create-windy 0.5.0 → 0.5.1

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
@@ -2661,16 +2661,27 @@ async function pruneDatabaseArtifacts(root, tableNames, statementTokens) {
2661
2661
  for (const path of await collectFiles2(drizzleRoot)) {
2662
2662
  if (path.endsWith(".sql")) {
2663
2663
  const source = await readFile6(path, "utf8");
2664
- const statements = source.split("--> statement-breakpoint").map((statement) => statement.trim()).filter(Boolean).filter((statement) => !tablePatterns.some((pattern) => pattern.test(statement)) && !statementTokens.some((token) => statement.includes(token)));
2665
- await writeFile5(path, statements.length ? `${statements.join(`
2664
+ const statements = source.split("--> statement-breakpoint").map((statement) => statement.trim()).filter(Boolean);
2665
+ const retained = statements.filter((statement) => !tablePatterns.some((pattern) => pattern.test(statement)) && !statementTokens.some((token) => statement.includes(token)));
2666
+ if (retained.length === statements.length)
2667
+ continue;
2668
+ await writeFile5(path, retained.length ? `${retained.join(`
2666
2669
  --> statement-breakpoint
2667
2670
  `)}
2668
2671
  ` : `-- \u6B64 migration \u7684\u6A21\u5757\u672A\u88AB\u5F53\u524D\u9879\u76EE\u9009\u62E9\u3002
2669
2672
  `);
2670
2673
  } else if (path.endsWith("_snapshot.json")) {
2671
2674
  const snapshot = JSON.parse(await readFile6(path, "utf8"));
2672
- for (const name of tableNames)
2673
- delete snapshot.tables?.[`public.${name}`];
2675
+ let changed = false;
2676
+ for (const name of tableNames) {
2677
+ const key = `public.${name}`;
2678
+ if (!Object.hasOwn(snapshot.tables ?? {}, key))
2679
+ continue;
2680
+ delete snapshot.tables?.[key];
2681
+ changed = true;
2682
+ }
2683
+ if (!changed)
2684
+ continue;
2674
2685
  await writeFile5(path, `${JSON.stringify(snapshot, null, 2)}
2675
2686
  `);
2676
2687
  }
@@ -7558,6 +7569,11 @@ var recipes = [
7558
7569
  id: "starter-0.4.1-to-0.5.0",
7559
7570
  from: "0.4.1",
7560
7571
  to: "0.5.0"
7572
+ },
7573
+ {
7574
+ id: "starter-0.5.0-to-0.5.1",
7575
+ from: "0.5.0",
7576
+ to: "0.5.1"
7561
7577
  }
7562
7578
  ];
7563
7579
  function resolveRecipeChain(sourceVersion, targetVersion) {
@@ -8634,6 +8650,11 @@ function mergeValue(base, ours, theirs, path2, conflicts) {
8634
8650
  return theirs;
8635
8651
  if (equal(theirs, base))
8636
8652
  return ours;
8653
+ if (path2 === "package.json.files") {
8654
+ const files = mergeAppendOnlyStringSet(base, ours, theirs);
8655
+ if (files)
8656
+ return files;
8657
+ }
8637
8658
  if (isObject(base) && isObject(ours) && isObject(theirs)) {
8638
8659
  const output = {};
8639
8660
  const keys = new Set([
@@ -8654,6 +8675,15 @@ function mergeValue(base, ours, theirs, path2, conflicts) {
8654
8675
  function equal(left, right) {
8655
8676
  return JSON.stringify(left) === JSON.stringify(right);
8656
8677
  }
8678
+ function mergeAppendOnlyStringSet(base, ours, theirs) {
8679
+ if (!isStringArray(base) || !isStringArray(ours) || !isStringArray(theirs) || !base.every((value) => ours.includes(value) && theirs.includes(value))) {
8680
+ return;
8681
+ }
8682
+ return [...new Set([...ours, ...theirs])].sort();
8683
+ }
8684
+ function isStringArray(value) {
8685
+ return Array.isArray(value) && value.every((item) => typeof item === "string");
8686
+ }
8657
8687
  function isObject(value) {
8658
8688
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
8659
8689
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-windy",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
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": "647dac095fa843d7c6eaa3e734d3fbf0d80d81d8",
4
- "generatorVersion": "0.5.0",
3
+ "templateCommit": "25b98ed98562c416c6dcfe48940cd0cae43252d4",
4
+ "generatorVersion": "0.5.1",
5
5
  "modules": [
6
6
  {
7
7
  "name": "system",