rulesync 0.58.0 → 0.60.0

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
@@ -1,38 +1,16 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- generateJunieMcp
4
- } from "./chunk-VNT6AHHO.js";
5
- import {
6
- generateKiroMcp
7
- } from "./chunk-LXTA7DBA.js";
8
- import {
9
- generateRooMcp
10
- } from "./chunk-PCATT4UZ.js";
11
- import {
12
- generateWindsurfMcp
13
- } from "./chunk-7E4U4YAB.js";
14
- import {
15
- generateAugmentcodeMcp
16
- } from "./chunk-YTU3SCQO.js";
17
- import {
18
- generateClaudeMcp
19
- } from "./chunk-VKNCBVZF.js";
20
- import {
21
- generateClineMcp
22
- } from "./chunk-W2WU253H.js";
23
- import {
24
- generateCodexMcp
25
- } from "./chunk-7UBF4OLN.js";
26
- import {
27
- generateCopilotMcp
28
- } from "./chunk-KUGTKMNW.js";
29
- import {
30
- generateCursorMcp
31
- } from "./chunk-OA473EXZ.js";
32
- import {
33
- generateGeminiCliMcp
34
- } from "./chunk-WAX2UANS.js";
35
- import "./chunk-J3TBR5EP.js";
2
+ import "./chunk-5BYJMDCI.js";
3
+ import "./chunk-LXTA7DBA.js";
4
+ import "./chunk-PCATT4UZ.js";
5
+ import "./chunk-ZOVBWPWK.js";
6
+ import "./chunk-YTU3SCQO.js";
7
+ import "./chunk-GJ3NMGAT.js";
8
+ import "./chunk-QP2BI4DF.js";
9
+ import "./chunk-2TFEIJOG.js";
10
+ import "./chunk-KUGTKMNW.js";
11
+ import "./chunk-55OU7KJU.js";
12
+ import "./chunk-7Q5JNJJW.js";
13
+ import "./chunk-YGX4XO3M.js";
36
14
  import {
37
15
  ALL_TOOL_TARGETS,
38
16
  RulesyncTargetsSchema,
@@ -2549,125 +2527,51 @@ function parseMcpConfig(projectRoot) {
2549
2527
  }
2550
2528
 
2551
2529
  // src/core/mcp-generator.ts
2552
- async function generateMcpConfigs(projectRoot, baseDir, targetTools) {
2553
- const results = [];
2554
- const targetRoot = baseDir || projectRoot;
2555
- const config = parseMcpConfig(projectRoot);
2556
- if (!config) {
2557
- return results;
2558
- }
2559
- const generators = [
2560
- {
2561
- tool: "augmentcode-project",
2562
- path: path4.join(targetRoot, ".mcp.json"),
2563
- generate: () => generateAugmentcodeMcp(config)
2564
- },
2565
- {
2566
- tool: "augmentcode-legacy-project",
2567
- path: path4.join(targetRoot, ".mcp.json"),
2568
- generate: () => generateAugmentcodeMcp(config)
2569
- },
2570
- {
2571
- tool: "claude-project",
2572
- path: path4.join(targetRoot, ".mcp.json"),
2573
- generate: () => generateClaudeMcp(config)
2574
- },
2575
- {
2576
- tool: "copilot-editor",
2577
- path: path4.join(targetRoot, ".vscode", "mcp.json"),
2578
- generate: () => generateCopilotMcp(config, "editor")
2579
- },
2580
- {
2581
- tool: "cursor-project",
2582
- path: path4.join(targetRoot, ".cursor", "mcp.json"),
2583
- generate: () => generateCursorMcp(config)
2584
- },
2585
- {
2586
- tool: "cline-project",
2587
- path: path4.join(targetRoot, ".cline", "mcp.json"),
2588
- generate: () => generateClineMcp(config)
2589
- },
2590
- {
2591
- tool: "codexcli-project",
2592
- path: path4.join(targetRoot, ".codex", "mcp-config.json"),
2593
- generate: () => generateCodexMcp(config)
2594
- },
2595
- {
2596
- tool: "gemini-project",
2597
- path: path4.join(targetRoot, ".gemini", "settings.json"),
2598
- generate: () => generateGeminiCliMcp(config)
2599
- },
2600
- {
2601
- tool: "junie-project",
2602
- path: path4.join(targetRoot, ".junie", "mcp-config.json"),
2603
- generate: () => generateJunieMcp(config)
2604
- },
2605
- {
2606
- tool: "kiro-project",
2607
- path: path4.join(targetRoot, ".kiro", "mcp.json"),
2608
- generate: () => generateKiroMcp(config)
2609
- },
2610
- {
2611
- tool: "roo-project",
2612
- path: path4.join(targetRoot, ".roo", "mcp.json"),
2613
- generate: () => generateRooMcp(config)
2614
- },
2615
- {
2616
- tool: "windsurf-project",
2617
- path: path4.join(targetRoot, "mcp_config.json"),
2618
- generate: () => generateWindsurfMcp(config)
2619
- }
2620
- ];
2621
- const filteredGenerators = targetTools ? generators.filter((g) => {
2622
- const baseTool = g.tool.split("-")[0];
2623
- if (!isToolTarget(baseTool)) {
2624
- return false;
2625
- }
2626
- if (baseTool === "augmentcode") {
2627
- return targetTools.includes("augmentcode") || targetTools.includes("augmentcode-legacy");
2628
- }
2629
- return targetTools.includes(baseTool);
2630
- }) : generators;
2631
- for (const generator of filteredGenerators) {
2632
- try {
2633
- const content = generator.generate();
2634
- const parsed = JSON.parse(content);
2635
- if (generator.tool.includes("augmentcode") || generator.tool.includes("claude") || generator.tool.includes("cline") || generator.tool.includes("codexcli") || generator.tool.includes("cursor") || generator.tool.includes("gemini") || generator.tool.includes("junie") || generator.tool.includes("kiro") || generator.tool.includes("roo") || generator.tool.includes("windsurf")) {
2636
- if (!parsed.mcpServers || Object.keys(parsed.mcpServers).length === 0) {
2637
- results.push({
2638
- tool: generator.tool,
2639
- path: generator.path,
2640
- status: "skipped"
2641
- });
2642
- continue;
2643
- }
2644
- } else if (generator.tool.includes("copilot")) {
2645
- const key = generator.tool.includes("codingAgent") ? "mcpServers" : "servers";
2646
- if (!parsed[key] || Object.keys(parsed[key]).length === 0) {
2647
- results.push({
2648
- tool: generator.tool,
2649
- path: generator.path,
2650
- status: "skipped"
2651
- });
2652
- continue;
2530
+ async function generateMcpConfigurations(mcpConfig, baseDir, targetTools) {
2531
+ const outputs = [];
2532
+ const toolMap = {
2533
+ augmentcode: async (servers, dir) => (await import("./augmentcode-HIZIQG2W.js")).generateAugmentcodeMcpConfiguration(
2534
+ servers,
2535
+ dir
2536
+ ),
2537
+ "augmentcode-legacy": async (servers, dir) => (await import("./augmentcode-HIZIQG2W.js")).generateAugmentcodeMcpConfiguration(
2538
+ servers,
2539
+ dir
2540
+ ),
2541
+ claudecode: async (servers, dir) => (await import("./claudecode-W56JJONQ.js")).generateClaudeMcpConfiguration(
2542
+ servers,
2543
+ dir
2544
+ ),
2545
+ copilot: async (servers, dir) => (await import("./copilot-MOR3HHJX.js")).generateCopilotMcpConfiguration(servers, dir),
2546
+ cursor: async (servers, dir) => (await import("./cursor-PT2RUL4U.js")).generateCursorMcpConfiguration(servers, dir),
2547
+ cline: async (servers, dir) => (await import("./cline-SEVFH54V.js")).generateClineMcpConfiguration(servers, dir),
2548
+ codexcli: async (servers, dir) => (await import("./codexcli-Q34DZAEO.js")).generateCodexMcpConfiguration(servers, dir),
2549
+ roo: async (servers, dir) => (await import("./roo-L3QTTIPO.js")).generateRooMcpConfiguration(servers, dir),
2550
+ geminicli: async (servers, dir) => (await import("./geminicli-AUNY2MDS.js")).generateGeminiCliMcpConfiguration(
2551
+ servers,
2552
+ dir
2553
+ ),
2554
+ kiro: async (servers, dir) => (await import("./kiro-YDHXY2MA.js")).generateKiroMcpConfiguration(servers, dir),
2555
+ junie: async (servers, dir) => (await import("./junie-YL5UL6FE.js")).generateJunieMcpConfiguration(servers, dir),
2556
+ windsurf: async (servers, dir) => (await import("./windsurf-RLTNFHLL.js")).generateWindsurfMcpConfiguration(
2557
+ servers,
2558
+ dir
2559
+ )
2560
+ };
2561
+ const tools = targetTools || Object.keys(toolMap).filter(isToolTarget);
2562
+ const seenPaths = /* @__PURE__ */ new Set();
2563
+ for (const tool of tools) {
2564
+ if (tool in toolMap) {
2565
+ const results = await toolMap[tool](mcpConfig.mcpServers || {}, baseDir);
2566
+ for (const result of results) {
2567
+ if (!seenPaths.has(result.filepath)) {
2568
+ seenPaths.add(result.filepath);
2569
+ outputs.push({ ...result, tool });
2653
2570
  }
2654
2571
  }
2655
- await writeFileContent(generator.path, content);
2656
- results.push({
2657
- tool: generator.tool,
2658
- path: generator.path,
2659
- status: "success"
2660
- });
2661
- } catch (error) {
2662
- results.push({
2663
- tool: generator.tool,
2664
- path: generator.path,
2665
- status: "error",
2666
- error: error instanceof Error ? error.message : String(error)
2667
- });
2668
2572
  }
2669
2573
  }
2670
- return results;
2574
+ return outputs;
2671
2575
  }
2672
2576
 
2673
2577
  // src/cli/commands/generate.ts
@@ -2812,25 +2716,35 @@ Generating configurations for base directory: ${baseDir}`);
2812
2716
  }
2813
2717
  let totalMcpOutputs = 0;
2814
2718
  for (const baseDir of baseDirs) {
2815
- const mcpResults = await generateMcpConfigs(
2816
- process.cwd(),
2817
- baseDir === process.cwd() ? void 0 : baseDir,
2818
- config.defaultTargets
2819
- );
2820
- if (mcpResults.length === 0) {
2821
- if (config.verbose) {
2822
- console.log(`No MCP configuration found for ${baseDir}`);
2719
+ try {
2720
+ const mcpConfig = parseMcpConfig(process.cwd());
2721
+ if (!mcpConfig || !mcpConfig.mcpServers || Object.keys(mcpConfig.mcpServers).length === 0) {
2722
+ if (config.verbose) {
2723
+ console.log(`No MCP configuration found for ${baseDir}`);
2724
+ }
2725
+ continue;
2823
2726
  }
2824
- continue;
2825
- }
2826
- for (const result of mcpResults) {
2827
- if (result.status === "success") {
2828
- console.log(`\u2705 Generated ${result.tool} MCP configuration: ${result.path}`);
2727
+ const mcpResults = await generateMcpConfigurations(
2728
+ mcpConfig,
2729
+ baseDir === process.cwd() ? "." : baseDir,
2730
+ config.defaultTargets
2731
+ );
2732
+ if (mcpResults.length === 0) {
2733
+ if (config.verbose) {
2734
+ console.log(`No MCP configurations generated for ${baseDir}`);
2735
+ }
2736
+ continue;
2737
+ }
2738
+ for (const result of mcpResults) {
2739
+ await writeFileContent(result.filepath, result.content);
2740
+ console.log(`\u2705 Generated ${result.tool} MCP configuration: ${result.filepath}`);
2829
2741
  totalMcpOutputs++;
2830
- } else if (result.status === "error") {
2831
- console.error(`\u274C Failed to generate ${result.tool} MCP configuration: ${result.error}`);
2832
- } else if (config.verbose && result.status === "skipped") {
2833
- console.log(`\u23ED\uFE0F Skipped ${result.tool} MCP configuration (no servers configured)`);
2742
+ }
2743
+ } catch (error) {
2744
+ if (config.verbose) {
2745
+ console.error(
2746
+ `\u274C Failed to generate MCP configurations: ${error instanceof Error ? error.message : String(error)}`
2747
+ );
2834
2748
  }
2835
2749
  }
2836
2750
  }
@@ -4192,7 +4106,7 @@ async function watchCommand() {
4192
4106
 
4193
4107
  // src/cli/index.ts
4194
4108
  var program = new Command();
4195
- program.name("rulesync").description("Unified AI rules management CLI tool").version("0.58.0");
4109
+ program.name("rulesync").description("Unified AI rules management CLI tool").version("0.60.0");
4196
4110
  program.command("init").description("Initialize rulesync in current directory").action(initCommand);
4197
4111
  program.command("add <filename>").description("Add a new rule file").action(addCommand);
4198
4112
  program.command("gitignore").description("Add generated files to .gitignore").action(gitignoreCommand);
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generateJunieMcp,
3
3
  generateJunieMcpConfiguration
4
- } from "./chunk-VNT6AHHO.js";
5
- import "./chunk-J3TBR5EP.js";
4
+ } from "./chunk-5BYJMDCI.js";
5
+ import "./chunk-YGX4XO3M.js";
6
6
  import "./chunk-AUUSMVCT.js";
7
7
  export {
8
8
  generateJunieMcp,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generateWindsurfMcp,
3
3
  generateWindsurfMcpConfiguration
4
- } from "./chunk-7E4U4YAB.js";
5
- import "./chunk-J3TBR5EP.js";
4
+ } from "./chunk-ZOVBWPWK.js";
5
+ import "./chunk-YGX4XO3M.js";
6
6
  import "./chunk-AUUSMVCT.js";
7
7
  export {
8
8
  generateWindsurfMcp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rulesync",
3
- "version": "0.58.0",
3
+ "version": "0.60.0",
4
4
  "description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
5
5
  "keywords": [
6
6
  "ai",
@@ -60,6 +60,7 @@
60
60
  "eslint-plugin-no-type-assertion": "1.3.0",
61
61
  "eslint-plugin-oxlint": "1.11.2",
62
62
  "eslint-plugin-zod-import": "0.3.0",
63
+ "knip": "5.62.0",
63
64
  "lint-staged": "16.1.5",
64
65
  "o3-search-mcp": "0.0.7",
65
66
  "oxlint": "1.11.2",
@@ -89,6 +90,7 @@
89
90
  "eslint:fix": "eslint . --fix --max-warnings 0 --cache",
90
91
  "fix": "pnpm run bcheck:fix && pnpm run oxlint:fix && pnpm run eslint:fix",
91
92
  "generate": "pnpm run dev generate",
93
+ "knip": "knip",
92
94
  "oxlint": "oxlint . --max-warnings 0",
93
95
  "oxlint:fix": "oxlint . --fix --max-warnings 0",
94
96
  "secretlint": "secretlint --secretlintignore .gitignore \"**/*\"",