Skip to content

morristech/github-graphql-template

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github-graphql-template

A step by step guide to creating bit Scope for GitHub’s GraphQL API like this one: https://bitsrc.io/giladshoham/github-graphql

From this Scope, any user can easily install these components using NPM or import them into their own projects using Bit to quickly modify them to suit their own use case.

1. Generate GitHub access token

To run this project you will have to generate a github token to access GitHub’s API.
creating-a-personal-access-token-for-the-command-line

Then, copy the generated token into ./src/App.js instead of the 'YOUR TOEKN HERE' string.

2. Running the project

npm i
npm start

Workflow

This project is based on simple create react app. Make sure to run npm install before starting the process.

Also, please create a user and a free Scope with Bit. You can learn more about Bit in this getting started guide.

  1. First, let’s install Bit.
$ npm install bit-bin -g
  1. Let’s initialize Bit for the project.
$ cd github-graphql-template 
$ bit init
  1. Let’s add the components to be tracked by Bit.
$ bit add src/*/*  -t src/{PARENT}/{FILE_NAME}.spec.js  # use a glob pattern to track multiple components in the same path or a single path to track a single component.
  1. Let’s add build and test environments. Here is an example.
$ bit import bit.envs/compilers/react -c
the following component environments were installed
- bit.envs/compilers/react@0.0.7

$ bit import bit.envs/testers/mocha -t
the following component environments were installed
- bit.envs/testers/jest@0.0.7
  1. Now let’s lock a version and isolate the components from the project.
bit tag --all 1.0.0
  1. Now let’s share the components to a remote Scope.
$ bit export username.scopename  # Share components to this Scope

Note that using the --eject flag you can also remove an exported component from your source-code and add it as a package dependency in your project’s package.json file.

That’s it. You can now install the components using your favorite package manager, or use bit import to bring their source code into any repository, make changes and sync them across your codebase.

About

A template project to create the same components described here: https://bitsrc.io/giladshoham/github-graphql

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 85.2%
  • HTML 11.6%
  • CSS 3.2%