test(build): add post-build tests for ESM/UMD bundles and API surface gate#8845
Open
kpal81xd wants to merge 1 commit into
Open
test(build): add post-build tests for ESM/UMD bundles and API surface gate#8845kpal81xd wants to merge 1 commit into
kpal81xd wants to merge 1 commit into
Conversation
13df5ea to
6e2f2d4
Compare
… gate The mocha suite runs against src/ and CI only publints the bundles, so build-output regressions ship undetected (e.g. #8836 pc.app null in UMD, #8839 getter-only exports breaking pc.createScript overrides). - test/bundles/: post-build mocha suite (npm run test:build) loading the built bundles (rel/dbg/prf/min x UMD/ESM) - each loads (UMD global + CJS, ESM import) and boots an Application; runtime exports match src/index.js; pc.app live binding (#8836/#8837); UMD exports overridable (#8839); plus a blanket invariant that every UMD export is a live + overridable accessor. - api-extractor: public API surface gate. npm run api:check verifies the built .d.ts against etc/playcanvas.api.md (compact colored diff on failure); npm run api:update regenerates it. Scratch report under build/.api-extractor/. New dev dependency: @microsoft/api-extractor. - CI: run test:build in the build job; api:check in the typescript-declarations job. Closes #8838
756ab1a to
fe87182
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Build-output regressions ship undetected today — the unit suite runs against
src/, and CI onlypublints the bundles. That's how #8836 (pc.appnull in UMD) and #8839 (getter-only exportsbreaking
pc.createScriptoverrides) reached users. Closes #8838.Adds two post-build guards:
test/bundles/)npm run test:buildApplication; runtime exports matchsrc/index.js;pc.applive binding (#8836/#8837); UMD exports overridable (#8839); blanket invariant — every UMD export is a live + overridable accessorbuildnpm run api:check.d.tssignatures vs committedetc/playcanvas.api.md; bless intentional changes withnpm run api:update. Report holds only declarations, so it's stable against unrelated editstypescript-declarationsExample
Verification
npm run test:buildnpm run api:check.d.tsline shifts)npm test(unit)test:buildspecs fail (#8836 + #8839)New dev dependency:
@microsoft/api-extractor.