diff --git a/package.json b/package.json index 6751c89e..5748e78e 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@babel/preset-typescript": "^7.17.12", "@commitlint/cli": "^16.0.2", "@commitlint/config-conventional": "^16.0.0", - "@rollup/plugin-typescript": "^8.3.0", + "@rollup/plugin-typescript": "^11.1.6", "@types/circomlibjs": "^0.1.4", "@types/download": "^8.0.1", "@types/glob": "^7.2.0", @@ -82,12 +82,12 @@ "lint-staged": "^12.1.7", "prettier": "^2.5.1", "rimraf": "^3.0.2", - "rollup": "^2.64.0", + "rollup": "^4.9.6", "snarkjs": "^0.7.2", - "ts-node": "^10.4.0", - "tslib": "^2.3.1", - "typedoc": "^0.25.1", - "typescript": "^4.7.0" + "ts-node": "^10.9.2", + "tslib": "^2.6.2", + "typedoc": "^0.25.7", + "typescript": "^5.3.3" }, "config": { "commitizen": { diff --git a/packages/cli/build.tsconfig.json b/packages/cli/build.tsconfig.json index 2599898e..410f745e 100644 --- a/packages/cli/build.tsconfig.json +++ b/packages/cli/build.tsconfig.json @@ -1,8 +1,9 @@ { "compilerOptions": { "baseUrl": ".", - "target": "es2020", + "target": "ES2020", "module": "ESNext", + "moduleResolution": "Bundler", "allowSyntheticDefaultImports": true }, "include": ["src"] diff --git a/packages/cli/package.json b/packages/cli/package.json index 8baf630b..40eb50af 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -23,7 +23,7 @@ "node": ">=14.16" }, "scripts": { - "start": "node --loader ts-node/esm --no-warnings src/index.ts", + "start": "node --import 'data:text/javascript,import { register } from \"node:module\"; import { pathToFileURL } from \"node:url\"; register(\"ts-node/esm\", pathToFileURL(\"./\"));' ./src/index.ts", "build": "rimraf dist && rollup -c rollup.config.ts --configPlugin typescript", "prepublishOnly": "yarn build" }, @@ -37,8 +37,7 @@ "@types/pacote": "^11.1.5", "@types/semver": "^7.3.13", "rollup-plugin-cleanup": "^3.2.1", - "rollup-plugin-typescript2": "^0.31.2", - "ts-node": "^10.9.1" + "rollup-plugin-typescript2": "^0.36.0" }, "dependencies": { "@semaphore-protocol/data": "4.0.0-alpha.4", diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index 40f865a1..198db003 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -1,9 +1,9 @@ { "compilerOptions": { "baseUrl": ".", - "target": "es2020", + "target": "ES2020", "module": "ESNext", - "moduleResolution": "Node16", + "moduleResolution": "Bundler", "allowSyntheticDefaultImports": true }, "include": ["src", "rollup.config.ts"] diff --git a/packages/core/package.json b/packages/core/package.json index 2954f28e..8b9b1b07 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -8,24 +8,24 @@ "types": "src/types/index.d.ts", "exports": { ".": { + "types": "./src/types/index.d.ts", "require": "./src/index.cjs", - "default": "./src/index.js", - "types": "./src/types/index.d.ts" + "default": "./src/index.js" }, "./identity": { + "types": "./src/identity/types/index.d.ts", "require": "./src/identity/index.cjs", - "default": "./src/identity/index.js", - "types": "./src/identity/types/index.d.ts" + "default": "./src/identity/index.js" }, "./group": { + "types": "./src/identity/types/index.d.ts", "require": "./src/group/index.cjs", - "default": "./src/group/index.js", - "types": "./src/group/types/index.d.ts" + "default": "./src/group/index.js" }, "./proof": { + "types": "./src/identity/types/index.d.ts", "require": "./src/proof/index.cjs", - "default": "./src/proof/index.js", - "types": "./src/proof/types/index.d.ts" + "default": "./src/proof/index.js" } }, "files": [ diff --git a/packages/data/package.json b/packages/data/package.json index a29f21f9..d886c461 100644 --- a/packages/data/package.json +++ b/packages/data/package.json @@ -2,14 +2,15 @@ "name": "@semaphore-protocol/data", "version": "4.0.0-alpha.4", "description": "A library to query Semaphore contracts.", + "type": "module", "license": "MIT", - "main": "dist/index.node.js", + "main": "dist/index.js", + "types": "dist/types/index.d.ts", "exports": { - "import": "./dist/index.mjs", - "require": "./dist/index.node.js", - "types": "./dist/types/index.d.ts" + "types": "./dist/types/index.d.ts", + "require": "./dist/index.cjs", + "default": "./dist/index.js" }, - "types": "./dist/types/index.d.ts", "files": [ "dist/", "src/", @@ -29,9 +30,9 @@ "access": "public" }, "devDependencies": { - "@rollup/plugin-json": "^6.0.0", + "@rollup/plugin-json": "^6.1.0", "rollup-plugin-cleanup": "^3.2.1", - "rollup-plugin-typescript2": "^0.31.2" + "rollup-plugin-typescript2": "^0.36.0" }, "dependencies": { "axios": "1.6.6", diff --git a/packages/data/rollup.config.ts b/packages/data/rollup.config.ts index f524f225..a6900d51 100644 --- a/packages/data/rollup.config.ts +++ b/packages/data/rollup.config.ts @@ -17,7 +17,7 @@ export default { input: "src/index.ts", output: [ { file: pkg.exports.require, format: "cjs", banner, exports: "auto" }, - { file: pkg.exports.import, format: "es", banner } + { file: pkg.exports.default, format: "es", banner } ], external: Object.keys(pkg.dependencies), plugins: [ diff --git a/packages/group/package.json b/packages/group/package.json index 857a445c..c2bec25b 100644 --- a/packages/group/package.json +++ b/packages/group/package.json @@ -2,14 +2,15 @@ "name": "@semaphore-protocol/group", "version": "4.0.0-alpha.4", "description": "A library to create and manage Semaphore groups.", + "type": "module", "license": "MIT", - "main": "dist/index.node.js", - "exports": { - "import": "./dist/index.mjs", - "require": "./dist/index.node.js", - "types": "./dist/types/index.d.ts" - }, + "main": "dist/index.js", "types": "dist/types/index.d.ts", + "exports": { + "types": "./dist/types/index.d.ts", + "require": "./dist/index.cjs", + "default": "./dist/index.js" + }, "files": [ "dist/", "src/", @@ -29,11 +30,11 @@ "access": "public" }, "devDependencies": { - "@rollup/plugin-commonjs": "^24.0.1", - "@rollup/plugin-node-resolve": "^15.0.1", + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-node-resolve": "^15.2.3", "poseidon-lite": "^0.2.0", "rollup-plugin-cleanup": "^3.2.1", - "rollup-plugin-typescript2": "^0.31.2" + "rollup-plugin-typescript2": "^0.36.0" }, "dependencies": { "@zk-kit/imt": "^2.0.0-beta" diff --git a/packages/group/rollup.config.ts b/packages/group/rollup.config.ts index bdf00e8f..b11d2bac 100644 --- a/packages/group/rollup.config.ts +++ b/packages/group/rollup.config.ts @@ -18,7 +18,7 @@ export default { input: "src/index.ts", output: [ { file: pkg.exports.require, format: "cjs", banner, exports: "auto" }, - { file: pkg.exports.import, format: "es", banner } + { file: pkg.exports.default, format: "es", banner } ], external: Object.keys(pkg.dependencies), plugins: [ diff --git a/packages/hardhat/package.json b/packages/hardhat/package.json index 2bbf972e..4819ad56 100644 --- a/packages/hardhat/package.json +++ b/packages/hardhat/package.json @@ -2,14 +2,15 @@ "name": "@semaphore-protocol/hardhat", "version": "4.0.0-alpha.4", "description": "A Semaphore Hardhat plugin to deploy verifiers and Semaphore contract.", + "type": "module", "license": "MIT", - "main": "dist/index.node.js", - "exports": { - "import": "./dist/index.mjs", - "require": "./dist/index.node.js", - "types": "./dist/types/index.d.ts" - }, + "main": "dist/index.js", "types": "dist/types/index.d.ts", + "exports": { + "types": "./dist/types/index.d.ts", + "require": "./dist/index.cjs", + "default": "./dist/index.js" + }, "files": [ "dist/", "src/", @@ -31,7 +32,7 @@ "devDependencies": { "hardhat": "^2.19.4", "rollup-plugin-cleanup": "^3.2.1", - "rollup-plugin-typescript2": "^0.31.2" + "rollup-plugin-typescript2": "^0.36.0" }, "peerDependencies": { "hardhat": "^2.19.4" diff --git a/packages/hardhat/rollup.config.ts b/packages/hardhat/rollup.config.ts index cfb9be8e..29ed3760 100644 --- a/packages/hardhat/rollup.config.ts +++ b/packages/hardhat/rollup.config.ts @@ -16,7 +16,7 @@ export default { input: "src/index.ts", output: [ { file: pkg.exports.require, format: "cjs", banner, exports: "auto" }, - { file: pkg.exports.import, format: "es", banner } + { file: pkg.exports.default, format: "es", banner } ], external: [...Object.keys(pkg.dependencies), "hardhat/config"], plugins: [ diff --git a/packages/heyauthn/package.json b/packages/heyauthn/package.json index fe5eafa6..9b40250c 100644 --- a/packages/heyauthn/package.json +++ b/packages/heyauthn/package.json @@ -2,14 +2,15 @@ "name": "@semaphore-protocol/heyauthn", "version": "4.0.0-alpha.4", "description": "A library to allow developers to create and manage Semaphore identities using WebAuthn", + "type": "module", "license": "MIT", - "main": "dist/index.node.js", - "exports": { - "import": "./dist/index.mjs", - "require": "./dist/index.node.js", - "types": "./dist/types/index.d.ts" - }, + "main": "dist/index.js", "types": "dist/types/index.d.ts", + "exports": { + "types": "./dist/types/index.d.ts", + "require": "./dist/index.cjs", + "default": "./dist/index.js" + }, "files": [ "dist/", "src/", @@ -30,7 +31,7 @@ }, "devDependencies": { "rollup-plugin-cleanup": "^3.2.1", - "rollup-plugin-typescript2": "^0.31.2" + "rollup-plugin-typescript2": "^0.36.0" }, "dependencies": { "@semaphore-protocol/identity": "4.0.0-alpha.4", diff --git a/packages/heyauthn/rollup.config.ts b/packages/heyauthn/rollup.config.ts index f2d2a8c5..5e66f8e1 100644 --- a/packages/heyauthn/rollup.config.ts +++ b/packages/heyauthn/rollup.config.ts @@ -16,7 +16,7 @@ export default { input: "src/index.ts", output: [ { file: pkg.exports.require, format: "cjs", banner, exports: "auto" }, - { file: pkg.exports.import, format: "es", banner } + { file: pkg.exports.default, format: "es", banner } ], external: Object.keys(pkg.dependencies), plugins: [ diff --git a/packages/identity/package.json b/packages/identity/package.json index 0a765810..0a8b8c32 100644 --- a/packages/identity/package.json +++ b/packages/identity/package.json @@ -2,21 +2,21 @@ "name": "@semaphore-protocol/identity", "version": "4.0.0-alpha.4", "description": "A library to create Semaphore identities.", + "type": "module", "license": "MIT", - "main": "dist/index.node.js", - "browser": "dist/index.browser.mjs", + "main": "dist/index.browser.js", + "types": "dist/types/index.d.ts", "exports": { ".": { + "types": "./dist/types/index.d.ts", "node": { - "import": "./dist/index.node.mjs", - "require": "./dist/index.node.js" + "import": "./dist/index.node.js", + "require": "./dist/index.node.cjs" }, - "browser": "./dist/index.browser.mjs", - "default": "./dist/index.browser.mjs", - "types": "./dist/types/index.d.ts" + "browser": "./dist/index.browser.js", + "default": "./dist/index.browser.js" } }, - "types": "dist/types/index.d.ts", "files": [ "dist/", "src/", @@ -39,10 +39,10 @@ }, "devDependencies": { "@rollup/plugin-alias": "^5.1.0", - "@rollup/plugin-commonjs": "^24.0.1", - "@rollup/plugin-node-resolve": "^15.0.1", + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-node-resolve": "^15.2.3", "rollup-plugin-cleanup": "^3.2.1", - "rollup-plugin-typescript2": "^0.31.2" + "rollup-plugin-typescript2": "^0.36.0" }, "dependencies": { "@zk-kit/eddsa-poseidon": "0.4.1", diff --git a/packages/proof/package.json b/packages/proof/package.json index 0d737790..963d8759 100644 --- a/packages/proof/package.json +++ b/packages/proof/package.json @@ -2,21 +2,21 @@ "name": "@semaphore-protocol/proof", "version": "4.0.0-alpha.4", "description": "A library to generate and verify Semaphore proofs.", + "type": "module", "license": "MIT", - "main": "dist/index.node.js", - "browser": "dist/index.browser.mjs", + "main": "dist/index.browser.js", + "types": "dist/types/index.d.ts", "exports": { ".": { + "types": "./dist/types/index.d.ts", "node": { - "import": "./dist/index.node.mjs", - "require": "./dist/index.node.js" + "import": "./dist/index.node.js", + "require": "./dist/index.node.cjs" }, - "browser": "./dist/index.browser.mjs", - "default": "./dist/index.browser.mjs", - "types": "./dist/types/index.d.ts" + "browser": "./dist/index.browser.js", + "default": "./dist/index.browser.js" } }, - "types": "dist/types/index.d.ts", "files": [ "dist/", "src/", @@ -40,14 +40,14 @@ "devDependencies": { "@ethersproject/strings": "^5.7.0", "@rollup/plugin-alias": "^5.1.0", - "@rollup/plugin-json": "^5.0.1", + "@rollup/plugin-json": "^6.1.0", "@types/download": "^8.0.5", "@types/tmp": "^0.2.6", "poseidon-lite": "^0.2.0", "rimraf": "^5.0.5", "rollup": "^4.0.2", "rollup-plugin-cleanup": "^3.2.1", - "rollup-plugin-typescript2": "^0.31.2" + "rollup-plugin-typescript2": "^0.36.0" }, "peerDependencies": { "@semaphore-protocol/group": "4.0.0-alpha.4", diff --git a/yarn.lock.REMOVED.git-id b/yarn.lock.REMOVED.git-id index 913302e6..8d3265bc 100644 --- a/yarn.lock.REMOVED.git-id +++ b/yarn.lock.REMOVED.git-id @@ -1 +1 @@ -39213c5bdc987131a61838ee2f09251314b7dbf4 \ No newline at end of file +34667953fc51e28aba7266bac29b61d7cf14c359 \ No newline at end of file