Skip to content

Commit 9f5615e

Browse files
ScriptedAlchemycursoragentclaude
authored
Create Rslib executor for Nx (#3876)
Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: Claude <[email protected]>
1 parent d374fac commit 9f5615e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1458
-573
lines changed

apps/rslib-module/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@module-federation/rsbuild-plugin": "workspace:*",
2424
"@module-federation/storybook-addon": "workspace:*",
2525
"@rsbuild/plugin-react": "^1.0.6",
26-
"@rslib/core": "0.2.0",
26+
"@rslib/core": "0.10.4",
2727
"@types/react": "^18.3.11",
2828
"http-server": "^14.1.1",
2929
"react": "^18.3.1",

apps/rslib-module/project.json

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,41 @@
11
{
22
"name": "rslib-module",
33
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4-
"sourceRoot": "packages/rslib-module/src",
4+
"sourceRoot": "apps/rslib-module/src",
55
"projectType": "library",
66
"tags": ["type:app"],
77
"targets": {
88
"build": {
9-
"executor": "nx:run-commands",
9+
"executor": "../../tools/rslib-plugin:build",
10+
"outputs": ["{projectRoot}/dist"],
1011
"options": {
11-
"commands": ["npm run build --prefix apps/rslib-module"]
12+
"configFile": "rslib.config.ts",
13+
"mode": "production"
14+
},
15+
"configurations": {
16+
"development": {
17+
"mode": "development"
18+
},
19+
"watch": {
20+
"watch": true
21+
}
1222
}
1323
},
24+
"dev": {
25+
"executor": "../../tools/rslib-plugin:dev",
26+
"options": {
27+
"configFile": "rslib.config.ts",
28+
"mode": "mf-dev",
29+
"port": 3001,
30+
"open": false
31+
},
32+
"dependsOn": [
33+
{
34+
"target": "build",
35+
"dependencies": true
36+
}
37+
]
38+
},
1439
"serve": {
1540
"executor": "nx:run-commands",
1641
"options": {
@@ -23,10 +48,11 @@
2348
}
2449
]
2550
},
26-
"dev": {
27-
"executor": "nx:run-commands",
51+
"build-watch": {
52+
"executor": "../../tools/rslib-plugin:dev",
2853
"options": {
29-
"commands": ["npm run dev --prefix apps/rslib-module"]
54+
"configFile": "rslib.config.ts",
55+
"mode": "watch"
3056
},
3157
"dependsOn": [
3258
{
@@ -35,6 +61,22 @@
3561
}
3662
]
3763
},
64+
"test": {
65+
"executor": "../../tools/rslib-plugin:build",
66+
"options": {
67+
"configFile": "rslib.config.ts",
68+
"mode": "development",
69+
"verbose": true
70+
}
71+
},
72+
"test:watch": {
73+
"executor": "../../tools/rslib-plugin:build",
74+
"options": {
75+
"configFile": "rslib.config.ts",
76+
"mode": "development",
77+
"watch": true
78+
}
79+
},
3880
"storybook": {
3981
"executor": "nx:run-commands",
4082
"options": {

nx.json

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
"cache": true
88
},
99
"lint": {
10-
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
10+
"inputs": [
11+
"default",
12+
"{workspaceRoot}/.eslintrc.json",
13+
"{workspaceRoot}/.eslintignore",
14+
"{workspaceRoot}/eslint.config.js"
15+
],
1116
"cache": true
1217
},
1318
"test": {
@@ -63,17 +68,15 @@
6368
"default": ["{projectRoot}/**/*", "sharedGlobals"],
6469
"production": [
6570
"default",
66-
"!{projectRoot}/.eslintrc.json",
6771
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
6872
"!{projectRoot}/tsconfig.spec.json",
6973
"!{projectRoot}/jest.config.[jt]s",
70-
"!{projectRoot}/vitest.config.[jt]s",
71-
"!{projectRoot}/.storybook/**/*",
72-
"!{projectRoot}/**/*.stories.@(js|jsx|ts|tsx|mdx)",
7374
"!{projectRoot}/src/test-setup.[jt]s",
74-
"!{projectRoot}/tsconfig.storybook.json"
75+
"!{projectRoot}/test-setup.[jt]s",
76+
"!{projectRoot}/.eslintrc.json",
77+
"!{projectRoot}/eslint.config.js"
7578
],
76-
"sharedGlobals": ["{workspaceRoot}/babel.config.json"]
79+
"sharedGlobals": []
7780
},
7881
"workspaceLayout": {
7982
"appsDir": "apps",
@@ -115,5 +118,8 @@
115118
},
116119
"useInferencePlugins": false,
117120
"defaultBase": "main",
118-
"nxCloudAccessToken": "NTVlZTRhOWItMGRjYy00YmJjLTllNzAtNDFkNzRhNzdjZDkwfHJlYWQtd3JpdGU="
121+
"nxCloudAccessToken": "NTVlZTRhOWItMGRjYy00YmJjLTllNzAtNDFkNzRhNzdjZDkwfHJlYWQtd3JpdGU=",
122+
"cli": {
123+
"tui": false
124+
}
119125
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
129129
"@rollup/plugin-alias": "5.1.1",
130130
"@rollup/plugin-replace": "6.0.1",
131+
"@rslib/core": "^0.10.4",
131132
"@rspack/core": "1.3.9",
132133
"@rspack/dev-server": "1.1.1",
133134
"@semantic-release/changelog": "^6.0.3",

packages/bridge/vue3-bridge/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@
3737
"src/remoteApp.tsx",
3838
"src/create.ts"
3939
],
40+
"exclude": ["../../runtime-core/dist/**/*"],
4041
"references": [{ "path": "./tsconfig.node.json" }]
4142
}

packages/chrome-devtools/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"compilerOptions": {
44
"types": ["chrome"]
55
},
6-
"include": ["src", "shared", "modern.config.ts"]
6+
"include": ["src", "shared", "modern.config.ts"],
7+
"exclude": ["../runtime-core/dist/**/*"]
78
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"extends": "./tsconfig.base.json",
3-
"include": ["src", "stories"]
3+
"include": ["src", "stories"],
4+
"exclude": ["../runtime-core/dist/**/*"]
45
}

packages/enhanced/tsconfig.lib.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
"src/**/*.spec.ts",
1212
"src/**/*.test.ts",
1313
"dist/**",
14-
"node_modules/**"
14+
"node_modules/**",
15+
"../runtime-core/src/**",
16+
"../runtime-core/global.d.ts"
1517
]
1618
}

packages/error-codes/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
}
6969
},
7070
"echo": {
71-
"executor": "rslib:echo",
71+
"executor": "../../tools/rslib-plugin:echo",
7272
"options": {
7373
"textToEcho": "Hello World"
7474
}

packages/runtime-core/global.d.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)