Skip to content
Open
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
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [["@module-federation/tanstack"]],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
pull_request:
branches: [main]
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
verify:
name: Verify (Node ${{ matrix.node }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ["22.18.0", "24", "26"]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: pnpm/action-setup@b0f76dfb45f55f8421693e4803ac7bb65143bd34 # v6
with:
version: 10.15.0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: ${{ matrix.node }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm format:check
- run: pnpm typecheck
- run: pnpm build
- run: pnpm test
- run: pnpm pack:tanstack
24 changes: 24 additions & 0 deletions .github/workflows/pkg-pr-new.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: pkg-pr-new

on:
push:
branches: [main]
pull_request:

permissions: {}

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: pnpm/action-setup@b0f76dfb45f55f8421693e4803ac7bb65143bd34 # v6
with:
version: 10.15.0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build:package
- run: pnpm dlx pkg-pr-new@0.0.54 publish ./packages/tanstack
21 changes: 21 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Validate PR title

on:
pull_request:
branches: [main]

permissions:
pull-requests: read

jobs:
semantic-pr:
runs-on: ubuntu-latest
steps:
- name: Accept generated release title
if: ${{ startsWith(github.event.pull_request.title, 'Release ') }}
run: echo "Generated release PR title accepted."

- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
if: ${{ !startsWith(github.event.pull_request.title, 'Release ') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46 changes: 46 additions & 0 deletions .github/workflows/release-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release Pull Request

on:
workflow_dispatch:

permissions:
contents: write
pull-requests: write

concurrency:
group: release-pull-request
cancel-in-progress: false

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Validate release request
env:
REPO_SCOPED_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}
run: |
test "$GITHUB_REF" = "refs/heads/main" || { echo "Release PRs are main-only."; exit 1; }
test -n "$REPO_SCOPED_TOKEN" || { echo "REPO_SCOPED_TOKEN is required."; exit 1; }
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
fetch-depth: 10
token: ${{ secrets.REPO_SCOPED_TOKEN }}
- uses: pnpm/action-setup@b0f76dfb45f55f8421693e4803ac7bb65143bd34 # v6
with:
version: 10.15.0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile --ignore-scripts
- uses: module-federation/actions@842df3a7740093a5ff44de2b9a890106046b8e32 # v2
with:
version: latest
versionNumber: auto
type: pull request
tools: changeset
coreNpmName: "@module-federation/tanstack"
env:
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}
REPOSITORY: ${{ github.repository }}
REF: ${{ github.ref }}
100 changes: 100 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Release

on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
type: choice
required: true
default: next
options: [latest, next]
branch:
required: true
default: main

permissions:
contents: read
id-token: write

concurrency:
group: publish-module-federation-tanstack
cancel-in-progress: false

jobs:
publish:
runs-on: ubuntu-latest
environment: Publish
steps:
- name: Validate manual target
if: github.event_name == 'workflow_dispatch'
env:
RELEASE_BRANCH: ${{ inputs.branch }}
run: test "$RELEASE_BRANCH" = "main" || { echo "Releases are main-only."; exit 1; }
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
fetch-depth: 0
ref: ${{ github.event.release.tag_name || inputs.branch }}
- name: Verify source branch
run: |
git fetch --no-tags origin main:refs/remotes/origin/main
git merge-base --is-ancestor HEAD origin/main || { echo "Source is not on main."; exit 1; }
- uses: pnpm/action-setup@b0f76dfb45f55f8421693e4803ac7bb65143bd34 # v6
with:
version: 10.15.0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 24
cache: pnpm
registry-url: https://registry.npmjs.org/
- run: pnpm install --frozen-lockfile
- name: Verify release tag
if: github.event_name == 'release'
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
test "${RELEASE_TAG#v}" = "$RELEASE_TAG" || { echo "Tags must not start with v."; exit 1; }
test "$(node -p "require('./packages/tanstack/package.json').version")" = "$RELEASE_TAG" || { echo "Tag/version mismatch."; exit 1; }
- name: Generate preview version
if: github.event_name == 'workflow_dispatch' && inputs.version == 'next'
run: |
pnpm changeset version --snapshot next
SNAPSHOT_VERSION="$(node -p "require('./packages/tanstack/package.json').version")"
BASE_VERSION="${SNAPSHOT_VERSION%%-*}"
npm pkg set version="${BASE_VERSION}-next.${GITHUB_RUN_ID}" --prefix packages/tanstack
- run: pnpm format:check
- run: pnpm typecheck
- run: pnpm build
- run: pnpm test
- run: pnpm pack:tanstack
- name: Compute dist-tag
id: dist
env:
INPUT_VERSION: ${{ inputs.version }}
PRERELEASE: ${{ github.event.release.prerelease || false }}
run: |
TAG=latest
if [ "$INPUT_VERSION" = "next" ] || [ "$PRERELEASE" = "true" ]; then TAG=next; fi
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
- name: Refuse conflicting republish
id: publish-check
env:
PACKAGE: "@module-federation/tanstack"
DIST_TAG: ${{ steps.dist.outputs.tag }}
run: |
VERSION="$(node -p "require('./packages/tanstack/package.json').version")"
EXISTING="$(npm view "$PACKAGE@$VERSION" version --json 2>/dev/null || true)"
EXISTING="${EXISTING#\"}"; EXISTING="${EXISTING%\"}"
if [ "$EXISTING" = "$VERSION" ]; then
CURRENT="$(npm view "$PACKAGE" "dist-tags.$DIST_TAG" --json 2>/dev/null || true)"
CURRENT="${CURRENT#\"}"; CURRENT="${CURRENT%\"}"
test "$CURRENT" = "$VERSION" || { echo "Existing version has conflicting dist-tag."; exit 1; }
echo "publish=false" >> "$GITHUB_OUTPUT"
else
echo "publish=true" >> "$GITHUB_OUTPUT"
fi
- name: Publish to npm
if: steps.publish-check.outputs.publish == 'true'
working-directory: packages/tanstack
run: npm publish --provenance --tag "${{ steps.dist.outputs.tag }}" --access public
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules/
dist/
.turbo/
.mf/
@mf-types/
*.log
pnpm-debug.log*
coverage/
*.tgz
*.tsbuildinfo
.DS_Store
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
auto-install-peers=false
prefer-frozen-lockfile=true
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist
node_modules
pnpm-lock.yaml
.turbo
**/routeTree.gen.ts
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": true,
"singleQuote": false,
"trailingComma": "all",
"printWidth": 100
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Module Federation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading