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

Release: Patch 8.6.5 #30762

Open
wants to merge 12 commits into
base: latest-release
Choose a base branch
from
Open
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
27 changes: 15 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -879,10 +879,11 @@ workflows:
parallelism: 5
requires:
- create-sandboxes
- bench-sandboxes:
parallelism: 5
requires:
- create-sandboxes
# TODO: don't forget to reenable this
# - bench-sandboxes:
# parallelism: 5
# requires:
# - create-sandboxes
- test-ui-testing-module:
requires:
- build
Expand Down Expand Up @@ -966,10 +967,11 @@ workflows:
- test-init-features:
requires:
- build
- bench-sandboxes:
parallelism: 5
requires:
- create-sandboxes
# TODO: don't forget to reenable this
# - bench-sandboxes:
# parallelism: 5
# requires:
# - create-sandboxes
# TODO: reenable once we find out the source of flakyness
# - test-runner-dev:
# parallelism: 4
Expand Down Expand Up @@ -1060,10 +1062,11 @@ workflows:
# --smoke-test is not supported for the angular builder right now
# - "angular-cli"
- "lit-vite-ts"
- bench-sandboxes:
parallelism: 5
requires:
- create-sandboxes
# TODO: don't forget to reenable this
# - bench-sandboxes:
# parallelism: 5
# requires:
# - create-sandboxes

# TODO: reenable once we find out the source of flakyness
# - test-runner-dev:
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 8.6.5

