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.
Files changed (2) hide show
  1. package/dist/index.js +6 -9
  2. 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
- updatePackageJsonName(root, name);
116
- updatePackageJsonName(path.join(root, "server"), `@${name}/server`);
117
- updatePackageJsonName(path.join(root, "web"), `@${name}/web`);
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-skybridge",
3
- "version": "0.0.0-dev.4998c4f",
3
+ "version": "0.0.0-dev.4afbe8a",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Alpic",