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: Merge patches to main (without version bump) #29834

Closed
wants to merge 91 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
f25d3d5
Update ./docs/versions/next.json for v8.5.0-alpha.0
storybook-bot Oct 31, 2024
366970b
Update ./docs/versions/next.json for v8.5.0-alpha.1
storybook-bot Oct 31, 2024
8e5a14b
Merge pull request #29503 from storybookjs/kasper/fix-peer-constraints
kasperpeulen Oct 31, 2024
3abca8e
Write changelog for 8.4.1 [skip ci]
storybook-bot Nov 1, 2024
5fa09b9
Merge pull request #29504 from storybookjs/version-patch-from-8.4.0
kasperpeulen Nov 1, 2024
9983774
Bump version from "8.4.0" to "8.4.1" [skip ci]
storybook-bot Nov 1, 2024
06a1678
Update ./docs/versions/next.json for v8.5.0-alpha.2
storybook-bot Nov 2, 2024
625e209
Merge pull request #29501 from storybookjs/yann/hide-testing-module-o…
yannbf Nov 1, 2024
d54f775
Merge pull request #29444 from sentience/fix-nextjs-react-paths-in-mo…
valentinpalkovic Nov 1, 2024
fac64fd
Merge pull request #29514 from storybookjs/shilman/fix-solid-init
shilman Nov 2, 2024
91f2760
Merge pull request #29157 from storybookjs/valentin/fix-svelte-vite-p…
valentinpalkovic Nov 1, 2024
e6b7d07
Merge pull request #29524 from storybookjs/valentin/fix-addon-test-in…
valentinpalkovic Nov 4, 2024
1d10e77
Write changelog for 8.4.2 [skip ci]
storybook-bot Nov 5, 2024
12d2737
Merge pull request #29510 from storybookjs/version-patch-from-8.4.1
shilman Nov 5, 2024
d5fa671
Bump version from "8.4.1" to "8.4.2" [skip ci]
storybook-bot Nov 5, 2024
1e49059
Update ./docs/versions/next.json for v8.5.0-alpha.4
storybook-bot Nov 12, 2024
6f22788
Merge pull request #29592 from storybookjs/yann/fix-next-13-sandboxes
yannbf Nov 12, 2024
ae766cc
Merge pull request #29589 from storybookjs/viewports-global-options-e…
kylegach Nov 12, 2024
82fb5ba
Merge pull request #29595 from storybookjs/yann/fix-e2e-flake-discrep…
yannbf Nov 13, 2024
3edae5c
Write changelog for 8.4.3 [skip ci]
storybook-bot Nov 13, 2024
b8c7ccf
Merge pull request #29587 from storybookjs/yann/next-15-support
shilman Nov 12, 2024
c946bc1
Merge pull request #29593 from storybookjs/yann/fix-next-13-sandboxes…
yannbf Nov 12, 2024
e266b17
Merge pull request #29590 from storybookjs/version-patch-from-8.4.2
yannbf Nov 13, 2024
750930f
Bump version from "8.4.2" to "8.4.3" [skip ci]
storybook-bot Nov 13, 2024
29e7d17
Merge pull request #29617 from storybookjs/yann/fix-dep-optimization-…
yannbf Nov 14, 2024
81f276d
Write changelog for 8.4.4 [skip ci]
storybook-bot Nov 14, 2024
7e74e60
Merge pull request #29618 from storybookjs/version-patch-from-8.4.3
yannbf Nov 14, 2024
ca016ae
Bump version from "8.4.3" to "8.4.4" [skip ci]
storybook-bot Nov 14, 2024
776f071
Update ./docs/versions/next.json for v8.5.0-alpha.5
storybook-bot Nov 16, 2024
76fcb50
Update ./docs/versions/next.json for v8.5.0-alpha.6
storybook-bot Nov 18, 2024
4dc60f1
Update ./docs/versions/next.json for v8.5.0-alpha.7
storybook-bot Nov 19, 2024
8d7b8fd
Update ./docs/versions/next.json for v8.5.0-alpha.8
storybook-bot Nov 19, 2024
f840774
Merge pull request #29546 from storybookjs/docs_adjust_svelte_snippet…
jonniebigodes Nov 15, 2024
7ab2e09
Merge pull request #29628 from storybookjs/docs_additional_polish_sve…
jonniebigodes Nov 15, 2024
d21ba40
Merge pull request #29629 from SpanishPear/patch-3
shilman Nov 16, 2024
4e8d32e
Merge pull request #29632 from storybookjs/shilman/fix-qwik-init
shilman Nov 17, 2024
5096486
Merge pull request #29547 from Borgund/patch-1
kylegach Nov 19, 2024
4019947
Merge pull request #29640 from storybookjs/yann/next-15-support-vite
yannbf Nov 20, 2024
f140fcc
Merge pull request #29659 from leosvelperez/feat/angular-19
valentinpalkovic Nov 20, 2024
a1bf316
Write changelog for 8.4.5 [skip ci]
storybook-bot Nov 20, 2024
fb1da8c
Merge pull request #29627 from storybookjs/yann/disable-corepack-pin-…
yannbf Nov 18, 2024
5fdf705
Update ./docs/versions/next.json for v8.5.0-alpha.9
storybook-bot Nov 20, 2024
dba1f48
Merge pull request #29625 from storybookjs/version-patch-from-8.4.4
yannbf Nov 20, 2024
60a5088
Bump version from "8.4.4" to "8.4.5" [skip ci]
storybook-bot Nov 20, 2024
4405245
Merge branch 'latest-release'
storybook-bot Nov 20, 2024
1c878bd
Update ./docs/versions/next.json for v8.5.0-alpha.10
storybook-bot Nov 23, 2024
3d64370
Update ./docs/versions/next.json for v8.5.0-alpha.11
storybook-bot Nov 27, 2024
645bc7b
Update ./docs/versions/next.json for v8.5.0-alpha.12
storybook-bot Nov 29, 2024
9858520
Update ./docs/versions/latest.json for v8.5.0-alpha.12
storybook-bot Nov 29, 2024
2d0a7ee
Update ./docs/versions/next.json for v8.5.0-alpha.13
storybook-bot Nov 29, 2024
578ba77
Merge pull request #29677 from ingowagner/next
yannbf Nov 21, 2024
725a098
Merge pull request #29683 from storybookjs/docs_fix_snippets_v3
jonniebigodes Nov 22, 2024
86b5966
Merge pull request #29733 from storybookjs/yann/improve-ps-annotations
shilman Nov 29, 2024
f97af36
Merge pull request #29748 from storybookjs/fix/portable-stories-tests
yannbf Nov 29, 2024
e243c64
Write changelog for 8.4.6 [skip ci]
storybook-bot Nov 29, 2024
344092b
Merge pull request #29676 from storybookjs/yann/fix-addon-test-setup-…
yannbf Nov 21, 2024
21baaef
Merge pull request #29710 from storybookjs/yann/support-vite-6
yannbf Nov 26, 2024
db62f8e
Merge pull request #29731 from storybookjs/jeppe/support-svelte-vite-…
yannbf Nov 28, 2024
15e14c4
Merge pull request #29724 from storybookjs/yann/fix-vite-6-sandboxes
ndelangen Nov 28, 2024
8cb6a37
Merge pull request #29679 from storybookjs/version-patch-from-8.4.5
yannbf Nov 29, 2024
b58b3ee
Bump version from "8.4.5" to "8.4.6" [skip ci]
storybook-bot Nov 29, 2024
9fccef6
Update ./docs/versions/next.json for v8.5.0-alpha.14
storybook-bot Nov 30, 2024
2f6c2f3
Update ./docs/versions/next.json for v8.5.0-alpha.15
storybook-bot Dec 3, 2024
720d407
Update ./docs/versions/next.json for v8.5.0-alpha.16
storybook-bot Dec 3, 2024
fcf2255
Update ./docs/versions/next.json for v8.5.0-alpha.17
storybook-bot Dec 4, 2024
0f059d4
Merge pull request #29759 from storybookjs/shilman/fix-docs-no-skip-h…
shilman Dec 2, 2024
44f7b46
Merge pull request #29736 from storybookjs/tmeasday/anonymous-id-tweaks
shilman Dec 2, 2024
c462fd9
Merge pull request #29272 from Sidnioulz/sidnioulz-docs-indexers
jonniebigodes Dec 2, 2024
6b20bd1
Merge pull request #29693 from storybookjs/maintenance_fix_docs_scripts
jonniebigodes Dec 3, 2024
70142fc
Write changelog for 8.4.7 [skip ci]
storybook-bot Dec 5, 2024
ca12b18
Merge pull request #29795 from tobiasdiez/plugin-promise
yannbf Dec 5, 2024
3137114
Update ./docs/versions/next.json for v8.5.0-alpha.18
storybook-bot Dec 5, 2024
f62f005
Merge pull request #29766 from storybookjs/version-patch-from-8.4.6
yannbf Dec 5, 2024
0466712
Bump version from "8.4.6" to "8.4.7" [skip ci]
storybook-bot Dec 5, 2024
bdf54f7
Merge branch 'latest-release'
storybook-bot Dec 5, 2024
6cfe4d9
Update ./docs/versions/next.json for v8.5.0-alpha.19
storybook-bot Dec 10, 2024
960c9f3
Update ./docs/versions/next.json for v8.5.0-alpha.20
storybook-bot Dec 11, 2024
d482d0a
Update ./docs/versions/next.json for v8.5.0-alpha.21
storybook-bot Dec 12, 2024
fc9756b
Update ./docs/versions/next.json for v8.5.0-alpha.22
storybook-bot Dec 13, 2024
4ddbaf5
Update ./docs/versions/next.json for v8.5.0-beta.0
storybook-bot Dec 16, 2024
36e2e6f
Update ./docs/versions/next.json for v8.5.0-beta.1
storybook-bot Dec 16, 2024
01e04c9
Update ./docs/versions/next.json for v8.5.0-beta.2
storybook-bot Dec 18, 2024
b3ff419
Update ./docs/versions/next.json for v8.5.0-beta.3
storybook-bot Dec 19, 2024
0df7636
Update ./docs/versions/next.json for v8.5.0-beta.4
storybook-bot Dec 20, 2024
e55d312
Update ./docs/versions/next.json for v8.5.0-beta.5
storybook-bot Dec 23, 2024
1414019
Update ./docs/versions/next.json for v8.5.0-beta.6
storybook-bot Dec 25, 2024
5efc689
Update ./docs/versions/next.json for v8.5.0-beta.7
storybook-bot Dec 27, 2024
257baa6
Update ./docs/versions/next.json for v8.5.0-beta.8
storybook-bot Jan 8, 2025
21717f1
Update ./docs/versions/next.json for v8.5.0-beta.9
storybook-bot Jan 13, 2025
37e2196
Update ./docs/versions/next.json for v8.5.0-beta.10
storybook-bot Jan 13, 2025
de15248
Update ./docs/versions/next.json for v8.5.0-beta.11
storybook-bot Jan 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -920,30 +920,30 @@ workflows:
requires:
- build
- create-sandboxes:
parallelism: 38
parallelism: 37
requires:
- build
# - smoke-test-sandboxes: # disabled for now
# requires:
# - create-sandboxes
- build-sandboxes:
parallelism: 38
parallelism: 37
requires:
- create-sandboxes
- chromatic-sandboxes:
parallelism: 35
parallelism: 34
requires:
- build-sandboxes
- e2e-production:
parallelism: 33
parallelism: 32
requires:
- build-sandboxes
- e2e-dev:
parallelism: 2
requires:
- create-sandboxes
- test-runner-production:
parallelism: 33
parallelism: 32
requires:
- build-sandboxes
- vitest-integration:
Expand Down
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
## 8.4.7

