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

feat: support all runtimes #29

Merged
merged 2 commits into from
Mar 31, 2024
Merged

feat: support all runtimes #29

merged 2 commits into from
Mar 31, 2024

Conversation

sgammon
Copy link
Owner

@sgammon sgammon commented Mar 31, 2024

Summary

Support for a Deno entrypoint, and other various fixes.

Related Issues

Upstream PRs

Changelog

  • 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

@sgammon sgammon added the enhancement New feature or request label Mar 31, 2024
@sgammon sgammon requested a review from darvld March 31, 2024 01:40
@sgammon sgammon self-assigned this Mar 31, 2024
Comment on lines +189 to +191
"minipass": "7.0.4",
"patch-package": "8.0.0",
"path-scurry": "1.10.2",
Copy link
Owner Author

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.

scripts/build-cli.mjs Outdated Show resolved Hide resolved
Comment on lines +1 to +7
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)
Copy link
Owner Author

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.

- 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>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Copy link

sonarcloud bot commented Mar 31, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@sgammon sgammon merged commit 25f5594 into main Mar 31, 2024
29 checks passed
@sgammon sgammon deleted the feat/neutral-runtimes branch March 31, 2024 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants