create-windy 0.2.14 → 0.2.15
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 +23 -4
- package/package.json +1 -1
- package/template/.windy-template.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -4012,7 +4012,8 @@ var recipes = [
|
|
|
4012
4012
|
{ id: "starter-0.2.10-to-0.2.11", from: "0.2.10", to: "0.2.11" },
|
|
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
|
-
{ id: "starter-0.2.13-to-0.2.14", from: "0.2.13", to: "0.2.14" }
|
|
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
4017
|
];
|
|
4017
4018
|
function resolveRecipeChain(sourceVersion, targetVersion) {
|
|
4018
4019
|
if (sourceVersion === targetVersion)
|
|
@@ -4104,18 +4105,28 @@ import { access as access3, readFile as readFile13 } from "node:fs/promises";
|
|
|
4104
4105
|
import { join as join14 } from "node:path";
|
|
4105
4106
|
|
|
4106
4107
|
// src/update/known-repairs.ts
|
|
4107
|
-
var
|
|
4108
|
+
var wrongTextVersions = new Set(["0.2.12", "0.2.13"]);
|
|
4108
4109
|
var wrongExampleDescription = "创建时包含了 `work-order` 示例模块,用于演示 Module Manifest 接入;它不是生产工单产品,可以在正式开发前替换。";
|
|
4109
4110
|
var correctCoreDescription = "创建时未选择 `work-order` 示例模块,当前项目只包含平台模块。";
|
|
4110
4111
|
var wrongExampleRow = /^\|\s*示例工单\s*\|\s*已包含\s*\|$/m;
|
|
4111
4112
|
var correctCoreRow = /^\|\s*示例工单\s*\|\s*未包含\s*\|$/m;
|
|
4112
4113
|
function repairKnownDerivedFile(input) {
|
|
4113
|
-
if (input.path !== "README.md" || input.includeExample || !
|
|
4114
|
+
if (input.path !== "README.md" || input.includeExample || !input.targetContent.includes(correctCoreDescription) || !correctCoreRow.test(input.targetContent)) {
|
|
4114
4115
|
return;
|
|
4115
4116
|
}
|
|
4116
4117
|
const targetRow = input.targetContent.match(correctCoreRow)?.[0];
|
|
4117
4118
|
if (!targetRow)
|
|
4118
4119
|
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);
|
|
4124
|
+
}
|
|
4125
|
+
return;
|
|
4126
|
+
}
|
|
4127
|
+
if (!wrongTextVersions.has(input.sourceVersion) || !input.content.includes(wrongExampleDescription) || !wrongExampleRow.test(input.content)) {
|
|
4128
|
+
return;
|
|
4129
|
+
}
|
|
4119
4130
|
return input.content.replace(wrongExampleDescription, correctCoreDescription).replace(wrongExampleRow, targetRow);
|
|
4120
4131
|
}
|
|
4121
4132
|
|
|
@@ -4414,9 +4425,17 @@ async function finalize(result) {
|
|
|
4414
4425
|
const generationContent = `${JSON.stringify(result.plan.targetProvenance, null, 2)}
|
|
4415
4426
|
`;
|
|
4416
4427
|
await writeFile11(join15(root, ".windy/generation.json"), generationContent);
|
|
4428
|
+
const refreshedPaths = new Set([
|
|
4429
|
+
".windy/generation.json",
|
|
4430
|
+
...result.plan.files.filter(({ action }) => action === "create" || action === "update").map(({ path: path2 }) => path2)
|
|
4431
|
+
]);
|
|
4432
|
+
const refreshedHashes = new Map(await Promise.all([...refreshedPaths].map(async (path2) => [path2, hashContent(await readFile14(join15(root, path2)))])));
|
|
4417
4433
|
const targetManifest = {
|
|
4418
4434
|
...result.plan.targetManifest,
|
|
4419
|
-
files: result.plan.targetManifest.files.map((entry) =>
|
|
4435
|
+
files: result.plan.targetManifest.files.map((entry) => ({
|
|
4436
|
+
...entry,
|
|
4437
|
+
hash: refreshedHashes.get(entry.path) ?? entry.hash
|
|
4438
|
+
}))
|
|
4420
4439
|
};
|
|
4421
4440
|
await writeFile11(join15(root, ".windy/files.json"), `${JSON.stringify(targetManifest, null, 2)}
|
|
4422
4441
|
`);
|
package/package.json
CHANGED