Skip to content

Commit 179c530

Browse files
committed
feat(angular): add angular-rspack-compiler package
1 parent 079dd89 commit 179c530

28 files changed

+130
-860
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
pnpm nx run-many -t check-imports check-commit check-lock-files check-codeowners --parallel=1 --no-dte &
9696
pids+=($!)
9797
98-
pnpm nx affected --targets=lint,test,build,e2e,e2e-ci,format-native,lint-native &
98+
pnpm nx affected --targets=lint,test,vite:test,build,e2e,e2e-ci,format-native,lint-native &
9999
pids+=($!)
100100
101101
for pid in "${pids[@]}"; do

docs/generated/manifests/menus.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7714,6 +7714,14 @@
77147714
"isExternal": false,
77157715
"disableCollapsible": false
77167716
},
7717+
{
7718+
"id": "angular-rspack-compiler",
7719+
"path": "/nx-api/angular-rspack-compiler",
7720+
"name": "angular-rspack-compiler",
7721+
"children": [],
7722+
"isExternal": false,
7723+
"disableCollapsible": false
7724+
},
77177725
{
77187726
"id": "create-nx-plugin",
77197727
"path": "/nx-api/create-nx-plugin",

docs/generated/manifests/nx-api.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,19 @@
12171217
},
12181218
"path": "/nx-api/angular"
12191219
},
1220+
"angular-rspack-compiler": {
1221+
"githubRoot": "https://github.com/nrwl/nx/blob/master",
1222+
"name": "angular-rspack-compiler",
1223+
"packageName": "@nx/angular-rspack-compiler",
1224+
"description": "Compilation utilities for Angular with Rspack and Rsbuild.",
1225+
"documents": {},
1226+
"root": "/packages/angular-rspack-compiler",
1227+
"source": "/packages/angular-rspack-compiler/src",
1228+
"executors": {},
1229+
"generators": {},
1230+
"migrations": {},
1231+
"path": "/nx-api/angular-rspack-compiler"
1232+
},
12201233
"create-nx-plugin": {
12211234
"githubRoot": "https://github.com/nrwl/nx/blob/master",
12221235
"name": "create-nx-plugin",

docs/generated/packages-metadata.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,6 +1216,18 @@
12161216
"root": "/packages/angular",
12171217
"source": "/packages/angular/src"
12181218
},
1219+
{
1220+
"description": "Compilation utilities for Angular with Rspack and Rsbuild.",
1221+
"documents": [],
1222+
"executors": [],
1223+
"generators": [],
1224+
"migrations": [],
1225+
"githubRoot": "https://github.com/nrwl/nx/blob/master",
1226+
"name": "angular-rspack-compiler",
1227+
"packageName": "@nx/angular-rspack-compiler",
1228+
"root": "/packages/angular-rspack-compiler",
1229+
"source": "/packages/angular-rspack-compiler/src"
1230+
},
12191231
{
12201232
"description": "This package is used to scaffold a brand-new workspace used to develop an Nx plugin, and sets up a pre-configured plugin with the specified name. The new plugin is created with a default generator, executor, and e2e app.",
12211233
"documents": [],

docs/shared/reference/sitemap.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@
400400
- [cypress-component-configuration](/nx-api/angular/generators/cypress-component-configuration)
401401
- [web-worker](/nx-api/angular/generators/web-worker)
402402
- [migrations](/nx-api/angular/migrations)
403+
- [angular-rspack-compiler](/nx-api/angular-rspack-compiler)
403404
- [create-nx-plugin](/nx-api/create-nx-plugin)
404405
- [create-nx-workspace](/nx-api/create-nx-workspace)
405406
- [cypress](/nx-api/cypress)

nx.json

Lines changed: 55 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
{
22
"$schema": "packages/nx/schemas/nx-schema.json",
33
"namedInputs": {
4-
"default": [
5-
"{projectRoot}/**/*",
6-
"sharedGlobals"
7-
],
4+
"default": ["{projectRoot}/**/*", "sharedGlobals"],
85
"production": [
96
"default",
107
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
@@ -31,10 +28,7 @@
3128
"runtime": "rustc --version"
3229
},
3330
{
34-
"externalDependencies": [
35-
"npm:@monodon/rust",
36-
"npm:@napi-rs/cli"
37-
]
31+
"externalDependencies": ["npm:@monodon/rust", "npm:@napi-rs/cli"]
3832
}
3933
],
4034
"e2eInputs": [
@@ -61,10 +55,7 @@
6155
]
6256
},
6357
"release": {
64-
"projects": [
65-
"packages/*",
66-
"packages/nx/native-packages/*"
67-
],
58+
"projects": ["packages/*", "packages/nx/native-packages/*"],
6859
"releaseTagPattern": "{version}",
6960
"changelog": {
7061
"workspaceChangelog": {
@@ -85,9 +76,7 @@
8576
},
8677
"currentVersionResolver": "registry",
8778
"preserveLocalDependencyProtocols": false,
88-
"manifestRootsToUpdate": [
89-
"build/packages/{projectName}"
90-
],
79+
"manifestRootsToUpdate": ["build/packages/{projectName}"],
9180
"versionActionsOptions": {
9281
"skipLockFileUpdate": true
9382
}
@@ -100,140 +89,87 @@
10089
}
10190
},
10291
"build": {
103-
"dependsOn": [
104-
"build-base",
105-
"build-native"
106-
],
107-
"inputs": [
108-
"production",
109-
"^production"
110-
],
92+
"dependsOn": ["build-base", "build-native"],
93+
"inputs": ["production", "^production"],
11194
"cache": true
11295
},
11396
"build-native": {
114-
"inputs": [
115-
"native"
116-
],
97+
"inputs": ["native"],
11798
"cache": true
11899
},
119100
"build-base": {
120-
"dependsOn": [
121-
"^build-base",
122-
"build-native"
123-
],
124-
"inputs": [
125-
"production",
126-
"^production"
127-
],
101+
"dependsOn": ["^build-base", "build-native"],
102+
"inputs": ["production", "^production"],
128103
"options": {
129104
"outputPath": "build/{projectRoot}",
130105
"tsConfig": "{projectRoot}/tsconfig.lib.json",
131106
"main": "{projectRoot}/index.ts"
132107
},
133-
"outputs": [
134-
"{options.outputPath}"
135-
],
108+
"outputs": ["{options.outputPath}"],
136109
"cache": true
137110
},
138111
"test-native": {
139-
"inputs": [
140-
"native"
141-
],
112+
"inputs": ["native"],
142113
"executor": "@monodon/rust:test",
143114
"options": {},
144115
"cache": true
145116
},
146117
"test": {
147-
"dependsOn": [
148-
"test-native",
149-
"build-native",
150-
"^build-native"
151-
],
152-
"inputs": [
153-
"default",
154-
"^production",
155-
"{workspaceRoot}/jest.preset.js"
156-
],
118+
"dependsOn": ["test-native", "build-native", "^build-native"],
119+
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
157120
"options": {
158-
"args": [
159-
"--passWithNoTests",
160-
"--detectOpenHandles",
161-
"--forceExit"
162-
]
121+
"args": ["--passWithNoTests", "--detectOpenHandles", "--forceExit"]
163122
}
164123
},
124+
"vite:test": {
125+
"dependsOn": ["test-native", "build-native", "^build-native"],
126+
"inputs": ["default", "^production"]
127+
},
165128
"lint": {
166-
"dependsOn": [
167-
"build-native",
168-
"^build-native"
169-
]
129+
"dependsOn": ["build-native", "^build-native"]
170130
},
171131
"e2e": {
172132
"cache": true,
173-
"inputs": [
174-
"e2eInputs",
175-
"^production"
176-
]
133+
"inputs": ["e2eInputs", "^production"]
177134
},
178135
"e2e-local": {
179136
"cache": true,
180-
"inputs": [
181-
"e2eInputs",
182-
"^production"
183-
],
137+
"inputs": ["e2eInputs", "^production"],
184138
"dependsOn": [
185139
"@nx/nx-source:populate-local-registry-storage",
186140
"@nx/nx-source:local-registry"
187141
]
188142
},
189143
"e2e-ci": {
190-
"inputs": [
191-
"e2eInputs",
192-
"^production"
193-
]
144+
"inputs": ["e2eInputs", "^production"]
194145
},
195146
"e2e-macos-local": {
196147
"cache": true,
197-
"inputs": [
198-
"e2eInputs",
199-
"^production"
200-
],
148+
"inputs": ["e2eInputs", "^production"],
201149
"dependsOn": [
202150
"@nx/nx-source:populate-local-registry-storage",
203151
"@nx/nx-source:local-registry"
204152
]
205153
},
206154
"e2e-macos-ci": {
207-
"inputs": [
208-
"e2eInputs",
209-
"^production"
210-
]
155+
"inputs": ["e2eInputs", "^production"]
211156
},
212157
"e2e-ci--**/**": {
213-
"inputs": [
214-
"e2eInputs",
215-
"^production"
216-
],
158+
"inputs": ["e2eInputs", "^production"],
217159
"dependsOn": [
218160
"@nx/nx-source:populate-local-registry-storage",
219161
"@nx/nx-source:local-registry"
220162
]
221163
},
222164
"e2e-macos-ci--**/*": {
223-
"inputs": [
224-
"e2eInputs",
225-
"^production"
226-
],
165+
"inputs": ["e2eInputs", "^production"],
227166
"dependsOn": [
228167
"@nx/nx-source:populate-local-registry-storage",
229168
"@nx/nx-source:local-registry"
230169
]
231170
},
232171
"e2e-base": {
233-
"inputs": [
234-
"default",
235-
"^production"
236-
]
172+
"inputs": ["default", "^production"]
237173
},
238174
"build-storybook": {
239175
"inputs": [
@@ -294,26 +230,16 @@
294230
},
295231
{
296232
"plugin": "@nx/jest/plugin",
297-
"include": [
298-
"e2e/**/*"
299-
],
300-
"exclude": [
301-
"e2e/detox/**/*",
302-
"e2e/react-native/**/*",
303-
"e2e/expo/**/*"
304-
],
233+
"include": ["e2e/**/*"],
234+
"exclude": ["e2e/detox/**/*", "e2e/react-native/**/*", "e2e/expo/**/*"],
305235
"options": {
306236
"targetName": "e2e-local",
307237
"ciTargetName": "e2e-ci"
308238
}
309239
},
310240
{
311241
"plugin": "@nx/jest/plugin",
312-
"include": [
313-
"e2e/detox/**/*",
314-
"e2e/react-native/**/*",
315-
"e2e/expo/**/*"
316-
],
242+
"include": ["e2e/detox/**/*", "e2e/react-native/**/*", "e2e/expo/**/*"],
317243
"options": {
318244
"targetName": "e2e-macos-local",
319245
"ciTargetName": "e2e-macos-ci"
@@ -347,8 +273,31 @@
347273
"buildDepsTargetName": "build-deps",
348274
"watchDepsTargetName": "watch-deps"
349275
}
276+
},
277+
{
278+
"plugin": "@nx/vite/plugin",
279+
"include": ["packages/angular-rspack-compiler/**/*"],
280+
"options": {
281+
"testTargetName": "vite:test"
282+
}
283+
},
284+
{
285+
"plugin": "@nx/js/typescript",
286+
"include": ["packages/angular-rspack-compiler/**/*"],
287+
"options": {
288+
"typecheck": {
289+
"targetName": "typecheck"
290+
},
291+
"build": {
292+
"targetName": "build",
293+
"configName": "tsconfig.lib.json"
294+
}
295+
}
350296
}
351297
],
298+
"sync": {
299+
"disabledTaskSyncGenerators": ["@nx/js:typescript-sync"]
300+
},
352301
"nxCloudId": "62d013ea0852fe0a2df74438",
353302
"nxCloudUrl": "https://staging.nx.app",
354303
"parallel": 1,
@@ -358,18 +307,14 @@
358307
"rules": [
359308
{
360309
"rule": "@nx/workspace-plugin/conformance-rules/blog-description",
361-
"projects": [
362-
"docs"
363-
],
310+
"projects": ["docs"],
364311
"options": {
365312
"mdGlobPattern": "{blog,shared}/**/!(sitemap).md"
366313
}
367314
},
368315
{
369316
"rule": "@nx/workspace-plugin/conformance-rules/blog-cover-image",
370-
"projects": [
371-
"docs"
372-
],
317+
"projects": ["docs"],
373318
"options": {
374319
"mdGlobPattern": "blog/**/!(sitemap).md"
375320
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"prepare": "is-ci || husky",
2222
"echo": "echo 123458",
2323
"preinstall": "node ./scripts/preinstall.js",
24+
"postinstall": "node ./packages/angular-rspack-compiler/patch/patch-angular-build.js",
2425
"test": "nx run-many -t test",
2526
"e2e": "nx run-many -t e2e --projects ./e2e/*",
2627
"build:wasm": "rustup override set nightly-2025-05-09 && rustup target add wasm32-wasip1-threads && WASI_SDK_PATH=\"$(pwd)/wasi-sdk-23.0-x86_64-linux\" CMAKE_BUILD_PARALLEL_LEVEL=2 LIBSQLITE3_FLAGS=\"-DLONGDOUBLE_TYPE=double\" pnpm exec nx run-many -t build-native-wasm && rustup override unset",
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"extends": "../../.eslintrc",
3+
"overrides": [
4+
{
5+
"files": ["**/*.json"],
6+
"rules": {
7+
"@nx/dependency-checks": [
8+
"error",
9+
{
10+
"ignoredFiles": [
11+
"{projectRoot}/eslint.config.{js,cjs,mjs}",
12+
"{projectRoot}/vite.config.{js,ts,mjs,mts}"
13+
],
14+
"ignoredDependencies": [
15+
"@angular/core",
16+
"jsonc-eslint-parser",
17+
"vitest"
18+
]
19+
}
20+
]
21+
},
22+
"parser": "jsonc-eslint-parser"
23+
}
24+
]
25+
}

0 commit comments

Comments
 (0)