create-rsbuild 0.0.8 → 0.0.10

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/CHANGELOG.md ADDED
@@ -0,0 +1,14 @@
1
+ # create-rsbuild
2
+
3
+ ## 0.0.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 3d261af: fix(create-rsbuild): failed to publish tsconfig of templates
8
+
9
+ ## 0.0.9
10
+
11
+ ### Patch Changes
12
+
13
+ - 0fbab50: fix(create-rsbuild): failed to resolve the templates
14
+ - e6be3a5: fix(create-rspack): skip local files for debugging
package/dist/index.js CHANGED
@@ -39,6 +39,7 @@ async function main() {
39
39
  console.log("");
40
40
  import_rslog.logger.greet("◆ Create Rsbuild Project");
41
41
  const cwd = process.cwd();
42
+ const packageRoot = import_path.default.resolve(__dirname, "..");
42
43
  let targetDir = await (0, import_prompts.text)({
43
44
  message: "Input target folder",
44
45
  placeholder: "my-project",
@@ -70,12 +71,12 @@ async function main() {
70
71
  ]
71
72
  });
72
73
  checkCancel(language);
73
- const srcFolder = import_path.default.join(cwd, `template-${framework}-${language}`);
74
- const commonFolder = import_path.default.join(cwd, `template-common`);
74
+ const srcFolder = import_path.default.join(packageRoot, `template-${framework}-${language}`);
75
+ const commonFolder = import_path.default.join(packageRoot, `template-common`);
75
76
  const distFolder = import_path.default.join(cwd, targetDir);
76
77
  copyFolder(commonFolder, distFolder);
77
78
  copyFolder(srcFolder, distFolder);
78
- const nextSteps = [`cd ${targetDir}`, "npm i", "npm dev"];
79
+ const nextSteps = [`cd ${targetDir}`, "npm i", "npm run dev"];
79
80
  (0, import_prompts.note)(nextSteps.join("\n"), "Next steps");
80
81
  (0, import_prompts.outro)("Done.");
81
82
  }
@@ -83,8 +84,12 @@ function copyFolder(src, dist) {
83
84
  const renameFiles = {
84
85
  gitignore: ".gitignore"
85
86
  };
87
+ const skipFiles = ["node_modules", "dist"];
86
88
  import_fs.default.mkdirSync(dist, { recursive: true });
87
89
  for (const file of import_fs.default.readdirSync(src)) {
90
+ if (skipFiles.includes(file)) {
91
+ continue;
92
+ }
88
93
  const srcFile = import_path.default.resolve(src, file);
89
94
  const distFile = renameFiles[file] ? import_path.default.resolve(dist, renameFiles[file]) : import_path.default.resolve(dist, file);
90
95
  const stat = import_fs.default.statSync(srcFile);
@@ -0,0 +1,3 @@
1
+ import baseConfig from '../../scripts/modern.base.config';
2
+
3
+ export default baseConfig;
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "directory": "packages/create-rsbuild"
9
9
  },
10
10
  "license": "MIT",
11
- "version": "0.0.8",
11
+ "version": "0.0.10",
12
12
  "types": "./dist/index.d.ts",
13
13
  "main": "./dist/index.js",
14
14
  "bin": {
@@ -35,6 +35,7 @@
35
35
  },
36
36
  "scripts": {
37
37
  "dev": "modern build --watch",
38
- "build": "modern build"
38
+ "build": "modern build",
39
+ "start": "node ./dist/index.js"
39
40
  }
40
41
  }
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "lib": ["DOM", "ES2020"],
5
+ "module": "ESNext",
6
+ "jsx": "react-jsx",
7
+ "strict": true,
8
+ "skipLibCheck": true,
9
+ "isolatedModules": true,
10
+ "resolveJsonModule": true,
11
+ "moduleResolution": "bundler"
12
+ },
13
+ "include": ["src"]
14
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "lib": ["DOM", "ES2020"],
5
+ "module": "ESNext",
6
+ "strict": true,
7
+ "skipLibCheck": true,
8
+ "isolatedModules": true,
9
+ "resolveJsonModule": true,
10
+ "moduleResolution": "bundler"
11
+ },
12
+ "include": ["src"]
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "lib": ["DOM", "ES2020"],
5
+ "module": "ESNext",
6
+ "strict": true,
7
+ "skipLibCheck": true,
8
+ "isolatedModules": true,
9
+ "resolveJsonModule": true,
10
+ "moduleResolution": "bundler"
11
+ },
12
+ "include": ["src"]
13
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "@rsbuild/tsconfig/base",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "baseUrl": "./"
6
+ },
7
+ "include": ["src"]
8
+ }