Skip to content

Commit fff79ea

Browse files
authored
Merge pull request #32305 from storybookjs/version-non-patch-from-10.0.0-beta.0
Release: Prerelease 10.0.0-beta.1
2 parents 4236d09 + 6c3505d commit fff79ea

File tree

44 files changed

+1405
-154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1405
-154
lines changed

.github/workflows/generate-sandboxes.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Generate and publish sandboxes
22

33
on:
44
schedule:
5-
- cron: "2 2 */1 * *"
5+
- cron: '2 2 */1 * *'
66
workflow_dispatch:
77
# To test fixes on push rather than wait for the scheduling, do the following:
88
# 1. Uncomment the lines below and add your branch.
@@ -14,8 +14,8 @@ on:
1414
# 4. 👉 DON'T FORGET TO UNDO THE STEPS BEFORE YOU MERGE YOUR CHANGES!
1515

1616
env:
17-
YARN_ENABLE_IMMUTABLE_INSTALLS: "false"
18-
CLEANUP_SANDBOX_NODE_MODULES: "true"
17+
YARN_ENABLE_IMMUTABLE_INSTALLS: 'false'
18+
CLEANUP_SANDBOX_NODE_MODULES: 'true'
1919

2020
defaults:
2121
run:
@@ -32,7 +32,7 @@ jobs:
3232

3333
- uses: actions/setup-node@v4
3434
with:
35-
node-version-file: ".nvmrc"
35+
node-version-file: '.nvmrc'
3636

3737
- name: Setup git user
3838
run: |
@@ -84,7 +84,7 @@ jobs:
8484

8585
- uses: actions/setup-node@v4
8686
with:
87-
node-version-file: ".nvmrc"
87+
node-version-file: '.nvmrc'
8888

8989
- name: Setup git user
9090
run: |

.kiro/steering/product.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Product Overview
2+
3+
Storybook is a frontend workshop for building UI components and pages in isolation. It's a tool for UI development, testing, and documentation that supports multiple frameworks including React, Angular, Vue, Svelte, and many others.
4+
5+
## Core Purpose
6+
7+
- Build bulletproof UI components faster
8+
- Develop UI components in isolation
9+
- Create comprehensive documentation for components
10+
- Enable visual testing and interaction testing
11+
- Support component-driven development workflows
12+
13+
## Key Features
14+
15+
- Multi-framework support (React, Angular, Vue, Svelte, etc.)
16+
- Extensive addon ecosystem for enhanced functionality
17+
- Built-in documentation generation
18+
- Visual testing capabilities
19+
- Component story format (CSF) for organizing examples
20+
- Hot module reloading for fast development
21+
22+
## Target Users
23+
24+
- Frontend developers building component libraries
25+
- Design system teams
26+
- UI/UX designers collaborating with developers
27+
- QA teams performing visual testing
28+
- Documentation writers creating component guides

