Skip to content

feat(engine): consume installed Web and Editor SDK packages - #1051

Draft
bofeng-song wants to merge 6 commits into
cocos:mainfrom
bofeng-song:codex/engine-npm-distribution
Draft

bofeng-song wants to merge 6 commits into
cocos:mainfrom
bofeng-song:codex/engine-npm-distribution

Conversation

@bofeng-song

@bofeng-song bofeng-song commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

The CLI consumes installed Web and Editor engine packages while retaining source-directory support. Engine package generation belongs to cocos/cocos4#441.

  • Prefer the standard Web/Editor packages installed in the CLI over machine-local source defaults. Games do not need engine dependencies or engineSdk configuration. Explicit project sources and --engine-path still override automatic selection.
  • Validate component identities and assemble isolated working views without modifying installed packages. Missing or mismatched components fail without falling back to another engine.
  • Use the same SDK selection during installation. compiler-engine validates prepared npm profiles and skips source compilation, including with --force; build-cc-module uses the matching declarations and editor exports.
  • Retain project SDK overrides and platform capability validation, and expose build configuration discovery/validation APIs.
  • Document installation, selection precedence, source overrides and verification commands. No local tarball paths are committed.

Validation:

  • 53 SDK selection, consumer, installation and packaging regression tests passed.
  • Full postinstall passed with installed npm SDKs, including CLI compilation, declaration generation (13 snapshot tests), and minimal tool preparation.
  • Downloaded matching Web/Editor 4.0.0-beta.3 tarballs from engine CI run 45095777994 and verified checksums/release identities.
  • Fresh projects without engine dependencies or engineSdk configuration completed Web and Taobao builds using CLI-installed packages. Chrome verified scene frames, image/Sprite loading and direct npm imports without uncaught exceptions.

Limitations: Native npm generation, signing/upload, engine separation and WASM subpackages are not validated here. Taobao simulator operation was confirmed separately by the user. A non-blocking System type redeclaration warning remains in module-system; it also reproduces with source engines. Legacy 3.7.2 source preparation reports Unknown platform: NODEJS, and the current 4.0 source Web build reports Missing class properties transform; this change does not claim to fix those source compilation failures.

@bofeng-song
bofeng-song requested a review from star-e November 20, 2026 07:57
@bofeng-song bofeng-song changed the title feat(engine): distribute Web and Editor SDKs as npm packages feat(engine): consume installed Web and Editor SDK packages Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant