@mnci/cli 4.10.0 → 4.10.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.
- package/dist/cli.js +29 -3
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1686,7 +1686,6 @@ var NX_SCAFFOLDING_TO_REMOVE = [
|
|
|
1686
1686
|
// The AI-agent set, in full. See the remarks above: a partial delete leaves
|
|
1687
1687
|
// every `nx` command printing an "outdated configuration" nag.
|
|
1688
1688
|
".agents",
|
|
1689
|
-
".claude",
|
|
1690
1689
|
".codex",
|
|
1691
1690
|
".cursor",
|
|
1692
1691
|
".gemini",
|
|
@@ -1694,10 +1693,15 @@ var NX_SCAFFOLDING_TO_REMOVE = [
|
|
|
1694
1693
|
".github/agents",
|
|
1695
1694
|
".github/prompts",
|
|
1696
1695
|
".github/skills",
|
|
1697
|
-
"AGENTS.md",
|
|
1698
|
-
"CLAUDE.md",
|
|
1699
1696
|
"opencode.json"
|
|
1697
|
+
// `.claude`, `AGENTS.md` and `CLAUDE.md` are NOT here. See
|
|
1698
|
+
// {@link NX_AUTHORED_AGENT_FILES} and {@link removeNxAuthoredAgentFiles}:
|
|
1699
|
+
// all three are paths a user writes by hand, so they are removed by what
|
|
1700
|
+
// they CONTAIN rather than by where they are.
|
|
1700
1701
|
];
|
|
1702
|
+
var NX_AGENT_RULES_MARKER = "<!-- nx configuration start-->";
|
|
1703
|
+
var NX_AUTHORED_AGENT_FILES = ["AGENTS.md", "CLAUDE.md"];
|
|
1704
|
+
var NX_CLAUDE_SETTINGS = ".claude/settings.json";
|
|
1701
1705
|
function withoutKey(record, key) {
|
|
1702
1706
|
return Object.fromEntries(Object.entries(record).filter(([name]) => name !== key));
|
|
1703
1707
|
}
|
|
@@ -1732,8 +1736,30 @@ function removeNxScaffolding(workspaceRoot) {
|
|
|
1732
1736
|
for (const entry of NX_SCAFFOLDING_TO_REMOVE) {
|
|
1733
1737
|
(0, import_node_fs2.rmSync)((0, import_node_path2.join)(workspaceRoot, entry), { recursive: true, force: true });
|
|
1734
1738
|
}
|
|
1739
|
+
removeNxAuthoredAgentFiles(workspaceRoot);
|
|
1735
1740
|
removeProjectEslintConfigs(workspaceRoot);
|
|
1736
1741
|
}
|
|
1742
|
+
function removeNxAuthoredAgentFiles(workspaceRoot) {
|
|
1743
|
+
(0, import_node_fs2.rmSync)((0, import_node_path2.join)(workspaceRoot, NX_CLAUDE_SETTINGS), { force: true });
|
|
1744
|
+
for (const name of NX_AUTHORED_AGENT_FILES) {
|
|
1745
|
+
const path = (0, import_node_path2.join)(workspaceRoot, name);
|
|
1746
|
+
if (!(0, import_node_fs2.existsSync)(path)) continue;
|
|
1747
|
+
const kept = withoutNxAgentRules((0, import_node_fs2.readFileSync)(path, "utf8"));
|
|
1748
|
+
if (kept === void 0) continue;
|
|
1749
|
+
if (kept.trim() === "") (0, import_node_fs2.rmSync)(path, { force: true });
|
|
1750
|
+
else writeFileEnsured(path, kept);
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
function withoutNxAgentRules(content) {
|
|
1754
|
+
const start = content.indexOf(NX_AGENT_RULES_MARKER);
|
|
1755
|
+
if (start === -1) return void 0;
|
|
1756
|
+
const endMarker = "<!-- nx configuration end";
|
|
1757
|
+
const end = content.indexOf(endMarker, start);
|
|
1758
|
+
if (end === -1) return void 0;
|
|
1759
|
+
const afterEnd = content.indexOf(">", end);
|
|
1760
|
+
const rest = afterEnd === -1 ? "" : content.slice(afterEnd + 1);
|
|
1761
|
+
return `${content.slice(0, start)}${rest}`.replace(/^[\r\n]+/, "");
|
|
1762
|
+
}
|
|
1737
1763
|
function removeIfPresent(path) {
|
|
1738
1764
|
(0, import_node_fs2.rmSync)(path, { recursive: true, force: true });
|
|
1739
1765
|
}
|