Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
bc0f366
fix: improve upgrade script
ryok90 Aug 22, 2025
ed32811
fix: broken examples
ryok90 Aug 22, 2025
d79886f
fix: remove qwik and add concurrency
ryok90 Aug 22, 2025
29a0c0e
fix: concurrency adjusted
ryok90 Aug 22, 2025
26b05eb
fix adding manual types to overcome pnpm catalog react resolution
ryok90 Aug 22, 2025
cf44289
feat: proper scripts packages
ryok90 Sep 11, 2025
75d93ab
chore: partial ts migration
ryok90 Sep 11, 2025
84108fd
chore: tests in ts
ryok90 Sep 11, 2025
8f57c9d
fix: adjust optional version parameter to update
ryok90 Sep 11, 2025
27b6683
fix: adjust test timeouts
ryok90 Sep 11, 2025
fae87d8
fix: test validations
ryok90 Sep 11, 2025
b74e1f6
test: unifying tests
ryok90 Sep 11, 2025
9639789
test: adjusting last tests
ryok90 Sep 11, 2025
ce30182
test: adjusting turbo and remaining test cases
ryok90 Sep 12, 2025
2713f45
fix: build packages inputs and build test workflow
ryok90 Sep 12, 2025
1992acf
fix: add setup action
ryok90 Sep 12, 2025
1481275
fix: linting
ryok90 Sep 15, 2025
4329d5e
fix: angular vite deps
ryok90 Sep 16, 2025
df762dd
fix: adjusting windows execution and Nx version issues
ryok90 Sep 16, 2025
a2ac4e7
fix: adjusting dependencies
ryok90 Sep 16, 2025
eaa4e13
fix: more dependency issues
ryok90 Sep 16, 2025
4e9f1fe
fix: deps
ryok90 Sep 17, 2025
7bcfa31
fix: moooooar dep issues
ryok90 Sep 17, 2025
a80ec85
fix: final deps fixes
ryok90 Sep 17, 2025
83f3689
fix: last deps issues
ryok90 Sep 17, 2025
de48b63
fix: last cross-env missing
ryok90 Sep 17, 2025
13776f9
fix: allow missing validation to pass by skipping
ryok90 Sep 18, 2025
f0f74cc
fix: disable nx license
ryok90 Sep 18, 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
38 changes: 38 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Setup Node and PNPM
description: Sets up Node.js and PNPM with caching

inputs:
os:
required: true
description: 'Operating system'
default: ubuntu-latest
node-version:
required: true
description: 'Node.js version'
default: '24'

runs:
using: 'composite'
steps:
- uses: pnpm/action-setup@v4
with:
version: 10
run_install: false
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
registry-url: 'https://registry.npmjs.org'
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- run: pnpm install --prefer-offline
shell: bash
98 changes: 98 additions & 0 deletions .github/workflows/build-deploy-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Build, Deploy, and Test All Examples

on:
workflow_dispatch:
inputs:
skip_cache:
description: "Skip build cache and force rebuild all packages"
required: false
default: true
type: boolean
plugin_version:
description: "Zephyr plugin version to upgrade to (default: next)"
required: false
default: "next"
type: string
repository_dispatch:
types: [build-deploy-test]

env:
NODE_VERSION: "20"

jobs:
build-deploy-test:
name: Build, Deploy, and Test All Examples
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: ./.github/actions/setup
with:
node-version: ${{ env.NODE_VERSION }}

- name: Upgrade Zephyr plugins
run: |
cd scripts
if [ -n "${{ github.event.inputs.plugin_version }}" ]; then
echo "Upgrading plugins to version: ${{ github.event.inputs.plugin_version }}"
pnpm upgrade-plugins --version=${{ github.event.inputs.plugin_version }}
elif [ -n "${{ github.event.client_payload.plugin_version }}" ]; then
echo "Upgrading plugins to version: ${{ github.event.client_payload.plugin_version }}"
pnpm upgrade-plugins --version=${{ github.event.client_payload.plugin_version }}
else
echo "Upgrading plugins to latest (next)"
pnpm upgrade-plugins
fi

- name: Install dependencies after upgrade
run: pnpm install --prefer-offline

