create-windy 0.2.24 → 0.2.25

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/dist/cli.js CHANGED
@@ -4308,7 +4308,8 @@ var recipes = [
4308
4308
  { id: "starter-0.2.20-to-0.2.21", from: "0.2.20", to: "0.2.21" },
4309
4309
  { id: "starter-0.2.21-to-0.2.22", from: "0.2.21", to: "0.2.22" },
4310
4310
  { id: "starter-0.2.22-to-0.2.23", from: "0.2.22", to: "0.2.23" },
4311
- { id: "starter-0.2.23-to-0.2.24", from: "0.2.23", to: "0.2.24" }
4311
+ { id: "starter-0.2.23-to-0.2.24", from: "0.2.23", to: "0.2.24" },
4312
+ { id: "starter-0.2.24-to-0.2.25", from: "0.2.24", to: "0.2.25" }
4312
4313
  ];
4313
4314
  function resolveRecipeChain(sourceVersion, targetVersion) {
4314
4315
  if (sourceVersion === targetVersion)
@@ -4400,13 +4401,39 @@ import { access as access3, readFile as readFile15 } from "node:fs/promises";
4400
4401
  import { join as join16 } from "node:path";
4401
4402
 
4402
4403
  // src/update/known-repairs.ts
4404
+ import { createHash as createHash2 } from "node:crypto";
4403
4405
  var wrongTextVersions = new Set(["0.2.12", "0.2.13"]);
4404
4406
  var formattedBaselineVersions = new Set(["0.2.14", "0.2.15"]);
4407
+ var known023DownstreamHashes = new Map([
4408
+ [
4409
+ "apps/server/src/http-app.ts",
4410
+ "9fca4e4ef68d942993f8176f2d6c508607d7c54c71d80982c966132b3a2572ce"
4411
+ ],
4412
+ [
4413
+ "apps/server/src/observability/http-observability.test.ts",
4414
+ "55598b65792606fe80bb5355b2004440ee05aa64f5eedc2662680219d3678fe2"
4415
+ ],
4416
+ [
4417
+ "apps/server/src/observability/http-observability.ts",
4418
+ "90a2ee14a2b905c705deb086d8fbeeded5c1e9d345e7f83141c33fcd73f794f3"
4419
+ ],
4420
+ [
4421
+ "docs/operations/observability.md",
4422
+ "f7618d173f9f985b15bf71f0c1c00338dad53395ba6c249c3ce3f9443e5e756f"
4423
+ ],
4424
+ [
4425
+ "packages/modules/src/system-modules.ts",
4426
+ "81fb08f26e5baa3238606d62b9c46761a68c90f3967ea639b178c80c74c69fc1"
4427
+ ]
4428
+ ]);
4405
4429
  var wrongExampleDescription = "创建时包含了 `work-order` 示例模块,用于演示 Module Manifest 接入;它不是生产工单产品,可以在正式开发前替换。";
4406
4430
  var correctCoreDescription = "创建时未选择 `work-order` 示例模块,当前项目只包含平台模块。";
4407
4431
  var wrongExampleRow = /^\|\s*示例工单\s*\|\s*已包含\s*\|$/m;
4408
4432
  var correctCoreRow = /^\|\s*示例工单\s*\|\s*未包含\s*\|$/m;
4409
4433
  function repairKnownDerivedFile(input) {
4434
+ const downstreamRepair = repairKnown023Downstream(input);
4435
+ if (downstreamRepair !== undefined)
4436
+ return downstreamRepair;
4410
4437
  if (input.path !== "README.md" || input.includeExample || !input.targetContent.includes(correctCoreDescription) || !correctCoreRow.test(input.targetContent)) {
4411
4438
  return;
4412
4439
  }
@@ -4424,6 +4451,57 @@ function repairKnownDerivedFile(input) {
4424
4451
  }
4425
4452
  return input.content.replace(wrongExampleDescription, correctCoreDescription).replace(wrongExampleRow, targetRow);
4426
4453
  }
4454
+ function repairKnown023Downstream(input) {
4455
+ if (input.sourceVersion !== "0.2.23" || known023DownstreamHashes.get(input.path) !== contentHash(input.content)) {
4456
+ return;
4457
+ }
4458
+ if (input.path === "apps/server/src/http-app.ts" || input.path === "packages/modules/src/system-modules.ts") {
4459
+ return input.targetContent;
4460
+ }
4461
+ if (input.path === "apps/server/src/observability/http-observability.ts") {
4462
+ return replaceKnown(input.content, ` if (!isImportantRequest(input.request.method, statusCode, durationMs)) {`, ` if (durationMs === undefined) return;
4463
+ if (!isImportantRequest(input.request.method, statusCode, durationMs)) {`);
4464
+ }
4465
+ if (input.path === "apps/server/src/observability/http-observability.test.ts") {
4466
+ const targetTest = extractTest(input.targetContent, "同一次 observation 重复完成时不重复记录日志");
4467
+ return targetTest ? replaceKnown(input.content, `
4468
+ });
4469
+ `, `
4470
+ ${targetTest}
4471
+ });
4472
+ `) : undefined;
4473
+ }
4474
+ if (input.path === "docs/operations/observability.md") {
4475
+ const lifecycle = extractSectionLead(input.targetContent, "请求观测在全局 `onRequest` 建立", "## Server 指标");
4476
+ const verification = extractSectionLead(input.targetContent, "已验证:共享关联标识校验", "尚未由本页证明");
4477
+ const withLifecycle = lifecycle ? replaceKnown(input.content, `
4478
+ ## Server 指标`, `
4479
+ ${lifecycle}
4480
+ ## Server 指标`) : undefined;
4481
+ return withLifecycle && verification ? replaceKnown(withLifecycle, /^已验证:共享关联标识校验.*Dockerfile 已声明 readiness `HEALTHCHECK`。$/m, verification.trim()) : undefined;
4482
+ }
4483
+ }
4484
+ function contentHash(content) {
4485
+ return createHash2("sha256").update(content).digest("hex");
4486
+ }
4487
+ function replaceKnown(content, search, replacement) {
4488
+ const replaced = content.replace(search, replacement);
4489
+ return replaced === content ? undefined : replaced;
4490
+ }
4491
+ function extractTest(content, title) {
4492
+ const marker = ` test("${title}"`;
4493
+ const start = content.indexOf(marker);
4494
+ if (start < 0)
4495
+ return;
4496
+ const end = content.indexOf(`
4497
+ });`, start);
4498
+ return end < 0 ? undefined : content.slice(start, end + 6);
4499
+ }
4500
+ function extractSectionLead(content, startText, endText) {
4501
+ const start = content.indexOf(startText);
4502
+ const end = content.indexOf(endText, start);
4503
+ return start < 0 || end < 0 ? undefined : content.slice(start, end);
4504
+ }
4427
4505
  function normalizeMarkdownTables(content) {
4428
4506
  return content.split(`
4429
4507
  `).map((line) => {
@@ -4980,7 +5058,7 @@ async function planFile(path2, project, baseRoot, targetRoot, source, target, pr
4980
5058
  targetContent: new TextDecoder().decode(theirs)
4981
5059
  }) : undefined;
4982
5060
  if (repaired !== undefined) {
4983
- return ready(path2, ownership, "update", "修复已发布版本的模块选择派生文本", new TextEncoder().encode(repaired));
5061
+ return ready(path2, ownership, "update", "修复已发布版本的确定性派生差异", new TextEncoder().encode(repaired));
4984
5062
  }
4985
5063
  if (path2.startsWith("packages/database/drizzle/") && path2.endsWith(".sql")) {
4986
5064
  if (source && !target)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-windy",
3
- "version": "0.2.24",
3
+ "version": "0.2.25",
4
4
  "description": "创建单组织、单租户、私有部署优先的 Windy 企业 Dashboard Starter",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "templateCommit": "2dcb96dc1bf7f19b9d04573dea8d4af594e06100",
4
- "generatorVersion": "0.2.24",
3
+ "templateCommit": "02fc178560c17d0e17022dd785ff1f11e5350179",
4
+ "generatorVersion": "0.2.25",
5
5
  "modules": [
6
6
  {
7
7
  "name": "system",
@@ -126,13 +126,13 @@ SSE 事件包括 `output.delta`、`tool.requested`、`tool.completed`、usage,
126
126
  `run.completed`、`run.failed` 或 `run.cancelled` 终态。断线后使用已确认 sequence 作为
127
127
  cursor 恢复;不要重新创建 Run 或重复执行 Tool。
128
128
 
129
- ## 从 create-windy 0.2.23 或更早版本升级
129
+ ## 从 create-windy 0.2.24 或更早版本升级
130
130
 
131
131
  先检查计划,再应用连续 recipe:
132
132
 
133
133
  ```bash
134
- bunx --bun create-windy@0.2.24 update --check
135
- bunx --bun create-windy@0.2.24 update
134
+ bunx --bun create-windy@0.2.25 update --check
135
+ bunx --bun create-windy@0.2.25 update
136
136
  bun install
137
137
  ```
138
138