Skip to content

Commit e494633

Browse files
Merge remote-tracking branch 'origin/main' into rslib/nextjs-mf
2 parents 30a654e + 00d2241 commit e494633

200 files changed

Lines changed: 19939 additions & 1568 deletions

File tree

Some content is hidden

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

.changeset/bright-owls-cheer.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@module-federation/dts-plugin": patch
3+
---
4+
5+
Fix Windows TypeScript type generation by invoking the compiler with
6+
`execFile` and properly quoted project paths.

.changeset/config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
"create-module-federation",
3030
"@module-federation/cli",
3131
"@module-federation/rspress-plugin",
32+
"@module-federation/treeshake-server",
33+
"@module-federation/treeshake-frontend",
3234
"@module-federation/metro",
3335
"@module-federation/metro-plugin-rnef",
3436
"@module-federation/metro-plugin-rnc-cli"

.changeset/salty-icons-carry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@module-federation/treeshake-server': patch
3+
---
4+
5+
feat: add tree shaking server

.github/workflows/actionlint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ jobs:
1515
- name: Checkout repository
1616
uses: actions/checkout@v5
1717

18+
- name: Install actionlint
19+
run: bash <(curl -s https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
20+
shell: bash
21+
1822
- name: Run actionlint
1923
uses: raven-actions/actionlint@v2
2024
env:

.github/workflows/build-and-test.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ jobs:
2424
with:
2525
fetch-depth: 0
2626

27+
- name: Cache Tool Downloads
28+
uses: actions/cache@v5
29+
with:
30+
path: ~/.cache
31+
key: ${{ runner.os }}-toolcache-${{ hashFiles('pnpm-lock.yaml') }}
32+
restore-keys: |
33+
${{ runner.os }}-toolcache-
34+
2735
- name: Setup pnpm
2836
uses: pnpm/action-setup@v4
2937

@@ -51,6 +59,9 @@ jobs:
5159
- name: Install Dependencies
5260
run: pnpm install --frozen-lockfile
5361

62+
- name: Install Playwright Browsers
63+
run: pnpm exec playwright install --force
64+
5465
- name: Install Cypress
5566
# if: steps.browsers-cache.outputs.cache-hit != 'true'
5667
run: npx cypress install
@@ -120,6 +131,11 @@ jobs:
120131
uses: ./.github/workflows/e2e-next-prod.yml
121132
secrets: inherit
122133

134+
e2e-treeshake:
135+
needs: checkout-install
136+
uses: ./.github/workflows/e2e-treeshake.yml
137+
secrets: inherit
138+
123139
e2e-modern-ssr:
124140
needs: checkout-install
125141
uses: ./.github/workflows/e2e-modern-ssr.yml
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: E2E Treeshake
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
e2e-treeshake:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
actions: read
12+
timeout-minutes: 30
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v5
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Cache Tool Downloads
20+
uses: actions/cache@v5
21+
with:
22+
path: ~/.cache
23+
key: ${{ runner.os }}-toolcache-${{ hashFiles('pnpm-lock.yaml') }}
24+
restore-keys: |
25+
${{ runner.os }}-toolcache-
26+
27+
- name: Set Playwright cache status
28+
run: |
29+
if [ -d "$HOME/.cache/ms-playwright" ] || [ -d "$HOME/.cache/Cypress" ]; then
30+
echo "PLAYWRIGHT_CACHE_HIT=true" >> "$GITHUB_ENV"
31+
else
32+
echo "PLAYWRIGHT_CACHE_HIT=false" >> "$GITHUB_ENV"
33+
fi
34+
35+
- name: Setup pnpm
36+
uses: pnpm/action-setup@v4
37+
38+
- name: Setup Node.js 20
39+
uses: actions/setup-node@v6
40+
with:
41+
node-version: '20'
42+
cache: 'pnpm'
43+
cache-dependency-path: '**/pnpm-lock.yaml'
44+
45+
- name: Set Nx SHA
46+
uses: nrwl/nx-set-shas@v4
47+
48+
- name: Set SKIP_DEVTOOLS_POSTINSTALL environment variable
49+
run: echo "SKIP_DEVTOOLS_POSTINSTALL=true" >> "$GITHUB_ENV"
50+
51+
- name: Install Dependencies
52+
run: pnpm install --frozen-lockfile
53+
54+
- name: Run Build for All
55+
run: npx nx run-many --targets=build --projects=tag:type:pkg
56+
57+
- name: Run condition check script
58+
id: check-ci
59+
run: node tools/scripts/ci-is-affected.mjs --appName=treeshake-server,treeshake-frontend
60+
61+
- name: E2E Treeshake Server
62+
if: steps.check-ci.outcome == 'success'
63+
run: npx nx run treeshake-server:test
64+
65+
- name: E2E Treeshake Frontend
66+
if: steps.check-ci.outcome == 'success'
67+
run: npx nx run treeshake-frontend:e2e

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,6 @@ packages/enhanced/.unpack-cache/**
9797
packages/enhanced/.codex/**
9898
packages/enhanced/generated/**
9999
**/.codex/
100+
.pnpm-store/
101+
apps/rsc-demo/**/build/
102+
apps/rsc-demo/e2e/test-results/

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pnpm-lock.yaml
99
**/dist/**
1010
**/dist-rslib/**
1111
apps/website-new/docs
12+
packages/treeshake-server/template/**
1213

1314
/.nx/workspace-data
1415
/.nx/cache

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"commit": "cz",
2424
"docs": "typedoc",
2525
"f": "nx format:write",
26+
"ci:local": "node tools/scripts/ci-local.mjs",
2627
"enhanced:rstest": "nx run enhanced:build && NODE_OPTIONS=--experimental-vm-modules npx rstest -c packages/enhanced/rstest.config.ts",
2728
"lint": "nx run-many --target=lint",
2829
"test": "nx run-many --target=test",
@@ -198,6 +199,7 @@
198199
"@nx/web": "21.2.3",
199200
"@nx/webpack": "21.2.3",
200201
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
202+
"@playwright/test": "1.57.0",
201203
"@rollup/plugin-alias": "5.1.1",
202204
"@rollup/plugin-replace": "6.0.1",
203205
"@rslib/core": "^0.10.4",

0 commit comments

Comments
 (0)