@react-grab/cli 0.1.48-dev.f29c951 → 0.1.48-dev.fe982d7

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/cli.cjs CHANGED
@@ -133,7 +133,7 @@ const promptSkillInstall = async ({ yes = false, global = false, cwd = process.c
133
133
  };
134
134
  //#endregion
135
135
  //#region src/commands/add.ts
136
- const VERSION$5 = "0.1.48-dev.f29c951";
136
+ const VERSION$5 = "0.1.48-dev.fe982d7";
137
137
  const add = new commander.Command().name("add").alias("install").description("install the React Grab skill for your agent").option("-y, --yes", "skip confirmation prompts", false).option("-c, --cwd <cwd>", "working directory (defaults to current directory)", process.cwd()).option("-g, --global", "install the skill globally instead of in the project", false).action(async (opts) => {
138
138
  console.log(`${picocolors.default.magenta("✿")} ${picocolors.default.bold("React Grab")} ${picocolors.default.gray(VERSION$5)}`);
139
139
  console.log();
@@ -266,6 +266,34 @@ const printDiff = (filePath, originalContent, newContent) => {
266
266
  console.log("─".repeat(60));
267
267
  };
268
268
  //#endregion
269
+ //#region src/utils/cli-helpers.ts
270
+ const applyTransformWithFeedback = (result, message) => {
271
+ const writeSpinner = spinner(message ?? `Applying changes to ${result.filePath}.`).start();
272
+ const writeResult = require_install.applyTransform(result);
273
+ if (!writeResult.success) {
274
+ writeSpinner.fail();
275
+ logger.break();
276
+ logger.error(writeResult.error || "Failed to write file.");
277
+ logger.break();
278
+ process.exit(1);
279
+ }
280
+ writeSpinner.succeed();
281
+ };
282
+ const installPackagesWithFeedback = async (packages, packageManager, projectRoot) => {
283
+ if (packages.length === 0) return;
284
+ const installSpinner = spinner(`Installing ${packages.join(", ")}.`).start();
285
+ try {
286
+ await require_install.installPackages(packages, {
287
+ packageManager,
288
+ cwd: projectRoot
289
+ });
290
+ installSpinner.succeed();
291
+ } catch (error) {
292
+ installSpinner.fail();
293
+ handleError(error);
294
+ }
295
+ };
296
+ //#endregion
269
297
  //#region src/utils/constants.ts
270
298
  const MAX_KEY_HOLD_DURATION_MS = 2e3;
271
299
  const DEFAULT_WATCH_DIR = ".react-grab";
@@ -289,7 +317,7 @@ const formatActivationKeyDisplay = (activationKey) => {
289
317
  };
290
318
  //#endregion
291
319
  //#region src/commands/configure.ts
292
- const VERSION$4 = "0.1.48-dev.f29c951";
320
+ const VERSION$4 = "0.1.48-dev.fe982d7";
293
321
  const isMac = process.platform === "darwin";
294
322
  const META_LABEL = isMac ? "Cmd" : "Win";
295
323
  const ALT_LABEL = isMac ? "Option" : "Alt";
@@ -648,16 +676,7 @@ const configure = new commander.Command().name("configure").alias("config").desc
648
676
  process.exit(0);
649
677
  }
650
678
  }
651
- const writeSpinner = spinner(`Applying changes to ${result.filePath}.`).start();
652
- const writeResult = require_install.applyTransform(result);
653
- if (!writeResult.success) {
654
- writeSpinner.fail();
655
- logger.break();
656
- logger.error(writeResult.error || "Failed to write file.");
657
- logger.break();
658
- process.exit(1);
659
- }
660
- writeSpinner.succeed();
679
+ applyTransformWithFeedback(result);
661
680
  logger.break();
662
681
  logger.log(`${highlighter.success("Success!")} CDN updated.`);
663
682
  logger.break();
@@ -832,16 +851,7 @@ const configure = new commander.Command().name("configure").alias("config").desc
832
851
  process.exit(0);
833
852
  }
834
853
  }
