diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 34d40bfeb..219f2aff3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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/).