From 0c447039ac89d59fd1b02b389941d6d9a9b522ab Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 6 Nov 2023 13:22:54 -0600 Subject: [PATCH 1/3] fix: yarn prepare --- yarn-project/noir-contracts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/noir-contracts/package.json b/yarn-project/noir-contracts/package.json index ec1249fe8a7..ee58c6bab5b 100644 --- a/yarn-project/noir-contracts/package.json +++ b/yarn-project/noir-contracts/package.json @@ -4,7 +4,7 @@ "type": "module", "exports": { "./artifacts": "./dest/artifacts/index.js", - "./types": "./dest/types/index.js" + "./types": "./dest/index.d.ts" }, "scripts": { "build": "yarn clean && tsc -b", From 780566f957a92fcfb54c3334eec244deed8e6ac1 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Mon, 6 Nov 2023 20:44:18 +0000 Subject: [PATCH 2/3] fix: more lenient package.json check --- yarn-project/noir-contracts/package.json | 2 +- .../yarn-project-base/scripts/update_package_jsons.mjs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/yarn-project/noir-contracts/package.json b/yarn-project/noir-contracts/package.json index ee58c6bab5b..4f165554173 100644 --- a/yarn-project/noir-contracts/package.json +++ b/yarn-project/noir-contracts/package.json @@ -4,7 +4,7 @@ "type": "module", "exports": { "./artifacts": "./dest/artifacts/index.js", - "./types": "./dest/index.d.ts" + "./types": "./dest/types/index.d.ts" }, "scripts": { "build": "yarn clean && tsc -b", diff --git a/yarn-project/yarn-project-base/scripts/update_package_jsons.mjs b/yarn-project/yarn-project-base/scripts/update_package_jsons.mjs index 7f59317c058..bc5f20ddca7 100644 --- a/yarn-project/yarn-project-base/scripts/update_package_jsons.mjs +++ b/yarn-project/yarn-project-base/scripts/update_package_jsons.mjs @@ -34,6 +34,9 @@ function getUpdatedValue(source, target, key) { } else if (key === 'files') { const res = [...target[key], ...value]; return Array.from(new Set(res)); + } else if (key === 'types') { + // there should be a "types" key in package.json, but allow packages to overwrite it + return target[key] ?? value; } else { return value; } From 4950624fcae70ba6403274c71a55c64b73ff25c4 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Mon, 6 Nov 2023 20:45:16 +0000 Subject: [PATCH 3/3] fix: export right types from noir-contracts --- yarn-project/noir-contracts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/noir-contracts/package.json b/yarn-project/noir-contracts/package.json index 4f165554173..ec1249fe8a7 100644 --- a/yarn-project/noir-contracts/package.json +++ b/yarn-project/noir-contracts/package.json @@ -4,7 +4,7 @@ "type": "module", "exports": { "./artifacts": "./dest/artifacts/index.js", - "./types": "./dest/types/index.d.ts" + "./types": "./dest/types/index.js" }, "scripts": { "build": "yarn clean && tsc -b",