This is document is targeted to Tangential developers. It describes how to perform a release, and how to publish the libraries to NPM.
If you have cloned Tangential in order to bootstrap your own 'Component Library' project, this will likely be of interest to you as well.
These steps have only been tested on MacOS. It will probably work on any 'nix variant. MS Windows with a developer 'nix shell is a distinct 'maybe'.
If you are cloning this project for your own devious purposes, see the Using this project as a bootstrap section, near the end.
1) Create a github access token https://github.com/settings/tokens and save it in a file named generate-changelog-token.local.txt
1) Clean and build the project successfully
Only perform a release from Master branch
-
You have no uncommitted code.
-
All changes intended for the release have already been merged to master.
-
Pull from origin/master
-
Run
gulp versionBump --lib [libName] -i preminor [--preid [alpha|beta|rc]] && git add .
-
For example
gulp versionBump --lib core -i preminor --preid beta && git add .
-
-i can take any of the semver values that
npm version
accepts ({major | minor | patch | premajor | preminor | prepatch | prerelease})
-
-
Verify the version number has been updated and that there are no other uncommitted changes.
-
Run
./generate-changelog.sh patch
-
This should only modify and
git add
the changelog file. -
Execute the additional steps that are printed out to the console.
-
-
Verify change log generated and that there are no uncommitted changes.
-
Run NPM publish steps, below.
The following require your npm user account credentials. Adding a local .npmrc
file with username=foo
and email=foo@example.com
can make this a bit nicer.
# sign out of your normal account
> npm logout
# Sign in to npm account
> npm login
> Username: (tangential)
> Password:
> Email: (this IS public) (you@example.com)
> Logged in as tangential on https://registry.npmjs.org/.
> npm run publish
As mentioned (somewhere), this project’s build structure was cloned from the Angular Material2. The clone was made prior to the Material team updating their build to deliver a single, monolithic NPM project, in line with the Angular2 project structure.
If you wish to release multiple components, but develop in a single project, this project would certainly be a good place to start. You will want to take a look at the procedures for 'scoped projects' in NPM, and create a user account that has the name you want to use for the parent project. For example, our project paths here are like '@tangential/scopedProjectNames', where 'tangential' is the npm 'user' name.