- Recent Node and Npm installed. I currently use node v10.10.0 and npm v6.8.0
- Install yarn with
npm i -g yarn
- Install lerna with
npm i -g lerna
-
Install required packages with
yarn install
(Don't pay attention to unmet peer dependency warnings). -
Link the different packages with
lerna link
-
Go into the dev package. i.e.
cd packages/ibm-gantt-dev
-
Start dev examples
yarn start
Note: Build relies on gda-scripts that provides (kind of) webpack presets and useful scripts (sort of create-react-app for libraries).
-
Bump version of all packages with
lerna version
(necessary before building to inject the proper version number) -
Build all packages
lerna run build:all
-
Publish all packages
lerna publish from-package --no-git-reset
This projects follows a quite opinionated convention for formatting and linting. But don't worry, it's all automatic.
Use yarn check:fix
to properly format your code and fix common issues (i.e. missing , ou ;) or yarn check:list
to only list issues.
Note: a pre-commit script will enforce formatting and linting.
Recommended extensions for VS Code
Use the following extensions to automatically format files on save and display linting errors. Import sorting is manually triggered on alt+command+o
- ESLint dbaeumer.vscode-eslint
- stylelint shinnn.stylelint
- Prettier - Code formatter esbenp.prettier-vscode
- sort-imports amatiasq.sort-imports
You may use the following settings to configure the extensions:
{
"editor.formatOnSave": true,
"editor.rulers": [120],
"editor.tabSize": 2,
"javascript.validate.enable": false,
"eslint.autoFixOnSave": true,
"stylelint.enable": true,
"css.validate": false,
"less.validate": false,
"scss.validate": false,
"prettier.eslintIntegration": true,
"prettier.stylelintIntegration": true,
"prettier.printWidth": 120,
"prettier.singleQuote": true,
"prettier.trailingComma": "es5",
"sort-imports.on-save": false
}
[
{
"key": "alt+cmd+o",
"command": "sort-imports.sort"
}
]