Skip to content

Commit

Permalink
Merge branch 'main' into feat/recursive-shared-version-search
Browse files Browse the repository at this point in the history
  • Loading branch information
robdonn authored Jul 9, 2024
2 parents 6d7a50b + b945d21 commit cb92225
Show file tree
Hide file tree
Showing 183 changed files with 7,618 additions and 4,336 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-paws-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/nextjs-mf': patch
---

prevent error throw in image loaders when module cache doesnt exist
5 changes: 5 additions & 0 deletions .changeset/eight-kids-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/nextjs-mf': patch
---

clean up old plugin params
5 changes: 5 additions & 0 deletions .changeset/friendly-doors-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/node': patch
---

remove loggers from node runtime plugin
5 changes: 5 additions & 0 deletions .changeset/red-pants-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/nextjs-mf': minor
---

enable chunk splitting for next
5 changes: 5 additions & 0 deletions .changeset/sour-wasps-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/sdk': patch
---

pass dynamic import callback to vm
5 changes: 5 additions & 0 deletions .changeset/swift-parrots-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/node': minor
---

dynamic import callback handler passed to vm. may require NODE_OPTIONS="--experimental-vm-modules"
5 changes: 5 additions & 0 deletions .changeset/yellow-cats-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/nextjs-mf': patch
---

Move to node runtime plugin implementation
67 changes: 26 additions & 41 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: Build affected packages
name: Build Affected Packages

on:
pull_request:
branches: [main]

push:
branches: [main]

jobs:
main:
checkout-install:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
Expand Down Expand Up @@ -37,47 +36,33 @@ jobs:
- name: Check Code Format
run: npx nx format:check

- name: Update NX Build Cache
run: npx nx run-many --targets=build --projects=tag:type:pkg

- name: Run Build for All
run: npx nx run-many --targets=build --projects=tag:type:pkg --skip-nx-cache

- name: Run Affected Lint
run: npx nx affected -t lint --parallel=7 --exclude='*,!tag:type:pkg'

- name: Run Affected Test
run: npx nx affected -t test --parallel=2 --exclude='*,!tag:type:pkg' --skip-nx-cache

# - name: E2E Test for Next.js Dev
# run: |
# pnpm run app:next:dev > /dev/null 2>&1 &
# sleep 1 &&
# npx wait-on tcp:3001 &&
# npx wait-on tcp:3002 &&
# npx wait-on tcp:3000 &&
# npx nx run-many --target=test:e2e --projects=3000-home,3001-shop,3002-checkout --parallel=3 &&
# lsof -ti tcp:3000,3001,3002 | xargs kill

# - name: E2E Test for Next.js Prod
# run: |
# pnpm run --filter @module-federation/3002-checkout --filter @module-federation/3000-home --filter @module-federation/3001-shop build &&
# pnpm run app:next:prod &
# sleep 2 &&
# npx wait-on tcp:3001 &&
# npx wait-on tcp:3002 &&
# npx wait-on tcp:3000 &&
# npx nx run-many --target=test:e2e --projects=3000-home,3001-shop,3002-checkout --parallel=1 &&
# lsof -ti tcp:3000,3001,3002 | xargs kill

- name: E2E Test for ModernJS
run: npx nx run-many --target=test:e2e --projects=modernjs --parallel=1 && lsof -ti tcp:4001 | xargs kill

- name: E2E Test for 3005-runtime-host
run: npx kill-port --port 3005,3006,3007 && pnpm run app:runtime:dev & echo "done" && sleep 20 && npx nx run-many --target=test:e2e --projects=3005-runtime-host --parallel=1 && lsof -ti tcp:3005,3006,3007 | xargs kill

- name: E2E Test for 3008-webpack-host
run: pnpm run app:manifest:dev & echo "done" && npx wait-on tcp:3009 && npx wait-on tcp:3012 && npx nx run-many --target=e2e --projects=3008-webpack-host --parallel=1 && lsof -ti tcp:3008,3009,3010,3011,3012 | xargs kill

