Skip to content

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.

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.

@sgammon sgammon force-pushed the feat/neutral-runtimes branch from 85c8104 to a5fb21b Compare March 31, 2024 01:44
- 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 sgammon force-pushed the feat/neutral-runtimes branch from a5fb21b to 4acc9bb Compare March 31, 2024 01:45
Copy link

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
@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