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

Build: Upgrade typescript #30354

Merged
merged 17 commits into from
Jan 30, 2025
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
2 changes: 1 addition & 1 deletion code/addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"react-dom": "^18.2.0",
"react-resize-detector": "^7.1.2",
"resize-observer-polyfill": "^1.5.1",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"react-dom": "^18.2.0",
"react-inspector": "^6.0.0",
"telejson": "^7.2.0",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion code/addons/backgrounds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@storybook/icons": "^1.2.12",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion code/addons/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"react-dom": "^18.2.0",
"rehype-external-links": "^3.0.0",
"rehype-slug": "^6.0.0",
"typescript": "^5.3.2",
"typescript": "^5.7.3",
"vite": "^4.0.4"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion code/addons/essentials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"ts-dedent": "^2.0.0"
},
"devDependencies": {
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion code/addons/gfm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"ts-dedent": "^2.0.0"
},
"devDependencies": {
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion code/addons/highlight/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"devDependencies": {
"@types/webpack-env": "^1.16.0",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
Comment on lines 57 to +58
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Consider adding a ~ instead of ^ to prevent auto-updating to TypeScript 5.8+ when it releases, which could introduce breaking changes

},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion code/addons/interactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"formik": "^2.2.9",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion code/addons/interactions/src/mocks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const getInteractions = (finalStatus: CallStates) =>
.filter((call) => call.interceptable)
.map((call) => ({
...call,
childCallIds: [],
childCallIds: [] as any[],
Copy link
Contributor

Choose a reason for hiding this comment

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

style: consider using a more specific type than any[] for childCallIds, such as Call['id'][] to maintain type safety

Suggested change
childCallIds: [] as any[],
childCallIds: [] as Call['id'][],

isCollapsed: false,
isHidden: false,
toggleCollapsed: () => {},
Expand Down
2 changes: 1 addition & 1 deletion code/addons/jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-resize-detector": "^7.1.2",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion code/addons/links/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"ts-dedent": "^2.0.0"
},
"devDependencies": {
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/measure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"@storybook/icons": "^1.2.12",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion code/addons/onboarding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"react-dom": "^18.2.0",
"react-joyride": "^2.8.2",
"react-use-measure": "^2.1.1",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion code/addons/outline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"@storybook/icons": "^1.2.12",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion code/addons/storysource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-syntax-highlighter": "^15.5.0",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion code/addons/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"tinyglobby": "^0.2.10",
"tree-kill": "^1.2.2",
"ts-dedent": "^2.2.0",
"typescript": "^5.3.2",
"typescript": "^5.7.3",
"vitest": "^3.0.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion code/addons/themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
},
"devDependencies": {
"@storybook/icons": "^1.2.12",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion code/addons/toolbars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"devDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion code/addons/viewport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@storybook/icons": "^1.2.12",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion code/builders/builder-webpack5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"pretty-hrtime": "^1.0.3",
"sirv": "^2.0.4",
"slash": "^5.0.0",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion code/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@
"ts-dedent": "^2.0.0",
"tsconfig-paths": "^4.2.0",
"type-fest": "^4.18.1",
"typescript": "^5.3.2",
"typescript": "^5.7.3",
"unique-string": "^3.0.0",
"use-resize-observer": "^9.1.0",
"watchpack": "^2.2.0"
Expand Down
8 changes: 4 additions & 4 deletions code/core/src/core-server/presets/favicon.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ it('with no staticDirs favicon should return default', async () => {

it('with staticDirs containing a single favicon.ico should return the found favicon', async () => {
const location = 'static';
existsSyncMock.mockImplementation((p: string | Buffer | URL) => {
existsSyncMock.mockImplementation((p) => {
if (p === createPath(location)) {
return true;
}
Expand All @@ -69,7 +69,7 @@ it('with staticDirs containing a single favicon.ico should return the found favi

it('with staticDirs containing a single favicon.svg should return the found favicon', async () => {
const location = 'static';
existsSyncMock.mockImplementation((p: string | Buffer | URL) => {
existsSyncMock.mockImplementation((p) => {
if (p === createPath(location)) {
return true;
}
Expand All @@ -85,7 +85,7 @@ it('with staticDirs containing a single favicon.svg should return the found favi

it('with staticDirs containing a multiple favicons should return the first favicon and warn', async () => {
const location = 'static';
existsSyncMock.mockImplementation((p: string | Buffer | URL) => {
existsSyncMock.mockImplementation((p) => {
if (p === createPath(location)) {
return true;
}
Expand All @@ -107,7 +107,7 @@ it('with staticDirs containing a multiple favicons should return the first favic
it('with multiple staticDirs containing a multiple favicons should return the first favicon and warn', async () => {
const locationA = 'static-a';
const locationB = 'static-b';
existsSyncMock.mockImplementation((p: string | Buffer | URL) => {
existsSyncMock.mockImplementation((p) => {
if (p === createPath(locationA)) {
return true;
}
Expand Down
1 change: 0 additions & 1 deletion code/core/src/manager-api/modules/stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ export const init: ModuleFn<SubAPI, SubState> = ({
return undefined;
}
if (refId) {
// @ts-expect-error (possibly undefined)
return refs[refId].index ? refs[refId].index[storyId] : undefined;
}
return index ? index[storyId] : undefined;
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"cross-spawn": "^7.0.3",
"rimraf": "^6.0.1",
"tmp": "^0.2.1",
"typescript": "^5.3.2",
"typescript": "^5.7.3",
"webpack": "5",
"zone.js": "^0.15.0"
},
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/ember/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"devDependencies": {
"@types/babel__preset-env": "^7",
"ember-source": "~3.28.1",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"@babel/core": "*",
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/experimental-nextjs-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"devDependencies": {
"@types/node": "^22.0.0",
"next": "^15.0.3",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
Comment on lines 105 to 109
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Consider adding an explicit minimum TypeScript version requirement in peerDependencies since this upgrade enables new functionality that may not work with older versions

"peerDependencies": {
"@storybook/test": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/html-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"devDependencies": {
"@types/node": "^22.0.0",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/html-webpack5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
"devDependencies": {
"@types/node": "^22.0.0",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
"@types/node": "^22.0.0",
"@types/react-refresh": "^0",
"next": "^15.0.3",
"typescript": "^5.3.2",
"typescript": "^5.7.3",
"webpack": "^5.65.0"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/preact-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
},
"devDependencies": {
"@types/node": "^22.0.0",
"typescript": "^5.3.2",
"typescript": "^5.7.3",
"vite": "^4.0.0"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/preact-webpack5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"devDependencies": {
"@types/node": "^22.0.0",
"preact": "^10.5.13",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"preact": ">=10.0.0",
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/react-native-web-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
},
"devDependencies": {
"@types/node": "^22.0.0",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/react-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
},
"devDependencies": {
"@types/node": "^22.0.0",
"typescript": "^5.3.2",
"typescript": "^5.7.3",
"vite": "^4.0.0"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/server-webpack5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"devDependencies": {
"@types/node": "^22.0.0",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
4 changes: 2 additions & 2 deletions code/frameworks/svelte-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
"typescript": "^4.9.4 || ^5.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

style: dependency version range for typescript should be updated to match devDependency version ^5.7.3 for consistency

},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@sveltejs/vite-plugin-svelte": "^5.0.3",
"@types/node": "^22.0.0",
"svelte": "^5.0.5",
"typescript": "^5.3.2",
"typescript": "^5.7.3",
"vite": "^4.0.0"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/svelte-webpack5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"devDependencies": {
"svelte": "^5.0.5",
"svelte-loader": "^3.2.4",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
},
"devDependencies": {
"@types/node": "^22.0.0",
"typescript": "^5.3.2",
"typescript": "^5.7.3",
"vite": "^4.0.0"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions code/frameworks/vue3-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@
"@storybook/vue3": "workspace:*",
"find-package-json": "^1.2.0",
"magic-string": "^0.30.0",
"typescript": "^5.0.0",
"typescript": "^5.7.3",
"vue-component-meta": "^2.0.0",
"vue-docgen-api": "^4.75.1"
},
"devDependencies": {
"@types/find-package-json": "^1.2.6",
"@types/node": "^22.0.0",
"typescript": "^5.3.2",
"typescript": "^5.7.3",
"vite": "^4.0.0"
Comment on lines +59 to 67
Copy link
Contributor

Choose a reason for hiding this comment

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

style: TypeScript is listed in both dependencies and devDependencies. Consider removing it from one location to avoid potential version conflicts and duplicate installations.

Suggested change
"typescript": "^5.7.3",
"vue-component-meta": "^2.0.0",
"vue-docgen-api": "^4.75.1"
},
"devDependencies": {
"@types/find-package-json": "^1.2.6",
"@types/node": "^22.0.0",
"typescript": "^5.3.2",
"typescript": "^5.7.3",
"vite": "^4.0.0"
"magic-string": "^0.30.0",
"vue-component-meta": "^2.0.0",
"vue-docgen-api": "^4.75.1"
},
"devDependencies": {
"@types/find-package-json": "^1.2.6",
"@types/node": "^22.0.0",
"typescript": "^5.7.3",
"vite": "^4.0.0"

},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/vue3-webpack5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"devDependencies": {
"@types/node": "^22.0.0",
"@vue/compiler-sfc": "3.0.0",
"typescript": "^5.3.2",
"typescript": "^5.7.3",
"vue": "3.0.0"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/web-components-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"devDependencies": {
"@types/node": "^22.0.0",
"typescript": "^5.3.2"
"typescript": "^5.7.3"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
Loading