Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
c65a783
Try out NX agents
kasperpeulen Nov 18, 2025
45e6f41
Use --startFrom task in nx
kasperpeulen Nov 24, 2025
b96d8b6
Fix
kasperpeulen Nov 24, 2025
4815dd0
Fix
kasperpeulen Nov 25, 2025
0812f33
Fix
kasperpeulen Nov 25, 2025
5889731
Use latest node 22
kasperpeulen Nov 25, 2025
1644680
Cleanup build script
kasperpeulen Nov 25, 2025
9c09531
Run everything
kasperpeulen Nov 25, 2025
36db0b3
Fix
kasperpeulen Nov 25, 2025
2f45799
Fix check
kasperpeulen Nov 25, 2025
c10cca9
Fix
kasperpeulen Nov 25, 2025
11da1a4
Fix
kasperpeulen Nov 25, 2025
4694e9d
Fix
kasperpeulen Nov 25, 2025
908eefb
Fix
kasperpeulen Nov 25, 2025
c9f56bf
Fix
kasperpeulen Nov 25, 2025
4622396
Fix
kasperpeulen Nov 25, 2025
a8c6d41
Fix
kasperpeulen Nov 26, 2025
1b72107
Add cloud access token
kasperpeulen Nov 26, 2025
3d7f007
Fix
kasperpeulen Nov 26, 2025
5caad09
Fix
kasperpeulen Nov 26, 2025
b68e98e
Fix
kasperpeulen Nov 26, 2025
8b63ec2
Verify
kasperpeulen Nov 26, 2025
ffc7857
Fix
kasperpeulen Nov 26, 2025
0f2c997
Fix
kasperpeulen Nov 26, 2025
c2e3773
Run chromatic in cache location
kasperpeulen Nov 26, 2025
b1ba7b2
Fix
kasperpeulen Nov 26, 2025
32bb4b0
Fix
kasperpeulen Nov 26, 2025
40f2c1d
Fix
kasperpeulen Nov 26, 2025
3cd7a0f
Fix
kasperpeulen Nov 26, 2025
bf2a3d9
Fix
kasperpeulen Nov 26, 2025
2483221
Fix
kasperpeulen Nov 26, 2025
82f6baf
Remove yarn lock file
kasperpeulen Nov 26, 2025
0779ef3
Ignore yarn lock files in test-storybooks
kasperpeulen Nov 26, 2025
4916d39
Fix
kasperpeulen Nov 26, 2025
bf04639
Fix
kasperpeulen Nov 26, 2025
a102952
Fix
kasperpeulen Nov 26, 2025
035dfa3
Fix
kasperpeulen Nov 26, 2025
1d8048b
Fix
kasperpeulen Nov 26, 2025
d370e3b
Fix
kasperpeulen Nov 26, 2025
975b14f
Fix
kasperpeulen Nov 26, 2025
a706f5f
Fix
kasperpeulen Nov 26, 2025
4703f2a
Fix
kasperpeulen Nov 26, 2025
3b25ae5
Merge remote-tracking branch 'origin/next' into kasper/nx-agents
kasperpeulen Nov 26, 2025
497caa6
Fix
kasperpeulen Nov 26, 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
Prev Previous commit
Next Next commit
Fix
  • Loading branch information
kasperpeulen committed Nov 26, 2025
commit 975b14febc5bdff28b44c01cdb91a7a1e52c2606
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": []
}
10 changes: 5 additions & 5 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions .github/workflows/nx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
Comment thread
coderabbitai[bot] marked this conversation as resolved.
branches:
- next
- kasper/nx-agents
Comment on lines +7 to +8
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Remove TODO comments and temporary test branch before merging.

Lines 7–8 and 52–55 reference the kasper/nx-agents feature branch with TODO markers indicating this is temporary. This branch-specific logic must be removed before merging to next, as CI workflows should not contain developer-specific or feature-branch routing logic in the final state.

Apply this diff to clean up:

 on:
   push:
     branches:
       - next
-      # TODO remove
-      - kasper/nx-agents
   pull_request:
     types: [opened, synchronize, labeled, reopened]
       - if: github.event_name == 'push' &&
           github.ref == 'refs/heads/next'
         run: yarn nx run-many -t $ALL_TASKS -c production -p="tag:ci:normal,tag:ci:merged"
