Creating a new package
Create GitHub repository#
GitHub has a generous free plan which allows us to create private repositories, run a CI/CD environment, and host private NPM packages. The first step for our new component library is to create a private GitHub repository.
Use your GitHub username
If your company uses GitHub you may create this package under their organization when creating a component library for production
Make sure the repository is listed as
README / .gitignore
Provide a default
READMEas well as the
Once the repository is created, let's clone it to our machine.
When the repository is finished cloning, open it in your editor of choice. You should see the
.gitignore we defined in the previous step.
Initialize the package#
To help the initial package creation we will use the npm-init command.
You will see a new
package.json with its values pre-populated to match our repository. Let's update the name of the package to include our GitHub account as a scope: