Skip to content

Commit b5fe362

Browse files
fix(ci): restore storybook and e2e task parity
1 parent d6b8f3f commit b5fe362

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

.github/workflows/bundle-size.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,18 @@ jobs:
5353

5454
- name: Prepare base worktree
5555
run: |
56-
BASE_REF=${CI_LOCAL_BASE_REF:-origin/main}
56+
BASE_REF=${CI_LOCAL_BASE_REF:-${{ github.event.pull_request.base.sha }}}
5757
BASE_PATH=".ci-local-base-${RANDOM}-${RANDOM}"
58-
LOCAL_BASE_REF="${BASE_REF#origin/}"
5958
echo "BASE_REF=$BASE_REF" >> "$GITHUB_ENV"
6059
echo "BASE_PATH=$BASE_PATH" >> "$GITHUB_ENV"
61-
echo "LOCAL_BASE_REF=$LOCAL_BASE_REF" >> "$GITHUB_ENV"
6260
git worktree add "$BASE_PATH" "$BASE_REF"
63-
git -C "$BASE_PATH" branch -f "$LOCAL_BASE_REF" "$BASE_REF" || true
61+
case "$BASE_REF" in
62+
origin/*)
63+
LOCAL_BASE_REF="${BASE_REF#origin/}"
64+
echo "LOCAL_BASE_REF=$LOCAL_BASE_REF" >> "$GITHUB_ENV"
65+
git -C "$BASE_PATH" branch -f "$LOCAL_BASE_REF" "$BASE_REF" || true
66+
;;
67+
esac
6468
6569
- name: Restore Turborepo cache (base worktree)
6670
uses: actions/cache@v5

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
"e2e:router": "node tools/scripts/run-router-e2e.mjs --mode=dev",
3939
"e2e:shared-tree-shaking:runtime-infer": "npx kill-port --port 3001,3002 && pnpm exec turbo run test:e2e --filter=shared-tree-shaking-no-server-host && lsof -ti tcp:3001,3002 | xargs kill",
4040
"e2e:shared-tree-shaking:server-calc": "npx kill-port --port 3001,3002,3003 && pnpm exec turbo run test:e2e --filter=shared-tree-shaking-with-server-host && lsof -ti tcp:3001,3002,3003 | xargs kill",
41-
"e2e:devtools:dev": "npx kill-port 3009 3010 3011 3012 3013 4001 && pnpm run app:manifest:dev & echo \"done\" && npx wait-on tcp:3009 tcp:3010 tcp:3011 tcp:3012 tcp:3013 && sleep 10 && pnpm exec turbo run e2e:devtools --filter=@module-federation/devtools",
42-
"e2e:devtools:prod": "npx kill-port 3009 3010 3011 3012 3013 4001 && npx kill-port 3009 3010 3011 3012 3013 4001 && pnpm run app:manifest:prod & echo \"done\" && npx wait-on tcp:3009 tcp:3010 tcp:3011 tcp:3012 tcp:3013 && sleep 30 && pnpm exec turbo run e2e:devtools --filter=@module-federation/devtools",
41+
"e2e:devtools:dev": "npx kill-port 3009 3010 3011 3012 3013 4001 && pnpm run app:manifest:dev & echo \"done\" && npx wait-on tcp:3009 tcp:3010 tcp:3011 tcp:3012 tcp:3013 && sleep 10 && pnpm exec turbo run test:e2e --filter=@module-federation/devtools",
42+
"e2e:devtools:prod": "npx kill-port 3009 3010 3011 3012 3013 4001 && npx kill-port 3009 3010 3011 3012 3013 4001 && pnpm run app:manifest:prod & echo \"done\" && npx wait-on tcp:3009 tcp:3010 tcp:3011 tcp:3012 tcp:3013 && sleep 30 && pnpm exec turbo run test:e2e --filter=@module-federation/devtools",
4343
"enhanced:rstest": "pnpm --filter @module-federation/enhanced run build && NODE_OPTIONS=--experimental-vm-modules npx rstest -c packages/enhanced/rstest.config.ts",
4444
"lint": "pnpm run lint:packages",
4545
"test": "pnpm exec turbo run test",

packages/storybook-addon/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"@module-federation/sdk": "workspace:*"
5454
},
5555
"devDependencies": {
56+
"@nx/module-federation": ">= 16.0.0",
5657
"jest-fixed-jsdom": "^0.0.9",
5758
"@module-federation/utilities": "workspace:*",
5859
"@rsbuild/core": "2.0.0-beta.2",
@@ -82,6 +83,9 @@
8283
"@nx/react": {
8384
"optional": true
8485
},
86+
"@nx/module-federation": {
87+
"optional": true
88+
},
8589
"@nx/webpack": {
8690
"optional": true
8791
},

packages/storybook-addon/src/lib/storybook-addon.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
type WebpackPluginInstance,
99
} from 'webpack';
1010
import { normalizeStories } from '@storybook/core/common';
11+
import withModuleFederation from '../utils/with-module-federation.js';
1112
import { correctImportPath } from '../utils/correctImportPath.js';
1213

1314
// TODO: Only reserve `storybook/internal/node-logger` in next major release.
@@ -39,11 +40,7 @@ type Options = {
3940
};
4041
configDir: string;
4142
};
42-
43-
export const withModuleFederation = async (options: ModuleFederationConfig) => {
44-
const module = await import('../utils/with-module-federation.js');
45-
return module.default(options);
46-
};
43+
export { withModuleFederation };
4744

4845
export const webpack = async (
4946
webpackConfig: Configuration,

pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)