- name: E2E Node Federation
run: npx nx run-many --target=serve --projects=node-local-remote,node-remote,node-dynamic-remote-new-version,node-dynamic-remote --parallel=10 & echo "done" && sleep 25 && npx nx run-many --target=serve --projects=node-host & sleep 5 && npx wait-on tcp:3333 && npx nx run node-host-e2e:test:e2e
e2e-modern:
needs: checkout-install
uses: ./.github/workflows/e2e-modern.yml
secrets: inherit

e2e-runtime:
needs: checkout-install
uses: ./.github/workflows/e2e-runtime.yml
secrets: inherit

e2e-manifest:
needs: checkout-install
uses: ./.github/workflows/e2e-manifest.yml
secrets: inherit

e2e-node:
needs: checkout-install
uses: ./.github/workflows/e2e-node.yml
secrets: inherit

e2e-next:
needs: checkout-install
uses: ./.github/workflows/e2e-next.yml
secrets: inherit
46 changes: 46 additions & 0 deletions .github/workflows/e2e-manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# .github/workflows/e2e-webpack-host.yml
name: E2E Test for Manifest

on:
workflow_call:

jobs:
e2e-manifest:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Pnpm
run: corepack enable

- name: Setup Node.js 18
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'

- name: Set Nx SHA
uses: nrwl/nx-set-shas@v3

- name: Set SKIP_DEVTOOLS_POSTINSTALL environment variable
run: echo "SKIP_DEVTOOLS_POSTINSTALL=true" >> $GITHUB_ENV

- name: Install Dependencies
run: pnpm install

- name: Install Cypress
run: npx cypress install

- name: Run Build for All
run: npx nx run-many --targets=build --projects=tag:type:pkg

- name: Run condition check script
id: check-ci
run: node tools/scripts/ci-is-affected.mjs --appName=manifest-webpack-host

- name: E2E Test for Manifest Demo
if: steps.check-ci.outcome == 'success'
run: pnpm run app:manifest:dev & echo "done" && npx wait-on tcp:3009 && npx wait-on tcp:3012 && npx nx run-many --target=e2e --projects=manifest-webpack-host --parallel=1 && lsof -ti tcp:3013,3009,3010,3011,3012 | xargs kill
46 changes: 46 additions & 0 deletions .github/workflows/e2e-modern.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# .github/workflows/e2e-modernjs.yml
name: E2E Test for ModernJS

on:
workflow_call:

jobs:
e2e-modern:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Pnpm
run: corepack enable

- name: Setup Node.js 18
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'

- name: Set Nx SHA
uses: nrwl/nx-set-shas@v3

- name: Set SKIP_DEVTOOLS_POSTINSTALL environment variable
run: echo "SKIP_DEVTOOLS_POSTINSTALL=true" >> $GITHUB_ENV

- name: Install Dependencies
run: pnpm install

- name: Install Cypress
run: npx cypress install

- name: Run Build for All
run: npx nx run-many --targets=build --projects=tag:type:pkg

- name: Run condition check script
id: check-ci
run: node tools/scripts/ci-is-affected.mjs --appName=modernjs

- name: E2E Test for ModernJS
if: steps.check-ci.outcome == 'success'
run: npx kill-port --port 4001 && npx nx run-many --target=test:e2e --projects=modernjs --parallel=1 && lsof -ti tcp:4001 | xargs kill
65 changes: 65 additions & 0 deletions .github/workflows/e2e-next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# .github/workflows/e2e-next-dev.yml
name: E2E Test for Next.js Dev

on:
workflow_call:

jobs:
e2e-next:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Pnpm
run: corepack enable

- name: Setup Node.js 18
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'

- name: Set Nx SHA
uses: nrwl/nx-set-shas@v3

- name: Set SKIP_DEVTOOLS_POSTINSTALL environment variable
run: echo "SKIP_DEVTOOLS_POSTINSTALL=true" >> $GITHUB_ENV

- name: Install Dependencies
run: pnpm install

- name: Install Cypress
run: npx cypress install

- name: Run Build for All
run: npx nx run-many --targets=build --projects=tag:type:pkg

