create-rsbuild 0.7.5 → 0.7.7
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 +16 -12
- package/package.json +1 -1
- package/template-biome/{extra-package.json → package.json} +3 -0
- package/template-eslint/common-js/{extra-package.json → package.json} +3 -0
- package/template-eslint/{react-ts/extra-package.json → common-ts/package.json} +3 -2
- package/template-eslint/react-js/eslint.config.mjs +20 -2
- package/template-eslint/react-js/{extra-package.json → package.json} +4 -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} +3 -0
- package/template-eslint/svelte-ts/{extra-package.json → package.json} +3 -0
- package/template-eslint/vue-js/{extra-package.json → package.json} +3 -0
- package/template-eslint/vue-ts/{extra-package.json → package.json} +3 -0
- package/template-lit-js/package.json +1 -1
- package/template-lit-ts/package.json +1 -1
- package/template-prettier/{extra-package.json → package.json} +3 -0
- package/template-svelte-js/package.json +1 -1
- package/template-svelte-ts/package.json +1 -1
- package/template-eslint/common-ts/extra-package.json +0 -11
package/dist/index.js
CHANGED
|
@@ -1314,17 +1314,19 @@ function mergePackageJson(targetPackage, extraPackage) {
|
|
|
1314
1314
|
if (!fs.existsSync(targetPackage)) {
|
|
1315
1315
|
return;
|
|
1316
1316
|
}
|
|
1317
|
-
const
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1317
|
+
const targetJson = JSON.parse(fs.readFileSync(targetPackage, "utf-8"));
|
|
1318
|
+
const extraJson = JSON.parse(fs.readFileSync(extraPackage, "utf-8"));
|
|
1319
|
+
const mergedJson = (0, import_deepmerge.default)(targetJson, extraJson);
|
|
1320
|
+
mergedJson.name = targetJson.name || extraJson.name;
|
|
1321
1321
|
for (const key of ["scripts", "dependencies", "devDependencies"]) {
|
|
1322
|
-
if (!(key in
|
|
1322
|
+
if (!(key in mergedJson)) {
|
|
1323
1323
|
continue;
|
|
1324
1324
|
}
|
|
1325
|
-
|
|
1325
|
+
mergedJson[key] = sortObjectKeys(
|
|
1326
|
+
mergedJson[key]
|
|
1327
|
+
);
|
|
1326
1328
|
}
|
|
1327
|
-
fs.writeFileSync(targetPackage, `${JSON.stringify(
|
|
1329
|
+
fs.writeFileSync(targetPackage, `${JSON.stringify(mergedJson, null, 2)}
|
|
1328
1330
|
`);
|
|
1329
1331
|
}
|
|
1330
1332
|
function copyFolder(src, dist, version, name) {
|
|
@@ -1342,14 +1344,16 @@ function copyFolder(src, dist, version, name) {
|
|
|
1342
1344
|
const stat = fs.statSync(srcFile);
|
|
1343
1345
|
if (stat.isDirectory()) {
|
|
1344
1346
|
copyFolder(srcFile, distFile, version);
|
|
1345
|
-
} else if (file === "
|
|
1347
|
+
} else if (file === "package.json") {
|
|
1346
1348
|
const targetPackage = path2.resolve(dist, "package.json");
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1349
|
+
if (fs.existsSync(targetPackage)) {
|
|
1350
|
+
mergePackageJson(targetPackage, srcFile);
|
|
1351
|
+
} else {
|
|
1352
|
+
fs.copyFileSync(srcFile, distFile);
|
|
1351
1353
|
updatePackageJson(distFile, version, name);
|
|
1352
1354
|
}
|
|
1355
|
+
} else {
|
|
1356
|
+
fs.copyFileSync(srcFile, distFile);
|
|
1353
1357
|
}
|
|
1354
1358
|
}
|
|
1355
1359
|
}
|
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/compat": "^1.0.3",
|
|
7
9
|
"@eslint/js": "^9.4.0",
|
|
8
10
|
"eslint": "9.x",
|
|
9
|
-
"eslint-plugin-react": "^7.34.2",
|
|
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
|
];
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
+
"name": "rsbuild-eslint-react-js",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
2
5
|
"scripts": {
|
|
3
6
|
"lint": "eslint ."
|
|
4
7
|
},
|
|
@@ -7,6 +10,7 @@
|
|
|
7
10
|
"@eslint/js": "^9.4.0",
|
|
8
11
|
"eslint": "9.x",
|
|
9
12
|
"eslint-plugin-react": "^7.34.2",
|
|
13
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
10
14
|
"globals": "^15.4.0"
|
|
11
15
|
}
|
|
12
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.0.3",
|
|
10
|
+
"@eslint/js": "^9.4.0",
|
|
11
|
+
"eslint": "9.x",
|
|
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
|
+
}
|