tup-js
v0.0.1
Published
ThredUP JavaScript packages
Readme
tup-js
ThredUP JavaScript Packages
About
This is intended to be a monorepo of small, independantly versioned packages that are shared across applications.
Lerna is used to attempt to optimize this workflow.
Getting Started
Install and link dependencies:
npm run bootstrapAdding a new package
- Add a new directory for the package under
packages - Follow common directory conventions:
src- all the source code for the packagedist- build outputtest- unit tests
- Provde common npm scripts:
lint- eslint rules are pre-configured at the project roottest- run unit teststest-ci- run unit tests with code coverage and output test resuls in JUnit format for CIclean- delete build artifactscover- code coveragecover:check- check if code coverage is within tolerancebuild- run babel compilation, if requiredprepare- run lint, test, clean, and build
Commit messages
Please use convential commits to help communicate the nature of changes, generate the changelog and for determining the version bump.
Publishing a package
Get your PR reviewed/merged
Locally update your master branch
git pull origin masterPublish new version of the packages to npm
- without 2FA enabled
npm run publish- with 2FA enabled
If your npm login has 2FA enabled, use your authenticator app to get a 2FA code and set as an environment variable:
NPM_CONFIG_OTP=12345 npm run publishPush your local master branch to origin
git push origin master
Other commands
Run tests for all packages
npm testRun linter for all packages
npm run lintRun code coverage for all packages
npm run coverRemove node_modules for all packages
npm run cleanBuild all packages
npm run build