Skip to content

Commit

Permalink
fix(storybook): nodejs-17+ requires webpack@5+ [1]
Browse files Browse the repository at this point in the history
  • Loading branch information
lkraav committed Feb 20, 2023
1 parent 7afba39 commit f0ecd9a
Show file tree
Hide file tree
Showing 9 changed files with 294 additions and 13 deletions.
1 change: 1 addition & 0 deletions packages/cxl-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"mark.js": "^8.11.1",
"postcss": "^8.2.4",
"postcss-preset-env": "^6.7.0",
"stream-browserify": "^3.0.0",
"subtitle": "^4.2.1"
},
"scripts": {
Expand Down
17 changes: 17 additions & 0 deletions packages/storybook/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = {
// @see https://github.com/storybookjs/storybook/issues/16555
core: {
builder: 'webpack5',
},
// @see https://github.com/storybookjs/storybook/issues/12307
stories: ['../**/*.stories.js'],
addons: [
Expand All @@ -8,4 +12,17 @@ module.exports = {
'@storybook/addon-storysource',
'@storybook/addon-viewport',
],
// @see https://stackoverflow.com/questions/61375674/upgrade-to-webpack-5-breaking-storybook-5
webpackFinal: (config) => {
return {
...config,
resolve: {
...config.resolve,
fallback: {
...config.fallback,
stream: require.resolve('stream-browserify'),
},
},
};
},
};
2 changes: 1 addition & 1 deletion packages/storybook/cxl-ui/cxl-paywall.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { html } from 'lit';
import { unsafeHTML } from 'lit/directives/unsafe-html';
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
import '../../cxl-ui/src/components/cxl-paywall';
import { loremIpsum } from 'lorem-ipsum';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { html } from 'lit';
import { unsafeHTML } from 'lit/directives/unsafe-html';
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
import '@conversionxl/cxl-ui/src/components/cxl-vaadin-accordion.js';
import '@conversionxl/cxl-ui/src/components/cxl-accordion-card.js';
import '@conversionxl/cxl-ui/src/components/cxl-save-favorite.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { html } from 'lit';
import { unsafeHTML } from 'lit/directives/unsafe-html';
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
import playbookStepData from './cxl-playbook-accordion.data.json';

export const CXLPlaybookAccordion = ({ FeedbackButtonLabel, PlaybookId }) => html`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { html } from 'lit';
import { unsafeHTML } from 'lit/directives/unsafe-html';
import { unsafeHTML } from 'lit/directives/unsafe-html.js';

const CxlSingleversionCardDisplay = (el, userId, selected) => {
const postType = el.cxl_hybrid_attr_post['@attributes'].class.includes(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { html } from 'lit';
import { unsafeHTML } from 'lit/directives/unsafe-html';
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
import '@conversionxl/cxl-ui/src/components/cxl-vaadin-accordion.js';
import faqData from './theme=cxl-faq.data.json';

Expand Down
4 changes: 4 additions & 0 deletions packages/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"@storybook/builder-webpack5": "^6.5.16",
"@storybook/manager-webpack5": "^6.5.16"
}
}
Loading

0 comments on commit f0ecd9a

Please sign in to comment.