Repository navigation
npm backend: transpile the dev apps WITH the framework on a release that can - #59
Merged
Merged
Conversation
…hat can From the @abap2ui5/node-runtime release after 1.147.0 on, the package transpiles a host's classes together with the framework and writes an entry point into the host's own output (abap2UI5/abap2UI5#2916) - what the transpiler's maintainer asked for on abaplint/transpiler#1999 instead of a library left out of the output. - fullTranspileOf: such a release records abap2ui5.expressIcfShim and carries setup/transpile.mjs and srv/framework.mjs. - buildFull: the sandbox and the package's downport/ in one transpile, open-abap-core and express-icf-shim (ensureGitLibrary, generalised from ensureOpenAbapCore) by url as the libraries, into a staging that is the new apps/ - a complete runtime, its init.mjs and runner as written. The package's own writeEntry( ) writes host.mjs and claim.mjs into it (a child, the output as argv[1] so the module does not run as its bin); the build adds boot.mjs. Nothing rewritten. - npm-host: a full build is booted through apps/boot.mjs, the exports taken from apps/host.mjs - the package's entry point is never imported. - app_list names dev and framework apps by the sandbox on a full build. - Releases up to 1.147.0 build exactly as before. Measured against the release packed from abap2UI5#2916: a changed build 16 s with both fetches (8 s before), an unchanged one 0 s; unit run, app start and the framework catching the app's own exception all work. The fixture gains a 'full' release whose entry point throws when imported; npm test 554 pass, the network integration test against the published release passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GPMAtn6BycCF2mKRUHGpek
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.
From the
@abap2ui5/node-runtimerelease after 1.147.0 on, the package transpiles a host's classes together with the framework and writes an entry point into the host's own output (abap2UI5/abap2UI5#2916). That is what the transpiler's maintainer asked for on abaplint/transpiler#1999 (closed), instead of an option that leaves a library out of the output. This PR builds the dev apps that way on such a release. Older releases build exactly as before.What changes
fullTranspileOfrecognises a release that can do this: it recordsabap2ui5.expressIcfShimand carriessetup/transpile.mjsandsrv/framework.mjs.buildFulltranspiles everything in one run:downport/;ensureGitLibrary, generalised fromensureOpenAbapCore;apps/, a complete runtime. Itsinit.mjscreates every table and its runner is left exactly as the transpiler wrote it.writeEntry( )writeshost.mjsandclaim.mjsintoapps/. It runs as a child with the output asargv[1], so the module does not start its CLI. The build addsboot.mjs.npm-host: a full build is booted throughapps/boot.mjs, and the exports come fromapps/host.mjs. The package's own entry point is never imported; it would load a second runtime, which the package refuses.app_list: on a full build,apps/also holds the framework, so dev and framework apps are told apart by the sandbox's names, as on a checkout.fullandexpressIcfShim, and the build record gainslayout: "full". CHANGELOG and AGENTS.md describe it.Tests
layout: 'full'release whose package entry point throws when it is imported.npm-runtime.test.mjschecks:apps/is a complete runtime, and the transpiler's imports are left untouched;boot.mjsand the build record are correct;apps/;npm-host.test.mjschecks that the full build is served throughapps/host.mjs.npm-backend.test.mjscovers the pure helpers.z2ui5_cl_ui5_app_hi_worldand the own app started, and the framework caught the app's own exception (500 namingZCX_E2E_ERROR);app_listlabelled the apps correctly.npm run checkgives 554 passed and 17 skipped. WithA2UI5_MCP_NETWORK_TESTS=1,npm-integration.test.mjsagainst the published 1.147.0 (old path) passes.Lands safely before the release: on 1.147.0 and earlier nothing changes.
🤖 Generated with Claude Code
https://claude.ai/code/session_01GPMAtn6BycCF2mKRUHGpek
Generated by Claude Code