Skip to content

Commit

Permalink
fix: add environment props for storybook IntentbaseProvider, add info…
Browse files Browse the repository at this point in the history
… in readme about aws secrets
  • Loading branch information
Jozwiaczek committed Dec 8, 2020
1 parent 6ba5521 commit c2788de
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { IntentbaseProvider } from '../src/providers/IntentbaseProvider';
export const decorators = [
(Story) => (
<IntentbaseProvider
environment={process.env.AWS_COGNITO_REGION || 'development'}
awsCognitoRegion={process.env.AWS_COGNITO_REGION}
awsCognitoUserPoolId={process.env.AWS_COGNITO_USER_POOL_ID}
awsCognitoUserPoolWebClientId={process.env.AWS_COGNITO_USER_POOL_CLIENT_ID}
Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ yarn install

Copy and paste .env.example into .env and fill all secrets.

| Secret | Description | Default |
| -------- | ------------------------- | ------- |
| NODE_ENV | Define current enviroment | - |
> _Important Note:_ AWS secrets must be filled before starting storybook.
| Secret | Description | Default |
| ------------------------------- | -------------------------- | --------- |
| NODE_ENV | Define current environment | - |
| AWS_COGNITO_REGION | | eu-west-1 |
| AWS_COGNITO_USER_POOL_ID | | - |
| AWS_COGNITO_USER_POOL_CLIENT_ID | | - |

### Running the app

Expand All @@ -64,8 +69,8 @@ To run script, in terminal type `yarn {script}`.

| Script | Description | Note |
| -------------- | --------------------------------------- | ------------------------------------------ |
| `prepublish` | Builds components | It runs automatically before every publish |
| `preinstall` | Checks is yarn was used package manager | It runs automatically before every install |
| `prebuild` | Runs yarn clean | It runs automatically before every build |
| `start` | Starts app locally | |
| `clean` | Removes build directory if it exists | |
| `build` | Builds app | |
Expand All @@ -86,4 +91,7 @@ npm publish --access=public
## Useful docs

- [Create React App](https://github.com/facebook/create-react-app)
- [React Admin](https://marmelab.com/react-admin/Readme.html)
- [AWS Amplify Auth](https://docs.amplify.aws/lib/auth/getting-started/q/platform/js)
- [Styled-components](https://styled-components.com/docs)
- [Storybook](https://storybook.js.org/docs/react/get-started/introduction)
- [Docusaurus](https://v2.docusaurus.io/docs/)

0 comments on commit c2788de

Please sign in to comment.