Skip to content

Commit

Permalink
feat(addon-storybook): add storybook addon and typescript 3.7 support
Browse files Browse the repository at this point in the history
* chore(deps): bump @babel/core from 7.6.4 to 7.7.0

Bumps [@babel/core](https://github.com/babel/babel) from 7.6.4 to 7.7.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](babel/babel@v7.6.4...v7.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps-dev): bump @semantic-release/npm from 5.3.2 to 5.3.4

Bumps [@semantic-release/npm](https://github.com/semantic-release/npm) from 5.3.2 to 5.3.4.
- [Release notes](https://github.com/semantic-release/npm/releases)
- [Commits](semantic-release/npm@v5.3.2...v5.3.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump node-sass from 4.12.0 to 4.13.0

Bumps [node-sass](https://github.com/sass/node-sass) from 4.12.0 to 4.13.0.
- [Release notes](https://github.com/sass/node-sass/releases)
- [Changelog](https://github.com/sass/node-sass/blob/master/CHANGELOG.md)
- [Commits](sass/node-sass@v4.12.0...v4.13.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps-dev): bump semantic-release from 15.13.28 to 15.13.30

Bumps [semantic-release](https://github.com/semantic-release/semantic-release) from 15.13.28 to 15.13.30.
- [Release notes](https://github.com/semantic-release/semantic-release/releases)
- [Commits](semantic-release/semantic-release@v15.13.28...v15.13.30)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump @babel/preset-typescript from 7.6.0 to 7.7.0

Bumps [@babel/preset-typescript](https://github.com/babel/babel) from 7.6.0 to 7.7.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](babel/babel@v7.6.0...v7.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump @babel/preset-react from 7.6.3 to 7.7.0

Bumps [@babel/preset-react](https://github.com/babel/babel) from 7.6.3 to 7.7.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](babel/babel@v7.6.3...v7.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump @typescript-eslint/parser from 2.6.0 to 2.6.1

Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.6.1/packages/parser)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump @babel/register from 7.6.2 to 7.7.0

Bumps [@babel/register](https://github.com/babel/babel) from 7.6.2 to 7.7.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](babel/babel@v7.6.2...v7.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump @typescript-eslint/eslint-plugin from 2.6.0 to 2.6.1

Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.6.1/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump eslint-config-prettier from 6.4.0 to 6.5.0

Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 6.4.0 to 6.5.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/master/CHANGELOG.md)
- [Commits](prettier/eslint-config-prettier@v6.4.0...v6.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump typescript from 3.6.4 to 3.7.2

Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.6.4 to 3.7.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump @types/webpack from 4.39.4 to 4.39.8

Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.39.4 to 4.39.8.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump @testing-library/react from 9.3.1 to 9.3.2

Bumps [@testing-library/react](https://github.com/testing-library/react-testing-library) from 9.3.1 to 9.3.2.
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/master/CHANGELOG.md)
- [Commits](testing-library/react-testing-library@v9.3.1...v9.3.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump @babel/preset-env from 7.6.3 to 7.7.1

Bumps [@babel/preset-env](https://github.com/babel/babel) from 7.6.3 to 7.7.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](babel/babel@v7.6.3...v7.7.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump @types/jest from 24.0.21 to 24.0.22

Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 24.0.21 to 24.0.22.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump copy-webpack-plugin from 5.0.4 to 5.0.5

Bumps [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin) from 5.0.4 to 5.0.5.
- [Release notes](https://github.com/webpack-contrib/copy-webpack-plugin/releases)
- [Changelog](https://github.com/webpack-contrib/copy-webpack-plugin/blob/master/CHANGELOG.md)
- [Commits](webpack-contrib/copy-webpack-plugin@v5.0.4...v5.0.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump @types/react-dom from 16.9.3 to 16.9.4

Bumps [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) from 16.9.3 to 16.9.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump core-js from 3.3.6 to 3.4.0

Bumps [core-js](https://github.com/zloirock/core-js) from 3.3.6 to 3.4.0.
- [Release notes](https://github.com/zloirock/core-js/releases)
- [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
- [Commits](zloirock/core-js@v3.3.6...v3.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump react-hot-loader from 4.12.15 to 4.12.16

Bumps [react-hot-loader](https://github.com/gaearon/react-hot-loader) from 4.12.15 to 4.12.16.
- [Release notes](https://github.com/gaearon/react-hot-loader/releases)
- [Changelog](https://github.com/gaearon/react-hot-loader/blob/master/CHANGELOG.md)
- [Commits](gaearon/react-hot-loader@v4.12.15...v4.12.16)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump @hot-loader/react-dom from 16.10.2 to 16.11.0

Bumps [@hot-loader/react-dom](https://github.com/hot-loader/react-dom) from 16.10.2 to 16.11.0.
- [Release notes](https://github.com/hot-loader/react-dom/releases)
- [Commits](https://github.com/hot-loader/react-dom/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump @babel/preset-typescript from 7.7.0 to 7.7.2

Bumps [@babel/preset-typescript](https://github.com/babel/babel) from 7.7.0 to 7.7.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](babel/babel@v7.7.0...v7.7.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump @babel/core from 7.7.0 to 7.7.2

Bumps [@babel/core](https://github.com/babel/babel) from 7.7.0 to 7.7.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](babel/babel@v7.7.0...v7.7.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps-dev): bump @semantic-release/commit-analyzer

Bumps [@semantic-release/commit-analyzer](https://github.com/semantic-release/commit-analyzer) from 6.3.2 to 6.3.3.
- [Release notes](https://github.com/semantic-release/commit-analyzer/releases)
- [Commits](semantic-release/commit-analyzer@v6.3.2...v6.3.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump fork-ts-checker-webpack-plugin from 3.0.1 to 3.1.0

Bumps [fork-ts-checker-webpack-plugin](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin) from 3.0.1 to 3.1.0.
- [Release notes](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/releases)
- [Changelog](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/blob/master/CHANGELOG.md)
- [Commits](TypeStrong/fork-ts-checker-webpack-plugin@v3.0.1...v3.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* chore(deps): bump prettier from 1.18.2 to 1.19.0

Bumps [prettier](https://github.com/prettier/prettier) from 1.18.2 to 1.19.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](prettier/prettier@1.18.2...1.19.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* feat(addons): add storybook addon and docs

* chore(deps): bumps package.json versions

* chore(deps): yarn.lock update

* docs(readme.md): change link to storybook addon to its folder
  • Loading branch information
HorusGoul committed Nov 9, 2019
1 parent 594a1ce commit 924443b
Show file tree
Hide file tree
Showing 5 changed files with 555 additions and 442 deletions.
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -7,3 +7,12 @@ Run CRA like this:
```
create-react-app --scripts-version horus-react-scripts AppName
```

## Addons

Addons are helpers that allow other tools to use HRS configuration. Currently, this is the list of addons
directly supported:

- [Storybook](./addons/storybook)

If you need support for a tool that isn't listed here or you found some issues using any of the existing addons, please submit an issue or create a PR.
22 changes: 22 additions & 0 deletions addons/storybook/README.md
@@ -0,0 +1,22 @@
# Storybook

You can connect Storybook's Webpack Configuration to ours just by creating a `.storybook/webpack.config.js` file in your project and putting this inside:

```js
module.exports = require('horus-react-scripts/addons/storybook/webpack.config');
```

Alternatively, you can do the same by copy-pasting the code located in [`webpack.config.js`](./webpack.config.js) inside your project's `.storybook/webpack.config.js`, and after that, changing the path that points to the HRS' Webpack Configuration to `horus-react-scripts/config/webpack.config.entry`.

Remember to also follow the [Storybook for React Guide](https://storybook.js.org/docs/guides/guide-react/#manual-setup) to complete your setup.

**You don't need to add react, react-dom @babel/core or babel-loader as these are already handled by `horus-react-scripts`**

## After ejecting

If you decide to eject, you'll need to do two things:

1. First, copy-paste the configuration from this folder as we explained earlier
2. Then replace the path to your project's webpack config from `horus-react-scripts/config/webpack.config.entry` to something like `../config/webpack.config.entry` (may vary depeding on your project's folder structure)

Now everything should continue working just like before ejecting 🎉
23 changes: 23 additions & 0 deletions addons/storybook/webpack.config.js
@@ -0,0 +1,23 @@
const createWebpackConfig = require('../../config/webpack.config.entry')
.default;

module.exports = async ({ config, mode }) => {
const projectConfig = createWebpackConfig(
mode === 'PRODUCTION' ? 'production' : 'dev',
);

const excludedPlugins = config.plugins.map(plugin => plugin.constructor.name);

return {
...config,
context: projectConfig.context,
resolve: projectConfig.resolve,
module: projectConfig.module,
plugins: [
...config.plugins,
...projectConfig.plugins.filter(plugin => {
return !excludedPlugins.includes(plugin.constructor.name);
}),
],
};
};
69 changes: 35 additions & 34 deletions package.json
Expand Up @@ -15,7 +15,8 @@
"bin",
"config",
"scripts",
"templates"
"templates",
"addons"
],
"bugs": {
"url": "https://github.com/HorusGoul/horus-react-scripts/issues"
Expand All @@ -27,42 +28,42 @@
"semantic-release": "semantic-release"
},
"dependencies": {
"@babel/core": "^7.6.4",
"@babel/preset-env": "^7.6.3",
"@babel/preset-react": "^7.6.3",
"@babel/preset-typescript": "^7.6.0",
"@babel/register": "^7.6.2",
"@hot-loader/react-dom": "^16.10.2",
"@babel/core": "^7.7.2",
"@babel/preset-env": "^7.7.1",
"@babel/preset-react": "^7.7.0",
"@babel/preset-typescript": "^7.7.2",
"@babel/register": "^7.7.0",
"@hot-loader/react-dom": "^16.11.0",
"@nice-labs/typed-css-modules": "^1.2.1",
"@svgr/webpack": "^4.3.3",
"@testing-library/react": "^9.3.0",
"@types/jest": "^24.0.19",
"@types/react": "^16.9.6",
"@types/react-dom": "^16.9.2",
"@types/webpack": "^4.39.3",
"@testing-library/react": "^9.3.2",
"@types/jest": "^24.0.22",
"@types/react": "^16.9.11",
"@types/react-dom": "^16.9.4",
"@types/webpack": "^4.39.8",
"@types/workbox-sw": "^4.2.1",
"@typescript-eslint/eslint-plugin": "^2.4.0",
"@typescript-eslint/parser": "^2.4.0",
"autoprefixer": "^9.6.5",
"@typescript-eslint/eslint-plugin": "^2.6.1",
"@typescript-eslint/parser": "^2.6.1",
"autoprefixer": "^9.7.1",
"babel-jest": "^24.9.0",
"babel-loader": "^8.0.6",
"camelcase": "^5.3.1",
"command-exists": "^1.2.8",
"copy-dir": "^1.2.0",
"copy-template-dir": "^1.4.0",
"copy-webpack-plugin": "^5.0.4",
"core-js": "^3.3.2",
"copy-webpack-plugin": "^5.0.5",
"core-js": "^3.4.0",
"cross-env": "^6.0.3",
"cross-spawn": "^7.0.1",
"css-loader": "^3.2.0",
"dotenv": "^8.2.0",
"eslint": "^6.5.1",
"eslint-config-prettier": "^6.4.0",
"eslint": "^6.6.0",
"eslint-config-prettier": "^6.5.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-react": "^7.16.0",
"eslint-plugin-react-hooks": "^2.1.2",
"eslint-plugin-react-hooks": "^2.2.0",
"file-loader": "^4.2.0",
"fork-ts-checker-webpack-plugin": "^3.0.1",
"fork-ts-checker-webpack-plugin": "^3.1.0",
"html-webpack-plugin": "^3.2.0",
"husky": "^3.0.9",
"identity-obj-proxy": "^3.0.0",
Expand All @@ -73,24 +74,24 @@
"lint-staged": "^9.4.2",
"mini-css-extract-plugin": "^0.8.0",
"minireset.css": "^0.0.6",
"node-sass": "^4.12.0",
"node-sass": "^4.13.0",
"postcss-loader": "^3.0.0",
"postcss-pxtorem": "^4.0.1",
"prettier": "^1.18.2",
"react-hot-loader": "^4.12.15",
"prettier": "^1.19.0",
"react-hot-loader": "^4.12.16",
"regenerator-runtime": "^0.13.3",
"sass-loader": "^8.0.0",
"sass-mq": "^5.0.1",
"style-loader": "^1.0.0",
"terser-webpack-plugin": "^2.1.3",
"ts-loader": "^6.2.0",
"typescript": "^3.6.4",
"webpack": "^4.41.1",
"webpack-bundle-analyzer": "^3.5.2",
"terser-webpack-plugin": "^2.2.1",
"ts-loader": "^6.2.1",
"typescript": "^3.7.2",
"webpack": "^4.41.2",
"webpack-bundle-analyzer": "^3.6.0",
"webpack-chunk-hash": "^0.6.0",
"webpack-cleanup-plugin": "^0.5.1",
"webpack-cli": "^3.3.9",
"webpack-dev-server": "^3.8.2",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.9.0",
"webpack-merge": "^4.2.2",
"workbox-webpack-plugin": "^5.0.0-rc.0"
},
Expand All @@ -100,14 +101,14 @@
},
"devDependencies": {
"@semantic-release/changelog": "^3.0.5",
"@semantic-release/commit-analyzer": "^6.3.2",
"@semantic-release/commit-analyzer": "^6.3.3",
"@semantic-release/github": "^5.5.5",
"@semantic-release/npm": "^5.3.2",
"@semantic-release/npm": "^5.3.4",
"@semantic-release/release-notes-generator": "^7.3.2",
"commitizen": "^4.0.3",
"create-react-app": "^3.2.0",
"cz-conventional-changelog": "3.0.2",
"semantic-release": "^15.13.27"
"semantic-release": "^15.13.30"
},
"config": {
"commitizen": {
Expand Down

0 comments on commit 924443b

Please sign in to comment.