rulesync 9.0.0 → 9.0.2

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/types/features.ts","../src/types/tool-target-tuples.ts","../src/types/tool-targets.ts","../src/lib/convert.ts","../src/types/ai-dir.ts","../src/features/skills/rulesync-skill.ts","../src/lib/generate.ts","../src/lib/import.ts","../src/index.ts"],"mappings":";;;cAEa,YAAA;AAAA,cAaP,aAAA,EAAa,CAAA,CAAA,WAAA;;;;;;;;;;KAEP,OAAA,GAAU,CAAA,CAAE,KAAK,QAAQ,aAAA;;;cC8NxB,sBAAA;;;KCrOR,aAAA,WAAwB,sBAAsB;AAAA,cAEtC,gBAAA,YAA4B,aAAA,KAAkB,aAAa;AAAA,cAM3D,gBAAA,EAAgB,CAAA,CAAA,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEjB,UAAA,GAAa,CAAA,CAAE,KAAK,QAAQ,gBAAA;;;KCP5B,aAAA;EACV,UAAA;EACA,WAAA;EACA,QAAA;EACA,aAAA;EACA,cAAA;EACA,WAAA;EACA,UAAA;EACA,gBAAA;AAAA;;;KCjBU,gBAAA;EAEN,OAAA;EACA,KAAA;AAAA;EAGA,OAAA;EACA,KAAA,EAAO,KAAK;AAAA;AAAA,KAGN,SAAA;EACV,yBAAA;EACA,UAAA,EAAY,MAAM;AAAA;AAAA,KAGR,WAAA;EACV,UAAA;EACA,eAAA;EACA,OAAA;EACA,QAAA;IACE,IAAA;IACA,IAAA;IACA,WAAA,GAAc,MAAA;EAAA;EAEhB,UAAA,GAAa,SAAS;EACtB,MAAA;AAAA;AAAA,KAGU,kBAAA,GAAqB,IAAI,CACnC,WAAA;AAAA,uBAIoB,KAAA;EJpBH;;;EAAA,mBIwBE,UAAA;EJxBG;;;EAAA,mBI6BH,eAAA;;;;qBAKA,OAAA;EHqMX;;;EAAA,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AAA;AAAA;AAAA,KAGD,cAAA,GAAiB,WAAA;EAC3B,IAAA,EAAM,UAAA;EACN,EAAA,EAAI,UAAA;EACJ,QAAA,GAAW,OAAA;EACX,MAAA;AAAA;AAAA,iBAGoB,QAAA,CAAS,OAAA,GAAS,eAAA,GAAuB,OAAA,CAAQ,cAAA;AAAA,iBAqBjD,cAAA,CAAe,OAAA,EAAS,aAAA,GAAgB,OAAA,CAAQ,YAAA;AAAA,iBAehD,eAAA,CAAgB,OAAA,EAAS,cAAA,GAAiB,OAAA,CAAQ,aAAA"}
package/dist/index.js CHANGED
@@ -1,69 +1,65 @@
1
- import {
2
- ALL_FEATURES,
3
- ALL_TOOL_TARGETS,
4
- ConfigResolver,
5
- ConsoleLogger,
6
- checkRulesyncDirExists,
7
- convertFromTool,
8
- generate,
9
- importFromTool
10
- } from "./chunk-JT4BB5RE.js";
11
-
12
- // src/index.ts
13
- async function generate2(options = {}) {
14
- const { silent = true, verbose = false, ...rest } = options;
15
- const logger = new ConsoleLogger({ verbose, silent });
16
- const config = await ConfigResolver.resolve({
17
- ...rest,
18
- verbose,
19
- silent
20
- });
21
- const inputRoot = config.getInputRoot();
22
- if (!await checkRulesyncDirExists({ inputRoot })) {
23
- throw new Error(`.rulesync directory not found in '${inputRoot}'. Run 'rulesync init' first.`);
24
- }
25
- return generate({ config, logger });
1
+ import { Ut as ALL_FEATURES, Y as ConfigResolver, Z as ConsoleLogger, _t as ALL_TOOL_TARGETS, i as convertFromTool$1, n as checkRulesyncDirExists, r as generate$1, t as importFromTool$1 } from "./import-zmpFGK87.js";
2
+ //#region src/index.ts
3
+ async function generate(options = {}) {
4
+ const { silent = true, verbose = false, ...rest } = options;
5
+ const logger = new ConsoleLogger({
6
+ verbose,
7
+ silent
8
+ });
9
+ const config = await ConfigResolver.resolve({
10
+ ...rest,
11
+ verbose,
12
+ silent
13
+ });
14
+ const inputRoot = config.getInputRoot();
15
+ if (!await checkRulesyncDirExists({ inputRoot })) throw new Error(`.rulesync directory not found in '${inputRoot}'. Run 'rulesync init' first.`);
16
+ return generate$1({
17
+ config,
18
+ logger
19
+ });
26
20
  }
27
- async function importFromTool2(options) {
28
- const { target, features, silent = true, verbose = false, ...rest } = options;
29
- const logger = new ConsoleLogger({ verbose, silent });
30
- const config = await ConfigResolver.resolve({
31
- ...rest,
32
- targets: [target],
33
- features,
34
- verbose,
35
- silent
36
- });
37
- return importFromTool({ config, tool: target, logger });
21
+ async function importFromTool(options) {
22
+ const { target, features, silent = true, verbose = false, ...rest } = options;
23
+ const logger = new ConsoleLogger({
24
+ verbose,
25
+ silent
26
+ });
27
+ return importFromTool$1({
28
+ config: await ConfigResolver.resolve({
29
+ ...rest,
30
+ targets: [target],
31
+ features,
32
+ verbose,
33
+ silent
34
+ }),
35
+ tool: target,
36
+ logger
37
+ });
38
38
  }
39
- async function convertFromTool2(options) {
40
- const { from, to, features, silent = true, verbose = false, ...rest } = options;
41
- if (!from) {
42
- throw new Error("from is required. Please specify a source tool to convert from.");
43
- }
44
- if (!to || to.length === 0) {
45
- throw new Error("to is required and must not be empty. Please specify destination tools.");
46
- }
47
- const toTools = Array.from(new Set(to));
48
- if (toTools.includes(from)) {
49
- throw new Error(
50
- `Destination tools must not include the source tool '${from}'. Converting a tool onto itself is likely a mistake and may cause lossy round-trips.`
51
- );
52
- }
53
- const logger = new ConsoleLogger({ verbose, silent });
54
- const config = await ConfigResolver.resolve({
55
- ...rest,
56
- targets: [from],
57
- features: features ?? ["*"],
58
- verbose,
59
- silent
60
- });
61
- return convertFromTool({ config, fromTool: from, toTools, logger });
39
+ async function convertFromTool(options) {
40
+ const { from, to, features, silent = true, verbose = false, ...rest } = options;
41
+ if (!from) throw new Error("from is required. Please specify a source tool to convert from.");
42
+ if (!to || to.length === 0) throw new Error("to is required and must not be empty. Please specify destination tools.");
43
+ const toTools = Array.from(new Set(to));
44
+ if (toTools.includes(from)) throw new Error(`Destination tools must not include the source tool '${from}'. Converting a tool onto itself is likely a mistake and may cause lossy round-trips.`);
45
+ const logger = new ConsoleLogger({
46
+ verbose,
47
+ silent
48
+ });
49
+ return convertFromTool$1({
50
+ config: await ConfigResolver.resolve({
51
+ ...rest,
52
+ targets: [from],
53
+ features: features ?? ["*"],
54
+ verbose,
55
+ silent
56
+ }),
57
+ fromTool: from,
58
+ toTools,
59
+ logger
60
+ });
62
61
  }
63
- export {
64
- ALL_FEATURES,
65
- ALL_TOOL_TARGETS,
66
- convertFromTool2 as convertFromTool,
67
- generate2 as generate,
68
- importFromTool2 as importFromTool
69
- };
62
+ //#endregion
63
+ export { ALL_FEATURES, ALL_TOOL_TARGETS, convertFromTool, generate, importFromTool };
64
+
65
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["coreGenerate","coreImportFromTool","coreConvertFromTool"],"sources":["../src/index.ts"],"sourcesContent":["import { ConfigResolver } from \"./config/config-resolver.js\";\nimport { convertFromTool as coreConvertFromTool, type ConvertResult } from \"./lib/convert.js\";\nimport {\n checkRulesyncDirExists,\n generate as coreGenerate,\n type GenerateResult,\n} from \"./lib/generate.js\";\nimport { importFromTool as coreImportFromTool, type ImportResult } from \"./lib/import.js\";\nimport type { Feature } from \"./types/features.js\";\nimport type { ToolTarget } from \"./types/tool-targets.js\";\nimport { ConsoleLogger } from \"./utils/logger.js\";\n\nexport type { Feature } from \"./types/features.js\";\nexport type { ToolTarget } from \"./types/tool-targets.js\";\nexport { ALL_FEATURES } from \"./types/features.js\";\nexport { ALL_TOOL_TARGETS } from \"./types/tool-targets.js\";\nexport type { GenerateResult } from \"./lib/generate.js\";\nexport type { ImportResult } from \"./lib/import.js\";\nexport type { ConvertResult } from \"./lib/convert.js\";\n\ntype BaseOptions = {\n configPath?: string;\n verbose?: boolean;\n silent?: boolean;\n global?: boolean;\n};\n\nexport type GenerateOptions = BaseOptions & {\n targets?: ToolTarget[];\n features?: Feature[];\n outputRoots?: string[];\n /**\n * Directory containing the `.rulesync/` source files. Defaults to the\n * current working directory at config-construction time. When set, output\n * is still written to each `outputRoots` entry; only the input source root\n * is redirected. Mirrors the CLI's `--input-root` option.\n */\n inputRoot?: string;\n delete?: boolean;\n simulateCommands?: boolean;\n simulateSubagents?: boolean;\n simulateSkills?: boolean;\n dryRun?: boolean;\n check?: boolean;\n};\n\nexport type ImportOptions = BaseOptions & {\n target: ToolTarget;\n features?: Feature[];\n};\n\nexport type ConvertOptions = BaseOptions & {\n from: ToolTarget;\n to: ToolTarget[];\n features?: Feature[];\n dryRun?: boolean;\n};\n\nexport async function generate(options: GenerateOptions = {}): Promise<GenerateResult> {\n const { silent = true, verbose = false, ...rest } = options;\n const logger = new ConsoleLogger({ verbose, silent });\n\n const config = await ConfigResolver.resolve({\n ...rest,\n verbose,\n silent,\n });\n\n // The pre-flight check probes the input source root rather than each\n // output root. This matches the CLI's behavior and the way features\n // load `.rulesync/**` content (always relative to `config.getInputRoot()`).\n const inputRoot = config.getInputRoot();\n if (!(await checkRulesyncDirExists({ inputRoot }))) {\n throw new Error(`.rulesync directory not found in '${inputRoot}'. Run 'rulesync init' first.`);\n }\n\n return coreGenerate({ config, logger });\n}\n\nexport async function importFromTool(options: ImportOptions): Promise<ImportResult> {\n const { target, features, silent = true, verbose = false, ...rest } = options;\n const logger = new ConsoleLogger({ verbose, silent });\n\n const config = await ConfigResolver.resolve({\n ...rest,\n targets: [target],\n features,\n verbose,\n silent,\n });\n\n return coreImportFromTool({ config, tool: target, logger });\n}\n\nexport async function convertFromTool(options: ConvertOptions): Promise<ConvertResult> {\n const { from, to, features, silent = true, verbose = false, ...rest } = options;\n\n if (!from) {\n throw new Error(\"from is required. Please specify a source tool to convert from.\");\n }\n\n if (!to || to.length === 0) {\n throw new Error(\"to is required and must not be empty. Please specify destination tools.\");\n }\n\n const toTools = Array.from(new Set(to));\n\n if (toTools.includes(from)) {\n throw new Error(\n `Destination tools must not include the source tool '${from}'. ` +\n `Converting a tool onto itself is likely a mistake and may cause lossy round-trips.`,\n );\n }\n\n const logger = new ConsoleLogger({ verbose, silent });\n\n // NOTE: The CLI and MCP wrappers pass `[from, ...to]` as `targets` so that\n // per-target feature overrides in `rulesync.jsonc` apply to destinations too.\n // The JS API intentionally passes only `[from]` here because the public\n // contract for `convertFromTool` (issue #1557) prescribes this shape:\n // programmatic callers are expected to supply `features` explicitly when\n // they need fine-grained control, rather than relying on config-file\n // per-target maps. Defaulting `features` to `[\"*\"]` below matches the CLI's\n // \"attempt every feature both tools support\" behavior so callers who omit\n // `features` get the same effective coverage as the CLI.\n const config = await ConfigResolver.resolve({\n ...rest,\n targets: [from],\n features: features ?? [\"*\"],\n verbose,\n silent,\n });\n\n return coreConvertFromTool({ config, fromTool: from, toTools, logger });\n}\n"],"mappings":";;AA0DA,eAAsB,SAAS,UAA2B,CAAC,GAA4B;CACrF,MAAM,EAAE,SAAS,MAAM,UAAU,OAAO,GAAG,SAAS;CACpD,MAAM,SAAS,IAAI,cAAc;EAAE;EAAS;CAAO,CAAC;CAEpD,MAAM,SAAS,MAAM,eAAe,QAAQ;EAC1C,GAAG;EACH;EACA;CACF,CAAC;CAKD,MAAM,YAAY,OAAO,aAAa;CACtC,IAAI,CAAE,MAAM,uBAAuB,EAAE,UAAU,CAAC,GAC9C,MAAM,IAAI,MAAM,qCAAqC,UAAU,8BAA8B;CAG/F,OAAOA,WAAa;EAAE;EAAQ;CAAO,CAAC;AACxC;AAEA,eAAsB,eAAe,SAA+C;CAClF,MAAM,EAAE,QAAQ,UAAU,SAAS,MAAM,UAAU,OAAO,GAAG,SAAS;CACtE,MAAM,SAAS,IAAI,cAAc;EAAE;EAAS;CAAO,CAAC;CAUpD,OAAOC,iBAAmB;EAAE,QAAA,MARP,eAAe,QAAQ;GAC1C,GAAG;GACH,SAAS,CAAC,MAAM;GAChB;GACA;GACA;EACF,CAAC;EAEmC,MAAM;EAAQ;CAAO,CAAC;AAC5D;AAEA,eAAsB,gBAAgB,SAAiD;CACrF,MAAM,EAAE,MAAM,IAAI,UAAU,SAAS,MAAM,UAAU,OAAO,GAAG,SAAS;CAExE,IAAI,CAAC,MACH,MAAM,IAAI,MAAM,iEAAiE;CAGnF,IAAI,CAAC,MAAM,GAAG,WAAW,GACvB,MAAM,IAAI,MAAM,yEAAyE;CAG3F,MAAM,UAAU,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;CAEtC,IAAI,QAAQ,SAAS,IAAI,GACvB,MAAM,IAAI,MACR,uDAAuD,KAAK,sFAE9D;CAGF,MAAM,SAAS,IAAI,cAAc;EAAE;EAAS;CAAO,CAAC;CAmBpD,OAAOC,kBAAoB;EAAE,QAAA,MARR,eAAe,QAAQ;GAC1C,GAAG;GACH,SAAS,CAAC,IAAI;GACd,UAAU,YAAY,CAAC,GAAG;GAC1B;GACA;EACF,CAAC;EAEoC,UAAU;EAAM;EAAS;CAAO,CAAC;AACxE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rulesync",
3
- "version": "9.0.0",
3
+ "version": "9.0.2",
4
4
  "description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
5
5
  "keywords": [
6
6
  "ai",
@@ -85,7 +85,7 @@
85
85
  "simple-git": "3.36.0",
86
86
  "simple-git-hooks": "2.13.1",
87
87
  "sort-package-json": "4.0.0",
88
- "tsup": "8.5.1",
88
+ "tsdown": "0.22.3",
89
89
  "tsx": "4.22.4",
90
90
  "typescript": "6.0.3",
91
91
  "vite": "8.0.16",
@@ -100,7 +100,7 @@
100
100
  "access": "public"
101
101
  },
102
102
  "scripts": {
103
- "build": "tsup src/cli/index.ts src/index.ts --format cjs,esm --dts --clean",
103
+ "build": "tsdown",
104
104
  "check": "pnpm run fmt:check && pnpm run oxlint && pnpm run typecheck",
105
105
  "check:gitignore": "pnpm run dev gitignore && git diff --exit-code .gitignore .gitattributes",
106
106
  "check:supported-tools": "tsx scripts/generate-supported-tools-tables.ts && git diff --exit-code README.md docs/reference/supported-tools.md",