diff --git a/npm-packages/meteor-rspack/README.md b/npm-packages/meteor-rspack/README.md new file mode 100644 index 0000000000..e5ea9413a4 --- /dev/null +++ b/npm-packages/meteor-rspack/README.md @@ -0,0 +1,141 @@ +# @meteorjs/rspack + +The default [Rspack](https://rspack.dev) configuration for Meteor applications. This package provides everything you need to bundle your Meteor app with Rspack out of the box: client and server builds, SWC transpilation, React/Blaze/Angular support, hot module replacement, asset management, and all the Meteor-specific wiring so you don't have to. + +When Meteor runs with the Rspack bundler enabled, this package is what generates the underlying Rspack configuration. It detects your project setup (TypeScript, React, Blaze, Angular), sets up the right loaders and plugins, defines `Meteor.isClient`/`Meteor.isServer` and friends, configures caching, and exposes a set of helpers you can use in your own `rspack.config.js` to customize the build without breaking Meteor integration. + +## What it provides + +- **Dual client/server builds** with the correct targets, externals, and output paths +- **SWC-based transpilation** for JS/TS/JSX/TSX with automatic framework detection +- **React Fast Refresh** in development when React is enabled +- **Blaze template handling** via ignore-loader when Blaze is enabled +- **Persistent filesystem caching** for fast rebuilds +- **Asset externals and HTML generation** through custom Rspack plugins +- **A `defineConfig` helper** that accepts a factory function receiving Meteor environment flags and build utilities +- **Customizable config** via `rspack.config.js` in your project root, with safe merging that warns if you try to override reserved settings + +## Installation + +[Rspack integration](https://docs.meteor.com/about/modern-build-stack/rspack-bundler-integration.html) is automatically managed by the rspack Atmosphere package. + +```bash +meteor add rspack +``` + +By doing this, your Meteor app will automatically serve `@meteorjs/rspack` and the required `@rspack/cli`, `@rspack/core`, among others. + +## Usage + +In your project's `rspack.config.js`, use the `defineConfig` helper to customize the build. The factory function receives a `env` object with Meteor environment flags and helper utilities: + +```js +const { defineConfig } = require('@meteorjs/rspack'); + +module.exports = defineConfig((env, argv) => { + // env.isClient, env.isServer, env.isDevelopment, env.isProduction + // env.isReactEnabled, env.isBlazeEnabled, etc. + + return { + // Your custom Rspack configuration here. + // It gets safely merged with the Meteor defaults. + }; +}); +``` + +More information is available in the official docs: [Rspack Bundler Integration](https://docs.meteor.com/about/modern-build-stack/rspack-bundler-integration.html#custom-rspack-config-js). + +## Development + +### Install dependencies + +```bash +npm install +``` + +### Version bumping + +Use `npm run bump` to update the version in `package.json` before publishing. + +```bash +npm run bump -- [--beta] +``` + +**Standard bumps** increment the version and remove any prerelease suffix: + +```bash +npm run bump -- patch # 1.0.1 -> 1.0.2 +npm run bump -- minor # 1.0.1 -> 1.1.0 +npm run bump -- major # 1.0.1 -> 2.0.0 +``` + +**Beta bumps** append or increment a `-beta.N` prerelease suffix: + +```bash +npm run bump -- patch --beta # 1.0.1 -> 1.0.2-beta.0 +npm run bump -- patch --beta # 1.0.2-beta.0 -> 1.0.2-beta.1 +npm run bump -- patch --beta # 1.0.2-beta.1 -> 1.0.2-beta.2 +``` + +If you change the bump level while on a beta, the base version updates and the beta counter resets: + +```bash +npm run bump -- minor --beta # 1.0.2-beta.2 -> 1.1.0-beta.0 +npm run bump -- major --beta # 1.1.0-beta.0 -> 2.0.0-beta.0 +``` + +### Publishing a beta release + +After bumping to a beta version, publish to the `beta` dist-tag: + +```bash +npm run bump -- patch --beta +npm run publish:beta +``` + +Users can then install the beta with: + +```bash +npm install @meteorjs/rspack@beta +``` + +You can pass extra flags to `npm publish` through the script: + +```bash +npm run publish:beta -- --dry-run +``` + +### Publishing an official release + +After bumping to a stable version, publish with the default `latest` tag: + +```bash +npm run bump -- patch +npm publish +``` + +### Typical workflows + +**Beta iteration**: ship multiple beta builds for the same upcoming patch: + +```bash +npm run bump -- patch --beta # 1.0.1 -> 1.0.2-beta.0 +npm run publish:beta +# ... fix issues ... +npm run bump -- patch --beta # 1.0.2-beta.0 -> 1.0.2-beta.1 +npm run publish:beta +``` + +**Promote beta to stable**: once the beta is ready, bump to the stable version and publish: + +```bash +npm run bump -- patch # 1.0.2-beta.1 -> 1.0.3 +npm publish +``` + +**Direct stable release**: skip the beta phase entirely: + +```bash +npm run bump -- minor # 1.0.1 -> 1.1.0 +npm publish +``` diff --git a/npm-packages/meteor-rspack/scripts/bump-version.js b/npm-packages/meteor-rspack/scripts/bump-version.js new file mode 100755 index 0000000000..81be21edc5 --- /dev/null +++ b/npm-packages/meteor-rspack/scripts/bump-version.js @@ -0,0 +1,89 @@ +#!/usr/bin/env node +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const semver = require('semver'); + +const VALID_LEVELS = ['major', 'minor', 'patch']; + +function usage() { + console.log(`Usage: node ${path.basename(__filename)} [--beta]`); + console.log(''); + console.log('Examples:'); + console.log(' patch # 1.0.1 -> 1.0.2'); + console.log(' minor # 1.0.1 -> 1.1.0'); + console.log(' major # 1.0.1 -> 2.0.0'); + console.log(' patch --beta # 1.0.1 -> 1.0.2-beta.0'); + console.log(' patch --beta # 1.0.2-beta.0 -> 1.0.2-beta.1 (already beta, bumps beta number)'); + console.log(' minor --beta # 1.0.2-beta.1 -> 1.1.0-beta.0 (different bump level resets)'); + process.exit(1); +} + +const args = process.argv.slice(2); +const level = args[0]; +const beta = args.includes('--beta'); + +if (!level || !VALID_LEVELS.includes(level)) { + if (level) console.error(`Error: first argument must be major, minor, or patch`); + usage(); +} + +const pkgPath = path.resolve(__dirname, '..', 'package.json'); +const raw = fs.readFileSync(pkgPath, 'utf8'); +const pkg = JSON.parse(raw); +const current = pkg.version; +const parsed = semver.parse(current); + +if (!parsed) { + console.error(`Error: invalid current version "${current}"`); + process.exit(1); +} + +let newVersion; + +if (beta) { + const isBeta = parsed.prerelease.length > 0 && parsed.prerelease[0] === 'beta'; + + if (isBeta) { + // Already a beta. The base version already has a prior bump applied. + // Check if the same bump level is being requested by inspecting which + // components are zeroed out (major resets minor+patch, minor resets patch). + // If the same level, just increment the beta number. + const { major, minor, patch } = parsed; + const betaNum = typeof parsed.prerelease[1] === 'number' ? parsed.prerelease[1] : 0; + let sameLevel = false; + + if (level === 'patch') { + sameLevel = true; + } else if (level === 'minor') { + sameLevel = patch === 0 && minor > 0; + } else if (level === 'major') { + sameLevel = minor === 0 && patch === 0; + } + + if (sameLevel) { + newVersion = `${major}.${minor}.${patch}-beta.${betaNum + 1}`; + } else { + const bumped = semver.inc(`${major}.${minor}.${patch}`, level); + newVersion = `${bumped}-beta.0`; + } + } else { + // Not a beta yet: bump the base and start at beta.0 + const bumped = semver.inc(current, level); + newVersion = `${bumped}-beta.0`; + } +} else { + if (parsed.prerelease.length > 0) { + // Currently a prerelease: bump base version from the clean base + const cleanBase = `${parsed.major}.${parsed.minor}.${parsed.patch}`; + newVersion = semver.inc(cleanBase, level); + } else { + newVersion = semver.inc(current, level); + } +} + +pkg.version = newVersion; +fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n'); + +console.log(`Bumped version: ${current} -> ${newVersion}`); diff --git a/npm-packages/meteor-rspack/scripts/publish-beta.sh b/npm-packages/meteor-rspack/scripts/publish-beta.sh new file mode 100755 index 0000000000..29ec756bbf --- /dev/null +++ b/npm-packages/meteor-rspack/scripts/publish-beta.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euo pipefail + +npm publish --tag beta "$@" diff --git a/v3-docs/docs/.vitepress/config.mts b/v3-docs/docs/.vitepress/config.mts index bef4db33ed..97af62202c 100644 --- a/v3-docs/docs/.vitepress/config.mts +++ b/v3-docs/docs/.vitepress/config.mts @@ -163,10 +163,6 @@ export default defineConfig({ text: "Roadmap", link: "/about/roadmap", }, - { - text: "Contributing", - link: "/about/contributing", - } ], collapsed: true, }, @@ -631,6 +627,20 @@ export default defineConfig({ ], collapsed: true, }, + { + text: "Community", + items: [ + { + text: "Contributing", + link: "/community/contributing", + }, + { + text: "Contributors", + link: "/community/contributors", + }, + ], + collapsed: true, + }, ], socialLinks: [ diff --git a/v3-docs/docs/.vitepress/theme/Contributors.vue b/v3-docs/docs/.vitepress/theme/Contributors.vue new file mode 100644 index 0000000000..2b817192b7 --- /dev/null +++ b/v3-docs/docs/.vitepress/theme/Contributors.vue @@ -0,0 +1,106 @@ + + + + + diff --git a/v3-docs/docs/.vitepress/theme/index.ts b/v3-docs/docs/.vitepress/theme/index.ts index afddc3f960..e546ad156d 100644 --- a/v3-docs/docs/.vitepress/theme/index.ts +++ b/v3-docs/docs/.vitepress/theme/index.ts @@ -3,6 +3,7 @@ import type { Theme } from "vitepress"; import DefaultTheme from "vitepress/theme"; import ApiBox from "../../components/ApiBox.vue"; import ApiMap from "../../components/ApiMap.vue"; +import Contributors from "./Contributors.vue"; import Layout from "./Layout.vue"; import "./theme.css"; @@ -12,6 +13,7 @@ export default { // register your custom global components app.component("ApiBox", ApiBox); app.component("ApiMap", ApiMap); + app.component("Contributors", Contributors); }, Layout, } satisfies Theme; diff --git a/v3-docs/docs/api/packages-listing.md b/v3-docs/docs/api/packages-listing.md index d53b36c78f..2b283d0acf 100644 --- a/v3-docs/docs/api/packages-listing.md +++ b/v3-docs/docs/api/packages-listing.md @@ -125,6 +125,7 @@ ### [retry](https://github.com/meteor/meteor/tree/devel/packages/retry) {#retry} ### [roles](https://github.com/meteor/meteor/tree/devel/packages/roles) {#roles} ### [routepolicy](https://github.com/meteor/meteor/tree/devel/packages/routepolicy) {#routepolicy} +### [rspack](https://github.com/meteor/meteor/tree/devel/packages/rspack) {#rspack} ### [server-render](https://github.com/meteor/meteor/tree/devel/packages/server-render) {#server-render} ### [service-configuration](https://github.com/meteor/meteor/tree/devel/packages/service-configuration) {#service-configuration} ### [session](https://github.com/meteor/meteor/tree/devel/packages/session) {#session} @@ -142,6 +143,7 @@ ### [test-server-tests-in-console-once](https://github.com/meteor/meteor/tree/devel/packages/test-server-tests-in-console-once) {#test-server-tests-in-console-once} ### [tinytest](https://github.com/meteor/meteor/tree/devel/packages/tinytest) {#tinytest} ### [tinytest-harness](https://github.com/meteor/meteor/tree/devel/packages/tinytest-harness) {#tinytest-harness} +### [tools-core](https://github.com/meteor/meteor/tree/devel/packages/tools-core) {#tools-core} ### [tracker](https://github.com/meteor/meteor/tree/devel/packages/tracker) {#tracker} ### [twitter-config-ui](https://github.com/meteor/meteor/tree/devel/packages/twitter-config-ui) {#twitter-config-ui} ### [twitter-oauth](https://github.com/meteor/meteor/tree/devel/packages/twitter-oauth) {#twitter-oauth} diff --git a/v3-docs/docs/about/contributing.md b/v3-docs/docs/community/contributing.md similarity index 100% rename from v3-docs/docs/about/contributing.md rename to v3-docs/docs/community/contributing.md diff --git a/v3-docs/docs/community/contributors.data.ts b/v3-docs/docs/community/contributors.data.ts new file mode 100644 index 0000000000..6edc582ecb --- /dev/null +++ b/v3-docs/docs/community/contributors.data.ts @@ -0,0 +1,60 @@ +export interface Contributor { + login: string + avatar_url: string + html_url: string + contributions: number +} + +declare const data: Contributor[] +export { data } + +export default { + async load(): Promise { + const contributors: Contributor[] = [] + let page = 1 + const perPage = 100 + + while (true) { + const headers: Record = { + Accept: 'application/vnd.github.v3+json', + 'User-Agent': 'meteor-docs-builder', + } + + if (process.env.GITHUB_TOKEN) { + headers['Authorization'] = `Bearer ${process.env.GITHUB_TOKEN}` + } + + const response = await fetch( + `https://api.github.com/repos/meteor/meteor/contributors?per_page=${perPage}&page=${page}`, + { headers } + ) + + if (!response.ok) { + console.warn( + `[contributors.data] GitHub API error: ${response.status} ${response.statusText}` + ) + break + } + + const batch = (await response.json()) as any[] + + if (!batch.length) break + + contributors.push( + ...batch + .filter((c) => c.type === 'User') + .map((c) => ({ + login: c.login, + avatar_url: c.avatar_url, + html_url: c.html_url, + contributions: c.contributions, + })) + ) + + if (batch.length < perPage) break + page++ + } + + return contributors + }, +} diff --git a/v3-docs/docs/community/contributors.md b/v3-docs/docs/community/contributors.md new file mode 100644 index 0000000000..c5e93f953b --- /dev/null +++ b/v3-docs/docs/community/contributors.md @@ -0,0 +1,43 @@ +--- +outline: false +--- + + + +# Contributors + +## Technical Committee + +The Technical Committee is responsible for the direction and governance of the Meteor project. + + + +## Core Maintainers + +Core Maintainers are experienced contributors who actively maintain key areas of the Meteor codebase. + + + +## All Contributors + +Thank you to all the amazing people who have contributed to Meteor! This list is automatically generated from the [meteor/meteor](https://github.com/meteor/meteor) GitHub repository, sorted by number of commits. + + diff --git a/v3-docs/docs/history.md b/v3-docs/docs/history.md index d21e98513f..2187c91936 100644 --- a/v3-docs/docs/history.md +++ b/v3-docs/docs/history.md @@ -10,21 +10,23 @@ This is a complete history of changes for Meteor releases. [//]: # (go to meteor/docs/generators/changelog/docs) + + ## v3.4.0, 30-01-2026 ### Highlights - **Meteor-Rspack Integration**, [PR#13910](https://github.com/meteor/meteor/pull/13910) - ⚡ New `rspack` atmosphere package (requires at least rspack@1.7.1) - Orchestrates the full Rspack setup, including the development server and production builds. + Orchestrates the full Rspack setup, including the development server and production builds. - 📦 New `@meteorjs/rspack` npm package - Provides a default rspack.config.js. Applications can extend or override this configuration with their own. + Provides a default rspack.config.js. Applications can extend or override this configuration with their own. - 🛠️ New `tools-core` package - Supplies runtime utilities for Meteor, designed to support this integration and future tool integrations. + Supplies runtime utilities for Meteor, designed to support this integration and future tool integrations. - 🔑 Core updates - Enhanced Meteor’s core to support the Rspack integration. + Enhanced Meteor’s core to support the Rspack integration. - ✅ Test suite additions - Introduced tests for app skeletons and Meteor-Rspack features to ensure quality and reliability. + Introduced tests for app skeletons and Meteor-Rspack features to ensure quality and reliability. - 📃 [Documentation](https://docs.meteor.com/about/modern-build-stack/rspack-bundler-integration.html) Complete documentation section covering all details of the Meteor-Rspack integration, including migration guides, configuration helpers and more. - Adopting Rspack gives you a faster build experience @@ -155,8 +157,7 @@ If you find any issues, please report them to the [Meteor issues tracker](https: - [@jeetburman](https://github.com/jeetburman) - [@copleykj](https://github.com/copleykj) - ✨✨✨ - + ✨✨✨ ## v3.3.2, 01-09-2025 ### Highlights @@ -226,7 +227,6 @@ If you find any issues, please report them to the [Meteor issues tracker](https: - [@copleykj](https://github.com/copleykj) ✨✨✨ - ## v3.3.1, 05-08-2025 ### Highlights