835
- const writeSpinner = spinner(`Applying changes to ${result.filePath}.`).start();
836
- const writeResult = require_install.applyTransform(result);
837
- if (!writeResult.success) {
838
- writeSpinner.fail();
839
- logger.break();
840
- logger.error(writeResult.error || "Failed to write file.");
841
- logger.break();
842
- process.exit(1);
843
- }
844
- writeSpinner.succeed();
854
+ applyTransformWithFeedback(result);
845
855
  } else {
846
856
  logger.break();
847
857
  logger.log("No changes needed.");
@@ -854,34 +864,6 @@ const configure = new commander.Command().name("configure").alias("config").desc
854
864
  }
855
865
  });
856
866
  //#endregion
857
- //#region src/utils/cli-helpers.ts
858
- const applyTransformWithFeedback = (result, message) => {
859
- const writeSpinner = spinner(message ?? `Applying changes to ${result.filePath}.`).start();
860
- const writeResult = require_install.applyTransform(result);
861
- if (!writeResult.success) {
862
- writeSpinner.fail();
863
- logger.break();
864
- logger.error(writeResult.error || "Failed to write file.");
865
- logger.break();
866
- process.exit(1);
867
- }
868
- writeSpinner.succeed();
869
- };
870
- const installPackagesWithFeedback = async (packages, packageManager, projectRoot) => {
871
- if (packages.length === 0) return;
872
- const installSpinner = spinner(`Installing ${packages.join(", ")}.`).start();
873
- try {
874
- await require_install.installPackages(packages, {
875
- packageManager,
876
- cwd: projectRoot
877
- });
878
- installSpinner.succeed();
879
- } catch (error) {
880
- installSpinner.fail();
881
- handleError(error);
882
- }
883
- };
884
- //#endregion
885
867
  //#region src/utils/is-telemetry-enabled.ts
