Skip to content

Commit 0d1d889

Browse files
authored
Remove tsx dependency (#32967)
* Remove tsx dependency * Iterate * Iterate * Iterate
1 parent dda9ec0 commit 0d1d889

21 files changed

Lines changed: 48 additions & 48 deletions

apps/desktop/.eslintrc.cjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ module.exports = {
4646
// Things we do that break the ideal style
4747
"prefer-promise-reject-errors": "off",
4848
"quotes": "off",
49+
"n/file-extension-in-import": "off",
4950

5051
"@typescript-eslint/no-explicit-any": "off",
5152
// We're okay with assertion errors when we ask for them
@@ -62,6 +63,7 @@ module.exports = {
6263
// Things we do that break the ideal style
6364
"prefer-promise-reject-errors": "off",
6465
"quotes": "off",
66+
"n/file-extension-in-import": "off",
6567

6668
"@typescript-eslint/no-explicit-any": "off",
6769
// We're okay with assertion errors when we ask for them

apps/desktop/hak/matrix-seshat/build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
66
Please see LICENSE files in the repository root for full details.
77
*/
88

9-
import type HakEnv from "../../scripts/hak/hakEnv.js";
10-
import type { DependencyInfo } from "../../scripts/hak/dep.js";
9+
import type HakEnv from "../../scripts/hak/hakEnv.ts";
10+
import type { DependencyInfo } from "../../scripts/hak/dep.ts";
1111

1212
export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
1313
const env = hakEnv.makeGypEnv();

apps/desktop/hak/matrix-seshat/check.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Please see LICENSE files in the repository root for full details.
99
import childProcess from "node:child_process";
1010
import fsProm from "node:fs/promises";
1111

12-
import type HakEnv from "../../scripts/hak/hakEnv.js";
13-
import type { Tool } from "../../scripts/hak/hakEnv.js";
14-
import type { DependencyInfo } from "../../scripts/hak/dep.js";
12+
import type HakEnv from "../../scripts/hak/hakEnv.ts";
13+
import type { Tool } from "../../scripts/hak/hakEnv.ts";
14+
import type { DependencyInfo } from "../../scripts/hak/dep.ts";
1515

1616
export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
1717
const tools: Tool[] = [

apps/desktop/hak/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"sourceMap": false,
77
"strict": true,
88
"lib": ["es2022"],
9-
"types": ["node"]
9+
"types": ["node"],
10+
"allowImportingTsExtensions": true
1011
},
1112
"include": ["../scripts/@types/*.d.ts", "./**/*.ts"]
1213
}

apps/desktop/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
"type": "module",
1919
"files": [],
2020
"engines": {
21-
"node": ">=18.0.0"
21+
"node": ">=22.18"
2222
},
2323
"scripts": {
2424
"i18n": "matrix-gen-i18n && pnpm i18n:sort && pnpm i18n:lint",
2525
"i18n:sort": "matrix-sort-i18n src/i18n/strings/en_EN.json",
2626
"i18n:lint": "prettier --log-level=silent --write src/i18n/strings/ --ignore-path /dev/null",
2727
"i18n:diff": "cp src/i18n/strings/en_EN.json src/i18n/strings/en_EN_orig.json && pnpm i18n && matrix-compare-i18n-files src/i18n/strings/en_EN_orig.json src/i18n/strings/en_EN.json",
2828
"mkdirs": "mkdirp packages deploys",
29-
"fetch": "pnpm run mkdirs && tsx scripts/fetch-package.ts",
29+
"fetch": "pnpm run mkdirs && node scripts/fetch-package.ts",
3030
"asar-webapp": "asar p webapp webapp.asar",
3131
"start": "pnpm run build:ts && pnpm run build:res && electron .",
3232
"lint": "pnpm lint:types && pnpm lint:js",
@@ -44,13 +44,13 @@
4444
"build:universal": "pnpm run build:ts && pnpm run build:res && electron-builder --universal",
4545
"build": "pnpm run build:ts && pnpm run build:res && electron-builder",
4646
"build:ts": "tsc",
47-
"build:res": "tsx scripts/copy-res.ts",
47+
"build:res": "node scripts/copy-res.ts",
4848
"docker:setup": "docker build --platform linux/amd64 -t element-desktop-dockerbuild -f dockerbuild/Dockerfile .",
4949
"docker:build:native": "scripts/in-docker.sh pnpm run hak",
5050
"docker:build": "scripts/in-docker.sh pnpm run build",
5151
"docker:install": "scripts/in-docker.sh pnpm install",
5252
"clean": "rimraf webapp.asar dist packages deploys lib",
53-
"hak": "tsx scripts/hak/index.ts",
53+
"hak": "node scripts/hak/index.ts",
5454
"test": "playwright test",
5555
"test:open": "pnpm test --ui",
5656
"test:screenshots:build": "docker build playwright -t element-desktop-playwright --platform linux/amd64",
@@ -102,7 +102,6 @@
102102
"prettier": "^3.0.0",
103103
"rimraf": "^6.0.0",
104104
"tar": "^7.5.8",
105-
"tsx": "^4.19.2",
106105
"typescript": "5.9.3"
107106
},
108107
"hakDependencies": {

apps/desktop/scripts/copy-res.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env -S npx tsx
1+
#!/usr/bin/env node
22

33
// copies resources into the lib directory.
44

apps/desktop/scripts/fetch-package.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env -S npx tsx --resolveJsonModule
1+
#!/usr/bin/env node
22

33
import * as path from "node:path";
44
import { createWriteStream, promises as fs } from "node:fs";
@@ -7,8 +7,8 @@ import * as tar from "tar";
77
import * as asar from "@electron/asar";
88
import { promises as stream } from "node:stream";
99

10-
import riotDesktopPackageJson from "../package.json";
11-
import { setPackageVersion } from "./set-version.js";
10+
import riotDesktopPackageJson from "../package.json" with { type: "json" };
11+
import { setPackageVersion } from "./set-version.ts";
1212

1313
const PUB_KEY_URL = "https://packages.riot.im/element-release-key.asc";
1414
const PACKAGE_URL_PREFIX = "https://github.com/element-hq/element-web/releases/download/";

apps/desktop/scripts/generate-nightly-version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env -S npx tsx
1+
#!/usr/bin/env node
22

33
/**
44
* Script to generate incremental Nightly build versions, based on the latest Nightly build version of that kind.

apps/desktop/scripts/get-version.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#!/usr/bin/env -S npx tsx
1+
#!/usr/bin/env node
22

33
/*
44
* Checks for the presence of a webapp, inspects its version and prints it
55
*/
66

77
import url from "node:url";
88

9-
import { versionFromAsar } from "./set-version.js";
9+
import { versionFromAsar } from "./set-version.ts";
1010

1111
async function main(): Promise<number> {
1212
const version = await versionFromAsar();

apps/desktop/scripts/hak/build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
66
Please see LICENSE files in the repository root for full details.
77
*/
88

9-
import type { DependencyInfo } from "./dep.js";
10-
import type HakEnv from "./hakEnv.js";
9+
import type { DependencyInfo } from "./dep.ts";
10+
import type HakEnv from "./hakEnv.ts";
1111

1212
export default async function build(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
1313
await moduleInfo.scripts.build(hakEnv, moduleInfo);

0 commit comments

Comments
 (0)