- Telemetry: Improve anonymous id calculation - [#29736](https://github.com/storybookjs/storybook/pull/29736), thanks @tmeasday!
- Vue: Properly resolve Vite plugin - [#29795](https://github.com/storybookjs/storybook/pull/29795), thanks @tobiasdiez!

## 8.4.6

- Addon Test: Use pathe for better windows support - [#29676](https://github.com/storybookjs/storybook/pull/29676), thanks @yannbf!
- Angular: Default to standalone components in Angular v19 - [#29677](https://github.com/storybookjs/storybook/pull/29677), thanks @ingowagner!
- Frameworks: Add Vite 6 support - [#29710](https://github.com/storybookjs/storybook/pull/29710), thanks @yannbf!
- Portable stories: Support multiple annotation notations from preview - [#29733](https://github.com/storybookjs/storybook/pull/29733), thanks @yannbf!
- React: Upgrade react-docgen-typescript to support Vite 6 - [#29724](https://github.com/storybookjs/storybook/pull/29724), thanks @yannbf!
- Svelte: Support `@sveltejs/vite-plugin-svelte` v5 - [#29731](https://github.com/storybookjs/storybook/pull/29731), thanks @JReinhold!

## 8.4.5

- Angular: Support v19 - [#29659](https://github.com/storybookjs/storybook/pull/29659), thanks @leosvelperez!
- CLI: Disable corepack auto pin behavior - [#29627](https://github.com/storybookjs/storybook/pull/29627), thanks @yannbf!
- CLI: Fix qwik init - [#29632](https://github.com/storybookjs/storybook/pull/29632), thanks @shilman!
- Nextjs-Vite: Add Next.js 15 support - [#29640](https://github.com/storybookjs/storybook/pull/29640), thanks @yannbf!

## 8.4.4

- Addon Test: Only optimize react deps if applicable in vitest-plugin - [#29617](https://github.com/storybookjs/storybook/pull/29617), thanks @yannbf!

## 8.4.3

- Addon Test: Optimize internal dependencies - [#29595](https://github.com/storybookjs/storybook/pull/29595), thanks @yannbf!
- Next.js: Add support for Next 15 - [#29587](https://github.com/storybookjs/storybook/pull/29587), thanks @yannbf!

## 8.4.2

- Addon Test: Fix post-install logic for Next.js Vite framework support - [#29524](https://github.com/storybookjs/storybook/pull/29524), thanks @valentinpalkovic!
- Addon Test: Only render the TestingModule component in development mode - [#29501](https://github.com/storybookjs/storybook/pull/29501), thanks @yannbf!
- CLI: Fix Solid init by installing `@storybook/test` - [#29514](https://github.com/storybookjs/storybook/pull/29514), thanks @shilman!
- Core: Shim CJS-only globals in ESM output - [#29157](https://github.com/storybookjs/storybook/pull/29157), thanks @valentinpalkovic!
- Next.js: Fix bundled react and react-dom in monorepos - [#29444](https://github.com/storybookjs/storybook/pull/29444), thanks @sentience!

## 8.4.1

- Core: Relax peer dep constraint of shim packages - [#29503](https://github.com/storybookjs/storybook/pull/29503), thanks @kasperpeulen!

## 8.4.0

Storybook 8.4 comes with a ton of exciting new features designed to give you the best experience developing, testing, and debugging tests in the browser!
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
"version": "8.4.0",
"version": "8.4.7",
"description": "Test component compliance with web accessibility standards",
"keywords": [
"a11y",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-actions",
"version": "8.4.0",
"version": "8.4.7",
"description": "Get UI feedback when an action is performed on an interactive element",
"keywords": [
"storybook",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/backgrounds/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-backgrounds",
"version": "8.4.0",
"version": "8.4.7",
"description": "Switch backgrounds to view components in different settings",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/controls/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-controls",
"version": "8.4.0",
"version": "8.4.7",
"description": "Interact with component inputs dynamically in the Storybook UI",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-docs",
"version": "8.4.0",
"version": "8.4.7",
"description": "Document component usage and properties in Markdown",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/essentials/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-essentials",
"version": "8.4.0",
"version": "8.4.7",
"description": "Curated addons to bring out the best of Storybook",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/gfm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-mdx-gfm",
"version": "8.4.0",
"version": "8.4.7",
"description": "GitHub Flavored Markdown in Storybook",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/highlight/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-highlight",
"version": "8.4.0",
"version": "8.4.7",
"description": "Highlight DOM nodes within your stories",
"keywords": [
"storybook-addons",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/interactions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-interactions",
"version": "8.4.0",
"version": "8.4.7",
"description": "Automate, test and debug user interactions",
"keywords": [
"storybook-addons",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/jest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-jest",
"version": "8.4.0",
"version": "8.4.7",
"description": "React storybook addon that show component jest report",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/links/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-links",
"version": "8.4.0",
"version": "8.4.7",
"description": "Link stories together to build demos and prototypes with your UI components",
"keywords": [
"storybook-addons",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/measure/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-measure",
"version": "8.4.0",
"version": "8.4.7",
"description": "Inspect layouts by visualizing the box model",
"keywords": [
"storybook-addons",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/onboarding/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-onboarding",
"version": "8.4.0",
"version": "8.4.7",
"description": "Storybook Addon Onboarding - Introduces a new onboarding experience",
"keywords": [
"storybook-addons",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/outline/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-outline",
"version": "8.4.0",
"version": "8.4.7",
"description": "Outline all elements with CSS to help with layout placement and alignment",
"keywords": [
"storybook-addons",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/storysource/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storysource",
"version": "8.4.0",
"version": "8.4.7",
"description": "View a story’s source code to see how it works and paste into your app",
"keywords": [
"addon",
Expand Down
3 changes: 2 additions & 1 deletion code/addons/test/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/experimental-addon-test",
"version": "8.4.0",
"version": "8.4.7",
"description": "Integrate Vitest with Storybook",
"keywords": [
"storybook-addons",
Expand Down Expand Up @@ -98,6 +98,7 @@
"execa": "^8.0.1",
"find-up": "^7.0.0",
"formik": "^2.2.9",
"pathe": "^1.1.2",
"picocolors": "^1.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/test/src/node/boot-test-runner.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { type ChildProcess } from 'node:child_process';
import { join } from 'node:path';

import type { Channel } from 'storybook/internal/channels';
import {
Expand All @@ -13,6 +12,7 @@ import {

// eslint-disable-next-line depend/ban-dependencies
import { execaNode } from 'execa';
import { join } from 'pathe';

import { TEST_PROVIDER_ID } from '../constants';
import { log } from '../logger';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/test/src/node/test-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createVitest } from 'vitest/node';

import { Channel, type ChannelTransport } from '@storybook/core/channels';

import path from 'path';
import path from 'pathe';

import { TEST_PROVIDER_ID } from '../constants';
import { TestManager } from './test-manager';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/test/src/node/vitest-manager.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { existsSync } from 'node:fs';
import path, { normalize } from 'node:path';

import type { TestProject, TestSpecification, Vitest, WorkspaceProject } from 'vitest/node';

import type { Channel } from 'storybook/internal/channels';
import type { TestingModuleRunRequestPayload } from 'storybook/internal/core-events';

import path, { normalize } from 'pathe';
import slash from 'slash';

import { log } from '../logger';
Expand Down
40 changes: 24 additions & 16 deletions code/addons/test/src/postinstall.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { existsSync } from 'node:fs';
import * as fs from 'node:fs/promises';
import { writeFile } from 'node:fs/promises';
import { dirname, join, relative } from 'node:path';
import * as path from 'node:path';

import {
JsPackageManagerFactory,
Expand All @@ -16,6 +14,7 @@ import { colors, logger } from 'storybook/internal/node-logger';
// eslint-disable-next-line depend/ban-dependencies
import { execa } from 'execa';
import { findUp } from 'find-up';
import { dirname, extname, join, relative, resolve } from 'pathe';
import picocolors from 'picocolors';
import prompts from 'prompts';
import { coerce, satisfies } from 'semver';
Expand All @@ -27,7 +26,8 @@ import { printError, printInfo, printSuccess, step } from './postinstall-logger'
const ADDON_NAME = '@storybook/experimental-addon-test' as const;
const EXTENSIONS = ['.js', '.jsx', '.ts', '.tsx', '.cts', '.mts', '.cjs', '.mjs'] as const;

const findFile = async (basename: string) => findUp(EXTENSIONS.map((ext) => basename + ext));
const findFile = async (basename: string, extraExtensions: string[] = []) =>
findUp([...EXTENSIONS, ...extraExtensions].map((ext) => basename + ext));

export default async function postInstall(options: PostinstallOptions) {
printSuccess(
Expand Down Expand Up @@ -58,7 +58,9 @@ export default async function postInstall(options: PostinstallOptions) {
'@storybook/experimental-nextjs-vite',
'@storybook/sveltekit',
].includes(info.frameworkPackageName)
? info.frameworkPackageName
? info.frameworkPackageName === '@storybook/nextjs'
? '@storybook/experimental-nextjs-vite'
: info.frameworkPackageName
: info.rendererPackageName &&
['@storybook/react', '@storybook/svelte', '@storybook/vue3'].includes(
info.rendererPackageName
Expand Down Expand Up @@ -242,7 +244,10 @@ export default async function postInstall(options: PostinstallOptions) {
args: ['playwright', 'install', 'chromium', '--with-deps'],
});

const vitestSetupFile = path.resolve(options.configDir, 'vitest.setup.ts');
const fileExtension =
allDeps['typescript'] || (await findFile('tsconfig', ['.json'])) ? 'ts' : 'js';

const vitestSetupFile = resolve(options.configDir, `vitest.setup.${fileExtension}`);
if (existsSync(vitestSetupFile)) {
printError(
'🚨 Oh no!',
Expand All @@ -262,9 +267,9 @@ export default async function postInstall(options: PostinstallOptions) {
logger.plain(`${step} Creating a Vitest setup file for Storybook:`);
logger.plain(colors.gray(` ${vitestSetupFile}`));

const previewExists = EXTENSIONS.map((ext) =>
path.resolve(options.configDir, `preview${ext}`)
).some((config) => existsSync(config));
const previewExists = EXTENSIONS.map((ext) => resolve(options.configDir, `preview${ext}`)).some(
(config) => existsSync(config)
);

await writeFile(
vitestSetupFile,
Expand Down Expand Up @@ -329,10 +334,10 @@ export default async function postInstall(options: PostinstallOptions) {

if (rootConfig) {
// If there's an existing config, we create a workspace file so we can run Storybook tests alongside.
const extname = path.extname(rootConfig);
const browserWorkspaceFile = path.resolve(dirname(rootConfig), `vitest.workspace${extname}`);
const extension = extname(rootConfig);
const browserWorkspaceFile = resolve(dirname(rootConfig), `vitest.workspace${extension}`);
// to be set in vitest config
const vitestSetupFilePath = path.relative(path.dirname(browserWorkspaceFile), vitestSetupFile);
const vitestSetupFilePath = relative(dirname(browserWorkspaceFile), vitestSetupFile);

logger.line(1);
logger.plain(`${step} Creating a Vitest project workspace file:`);
Expand Down Expand Up @@ -371,9 +376,9 @@ export default async function postInstall(options: PostinstallOptions) {
);
} else {
// If there's no existing Vitest/Vite config, we create a new Vitest config file.
const newVitestConfigFile = path.resolve('vitest.config.ts');
const newVitestConfigFile = resolve(`vitest.config.${fileExtension}`);
// to be set in vitest config
const vitestSetupFilePath = path.relative(path.dirname(newVitestConfigFile), vitestSetupFile);
const vitestSetupFilePath = relative(dirname(newVitestConfigFile), vitestSetupFile);

logger.line(1);
logger.plain(`${step} Creating a Vitest project config file:`);
Expand Down Expand Up @@ -431,7 +436,7 @@ const getVitestPluginInfo = (framework: string) => {
let frameworkPluginCall = '';
let frameworkPluginDocs = '';

if (framework === '@storybook/nextjs') {
if (framework === '@storybook/nextjs' || framework === '@storybook/experimental-nextjs-vite') {
frameworkPluginImport =
"import { storybookNextJsPlugin } from '@storybook/experimental-nextjs-vite/vite-plugin';";
frameworkPluginDocs =
Expand Down Expand Up @@ -489,14 +494,17 @@ async function getStorybookInfo({ configDir, packageManager: pkgMgr }: Postinsta
}

const builderPackageJson = await fs.readFile(
`${typeof builder === 'string' ? builder : builder.name}/package.json`,
require.resolve(join(typeof builder === 'string' ? builder : builder.name, 'package.json')),
'utf8'
);
const builderPackageName = JSON.parse(builderPackageJson).name;

let rendererPackageName: string | undefined;
if (renderer) {
const rendererPackageJson = await fs.readFile(`${renderer}/package.json`, 'utf8');
const rendererPackageJson = await fs.readFile(
require.resolve(join(renderer, 'package.json')),
'utf8'
);
rendererPackageName = JSON.parse(rendererPackageJson).name;
}

Expand Down
2 changes: 1 addition & 1 deletion code/addons/test/src/preset.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { readFileSync } from 'node:fs';
import { isAbsolute, join } from 'node:path';

import type { Channel } from 'storybook/internal/channels';
import { checkAddonOrder, getFrameworkName, serverRequire } from 'storybook/internal/common';
Expand All @@ -11,6 +10,7 @@ import {
import { oneWayHash, telemetry } from 'storybook/internal/telemetry';
import type { Options, PresetProperty, StoryId } from 'storybook/internal/types';

import { isAbsolute, join } from 'pathe';
import picocolors from 'picocolors';
import { dedent } from 'ts-dedent';

Expand Down
Loading
Loading