886
868
  const isTelemetryEnabled = () => {
887
869
  const doNotTrack = process.env.DO_NOT_TRACK;
@@ -889,7 +871,7 @@ const isTelemetryEnabled = () => {
889
871
  };
890
872
  //#endregion
891
873
  //#region src/commands/init.ts
892
- const VERSION$3 = "0.1.48-dev.f29c951";
874
+ const VERSION$3 = "0.1.48-dev.fe982d7";
893
875
  const REPORT_URL = "https://react-grab.com/api/report-cli";
894
876
  const DOCS_URL = "https://github.com/aidenybai/react-grab";
895
877
  const reportToCli = (type, config, error) => {
@@ -1840,7 +1822,7 @@ const pull = new commander.Command().name("pull").description("start the watcher
1840
1822
  });
1841
1823
  //#endregion
1842
1824
  //#region src/commands/remove.ts
1843
- const VERSION$2 = "0.1.48-dev.f29c951";
1825
+ const VERSION$2 = "0.1.48-dev.fe982d7";
1844
1826
  const remove = new commander.Command().name("remove").description("uninstall the React Grab skill from your agent").option("-c, --cwd <cwd>", "working directory (defaults to current directory)", process.cwd()).option("-g, --global", "remove the globally-installed skill instead of the project's", false).action(async (opts) => {
1845
1827
  console.log(`${picocolors.default.magenta("✿")} ${picocolors.default.bold("React Grab")} ${picocolors.default.gray(VERSION$2)}`);
1846
1828
  console.log();
@@ -1869,7 +1851,7 @@ const stop = new commander.Command().name("stop").description("stop the React Gr
1869
1851
  });
1870
1852
  //#endregion
1871
1853
  //#region src/commands/upgrade.ts
1872
- const VERSION$1 = "0.1.48-dev.f29c951";
1854
+ const VERSION$1 = "0.1.48-dev.fe982d7";
1873
1855
  const NPM_REGISTRY_URL = "https://registry.npmjs.org/react-grab/latest";
1874
1856
  const fetchLatestVersion = async () => {
1875
1857
  try {
@@ -1981,7 +1963,7 @@ const watch = new commander.Command().name("watch").description("run the React G
1981
1963
  });
1982
1964
  //#endregion
1983
1965
  //#region src/cli.ts
1984
- const VERSION = "0.1.48-dev.f29c951";
1966
+ const VERSION = "0.1.48-dev.fe982d7";
1985
1967
  const VERSION_API_URL = "https://www.react-grab.com/api/version";
1986
1968
  process.on("SIGINT", () => process.exit(0));
1987
1969
  process.on("SIGTERM", () => process.exit(0));
package/dist/cli.js CHANGED
@@ -128,7 +128,7 @@ const promptSkillInstall = async ({ yes = false, global = false, cwd = process.c
128
128
  };
129
129
  //#endregion
130
130
  //#region src/commands/add.ts
131
- const VERSION$5 = "0.1.48-dev.f29c951";
131
+ const VERSION$5 = "0.1.48-dev.fe982d7";
132
132
  const add = new Command().name("add").alias("install").description("install the React Grab skill for your agent").option("-y, --yes", "skip confirmation prompts", false).option("-c, --cwd <cwd>", "working directory (defaults to current directory)", process.cwd()).option("-g, --global", "install the skill globally instead of in the project", false).action(async (opts) => {
133
133
  console.log(`${pc.magenta("✿")} ${pc.bold("React Grab")} ${pc.gray(VERSION$5)}`);
134
134
  console.log();
@@ -261,6 +261,34 @@ const printDiff = (filePath, originalContent, newContent) => {
261
261
  console.log("─".repeat(60));
262
262
  };
263
263
  //#endregion
264
+ //#region src/utils/cli-helpers.ts
265
+ const applyTransformWithFeedback = (result, message) => {
266
+ const writeSpinner = spinner(message ?? `Applying changes to ${result.filePath}.`).start();
267
+ const writeResult = applyTransform(result);
268
+ if (!writeResult.success) {
269
+ writeSpinner.fail();
270
+ logger.break();
271
+ logger.error(writeResult.error || "Failed to write file.");
272
+ logger.break();
273
+ process.exit(1);
274
+ }
275
+ writeSpinner.succeed();
276
+ };
277
+ const installPackagesWithFeedback = async (packages, packageManager, projectRoot) => {
278
+ if (packages.length === 0) return;
279
+ const installSpinner = spinner(`Installing ${packages.join(", ")}.`).start();
280
+ try {
281
+ await installPackages(packages, {
282
+ packageManager,
283
+ cwd: projectRoot
284
+ });
285
+ installSpinner.succeed();
286
+ } catch (error) {
287
+ installSpinner.fail();
288
+ handleError(error);
289
+ }
290
+ };
291
+ //#endregion
264
292
  //#region src/utils/constants.ts
265
293
  const MAX_KEY_HOLD_DURATION_MS = 2e3;
266
294
  const DEFAULT_WATCH_DIR = ".react-grab";
@@ -284,7 +312,7 @@ const formatActivationKeyDisplay = (activationKey) => {
284
312
  };
285
313
  //#endregion
286
314
  //#region src/commands/configure.ts
287
- const VERSION$4 = "0.1.48-dev.f29c951";
315
+ const VERSION$4 = "0.1.48-dev.fe982d7";
288
316
  const isMac = process.platform === "darwin";
289
317
  const META_LABEL = isMac ? "Cmd" : "Win";
290
318
  const ALT_LABEL = isMac ? "Option" : "Alt";
@@ -643,16 +671,7 @@ const configure = new Command().name("configure").alias("config").description("c
643
671
  process.exit(0);
644
672
  }
645
673
  }
646
- const writeSpinner = spinner(`Applying changes to ${result.filePath}.`).start();
647
- const writeResult = applyTransform(result);
648
- if (!writeResult.success) {
649
- writeSpinner.fail();
650
- logger.break();
651
- logger.error(writeResult.error || "Failed to write file.");
652
- logger.break();
653
- process.exit(1);
654
- }
655
- writeSpinner.succeed();
674
+ applyTransformWithFeedback(result);
656
675
  logger.break();
657
676
  logger.log(`${highlighter.success("Success!")} CDN updated.`);
658
677
  logger.break();
@@ -827,16 +846,7 @@ const configure = new Command().name("configure").alias("config").description("c
827
846
  process.exit(0);
828
847
  }
829
848
  }
830
- const writeSpinner = spinner(`Applying changes to ${result.filePath}.`).start();
831
- const writeResult = applyTransform(result);
832
- if (!writeResult.success) {
833
- writeSpinner.fail();
834
- logger.break();
835
- logger.error(writeResult.error || "Failed to write file.");
836
- logger.break();
837
- process.exit(1);
838
- }
839
- writeSpinner.succeed();
849
+ applyTransformWithFeedback(result);
840
850
  } else {
841
851
  logger.break();
842
852
  logger.log("No changes needed.");
@@ -849,34 +859,6 @@ const configure = new Command().name("configure").alias("config").description("c
849
859
  }
850
860
  });
851
861
  //#endregion
852
- //#region src/utils/cli-helpers.ts
853
- const applyTransformWithFeedback = (result, message) => {
854
- const writeSpinner = spinner(message ?? `Applying changes to ${result.filePath}.`).start();
855
- const writeResult = applyTransform(result);
856
- if (!writeResult.success) {
857
- writeSpinner.fail();
858
- logger.break();
859
- logger.error(writeResult.error || "Failed to write file.");
860
- logger.break();
861
- process.exit(1);
862
- }
863
- writeSpinner.succeed();
864
- };
865
- const installPackagesWithFeedback = async (packages, packageManager, projectRoot) => {
866
- if (packages.length === 0) return;
867
- const installSpinner = spinner(`Installing ${packages.join(", ")}.`).start();
868
- try {
869
- await installPackages(packages, {
870
- packageManager,
871
- cwd: projectRoot
872
- });
873
- installSpinner.succeed();
874
- } catch (error) {
875
- installSpinner.fail();
876
- handleError(error);
877
- }
878
- };
879
- //#endregion
880
862
  //#region src/utils/is-telemetry-enabled.ts
881
863
  const isTelemetryEnabled = () => {
882
864
  const doNotTrack = process.env.DO_NOT_TRACK;
@@ -884,7 +866,7 @@ const isTelemetryEnabled = () => {
884
866
  };
885
867
  //#endregion
886
868
  //#region src/commands/init.ts
887
- const VERSION$3 = "0.1.48-dev.f29c951";
869
+ const VERSION$3 = "0.1.48-dev.fe982d7";
888
870
  const REPORT_URL = "https://react-grab.com/api/report-cli";
889
871
  const DOCS_URL = "https://github.com/aidenybai/react-grab";
890
872
  const reportToCli = (type, config, error) => {
@@ -1835,7 +1817,7 @@ const pull = new Command().name("pull").description("start the watcher if needed
1835
1817
  });
1836
1818
  //#endregion
1837
1819
  //#region src/commands/remove.ts
1838
- const VERSION$2 = "0.1.48-dev.f29c951";
1820
+ const VERSION$2 = "0.1.48-dev.fe982d7";
1839
1821
  const remove = new Command().name("remove").description("uninstall the React Grab skill from your agent").option("-c, --cwd <cwd>", "working directory (defaults to current directory)", process.cwd()).option("-g, --global", "remove the globally-installed skill instead of the project's", false).action(async (opts) => {
1840
1822
  console.log(`${pc.magenta("✿")} ${pc.bold("React Grab")} ${pc.gray(VERSION$2)}`);
1841
1823
  console.log();
@@ -1864,7 +1846,7 @@ const stop = new Command().name("stop").description("stop the React Grab watcher
1864
1846
  });
1865
1847
  //#endregion
1866
1848
  //#region src/commands/upgrade.ts
1867
- const VERSION$1 = "0.1.48-dev.f29c951";
1849
+ const VERSION$1 = "0.1.48-dev.fe982d7";
1868
1850
  const NPM_REGISTRY_URL = "https://registry.npmjs.org/react-grab/latest";
1869
1851
  const fetchLatestVersion = async () => {
1870
1852
  try {
@@ -1976,7 +1958,7 @@ const watch = new Command().name("watch").description("run the React Grab captur
1976
1958
  });
1977
1959
  //#endregion
1978
1960
  //#region src/cli.ts
1979
- const VERSION = "0.1.48-dev.f29c951";
1961
+ const VERSION = "0.1.48-dev.fe982d7";
1980
1962
  const VERSION_API_URL = "https://www.react-grab.com/api/version";
1981
1963
  process.on("SIGINT", () => process.exit(0));
1982
1964
  process.on("SIGTERM", () => process.exit(0));