- name: Run condition check script
id: check-ci
run: node tools/scripts/ci-is-affected.mjs --appName=3000-home

- name: E2E Test for Next.js Prod
if: steps.check-ci.outcome == 'success'
run: |
pnpm run --filter @module-federation/3002-checkout --filter @module-federation/3000-home --filter @module-federation/3001-shop build &&
pnpm run app:next:prod &
sleep 2 &&
npx wait-on tcp:3001 &&
npx wait-on tcp:3002 &&
npx wait-on tcp:3000 &&
npx nx run-many --target=test:e2e --projects=3000-home,3001-shop,3002-checkout --parallel=3 &&
lsof -ti tcp:3000,3001,3002 | xargs kill
- name: E2E Test for Next.js Dev
if: steps.check-ci.outcome == 'success'
run: |
pnpm run app:next:dev > /dev/null 2>&1 &
sleep 1 &&
npx wait-on tcp:3001 &&
npx wait-on tcp:3002 &&
npx wait-on tcp:3000 &&
npx nx run-many --target=test:e2e --projects=3000-home,3001-shop,3002-checkout --parallel=1 &&
lsof -ti tcp:3000,3001,3002 | xargs kill
46 changes: 46 additions & 0 deletions .github/workflows/e2e-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# .github/workflows/e2e-node-federation.yml
name: E2E Node Federation

on:
workflow_call:

jobs:
e2e-node:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Pnpm
run: corepack enable

- name: Setup Node.js 18
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'

- name: Set Nx SHA
uses: nrwl/nx-set-shas@v3

- name: Set SKIP_DEVTOOLS_POSTINSTALL environment variable
run: echo "SKIP_DEVTOOLS_POSTINSTALL=true" >> $GITHUB_ENV

- name: Install Dependencies
run: pnpm install

- name: Install Cypress
run: npx cypress install

- name: Run Build for All
run: npx nx run-many --targets=build --projects=tag:type:pkg

- name: Run condition check script
id: check-ci
run: node tools/scripts/ci-is-affected.mjs --appName=node-local-remote,node-remote,node-dynamic-remote-new-version,node-dynamic-remote

- name: E2E Node Federation
if: steps.check-ci.outcome == 'success'
run: npx nx run-many --target=serve --projects=node-local-remote,node-remote,node-dynamic-remote-new-version,node-dynamic-remote --parallel=10 & echo "done" && sleep 25 && npx nx run-many --target=serve --projects=node-host & sleep 5 && npx wait-on tcp:3333 && npx nx run node-host-e2e:test:e2e
46 changes: 46 additions & 0 deletions .github/workflows/e2e-runtime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# .github/workflows/e2e-runtime-host.yml
name: E2E Test for Runtime

on:
workflow_call:

jobs:
e2e-runtime:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Pnpm
run: corepack enable

- name: Setup Node.js 18
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'

- name: Set Nx SHA
uses: nrwl/nx-set-shas@v3

- name: Set SKIP_DEVTOOLS_POSTINSTALL environment variable
run: echo "SKIP_DEVTOOLS_POSTINSTALL=true" >> $GITHUB_ENV

- name: Install Dependencies
run: pnpm install

- name: Install Cypress
run: npx cypress install

- name: Run Build for All
run: npx nx run-many --targets=build --projects=tag:type:pkg

- name: Run condition check script
id: check-ci
run: node tools/scripts/ci-is-affected.mjs --appName=3005-runtime-host

- name: E2E Test for Runtime Demo
if: steps.check-ci.outcome == 'success'
run: npx kill-port --port 3005,3006,3007 && pnpm run app:runtime:dev & echo "done" && sleep 20 && npx nx run-many --target=test:e2e --projects=3005-runtime-host --parallel=1 && lsof -ti tcp:3005,3006,3007 | xargs kill
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ packages/enhanced/test/js
**/.mf/**

/apps/manifest-demo/**/@mf-types/
/apps/manifest-demo/3008-webpack-host/@mf-types/
/apps/manifest-demo/webpack-host/@mf-types/
Loading

0 comments on commit cb92225

Please sign in to comment.