Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enhance hints for bare Node.js built-in modules #26669

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

bartlomieju
Copy link
Member

The hint was not helpful in all situations as it didn't list the
--unstable-bare-node-builtins flag or the bare-node-builtins
option in the unstable config.

@birkskyum
Copy link
Contributor

birkskyum commented Nov 1, 2024

I'm wondering if it makes sense to silence these warnings when the explicit --unstable-bare-node-builtins flag is provided. Maybe a bit of nudging to get things cleaned up is okay.

➜ deno run --unstable-bare-node-builtins -A ../packages/create-solid/src/index.ts
Warning Resolving "fs/promises" as "node:fs/promises" at file:///Users/admin/repos/solid-cli/packages/commands/dist/handlers/new.mjs:1:324. If you want to use a built-in Node module, add a "node:" prefix.
Warning Resolving "path" as "node:path" at file:///Users/admin/repos/solid-cli/packages/commands/dist/handlers/new.mjs:1:372. If you want to use a built-in Node module, add a "node:" prefix.
Warning Resolving "fs" as "node:fs" at file:///Users/admin/repos/solid-cli/packages/commands/dist/handlers/new.mjs:1:475. If you want to use a built-in Node module, add a "node:" prefix.
Warning Resolving "fs/promises" as "node:fs/promises" at file:///Users/admin/repos/solid-cli/packages/utils/dist/index.mjs:1:256. If you want to use a built-in Node module, add a "node:" prefix.
Warning Resolving "os" as "node:os" at file:///Users/admin/repos/solid-cli/packages/utils/dist/index.mjs:1:306. If you want to use a built-in Node module, add a "node:" prefix.
Warning Resolving "path" as "node:path" at file:///Users/admin/repos/solid-cli/packages/utils/dist/index.mjs:1:375. If you want to use a built-in Node module, add a "node:" prefix.
Warning Resolving "util" as "node:util" at file:///Users/admin/repos/solid-cli/packages/utils/dist/index.mjs:5:158. If you want to use a built-in Node module, add a "node:" prefix.
Warning Resolving "fs/promises" as "node:fs/promises" at file:///Users/admin/repos/solid-cli/packages/utils/dist/fs/index.mjs:1:26. If you want to use a built-in Node module, add a "node:" prefix.
Warning Resolving "fs/promises" as "node:fs/promises" at file:///Users/admin/repos/solid-cli/packages/utils/dist/updates/index.mjs:1:37. If you want to use a built-in Node module, add a "node:" prefix.

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +760 to +761
Some(format!("If you want to use a built-in Node module, add a \"node:\" prefix (ex. \"node:{specifier}\"), or use
--unstable-bare-node-builtins flag, or specify `bare-node-builtins` in the `unstable` option in the config file."))
Copy link
Member Author

Choose a reason for hiding this comment

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

This should actually be reverted, because it's only shown when the flag is present

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.

3 participants