dsh-mini-utility-dock 0.7.0 → 0.7.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.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/bin/dsh-plugin-parity.js +7 -7
- package/docs/CHANGELOG.en.md +6 -0
- package/docs/CHANGELOG.md +6 -0
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -56,7 +56,7 @@ A consumer's `npm test` runs `loopback:check` / `guard:check` / `http:check`, co
|
|
|
56
56
|
|
|
57
57
|
`dsh-plugin-parity` (a bin provided by this package) checks that cross-repo property directly: every host block compared in isolation after stripping the block's common indentation (the three, `dsh-host-http` included), pin agreement, block position, and a behavioral comparison. It is a manual diagnostic and **does not run in CI**: the property cannot hold while peers sit on a different branch. The member list is caller-supplied via `--member <repo>:<export>` — the guard factory's export name is per-repository by fragment design, so the tool presupposes no members; `--fleet <repo>` names the single member that opts into fleet mode, and only its guard is checked for "the relaxation stays bounded", while naming a repository that is not a member fails with a non-zero exit; without `--member` it runs the static checks only and discovers every checkout that embeds the guard block. `--self-test` needs no checkout at all: it exercises the block extractor and the block-dropping step against inline samples, so run it first whenever either changes.
|
|
58
58
|
|
|
59
|
-
`dsh-plugin-docs` (another bin of this package) checks the bilingual documentation pairs for structural
|
|
59
|
+
`dsh-plugin-docs` (another bin of this package) checks the bilingual documentation pairs for structural consistency. It names no document of its own: which pairs to check, which directory holds them, and how each is compared come from an array of `{ name, zh, en, shape? }` that the calling repository supplies through `--config <module>`; this package declares its own pairs in `docs.config.mjs` the same way. Two shapes exist. The default, `markdown`, compares the heading-level sequence and the code-fence languages on both sides; content inside a fence is exempt because that is where language-specific examples live. `changelog` compares the releases on both sides, the `Unreleased` section included, together with their sections and item counts, with section titles normalized through a bilingual category map. `--base <revision>` additionally requires both files of each declared pair to have changed since that revision: a one-sided edit is a missing translation. When that revision is the all-zero null OID, which is what `github.event.before` carries for a newly created or force-pushed branch, there is no previous state to compare, so that one requirement is skipped with a note while the structural checks still run. Repositories call it from their own `docs:check` script.
|
|
60
60
|
|
|
61
61
|
## Development and verification
|
|
62
62
|
|
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ npm run dock:embed -- sync path/to/shared.js
|
|
|
56
56
|
|
|
57
57
|
`dsh-plugin-parity`(本包提供的 bin)直接检这条跨仓性质:逐块(剥离块的公共缩进后)比对三个 host 块(含 `dsh-host-http`)、pin 一致性断言、块落点顺序断言与行为级对比。它是人工诊断工具,**不在 CI 中运行**:peer 处于不同分支时该性质本就不成立。成员表由调用方经 `--member <repo>:<export>` 提供——守卫工厂的导出名按片段设计是各仓自定的,故本工具不预设任何成员;`--fleet <repo>` 点名唯一启用 fleet 模式的成员,只对它检查「放宽有边界」,点名不在成员表中的仓即判 FAIL 并非零退出;不带 `--member` 时只跑静态检查,自动发现所有嵌入了宿主守卫块的仓。`--self-test` 不需要任何 checkout:它用内联样例检验块提取与「丢块」两步,改动这两个函数后先跑它。
|
|
58
58
|
|
|
59
|
-
`dsh-plugin-docs`(同样是本包的 bin
|
|
59
|
+
`dsh-plugin-docs`(同样是本包的 bin)校验双语文档的结构一致性。它不预设文档名:检查哪些文档对、文件位于哪个目录、按什么形状比较,都由调用仓通过 `--config <module>` 提供一个 `{ name, zh, en, shape? }` 数组决定;本包用同一种方式声明自己的 `docs.config.mjs`。形状有两种。默认的 `markdown` 比较中英两侧的标题层级序列与代码围栏语言,围栏内的内容豁免,因为语言相关的示例写在那里。`changelog` 比较中英两侧的版本段(含 `Unreleased` 段)、分类段与小节条目数,分类标题经双语映射归一。`--base <revision>` 额外要求声明的每一对文件在该 revision 之后一起改动,单边改动即缺翻译;revision 为全 0 的 null OID(新建分支或强推时 `github.event.before` 即为此值)时没有可比的前态,这一项跳过并给出提示,其余结构校验照常。各仓的 `docs:check` script 调用它。
|
|
60
60
|
|
|
61
61
|
## 开发与验证
|
|
62
62
|
|
package/bin/dsh-plugin-parity.js
CHANGED
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
// a Host that parses to no hostname skipping the allowlist in one copy while
|
|
9
9
|
// another denies it.
|
|
10
10
|
//
|
|
11
|
-
// The copies are
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
11
|
+
// The consumer copies are embedded blocks generated from this package's `dist/`
|
|
12
|
+
// files by the dock CLI — `dist/loopback.js` (the predicates), `dist/guard.js`
|
|
13
|
+
// (the enforcement policy) and `dist/host-http.js` (the response glue: JSON
|
|
14
|
+
// replies, the POST gate, the browser authorizer). So this checker asserts three
|
|
15
|
+
// things a generator alone cannot:
|
|
16
16
|
//
|
|
17
17
|
// * every embedded block is byte-identical in every member (a hand edit to
|
|
18
18
|
// one copy, or a repo that never re-ran `loopback:sync` / `guard:sync` /
|
|
@@ -293,8 +293,8 @@ for (const block of BLOCKS) {
|
|
|
293
293
|
// Every pattern here matches a CODE SHAPE, not a word. These files are scanned
|
|
294
294
|
// as text with the generated blocks dropped, so a bare keyword also matches
|
|
295
295
|
// prose: a doc comment explaining why a private helper is NOT a second guard
|
|
296
|
-
//
|
|
297
|
-
//
|
|
296
|
+
// would read as a decision. An explanation is not enforcement; reading a
|
|
297
|
+
// header or declaring a function is.
|
|
298
298
|
const ENFORCEMENT = [
|
|
299
299
|
[/LOOPBACK_HOSTNAMES\s*=(?!=)/, 'redefines LOOPBACK_HOSTNAMES'],
|
|
300
300
|
[/(?:const|function|let)\s+isLoopbackName\b/, 'defines a private isLoopbackName'],
|
package/docs/CHANGELOG.en.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Release notes are generated from the matching version section; newest first.
|
|
4
4
|
For Chinese, see [CHANGELOG.md](CHANGELOG.md).
|
|
5
5
|
|
|
6
|
+
## 0.7.1 - 2026-09-29
|
|
7
|
+
|
|
8
|
+
### Maintenance
|
|
9
|
+
|
|
10
|
+
- No interface changed: only the explanatory text in `bin/` and `test/` and two README phrasings were rewritten; `dist/`, the CLI arguments and the `--config` contract are untouched.
|
|
11
|
+
|
|
6
12
|
## 0.7.0 - 2026-09-29
|
|
7
13
|
|
|
8
14
|
### Changed
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Release Notes 由对应版本段生成;最新版本在前。
|
|
4
4
|
英文版见 [CHANGELOG.en.md](CHANGELOG.en.md)。
|
|
5
5
|
|
|
6
|
+
## 0.7.1 - 2026-09-29
|
|
7
|
+
|
|
8
|
+
### 维护
|
|
9
|
+
|
|
10
|
+
- 无接口变更:`dsh-plugin-docs` 与 `dsh-plugin-parity` 的参数、输出和 `dist/` 片段字节均未改动,本次只改写 bin 与测试中的说明文字,并把 README 里「结构对齐」的说法改为「结构一致性」。
|
|
11
|
+
|
|
6
12
|
## 0.7.0 - 2026-09-29
|
|
7
13
|
|
|
8
14
|
### 变更
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mini-utility-dock",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "The DSH plugin family's shared assets: source fragments (the loopback predicates, host request guard and host HTTP glue for host halves, the utility launcher for client halves), the embedding CLI, and the family diagnostics — cross-repo drift check and bilingual docs structure check.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|