@saastemly/voidcommerce 0.22.0 → 0.22.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
@@ -25,7 +25,7 @@ import {
25
25
  version,
26
26
  voidAppsIn,
27
27
  wrangler
28
- } from "./index-2kqz80nx.js";
28
+ } from "./index-51zee2vf.js";
29
29
  import {
30
30
  LOCAL_KEY_FILE,
31
31
  PRIVATE_KEY_VAR,
@@ -126,7 +126,7 @@ ${color.bold("This will destroy, on Cloudflare:")}
126
126
  ` + ` ${color.cyan(`vc teardown --cloudflare --confirm ${project.manifest.shop.domain}`)}`);
127
127
  }
128
128
  console.log(`▸ wrangler delete (${plan.worker})`);
129
- const deleted = await wrangler(bin, ["delete", "--name", plan.worker, "--force"], app, true);
129
+ const deleted = await wrangler(bin, ["delete", "--name", plan.worker, "--force"], app);
130
130
  if (deleted.code !== 0 && !/not found|does not exist|10007|10090/i.test(deleted.out)) {
131
131
  return fail(`could not delete the worker:
132
132
  ${deleted.out.trim().split(`
@@ -135,7 +135,7 @@ ${deleted.out.trim().split(`
135
135
  }
136
136
  console.log(`${color.green("✓")} worker gone${/not found|does not exist/i.test(deleted.out) ? color.dim(" (it was already)") : ""}`);
137
137
  for (const queue of plan.queues) {
138
- const dropped = await wrangler(bin, ["queues", "delete", queue], app, true);
138
+ const dropped = await wrangler(bin, ["queues", "delete", queue], app);
139
139
  if (dropped.code !== 0 && !/not found|does not exist|11009|11018/i.test(dropped.out)) {
140
140
  console.error(`${color.yellow("!")} queue "${queue}" could not be deleted: ${dropped.out.trim().split(`
141
141
  `).slice(-1)[0]}`);
@@ -144,7 +144,7 @@ ${deleted.out.trim().split(`
144
144
  }
145
145
  }
146
146
  if (plan.d1 && !opts.keepData) {
147
- const dropped = await wrangler(bin, ["d1", "delete", plan.d1, "--skip-confirmation"], app, true);
147
+ const dropped = await wrangler(bin, ["d1", "delete", plan.d1, "--skip-confirmation"], app);
148
148
  if (dropped.code !== 0 && !/not found|does not exist|7404/i.test(dropped.out)) {
149
149
  return fail(`the worker and queues are gone but D1 "${plan.d1}" is not:
150
150
  ${dropped.out.trim().split(`
@@ -1383,7 +1383,7 @@ import color from "picocolors";
1383
1383
  // package.json
1384
1384
  var package_default = {
1385
1385
  name: "@saastemly/voidcommerce",
1386
- version: "0.22.0",
1386
+ version: "0.22.1",
1387
1387
  description: "Void, with a shop in it. `vc init` walks you through Better Auth, betterCommerce and every plugin; everything else passes through to `void`.",
1388
1388
  type: "module",
1389
1389
  license: "MIT",
package/dist/index.js CHANGED
@@ -52,7 +52,7 @@ import {
52
52
  routeProblem,
53
53
  strictDependencies,
54
54
  upsertJsonc
55
- } from "./index-2kqz80nx.js";
55
+ } from "./index-51zee2vf.js";
56
56
  import {
57
57
  allEnvKeys,
58
58
  envSummary,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saastemly/voidcommerce",
3
- "version": "0.22.0",
3
+ "version": "0.22.1",
4
4
  "description": "Void, with a shop in it. `vc init` walks you through Better Auth, betterCommerce and every plugin; everything else passes through to `void`.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -116,12 +116,18 @@ export async function teardownCloudflare(project: Project, opts: TeardownOptions
116
116
  }
117
117
 
118
118
  /**
119
+ * Every call CAPTURES its output rather than streaming it, because
120
+ * idempotency depends on reading what wrangler said. `wrangler(..., true)`
121
+ * inherits stdio, which leaves `out` empty — so "this worker does not
122
+ * exist" could never be recognised and a second teardown failed where it
123
+ * should have been a no-op.
124
+ *
119
125
  * Order matters. The worker goes FIRST: while it is live it serves
120
126
  * customers, and a shop that answers with a database that no longer
121
127
  * exists is worse than a shop that does not answer.
122
128
  */
123
129
  console.log(`▸ wrangler delete (${plan.worker})`);
124
- const deleted = await wrangler(bin, ["delete", "--name", plan.worker, "--force"], app, true);
130
+ const deleted = await wrangler(bin, ["delete", "--name", plan.worker, "--force"], app);
125
131
  // "not found" is success here: teardown is idempotent by design.
126
132
  if (deleted.code !== 0 && !/not found|does not exist|10007|10090/i.test(deleted.out)) {
127
133
  return fail(`could not delete the worker:\n${deleted.out.trim().split("\n").slice(-3).join("\n")}`);
@@ -129,7 +135,7 @@ export async function teardownCloudflare(project: Project, opts: TeardownOptions
129
135
  console.log(`${color.green("✓")} worker gone${/not found|does not exist/i.test(deleted.out) ? color.dim(" (it was already)") : ""}`);
130
136
 
131
137
  for (const queue of plan.queues) {
132
- const dropped = await wrangler(bin, ["queues", "delete", queue], app, true);
138
+ const dropped = await wrangler(bin, ["queues", "delete", queue], app);
133
139
  if (dropped.code !== 0 && !/not found|does not exist|11009|11018/i.test(dropped.out)) {
134
140
  console.error(`${color.yellow("!")} queue "${queue}" could not be deleted: ${dropped.out.trim().split("\n").slice(-1)[0]}`);
135
141
  } else {
@@ -138,7 +144,7 @@ export async function teardownCloudflare(project: Project, opts: TeardownOptions
138
144
  }
139
145
 
140
146
  if (plan.d1 && !opts.keepData) {
141
- const dropped = await wrangler(bin, ["d1", "delete", plan.d1, "--skip-confirmation"], app, true);
147
+ const dropped = await wrangler(bin, ["d1", "delete", plan.d1, "--skip-confirmation"], app);
142
148
  if (dropped.code !== 0 && !/not found|does not exist|7404/i.test(dropped.out)) {
143
149
  return fail(`the worker and queues are gone but D1 "${plan.d1}" is not:\n${dropped.out.trim().split("\n").slice(-3).join("\n")}`);
144
150
  }