Skip to content

remove node types and bun types from workflows#199

Open
ernest-nowacki wants to merge 19 commits intomainfrom
feat/no-node-types
Open

remove node types and bun types from workflows#199
ernest-nowacki wants to merge 19 commits intomainfrom
feat/no-node-types

Conversation

@ernest-nowacki
Copy link
Contributor

@ernest-nowacki ernest-nowacki commented Feb 25, 2026

Summary

CRE workflows run inside a Javy/QuickJS WASM sandbox — not Node.js.

This is often coming back and throwing users off guard. Changes proposed in this PR aims to be solid first step to improve that experience.

Compile-time: Type-level restrictions

We're adding custom types to a whole set of common Node built-in modules (node:crypto, node:fs, node:http, node:net, etc.). This custom type mark those APIs as never which will result in clear errors when running workflows.

Our cre-sdk-examples will now present have now

We also Removed @types/node and bun-types and our cre-sdk-examples will now behave like user workflows now, correctly showing what is available.

Build-time: Static analysis validator

There's an extra step added during workflow compilation that would check for usage of restricted node modules. It would produce readable errors instead of weird WASM traces.

Screenshot 2026-03-03 at 14 48 19

What is not covered

Current implementation doesn't cover 3rd party libraries. For example if I import my-custom-hashes library which under the hoods is using unavailable NodeJS APIs we wouldn't be able to catch it as nicely as current direct node imports.

That's because it would require skipLibCheck option set to false in TypeScript which is not a common practice and we could get more reports about unrelated 3rd party libs erroring out. I will keep exploring this - but I think current proposal already uplifts DX experience of the SDK a lot.

@ernest-nowacki ernest-nowacki marked this pull request as ready for review February 26, 2026 09:32
@ernest-nowacki ernest-nowacki requested review from a team as code owners February 26, 2026 09:32
@ernest-nowacki ernest-nowacki marked this pull request as draft February 26, 2026 09:48
@ernest-nowacki ernest-nowacki marked this pull request as ready for review March 2, 2026 14:53
@ernest-nowacki ernest-nowacki marked this pull request as draft March 2, 2026 15:29
@ernest-nowacki ernest-nowacki marked this pull request as ready for review March 3, 2026 14:33
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