@hapico/cli 0.0.26 → 0.0.27
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/bin/index.js +15 -4
- package/bin/tools/vibe/index.js +770 -0
- package/bun.lock +122 -2
- package/dist/index.js +15 -4
- package/dist/tools/vibe/index.js +770 -0
- package/index.ts +18 -10
- package/package.json +3 -1
- package/tools/vibe/index.ts +816 -0
package/bin/index.js
CHANGED
|
@@ -55,6 +55,7 @@ const child_process_1 = require("child_process");
|
|
|
55
55
|
const util_1 = require("util");
|
|
56
56
|
const chalk_1 = __importDefault(require("chalk"));
|
|
57
57
|
const pako_1 = __importDefault(require("pako"));
|
|
58
|
+
const vibe_1 = require("./tools/vibe");
|
|
58
59
|
// Promisify exec for async usage
|
|
59
60
|
const execPromise = (0, util_1.promisify)(child_process_1.exec);
|
|
60
61
|
// Directory to store the token and project config
|
|
@@ -395,7 +396,7 @@ class RoomState {
|
|
|
395
396
|
return this.isConnected;
|
|
396
397
|
}
|
|
397
398
|
}
|
|
398
|
-
commander_1.program.version("0.0.
|
|
399
|
+
commander_1.program.version("0.0.27").description("Hapico CLI for project management");
|
|
399
400
|
commander_1.program
|
|
400
401
|
.command("clone <id>")
|
|
401
402
|
.description("Clone a project by ID")
|
|
@@ -483,6 +484,13 @@ commander_1.program
|
|
|
483
484
|
apiSpinner.fail(chalk_1.default.red(`Error cloning project: ${error.message}`));
|
|
484
485
|
}
|
|
485
486
|
});
|
|
487
|
+
commander_1.program
|
|
488
|
+
.command("vibe")
|
|
489
|
+
.description("Refactor code using AI")
|
|
490
|
+
.action(async () => {
|
|
491
|
+
const targetPath = process.cwd();
|
|
492
|
+
await (0, vibe_1.vibe)(targetPath);
|
|
493
|
+
});
|
|
486
494
|
commander_1.program
|
|
487
495
|
.command("dev")
|
|
488
496
|
.description("Start the project in development mode")
|
|
@@ -571,6 +579,10 @@ commander_1.program
|
|
|
571
579
|
room.connect(async () => {
|
|
572
580
|
devSpinner.succeed(chalk_1.default.green("Project started in development mode!"));
|
|
573
581
|
room.updateState("view", filteredFiles);
|
|
582
|
+
// Debounce the state update to avoid overwhelming the server while typing/saving
|
|
583
|
+
const debouncedUpdate = (0, lodash_1.debounce)((updatedFiles) => {
|
|
584
|
+
room.updateState("view", updatedFiles);
|
|
585
|
+
}, 200);
|
|
574
586
|
fileManager.setOnFileChange((filePath, content) => {
|
|
575
587
|
var _a;
|
|
576
588
|
const es5 = (_a = (0, exports.compileES5)(content, filePath)) !== null && _a !== void 0 ? _a : "";
|
|
@@ -582,7 +594,7 @@ commander_1.program
|
|
|
582
594
|
return file;
|
|
583
595
|
});
|
|
584
596
|
room.files = updatedFiles;
|
|
585
|
-
|
|
597
|
+
debouncedUpdate(updatedFiles);
|
|
586
598
|
});
|
|
587
599
|
// Fetch project info
|
|
588
600
|
const store = getStoredProjectId(pwd);
|
|
@@ -603,8 +615,7 @@ commander_1.program
|
|
|
603
615
|
const projectType = project.data.type || "view";
|
|
604
616
|
const zversion = options.zversion;
|
|
605
617
|
if (projectType === "expo_app" || projectType === "emg_edu_lesson") {
|
|
606
|
-
const BASE_EXPO_LINK = `exp://u.expo.dev/e362c6df-abe8-4503-8723-1362f015d167/group/
|
|
607
|
-
//exp://u.expo.dev/e362c6df-abe8-4503-8723-1362f015d167/group/8cd11ab9-b6db-4924-9f7a-5e449f027bba?sessionKey=eyJpZCI6IjU1NF8xIiwidmlld0lkIjo1NTR9&mode=development
|
|
618
|
+
const BASE_EXPO_LINK = `exp://u.expo.dev/e362c6df-abe8-4503-8723-1362f015d167/group/abdb7abf-bcf7-4f39-a527-dc4d277b74c0`;
|
|
608
619
|
const link = `${BASE_EXPO_LINK}?sessionKey=${projectId}&mode=development`;
|
|
609
620
|
qrcode_terminal_1.default.generate(link, { small: true }, (qrcode) => {
|
|
610
621
|
console.log(chalk_1.default.cyan("📱 Scan this QR code with Expo Go to connect to the project:"));
|