Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:
_types
generation and modernizes module resolution. (#56)
Currently, the `_types` is built using `node` module resolution, which results in this project generating invalid types. Details about the TypeScript bug can be found at microsoft/TypeScript#60930 (comment) and there are no plans to fix it since `node` (which is equivalent to `node10`) is being deprecated in TypeScript soon. The way this bug manifests is in files like `src/_types/core/P256.d.ts` where it would previously generate code like:�```ts create: (hash: import("@noble/curves/abstract/utils.js").CHash) => import("@noble/curves/abstract/weierstrass.js").CurveFn; ``` when it should have generated code like this (which is what is generated after this change):�```ts create: (hash: import("@noble/curves/abstract/utils").CHash) => import("@noble/curves/abstract/weierstrass").CurveFn; ``` For the cjs build command, I changed from `node` to `node10` to be more explicit/clear, since `node` was just an alias for `node10`. For the esm build command, I changed it to use the tsconfig so it is less likely to get out of sync with the generated types. Also updated .gitignore to ignore `.pnpm-store` which had 30,000 files it wanted to commit after I did `pnpm install` using the recommended version of `pnpm`.
- Loading branch information