Răsfoiți Sursa

fix(runtime): build error (#529)

Louis Young 6 luni în urmă
părinte
comite
6904cd0241

+ 21 - 1
apps/docs/src/en/guide/runtime/quick-start.mdx

@@ -79,7 +79,7 @@ If everything is working correctly, you should see the following output in the c
 
 ```
 > Listen Port: 4000
-> Server Address: http://[::1]:4000
+> Server Address: http://localhost:4000
 > API Docs: http://localhost:4000/docs
 ```
 
@@ -106,3 +106,23 @@ You should see the following output in the command line where the service is run
 > LOG Task finished:  xxxx-xxxx-xxxx-xxxx
 { test_output: 'Hello FlowGram!' }
 ```
+
+## Compiling the Service
+
+1. **Enter the Runtime Directory**
+
+```bash
+cd packages/runtime/nodejs
+```
+
+2. **Compile the Service**
+
+```bash
+npm run build
+```
+
+2. **Start the nodejs Server**
+
+```bash
+node dist/index.js
+```

+ 21 - 1
apps/docs/src/zh/guide/runtime/quick-start.mdx

@@ -79,7 +79,7 @@ npm run dev
 
 ```
 > Listen Port: 4000
-> Server Address: http://[::1]:4000
+> Server Address: http://localhost:4000
 > API Docs: http://localhost:4000/docs
 ```
 
@@ -122,3 +122,23 @@ createRuntimePlugin({
   },
 })
 ```
+
+## 编译服务
+
+1. **进入运行时目录**
+
+```bash
+cd packages/runtime/nodejs
+```
+
+2. **编译服务**
+
+```bash
+npm run build
+```
+
+2. **启动 nodejs 服务器**
+
+```bash
+node dist/index.js
+```

+ 1 - 0
packages/runtime/interface/package.json

@@ -4,6 +4,7 @@
   "homepage": "https://flowgram.ai/",
   "repository": "https://github.com/bytedance/flowgram.ai",
   "license": "MIT",
+  "type": "module",
   "exports": {
     "types": "./dist/index.d.ts",
     "import": "./dist/esm/index.js",

+ 1 - 0
packages/runtime/js-core/package.json

@@ -4,6 +4,7 @@
   "homepage": "https://flowgram.ai/",
   "repository": "https://github.com/bytedance/flowgram.ai",
   "license": "MIT",
+  "type": "module",
   "exports": {
     "types": "./dist/index.d.ts",
     "import": "./dist/esm/index.js",

+ 1 - 1
packages/runtime/nodejs/README.md

@@ -12,5 +12,5 @@ pnpm build
 
 ## Running the server
 ```bash
-pnpm start
+node dist/index.js
 ```

+ 14 - 4
packages/runtime/nodejs/package.json

@@ -1,13 +1,23 @@
 {
   "name": "@flowgram.ai/runtime-nodejs",
-  "version": "0.1.0",
-  "description": "",
-  "keywords": [],
+  "version": "0.1.8",
+  "homepage": "https://flowgram.ai/",
+  "repository": "https://github.com/bytedance/flowgram.ai",
   "license": "MIT",
+  "type": "module",
+  "exports": {
+    "types": "./dist/index.d.ts",
+    "import": "./dist/index.js"
+  },
+  "module": "./dist/index.js",
+  "types": "./dist/index.d.ts",
+  "files": [
+    "dist"
+  ],
   "scripts": {
     "dev": "tsx watch src",
     "build": "npm run build:fast -- --dts-resolve",
-    "build:fast": "tsup src/index.ts --format cjs,esm --sourcemap --legacy-output",
+    "build:fast": "tsup src/index.ts --format esm --sourcemap --out-dir dist",
     "build:watch": "npm run build:fast -- --dts-resolve",
     "lint": "eslint --cache src",
     "lint-fix": "eslint --fix src",