wukong-gitlog-cli 0.0.12 → 0.0.13

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.0.13](https://github.com/tomatobybike/wukong-gitlog-cli/compare/v0.0.12...v0.0.13) (2025-11-28)
6
+
7
+
8
+ ### Features
9
+
10
+ * 🎸 web dir ([aaadd05](https://github.com/tomatobybike/wukong-gitlog-cli/commit/aaadd051a8216d75ad6d8517b292caac90c7fb9b))
11
+
5
12
  ### [0.0.12](https://github.com/tomatobybike/wukong-gitlog-cli/compare/v0.0.11...v0.0.12) (2025-11-28)
6
13
 
7
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wukong-gitlog-cli",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "Advanced Git commit log exporter with Excel/JSON/TXT output, grouping, stats and CLI.",
5
5
  "keywords": [
6
6
  "git",
package/src/server.mjs CHANGED
@@ -2,6 +2,7 @@ import http from 'http';
2
2
  import fs from 'fs';
3
3
  import path from 'path';
4
4
  import chalk from 'chalk';
5
+ import { fileURLToPath } from 'url';
5
6
 
6
7
  const mime = new Map([
7
8
  ['.html', 'text/html; charset=utf-8'],
@@ -18,9 +19,10 @@ const mime = new Map([
18
19
 
19
20
  // eslint-disable-next-line default-param-last
20
21
  export function startServer(port = 3000, outputDir) {
21
- // TODO: remove debug log before production
22
- console.log('✅', 'outputDir', outputDir);
23
- const webRoot = path.resolve(process.cwd(), 'web');
22
+ // 解析包根目录,确保 web 资源在全局安装后也能找到
23
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
24
+ const pkgRoot = path.resolve(__dirname, '..');
25
+ const webRoot = path.resolve(pkgRoot, 'web');
24
26
  const dataRoot = outputDir ? path.resolve(outputDir) : path.resolve(process.cwd(), 'output');
25
27
 
26
28
  // warn if web directory or data directory doesn't exist