@react-grab/cli 0.1.3 → 0.1.4

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.
Files changed (3) hide show
  1. package/dist/cli.cjs +17 -17
  2. package/dist/cli.js +17 -17
  3. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -1505,10 +1505,10 @@ var addOptionsToNextScript = (originalContent, options, filePath) => {
1505
1505
  };
1506
1506
  };
1507
1507
  var addOptionsToViteScript = (originalContent, options, filePath) => {
1508
- const reactGrabImportMatch = originalContent.match(
1509
- /import\s*\(\s*["']react-grab["']\s*\)/
1508
+ const reactGrabImportWithInitMatch = originalContent.match(
1509
+ /import\s*\(\s*["']react-grab["']\s*\)(?:\.then\s*\(\s*\(m\)\s*=>\s*m\.init\s*\([^)]*\)\s*\))?/
1510
1510
  );
1511
- if (!reactGrabImportMatch) {
1511
+ if (!reactGrabImportWithInitMatch) {
1512
1512
  return {
1513
1513
  success: false,
1514
1514
  filePath,
@@ -1518,7 +1518,7 @@ var addOptionsToViteScript = (originalContent, options, filePath) => {
1518
1518
  const optionsJson = formatOptionsAsJson(options);
1519
1519
  const newImport = `import("react-grab").then((m) => m.init(${optionsJson}))`;
1520
1520
  const newContent = originalContent.replace(
1521
- reactGrabImportMatch[0],
1521
+ reactGrabImportWithInitMatch[0],
1522
1522
  newImport
1523
1523
  );
1524
1524
  return {
@@ -1530,10 +1530,10 @@ var addOptionsToViteScript = (originalContent, options, filePath) => {
1530
1530
  };
1531
1531
  };
1532
1532
  var addOptionsToWebpackImport = (originalContent, options, filePath) => {
1533
- const reactGrabImportMatch = originalContent.match(
1534
- /import\s*\(\s*["']react-grab["']\s*\)/
1533
+ const reactGrabImportWithInitMatch = originalContent.match(
1534
+ /import\s*\(\s*["']react-grab["']\s*\)(?:\.then\s*\(\s*\(m\)\s*=>\s*m\.init\s*\([^)]*\)\s*\))?/
1535
1535
  );
1536
- if (!reactGrabImportMatch) {
1536
+ if (!reactGrabImportWithInitMatch) {
1537
1537
  return {
1538
1538
  success: false,
1539
1539
  filePath,
@@ -1543,7 +1543,7 @@ var addOptionsToWebpackImport = (originalContent, options, filePath) => {
1543
1543
  const optionsJson = formatOptionsAsJson(options);
1544
1544
  const newImport = `import("react-grab").then((m) => m.init(${optionsJson}))`;
1545
1545
  const newContent = originalContent.replace(
1546
- reactGrabImportMatch[0],
1546
+ reactGrabImportWithInitMatch[0],
1547
1547
  newImport
1548
1548
  );
1549
1549
  return {
@@ -1555,10 +1555,10 @@ var addOptionsToWebpackImport = (originalContent, options, filePath) => {
1555
1555
  };
1556
1556
  };
1557
1557
  var addOptionsToTanStackImport = (originalContent, options, filePath) => {
1558
- const reactGrabImportMatch = originalContent.match(
1559
- /void\s+import\s*\(\s*["']react-grab["']\s*\)/
1558
+ const reactGrabImportWithInitMatch = originalContent.match(
1559
+ /(?:void\s+import\s*\(\s*["']react-grab["']\s*\)|import\s*\(\s*["']react-grab\/core["']\s*\)\.then\s*\(\s*\(\s*\{\s*init\s*\}\s*\)\s*=>\s*init\s*\([^)]*\)\s*\))/
1560
1560
  );
1561
- if (!reactGrabImportMatch) {
1561
+ if (!reactGrabImportWithInitMatch) {
1562
1562
  return {
1563
1563
  success: false,
1564
1564
  filePath,
@@ -1568,7 +1568,7 @@ var addOptionsToTanStackImport = (originalContent, options, filePath) => {
1568
1568
  const optionsJson = formatOptionsAsJson(options);
1569
1569
  const newImport = `import("react-grab/core").then(({ init }) => init(${optionsJson}))`;
1570
1570
  const newContent = originalContent.replace(
1571
- reactGrabImportMatch[0],
1571
+ reactGrabImportWithInitMatch[0],
1572
1572
  newImport
1573
1573
  );
1574
1574
  return {
@@ -1833,7 +1833,7 @@ var previewPackageJsonAgentRemoval = (projectRoot, agent) => {
1833
1833
  };
1834
1834
 
1835
1835
  // src/commands/add.ts
1836
- var VERSION = "0.1.2";
1836
+ var VERSION = "0.1.3";
1837
1837
  var formatInstalledAgentNames = (agents) => agents.map((agent) => AGENT_NAMES[agent] || agent).join(", ");
1838
1838
  var add = new commander.Command().name("add").alias("install").description("add an agent integration").argument("[agent]", `agent to add (${AGENTS.join(", ")})`).option("-y, --yes", "skip confirmation prompts", false).option(
1839
1839
  "-c, --cwd <cwd>",
@@ -2169,7 +2169,7 @@ var MAX_KEY_HOLD_DURATION_MS = 2e3;
2169
2169
  var MAX_CONTEXT_LINES = 50;
2170
2170
 
2171
2171
  // src/commands/configure.ts
2172
- var VERSION2 = "0.1.2";
2172
+ var VERSION2 = "0.1.3";
2173
2173
  var isMac = process.platform === "darwin";
2174
2174
  var META_LABEL = isMac ? "Cmd" : "Win";
2175
2175
  var ALT_LABEL = isMac ? "Option" : "Alt";
@@ -2669,7 +2669,7 @@ var uninstallPackagesWithFeedback = (packages, packageManager, projectRoot) => {
2669
2669
  };
2670
2670
 
2671
2671
  // src/commands/init.ts
2672
- var VERSION3 = "0.1.2";
2672
+ var VERSION3 = "0.1.3";
2673
2673
  var REPORT_URL = "https://react-grab.com/api/report-cli";
2674
2674
  var DOCS_URL = "https://github.com/aidenybai/react-grab";
2675
2675
  var reportToCli = (type, config, error) => {
@@ -3405,7 +3405,7 @@ var init = new commander.Command().name("init").description("initialize React Gr
3405
3405
  reportToCli("error", void 0, error);
3406
3406
  }
3407
3407
  });
3408
- var VERSION4 = "0.1.2";
3408
+ var VERSION4 = "0.1.3";
3409
3409
  var remove = new commander.Command().name("remove").description("remove an agent integration").argument(
3410
3410
  "[agent]",
3411
3411
  "agent to remove (claude-code, cursor, opencode, codex, gemini, amp, ami)"
@@ -3584,7 +3584,7 @@ var remove = new commander.Command().name("remove").description("remove an agent
3584
3584
  });
3585
3585
 
3586
3586
  // src/cli.ts
3587
- var VERSION5 = "0.1.2";
3587
+ var VERSION5 = "0.1.3";
3588
3588
  var VERSION_API_URL = "https://www.react-grab.com/api/version";
3589
3589
  process.on("SIGINT", () => process.exit(0));
3590
3590
  process.on("SIGTERM", () => process.exit(0));
package/dist/cli.js CHANGED
@@ -1497,10 +1497,10 @@ var addOptionsToNextScript = (originalContent, options, filePath) => {
1497
1497
  };
1498
1498
  };
1499
1499
  var addOptionsToViteScript = (originalContent, options, filePath) => {
1500
- const reactGrabImportMatch = originalContent.match(
1501
- /import\s*\(\s*["']react-grab["']\s*\)/
1500
+ const reactGrabImportWithInitMatch = originalContent.match(
1501
+ /import\s*\(\s*["']react-grab["']\s*\)(?:\.then\s*\(\s*\(m\)\s*=>\s*m\.init\s*\([^)]*\)\s*\))?/
1502
1502
  );
1503
- if (!reactGrabImportMatch) {
1503
+ if (!reactGrabImportWithInitMatch) {
1504
1504
  return {
1505
1505
  success: false,
1506
1506
  filePath,
@@ -1510,7 +1510,7 @@ var addOptionsToViteScript = (originalContent, options, filePath) => {
1510
1510
  const optionsJson = formatOptionsAsJson(options);
1511
1511
  const newImport = `import("react-grab").then((m) => m.init(${optionsJson}))`;
1512
1512
  const newContent = originalContent.replace(
1513
- reactGrabImportMatch[0],
1513
+ reactGrabImportWithInitMatch[0],
1514
1514
  newImport
1515
1515
  );
1516
1516
  return {
@@ -1522,10 +1522,10 @@ var addOptionsToViteScript = (originalContent, options, filePath) => {
1522
1522
  };
1523
1523
  };
1524
1524
  var addOptionsToWebpackImport = (originalContent, options, filePath) => {
1525
- const reactGrabImportMatch = originalContent.match(
1526
- /import\s*\(\s*["']react-grab["']\s*\)/
1525
+ const reactGrabImportWithInitMatch = originalContent.match(
1526
+ /import\s*\(\s*["']react-grab["']\s*\)(?:\.then\s*\(\s*\(m\)\s*=>\s*m\.init\s*\([^)]*\)\s*\))?/
1527
1527
  );
1528
- if (!reactGrabImportMatch) {
1528
+ if (!reactGrabImportWithInitMatch) {
1529
1529
  return {
1530
1530
  success: false,
1531
1531
  filePath,
@@ -1535,7 +1535,7 @@ var addOptionsToWebpackImport = (originalContent, options, filePath) => {
1535
1535
  const optionsJson = formatOptionsAsJson(options);
1536
1536
  const newImport = `import("react-grab").then((m) => m.init(${optionsJson}))`;
1537
1537
  const newContent = originalContent.replace(
1538
- reactGrabImportMatch[0],
1538
+ reactGrabImportWithInitMatch[0],
1539
1539
  newImport
1540
1540
  );
1541
1541
  return {
@@ -1547,10 +1547,10 @@ var addOptionsToWebpackImport = (originalContent, options, filePath) => {
1547
1547
  };
1548
1548
  };
1549
1549
  var addOptionsToTanStackImport = (originalContent, options, filePath) => {
1550
- const reactGrabImportMatch = originalContent.match(
1551
- /void\s+import\s*\(\s*["']react-grab["']\s*\)/
1550
+ const reactGrabImportWithInitMatch = originalContent.match(
1551
+ /(?:void\s+import\s*\(\s*["']react-grab["']\s*\)|import\s*\(\s*["']react-grab\/core["']\s*\)\.then\s*\(\s*\(\s*\{\s*init\s*\}\s*\)\s*=>\s*init\s*\([^)]*\)\s*\))/
1552
1552
  );
1553
- if (!reactGrabImportMatch) {
1553
+ if (!reactGrabImportWithInitMatch) {
1554
1554
  return {
1555
1555
  success: false,
1556
1556
  filePath,
@@ -1560,7 +1560,7 @@ var addOptionsToTanStackImport = (originalContent, options, filePath) => {
1560
1560
  const optionsJson = formatOptionsAsJson(options);
1561
1561
  const newImport = `import("react-grab/core").then(({ init }) => init(${optionsJson}))`;
1562
1562
  const newContent = originalContent.replace(
1563
- reactGrabImportMatch[0],
1563
+ reactGrabImportWithInitMatch[0],
1564
1564
  newImport
1565
1565
  );
1566
1566
  return {
@@ -1825,7 +1825,7 @@ var previewPackageJsonAgentRemoval = (projectRoot, agent) => {
1825
1825
  };
1826
1826
 
1827
1827
  // src/commands/add.ts
1828
- var VERSION = "0.1.2";
1828
+ var VERSION = "0.1.3";
1829
1829
  var formatInstalledAgentNames = (agents) => agents.map((agent) => AGENT_NAMES[agent] || agent).join(", ");
1830
1830
  var add = new Command().name("add").alias("install").description("add an agent integration").argument("[agent]", `agent to add (${AGENTS.join(", ")})`).option("-y, --yes", "skip confirmation prompts", false).option(
1831
1831
  "-c, --cwd <cwd>",
@@ -2161,7 +2161,7 @@ var MAX_KEY_HOLD_DURATION_MS = 2e3;
2161
2161
  var MAX_CONTEXT_LINES = 50;
2162
2162
 
2163
2163
  // src/commands/configure.ts
2164
- var VERSION2 = "0.1.2";
2164
+ var VERSION2 = "0.1.3";
2165
2165
  var isMac = process.platform === "darwin";
2166
2166
  var META_LABEL = isMac ? "Cmd" : "Win";
2167
2167
  var ALT_LABEL = isMac ? "Option" : "Alt";
@@ -2661,7 +2661,7 @@ var uninstallPackagesWithFeedback = (packages, packageManager, projectRoot) => {
2661
2661
  };
2662
2662
 
2663
2663
  // src/commands/init.ts
2664
- var VERSION3 = "0.1.2";
2664
+ var VERSION3 = "0.1.3";
2665
2665
  var REPORT_URL = "https://react-grab.com/api/report-cli";
2666
2666
  var DOCS_URL = "https://github.com/aidenybai/react-grab";
2667
2667
  var reportToCli = (type, config, error) => {
@@ -3397,7 +3397,7 @@ var init = new Command().name("init").description("initialize React Grab in your
3397
3397
  reportToCli("error", void 0, error);
3398
3398
  }
3399
3399
  });
3400
- var VERSION4 = "0.1.2";
3400
+ var VERSION4 = "0.1.3";
3401
3401
  var remove = new Command().name("remove").description("remove an agent integration").argument(
3402
3402
  "[agent]",
3403
3403
  "agent to remove (claude-code, cursor, opencode, codex, gemini, amp, ami)"
@@ -3576,7 +3576,7 @@ var remove = new Command().name("remove").description("remove an agent integrati
3576
3576
  });
3577
3577
 
3578
3578
  // src/cli.ts
3579
- var VERSION5 = "0.1.2";
3579
+ var VERSION5 = "0.1.3";
3580
3580
  var VERSION_API_URL = "https://www.react-grab.com/api/version";
3581
3581
  process.on("SIGINT", () => process.exit(0));
3582
3582
  process.on("SIGTERM", () => process.exit(0));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-grab/cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "bin": {
5
5
  "react-grab": "./dist/cli.js"
6
6
  },