- name: Build all examples
run: |
cd scripts
if [ "${{ github.event.inputs.skip_cache }}" == "true" ] || [ "${{ github.event.client_payload.skip_cache }}" == "true" ]; then
echo "Building with --skip-cache flag"
pnpm build-packages:force
else
echo "Building with cache enabled"
pnpm build-packages
fi
env:
NODE_ENV: production

- name: Wait for deployments to be ready
run: |
echo "Waiting 60 seconds for all deployments to propagate..."
sleep 60

- name: Install Playwright browsers
run: |
cd scripts
npx playwright install chromium

- name: Run deployment validation tests
run: |
cd scripts
pnpm test
env:
CI: true

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: |
scripts/test-results/
scripts/playwright-report/
retention-days: 7

- name: Upload build logs
uses: actions/upload-artifact@v4
if: always()
with:
name: build-logs
path: |
scripts/tmp/build/
retention-days: 3
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ dist
*/**/.__mf__temp

.parcel-cache
*.tsbuildinfo
tmp

# Playwright test results
scripts/test-results/
scripts/playwright-report/
test-results/
playwright-report/
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ Once you've forked this repository, you can clone it and follow the instructions
A monorepo using Nx, Angular v15, and Webpack as the bundler.
* __[`parce-react`](./examples/parcel-react)__
A parcel and react application.
* __[`qwik-1.5`](./examples/qwik-1.5)__
A Qwik v1.5 app using Vite as the bundler.
* __[`react-airbnb-clone`](./examples/react-airbnb-clone)__
An AirBnb clone using React, Module Federation and Rspack as the bundler.
* __[`react-rollup-ts`](./examples/react-rollup-ts)__
Expand Down Expand Up @@ -85,7 +83,6 @@ For more information on using Zephyr Cloud, visit the [official documentation][d
:white_check_mark: `create-nx-rspack-workspace-mf`
:white_check_mark: `create-nx-workspace-mf`
:white_check_mark: `nx-ng`
:x: `qwik-1.5` - rework plugin support
:white_check_mark: `react-airbnb-clone`
:white_check_mark: `react-rollup-ts`
:white_check_mark: `react-rspack-tractor-2.0`
Expand Down
2 changes: 1 addition & 1 deletion examples/angular-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
"@angular/build": "catalog:angular19",
"@angular/compiler-cli": "catalog:angular19",
"typescript": "catalog:typescript",
"vite": "catalog:vite5"
"vite": "catalog:vite6"
}
}
29 changes: 29 additions & 0 deletions examples/basehref-examples/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "basehref-examples",
"version": "1.0.0",
"description": "Examples demonstrating base href configuration with different bundlers",
"private": true,
"scripts": {
"build": "pnpm --filter basehref-rspack-app build && pnpm --filter basehref-vite-app build && pnpm --filter basehref-webpack-app build",
"build:rspack": "pnpm --filter basehref-rspack-app build",
"build:vite": "pnpm --filter basehref-vite-app build",
"build:webpack": "pnpm --filter basehref-webpack-app build",
"build:base": "pnpm --filter basehref-rspack-app build:base && pnpm --filter basehref-vite-app build:base && pnpm --filter basehref-webpack-app build:base",
"build:base:rspack": "pnpm --filter basehref-rspack-app build:base",
"build:base:vite": "pnpm --filter basehref-vite-app build:base",
"build:base:webpack": "pnpm --filter basehref-webpack-app build:base"
},
"keywords": [
"basehref",
"rspack",
"vite",
"webpack",
"react",
"zephyr"
],
"repository": {
"type": "git",
"url": "https://github.com/zephyrcloud/zephyr-examples",
"directory": "examples/basehref-examples"
}
}
4 changes: 2 additions & 2 deletions examples/basehref-examples/rspack-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"zephyr-rspack-plugin": "catalog:zephyr"
},
"devDependencies": {
"@rspack/cli": "catalog:rspack",
"@rspack/core": "catalog:rspack",
"@rspack/cli": "1.5.5",
"@rspack/core": "1.5.5",
"@rspack/plugin-react-refresh": "catalog:rspack",
"@types/react": "catalog:react19",
"@types/react-dom": "catalog:react19",
Expand Down
120 changes: 60 additions & 60 deletions examples/basehref-examples/rspack-app/rspack.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from "@rspack/cli";
import type { Configuration } from "@rspack/cli";
import { rspack } from "@rspack/core";
import * as RefreshPlugin from "@rspack/plugin-react-refresh";
import { withZephyr } from "zephyr-rspack-plugin";
Expand All @@ -9,67 +9,67 @@ const publicPath = process.env.PUBLIC_PATH || "/";

const targets = ["chrome >= 87", "edge >= 88", "firefox >= 78", "safari >= 14"];

export default withZephyr()(
defineConfig({
output: {
publicPath,
},
context: __dirname,
entry: {
main: "./src/main.tsx",
},
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"],
},
module: {
rules: [
{
test: /\.svg$/,
type: "asset",
},
{
test: /\.(jsx?|tsx?)$/,
use: [
{
loader: "builtin:swc-loader",
options: {
jsc: {
parser: {
syntax: "typescript",
tsx: true,
},
transform: {
react: {
runtime: "automatic",
development: isDev,
refresh: isDev,
},
const config: Configuration = {
output: {
publicPath,
},
context: __dirname,
entry: {
main: "./src/main.tsx",
},
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"],
},
module: {
rules: [
{
test: /\.svg$/,
type: "asset",
},
{
test: /\.(jsx?|tsx?)$/,
use: [
{
loader: "builtin:swc-loader",
options: {
jsc: {
parser: {
syntax: "typescript",
tsx: true,
},
transform: {
react: {
runtime: "automatic",
development: isDev,
refresh: isDev,
},
},
env: { targets },
},
env: { targets },
},
],
},
],
},
plugins: [
new rspack.HtmlRspackPlugin({
template: "./index.html",
publicPath,
},
],
},
],
},
plugins: [
new rspack.HtmlRspackPlugin({
template: "./index.html",
publicPath,
}),
isDev ? new RefreshPlugin() : null,
].filter(Boolean),
optimization: {
minimizer: [
new rspack.SwcJsMinimizerRspackPlugin(),
new rspack.LightningCssMinimizerRspackPlugin({
minimizerOptions: { targets },
}),
isDev ? new RefreshPlugin() : null,
].filter(Boolean),
optimization: {
minimizer: [
new rspack.SwcJsMinimizerRspackPlugin(),
new rspack.LightningCssMinimizerRspackPlugin({
minimizerOptions: { targets },
}),
],
},
experiments: {
css: true,
},
})
);
],
},
experiments: {
css: true,
},
};

export default withZephyr()(config);
2 changes: 1 addition & 1 deletion examples/basehref-examples/webpack-app/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const path = require('path');
const path = require('node:path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { withZephyr } = require('zephyr-webpack-plugin');

Expand Down
14 changes: 7 additions & 7 deletions examples/create-nx-rspack-workspace-mf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ A comprehensive Nx workspace demonstrating Module Federation architecture with R
This Nx workspace consists of three federated applications:

- **`host/`** - Host application that orchestrates the micro-frontends
- **`remote1/`** - Remote application exposing shared components
- **`remote2/`** - Another remote application with independent functionality
- **`rspack_remote1/`** - Remote application exposing shared components
- **`rspack_remote2/`** - Another remote application with independent functionality

## Getting Started

Expand All @@ -36,13 +36,13 @@ This Nx workspace consists of three federated applications:

Start all applications concurrently:
```bash
npx nx run-many --target=serve --projects=remote1,remote2,host --parallel
npx nx run-many --target=serve --projects=rspack_remote1,rspack_remote2,host --parallel
```

Or start individually:
```bash
npx nx serve remote1
npx nx serve remote2
npx nx serve rspack_remote1
npx nx serve rspack_remote2
npx nx serve host
```

Expand All @@ -51,8 +51,8 @@ This Nx workspace consists of three federated applications:
Because this is a Module Federation setup, remotes must be built before the host:

```bash
npx nx run remote1:build
npx nx run remote2:build
npx nx run rspack_remote1:build
npx nx run rspack_remote2:build
npx nx run host:build
```

Expand Down
Loading
Loading