mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 18:16:15 +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:
+10
-4
@@ -11,11 +11,15 @@ interface RunScriptOptions {
|
||||
}
|
||||
|
||||
const currentDir = Path.dir(import.meta.url);
|
||||
const serverRuntimeLoader = currentDir
|
||||
.join('../register.js')
|
||||
.toFileUrl()
|
||||
.toString();
|
||||
|
||||
const ignoreLoaderScripts = [
|
||||
'vitest',
|
||||
'vite',
|
||||
'ts-node',
|
||||
'tsx',
|
||||
'prisma',
|
||||
'cap',
|
||||
'tsc',
|
||||
@@ -161,13 +165,15 @@ export class RunCommand extends PackageCommand {
|
||||
args = extractedArgs;
|
||||
|
||||
const bin = args[0] === 'yarn' ? args[1] : args[0];
|
||||
|
||||
const loader = currentDir.join('../register.js').toFileUrl().toString();
|
||||
const loader = pkg.name === '@affine/server' ? serverRuntimeLoader : 'tsx';
|
||||
const hasKnownLoader =
|
||||
process.env.NODE_OPTIONS?.includes('tsx') ||
|
||||
process.env.NODE_OPTIONS?.includes(serverRuntimeLoader);
|
||||
|
||||
// very simple test for auto ts/mjs scripts
|
||||
const isLoaderRequired =
|
||||
!ignoreLoaderScripts.some(ignore => new RegExp(ignore).test(bin)) ||
|
||||
process.env.NODE_OPTIONS?.includes('ts-node/esm') ||
|
||||
hasKnownLoader ||
|
||||
process.env.NODE_OPTIONS?.includes(loader);
|
||||
|
||||
let NODE_OPTIONS = process.env.NODE_OPTIONS
|
||||
|
||||
Reference in New Issue
Block a user