Skip to content

Emit JavaScript for installed Lara packages - #120

Open
lm-sousa wants to merge 3 commits into
lara-4from
ast-protobuf
Open

lm-sousa wants to merge 3 commits into
lara-4from
ast-protobuf

Conversation

@lm-sousa

@lm-sousa lm-sousa commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Installed Lara packages exported TypeScript from node_modules, which Node 24 refuses to strip. Emit JavaScript and declarations before packing, route package exports and the CLI to those artifacts, and select the default Weaver script according to whether the launcher runs from source or emitted code. This supports the paired Clava packaging fix without changing the Java transport.

Validation: TypeScript build and package-runtime tests passed. Packed Node 24 local and global installs passed Clava and Lara CLI help and exported API imports. The local smoke approved only the java addon install script under npm 11 before rebuilding it. Final Lara source suite passes 54 cases with one expected-failure case; paired Clava passes 162 cases with two skips. The emitted Vitest environment and default Java-binary paths now match source behavior, generated test copies are excluded, and a packed-package config smoke passes. Windows-specific launcher/path checks were source-reviewed and corrected; local smoke execution was on Linux. CI currently stops before compilation because the shared dependency resolver reports ambiguous Specs branches.

This PR targets the existing Lara 4 lineage. No stable publication or master merge is requested.

Publish the existing Lara import paths and CLI through emitted JavaScript and declarations. Resolve the default Weaver script from the launcher's extension so source mode keeps using Weaver.ts and packed mode uses Weaver.js. Add focused runtime checks for both modes.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T07:50:33.749362Z 5e001ea PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e001eaf67

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Lara-JS/package.json
"./vitest.config.ts": "./vitest.config.ts",
"./vitest/*.js": "./dist/vitest/*.js",
"./vitest/*": "./dist/vitest/*.js",
"./vitest/*.ts": "./dist/vitest/*.js",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Point the emitted Vitest config at the JavaScript environment

When an installed package imports @specs-feup/lara/vitest/weaverVitestConfig.ts, this export now loads dist/vitest/weaverVitestConfig.js, but createWeaverVitestConfig() still constructs its environment URL as ./weaverEnvironment.ts in vitest/weaverVitestConfig.ts:22-24. The packed package contains only dist/vitest/weaverEnvironment.js, so Vitest receives an absolute path to a nonexistent file and downstream suites using this shared configuration fail before any tests run. Resolve the environment extension from the emitted module or otherwise ensure the referenced file is packaged.

Useful? React with 👍 / 👎.

Resolve the shared test environment from the config module extension so source and packed JavaScript modes select their matching files. Keep the default repository config's Java path stable across source and dist layouts. Exclude emitted source tests, clean stale dist output, ignore dist during Vitest discovery, and add a packed-package Vitest smoke.
Convert configured environment URLs back to native paths for filesystem checks and invoke npm through the current Node executable using npm_execpath.
@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

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