spfn 0.2.0-beta.41 → 0.2.0-beta.43

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.
Files changed (2) hide show
  1. package/dist/index.js +8 -7
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -755,7 +755,7 @@ var init_deployment_config = __esm({
755
755
 
756
756
  // src/utils/version.ts
757
757
  function getCliVersion() {
758
- return "0.2.0-beta.41";
758
+ return "0.2.0-beta.43";
759
759
  }
760
760
  function getTagFromVersion(version) {
761
761
  const match = version.match(/-([a-z]+)\./i);
@@ -2487,13 +2487,14 @@ async function dbPush(options = {}) {
2487
2487
  }
2488
2488
  displayApplySummary(statements.length, 0);
2489
2489
  } else {
2490
- const safeCount = result.safe.length + result.warning.length;
2491
- if (safeCount > 0) {
2492
- for (const stmt of [...result.safe, ...result.warning]) {
2493
- await db.execute(sql.raw(stmt.sql));
2490
+ const destructiveSet = new Set(result.destructive.map((s) => s.sql));
2491
+ const nonDestructive = statements.filter((s) => !destructiveSet.has(s));
2492
+ if (nonDestructive.length > 0) {
2493
+ for (const stmt of nonDestructive) {
2494
+ await db.execute(sql.raw(stmt));
2494
2495
  }
2495
2496
  console.log(chalk13.green(`
2496
- \u2705 Applied ${safeCount} safe statement(s)`));
2497
+ \u2705 Applied ${nonDestructive.length} safe statement(s)`));
2497
2498
  }
2498
2499
  console.log(chalk13.red(`
2499
2500
  \u274C ${result.destructive.length} destructive change(s) require confirmation:`));
@@ -2513,7 +2514,7 @@ async function dbPush(options = {}) {
2513
2514
  }
2514
2515
  displayApplySummary(statements.length, 0);
2515
2516
  } else {
2516
- displayApplySummary(safeCount, result.destructive.length);
2517
+ displayApplySummary(nonDestructive.length, result.destructive.length);
2517
2518
  console.log(chalk13.dim("Tip: Use --force to apply all changes without prompting.\n"));
2518
2519
  }
2519
2520
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spfn",
3
- "version": "0.2.0-beta.41",
3
+ "version": "0.2.0-beta.43",
4
4
  "description": "Superfunction CLI - Add SPFN to your Next.js project",
5
5
  "type": "module",
6
6
  "bin": {
@@ -78,7 +78,7 @@
78
78
  "concurrently": "^9.2.1",
79
79
  "tsx": "^4.20.6",
80
80
  "typescript": "^5.3.3",
81
- "@spfn/core": "0.2.0-beta.39"
81
+ "@spfn/core": "0.2.0-beta.40"
82
82
  },
83
83
  "scripts": {
84
84
  "build": "tsup && node scripts/copy-templates.js",