Remove tsx dependency (#32967)

* Remove tsx dependency

* Iterate

* Iterate

* Iterate
This commit is contained in:
Michael Telatynski
2026-03-30 17:17:36 +02:00
committed by GitHub
parent dda9ec061b
commit 0d1d889c28
21 changed files with 48 additions and 48 deletions
+2
View File
@@ -46,6 +46,7 @@ module.exports = {
// Things we do that break the ideal style
"prefer-promise-reject-errors": "off",
"quotes": "off",
"n/file-extension-in-import": "off",
"@typescript-eslint/no-explicit-any": "off",
// We're okay with assertion errors when we ask for them
@@ -62,6 +63,7 @@ module.exports = {
// Things we do that break the ideal style
"prefer-promise-reject-errors": "off",
"quotes": "off",
"n/file-extension-in-import": "off",
"@typescript-eslint/no-explicit-any": "off",
// We're okay with assertion errors when we ask for them
+2 -2
View File
@@ -6,8 +6,8 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import type HakEnv from "../../scripts/hak/hakEnv.js";
import type { DependencyInfo } from "../../scripts/hak/dep.js";
import type HakEnv from "../../scripts/hak/hakEnv.ts";
import type { DependencyInfo } from "../../scripts/hak/dep.ts";
export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
const env = hakEnv.makeGypEnv();
+3 -3
View File
@@ -9,9 +9,9 @@ Please see LICENSE files in the repository root for full details.
import childProcess from "node:child_process";
import fsProm from "node:fs/promises";
import type HakEnv from "../../scripts/hak/hakEnv.js";
import type { Tool } from "../../scripts/hak/hakEnv.js";
import type { DependencyInfo } from "../../scripts/hak/dep.js";
import type HakEnv from "../../scripts/hak/hakEnv.ts";
import type { Tool } from "../../scripts/hak/hakEnv.ts";
import type { DependencyInfo } from "../../scripts/hak/dep.ts";
export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
const tools: Tool[] = [
+2 -1
View File
@@ -6,7 +6,8 @@
"sourceMap": false,
"strict": true,
"lib": ["es2022"],
"types": ["node"]
"types": ["node"],
"allowImportingTsExtensions": true
},
"include": ["../scripts/@types/*.d.ts", "./**/*.ts"]
}
+4 -5
View File
@@ -18,7 +18,7 @@
"type": "module",
"files": [],
"engines": {
"node": ">=18.0.0"
"node": ">=22.18"
},
"scripts": {
"i18n": "matrix-gen-i18n && pnpm i18n:sort && pnpm i18n:lint",
@@ -26,7 +26,7 @@
"i18n:lint": "prettier --log-level=silent --write src/i18n/strings/ --ignore-path /dev/null",
"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",
"mkdirs": "mkdirp packages deploys",
"fetch": "pnpm run mkdirs && tsx scripts/fetch-package.ts",
"fetch": "pnpm run mkdirs && node scripts/fetch-package.ts",
"asar-webapp": "asar p webapp webapp.asar",
"start": "pnpm run build:ts && pnpm run build:res && electron .",
"lint": "pnpm lint:types && pnpm lint:js",
@@ -44,13 +44,13 @@
"build:universal": "pnpm run build:ts && pnpm run build:res && electron-builder --universal",
"build": "pnpm run build:ts && pnpm run build:res && electron-builder",
"build:ts": "tsc",
"build:res": "tsx scripts/copy-res.ts",
"build:res": "node scripts/copy-res.ts",
"docker:setup": "docker build --platform linux/amd64 -t element-desktop-dockerbuild -f dockerbuild/Dockerfile .",
"docker:build:native": "scripts/in-docker.sh pnpm run hak",
"docker:build": "scripts/in-docker.sh pnpm run build",
"docker:install": "scripts/in-docker.sh pnpm install",
"clean": "rimraf webapp.asar dist packages deploys lib",
"hak": "tsx scripts/hak/index.ts",
"hak": "node scripts/hak/index.ts",
"test": "playwright test",
"test:open": "pnpm test --ui",
"test:screenshots:build": "docker build playwright -t element-desktop-playwright --platform linux/amd64",
@@ -102,7 +102,6 @@
"prettier": "^3.0.0",
"rimraf": "^6.0.0",
"tar": "^7.5.8",
"tsx": "^4.19.2",
"typescript": "5.9.3"
},
"hakDependencies": {
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env -S npx tsx
#!/usr/bin/env node
// copies resources into the lib directory.
+3 -3
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env -S npx tsx --resolveJsonModule
#!/usr/bin/env node
import * as path from "node:path";
import { createWriteStream, promises as fs } from "node:fs";
@@ -7,8 +7,8 @@ import * as tar from "tar";
import * as asar from "@electron/asar";
import { promises as stream } from "node:stream";
import riotDesktopPackageJson from "../package.json";
import { setPackageVersion } from "./set-version.js";
import riotDesktopPackageJson from "../package.json" with { type: "json" };
import { setPackageVersion } from "./set-version.ts";
const PUB_KEY_URL = "https://packages.riot.im/element-release-key.asc";
const PACKAGE_URL_PREFIX = "https://github.com/element-hq/element-web/releases/download/";
@@ -1,4 +1,4 @@
#!/usr/bin/env -S npx tsx
#!/usr/bin/env node
/**
* Script to generate incremental Nightly build versions, based on the latest Nightly build version of that kind.
+2 -2
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env -S npx tsx
#!/usr/bin/env node
/*
* Checks for the presence of a webapp, inspects its version and prints it
@@ -6,7 +6,7 @@
import url from "node:url";
import { versionFromAsar } from "./set-version.js";
import { versionFromAsar } from "./set-version.ts";
async function main(): Promise<number> {
const version = await versionFromAsar();
+2 -2
View File
@@ -6,8 +6,8 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import type { DependencyInfo } from "./dep.js";
import type HakEnv from "./hakEnv.js";
import type { DependencyInfo } from "./dep.ts";
import type HakEnv from "./hakEnv.ts";
export default async function build(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
await moduleInfo.scripts.build(hakEnv, moduleInfo);
+2 -2
View File
@@ -6,8 +6,8 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import type { DependencyInfo } from "./dep.js";
import type HakEnv from "./hakEnv.js";
import type { DependencyInfo } from "./dep.ts";
import type HakEnv from "./hakEnv.ts";
export default async function check(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
await moduleInfo.scripts.check?.(hakEnv, moduleInfo);
+2 -2
View File
@@ -9,8 +9,8 @@ Please see LICENSE files in the repository root for full details.
import path from "node:path";
import { rimraf } from "rimraf";
import type { DependencyInfo } from "./dep.js";
import type HakEnv from "./hakEnv.js";
import type { DependencyInfo } from "./dep.ts";
import type HakEnv from "./hakEnv.ts";
export default async function clean(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
await rimraf(moduleInfo.moduleDotHakDir);
+2 -2
View File
@@ -12,8 +12,8 @@ import childProcess from "node:child_process";
import { glob } from "glob";
import { mkdirp } from "mkdirp";
import type HakEnv from "./hakEnv.js";
import type { DependencyInfo } from "./dep.js";
import type HakEnv from "./hakEnv.ts";
import type { DependencyInfo } from "./dep.ts";
export default async function copy(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
if (moduleInfo.cfg.copy) {
+1 -1
View File
@@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import type HakEnv from "./hakEnv.js";
import type HakEnv from "./hakEnv.ts";
export interface DependencyInfo {
name: string;
+2 -2
View File
@@ -10,8 +10,8 @@ import fsProm from "node:fs/promises";
import pacote from "pacote";
import path from "node:path";
import type HakEnv from "./hakEnv.js";
import type { DependencyInfo } from "./dep.js";
import type HakEnv from "./hakEnv.ts";
import type { DependencyInfo } from "./dep.ts";
export default async function fetch(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
let haveModuleBuildDir;
+4 -5
View File
@@ -11,7 +11,7 @@ import os from "node:os";
import { getElectronVersionFromInstalled } from "app-builder-lib/out/electron/electronVersion.js";
import childProcess, { type SpawnOptions } from "node:child_process";
import { type Arch, type Target, TARGETS, getHost, isHostId, type TargetId } from "./target.js";
import { type Arch, type Target, TARGETS, getHost, isHostId, type TargetId } from "./target.ts";
async function getRuntimeVersion(projectRoot: string): Promise<string> {
const electronVersion = await getElectronVersionFromInstalled(path.join(projectRoot, "..", ".."));
@@ -28,11 +28,10 @@ export default class HakEnv {
public runtime: string = "electron";
public runtimeVersion?: string;
public dotHakDir: string;
public readonly projectRoot: string;
public constructor(
public readonly projectRoot: string,
targetId: TargetId | null,
) {
public constructor(projectRoot: string, targetId: TargetId | null) {
this.projectRoot = projectRoot;
const target = targetId ? TARGETS[targetId] : getHost();
if (!target) {
+6 -6
View File
@@ -9,11 +9,11 @@ Please see LICENSE files in the repository root for full details.
import path, { dirname } from "node:path";
import { fileURLToPath } from "node:url";
import HakEnv from "./hakEnv.js";
import type { TargetId } from "./target.js";
import type { DependencyInfo } from "./dep.js";
import { loadJsonFile } from "../../src/utils.js";
import packageJson from "../../package.json";
import HakEnv from "./hakEnv.ts";
import type { TargetId } from "./target.ts";
import type { DependencyInfo } from "./dep.ts";
import { loadJsonFile } from "../../src/utils.ts";
import packageJson from "../../package.json" with { type: "json" };
// These can only be run on specific modules
const MODULECOMMANDS = ["check", "fetch", "link", "build", "copy", "clean"];
@@ -127,7 +127,7 @@ async function main(): Promise<void> {
process.exit(1);
}
const cmdFunc = (await import("./" + cmd)).default;
const cmdFunc = (await import(`./${cmd}.ts`)).default;
for (const mod of modules) {
const depInfo = deps[mod];
+2 -2
View File
@@ -6,8 +6,8 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import type HakEnv from "./hakEnv.js";
import { type DependencyInfo } from "./dep.js";
import type HakEnv from "./hakEnv.ts";
import { type DependencyInfo } from "./dep.ts";
export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
await hakEnv.spawn("pnpm", ["link", moduleInfo.moduleOutDir], {
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env -S npx tsx
#!/usr/bin/env node
/*
* Checks for the presence of a webapp, inspects its version and sets the
+3 -2
View File
@@ -5,11 +5,12 @@
"skipLibCheck": true,
"esModuleInterop": true,
"target": "es2022",
"module": "node16",
"module": "node20",
"sourceMap": false,
"strict": true,
"lib": ["es2022"],
"types": ["node"]
"types": ["node"],
"allowImportingTsExtensions": true
},
"include": ["../src/@types", "./**/*.ts"]
}
+1 -3
View File
@@ -314,9 +314,6 @@ importers:
tar:
specifier: ^7.5.8
version: 7.5.13
tsx:
specifier: ^4.19.2
version: 4.21.0
typescript:
specifier: 5.9.3
version: 5.9.3
@@ -26560,6 +26557,7 @@ snapshots:
get-tsconfig: 4.13.6
optionalDependencies:
fsevents: 2.3.3
optional: true
tsyringe@4.10.0:
dependencies: