This is an automated email from the ASF dual-hosted git repository.
xuang7 pushed a commit to branch release/v1.2
in repository https://gitbox.apache.org/repos/asf/texera.git
The following commit(s) were added to refs/heads/release/v1.2 by this push:
new 67d6676123 fix(frontend): use default import for package.json version
in dev build (#5444) [release/v1.2 backport] (#5617)
67d6676123 is described below
commit 67d6676123edbfec074a9968fdc5a3afbb5e10f3
Author: Matthew B. <[email protected]>
AuthorDate: Wed Jun 10 22:14:37 2026 -0700
fix(frontend): use default import for package.json version in dev build
(#5444) [release/v1.2 backport] (#5617)
### What changes were proposed in this PR?
Backport of #5444 ("fix(frontend): use default import for package.json
version in dev build") to `release/v1.2`.
Applies as a clean `git cherry-pick -x` of the merged squash commit
`ce919243`, no conflicts and no prerequisite chain. Frontend-only: 2
files changed, 35 insertions, 2 deletions, identical to the original.
For the full change description, see #5444. In brief: the dev build
reads the package.json version via a named import, which breaks under
the dev build's JSON module handling; this switches to a default import
so the version resolves correctly.
### Any related issues, documentation, discussions?
Closes: #5620
Backports #5444 (which closes #5443 on `main`). Requested by @xuang7 for
the v1.2 release; the PR was merged before the `release/v1.2` label
existed, so auto-backport did not trigger.
### How was this PR tested?
This is a backport with no changes beyond the single cherry-picked
commit, so it relies on the existing tests carried over from #5444
(added `version.spec.ts`). Run them with `yarn test
--include='**/version.spec.ts'` from `frontend/`.
Backport fidelity was verified locally: after the cherry-pick, every
file touched by #5444 is byte-identical to its state on `main` at the
merged commit (`ce919243`), and `release/v1.2` had no independent
changes to any of those files.
Full compile and unit-test runs are left to CI.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.8)
---
.../src/environments/{version.ts => version.spec.ts} | 19 ++++++++++++-------
frontend/src/environments/version.ts | 5 +++--
2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/frontend/src/environments/version.ts
b/frontend/src/environments/version.spec.ts
similarity index 66%
copy from frontend/src/environments/version.ts
copy to frontend/src/environments/version.spec.ts
index 34748af22b..4416ff4fb5 100644
--- a/frontend/src/environments/version.ts
+++ b/frontend/src/environments/version.spec.ts
@@ -17,11 +17,16 @@
* under the License.
*/
-import { version } from "../../package.json";
+import packageJson from "../../package.json";
+import { Version } from "./version";
-// Dev placeholder. Production builds replace this file with the generated
-// version.prod.ts (see angular.json fileReplacements +
frontend/build-version.js).
-export const Version = {
- buildNumber: "dev",
- version,
-};
+describe("Version (dev environment)", () => {
+ it("exposes the version from package.json", () => {
+ expect(Version.version).toBe(packageJson.version);
+ expect(Version.version.length).toBeGreaterThan(0);
+ });
+
+ it('uses the "dev" build number placeholder', () => {
+ expect(Version.buildNumber).toBe("dev");
+ });
+});
diff --git a/frontend/src/environments/version.ts
b/frontend/src/environments/version.ts
index 34748af22b..901d9accc8 100644
--- a/frontend/src/environments/version.ts
+++ b/frontend/src/environments/version.ts
@@ -17,11 +17,12 @@
* under the License.
*/
-import { version } from "../../package.json";
+// Default import: Angular's webpack rejects named JSON imports.
+import packageJson from "../../package.json";
// Dev placeholder. Production builds replace this file with the generated
// version.prod.ts (see angular.json fileReplacements +
frontend/build-version.js).
export const Version = {
buildNumber: "dev",
- version,
+ version: packageJson.version,
};