Skip to content

Commit

Permalink
Upgrade to TypeScript 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wojpawlik committed Sep 22, 2023
1 parent c4a503b commit dc34fd8
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 74 deletions.
68 changes: 17 additions & 51 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.9.0",
"version": "1.10.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": "^19.0.0"
"ts-morph": "^20.0.0"
},
"devDependencies": {
"@types/node": "^18.15.11",
"deno-bin": "~1.36.0",
"deno-bin": "~1.37.0",
"fast-check": "^3.10.0"
}
}
17 changes: 17 additions & 0 deletions scripts/ts-version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!node_modules/.bin/deno run
import { ts } from "../src/deps.deno.ts";

const minor = (version: string) => version.split(".", 2).join(".");
const deno_s = minor(Deno.version.typescript);
const ts_morph_s = minor(ts.version);

if (deno_s !== ts_morph_s) {
console.error(
"Deno's TypeScript version (%s) doesn't match ts-morph's (%s).",
deno_s,
ts_morph_s,
);
Deno.exit(1);
}

console.info(ts_morph_s);
21 changes: 2 additions & 19 deletions scripts/update.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash
set -eu

export PATH="$PWD/node_modules/.bin:$PATH"
export NPM_CONFIG_COMMIT_HOOKS=false

git diff --quiet || {
Expand All @@ -11,30 +10,14 @@ git diff --quiet || {

if npm outdated ts-morph --json | jq --exit-status '."ts-morph" | .latest == .wanted' >/dev/null; then
echo 'ts-morph already up to date.'
exit
exit 0
fi

npm install --ignore-scripts
oldTsVersion="$(deno eval --print 'Deno.version.typescript.match(/^\d+\.\d+/, "")[0]')"
npm install --save-dev --save-prefix='~' deno-bin@latest
newTsVersion="$(deno eval --print 'Deno.version.typescript.match(/^\d+\.\d+/, "")[0]')"

if [ "$oldTsVersion" == "$newTsVersion" ]; then
echo 'Deno already up to date.'
git restore 'package*.json'
exit
fi

npm install-test ts-morph@latest
! git diff --quiet src/deps.deno.ts
src/cli.ts --noEmit
tsMorphTsVersion=$(node --print 'require("ts-morph").ts.version.match(/^\d+\.\d+/, "")[0]')

if [[ "$tsMorphTsVersion" != "$newTsVersion" ]]; then
echo "TypeScript version mismatch! Deno's: $newTsVersion, ts-morph's: $tsMorphTsVersion"
exit 1
fi

newTsVersion=$(scripts/ts-version.ts || exit 0)
git add src/deps.deno.ts

npm version minor --force --message "Upgrade to TypeScript ${newTsVersion}"
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@19.0.0/mod.ts";
export * from "https://deno.land/x/ts_morph@20.0.0/mod.ts";

0 comments on commit dc34fd8

Please sign in to comment.