Common typings & helper functions for all slate related Simplicity projects.
To release a new version:
- Before pushing, update the package's version in
package.json
. - Push your updates to
master
. - Go to GitHub & open the "Releases" section.
- Click "Draft a new release".
- Create a new tag identical to the new version you've updated in
package.json
. - Add a release title (in our case, the version).
- Press "publish"
After following these steps, the package should auto-deploy to our private NPM registry in our GH institution.
To use the package locally (and any other package from our private NPM registry on GitHub), you will need a Personal Access Token (PAT):
-
Go to GitHub & generate a PAT here.
- I'd recommend setting the access rights only to
read:packages
, as that would be the only one necessary to access the package.
- I'd recommend setting the access rights only to
-
Create/edit the
.npmrc
file with this content://npm.pkg.github.com/:_authToken=<YOUR_TOKEN_GOES_HERE> @simplicity-tech:registry=https://npm.pkg.github.com
- The
.npmrc
file should be in the project's.gitignore
.
- The
-
Add the dependency to your project's
package.json
'sdependencies
, e.g.:"@simplicity-tech/sim-slate-types": "1.1.0",
-
yarn
to install the dependency.
To make sure your GitHub workflow has access to our private NPM registry, you will need to modify a few things:
- Modify the node setup step to look like this:
- name: Install Node.js uses: actions/setup-node@v2 with: node-version: 14.x registry-url: 'https://npm.pkg.github.com' scope: '@simplicity-tech'
- Modify the installation step (or possibly any other step that needs access to the registry) to look like this:
The env variable name needs to be EXACTLY
- name: Install NPM packages run: yarn install env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN
. TheGITHUB_TOKEN
secret is passed automatically by the GitHub action.