create-rsbuild 0.7.6 → 0.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +21 -16
- package/package.json +1 -1
- package/template-biome/{extra-package.json → package.json} +4 -1
- package/template-eslint/common-js/package.json +13 -0
- package/template-eslint/{react-ts/extra-package.json → common-ts/package.json} +5 -4
- package/template-eslint/react-js/eslint.config.mjs +20 -2
- package/template-eslint/react-js/package.json +16 -0
- package/template-eslint/react-ts/eslint.config.mjs +20 -2
- package/template-eslint/react-ts/package.json +17 -0
- package/template-eslint/svelte-js/{extra-package.json → package.json} +5 -2
- package/template-eslint/svelte-ts/package.json +16 -0
- package/template-eslint/vue-js/{extra-package.json → package.json} +5 -2
- package/template-eslint/vue-ts/{extra-package.json → package.json} +5 -2
- package/template-lit-js/package.json +1 -1
- package/template-lit-ts/package.json +1 -1
- package/template-prettier/package.json +11 -0
- package/template-svelte-js/package.json +1 -1
- package/template-svelte-ts/package.json +1 -1
- package/template-eslint/common-js/extra-package.json +0 -10
- package/template-eslint/common-ts/extra-package.json +0 -11
- package/template-eslint/react-js/extra-package.json +0 -12
- package/template-eslint/svelte-ts/extra-package.json +0 -13
- package/template-prettier/extra-package.json +0 -8
package/dist/index.js
CHANGED
|
@@ -38,12 +38,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
38
38
|
mod
|
|
39
39
|
));
|
|
40
40
|
|
|
41
|
-
// ../../node_modules/.pnpm/@modern-js+module-tools@2.52.0_eslint@9.
|
|
41
|
+
// ../../node_modules/.pnpm/@modern-js+module-tools@2.52.0_eslint@9.5.0_typescript@5.4.5/node_modules/@modern-js/module-tools/shims/esm.js
|
|
42
42
|
import { fileURLToPath } from "url";
|
|
43
43
|
import path from "path";
|
|
44
44
|
var getFilename, getDirname, __dirname;
|
|
45
45
|
var init_esm = __esm({
|
|
46
|
-
"../../node_modules/.pnpm/@modern-js+module-tools@2.52.0_eslint@9.
|
|
46
|
+
"../../node_modules/.pnpm/@modern-js+module-tools@2.52.0_eslint@9.5.0_typescript@5.4.5/node_modules/@modern-js/module-tools/shims/esm.js"() {
|
|
47
47
|
"use strict";
|
|
48
48
|
getFilename = () => fileURLToPath(import.meta.url);
|
|
49
49
|
getDirname = () => path.dirname(getFilename());
|
|
@@ -1270,12 +1270,13 @@ async function main() {
|
|
|
1270
1270
|
);
|
|
1271
1271
|
const tools = checkCancel(
|
|
1272
1272
|
await ae({
|
|
1273
|
-
message: "Select additional tools (
|
|
1273
|
+
message: "Select additional tools (press enter to continue)",
|
|
1274
1274
|
options: [
|
|
1275
1275
|
{ value: "biome", label: "Add Biome for code linting and formatting" },
|
|
1276
1276
|
{ value: "eslint", label: "Add ESLint for code linting" },
|
|
1277
1277
|
{ value: "prettier", label: "Add Prettier for code formatting" }
|
|
1278
|
-
]
|
|
1278
|
+
],
|
|
1279
|
+
required: false
|
|
1279
1280
|
})
|
|
1280
1281
|
);
|
|
1281
1282
|
const srcFolder = path2.join(packageRoot, `template-${framework}-${language}`);
|
|
@@ -1314,17 +1315,19 @@ function mergePackageJson(targetPackage, extraPackage) {
|
|
|
1314
1315
|
if (!fs.existsSync(targetPackage)) {
|
|
1315
1316
|
return;
|
|
1316
1317
|
}
|
|
1317
|
-
const
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1318
|
+
const targetJson = JSON.parse(fs.readFileSync(targetPackage, "utf-8"));
|
|
1319
|
+
const extraJson = JSON.parse(fs.readFileSync(extraPackage, "utf-8"));
|
|
1320
|
+
const mergedJson = (0, import_deepmerge.default)(targetJson, extraJson);
|
|
1321
|
+
mergedJson.name = targetJson.name || extraJson.name;
|
|
1321
1322
|
for (const key of ["scripts", "dependencies", "devDependencies"]) {
|
|
1322
|
-
if (!(key in
|
|
1323
|
+
if (!(key in mergedJson)) {
|
|
1323
1324
|
continue;
|
|
1324
1325
|
}
|
|
1325
|
-
|
|
1326
|
+
mergedJson[key] = sortObjectKeys(
|
|
1327
|
+
mergedJson[key]
|
|
1328
|
+
);
|
|
1326
1329
|
}
|
|
1327
|
-
fs.writeFileSync(targetPackage, `${JSON.stringify(
|
|
1330
|
+
fs.writeFileSync(targetPackage, `${JSON.stringify(mergedJson, null, 2)}
|
|
1328
1331
|
`);
|
|
1329
1332
|
}
|
|
1330
1333
|
function copyFolder(src, dist, version, name) {
|
|
@@ -1342,14 +1345,16 @@ function copyFolder(src, dist, version, name) {
|
|
|
1342
1345
|
const stat = fs.statSync(srcFile);
|
|
1343
1346
|
if (stat.isDirectory()) {
|
|
1344
1347
|
copyFolder(srcFile, distFile, version);
|
|
1345
|
-
} else if (file === "
|
|
1348
|
+
} else if (file === "package.json") {
|
|
1346
1349
|
const targetPackage = path2.resolve(dist, "package.json");
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1350
|
+
if (fs.existsSync(targetPackage)) {
|
|
1351
|
+
mergePackageJson(targetPackage, srcFile);
|
|
1352
|
+
} else {
|
|
1353
|
+
fs.copyFileSync(srcFile, distFile);
|
|
1351
1354
|
updatePackageJson(distFile, version, name);
|
|
1352
1355
|
}
|
|
1356
|
+
} else {
|
|
1357
|
+
fs.copyFileSync(srcFile, distFile);
|
|
1353
1358
|
}
|
|
1354
1359
|
}
|
|
1355
1360
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
+
"name": "rsbuild-eslint-common-ts",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
2
5
|
"scripts": {
|
|
3
6
|
"lint": "eslint ."
|
|
4
7
|
},
|
|
5
8
|
"devDependencies": {
|
|
6
|
-
"@eslint/
|
|
7
|
-
"
|
|
8
|
-
"eslint": "9.x",
|
|
9
|
-
"eslint-plugin-react": "^7.34.2",
|
|
9
|
+
"@eslint/js": "^9.5.0",
|
|
10
|
+
"eslint": "^9.5.0",
|
|
10
11
|
"globals": "^15.4.0",
|
|
11
12
|
"typescript-eslint": "^7.12.0"
|
|
12
13
|
}
|
|
@@ -1,11 +1,29 @@
|
|
|
1
|
-
import { fixupConfigRules } from '@eslint/compat';
|
|
1
|
+
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat';
|
|
2
2
|
import js from '@eslint/js';
|
|
3
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
4
|
+
import reactJsx from 'eslint-plugin-react/configs/jsx-runtime.js';
|
|
3
5
|
import react from 'eslint-plugin-react/configs/recommended.js';
|
|
4
6
|
import globals from 'globals';
|
|
5
7
|
|
|
6
8
|
export default [
|
|
7
9
|
{ languageOptions: { globals: globals.browser } },
|
|
8
10
|
js.configs.recommended,
|
|
9
|
-
...fixupConfigRules(
|
|
11
|
+
...fixupConfigRules([
|
|
12
|
+
{
|
|
13
|
+
...react,
|
|
14
|
+
settings: {
|
|
15
|
+
react: { version: 'detect' },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
reactJsx,
|
|
19
|
+
]),
|
|
20
|
+
{
|
|
21
|
+
plugins: {
|
|
22
|
+
'react-hooks': fixupPluginRules(reactHooks),
|
|
23
|
+
},
|
|
24
|
+
rules: {
|
|
25
|
+
...reactHooks.configs.recommended.rules,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
10
28
|
{ ignores: ['dist/'] },
|
|
11
29
|
];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rsbuild-eslint-react-js",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"lint": "eslint ."
|
|
7
|
+
},
|
|
8
|
+
"devDependencies": {
|
|
9
|
+
"@eslint/compat": "^1.1.0",
|
|
10
|
+
"@eslint/js": "^9.5.0",
|
|
11
|
+
"eslint": "^9.5.0",
|
|
12
|
+
"eslint-plugin-react": "^7.34.2",
|
|
13
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
14
|
+
"globals": "^15.4.0"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { fixupConfigRules } from '@eslint/compat';
|
|
1
|
+
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat';
|
|
2
2
|
import js from '@eslint/js';
|
|
3
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
4
|
+
import reactJsx from 'eslint-plugin-react/configs/jsx-runtime.js';
|
|
3
5
|
import react from 'eslint-plugin-react/configs/recommended.js';
|
|
4
6
|
import globals from 'globals';
|
|
5
7
|
import ts from 'typescript-eslint';
|
|
@@ -8,6 +10,22 @@ export default [
|
|
|
8
10
|
{ languageOptions: { globals: globals.browser } },
|
|
9
11
|
js.configs.recommended,
|
|
10
12
|
...ts.configs.recommended,
|
|
11
|
-
...fixupConfigRules(
|
|
13
|
+
...fixupConfigRules([
|
|
14
|
+
{
|
|
15
|
+
...react,
|
|
16
|
+
settings: {
|
|
17
|
+
react: { version: 'detect' },
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
reactJsx,
|
|
21
|
+
]),
|
|
22
|
+
{
|
|
23
|
+
plugins: {
|
|
24
|
+
'react-hooks': fixupPluginRules(reactHooks),
|
|
25
|
+
},
|
|
26
|
+
rules: {
|
|
27
|
+
...reactHooks.configs.recommended.rules,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
12
30
|
{ ignores: ['dist/'] },
|
|
13
31
|
];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rsbuild-eslint-react-ts",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"lint": "eslint ."
|
|
7
|
+
},
|
|
8
|
+
"devDependencies": {
|
|
9
|
+
"@eslint/compat": "^1.1.0",
|
|
10
|
+
"@eslint/js": "^9.5.0",
|
|
11
|
+
"eslint": "^9.5.0",
|
|
12
|
+
"eslint-plugin-react": "^7.34.2",
|
|
13
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
14
|
+
"globals": "^15.4.0",
|
|
15
|
+
"typescript-eslint": "^7.12.0"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
+
"name": "rsbuild-eslint-svelte-js",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
2
5
|
"scripts": {
|
|
3
6
|
"lint": "eslint ."
|
|
4
7
|
},
|
|
5
8
|
"devDependencies": {
|
|
6
|
-
"@eslint/js": "^9.
|
|
7
|
-
"eslint": "9.
|
|
9
|
+
"@eslint/js": "^9.5.0",
|
|
10
|
+
"eslint": "^9.5.0",
|
|
8
11
|
"eslint-plugin-svelte": "^2.36.0",
|
|
9
12
|
"globals": "^15.4.0"
|
|
10
13
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rsbuild-eslint-svelte-ts",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"lint": "eslint ."
|
|
7
|
+
},
|
|
8
|
+
"devDependencies": {
|
|
9
|
+
"@eslint/js": "^9.5.0",
|
|
10
|
+
"eslint": "^9.5.0",
|
|
11
|
+
"eslint-plugin-svelte": "^2.36.0",
|
|
12
|
+
"globals": "^15.4.0",
|
|
13
|
+
"typescript-eslint": "^8.0.0-alpha.30"
|
|
14
|
+
},
|
|
15
|
+
"type": "module"
|
|
16
|
+
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
+
"name": "rsbuild-eslint-vue-js",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
2
5
|
"scripts": {
|
|
3
6
|
"lint": "eslint ."
|
|
4
7
|
},
|
|
5
8
|
"devDependencies": {
|
|
6
|
-
"@eslint/js": "^9.
|
|
7
|
-
"eslint": "9.
|
|
9
|
+
"@eslint/js": "^9.5.0",
|
|
10
|
+
"eslint": "^9.5.0",
|
|
8
11
|
"eslint-plugin-vue": "^9.26.0",
|
|
9
12
|
"globals": "^15.4.0"
|
|
10
13
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
+
"name": "rsbuild-eslint-vue-ts",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
2
5
|
"scripts": {
|
|
3
6
|
"lint": "eslint ."
|
|
4
7
|
},
|
|
5
8
|
"devDependencies": {
|
|
6
|
-
"@eslint/js": "^9.
|
|
7
|
-
"eslint": "9.
|
|
9
|
+
"@eslint/js": "^9.5.0",
|
|
10
|
+
"eslint": "^9.5.0",
|
|
8
11
|
"eslint-plugin-vue": "^9.26.0",
|
|
9
12
|
"globals": "^15.4.0",
|
|
10
13
|
"typescript-eslint": "^7.12.0"
|