Skip to content

Commit a779a54

Browse files
authored
Merge pull request #28790 from storybookjs/version-patch-from-8.2.7
Release: Patch 8.2.8
2 parents 97d8476 + f114187 commit a779a54

12 files changed

+79
-51
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 8.2.8
2+
3+
- CLI: Parse more Yarn Berry errors - [#28816](https://github.com/storybookjs/storybook/pull/28816), thanks @yannbf!
4+
- Fix: Invariant failed: Expected package.json#version to be defined in the "undefined" package - [#28752](https://github.com/storybookjs/storybook/pull/28752), thanks @abcdmku!
5+
16
## 8.2.7
27

38
- CPC: Fix type usage in renderers - [#28745](https://github.com/storybookjs/storybook/pull/28745), thanks @ndelangen!

code/core/src/common/js-package-manager/Yarn2Proxy.test.ts

+9
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,15 @@ describe('Yarn 2 Proxy', () => {
324324
expect(yarn2Proxy.parseErrorFromLogs(YARN2_ERROR_SAMPLE)).toMatchInlineSnapshot(
325325
`
326326
"YARN2 error
327+
YN0002: MISSING_PEER_DEPENDENCY
328+
-> before-storybook@workspace:. doesn't provide @testing-library/dom (p1ac37), requested by @testing-library/user-event.
329+
330+
YN0002: MISSING_PEER_DEPENDENCY
331+
-> before-storybook@workspace:. doesn't provide eslint (p1f657), requested by eslint-plugin-storybook.
332+
333+
YN0086: EXPLAIN_PEER_DEPENDENCIES_CTA
334+
-> Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
335+
327336
YN0014: YARN_IMPORT_FAILED
328337
-> Failed to import certain dependencies
329338

code/core/src/common/js-package-manager/Yarn2Proxy.ts

+23-37
Original file line numberDiff line numberDiff line change
@@ -12,74 +12,60 @@ import type { PackageJson } from './PackageJson';
1212
import type { InstallationMetadata, PackageMetadata } from './types';
1313
import { parsePackageData } from './util';
1414

15+
// more info at https://yarnpkg.com/advanced/error-codes
1516
const CRITICAL_YARN2_ERROR_CODES = {
1617
YN0001: 'EXCEPTION',
17-
YN0009: 'BUILD_FAILED',
18-
YN0010: 'RESOLVER_NOT_FOUND',
19-
YN0011: 'FETCHER_NOT_FOUND',
20-
YN0012: 'LINKER_NOT_FOUND',
21-
YN0014: 'YARN_IMPORT_FAILED',
22-
YN0015: 'REMOTE_INVALID',
23-
YN0016: 'REMOTE_NOT_FOUND',
24-
YN0020: 'MISSING_LOCKFILE_ENTRY',
25-
YN0021: 'WORKSPACE_NOT_FOUND',
26-
YN0028: 'FROZEN_LOCKFILE_EXCEPTION',
27-
YN0030: 'FETCH_FAILED',
28-
YN0046: 'AUTOMERGE_FAILED_TO_PARSE',
29-
YN0062: 'INCOMPATIBLE_OS',
30-
YN0063: 'INCOMPATIBLE_CPU',
31-
YN0071: 'NM_CANT_INSTALL_EXTERNAL_SOFT_LINK',
32-
YN0072: 'NM_PRESERVE_SYMLINKS_REQUIRED',
33-
YN0075: 'PROLOG_INSTANTIATION_ERROR',
34-
YN0076: 'INCOMPATIBLE_ARCHITECTURE',
35-
YN0078: 'RESOLUTION_MISMATCH',
36-
YN0081: 'NETWORK_UNSAFE_HTTP',
37-
YN0082: 'RESOLUTION_FAILED',
38-
YN0083: 'AUTOMERGE_GIT_ERROR',
39-
};
40-
41-
// @ts-expect-error If we want a code to be parsed, we move from the list below to the list above
42-
// Keep the codes here, they might be helpful in the future
43-
const YARN2_ERROR_CODES = {
44-
...CRITICAL_YARN2_ERROR_CODES,
45-
YN0000: 'UNNAMED',
4618
YN0002: 'MISSING_PEER_DEPENDENCY',
4719
YN0003: 'CYCLIC_DEPENDENCIES',
4820
YN0004: 'DISABLED_BUILD_SCRIPTS',
4921
YN0005: 'BUILD_DISABLED',
5022
YN0006: 'SOFT_LINK_BUILD',
5123
YN0007: 'MUST_BUILD',
5224
YN0008: 'MUST_REBUILD',
25+
YN0009: 'BUILD_FAILED',
26+
YN0010: 'RESOLVER_NOT_FOUND',
27+
YN0011: 'FETCHER_NOT_FOUND',
28+
YN0012: 'LINKER_NOT_FOUND',
5329
YN0013: 'FETCH_NOT_CACHED',
54-
YN0017: 'RESOLUTION_PACK',
30+
YN0014: 'YARN_IMPORT_FAILED',
31+
YN0015: 'REMOTE_INVALID',
32+
YN0016: 'REMOTE_NOT_FOUND',
5533
YN0018: 'CACHE_CHECKSUM_MISMATCH',
5634
YN0019: 'UNUSED_CACHE_ENTRY',
35+
YN0020: 'MISSING_LOCKFILE_ENTRY',
5736
YN0022: 'TOO_MANY_MATCHING_WORKSPACES',
5837
YN0023: 'CONSTRAINTS_MISSING_DEPENDENCY',
5938
YN0024: 'CONSTRAINTS_INCOMPATIBLE_DEPENDENCY',
6039
YN0025: 'CONSTRAINTS_EXTRANEOUS_DEPENDENCY',
6140
YN0026: 'CONSTRAINTS_INVALID_DEPENDENCY',
6241
YN0027: 'CANT_SUGGEST_RESOLUTIONS',
42+
YN0028: 'FROZEN_LOCKFILE_EXCEPTION',
6343
YN0029: 'CROSS_DRIVE_VIRTUAL_LOCAL',
44+
YN0030: 'FETCH_FAILED',
6445
YN0031: 'DANGEROUS_NODE_MODULES',
65-
YN0032: 'NODE_GYP_INJECTED',
46+
YN0035: 'NETWORK_ERROR',
47+
YN0046: 'AUTOMERGE_FAILED_TO_PARSE',
6648
YN0047: 'AUTOMERGE_IMMUTABLE',
6749
YN0048: 'AUTOMERGE_SUCCESS',
6850
YN0049: 'AUTOMERGE_REQUIRED',
6951
YN0050: 'DEPRECATED_CLI_SETTINGS',
7052
YN0059: 'INVALID_RANGE_PEER_DEPENDENCY',
7153
YN0060: 'INCOMPATIBLE_PEER_DEPENDENCY',
72-
YN0061: 'DEPRECATED_PACKAGE',
73-
YN0068: 'UNUSED_PACKAGE_EXTENSION',
54+
YN0062: 'INCOMPATIBLE_OS',
55+
YN0063: 'INCOMPATIBLE_CPU',
7456
YN0069: 'REDUNDANT_PACKAGE_EXTENSION',
57+
YN0071: 'NM_CANT_INSTALL_EXTERNAL_SOFT_LINK',
58+
YN0072: 'NM_PRESERVE_SYMLINKS_REQUIRED',
7559
YN0074: 'NM_HARDLINKS_MODE_DOWNGRADED',
60+
YN0075: 'PROLOG_INSTANTIATION_ERROR',
61+
YN0076: 'INCOMPATIBLE_ARCHITECTURE',
7662
YN0077: 'GHOST_ARCHITECTURE',
63+
YN0078: 'RESOLUTION_MISMATCH',
7764
YN0080: 'NETWORK_DISABLED',
78-
YN0085: 'UPDATED_RESOLUTION_RECORD',
65+
YN0081: 'NETWORK_UNSAFE_HTTP',
66+
YN0082: 'RESOLUTION_FAILED',
67+
YN0083: 'AUTOMERGE_GIT_ERROR',
7968
YN0086: 'EXPLAIN_PEER_DEPENDENCIES_CTA',
80-
YN0087: 'MIGRATION_SUCCESS',
81-
YN0088: 'VERSION_NOTICE',
82-
YN0089: 'TIPS_NOTICE',
8369
YN0090: 'OFFLINE_MODE_ENABLED',
8470
};
8571

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { dirname } from 'node:path';
44

55
async function build(options: any = {}, frameworkOptions: any = {}) {
66
const { mode = 'dev' } = options;
7-
const packageJson = dirname(require.resolve('@storybook/core/package.json'));
7+
const packageJsonDir = dirname(require.resolve('@storybook/core/package.json'));
8+
const packageJson = JSON.parse(require('fs').readFileSync(`${packageJsonDir}/package.json`));
89

910
const commonOptions = {
1011
...options,

code/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -278,5 +278,6 @@
278278
"Dependency Upgrades"
279279
]
280280
]
281-
}
281+
},
282+
"deferredNextVersion": "8.2.8"
282283
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
```shell renderer="angular" tabTitle="with-builder"
2+
# Builds Storybook with Angular's custom builder
3+
# See https://storybook.js.org/docs/get-started/frameworks/angular#how-do-i-migrate-to-an-angular-storybook-builder
4+
# to learn how to create the custom builder
5+
ng run my-project:build-storybook
6+
```
7+
8+
```json renderer="angular" language="js" filename="package.json" tabTitle="script-for-builder"
9+
{
10+
"scripts": {
11+
"build-storybook": "ng run my-project:build-storybook"
12+
}
13+
}
14+
```

docs/_snippets/custom-build-script-production.md

-8
This file was deleted.

docs/api/portable-stories/portable-stories-jest.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ sidebar:
1818

1919
Normally, Storybook composes a story and its [annotations](#annotations) automatically, as part of the [story pipeline](#story-pipeline). When using stories in Jest tests, you must handle the story pipeline yourself, which is what the [`composeStories`](#composestories) and [`composeStory`](#composestory) functions enable.
2020

21+
<Callout variant="info">
22+
The API specified here is available in Storybook `8.2.7` and up. If you're using an older version of Storybook, you can upgrade to the latest version (`npx storybook@latest upgrade`) to use this API. If you're unable to upgrade, you can use previous API, which uses the `.play()` method instead of `.run()`, but is otherwise identical.
23+
</Callout>
24+
2125
<If renderer="react">
2226
<Callout variant="info">
2327
**Using `Next.js`?** You need to do three things differently when using portable stories in Jest with Next.js projects:

docs/api/portable-stories/portable-stories-vitest.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ sidebar:
2222

2323
Normally, Storybook composes a story and its [annotations](#annotations) automatically, as part of the [story pipeline](#story-pipeline). When using stories in Vitest tests, you must handle the story pipeline yourself, which is what the [`composeStories`](#composestories) and [`composeStory`](#composestory) functions enable.
2424

25+
<Callout variant="info">
26+
The API specified here is available in Storybook `8.2.7` and up. If you're using an older version of Storybook, you can upgrade to the latest version (`npx storybook@latest upgrade`) to use this API. If you're unable to upgrade, you can use previous API, which uses the `.play()` method instead of `.run()`, but is otherwise identical.
27+
</Callout>
28+
2529
<If renderer="react">
2630
<Callout variant="warning">
2731
**Using `Next.js`?** Next.js requires specific configuration that is only available in [Jest](./portable-stories-jest.mdx). The portable stories API is not supported in Next.js with Vitest.

docs/sharing/publish-storybook.mdx

+14-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,26 @@ Teams publish Storybook online to review and collaborate on works in progress. T
1313

1414
## Build Storybook as a static web application
1515

16-
First, we'll need to build Storybook as a static web application. The functionality is already built-in and pre-configured for most supported frameworks. Others require a bit of customization (e.g., Angular). Run the following command inside your project's root directory:
16+
First, we'll need to build Storybook as a static web application. The functionality is already built-in and pre-configured for most supported frameworks. Run the following command inside your project's root directory:
1717

1818
{/* prettier-ignore-start */}
1919

20-
<CodeSnippets path="custom-build-script-production.md" />
20+
<CodeSnippets path="build-storybook-production-mode.md" />
2121

2222
{/* prettier-ignore-end */}
2323

24+
<If renderer="angular">
25+
26+
If you're using Angular, it's often better to use the [Angular builder](../get-started/frameworks/angular.mdx#how-do-i-migrate-to-an-angular-storybook-builder) to build Storybook:
27+
28+
{/* prettier-ignore-start */}
29+
30+
<CodeSnippets path="angular-builder-production.md" />
31+
32+
{/* prettier-ignore-end */}
33+
34+
</If>
35+
2436
<Callout variant="info" icon="💡">
2537
You can provide additional flags to customize the command. Read more about the flag options [here](../api/cli-options.mdx).
2638
</Callout>

docs/versions/latest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"8.2.7","info":{"plain":"- CPC: Fix type usage in renderers - [#28745](https://github.com/storybookjs/storybook/pull/28745), thanks @ndelangen!\n- Core: Introduce run over play in portable stories, and revert back play changes of 8.2 - [#28764](https://github.com/storybookjs/storybook/pull/28764), thanks @kasperpeulen!"}}
1+
{"version":"8.2.8","info":{"plain":"- CLI: Parse more Yarn Berry errors - [#28816](https://github.com/storybookjs/storybook/pull/28816), thanks @yannbf!\n- Fix: Invariant failed: Expected package.json#version to be defined in the \\\"undefined\\\" package - [#28752](https://github.com/storybookjs/storybook/pull/28752), thanks @abcdmku!"}}

docs/versions/next.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"8.3.0-alpha.3","info":{"plain":"- Angular: Fix Angular template error for props with a circular reference - [#28498](https://github.com/storybookjs/storybook/pull/28498), thanks @Marklb!\n- Angular: Fix template props not able to use dot notation - [#28588](https://github.com/storybookjs/storybook/pull/28588), thanks @Marklb!\n- CLI: Fix the initialization of Storybook in workspaces - [#28699](https://github.com/storybookjs/storybook/pull/28699), thanks @valentinpalkovic!\n- CPC: Fix missing exports for addon-kit - [#28691](https://github.com/storybookjs/storybook/pull/28691), thanks @ndelangen!\n- CPC: Fix type usage in renderers - [#28745](https://github.com/storybookjs/storybook/pull/28745), thanks @ndelangen!\n- Controls: Add disableSave parameter - [#28734](https://github.com/storybookjs/storybook/pull/28734), thanks @valentinpalkovic!\n- React: Avoid 'Dynamic require of react is not possible' issue - [#28730](https://github.com/storybookjs/storybook/pull/28730), thanks @valentinpalkovic!\n- Telemetry: Add mount, beforeEach, moduleMock stats - [#28624](https://github.com/storybookjs/storybook/pull/28624), thanks @shilman!\n- Telemetry: CSF feature usage - [#28622](https://github.com/storybookjs/storybook/pull/28622), thanks @shilman!\n- Types: Adjust beforeAll to be non-nullable in NormalizedProjectAnnotations - [#28671](https://github.com/storybookjs/storybook/pull/28671), thanks @kasperpeulen!\n- Vue: Fix out of memory error when using vue-component-meta for events and slots - [#28674](https://github.com/storybookjs/storybook/pull/28674), thanks @larsrickert!\n- Vue: Improve generated code snippets - [#27194](https://github.com/storybookjs/storybook/pull/27194), thanks @larsrickert!"}}
1+
{"version":"8.3.0-alpha.4","info":{"plain":"- CSF: Allow overridding globals at the story level - [#26654](https://github.com/storybookjs/storybook/pull/26654), thanks @tmeasday!\n- Core: Introduce run over play in portable stories, and revert back play changes of 8.2 - [#28764](https://github.com/storybookjs/storybook/pull/28764), thanks @kasperpeulen!\n- Core: Split Storybook CLI - [#28519](https://github.com/storybookjs/storybook/pull/28519), thanks @kasperpeulen!\n- Fix: Invariant failed: Expected package.json#version to be defined in the \\\"undefined\\\" package - [#28752](https://github.com/storybookjs/storybook/pull/28752), thanks @abcdmku!\n- Next.js: Make RSC portable-stories compatible - [#28756](https://github.com/storybookjs/storybook/pull/28756), thanks @valentinpalkovic!\n- UI: Fix collapse/expand all functionality - [#28582](https://github.com/storybookjs/storybook/pull/28582), thanks @filipemelo2002!"}}

0 commit comments

Comments
 (0)