@guandata/guanmetric 0.1.19 → 0.1.20

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
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## @guandata/guanmetric 0.1.20 - 2026-10-12
4
+
5
+ - 改进本地开发提示:通过 `npm link` 使用源码目录且缺少本地构建时,提示执行 `npm run build`,避免误导用户重装发布版。
6
+
3
7
  ## @guandata/guanmetric 0.1.19 - 2026-09-24
4
8
 
5
9
  - 新增指标创建 Flow:从标准模板生成计划,按依赖顺序创建、回读并验证指标;创建结果不确定时可核对已有资源并恢复进度,避免重复创建。
package/README.md CHANGED
@@ -51,6 +51,10 @@ guanmetric metric-tree update-config <metric_tree_id> --file metric_tree_config.
51
51
 
52
52
  ## 版本更新
53
53
 
54
+ ### @guandata/guanmetric 0.1.20
55
+
56
+ - 从源码目录运行但尚未构建时,启动器会提示先执行 `npm run build`。
57
+
54
58
  ### @guandata/guanmetric 0.1.19
55
59
 
56
60
  - 新增指标创建 Flow:从标准模板生成可审阅计划,按依赖创建、回读和验证;创建结果不确定时可核对已有资源并恢复进度。
package/bin/run.js CHANGED
@@ -60,11 +60,24 @@ function resolvePlatformBinaries(options = {}) {
60
60
  // Local development fallback. The generated directory is excluded from
61
61
  // the published main package, so installed users always use the optional
62
62
  // platform dependency above.
63
- const localBinDir = path.join(__dirname, "..", "platforms", target.suffix, "bin");
63
+ const pkgRoot = path.join(__dirname, "..");
64
+ const localBinDir = path.join(pkgRoot, "platforms", target.suffix, "bin");
64
65
  const binaryPaths = {};
65
66
  for (const binary of target.binaries) {
66
67
  const binaryPath = path.join(localBinDir, binary);
67
68
  if (!exists(binaryPath)) {
69
+ // scripts/ is not published, so this is a source checkout (npm link).
70
+ // npm link never installs the optional platform package; reinstalling
71
+ // from the registry would not help, the local build is missing.
72
+ if (exists(path.join(pkgRoot, "scripts", "build.js"))) {
73
+ throw new Error(
74
+ `Missing local build for ${key}: ${binaryPath}\n` +
75
+ `This ${PACKAGE_PREFIX} is a source checkout (npm link), which runs the ` +
76
+ `binaries built into platforms/ instead of the optional platform package.\n` +
77
+ `Build them first:\n` +
78
+ ` cd "${pkgRoot}" && npm run build`
79
+ );
80
+ }
68
81
  throw new Error(
69
82
  `Missing optional platform package ${target.packageName} for ${key}.\n` +
70
83
  `Reinstall without disabling optional dependencies:\n` +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guandata/guanmetric",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "观远 BI 指标写操作工具 - 指标创建编辑删除、指标目录、公共维度、Excel 标准化",
5
5
  "bin": {
6
6
  "guanmetric": "bin/run.js"
@@ -41,11 +41,11 @@
41
41
  "node": ">=14"
42
42
  },
43
43
  "optionalDependencies": {
44
- "@guandata/guanmetric-darwin-arm64": "0.1.19",
45
- "@guandata/guanmetric-darwin-x64": "0.1.19",
46
- "@guandata/guanmetric-linux-x64": "0.1.19",
47
- "@guandata/guanmetric-linux-arm64": "0.1.19",
48
- "@guandata/guanmetric-win32-x64": "0.1.19"
44
+ "@guandata/guanmetric-darwin-arm64": "0.1.20",
45
+ "@guandata/guanmetric-darwin-x64": "0.1.20",
46
+ "@guandata/guanmetric-linux-x64": "0.1.20",
47
+ "@guandata/guanmetric-linux-arm64": "0.1.20",
48
+ "@guandata/guanmetric-win32-x64": "0.1.20"
49
49
  },
50
50
  "publishConfig": {
51
51
  "registry": "https://registry.npmjs.org/",