From 5c1e2f66cacd026abca28d16732f4ea564b3212a Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Tue, 21 May 2024 11:30:11 -0700 Subject: [PATCH 1/2] build: remove Endo-specific build hooks --- scripts/get-packed-versions.sh | 2 -- scripts/registry.sh | 6 ------ scripts/replace-packages.sh | 3 +-- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/scripts/get-packed-versions.sh b/scripts/get-packed-versions.sh index ecaf970ee8d..d9459a7d987 100755 --- a/scripts/get-packed-versions.sh +++ b/scripts/get-packed-versions.sh @@ -23,8 +23,6 @@ corepack enable yarn install 1>&2 yarn build 1>&2 -yarn lerna run build:types 1>&2 - npm query .workspace | jq -r '.[].location' | while read -r dir; do # Skip private packages. echo "dir=$dir" 1>&2 diff --git a/scripts/registry.sh b/scripts/registry.sh index d571269f982..752b88c4733 100755 --- a/scripts/registry.sh +++ b/scripts/registry.sh @@ -70,17 +70,11 @@ publish() { yarn build git commit --allow-empty -am "chore: prepare for publishing" - # Convention used in Endo - yarn lerna run build:types - # Publish the packages to our local service. # without concurrency until https://github.com/Agoric/agoric-sdk/issues/8091 yarn lerna version --concurrency 1 prerelease --exact \ --preid=dev --no-push --no-git-tag-version --yes - # Convention used in Endo - yarn lerna run clean:types - # Change any version prefices to an exact match, and merge our versions. VERSIONSHASH=$(jq --slurpfile versions <(popd > /dev/null && git cat-file blob "$VERSIONSHASH") \ '[to_entries[] | { key: .key, value: (.value | sub("^[~^]"; "")) }] diff --git a/scripts/replace-packages.sh b/scripts/replace-packages.sh index 7d6817a649f..125f7461a4c 100755 --- a/scripts/replace-packages.sh +++ b/scripts/replace-packages.sh @@ -14,8 +14,7 @@ DSTDIR=${2-$PWD/node_modules} pushd "$SRCDIR" yarn install npm run build -# Endo requires this -npx lerna run build:types || true + npm query .workspace | jq -r '.[].location' | while read -r dir; do # Skip private packages. test "$(jq .private < "$dir/package.json")" != true || continue From b117ef85d5220359bd2081b8e19f2e1af7583b4d Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Sat, 17 Aug 2024 13:55:22 -0400 Subject: [PATCH 2/2] lint: any for template fn args --- packages/base-zone/src/make-once.js | 2 +- packages/internal/src/callback.js | 24 ++++++++++++------------ packages/internal/src/types.d.ts | 2 +- patches/@endo+eventual-send+1.2.4.patch | 13 +++++++++++++ 4 files changed, 27 insertions(+), 14 deletions(-) create mode 100644 patches/@endo+eventual-send+1.2.4.patch diff --git a/packages/base-zone/src/make-once.js b/packages/base-zone/src/make-once.js index adb01b70cb2..fbefd6e9d17 100644 --- a/packages/base-zone/src/make-once.js +++ b/packages/base-zone/src/make-once.js @@ -35,7 +35,7 @@ export const makeOnceKit = (debugName, stores, backingStore = undefined) => { * Ensure the wrapped function is only called once per incarnation. It is * expected to update the backing store directly. * - * @template {(key: string, ...rest: unknown[]) => any} T + * @template {(key: string, ...rest: any[]) => any} T * @param {T} provider * @param {(label: string) => string[]} [labelToKeys] * @returns {T} diff --git a/packages/internal/src/callback.js b/packages/internal/src/callback.js index 01350acfa58..a8400ae90c5 100644 --- a/packages/internal/src/callback.js +++ b/packages/internal/src/callback.js @@ -41,7 +41,7 @@ const isPropertyKey = key => { /** * Synchronously call a callback. * - * @template {(...args: unknown[]) => any} I + * @template {(...args: any[]) => any} I * @param {SyncCallback} callback * @param {Parameters} args * @returns {ReturnType} @@ -58,7 +58,7 @@ harden(callSync); /** * Eventual send to a callback. * - * @template {(...args: unknown[]) => any} I + * @template {(...args: any[]) => any} I * @param {Callback} callback * @param {Parameters} args * @returns {Promise>>} @@ -75,9 +75,9 @@ harden(callE); /** * Create a callback from a near function. * - * @template {(...args: unknown[]) => any} I + * @template {(...args: any[]) => any} I * @template {(...args: [...B, ...Parameters]) => ReturnType} [T=I] - * @template {unknown[]} [B=[]] + * @template {any[]} [B=[]] * @param {T} target * @param {B} bound * @returns {SyncCallback} @@ -94,9 +94,9 @@ harden(makeSyncFunctionCallback); /** * Create a callback from a potentially far function. * - * @template {(...args: unknown[]) => any} I + * @template {(...args: any[]) => any} I * @template {ERef<(...args: [...B, ...Parameters]) => ReturnType>} [T=ERef] - * @template {unknown[]} [B=[]] + * @template {any[]} [B=[]] * @param {T} target * @param {B} bound * @returns {Callback} @@ -113,12 +113,12 @@ harden(makeFunctionCallback); /** * Create a callback from a near method. * - * @template {(...args: unknown[]) => any} I + * @template {(...args: any[]) => any} I * @template {PropertyKey} P * @template {{ * [x in P]: (...args: [...B, ...Parameters]) => ReturnType; * }} [T={ [x in P]: I }] - * @template {unknown[]} [B=[]] + * @template {any[]} [B=[]] * @param {T} target * @param {P} methodName * @param {B} bound @@ -139,12 +139,12 @@ harden(makeSyncMethodCallback); /** * Create a callback from a potentially far method. * - * @template {(...args: unknown[]) => any} I + * @template {(...args: any[]) => any} I * @template {PropertyKey} P * @template {ERef<{ * [x in P]: (...args: [...B, ...Parameters]) => ReturnType; * }>} [T=ERef<{ [x in P]: I }>] - * @template {unknown[]} [B=[]] + * @template {any[]} [B=[]] * @param {T} target * @param {P} methodName * @param {B} bound @@ -200,11 +200,11 @@ export const prepareAttenuator = ( { interfaceGuard, tag = 'Attenuator' } = {}, ) => { /** - * @typedef {(this: any, ...args: unknown[]) => any} Method + * @typedef {(this: any, ...args: any[]) => any} Method * * @typedef {{ [K in M]?: Callback | null }} Overrides * - * @typedef {{ [K in M]: (this: any, ...args: unknown[]) => any }} Methods + * @typedef {{ [K in M]: (this: any, ...args: any[]) => any }} Methods */ const methods = /** @type {Methods} */ ( fromEntries( diff --git a/packages/internal/src/types.d.ts b/packages/internal/src/types.d.ts index 2cbeb768137..a91602bf1f4 100644 --- a/packages/internal/src/types.d.ts +++ b/packages/internal/src/types.d.ts @@ -14,7 +14,7 @@ export type TotalMap = Omit, 'get'> & { export type TotalMapFrom = M extends Map ? TotalMap : never; -export declare class Callback any> { +export declare class Callback any> { private iface: I; public target: any; diff --git a/patches/@endo+eventual-send+1.2.4.patch b/patches/@endo+eventual-send+1.2.4.patch new file mode 100644 index 00000000000..f2ce760a105 --- /dev/null +++ b/patches/@endo+eventual-send+1.2.4.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/@endo/eventual-send/src/types.d.ts b/node_modules/@endo/eventual-send/src/types.d.ts +index d847557..64bb686 100644 +--- a/node_modules/@endo/eventual-send/src/types.d.ts ++++ b/node_modules/@endo/eventual-send/src/types.d.ts +@@ -17,7 +17,7 @@ export type * from './track-turns.js'; + // Types exposed to modules. + // + +-export type Callable = (...args: unknown[]) => any; ++export type Callable = (...args: any[]) => any; + + /** + * Nominal type to carry the local and remote interfaces of a Remotable.