Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Standardize @types/node version and upgrade all TS packages to use [email protected] #5423

Merged
merged 2 commits into from
Aug 11, 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"nyc": "15.1.0",
"prettier": "^2.5.1",
"prs-merged-since": "^1.1.0",
"typescript": "^4.1.4"
"typescript": "^4.7.4"
},
"workspaces": {
"packages": [
Expand Down
4 changes: 2 additions & 2 deletions packages/abi-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
"@types/faker": "^5.1.2",
"@types/jest": "27.4.1",
"@types/jest-json-schema": "^2.1.2",
"@types/node": "12.12.21",
"@types/node": "~12.12.0",
"jest": "28.1.3",
"jest-extended": "^0.11.5",
"jest-json-schema": "^2.1.0",
"ts-jest": "28.0.7",
"ts-node": "10.7.0",
"typescript": "^4.1.4"
"typescript": "^4.7.4"
},
"keywords": [
"abi",
Expand Down
4 changes: 2 additions & 2 deletions packages/artifactor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@truffle/contract": "^4.5.21",
"@types/fs-extra": "^8.1.0",
"@types/lodash": "^4.14.179",
"@types/node": "12.12.21",
"@types/node": "~12.12.0",
"chai": "^4.2.0",
"debug": "^4.3.1",
"ganache": "7.4.0",
Expand All @@ -39,7 +39,7 @@
"sinon": "^9.0.2",
"tmp": "^0.2.1",
"ts-node": "10.7.0",
"typescript": "^4.1.4",
"typescript": "^4.7.4",
"web3": "1.7.4"
},
"publishConfig": {
Expand Down
7 changes: 1 addition & 6 deletions packages/artifactor/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@
]
},
"rootDir": ".",
"typeRoots": [
"./typings",
"../../**/node_modules/@types/mocha",
"../../**/node_modules/@types/fs-extra",
"../../**/node_modules/@types/node"
]
"types": ["node", "mocha"]
},
"include": [
"./**/*.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/blockchain-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
"devDependencies": {
"@types/assert": "^1.4.2",
"@types/mocha": "^5.2.7",
"@types/node": "12.12.21",
"@types/node": "~12.12.0",
"@types/web3": "^1.0.20",
"mocha": "9.2.2",
"ts-node": "10.7.0",
"typescript": "^4.1.4"
"typescript": "^4.7.4"
},
"keywords": [
"blockchain",
Expand Down
2 changes: 2 additions & 0 deletions packages/blockchain-utils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
]
},
"rootDir": ".",
"types": ["node", "mocha"],
"typeRoots": [
"./typings",
"../../node_modules/@types/node",
"../../node_modules/@types/mocha",
"../../node_modules/@types/assert"
]
Expand Down
2 changes: 1 addition & 1 deletion packages/box/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"mocha": "9.2.2",
"sinon": "^9.0.2",
"ts-node": "10.7.0",
"typescript": "^4.1.4"
"typescript": "^4.7.4"
},
"keywords": [
"boilerplate",
Expand Down
4 changes: 2 additions & 2 deletions packages/code-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"devDependencies": {
"@types/cbor": "^5.0.1",
"@types/mocha": "^5.2.7",
"@types/node": "12.12.21",
"@types/node": "~12.12.0",
"mocha": "9.2.2",
"ts-node": "10.7.0",
"typescript": "^4.1.4"
"typescript": "^4.7.4"
},
"publishConfig": {
"access": "public"
Expand Down
7 changes: 1 addition & 6 deletions packages/code-utils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@
]
},
"rootDir": ".",
"typeRoots": [
"./typings",
"node_modules/@types",
"../../node_modules/@types/mocha",
"../../node_modules/@types/node"
]
"types": ["node", "mocha"]
},
"include": [
"./src/**/*.ts",
Expand Down
6 changes: 3 additions & 3 deletions packages/codec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
"@types/lodash": "^4.14.179",
"@types/semver": "^6.0.0",
"@types/utf8": "^2.1.6",
"@zerollup/ts-transform-paths": "^1.7.3",
"ts-node": "10.7.0",
"ttypescript": "1.5.13",
"typedoc": "0.20.37",
"typedoc": "0.22.18",
"typedoc-plugin-remove-references": "^0.0.5",
"typescript": "^4.1.4"
"typescript": "^4.7.4",
"typescript-transform-paths": "3.3.1"
},
"keywords": [
"abi",
Expand Down
13 changes: 3 additions & 10 deletions packages/codec/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,11 @@
]
},
"plugins": [
{
"transform": "@zerollup/ts-transform-paths",
"exclude": "*"
}
{ "transform": "typescript-transform-paths" },
{ "transform": "typescript-transform-paths", "afterDeclarations": true }
],
"rootDir": ".",
"typeRoots": [
"./typings",
"../../**/node_modules/@types/bn.js",
"../../**/node_modules/@types/debug",
"../../**/node_modules/@types/lodash"
]
"types": ["node"]
},
"include": [
"./lib/**/*.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/compile-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
"devDependencies": {
"@truffle/contract-schema": "^3.4.9",
"@types/mocha": "^5.2.7",
"@types/node": "12.12.21",
"@types/node": "~12.12.0",
"mocha": "9.2.2",
"ts-node": "10.7.0",
"typescript": "^4.1.4"
"typescript": "^4.7.4"
},
"gitHead": "6b84be7849142588ef2e3224d8a9d7c2ceeb6e4a"
}
3 changes: 2 additions & 1 deletion packages/compile-solidity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"fs-extra": "^9.1.0",
"iter-tools": "^7.0.2",
"lodash": "^4.17.21",
"node-abort-controller": "^3.0.1",
"original-require": "^1.0.1",
"require-from-string": "^2.0.2",
"semver": "7.3.7",
Expand All @@ -50,7 +51,7 @@
"sinon": "^9.0.2",
"tmp": "^0.2.1",
"ttypescript": "1.5.13",
"typescript": "^4.3.5",
"typescript": "^4.7.4",
"typescript-transform-paths": "3.3.1"
},
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { Spinner } from "@truffle/spinners";

