Skip to content

Commit

Permalink
Merge branch 'next' of github.com:storybookjs/storybook into revert-2…
Browse files Browse the repository at this point in the history
…4832-revert-24676-experiment-addon-peer-dep
  • Loading branch information
JReinhold committed Nov 15, 2023
2 parents c5cddf6 + e559a1e commit 9b33681
Show file tree
Hide file tree
Showing 166 changed files with 735 additions and 657 deletions.
5 changes: 2 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ jobs:
at: .
- run:
name: Starting Event Collector
command: yarn ts-node ./event-log-collector.ts
command: node --loader esbuild-register/loader -r esbuild-register ./event-log-collector.ts
working_directory: scripts
background: true
- run:
Expand All @@ -334,7 +334,7 @@ jobs:
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task build)
if [[ $TEMPLATE != bench/* ]]
then
yarn ts-node ./event-log-checker build $TEMPLATE
node --loader esbuild-register/loader -r esbuild-register ./event-log-checker build $TEMPLATE
fi
working_directory: scripts
- report-workflow-on-failure:
Expand Down Expand Up @@ -645,4 +645,3 @@ workflows:
# parallelism: 4
# requires:
# - create-sandboxes

2 changes: 1 addition & 1 deletion code/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const uiPackages = fs

module.exports = {
root: true,
extends: [path.join(scriptPath, '.eslintrc.js')],
extends: [path.join(scriptPath, '.eslintrc.cjs')],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
Expand Down
4 changes: 2 additions & 2 deletions code/addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/addon-bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"@storybook/addon-highlight": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/addon-bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"@storybook/global": "^5.0.0",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/backgrounds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/addon-bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"@storybook/global": "^5.0.0",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/controls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/addon-bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"@storybook/blocks": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@jest/transform": "^29.3.1",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/essentials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/addon-bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"@storybook/addon-actions": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/gfm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/addon-bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"@storybook/node-logger": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/highlight/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/addon-bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"@storybook/global": "^5.0.0"
Expand Down
4 changes: 2 additions & 2 deletions code/addons/interactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/addon-bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"@storybook/global": "^5.0.0",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/addon-bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"@storybook/global": "^5.0.0",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/links/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/addon-bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"@storybook/csf": "^0.1.0",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/measure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/addon-bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"@storybook/global": "^5.0.0",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/outline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/addon-bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"@storybook/global": "^5.0.0",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/storyshots-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/tsc.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/tsc.ts"
},
"dependencies": {
"@jest/transform": "^29.3.1",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/storyshots-puppeteer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/tsc.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/tsc.ts"
},
"dependencies": {
"@axe-core/puppeteer": "^4.2.0",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/storysource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/addon-bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"estraverse": "^5.2.0",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/addon-bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"ts-dedent": "^2.0.0"
Expand Down
4 changes: 2 additions & 2 deletions code/addons/toolbars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/addon-bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"devDependencies": {
"@storybook/client-logger": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/viewport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/addon-bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
},
"dependencies": {
"memoizerific": "^1.11.3"
Expand Down
64 changes: 64 additions & 0 deletions code/addons/viewport/src/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,62 @@ export const INITIAL_VIEWPORTS: ViewportMap = {
},
type: 'mobile',
},
iphoneSE3: {
name: 'iPhone SE 3rd generation',
styles: {
height: '667px',
width: '375px',
},
type: 'mobile',
},
iphone13: {
name: 'iPhone 13',
styles: {
height: '844px',
width: '390px',
},
type: 'mobile',
},
iphone13pro: {
name: 'iPhone 13 Pro',
styles: {
height: '844px',
width: '390px',
},
type: 'mobile',
},
iphone13promax: {
name: 'iPhone 13 Pro Max',
styles: {
height: '926px',
width: '428px',
},
type: 'mobile',
},
iphone14: {
name: 'iPhone 14',
styles: {
height: '844px',
width: '390px',
},
type: 'mobile',
},
iphone14pro: {
name: 'iPhone 14 Pro',
styles: {
height: '852px',
width: '393px',
},
type: 'mobile',
},
iphone14promax: {
name: 'iPhone 14 Pro Max',
styles: {
height: '932px',
width: '430px',
},
type: 'mobile',
},
ipad: {
name: 'iPad',
styles: {
Expand All @@ -105,6 +161,14 @@ export const INITIAL_VIEWPORTS: ViewportMap = {
},
type: 'tablet',
},
ipad11p: {
name: 'iPad Pro 11-in',
styles: {
height: '1194px',
width: '834px',
},
type: 'tablet',
},
ipad12p: {
name: 'iPad Pro 12.9-in',
styles: {
Expand Down
4 changes: 2 additions & 2 deletions code/builders/builder-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",
Expand Down
4 changes: 2 additions & 2 deletions code/builders/builder-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"!src/**/*"
],
"scripts": {
"check": "../../../scripts/prepare/check.ts",
"prep": "../../../scripts/prepare/bundle.ts"
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/channels": "workspace:*",
Expand Down
36 changes: 21 additions & 15 deletions code/builders/builder-vite/src/list-stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,27 @@ export async function listStories(options: Options) {
const { normalizePath } = await import('vite');

return (
await Promise.all(
normalizeStories(await options.presets.apply('stories', [], options), {
configDir: options.configDir,
workingDir: options.configDir,
}).map(({ directory, files }) => {
const pattern = path.join(directory, files);
const absolutePattern = path.isAbsolute(pattern)
? pattern
: path.join(options.configDir, pattern);
(
await Promise.all(
normalizeStories(await options.presets.apply('stories', [], options), {
configDir: options.configDir,
workingDir: options.configDir,
}).map(({ directory, files }) => {
const pattern = path.join(directory, files);
const absolutePattern = path.isAbsolute(pattern)
? pattern
: path.join(options.configDir, pattern);

return glob(slash(absolutePattern), {
...commonGlobOptions(absolutePattern),
follow: true,
});
})
return glob(slash(absolutePattern), {
...commonGlobOptions(absolutePattern),
follow: true,
});
})
)
)
).reduce((carry, stories) => carry.concat(stories.map(normalizePath)), []);
.reduce((carry, stories) => carry.concat(stories.map(normalizePath)), [])
// Sort stories to prevent a non-deterministic build. The result of Glob is not sorted an may differ
// for each invocation. This results in a different bundle file hashes from one build to the next.
.sort()
);
}
2 changes: 1 addition & 1 deletion code/builders/builder-vite/src/transform-iframe-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function transformIframeHtml(html: string, options: Options) {
}));

const otherGlobals = {
...(build?.test?.emptyBlocks ? { __STORYBOOK_BLOCKS_EMPTY_MODULE__: {} } : {}),
...(build?.test?.disableBlocks ? { __STORYBOOK_BLOCKS_EMPTY_MODULE__: {} } : {}),
};

return html
Expand Down
Loading

0 comments on commit 9b33681

Please sign in to comment.