Add support for html stories

This commit is contained in:
Eric Schultz 2020-09-23 13:41:25 -05:00 committed by Eric Schultz
parent 7a11b88a92
commit 3aeae30957
6 changed files with 864 additions and 37 deletions

11
.storybook/html/main.js Normal file
View file

@ -0,0 +1,11 @@
// License: LGPL-3.0-or-later
module.exports = {
"stories": [
"../../app/javascript/**/*--html.stories.mdx",
"../../app/javascript/**/*--html.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials"
]
}

View file

@ -0,0 +1,4 @@
// License: LGPL-3.0-or-later
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
}

4
bin/bulid-html-storybook Executable file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env node
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
require('@storybook/html/dist/server/build');

3
bin/start-html-storybook Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env node
require('@storybook/html/dist/server');

View file

@ -11,8 +11,10 @@
"test": "rake -v spec && yarn build && yarn jest",
"jest": "jest",
"eslint": "eslint . --ext .ts,.js,.es6,.tsx",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
"storybook": "start-storybook -p 6006 -c .storybook/react",
"build-storybook": "build-storybook -c .storybook/react",
"html-storybook": "bin/start-html-storybook -p 6007 -c .storybook/html",
"build-html-storybook": "bin/build-html-storybook -c .storybook/html"
},
"devDependencies": {
"@babel/core": "^7.0.0",
@ -23,9 +25,11 @@
"@babel/preset-typescript": "^7.9.0",
"@rails/webpacker": "^5.1.1",
"@storybook/addon-actions": "^6.0.21",
"@storybook/addon-essentials": "^6.0.21",
"@storybook/addon-knobs": "^6.0.21",
"@storybook/addon-links": "^6.0.21",
"@storybook/addons": "^6.0.21",
"@storybook/html": "^6.0.21",
"@storybook/react": "^6.0.21",
"@testing-library/jest-dom": "^5.11.1",
"@testing-library/react": "^10.4.7",
@ -77,6 +81,7 @@
"object-hash": "^2.0.3",
"phantomjs-prebuilt": "^2.1.16",
"rails-erb-loader": "^5.5.2",
"react-is": "^16.13.1",
"react-test-renderer": "^16.13.1",
"resolve-url-loader": "^2.3.0",
"sass-loader": "^7.0.1",

870
yarn.lock

File diff suppressed because it is too large Load diff