-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: support all runtimes #29
Conversation
"minipass": "7.0.4", | ||
"patch-package": "8.0.0", | ||
"path-scurry": "1.10.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These must be hoisted and pinned so I can patch them on-install.
import { createRequire } from 'node:module' | ||
import path from 'node:path' | ||
import url from 'node:url' | ||
|
||
globalThis.require = createRequire(import.meta.url) | ||
globalThis.__filename = url.fileURLToPath(import.meta.url) | ||
globalThis.__dirname = path.dirname(__filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shim is required for require
, __filename
, and __dirname
to be present in an ESM module; it is injected at build time into the CLI entrypoint.
Why ship the CLI like this? Because the module remains backward compatible with type: commonjs
, and so this will be loaded as CJS, but we want it to be built as ESM.
85c8104
to
a5fb21b
Compare
- 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 <sam@elide.dev>
a5fb21b
to
4acc9bb
Compare
Signed-off-by: Sam Gammon <sam@elide.ventures>
Quality Gate passedIssues Measures |
Summary
Support for a Deno entrypoint, and other various fixes.
Related Issues
Upstream PRs
node:
-prefixed requires for builtins isaacs/node-glob#581node
-prefixed requires for builtins tj/commander.js#2170Changelog
glob
,minipass
, andpath-scurry