// must polyfill AbortController to use axios >=0.20.0, <=0.27.2 on node <= v14.x
import "../../polyfill";
import axios from "axios";

import axiosRetry from "axios-retry";
import fs from "fs";
import { execSync } from "child_process";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ const debug = debugModule("compile:compilerSupplier");

import requireFromString from "require-from-string";
import originalRequire from "original-require";

// must polyfill AbortController to use axios >=0.20.0, <=0.27.2 on node <= v14.x
import "../../polyfill";
import { default as axios, AxiosResponse } from "axios";

import semver from "semver";

import solcWrap from "solc/wrapper";
import { Cache } from "../Cache";
import { observeListeners } from "../observeListeners";
Expand Down
11 changes: 11 additions & 0 deletions packages/compile-solidity/src/polyfill.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// must polyfill AbortController to use axios >=0.20.0, <=0.27.2 on node <= v14.x
Copy link
Member

Choose a reason for hiding this comment

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

Minor nit: I think the filename should reflect the type of polyfill, like abort-controller-pollyfill.ts or something similar, instead of polyfill.ts

Copy link
Member

Choose a reason for hiding this comment

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

I guess we shouldn't worry about this If the intention is to revisit and have a polyfill module as followup work.

import { AbortController, AbortSignal } from "node-abort-controller";

// we're using the "dom" lib in this package, so these types are already
// defined, but their implementations are nonexistent when running under node <=
// v15.x, so we polyfill them here anyway

if (typeof (global as any).AbortController === "undefined") {
(global as any).AbortController = AbortController;
(global as any).AbortSignal = AbortSignal;
}
5 changes: 1 addition & 4 deletions packages/compile-solidity/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
},
"rootDir": "src",
"baseUrl": ".",
"typeRoots": ["../../node_modules/@types/node"],
"types": [
"mocha"
],
"types": [ "mocha" ],
"plugins": [
{ "transform": "typescript-transform-paths" },
{ "transform": "typescript-transform-paths", "afterDeclarations": true }
Expand Down
6 changes: 3 additions & 3 deletions packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@truffle/error": "^0.1.0",
"@truffle/events": "^0.1.12",
"@truffle/provider": "^0.2.58",
"conf": "^10.0.2",
"conf": "^10.1.2",
"find-up": "^2.1.0",
"lodash": "^4.17.21",
"original-require": "^1.0.1"
Expand All @@ -33,12 +33,12 @@
"@types/configstore": "^4.0.0",
"@types/find-up": "^2.1.0",
"@types/lodash": "^4.14.179",
"@types/node": "12.12.21",
"@types/node": "~12.12.0",
"@types/sinon": "^9.0.10",
"mocha": "9.2.2",
"sinon": "^9.0.2",
"ts-node": "10.7.0",
"typescript": "^4.1.4"
"typescript": "^4.7.4"
},
"keywords": [
"config",
Expand Down
1 change: 1 addition & 0 deletions packages/config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"baseUrl": ".",
"lib": ["es2019", "dom"],
"rootDir": "./src",
"types": ["node", "mocha"],
"typeRoots": [
"./typings",
"node_modules/@types/node",
Expand Down
3 changes: 3 additions & 0 deletions packages/dashboard-message-bus-client/lib/connection/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import WebSocket from "isomorphic-ws";

// must polyfill AbortController to use axios >=0.20.0, <=0.27.2 on node <= v14.x
import "../polyfill";
import axios from "axios";
import {
base64ToJson,
Expand Down
12 changes: 12 additions & 0 deletions packages/dashboard-message-bus-client/lib/polyfill.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// must polyfill AbortController to use axios >=0.20.0, <=0.27.2 on node <= v14.x
import { AbortController, AbortSignal } from "node-abort-controller";
Comment on lines +1 to +2
Copy link
Member

Choose a reason for hiding this comment

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

Second use; duplicate, grin and bear it :)


declare global {
type AbortController = typeof AbortController;
type AbortSignal = typeof AbortSignal;
}

if (typeof (global as any).AbortController === "undefined") {
(global as any).AbortController = AbortController;
(global as any).AbortSignal = AbortSignal;
}
5 changes: 3 additions & 2 deletions packages/dashboard-message-bus-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@
"debug": "^4.3.1",
"delay": "^5.0.0",
"isomorphic-ws": "^4.0.1",
"node-abort-controller": "^3.0.1",
"tiny-typed-emitter": "^2.1.0",
"ws": "^7.2.0"
},
"devDependencies": {
"@types/debug": "^4.1.5",
"@types/node": "^16.11.6",
"typescript": "^4.1.4"
"@types/node": "~12.12.0",
"typescript": "^4.7.4"
}
}
4 changes: 2 additions & 2 deletions packages/dashboard-message-bus-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"access": "public"
},
"devDependencies": {
"@types/node": "^12.0.0",
"typescript": "^4.1.4"
"@types/node": "~12.12.0",
"typescript": "^4.7.4"
}
}
2 changes: 1 addition & 1 deletion packages/dashboard-message-bus-e2e-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@truffle/dashboard-message-bus-common": "^0.1.2",
"@types/debug": "^4.1.5",
"@types/jest": "^27.0.3",
"@types/node": "^16.11.6",
"@types/node": "~12.12.0",
"@types/web3": "^1.2.2",
"ethers": "^5.6.2",
"jest": "28.1.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/dashboard-message-bus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
},
"types": "dist/lib/index.d.ts",
"devDependencies": {
"@types/node": "^12.0.0",
"@types/node": "~12.12.0",
"@types/promise.any": "^2.0.0",
"@types/web3": "^1.2.2",
"typescript": "^4.1.4"
"typescript": "^4.7.4"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@types/ethereum-protocol": "^1.0.2",
"@types/express": "^4.17.13",
"@types/jest": "27.4.1",
"@types/node": "^12.0.0",
"@types/node": "~12.12.0",
"@types/react": "^17.0.37",
"@types/react-dom": "^17.0.11",
"@types/ws": "^7.2.0",
Expand All @@ -74,7 +74,7 @@
"tailwindcss": "npm:@tailwindcss/postcss7-compat",
"ts-jest": "28.0.7",
"ts-node": "10.7.0",
"typescript": "^4.1.4",
"typescript": "^4.7.4",
"wagmi": "^0.2.21"
},
"publishConfig": {
Expand Down
6 changes: 3 additions & 3 deletions packages/db-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
},
"devDependencies": {
"@types/jest": "27.4.1",
"@types/node": "12.12.21",
"@types/node": "~12.12.0",
"@types/react": "^16.8.0",
"@types/web3": "^1.0.20",
"eslint-plugin-react-hooks": "^4.3.0",
Expand All @@ -67,8 +67,8 @@
"ts-node": "10.7.0",
"tsconfig-paths": "^3.9.0",
"ttypescript": "1.5.13",
"typedoc": "0.20.37",
"typescript": "^4.1.4",
"typedoc": "0.22.18",
"typescript": "^4.7.4",
"typescript-transform-paths": "3.3.1",
"web3-core": "1.7.4"
},
Expand Down
7 changes: 5 additions & 2 deletions packages/db-kit/typedoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ module.exports = {
entryPoints: ["src/index.ts"],
categorizeByGroup: false,
readme: "none",
plugin: ["none"],
out: "dist/docs"
plugin: [],
out: "dist/docs",
validation: {
notExported: false
}
};
2 changes: 1 addition & 1 deletion packages/db-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
"@truffle/db": "^1.0.18"
},
"devDependencies": {
"typescript": "^4.1.4"
"typescript": "^4.7.4"
}
}
Loading