fix(core,cli): harden install engine and argument parsing
- Reject unknown flags with exit 2 and never write on --dry-run, even in a TTY - Treat files already matching the new content as up to date after an interrupted update - Remove unmodified orphan files from older versions, keep and report modified ones and shared paths - Degrade malformed manifests instead of blocking installs; readIfExists only maps ENOENT/ENOTDIR to null - Block downgrades from older CLIs (semver), honor uninstall --scope, dedupe targets, fix next-step output and table width - Deeper package verification, LF normalization for .mjs, MIT LICENSE
This commit is contained in:
parent
97f2c241e4
commit
eecd3f03ff
29 changed files with 867 additions and 124 deletions
|
|
@ -83,3 +83,16 @@ test("문서 중간 블록을 빼면 블록 앞뒤 구분 빈 줄 하나만 걷
|
|||
const doc = "A\n\n<!-- designpaca:start -->\nx\n<!-- designpaca:end -->\n\nB\n";
|
||||
assert.equal(removeBlock(doc, M), "A\n\nB\n");
|
||||
});
|
||||
|
||||
test("CRLF 문서에는 CRLF 블록을 주입하고 제거하면 원문으로 돌아온다", () => {
|
||||
const doc = "# 내 지침\r\n\r\n건드리지 마라.\r\n";
|
||||
const out = upsertBlock(doc, M, "첫 줄\n둘째 줄");
|
||||
assert.ok(!/(^|[^\r])\n/.test(out), "LF 단독 줄바꿈이 섞이면 안 된다");
|
||||
assert.equal(extractBlock(out, M), "첫 줄\r\n둘째 줄");
|
||||
assert.equal(removeBlock(out, M), doc);
|
||||
});
|
||||
|
||||
test("LF 문서에는 LF 블록을 주입한다", () => {
|
||||
const out = upsertBlock("# 지침\n", M, "본문");
|
||||
assert.ok(!out.includes("\r"));
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue