feat(rsbuild): add intial package (#29147)

## Current Behavior
We do not currently have a package or plugin to officially support
Rsbuild (http://rsbuild.dev)

## Expected Behavior
We should have a package to manage Rsbuild support
This commit is contained in:
Colum Ferry 2024-12-06 15:04:10 +00:00 committed by GitHub
parent cc1441170a
commit 50d83e2178
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
18 changed files with 247 additions and 1 deletions

View File

@ -97,6 +97,7 @@ rust-toolchain @nrwl/nx-native-reviewers
/e2e/webpack/** @nrwl/nx-js-reviewers /e2e/webpack/** @nrwl/nx-js-reviewers
/packages/rspack/** @nrwl/nx-js-reviewers /packages/rspack/** @nrwl/nx-js-reviewers
/e2e/rspack/** @nrwl/nx-js-reviewers /e2e/rspack/** @nrwl/nx-js-reviewers
/packages/rsbuild/** @nrwl/nx-js-reviewers
/packages/esbuild/** @nrwl/nx-js-reviewers /packages/esbuild/** @nrwl/nx-js-reviewers
/e2e/esbuild/** @nrwl/nx-js-reviewers /e2e/esbuild/** @nrwl/nx-js-reviewers
/packages/rollup/** @nrwl/nx-js-reviewers /packages/rollup/** @nrwl/nx-js-reviewers

View File

@ -9885,6 +9885,14 @@
"isExternal": false, "isExternal": false,
"disableCollapsible": false "disableCollapsible": false
}, },
{
"id": "rsbuild",
"path": "/nx-api/rsbuild",
"name": "rsbuild",
"children": [],
"isExternal": false,
"disableCollapsible": false
},
{ {
"id": "rspack", "id": "rspack",
"path": "/nx-api/rspack", "path": "/nx-api/rspack",

View File

@ -2891,6 +2891,18 @@
}, },
"path": "/nx-api/rollup" "path": "/nx-api/rollup"
}, },
"rsbuild": {
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "rsbuild",
"packageName": "@nx/rsbuild",
"description": "The Nx Plugin for Rsbuild contains an Nx plugin, executors and utilities that support building applications using Rsbuild.",
"documents": {},
"root": "/packages/rsbuild",
"source": "/packages/rsbuild/src",
"executors": {},
"generators": {},
"path": "/nx-api/rsbuild"
},
"rspack": { "rspack": {
"githubRoot": "https://github.com/nrwl/nx/blob/master", "githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "rspack", "name": "rspack",

View File

@ -2865,6 +2865,17 @@
"root": "/packages/rollup", "root": "/packages/rollup",
"source": "/packages/rollup/src" "source": "/packages/rollup/src"
}, },
{
"description": "The Nx Plugin for Rsbuild contains an Nx plugin, executors and utilities that support building applications using Rsbuild.",
"documents": [],
"executors": [],
"generators": [],
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "rsbuild",
"packageName": "@nx/rsbuild",
"root": "/packages/rsbuild",
"source": "/packages/rsbuild/src"
},
{ {
"description": "The Nx Plugin for Rspack contains executors and generators that support building applications using Rspack.", "description": "The Nx Plugin for Rspack contains executors and generators that support building applications using Rspack.",
"documents": [ "documents": [

View File

@ -685,6 +685,7 @@
- [init](/nx-api/rollup/generators/init) - [init](/nx-api/rollup/generators/init)
- [configuration](/nx-api/rollup/generators/configuration) - [configuration](/nx-api/rollup/generators/configuration)
- [convert-to-inferred](/nx-api/rollup/generators/convert-to-inferred) - [convert-to-inferred](/nx-api/rollup/generators/convert-to-inferred)
- [rsbuild](/nx-api/rsbuild)
- [rspack](/nx-api/rspack) - [rspack](/nx-api/rspack)
- [documents](/nx-api/rspack/documents) - [documents](/nx-api/rspack/documents)
- [Overview](/nx-api/rspack/documents/overview) - [Overview](/nx-api/rspack/documents/overview)

View File

@ -0,0 +1,44 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
},
{
"files": ["./package.json", "./generators.json", "./executors.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/nx-plugin-checks": "error"
}
},
{
"files": ["./package.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": [
"error",
{
"buildTargets": ["build-base"],
"ignoredDependencies": [
"nx",
"eslint",
"typescript",
"@nx/cypress",
"@nx/playwright"
]
}
]
}
}
]
}

View File

@ -0,0 +1,18 @@
<p style="text-align: center;">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
<img alt="Nx - Smart Monorepos · Fast CI" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
</picture>
</p>
{{links}}
<hr>
# Nx: Smart Monorepos · Fast CI
Nx is a build system, optimized for monorepos, with plugins for popular frameworks and tools and advanced CI capabilities including caching and distribution.
This package is a [Rsbuild plugin for Nx](https://nx.dev/nx-api/rsbuild).
{{content}}

View File

@ -0,0 +1,4 @@
{
"$schema": "http://json-schema.org/schema",
"executors": {}
}

View File

View File

@ -0,0 +1,16 @@
/* eslint-disable */
export default {
displayName: 'rsbuild',
preset: '../../jest.preset.js',
globals: {},
transform: {
'^.+\\.[tj]s$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/packages/rsbuild',
};

View File

@ -0,0 +1 @@
{}

View File

@ -0,0 +1,37 @@
{
"name": "@nx/rsbuild",
"description": "The Nx Plugin for Rsbuild contains an Nx plugin, executors and utilities that support building applications using Rsbuild.",
"version": "0.0.1",
"type": "commonjs",
"publishConfig": {
"access": "private"
},
"repository": {
"type": "git",
"url": "https://github.com/nrwl/nx.git",
"directory": "packages/rsbuild"
},
"bugs": {
"url": "https://github.com/nrwl/nx/issues"
},
"keywords": [
"Monorepo",
"Rspack",
"Webpack",
"Bundling",
"Module Federation",
"Rsbuild"
],
"author": "Colum Ferry",
"license": "MIT",
"homepage": "https://nx.dev",
"main": "index.js",
"executors": "./executors.json",
"dependencies": {
"tslib": "^2.3.0"
},
"peerDependencies": {},
"nx-migrations": {
"migrations": "./migrations.json"
}
}

View File

@ -0,0 +1,55 @@
{
"name": "rsbuild",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/rsbuild",
"projectType": "library",
"targets": {
"build-base": {
"executor": "@nx/js:tsc",
"options": {
"outputPath": "build/packages/rsbuild",
"tsConfig": "packages/rsbuild/tsconfig.lib.json",
"main": "packages/rsbuild/index.ts",
"assets": [
{
"input": "packages/rsbuild",
"glob": "**/files/**",
"output": "/"
},
{
"input": "packages/rsbuild",
"glob": "**/files/**/.gitkeep",
"output": "/"
},
{
"input": "packages/rsbuild",
"glob": "**/*.json",
"ignore": ["**/tsconfig*.json", "project.json", ".eslintrc.json"],
"output": "/"
},
{
"input": "packages/rsbuild",
"glob": "**/*.js",
"ignore": ["**/jest.config.js"],
"output": "/"
},
{
"input": "packages/rsbuild",
"glob": "**/*.d.ts",
"output": "/"
},
{
"input": "",
"glob": "LICENSE",
"output": "/"
}
]
},
"outputs": ["{options.outputPath}"]
},
"build": {
"command": "node ./scripts/copy-readme.js rsbuild",
"outputs": ["{workspaceRoot}/build/packages/rsbuild"]
}
}
}

View File

@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs"
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}

View File

@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"declaration": true,
"types": ["node"]
},
"include": ["**/*.ts"],
"exclude": ["jest.config.ts", "**/*.spec.ts", "**/*.test.ts"]
}

