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 +20 -5
- package/package.json +1 -1
- package/template/.windy-template.json +2 -2
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
|
|
4121
|
-
|
|
4122
|
-
|
|
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