mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-11 05:18:44 -08:00
79 lines
5.3 KiB
Markdown
79 lines
5.3 KiB
Markdown
# Installed package checks
|
|
|
|
Run `yarn test:package` with the pinned Node and Yarn after a frozen install. The
|
|
initial scope is core and chapter; extend `names` in `scripts/package-consumer.mjs`
|
|
and add package-specific consumers when migrating another package.
|
|
|
|
`scripts/package-check.mjs` copies source into an ignored build snapshot, rebuilds
|
|
all three formats and core languages using repository scripts, and runs Yarn pack.
|
|
It checks manifest targets, historical distribution files, archive members and
|
|
unexpected source/configuration files. It then installs the tarballs in a fresh
|
|
OS temporary directory outside the repository, using the root lock to resolve
|
|
runtime dependencies offline, and repeats installation with a frozen consumer lock.
|
|
Install hooks are disabled; packages with such hooks are rejected until covered.
|
|
|
|
Only the build snapshot links workspace build tools. The consumer has no workspace
|
|
package links, `NODE_PATH` is cleared, installed files must match archive hashes,
|
|
and compiler inputs may only resolve inside that consumer or the pinned compiler's
|
|
standard library. Temporary consumers are cleaned up after success or failure.
|
|
|
|
`runtime.cjs` tests CJS, ESM, UMD, AMD, legacy and language entrypoints, SSR import,
|
|
export restrictions and shared Emitter behavior. Public property descriptors and
|
|
default configuration are compared against the fixed published core/chapter.
|
|
This is a targeted compatibility check, not a complete behavioral API comparison.
|
|
|
|
Custom-UA SSR profiles run actual UMD/legacy bytes and direct ESM imports with no
|
|
window/document/navigator shim. The frozen baseline's iOS/Macintosh ReferenceErrors
|
|
are asserted only in explicit baseline mode; candidates must import successfully.
|
|
The checks retain callback-free server imports, no UMD timers, and the browser-only
|
|
constructor error. A negative fixture verifies the old package fails candidate mode.
|
|
|
|
Public, chapter-options, chapter-exports, language and legacy-plugin consumers run with
|
|
TS 5.9.3 (Node10, NodeNext CJS/ESM and Bundler) and TS 4.3.5 (Node10). NodeNext CJS also
|
|
checks import-equals/require and namespaced types. PKG-CHAPTER-04 resolved the initial
|
|
type failures; all five groups now require zero diagnostics. Exact known
|
|
diagnostics are referenced by `known-types.json` and `test/types/known-diagnostics.json`.
|
|
Unexpected errors and unexpectedly removed errors both require investigation.
|
|
Remove a known case when its owning task fixes it; keep frozen release evidence intact.
|
|
`yarn test:package:release` additionally rejects remaining known type and runtime blockers.
|
|
Passing this command alone is not authorization or sufficient evidence to publish.
|
|
|
|
`scripts/package-runtime.mjs` uses only Node built-ins and can reinstall the exact checked
|
|
tarballs under a different Node. First run `yarn test:package` on the canonical toolchain,
|
|
then use the selected executable with `scripts/package-runtime.mjs --expected-node 20.19.0`
|
|
or `--expected-node 22.12.0`; `yarn test:package:runtime` verifies canonical Node.
|
|
Each run checks HEAD, archive digests, the frozen offline install, installed bytes and
|
|
the actual child version. Reports and failure logs are `runtime-node-<version>.*` in
|
|
the same package output directory. Old reports without source/toolchain fields must
|
|
be rebuilt. CI restores canonical Node before running browser tools.
|
|
|
|
CORE-25 fixed candidate static defaults without navigator. The fixture preserves the
|
|
published ReferenceError while requiring candidate main/legacy/ESM defaults to succeed,
|
|
then uses an identical controlled language for comparison and restores the global.
|
|
The fixture now reports zero known runtime blockers; it is still only core/chapter
|
|
acceptance, not full release readiness. See [the fix](../../refactor/changes/2026-09-13-CORE-25-defaults-ssr.md)
|
|
and the earlier [Node evidence](../../refactor/changes/2026-09-13-CI-01-node-consumers.md).
|
|
|
|
The optional core `artplayer/runtime` entry has eight additional strict consumer
|
|
groups: TS 5.1.6 and 5.9.3 each check Node10 CommonJS, NodeNext CJS/ESM and Bundler.
|
|
These fixtures cover accurate returns and getter/setter types, construction-stage
|
|
callback hosts, both old and new module augmentations, old chapter factories and
|
|
the shared modern/legacy constructor. The old root remains isolated from modern
|
|
accessor syntax and retains its five original consumer groups. Runtime checks
|
|
verify the added entries reuse existing JS module and constructor identities;
|
|
`runtime/types` remains type-only. All generated core declarations are packaged,
|
|
while their authored `public/` source graph and internal implementation are excluded.
|
|
|
|
Reports, archives, installed artifact copies and build/install logs are under
|
|
`refactor/.cache/packages/run-*`; `latest.json` points to the last successful
|
|
compatibility run (a strict release rejection still leaves its report). For browser
|
|
validation set `ARTPLAYER_BROWSER_ARTIFACTS` to that run's `browser-artifacts.json`
|
|
and run `yarn test:browser`. The service then uses installed package bytes without
|
|
falling back to source. CI performs this sequence and uploads only reports and
|
|
artifacts, excluding the build snapshot's node_modules link.
|
|
|
|
`test/package-check.test.js` verifies missing targets, leaked configuration and
|
|
removed historical files, then deliberately removes an actual published default
|
|
export and required entry in an isolated consumer to prove runtime failures are
|
|
detected. It is part of `yarn test:node`.
|