Skip to content

Commit

Permalink
Upgrade to TypeScript 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
wojpawlik committed Mar 28, 2024
1 parent 51ce3d2 commit 4cbb453
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 30 deletions.
42 changes: 21 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion src/deps.deno.ts
Original file line number Diff line number Diff line change
@@ -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";
5 changes: 3 additions & 2 deletions src/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ 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);
}
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;
}
9 changes: 6 additions & 3 deletions src/shim.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4cbb453

Please sign in to comment.