diff --git a/code/lib/core-common/src/js-package-manager/Yarn2Proxy.test.ts b/code/lib/core-common/src/js-package-manager/Yarn2Proxy.test.ts index f024d19c1133..985d0dbecf83 100644 --- a/code/lib/core-common/src/js-package-manager/Yarn2Proxy.test.ts +++ b/code/lib/core-common/src/js-package-manager/Yarn2Proxy.test.ts @@ -1,5 +1,4 @@ import { describe, beforeEach, it, expect, vi } from 'vitest'; -import dedent from 'ts-dedent'; import { Yarn2Proxy } from './Yarn2Proxy'; describe('Yarn 2 Proxy', () => { diff --git a/code/lib/core-common/src/js-package-manager/Yarn2Proxy.ts b/code/lib/core-common/src/js-package-manager/Yarn2Proxy.ts index 7014357cc44b..8ed0de57e826 100644 --- a/code/lib/core-common/src/js-package-manager/Yarn2Proxy.ts +++ b/code/lib/core-common/src/js-package-manager/Yarn2Proxy.ts @@ -36,6 +36,7 @@ const CRITICAL_YARN2_ERROR_CODES = { YN0083: 'AUTOMERGE_GIT_ERROR', }; +// @ts-expect-error The error codes might be helpful in the future const YARN2_ERROR_CODES = { ...CRITICAL_YARN2_ERROR_CODES, YN0000: 'UNNAMED', @@ -306,10 +307,12 @@ export class Yarn2Proxy extends JsPackageManager { while ((match = regex.exec(logs)) !== null) { const code = match[1]; const message = match[2].replace(/[┌│└]/g, '').trim(); - if (CRITICAL_YARN2_ERROR_CODES[code]) { + if (code in CRITICAL_YARN2_ERROR_CODES) { errorCodesWithMessages.push({ code, - message: `${CRITICAL_YARN2_ERROR_CODES[code]}\n-> ${message}\n`, + message: `${ + CRITICAL_YARN2_ERROR_CODES[code as keyof typeof CRITICAL_YARN2_ERROR_CODES] + }\n-> ${message}\n`, }); } } diff --git a/code/package.json b/code/package.json index 399bf6dd0b11..0daa82df94f1 100644 --- a/code/package.json +++ b/code/package.json @@ -223,7 +223,7 @@ "trash": "^7.0.0", "ts-dedent": "^2.0.0", "ts-node": "^10.9.1", - "typescript": "^5.3.2", + "typescript": "^5.4.3", "util": "^0.12.4", "vite": "^4.0.0", "vitest": "^1.2.2", diff --git a/code/presets/create-react-app/package.json b/code/presets/create-react-app/package.json index 4d0db3310dc4..405e368aad5f 100644 --- a/code/presets/create-react-app/package.json +++ b/code/presets/create-react-app/package.json @@ -50,6 +50,7 @@ }, "dependencies": { "@pmmmwh/react-refresh-webpack-plugin": "^0.5.1", + "@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.0c3f3b7.0", "@storybook/types": "workspace:*", "@types/semver": "^7.5.6", "pnp-webpack-plugin": "^1.7.0", diff --git a/code/presets/create-react-app/src/types.ts b/code/presets/create-react-app/src/types.ts index 14d9b6b59d88..197a4c9f467e 100644 --- a/code/presets/create-react-app/src/types.ts +++ b/code/presets/create-react-app/src/types.ts @@ -1,4 +1,5 @@ import type { Options } from '@storybook/types'; + import type { PluginOptions as RDTSPluginOptions } from '@storybook/react-docgen-typescript-plugin'; export interface PluginOptions extends Options { diff --git a/code/renderers/react/src/__test__/portable-stories.test.tsx b/code/renderers/react/src/__test__/portable-stories.test.tsx index f80a1bbd2cc6..6c3c38055065 100644 --- a/code/renderers/react/src/__test__/portable-stories.test.tsx +++ b/code/renderers/react/src/__test__/portable-stories.test.tsx @@ -3,7 +3,6 @@ import React from 'react'; import { vi, it, expect, afterEach, describe } from 'vitest'; import { render, screen, cleanup } from '@testing-library/react'; import { addons } from '@storybook/preview-api'; -//@ts-expect-error our tsconfig.jsn#moduleResolution is set to 'node', which doesn't support this import import * as addonInteractionsPreview from '@storybook/addon-interactions/preview'; @@ -92,6 +91,7 @@ describe('projectAnnotations', () => { }); it('has spies when addon-interactions annotations are added', async () => { + //@ts-expect-error TODO investigate const Story = composeStory(stories.WithActionArg, stories.default, addonInteractionsPreview); expect(vi.mocked(Story.args.someActionArg!).mock).toBeDefined(); diff --git a/code/yarn.lock b/code/yarn.lock index f4deb1517325..28f3aa376755 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -6048,6 +6048,7 @@ __metadata: dependencies: "@pmmmwh/react-refresh-webpack-plugin": "npm:^0.5.1" "@storybook/node-logger": "workspace:*" + "@storybook/react-docgen-typescript-plugin": "npm:1.0.6--canary.9.0c3f3b7.0" "@storybook/types": "workspace:*" "@types/node": "npm:^18.0.0" "@types/semver": "npm:^7.5.6" @@ -6458,7 +6459,7 @@ __metadata: trash: "npm:^7.0.0" ts-dedent: "npm:^2.0.0" ts-node: "npm:^10.9.1" - typescript: "npm:^5.3.2" + typescript: "npm:^5.4.3" util: "npm:^0.12.4" vite: "npm:^4.0.0" vitest: "npm:^1.2.2" @@ -27534,6 +27535,16 @@ __metadata: languageName: node linkType: hard +"typescript@npm:^5.4.3": + version: 5.4.3 + resolution: "typescript@npm:5.4.3" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10c0/22443a8760c3668e256c0b34b6b45c359ef6cecc10c42558806177a7d500ab1a7d7aac1f976d712e26989ddf6731d2fbdd3212b7c73290a45127c1c43ba2005a + languageName: node + linkType: hard + "typescript@patch:typescript@npm%3A^3.8.3#optional!builtin": version: 3.9.10 resolution: "typescript@patch:typescript@npm%3A3.9.10#optional!builtin::version=3.9.10&hash=3bd3d3" @@ -27554,6 +27565,16 @@ __metadata: languageName: node linkType: hard +"typescript@patch:typescript@npm%3A^5.4.3#optional!builtin": + version: 5.4.3 + resolution: "typescript@patch:typescript@npm%3A5.4.3#optional!builtin::version=5.4.3&hash=5adc0c" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10c0/6e51f8b7e6ec55b897b9e56b67e864fe8f44e30f4a14357aad5dc0f7432db2f01efc0522df0b6c36d361c51f2dc3dcac5c832efd96a404cfabf884e915d38828 + languageName: node + linkType: hard + "ufo@npm:^1.3.0": version: 1.3.2 resolution: "ufo@npm:1.3.2" diff --git a/scripts/package.json b/scripts/package.json index bff065475ea5..bf44133234b4 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -177,7 +177,7 @@ "ts-dedent": "^2.0.0", "tsup": "^6.7.0", "type-fest": "~2.19", - "typescript": "^5.3.2", + "typescript": "^5.4.3", "util": "^0.12.4", "uuid": "^9.0.0", "vitest": "^1.2.2", diff --git a/scripts/yarn.lock b/scripts/yarn.lock index e48f40c7ef08..fb585cb2070b 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -2827,7 +2827,7 @@ __metadata: ts-loader: "npm:^9.4.2" tsup: "npm:^6.7.0" type-fest: "npm:~2.19" - typescript: "npm:^5.3.2" + typescript: "npm:^5.4.3" util: "npm:^0.12.4" uuid: "npm:^9.0.0" verdaccio: "npm:^5.19.1" @@ -14963,23 +14963,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^5.3.2": - version: 5.4.2 - resolution: "typescript@npm:5.4.2" +"typescript@npm:^5.4.3": + version: 5.4.3 + resolution: "typescript@npm:5.4.3" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/583ff68cafb0c076695f72d61df6feee71689568179fb0d3a4834dac343df6b6ed7cf7b6f6c801fa52d43cd1d324e2f2d8ae4497b09f9e6cfe3d80a6d6c9ca52 + checksum: 10c0/22443a8760c3668e256c0b34b6b45c359ef6cecc10c42558806177a7d500ab1a7d7aac1f976d712e26989ddf6731d2fbdd3212b7c73290a45127c1c43ba2005a languageName: node linkType: hard -"typescript@patch:typescript@npm%3A^5.3.2#optional!builtin": - version: 5.4.2 - resolution: "typescript@patch:typescript@npm%3A5.4.2#optional!builtin::version=5.4.2&hash=5adc0c" +"typescript@patch:typescript@npm%3A^5.4.3#optional!builtin": + version: 5.4.3 + resolution: "typescript@patch:typescript@npm%3A5.4.3#optional!builtin::version=5.4.3&hash=5adc0c" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/fcf6658073d07283910d9a0e04b1d5d0ebc822c04dbb7abdd74c3151c7aa92fcddbac7d799404e358197222006ccdc4c0db219d223d2ee4ccd9e2b01333b49be + checksum: 10c0/6e51f8b7e6ec55b897b9e56b67e864fe8f44e30f4a14357aad5dc0f7432db2f01efc0522df0b6c36d361c51f2dc3dcac5c832efd96a404cfabf884e915d38828 languageName: node linkType: hard