From 4cbb4539c806cc4e639b033518102fb7ae66ecb2 Mon Sep 17 00:00:00 2001 From: Wojciech Pawlik Date: Thu, 28 Mar 2024 13:34:41 +0100 Subject: [PATCH] Upgrade to TypeScript 5.4 --- package-lock.json | 42 +++++++++++++++++++++--------------------- package.json | 6 +++--- src/deps.deno.ts | 2 +- src/help.ts | 5 +++-- src/shim.node.ts | 9 ++++++--- 5 files changed, 34 insertions(+), 30 deletions(-) diff --git a/package-lock.json b/package-lock.json index c8b7e1b..402491c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,22 +1,22 @@ { "name": "deno2node", - "version": "1.11.0", + "version": "1.12.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "deno2node", - "version": "1.11.0", + "version": "1.12.0", "license": "MIT", "dependencies": { - "ts-morph": "^21.0.1" + "ts-morph": "^22.0.0" }, "bin": { "deno2node": "lib/cli.js" }, "devDependencies": { "@types/node": "^18.15.11", - "deno-bin": "~1.39.0", + "deno-bin": "~1.42.0", "fast-check": "^3.10.0" }, "engines": { @@ -56,9 +56,9 @@ } }, "node_modules/@ts-morph/common": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.22.0.tgz", - "integrity": "sha512-HqNBuV/oIlMKdkLshXd1zKBqNQCsuPEsgQOkfFQ/eUKjRlwndXW1AjN9LVkBEIukm00gGXSRmfkl0Wv5VXLnlw==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.23.0.tgz", + "integrity": "sha512-m7Lllj9n/S6sOkCkRftpM7L24uvmfXQFedlW/4hENcuJH1HHm9u5EgxZb9uVjQSCGrbBWBkOGgcTxNg36r6ywA==", "dependencies": { "fast-glob": "^3.3.2", "minimatch": "^9.0.3", @@ -106,14 +106,14 @@ } }, "node_modules/code-block-writer": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-12.0.0.tgz", - "integrity": "sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w==" + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.1.tgz", + "integrity": "sha512-c5or4P6erEA69TxaxTNcHUNcIn+oyxSRTOWV+pSYF+z4epXqNvwvJ70XPGjPNgue83oAFAPBRQYwpAJ/Hpe/Sg==" }, "node_modules/deno-bin": { - "version": "1.39.0", - "resolved": "https://registry.npmjs.org/deno-bin/-/deno-bin-1.39.0.tgz", - "integrity": "sha512-F9zMzDROZOvtSBz3GLYIJwk5hJGm07OTCxVRJeuKBLGcLkmzQgsvSxDbRJbg+N97RryxNOck8ZtEula3NfxFMw==", + "version": "1.42.0", + "resolved": "https://registry.npmjs.org/deno-bin/-/deno-bin-1.42.0.tgz", + "integrity": "sha512-aCM5UrdUq9MJlXayXXMmwl/YsOGiIt5SUVWaEXLwB+ON+I06Ddrb90F99Dp///WpbySel1jCwV0Z0utVYVvr/g==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -162,9 +162,9 @@ } }, "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dependencies": { "reusify": "^1.0.4" } @@ -360,12 +360,12 @@ } }, "node_modules/ts-morph": { - "version": "21.0.1", - "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-21.0.1.tgz", - "integrity": "sha512-dbDtVdEAncKctzrVZ+Nr7kHpHkv+0JDJb2MjjpBaj8bFeCkePU9rHfMklmhuLFnpeq/EJZk2IhStY6NzqgjOkg==", + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-22.0.0.tgz", + "integrity": "sha512-M9MqFGZREyeb5fTl6gNHKZLqBQA0TjA1lea+CR48R8EBTDuWrNqW6ccC5QvjNR4s6wDumD3LTCjOFSp9iwlzaw==", "dependencies": { - "@ts-morph/common": "~0.22.0", - "code-block-writer": "^12.0.0" + "@ts-morph/common": "~0.23.0", + "code-block-writer": "^13.0.1" } } } diff --git a/package.json b/package.json index a73778b..5e4d00b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "deno2node", - "version": "1.11.0", + "version": "1.12.0", "description": "`tsc` replacement for transpiling Deno libraries to run on Node.js.", "type": "module", "bin": { @@ -43,11 +43,11 @@ "node": ">=14.13.1" }, "dependencies": { - "ts-morph": "^21.0.1" + "ts-morph": "^22.0.0" }, "devDependencies": { "@types/node": "^18.15.11", - "deno-bin": "~1.39.0", + "deno-bin": "~1.42.0", "fast-check": "^3.10.0" } } diff --git a/src/deps.deno.ts b/src/deps.deno.ts index 3ba4242..cb2248d 100644 --- a/src/deps.deno.ts +++ b/src/deps.deno.ts @@ -1,3 +1,3 @@ // Deno-only, see https://doc.deno.land/https/deno.land/x/deno2node/src/mod.ts#deno2node // Auto-updated in `dependencies` script -export * from "https://deno.land/x/ts_morph@21.0.1/mod.ts"; +export * from "https://deno.land/x/ts_morph@22.0.0/mod.ts"; diff --git a/src/help.ts b/src/help.ts index aa4e07f..bb2f300 100644 --- a/src/help.ts +++ b/src/help.ts @@ -26,7 +26,8 @@ You can learn about the compiler options at https://aka.ms/tsc `; } -const TTY = Deno.isatty(Deno.stdout.rid); +export const useColors = Deno.stdout.isTerminal() && !Deno.noColor; + function bold(text: string) { return format(text, 1); } @@ -34,5 +35,5 @@ function blue(text: string) { return format(text, 34); } function format(text: string, ansi: number) { - return TTY ? `\u001b[${ansi}m${text}\u001b[0m` : text; + return useColors ? `\u001b[${ansi}m${text}\u001b[0m` : text; } diff --git a/src/shim.node.ts b/src/shim.node.ts index 44122d9..d7b867a 100644 --- a/src/shim.node.ts +++ b/src/shim.node.ts @@ -11,9 +11,12 @@ export const Deno = { build: { os }, chmod, exit: process.exit, - isatty, - noColor: process.env.NO_COLOR !== undefined, - stdout: { rid: process.stdout.fd }, + get noColor() { + return Boolean(process.env.NO_COLOR); + }, + stdout: { + isTerminal: () => isatty(process.stdout.fd), + }, }; export async function fetch(fileUrl: URL) {