rulesync 8.32.0 → 9.0.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/README.md +1 -4
- package/dist/{chunk-3SMTK3M3.js → chunk-JT4BB5RE.js} +1974 -4053
- package/dist/cli/index.cjs +2454 -4603
- package/dist/cli/index.js +12 -86
- package/dist/index.cjs +2000 -4077
- package/dist/index.d.cts +14 -25
- package/dist/index.d.ts +14 -25
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
ConsoleLogger,
|
|
17
17
|
ErrorCodes,
|
|
18
18
|
FETCH_CONCURRENCY_LIMIT,
|
|
19
|
-
GITIGNORE_DESTINATION_KEY,
|
|
20
19
|
HooksProcessor,
|
|
21
20
|
HooksProcessorToolTargetSchema,
|
|
22
21
|
IgnoreProcessor,
|
|
@@ -83,7 +82,6 @@ import {
|
|
|
83
82
|
getHomeDirectory,
|
|
84
83
|
getLocalSkillDirNames,
|
|
85
84
|
importFromTool,
|
|
86
|
-
isFeatureValueEnabled,
|
|
87
85
|
isSymlink,
|
|
88
86
|
listDirectoryFiles,
|
|
89
87
|
readFileContent,
|
|
@@ -101,7 +99,7 @@ import {
|
|
|
101
99
|
toolSkillFactories,
|
|
102
100
|
toolSubagentFactories,
|
|
103
101
|
writeFileContent
|
|
104
|
-
} from "../chunk-
|
|
102
|
+
} from "../chunk-JT4BB5RE.js";
|
|
105
103
|
|
|
106
104
|
// src/cli/index.ts
|
|
107
105
|
import { Command } from "commander";
|
|
@@ -1132,15 +1130,6 @@ async function fetchCommand(logger5, options) {
|
|
|
1132
1130
|
}
|
|
1133
1131
|
|
|
1134
1132
|
// src/cli/commands/generate.ts
|
|
1135
|
-
function sameDirSets(a, b) {
|
|
1136
|
-
const aSet = new Set(a);
|
|
1137
|
-
const bSet = new Set(b);
|
|
1138
|
-
if (aSet.size !== bSet.size) return false;
|
|
1139
|
-
for (const v of aSet) {
|
|
1140
|
-
if (!bSet.has(v)) return false;
|
|
1141
|
-
}
|
|
1142
|
-
return true;
|
|
1143
|
-
}
|
|
1144
1133
|
function logFeatureResult(logger5, params) {
|
|
1145
1134
|
const { count, paths, featureName, isPreview, modePrefix } = params;
|
|
1146
1135
|
if (count > 0) {
|
|
@@ -1154,24 +1143,6 @@ function logFeatureResult(logger5, params) {
|
|
|
1154
1143
|
}
|
|
1155
1144
|
}
|
|
1156
1145
|
}
|
|
1157
|
-
function resolveOutputRoots({
|
|
1158
|
-
logger: logger5,
|
|
1159
|
-
baseDir,
|
|
1160
|
-
outputRoots
|
|
1161
|
-
}) {
|
|
1162
|
-
if (baseDir !== void 0) {
|
|
1163
|
-
logger5.warn(
|
|
1164
|
-
"--base-dir is deprecated; use --output-roots instead. It will be removed in a future major release."
|
|
1165
|
-
);
|
|
1166
|
-
}
|
|
1167
|
-
const outputRootsResolved = outputRoots !== void 0 && outputRoots.length > 0 ? outputRoots : baseDir;
|
|
1168
|
-
if (baseDir !== void 0 && outputRoots !== void 0 && baseDir.length > 0 && outputRoots.length > 0 && !sameDirSets(outputRoots, baseDir)) {
|
|
1169
|
-
logger5.warn(
|
|
1170
|
-
`Both '--output-roots' and '--base-dir' were provided with differing values; using '--output-roots' (${JSON.stringify(outputRoots)}) and ignoring '--base-dir' (${JSON.stringify(baseDir)}).`
|
|
1171
|
-
);
|
|
1172
|
-
}
|
|
1173
|
-
return outputRootsResolved;
|
|
1174
|
-
}
|
|
1175
1146
|
var FEATURE_DEBUG_MESSAGES = {
|
|
1176
1147
|
ignore: "Generating ignore files...",
|
|
1177
1148
|
mcp: "Generating MCP files...",
|
|
@@ -1215,12 +1186,7 @@ function buildSummaryParts(result) {
|
|
|
1215
1186
|
return parts;
|
|
1216
1187
|
}
|
|
1217
1188
|
async function generateCommand(logger5, options) {
|
|
1218
|
-
const
|
|
1219
|
-
const outputRootsResolved = resolveOutputRoots({ logger: logger5, baseDir, outputRoots });
|
|
1220
|
-
const config = await ConfigResolver.resolve(
|
|
1221
|
-
{ ...rest, outputRoots: outputRootsResolved },
|
|
1222
|
-
{ logger: logger5 }
|
|
1223
|
-
);
|
|
1189
|
+
const config = await ConfigResolver.resolve(options, { logger: logger5 });
|
|
1224
1190
|
const check = config.getCheck();
|
|
1225
1191
|
const isPreview = config.isPreviewMode();
|
|
1226
1192
|
const modePrefix = isPreview ? "[DRY RUN]" : "";
|
|
@@ -1359,7 +1325,6 @@ var getProcessorRegistryEntry = (feature) => {
|
|
|
1359
1325
|
// src/cli/commands/gitignore-derive.ts
|
|
1360
1326
|
var TARGETS_NOT_DERIVED = /* @__PURE__ */ new Set([
|
|
1361
1327
|
"agentsskills",
|
|
1362
|
-
"antigravity",
|
|
1363
1328
|
"augmentcode-legacy",
|
|
1364
1329
|
"claudecode-legacy"
|
|
1365
1330
|
]);
|
|
@@ -1547,28 +1512,12 @@ var getSelectedGitignoreEntryTargets = (target, selectedTargets) => {
|
|
|
1547
1512
|
}
|
|
1548
1513
|
return targets.filter((candidate) => selectedTargets.includes(candidate));
|
|
1549
1514
|
};
|
|
1550
|
-
var
|
|
1515
|
+
var isFeatureSelected = (feature, features) => {
|
|
1551
1516
|
if (feature === "general") return true;
|
|
1552
1517
|
if (!features) return true;
|
|
1553
|
-
if (
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
return features.includes(feature);
|
|
1557
|
-
}
|
|
1558
|
-
if (target === "common") return true;
|
|
1559
|
-
const targetFeatures = features[target];
|
|
1560
|
-
if (!targetFeatures) return true;
|
|
1561
|
-
if (Array.isArray(targetFeatures)) {
|
|
1562
|
-
if (targetFeatures.includes("*")) return true;
|
|
1563
|
-
return targetFeatures.includes(feature);
|
|
1564
|
-
}
|
|
1565
|
-
if (isFeatureValueEnabled(targetFeatures["*"])) return true;
|
|
1566
|
-
return isFeatureValueEnabled(targetFeatures[feature]);
|
|
1567
|
-
};
|
|
1568
|
-
var isFeatureSelected = (feature, target, features) => {
|
|
1569
|
-
return normalizeGitignoreEntryTargets(target).some(
|
|
1570
|
-
(candidate) => isFeatureSelectedForTarget(feature, candidate, features)
|
|
1571
|
-
);
|
|
1518
|
+
if (features.length === 0) return true;
|
|
1519
|
+
if (features.includes("*")) return true;
|
|
1520
|
+
return features.includes(feature);
|
|
1572
1521
|
};
|
|
1573
1522
|
var warnInvalidTargets = (targets, logger5) => {
|
|
1574
1523
|
const validTargets = new Set(ALL_TOOL_TARGETS_WITH_WILDCARD);
|
|
@@ -1583,32 +1532,13 @@ var warnInvalidTargets = (targets, logger5) => {
|
|
|
1583
1532
|
var warnInvalidFeatures = (features, logger5) => {
|
|
1584
1533
|
const validFeatures = new Set(ALL_FEATURES_WITH_WILDCARD);
|
|
1585
1534
|
const warned = /* @__PURE__ */ new Set();
|
|
1586
|
-
const
|
|
1535
|
+
for (const feature of features) {
|
|
1587
1536
|
if (!validFeatures.has(feature) && !warned.has(feature)) {
|
|
1588
1537
|
warned.add(feature);
|
|
1589
1538
|
logger5?.warn(
|
|
1590
1539
|
`Unknown feature '${feature}'. Valid features: ${ALL_FEATURES_WITH_WILDCARD.join(", ")}`
|
|
1591
1540
|
);
|
|
1592
1541
|
}
|
|
1593
|
-
};
|
|
1594
|
-
if (Array.isArray(features)) {
|
|
1595
|
-
for (const feature of features) {
|
|
1596
|
-
warnOnce(feature);
|
|
1597
|
-
}
|
|
1598
|
-
} else {
|
|
1599
|
-
for (const targetFeatures of Object.values(features)) {
|
|
1600
|
-
if (!targetFeatures) continue;
|
|
1601
|
-
if (Array.isArray(targetFeatures)) {
|
|
1602
|
-
for (const feature of targetFeatures) {
|
|
1603
|
-
warnOnce(feature);
|
|
1604
|
-
}
|
|
1605
|
-
} else {
|
|
1606
|
-
for (const feature of Object.keys(targetFeatures)) {
|
|
1607
|
-
if (feature === GITIGNORE_DESTINATION_KEY) continue;
|
|
1608
|
-
warnOnce(feature);
|
|
1609
|
-
}
|
|
1610
|
-
}
|
|
1611
|
-
}
|
|
1612
1542
|
}
|
|
1613
1543
|
};
|
|
1614
1544
|
var resolveGitignoreEntries = (params) => {
|
|
@@ -1624,7 +1554,7 @@ var resolveGitignoreEntries = (params) => {
|
|
|
1624
1554
|
for (const tag of GITIGNORE_ENTRY_REGISTRY) {
|
|
1625
1555
|
if (!isTargetSelected(tag.target, targets)) continue;
|
|
1626
1556
|
const selectedTagTargets = getSelectedGitignoreEntryTargets(tag.target, targets);
|
|
1627
|
-
if (!isFeatureSelected(tag.feature,
|
|
1557
|
+
if (!isFeatureSelected(tag.feature, features)) continue;
|
|
1628
1558
|
if (seen.has(tag.entry)) continue;
|
|
1629
1559
|
seen.add(tag.entry);
|
|
1630
1560
|
result.push({
|
|
@@ -1816,9 +1746,9 @@ ${rulesyncBlock}
|
|
|
1816
1746
|
"\u{1F4A1} If you're using Google Antigravity, note that rules, workflows, and skills won't load if they're gitignored."
|
|
1817
1747
|
);
|
|
1818
1748
|
logger5.info(" You can add the following to .git/info/exclude instead:");
|
|
1819
|
-
logger5.info(" **/.
|
|
1820
|
-
logger5.info(" **/.
|
|
1821
|
-
logger5.info(" **/.
|
|
1749
|
+
logger5.info(" **/.agents/rules/");
|
|
1750
|
+
logger5.info(" **/.agents/workflows/");
|
|
1751
|
+
logger5.info(" **/.agents/skills/");
|
|
1822
1752
|
logger5.info(" For more details: https://github.com/dyoshikawa/rulesync/issues/981");
|
|
1823
1753
|
};
|
|
1824
1754
|
|
|
@@ -6889,7 +6819,7 @@ function wrapCommand({
|
|
|
6889
6819
|
}
|
|
6890
6820
|
|
|
6891
6821
|
// src/cli/index.ts
|
|
6892
|
-
var getVersion = () => "
|
|
6822
|
+
var getVersion = () => "9.0.0";
|
|
6893
6823
|
function wrapCommand2(name, errorCode, handler) {
|
|
6894
6824
|
return wrapCommand({ name, errorCode, handler, getVersion });
|
|
6895
6825
|
}
|
|
@@ -7003,10 +6933,6 @@ var main = async () => {
|
|
|
7003
6933
|
"-o, --output-roots <paths>",
|
|
7004
6934
|
"Output root directories to generate files into (comma-separated for multiple paths)",
|
|
7005
6935
|
parseCommaSeparatedList
|
|
7006
|
-
).option(
|
|
7007
|
-
"-b, --base-dir <paths>",
|
|
7008
|
-
"[Deprecated] Use --output-roots instead. Output root directories (comma-separated for multiple paths)",
|
|
7009
|
-
parseCommaSeparatedList
|
|
7010
6936
|
).option("-V, --verbose", "Verbose output").option("-s, --silent", "Suppress all output").option("-c, --config <path>", "Path to configuration file").option("-g, --global", "Generate for global(user scope) configuration files").option(
|
|
7011
6937
|
"--simulate-commands",
|
|
7012
6938
|
"Generate simulated commands. This feature is only available for copilot, cursor and codexcli."
|