Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(cli): run dev-web crash

Alex Yangfd0c1da608c6
diff --git a/packages/cli/package.json b/packages/cli/package.json
index 581afb6061..df3b3eb414 100644
--- a/packages/cli/package.json
+++ b/packages/cli/package.json
@@ -3,7 +3,7 @@
"type": "module",
"private": true,
"bin": {
- "dev-web": "./src/dev.mts"
+ "dev-web": "./src/dev.mjs"
},
"scripts": {
"start": "ts-node-esm ./src/dev.mjs"
diff --git a/packages/cli/src/dev.mjs b/packages/cli/src/dev.mjs
new file mode 100755
index 0000000000..d9042c1711
--- /dev/null
+++ b/packages/cli/src/dev.mjs
@@ -0,0 +1,16 @@
+#!/usr/bin/env node
+import { spawnSync } from 'node:child_process';
+import { fileURLToPath } from 'node:url';
+
+const child = spawnSync(
+ process.execPath,
+ [
+ '--loader',
+ 'ts-node/esm/transpile-only',
+ fileURLToPath(new URL('./dev.ts', import.meta.url)),
+ ...process.argv.slice(2),
+ ],
+ { stdio: 'inherit' }
+);
+
+if (child.status) process.exit(child.status);
diff --git a/packages/cli/src/dev.mts b/packages/cli/src/dev.ts
similarity index 100%
rename from packages/cli/src/dev.mts
rename to packages/cli/src/dev.ts
diff --git a/yarn.lock b/yarn.lock
index 2f36c2589b..c1b6f02ab1 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -77,7 +77,7 @@ __metadata:
peerDependencies:
ts-node: "*"
bin:
- dev-web: ./src/dev.mts
+ dev-web: ./src/dev.mjs
languageName: unknown
linkType: soft