-      # TODO remove
-      - if: github.event_name == 'push' &&
-          github.ref == 'refs/heads/kasper/nx-agents'
-        run: yarn nx run-many -t $ALL_TASKS -c production -p="tag:ci:normal"

Also applies to: 52-55

🤖 Prompt for AI Agents
In .github/workflows/nx.yml around lines 7–8 and 52–55, remove the temporary
TODO comment and the explicit reference to the developer/feature branch
"kasper/nx-agents" (both the comment and the branch entry) so the workflow
contains no developer-specific or feature-branch routing logic; replace them
with the intended canonical branches or simply delete the entries if not needed,
and ensure any remaining comments reflect the final workflow (no TODO markers)
and that workflow triggers/filters reference shared branches (e.g., main/next)
rather than feature branches.

pull_request:
types: [opened, synchronize, labeled, reopened]

Expand All @@ -18,13 +19,13 @@ jobs:
nx:
runs-on: ubuntu-latest
env:
ALL_TASKS: check,knip,test,pretty-docs,lint,test,sandbox,build-sandbox,e2e-tests,e2e-tests-dev,test-runner,vitest-integration,check-sandbox,e2e-ui,jest,vitest,playwright-ct,cypress
ALL_TASKS: check,knip,test,pretty-docs,lint,sandbox,build-sandbox,e2e-tests,e2e-tests-dev,test-runner,vitest-integration,check-sandbox,e2e-ui,jest,vitest,playwright-ct,cypress
steps:
- uses: actions/checkout@v4
with:
filter: tree:0
fetch-depth: 0
- run: npx nx@latest start-ci-run --distribute-on=" ./.nx/workflows/distribution-config.yaml" --stop-agents-after="$ALL_TASKS"
- run: npx nx@latest start-ci-run --distribute-on="./.nx/workflows/distribution-config.yaml" --stop-agents-after="$ALL_TASKS"
- uses: actions/setup-node@v4
with:
node-version: 22
Expand All @@ -36,4 +37,4 @@ jobs:
- if: github.event_name == 'pull_request' && (contains(github.event.pull_request.labels.*.name, 'ci:merged'))
run: yarn nx run-many -t $ALL_TASKS -c production -p="tag:ci:normal,tag:ci:merged"
- if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'ci:daily')
run: yarn nx run-many -t $ALL_TASKS -c production -p="tag:ci:normal,tag:ci:merged,tag:ci:daily"
run: yarn nx run-many -t $ALL_TASKS -c production -p="tag:ci:normal,tag:ci:merged,tag:ci:daily"
2 changes: 1 addition & 1 deletion CONTRIBUTING/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ If you need to release a change to an older minor version that is not the latest
1. `git fetch --all --tags`
2. `git checkout tags/v8.3.6 -b patch-8-3-7`
2. Make the changes you need to, most likely cherry-picking commits from the fix you need to back-port.
3. Run `yarn install` in `scripts` and `code`
3. Run `yarn install`
4. Build all packages in `code` with `yarn task --task compile --no-link`
5. Commit and push your changes.
6. Trigger _daily_ CI manually on your branch:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"get-report-message": "cd scripts; yarn get-report-message",
"get-sandbox-dir": "cd scripts; yarn get-sandbox-dir",
"get-template": "cd scripts; yarn get-template",
"i": "yarn --cwd scripts && yarn --cwd code",
"i": "yarn",
"knip": "cd code; yarn knip",
"lint": "cd code; yarn lint",
"nx": "nx",
Expand Down
2 changes: 1 addition & 1 deletion scripts/utils/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function getCodeWorkspaces(includePrivate = true) {
return {
name: it.name,
// strip code from the location for backwards compatibility
location: it.location.replace('code/', '').replace('code', '.'),
location: it.location === 'code' ? '.' : it.location.replace('code/', ''),
};
}) as Workspace[];
}
Comment on lines +9 to 30
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

Possible Windows path issue when stripping the leading code segment

The new getCodeWorkspaces implementation:

location: it.location
  .split(path.sep)
  .filter((it, i) => !(it === 'code' && i === 0))
  .join(path.sep),

assumes Yarn’s location uses path.sep. On Windows, Yarn typically reports workspace locations with /, while path.sep is \. In that case:

  • it.location like "code/addons/a11y" will not be split into ['code', 'addons', 'a11y'] but remain a single segment.
  • The leading code segment will not be removed.
  • Any caller that still treats workspace.location as relative to the code directory (e.g., join(CODE_DIRECTORY, workspace.location)) would end up with code/code/... on Windows.

