@stridekick/scripts
v1.0.4
Published
A collection of npm scripts
Downloads
15
Keywords
Readme
@stridekick/scripts
A collection of npm scripts
Table of Contents
Installation
npm install --save @stridekick/scripts
Scripts
setNpmrc
In order to gain access to private npm modules, a local .npmrc
file is created pointing to the npmjs repository with an approved token.
This function creates a .npmrc
file with //registry.npmjs.org/:_authToken=${REACT_APP_NPM_TOKEN}
as the contents.
The build will replace REACT_APP_NPM_TOKEN
with the actual token.
Usage
Add an
heroku-prebuild
npm script (see example)Set the
REACT_APP_NPM_TOKEN
environment variable in Heroku to an approved token.
Example (within package.json
)
"scripts": {
"heroku-prebuild": "node node_modules/@stridekick/scripts/dist/setNpmrc.js"
}
Publishing
To publish updates to the npm repository:
Push all code changes to the code repository
npm install
Perform one of the following:
npm run publish:patch
- {major}.{minor}.{patch +1}npm run publish:minor
- {major}.{minor + 1}.0npm run publish:major
- {major + 1}.0.0