./packages
lerna publish
to publish changes./packages
master
branchCreate 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:
.name
property with @mcf/
..main
property with "dist/index.js"
"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"
},