You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@texera.apache.org by gi...@apache.org on 2026/06/07 05:24:35 UTC

(texera) branch gh-readonly-queue/main/pr-5444-e987f133f4a1d4be131add116cb3d8303a8acce6 created (now cbe07e14f9)

This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a change to branch gh-readonly-queue/main/pr-5444-e987f133f4a1d4be131add116cb3d8303a8acce6
in repository https://gitbox.apache.org/repos/asf/texera.git


      at cbe07e14f9 fix(frontend): use default import for package.json version in dev build (#5444)

This branch includes the following new commits:

     new cbe07e14f9 fix(frontend): use default import for package.json version in dev build (#5444)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(texera) 01/01: fix(frontend): use default import for package.json version in dev build (#5444)

Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-5444-e987f133f4a1d4be131add116cb3d8303a8acce6
in repository https://gitbox.apache.org/repos/asf/texera.git

commit cbe07e14f91c624d1e4c97da514481e607df8c6a
Author: Matthew B. <mg...@uci.edu>
AuthorDate: Sat Jun 6 22:24:14 2026 -0700

    fix(frontend): use default import for package.json version in dev build (#5444)
    
    ### What changes were proposed in this PR?
    - Change `frontend/src/environments/version.ts` to import `package.json`
    with a default import (`packageJson.version`) instead of a named import
    (`import { version }`).
    - Why it is a bug: Angular 21's webpack rejects named imports from JSON
    modules, so `ng serve` (dev) fails to compile and the dev server serves
    "Cannot GET /" (HTTP 404). Production builds are unaffected because
    `angular.json` fileReplacements swaps in `version.prod.ts`.
    ### Any related issues, documentation, discussions?
    Closes #5443 (regression introduced by #5153).
    ### How was this PR tested?
    - From `frontend/` on Node >=24, run `yarn start` and confirm the dev
    server compiles with no errors (previously failed on `version.ts` with
    `Failed to compile.`).
    - Open http://localhost:4200/ and confirm the app loads (HTTP 200, page
    title "Texera") instead of "Cannot GET /".
    - Confirm the UI footer still shows the version string from
    `package.json`.
    ### 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,
 };