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

Storybook 7 Upgrade - DCR #7513

Merged
merged 3 commits into from
Apr 26, 2023
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
13 changes: 4 additions & 9 deletions dotcom-rendering/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ module.exports = {
// used in composition
buildStoriesJson: true,
},
core: {
builder: 'webpack5',
},
stories: [
'../src/**/*.stories.@(tsx)',
'../stories/**/*.stories.@(tsx)',
Expand Down Expand Up @@ -60,7 +57,6 @@ module.exports = {
process: '{}',
}),
);

return config;
},
env: (config) => ({
Expand All @@ -69,8 +65,11 @@ module.exports = {
// See: https://storybook.js.org/docs/react/configure/environment-variables
CI: 'true',
}),
framework: {
name: '@storybook/react-webpack5',
options: {},
},
};

const webpackConfig = (config) => {
const rules = config.module.rules;

Expand All @@ -87,7 +86,6 @@ const webpackConfig = (config) => {
config.resolve.alias[
path.resolve(__dirname, '../src/web/components/SecureSignup.tsx')
] = path.resolve(__dirname, '../__mocks__/SecureSignupMock.tsx');

const webpackLoaders = getLoaders('modern');
// https://swc.rs/docs/usage/swc-loader#with-babel-loader
if (webpackLoaders[0].loader.startsWith('swc')) {
Expand All @@ -111,14 +109,11 @@ const webpackConfig = (config) => {
test: /\.svg$/,
use: ['desvg-loader/react', 'svg-loader'],
});

config.resolve.modules = [
...((config && config.resolve && config.resolve.modules) || []),
];

config.resolve.alias = {
...config.resolve.alias,
};

return config;
};
24 changes: 12 additions & 12 deletions dotcom-rendering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"cypress:open:percy": "percy exec -- cypress open --e2e --browser electron --config specPattern='cypress/snapshot/**/*'",
"cypress:run:percy": "percy exec -- cypress run --config specPattern='cypress/snapshot/**/*'",
"unused-exports": "yarn ts-unused-exports ./tsconfig.json --ignoreFiles='(/(fixtures|__mocks__)/|.+\\.(stories|mocks))' --exitWithCount",
"storybook": "start-storybook -p 4002",
"build-storybook": "node --max-old-space-size=4096 $(yarn bin)/build-storybook",
"storybook": "storybook dev -p 4002",
"build-storybook": "node --max-old-space-size=4096 $(yarn bin)/storybook build",
"makeBuild": "NODE_ENV=production CI_ENV=github webpack --config ./scripts/webpack/webpack.config.js",
"cdk:build": "tsc -p ./tsconfig.cdk.json",
"cdk:synth": "cdk synth --path-metadata false --version-reporting false",
Expand Down Expand Up @@ -83,16 +83,15 @@
"@percy/cypress": "^3.1.2",
"@sentry/browser": "^7.35.0",
"@sentry/integrations": "^7.35.0",
"@storybook/addon-essentials": "^6.4.0",
"@storybook/addons": "^6.4.0",
"@storybook/api": "^6.4.0",
"@storybook/builder-webpack5": "^6.4.0",
"@storybook/components": "^6.4.0",
"@storybook/core-events": "^6.4.0",
"@storybook/manager-webpack5": "^6.4.0",
"@storybook/react": "^6.4.0",
"@storybook/testing-library": "^0.0.13",
"@storybook/theming": "^6.4.0",
"@storybook/addon-essentials": "^7.0.1",
"@storybook/addons": "^7.0.1",
"@storybook/api": "^7.0.1",
"@storybook/components": "^7.0.1",
"@storybook/core-events": "^7.0.1",
"@storybook/react": "^7.0.1",
"@storybook/react-webpack5": "^7.0.1",
"@storybook/testing-library": "^0.0.14-next.2",
"@storybook/theming": "^7.0.1",
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.38",
"@swc/jest": "^0.2.24",
Expand Down Expand Up @@ -243,6 +242,7 @@
"source-map": "^0.7.4",
"source-map-support": "^0.5.21",
"start-server-and-test": "^1.12.1",
"storybook": "^7.0.1",
"storybook-addon-turbo-build": "^1.0.0-beta.0",
"stylelint": "^14.16.1",
"stylelint-config-standard": "^29.0.0",
Expand Down
Loading