create-skybridge 0.0.0-dev.4998c4f → 0.0.0-dev.4afbe8a
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 +6 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -23,12 +23,6 @@ Examples:
|
|
|
23
23
|
create-skybridge my-app
|
|
24
24
|
create-skybridge . --overwrite
|
|
25
25
|
`;
|
|
26
|
-
function updatePackageJsonName(root, name) {
|
|
27
|
-
const pkgPath = path.join(root, "package.json");
|
|
28
|
-
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
29
|
-
pkg.name = name;
|
|
30
|
-
fs.writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`);
|
|
31
|
-
}
|
|
32
26
|
async function init() {
|
|
33
27
|
const argTargetDir = argv._[0]
|
|
34
28
|
? formatTargetDir(String(argv._[0]))
|
|
@@ -112,9 +106,12 @@ async function init() {
|
|
|
112
106
|
fs.renameSync(path.join(root, "_gitignore"), path.join(root, ".gitignore"));
|
|
113
107
|
// Update project name in package.json
|
|
114
108
|
const name = path.basename(root);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
109
|
+
for (const dir of ["", "server", "web"]) {
|
|
110
|
+
const pkgPath = path.join(root, dir, "package.json");
|
|
111
|
+
const pkg = fs.readFileSync(pkgPath, "utf-8");
|
|
112
|
+
const fixed = pkg.replace(/apps-sdk-template/g, name);
|
|
113
|
+
fs.writeFileSync(pkgPath, fixed);
|
|
114
|
+
}
|
|
118
115
|
prompts.log.success(`Project created in ${root}`);
|
|
119
116
|
prompts.outro(`Done! Next steps:\n\n cd ${targetDir}\n pnpm install\n pnpm dev`);
|
|
120
117
|
}
|