From dc0b9257f1222bac27e3d6e3cdd37923626d1306 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 5 Jun 2024 10:42:52 -0700 Subject: [PATCH 1/6] chore: update type-coverage --- packages/ERTP/package.json | 2 +- packages/base-zone/package.json | 2 +- packages/boot/package.json | 2 +- packages/builders/package.json | 2 +- packages/cosmic-swingset/package.json | 2 +- packages/inter-protocol/package.json | 2 +- packages/internal/package.json | 2 +- packages/network/package.json | 2 +- packages/orchestration/package.json | 2 +- packages/smart-wallet/package.json | 2 +- packages/swing-store/package.json | 2 +- packages/vats/package.json | 2 +- packages/xsnap/package.json | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/ERTP/package.json b/packages/ERTP/package.json index 74514915f05..76bc34e84e4 100644 --- a/packages/ERTP/package.json +++ b/packages/ERTP/package.json @@ -86,6 +86,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 91.21 + "atLeast": 91.22 } } diff --git a/packages/base-zone/package.json b/packages/base-zone/package.json index a1788d2de70..7adeeb7da22 100644 --- a/packages/base-zone/package.json +++ b/packages/base-zone/package.json @@ -56,6 +56,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 90.77 + "atLeast": 91.11 } } diff --git a/packages/boot/package.json b/packages/boot/package.json index d0b8d8bf54e..0cbfd4b5ae2 100644 --- a/packages/boot/package.json +++ b/packages/boot/package.json @@ -90,6 +90,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 86.74 + "atLeast": 87.28 } } diff --git a/packages/builders/package.json b/packages/builders/package.json index d9531fcee5b..0acd618d6c7 100644 --- a/packages/builders/package.json +++ b/packages/builders/package.json @@ -78,6 +78,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 74.23 + "atLeast": 74.36 } } diff --git a/packages/cosmic-swingset/package.json b/packages/cosmic-swingset/package.json index 5484a44753d..f60ec2e7204 100644 --- a/packages/cosmic-swingset/package.json +++ b/packages/cosmic-swingset/package.json @@ -68,6 +68,6 @@ "timeout": "20m" }, "typeCoverage": { - "atLeast": 80.48 + "atLeast": 80.49 } } diff --git a/packages/inter-protocol/package.json b/packages/inter-protocol/package.json index ebcc5ed2654..e95cbab9e9d 100644 --- a/packages/inter-protocol/package.json +++ b/packages/inter-protocol/package.json @@ -82,6 +82,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 95.87 + "atLeast": 95.85 } } diff --git a/packages/internal/package.json b/packages/internal/package.json index dc0d6adf6a6..0c893089470 100755 --- a/packages/internal/package.json +++ b/packages/internal/package.json @@ -56,6 +56,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 93.81 + "atLeast": 93.89 } } diff --git a/packages/network/package.json b/packages/network/package.json index c5c152cf2f8..7ba9f082f1b 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -65,6 +65,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 89.39 + "atLeast": 89.7 } } diff --git a/packages/orchestration/package.json b/packages/orchestration/package.json index a861179efe0..05a1cee587c 100644 --- a/packages/orchestration/package.json +++ b/packages/orchestration/package.json @@ -82,6 +82,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 97.38 + "atLeast": 97.17 } } diff --git a/packages/smart-wallet/package.json b/packages/smart-wallet/package.json index 2084c60f9d3..a98c41b6656 100644 --- a/packages/smart-wallet/package.json +++ b/packages/smart-wallet/package.json @@ -68,6 +68,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 94.35 + "atLeast": 94.3 } } diff --git a/packages/swing-store/package.json b/packages/swing-store/package.json index ff77bd5432b..a1972774c41 100644 --- a/packages/swing-store/package.json +++ b/packages/swing-store/package.json @@ -49,6 +49,6 @@ "timeout": "2m" }, "typeCoverage": { - "atLeast": 76.3 + "atLeast": 76.31 } } diff --git a/packages/vats/package.json b/packages/vats/package.json index d374c13c81f..d143015f69b 100644 --- a/packages/vats/package.json +++ b/packages/vats/package.json @@ -77,6 +77,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 91.27 + "atLeast": 91.11 } } diff --git a/packages/xsnap/package.json b/packages/xsnap/package.json index 0f9480f5d7f..3d67a418912 100644 --- a/packages/xsnap/package.json +++ b/packages/xsnap/package.json @@ -74,6 +74,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 94.04 + "atLeast": 93.95 } } From a744db8d7ca4cd238391904b9ce47c42111eadf1 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 5 Jun 2024 09:30:49 -0700 Subject: [PATCH 2/6] lint(types): suppress error in export augmentation --- packages/ERTP/exported.d.ts | 1 + packages/governance/exported.d.ts | 1 + packages/internal/exported.d.ts | 1 + packages/notifier/exported.d.ts | 1 + packages/store/exported.d.ts | 1 + 5 files changed, 5 insertions(+) diff --git a/packages/ERTP/exported.d.ts b/packages/ERTP/exported.d.ts index c3dab4e11ff..4ab07be2621 100644 --- a/packages/ERTP/exported.d.ts +++ b/packages/ERTP/exported.d.ts @@ -19,6 +19,7 @@ import { Purse as _Purse, } from './src/types.js'; declare global { + // @ts-ignore TS2666: Exports and export assignments are not permitted in module augmentations. export { _Amount as Amount, _Brand as Brand, diff --git a/packages/governance/exported.d.ts b/packages/governance/exported.d.ts index a3336ac36dd..383c9944117 100644 --- a/packages/governance/exported.d.ts +++ b/packages/governance/exported.d.ts @@ -16,6 +16,7 @@ import { GovernableStartFn as _GovernableStartFn, } from './src/types.js'; declare global { + // @ts-ignore TS2666: Exports and export assignments are not permitted in module augmentations. export { _CommitteeElectoratePublic as CommitteeElectoratePublic, _GovernableStartFn as GovernableStartFn, diff --git a/packages/internal/exported.d.ts b/packages/internal/exported.d.ts index 043f11db074..792693d4958 100644 --- a/packages/internal/exported.d.ts +++ b/packages/internal/exported.d.ts @@ -15,6 +15,7 @@ import { } from './src/lib-chainStorage.js'; declare global { + // @ts-ignore TS2666: Exports and export assignments are not permitted in module augmentations. export { _ERef as ERef, _Marshaller as Marshaller, diff --git a/packages/notifier/exported.d.ts b/packages/notifier/exported.d.ts index 4709364a419..9b5fff20c15 100644 --- a/packages/notifier/exported.d.ts +++ b/packages/notifier/exported.d.ts @@ -21,6 +21,7 @@ import { } from './src/types.js'; declare global { + // @ts-ignore TS2666: Exports and export assignments are not permitted in module augmentations. export { _EachTopic as EachTopic, _IterableEachTopic as IterableEachTopic, diff --git a/packages/store/exported.d.ts b/packages/store/exported.d.ts index 800f1a2c54a..563c422026e 100644 --- a/packages/store/exported.d.ts +++ b/packages/store/exported.d.ts @@ -12,6 +12,7 @@ import { } from './src/types.js'; import { Pattern as _Pattern } from '@endo/patterns'; declare global { + // @ts-ignore TS2666: Exports and export assignments are not permitted in module augmentations. export { _LegacyMap as LegacyMap, _LegacyWeakMap as LegacyWeakMap, From 717a4c98aeadaa83897567b46d12b654b0a2cc72 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 5 Jun 2024 09:32:28 -0700 Subject: [PATCH 3/6] fix(types): DataOnly import of Callable --- packages/internal/src/types.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/internal/src/types.d.ts b/packages/internal/src/types.d.ts index e54952e4ab2..9130d2a39e9 100644 --- a/packages/internal/src/types.d.ts +++ b/packages/internal/src/types.d.ts @@ -1,6 +1,7 @@ /* eslint-disable max-classes-per-file */ -import type { Callable, RemotableBrand } from '@endo/eventual-send'; +import type { RemotableBrand } from '@endo/eventual-send'; import type { Primitive } from '@endo/pass-style'; +import type { Callable } from './utils.js'; export declare class Callback any> { private iface: I; From c3aa4987ba156863bf7e589c97095552e701070f Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 5 Jun 2024 09:37:05 -0700 Subject: [PATCH 4/6] chore(deps): bump @types/estree to working version the one pulled in by `@rollup/pluginutils` was missing exports --- package.json | 1 + yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 5176862c300..c953447f0f7 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ }, "resolutions": { "**/protobufjs": "^7.2.6", + "**/@types/estree": "^1.0.0", "**/@typescript-eslint/typescript-estree": "^7.7.1" }, "engines": { diff --git a/yarn.lock b/yarn.lock index d096a8503d0..cbed3f4d19d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3389,10 +3389,10 @@ "@types/estree" "*" "@types/json-schema" "*" -"@types/estree@*", "@types/estree@0.0.39": - version "0.0.39" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" - integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== +"@types/estree@*", "@types/estree@0.0.39", "@types/estree@^1.0.0": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" + integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== "@types/express-serve-static-core@^4.17.33": version "4.17.35" From 077240b3f205151b97afc61a4615cf3a83d6f9a3 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 5 Jun 2024 09:39:01 -0700 Subject: [PATCH 5/6] fix(types): errors detected with libcheck --- packages/vats/src/core/chain-behaviors.js | 3 +++ packages/vats/src/core/core-eval-env.d.ts | 12 +++++----- packages/vats/src/core/types-ambient.d.ts | 24 ++++++++++++------- packages/vats/src/types.d.ts | 2 +- .../zoe/src/contractFacet/types-ambient.d.ts | 3 ++- packages/zoe/src/zoeService/utils.d.ts | 3 +++ 6 files changed, 31 insertions(+), 16 deletions(-) diff --git a/packages/vats/src/core/chain-behaviors.js b/packages/vats/src/core/chain-behaviors.js index 48617e717b5..75b1951d96a 100644 --- a/packages/vats/src/core/chain-behaviors.js +++ b/packages/vats/src/core/chain-behaviors.js @@ -331,11 +331,14 @@ export const makeBridgeManager = async ({ const bridgeManager = E(vat).provideManagerForBridge(bridge); bridgeManagerP.resolve(bridgeManager); provisionBridgeManager.resolve( + // @ts-expect-error XXX EProxy E(bridgeManager).register(BRIDGE_ID.PROVISION), ); provisionWalletBridgeManager.resolve( + // @ts-expect-error XXX EProxy E(bridgeManager).register(BRIDGE_ID.PROVISION_SMART_WALLET), ); + // @ts-expect-error XXX EProxy walletBridgeManager.resolve(E(bridgeManager).register(BRIDGE_ID.WALLET)); }; harden(makeBridgeManager); diff --git a/packages/vats/src/core/core-eval-env.d.ts b/packages/vats/src/core/core-eval-env.d.ts index cb1f87b419b..83b01732d40 100644 --- a/packages/vats/src/core/core-eval-env.d.ts +++ b/packages/vats/src/core/core-eval-env.d.ts @@ -11,8 +11,8 @@ */ import type { VatData } from '@agoric/swingset-liveslots/src/vatDataTypes.js'; -import type { E, Far, getInterfaceOf, passStyleOf } from '@endo/far'; -import type { Assert, VirtualConsole } from 'ses'; +import type * as far from '@endo/far'; +import type { Assert } from 'ses'; import type { BootstrapModules } from './boot-chain.js'; // Provided by 'CORE_EVAL' handler in chain-behaviors.js @@ -22,10 +22,10 @@ declare global { var utils: BootstrapModules['utils']; // @endo/far exports - var E: E; - var Far: Far; - var getInterfaceOfFar: getInterfaceOfFar; - var passStyleOfFar: passStyleOfFar; + var E: typeof far.E; + var Far: typeof far.Far; + var getInterfaceOfFar: typeof far.getInterfaceOf; + var passStyleOfFar: typeof far.passStyleOf; // endowments var VatData: VatData; diff --git a/packages/vats/src/core/types-ambient.d.ts b/packages/vats/src/core/types-ambient.d.ts index 9a6b4ae680d..ec5043e8e29 100644 --- a/packages/vats/src/core/types-ambient.d.ts +++ b/packages/vats/src/core/types-ambient.d.ts @@ -202,13 +202,13 @@ type WellKnownName = { }; type ContractInstallationPromises< - StartFns extends Record, + StartFns extends Record, > = { [Property in keyof StartFns]: Promise>; }; type ContractInstancePromises< - StartFns extends Record, + StartFns extends Record, > = { [Property in keyof StartFns]: Promise< import('@agoric/zoe/src/zoeService/utils.js').Instance @@ -259,11 +259,13 @@ type WellKnownSpaces = { WellKnownName['installation'], Promise> > & + // @ts-expect-error XXX ContractInstallationPromises; }; instance: { produce: Record>; consume: Record> & + // @ts-expect-error XXX ContractInstancePromises; }; uiConfig: { @@ -281,6 +283,7 @@ type StartGovernedUpgradableOpts = { 'brands' | 'issuers' | 'governedParams' | 'electionManager' >; privateArgs: Omit< + // @ts-expect-error XXX import('@agoric/zoe/src/zoeService/utils').StartParams['privateArgs'], 'initialPoserInvitation' >; @@ -314,8 +317,9 @@ type StartUpgradable = < } >; -type StartedInstanceKit = - import('@agoric/zoe/src/zoeService/utils').StartedInstanceKit; +type StartedInstanceKit< + T extends import('@agoric/zoe/src/zoeService/utils').ContractStartFunction, +> = import('@agoric/zoe/src/zoeService/utils').StartedInstanceKit; type StartedInstanceKitWithLabel = { label: string; @@ -365,12 +369,14 @@ type ChainBootstrapSpaceT = { pegasusConnections: import('@agoric/vats').NameHubKit; pegasusConnectionsAdmin: import('@agoric/vats').NameAdmin; priceAuthorityVat: Awaited; - priceAuthority: PriceAuthority; + priceAuthority: import('@agoric/zoe/tools/types.js').PriceAuthority; priceAuthorityAdmin: import('@agoric/vats/src/priceAuthorityRegistry').PriceAuthorityRegistryAdmin; provisioning: Awaited | undefined; - provisionBridgeManager: import('../types.js').ScopedBridgeManager | undefined; + provisionBridgeManager: + | import('../types.js').ScopedBridgeManager<'provision'> + | undefined; provisionWalletBridgeManager: - | import('../types.js').ScopedBridgeManager + | import('../types.js').ScopedBridgeManager<'provisionWallet'> | undefined; storageBridgeManager: | import('../types.js').ScopedBridgeManager<'storage'> @@ -391,7 +397,9 @@ type ChainBootstrapSpaceT = { >; /** Used only for testing. Should not appear in any production proposals. */ testFirstAnchorKit: import('../vat-bank.js').AssetIssuerKit; - walletBridgeManager: import('../types.js').ScopedBridgeManager | undefined; + walletBridgeManager: + | import('../types.js').ScopedBridgeManager<'wallet'> + | undefined; walletFactoryStartResult: import('./startWalletFactory.js').WalletFactoryStartResult; provisionPoolStartResult: GovernanceFacetKit< typeof import('@agoric/inter-protocol/src/provisionPool.js').start diff --git a/packages/vats/src/types.d.ts b/packages/vats/src/types.d.ts index ec9ecc84191..11613498f5f 100644 --- a/packages/vats/src/types.d.ts +++ b/packages/vats/src/types.d.ts @@ -1,6 +1,6 @@ import type { BridgeIdValue, Remote } from '@agoric/internal'; import type { Bytes } from '@agoric/network'; -import type { PromiseVow, Remote } from '@agoric/vow'; +import type { PromiseVow } from '@agoric/vow'; import type { Guarded } from '@endo/exo'; export type Board = ReturnType< diff --git a/packages/zoe/src/contractFacet/types-ambient.d.ts b/packages/zoe/src/contractFacet/types-ambient.d.ts index 81b78ef8f06..f9c6d9b479d 100644 --- a/packages/zoe/src/contractFacet/types-ambient.d.ts +++ b/packages/zoe/src/contractFacet/types-ambient.d.ts @@ -244,7 +244,8 @@ type ContractStartFnResult = { }; // XXX redef, losing documentation -type ContractOf = import('../zoeService/utils').ContractOf; +type ContractOf any> = + import('../zoeService/utils').ContractOf; type AdminFacet = import('../zoeService/utils').AdminFacet; declare const OfferReturn: unique symbol; diff --git a/packages/zoe/src/zoeService/utils.d.ts b/packages/zoe/src/zoeService/utils.d.ts index 8ccd1043f87..6ef63ce49a8 100644 --- a/packages/zoe/src/zoeService/utils.d.ts +++ b/packages/zoe/src/zoeService/utils.d.ts @@ -104,13 +104,16 @@ export type StartInstance = ( issuerKeywordRecord?: Record>, // 'brands' and 'issuers' need not be passed in; Zoe provides them as StandardTerms terms?: Omit['terms'], 'brands' | 'issuers'>, + // @ts-expect-error XXX privateArgs?: Parameters[1], label?: string, + // @ts-expect-error XXX ) => Promise>; // XXX SF should extend ContractStartFunction but doing that triggers a bunch of tech debt type errors export type GetPublicFacet = ( instance: Instance | PromiseLike>, + // @ts-expect-error XXX ) => Promise['publicFacet']>; export type GetTerms = (instance: Instance) => Promise< From 0701b917ce04bc639a45274bfe3b93a16ac40574 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 5 Jun 2024 10:41:19 -0700 Subject: [PATCH 6/6] chore: update type-coverage --- packages/inter-protocol/package.json | 2 +- packages/orchestration/package.json | 2 +- packages/smart-wallet/package.json | 2 +- packages/vats/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/inter-protocol/package.json b/packages/inter-protocol/package.json index e95cbab9e9d..c2325e54111 100644 --- a/packages/inter-protocol/package.json +++ b/packages/inter-protocol/package.json @@ -82,6 +82,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 95.85 + "atLeast": 95.81 } } diff --git a/packages/orchestration/package.json b/packages/orchestration/package.json index 05a1cee587c..029873261da 100644 --- a/packages/orchestration/package.json +++ b/packages/orchestration/package.json @@ -82,6 +82,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 97.17 + "atLeast": 97.1 } } diff --git a/packages/smart-wallet/package.json b/packages/smart-wallet/package.json index a98c41b6656..f2f805cafb1 100644 --- a/packages/smart-wallet/package.json +++ b/packages/smart-wallet/package.json @@ -68,6 +68,6 @@ "access": "public" }, "typeCoverage": { - "atLeast": 94.3 + "atLeast": 94.36 } } diff --git a/packages/vats/package.json b/packages/vats/package.json index d143015f69b..e61a97130f9 100644 --- a/packages/vats/package.json +++ b/packages/vats/package.json @@ -77,6 +77,6 @@ "workerThreads": false }, "typeCoverage": { - "atLeast": 91.11 + "atLeast": 91.21 } }