@somewhatintelligent/guestlist 0.0.1 → 0.0.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@somewhatintelligent/guestlist",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "publishConfig": {
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: config.billing.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 carries both
57
- * `STRIPE_SECRET_KEY` and `STRIPE_WEBHOOK_SIGNING_SECRET`; otherwise it
58
- * is left out of the plugin array entirely (dormant by default). Price
59
- * ids come from the consumer's billing catalog (`@somewhatintelligent/stripe`);
60
- * billing presence — not plan count — is what adds the `subscription`
61
- * table to the generated schema, so keep this set (or unset) in the
62
- * codegen config too.
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
  /**
@@ -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.1",
6
- commit: "887706f26e37bcf6295d5840f99a7e38e757a366",
5
+ version: "0.0.2",
6
+ commit: "73a4a5eca0d1535e049eff82648c4c2a68640af2",
7
7
  } as const;