@viccydev/pi-fpa 0.6.2 → 0.6.3

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
@@ -127,12 +127,12 @@ pi list
127
127
  团队分发建议使用固定 Git tag:
128
128
 
129
129
  ```bash
130
- pi install git:github.com/linyqh/pi-fpa@v0.6.2
130
+ pi install git:github.com/linyqh/pi-fpa@v0.6.3
131
131
  ```
132
132
 
133
133
  ## 发布到 npm
134
134
 
135
- 发布动作由 GitHub Release 触发。Release 标签必须严格使用 `v<package.json version>`,例如版本 `0.6.2` 对应 `v0.6.2`。工作流会检出该标签,执行 `npm ci`、`npm test` 和包内容预检,全部通过后发布公开包 `@viccydev/pi-fpa`。普通 Release 发布到 `latest`,Prerelease 发布到 `next`。
135
+ 发布动作由 GitHub Release 触发。Release 标签必须严格使用 `v<package.json version>`,例如版本 `0.6.3` 对应 `v0.6.3`。工作流会检出该标签,执行 `npm ci`、`npm test` 和包内容预检,全部通过后发布公开包 `@viccydev/pi-fpa`。普通 Release 发布到 `latest`,Prerelease 发布到 `next`。
136
136
 
137
137
  发布认证使用 npm Trusted Publishing / OIDC,不使用长期 npm Token。npm 包后台的 Trusted Publisher 配置为:
138
138
 
@@ -35,6 +35,10 @@ function values(metric: ScenarioMetric | undefined, path: string) {
35
35
  return { downside: metric.downside, base: metric.base, upside: metric.upside };
36
36
  }
37
37
 
38
+ function canonicalTimezone(timezone: string): string {
39
+ return new Intl.DateTimeFormat("en-US", { timeZone: timezone }).resolvedOptions().timeZone;
40
+ }
41
+
38
42
  export function projectForwardOutlook(input: {
39
43
  current_forecast: unknown;
40
44
  forward_forecasts: ForwardForecastInput[];
@@ -47,7 +51,7 @@ export function projectForwardOutlook(input: {
47
51
  const forecast = approvedForecast(item.forecast, `forward_forecasts[${index}].forecast`);
48
52
  if (item.ref.artifact_type !== "approved_cycle_forecast" || item.ref.body_fingerprint === "" || item.ref.cycle_id === "") throw new Error(`forward_forecasts[${index}].ref is invalid.`);
49
53
  if (forecast.reporting_currency !== current.reporting_currency) throw new Error(`forward_forecasts[${index}] reporting currency does not match the current forecast.`);
50
- if (forecast.target_period.timezone !== current.target_period.timezone || Date.parse(forecast.target_period.start_inclusive) !== Date.parse(expectedStart)) {
54
+ if (canonicalTimezone(forecast.target_period.timezone) !== canonicalTimezone(current.target_period.timezone) || Date.parse(forecast.target_period.start_inclusive) !== Date.parse(expectedStart)) {
51
55
  throw new Error(`forward_forecasts[${index}] must be the exact consecutive successor in the same timezone.`);
52
56
  }
53
57
  expectedStart = forecast.target_period.end_exclusive;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viccydev/pi-fpa",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "type": "module",
5
5
  "description": "Full-cycle FP&A planning, strategy, forecast, and review prompts, skills, and data tools for Pi",
6
6
  "license": "UNLICENSED",