Skip to content

chore(build): run the plugin generator with node - #5943

Merged
norman-abramovitz merged 4 commits into
cloudfoundry:developfrom
nabramovitz:norm/chore/prebuild-native-ts
Sep 23, 2026
Merged

norman-abramovitz merged 4 commits into
cloudfoundry:developfrom
nabramovitz:norm/chore/prebuild-native-ts

Conversation

@nabramovitz

@nabramovitz nabramovitz commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

The pre-build ran the backend plugin generator (src/frontend/packages/devkit/src/backend.ts) through npx tsx, but tsx is not a dependency anywhere in the tree. So on every build npx went to the registry for the newest release:

npm warn exec The following package was not found and will be installed: tsx@4.23.15

That means each build fetched unpinned code over the network, and the pre-build failed without registry access. The line also shows up in every make check gate run.

Change

The generator doesn't need a transpiler. It imports only Node built-ins and js-yaml and uses only erasable type syntax, so node runs it directly by stripping the types. The useTsx flag and the npx tsx branch in build/build-orchestrator.js go away, and every tool now runs with node. The engines range, ^24 || ^26, already includes Node versions that support this.

The angular.json builder path runs the compiled dist-devkit/src/backend.js and is not affected.

The screenshot scripts

e2e:screenshot:compare had the same problem through bun: it ran bunx tsx, and both e2e/scripts/compare-screenshots.ts and gallery-screenshots.ts carried a tsx shebang and tsx usage lines. They import only Node built-ins plus pngjs and pixelmatch (root dev dependencies), so they now run with node too. The report and gallery HTML are byte-identical under bunx tsx and node, across changed, identical, resized and one-sided screenshots, and bun run e2e:screenshot:compare works through the package script.

tools/stb still documents npx tsx for its model generator. It's left out here: that script uses extensionless relative imports, so it does need tsx, and the fix is pinning tsx in tools/stb/package.json.

Verification

  • extra_plugins.go is byte-identical when generated by tsx, Node 24.0.0, Node 24.21.0 and Node 26.
  • Node 24.0.0 prints an ExperimentalWarning for type stripping. 24.21.0, which CI's node-version: '24' resolves to, prints nothing.
  • make check gate passes with no npm warn lines. The generator step now takes 0.06 s.

The pre-build ran devkit/src/backend.ts through `npx tsx`, but tsx is
not a dependency anywhere in the tree. npx therefore downloaded the
newest tsx from the registry on every build ("npm warn exec The
following package was not found and will be installed: tsx@4.23.15"),
so each build fetched unpinned code over the network, and the build
failed without registry access.

The script needs no transpiler. It imports only Node built-ins and
js-yaml and uses only erasable type syntax, so Node runs it directly by
stripping the types. The engines range, ^24 || ^26, already covers
that. The generated extra_plugins.go is byte-identical under tsx, Node
24.0.0, 24.21.0 and 26. 24.0.0 prints an ExperimentalWarning for type
stripping; 24.21.0, which CI resolves for node-version '24', does not.

@norman-abramovitz norman-abramovitz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

The same unpinned fetch as the pre-build generator:
e2e:screenshot:compare ran `bunx tsx`, and both screenshot scripts
carried a tsx shebang and tsx usage lines, with tsx declared nowhere.
bunx resolved the newest tsx from the registry on each run.

Both scripts import only Node built-ins plus pngjs and pixelmatch,
which are root dev dependencies, so node runs them directly. The
report and gallery HTML are byte-identical under bunx tsx and node,
across changed, identical, resized and one-sided screenshots.

@norman-abramovitz norman-abramovitz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@norman-abramovitz
norman-abramovitz merged commit 7755ad2 into cloudfoundry:develop Sep 23, 2026
24 checks passed
@nabramovitz
nabramovitz deleted the norm/chore/prebuild-native-ts branch September 23, 2026 16:18
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.

2 participants