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

Update TypeScript to 4.5 #1043

Merged
merged 2 commits into from
Feb 3, 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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"eslint-plugin-prettier": "^3.1.2",
"lerna": "^3.19.0",
"lerna-update-wizard": "^0.17.5",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"scripts": {
"clean": "lerna clean",
Expand All @@ -69,7 +69,7 @@
"build": "lerna run build"
},
"dependencies": {
"@typescript-eslint/parser": "^4.25.0",
"@typescript-eslint/parser": "^5.10.2",
"conventional-changelog-conventionalcommits": "^4.6.0",
"patch-package": "^6.2.2"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/base64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [
"LICENSE*",
Expand Down
2 changes: 1 addition & 1 deletion packages/cjs-module-analyzer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [
"LICENSE*",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [
"LICENSE*",
Expand Down
2 changes: 1 addition & 1 deletion packages/compartment-mapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [
"LICENSE*",
Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [
"LICENSE*",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@jessie.js/eslint-plugin": "^0.1.1"
},
"devDependencies": {
"@typescript-eslint/parser": "^4.18.0",
"@typescript-eslint/parser": "^5.10.2",
"babel-eslint": "^10.0.3",
"eslint": "^7.23.0",
"eslint-config-airbnb-base": "^14.0.0",
Expand All @@ -42,7 +42,7 @@
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4",
"prettier": "^1.19.1",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [
"LICENSE*",
Expand Down
2 changes: 1 addition & 1 deletion packages/eventual-send/src/handled-promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ export const makeHandledPromise = () => {
},
resolve(value) {
// Resolving a Presence returns the pre-registered handled promise.
let resolvedPromise = presenceToPromise.get(value);
let resolvedPromise = presenceToPromise.get(/** @type {any} */ (value));
if (!resolvedPromise) {
resolvedPromise = Promise.resolve(value);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/lp32/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [
"LICENSE*",
Expand Down
3 changes: 3 additions & 0 deletions packages/marshal/src/dot-membrane.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const { fromEntries } = Object;
const { ownKeys } = Reflect;
const { details: X } = assert;

// TODO(erights): Add Converter type
/** @param {any} [mirrorConverter] */
const makeConverter = (mirrorConverter = undefined) => {
/** @type {WeakMap<any,any>=} */
let mineToYours = new WeakMap();
Expand Down Expand Up @@ -61,6 +63,7 @@ const makeConverter = (mirrorConverter = undefined) => {
break;
}
case 'remotable': {
/** @param {PropertyKey} [optVerb] */
const myMethodToYours = (optVerb = undefined) => (...yourArgs) => {
// We use mineIf rather than mine so that mine is not accessible
// after revocation. This gives the correct error behavior,
Expand Down
4 changes: 3 additions & 1 deletion packages/marshal/src/marshal-justin.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,9 @@ const decodeToJustin = (encoding, shouldIndent = false) => {
return out.close(']');
}
} else {
const names = ownKeys(rawTree);
// rawTree is an `EncodingRecord` which only has string keys,
// but since ownKeys is not generic, it can't propagate that
const names = /** @type {string[]} */ (ownKeys(rawTree));
if (names.length === 0) {
return out.next('{}');
} else {
Expand Down
1 change: 1 addition & 0 deletions packages/marshal/src/marshal.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ export function makeMarshal(

default: {
assert(
// @ts-expect-error exhaustive check should make condition true
qclass !== 'ibid',
X`The protocol no longer supports ibid encoding: ${rawTree}.`,
);
Expand Down
33 changes: 23 additions & 10 deletions packages/marshal/src/passStyleOf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,19 @@ import './types.js';
import './helpers/internal-types.js';
import { assertPassableSymbol } from './helpers/symbol.js';

/** @typedef {Exclude<PassStyle, PrimitiveStyle | "promise">} HelperPassStyle */

const { details: X, quote: q } = assert;
const { ownKeys } = Reflect;
const { isFrozen } = Object;

/**
* @param {PassStyleHelper[]} passStyleHelpers The passStyleHelpers to register,
* in priority order.
* NOTE These must all be "trusted",
* complete, and non-colliding. `makePassStyleOf` may *assume* that each helper
* does what it is supposed to do. `makePassStyleOf` is not trying to defend
* itself against malicious helpers, though it does defend against some
* accidents.
* @returns {PassStyleOf}
* @param {PassStyleHelper[]} passStyleHelpers
* @returns {Record<HelperPassStyle, PassStyleHelper> }
*/
const makePassStyleOf = passStyleHelpers => {

const makeHelperTable = passStyleHelpers => {
/** @type {Record<HelperPassStyle, any> & {__proto__: null}} */
const HelperTable = {
__proto__: null,
copyArray: undefined,
Expand All @@ -54,7 +52,22 @@ const makePassStyleOf = passStyleHelpers => {
X`missing helper for ${q(styleName)}`,
);
}
harden(HelperTable);

return harden(HelperTable);
};

/**
* @param {PassStyleHelper[]} passStyleHelpers The passStyleHelpers to register,
* in priority order.
* NOTE These must all be "trusted",
* complete, and non-colliding. `makePassStyleOf` may *assume* that each helper
* does what it is supposed to do. `makePassStyleOf` is not trying to defend
* itself against malicious helpers, though it does defend against some
* accidents.
* @returns {PassStyleOf}
*/
const makePassStyleOf = passStyleHelpers => {
const HelperTable = makeHelperTable(passStyleHelpers);
const remotableHelper = HelperTable.remotable;

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/netstring/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [
"LICENSE*",
Expand Down
2 changes: 1 addition & 1 deletion packages/promise-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [
"LICENSE*",
Expand Down
2 changes: 1 addition & 1 deletion packages/ses-ava/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [
"LICENSE*",
Expand Down
2 changes: 1 addition & 1 deletion packages/ses-types-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [],
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/ses/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"prettier": "^1.19.1",
"sinon": "8.0.4",
"terser": "^4.8.0",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [
"LICENSE*",
Expand Down
2 changes: 1 addition & 1 deletion packages/static-module-record/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [
"LICENSE*",
Expand Down
4 changes: 2 additions & 2 deletions packages/stream-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"devDependencies": {
"@endo/eslint-config": "^0.4.2",
"@endo/ses-ava": "^0.2.17",
"@typescript-eslint/parser": "^4.18.0",
"@typescript-eslint/parser": "^5.10.2",
"ava": "^3.12.1",
"babel-eslint": "^10.0.3",
"c8": "^7.7.3",
Expand All @@ -58,7 +58,7 @@
"eslint-plugin-jsdoc": "^30.4.2",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [
"LICENSE*",
Expand Down
2 changes: 1 addition & 1 deletion packages/stream-types-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [],
"publishConfig": {
Expand Down
4 changes: 2 additions & 2 deletions packages/stream/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@endo/eslint-config": "^0.4.2",
"@endo/init": "^0.5.33",
"@endo/ses-ava": "^0.2.17",
"@typescript-eslint/parser": "^4.18.0",
"@typescript-eslint/parser": "^5.10.2",
"ava": "^3.12.1",
"babel-eslint": "^10.0.3",
"c8": "^7.7.3",
Expand All @@ -57,7 +57,7 @@
"eslint-plugin-jsdoc": "^30.4.2",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [
"LICENSE*",
Expand Down
2 changes: 1 addition & 1 deletion packages/syrup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [
"LICENSE*",
Expand Down
2 changes: 1 addition & 1 deletion packages/where/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [
"LICENSE*",
Expand Down
2 changes: 1 addition & 1 deletion packages/zip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"typescript": "~4.2.3"
"typescript": "~4.5.5"
},
"files": [
"LICENSE*",
Expand Down
2 changes: 1 addition & 1 deletion scripts/repackage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ NEWPKGJSONHASH=$(
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"typescript": "~4.2.3",
"typescript": "~4.5.5",
"ava": "^3.12.1",
}) | to_entries | sort_by(.key) | from_entries,
files: ((.files // []) + [
Expand Down
Loading