create-skybridge 0.0.0-dev.98d6e94 → 0.0.0-dev.a4ea8e7
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 +11 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8,13 +8,12 @@ const argv = mri(process.argv.slice(2), {
|
|
|
8
8
|
alias: { h: "help" },
|
|
9
9
|
});
|
|
10
10
|
const cwd = process.cwd();
|
|
11
|
-
const TEMPLATE_REPO = "https://github.com/alpic-ai/apps-sdk-template";
|
|
12
11
|
const defaultProjectName = "skybridge-project";
|
|
13
12
|
// prettier-ignore
|
|
14
13
|
const helpMessage = `\
|
|
15
14
|
Usage: create-skybridge [OPTION]... [DIRECTORY]
|
|
16
15
|
|
|
17
|
-
Create a new Skybridge project by
|
|
16
|
+
Create a new Skybridge project by copying the starter template.
|
|
18
17
|
|
|
19
18
|
Options:
|
|
20
19
|
-h, --help show this help message
|
|
@@ -111,23 +110,23 @@ async function init() {
|
|
|
111
110
|
}
|
|
112
111
|
}
|
|
113
112
|
const root = path.join(cwd, targetDir);
|
|
114
|
-
// 3.
|
|
115
|
-
prompts.log.step(`
|
|
113
|
+
// 3. Copy the repository
|
|
114
|
+
prompts.log.step(`Copying template...`);
|
|
116
115
|
try {
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
const templateDir = new URL("../template", import.meta.url).pathname;
|
|
117
|
+
// Copy directly to target directory
|
|
118
|
+
run(["cp", "-r", `${templateDir}/.`, root], {
|
|
119
|
+
stdio: "inherit",
|
|
120
|
+
});
|
|
121
|
+
// Set up .gitignore
|
|
122
|
+
run(["mv", path.join(root, "_gitignore"), path.join(root, ".gitignore")], {
|
|
119
123
|
stdio: "inherit",
|
|
120
124
|
});
|
|
121
|
-
// Remove .git directory to start fresh
|
|
122
|
-
const gitDir = path.join(root, ".git");
|
|
123
|
-
if (fs.existsSync(gitDir)) {
|
|
124
|
-
fs.rmSync(gitDir, { recursive: true, force: true });
|
|
125
|
-
}
|
|
126
125
|
prompts.log.success(`Project created in ${root}`);
|
|
127
126
|
prompts.outro(`Done! Next steps:\n\n cd ${targetDir}\n pnpm install\n pnpm dev`);
|
|
128
127
|
}
|
|
129
128
|
catch (error) {
|
|
130
|
-
prompts.log.error("Failed to
|
|
129
|
+
prompts.log.error("Failed to copy repository");
|
|
131
130
|
console.error(error);
|
|
132
131
|
process.exit(1);
|
|
133
132
|
}
|