- Git clone this product
- Make changes in the relevant package under
./packages
- Push to the GitHub repository
- Run
lerna publish
to publish changes
- Fork this project
- Make changes to the relevant packages under
./packages
- Push to your own
master
branch - Create a merge request
Create a directory inside the ./packages
directory:
mkdir -p ./packages/package-name
Go into the package and initialise an NPM package:
cd ./packages/package-name;
npm init -f
Open the generated package.json
file and:
- Prefix the
.name
property with@mcf/
. - Replace the
.main
property with"dist/index.js"
- Copy and paste the following properties in to quickly get started for a package in ES6:
"scripts": {
"build": "npx babel --presets=env src --out-dir dist --ignore '*.test.js' ",
"lint": "npx eslint -c ../../.eslintrc.json .",
"test:watch": "npx mocha --watch --require babel-register \"src/*.test.js\" \"src/**/*.test.js\" ",
"test": "npx mocha --require babel-register \"dist/*.test.js\" \"dist/**/*.test.js\"",
"pretest": "cd ./src && find ./ -name '*.test.js' | cpio -pdm ../dist",
"posttest": "find ./dist -name '*.test.js' | xargs -I@ rm -rf @",
"prestart": "npm run build"
},
"publishConfig": {
"access": "public"
},
"private": false,
"babel": {
"presets": [
"env"
],
"ignore": [
"node_modules"
]
},
"repository": {
"type": "git",
"url": "https://github.com/GovTechSG/mcf-boilerplate-js.git"
},