Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [["@module-federation/vite"]],
"ignorePatterns": ["^alpha|^beta"],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/misty-hounds-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/vite': patch
---

chore: add changesets configuration
62 changes: 62 additions & 0 deletions .github/workflows/release-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release Pull Request

on:
workflow_dispatch:
inputs:
version:
type: choice
description: 'Release Type (next, beta, alpha, latest)'
required: true
default: 'latest'
options:
- next
- beta
- alpha
- latest

jobs:
release:
name: Create Release Pull Request
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
Comment on lines +22 to +23
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

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

This workflow uses actions/checkout@master, which is unpinned and goes against the convention elsewhere in this repo of pinning GitHub Actions to a major version (for example, .github/workflows/release.yml and unit-test.yml both use actions/checkout@v5). To reduce the risk of unexpected breaking changes and keep workflows consistent, consider switching this to a pinned major version such as actions/checkout@v5.

Copilot uses AI. Check for mistakes.
with:
fetch-depth: 10

- name: Cache Tool Downloads
uses: actions/cache@v4
with:
path: ~/.cache
key: ${{ runner.os }}-toolcache-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-toolcache-

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.14.2

- name: Setup Node.js 24
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'

- name: Install Dependencies
run: pnpm install --ignore-scripts

- name: Create Release Pull Request
uses: module-federation/actions@v2
with:
version: ${{ github.event.inputs.version || 'latest' }}
versionNumber: 'auto'
type: 'pull request'
tools: 'changeset'
coreNpmName: '@module-federation/vite'
env:
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN || secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
REPOSITORY: ${{ github.repository }}
REF: ${{ github.ref }}
44 changes: 42 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
name: Release

on:
- workflow_dispatch
workflow_dispatch:
inputs:
version:
type: choice
description: 'Release Version'
required: true
default: 'next'
options:
- latest
- next
branch:
description: 'Release Branch (confirm release branch)'
required: true
default: 'main'

permissions:
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 25
ref: ${{ github.event.inputs.branch }}

- name: Cache Tool Downloads
uses: actions/cache@v4
with:
path: ~/.cache
key: ${{ runner.os }}-toolcache-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-toolcache-

- name: PNPM Install
uses: pnpm/action-setup@v4
Expand All @@ -27,10 +54,23 @@ jobs:
- name: Install NPM Dependencies
run: pnpm install --frozen-lockfile

- name: Generate preview version
if: github.event.inputs.version == 'next'
run: |
SAFE_BRANCH=$(echo "${{ github.event.inputs.branch }}" | sed 's/[^a-zA-Z0-9-]/-/g' | tr '[:upper:]' '[:lower:]')
npx changeset version --snapshot "$SAFE_BRANCH"

- name: Build
run: pnpm run build

- name: Publish to npm
- name: Publish latest version
if: github.event.inputs.version == 'latest'
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish preview version
if: github.event.inputs.version == 'next'
run: npm publish --tag next --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"preview-vv": "pnpm -filter 'examples-vite-vite*' run preview",
"multi-example": "pnpm --filter \"multi-example-*\" --parallel run start",
"test": "vitest",
"e2e": "playwright test"
"e2e": "playwright test",
"changeset": "changeset",
"changeset:status": "changeset status"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -59,6 +61,7 @@
"pathe": "^1.1.2"
},
"devDependencies": {
"@changesets/cli": "^2.27.9",
"@playwright/test": "^1.47.2",
"@types/node": "^22.7.4",
"husky": "^8.0.3",
Expand Down
Loading
Loading