Document the production build, and correct the /resources story - #17
Merged
Conversation
The deployment page said `npm run build` and stopped there. What that actually has to run is `npm ci` + `npm run build:production` — `cds build --production` plus `scripts/vendor-core.js` — because the CDS build stages gen/srv with the app's `"abap2UI5": "file:./core"` dependency and does not stage the folder it names. Without the second half the archive builds, `cf deploy` succeeds, and the instance crash-loops on `Cannot find module 'abap2UI5/engine'`; that was the state of the shipped app until cap2UI5/builder-cap2UI5 fixed it. Readers vendoring a `file:` dependency in their own CAP project hit the same thing, so the section also names the CAP-supported alternative (npm workspaces + `cds build --ws-pack`). Also records that openui5-dist is not deployed — on BTP `/resources` comes from the `ui5` destination — and adds abap2UI5-db-deployer to the mta.yaml module list, which the page had omitted. Troubleshooting claimed the server "fails at startup with an explicit message" when openui5-dist is missing. It does not: srv/cap/activate.js warns once and carries on, so the symptom is a blank page and a log line, not a failed boot. Corrected, with the actual message and a separate entry for the BTP case, where a /resources 404 means the destination is wrong rather than a missing dependency. verify-refs --require-checkout passes against a cap2UI5 checkout; site builds. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R2ofjmLGtR9pKxi3m2KvMq
Follows builder-abap2UI5-js@815593e. openui5-dist is no longer a dependency of the framework package, so a project using the core installs it itself if it wants the local /resources runtime — the docs said nothing about that and would have left readers with a 404 they could not explain. Deployment gains the numbers behind the decision (611 MB, 43 advisories, 3 critical, none of it code the app loads) and states that the staged module leaves it out via `npm ci --omit=dev` rather than only via the vendor step's prune. Troubleshooting names the install to run when a project never declared it. verify-refs --require-checkout passes against a cap2UI5 checkout; site builds. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R2ofjmLGtR9pKxi3m2KvMq
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.
Independent of the other three PRs in this set — safe to merge in any order.
Deployment
The page said
npm run buildand stopped there. What that actually has to run isnpm ci+npm run build:production—cds build --productionplusscripts/vendor-core.js— because the CDS build stagesgen/srvwith the app's"abap2UI5": "file:./core"dependency and does not stage the folder it names. Without the second half the archive builds,cf deploysucceeds, and the instance crash-loops onCannot find module 'abap2UI5/engine'; that was the state of the shipped app until cap2UI5/builder-cap2UI5#26.Readers vendoring a
file:dependency in their own CAP project hit exactly the same thing, so the section also names the CAP-supported alternative (npm workspaces +cds build --ws-pack).Also records that
openui5-distis not deployed — on BTP/resourcescomes from theui5destination — with the numbers behind that decision (611 MB, 43 advisories, 3 critical, none of it code the app loads), and addsabap2UI5-db-deployerto the mta.yaml module list, which the page had omitted.Troubleshooting
The page claimed the server "fails at startup with an explicit message" when
openui5-distis missing. It does not:srv/cap/activate.jswarns once and carries on, so the symptom is a blank page and a log line, not a failed boot. Corrected, with the actual message, plus a separate entry for the BTP case where a/resources404 means the destination is wrong rather than a missing dependency — and the install to run now that the framework declares it as an optional peer dependency rather than a dependency.Verification
verify-refs --require-checkoutpasses against a cap2UI5 checkout; site builds.Generated by Claude Code