Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no more maxNodeModuleJsDepth #6369

Merged
merged 4 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/ERTP/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"lint-fix": "yarn lint:eslint --fix",
"lint": "run-s --continue-on-error lint:*",
"lint:eslint": "eslint .",
"lint:types": "tsc --maxNodeModuleJsDepth 3 -p jsconfig.json"
"lint:types": "tsc -p jsconfig.json"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/SwingSet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"test:xs-worker": "ava test/workers/test-worker.js -m 'xs vat manager'",
"lint-fix": "yarn lint:eslint --fix",
"lint": "yarn lint:types&&yarn lint:eslint",
"lint:types": "tsc --maxNodeModuleJsDepth 3 -p jsconfig.json",
"lint:types": "tsc -p jsconfig.json",
"lint:eslint": "eslint ."
},
"devDependencies": {
Expand Down
5 changes: 3 additions & 2 deletions packages/SwingSet/src/controller/controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @ts-check
/* global globalThis, WeakRef, FinalizationRegistry */
/* eslint-disable @typescript-eslint/prefer-ts-expect-error -- https://github.com/Agoric/agoric-sdk/issues/4620 */

import fs from 'fs';
import path from 'path';
Expand Down Expand Up @@ -287,9 +288,9 @@ export async function makeSwingsetController(
}

const bundles = [
// @ts-expect-error assume lockdownBundle is set
// @ts-ignore assume lockdownBundle is set
JSON.parse(kvStore.get('lockdownBundle')),
// @ts-expect-error assume supervisorBundle is set
// @ts-ignore assume supervisorBundle is set
JSON.parse(kvStore.get('supervisorBundle')),
];
const startXSnap = makeStartXSnap(bundles, {
Expand Down
3 changes: 3 additions & 0 deletions packages/SwingSet/src/kernel/kernelSyscall.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check
/* eslint-disable @typescript-eslint/prefer-ts-expect-error -- https://github.com/Agoric/agoric-sdk/issues/4620 */

import { assert, details as X } from '@agoric/assert';
import { insistKernelType } from './parseKernelSlots.js';
Expand Down Expand Up @@ -207,8 +208,10 @@ export function makeKernelSyscallHandler(tools) {
workingLowerBound = actualLowerBound;
workingUpperBound = actualUpperBound;
workingKeyIterator = kvStore.getKeys(startKey, actualUpperBound);
// @ts-ignore some resolution thinks this is undefined
nextIter = workingKeyIterator.next();
if (!nextIter.done && nextIter.value === actualPriorKey) {
// @ts-ignore some resolution thinks this is undefined
nextIter = workingKeyIterator.next();
}
}
Expand Down
3 changes: 2 additions & 1 deletion packages/SwingSet/src/kernel/state/kernelKeeper.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check
/* eslint-disable @typescript-eslint/prefer-ts-expect-error -- https://github.com/Agoric/agoric-sdk/issues/4620 */
import { Nat, isNat } from '@agoric/nat';
import { assert, details as X } from '@agoric/assert';
import { wrapStorage } from './storageWrapper.js';
Expand Down Expand Up @@ -199,7 +200,7 @@ export default function makeKernelKeeper(
*/
function getRequired(key) {
assert(kvStore.has(key), X`storage lacks required key ${key}`);
// @ts-expect-error already checked .has()
// @ts-ignore already checked .has()
return kvStore.get(key);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test:xs": "exit 0",
"lint-fix": "yarn lint:eslint --fix",
"lint": "run-s --continue-on-error lint:*",
"lint:types": "tsc --maxNodeModuleJsDepth 4 -p jsconfig.json",
"lint:types": "tsc -p jsconfig.json",
"lint:eslint": "eslint --ext .js,.ts ."
},
"keywords": [],
Expand Down
2 changes: 1 addition & 1 deletion packages/casting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test:xs": "exit 0",
"lint-fix": "yarn lint:eslint --fix",
"lint": "run-s --continue-on-error lint:*",
"lint:types": "tsc --maxNodeModuleJsDepth 4 -p jsconfig.json",
"lint:types": "tsc -p jsconfig.json",
"lint:eslint": "eslint --ext .js,.ts ."
},
"keywords": [],
Expand Down
2 changes: 1 addition & 1 deletion packages/cosmic-swingset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"test:xs": "exit 0",
"lint-fix": "yarn lint:eslint --fix",
"lint": "run-s --continue-on-error lint:*",
"lint:types": "tsc --maxNodeModuleJsDepth 3 -p jsconfig.json",
"lint:types": "tsc -p jsconfig.json",
"lint:eslint": "eslint ."
},
"keywords": [],
Expand Down
2 changes: 1 addition & 1 deletion packages/deploy-script-support/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test:xs": "exit 0",
"lint-fix": "yarn lint:eslint --fix",
"lint:eslint": "eslint .",
"lint:types": "tsc --maxNodeModuleJsDepth 5 -p jsconfig.json",
"lint:types": "tsc -p jsconfig.json",
"lint": "run-s --continue-on-error lint:*"
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/governance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"lint-fix": "yarn lint:eslint --fix",
"lint": "run-s --continue-on-error lint:*",
"lint:eslint": "eslint .",
"lint:types": "tsc --maxNodeModuleJsDepth 3 -p jsconfig.json"
"lint:types": "tsc -p jsconfig.json"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/inter-protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"lint-fix": "yarn lint:eslint --fix",
"lint": "run-s --continue-on-error lint:*",
"lint:eslint": "eslint .",
"lint:types": "tsc --maxNodeModuleJsDepth 5 -p jsconfig.json"
"lint:types": "tsc -p jsconfig.json"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions packages/internal/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
/** @file
*
* Some of this config info may make more sense in a particular package. However
* due to the maxNodeModuleJsDepth hack and our general lax dependency graph,
* sometimes rational placements cause type resolution errors.
* due to https://github.com/Agoric/agoric-sdk/issues/4620 and our lax package
* dependency graph, sometimes rational placements cause type resolution errors.
*
* So as a work-around some constants that need access from more than one package are placed here.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/notifier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"lint-fix": "yarn lint:eslint --fix",
"lint": "run-s --continue-on-error lint:*",
"lint:eslint": "eslint .",
"lint:types": "tsc --maxNodeModuleJsDepth 3 -p jsconfig.json"
"lint:types": "tsc -p jsconfig.json"
},
"repository": {
"type": "git",
Expand Down
2 changes: 2 additions & 0 deletions packages/notifier/src/asyncIterableAdaptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ export const makeAsyncIterableFromNotifier = notifierP => {
return harden({ value, done });
});
}
// xxx hint for type checker
assert(myIterationResultP);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh that's weird. Why doesn't flow control realize that myIterationResultP is never undefined here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's weird. I don't now why but here's the error without it,

> @agoric/ui-components@0.3.3 lint:types
> tsc -p jsconfig.json

../notifier/src/asyncIterableAdaptor.js(39,3): error TS2322: Type '{ [Symbol.asyncIterator]: () => { next: () => Promise<{ value: T; done: boolean; }> | undefined; } & RemotableBrand<{}, { next: () => Promise<{ value: T; done: boolean; }> | undefined; }>; } & RemotableBrand<...>' is not assignable to type 'ConsistentAsyncIterable<T>'.
  The types returned by '[Symbol.asyncIterator]().next(...)' are incompatible between these types.
    Type 'Promise<{ value: T; done: boolean; }> | undefined' is not assignable to type 'Promise<IteratorResult<T, T>>'.
      Type 'undefined' is not assignable to type 'Promise<IteratorResult<T, T>>'.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I think I know. TS doesn't know that the chained calls, and in particular .then() doesn't execute the callbacks synchronously, so it can't know that myIterationResultP = undefined; hasn't happened.

return myIterationResultP;
},
});
Expand Down
3 changes: 2 additions & 1 deletion packages/notifier/src/storesub.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ export const makeStoredSubscription = (
}

/** @type {StoredSubscription<T>} */
// @ts-expect-error getStoreKey invalid, deprecated type
// eslint-disable-next-line -- different per package https://github.com/Agoric/agoric-sdk/issues/4620
// @ts-ignore getStoreKey type does not have `subscription`
const storesub = Far('StoredSubscription', {
getStoreKey: async () => {
if (!storageNode) {
Expand Down
2 changes: 2 additions & 0 deletions packages/notifier/test/prepare-test-env-ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ import '@endo/init';
import { wrapTest } from '@endo/ses-ava';
import rawTest from 'ava';

// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
// @ts-ignore -- https://github.com/endojs/endo/issues/1235
export const test = wrapTest(rawTest);
11 changes: 6 additions & 5 deletions packages/notifier/test/test-publish-kit.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check
/* eslint-disable @typescript-eslint/prefer-ts-expect-error -- https://github.com/Agoric/agoric-sdk/issues/4620 */

import { test } from './prepare-test-env-ava.js';
import {
Expand Down Expand Up @@ -124,13 +125,13 @@ test('makePublishKit', async t => {
'failure should not be allowed after finalization',
);
await t.throwsAsync(
// @ts-expect-error known to be promise version of PublicationList
// @ts-ignore known to be promise version of PublicationList
subFinal.tail,
undefined,
'tail promise of final result should be rejected',
);
await t.throwsAsync(
// @ts-expect-error known to be promise version of PublicationList
// @ts-ignore known to be promise version of PublicationList
subscriber.subscribeAfter(subFinal.publishCount),
undefined,
'subscribeAfter(finalPublishCount) should be rejected',
Expand Down Expand Up @@ -179,13 +180,13 @@ test('makePublishKit - immediate finish', async t => {
'failure should not be allowed after finalization',
);
await t.throwsAsync(
// @ts-expect-error known to be promise version of PublicationList
// @ts-ignore known to be promise version of PublicationList
subFinal.tail,
undefined,
'tail promise of final result should be rejected',
);
await t.throwsAsync(
// @ts-expect-error known to be promise version of PublicationList
// @ts-ignore known to be promise version of PublicationList
subscriber.subscribeAfter(subFinal.publishCount),
undefined,
'subscribeAfter(finalPublishCount) should be rejected',
Expand Down Expand Up @@ -336,7 +337,7 @@ test('subscribeAfter bounds checking', async t => {
const repr =
typeof badCount === 'string' ? JSON.stringify(badCount) : badCount;
t.throws(
// @ts-expect-error deliberate invalid arguments for testing
// @ts-ignore deliberate invalid arguments for testing
() => subscriber.subscribeAfter(badCount),
undefined,
`subscribeAfter should reject invalid publish count: ${typeof badCount} ${repr}`,
Expand Down
2 changes: 1 addition & 1 deletion packages/pegasus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"lint-fix": "yarn lint:eslint --fix",
"lint": "run-s --continue-on-error lint:*",
"lint:eslint": "eslint .",
"lint:types": "tsc --maxNodeModuleJsDepth 4 -p jsconfig.json"
"lint:types": "tsc -p jsconfig.json"
},
"repository": {
"type": "git",
Expand Down
3 changes: 1 addition & 2 deletions packages/smart-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test:xs": "exit 0",
"lint": "run-s --continue-on-error lint:*",
"lint-fix": "yarn lint:eslint --fix",
"lint:types": "tsc --maxNodeModuleJsDepth 4 -p jsconfig.json",
"lint:types": "tsc -p jsconfig.json",
"lint:eslint": "eslint ."
},
"devDependencies": {
Expand All @@ -19,7 +19,6 @@
"@agoric/deploy-script-support": "^0.9.4",
"@agoric/inter-protocol": "^0.13.1",
"@agoric/swingset-vat": "^0.30.2",
"@agoric/vats": "^0.11.0",
"@agoric/wallet-backend": "^0.13.3",
"@endo/captp": "^2.0.17",
"@endo/init": "^0.5.51",
Expand Down
2 changes: 1 addition & 1 deletion packages/smart-wallet/src/smartWallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ const behavior = {
self: {
/**
*
* @param {import('@endo/captp').CapData<string>} actionCapData of type BridgeAction
* @param {import('@endo/marshal').CapData<string>} actionCapData of type BridgeAction
* @param {boolean} [canSpend=false]
*/
handleBridgeAction(actionCapData, canSpend = false) {
Expand Down
2 changes: 1 addition & 1 deletion packages/solo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"test:xs": "exit 0",
"lint-fix": "yarn lint:eslint --fix",
"lint": "run-s --continue-on-error lint:*",
"lint:types": "tsc --maxNodeModuleJsDepth 4 -p jsconfig.json",
"lint:types": "tsc -p jsconfig.json",
"lint:eslint": "eslint ."
},
"keywords": [],
Expand Down
2 changes: 1 addition & 1 deletion packages/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test:xs": "exit 0",
"lint-fix": "yarn lint:eslint --fix",
"lint": "run-s --continue-on-error lint:*",
"lint:types": "tsc --maxNodeModuleJsDepth 3 -p jsconfig.json",
"lint:types": "tsc -p jsconfig.json",
"lint:eslint": "eslint ."
},
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/store/src/patterns/interface-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ export const defineHeapFarClassKit = (
const contextMapKit = objectMap(methodsKit, () => new WeakMap());
const prototypeKit = objectMap(methodsKit, (methods, facetName) =>
defendPrototype(
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error -- different per package #4620
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error -- different per package https://github.com/Agoric/agoric-sdk/issues/4620
// @ts-ignore could be symbol
`${tag} ${facetName}`,
contextMapKit[facetName],
Expand Down Expand Up @@ -394,7 +394,7 @@ export const defineHeapFarClassKit = (
}
return facets;
};
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error -- different per package #4620
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error -- different per package https://github.com/Agoric/agoric-sdk/issues/4620
// @ts-ignore xxx
return harden(makeInstanceKit);
};
Expand Down
2 changes: 1 addition & 1 deletion packages/swing-store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test:xs": "exit 0",
"lint-fix": "yarn lint:eslint --fix",
"lint": "run-s --continue-on-error lint:*",
"lint:types": "tsc --maxNodeModuleJsDepth 4 -p jsconfig.json",
"lint:types": "tsc -p jsconfig.json",
"lint:eslint": "eslint ."
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/telemetry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test:xs": "exit 0",
"lint-fix": "yarn lint:eslint --fix",
"lint": "run-s --continue-on-error lint:*",
"lint:types": "tsc --maxNodeModuleJsDepth 4 -p jsconfig.json",
"lint:types": "tsc -p jsconfig.json",
"lint:eslint": "eslint ."
},
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"lint-fix": "yarn lint:eslint --fix",
"lint": "run-s --continue-on-error lint:*",
"lint:eslint": "eslint .",
"lint:types": "tsc --maxNodeModuleJsDepth 3 -p jsconfig.json"
"lint:types": "tsc -p jsconfig.json"
},
"eslintConfig": {
"extends": [
Expand Down
2 changes: 1 addition & 1 deletion packages/vats/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"test:xs": "exit 0",
"lint-fix": "yarn lint:eslint --fix",
"lint": "run-s --continue-on-error lint:*",
"lint:types": "tsc --maxNodeModuleJsDepth 5 -p jsconfig.json",
"lint:types": "tsc -p jsconfig.json",
"lint:eslint": "eslint ."
},
"keywords": [],
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test:xs": "exit 0",
"lint": "run-s --continue-on-error lint:*",
"lint-fix": "yarn lint:eslint --fix",
"lint:types": "tsc --maxNodeModuleJsDepth 3 -p jsconfig.json",
"lint:types": "tsc -p jsconfig.json",
"lint:eslint": "eslint ."
},
"devDependencies": {
Expand Down
53 changes: 0 additions & 53 deletions packages/wallet/ui/endo-promise-kit.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/web-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test:watch": "web-test-runner --watch",
"lint-fix": "yarn lint:eslint --fix",
"lint": "run-s --continue-on-error lint:*",
"lint:types": "tsc --maxNodeModuleJsDepth 4 -p jsconfig.json",
"lint:types": "tsc -p jsconfig.json",
"lint:eslint": "eslint . --ignore-path .gitignore",
"analyze": "cem analyze --litelement",
"start": "web-dev-server --port 8100"
Expand Down
Loading