Skip to content

Commit

Permalink
Merge pull request #28633 from storybookjs/version-patch-from-8.2.4
Browse files Browse the repository at this point in the history
Release: Patch 8.2.5
  • Loading branch information
shilman committed Jul 19, 2024
2 parents 7b84561 + 6df2e2b commit 38d2274
Show file tree
Hide file tree
Showing 33 changed files with 1,266 additions and 94 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 8.2.5

- CPC: Add the globals export for manager - [#28650](https://github.com/storybookjs/storybook/pull/28650), thanks @ndelangen!
- CPC: Correct path to the `@storybook/theming/create` alias - [#28643](https://github.com/storybookjs/storybook/pull/28643), thanks @Averethel!
- Components: Remove external overrides - [#28632](https://github.com/storybookjs/storybook/pull/28632), thanks @kasperpeulen!
- Core: Fix header for MountMustBeDestructuredError message - [#28590](https://github.com/storybookjs/storybook/pull/28590), thanks @0916dhkim!
- Onboarding: Fix code snippet when story name differs from export name - [#28649](https://github.com/storybookjs/storybook/pull/28649), thanks @ghengeveld!
- Telemetry: Add mount, beforeEach, moduleMock stats - [#28624](https://github.com/storybookjs/storybook/pull/28624), thanks @shilman!
- Telemetry: CSF feature usage - [#28622](https://github.com/storybookjs/storybook/pull/28622), thanks @shilman!

## 8.2.4

- CLI: Add diagnostic when the `storybook` package is missing - [#28604](https://github.com/storybookjs/storybook/pull/28604), thanks @kasperpeulen!
Expand Down
6 changes: 3 additions & 3 deletions code/addons/docs/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ async function webpack(
*
* In the future the `@storybook/theming` and `@storybook/components` can be removed, as they should be singletons in the future due to the peerDependency on `storybook` package.
*/
const cliPath = require.resolve('storybook/package.json');
const themingPath = join(cliPath, '..', 'core', 'theming', 'index.js');
const cliPath = dirname(require.resolve('storybook/package.json'));
const themingPath = join(cliPath, 'core', 'theming', 'index.js');
const themingCreatePath = join(cliPath, 'core', 'theming', 'create.js');

const componentsPath = join(cliPath, '..', 'core', 'components', 'index.js');
const componentsPath = join(cliPath, 'core', 'components', 'index.js');
const blocksPath = dirname(require.resolve('@storybook/blocks/package.json'));
if (Array.isArray(webpackConfig.resolve?.alias)) {
alias = [...webpackConfig.resolve?.alias];
Expand Down
5 changes: 3 additions & 2 deletions code/addons/onboarding/src/Onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export default function Onboarding({ api }: { api: API }) {
const [createNewStoryForm, setCreateNewStoryForm] = useState<HTMLElement | null>();
const [createdStory, setCreatedStory] = useState<{
newStoryName: string;
newStoryExportName: string;
sourceFileContent: string;
sourceFileName: string;
} | null>();
Expand Down Expand Up @@ -158,8 +159,8 @@ export default function Onboarding({ api }: { api: API }) {
}

const source = createdStory?.sourceFileContent;
const startIndex = source?.lastIndexOf(`export const ${createdStory?.newStoryName}`);
const snippet = source?.slice(startIndex);
const startIndex = source?.lastIndexOf(`export const ${createdStory?.newStoryExportName}`);
const snippet = source?.slice(startIndex).trim();
const startingLineNumber = source?.slice(0, startIndex).split('\n').length;

const steps: StepDefinition[] = [
Expand Down
8 changes: 8 additions & 0 deletions code/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@
"import": "./dist/manager/globals-module-info.js",
"require": "./dist/manager/globals-module-info.cjs"
},
"./manager/globals": {
"types": "./dist/manager/globals.d.ts",
"import": "./dist/manager/globals.js",
"require": "./dist/manager/globals.cjs"
},
"./preview/globals": {
"types": "./dist/preview/globals.d.ts",
"import": "./dist/preview/globals.js",
Expand Down Expand Up @@ -229,6 +234,9 @@
"manager/globals-module-info": [
"./dist/manager/globals-module-info.d.ts"
],
"manager/globals": [
"./dist/manager/globals.d.ts"
],
"preview/globals": [
"./dist/preview/globals.d.ts"
]
Expand Down
8 changes: 2 additions & 6 deletions code/core/scripts/entries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,13 @@ export const getEntries = (cwd: string) => {
define('src/preview-api/index.ts', ['browser', 'node'], true),
define('src/manager-api/index.ts', ['browser', 'node'], true, ['react']),
define('src/router/index.ts', ['browser', 'node'], true, ['react']),
define('src/components/index.ts', ['browser', 'node'], true, [
'react',
'react-dom',
'@storybook/csf',
'@storybook/global',
]),
define('src/components/index.ts', ['browser', 'node'], true, ['react', 'react-dom']),
define('src/theming/index.ts', ['browser', 'node'], true, ['react']),
define('src/theming/create.ts', ['browser', 'node'], true, ['react']),
define('src/docs-tools/index.ts', ['browser', 'node'], true),

define('src/manager/globals-module-info.ts', ['node'], true),
define('src/manager/globals.ts', ['node'], true),
define('src/preview/globals.ts', ['node'], true),
];
};
Expand Down
2 changes: 2 additions & 0 deletions code/core/src/core-events/data/save-story.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export interface SaveStoryResponsePayload {
csfId: string;
newStoryId?: string;
newStoryName?: string;
newStoryExportName?: string;
sourceFileContent?: string;
sourceFileName?: string;
sourceStoryName?: string;
sourceStoryExportName?: string;
}
Loading

0 comments on commit 38d2274

Please sign in to comment.