@saastemly/voidcommerce 0.19.0 → 0.19.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 +4 -4
- package/dist/deploy/keys.d.ts +2 -2
- package/dist/generate/ci.d.ts +4 -4
- package/dist/{index-68m1eg3f.js → index-hsc97bf2.js} +6 -6
- package/dist/{index-y4dk27kf.js → index-tk46w7yn.js} +4 -3
- package/dist/index.js +2 -2
- package/dist/{keys-e6w5dcxx.js → keys-knmqsqz1.js} +1 -1
- package/package.json +1 -1
- package/src/deploy/index.ts +2 -2
- package/src/deploy/keys.ts +6 -6
- package/src/deploy/secrets.ts +1 -1
- package/src/generate/ci.ts +6 -5
- package/src/generate/env.ts +2 -2
package/dist/cli.js
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
runVoid,
|
|
22
22
|
version,
|
|
23
23
|
voidAppsIn
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-tk46w7yn.js";
|
|
25
25
|
import {
|
|
26
26
|
LOCAL_KEY_FILE,
|
|
27
27
|
PRIVATE_KEY_VAR,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
plaintextSecretNames,
|
|
36
36
|
run,
|
|
37
37
|
secretsCommand
|
|
38
|
-
} from "./index-
|
|
38
|
+
} from "./index-hsc97bf2.js";
|
|
39
39
|
import {
|
|
40
40
|
LAYOUTS,
|
|
41
41
|
oneOrigin,
|
|
@@ -132,8 +132,8 @@ async function deployHelp() {
|
|
|
132
132
|
...row("CLOUDFLARE_API_TOKEN", "in the environment; the account is pinned for you when there is one", width, 2),
|
|
133
133
|
...row(PRIVATE_KEY_VAR, "to decrypt the shop's own secrets", width, 2),
|
|
134
134
|
line("", width),
|
|
135
|
-
line("Normally neither is on your machine:
|
|
136
|
-
line("
|
|
135
|
+
line("Normally neither is on your machine: both are ordinary secrets in", width),
|
|
136
|
+
line(".env.secrets, and the deploy reads them out of what you pushed.", width)
|
|
137
137
|
], width);
|
|
138
138
|
if (captured)
|
|
139
139
|
process.stdout.write(captured.out.replace(/\n*$/, `
|
package/dist/deploy/keys.d.ts
CHANGED
|
@@ -56,8 +56,8 @@ import type { Project } from "../project";
|
|
|
56
56
|
* secrets long before anyone has made a GitHub repo to put the private half
|
|
57
57
|
* on. Refusing to make a key until then would block exactly that, so
|
|
58
58
|
* `vc keys --init` will write one here instead — 0600, gitignored, and
|
|
59
|
-
* TEMPORARY:
|
|
60
|
-
* file
|
|
59
|
+
* TEMPORARY: once the repository exists, the key is set on it as a variable
|
|
60
|
+
* and this file can go — `vc keys --restore` brings it back when needed.
|
|
61
61
|
*/
|
|
62
62
|
export declare const LOCAL_KEY_FILE = ".env.keys";
|
|
63
63
|
/** The private key parked locally, if there is one. */
|
package/dist/generate/ci.d.ts
CHANGED
|
@@ -20,10 +20,10 @@ import type { Manifest } from "../manifest";
|
|
|
20
20
|
* Worker that has to exist first.
|
|
21
21
|
*
|
|
22
22
|
* GitHub already has what is needed. A person who can push is logged into
|
|
23
|
-
* `gh`, and `gh` can write repository
|
|
24
|
-
*
|
|
25
|
-
* workflow spends
|
|
26
|
-
*
|
|
23
|
+
* `gh`, and `gh` can write repository variables from the terminal — so the
|
|
24
|
+
* one key that opens `.env.secrets` is set there when the key is made, and
|
|
25
|
+
* this workflow spends it. Nothing else is configured outside the
|
|
26
|
+
* repository: the Cloudflare credentials are ordinary secrets in that file.
|
|
27
27
|
*
|
|
28
28
|
* ── The `void-dist` branch is still built ────────────────────────────────
|
|
29
29
|
*
|
|
@@ -370,7 +370,7 @@ async function decryptSecrets(project) {
|
|
|
370
370
|
const root = project.root;
|
|
371
371
|
if (!existsSync2(join2(root, SECRETS_FILE)))
|
|
372
372
|
return { error: `${SECRETS_FILE} does not exist — \`vc secrets init\` writes one` };
|
|
373
|
-
const { localPrivateKey } = await import("./keys-
|
|
373
|
+
const { localPrivateKey } = await import("./keys-knmqsqz1.js");
|
|
374
374
|
const privateKey = process.env[PRIVATE_KEY_VAR] || localPrivateKey(root) || "";
|
|
375
375
|
if (!privateKey) {
|
|
376
376
|
return {
|
|
@@ -382,7 +382,7 @@ async function decryptSecrets(project) {
|
|
|
382
382
|
}
|
|
383
383
|
const expected = committedPublicKey(root);
|
|
384
384
|
if (expected) {
|
|
385
|
-
const { publicKeyFor } = await import("./keys-
|
|
385
|
+
const { publicKeyFor } = await import("./keys-knmqsqz1.js");
|
|
386
386
|
const derived = await publicKeyFor(privateKey);
|
|
387
387
|
if (derived && derived.toLowerCase() !== expected.toLowerCase()) {
|
|
388
388
|
return {
|
|
@@ -852,10 +852,10 @@ Secrets are encrypted with a public key that is COMMITTED, and read with a`);
|
|
|
852
852
|
console.log(`private key that lives only in GitHub Actions.
|
|
853
853
|
`);
|
|
854
854
|
const hasFile = existsSync3(join3(project.root, SECRETS_FILE));
|
|
855
|
-
const publicNote = state.publicKey ? `${state.publicKey.slice(0, 20)}… in ${SECRETS_FILE}` : color2.dim(hasFile ? `${SECRETS_FILE} has no key yet — \`vc
|
|
855
|
+
const publicNote = state.publicKey ? `${state.publicKey.slice(0, 20)}… in ${SECRETS_FILE}` : color2.dim(hasFile ? `${SECRETS_FILE} has no key yet — \`vc keys --init\` makes one` : `no ${SECRETS_FILE} yet — \`vc secrets --init\``);
|
|
856
856
|
console.log(` ${state.publicKey ? color2.green("✓") : color2.dim("·")} public key ${publicNote}`);
|
|
857
857
|
const parked = localPrivateKey(project.root) !== null;
|
|
858
|
-
console.log(` ${state.inGitHub || parked ? color2.green("✓") : color2.red("✗")} private key ${state.inGitHub ? `${PRIVATE_KEY_VAR} is set on ${state.slug}` : parked ? color2.yellow(`waiting in ${LOCAL_KEY_FILE} —
|
|
858
|
+
console.log(` ${state.inGitHub || parked ? color2.green("✓") : color2.red("✗")} private key ${state.inGitHub ? `${PRIVATE_KEY_VAR} is set on ${state.slug}` : parked ? color2.yellow(`waiting in ${LOCAL_KEY_FILE} — create the repository, then \`vc keys --init\` puts it there`) : state.slug ? color2.red(`not set on ${state.slug} — \`vc keys --init\``) : color2.dim("no key yet — `vc keys --init`")}`);
|
|
859
859
|
if (state.mismatch) {
|
|
860
860
|
console.error(`
|
|
861
861
|
${color2.red("✗")} ${state.mismatch}
|
|
@@ -893,8 +893,8 @@ vc: ${made.reason}
|
|
|
893
893
|
${color2.green("✓")} key made; public half in ${SECRETS_FILE}, private half waiting in ${LOCAL_KEY_FILE}
|
|
894
894
|
|
|
895
895
|
` + color2.yellow(` ${LOCAL_KEY_FILE} is TEMPORARY. It is gitignored, but it is the one file that
|
|
896
|
-
opens every secret in this shop.
|
|
897
|
-
|
|
896
|
+
opens every secret in this shop. Once the repository exists it is set
|
|
897
|
+
there as a variable, and this file can go.
|
|
898
898
|
`) + (fresh ? `
|
|
899
899
|
Next: ${color2.cyan("vc secrets --init")} fills in the keys this shop needs.
|
|
900
900
|
` : "") : `
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
renderEnvTs,
|
|
14
14
|
secretValue,
|
|
15
15
|
unsetSecretNames
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-hsc97bf2.js";
|
|
17
17
|
import {
|
|
18
18
|
MANIFEST_FILE,
|
|
19
19
|
has,
|
|
@@ -1380,7 +1380,7 @@ import color from "picocolors";
|
|
|
1380
1380
|
// package.json
|
|
1381
1381
|
var package_default = {
|
|
1382
1382
|
name: "@saastemly/voidcommerce",
|
|
1383
|
-
version: "0.19.
|
|
1383
|
+
version: "0.19.1",
|
|
1384
1384
|
description: "Void, with a shop in it. `vc init` walks you through Better Auth, betterCommerce and every plugin; everything else passes through to `void`.",
|
|
1385
1385
|
type: "module",
|
|
1386
1386
|
license: "MIT",
|
|
@@ -1987,7 +1987,8 @@ Point Workers Builds at the \`${DIST_BRANCH}\` branch — it is a plain Void app
|
|
|
1987
1987
|
a committed lockfile. The Worker must be named \`${worker}\`, matching the \`name\`
|
|
1988
1988
|
in its \`wrangler.jsonc\`. You will need to set \`${PRIVATE_KEY_VAR}\` as a
|
|
1989
1989
|
build secret in the dashboard, and replace the auto-generated API token with
|
|
1990
|
-
one that has D1 and Queues
|
|
1990
|
+
one that has D1 and Queues — three dashboard visits, which is exactly what
|
|
1991
|
+
the GitHub Actions path above exists to avoid.
|
|
1991
1992
|
`;
|
|
1992
1993
|
}
|
|
1993
1994
|
|
package/dist/index.js
CHANGED
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
routeProblem,
|
|
53
53
|
strictDependencies,
|
|
54
54
|
upsertJsonc
|
|
55
|
-
} from "./index-
|
|
55
|
+
} from "./index-tk46w7yn.js";
|
|
56
56
|
import {
|
|
57
57
|
allEnvKeys,
|
|
58
58
|
envSummary,
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
renderEnvLocal,
|
|
61
61
|
renderEnvProduction,
|
|
62
62
|
renderEnvTs
|
|
63
|
-
} from "./index-
|
|
63
|
+
} from "./index-hsc97bf2.js";
|
|
64
64
|
import {
|
|
65
65
|
LAYOUTS,
|
|
66
66
|
MANIFEST_FILE,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saastemly/voidcommerce",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.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",
|
package/src/deploy/index.ts
CHANGED
|
@@ -115,8 +115,8 @@ export async function deployHelp(): Promise<number> {
|
|
|
115
115
|
...row("CLOUDFLARE_API_TOKEN", "in the environment; the account is pinned for you when there is one", width, 2),
|
|
116
116
|
...row(PRIVATE_KEY_VAR, "to decrypt the shop's own secrets", width, 2),
|
|
117
117
|
line("", width),
|
|
118
|
-
line("Normally neither is on your machine:
|
|
119
|
-
line("
|
|
118
|
+
line("Normally neither is on your machine: both are ordinary secrets in", width),
|
|
119
|
+
line(".env.secrets, and the deploy reads them out of what you pushed.", width),
|
|
120
120
|
], width);
|
|
121
121
|
if (captured) process.stdout.write(captured.out.replace(/\n*$/, "\n"));
|
|
122
122
|
console.log(ours);
|
package/src/deploy/keys.ts
CHANGED
|
@@ -63,8 +63,8 @@ import { PRIVATE_KEY_VAR, SECRETS_FILE, committedPublicKeyInto, findDotenvx, run
|
|
|
63
63
|
* secrets long before anyone has made a GitHub repo to put the private half
|
|
64
64
|
* on. Refusing to make a key until then would block exactly that, so
|
|
65
65
|
* `vc keys --init` will write one here instead — 0600, gitignored, and
|
|
66
|
-
* TEMPORARY:
|
|
67
|
-
* file
|
|
66
|
+
* TEMPORARY: once the repository exists, the key is set on it as a variable
|
|
67
|
+
* and this file can go — `vc keys --restore` brings it back when needed.
|
|
68
68
|
*/
|
|
69
69
|
export const LOCAL_KEY_FILE = ".env.keys";
|
|
70
70
|
|
|
@@ -260,7 +260,7 @@ export async function keysCommand(project: Project, args: string[]): Promise<num
|
|
|
260
260
|
const hasFile = existsSync(join(project.root, SECRETS_FILE));
|
|
261
261
|
const publicNote = state.publicKey
|
|
262
262
|
? `${state.publicKey.slice(0, 20)}… in ${SECRETS_FILE}`
|
|
263
|
-
: color.dim(hasFile ? `${SECRETS_FILE} has no key yet — \`vc
|
|
263
|
+
: color.dim(hasFile ? `${SECRETS_FILE} has no key yet — \`vc keys --init\` makes one` : `no ${SECRETS_FILE} yet — \`vc secrets --init\``);
|
|
264
264
|
console.log(` ${state.publicKey ? color.green("✓") : color.dim("·")} public key ${publicNote}`);
|
|
265
265
|
const parked = localPrivateKey(project.root) !== null;
|
|
266
266
|
console.log(
|
|
@@ -268,7 +268,7 @@ export async function keysCommand(project: Project, args: string[]): Promise<num
|
|
|
268
268
|
state.inGitHub
|
|
269
269
|
? `${PRIVATE_KEY_VAR} is set on ${state.slug}`
|
|
270
270
|
: parked
|
|
271
|
-
? color.yellow(`waiting in ${LOCAL_KEY_FILE} —
|
|
271
|
+
? color.yellow(`waiting in ${LOCAL_KEY_FILE} — create the repository, then \`vc keys --init\` puts it there`)
|
|
272
272
|
: state.slug
|
|
273
273
|
? color.red(`not set on ${state.slug} — \`vc keys --init\``)
|
|
274
274
|
: color.dim("no key yet — `vc keys --init`")
|
|
@@ -315,8 +315,8 @@ async function initKey(project: Project): Promise<number> {
|
|
|
315
315
|
? `\n${color.green("✓")} key made; public half in ${SECRETS_FILE}, private half waiting in ${LOCAL_KEY_FILE}\n\n` +
|
|
316
316
|
color.yellow(
|
|
317
317
|
` ${LOCAL_KEY_FILE} is TEMPORARY. It is gitignored, but it is the one file that\n` +
|
|
318
|
-
` opens every secret in this shop.
|
|
319
|
-
"
|
|
318
|
+
` opens every secret in this shop. Once the repository exists it is set\n` +
|
|
319
|
+
" there as a variable, and this file can go.\n",
|
|
320
320
|
) +
|
|
321
321
|
(fresh ? `\n Next: ${color.cyan("vc secrets --init")} fills in the keys this shop needs.\n` : "")
|
|
322
322
|
: `\n${color.green("✓")} ${PRIVATE_KEY_VAR} set on ${state.slug}; public key in ${SECRETS_FILE}\n` +
|
package/src/deploy/secrets.ts
CHANGED
|
@@ -318,7 +318,7 @@ export async function secretsCommand(project: Project, args: string[]): Promise<
|
|
|
318
318
|
export async function initSecrets(project: Project): Promise<number> {
|
|
319
319
|
const path = join(project.root, SECRETS_FILE);
|
|
320
320
|
|
|
321
|
-
// `vc
|
|
321
|
+
// `vc keys --init` leaves a file holding nothing but the public key, so "exists"
|
|
322
322
|
// is not the same as "is already set up". Refusing on existence alone
|
|
323
323
|
// stranded anyone who linked first, which is the order the docs recommend.
|
|
324
324
|
if (existsSync(path) && declaredSecretNames(project.root).size > 0) {
|
package/src/generate/ci.ts
CHANGED
|
@@ -23,10 +23,10 @@ import { PRIVATE_KEY_VAR, SECRETS_FILE } from "../deploy/secrets";
|
|
|
23
23
|
* Worker that has to exist first.
|
|
24
24
|
*
|
|
25
25
|
* GitHub already has what is needed. A person who can push is logged into
|
|
26
|
-
* `gh`, and `gh` can write repository
|
|
27
|
-
*
|
|
28
|
-
* workflow spends
|
|
29
|
-
*
|
|
26
|
+
* `gh`, and `gh` can write repository variables from the terminal — so the
|
|
27
|
+
* one key that opens `.env.secrets` is set there when the key is made, and
|
|
28
|
+
* this workflow spends it. Nothing else is configured outside the
|
|
29
|
+
* repository: the Cloudflare credentials are ordinary secrets in that file.
|
|
30
30
|
*
|
|
31
31
|
* ── The `void-dist` branch is still built ────────────────────────────────
|
|
32
32
|
*
|
|
@@ -318,6 +318,7 @@ Point Workers Builds at the \`${DIST_BRANCH}\` branch — it is a plain Void app
|
|
|
318
318
|
a committed lockfile. The Worker must be named \`${worker}\`, matching the \`name\`
|
|
319
319
|
in its \`wrangler.jsonc\`. You will need to set \`${PRIVATE_KEY_VAR}\` as a
|
|
320
320
|
build secret in the dashboard, and replace the auto-generated API token with
|
|
321
|
-
one that has D1 and Queues
|
|
321
|
+
one that has D1 and Queues — three dashboard visits, which is exactly what
|
|
322
|
+
the GitHub Actions path above exists to avoid.
|
|
322
323
|
`;
|
|
323
324
|
}
|
package/src/generate/env.ts
CHANGED
|
@@ -16,8 +16,8 @@ const BASE: EnvKey[] = [
|
|
|
16
16
|
/**
|
|
17
17
|
* The Cloudflare credentials are ORDINARY SECRETS, deliberately.
|
|
18
18
|
*
|
|
19
|
-
* They used to be set on the GitHub repository by a
|
|
20
|
-
* existed only because they were treated as special. They are not: they
|
|
19
|
+
* They used to be set on the GitHub repository by a separate linking step,
|
|
20
|
+
* which existed only because they were treated as special. They are not: they
|
|
21
21
|
* are two more values this shop needs, they belong in `.env.secrets` with
|
|
22
22
|
* everything else, and they are set the same way — `vc secrets set`.
|
|
23
23
|
*
|