mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
feat: build with TypeScript 7 and run sources with plain node
Replace the tsgo native preview with typescript@7.0.2 and port the check scripts to the TS 7 API. Target ES2024, drop useDefineForClassFields: false and unused decorator options, and enable verbatimModuleSyntax. Replace tsx with node plus the source resolver hook, passed to --import as a file URL. closes #9965
This commit is contained in:
parent
49681e1b71
commit
ca7460d16b
46 changed files with 543 additions and 240 deletions
|
|
@ -11,6 +11,7 @@ import {
|
|||
} from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join, resolve } from "node:path";
|
||||
import { pathToFileURL } from "node:url";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import type { Args } from "../src/cli/args.ts";
|
||||
import { ENV_AGENT_DIR } from "../src/config.ts";
|
||||
|
|
@ -19,7 +20,8 @@ import { SettingsManager } from "../src/core/settings-manager.ts";
|
|||
import { createSessionManager } from "../src/main.ts";
|
||||
|
||||
const cliPath = resolve(__dirname, "../src/cli.ts");
|
||||
const sourceResolverPath = resolve(__dirname, "../src/experimental/source-resolver.ts");
|
||||
// --import takes a module specifier, not a filesystem path.
|
||||
const sourceResolverUrl = pathToFileURL(resolve(__dirname, "../src/experimental/source-resolver.ts")).href;
|
||||
const tempDirs: string[] = [];
|
||||
|
||||
afterEach(() => {
|
||||
|
|
@ -64,7 +66,7 @@ async function runCli(args: string[]): Promise<{ code: number | null; agentDir:
|
|||
mkdirSync(projectDir, { recursive: true });
|
||||
|
||||
const code = await new Promise<number | null>((resolvePromise, reject) => {
|
||||
const child = spawn(process.execPath, ["--import", sourceResolverPath, cliPath, ...args], {
|
||||
const child = spawn(process.execPath, ["--import", sourceResolverUrl, cliPath, ...args], {
|
||||
cwd: projectDir,
|
||||
env: {
|
||||
...process.env,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue