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 CHANGED
@@ -1314,17 +1314,19 @@ function mergePackageJson(targetPackage, extraPackage) {
1314
1314
  if (!fs.existsSync(targetPackage)) {
1315
1315
  return;
1316
1316
  }
1317
- const content = (0, import_deepmerge.default)(
1318
- JSON.parse(fs.readFileSync(targetPackage, "utf-8")),
1319
- JSON.parse(fs.readFileSync(extraPackage, "utf-8"))
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 content)) {
1322
+ if (!(key in mergedJson)) {
1323
1323
  continue;
1324
1324
  }
1325
- content[key] = sortObjectKeys(content[key]);
1325
+ mergedJson[key] = sortObjectKeys(
1326
+ mergedJson[key]
1327
+ );
1326
1328
  }
1327
- fs.writeFileSync(targetPackage, `${JSON.stringify(content, null, 2)}
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 === "extra-package.json") {
1347
+ } else if (file === "package.json") {
1346
1348
  const targetPackage = path2.resolve(dist, "package.json");
1347
- mergePackageJson(targetPackage, srcFile);
1348
- } else {
1349
- fs.copyFileSync(srcFile, distFile);
1350
- if (file === "package.json") {
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,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rsbuild",
3
- "version": "0.7.5",
3
+ "version": "0.7.7",
4
4
  "description": "Create a new Rsbuild project",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "repository": {
@@ -1,4 +1,7 @@
1
1
  {
2
+ "name": "rsbuild-biome",
3
+ "private": true,
4
+ "version": "1.0.0",
2
5
  "scripts": {
3
6
  "check": "biome check --write",
4
7
  "format": "biome format --write"
@@ -1,4 +1,7 @@
1
1
  {
2
+ "name": "rsbuild-eslint-common-js",
3
+ "private": true,
4
+ "version": "1.0.0",
2
5
  "scripts": {
3
6
  "lint": "eslint ."
4
7
  },
@@ -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(react),
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(react),
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
+ }
@@ -1,4 +1,7 @@
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
  },
@@ -1,4 +1,7 @@
1
1
  {
2
+ "name": "rsbuild-eslint-svelte-ts",
3
+ "private": true,
4
+ "version": "1.0.0",
2
5
  "scripts": {
3
6
  "lint": "eslint ."
4
7
  },
@@ -1,4 +1,7 @@
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
  },
@@ -1,4 +1,7 @@
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
  },
@@ -9,6 +9,6 @@
9
9
  },
10
10
  "devDependencies": {
11
11
  "@rsbuild/core": "workspace:*",
12
- "lit": "^3.1.3"
12
+ "lit": "^3.1.4"
13
13
  }
14
14
  }
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "devDependencies": {
11
11
  "@rsbuild/core": "workspace:*",
12
- "lit": "^3.1.3",
12
+ "lit": "^3.1.4",
13
13
  "typescript": "^5.4.2"
14
14
  }
15
15
  }
@@ -1,4 +1,7 @@
1
1
  {
2
+ "name": "rsbuild-prettier",
3
+ "private": true,
4
+ "version": "1.0.0",
2
5
  "scripts": {
3
6
  "format": "prettier --write ."
4
7
  },
@@ -8,7 +8,7 @@
8
8
  "preview": "rsbuild preview"
9
9
  },
10
10
  "dependencies": {
11
- "svelte": "^4.2.17"
11
+ "svelte": "^4.2.18"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@rsbuild/core": "workspace:*",
@@ -9,7 +9,7 @@
9
9
  "svelte-check": "svelte-check --tsconfig ./tsconfig.json"
10
10
  },
11
11
  "dependencies": {
12
- "svelte": "^4.2.17"
12
+ "svelte": "^4.2.18"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@rsbuild/core": "workspace:*",
@@ -1,11 +0,0 @@
1
- {
2
- "scripts": {
3
- "lint": "eslint ."
4
- },
5
- "devDependencies": {
6
- "@eslint/js": "^9.4.0",
7
- "eslint": "9.x",
8
- "globals": "^15.4.0",
9
- "typescript-eslint": "^7.12.0"
10
- }
11
- }