Skip to content

Commit

Permalink
feat: use lerna hoisting for fast monorepo bootstrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
zone117x committed May 11, 2021
1 parent 953c820 commit cfd76ab
Show file tree
Hide file tree
Showing 30 changed files with 5,845 additions and 68,608 deletions.
6 changes: 4 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module.exports = {
root: true,
parser: '@typescript-eslint/parser',
reportUnusedDisableDirectives: true,
extends: '@stacks/eslint-config',
plugins: ['@typescript-eslint', 'node'],
extends: ['@stacks/eslint-config', 'plugin:import/typescript'],
plugins: ['@typescript-eslint', 'node', 'import'],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./packages/**/tsconfig.json', './tsconfig.json'],
Expand All @@ -29,5 +29,7 @@ module.exports = {
'@typescript-eslint/no-non-null-assertion': [0],

'node/prefer-global/buffer': ['error', 'never'],

'import/no-extraneous-dependencies': ['error'],
},
};
2 changes: 0 additions & 2 deletions .github/workflows/stacks-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: stacks.js

on:
push:
branches:
- 'master'
pull_request:

jobs:
Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ See `README` in each package directory for installation instructions and usage.

To migrate your app from blockstack.js to stacks.js follow the steps in the [migration guide](https://github.com/blockstack/stacks.js/tree/master/migration-guide.md).

## Development environment setup
## Development: environment setup

To setup the development environment for this repository, follow these steps:

Expand All @@ -30,6 +30,23 @@ To setup the development environment for this repository, follow these steps:
4. Run `npm run build` to build packages
5. Run `npm run test` to run tests

## Development: adding dependencies

This repo uses Lerna [hoisting](https://github.com/lerna/lerna/blob/main/doc/hoist.md) for package dependencies.

In order to install a new dependency to a package, the [`lerna add`](https://github.com/lerna/lerna/tree/main/commands/add) command must be used, rather than `npm install <package>`.

For example, the following command installs `lodash` as a dependency to the `@stacks/storage` package:
```shell
# Run within the root directory
npm run lerna -- add lodash --scope @stacks/storage
```

Add `--dev` to install as a development dependency:
```shell
npm run lerna -- add lodash --scope @stacks/storage --dev
```

## Documentation

Documentation for Stacks tooling is located [here](https://docs.blockstack.org/).
Expand Down
9 changes: 8 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,12 @@
},
"packages": [
"packages/*"
]
],
"command": {
"bootstrap": {
"forceLocal": true,
"hoist": true,
"npmClientArgs": ["--ci"]
}
}
}

0 comments on commit cfd76ab

Please sign in to comment.