.kiro/steering/structure.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Project Structure
2+
3+
## Repository Layout
4+
5+
This is a monorepo with the main codebase in the `code/` directory and supporting files at the root level.
6+
7+
```ascii
8+
storybook/
9+
├── code/ # Main codebase (Nx workspace)
10+
│ ├── addons/ # Storybook addons (a11y, docs, jest, etc.)
11+
│ ├── builders/ # Build system integrations
12+
│ ├── core/ # Core Storybook UI and API
13+
│ ├── frameworks/ # Framework-specific implementations
14+
│ ├── lib/ # CLI tools and utilities
15+
│ ├── presets/ # Configuration presets
16+
│ ├── renderers/ # Framework renderers
17+
│ └── sandbox/ # Development sandboxes
18+
├── docs/ # Documentation source files
19+
├── scripts/ # Build and automation scripts
20+
├── test-storybooks/ # Integration test projects
21+
└── sandbox/ # Generated sandbox environments
22+
```
23+
24+
## Code Organization
25+
26+
### Core Packages (`code/`)
27+
28+
- **`core/`**: Main Storybook application (manager UI, preview, server)
29+
- **`addons/`**: Official addons (a11y, docs, jest, links, etc.)
30+
- **`frameworks/`**: Framework-specific integrations (angular, nextjs, sveltekit), usually a combination of a renderer and a builder
31+
- **`renderers/`**: Pure framework renderers (react, vue3, svelte)
32+
- **`builders/`**: Build tool integrations (vite, webpack5)
33+
- **`lib/`**: Utilities and CLI tools (cli-sb, codemod, create-storybook)
34+
- **`presets/`**: Webpack configuration presets for popular setups
35+
36+
### Package Naming Conventions
37+
38+
- Renderer packages: `@storybook/{renderer}` (e.g., `@storybook/react`)
39+
- Framework + builder: `@storybook/{renderer}-{builder}` OR `@storybook/{framework}` (e.g., `@storybook/react-vite`, `@storybook/sveltekit`)
40+
- Addons: `@storybook/addon-{name}` (e.g., `@storybook/addon-docs`)
41+
- Builders: `@storybook/builder-{name}` (e.g., `@storybook/builder-vite`)
42+
- Presets: `@storybook/preset-{name}` (e.g., `@storybook/preset-create-react-app`)
43+
44+
## File Conventions
45+
46+
### TypeScript Configuration
47+
48+
- Strict TypeScript with `noImplicitAny: true`
49+
- Module resolution: `bundler` mode
50+
- Target: `ES2020`
51+
- JSX: `preserve` mode
52+
53+
### Code Style
54+
55+
- **Prettier**: 100 character line width, single quotes, trailing commas
56+
- **Import Order**: Node modules → testing → React → Storybook internal → third-party → relative
57+
- **File Extensions**: Prefer `.ts`/`.tsx` over `.js`/`.jsx`
58+
- **Naming**: Use kebab-case for files, PascalCase for components
59+
60+
### Testing Structure
61+
62+
- **Unit Tests**: `*.test.ts` files alongside source code
63+
- **E2E Tests**: `code/e2e-tests/` directory with Playwright
64+
- **Stories**: `*.stories.ts` files for component examples
65+
- **Mocks**: `__mocks__/` directories for test fixtures
66+
67+
### Documentation
68+
69+
- **API Docs**: JSDoc comments with TSDoc format
70+
- **README**: Each package should have comprehensive README
71+
- **Stories**: Use Component Story Format (CSF) 3.0
72+
- **Migration Guides**: Document breaking changes
73+
74+
## Development Patterns
75+
76+
### Monorepo Workflow
77+
78+
1. All development happens in `code/` directory
79+
2. Use `yarn build --watch` for active development
80+
3. Nx handles dependency graph and caching
81+
4. All packages are versioned and released together
82+
83+
### Package Dependencies
84+
85+
- **Internal**: Use `workspace:*` for internal package references
86+
- **Peer Dependencies**: Framework packages are peer dependencies
87+
- **Dev Dependencies**: Testing and build tools in root package.json
88+
89+
### Build Outputs
90+
91+
- **`dist/`**: Compiled JavaScript and type definitions
92+
- **`template/`**: Framework-specific template files
93+
- **`*.d.ts`**: TypeScript declaration files
94+
95+
### Sandbox Development
96+
97+
- Use `yarn start` for quick React TypeScript sandbox
98+
- Use `yarn task` for custom framework/template selection
99+
- Sandboxes are generated in `sandbox/` directory
100+
- Link mode connects to local packages for development

.kiro/steering/tech.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Technology Stack
2+
3+
## Build System & Package Management
4+
5+
- **Monorepo**: Managed with Nx for build orchestration and caching
6+
- **Package Manager**: Yarn 4 with workspaces
7+
- **Node.js**: Version 22+ (specified in .nvmrc)
8+
- **Build Tool**: Custom build scripts with esbuild and Vite integration
9+
10+
## Core Technologies
11+
12+
- **TypeScript**: Primary language with strict configuration
13+
- **React**: Main UI framework for Storybook's own interface
14+
- **Vite**: Build tool and dev server for modern frameworks
15+
- **Webpack 5**: Alternative bundler support
16+
- **ESBuild**: Fast JavaScript bundler and minifier
17+
18+
## Testing & Quality
19+
20+
- **Vitest**: Primary test runner with coverage via Istanbul
21+
- **Playwright**: End-to-end testing framework
22+
- **ESLint**: Code linting with extensive custom rules
23+
- **Prettier**: Code formatting with custom plugins
24+
- **Chromatic**: Visual testing and review
25+
26+
## Development Workflow
27+
28+
- **Hot Module Reloading**: Fast development feedback
29+
- **Watch Mode**: Automatic rebuilds during development
30+
- **Parallel Builds**: Nx orchestrates parallel package builds
31+
- **Caching**: Aggressive build and test caching via Nx
32+
33+
## Common Commands
34+
35+
### Development
36+
37+
```bash
38+
# Start development environment with React TypeScript sandbox
39+
yarn start
40+
41+
# Start with custom template selection
42+
yarn task
43+
44+
# Build specific packages in watch mode
45+
cd code && yarn build --watch <package-names>
46+
47+
# Run Storybook UI development server
48+
yarn storybook:ui
49+
50+
# Create a standalone sandbox to develop against a specific framework
51+
yarn task --task sandbox
52+
```
53+
54+
### Testing
55+
56+
```bash
57+
# Run all tests
58+
yarn test
59+
60+
# Run tests in watch mode
61+
yarn test:watch
62+
63+
# Run specific package tests
64+
yarn nx test <package-name>
65+
66+
# Run E2E tests
67+
yarn playwright test
68+
```
69+
70+
### Building
71+
72+
```bash
73+
# Build all packages
74+
yarn build
75+
76+
# Build in production mode (required for Angular)
77+
yarn build --prod
78+
79+
# Build with watch mode
80+
yarn build --watch
81+
82+
# Build specific packages
83+
yarn build <package-1> <package-2>
84+
```
85+
86+
### Linting & Formatting
87+
88+
```bash
89+
# Lint JavaScript/TypeScript
90+
yarn lint:js
91+
92+
# Lint markdown and code samples
93+
yarn lint:md
94+
95+
# Auto-fix linting issues
96+
yarn lint:js --fix
97+
98+
# Format code with Prettier
99+
yarn lint:prettier
100+
```
101+
102+
## Framework Support
103+
104+
Storybook supports multiple frontend frameworks through dedicated packages:
105+
106+
- React (react, react-vite, react-webpack5)
107+
- Angular (angular)
108+
- Vue (vue3, vue3-vite)
109+
- Svelte (svelte, svelte-vite, sveltekit)
110+
- Web Components (web-components, web-components-vite)
111+
- HTML (html, html-vite)
112+
- Preact (preact, preact-vite)
113+
- Next.js (nextjs, nextjs-vite)

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 9.1.3
2+
3+
- Docs: Move button in ArgsTable heading to fix screenreader announcements - [#32238](https://github.com/storybookjs/storybook/pull/32238), thanks @Sidnioulz!
4+
- Mock: Catch errors when transforming preview files - [#32216](https://github.com/storybookjs/storybook/pull/32216), thanks @valentinpalkovic!
5+
- Next.js: Fix version mismatch error in Webpack - [#32306](https://github.com/storybookjs/storybook/pull/32306), thanks @valentinpalkovic!
6+
- Telemetry: Disambiguate traffic coming from error/upgrade links - [#32287](https://github.com/storybookjs/storybook/pull/32287), thanks @shilman!
7+
- Telemetry: Disambiguate unattributed traffic from Onboarding - [#32286](https://github.com/storybookjs/storybook/pull/32286), thanks @shilman!
8+
19
## 9.1.2
210

311
- Addon Docs: Fix Symbol conversion issue in docs page and controls panel - [#32220](https://github.com/storybookjs/storybook/pull/32220), thanks @yannbf!

CHANGELOG.prerelease.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## 10.0.0-beta.1
2+
3+
- AddonA11Y: Fix postinstall - [#32309](https://github.com/storybookjs/storybook/pull/32309), thanks @ndelangen!
4+
- Angular: Properly merge builder options and browserTarget options - [#32272](https://github.com/storybookjs/storybook/pull/32272), thanks @kroeder!
5+
- Core: Optimize bundlesize, by reusing internal/babel in mocking-utils - [#32350](https://github.com/storybookjs/storybook/pull/32350), thanks @ndelangen!
6+
- Core: Update tags filter UI - [#32343](https://github.com/storybookjs/storybook/pull/32343), thanks @ghengeveld!
7+
- Next.js: Avoid multiple webpack versions at runtime - [#32313](https://github.com/storybookjs/storybook/pull/32313), thanks @valentinpalkovic!
8+
- Next.js: Fix version mismatch error in Webpack - [#32306](https://github.com/storybookjs/storybook/pull/32306), thanks @valentinpalkovic!
9+
- Svelte & Vue: Add framework-specific `docgen` option to disable docgen processing - [#32319](https://github.com/storybookjs/storybook/pull/32319), thanks @copilot-swe-agent!
10+
- Svelte: Support `@sveltejs/vite-plugin-svelte` v6 - [#32320](https://github.com/storybookjs/storybook/pull/32320), thanks @JReinhold!
11+
- Update: Satellite repos after major version bump - [#32303](https://github.com/storybookjs/storybook/pull/32303), thanks @ndelangen!
12+
113
## 10.0.0-beta.0
214

315
- Core: Fix staticCopy not copying `index.html` to sub directory - [#32259](https://github.com/storybookjs/storybook/pull/32259), thanks @ndelangen!

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ import { dedent } from 'ts-dedent';
77
import { JsPackageManager } from './JsPackageManager';
88
import { Yarn1Proxy } from './Yarn1Proxy';
99

10+
vi.mock('node:process', async (importOriginal) => {
11+
const original: any = await importOriginal();
12+
return {
13+
...original,
14+
default: {
15+
...original.default,
16+
env: {
17+
...original.default.env,
18+
CI: false,
19+
},
20+
},
21+
};
22+
});
23+
1024
describe('Yarn 1 Proxy', () => {
1125
let yarn1Proxy: Yarn1Proxy;
1226

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { existsSync, readFileSync } from 'node:fs';
22
import { join } from 'node:path';
3+
import process from 'node:process';
34

45
import { prompt } from 'storybook/internal/node-logger';
56
import { FindPackageVersionsError } from 'storybook/internal/server-errors';
@@ -36,7 +37,7 @@ export class Yarn1Proxy extends JsPackageManager {
3637

3738
getInstallArgs(): string[] {
3839
if (!this.installArgs) {
39-
this.installArgs = ['--ignore-workspace-root-check'];
40+
this.installArgs = process.env.CI ? [] : ['--ignore-workspace-root-check'];
4041
}
4142
return this.installArgs;
4243
}

code/core/src/components/components/tooltip/ListItem.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ const Right = styled.span<RightProps>({
5454
margin: '3px 0',
5555
verticalAlign: 'top',
5656
},
57-
'& path': {
58-
fill: 'inherit',
59-
},
6057
});
6158

6259
const Center = styled.span<{ isIndented: boolean }>(

code/core/src/components/components/tooltip/WithTooltip.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ export interface WithTooltipPureProps
4444
* @default false
4545
*/
4646
closeOnOutsideClick?: boolean;
47+
/**
48+
* Optional container to portal the tooltip into. Can be a CSS selector string or a DOM Element.
49+
* Falls back to document.body.
50+
*/
51+
portalContainer?: Element | string | null;
4752
}
4853

4954
// Pure, does not bind to the body
@@ -87,6 +92,7 @@ const WithTooltipPure = ({
8792
strategy,
8893
followCursor,
8994
onVisibleChange,
95+
portalContainer,
9096
...props
9197
}: WithTooltipPureProps) => {
9298
const Container = svg ? TargetSvgContainer : TargetContainer;
@@ -119,6 +125,11 @@ const WithTooltipPure = ({
119125
}
120126
);
121127

128+
const portalTarget: Element =
129+
(typeof portalContainer === 'string'
130+
? document.querySelector(portalContainer)
131+
: portalContainer) || document.body;
132+
122133
const tooltipComponent = isVisible ? (
123134
<Tooltip
124135
placement={state?.placement}
@@ -138,7 +149,7 @@ const WithTooltipPure = ({
138149
<Container trigger={trigger} ref={setTriggerRef as any} {...(props as any)}>
139150
{children}
140151
</Container>
141-
{isVisible && ReactDOM.createPortal(tooltipComponent, document.body)}
152+
{isVisible && ReactDOM.createPortal(tooltipComponent, portalTarget)}
142153
</>
143154
);
144155
};

0 commit comments

Comments
 (0)