create-windy 0.3.6 → 0.3.7

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
@@ -8687,7 +8687,7 @@ function conflict(path2, reason, expectedProjectContent) {
8687
8687
  }
8688
8688
 
8689
8689
  // src/update/planner-file.ts
8690
- async function planFile(path2, baseRoot, targetRoot, source, target, ours, provenance, targetContentOverride, manageGeneratedProjectOwned = false) {
8690
+ async function planFile(path2, baseRoot, targetRoot, source, target, ours, provenance, targetContentOverride, manageGeneratedProjectOwned = false, forcePlatformBaseline = false) {
8691
8691
  const [base, theirs] = await Promise.all([
8692
8692
  readOptional(join19(baseRoot, path2)),
8693
8693
  targetContentOverride ? Promise.resolve(targetContentOverride) : readOptional(join19(targetRoot, path2))
@@ -8736,6 +8736,14 @@ async function planFile(path2, baseRoot, targetRoot, source, target, ours, prove
8736
8736
  const oursChanged = hashContent(ours) !== source.hash;
8737
8737
  const sourceArtifactHash = artifactHashOf(source);
8738
8738
  const targetChanged = targetChangedSinceBase(sourceArtifactHash, base, theirs);
8739
+ if (shouldForcePlatformBaseline({
8740
+ forcePlatformBaseline,
8741
+ oursChanged,
8742
+ sourceArtifactHash,
8743
+ base
8744
+ })) {
8745
+ return readyPlannedFile(path2, ownership, "update", "\u5F3A\u5236\u91C7\u7528\u76EE\u6807\u5E73\u53F0\u57FA\u7EBF", expected, theirs);
8746
+ }
8739
8747
  if (!oursChanged && !targetChanged) {
8740
8748
  return readyPlannedFile(path2, ownership, "preserve", "\u53CC\u65B9\u672A\u4FEE\u6539", expected);
8741
8749
  }
@@ -8758,6 +8766,9 @@ async function planFile(path2, baseRoot, targetRoot, source, target, ours, prove
8758
8766
  }
8759
8767
  return conflict2(path2, ownership, "\u5BA2\u6237\u548C Windy \u5747\u5DF2\u4FEE\u6539", expected);
8760
8768
  }
8769
+ function shouldForcePlatformBaseline(input) {
8770
+ return input.forcePlatformBaseline && !input.oursChanged && input.base !== undefined && hashContent(input.base) !== input.sourceArtifactHash;
8771
+ }
8761
8772
  function targetChangedSinceBase(sourceHash, base, target) {
8762
8773
  return base && target ? hashContent(base) !== hashContent(target) : !!target && hashContent(target) !== sourceHash;
8763
8774
  }
@@ -8959,7 +8970,8 @@ var recipes = [
8959
8970
  { id: "starter-0.3.2-to-0.3.3", from: "0.3.2", to: "0.3.3" },
8960
8971
  { id: "starter-0.3.3-to-0.3.4", from: "0.3.3", to: "0.3.4" },
8961
8972
  { id: "starter-0.3.4-to-0.3.5", from: "0.3.4", to: "0.3.5" },
8962
- { id: "starter-0.3.5-to-0.3.6", from: "0.3.5", to: "0.3.6" }
8973
+ { id: "starter-0.3.5-to-0.3.6", from: "0.3.5", to: "0.3.6" },
8974
+ { id: "starter-0.3.6-to-0.3.7", from: "0.3.6", to: "0.3.7" }
8963
8975
  ];
8964
8976
  function resolveRecipeChain(sourceVersion, targetVersion) {
8965
8977
  if (sourceVersion === targetVersion)
@@ -9054,7 +9066,8 @@ async function createUpdatePlan(request, artifacts) {
9054
9066
  migrations,
9055
9067
  artifactSet,
9056
9068
  provenance,
9057
- manageGeneratedProjectOwned: request.targetModules !== undefined
9069
+ manageGeneratedProjectOwned: request.targetModules !== undefined,
9070
+ forcePlatformBaseline: request.forcePlatformBaseline === true
9058
9071
  });
9059
9072
  deriveWebDockerfilePlan(files, projectSnapshots, new Set([...paths, ...workspaceSnapshot.manifests.keys()]));
9060
9073
  for (const file of files) {
@@ -9141,7 +9154,7 @@ async function planFiles(input) {
9141
9154
  } else if (forcedContent) {
9142
9155
  files.push(readyPlannedFile(path2, input.targetEntries.get(path2)?.ownership ?? input.sourceEntries.get(path2)?.ownership ?? classifyOwnership(path2), "update", "\u5408\u5E76\u5E73\u53F0\u4E0E\u4E0B\u6E38 migration \u5386\u53F2", expected, forcedContent));
9143
9156
  } else {
9144
- files.push(await planFile(path2, input.artifactSet.baseDirectory, input.artifactSet.targetDirectory, input.sourceEntries.get(path2), input.targetEntries.get(path2), ours, input.provenance, input.migrations.contentOverrides.get(path2), input.manageGeneratedProjectOwned));
9157
+ files.push(await planFile(path2, input.artifactSet.baseDirectory, input.artifactSet.targetDirectory, input.sourceEntries.get(path2), input.targetEntries.get(path2), ours, input.provenance, input.migrations.contentOverrides.get(path2), input.manageGeneratedProjectOwned, input.forcePlatformBaseline));
9145
9158
  }
9146
9159
  }
9147
9160
  return files;
@@ -10702,7 +10715,11 @@ async function runUpdate(args, projectDirectory) {
10702
10715
  return;
10703
10716
  }
10704
10717
  const updater = new DefaultStarterUpdater;
10705
- const plan = await updater.plan({ projectDirectory, targetVersion: target });
10718
+ const plan = await updater.plan({
10719
+ projectDirectory,
10720
+ targetVersion: target,
10721
+ forcePlatformBaseline: args.includes("--force")
10722
+ });
10706
10723
  printPlan(plan);
10707
10724
  if (args.includes("--dry-run")) {
10708
10725
  await rm11(plan.temporaryRoot, { recursive: true, force: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-windy",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
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": "5be88a688b54b87cf58a753535efb875ee3058e4",
4
- "generatorVersion": "0.3.6",
3
+ "templateCommit": "fca8f541b8d5593ff4e69daf665624ba131eb3e5",
4
+ "generatorVersion": "0.3.7",
5
5
  "modules": [
6
6
  {
7
7
  "name": "system",