Skip to content

fix(windmill-utils-internal): move config to subpath export#9045

Merged
hugocasa merged 1 commit into
mainfrom
fix/windmill-utils-internal-config-subpath
May 5, 2026
Merged

fix(windmill-utils-internal): move config to subpath export#9045
hugocasa merged 1 commit into
mainfrom
fix/windmill-utils-internal-config-subpath

Conversation

@hugocasa
Copy link
Copy Markdown
Collaborator

@hugocasa hugocasa commented May 5, 2026

Summary

  • The config module in `windmill-utils-internal` statically imports `node:fs/promises` (`stat`, `mkdir`). The windmill SPA frontend got away with it because Vite/Rollup tree-shook the unused re-export, but stricter runtimes (e.g. the Cloudflare Workers build of the hub) reject the bare `node:` import even when unused.
  • Stop re-exporting `./config` from the package main entry and expose it via a `windmill-utils-internal/config` subpath instead. CLI code already deep-imports the source files, so it's unaffected.
  • Bump the package to `1.4.0` and update the frontend dependency to match.

This is a breaking change for any external consumer that imported config helpers from the main entry — they would now need `from 'windmill-utils-internal/config'`. No in-repo consumer does this.

Test plan

  • Publish `windmill-utils-internal@1.4.0` to npm
  • `npm install` in `frontend/` and run `npm run check`
  • Verify the Cloudflare hub build no longer pulls `node:fs/promises` from this package
  • CLI `wmill workspace add` / `wmill instance add` still write/read config files correctly

🤖 Generated with Claude Code


Summary by cubic

Move config helpers to a subpath export in windmill-utils-internal so the main entry no longer imports node:fs/promises. This fixes Cloudflare Workers builds and bumps the package to 1.4.0 (frontend updated).

  • Bug Fixes

    • Stop re-exporting ./config from the main entry; expose windmill-utils-internal/config to avoid bare node: imports. CLI usage is unchanged.
  • Migration

    • If you imported config from windmill-utils-internal, switch to import ... from 'windmill-utils-internal/config'.

Written for commit 407e7ed. Summary will update on new commits.

The config module imports node:fs/promises (stat, mkdir), which breaks
non-Node bundlers like the Cloudflare Workers build of the hub. The
windmill SPA frontend got away with it via tree-shaking, but stricter
runtimes choke on the bare node: import even when unused.

Stop re-exporting ./config from the main entry and expose it via a
windmill-utils-internal/config subpath instead. CLI code already
deep-imports the source file, so it is unaffected. Bumps the package
to 1.4.0 and updates the frontend dependency to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hugocasa hugocasa marked this pull request as ready for review May 5, 2026 16:22
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: 407e7ed
Status: ✅  Deploy successful!
Preview URL: https://68348ea6.windmill.pages.dev
Branch Preview URL: https://fix-windmill-utils-internal.windmill.pages.dev

View logs

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 5, 2026

Claude finished @hugocasa's task in 2m 3s —— View job


Claude Code Review

Good to merge

Summary

The change cleanly addresses the stated problem: removing export * from "./config" from cli/windmill-utils-internal/src/index.ts ensures the main package entry no longer transitively pulls in node:fs/promises (the only place that import lives is src/config/config.ts). The new ./config subpath export wires dist/{cjs,esm}/config/index.js + dist/esm/config/index.d.ts, and those paths line up with the existing tsconfig.{cjs,esm}.json (rootDir: ./src, outDir: ./dist/cjs|esm, declaration: true), so the build will emit the targets the exports map points at.

Compatibility check

  • Frontend (frontend/src) — only imports argSigToJsonSchemaType and the *deploy* helpers from 'windmill-utils-internal'; none of them touch ./config. No fix needed.
  • CLI (cli/src) — already deep-imports config via relative source paths (../../../windmill-utils-internal/src/config/config.ts from commands/workspace/workspace.ts, commands/instance/instance.ts, core/store.ts, etc.), so removing the re-export from index.ts doesn't affect it.
  • Other in-repo consumers of the config subpath — none (grep for windmill-utils-internal/config returns no hits). The only impact is on hypothetical external consumers, which the PR description already calls out.

AGENTS.md compliance

No violations — this is a config/packaging-only change, no Rust or Svelte code touched.

Test coverage

This is a packaging change (package.json, lockfiles, and one removed re-export). No automated tests are expected here.

Manual verification before merge should cover what the PR test plan already lists: after publishing 1.4.0, run npm install && npm run check in frontend/ to confirm type resolution still works for the main-entry imports (argSigToJsonSchemaType, sharedDeployItem, etc.); rerun the Cloudflare hub build to confirm node:fs/promises is no longer pulled in; and exercise wmill workspace add / wmill instance add to confirm CLI config read/write still works (it uses deep relative imports, so it should be unaffected — but worth a smoke test since this is the load-bearing path).
| Branch

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 5 files

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Pi Review

Good to merge.


Summary: This PR removes export * from "./config" from the windmill-utils-internal main entry and exposes ./config as a dedicated subpath export. The config module imports node:fs/promises, which causes build failures in environments without Node.js builtins (e.g., Cloudflare Workers). All in-repo consumers are verified unaffected — CLI consumers deep-import source files directly, and the three frontend imports (argSigToJsonSchemaType, DeployResult) don't touch config exports. The bump to 1.4.0 is consistent across all four changed files.

No issues found.


Test coverage: This is a package-structure / exports change with no new logic. The test plan in the PR body (publish 1.4.0, npm install && npm run check in frontend, verify Cloudflare hub build, and CLI config commands still work) is appropriate. No automated tests are expected for a re-export removal + package.json wiring change. Manual verification steps from the PR body are sufficient.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Codex Review

Good to merge

No issues found. Checked for bugs, security, and AGENTS.md compliance.

Test coverage: This is a package metadata/export and frontend dependency update; no new frontend pure logic or backend behavior was added, so no automated tests are required by the review policy.

Manual verification still useful before merge: run the frontend install/check path with windmill-utils-internal@1.4.0, and verify the Cloudflare hub/frontend build does not pull node:fs/promises from the package main entry.

@hugocasa hugocasa enabled auto-merge May 5, 2026 18:34
@hugocasa hugocasa disabled auto-merge May 5, 2026 18:38
@hugocasa hugocasa merged commit b86f896 into main May 5, 2026
32 checks passed
@hugocasa hugocasa deleted the fix/windmill-utils-internal-config-subpath branch May 5, 2026 18:39
@github-actions github-actions Bot locked and limited conversation to collaborators May 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant