Use ts-bridge instead of tsc; restrict imports#226
Conversation
|
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎ This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring: Next stepsTake a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with |
|
@SocketSecurity ignore npm/commander@10.0.1
New author for |
- Use `ts-bridge` instead of `tsc` to generate a JavaScript build.
- This now produces two variants to cater to CommonJS-only and
ESM-compatible bundlers.
- Define exports in `package.json`
- Custom, on-demand subpath imports are no longer supported.
`bin` was pointing to `dist/cli.js` which no longer exists after #226, causing the CLI to break: ``` $ yarn changelog:validate node:internal/modules/cjs/loader:1228 throw err; ^ Error: Cannot find module './node_modules/@metamask/auto-changelog/dist/cli.js' at Module._resolveFilename (node:internal/modules/cjs/loader:1225:15) at Module._load (node:internal/modules/cjs/loader:1051:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:173:12) at node:internal/main/run_main_module:28:49 { code: 'MODULE_NOT_FOUND', requireStack: [] } ```
ts-bridgeinstead oftscto generate a JavaScript build.package.jsonManual testing steps
yarn buildand inspectdist. You should see.cjs,.mjs,.d.cts, and.d.mtsfiles for each TypeScript file insrc/.yarn test. This now runs a second command,attw --pack, which verifies that the built files are correct. This should pass.