Mindhive Packages
Monorepo for our NPM packages using Lerna and with inspiration from Bable and Jest
Getting started
- First thing run
yarn bootstrap
to install npm dependencies, compile build scripts and build any packages
Basics
-
yarn new <package>
creates a new package -
yarn build
builds all packages notignored
-
yarn clean:build
deletes all compiled packages -
yarn clean:all
runsclean:build
then deletes allnode_modules
for all packages and the project -
yarn pub
not implemented yet....
Commands
in root dir
-
yarn bootstrap
will:- Clean any compiled code and npm packages
- Install all project and sub package npm dependencies
- Compile build scripts from ES6 source
- Compile all packages
-
yarn new package-name
:- Creates
src/packages/package-name
- Copies
./init/default-package
->./packages/package-name
- Runs
npm init
in./packages/package-name
pulling default values from./init/npm-init.js
- Creates
-
yarn build
buildssrc/packages/*
->./packages/*
- runs the
build.js
script - Iterates over
packages
building each in turn - No need to update EVERY package if we change our build :)
-
mhpconfig,json
sets packages toignore
- runs the
-
yarn test
runs thetest
script in each package- By default, all test scripts point to
./scripts/test.sh
- No need to update EVERY package if we change our build :)
- By default, all test scripts point to
-
yarn clean:build
removes all./packages/*
-
yarn clean:all
removes all./node_modules
&&./src/packages/*/node_modules
and runsclean:build
mhpconfig.json
{
"mindhive-packages": "0.0.1",
"ignore": [
"documents",
"richtext",
"styles"
],
"sourcePath": "./src/packages",
"outPath": "./packages",
"registry": "https://registry.npmjs.org/",
}
Structure
root
|-compiled_scripts .... DON'T EDIT, see src/scripts
|-init .... template/defaults for new package
|-packages .... our COMPILED npm packages
|-src
|-- scripts .... scripts ES6 source
|-- packages .... packages ES6 source