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

Neutral JavaScript runtime support (Deno, Bun, etc) #54

Closed
sgammon opened this issue Mar 31, 2024 · 0 comments
Closed

Neutral JavaScript runtime support (Deno, Bun, etc) #54

sgammon opened this issue Mar 31, 2024 · 0 comments

Comments

@sgammon
Copy link
Contributor

sgammon commented Mar 31, 2024

Hey there @isaacs,

For context, I am using glob upstream, but I want to use it with Deno, and I can't because these imports need to be prefixed. PR is incoming shortly.

Related issues:

Distribution diff:

diff --git a/node_modules/minipass/dist/commonjs/index.js b/node_modules/minipass/dist/commonjs/index.js
index b6cdae8..b6487d9 100644
--- a/node_modules/minipass/dist/commonjs/index.js
+++ b/node_modules/minipass/dist/commonjs/index.js
@@ -10,9 +10,9 @@ const proc = typeof process === 'object' && process
         stdout: null,
         stderr: null,
     };
-const events_1 = require("events");
-const stream_1 = __importDefault(require("stream"));
-const string_decoder_1 = require("string_decoder");
+const events_1 = require("node:events");
+const stream_1 = __importDefault(require("node:stream"));
+const string_decoder_1 = require("node:string_decoder");
 /**
  * Return true if the argument is a Minipass stream, Node stream, or something
  * else that Minipass can interact with.
diff --git a/node_modules/minipass/dist/esm/index.js b/node_modules/minipass/dist/esm/index.js
index b65fafb..b5fa451 100644
--- a/node_modules/minipass/dist/esm/index.js
+++ b/node_modules/minipass/dist/esm/index.js
@@ -4,9 +4,9 @@ const proc = typeof process === 'object' && process
         stdout: null,
         stderr: null,
     };
-import { EventEmitter } from 'events';
-import Stream from 'stream';
-import { StringDecoder } from 'string_decoder';
+import { EventEmitter } from 'node:events';
+import Stream from 'node:stream';
+import { StringDecoder } from 'node:string_decoder';
 /**
  * Return true if the argument is a Minipass stream, Node stream, or something
  * else that Minipass can interact with.

This issue body was partially generated by patch-package.

sgammon added a commit to sgammon/minipass that referenced this issue Mar 31, 2024
This adjusts Node built-in imports to use the `node:` prefix, so
that such imports work on all runtimes.

Fixes and closes isaacs#54
Relates to isaacs/node-glob#580 and isaacs/path-scurry#16

Signed-off-by: Sam Gammon <[email protected]>
sgammon added a commit to sgammon/hashlock that referenced this issue Mar 31, 2024
- feat: support all popular js runtimes
  - patches for `glob`, `minipass`, and `path-scurry`
  - upstream prs (listed below)
  - test entrypoint commands
- test: add test entrypoints for each major runtime
- test: add scripts to test entrypoint with each major runtime
- chore: sync lockfiles

Related Issues
- isaacs/node-glob#580
- isaacs/path-scurry#16
- isaacs/minipass#54
- tj/commander.js#2169

Upstream PRs
- isaacs/node-glob#581
- isaacs/minipass#55
- isaacs/path-scurry#17
- tj/commander.js#2170

Signed-off-by: Sam Gammon <[email protected]>
sgammon added a commit to sgammon/hashlock that referenced this issue Mar 31, 2024
- feat: support all popular js runtimes
  - patches for `glob`, `minipass`, and `path-scurry`
  - upstream prs (listed below)
  - test entrypoint commands
- test: add test entrypoints for each major runtime
- test: add scripts to test entrypoint with each major runtime
- chore: sync lockfiles

Related Issues
- isaacs/node-glob#580
- isaacs/path-scurry#16
- isaacs/minipass#54
- tj/commander.js#2169

Upstream PRs
- isaacs/node-glob#581
- isaacs/minipass#55
- isaacs/path-scurry#17
- tj/commander.js#2170

Signed-off-by: Sam Gammon <[email protected]>
sgammon added a commit to sgammon/hashlock that referenced this issue Mar 31, 2024
- feat: support all popular js runtimes
  - patches for `glob`, `minipass`, and `path-scurry`
  - upstream prs (listed below)
  - test entrypoint commands
- test: add test entrypoints for each major runtime
- test: add scripts to test entrypoint with each major runtime
- chore: sync lockfiles

Related Issues
- isaacs/node-glob#580
- isaacs/path-scurry#16
- isaacs/minipass#54
- tj/commander.js#2169

Upstream PRs
- isaacs/node-glob#581
- isaacs/minipass#55
- isaacs/path-scurry#17
- tj/commander.js#2170

Signed-off-by: Sam Gammon <[email protected]>
sgammon added a commit to sgammon/hashlock that referenced this issue Mar 31, 2024
* feat: support all runtimes

- feat: support all popular js runtimes
  - patches for `glob`, `minipass`, and `path-scurry`
  - upstream prs (listed below)
  - test entrypoint commands
- test: add test entrypoints for each major runtime
- test: add scripts to test entrypoint with each major runtime
- chore: sync lockfiles

Related Issues
- isaacs/node-glob#580
- isaacs/path-scurry#16
- isaacs/minipass#54
- tj/commander.js#2169

Upstream PRs
- isaacs/node-glob#581
- isaacs/minipass#55
- isaacs/path-scurry#17
- tj/commander.js#2170

Signed-off-by: Sam Gammon <[email protected]>

* chore: version bump → `1.0.3`

Signed-off-by: Sam Gammon <[email protected]>

---------

Signed-off-by: Sam Gammon <[email protected]>
Signed-off-by: Sam Gammon <[email protected]>
@isaacs isaacs closed this as completed in 1270e6a May 9, 2024
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 a pull request may close this issue.

1 participant