Remove tsx dependency (#32967)
* Remove tsx dependency * Iterate * Iterate * Iterate
This commit is contained in:
committed by
GitHub
parent
dda9ec061b
commit
0d1d889c28
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env -S npx tsx
|
||||
#!/usr/bin/env node
|
||||
|
||||
// copies resources into the lib directory.
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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,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
|
||||
|
||||
@@ -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"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user