|
| 1 | +# effect |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +[](https://lerna.js.org/) |
| 6 | + |
| 7 | +## Getting started |
| 8 | + |
| 9 | +```sh |
| 10 | +$ npm i -g lerna # >= 3.19.0 |
| 11 | +$ npm i -g yarn@1 # <= 2.0.0 |
| 12 | +``` |
| 13 | + |
| 14 | +```sh |
| 15 | +# install all dependencies |
| 16 | +$ yarn |
| 17 | + |
| 18 | +# create a config file |
| 19 | +$ cd packages/<package-name> |
| 20 | +$ formula config # select `formula.config|h5-app.js` |
| 21 | + |
| 22 | +# running specified package |
| 23 | +$ formula dev -d packages/<package-name> |
| 24 | +``` |
| 25 | + |
| 26 | +## How to develop |
| 27 | + |
| 28 | +### Create a new package |
| 29 | + |
| 30 | +```sh |
| 31 | +$ lerna create <package-name> |
| 32 | + |
| 33 | +$ cd <path-to-package-name> |
| 34 | + |
| 35 | +# each package should has it's own config file |
| 36 | +$ formula config # select `formula.config|h5-app.js` |
| 37 | +``` |
| 38 | + |
| 39 | +🌟**NOTICE:** |
| 40 | + |
| 41 | +Please keep in mind when created a new package, DO NOT FORGET to specify the `category` field into package.json. It's important for deploy stage in CI pipeline when to build app resources. |
| 42 | + |
| 43 | +```json |
| 44 | +{ |
| 45 | + "category": "vue-app", |
| 46 | +} |
| 47 | +``` |
| 48 | + |
| 49 | +### Develop |
| 50 | + |
| 51 | +In order to let CI known which package to build, it is required to specify `<package-name>` in branch name |
| 52 | + |
| 53 | +```sh |
| 54 | +# branch pattern: `<package-name>/<feature-name>` |
| 55 | + |
| 56 | +$ git checkout -b <package-name>/add-new-feature |
| 57 | +``` |
| 58 | + |
| 59 | +We have a package named `shared` to shared some logic and files cross packages, |
| 60 | +you can \`install\` this package as dependency like usual by using `lerna add` command |
| 61 | + |
| 62 | +```sh |
| 63 | +$ cd <path-to-package-name> |
| 64 | + |
| 65 | +$ lerna add shared |
| 66 | +``` |
| 67 | + |
| 68 | +After linking `shared` library, you can use it in package like following: |
| 69 | + |
| 70 | +```js |
| 71 | +import setup from 'shared/setup' |
| 72 | +``` |
| 73 | + |
| 74 | +### Release |
| 75 | + |
| 76 | +```sh |
| 77 | +$ git checkout master |
| 78 | +$ git add . |
| 79 | +$ git commit -m 'feat: initial commit' |
| 80 | + |
| 81 | +# before running the following command |
| 82 | +# ensure that working directory is clean |
| 83 | +$ lerna version |
| 84 | +``` |
| 85 | + |
| 86 | +## ReDS 基础组件 |
| 87 | +https://fe-docs.devops.xiaohongshu.com/reds-web/guide/start |
| 88 | + |
| 89 | +## Onix 组件市场 |
| 90 | +https://fe-docs.devops.xiaohongshu.com/onix/onix-readme# vue3---- |
0 commit comments