- Addon A11y: Promote @storybook/global to full dependency - [#30723](https://github.com/storybookjs/storybook/pull/30723), thanks @mrginglymus!
- Angular: Add `@angular-devkit/build-angular` to installed packages - [#30790](https://github.com/storybookjs/storybook/pull/30790), thanks @kasperpeulen!
- CLI: Fix test install in RNW projects - [#30786](https://github.com/storybookjs/storybook/pull/30786), thanks @shilman!
- Core: Replace 'min' instead of 'm' in printDuration - [#30668](https://github.com/storybookjs/storybook/pull/30668), thanks @wlewis-formative!
- Next.js: Use latest version when init in empty directory - [#30659](https://github.com/storybookjs/storybook/pull/30659), thanks @valentinpalkovic!
- Svelte: Fix Vite crashing on virtual module imports - [#26838](https://github.com/storybookjs/storybook/pull/26838), thanks @rChaoz!
- Svelte: Fix automatic argTypes inference coming up empty with `[email protected]` - [#30784](https://github.com/storybookjs/storybook/pull/30784), thanks @JReinhold!
- Universal Store: Don't use `crypto.randomUUID` - [#30781](https://github.com/storybookjs/storybook/pull/30781), thanks @JReinhold!

## 8.6.4

- Manager: Add Content-Type to fix Cloud IDEs - [#30606](https://github.com/storybookjs/storybook/pull/30606), thanks @GCHQDeveloper548!
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@
},
"dependencies": {
"@storybook/addon-highlight": "workspace:*",
"@storybook/global": "^5.0.0",
"@storybook/test": "workspace:*",
"axe-core": "^4.2.0"
},
"devDependencies": {
"@storybook/global": "^5.0.0",
"@storybook/icons": "^1.2.12",
"@testing-library/react": "^14.0.0",
"execa": "^9.5.2",
Expand Down
2 changes: 1 addition & 1 deletion code/builders/builder-webpack5/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const printDuration = (startTime: [number, number]) =>
prettyTime(process.hrtime(startTime))
.replace(' ms', ' milliseconds')
.replace(' s', ' seconds')
.replace(' m', ' minutes');
.replace(' min', ' minutes');

let compilation: ReturnType<typeof webpackDevMiddleware> | undefined;
let reject: (reason?: any) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ describe('JsPackageManager', () => {
expect(result).toEqual(['@storybook/[email protected]']);
});

it('should return the latest stable release version when there is no current version', async () => {
it('should get the requested version when the package is not in the monorepo', async () => {
mockLatestVersion.mockResolvedValue('2.0.0');

const result = await jsPackageManager.getVersionedPackages(['@storybook/new-addon@^8.3.0']);
const result = await jsPackageManager.getVersionedPackages(['@storybook/new-addon@^next']);

expect(result).toEqual(['@storybook/new-addon@^2.0.0']);
expect(result).toEqual(['@storybook/new-addon@^next']);
});
});
});
7 changes: 7 additions & 0 deletions code/core/src/common/js-package-manager/JsPackageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,13 @@ export abstract class JsPackageManager {
return Promise.all(
packages.map(async (pkg) => {
const [packageName, packageVersion] = getPackageDetails(pkg);

// If the packageVersion is specified and we are not dealing with a storybook package,
// just return the requested version.
if (packageVersion && !(packageName in storybookPackagesVersions)) {
return pkg;
}

const latestInRange = await this.latestVersion(packageName, packageVersion);

const k = packageName as keyof typeof storybookPackagesVersions;
Expand Down
2 changes: 1 addition & 1 deletion code/core/src/common/utils/print-duration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export const printDuration = (startTime: [number, number]) =>
prettyTime(process.hrtime(startTime))
.replace(' ms', ' milliseconds')
.replace(' s', ' seconds')
.replace(' m', ' minutes');
.replace(' min', ' minutes');
69 changes: 35 additions & 34 deletions code/core/src/shared/universal-store/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ const mockChannel = {
describe('UniversalStore', () => {
beforeEach((context) => {
vi.useFakeTimers();
let randomUUIDCounter = 0;
vi.spyOn(globalThis.crypto, 'randomUUID').mockImplementation(() => {
return `mocked-random-uuid-v4-${randomUUIDCounter++}`;

// Mock Date and Math.random to make the actorId deterministic
let randomNumberCounter = 1;
vi.setSystemTime(new Date('2025-02-14'));
vi.spyOn(Math, 'random').mockImplementation(() => {
return randomNumberCounter++ / 10;
});

// Always prepare the store, unless the test is specifically for unprepared state
Expand All @@ -57,7 +60,7 @@ describe('UniversalStore', () => {
}

return () => {
randomUUIDCounter = 0;
randomNumberCounter = 0;
vi.clearAllTimers();
mockedInstances.clearAllEnvironments();
mockChannelListeners.clear();
Expand All @@ -78,7 +81,7 @@ describe('UniversalStore', () => {
// Assert - the store should be created with the initial state and actor
expect(store.getState()).toEqual({ count: 0 });
expect(store.actor.type).toBe('LEADER');
expect(store.actor.id).toBe('mocked-random-uuid-v4-0');
expect(store.actor.id).toBe('m7405c003lllllllllm');
});

it('should throw when trying to create an instance with the constructor directly', () => {
Expand Down Expand Up @@ -195,15 +198,13 @@ You should reuse the existing instance instead of trying to create a new one.`);
// Arrange - create an initial leader and follower
vi.spyOn(console, 'error').mockImplementation(() => {});

vi.spyOn(globalThis.crypto, 'randomUUID').mockReturnValueOnce('first-uuid-1-2-3-4');
const firstLeader = UniversalStore.create({
id: 'env1:test',
leader: true,
initialState: { count: 0 },
});

// Act - create the second leader
vi.spyOn(globalThis.crypto, 'randomUUID').mockReturnValueOnce('second-uuid-1-2-3-4');
const secondLeader = UniversalStore.create({
id: 'env2:test',
leader: true,
Expand Down Expand Up @@ -250,12 +251,12 @@ You should reuse the existing instance instead of trying to create a new one.`);
Only one leader can exists at a time, your stores are now in an invalid state.
Leaders detected:
this: {
"id": "second-uuid-1-2-3-4",
"id": "m7405c0077777777778",
"type": "LEADER",
"environment": "MANAGER"
}
other: {
"id": "first-uuid-1-2-3-4",
"id": "m7405c003lllllllllm",
"type": "LEADER",
"environment": "MANAGER"
}`
Expand All @@ -266,12 +267,12 @@ You should reuse the existing instance instead of trying to create a new one.`);
Only one leader can exists at a time, your stores are now in an invalid state.
Leaders detected:
this: {
"id": "first-uuid-1-2-3-4",
"id": "m7405c003lllllllllm",
"type": "LEADER",
"environment": "MANAGER"
}
other: {
"id": "second-uuid-1-2-3-4",
"id": "m7405c0077777777778",
"type": "LEADER",
"environment": "MANAGER"
}`
Expand All @@ -290,7 +291,7 @@ You should reuse the existing instance instead of trying to create a new one.`);
// Assert - the store should be created with the initial state and actor
expect(store.getState()).toEqual(undefined);
expect(store.actor.type).toBe('FOLLOWER');
expect(store.actor.id).toBe('mocked-random-uuid-v4-0');
expect(store.actor.id).toBe('m7405c003lllllllllm');
});

it('should get existing state when a follower is created without initialState', async () => {
Expand Down Expand Up @@ -325,7 +326,7 @@ You should reuse the existing instance instead of trying to create a new one.`);
"eventInfo": {
"actor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-0",
"id": "m7405c003lllllllllm",
"type": "LEADER",
},
},
Expand All @@ -340,7 +341,7 @@ You should reuse the existing instance instead of trying to create a new one.`);
"eventInfo": {
"actor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-1",
"id": "m7405c0077777777778",
"type": "FOLLOWER",
},
},
Expand All @@ -355,7 +356,7 @@ You should reuse the existing instance instead of trying to create a new one.`);
"eventInfo": {
"actor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-1",
"id": "m7405c0077777777778",
"type": "FOLLOWER",
},
},
Expand All @@ -370,12 +371,12 @@ You should reuse the existing instance instead of trying to create a new one.`);
"eventInfo": {
"actor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-1",
"id": "m7405c0077777777778",
"type": "FOLLOWER",
},
"forwardingActor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-0",
"id": "m7405c003lllllllllm",
"type": "LEADER",
},
},
Expand All @@ -393,7 +394,7 @@ You should reuse the existing instance instead of trying to create a new one.`);
"eventInfo": {
"actor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-0",
"id": "m7405c003lllllllllm",
"type": "LEADER",
},
},
Expand Down Expand Up @@ -437,7 +438,7 @@ You should reuse the existing instance instead of trying to create a new one.`);
"eventInfo": {
"actor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-0",
"id": "m7405c003lllllllllm",
"type": "LEADER",
},
},
Expand All @@ -452,7 +453,7 @@ You should reuse the existing instance instead of trying to create a new one.`);
"eventInfo": {
"actor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-1",
"id": "m7405c0077777777778",
"type": "FOLLOWER",
},
},
Expand All @@ -467,7 +468,7 @@ You should reuse the existing instance instead of trying to create a new one.`);
"eventInfo": {
"actor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-1",
"id": "m7405c0077777777778",
"type": "FOLLOWER",
},
},
Expand All @@ -482,12 +483,12 @@ You should reuse the existing instance instead of trying to create a new one.`);
"eventInfo": {
"actor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-1",
"id": "m7405c0077777777778",
"type": "FOLLOWER",
},
"forwardingActor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-0",
"id": "m7405c003lllllllllm",
"type": "LEADER",
},
},
Expand All @@ -505,7 +506,7 @@ You should reuse the existing instance instead of trying to create a new one.`);
"eventInfo": {
"actor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-0",
"id": "m7405c003lllllllllm",
"type": "LEADER",
},
},
Expand Down Expand Up @@ -560,7 +561,7 @@ You should reuse the existing instance instead of trying to create a new one.`);
"eventInfo": {
"actor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-0",
"id": "m7405c003lllllllllm",
"type": "LEADER",
},
},
Expand All @@ -575,7 +576,7 @@ You should reuse the existing instance instead of trying to create a new one.`);
"eventInfo": {
"actor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-1",
"id": "m7405c0077777777778",
"type": "FOLLOWER",
},
},
Expand All @@ -590,7 +591,7 @@ You should reuse the existing instance instead of trying to create a new one.`);
"eventInfo": {
"actor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-1",
"id": "m7405c0077777777778",
"type": "FOLLOWER",
},
},
Expand All @@ -605,12 +606,12 @@ You should reuse the existing instance instead of trying to create a new one.`);
"eventInfo": {
"actor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-1",
"id": "m7405c0077777777778",
"type": "FOLLOWER",
},
"forwardingActor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-0",
"id": "m7405c003lllllllllm",
"type": "LEADER",
},
},
Expand All @@ -628,7 +629,7 @@ You should reuse the existing instance instead of trying to create a new one.`);
"eventInfo": {
"actor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-0",
"id": "m7405c003lllllllllm",
"type": "LEADER",
},
},
Expand Down Expand Up @@ -664,7 +665,7 @@ You should reuse the existing instance instead of trying to create a new one.`);
"eventInfo": {
"actor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-0",
"id": "m7405c003lllllllllm",
"type": "FOLLOWER",
},
},
Expand All @@ -679,7 +680,7 @@ You should reuse the existing instance instead of trying to create a new one.`);
"eventInfo": {
"actor": {
"environment": "MANAGER",
"id": "mocked-random-uuid-v4-0",
"id": "m7405c003lllllllllm",
"type": "FOLLOWER",
},
},
Expand Down Expand Up @@ -951,7 +952,7 @@ You should reuse the existing instance instead of trying to create a new one.`);
},
"id": "env2:test",
"actor": {
"id": "mocked-random-uuid-v4-1",
"id": "m7405c0077777777778",
"type": "FOLLOWER",
"environment": "MANAGER"
},
Expand Down Expand Up @@ -1136,7 +1137,7 @@ You should reuse the existing instance instead of trying to create a new one.`);
},
"id": "env2:test",
"actor": {
"id": "mocked-random-uuid-v4-1",
"id": "m7405c0077777777778",
"type": "FOLLOWER",
"environment": "MANAGER"
},
Expand Down
Loading