You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* refactor(types): remove _internal-shims.d.ts soft-landing mechanism (SD-2942)
After SD-2893 drained every shim entry to zero, the auto-generated
_internal-shims.d.ts file ships empty (header comments only). The
auto-capture mechanism that wrote it is no longer load-bearing: it
was a soft fallback that captured any unrelocated private @superdoc/*
specifier in dist d.ts files and silently shimmed it as `any`. With
the relocation rules + RULE1_ALLOWLIST + UNSHIMMED_PRIVATE_SPECIFIERS
now covering the entire workspace surface, that soft path mostly
swallows new private leaks instead of failing the build.
This change makes new leaks fail loudly:
- ensure-types.cjs: drop the workspace-imports scanning loops, the
shim-file write, the triple-slash reference injection, and the
SHIM_FORBIDDEN regression net (now redundant with the relocation
rules + audit Rule 1). Add an explicit unlink for any stale
_internal-shims.d.ts left over from prior builds.
- audit-declarations.cjs: update the rule documentation. Rule 1 now
fails for any unrelocated private @superdoc/* specifier; Rule 3
becomes a no-op in steady state (kept as defense against stale
tarballs or future re-introduction). The internalShimsPresent
graceful-handling already existed in audit code; no behavioral
change there.
A future PR that introduces a new private @superdoc/* import on the
public surface fails audit Rule 1 at build time. Verified with a
synthetic injection: import('@superdoc/some-new-private-pkg').T in a
public-reachable d.ts produces FAIL findings: private-specifiers and
exits 1.
Net diff: -167 +41 lines across the two scripts.
Verified: build:es clean (10 guarded packages, no shim file emitted),
consumer matrix 47/0/0, runtime smoke 4/4, dist has zero
_internal-shims references, negative test confirms hard-landing.
* docs(types): fix stale comment about @superdoc/common shim path (SD-2942)
The comment above the inline-replacement block was inherited from the
pre-SD-2893 era and described two things that are no longer true after
the shim drain:
1. "fall through to the ambient shim block below" — SD-2942 (this PR)
removes the shim block, so non-main-entry @superdoc/common imports
now resolve via the RELOCATION_RULES rewriter, not via a fallback
shim.
2. "Comment, CommentContent, CommentJSON ... not on the public surface"
— SD-2893 stack 6 (PR #3154) relocated these types via the bare
@superdoc/common rule mapping to comments-types.d.ts. `Comment` is
now publicly importable as
`import type { Comment } from 'superdoc/super-editor'`.
Replace the block with a description of what the inline-replacement
step actually does today: handle the main entry's runtime-value imports
(DOCX, PDF, HTML, getFileObject, compareVersions, BlankDOCX) which are
not type-only and so the relocation rule cannot serve them.
console.error(`[ensure-types] ✗ ${pkg} appears in _internal-shims.d.ts. Its types should resolve via a relocation rewrite or fail the audit as an unrelocated leak, not via an ambient any shim. Investigate the include glob, the rewrite rule, and the shim-skip predicate for this package.`);
634
-
process.exit(1);
635
-
}
511
+
// `shouldSkipWorkspaceShim` is intentionally retained: it is no longer used
512
+
// by shim generation, but kept as documentation for the relocation policy
0 commit comments