View File

@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"]
}

View File

@ -21,6 +21,7 @@ const scopes = [
{ value: 'react-native', name: 'react-native: anything React Native specific' }, { value: 'react-native', name: 'react-native: anything React Native specific' },
{ value: 'remix', name: 'remix: anything Remix specific' }, { value: 'remix', name: 'remix: anything Remix specific' },
{ value: 'rspack', name: 'rspack: anything Rspack specific' }, { value: 'rspack', name: 'rspack: anything Rspack specific' },
{ value: 'rsbuild', name: 'rsbuild: anything Rsbuild specific' },
{ value: 'expo', name: 'expo: anything Expo specific' }, { value: 'expo', name: 'expo: anything Expo specific' },
{ value: 'release', name: 'release: anything related to nx release' }, { value: 'release', name: 'release: anything related to nx release' },
{ value: 'repo', name: 'repo: anything related to managing the repo itself' }, { value: 'repo', name: 'repo: anything related to managing the repo itself' },

View File

@ -132,6 +132,8 @@
"@nx/remix/*": ["packages/remix/*"], "@nx/remix/*": ["packages/remix/*"],
"@nx/rollup": ["packages/rollup"], "@nx/rollup": ["packages/rollup"],
"@nx/rollup/*": ["packages/rollup/*"], "@nx/rollup/*": ["packages/rollup/*"],
"@nx/rsbuild": ["packages/rsbuild/src"],
"@nx/rsbuild/*": ["packages/rsbuild/src/*"],
"@nx/rspack": ["packages/rspack/src"], "@nx/rspack": ["packages/rspack/src"],
"@nx/rspack/*": ["packages/rspack/src/*"], "@nx/rspack/*": ["packages/rspack/src/*"],
"@nx/storybook": ["packages/storybook"], "@nx/storybook": ["packages/storybook"],