Skip to content

chore: replace esrun with tsx (#5136) - #5160

Open
hunterckx wants to merge 2 commits into
mainfrom
hunter/5136-esrun-to-tsx
Open

hunterckx wants to merge 2 commits into
mainfrom
hunter/5136-esrun-to-tsx

Conversation

@hunterckx

Copy link
Copy Markdown
Contributor

Ticket

Closes #5136

Changes

  • Uninstalled @digitak/esrun and installed tsx for both package.jsons
  • Removed references to esrun and replaced with tsx where appropriate
  • Changed files package to "type": "module" to resolve and import issue

@hunterckx
hunterckx requested a review from a team December 4, 2026 22:53

@NoopDog NoopDog left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks Hunter, a tidy swap: the lock change is exactly esrun's tree going away, all four scripts behave the same under tsx, and adding "type": "module" to files/ is the right fix for the estree-walker export error. A few optional notes:

  • This also clears "Dependabot: esbuild 0.25.0 (GHSA-67mh-4wv8-2f99)" (#5128), which is still open; adding Closes #5128 would close it on merge.
  • In the description, "to resolve and import issue" reads as "an import issue", and naming the error (ERR_PACKAGE_PATH_NOT_EXPORTED from estree-walker when files/ ran as CommonJS) would help later readers. The title could put esrun and tsx in backticks.
  • One more inline on a comment.

"https://github.com/obophenotype/human-phenotype-ontology/releases/latest/download/phenotype.hpoa";
const ORPHADATA_URL = "https://www.orphadata.com/data/xml/en_product1.xml";
// Resolved from this script's location (esrun sets __dirname), so the script
// Resolved from this script's location (tsx sets __dirname), so the script

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Optional: tsx doesn't set __dirname; Node does, because the root package has no "type" and runs as CommonJS (under "type": "module" it's undefined). Since files/ just became ESM, something like "Resolved from this script's location (Node sets __dirname because the root package is CommonJS)" would point at the real cause if the root ever switches.

@hunterckx hunterckx self-assigned this Dec 5, 2026

This branch has not been deployed

No deployments
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.

Replace @digitak/esrun with tsx for the TypeScript scripts

2 participants