create-windy 0.3.5 → 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
@@ -1963,6 +1963,7 @@ var projectOwnedRoots = [
1963
1963
  ];
1964
1964
  var sharedScaffoldRoots = [
1965
1965
  "README.md",
1966
+ "docs",
1966
1967
  "AGENTS.md",
1967
1968
  ".env.example",
1968
1969
  "docker-compose.yml",
@@ -8686,7 +8687,7 @@ function conflict(path2, reason, expectedProjectContent) {
8686
8687
  }
8687
8688
 
8688
8689
  // src/update/planner-file.ts
8689
- 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) {
8690
8691
  const [base, theirs] = await Promise.all([
8691
8692
  readOptional(join19(baseRoot, path2)),
8692
8693
  targetContentOverride ? Promise.resolve(targetContentOverride) : readOptional(join19(targetRoot, path2))
@@ -8735,11 +8736,18 @@ async function planFile(path2, baseRoot, targetRoot, source, target, ours, prove
8735
8736
  const oursChanged = hashContent(ours) !== source.hash;
8736
8737
  const sourceArtifactHash = artifactHashOf(source);
8737
8738
  const targetChanged = targetChangedSinceBase(sourceArtifactHash, base, theirs);
8738
- const reconstructedBaseDrifted = !!base && hashContent(base) !== sourceArtifactHash;
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
  }
8742
- if (!oursChanged && !reconstructedBaseDrifted) {
8750
+ if (!oursChanged) {
8743
8751
  return readyPlannedFile(path2, ownership, "update", "\u4EC5 Windy \u4FEE\u6539", expected, theirs);
8744
8752
  }
8745
8753
  if (!targetChanged) {
@@ -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
  }
@@ -8958,7 +8969,9 @@ var recipes = [
8958
8969
  { id: "starter-0.3.1-to-0.3.2", from: "0.3.1", to: "0.3.2" },
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
- { id: "starter-0.3.4-to-0.3.5", from: "0.3.4", to: "0.3.5" }
8972
+ { id: "starter-0.3.4-to-0.3.5", from: "0.3.4", to: "0.3.5" },
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" }
8962
8975
  ];
8963
8976
  function resolveRecipeChain(sourceVersion, targetVersion) {
8964
8977
  if (sourceVersion === targetVersion)
@@ -9053,7 +9066,8 @@ async function createUpdatePlan(request, artifacts) {
9053
9066
  migrations,
9054
9067
  artifactSet,
9055
9068
  provenance,
9056
- manageGeneratedProjectOwned: request.targetModules !== undefined
9069
+ manageGeneratedProjectOwned: request.targetModules !== undefined,
9070
+ forcePlatformBaseline: request.forcePlatformBaseline === true
9057
9071
  });
9058
9072
  deriveWebDockerfilePlan(files, projectSnapshots, new Set([...paths, ...workspaceSnapshot.manifests.keys()]));
9059
9073
  for (const file of files) {
@@ -9140,7 +9154,7 @@ async function planFiles(input) {
9140
9154
  } else if (forcedContent) {
9141
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));
9142
9156
  } else {
9143
- 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));
9144
9158
  }
9145
9159
  }
9146
9160
  return files;
@@ -10701,7 +10715,11 @@ async function runUpdate(args, projectDirectory) {
10701
10715
  return;
10702
10716
  }
10703
10717
  const updater = new DefaultStarterUpdater;
10704
- 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
+ });
10705
10723
  printPlan(plan);
10706
10724
  if (args.includes("--dry-run")) {
10707
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.5",
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": "0e87efcbc9fb6805a73439e73e030e6ec5783ad7",
4
- "generatorVersion": "0.3.5",
3
+ "templateCommit": "fca8f541b8d5593ff4e69daf665624ba131eb3e5",
4
+ "generatorVersion": "0.3.7",
5
5
  "modules": [
6
6
  {
7
7
  "name": "system",