create-skybridge 0.0.0-dev.fd7dd56 → 0.0.0-dev.fdbe55f
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
CHANGED
|
@@ -105,8 +105,8 @@ export async function init(args = process.argv.slice(2)) {
|
|
|
105
105
|
emptyDir(targetDir);
|
|
106
106
|
break;
|
|
107
107
|
case "no":
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
prompts.log.error("Target directory is not empty.");
|
|
109
|
+
process.exit(1);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
const root = path.join(process.cwd(), targetDir);
|
|
@@ -153,7 +153,29 @@ export async function init(args = process.argv.slice(2)) {
|
|
|
153
153
|
}
|
|
154
154
|
const userAgent = process.env.npm_config_user_agent;
|
|
155
155
|
const pkgManager = userAgent?.split(" ")[0]?.split("/")[0] || "npm";
|
|
156
|
-
// 4. Ask about
|
|
156
|
+
// 4. Ask about skills installation
|
|
157
|
+
if (interactive) {
|
|
158
|
+
const skillsResult = await prompts.confirm({
|
|
159
|
+
message: "Install the coding agents skills? (recommended)",
|
|
160
|
+
initialValue: true,
|
|
161
|
+
});
|
|
162
|
+
if (prompts.isCancel(skillsResult)) {
|
|
163
|
+
return cancel();
|
|
164
|
+
}
|
|
165
|
+
if (skillsResult) {
|
|
166
|
+
run([
|
|
167
|
+
...getPkgExecCmd(pkgManager, "skills"),
|
|
168
|
+
"add",
|
|
169
|
+
"alpic-ai/skybridge",
|
|
170
|
+
"-s",
|
|
171
|
+
"chatgpt-app-builder",
|
|
172
|
+
], {
|
|
173
|
+
stdio: "inherit",
|
|
174
|
+
cwd: targetDir,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
// 5. Ask about immediate installation
|
|
157
179
|
let immediate = argImmediate;
|
|
158
180
|
if (immediate === undefined) {
|
|
159
181
|
if (interactive) {
|
|
@@ -225,18 +247,37 @@ function sanitizeTargetDir(targetDir) {
|
|
|
225
247
|
// Remove leading/trailing slashes
|
|
226
248
|
.replace(/^\/+|\/+$/g, ""));
|
|
227
249
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
return
|
|
250
|
+
// Skip user's SPEC.md and IDE/agent preferences (.idea, .claude, etc.)
|
|
251
|
+
function isSkippedEntry(entry) {
|
|
252
|
+
return ((entry.name.startsWith(".") && entry.isDirectory()) ||
|
|
253
|
+
entry.name === "SPEC.md");
|
|
254
|
+
}
|
|
255
|
+
function isEmpty(dirPath) {
|
|
256
|
+
const entries = fs.readdirSync(dirPath, { withFileTypes: true });
|
|
257
|
+
return entries.every(isSkippedEntry);
|
|
231
258
|
}
|
|
232
259
|
function emptyDir(dir) {
|
|
233
260
|
if (!fs.existsSync(dir)) {
|
|
234
261
|
return;
|
|
235
262
|
}
|
|
236
|
-
for (const
|
|
237
|
-
if (
|
|
263
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
264
|
+
if (isSkippedEntry(entry)) {
|
|
238
265
|
continue;
|
|
239
266
|
}
|
|
240
|
-
fs.rmSync(path.
|
|
267
|
+
fs.rmSync(path.join(dir, entry.name), { recursive: true, force: true });
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
function getPkgExecCmd(pkgManager, cmd) {
|
|
271
|
+
switch (pkgManager) {
|
|
272
|
+
case "yarn":
|
|
273
|
+
return ["yarn", "dlx", cmd];
|
|
274
|
+
case "pnpm":
|
|
275
|
+
return ["pnpm", "dlx", cmd];
|
|
276
|
+
case "bun":
|
|
277
|
+
return ["bunx", cmd];
|
|
278
|
+
case "deno":
|
|
279
|
+
return ["deno", "run", "-A", `npm:${cmd}`];
|
|
280
|
+
default:
|
|
281
|
+
return ["npx", cmd];
|
|
241
282
|
}
|
|
242
283
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Before writing code, first explore the project structure, then invoke the chatgpt-app-builder skill for documentation.
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.29.1_@modelcontextprotocol+sdk@1.25.2_hono@4.11.3_zod@4.3.5__@types+node@25_c63f9c05f537b629dd808079c96120bf/node_modules/skybridge/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.29.1_@modelcontextprotocol+sdk@1.25.2_hono@4.11.3_zod@4.3.5__@types+node@25_c63f9c05f537b629dd808079c96120bf/node_modules/skybridge/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.29.1_@modelcontextprotocol+sdk@1.25.2_hono@4.11.3_zod@4.3.5__@types+node@25_c63f9c05f537b629dd808079c96120bf/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.29.1_@modelcontextprotocol+sdk@1.25.2_hono@4.11.3_zod@4.3.5__@types+node@25_c63f9c05f537b629dd808079c96120bf/node_modules/skybridge/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.29.1_@modelcontextprotocol+sdk@1.25.2_hono@4.11.3_zod@4.3.5__@types+node@25_c63f9c05f537b629dd808079c96120bf/node_modules/skybridge/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.29.1_@modelcontextprotocol+sdk@1.25.2_hono@4.11.3_zod@4.3.5__@types+node@25_c63f9c05f537b629dd808079c96120bf/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../skybridge/bin/run.js" "$@"
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.29.1_@modelcontextprotocol+sdk@1.25.2_hono@4.11.3_zod@4.3.5__@types+node@25_c63f9c05f537b629dd808079c96120bf/node_modules/skybridge/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.29.1_@modelcontextprotocol+sdk@1.25.2_hono@4.11.3_zod@4.3.5__@types+node@25_c63f9c05f537b629dd808079c96120bf/node_modules/skybridge/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.29.1_@modelcontextprotocol+sdk@1.25.2_hono@4.11.3_zod@4.3.5__@types+node@25_c63f9c05f537b629dd808079c96120bf/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.29.1_@modelcontextprotocol+sdk@1.25.2_hono@4.11.3_zod@4.3.5__@types+node@25_c63f9c05f537b629dd808079c96120bf/node_modules/skybridge/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.29.1_@modelcontextprotocol+sdk@1.25.2_hono@4.11.3_zod@4.3.5__@types+node@25_c63f9c05f537b629dd808079c96120bf/node_modules/skybridge/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.29.1_@modelcontextprotocol+sdk@1.25.2_hono@4.11.3_zod@4.3.5__@types+node@25_c63f9c05f537b629dd808079c96120bf/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../skybridge/bin/run.js" "$@"
|