@insforge/cli 0.1.64 → 0.1.65

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
@@ -1162,7 +1162,7 @@ function registerProjectsCommands(projectsCmd2) {
1162
1162
 
1163
1163
  // src/lib/analytics.ts
1164
1164
  import { PostHog } from "posthog-node";
1165
- var POSTHOG_API_KEY = "";
1165
+ var POSTHOG_API_KEY = "phc_ueV1ii62wdBTkH7E70ugyeqHIHu8dFDdjs0qq3TZhJz";
1166
1166
  var POSTHOG_HOST = process.env.POSTHOG_HOST || "https://us.i.posthog.com";
1167
1167
  var client = null;
1168
1168
  function getClient() {
@@ -3022,6 +3022,18 @@ var execAsync3 = promisify4(exec3);
3022
3022
  function buildOssHost2(appkey, region) {
3023
3023
  return `https://${appkey}.${region}.insforge.app`;
3024
3024
  }
3025
+ async function runNpmInstall(startMessage = "Installing dependencies...") {
3026
+ const spinner8 = clack12.spinner();
3027
+ spinner8.start(startMessage);
3028
+ try {
3029
+ await execAsync3("npm install", { cwd: process.cwd(), maxBuffer: 10 * 1024 * 1024 });
3030
+ spinner8.stop("Dependencies installed");
3031
+ } catch (err) {
3032
+ spinner8.stop("Failed to install dependencies");
3033
+ clack12.log.warn(`npm install failed: ${err.message}`);
3034
+ clack12.log.info("Run `npm install` manually to install dependencies.");
3035
+ }
3036
+ }
3025
3037
  function registerProjectLinkCommand(program2) {
3026
3038
  program2.command("link").description("Link current directory to an InsForge project").option("--project-id <id>", "Project ID to link").option("--org-id <id>", "Organization ID").option("--template <template>", "Download a template after linking: react, nextjs, chatbot, crm, e-commerce, todo").option("--auth <provider>", "Wire a third-party auth provider into the chosen template (currently: better-auth)").option("--api-base-url <url>", "API Base URL for direct linking (OSS/Self-hosted)").option("--api-key <key>", "API Key for direct linking (OSS/Self-hosted)").action(async (opts, cmd) => {
3027
3039
  const { json, apiUrl } = getRootOpts(cmd);
@@ -3106,16 +3118,7 @@ function registerProjectLinkCommand(program2) {
3106
3118
  }
3107
3119
  }
3108
3120
  if (templateDownloaded && !json) {
3109
- const installSpinner = clack12.spinner();
3110
- installSpinner.start("Installing dependencies...");
3111
- try {
3112
- await execAsync3("npm install", { cwd: process.cwd(), maxBuffer: 10 * 1024 * 1024 });
3113
- installSpinner.stop("Dependencies installed");
3114
- } catch (err) {
3115
- installSpinner.stop("Failed to install dependencies");
3116
- clack12.log.warn(`npm install failed: ${err.message}`);
3117
- clack12.log.info("Run `npm install` manually to install dependencies.");
3118
- }
3121
+ await runNpmInstall();
3119
3122
  }
3120
3123
  await installSkills(json);
3121
3124
  trackCommand("link", "oss-org", { direct: true, template: template2 });
@@ -3154,16 +3157,7 @@ function registerProjectLinkCommand(program2) {
3154
3157
  clack12.log.success(`Wired in ${opts.auth}: ${result.written.length} new, ${result.overwritten.length} replaced`);
3155
3158
  }
3156
3159
  if (result.packageJsonPatched && !json) {
3157
- const installSpinner = clack12.spinner();
3158
- installSpinner.start("Installing new dependencies...");
3159
- try {
3160
- await execAsync3("npm install", { cwd: process.cwd(), maxBuffer: 10 * 1024 * 1024 });
3161
- installSpinner.stop("Dependencies installed");
3162
- } catch (err) {
3163
- installSpinner.stop("Failed to install dependencies");
3164
- clack12.log.warn(`npm install failed: ${err.message}`);
3165
- clack12.log.info("Run `npm install` manually to install dependencies.");
3166
- }
3160
+ await runNpmInstall("Installing new dependencies...");
3167
3161
  }
3168
3162
  if (!json) clack12.note(result.nextSteps, "What's next");
3169
3163
  } catch (err) {
@@ -3318,16 +3312,7 @@ function registerProjectLinkCommand(program2) {
3318
3312
  }
3319
3313
  }
3320
3314
  if (templateDownloaded && !json) {
3321
- const installSpinner = clack12.spinner();
3322
- installSpinner.start("Installing dependencies...");
3323
- try {
3324
- await execAsync3("npm install", { cwd: process.cwd(), maxBuffer: 10 * 1024 * 1024 });
3325
- installSpinner.stop("Dependencies installed");
3326
- } catch (err) {
3327
- installSpinner.stop("Failed to install dependencies");
3328
- clack12.log.warn(`npm install failed: ${err.message}`);
3329
- clack12.log.info("Run `npm install` manually to install dependencies.");
3330
- }
3315
+ await runNpmInstall();
3331
3316
  }
3332
3317
  await installSkills(json);
3333
3318
  await reportCliUsage("cli.link", true, 6, projectConfig);
@@ -3351,8 +3336,11 @@ function registerProjectLinkCommand(program2) {
3351
3336
  const result = await applyAuthProvider(opts.auth, process.cwd(), projectConfig, json);
3352
3337
  if (!json) {
3353
3338
  clack12.log.success(`Wired in ${opts.auth}: ${result.written.length} new, ${result.overwritten.length} replaced`);
3354
- clack12.note(result.nextSteps, "What's next");
3355
3339
  }
3340
+ if (result.packageJsonPatched && !json) {
3341
+ await runNpmInstall("Installing new dependencies...");
3342
+ }
3343
+ if (!json) clack12.note(result.nextSteps, "What's next");
3356
3344
  } catch (err) {
3357
3345
  const msg = `Failed to apply --auth ${opts.auth}: ${err.message}`;
3358
3346
  if (json) console.error(JSON.stringify({ warning: msg }));
@@ -6767,7 +6755,7 @@ function registerDiagnoseCommands(diagnoseCmd2) {
6767
6755
  const s = !json ? clack14.spinner() : null;
6768
6756
  s?.start("Collecting diagnostic data...");
6769
6757
  const data2 = await collectDiagnosticData(projectId, ossMode, apiUrl);
6770
- const cliVersion = "0.1.64";
6758
+ const cliVersion = "0.1.65";
6771
6759
  s?.stop("Data collected");
6772
6760
  if (!json) {
6773
6761
  console.log(`