Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#83 Updated storybook to show HTML source. #87

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .storybook/addon-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ exports.default = function () {
},
},
'@storybook/addon-links',
'@whitespace/storybook-addon-html',
];

// Html and pseudo knobs.
Expand Down
7 changes: 7 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,11 @@ export const parameters = {
},
},
},
html: {
prettier: {
tabWidth: 4,
useTabs: false,
htmlWhitespaceSensitivity: 'strict',
},
},
};
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"dist:dev": "export NODE_OPTIONS=--openssl-legacy-provider && webpack --config ./webpack/webpack.dev.js",
"test": "npm run test-storybook:ci",
"test-storybook": "test-storybook",
"test-storybook:ci": "concurrently --kill-others --success first --names \"SB,TEST\" --prefix-colors \"magenta,blue\" \"npx http-server storybook-static --port 6006 -a 127.0.0.1 --silent\" \"wait-on --timeout 10000 http://127.0.0.1:6006 && npm run test-storybook\""
"test-storybook:ci": "concurrently --kill-others --success first --names \"SB,TEST\" --prefix-colors \"magenta,blue\" \"npx http-server storybook-static --port 6006 -a 127.0.0.1 --silent\" \"wait-on --timeout 10000 http://127.0.0.1:6006 && npm run test-storybook\"",
"postinstall": "npx patch-package"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
"engines": {
"node": ">=18.14"
Expand All @@ -49,6 +50,7 @@
"@storybook/addons": "^6.1.18",
"@storybook/html": "^6.3.8",
"@storybook/test-runner": "^0.16.0",
"@whitespace/storybook-addon-html": "^5.1.6",
"addon-screen-reader": "^1.8.6",
"babel-loader": "^8.2.2",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
Expand All @@ -70,8 +72,10 @@
"lorem-ipsum": "^2.0.4",
"mini-css-extract-plugin": "^1.6.2",
"node-sass-magic-importer": "^5.3.2",
"prettier": "^2.8.8",
"react": "^17",
"react-dom": "^17",
"react-syntax-highlighter": "^15.5.0",
"sass": "^1.41.0",
"sass-loader": "^10.2.0",
"semver": "^7.3.8",
Expand Down
19 changes: 19 additions & 0 deletions patches/@whitespace+storybook-addon-html+5.1.6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/node_modules/@whitespace/storybook-addon-html/preset.js b/node_modules/@whitespace/storybook-addon-html/preset.js
index aca6ca4..f23183d 100644
--- a/node_modules/@whitespace/storybook-addon-html/preset.js
+++ b/node_modules/@whitespace/storybook-addon-html/preset.js
@@ -1,7 +1,3 @@
-function config(entry = []) {
- return [...entry, require.resolve("./dist/esm/preset/preview")];
-}
-
function managerEntries(entry = []) {
return [...entry, require.resolve("./dist/esm/preset/manager")];
}
@@ -12,6 +8,5 @@ function previewAnnotations(entry = []) {

module.exports = {
managerEntries,
- config,
previewAnnotations,
};