Commit Graph

8 Commits

Author SHA1 Message Date
Nathan Rajlich 78301695ea fix(builders): avoid false-positive node-module errors for step-only usage in shared modules (#1821)
The workflow-node-module-error plugin records violations in onResolve, which
runs before esbuild's tree-shaker. A shared module with both a workflow-safe
export and a step-only export that imports node:* would be flagged even when
the workflow never reached the step-only export.

Mark node:/bun: imports as sideEffects: false so esbuild can tree-shake them
when unused in surviving code, enable metafile, and filter recorded violations
in onEnd against outputs[].imports so only builtins that actually survive in
the emitted bundle are reported.

Fixes #1817
2026-05-01 17:57:56 +00:00
Pranay Prakash d1330cfebc Fix node-module-error plugin matching identifiers in multi-line comments (#1554)
* Fix node-module-error plugin matching identifiers in multi-line comments

The findIdentifierUsage function only stripped single-line comments and
same-line block comments, but didn't track multi-line block comment state.
Lines inside JSDoc/block comments (e.g. ` * ... Writable stream`) passed
through unstripped, causing the plugin to point at comments instead of
actual code usage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Strip string literals before scanning for comment delimiters

Move string stripping before comment detection so that comment delimiters
inside string literals (e.g. `const s = "/*"`) don't incorrectly trigger
block comment mode. Adds regression test.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
2026-04-03 11:55:11 -07:00
JJ Kasper 6cce021503 fix(builders): catch node builtin usage when entry fields diverge (#1455)
* fix(builders): catch node builtin usage when entry fields diverge

* test(core): stabilize external package node-module build error case
2026-03-23 12:50:06 -07:00
Nathan Rajlich dc44dab49d Biome config tweaks and fixes applied (#741) 2026-01-07 12:52:52 -08:00
Adrian b73fc72f0e test: fix getViolationLocation sync in test (#540) 2025-12-04 18:25:03 -08:00
Adrian fc774e57d0 fix: error messages in esbuild node module plugin (#264)
* feat: add file dependency tracing for node module plugin

* feat: add violation identifier and read file to show contents

* Update packages/builders/src/node-module-esbuild-plugin.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* changeset

* fix: node module plugin silently failing when enhanced resolve fails

* chore: fix comment jsdoc

* fix: infinite loop in traversing dep grpah

* Update packages/builders/src/node-module-esbuild-plugin.test.ts

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* fix

* cleanup

* test: add comprehensive build errors test

* add more tests

* fix generate workflows

* update test

* fix: use readFile over readFileSync

* fix test

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
2025-12-04 16:53:41 -08:00
Adrian c2fa9df87d fix: node module plugin in workflow and add tests (#210)
* fix: node module plugin in workflow and add tests

* fix: node modules regex

* changeset
2025-11-04 16:39:56 -08:00
Pranay Prakash 652485aa30 feat: create @workflow/builders package with shared builder infrastructure (#73)
This commit extracts builder infrastructure from @workflow/cli into a new
shared @workflow/builders package. This improves code organization by:

- Creating a dedicated package for builder functionality
- Allowing @workflow/next and @workflow/nitro to depend on builders directly
- Reducing coupling between framework integrations and the CLI
- Preparing for moving NextBuilder to @workflow/next in the next PR

Changes:
- Created new @workflow/builders package
- Moved BaseBuilder, BasicBuilder, and VercelBuildOutputAPIBuilder
- Moved esbuild plugins (swc, discover-entries, node-module)
- Moved WorkflowConfig and BuildTarget types
- Updated @workflow/cli to import from @workflow/builders
- Updated @workflow/nitro to import from @workflow/builders
- Re-exported types from CLI for backwards compatibility

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 13:37:39 -08:00