openlearn-next 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,14 +11,23 @@
11
11
 
12
12
  ## 快速开始
13
13
 
14
- ### 通过 npx 一键启动
14
+ ### 通过 npm 安装运行
15
15
 
16
+ ```bash
17
+ # 全局安装
18
+ npm install -g openlearn-next
19
+
20
+ # 启动
21
+ openlearn-next
22
+
23
+ # 更新到最新版
24
+ npm update -g openlearn-next
25
+ ```
26
+
27
+ #### 或通过 npx 一键启动
16
28
  ```bash
17
29
  # 首次会自动下载安装,无需 clone 项目
18
- export GEMINI_API_KEY=你的密钥
19
- npx openlearn-next
20
30
 
21
- # 可选参数
22
31
  npx openlearn-next -p 3000 # 自定义端口(默认 9000)
23
32
  OPENLEARN_DB_PATH=./my.db npx openlearn-next # 自定义数据库路径(默认 ~/openlearn-next/data.db)
24
33
  ```
@@ -151,7 +160,9 @@ ext-exam.zip
151
160
 
152
161
  | 命令 | 说明 |
153
162
  |------|------|
154
- | `npx openlearn-next` | 一键启动生产服务 |
163
+ | `npm install -g openlearn-next` | 全局安装 |
164
+ | `npx openlearn-next` | 一键运行(免安装) |
165
+ | `npm update -g openlearn-next` | 更新到最新版 |
155
166
  | `npm run dev` | 启动开发服务 |
156
167
  | `npm run build` | 生产构建(Vite + esbuild) |
157
168
  | `npm start` | 运行生产构建 |
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/server.cjs CHANGED
@@ -14209,7 +14209,7 @@ ${examsText}
14209
14209
  });
14210
14210
  app.use(vite.middlewares);
14211
14211
  } else {
14212
- const distPath = import_path7.default.join(process.cwd(), "dist");
14212
+ const distPath = __dirname || import_path7.default.join(process.cwd(), "dist");
14213
14213
  app.use(import_express.default.static(distPath));
14214
14214
  app.get("*", (req, res) => {
14215
14215
  res.sendFile(import_path7.default.join(distPath, "index.html"));
@@ -14251,7 +14251,16 @@ ${examsText}
14251
14251
  });
14252
14252
  });
14253
14253
  httpServer.listen(PORT, "0.0.0.0", () => {
14254
- console.log(`Educational OS Kernel running on port ${PORT}`);
14254
+ const url = `http://localhost:${PORT}`;
14255
+ const OSC = "\x1B]8;;";
14256
+ const ST = "\x1B\\";
14257
+ const reset = "\x1B[0m";
14258
+ const bold = "\x1B[1m";
14259
+ const green = "\x1B[32m";
14260
+ const cyan = "\x1B[36m";
14261
+ console.log(`
14262
+ ${bold}${green}Educational OS Kernel${reset} ready at ${bold}${cyan}${OSC}${url}${ST}http://localhost:${PORT}${OSC}${ST}${reset}
14263
+ `);
14255
14264
  });
14256
14265
  }
14257
14266
  if (process.argv[1]?.endsWith("server.cjs") || process.argv[1]?.endsWith("server.ts")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openlearn-next",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "private": false,
5
5
  "description": "A plugin-driven Educational OS / LMS platform with AI agent teaching assistant",
6
6
  "keywords": [