Repository navigation
One command for the local setup, in a Codespace as well - #19
Merged
Merged
Conversation
`npm run start-local[:fe|:fe-v2|:card]` at the root now starts abap2UI5 in Node on localhost:3000 (@abap2ui5/node-runtime, a root devDependency) and then the example's dev server - nothing to install in a folder of its own. A backend already answering on port 3000 is used instead. `npm run backend` starts the backend alone, for the e2e tests. In a GitHub Codespace the port forwarding rewrites Origin and X-Forwarded-Host, so abap2UI5's CSRF check rejected every roundtrip with "CSRF validation failed - cross-origin request rejected". With CODESPACES=true, and only then, the local backend drops those headers before abap2UI5 reads them; AGENTS.md records the exception. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SSuTz9gad47nuvCgmUkpTr
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.
What changes
npm run start-local(and:fe,:fe-v2,:card) at the root now runs the whole local setup with one command. It starts abap2UI5 in Node onlocalhost:3000, then the example's dev server withui5-local.yaml. If a backend already answers on port 3000 (npm run backend, ornpm run expressin an abap2UI5 checkout), it uses that one instead.npm run backend(scripts/backend.mjs) starts only the backend, for example for the e2e tests.@abap2ui5/node-runtime(^1.148.0) andexpress(^5) are now root devDependencies.package-lock.jsonchanges accordingly; most of the churn is npm re-hoisting packages now that express 5 sits at the root.OriginandX-Forwarded-Host, so abap2UI5's CSRF check rejected every roundtrip with "CSRF validation failed - cross-origin request rejected". The local backend now dropsOrigin,RefererandX-Forwarded-Hostbefore abap2UI5 sees them, but only whenCODESPACES=true. Everywhere else the backend isserve()as it ships, host guard included.Delivery to the branches is unchanged:
scripts/is not delivered, and the examples' READMEs keep their own backend instructions.Why
Trying the examples locally used to need a second folder, a separate install and a second terminal. In a Codespace even that wasn't enough: the custom sections stayed empty (504 while no backend was running), then failed with the CSRF 403. Now
npm ci && npm run start-local:feis enough, locally and in a Codespace.Checked
npm run lint,npm run format:check,npm run abaplint(0 issues),npm run build(the control is in everydist/thirdparty/),ABAP2UI5_DIR=../abap2UI5 npm run bsp: all pass.npm run start-local:fe, tested with curl:CODESPACES: bundle 200, same-origin POST OK; Codespace-like headers → 403 (unchanged behaviour); a foreign Origin is refused by the host guard.CODESPACES=true: bundle 200, POST OK with Codespace-like headers.CODESPACESdetection) has not been run in a real Codespace yet.npx playwright testnot run here; CI runs it.Generated by Claude Code