rulesync 10.0.0 → 10.1.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/cli/index.cjs +48 -7
- package/dist/cli/index.js +48 -7
- package/dist/cli/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.cjs
CHANGED
|
@@ -1204,11 +1204,13 @@ const DERIVED_PATHS_NOT_GITIGNORED = /* @__PURE__ */ new Set([
|
|
|
1204
1204
|
"**/.antigravity/settings.json",
|
|
1205
1205
|
"**/.claude/settings.json",
|
|
1206
1206
|
"**/.claude/settings.local.json",
|
|
1207
|
+
"**/.codex/config.toml",
|
|
1207
1208
|
"**/.devin/config.json",
|
|
1208
1209
|
"**/.factory/settings.json",
|
|
1209
|
-
"**/.
|
|
1210
|
+
"**/.grok/config.toml",
|
|
1211
|
+
"**/.vibe/config.toml",
|
|
1212
|
+
"**/reasonix.toml",
|
|
1210
1213
|
"**/.zed/settings.json",
|
|
1211
|
-
"**/.warp/settings.toml",
|
|
1212
1214
|
"**/kilo.json",
|
|
1213
1215
|
"**/kilo.jsonc",
|
|
1214
1216
|
"**/opencode.json"
|
|
@@ -1224,7 +1226,6 @@ const supportsProject = (factory) => {
|
|
|
1224
1226
|
};
|
|
1225
1227
|
const getProjectPaths = (factory) => factory.class.getSettablePaths({ global: false });
|
|
1226
1228
|
const pushEntry = (entries, target, feature, entry) => {
|
|
1227
|
-
if (DERIVED_PATHS_NOT_GITIGNORED.has(entry)) return;
|
|
1228
1229
|
entries.push({
|
|
1229
1230
|
target,
|
|
1230
1231
|
feature,
|
|
@@ -1293,7 +1294,8 @@ const DERIVED_FEATURES = [
|
|
|
1293
1294
|
"permissions",
|
|
1294
1295
|
"ignore"
|
|
1295
1296
|
];
|
|
1296
|
-
const
|
|
1297
|
+
const deriveAllGitignoreEntriesUnfiltered = () => DERIVED_FEATURES.flatMap((feature) => deriveFeatureGitignoreEntries(feature));
|
|
1298
|
+
const deriveAllGitignoreEntries = () => deriveAllGitignoreEntriesUnfiltered().filter((tag) => !DERIVED_PATHS_NOT_GITIGNORED.has(tag.entry));
|
|
1297
1299
|
//#endregion
|
|
1298
1300
|
//#region src/cli/commands/gitignore-entries.ts
|
|
1299
1301
|
const normalizeGitignoreEntryTargets = (target) => {
|
|
@@ -1572,6 +1574,35 @@ const removeExistingRulesyncEntries = (content) => {
|
|
|
1572
1574
|
while (result.endsWith("\n\n")) result = result.slice(0, -1);
|
|
1573
1575
|
return result;
|
|
1574
1576
|
};
|
|
1577
|
+
const extractRulesyncManagedEntries = (content) => {
|
|
1578
|
+
const lines = content.split("\n");
|
|
1579
|
+
const managed = [];
|
|
1580
|
+
let index = 0;
|
|
1581
|
+
const collectBlockLines = (start, end) => {
|
|
1582
|
+
for (const blockLine of lines.slice(start, end)) {
|
|
1583
|
+
const trimmed = blockLine.trim();
|
|
1584
|
+
if (trimmed !== "") managed.push(trimmed);
|
|
1585
|
+
}
|
|
1586
|
+
};
|
|
1587
|
+
while (index < lines.length) {
|
|
1588
|
+
const line = lines[index] ?? "";
|
|
1589
|
+
if (isRulesyncHeader(line)) {
|
|
1590
|
+
const footerIndex = findRulesyncFooterIndex(lines, index + 1);
|
|
1591
|
+
if (footerIndex !== -1) {
|
|
1592
|
+
collectBlockLines(index + 1, footerIndex);
|
|
1593
|
+
index = footerIndex + 1;
|
|
1594
|
+
continue;
|
|
1595
|
+
}
|
|
1596
|
+
const legacyEnd = skipLegacyRulesyncBlock(lines, index);
|
|
1597
|
+
collectBlockLines(index + 1, legacyEnd);
|
|
1598
|
+
index = legacyEnd;
|
|
1599
|
+
continue;
|
|
1600
|
+
}
|
|
1601
|
+
if (isRulesyncEntry(line)) managed.push(line.trim());
|
|
1602
|
+
index++;
|
|
1603
|
+
}
|
|
1604
|
+
return managed;
|
|
1605
|
+
};
|
|
1575
1606
|
const groupEntriesByDestination = ({ entries, resolveDestination }) => {
|
|
1576
1607
|
const gitignore = /* @__PURE__ */ new Set();
|
|
1577
1608
|
const gitattributes = /* @__PURE__ */ new Set();
|
|
@@ -1608,6 +1639,8 @@ const gitignoreCommand = async (logger, options) => {
|
|
|
1608
1639
|
let content = "";
|
|
1609
1640
|
if (await require_import.fileExists(filePath)) content = await require_import.readFileContent(filePath);
|
|
1610
1641
|
const cleanedContent = removeExistingRulesyncEntries(content);
|
|
1642
|
+
const entrySet = new Set(entries);
|
|
1643
|
+
const entriesRemoved = [...new Set(extractRulesyncManagedEntries(content).filter((entry) => !entrySet.has(entry)))];
|
|
1611
1644
|
const existingEntries = new Set(content.split("\n").map((line) => line.trim()).filter((line) => line !== "" && !isRulesyncHeader(line) && !isRulesyncFooter(line)));
|
|
1612
1645
|
const alreadyExistedEntries = entries.filter((entry) => existingEntries.has(entry));
|
|
1613
1646
|
const entriesToAdd = entries.filter((entry) => !existingEntries.has(entry));
|
|
@@ -1620,13 +1653,15 @@ const gitignoreCommand = async (logger, options) => {
|
|
|
1620
1653
|
if (content === newContent) return {
|
|
1621
1654
|
updated: false,
|
|
1622
1655
|
alreadyExistedEntries,
|
|
1623
|
-
entriesToAdd: []
|
|
1656
|
+
entriesToAdd: [],
|
|
1657
|
+
entriesRemoved: []
|
|
1624
1658
|
};
|
|
1625
1659
|
await require_import.writeFileContent(filePath, newContent);
|
|
1626
1660
|
return {
|
|
1627
1661
|
updated: true,
|
|
1628
1662
|
alreadyExistedEntries,
|
|
1629
|
-
entriesToAdd
|
|
1663
|
+
entriesToAdd,
|
|
1664
|
+
entriesRemoved
|
|
1630
1665
|
};
|
|
1631
1666
|
};
|
|
1632
1667
|
const gitignoreResult = await updateRulesyncFile({
|
|
@@ -1652,6 +1687,12 @@ const gitignoreCommand = async (logger, options) => {
|
|
|
1652
1687
|
logger.captureData("gitignorePath", gitignorePath);
|
|
1653
1688
|
logger.captureData("gitattributesPath", gitattributesPath);
|
|
1654
1689
|
logger.captureData("alreadyExisted", [...gitignoreResult.alreadyExistedEntries, ...gitattributesResult.alreadyExistedEntries]);
|
|
1690
|
+
logger.captureData("entriesRemoved", gitignoreResult.entriesRemoved);
|
|
1691
|
+
}
|
|
1692
|
+
if (gitignoreResult.entriesRemoved.length > 0) {
|
|
1693
|
+
logger.warn("The following entries were removed from the rulesync-managed block in .gitignore and are no longer gitignored by rulesync:");
|
|
1694
|
+
for (const entry of gitignoreResult.entriesRemoved) logger.warn(` ${entry}`);
|
|
1695
|
+
logger.warn("Review these paths before committing — user-managed settings files may contain secrets.");
|
|
1655
1696
|
}
|
|
1656
1697
|
if (gitignoreResult.updated) logger.success("Updated .gitignore with rulesync entries:");
|
|
1657
1698
|
else logger.success(".gitignore is already up to date");
|
|
@@ -6515,7 +6556,7 @@ function wrapCommand$1({ name, errorCode, handler, getVersion, loggerFactory = c
|
|
|
6515
6556
|
}
|
|
6516
6557
|
//#endregion
|
|
6517
6558
|
//#region src/cli/index.ts
|
|
6518
|
-
const getVersion = () => "10.
|
|
6559
|
+
const getVersion = () => "10.1.0";
|
|
6519
6560
|
function wrapCommand(name, errorCode, handler) {
|
|
6520
6561
|
return wrapCommand$1({
|
|
6521
6562
|
name,
|
package/dist/cli/index.js
CHANGED
|
@@ -1202,11 +1202,13 @@ const DERIVED_PATHS_NOT_GITIGNORED = /* @__PURE__ */ new Set([
|
|
|
1202
1202
|
"**/.antigravity/settings.json",
|
|
1203
1203
|
"**/.claude/settings.json",
|
|
1204
1204
|
"**/.claude/settings.local.json",
|
|
1205
|
+
"**/.codex/config.toml",
|
|
1205
1206
|
"**/.devin/config.json",
|
|
1206
1207
|
"**/.factory/settings.json",
|
|
1207
|
-
"**/.
|
|
1208
|
+
"**/.grok/config.toml",
|
|
1209
|
+
"**/.vibe/config.toml",
|
|
1210
|
+
"**/reasonix.toml",
|
|
1208
1211
|
"**/.zed/settings.json",
|
|
1209
|
-
"**/.warp/settings.toml",
|
|
1210
1212
|
"**/kilo.json",
|
|
1211
1213
|
"**/kilo.jsonc",
|
|
1212
1214
|
"**/opencode.json"
|
|
@@ -1222,7 +1224,6 @@ const supportsProject = (factory) => {
|
|
|
1222
1224
|
};
|
|
1223
1225
|
const getProjectPaths = (factory) => factory.class.getSettablePaths({ global: false });
|
|
1224
1226
|
const pushEntry = (entries, target, feature, entry) => {
|
|
1225
|
-
if (DERIVED_PATHS_NOT_GITIGNORED.has(entry)) return;
|
|
1226
1227
|
entries.push({
|
|
1227
1228
|
target,
|
|
1228
1229
|
feature,
|
|
@@ -1291,7 +1292,8 @@ const DERIVED_FEATURES = [
|
|
|
1291
1292
|
"permissions",
|
|
1292
1293
|
"ignore"
|
|
1293
1294
|
];
|
|
1294
|
-
const
|
|
1295
|
+
const deriveAllGitignoreEntriesUnfiltered = () => DERIVED_FEATURES.flatMap((feature) => deriveFeatureGitignoreEntries(feature));
|
|
1296
|
+
const deriveAllGitignoreEntries = () => deriveAllGitignoreEntriesUnfiltered().filter((tag) => !DERIVED_PATHS_NOT_GITIGNORED.has(tag.entry));
|
|
1295
1297
|
//#endregion
|
|
1296
1298
|
//#region src/cli/commands/gitignore-entries.ts
|
|
1297
1299
|
const normalizeGitignoreEntryTargets = (target) => {
|
|
@@ -1570,6 +1572,35 @@ const removeExistingRulesyncEntries = (content) => {
|
|
|
1570
1572
|
while (result.endsWith("\n\n")) result = result.slice(0, -1);
|
|
1571
1573
|
return result;
|
|
1572
1574
|
};
|
|
1575
|
+
const extractRulesyncManagedEntries = (content) => {
|
|
1576
|
+
const lines = content.split("\n");
|
|
1577
|
+
const managed = [];
|
|
1578
|
+
let index = 0;
|
|
1579
|
+
const collectBlockLines = (start, end) => {
|
|
1580
|
+
for (const blockLine of lines.slice(start, end)) {
|
|
1581
|
+
const trimmed = blockLine.trim();
|
|
1582
|
+
if (trimmed !== "") managed.push(trimmed);
|
|
1583
|
+
}
|
|
1584
|
+
};
|
|
1585
|
+
while (index < lines.length) {
|
|
1586
|
+
const line = lines[index] ?? "";
|
|
1587
|
+
if (isRulesyncHeader(line)) {
|
|
1588
|
+
const footerIndex = findRulesyncFooterIndex(lines, index + 1);
|
|
1589
|
+
if (footerIndex !== -1) {
|
|
1590
|
+
collectBlockLines(index + 1, footerIndex);
|
|
1591
|
+
index = footerIndex + 1;
|
|
1592
|
+
continue;
|
|
1593
|
+
}
|
|
1594
|
+
const legacyEnd = skipLegacyRulesyncBlock(lines, index);
|
|
1595
|
+
collectBlockLines(index + 1, legacyEnd);
|
|
1596
|
+
index = legacyEnd;
|
|
1597
|
+
continue;
|
|
1598
|
+
}
|
|
1599
|
+
if (isRulesyncEntry(line)) managed.push(line.trim());
|
|
1600
|
+
index++;
|
|
1601
|
+
}
|
|
1602
|
+
return managed;
|
|
1603
|
+
};
|
|
1573
1604
|
const groupEntriesByDestination = ({ entries, resolveDestination }) => {
|
|
1574
1605
|
const gitignore = /* @__PURE__ */ new Set();
|
|
1575
1606
|
const gitattributes = /* @__PURE__ */ new Set();
|
|
@@ -1606,6 +1637,8 @@ const gitignoreCommand = async (logger, options) => {
|
|
|
1606
1637
|
let content = "";
|
|
1607
1638
|
if (await fileExists(filePath)) content = await readFileContent(filePath);
|
|
1608
1639
|
const cleanedContent = removeExistingRulesyncEntries(content);
|
|
1640
|
+
const entrySet = new Set(entries);
|
|
1641
|
+
const entriesRemoved = [...new Set(extractRulesyncManagedEntries(content).filter((entry) => !entrySet.has(entry)))];
|
|
1609
1642
|
const existingEntries = new Set(content.split("\n").map((line) => line.trim()).filter((line) => line !== "" && !isRulesyncHeader(line) && !isRulesyncFooter(line)));
|
|
1610
1643
|
const alreadyExistedEntries = entries.filter((entry) => existingEntries.has(entry));
|
|
1611
1644
|
const entriesToAdd = entries.filter((entry) => !existingEntries.has(entry));
|
|
@@ -1618,13 +1651,15 @@ const gitignoreCommand = async (logger, options) => {
|
|
|
1618
1651
|
if (content === newContent) return {
|
|
1619
1652
|
updated: false,
|
|
1620
1653
|
alreadyExistedEntries,
|
|
1621
|
-
entriesToAdd: []
|
|
1654
|
+
entriesToAdd: [],
|
|
1655
|
+
entriesRemoved: []
|
|
1622
1656
|
};
|
|
1623
1657
|
await writeFileContent(filePath, newContent);
|
|
1624
1658
|
return {
|
|
1625
1659
|
updated: true,
|
|
1626
1660
|
alreadyExistedEntries,
|
|
1627
|
-
entriesToAdd
|
|
1661
|
+
entriesToAdd,
|
|
1662
|
+
entriesRemoved
|
|
1628
1663
|
};
|
|
1629
1664
|
};
|
|
1630
1665
|
const gitignoreResult = await updateRulesyncFile({
|
|
@@ -1650,6 +1685,12 @@ const gitignoreCommand = async (logger, options) => {
|
|
|
1650
1685
|
logger.captureData("gitignorePath", gitignorePath);
|
|
1651
1686
|
logger.captureData("gitattributesPath", gitattributesPath);
|
|
1652
1687
|
logger.captureData("alreadyExisted", [...gitignoreResult.alreadyExistedEntries, ...gitattributesResult.alreadyExistedEntries]);
|
|
1688
|
+
logger.captureData("entriesRemoved", gitignoreResult.entriesRemoved);
|
|
1689
|
+
}
|
|
1690
|
+
if (gitignoreResult.entriesRemoved.length > 0) {
|
|
1691
|
+
logger.warn("The following entries were removed from the rulesync-managed block in .gitignore and are no longer gitignored by rulesync:");
|
|
1692
|
+
for (const entry of gitignoreResult.entriesRemoved) logger.warn(` ${entry}`);
|
|
1693
|
+
logger.warn("Review these paths before committing — user-managed settings files may contain secrets.");
|
|
1653
1694
|
}
|
|
1654
1695
|
if (gitignoreResult.updated) logger.success("Updated .gitignore with rulesync entries:");
|
|
1655
1696
|
else logger.success(".gitignore is already up to date");
|
|
@@ -6513,7 +6554,7 @@ function wrapCommand$1({ name, errorCode, handler, getVersion, loggerFactory = c
|
|
|
6513
6554
|
}
|
|
6514
6555
|
//#endregion
|
|
6515
6556
|
//#region src/cli/index.ts
|
|
6516
|
-
const getVersion = () => "10.
|
|
6557
|
+
const getVersion = () => "10.1.0";
|
|
6517
6558
|
function wrapCommand(name, errorCode, handler) {
|
|
6518
6559
|
return wrapCommand$1({
|
|
6519
6560
|
name,
|