Skip to content

Commit fced81f

Browse files
authored
Merge pull request #31281 from storybookjs/version-non-patch-from-9.0.0-beta.5
Release: Prerelease 9.0.0-beta.6
2 parents b380fd4 + a263ed7 commit fced81f

File tree

94 files changed

+2155
-1151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+2155
-1151
lines changed

CHANGELOG.prerelease.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 9.0.0-beta.6
2+
3+
- Automigration: Fix an issue when main.js addons have dynamic values - [#31273](https://github.com/storybookjs/storybook/pull/31273), thanks @valentinpalkovic!
4+
- Automigration: Respect config-dir option - [#31233](https://github.com/storybookjs/storybook/pull/31233), thanks @valentinpalkovic!
5+
- Core: Change require.resolve path for storybook/package.json - [#31230](https://github.com/storybookjs/storybook/pull/31230), thanks @valentinpalkovic!
6+
- Dependencies: Upgrades for security - [#31276](https://github.com/storybookjs/storybook/pull/31276), thanks @ndelangen!
7+
- Dependencies: Upgrades for security - [#31291](https://github.com/storybookjs/storybook/pull/31291), thanks @ndelangen!
8+
- Next.js: Remove deprecated compatibility files - [#31295](https://github.com/storybookjs/storybook/pull/31295), thanks @valentinpalkovic!
9+
- Svelte: Fix missing `ts-dedent` dependency - [#31289](https://github.com/storybookjs/storybook/pull/31289), thanks @JReinhold!
10+
111
## 9.0.0-beta.5
212

313
- All packages: Remove unused dependencies - [#31227](https://github.com/storybookjs/storybook/pull/31227), thanks @webpro!

code/addons/a11y/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"react": "^18.2.0",
7878
"react-dom": "^18.2.0",
7979
"react-resize-detector": "^7.1.2",
80-
"typescript": "^5.7.3",
80+
"typescript": "^5.8.3",
8181
"vitest-axe": "^0.1.0"
8282
},
8383
"peerDependencies": {

code/addons/docs/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
"@types/color-convert": "^2.0.0",
125125
"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
126126
"color-convert": "^2.0.1",
127-
"es-toolkit": "^1.22.0",
127+
"es-toolkit": "^1.36.0",
128128
"github-slugger": "^2.0.0",
129129
"markdown-to-jsx": "^7.7.2",
130130
"memoizerific": "^1.11.3",
@@ -136,7 +136,7 @@
136136
"rehype-slug": "^6.0.0",
137137
"telejson": "8.0.0",
138138
"tocbot": "^4.20.1",
139-
"typescript": "^5.7.3",
139+
"typescript": "^5.8.3",
140140
"vite": "^6.2.5"
141141
},
142142
"peerDependencies": {

code/addons/jest/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"react": "^18.2.0",
6161
"react-dom": "^18.2.0",
6262
"react-resize-detector": "^7.1.2",
63-
"typescript": "^5.7.3"
63+
"typescript": "^5.8.3"
6464
},
6565
"peerDependencies": {
6666
"storybook": "workspace:^"

code/addons/links/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"@storybook/global": "^5.0.0"
7272
},
7373
"devDependencies": {
74-
"typescript": "^5.7.3"
74+
"typescript": "^5.8.3"
7575
},
7676
"peerDependencies": {
7777
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",

code/addons/onboarding/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"react": "^18.2.0",
5151
"react-dom": "^18.2.0",
5252
"react-joyride": "^2.8.2",
53-
"typescript": "^5.7.3"
53+
"typescript": "^5.8.3"
5454
},
5555
"peerDependencies": {
5656
"storybook": "workspace:^"

code/addons/pseudo-states/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"@storybook/icons": "^1.4.0",
5555
"react": "^18.2.0",
5656
"react-dom": "^18.2.0",
57-
"typescript": "^5.7.3"
57+
"typescript": "^5.8.3"
5858
},
5959
"peerDependencies": {
6060
"storybook": "workspace:^"

code/addons/themes/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
},
7171
"devDependencies": {
7272
"@storybook/icons": "^1.4.0",
73-
"typescript": "^5.7.3"
73+
"typescript": "^5.8.3"
7474
},
7575
"peerDependencies": {
7676
"storybook": "workspace:^"

code/addons/vitest/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"@vitest/browser": "^3.1.1",
103103
"@vitest/runner": "^3.1.1",
104104
"boxen": "^8.0.1",
105-
"es-toolkit": "^1.22.0",
105+
"es-toolkit": "^1.36.0",
106106
"execa": "^8.0.1",
107107
"find-up": "^7.0.0",
108108
"istanbul-lib-report": "^3.0.1",
@@ -116,7 +116,7 @@
116116
"tinyglobby": "^0.2.10",
117117
"tree-kill": "^1.2.2",
118118
"ts-dedent": "^2.2.0",
119-
"typescript": "^5.7.3",
119+
"typescript": "^5.8.3",
120120
"vitest": "^3.1.1"
121121
},
122122
"peerDependencies": {

code/builders/builder-webpack5/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"pretty-hrtime": "^1.0.3",
9393
"sirv": "^2.0.4",
9494
"slash": "^5.0.0",
95-
"typescript": "^5.7.3"
95+
"typescript": "^5.8.3"
9696
},
9797
"peerDependencies": {
9898
"storybook": "workspace:^"

code/builders/builder-webpack5/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const printDuration = (startTime: [number, number]) =>
3131
.replace(' s', ' seconds')
3232
.replace(' min', ' minutes');
3333

34-
const corePath = dirname(require.resolve('storybook/package.json'));
34+
const corePath = dirname(require.resolve('storybook/internal/package.json'));
3535

3636
let compilation: ReturnType<typeof webpackDevMiddleware> | undefined;
3737
let reject: (reason?: any) => void;

code/core/package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,8 @@
399399
"./internal/manager/globals-runtime": {
400400
"import": "./dist/manager/globals-runtime.js"
401401
},
402-
"./package.json": "./package.json"
402+
"./package.json": "./package.json",
403+
"./internal/package.json": "./package.json"
403404
},
404405
"main": "dist/index.cjs",
405406
"module": "dist/index.js",
@@ -670,7 +671,7 @@
670671
"@tanstack/react-virtual": "^3.3.0",
671672
"@testing-library/dom": "10.4.0",
672673
"@testing-library/react": "^14.0.0",
673-
"@types/cross-spawn": "^6.0.2",
674+
"@types/cross-spawn": "^6.0.6",
674675
"@types/detect-port": "^1.3.0",
675676
"@types/diff": "^5.0.9",
676677
"@types/ejs": "^3.1.1",
@@ -700,15 +701,15 @@
700701
"commander": "^12.1.0",
701702
"comment-parser": "^1.4.1",
702703
"copy-to-clipboard": "^3.3.1",
703-
"cross-spawn": "^7.0.3",
704+
"cross-spawn": "^7.0.6",
704705
"deep-object-diff": "^1.1.0",
705706
"dequal": "^2.0.2",
706707
"detect-indent": "^7.0.1",
707708
"detect-port": "^1.3.0",
708709
"diff": "^5.2.0",
709710
"downshift": "^9.0.4",
710711
"ejs": "^3.1.10",
711-
"es-toolkit": "^1.22.0",
712+
"es-toolkit": "^1.36.0",
712713
"esbuild": "^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0 || ^0.24.0 || ^0.25.0",
713714
"execa": "^8.0.1",
714715
"fd-package-json": "^1.2.0",
@@ -763,7 +764,7 @@
763764
"ts-dedent": "^2.0.0",
764765
"tsconfig-paths": "^4.2.0",
765766
"type-fest": "^4.18.1",
766-
"typescript": "^5.7.3",
767+
"typescript": "^5.8.3",
767768
"unique-string": "^3.0.0",
768769
"use-resize-observer": "^9.1.0",
769770
"watchpack": "^2.2.0"

code/core/scripts/helpers/generatePackageJsonFile.ts

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export async function generatePackageJsonFile(entries: ReturnType<typeof getEntr
7070

7171
// Add the package.json file to the exports, so we can use it to `require.resolve` the package's root easily
7272
pkgJson.exports['./package.json'] = './package.json';
73+
pkgJson.exports['./internal/package.json'] = './package.json';
7374

7475
/**
7576
* Add the `typesVersion` field to `code/core/package.json`, to make typescript respect and find

code/core/src/builder-manager/index.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ const starter: StarterFunction = async function* starterGeneratorFn({
158158

159159
yield;
160160

161-
const coreDirOrigin = join(dirname(require.resolve('storybook/package.json')), 'dist', 'manager');
161+
const coreDirOrigin = join(
162+
dirname(require.resolve('storybook/internal/package.json')),
163+
'dist',
164+
'manager'
165+
);
162166

163167
router.use(
164168
'/sb-addons',
@@ -262,7 +266,11 @@ const builder: BuilderFunction = async function* builderGeneratorFn({ startTime,
262266
yield;
263267

264268
const addonsDir = config.outdir;
265-
const coreDirOrigin = join(dirname(require.resolve('storybook/package.json')), 'dist', 'manager');
269+
const coreDirOrigin = join(
270+
dirname(require.resolve('storybook/internal/package.json')),
271+
'dist',
272+
'manager'
273+
);
266274
const coreDirTarget = join(options.outputDir, `sb-manager`);
267275

268276
// TODO: this doesn't watch, we should change this to use the esbuild watch API: https://esbuild.github.io/api/#watch

code/core/src/builder-manager/utils/template.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import type { DocsOptions, Options, Ref, TagsOptions } from 'storybook/internal/
66
import { render } from 'ejs';
77

88
export const getTemplatePath = async (template: string) => {
9-
return join(dirname(require.resolve('storybook/package.json')), 'assets/server', template);
9+
return join(
10+
dirname(require.resolve('storybook/internal/package.json')),
11+
'assets/server',
12+
template
13+
);
1014
};
1115

1216
export const readTemplate = async (template: string) => {

code/core/src/common/utils/__tests__/template.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const BASE_HTML_CONTENTS = '<script>console.log("base script!");</script>';
1818
const BASE_BODY_HTML_CONTENTS = '<div>story contents</div>';
1919
const BODY_HTML_CONTENTS = '<div>custom body contents</div>';
2020

21-
const base = dirname(require.resolve('storybook/package.json'));
21+
const base = dirname(require.resolve('storybook/internal/package.json'));
2222

2323
describe('server.getPreviewHeadHtml', () => {
2424
afterEach(() => {

code/core/src/common/utils/template.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function getPreviewBodyTemplate(
88
configDirPath: string,
99
interpolations?: Record<string, string>
1010
) {
11-
const packageDir = dirname(require.resolve('storybook/package.json'));
11+
const packageDir = dirname(require.resolve('storybook/internal/package.json'));
1212
const base = readFileSync(`${packageDir}/assets/server/base-preview-body.html`, 'utf8');
1313

1414
const bodyHtmlPath = resolve(configDirPath, 'preview-body.html');
@@ -25,7 +25,7 @@ export function getPreviewHeadTemplate(
2525
configDirPath: string,
2626
interpolations?: Record<string, string>
2727
) {
28-
const packageDir = dirname(require.resolve('storybook/package.json'));
28+
const packageDir = dirname(require.resolve('storybook/internal/package.json'));
2929
const base = readFileSync(`${packageDir}/assets/server/base-preview-head.html`, 'utf8');
3030
const headHtmlPath = resolve(configDirPath, 'preview-head.html');
3131

code/core/src/core-server/build-static.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption
129129
}
130130

131131
const coreServerPublicDir = join(
132-
dirname(require.resolve('storybook/package.json')),
132+
dirname(require.resolve('storybook/internal/package.json')),
133133
'assets/browser'
134134
);
135135
effects.push(cp(coreServerPublicDir, options.outputDir, { recursive: true }));

code/core/src/core-server/presets/common-preset.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import type {
2424

2525
import { dedent } from 'ts-dedent';
2626

27-
import { cleanPaths, sanitizeError } from '../../telemetry/sanitize';
2827
import { initCreateNewStoryChannel } from '../server-channel/create-new-story-channel';
2928
import { initFileSearchChannel } from '../server-channel/file-search-channel';
3029
import { defaultStaticDirs } from '../utils/constants';
@@ -36,7 +35,7 @@ const interpolate = (string: string, data: Record<string, string> = {}) =>
3635
Object.entries(data).reduce((acc, [k, v]) => acc.replace(new RegExp(`%${k}%`, 'g'), v), string);
3736

3837
const defaultFavicon = join(
39-
dirname(require.resolve('storybook/package.json')),
38+
dirname(require.resolve('storybook/internal/package.json')),
4039
'/assets/browser/favicon.svg'
4140
);
4241

@@ -314,10 +313,10 @@ export const tags = async (existing: any) => {
314313
};
315314
};
316315

317-
export const managerEntries = async (existing: any, options: Options) => {
316+
export const managerEntries = async (existing: any) => {
318317
return [
319318
join(
320-
dirname(require.resolve('storybook/package.json')),
319+
dirname(require.resolve('storybook/internal/package.json')),
321320
'dist/core-server/presets/common-manager.js'
322321
),
323322
...(existing || []),

code/core/src/core-server/presets/favicon.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { logger } from 'storybook/internal/node-logger';
88
import * as m from './common-preset';
99

1010
const defaultFavicon = join(
11-
dirname(require.resolve('storybook/package.json')),
11+
dirname(require.resolve('storybook/internal/package.json')),
1212
'/assets/browser/favicon.svg'
1313
);
1414

code/core/src/core-server/standalone.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { buildStaticStandalone } from './build-static';
66

77
async function build(options: any = {}, frameworkOptions: any = {}) {
88
const { mode = 'dev' } = options;
9-
const packageJsonDir = dirname(require.resolve('storybook/package.json'));
9+
const packageJsonDir = dirname(require.resolve('storybook/internal/package.json'));
1010
const packageJson = JSON.parse(require('fs').readFileSync(`${packageJsonDir}/package.json`));
1111

1212
const commonOptions = {

code/core/src/core-server/utils/constants.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const DEBOUNCE = 100;
44

55
export const defaultStaticDirs = [
66
{
7-
from: join(dirname(require.resolve('storybook/package.json')), 'assets', 'browser'),
7+
from: join(dirname(require.resolve('storybook/internal/package.json')), 'assets', 'browser'),
88
to: '/sb-common-assets',
99
},
1010
];

code/core/src/highlight/useHighlights.stories.tsx

+11-7
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,21 @@ export const Styles = meta.story({
103103
selectors: ['div', 'input'],
104104
options: {
105105
styles: {
106-
outline: '3px dashed hotpink',
107-
animation: 'pulse 3s linear infinite',
106+
backgroundColor: `color-mix(in srgb, hotpink, transparent 90%)`,
107+
outline: '3px solid hotpink',
108+
animation: 'highlight-pulse 3s linear infinite',
108109
transition: 'outline-offset 0.2s ease-in-out',
109110
},
110-
focusStyles: {
111+
hoverStyles: {
111112
outlineOffset: '3px',
112113
},
113-
keyframes: `@keyframes pulse {
114-
0% { outline: 3px dashed rgba(255, 105, 180, 1); }
115-
50% { outline: 3px dashed rgba(255, 105, 180, 0.2); }
116-
100% { outline: 3px dashed rgba(255, 105, 180, 1); }
114+
focusStyles: {
115+
backgroundColor: 'transparent',
116+
},
117+
keyframes: `@keyframes highlight-pulse {
118+
0% { outline-color: rgba(255, 105, 180, 1); }
119+
50% { outline-color: rgba(255, 105, 180, 0.2); }
120+
100% { outline-color: rgba(255, 105, 180, 1); }
117121
}`,
118122
},
119123
},

code/core/src/manager/settings/shortcuts.tsx

+20-20
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,25 @@ export type ValidationStates = 'valid' | 'error' | 'warn';
6262

6363
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
6464
// @ts-ignore-error (this only errors during compilation for production)
65-
export const TextInput: FC<ComponentProps<typeof Form.Input> & { valid: ValidationStates }> =
66-
styled(Form.Input)<{ valid: ValidationStates }>(
67-
({ valid, theme }) =>
68-
valid === 'error'
69-
? {
70-
animation: `${theme.animation.jiggle} 700ms ease-out`,
71-
}
72-
: {},
73-
{
74-
display: 'flex',
75-
width: 80,
76-
flexDirection: 'column',
77-
justifySelf: 'flex-end',
78-
paddingLeft: 4,
79-
paddingRight: 4,
80-
textAlign: 'center',
81-
}
82-
);
65+
export const TextInput: FC<
66+
ComponentProps<typeof Form.Input> & { valid: ValidationStates | undefined }
67+
> = styled(Form.Input)<{ valid: ValidationStates }>(
68+
({ valid, theme }) =>
69+
valid === 'error'
70+
? {
71+
animation: `${theme.animation.jiggle} 700ms ease-out`,
72+
}
73+
: {},
74+
{
75+
display: 'flex',
76+
width: 80,
77+
flexDirection: 'column',
78+
justifySelf: 'flex-end',
79+
paddingLeft: 4,
80+
paddingRight: 4,
81+
textAlign: 'center',
82+
}
83+
);
8384

8485
export const Fade = keyframes`
8586
0%,100% { opacity: 0; }
@@ -268,9 +269,8 @@ class ShortcutsScreen extends Component<ShortcutsScreenProps, ShortcutsScreenSta
268269
: undefined;
269270
};
270271

271-
displayError = (activeElement: Feature): ValidationStates => {
272+
displayError = (activeElement: Feature): ValidationStates | undefined => {
272273
const { activeFeature, shortcutKeys } = this.state;
273-
// @ts-expect-error (non strict)
274274
return activeElement === activeFeature && shortcutKeys[activeElement].error === true
275275
? 'error'
276276
: undefined;

0 commit comments

Comments
 (0)