Repository navigation
feat(overlay): add Overlay 1.2.0 support - #184
Conversation
Update ApiDOM to v6.0.6 and @speclynx/api-languageservice to v2.14.0, which add Overlay 1.2.0 support to overlay apply, diff and validate. applyOverlayApiDOM now returns a Promise, so additional overlays passed via --overlay are awaited. overlay diff now emits Overlay 1.2.0 documents by default. The new --overlay-version option (1.0.0, 1.1.0, 1.2.0) allows targeting older Overlay versions; the generated actions only use target/update/remove, which are valid in every Overlay 1.x version.
Diagram — Overlay 1.2.0 support: dependency upgrades, async overlay application, and new CLI options flowchart TD
A["package.json<br/>apidom deps 5→6<br/>api-languageservice 2.13→2.14"] -->|enables| B["applyOverlayApiDOM<br/>now returns Promise"]
A -->|enables| C["Overlay 1.2.0<br/>reusable actions"]
B -->|requires| D["src/commands/overlay/apply/action.ts<br/>await applyOverlayApiDOM"]
C -->|requires| E["src/commands/overlay/apply/action.ts<br/>resolve $ref in components.actions"]
E -->|uses| F["parse + url.sanitize<br/>from apidom-reference"]
G["src/commands/overlay/diff/index.ts<br/>--overlay-version option"] -->|passes to| H["src/commands/overlay/diff/action.ts<br/>diffOverlay opts.overlay"]
H -->|generates| I["Overlay 1.1.0 or 1.2.0<br/>default 1.2.0"]
D -->|improves| J["src/commands/overlay/apply/trace.ts<br/>print trace on failure"]
K["bin/speclynx.mjs<br/>EPIPE handler"] -->|prevents| L["broken pipe errors<br/>when piped to head"]
M["babel.config.cjs<br/>remove cjs env"] -->|aligns with| N["package.json<br/>ESM-only build"]
O["test fixtures<br/>overlay-reusable.yaml<br/>overlay-copy.yaml<br/>overlay-1-2.yaml"] -->|test| D
O -->|test| G
O -->|test| C
Covers files changed in this PR — not the whole system. This PR upgrades ApiDOM and api-languageservice dependencies to support Overlay 1. 2. Requires your attention
🟡 Warnings (1)
ℹ️ Review details — 23,930 tokens · ~$0.3531 · 17.3s
Was this review helpful? React with 👍 or 👎 on this comment. |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
The generated actions update primitive nodes and concatenate arrays, which Overlay 1.0.0 does not allow. Only 1.1.0 and 1.2.0 are offered. Also document reusable action reference resolution in overlay apply and add diff -> validate -> apply round-trip tests. Refs speclynx/apidom#606
The trace is now printed up to the failing action instead of being dropped. Additional overlays pass their own URI as the dereferencing base URI, like the first overlay. Adds Overlay 1.2.0 reusable action and 1.1.0 copy fixtures and tests for apply and validate.
Piping output to a command that closes stdin early (e.g. head) crashed with an unhandled EPIPE error.
The package is ESM-only (type: module, no main/exports) and publishes only .mjs files, so the .cjs output was never shipped or used.
Superseded by new review on latest commit.
# [1.5.0](v1.4.2...v1.5.0) (2026-10-15) ### Features * **overlay:** add Overlay 1.2.0 support ([#184](#184)) ([52e797f](52e797f)), closes [speclynx/apidom#606](speclynx/apidom#606)
|
🎉 This PR is included in version 1.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
apidom-core,apidom-overlay,apidom-reference) to^6.0.6and@speclynx/api-languageserviceto^2.14.0(release), adding Overlay 1.2.0 support tooverlay apply,overlay diffandvalidate.applyOverlayApiDOMreturns a Promise since ApiDOM 6.0.0, so additional overlays passed via--overlayare now awaited. They also pass their own URI as the dereferencing base URI, like the first overlay.overlay diffemits Overlay 1.2.0 by default. The new--overlay-version <1.1.0|1.2.0>option targets an older version. 1.0.0 is not offered: the generated actions update primitive nodes and concatenate arrays, which 1.0.0 forbids (upstream: apidom-overlay: diff emits invalid actions for overlay: 1.0.0 apidom#606).overlay apply --verbosenow prints the trace up to the failing action when applying fails (e.g.--strictzero-match), instead of printing nothing.| head) instead of crashing with an unhandledEPIPE."type": "module", nomain/exports, publishes only.mjs), so the.cjsoutput was never shipped, andsrc/cli.cjscould not even load because ofimport.meta.--overlay-versiondocumented.CLAUDE.mdupdated for the removed CJS build.Notes
package-lock.jsonwas regenerated from scratch. With api-languageservice 2.13.x still pinned to ApiDOM 5, npm installed nested duplicate copies ofapidom-ns-overlay-1@6, which broke the overlay element type checks. With 2.14.0, everything uses one deduped ApiDOM 6 tree. As a side effect, the criticalhandlebarsaudit advisory is gone, andnpm audit --omit=devreports 0 vulnerabilities.Upstream issue found during review: speclynx/api-languageservice#71 (the "local reference not found" diagnostic code is built from
Date.now()).Test plan
npm run typescript:check-typesnpm run lintnpm test: 101 passing. New tests cover:--strict,--verbose)copyaction and its tracevalidate--overlay-version 1.0.0npm pack --dry-run,overlay apply ... | head