feat(apps): export ENGINE_VERSION from definition layer#40183
feat(apps): export ENGINE_VERSION from definition layer#40183d-gubert wants to merge 1 commit intofeat/apps-engine-splitfrom
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/apps-engine-split #40183 +/- ##
==========================================================
- Coverage 70.13% 70.11% -0.03%
==========================================================
Files 3284 3284
Lines 117428 117428
Branches 20757 20757
==========================================================
- Hits 82361 82330 -31
- Misses 31781 31795 +14
- Partials 3286 3303 +17
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Adds `src/definition/version.ts` which reads the package version via
`resolveJsonModule` and exports it as `ENGINE_VERSION`.
Replaces `AppPackageParser.getEngineVersion()` — which resolved the
version by traversing the filesystem relative to `__dirname` — with a
direct import of `ENGINE_VERSION`. This removes the assumption that
`package.json` lives at a predictable relative path, which will break
when `AppPackageParser` moves to a different package during the
apps-engine split.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix(apps-engine): fix ENGINE_VERSION runtime path in compiled output
Static `import { version } from '../../package.json'` resolves correctly
during TypeScript compilation (source lives at src/definition/) but the
emitted require('../../package.json') exits the package root at runtime
once compiled to definition/version.js (outDir='.', rootDir='./src').
Switching to require('../package.json') — which is the correct path
relative to the compiled output — and bypassing TypeScript's compile-time
module resolution avoids the path mismatch entirely.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bdb5d73 to
2ab8b32
Compare
Proposed changes (including videos or screenshots)
Adds
src/definition/version.tswhich reads the package version viaresolveJsonModuleand exports it asENGINE_VERSION.Replaces
AppPackageParser.getEngineVersion()— which resolved the version by traversing the filesystem relative to__dirname— with a direct import ofENGINE_VERSION. This removes the assumption thatpackage.jsonlives at a predictable relative path, which will break whenAppPackageParsermoves to a different package during theapps-engine split.
Issue(s)
Steps to test or reproduce
Further comments
Related to the "Apps-Engine split" stack: