create-rsbuild 0.0.8 → 0.0.9
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 +7 -2
- package/package.json +4 -4
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,8 +71,8 @@ async function main() {
|
|
|
70
71
|
]
|
|
71
72
|
});
|
|
72
73
|
checkCancel(language);
|
|
73
|
-
const srcFolder = import_path.default.join(
|
|
74
|
-
const commonFolder = import_path.default.join(
|
|
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);
|
|
@@ -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);
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"directory": "packages/create-rsbuild"
|
|
9
9
|
},
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"version": "0.0.
|
|
11
|
+
"version": "0.0.9",
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"main": "./dist/index.js",
|
|
14
14
|
"bin": {
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"registry": "https://registry.npmjs.org/",
|
|
33
|
-
"access": "public"
|
|
34
|
-
"provenance": true
|
|
33
|
+
"access": "public"
|
|
35
34
|
},
|
|
36
35
|
"scripts": {
|
|
37
36
|
"dev": "modern build --watch",
|
|
38
|
-
"build": "modern build"
|
|
37
|
+
"build": "modern build",
|
|
38
|
+
"start": "node ./dist/index.js"
|
|
39
39
|
}
|
|
40
40
|
}
|