Skip to content

Commit

Permalink
Fix ts: Emit separate typescript declarations for esm/cjs.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Jun 27, 2024
1 parent ad5bf5d commit 1b1fe7f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 58 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 23 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@noble/hashes": "1.4.0"
},
"devDependencies": {
"@paulmillr/jsbt": "0.1.0",
"@paulmillr/jsbt": "0.2.0",
"fast-check": "3.0.0",
"micro-bmark": "0.3.1",
"micro-should": "0.4.0",
Expand All @@ -42,114 +42,92 @@
"main": "index.js",
"exports": {
".": {
"types": "./index.d.ts",
"import": "./esm/index.js",
"default": "./index.js"
"require": "./index.js"
},
"./abstract/edwards": {
"types": "./abstract/edwards.d.ts",
"import": "./esm/abstract/edwards.js",
"default": "./abstract/edwards.js"
"require": "./abstract/edwards.js"
},
"./abstract/modular": {
"types": "./abstract/modular.d.ts",
"import": "./esm/abstract/modular.js",
"default": "./abstract/modular.js"
"require": "./abstract/modular.js"
},
"./abstract/montgomery": {
"types": "./abstract/montgomery.d.ts",
"import": "./esm/abstract/montgomery.js",
"default": "./abstract/montgomery.js"
"require": "./abstract/montgomery.js"
},
"./abstract/weierstrass": {
"types": "./abstract/weierstrass.d.ts",
"import": "./esm/abstract/weierstrass.js",
"default": "./abstract/weierstrass.js"
"require": "./abstract/weierstrass.js"
},
"./abstract/bls": {
"types": "./abstract/bls.d.ts",
"import": "./esm/abstract/bls.js",
"default": "./abstract/bls.js"
"require": "./abstract/bls.js"
},
"./abstract/hash-to-curve": {
"types": "./abstract/hash-to-curve.d.ts",
"import": "./esm/abstract/hash-to-curve.js",
"default": "./abstract/hash-to-curve.js"
"require": "./abstract/hash-to-curve.js"
},
"./abstract/curve": {
"types": "./abstract/curve.d.ts",
"import": "./esm/abstract/curve.js",
"default": "./abstract/curve.js"
"require": "./abstract/curve.js"
},
"./abstract/utils": {
"types": "./abstract/utils.d.ts",
"import": "./esm/abstract/utils.js",
"default": "./abstract/utils.js"
"require": "./abstract/utils.js"
},
"./abstract/poseidon": {
"types": "./abstract/poseidon.d.ts",
"import": "./esm/abstract/poseidon.js",
"default": "./abstract/poseidon.js"
"require": "./abstract/poseidon.js"
},
"./_shortw_utils": {
"types": "./_shortw_utils.d.ts",
"import": "./esm/_shortw_utils.js",
"default": "./_shortw_utils.js"
"require": "./_shortw_utils.js"
},
"./bls12-381": {
"types": "./bls12-381.d.ts",
"import": "./esm/bls12-381.js",
"default": "./bls12-381.js"
"require": "./bls12-381.js"
},
"./bn254": {
"types": "./bn254.d.ts",
"import": "./esm/bn254.js",
"default": "./bn254.js"
"require": "./bn254.js"
},
"./ed25519": {
"types": "./ed25519.d.ts",
"import": "./esm/ed25519.js",
"default": "./ed25519.js"
"require": "./ed25519.js"
},
"./ed448": {
"types": "./ed448.d.ts",
"import": "./esm/ed448.js",
"default": "./ed448.js"
"require": "./ed448.js"
},
"./index": {
"types": "./index.d.ts",
"import": "./esm/index.js",
"default": "./index.js"
"require": "./index.js"
},
"./jubjub": {
"types": "./jubjub.d.ts",
"import": "./esm/jubjub.js",
"default": "./jubjub.js"
"require": "./jubjub.js"
},
"./p256": {
"types": "./p256.d.ts",
"import": "./esm/p256.js",
"default": "./p256.js"
"require": "./p256.js"
},
"./p384": {
"types": "./p384.d.ts",
"import": "./esm/p384.js",
"default": "./p384.js"
"require": "./p384.js"
},
"./p521": {
"types": "./p521.d.ts",
"import": "./esm/p521.js",
"default": "./p521.js"
"require": "./p521.js"
},
"./pasta": {
"types": "./pasta.d.ts",
"import": "./esm/pasta.js",
"default": "./pasta.js"
"require": "./pasta.js"
},
"./secp256k1": {
"types": "./secp256k1.d.ts",
"import": "./esm/secp256k1.js",
"default": "./secp256k1.js"
"require": "./secp256k1.js"
}
},
"keywords": [
Expand Down
9 changes: 3 additions & 6 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
{
"extends": "@paulmillr/jsbt/tsconfigs/esm.json",
"extends": "@paulmillr/jsbt/tsconfig.esm.json",
"compilerOptions": {
"outDir": "esm",
"declaration": true,
"declarationMap": true
"outDir": "esm"
},
"include": [
"src"
],
"exclude": [
"node_modules",
"lib"
"node_modules"
]
}
10 changes: 7 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"extends": "@paulmillr/jsbt/tsconfigs/cjs.json",
"extends": "@paulmillr/jsbt/tsconfig.cjs.json",
"compilerOptions": {
"outDir": "."
},
"include": ["index.ts", "src"],
"exclude": ["node_modules", "lib"]
"include": [
"src"
],
"exclude": [
"node_modules"
]
}

0 comments on commit 1b1fe7f

Please sign in to comment.