Skip to content

feat(apps): export ENGINE_VERSION from definition layer#40183

Draft
d-gubert wants to merge 1 commit intofeat/apps-engine-splitfrom
feat/apps-engine-split--pr1-engine-version
Draft

feat(apps): export ENGINE_VERSION from definition layer#40183
d-gubert wants to merge 1 commit intofeat/apps-engine-splitfrom
feat/apps-engine-split--pr1-engine-version

Conversation

@d-gubert
Copy link
Copy Markdown
Member

@d-gubert d-gubert commented Apr 16, 2026

Proposed changes (including videos or screenshots)

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.

Issue(s)

Steps to test or reproduce

Further comments

Related to the "Apps-Engine split" stack:

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented Apr 16, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 16, 2026

⚠️ No Changeset found

Latest commit: 2ab8b32

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 16, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b37aae38-a0db-42fe-a95f-856201f33ce7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.11%. Comparing base (f621848) to head (2ab8b32).

Additional details and impacted files

Impacted file tree graph

@@                    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     
Flag Coverage Δ
e2e 59.67% <ø> (-0.09%) ⬇️
e2e-api 47.31% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@d-gubert d-gubert changed the title feat(apps-engine): export ENGINE_VERSION from definition layer feat(apps): export ENGINE_VERSION from definition layer Apr 16, 2026
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>
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