To keep semantics consistent across platforms, consider normalizing or splitting on both separators:

-        location: it.location
-          .split(path.sep)
+        location: it.location
+          .split(/[\\/]/)
           .filter((segment, i) => !(segment === 'code' && i === 0))
-          .join(path.sep),
+          .join(path.sep),

You could also avoid the any in the filter/map and type it as Workspace for better type safety.

Please verify on a Windows environment (or CI job) that:

  • getCodeWorkspaces() returns locations without the leading code segment, and
  • Callers of workspacePath that join with CODE_DIRECTORY or similar still resolve to the correct on‑disk paths.

Also applies to: 37-45


🏁 Script executed:

#!/bin/bash
# Locate and inspect the getCodeWorkspaces function
fd workspace.ts --type f | head -20

Length of output: 107


🏁 Script executed:

#!/bin/bash
# Search for getCodeWorkspaces usage across the codebase
rg -n "getCodeWorkspaces" --type ts --type js -C 3

Length of output: 4428


🏁 Script executed:

#!/bin/bash
# Inspect lines 37-45 of workspace.ts to see the "also applies to" section
cat scripts/utils/workspace.ts | head -50 | tail -20

Length of output: 650


🏁 Script executed:

#!/bin/bash
# Search for how workspace.location is used in callers
rg -n "workspace\.location" --type ts --type js -C 2

Length of output: 235


🏁 Script executed:

#!/bin/bash
# Check if any path normalization utilities exist in the codebase
rg -n "normalize|sep|split.*\/" --type ts --type js scripts/ | grep -i path | head -20

Length of output: 110


🏁 Script executed:

#!/bin/bash
# Search for workspacePath usage
rg -n "workspacePath" --type ts --type js -C 2

Length of output: 2764


🏁 Script executed:

#!/bin/bash
# View the complete workspace.ts file to understand context
cat scripts/utils/workspace.ts

Length of output: 1495


🏁 Script executed:

#!/bin/bash
# Search for CODE_DIRECTORY and how it's used with workspace paths
rg -n "CODE_DIRECTORY" --type ts --type js -C 2 | head -50

Length of output: 2891


🏁 Script executed:

#!/bin/bash
# Check what Yarn outputs - look at any comments or docs referencing path format
rg -n "yarn.*workspaces|workspaces.*list" --type ts --type js -i

Length of output: 499


🌐 Web query:

Does Yarn workspaces list command output paths with forward slashes on Windows?

💡 Result:

Short answer: Yes — Yarn's workspaces list (JSON/verbose output) uses forward slashes (POSIX-style) for workspace locations even on Windows. [1][2]

Sources:

  • Yarn CLI docs for workspaces list. [1]
  • Example/utility that mirrors Yarn v2 --verbose --json output showing "location":"packages/a" (posix path). [2]

Windows path stripping fails because Yarn outputs forward slashes on all platforms

The implementation splits it.location on path.sep, but Yarn's workspaces list --json always outputs workspace locations with forward slashes (/) regardless of platform. On Windows:

  • Input: "code/addons/a11y" (from Yarn, forward slashes only)
  • .split(path.sep) where path.sep = '\\' produces: ["code/addons/a11y"] (no split occurs)
  • Filter for it === 'code' && i === 0 fails to match
  • Result: location remains "code/addons/a11y" instead of "addons/a11y"

This breaks callers like sandbox-parts.ts:640 that do join(CODE_DIRECTORY, rendererPath, ...), which would yield code/code/addons/... on Windows.

Fix: Split on both forward and back slashes:

-        location: it.location
-          .split(path.sep)
+        location: it.location
+          .split(/[\/\\]/)
           .filter((segment, i) => !(segment === 'code' && i === 0))
-          .join(path.sep),
+          .join(path.sep),

Also applies to line 37 (getWorkspacesMemo wrapping the same logic).

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In scripts/utils/workspace.ts around lines 11 to 35, the code splits workspace
locations using path.sep which fails on Windows because Yarn always emits
forward slashes; update the splitting logic to split on both forward and back
slashes (e.g. split by a regex like /[\\/]/) so the leading "code" segment is
correctly detected and removed, then rejoin using path.sep for normalized
platform-specific paths; apply the same fix to the analogous logic used by
getWorkspacesMemo (around line ~37).

Expand Down
Loading