@saastemly/voidcommerce 0.10.0 → 0.11.0
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 +2 -2
- package/dist/generate/env.d.ts +10 -0
- package/dist/{index-vhsq8jpy.js → index-62q6669q.js} +3 -2
- package/dist/{index-mb1p1rh0.js → index-964eqtx0.js} +5 -2
- package/dist/index.js +2 -2
- package/dist/{keys-2q3qzntw.js → keys-1cqepd69.js} +1 -1
- package/package.json +1 -1
- package/src/generate/env.ts +11 -0
- package/src/generate/index.ts +4 -0
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-964eqtx0.js";
|
|
25
25
|
import {
|
|
26
26
|
LOCAL_KEY_FILE,
|
|
27
27
|
PRIVATE_KEY_VAR,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
setVariable,
|
|
51
51
|
variableNames,
|
|
52
52
|
verifyCloudflareToken
|
|
53
|
-
} from "./index-
|
|
53
|
+
} from "./index-62q6669q.js";
|
|
54
54
|
import {
|
|
55
55
|
LAYOUTS,
|
|
56
56
|
oneOrigin,
|
package/dist/generate/env.d.ts
CHANGED
|
@@ -3,6 +3,16 @@ import { type Manifest, has } from "../manifest";
|
|
|
3
3
|
export declare function allEnvKeys(manifest: Manifest): EnvKey[];
|
|
4
4
|
export declare function renderEnvTs(manifest: Manifest): string;
|
|
5
5
|
export declare function renderEnvExample(manifest: Manifest): string;
|
|
6
|
+
/**
|
|
7
|
+
* Keys whose value is the MANIFEST'S to decide, not the operator's.
|
|
8
|
+
*
|
|
9
|
+
* These are the shop's identity. Preserving whatever was already on disk is
|
|
10
|
+
* right for a credential and wrong for these: a shop copied from another one
|
|
11
|
+
* kept `SHOP_DOMAIN=tshirt.test` and an EMAIL_FROM at the wrong domain, which
|
|
12
|
+
* is how a storefront ends up quietly addressing the wrong business. If you
|
|
13
|
+
* want a different domain, change the manifest — that is what it is for.
|
|
14
|
+
*/
|
|
15
|
+
export declare const MANIFEST_OWNED_ENV: Set<string>;
|
|
6
16
|
export declare function renderEnvLocal(manifest: Manifest): string;
|
|
7
17
|
export declare function renderEnvProduction(manifest: Manifest): string;
|
|
8
18
|
/** So the generator can say what it decided. */
|
|
@@ -233,6 +233,7 @@ function renderEnvExample(manifest) {
|
|
|
233
233
|
].join(`
|
|
234
234
|
`);
|
|
235
235
|
}
|
|
236
|
+
var MANIFEST_OWNED_ENV = new Set(["SHOP_DOMAIN", "SHOP_ZONE", "EMAIL_FROM", "GITHUB_PAGES_HOST"]);
|
|
236
237
|
function renderEnvLocal(manifest) {
|
|
237
238
|
const keys = allEnvKeys(manifest);
|
|
238
239
|
const local = {
|
|
@@ -385,7 +386,7 @@ async function decryptSecrets(project) {
|
|
|
385
386
|
}
|
|
386
387
|
const expected = committedPublicKey(root);
|
|
387
388
|
if (expected) {
|
|
388
|
-
const { publicKeyFor } = await import("./keys-
|
|
389
|
+
const { publicKeyFor } = await import("./keys-1cqepd69.js");
|
|
389
390
|
const derived = await publicKeyFor(privateKey);
|
|
390
391
|
if (derived && derived.toLowerCase() !== expected.toLowerCase()) {
|
|
391
392
|
return {
|
|
@@ -912,4 +913,4 @@ ${color2.green("✓")} re-keyed under ${made.publicKey.slice(0, 20)}… and ${PR
|
|
|
912
913
|
return 0;
|
|
913
914
|
}
|
|
914
915
|
|
|
915
|
-
export { allEnvKeys, renderEnvTs, renderEnvExample, renderEnvLocal, renderEnvProduction, envSummary, ghAuth, repoSlug, setSecret, secretNames, setVariable, variableNames, verifyCloudflareToken, cloudflareAccounts, LOCAL_KEY_FILE, localPrivateKey, committedPublicKey, generateKeypair, publicKeyFor, keyState, provisionKey, ignoresKeyFile, keysCommand, SECRETS_FILE, PRIVATE_KEY_VAR, run2 as run, committedPublicKeyInto, declaredSecretNames, plaintextSecretNames, plaintextSecretEntries, decryptSecrets, secretsCommand, initSecrets, encryptInto };
|
|
916
|
+
export { allEnvKeys, renderEnvTs, renderEnvExample, MANIFEST_OWNED_ENV, renderEnvLocal, renderEnvProduction, envSummary, ghAuth, repoSlug, setSecret, secretNames, setVariable, variableNames, verifyCloudflareToken, cloudflareAccounts, LOCAL_KEY_FILE, localPrivateKey, committedPublicKey, generateKeypair, publicKeyFor, keyState, provisionKey, ignoresKeyFile, keysCommand, SECRETS_FILE, PRIVATE_KEY_VAR, run2 as run, committedPublicKeyInto, declaredSecretNames, plaintextSecretNames, plaintextSecretEntries, decryptSecrets, secretsCommand, initSecrets, encryptInto };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
MANIFEST_OWNED_ENV,
|
|
2
3
|
PRIVATE_KEY_VAR,
|
|
3
4
|
SECRETS_FILE,
|
|
4
5
|
allEnvKeys,
|
|
@@ -9,7 +10,7 @@ import {
|
|
|
9
10
|
renderEnvLocal,
|
|
10
11
|
renderEnvProduction,
|
|
11
12
|
renderEnvTs
|
|
12
|
-
} from "./index-
|
|
13
|
+
} from "./index-62q6669q.js";
|
|
13
14
|
import {
|
|
14
15
|
MANIFEST_FILE,
|
|
15
16
|
has,
|
|
@@ -1370,7 +1371,7 @@ import color from "picocolors";
|
|
|
1370
1371
|
// package.json
|
|
1371
1372
|
var package_default = {
|
|
1372
1373
|
name: "@saastemly/voidcommerce",
|
|
1373
|
-
version: "0.
|
|
1374
|
+
version: "0.11.0",
|
|
1374
1375
|
description: "Void, with a shop in it. `vc init` walks you through Better Auth, betterCommerce and every plugin; everything else passes through to `void`.",
|
|
1375
1376
|
type: "module",
|
|
1376
1377
|
license: "MIT",
|
|
@@ -2344,6 +2345,8 @@ async function putEnv(root, file, rendered, result) {
|
|
|
2344
2345
|
const match = /^\s*([A-Z][A-Z0-9_]*)\s*=\s*(.*)$/.exec(line2);
|
|
2345
2346
|
if (!match)
|
|
2346
2347
|
return line2;
|
|
2348
|
+
if (MANIFEST_OWNED_ENV.has(match[1]))
|
|
2349
|
+
return line2;
|
|
2347
2350
|
const had = existing.get(match[1]);
|
|
2348
2351
|
return had !== undefined && had !== "" && had !== "unset" ? `${match[1]}=${had}` : line2;
|
|
2349
2352
|
}).join(`
|
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-964eqtx0.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-62q6669q.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.
|
|
3
|
+
"version": "0.11.0",
|
|
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/generate/env.ts
CHANGED
|
@@ -105,6 +105,17 @@ export function renderEnvExample(manifest: Manifest): string {
|
|
|
105
105
|
].join("\n");
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
/**
|
|
109
|
+
* Keys whose value is the MANIFEST'S to decide, not the operator's.
|
|
110
|
+
*
|
|
111
|
+
* These are the shop's identity. Preserving whatever was already on disk is
|
|
112
|
+
* right for a credential and wrong for these: a shop copied from another one
|
|
113
|
+
* kept `SHOP_DOMAIN=tshirt.test` and an EMAIL_FROM at the wrong domain, which
|
|
114
|
+
* is how a storefront ends up quietly addressing the wrong business. If you
|
|
115
|
+
* want a different domain, change the manifest — that is what it is for.
|
|
116
|
+
*/
|
|
117
|
+
export const MANIFEST_OWNED_ENV = new Set(["SHOP_DOMAIN", "SHOP_ZONE", "EMAIL_FROM", "GITHUB_PAGES_HOST"]);
|
|
118
|
+
|
|
108
119
|
export function renderEnvLocal(manifest: Manifest): string {
|
|
109
120
|
const keys = allEnvKeys(manifest);
|
|
110
121
|
const local: Record<string, string> = {
|
package/src/generate/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
envSummary,
|
|
9
9
|
renderEnvExample,
|
|
10
10
|
renderEnvLocal,
|
|
11
|
+
MANIFEST_OWNED_ENV,
|
|
11
12
|
renderEnvProduction,
|
|
12
13
|
renderEnvTs,
|
|
13
14
|
} from "./env";
|
|
@@ -128,6 +129,9 @@ async function putEnv(root: string, file: string, rendered: string, result: Gene
|
|
|
128
129
|
.map((line) => {
|
|
129
130
|
const match = /^\s*([A-Z][A-Z0-9_]*)\s*=\s*(.*)$/.exec(line);
|
|
130
131
|
if (!match) return line;
|
|
132
|
+
// The shop's identity is the manifest's to decide; a value carried
|
|
133
|
+
// over from a shop this one was copied from is not a preference.
|
|
134
|
+
if (MANIFEST_OWNED_ENV.has(match[1]!)) return line;
|
|
131
135
|
const had = existing.get(match[1]!);
|
|
132
136
|
// A real value the operator set beats the template's placeholder.
|
|
133
137
|
// `unset` and empty are placeholders, not answers.
|