Skip to content

fix: resolve build and test errors - #1394

Merged
os-zhuang merged 1 commit into
mainfrom
fix/build-test-errors
May 30, 2026
Merged

fix: resolve build and test errors#1394
os-zhuang merged 1 commit into
mainfrom
fix/build-test-errors

Conversation

@xuyushun441-sys

@xuyushun441-sysxuyushun441-sys commented May 30, 2026

Copy link
Copy Markdown
Contributor

What

Fixes three stale tests/tooling that didn't match intentional source behavior, so pnpm build / pnpm test are green again. No shipped runtime behavior changes — only tests and the docs generator.

#Failing taskFix
1@objectstack/docs#build (gen:docs)escapeMdxDescription (packages/spec/scripts/build-docs.ts) used two separate regex passes for {...} and <...>. On nested tokens like {<id>} it double-wrapped into `{`<id>`}` — the inner backticks closed the inline-code span early and leaked <id> as raw JSX (Expected a closing tag for <id>). Replaced with a single backtick-aware pass that skips fragments already inside code spans; regenerated the affected .mdx.
2@objectstack/objectql#testloads from a complete artifact asserted strict toEqual against objDef, but object schemas pass through registerObject -> applyProtection, which stamps internal envelope markers (ADR-0010 §3.7). Switched to toMatchObject so it asserts the author-supplied shape is preserved rather than equality against intentional system fields.
3@objectstack/cli#testserve-defaults pinned ALWAYS_ON_CAPABILITIES to exactly six items, but the shipped fail-closed allowlist now also includes sharing. The six foundational capabilities must still lead the slate in order, so the test pins that prefix (slice(0, 6)) plus a no-duplicates invariant — letting the list grow without churning the assertion.

Verification

  • pnpm build63/63 tasks pass
  • pnpm test123/123 tasks pass

Reviewer notes

@vercel

vercelBot commented May 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
specReadyReadyPreview, CommentMay 30, 2026 1:16pm

Request Review

Three stale tests/tooling didn't match intentional source behavior, breaking
`pnpm build` / `pnpm test`. No shipped runtime behavior is changed.
1. MDX docs build (packages/spec/scripts/build-docs.ts) — @objectstack/docs#build
escapeMdxDescription used two separate regex passes for `{...}` and `<...>`.
On nested tokens like `{<id>}` it double-wrapped into `` `{`<id>`}` ``, whose
inner backticks closed the inline-code span early and leaked `<id>` as raw
JSX ("Expected a closing tag for `<id>`"). Replaced with a single
backtick-aware pass that skips fragments already inside code spans, and
regenerated the affected .mdx.
2. objectql registry test (packages/objectql/src/protocol-meta.test.ts)
"loads from a complete artifact" asserted strict toEqual against objDef, but
object schemas pass through registerObject -> applyProtection which stamps
internal envelope markers (ADR-0010 §3.7). Switched to toMatchObject to
assert the author-supplied shape is preserved rather than demanding equality
against intentional system fields.
3. CLI serve-defaults test (packages/cli/test/serve-defaults.test.ts)
The test pinned ALWAYS_ON_CAPABILITIES to exactly six items, but the shipped
fail-closed allowlist now also includes `sharing`. The six foundational
capabilities are still required to lead the slate in order, so the test now
pins that prefix (slice(0,6)) plus a no-duplicates invariant, letting the
list grow without churning the assertion.
Build: 63/63 tasks pass. Test: 123/123 tasks pass.
@os-zhuang
os-zhuang merged commit 03c7f44 into mainMay 30, 2026
12 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/mteststooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@xuyushun441-sys@os-zhuang