@somewhatintelligent/guestlist 0.0.1 → 0.0.2-beta.1783708421.c79dd9f
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/package.json +1 -1
- package/src/codegen.ts +7 -1
- package/src/config.ts +9 -7
- package/src/version.gen.ts +2 -2
package/package.json
CHANGED
package/src/codegen.ts
CHANGED
|
@@ -46,11 +46,17 @@ export function createCodegenAuth<TEnv extends GuestlistEnv>(config: GuestlistCo
|
|
|
46
46
|
// Billing present ⇒ the stripe plugin joins the set, so its tables
|
|
47
47
|
// land in the generated schema. Plan CONTENT is schema-neutral (same
|
|
48
48
|
// subscription table for any plan list); keys are stubs; see module doc.
|
|
49
|
+
// An empty consumer plan list still means "billing schema provisioned"
|
|
50
|
+
// (the runtime factory keeps the plugin dormant on empty plans), so a
|
|
51
|
+
// stub plan keeps the plugin — and its tables — in the generated set.
|
|
49
52
|
stripe: config.billing
|
|
50
53
|
? {
|
|
51
54
|
secretKey: "sk_codegen",
|
|
52
55
|
webhookSecret: "whsec_codegen",
|
|
53
|
-
plans:
|
|
56
|
+
plans:
|
|
57
|
+
config.billing.plans.length > 0
|
|
58
|
+
? config.billing.plans
|
|
59
|
+
: [{ name: "codegen-stub", priceId: "price_codegen" }],
|
|
54
60
|
}
|
|
55
61
|
: undefined,
|
|
56
62
|
});
|
package/src/config.ts
CHANGED
|
@@ -53,13 +53,15 @@ export interface GuestlistConfig<TEnv extends GuestlistEnv = GuestlistEnv> {
|
|
|
53
53
|
blobs?: (env: TEnv) => GuestlistBlobStore;
|
|
54
54
|
/**
|
|
55
55
|
* Stripe subscription billing (better-auth `stripe` plugin). The plugin
|
|
56
|
-
* activates only when this is set AND the env
|
|
57
|
-
* `STRIPE_SECRET_KEY` and `STRIPE_WEBHOOK_SIGNING_SECRET`;
|
|
58
|
-
* is left out of the plugin array entirely (dormant by
|
|
59
|
-
* ids come from the consumer's billing catalog
|
|
60
|
-
* billing
|
|
61
|
-
* table to the generated schema, so
|
|
62
|
-
*
|
|
56
|
+
* activates only when this is set AND `plans` is non-empty AND the env
|
|
57
|
+
* carries both `STRIPE_SECRET_KEY` and `STRIPE_WEBHOOK_SIGNING_SECRET`;
|
|
58
|
+
* otherwise it is left out of the plugin array entirely (dormant by
|
|
59
|
+
* default). Price ids come from the consumer's billing catalog
|
|
60
|
+
* (`@somewhatintelligent/stripe`); billing PRESENCE — not plan count —
|
|
61
|
+
* is what adds the `subscription` table to the generated schema, so
|
|
62
|
+
* `{ plans: [] }` is the supported "provision the billing schema now,
|
|
63
|
+
* declare tiers later" state. Keep this set (or unset) in the codegen
|
|
64
|
+
* config too.
|
|
63
65
|
*/
|
|
64
66
|
billing?: { plans: SubscriptionPlan[] };
|
|
65
67
|
/**
|
package/src/version.gen.ts
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
// values are dev placeholders, identical to the runtime fallbacks.
|
|
3
3
|
export const PKG = {
|
|
4
4
|
name: "@somewhatintelligent/guestlist",
|
|
5
|
-
version: "0.0.
|
|
6
|
-
commit: "
|
|
5
|
+
version: "0.0.2-beta.1783708421.c79dd9f",
|
|
6
|
+
commit: "c79dd9fc1a244f65ff900efab1bb5be5314b2d7f",
|
|
7
7
|
} as const;
|