Skip to content

Commit

Permalink
Update CONTRIBUTING.md with package generate info
Browse files Browse the repository at this point in the history
  • Loading branch information
anrusina authored Jun 2, 2022
1 parent 3287755 commit 43bf9ab
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,30 @@ a single module, you can specify that one specifically
(ex. `localStorage.debug = 'flyte:adminEntity'` to only see decoded Flyte
Admin API requests).

## Generate new package

To add a new package use a script

```bash
yarn generate:package
```

After new package is generated, you will need to update some values to be able to use it with other packages.
For example in case if package plan to be used in `console` app

Ensure to add proper webpack alias path resolutions into:
* ./storybook/main.js - as `'@flyteconsole/flyte-api': path.resolve(__dirname, '../packages/plugins/flyte-api/src’),`
* packages/zapp/console/webpack.common.config.ts to alias section - as `'@flyteconsole/flyte-api': path.resolve(__dirname, '../packages/plugins/flyte-api/src’),`

To add child package usage to other package, in parent package ->
* Add `{ "path": “../../${type}/${package-name}" }` to tsconfig.json
* Add `{ "path": “../../${type}/${package-name}/tsconfig.build.json" }` to tsconfig.build.json (if exists)
- Then you can import your changes as `import { getLoginUrl } from '@flyteconsole/flyte-api’;`

> If you see `yarn lint` package not defined issues update `.\eslintrc.js` by adding your package to
'import/core-modules': ['@clients/locale', '@clients/primitives', '@clients/theme'],


## Storybook

This project has support for [Storybook](https://storybook.js.org/).
Expand Down

0 comments on commit 43bf9ab

Please sign in to comment.