rulesync 8.12.0 → 8.13.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.d.cts CHANGED
@@ -70,7 +70,7 @@ type AiDirFile = {
70
70
  fileBuffer: Buffer;
71
71
  };
72
72
  type AiDirParams = {
73
- baseDir?: string;
73
+ outputRoot?: string;
74
74
  relativeDirPath: string;
75
75
  dirName: string;
76
76
  mainFile?: {
@@ -81,12 +81,12 @@ type AiDirParams = {
81
81
  otherFiles?: AiDirFile[];
82
82
  global?: boolean;
83
83
  };
84
- type AiDirFromDirParams = Pick<AiDirParams, "baseDir" | "relativeDirPath" | "dirName" | "global">;
84
+ type AiDirFromDirParams = Pick<AiDirParams, "outputRoot" | "relativeDirPath" | "dirName" | "global">;
85
85
  declare abstract class AiDir {
86
86
  /**
87
87
  * @example "."
88
88
  */
89
- protected readonly baseDir: string;
89
+ protected readonly outputRoot: string;
90
90
  /**
91
91
  * @example ".rulesync/skills"
92
92
  */
@@ -111,9 +111,9 @@ declare abstract class AiDir {
111
111
  * @example false
112
112
  */
113
113
  protected readonly global: boolean;
114
- constructor({ baseDir, relativeDirPath, dirName, mainFile, otherFiles, global, }: AiDirParams);
114
+ constructor({ outputRoot, relativeDirPath, dirName, mainFile, otherFiles, global, }: AiDirParams);
115
115
  static fromDir(_params: AiDirFromDirParams): Promise<AiDir>;
116
- getBaseDir(): string;
116
+ getOutputRoot(): string;
117
117
  getRelativeDirPath(): string;
118
118
  getDirName(): string;
119
119
  getDirPath(): string;
@@ -133,13 +133,13 @@ declare abstract class AiDir {
133
133
  * Recursively collects all files from a directory, excluding the specified main file.
134
134
  * This is a common utility for loading additional files alongside the main file.
135
135
  *
136
- * @param baseDir - The base directory path
136
+ * @param outputRoot - The base directory path
137
137
  * @param relativeDirPath - The relative path to the directory containing the skill
138
138
  * @param dirName - The name of the directory
139
139
  * @param excludeFileName - The name of the file to exclude (typically the main file)
140
140
  * @returns Array of files with their relative paths and buffers
141
141
  */
142
- protected static collectOtherFiles(baseDir: string, relativeDirPath: string, dirName: string, excludeFileName: string): Promise<AiDirFile[]>;
142
+ protected static collectOtherFiles(outputRoot: string, relativeDirPath: string, dirName: string, excludeFileName: string): Promise<AiDirFile[]>;
143
143
  abstract validate(): ValidationResult;
144
144
  }
145
145
 
@@ -236,7 +236,7 @@ type RulesyncSkillFrontmatterInput = {
236
236
  };
237
237
  type RulesyncSkillFrontmatter = z.infer<typeof RulesyncSkillFrontmatterSchemaInternal>;
238
238
  type RulesyncSkillParams = {
239
- baseDir?: string;
239
+ outputRoot?: string;
240
240
  relativeDirPath?: string;
241
241
  dirName: string;
242
242
  frontmatter: RulesyncSkillFrontmatterInput;
@@ -249,7 +249,7 @@ type RulesyncSkillSettablePaths = {
249
249
  relativeDirPath: string;
250
250
  };
251
251
  type RulesyncSkillFromDirParams = {
252
- baseDir?: string;
252
+ outputRoot?: string;
253
253
  relativeDirPath?: string;
254
254
  dirName: string;
255
255
  global?: boolean;
@@ -259,12 +259,12 @@ type RulesyncSkillFromDirParams = {
259
259
  * Extends AiDir to inherit directory management and security features.
260
260
  */
261
261
  declare class RulesyncSkill extends AiDir {
262
- constructor({ baseDir, relativeDirPath, dirName, frontmatter, body, otherFiles, validate, global, }: RulesyncSkillParams);
262
+ constructor({ outputRoot, relativeDirPath, dirName, frontmatter, body, otherFiles, validate, global, }: RulesyncSkillParams);
263
263
  static getSettablePaths(): RulesyncSkillSettablePaths;
264
264
  getFrontmatter(): RulesyncSkillFrontmatter;
265
265
  getBody(): string;
266
266
  validate(): ValidationResult;
267
- static fromDir({ baseDir, relativeDirPath, dirName, global, }: RulesyncSkillFromDirParams): Promise<RulesyncSkill>;
267
+ static fromDir({ outputRoot, relativeDirPath, dirName, global, }: RulesyncSkillFromDirParams): Promise<RulesyncSkill>;
268
268
  }
269
269
 
270
270
  type GenerateResult = {
@@ -308,7 +308,21 @@ type BaseOptions = {
308
308
  type GenerateOptions = BaseOptions & {
309
309
  targets?: ToolTarget[];
310
310
  features?: Feature[];
311
+ outputRoots?: string[];
312
+ /**
313
+ * @deprecated Use `outputRoots` instead. Accepted as a backward-compatible
314
+ * alias for the programmatic API; emits a one-shot deprecation warning when
315
+ * provided. When both `outputRoots` and `baseDirs` are supplied,
316
+ * `outputRoots` wins. Will be removed in a future major release.
317
+ */
311
318
  baseDirs?: string[];
319
+ /**
320
+ * Directory containing the `.rulesync/` source files. Defaults to the
321
+ * current working directory at config-construction time. When set, output
322
+ * is still written to each `outputRoots` entry; only the input source root
323
+ * is redirected. Mirrors the CLI's `--input-root` option.
324
+ */
325
+ inputRoot?: string;
312
326
  delete?: boolean;
313
327
  simulateCommands?: boolean;
314
328
  simulateSubagents?: boolean;
package/dist/index.d.ts CHANGED
@@ -70,7 +70,7 @@ type AiDirFile = {
70
70
  fileBuffer: Buffer;
71
71
  };
72
72
  type AiDirParams = {
73
- baseDir?: string;
73
+ outputRoot?: string;
74
74
  relativeDirPath: string;
75
75
  dirName: string;
76
76
  mainFile?: {
@@ -81,12 +81,12 @@ type AiDirParams = {
81
81
  otherFiles?: AiDirFile[];
82
82
  global?: boolean;
83
83
  };
84
- type AiDirFromDirParams = Pick<AiDirParams, "baseDir" | "relativeDirPath" | "dirName" | "global">;
84
+ type AiDirFromDirParams = Pick<AiDirParams, "outputRoot" | "relativeDirPath" | "dirName" | "global">;
85
85
  declare abstract class AiDir {
86
86
  /**
87
87
  * @example "."
88
88
  */
89
- protected readonly baseDir: string;
89
+ protected readonly outputRoot: string;
90
90
  /**
91
91
  * @example ".rulesync/skills"
92
92
  */
@@ -111,9 +111,9 @@ declare abstract class AiDir {
111
111
  * @example false
112
112
  */
113
113
  protected readonly global: boolean;
114
- constructor({ baseDir, relativeDirPath, dirName, mainFile, otherFiles, global, }: AiDirParams);
114
+ constructor({ outputRoot, relativeDirPath, dirName, mainFile, otherFiles, global, }: AiDirParams);
115
115
  static fromDir(_params: AiDirFromDirParams): Promise<AiDir>;
116
- getBaseDir(): string;
116
+ getOutputRoot(): string;
117
117
  getRelativeDirPath(): string;
118
118
  getDirName(): string;
119
119
  getDirPath(): string;
@@ -133,13 +133,13 @@ declare abstract class AiDir {
133
133
  * Recursively collects all files from a directory, excluding the specified main file.
134
134
  * This is a common utility for loading additional files alongside the main file.
135
135
  *
136
- * @param baseDir - The base directory path
136
+ * @param outputRoot - The base directory path
137
137
  * @param relativeDirPath - The relative path to the directory containing the skill
138
138
  * @param dirName - The name of the directory
139
139
  * @param excludeFileName - The name of the file to exclude (typically the main file)
140
140
  * @returns Array of files with their relative paths and buffers
141
141
  */
142
- protected static collectOtherFiles(baseDir: string, relativeDirPath: string, dirName: string, excludeFileName: string): Promise<AiDirFile[]>;
142
+ protected static collectOtherFiles(outputRoot: string, relativeDirPath: string, dirName: string, excludeFileName: string): Promise<AiDirFile[]>;
143
143
  abstract validate(): ValidationResult;
144
144
  }
145
145
 
@@ -236,7 +236,7 @@ type RulesyncSkillFrontmatterInput = {
236
236
  };
237
237
  type RulesyncSkillFrontmatter = z.infer<typeof RulesyncSkillFrontmatterSchemaInternal>;
238
238
  type RulesyncSkillParams = {
239
- baseDir?: string;
239
+ outputRoot?: string;
240
240
  relativeDirPath?: string;
241
241
  dirName: string;
242
242
  frontmatter: RulesyncSkillFrontmatterInput;
@@ -249,7 +249,7 @@ type RulesyncSkillSettablePaths = {
249
249
  relativeDirPath: string;
250
250
  };
251
251
  type RulesyncSkillFromDirParams = {
252
- baseDir?: string;
252
+ outputRoot?: string;
253
253
  relativeDirPath?: string;
254
254
  dirName: string;
255
255
  global?: boolean;
@@ -259,12 +259,12 @@ type RulesyncSkillFromDirParams = {
259
259
  * Extends AiDir to inherit directory management and security features.
260
260
  */
261
261
  declare class RulesyncSkill extends AiDir {
262
- constructor({ baseDir, relativeDirPath, dirName, frontmatter, body, otherFiles, validate, global, }: RulesyncSkillParams);
262
+ constructor({ outputRoot, relativeDirPath, dirName, frontmatter, body, otherFiles, validate, global, }: RulesyncSkillParams);
263
263
  static getSettablePaths(): RulesyncSkillSettablePaths;
264
264
  getFrontmatter(): RulesyncSkillFrontmatter;
265
265
  getBody(): string;
266
266
  validate(): ValidationResult;
267
- static fromDir({ baseDir, relativeDirPath, dirName, global, }: RulesyncSkillFromDirParams): Promise<RulesyncSkill>;
267
+ static fromDir({ outputRoot, relativeDirPath, dirName, global, }: RulesyncSkillFromDirParams): Promise<RulesyncSkill>;
268
268
  }
269
269
 
270
270
  type GenerateResult = {
@@ -308,7 +308,21 @@ type BaseOptions = {
308
308
  type GenerateOptions = BaseOptions & {
309
309
  targets?: ToolTarget[];
310
310
  features?: Feature[];
311
+ outputRoots?: string[];
312
+ /**
313
+ * @deprecated Use `outputRoots` instead. Accepted as a backward-compatible
314
+ * alias for the programmatic API; emits a one-shot deprecation warning when
315
+ * provided. When both `outputRoots` and `baseDirs` are supplied,
316
+ * `outputRoots` wins. Will be removed in a future major release.
317
+ */
311
318
  baseDirs?: string[];
319
+ /**
320
+ * Directory containing the `.rulesync/` source files. Defaults to the
321
+ * current working directory at config-construction time. When set, output
322
+ * is still written to each `outputRoots` entry; only the input source root
323
+ * is redirected. Mirrors the CLI's `--input-root` option.
324
+ */
325
+ inputRoot?: string;
312
326
  delete?: boolean;
313
327
  simulateCommands?: boolean;
314
328
  simulateSubagents?: boolean;
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  convertFromTool,
8
8
  generate,
9
9
  importFromTool
10
- } from "./chunk-643VJ2QM.js";
10
+ } from "./chunk-RLRAG4LZ.js";
11
11
 
12
12
  // src/index.ts
13
13
  async function generate2(options = {}) {
@@ -18,10 +18,9 @@ async function generate2(options = {}) {
18
18
  verbose,
19
19
  silent
20
20
  });
21
- for (const baseDir of config.getBaseDirs()) {
22
- if (!await checkRulesyncDirExists({ baseDir })) {
23
- throw new Error(`.rulesync directory not found in '${baseDir}'. Run 'rulesync init' first.`);
24
- }
21
+ const inputRoot = config.getInputRoot();
22
+ if (!await checkRulesyncDirExists({ inputRoot })) {
23
+ throw new Error(`.rulesync directory not found in '${inputRoot}'. Run 'rulesync init' first.`);
25
24
  }
26
25
  return generate({ config, logger });
27
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rulesync",
3
- "version": "8.12.0",
3
+ "version": "8.13.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",