mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-23 04:51:49 +08:00
fix: deps link
This commit is contained in:
@@ -9,6 +9,7 @@ const scriptsSrcFolder = join(scriptsFolder, 'src');
|
|||||||
const projectRoot = join(scriptsFolder, '..', '..');
|
const projectRoot = join(scriptsFolder, '..', '..');
|
||||||
const serverRoot = join(projectRoot, 'packages', 'backend', 'server');
|
const serverRoot = join(projectRoot, 'packages', 'backend', 'server');
|
||||||
const tsRuntimeRegister = join(scriptsFolder, 'register.js');
|
const tsRuntimeRegister = join(scriptsFolder, 'register.js');
|
||||||
|
const tsxRuntimeRegister = join(scriptsFolder, 'tsx-register.js');
|
||||||
|
|
||||||
const [node, _self, file, ...options] = process.argv;
|
const [node, _self, file, ...options] = process.argv;
|
||||||
|
|
||||||
@@ -64,7 +65,7 @@ if (
|
|||||||
if (scriptLocation.startsWith(serverRoot)) {
|
if (scriptLocation.startsWith(serverRoot)) {
|
||||||
nodeOptions.unshift(`--import=${pathToFileURL(tsRuntimeRegister)}`);
|
nodeOptions.unshift(`--import=${pathToFileURL(tsRuntimeRegister)}`);
|
||||||
} else {
|
} else {
|
||||||
nodeOptions.unshift('--import=tsx');
|
nodeOptions.unshift(`--import=${pathToFileURL(tsxRuntimeRegister)}`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
nodeOptions.unshift('--experimental-specifier-resolution=node');
|
nodeOptions.unshift('--experimental-specifier-resolution=node');
|
||||||
|
|||||||
@@ -15,6 +15,10 @@ const serverRuntimeLoader = currentDir
|
|||||||
.join('../register.js')
|
.join('../register.js')
|
||||||
.toFileUrl()
|
.toFileUrl()
|
||||||
.toString();
|
.toString();
|
||||||
|
const tsxRuntimeLoader = currentDir
|
||||||
|
.join('../tsx-register.js')
|
||||||
|
.toFileUrl()
|
||||||
|
.toString();
|
||||||
|
|
||||||
const ignoreLoaderScripts = [
|
const ignoreLoaderScripts = [
|
||||||
'vitest',
|
'vitest',
|
||||||
@@ -165,9 +169,11 @@ export class RunCommand extends PackageCommand {
|
|||||||
args = extractedArgs;
|
args = extractedArgs;
|
||||||
|
|
||||||
const bin = args[0] === 'yarn' ? args[1] : args[0];
|
const bin = args[0] === 'yarn' ? args[1] : args[0];
|
||||||
const loader = pkg.name === '@affine/server' ? serverRuntimeLoader : 'tsx';
|
const loader =
|
||||||
|
pkg.name === '@affine/server' ? serverRuntimeLoader : tsxRuntimeLoader;
|
||||||
const hasKnownLoader =
|
const hasKnownLoader =
|
||||||
process.env.NODE_OPTIONS?.includes('tsx') ||
|
process.env.NODE_OPTIONS?.includes('tsx') ||
|
||||||
|
process.env.NODE_OPTIONS?.includes(tsxRuntimeLoader) ||
|
||||||
process.env.NODE_OPTIONS?.includes(serverRuntimeLoader);
|
process.env.NODE_OPTIONS?.includes(serverRuntimeLoader);
|
||||||
|
|
||||||
// very simple test for auto ts/mjs scripts
|
// very simple test for auto ts/mjs scripts
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
import 'tsx';
|
||||||
Reference in New Issue
Block a user