create-windy 0.2.15 → 0.2.16

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
@@ -4013,7 +4013,8 @@ var recipes = [
4013
4013
  { id: "starter-0.2.11-to-0.2.12", from: "0.2.11", to: "0.2.12" },
4014
4014
  { id: "starter-0.2.12-to-0.2.13", from: "0.2.12", to: "0.2.13" },
4015
4015
  { id: "starter-0.2.13-to-0.2.14", from: "0.2.13", to: "0.2.14" },
4016
- { id: "starter-0.2.14-to-0.2.15", from: "0.2.14", to: "0.2.15" }
4016
+ { id: "starter-0.2.14-to-0.2.15", from: "0.2.14", to: "0.2.15" },
4017
+ { id: "starter-0.2.15-to-0.2.16", from: "0.2.15", to: "0.2.16" }
4017
4018
  ];
4018
4019
  function resolveRecipeChain(sourceVersion, targetVersion) {
4019
4020
  if (sourceVersion === targetVersion)
@@ -4106,6 +4107,7 @@ import { join as join14 } from "node:path";
4106
4107
 
4107
4108
  // src/update/known-repairs.ts
4108
4109
  var wrongTextVersions = new Set(["0.2.12", "0.2.13"]);
4110
+ var formattedBaselineVersions = new Set(["0.2.14", "0.2.15"]);
4109
4111
  var wrongExampleDescription = "创建时包含了 `work-order` 示例模块,用于演示 Module Manifest 接入;它不是生产工单产品,可以在正式开发前替换。";
4110
4112
  var correctCoreDescription = "创建时未选择 `work-order` 示例模块,当前项目只包含平台模块。";
4111
4113
  var wrongExampleRow = /^\|\s*示例工单\s*\|\s*已包含\s*\|$/m;
@@ -4117,10 +4119,9 @@ function repairKnownDerivedFile(input) {
4117
4119
  const targetRow = input.targetContent.match(correctCoreRow)?.[0];
4118
4120
  if (!targetRow)
4119
4121
  return;
4120
- if (input.sourceVersion === "0.2.14") {
4121
- const currentRow = input.content.match(correctCoreRow)?.[0];
4122
- if (input.content.includes(correctCoreDescription) && currentRow && currentRow !== targetRow) {
4123
- return input.content.replace(correctCoreRow, targetRow);
4122
+ if (formattedBaselineVersions.has(input.sourceVersion)) {
4123
+ if (input.content.includes(correctCoreDescription) && correctCoreRow.test(input.content) && input.content !== input.targetContent && normalizeMarkdownTables(input.content) === normalizeMarkdownTables(input.targetContent)) {
4124
+ return input.content;
4124
4125
  }
4125
4126
  return;
4126
4127
  }
@@ -4129,6 +4130,20 @@ function repairKnownDerivedFile(input) {
4129
4130
  }
4130
4131
  return input.content.replace(wrongExampleDescription, correctCoreDescription).replace(wrongExampleRow, targetRow);
4131
4132
  }
4133
+ function normalizeMarkdownTables(content) {
4134
+ return content.split(`
4135
+ `).map((line) => {
4136
+ const trimmed = line.trim();
4137
+ if (!trimmed.startsWith("|") || !trimmed.endsWith("|"))
4138
+ return line;
4139
+ return `| ${trimmed.slice(1, -1).split("|").map((cell) => normalizeTableCell(cell.trim())).join(" | ")} |`;
4140
+ }).join(`
4141
+ `);
4142
+ }
4143
+ function normalizeTableCell(cell) {
4144
+ const separator = cell.match(/^(:?)-{3,}(:?)$/);
4145
+ return separator ? `${separator[1]}---${separator[2]}` : cell;
4146
+ }
4132
4147
 
4133
4148
  // src/update/merge.ts
4134
4149
  import { mkdtemp as mkdtemp2, rm as rm6, writeFile as writeFile10 } from "node:fs/promises";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-windy",
3
- "version": "0.2.15",
3
+ "version": "0.2.16",
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": "04fdbd359b0f4159d1e3fe6c1a2ba148f2be73ce",
4
- "generatorVersion": "0.2.15",
3
+ "templateCommit": "a33bfe5d85129939050e231d5e5ab52a763041ac",
4
+ "generatorVersion": "0.2.16",
5
5
  "modules": [
6
6
  {
7
7
  "name": "system",