vibespot 0.4.4 → 0.4.5
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 +33 -22
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1305,7 +1305,8 @@ var ClaudeCodeEngine = class {
|
|
|
1305
1305
|
const child = spawn("claude", args, {
|
|
1306
1306
|
cwd: themePath,
|
|
1307
1307
|
stdio: ["pipe", "pipe", "pipe"],
|
|
1308
|
-
env
|
|
1308
|
+
env,
|
|
1309
|
+
shell: true
|
|
1309
1310
|
});
|
|
1310
1311
|
child.stdout.on("data", (d) => {
|
|
1311
1312
|
stdout += d.toString();
|
|
@@ -1642,7 +1643,7 @@ ${guide}`;
|
|
|
1642
1643
|
|
|
1643
1644
|
// src/ai/claude-api.ts
|
|
1644
1645
|
import Anthropic from "@anthropic-ai/sdk";
|
|
1645
|
-
import { join as join7 } from "path";
|
|
1646
|
+
import { join as join7, basename as basename3 } from "path";
|
|
1646
1647
|
import { readdirSync as readdirSync5 } from "fs";
|
|
1647
1648
|
var ClaudeAPIEngine = class {
|
|
1648
1649
|
client;
|
|
@@ -1655,7 +1656,7 @@ var ClaudeAPIEngine = class {
|
|
|
1655
1656
|
async convert(opts) {
|
|
1656
1657
|
const { sourceDir, themePath, conversionGuide, onProgress } = opts;
|
|
1657
1658
|
const systemPrompt = buildSystemPrompt(conversionGuide);
|
|
1658
|
-
const dirName = sourceDir
|
|
1659
|
+
const dirName = basename3(sourceDir) || "page";
|
|
1659
1660
|
const pagePrefix = dirName.toLowerCase().replace(/[^a-z0-9]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "").slice(0, 15);
|
|
1660
1661
|
onProgress("css", "Analyzing design system...");
|
|
1661
1662
|
const indexCss = this.findAndReadCSS(sourceDir);
|
|
@@ -1835,7 +1836,8 @@ var GeminiCLIEngine = class {
|
|
|
1835
1836
|
const child = spawn2("gemini", ["-p", prompt], {
|
|
1836
1837
|
cwd: themePath,
|
|
1837
1838
|
stdio: ["pipe", "pipe", "pipe"],
|
|
1838
|
-
env: { ...process.env }
|
|
1839
|
+
env: { ...process.env },
|
|
1840
|
+
shell: true
|
|
1839
1841
|
});
|
|
1840
1842
|
let stdout = "";
|
|
1841
1843
|
let stderr = "";
|
|
@@ -1962,7 +1964,8 @@ var CodexCLIEngine = class {
|
|
|
1962
1964
|
const child = spawn3("codex", ["exec", "--full-auto", prompt], {
|
|
1963
1965
|
cwd: themePath,
|
|
1964
1966
|
stdio: ["pipe", "pipe", "pipe"],
|
|
1965
|
-
env: { ...process.env }
|
|
1967
|
+
env: { ...process.env },
|
|
1968
|
+
shell: true
|
|
1966
1969
|
});
|
|
1967
1970
|
let stdout = "";
|
|
1968
1971
|
let stderr = "";
|
|
@@ -2417,7 +2420,7 @@ function validateModuleMeta(themePath) {
|
|
|
2417
2420
|
}
|
|
2418
2421
|
|
|
2419
2422
|
// src/wizard/uploader.ts
|
|
2420
|
-
import { join as join12 } from "path";
|
|
2423
|
+
import { join as join12, basename as basename4 } from "path";
|
|
2421
2424
|
|
|
2422
2425
|
// src/server/auto-fix.ts
|
|
2423
2426
|
import { join as join11 } from "path";
|
|
@@ -2741,7 +2744,7 @@ function countUploadedFiles(output) {
|
|
|
2741
2744
|
}
|
|
2742
2745
|
async function runUpload(themePath) {
|
|
2743
2746
|
await intro2("Uploading to HubSpot");
|
|
2744
|
-
const themeName = themePath
|
|
2747
|
+
const themeName = basename4(themePath) || themePath;
|
|
2745
2748
|
const s = await spinner2();
|
|
2746
2749
|
const MAX_RETRIES = 3;
|
|
2747
2750
|
for (let attempt = 1; attempt <= MAX_RETRIES; attempt++) {
|
|
@@ -2831,7 +2834,7 @@ The theme may work \u2014 check HubSpot Design Manager.`
|
|
|
2831
2834
|
// src/wizard/next-steps.ts
|
|
2832
2835
|
import { execSync as execSync2 } from "child_process";
|
|
2833
2836
|
import { rmSync as rmSync3 } from "fs";
|
|
2834
|
-
import { basename as
|
|
2837
|
+
import { basename as basename5 } from "path";
|
|
2835
2838
|
async function showNextSteps(opts) {
|
|
2836
2839
|
const { portalId, sourceDir, themePath, wasCloned } = opts;
|
|
2837
2840
|
await intro2("You're all set!");
|
|
@@ -2874,10 +2877,10 @@ Next steps:
|
|
|
2874
2877
|
}
|
|
2875
2878
|
const dirsToClean = [];
|
|
2876
2879
|
if (wasCloned && fileExists(sourceDir)) {
|
|
2877
|
-
dirsToClean.push({ path: sourceDir, label: `Cloned source (${
|
|
2880
|
+
dirsToClean.push({ path: sourceDir, label: `Cloned source (${basename5(sourceDir)})` });
|
|
2878
2881
|
}
|
|
2879
2882
|
if (fileExists(themePath)) {
|
|
2880
|
-
dirsToClean.push({ path: themePath, label: `Theme directory (${
|
|
2883
|
+
dirsToClean.push({ path: themePath, label: `Theme directory (${basename5(themePath)})` });
|
|
2881
2884
|
}
|
|
2882
2885
|
if (dirsToClean.length > 0) {
|
|
2883
2886
|
const cleanup = await confirm2({
|
|
@@ -3087,7 +3090,7 @@ import chalk2 from "chalk";
|
|
|
3087
3090
|
// src/server/server.ts
|
|
3088
3091
|
import { createServer } from "http";
|
|
3089
3092
|
import { readFileSync as readFileSync5, existsSync as existsSync5, readdirSync as readdirSync11, appendFileSync, rmSync as rmSync5, renameSync as renameSync2 } from "fs";
|
|
3090
|
-
import { join as join15, extname as extname2, basename as
|
|
3093
|
+
import { join as join15, extname as extname2, basename as basename7 } from "path";
|
|
3091
3094
|
import { homedir as homedir4 } from "os";
|
|
3092
3095
|
import { execSync as execSync4 } from "child_process";
|
|
3093
3096
|
import { WebSocketServer } from "ws";
|
|
@@ -4714,7 +4717,8 @@ function spawnCLI(bin, args, prompt, onChunk) {
|
|
|
4714
4717
|
delete env.CLAUDECODE;
|
|
4715
4718
|
const child = spawn4(bin, args, {
|
|
4716
4719
|
stdio: ["pipe", "pipe", "pipe"],
|
|
4717
|
-
env
|
|
4720
|
+
env,
|
|
4721
|
+
shell: true
|
|
4718
4722
|
});
|
|
4719
4723
|
let stdout = "";
|
|
4720
4724
|
let stderr = "";
|
|
@@ -5524,7 +5528,7 @@ function handleSetupOpenRoute(req, res) {
|
|
|
5524
5528
|
jsonResponse(res, 400, { error: `Theme folder not found: ${themePath}` });
|
|
5525
5529
|
return;
|
|
5526
5530
|
}
|
|
5527
|
-
const themeName =
|
|
5531
|
+
const themeName = basename7(fullPath);
|
|
5528
5532
|
createSession(fullPath, themeName);
|
|
5529
5533
|
scanThemeFromDisk(fullPath);
|
|
5530
5534
|
saveSession();
|
|
@@ -5867,17 +5871,19 @@ function handleSettingsCLIAuthRoute(req, res) {
|
|
|
5867
5871
|
const key = apiKey.trim();
|
|
5868
5872
|
process.env.OPENAI_API_KEY = key;
|
|
5869
5873
|
saveConfig({ openaiApiKey: key });
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5874
|
+
if (process.platform !== "win32") {
|
|
5875
|
+
const profileLine = `export OPENAI_API_KEY="${key}"`;
|
|
5876
|
+
const shellProfile = process.env.SHELL?.includes("zsh") ? join15(homedir4(), ".zshrc") : join15(homedir4(), ".bashrc");
|
|
5877
|
+
try {
|
|
5878
|
+
const existing = existsSync5(shellProfile) ? readFileSync5(shellProfile, "utf-8") : "";
|
|
5879
|
+
if (!existing.includes("OPENAI_API_KEY")) {
|
|
5880
|
+
appendFileSync(shellProfile, `
|
|
5876
5881
|
# Added by vibeSpot
|
|
5877
5882
|
${profileLine}
|
|
5878
5883
|
`);
|
|
5884
|
+
}
|
|
5885
|
+
} catch {
|
|
5879
5886
|
}
|
|
5880
|
-
} catch {
|
|
5881
5887
|
}
|
|
5882
5888
|
jsonResponse(res, 200, { ok: true, message: "API key saved" });
|
|
5883
5889
|
} else {
|
|
@@ -6508,8 +6514,13 @@ async function vibeCommand() {
|
|
|
6508
6514
|
console.log(accent(` v ${url}`));
|
|
6509
6515
|
console.log(dim(" Press Ctrl+C to stop\n"));
|
|
6510
6516
|
try {
|
|
6511
|
-
|
|
6512
|
-
|
|
6517
|
+
if (process.platform === "darwin") {
|
|
6518
|
+
execSync5(`open "${url}"`, { stdio: "ignore" });
|
|
6519
|
+
} else if (process.platform === "win32") {
|
|
6520
|
+
execSync5(`cmd /c start "" "${url}"`, { stdio: "ignore" });
|
|
6521
|
+
} else {
|
|
6522
|
+
execSync5(`xdg-open "${url}"`, { stdio: "ignore" });
|
|
6523
|
+
}
|
|
6513
6524
|
} catch {
|
|
6514
6525
|
}
|
|
6515
6526
|
await new Promise((resolve) => {
|