Skip to content

Commit

Permalink
Upgrade to TypeScript 5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
wojpawlik committed Jul 11, 2024
1 parent 4cbb453 commit 9959150
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 41 deletions.
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"deno.unstable": false,
"deno.path": "node_modules/.bin/deno",
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "denoland.vscode-deno",
"editor.formatOnSave": true,
Expand All @@ -13,5 +13,9 @@
"node_modules/**": true,
"package-lock.json": true,
"src/deps.deno.ts": true
},
"terminal.integrated.env.linux": {
"NPM_CONFIG_PREID": "beta",
"DENO_FUTURE": "1"
}
}
58 changes: 29 additions & 29 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.12.0",
"version": "1.13.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": "^22.0.0"
"ts-morph": "^23.0.0"
},
"devDependencies": {
"@types/node": "^18.15.11",
"deno-bin": "~1.42.0",
"deno-bin": "~1.45.0",
"fast-check": "^3.10.0"
}
}
4 changes: 2 additions & 2 deletions scripts/pretest.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env -S deno run --allow-read --allow-write="src/deps.deno.ts"
#!/usr/bin/env -S node_modules/.bin/deno run --allow-read --allow-write="src/deps.deno.ts"
const { version } = JSON.parse(
await Deno.readTextFile("node_modules/ts-morph/package.json"),
);
const deps = await Deno.readTextFile("src/deps.deno.ts");
await Deno.writeTextFile(
"src/deps.deno.ts",
deps.replace(/(?<=ts_morph@)[\d.]+/, version),
deps.replace(/(?<=ts-morph@)[\d.]+/, version),
);
10 changes: 6 additions & 4 deletions scripts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@ git diff --quiet || {
exit 2
}

if npm outdated ts-morph --json | jq --exit-status '."ts-morph" | .latest == .wanted' >/dev/null; then
NPM_CONFIG_PACKAGE_LOCK_ONLY=1 \
npm query --expect-results '#ts-morph:outdated(major)' &>/dev/null || {
echo 'ts-morph already up to date.'
exit 0
fi
}

NPM_CONFIG_PACKAGE_LOCK_ONLY=1 \
npm install --save-dev --save-prefix='~' deno-bin@latest
npm install-test ts-morph@latest
! git diff --quiet src/deps.deno.ts

newTsVersion=$(scripts/ts-version.ts || exit 0)
tsVersion="$(scripts/ts-version.ts)" || exit 0
npm run prepare
lib/cli.js --noEmit

git add src/deps.deno.ts
npm version minor --force --message "Upgrade to TypeScript ${newTsVersion}"
npm version "${1:-minor}" --force --message "Upgrade to TypeScript $tsVersion"
6 changes: 5 additions & 1 deletion src/_transformations/vendor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ test(function vendoring() {
skipAddingFilesFromTsConfig: true,
});
const vendorDir = project.createDirectory("src/vendor");
const file = project.addSourceFileAtPath("src/deps.deno.ts");
const file = project.createSourceFile(
"src/deps.deno.ts",
'export * from "https://deno.land/x/ts_morph/mod.ts"',
{ overwrite: true },
);
const exportDeclaration =
file.getChildrenOfKind(ts.SyntaxKind.ExportDeclaration)[0];

Expand Down
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@22.0.0/mod.ts";
export * from "jsr:@ts-morph/ts-morph@23.0.0";

0 comments on commit 9959150

Please sign in to comment.