Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
250127b
Refactor root of yarn monorepo from code to the git root. And NX agen…
kasperpeulen Nov 18, 2025
ec6d354
Fix distribution config
kasperpeulen Nov 27, 2025
3b0a2d7
Fix pretty docs
kasperpeulen Nov 27, 2025
7733316
Fix check
kasperpeulen Nov 27, 2025
69fbe0c
Clean up last things
kasperpeulen Nov 27, 2025
fbc2af4
Make sure the settings.json is deleted before the onboarding test.
kasperpeulen Nov 27, 2025
ac61afb
Update scripts/run-registry.ts
kasperpeulen Nov 27, 2025
ec1bd5d
Fix lint
kasperpeulen Nov 28, 2025
81a8497
Merge remote-tracking branch 'origin/kasper/yarn-monorepo-refactor' i…
kasperpeulen Nov 28, 2025
69106f4
Fix
kasperpeulen Nov 28, 2025
f35970d
Fix
kasperpeulen Nov 28, 2025
d80cf75
Fix
kasperpeulen Nov 28, 2025
c31e808
Merge remote-tracking branch 'origin/next' into kasper/yarn-monorepo-…
kasperpeulen Nov 28, 2025
ae1ebf8
Fix
kasperpeulen Nov 28, 2025
f04dd28
Cleanup
kasperpeulen Nov 28, 2025
d58d659
Make ports backwards compatible for local dev
kasperpeulen Nov 28, 2025
4446340
Remove TODOs
kasperpeulen Nov 28, 2025
5dd20f9
Revert
kasperpeulen Nov 28, 2025
7c89c17
Fix
kasperpeulen Nov 28, 2025
6e6a31c
Fix
kasperpeulen Nov 28, 2025
02e22fa
Fix
kasperpeulen Nov 28, 2025
40cdf8b
Fix
kasperpeulen Nov 28, 2025
39a4409
Fix
kasperpeulen Nov 28, 2025
b4b8b24
Fix
kasperpeulen Nov 28, 2025
729408e
Only move sandboxes to cache when NX is used
kasperpeulen Nov 28, 2025
b9a60d1
Fix build
kasperpeulen Nov 28, 2025
c7244fa
Fix
kasperpeulen Nov 28, 2025
73841fd
Fix
kasperpeulen Nov 28, 2025
a4f5eda
Fix
kasperpeulen Nov 28, 2025
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
56 changes: 29 additions & 27 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jobs:
- run:
command: |
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task bench)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
yarn workspace @storybook/scripts prepare-sandbox --template $TEMPLATE --no-link
name: Install sandbox dependencies
- run:
command: yarn task --task bench --template $(yarn get-template --cadence << pipeline.parameters.workflow >> --task bench) --no-link --start-from=never --junit
Expand All @@ -199,10 +199,11 @@ jobs:
clone_options: --depth 1 --verbose
- restore_cache:
keys:
- build-yarn-2-cache-v5--{{ checksum "code/yarn.lock" }}--{{ checksum "scripts/yarn.lock" }}
- build-yarn-2-cache-v5--{{ checksum "yarn.lock" }}
name: Restore Yarn cache
- run:
command: |
yarn
yarn task --task compile --start-from=auto --no-link --debug
git diff --exit-code
yarn dedupe --check
Expand All @@ -216,12 +217,13 @@ jobs:
- store_artifacts:
path: code/bench/esbuild-metafiles
- save_cache:
key: build-yarn-2-cache-v5--{{ checksum "code/yarn.lock" }}--{{ checksum "scripts/yarn.lock" }}
key: build-yarn-2-cache-v5--{{ checksum "yarn.lock" }}
name: Save Yarn cache
paths:
- ~/.yarn/berry/cache
- persist_to_workspace:
paths:
- node_modules
- code/node_modules
- code/addons
- scripts/node_modules
Expand All @@ -247,10 +249,11 @@ jobs:
workflow-name: << pipeline.parameters.workflow >>
- restore_cache:
keys:
- build-yarn-2-cache-v5--{{ checksum "code/yarn.lock" }}--{{ checksum "scripts/yarn.lock" }}
- build-yarn-2-cache-v5--{{ checksum "yarn.lock" }}
name: Restore Yarn cache
- run:
command: |
yarn
yarn task --task compile --start-from=auto --no-link --debug
name: Compile
- run:
Expand Down Expand Up @@ -279,7 +282,7 @@ jobs:
- run:
command: |
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task check-sandbox)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
yarn workspace @storybook/scripts prepare-sandbox --template $TEMPLATE --no-link
name: Install sandbox dependencies
- run:
command: yarn task --task check-sandbox --template $(yarn get-template --cadence << pipeline.parameters.workflow >> --task check-sandbox) --no-link --start-from=never --junit
Expand Down Expand Up @@ -307,7 +310,7 @@ jobs:
path: test-results
chromatic-sandboxes:
executor:
class: medium
class: medium+
name: sb_node_22_browsers
parallelism: << parameters.parallelism >>
parameters:
Expand All @@ -317,13 +320,19 @@ jobs:
- checkout
- attach_workspace:
at: .
- run:
background: true
command: |
cd code
yarn local-registry --open
name: Verdaccio
- run:
command: |
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task chromatic)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
SANDBOX_ROOT=./sandbox yarn workspace @storybook/scripts prepare-sandbox --template $TEMPLATE --no-link
name: Install sandbox dependencies
- run:
command: yarn task --task chromatic --template $(yarn get-template --cadence << pipeline.parameters.workflow >> --task chromatic) --no-link --start-from=never --junit
command: SANDBOX_ROOT=./sandbox yarn task --task chromatic --template $(yarn get-template --cadence << pipeline.parameters.workflow >> --task chromatic) --no-link --start-from=never --junit
name: Running Chromatic
- report-workflow-on-failure:
template: $(yarn get-template --cadence << pipeline.parameters.workflow >> --task chromatic)
Expand Down Expand Up @@ -370,7 +379,7 @@ jobs:
if [[ $TEMPLATE != bench/* ]]; then
yarn --cwd scripts jiti ./event-log-checker.ts build $TEMPLATE
fi
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && rm -rf node_modules
cd $(yarn get-sandbox-dir --template $TEMPLATE) && rm -rf node_modules
environment:
STORYBOOK_TELEMETRY_DEBUG: 1
STORYBOOK_TELEMETRY_URL: http://localhost:6007/event-log
Expand Down Expand Up @@ -399,7 +408,7 @@ jobs:
- run:
command: |
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task e2e-tests-dev)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
yarn workspace @storybook/scripts prepare-sandbox --template $TEMPLATE --no-link
name: Install sandbox dependencies
- run:
command: |
Expand Down Expand Up @@ -429,7 +438,7 @@ jobs:
- run:
command: |
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task e2e-tests)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
yarn workspace @storybook/scripts prepare-sandbox --template $TEMPLATE --no-link
name: Install sandbox dependencies
- run:
command: |
Expand Down Expand Up @@ -527,22 +536,21 @@ jobs:
- cancel-workflow-on-failure
pretty-docs:
executor:
class: medium
class: medium+
name: sb_node_22_classic
steps:
- git-shallow-clone/checkout_advanced:
clone_options: --depth 1 --verbose
- restore_cache:
keys:
- prettydocs-yarn-2-cache-v8--{{ checksum "code/yarn.lock" }}--{{ checksum "scripts/yarn.lock" }}
- prettydocs-yarn-2-cache-v8--{{ checksum "yarn.lock" }}
name: Restore Yarn cache
- run:
command: |
cd scripts
yarn install
name: Install
command: |
yarn install
name: Install
- save_cache:
key: prettydocs-yarn-2-cache-v8--{{ checksum "code/yarn.lock" }}--{{ checksum "scripts/yarn.lock" }}
key: prettydocs-yarn-2-cache-v8--{{ checksum "yarn.lock" }}
name: Save Yarn cache
paths:
- ~/.yarn/berry/cache
Expand Down Expand Up @@ -779,12 +787,6 @@ jobs:
command: yarn install
name: Install code dependencies
shell: bash.exe
working_directory: code
- run:
command: yarn install
name: Install script dependencies
shell: bash.exe
working_directory: scripts
- when:
condition:
equal:
Expand Down Expand Up @@ -959,7 +961,7 @@ jobs:
name: Storybook init for features
test-portable-stories:
executor:
class: medium
class: medium+
name: sb_playwright
parameters:
directory:
Expand Down Expand Up @@ -1028,7 +1030,7 @@ jobs:
- run:
command: |
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task test-runner)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
yarn workspace @storybook/scripts prepare-sandbox --template $TEMPLATE --no-link
name: Install sandbox dependencies
- start-event-collector
- run:
Expand Down Expand Up @@ -1100,7 +1102,7 @@ jobs:
- run:
command: |
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task vitest-integration)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
yarn workspace @storybook/scripts prepare-sandbox --template $TEMPLATE --no-link
name: Install sandbox dependencies
- start-event-collector
- run:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/jobs/bench-sandboxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ steps:
name: Install sandbox dependencies
command: |
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task bench)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
cd $(yarn get-sandbox-dir --template $TEMPLATE) && yarn
- run:
name: Running Bench
command: yarn task --task bench --template $(yarn get-template --cadence << pipeline.parameters.workflow >> --task bench) --no-link --start-from=never --junit
Expand Down
4 changes: 2 additions & 2 deletions .circleci/src/jobs/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ steps:
- restore_cache:
name: Restore Yarn cache
keys:
- build-yarn-2-cache-v5--{{ checksum "code/yarn.lock" }}--{{ checksum "scripts/yarn.lock" }}
- build-yarn-2-cache-v5--{{ checksum "yarn.lock" }}
- run:
name: Compile
command: |
Expand All @@ -25,7 +25,7 @@ steps:
path: code/bench/esbuild-metafiles
- save_cache:
name: Save Yarn cache
key: build-yarn-2-cache-v5--{{ checksum "code/yarn.lock" }}--{{ checksum "scripts/yarn.lock" }}
key: build-yarn-2-cache-v5--{{ checksum "yarn.lock" }}
paths:
- ~/.yarn/berry/cache
- persist_to_workspace:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/jobs/check-sandboxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ steps:
name: Install sandbox dependencies
command: |
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task check-sandbox)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
cd $(yarn get-sandbox-dir --template $TEMPLATE) && yarn
- run:
name: Type check Sandboxes
command: yarn task --task check-sandbox --template $(yarn get-template --cadence << pipeline.parameters.workflow >> --task check-sandbox) --no-link --start-from=never --junit
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/jobs/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ steps:
- restore_cache:
name: Restore Yarn cache
keys:
- build-yarn-2-cache-v5--{{ checksum "code/yarn.lock" }}--{{ checksum "scripts/yarn.lock" }}
- build-yarn-2-cache-v5--{{ checksum "yarn.lock" }}
- run:
name: Compile
command: |
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/jobs/chromatic-sandboxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ steps:
name: Install sandbox dependencies
command: |
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task chromatic)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
cd $(yarn get-sandbox-dir --template $TEMPLATE) && yarn
- run:
name: Running Chromatic
command: yarn task --task chromatic --template $(yarn get-template --cadence << pipeline.parameters.workflow >> --task chromatic) --no-link --start-from=never --junit
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/jobs/create-sandboxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ steps:
if [[ $TEMPLATE != bench/* ]]; then
yarn --cwd scripts jiti ./event-log-checker.ts build $TEMPLATE
fi
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && rm -rf node_modules
cd $(yarn get-sandbox-dir --template $TEMPLATE) && rm -rf node_modules
environment:
STORYBOOK_TELEMETRY_DEBUG: 1
STORYBOOK_TELEMETRY_URL: 'http://localhost:6007/event-log'
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/jobs/e2e-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ steps:
name: Install sandbox dependencies
command: |
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task e2e-tests-dev)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
cd $(yarn get-sandbox-dir --template $TEMPLATE) && yarn
- run:
name: Running E2E Tests
# TEST_FILES should include all relevant test files, in this case we use the default playwright pattern
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/jobs/e2e-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ steps:
name: Install sandbox dependencies
command: |
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task e2e-tests)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
cd $(yarn get-sandbox-dir --template $TEMPLATE) && yarn
- run:
name: Running E2E Tests
# TEST_FILES should include all relevant test files, in this case we use the default playwright pattern
Expand Down
4 changes: 2 additions & 2 deletions .circleci/src/jobs/pretty-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ steps:
- restore_cache:
name: Restore Yarn cache
keys:
- prettydocs-yarn-2-cache-v8--{{ checksum "code/yarn.lock" }}--{{ checksum "scripts/yarn.lock" }}
- prettydocs-yarn-2-cache-v8--{{ checksum "yarn.lock" }}
- run:
name: Install
command: |
cd scripts
yarn install
- save_cache:
name: Save Yarn cache
key: prettydocs-yarn-2-cache-v8--{{ checksum "code/yarn.lock" }}--{{ checksum "scripts/yarn.lock" }}
key: prettydocs-yarn-2-cache-v8--{{ checksum "yarn.lock" }}
paths:
- ~/.yarn/berry/cache
- run:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/jobs/test-runner-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ steps:
name: Install sandbox dependencies
command: |
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task test-runner)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
cd $(yarn get-sandbox-dir --template $TEMPLATE) && yarn
- start-event-collector
- run:
name: Running Test Runner
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/jobs/vitest-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ steps:
name: Install sandbox dependencies
command: |
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task vitest-integration)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
cd $(yarn get-sandbox-dir --template $TEMPLATE) && yarn
- start-event-collector
- run:
name: Running story tests in Vitest
Expand Down
2 changes: 1 addition & 1 deletion .cursor/environment.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"snapshot": "snapshot-20250521-0222c8bd-0a11-48ab-a2a8-380203843e05",
"install": "cd /workspace/scripts && yarn && cd ../code && yarn && yarn task --task=compile --start-from=compile",
"install": "yarn && yarn task --task=compile --start-from=compile",
"start": "cd /workspace/code && yarn test",
"terminals": []
}
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
STORYBOOK_DISABLE_TELEMETRY=true
IN_STORYBOOK_SANDBOX=true
SANDBOX_ROOT=../storybook-sandboxes
5 changes: 2 additions & 3 deletions .github/actions/setup-node-and-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ runs:
with:
path: |
~/.yarn/berry/cache
key: yarn-v1-${{ hashFiles('scripts/yarn.lock') }}-${{ hashFiles('code/yarn.lock') }}
key: yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-v1-${{ hashFiles('scripts/yarn.lock') }}-${{ hashFiles('code/yarn.lock') }}
yarn-v1-${{ hashFiles('scripts/yarn.lock') }}
yarn-v1-${{ hashFiles('yarn.lock') }}
yarn-v1

- name: Install script dependencies
Expand Down
12 changes: 6 additions & 6 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Storybook is a large monorepo built with TypeScript, React, and various other fr

## System Requirements

- **Node.js**: 22.16.0 (see `.nvmrc`)
- **Node.js**: 22.21.1 (see `.nvmrc`)
- **Package Manager**: Yarn 4.9.1
- **Operating System**: Linux/macOS (CI environment)

Expand All @@ -17,7 +17,7 @@ Storybook is a large monorepo built with TypeScript, React, and various other fr
```
storybook/
├── .github/ # GitHub configurations and workflows
├── code/ # Main monorepo codebase
├── code/ # Main codebase
│ ├── .storybook/ # Configuration for internal UI Storybook
│ ├── core/ # Core Storybook package
│ ├── lib/ # Core supporting libraries
Expand All @@ -30,15 +30,15 @@ storybook/
├── sandbox/ # Generated sandbox environments (created by yarn task --task sandbox)
├── scripts/ # Build and development scripts
├── docs/ # Documentation
└── test-storybooks/ # Test configurations
└── test-storybooks/ # Test repos
```

## Essential Commands and Build Times

### Installation & Setup
```bash
# Install all dependencies (run from repository root)
yarn i
yarn
# Time: ~2.5 minutes
# Timeout: Use 300+ seconds for bash commands
```
Expand Down Expand Up @@ -148,7 +148,7 @@ The repository includes 20 task scripts in `scripts/tasks/`:
## Recommended Development Workflow

### For Code Changes
1. Install dependencies: `yarn i` (if needed)
1. Install dependencies: `yarn` (if needed)
2. Compile packages: `yarn task --task compile`
3. Make your changes
4. Compile packages with `cd code && yarn task --task compile`
Expand Down Expand Up @@ -285,7 +285,7 @@ cd code && yarn storybook:vitest
## Troubleshooting

### Common Issues
1. **Build Failures**: Often resolved by running `yarn i` followed by `yarn task --task compile`
1. **Build Failures**: Often resolved by running `yarn` followed by `yarn task --task compile`
2. **Port Conflicts**: Storybook UI uses port 6006 by default
3. **Memory Issues**: Large compilation tasks may require increased Node.js memory limits
4. **Environment-Specific Issues**: Sandbox generation may occasionally fail due to dependency conflicts - use Storybook UI for testing as fallback
Expand Down
Loading
Loading