Skip to content

v0.40.6 — Audit-Driven Quality Cleanup

Choose a tag to compare

@SisyphusZheng SisyphusZheng released this 15 Jun 12:40

v0.40.6 Release Plan

Summary

v0.40.6 closes the internal quality gaps identified by the 2026-06-15
architecture audit (docs/audit/2026-06-15-architecture-audit.md). The release
adds test coverage for element and ui, splits over-large source files,
unifies error handling, cleans up runtime assertions, and removes remaining
ad-hoc console.* usage. No public API or package topology changes are
introduced.

This release also fixes the post-publish consumer smoke failure that affected
v0.40.5: packages/adapter-vite/src/ssg-package-resolver.ts now resolves the
new @openelement/ui subpaths open-dropdown, open-modal, and open-tabs
that were added in the v0.40.6 UI component test hardening. Additionally,
packages/create/deno.json correctly declares its dependency on
@openelement/core/logger, and the JSR publish order places create after
core.

This release is executed under the v0.40.x cleanup-train authority from
ADR-0105 and recorded in ADR-0106.

Changes

Documentation

  • Add docs/audit/2026-06-15-architecture-audit.md as a persistent architecture
    artifact.
  • Add ADR-0106 documenting the audit-driven cleanup scope and boundaries.
  • Update docs/status/STATUS.md and docs/roadmap/ROADMAP.md for the v0.40.6
    line.
  • Archive the v0.40.4 plan to docs/release/v0.40.4-plan.md.

Tests

  • Expand packages/element/__tests__/open-element.test.ts from 2 to 22 tests,
    covering lifecycle, DSD/CSR, signal hydration, events, static props, error
    boundaries, form internals, and params.
  • Expand packages/ui/__tests__/components.test.ts from 20 to 58 tests,
    covering all 13 open-* components plus manifest metadata.
  • Add missing open-dropdown, open-modal, and open-tabs declarations to
    packages/ui/src/manifest.ts and update smoke tests accordingly.

Error Handling

  • Introduce formatError(e: unknown): string in packages/core/src/errors.ts.
  • Replace all e instanceof Error ? e.message : String(e) patterns across
    packages with the shared helper.

File Size Reduction

  • Split packages/ssg/src/route-scanner.ts into
    route-scanner-ast.ts + route-scanner-fs.ts + orchestrator
    (~795 → ~555 lines).
  • Split packages/element/src/open-element.ts into
    open-element-render.ts + open-element-hydration.ts + base class
    (~719 → ~602 lines).
  • Extract alias normalization and build constants from
    packages/adapter-vite/src/cli/build-ssg.ts into alias-utils.ts and
    build-constants.ts (~526 → ~492 lines).

Runtime Safety

  • Replace shadowRoot! assertions in open-element.ts with a guarded local
    variable.
  • Add runtime guards for RegExp match indices in postprocess.ts.
  • Add runtime guard for openElement.module in entry-descriptor.ts.

Adapter-Vite Cleanup

  • Move alias normalization to alias-utils.ts.
  • Move build constants (DEFAULT_ADAPTER_VERSION_FALLBACK,
    SSR_CHUNK_SIZE_WARNING_LIMIT_KB, SANITIZE_HTML_SPECIFIER) to
    build-constants.ts.

Logging Cleanup

  • Route router/src/client-router.ts, adapter-vite/src/cli/build.ts,
    create/cli.ts, ui/src/open-layout.tsx, and ui/src/open-code-block.tsx
    logging through OpenElementLogger.
  • Leave generated runtime code and the low-level signal engine console logger
    unchanged by design.

Acceptance

  • deno task fmt:check, deno task lint, deno task typecheck, and
    deno task test all pass.
  • deno task type-safety:check reports 0 explicit any.
  • deno task graph:check and deno task package-surface:check confirm no
    package or public surface changes.
  • deno task arch:check, deno task repo:hygiene,
    deno task workflow:check, and deno task workflow:check-slimming pass.
  • deno task docs:check-current, deno task docs:check-public, and
    deno task docs:check-strategy pass.
  • deno task consumer:local and deno task consumer:packaged pass.
  • deno task nitro:proof:node and deno task nitro:proof:workers pass.
  • deno task publish:dry-run passes.

Verification

deno task fmt:check
deno task lint
deno task typecheck
deno task test
deno task test:coverage:check
deno task build
deno task graph:check
deno task arch:check
deno task repo:hygiene
deno task workflow:check
deno task workflow:check-slimming
deno task docs:check-public
deno task docs:check-current
deno task docs:check-strategy
deno task package-surface:check
deno task signals:check-protocol-boundary
deno task type-safety:check
deno task autoflow:test
deno task autoflow:push
deno task autoflow:ci
deno task nitro:proof:node
deno task nitro:proof:workers
deno task consumer:local
deno task consumer:packaged
deno task publish:dry-run