From 6ec40eeca30385bd41bd712f04423519501c5c9c Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Wed, 4 Oct 2023 19:21:54 -0300 Subject: [PATCH 1/3] chore: Remove incorrect types field from foundation package Foundation does not have a root index.js, and the file `./dest/index.d.ts` does not exist. This removes the pointer to an incorrect file. Still, ts seems to be able to figure out the typings correctly when installing this package from a test project. --- yarn-project/foundation/package.json | 1 - yarn-project/package.common.json | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/yarn-project/foundation/package.json b/yarn-project/foundation/package.json index 75d2332327d9..adcfc2849a9b 100644 --- a/yarn-project/foundation/package.json +++ b/yarn-project/foundation/package.json @@ -106,7 +106,6 @@ "src", "!*.test.*" ], - "types": "./dest/index.d.ts", "engines": { "node": ">=18" } diff --git a/yarn-project/package.common.json b/yarn-project/package.common.json index 6b6f74712581..ac892fd15705 100644 --- a/yarn-project/package.common.json +++ b/yarn-project/package.common.json @@ -10,8 +10,11 @@ "engines": { "node": ">=18" }, - "files": ["dest", "src", "!*.test.*"], - "types": "./dest/index.d.ts", + "files": [ + "dest", + "src", + "!*.test.*" + ], "devDependencies": { "@jest/globals": "^29.5.0", "@types/jest": "^29.5.0", From 484a47e936be03cafb2f99a1fe82522e6d788ef9 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Thu, 5 Oct 2023 08:42:44 -0300 Subject: [PATCH 2/3] Add main entrypoint for foundation --- yarn-project/foundation/package.json | 2 ++ yarn-project/foundation/src/index.ts | 27 +++++++++++++++++++++++++++ yarn-project/package.common.json | 6 +----- 3 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 yarn-project/foundation/src/index.ts diff --git a/yarn-project/foundation/package.json b/yarn-project/foundation/package.json index adcfc2849a9b..301d65073189 100644 --- a/yarn-project/foundation/package.json +++ b/yarn-project/foundation/package.json @@ -3,6 +3,8 @@ "version": "0.1.0", "packageManager": "yarn@3.4.1", "type": "module", + "main": "./dest/index.js", + "types": "./dest/index.d.ts", "exports": { "./eslint": "./.eslintrc.cjs", "./prettier": "./.prettierrc.json", diff --git a/yarn-project/foundation/src/index.ts b/yarn-project/foundation/src/index.ts new file mode 100644 index 000000000000..b34a0bf474eb --- /dev/null +++ b/yarn-project/foundation/src/index.ts @@ -0,0 +1,27 @@ +// Reexport all folders at the root for packages targeting CommonJS +export * as abi from './abi/index.js'; +export * as asyncMap from './async-map/index.js'; +export * as aztecAddress from './aztec-address/index.js'; +export * as bigintBuffer from './bigint-buffer/index.js'; +export * as collection from './collection/index.js'; +export * as committable from './committable/index.js'; +export * as crypto from './crypto/index.js'; +export * as errors from './errors/index.js'; +export * as ethAddress from './eth-address/index.js'; +export * as fields from './fields/index.js'; +export * as fifo from './fifo/index.js'; +export * as jsonRpc from './json-rpc/index.js'; +export * as jsonRpcClient from './json-rpc/client/index.js'; +export * as jsonRpcServer from './json-rpc/server/index.js'; +export * as log from './log/index.js'; +export * as mutex from './mutex/index.js'; +export * as retry from './retry/index.js'; +export * as runningPromise from './running-promise/index.js'; +export * as serialize from './serialize/index.js'; +export * as sleep from './sleep/index.js'; +export * as timer from './timer/index.js'; +export * as transport from './transport/index.js'; +export * as types from './types/index.js'; +export * as url from './url/index.js'; +export * as wasm from './wasm/index.js'; +export * as worker from './worker/index.js'; diff --git a/yarn-project/package.common.json b/yarn-project/package.common.json index ac892fd15705..bcb78bdc9b4f 100644 --- a/yarn-project/package.common.json +++ b/yarn-project/package.common.json @@ -10,11 +10,7 @@ "engines": { "node": ">=18" }, - "files": [ - "dest", - "src", - "!*.test.*" - ], + "files": ["dest", "src", "!*.test.*"], "devDependencies": { "@jest/globals": "^29.5.0", "@types/jest": "^29.5.0", From 79386100645d9ab47ce317e940d2eeb803ef7e9e Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Thu, 5 Oct 2023 08:48:50 -0300 Subject: [PATCH 3/3] Restore types in package common --- yarn-project/package.common.json | 1 + 1 file changed, 1 insertion(+) diff --git a/yarn-project/package.common.json b/yarn-project/package.common.json index bcb78bdc9b4f..6b6f74712581 100644 --- a/yarn-project/package.common.json +++ b/yarn-project/package.common.json @@ -11,6 +11,7 @@ "node": ">=18" }, "files": ["dest", "src", "!*.test.*"], + "types": "./dest/index.d.ts", "devDependencies": { "@jest/globals": "^29.5.0", "@types/jest": "^29.5.0",