rulesync 9.6.0 → 9.6.1

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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const require_import = require("../import-CiS5ckUo.cjs");
2
+ const require_import = require("../import-DW-a1SJq.cjs");
3
3
  let commander = require("commander");
4
4
  let zod_mini = require("zod/mini");
5
5
  let node_path = require("node:path");
@@ -1563,12 +1563,13 @@ const gitignoreCommand = async (logger, options) => {
1563
1563
  const gitignorePath = (0, node_path.join)(process.cwd(), ".gitignore");
1564
1564
  const gitattributesPath = (0, node_path.join)(process.cwd(), ".gitattributes");
1565
1565
  const config = await require_import.ConfigResolver.resolve({});
1566
+ const resolvedEntries = resolveGitignoreEntries({
1567
+ targets: options?.targets,
1568
+ features: options?.features,
1569
+ logger
1570
+ });
1566
1571
  const { gitignore: gitignoreEntries, gitattributes: gitattributesEntries } = groupEntriesByDestination({
1567
- entries: resolveGitignoreEntries({
1568
- targets: options?.targets,
1569
- features: options?.features,
1570
- logger
1571
- }),
1572
+ entries: resolvedEntries,
1572
1573
  resolveDestination: (target, feature) => {
1573
1574
  if (feature === void 0 || feature === "general") return config.getGitignoreDestination(target);
1574
1575
  return config.getGitignoreDestination(target, feature);
@@ -2562,11 +2563,14 @@ function injectSourceMetadata(params) {
2562
2563
  if (content.startsWith(`${FRONTMATTER_FENCE}\r\n`)) openFenceLen = 5;
2563
2564
  else if (content.startsWith(`${FRONTMATTER_FENCE}\n`)) openFenceLen = 4;
2564
2565
  else if (content === FRONTMATTER_FENCE) openFenceLen = 3;
2565
- else return `${FRONTMATTER_FENCE}\n${(0, js_yaml.dump)(provenance, {
2566
- noRefs: true,
2567
- lineWidth: -1,
2568
- sortKeys: false
2569
- })}${FRONTMATTER_FENCE}\n${content}`;
2566
+ else {
2567
+ const yaml = (0, js_yaml.dump)(provenance, {
2568
+ noRefs: true,
2569
+ lineWidth: -1,
2570
+ sortKeys: false
2571
+ });
2572
+ return `${FRONTMATTER_FENCE}\n${yaml}${FRONTMATTER_FENCE}\n${content}`;
2573
+ }
2570
2574
  const afterOpen = content.substring(openFenceLen);
2571
2575
  let fmBody;
2572
2576
  let rest;
@@ -2586,20 +2590,24 @@ function injectSourceMetadata(params) {
2586
2590
  } catch {
2587
2591
  throw new Error("invalid frontmatter");
2588
2592
  }
2589
- if (loaded === null || loaded === void 0) return `${FRONTMATTER_FENCE}\n${(0, js_yaml.dump)(provenance, {
2590
- noRefs: true,
2591
- lineWidth: -1,
2592
- sortKeys: false
2593
- })}${FRONTMATTER_FENCE}\n${rest}`;
2593
+ if (loaded === null || loaded === void 0) {
2594
+ const yaml = (0, js_yaml.dump)(provenance, {
2595
+ noRefs: true,
2596
+ lineWidth: -1,
2597
+ sortKeys: false
2598
+ });
2599
+ return `${FRONTMATTER_FENCE}\n${yaml}${FRONTMATTER_FENCE}\n${rest}`;
2600
+ }
2594
2601
  if (typeof loaded !== "object" || Array.isArray(loaded)) throw new Error("invalid frontmatter");
2595
- return `${FRONTMATTER_FENCE}\n${(0, js_yaml.dump)({
2602
+ const yaml = (0, js_yaml.dump)({
2596
2603
  ...loaded,
2597
2604
  ...provenance
2598
2605
  }, {
2599
2606
  noRefs: true,
2600
2607
  lineWidth: -1,
2601
2608
  sortKeys: false
2602
- })}${FRONTMATTER_FENCE}\n${rest}`;
2609
+ });
2610
+ return `${FRONTMATTER_FENCE}\n${yaml}${FRONTMATTER_FENCE}\n${rest}`;
2603
2611
  }
2604
2612
  //#endregion
2605
2613
  //#region src/lib/gh/gh-lock.ts
@@ -6453,7 +6461,7 @@ function wrapCommand$1({ name, errorCode, handler, getVersion, loggerFactory = c
6453
6461
  }
6454
6462
  //#endregion
6455
6463
  //#region src/cli/index.ts
6456
- const getVersion = () => "9.6.0";
6464
+ const getVersion = () => "9.6.1";
6457
6465
  function wrapCommand(name, errorCode, handler) {
6458
6466
  return wrapCommand$1({
6459
6467
  name,
package/dist/cli/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { $ as removeTempDirectory, A as RulesyncCommand, B as checkPathTraversal, C as RulesyncHooks, Ct as RULESYNC_RULES_RELATIVE_DIR_PATH, D as CLAUDECODE_MEMORIES_DIR_NAME, Dt as formatError, E as CLAUDECODE_LOCAL_RULE_FILE_NAME, Et as RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, F as findControlCharacter, G as findFilesByGlobs, H as directoryExists, I as ConsoleLogger, J as isSymlink, K as getFileSize, L as JsonLogger, M as stringifyFrontmatter, N as loadYaml, O as CLAUDECODE_SETTINGS_LOCAL_FILE_NAME, Ot as ALL_FEATURES, P as ConfigResolver, Q as removeFile, R as CLIError, S as HooksProcessor, St as RULESYNC_RELATIVE_DIR_PATH, T as CLAUDECODE_DIR, Tt as RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH, U as ensureDir, V as createTempDirectory, W as fileExists, X as readFileContent, Y as listDirectoryFiles, Z as removeDirectory, _ as RulesyncPermissions, _t as RULESYNC_MCP_RELATIVE_FILE_PATH, a as convertFromTool, at as MAX_FILE_SIZE, b as IgnoreProcessor, bt as RULESYNC_PERMISSIONS_FILE_NAME, c as RulesyncRuleFrontmatterSchema, ct as RULESYNC_COMMANDS_RELATIVE_DIR_PATH, d as RulesyncSubagentFrontmatterSchema, dt as RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH, et as toPosixPath, f as SkillsProcessor, ft as RULESYNC_HOOKS_FILE_NAME, g as SKILL_FILE_NAME$1, gt as RULESYNC_MCP_FILE_NAME, h as RulesyncSkillFrontmatterSchema, ht as RULESYNC_LOCAL_CONFIG_RELATIVE_FILE_PATH, i as getProcessorRegistryEntry, it as ToolTargetSchema, j as RulesyncCommandFrontmatterSchema, k as CLAUDECODE_SKILLS_DIR_PATH, kt as ALL_FEATURES_WITH_WILDCARD, l as SubagentsProcessor, lt as RULESYNC_CONFIG_RELATIVE_FILE_PATH, m as RulesyncSkill, mt as RULESYNC_IGNORE_RELATIVE_FILE_PATH, n as checkRulesyncDirExists, nt as ALL_TOOL_TARGETS, o as RulesProcessor, ot as RULESYNC_AIIGNORE_FILE_NAME, p as getLocalSkillDirNames, pt as RULESYNC_HOOKS_RELATIVE_FILE_PATH, q as getHomeDirectory, r as generate, rt as ALL_TOOL_TARGETS_WITH_WILDCARD, s as RulesyncRule, st as RULESYNC_AIIGNORE_RELATIVE_FILE_PATH, t as importFromTool, tt as writeFileContent, u as RulesyncSubagent, ut as RULESYNC_CONFIG_SCHEMA_URL, v as McpProcessor, vt as RULESYNC_MCP_SCHEMA_URL, w as CommandsProcessor, wt as RULESYNC_SKILLS_RELATIVE_DIR_PATH, x as RulesyncIgnore, xt as RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH, y as RulesyncMcp, yt as RULESYNC_OVERVIEW_FILE_NAME, z as ErrorCodes } from "../import-B6nwZmGl.js";
2
+ import { $ as removeTempDirectory, A as RulesyncCommand, B as checkPathTraversal, C as RulesyncHooks, Ct as RULESYNC_RULES_RELATIVE_DIR_PATH, D as CLAUDECODE_MEMORIES_DIR_NAME, Dt as formatError, E as CLAUDECODE_LOCAL_RULE_FILE_NAME, Et as RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, F as findControlCharacter, G as findFilesByGlobs, H as directoryExists, I as ConsoleLogger, J as isSymlink, K as getFileSize, L as JsonLogger, M as stringifyFrontmatter, N as loadYaml, O as CLAUDECODE_SETTINGS_LOCAL_FILE_NAME, Ot as ALL_FEATURES, P as ConfigResolver, Q as removeFile, R as CLIError, S as HooksProcessor, St as RULESYNC_RELATIVE_DIR_PATH, T as CLAUDECODE_DIR, Tt as RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH, U as ensureDir, V as createTempDirectory, W as fileExists, X as readFileContent, Y as listDirectoryFiles, Z as removeDirectory, _ as RulesyncPermissions, _t as RULESYNC_MCP_RELATIVE_FILE_PATH, a as convertFromTool, at as MAX_FILE_SIZE, b as IgnoreProcessor, bt as RULESYNC_PERMISSIONS_FILE_NAME, c as RulesyncRuleFrontmatterSchema, ct as RULESYNC_COMMANDS_RELATIVE_DIR_PATH, d as RulesyncSubagentFrontmatterSchema, dt as RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH, et as toPosixPath, f as SkillsProcessor, ft as RULESYNC_HOOKS_FILE_NAME, g as SKILL_FILE_NAME$1, gt as RULESYNC_MCP_FILE_NAME, h as RulesyncSkillFrontmatterSchema, ht as RULESYNC_LOCAL_CONFIG_RELATIVE_FILE_PATH, i as getProcessorRegistryEntry, it as ToolTargetSchema, j as RulesyncCommandFrontmatterSchema, k as CLAUDECODE_SKILLS_DIR_PATH, kt as ALL_FEATURES_WITH_WILDCARD, l as SubagentsProcessor, lt as RULESYNC_CONFIG_RELATIVE_FILE_PATH, m as RulesyncSkill, mt as RULESYNC_IGNORE_RELATIVE_FILE_PATH, n as checkRulesyncDirExists, nt as ALL_TOOL_TARGETS, o as RulesProcessor, ot as RULESYNC_AIIGNORE_FILE_NAME, p as getLocalSkillDirNames, pt as RULESYNC_HOOKS_RELATIVE_FILE_PATH, q as getHomeDirectory, r as generate, rt as ALL_TOOL_TARGETS_WITH_WILDCARD, s as RulesyncRule, st as RULESYNC_AIIGNORE_RELATIVE_FILE_PATH, t as importFromTool, tt as writeFileContent, u as RulesyncSubagent, ut as RULESYNC_CONFIG_SCHEMA_URL, v as McpProcessor, vt as RULESYNC_MCP_SCHEMA_URL, w as CommandsProcessor, wt as RULESYNC_SKILLS_RELATIVE_DIR_PATH, x as RulesyncIgnore, xt as RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH, y as RulesyncMcp, yt as RULESYNC_OVERVIEW_FILE_NAME, z as ErrorCodes } from "../import-tTMN0WRi.js";
3
3
  import { Command } from "commander";
4
4
  import { nonnegative, optional, refine, z } from "zod/mini";
5
5
  import * as path$1 from "node:path";
@@ -1561,12 +1561,13 @@ const gitignoreCommand = async (logger, options) => {
1561
1561
  const gitignorePath = join(process.cwd(), ".gitignore");
1562
1562
  const gitattributesPath = join(process.cwd(), ".gitattributes");
1563
1563
  const config = await ConfigResolver.resolve({});
1564
+ const resolvedEntries = resolveGitignoreEntries({
1565
+ targets: options?.targets,
1566
+ features: options?.features,
1567
+ logger
1568
+ });
1564
1569
  const { gitignore: gitignoreEntries, gitattributes: gitattributesEntries } = groupEntriesByDestination({
1565
- entries: resolveGitignoreEntries({
1566
- targets: options?.targets,
1567
- features: options?.features,
1568
- logger
1569
- }),
1570
+ entries: resolvedEntries,
1570
1571
  resolveDestination: (target, feature) => {
1571
1572
  if (feature === void 0 || feature === "general") return config.getGitignoreDestination(target);
1572
1573
  return config.getGitignoreDestination(target, feature);
@@ -2560,11 +2561,14 @@ function injectSourceMetadata(params) {
2560
2561
  if (content.startsWith(`${FRONTMATTER_FENCE}\r\n`)) openFenceLen = 5;
2561
2562
  else if (content.startsWith(`${FRONTMATTER_FENCE}\n`)) openFenceLen = 4;
2562
2563
  else if (content === FRONTMATTER_FENCE) openFenceLen = 3;
2563
- else return `${FRONTMATTER_FENCE}\n${dump(provenance, {
2564
- noRefs: true,
2565
- lineWidth: -1,
2566
- sortKeys: false
2567
- })}${FRONTMATTER_FENCE}\n${content}`;
2564
+ else {
2565
+ const yaml = dump(provenance, {
2566
+ noRefs: true,
2567
+ lineWidth: -1,
2568
+ sortKeys: false
2569
+ });
2570
+ return `${FRONTMATTER_FENCE}\n${yaml}${FRONTMATTER_FENCE}\n${content}`;
2571
+ }
2568
2572
  const afterOpen = content.substring(openFenceLen);
2569
2573
  let fmBody;
2570
2574
  let rest;
@@ -2584,20 +2588,24 @@ function injectSourceMetadata(params) {
2584
2588
  } catch {
2585
2589
  throw new Error("invalid frontmatter");
2586
2590
  }
2587
- if (loaded === null || loaded === void 0) return `${FRONTMATTER_FENCE}\n${dump(provenance, {
2588
- noRefs: true,
2589
- lineWidth: -1,
2590
- sortKeys: false
2591
- })}${FRONTMATTER_FENCE}\n${rest}`;
2591
+ if (loaded === null || loaded === void 0) {
2592
+ const yaml = dump(provenance, {
2593
+ noRefs: true,
2594
+ lineWidth: -1,
2595
+ sortKeys: false
2596
+ });
2597
+ return `${FRONTMATTER_FENCE}\n${yaml}${FRONTMATTER_FENCE}\n${rest}`;
2598
+ }
2592
2599
  if (typeof loaded !== "object" || Array.isArray(loaded)) throw new Error("invalid frontmatter");
2593
- return `${FRONTMATTER_FENCE}\n${dump({
2600
+ const yaml = dump({
2594
2601
  ...loaded,
2595
2602
  ...provenance
2596
2603
  }, {
2597
2604
  noRefs: true,
2598
2605
  lineWidth: -1,
2599
2606
  sortKeys: false
2600
- })}${FRONTMATTER_FENCE}\n${rest}`;
2607
+ });
2608
+ return `${FRONTMATTER_FENCE}\n${yaml}${FRONTMATTER_FENCE}\n${rest}`;
2601
2609
  }
2602
2610
  //#endregion
2603
2611
  //#region src/lib/gh/gh-lock.ts
@@ -6451,7 +6459,7 @@ function wrapCommand$1({ name, errorCode, handler, getVersion, loggerFactory = c
6451
6459
  }
6452
6460
  //#endregion
6453
6461
  //#region src/cli/index.ts
6454
- const getVersion = () => "9.6.0";
6462
+ const getVersion = () => "9.6.1";
6455
6463
  function wrapCommand(name, errorCode, handler) {
6456
6464
  return wrapCommand$1({
6457
6465
  name,