mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 20:46:38 +08:00
feat: bump typescript (#14507)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Upgraded TypeScript toolchain to v5.9.3 across packages and tooling. * Removed legacy ts-node and migrated developer tooling to newer runtimes (tsx/SWC) where applicable. * **Documentation** * Updated developer CLI docs and runtime behavior notes to reflect the new loader/runtime for running TypeScript files; no changes to public APIs or end-user behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -7,7 +7,8 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||
const scriptsFolder = join(fileURLToPath(import.meta.url), '..', '..');
|
||||
const scriptsSrcFolder = join(scriptsFolder, 'src');
|
||||
const projectRoot = join(scriptsFolder, '..', '..');
|
||||
const loader = join(scriptsFolder, 'register.js');
|
||||
const serverRoot = join(projectRoot, 'packages', 'backend', 'server');
|
||||
const tsRuntimeRegister = join(scriptsFolder, 'register.js');
|
||||
|
||||
const [node, _self, file, ...options] = process.argv;
|
||||
|
||||
@@ -60,7 +61,11 @@ if (
|
||||
scriptLocation.endsWith('.ts') ||
|
||||
scriptLocation.startsWith(scriptsFolder)
|
||||
) {
|
||||
nodeOptions.unshift(`--import=${pathToFileURL(loader)}`);
|
||||
if (scriptLocation.startsWith(serverRoot)) {
|
||||
nodeOptions.unshift(`--import=${pathToFileURL(tsRuntimeRegister)}`);
|
||||
} else {
|
||||
nodeOptions.unshift('--import=tsx');
|
||||
}
|
||||
} else {
|
||||
nodeOptions.unshift('--experimental-specifier-resolution=node');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user