Skip to content
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/nx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

runs-on: ubuntu-latest
env:
ALL_TASKS: compile,check,knip,test,pretty-docs,lint,sandbox,build,e2e-tests,e2e-tests-dev,test-runner,vitest-integration,check-sandbox,e2e-ui,jest,vitest,playwright-ct
ALL_TASKS: compile,check,knip,test,lint,fmt,sandbox,build,e2e-tests,e2e-tests-dev,test-runner,vitest-integration,check-sandbox,e2e-ui,jest,vitest,playwright-ct
steps:
- uses: actions/checkout@v4
with:
Expand Down
4 changes: 0 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
if [ -z "$SKIP_STORYBOOK_GIT_HOOKS" ]; then
cd code
yarn lint-staged

cd ../scripts
yarn lint-staged
fi
11 changes: 11 additions & 0 deletions .lintstagedrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { detectAgent } from 'std-env';

const fmtCmd = detectAgent().name ? 'oxfmt' : 'oxfmt --check';

export default {
'code/**/*.{js,jsx,mjs,ts,tsx,html,json}': [fmtCmd, 'yarn --cwd code lint:js:cmd'],
'scripts/**/*.{html,js,json,jsx,mjs,ts,tsx}': ['yarn --cwd scripts lint:js:cmd'],
'docs/_snippets/**/*.{js,jsx,mjs,ts,tsx,html,json}': [fmtCmd],
'**/*.ejs': ['yarn --cwd scripts exec ejslint'],
'**/package.json': ['yarn --cwd scripts lint:package'],
};
1 change: 0 additions & 1 deletion .nx/workflows/distribution-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ assignment-rules:
- targets:
- check
- lint
- pretty-docs
- knip
run-on:
- agent: linux-js
Expand Down
65 changes: 54 additions & 11 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 100,
"tabWidth": 2,
"bracketSpacing": true,
Expand All @@ -7,20 +8,62 @@
"arrowParens": "always",
"sortPackageJson": false,
"ignorePatterns": [
"code",
"test-storybooks",
"node_modules",
"*.bundle.js",
"*.js.map",
".yarn",
".nx",
".vscode",
".github",
"*.md",
"*.mdx",
".nx/cache",
".nx/workspace-data",
"dist",
"build",
"bench",
"coverage",
"node_modules",
"storybook-static",
"built-storybooks",
"ember-output",
"code/core/assets",
"code/core/report",
"code/core/src/core-server/presets/common-manager.ts",
"code/core/src/core-server/utils/__search-files-tests__",
"code/core/src/core-server/utils/__mockdata__/src/Empty.stories.ts",
"code/lib/codemod/src/transforms/__testfixtures__",
"code/frameworks/angular/template/**",
"code/lib/eslint-plugin",
"docs/versions/*.json",
".prettierrc",
"test-storybooks",
"*.yml",
"*.yaml",
"docs/versions",
"CHANGELOG*",
"MIGRATION*",
"CONTRIBUTING*"
"*.md",
"*.mdx",
"!docs/_snippets/**"
],
"overrides": [
{
"files": ["docs/_snippets/**"],
"options": {
"trailingComma": "all"
}
},
{
"files": ["*.md", "*.mdx"],
"options": {
"importOrderSeparation": false,
"importOrderSortSpecifiers": false
}
},
{
"files": ["*.component.html"],
"options": {
"parser": "angular"
}
},
{
"files": ["**/frameworks/angular/src/**/*.ts", "**/frameworks/angular/template/**/*.ts"],
"options": {
"parser": "babel-ts"
}
}
]
}
5 changes: 3 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig",
"unifiedjs.vscode-mdx",
"yzhang.markdown-all-in-one"
"yzhang.markdown-all-in-one",
"oxc.oxc-vscode"
]
}
}
44 changes: 24 additions & 20 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
{
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true
},
"[javascriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true
},
"[typescript]": {
"[javascript][javascriptreact][typescript][typescriptreact][json][jsonc]": {
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true
},
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
"source.fixAll.eslint": "explicit",
"source.fixAll.oxc": "explicit"
},
"editor.formatOnSave": true,
"[mdx]": {
"editor.formatOnSave": false
},
"editor.tabSize": 2,
"eslint.format.enable": true,
"eslint.options": {
"cache": true,
"cacheLocation": ".cache/eslint",
"extensions": [".js", ".jsx", ".mjs", ".json", ".ts", ".tsx"]
"extensions": [
".js",
".jsx",
".mjs",
".json",
".ts",
".tsx"
]
},
"eslint.useESLintClass": true,
"eslint.validate": [
Expand All @@ -35,9 +33,13 @@
"typescript",
"typescriptreact"
],
"eslint.workingDirectories": ["./code", "./scripts"],
"eslint.workingDirectories": [
"./code",
"./scripts"
],
"files.associations": {
"*.js": "javascriptreact"
"*.js": "javascriptreact",
".oxfmtrc.json": "json"
},
"javascript.preferences.importModuleSpecifier": "relative",
"javascript.preferences.quoteStyle": "single",
Expand All @@ -48,7 +50,9 @@
"typescript.preferences.preferTypeOnlyAutoImports": true,
"typescript.preferences.quoteStyle": "single",
"typescript.preferGoToSourceDefinition": true,
"typescript.tsdk": "./typescript/lib",
"typescript.tsdk": "./node_modules/typescript/lib",
"vitest.workspaceConfig": "./code/vitest.workspace.ts",
"vitest.rootConfig": "./code/vitest.workspace.ts",
}
"oxc.fmt.configPath": ".oxfmtrc.json",
"oxc.enable.oxlint": false,
}
4 changes: 4 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ Use Storybook loggers instead of raw `console.*` in normal code paths:
- Server-side: `storybook/internal/node-logger`
- Client-side: `storybook/internal/client-logger`

For TypeScript source in the repo, prefer explicit file extensions for relative code imports and exports such as `./foo.ts` or `./bar.tsx` when the target is another TS/JS module in this repository. Keep framework-specific component imports like `.vue` and `.svelte` in the form already expected by their package tooling.

The pre-commit hook automatically detects AI agents (via `std-env`) and switches from check-only to write mode, so formatting is auto-fixed when agents commit.

Avoid `console.log`, `console.warn`, and `console.error` unless the file is isolated enough that importing the logger is not reasonable.

## Troubleshooting
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 10.3.4

- Addon-a11y: Clear status transition timer on unmount to prevent test flake - [#34203](https://github.com/storybookjs/storybook/pull/34203), thanks @mixelburg!
- Bug: Skip re-processing already transformed config files for CSF factories - [#34273](https://github.com/storybookjs/storybook/pull/34273), thanks @huang-julien!
- Builder-Vite: Use djb2 hash to prevent variable name collisions in builder-vite - [#34274](https://github.com/storybookjs/storybook/pull/34274), thanks @chida09!
- CLI: Prompt for init crash reports - [#34316](https://github.com/storybookjs/storybook/pull/34316), thanks @JReinhold!
- CSF4: Fix duplicate preview loading issue in Vitest - [#34361](https://github.com/storybookjs/storybook/pull/34361), thanks @valentinpalkovic!
- Core: Fix WebSocket connection for StackBlitz/WebContainers - [#34281](https://github.com/storybookjs/storybook/pull/34281), thanks @ghengeveld!
- React-Docgen: Try .tsx fallback when resolving .js ESM imports in docgen resolvers - [#34393](https://github.com/storybookjs/storybook/pull/34393), thanks @mixelburg!
- React-Vite: Upgrade @joshwooding/vite-plugin-react-docgen-typescript to 0.7.0 - [#34335](https://github.com/storybookjs/storybook/pull/34335), thanks @beeswhacks!

## 10.3.3

- Addon-Vitest: Streamline vite(st) config detection across init and postinstall - [#34193](https://github.com/storybookjs/storybook/pull/34193), thanks @valentinpalkovic!
Expand Down
44 changes: 44 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
## 10.4.0-alpha.7

- CLI: Explicitly tell whether smoke tests passed or failed - [#34419](https://github.com/storybookjs/storybook/pull/34419), thanks @Sidnioulz!
- Core: Add `ChangeDetectionService` and wire up builder-vite - [#34369](https://github.com/storybookjs/storybook/pull/34369), thanks @ghengeveld!
- Maintenance: Extract parseFilterParam shared helper from tags and statuses modules - [#34436](https://github.com/storybookjs/storybook/pull/34436), thanks @mixelburg!
- Sidebar: Add status-based filtering with refactored status architecture - [#34339](https://github.com/storybookjs/storybook/pull/34339), thanks @valentinpalkovic!
- UI: Fix global shortcuts not showing region focus indicator - [#34201](https://github.com/storybookjs/storybook/pull/34201), thanks @Sidnioulz!

## 10.4.0-alpha.6

- Builder-Vite: Add onModuleGraphChange method - [#34323](https://github.com/storybookjs/storybook/pull/34323), thanks @ghengeveld!
- CLI: Add automigrate check for 'storybook' package name conflict - [#34290](https://github.com/storybookjs/storybook/pull/34290), thanks @whdjh!
- CLI: Prompt for init crash reports - [#34316](https://github.com/storybookjs/storybook/pull/34316), thanks @JReinhold!
- CSF4: Fix duplicate preview loading issue in Vitest - [#34361](https://github.com/storybookjs/storybook/pull/34361), thanks @valentinpalkovic!
- Maintenance: Add assertions outside step incorrectly nested in interactions panel - [#34296](https://github.com/storybookjs/storybook/pull/34296), thanks @majiayu000!
- Maintenance: Extract getBuilderOptions helper across framewo… - [#34260](https://github.com/storybookjs/storybook/pull/34260), thanks @alex-js-ltd!
- Maintenance: Use errorToErrorLike in boot-test-runner for consistent stack deduplication - [#34385](https://github.com/storybookjs/storybook/pull/34385), thanks @mixelburg!
- Onboarding: Fix checklist MDX instructions - [#33193](https://github.com/storybookjs/storybook/pull/33193), thanks @kylegach!
- React-Docgen: Add tsconfig fallback chain and warning for monorepos - [#34353](https://github.com/storybookjs/storybook/pull/34353), thanks @viditkbhatnagar!
- React-Docgen: Try .tsx fallback when resolving .js ESM imports in docgen resolvers - [#34393](https://github.com/storybookjs/storybook/pull/34393), thanks @mixelburg!
- UI: Fix mobile navigation when renderLabel returns a React node - [#34262](https://github.com/storybookjs/storybook/pull/34262), thanks @Nathan54Villaume!
- Vite: Use vite hook filter for performance improvements - [#34022](https://github.com/storybookjs/storybook/pull/34022), thanks @huang-julien!

## 10.4.0-alpha.5

- Addon-a11y: Clear status transition timer on unmount to prevent test flake - [#34203](https://github.com/storybookjs/storybook/pull/34203), thanks @mixelburg!
- Builder-Vite: Use djb2 hash to prevent variable name collisions in builder-vite - [#34274](https://github.com/storybookjs/storybook/pull/34274), thanks @chida09!
- CLI: Fix Next.js Vite automigration corrupting configs already using `@storybook/nextjs-vite` - [#34249](https://github.com/storybookjs/storybook/pull/34249), thanks @nathanjessen!
- Core: Add changeDetection feature flag - [#34314](https://github.com/storybookjs/storybook/pull/34314), thanks @valentinpalkovic!
- Manager: URL-based tag filter state + filter-aware initial story selection - [#34283](https://github.com/storybookjs/storybook/pull/34283), thanks @valentinpalkovic!
- React-Vite: Upgrade @joshwooding/vite-plugin-react-docgen-typescript to 0.7.0 - [#34335](https://github.com/storybookjs/storybook/pull/34335), thanks @beeswhacks!
- Refactor: Extract shared `PseudoStateGrid` component in pseudo-states stories - [#34334](https://github.com/storybookjs/storybook/pull/34334), thanks @copilot-swe-agent!

## 10.4.0-alpha.4

- Addon-Docs: Add Reset story button to re-render stories in docs - [#34086](https://github.com/storybookjs/storybook/pull/34086), thanks @6810779s!
- Code: Fix inline code blocks inside links removing link affordance - [#33903](https://github.com/storybookjs/storybook/pull/33903), thanks @yatishgoel!
- Controls: Add maxPresetColors option to ColorControl - [#33998](https://github.com/storybookjs/storybook/pull/33998), thanks @mixelburg!
- Core: Fix WebSocket connection for StackBlitz/WebContainers - [#34281](https://github.com/storybookjs/storybook/pull/34281), thanks @ghengeveld!
- Dependencies: Update `vite-plugin-storybook-nextjs` to ^3.2.4 - [#34280](https://github.com/storybookjs/storybook/pull/34280), thanks @k35o!
- React: Add component metadata extraction via Volar-style LanguageService - [#33914](https://github.com/storybookjs/storybook/pull/33914), thanks @kasperpeulen!
- StatusValue: Add 'status-value:<new|modified|affected>' - [#34305](https://github.com/storybookjs/storybook/pull/34305), thanks @valentinpalkovic!
- UI: Ensure Controls panel can scroll horizontally for now - [#34248](https://github.com/storybookjs/storybook/pull/34248), thanks @Sidnioulz!

## 10.4.0-alpha.3

- Addon-Vitest: Streamline vite(st) config detection across init and postinstall - [#34193](https://github.com/storybookjs/storybook/pull/34193), thanks @valentinpalkovic!
Expand Down
26 changes: 26 additions & 0 deletions code/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,5 +229,31 @@ module.exports = {
'storybook/no-renderer-packages': 'off',
},
},
{
files: ['**/*.ts', '**/*.tsx'],
excludedFiles: [
'**/*.d.ts',
'**/docs/**/*',
'**/template/**/*',
'**/templates/**/*',
'**/__testfixtures__/**/*',
'**/__mocks-ng-workspace__/**/*',
],
rules: {
'import-x/extensions': [
'error',
'always',
{
ignorePackages: true,
checkTypeImports: true,
fix: true,
pathGroupOverrides: [
{ pattern: 'storybook/**', action: 'ignore' },
{ pattern: '@storybook/**', action: 'ignore' },
],
},
],
},
},
],
};
34 changes: 0 additions & 34 deletions code/.oxfmtrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion code/.storybook/bench/bench.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import type { Meta } from '@storybook/react-vite';

import { safeMetafileArg } from '../../../scripts/bench/safe-args';
import { safeMetafileArg } from '../../../scripts/bench/safe-args.ts';

// @ts-expect-error - TS doesn't know about import.meta.glob from Vite
const allMetafiles = import.meta.glob('../../bench/esbuild-metafiles/**/*.json', {
Expand Down
8 changes: 4 additions & 4 deletions code/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import {
useTheme,
} from 'storybook/theming';

import { DocsPageWrapper } from '../addons/docs/src/blocks/components';
import * as templatePreview from '../core/template/stories/preview';
import '../renderers/react/template/components/index';
import { isChromatic } from './isChromatic';
import { DocsPageWrapper } from '../addons/docs/src/blocks/components/index.ts';
import * as templatePreview from '../core/template/stories/preview.ts';
import '../renderers/react/template/components/index.js';
import { isChromatic } from './isChromatic.ts';

sb.mock(import('@storybook/global'), { spy: true });

Expand Down
2 changes: 1 addition & 1 deletion code/.storybook/storybook.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { setProjectAnnotations } from '@storybook/react';

import { userEvent as storybookEvent, expect as storybookExpect } from 'storybook/test';

import preview from './preview';
import preview from './preview.tsx';

vi.spyOn(console, 'warn').mockImplementation((...args) => console.log(...args));

Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/build-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BuildEntries } from '../../../scripts/build/utils/entry-utils';
import type { BuildEntries } from '../../../scripts/build/utils/entry-utils.ts';

const config: BuildEntries = {
entries: {
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": "10.4.0-alpha.3",
"version": "10.4.0-alpha.7",
"description": "Storybook Addon A11y: Test UI component compliance with WCAG web accessibility standards",
"keywords": [
"a11y",
Expand Down
Loading
Loading