create-ailk 0.34.1 → 0.36.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/README.md +1 -1
- package/component-catalog.json +37 -4
- package/component-catalog.md +11 -9
- package/dist/add-module.js +7 -2
- package/dist/derive-architecture.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/env-catalog.js +8 -0
- package/dist/module-architecture.js +9 -0
- package/dist/programmatic.js +5 -2
- package/dist/site-listing-path.d.ts +8 -0
- package/dist/site-listing-path.js +8 -0
- package/dist/surfaces.d.ts +20 -0
- package/dist/surfaces.js +32 -3
- package/dist/template-record.js +2 -0
- package/dist/topology.d.ts +4 -4
- package/dist/topology.js +104 -60
- package/dist/update.js +11 -0
- package/package.json +3 -3
- package/templates/.env.example +21 -0
- package/templates/apps/api/.env.example +7 -0
- package/templates/apps/api/CLAUDE.md +14 -9
- package/templates/apps/mcp/CLAUDE.md +18 -7
- package/templates/apps/web/.env.example +16 -0
- package/templates/apps/web/CLAUDE.md +46 -5
- package/templates/apps/web/app/[locale]/(auth)/__tests__/password-reset.test.tsx +2 -0
- package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/page.test.tsx +52 -1
- package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/remembered-method.test.ts +43 -0
- package/templates/apps/web/app/[locale]/(auth)/sign-in/__tests__/sign-in-card.test.tsx +108 -1
- package/templates/apps/web/app/[locale]/(auth)/sign-in/page.tsx +36 -3
- package/templates/apps/web/app/[locale]/(auth)/sign-in/remembered-method.ts +37 -0
- package/templates/apps/web/app/[locale]/(auth)/sign-in/sign-in-card.tsx +90 -33
- package/templates/apps/web/app/[locale]/(auth)/sign-in/sign-in-text.ts +9 -4
- package/templates/apps/web/app/[locale]/(authed)/__tests__/gate.test.tsx +79 -348
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/billing.test.tsx +12 -1
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/hub-mode.test.tsx +55 -2
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/item.test.tsx +43 -0
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout-sign-out.test.tsx +10 -5
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/page.test.tsx +6 -5
- package/templates/apps/web/app/[locale]/(authed)/account/account-frame.tsx +1 -1
- package/templates/apps/web/app/[locale]/(authed)/account/billing/page.tsx +60 -6
- package/templates/apps/web/app/[locale]/(authed)/account/billing-source.ts +32 -3
- package/templates/apps/web/app/[locale]/(authed)/account/connect/__tests__/page.test.tsx +8 -1
- package/templates/apps/web/app/[locale]/(authed)/account/connect/page.tsx +7 -3
- package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/phone-verification.test.tsx +215 -0
- package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/seam-imports.test.ts +65 -0
- package/templates/apps/web/app/[locale]/(authed)/account/general/page.tsx +47 -0
- package/templates/apps/web/app/[locale]/(authed)/account/general/phone-actions.ts +122 -0
- package/templates/apps/web/app/[locale]/(authed)/account/general/phone-verification.tsx +214 -0
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/[kind]/[id]/page.tsx +6 -1
- package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/invitation-id.test.ts +35 -0
- package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/page.test.tsx +266 -0
- package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/actions.ts +116 -0
- package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/invitation-id.ts +12 -0
- package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/page.tsx +154 -0
- package/templates/apps/web/app/[locale]/(authed)/account/layout.tsx +6 -4
- package/templates/apps/web/app/[locale]/(authed)/account/security/page.tsx +3 -1
- package/templates/apps/web/app/[locale]/(authed)/layout.tsx +15 -13
- package/templates/apps/web/app/[locale]/(authed)/signed-out-gate.generated.tsx +20 -52
- package/templates/apps/web/app/[locale]/flows/[slug]/FlowStepperClient.tsx +43 -4
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.deliverable.test.tsx +23 -9
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.invite.test.tsx +15 -0
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.permalink.test.tsx +74 -0
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.test.tsx +34 -1
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/magnet-page.test.tsx +257 -4
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/save.actions.test.ts +72 -92
- package/templates/apps/web/app/[locale]/flows/[slug]/email-moment.ts +2 -2
- package/templates/apps/web/app/[locale]/flows/[slug]/magnet-page.tsx +164 -65
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/LevelChart.tsx +100 -0
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsCard.tsx +99 -0
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsClient.tsx +415 -253
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsEmailStep.tsx +113 -32
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.no-commerce.test.tsx +16 -17
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.report.test.tsx +284 -0
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/by-result.test.tsx +52 -19
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/cards.test.tsx +402 -0
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/page.test.tsx +100 -12
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/score.test.tsx +153 -101
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/meeting-seam.ts +36 -0
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/page.tsx +121 -33
- package/templates/apps/web/app/[locale]/flows/[slug]/save.actions.ts +27 -17
- package/templates/apps/web/app/[locale]/flows/[slug]/served-flow.ts +91 -0
- package/templates/apps/web/app/[locale]/layout.tsx +42 -76
- package/templates/apps/web/app/[locale]/purchase/__tests__/success.test.tsx +50 -0
- package/templates/apps/web/app/[locale]/purchase/success/page.tsx +48 -7
- package/templates/apps/web/app/api/auth/hub/__tests__/entry-routes.test.ts +749 -0
- package/templates/apps/web/app/api/auth/hub/authorize/__tests__/route.test.ts +189 -6
- package/templates/apps/web/app/api/auth/hub/authorize/route.ts +101 -31
- package/templates/apps/web/app/api/auth/hub/continuation.ts +51 -2
- package/templates/apps/web/app/api/auth/hub/email/route.ts +111 -0
- package/templates/apps/web/app/api/auth/hub/entry-shared.ts +163 -0
- package/templates/apps/web/app/api/auth/hub/purchase/route.ts +230 -0
- package/templates/apps/web/app/api/auth/hub/purchase-link/route.ts +174 -0
- package/templates/apps/web/app/api/auth/hub/sign-up/route.ts +60 -0
- package/templates/apps/web/app/api/auth/hub/sign-up-evidence.ts +97 -0
- package/templates/apps/web/app/api/hub-session/__tests__/routes.test.ts +475 -7
- package/templates/apps/web/app/api/hub-session/callback/route.ts +13 -47
- package/templates/apps/web/app/api/hub-session/email/route.ts +125 -0
- package/templates/apps/web/app/api/hub-session/one-tap/nonce/route.ts +49 -0
- package/templates/apps/web/app/api/hub-session/one-tap/route.ts +106 -0
- package/templates/apps/web/app/api/hub-session/open/route.ts +111 -0
- package/templates/apps/web/app/api/hub-session/sign-in/route.ts +23 -40
- package/templates/apps/web/app/api/hub-session/sign-out/route.ts +1 -10
- package/templates/apps/web/app/llms.txt/__tests__/site-listing.test.ts +122 -0
- package/templates/apps/web/app/llms.txt/route.ts +14 -2
- package/templates/apps/web/app/sitemap.xml/__tests__/site-listing.test.ts +98 -0
- package/templates/apps/web/app/sitemap.xml/route.ts +13 -2
- package/templates/apps/web/auth.ts +133 -6
- package/templates/apps/web/components/sign-out-trigger.tsx +1 -1
- package/templates/apps/web/lib/__tests__/auth-email.test.ts +141 -0
- package/templates/apps/web/lib/__tests__/auth-phone.test.ts +445 -0
- package/templates/apps/web/lib/__tests__/auth-sms.test.ts +140 -0
- package/templates/apps/web/lib/__tests__/fixtures/tsconfig.flow.json +18 -0
- package/templates/apps/web/lib/__tests__/site-header.test.ts +13 -0
- package/templates/apps/web/lib/__tests__/telemetry-scrub.test.ts +19 -1
- package/templates/apps/web/lib/account-config.ts +24 -9
- package/templates/apps/web/lib/auth-email.ts +62 -6
- package/templates/apps/web/lib/auth-env.ts +13 -0
- package/templates/apps/web/lib/auth-sms.ts +180 -0
- package/templates/apps/web/lib/hub-session/__tests__/hub-session.test.ts +28 -0
- package/templates/apps/web/lib/hub-session/__tests__/spoke-sign-in.test.tsx +332 -0
- package/templates/apps/web/lib/hub-session/config.ts +7 -1
- package/templates/apps/web/lib/hub-session/entry.ts +238 -0
- package/templates/apps/web/lib/hub-session/index.ts +1 -4
- package/templates/apps/web/lib/hub-session/one-tap.tsx +148 -0
- package/templates/apps/web/lib/hub-session/session.ts +120 -2
- package/templates/apps/web/lib/hub-session/spoke-sign-in.tsx +277 -0
- package/templates/apps/web/lib/site-header.ts +14 -1
- package/templates/apps/web/lib/site-listing.ts +7 -0
- package/templates/apps/web/lib/telemetry-scrub.ts +11 -0
- package/templates/apps/web/lib/topology.generated.ts +39 -0
- package/templates/apps/web/messages/en.json +125 -21
- package/templates/apps/web/middleware.ts +34 -2
- package/templates/apps/web/security-headers.config.ts +21 -0
- package/versions.json +47 -47
- package/templates/apps/web/app/[locale]/(authed)/sign-in-gate.tsx +0 -162
- package/templates/apps/web/components/signed-in-nav.tsx +0 -79
- package/templates/apps/web/lib/hub-session/__tests__/sign-in-gate.test.tsx +0 -180
- package/templates/apps/web/lib/hub-session/sign-in-gate.tsx +0 -162
package/dist/topology.js
CHANGED
|
@@ -90,8 +90,8 @@ export const SPOKE_EXCLUDED_MODULE_PATHS = [
|
|
|
90
90
|
* The `(authed)` seeds of the sign-in-through-the-hub mode (#7894 D9): the
|
|
91
91
|
* whole `(authed)` group goes in the default mode; in the hub mode its account
|
|
92
92
|
* area, layout and gate seam stay, and only these go — the operator surfaces,
|
|
93
|
-
* the
|
|
94
|
-
*
|
|
93
|
+
* the hub's own consent page (#9966 D2, a 404 on a spoke) and the suites that
|
|
94
|
+
* mock `auth.ts` by path.
|
|
95
95
|
*/
|
|
96
96
|
export const HUB_MODE_AUTHED_SEEDS = [
|
|
97
97
|
"apps/web/app/[locale]/(authed)/__tests__",
|
|
@@ -102,7 +102,6 @@ export const HUB_MODE_AUTHED_SEEDS = [
|
|
|
102
102
|
"apps/web/app/[locale]/(authed)/edit",
|
|
103
103
|
"apps/web/app/[locale]/(authed)/leads",
|
|
104
104
|
"apps/web/app/[locale]/(authed)/waitlist",
|
|
105
|
-
"apps/web/app/[locale]/(authed)/sign-in-gate.tsx",
|
|
106
105
|
];
|
|
107
106
|
/** The default mode's one `(authed)` seed, which the hub mode replaces. */
|
|
108
107
|
const AUTHED_SEED = "apps/web/app/[locale]/(authed)";
|
|
@@ -301,7 +300,10 @@ const WEB_SEAM_HEADER = `// topology.generated.ts — how this site reads a sess
|
|
|
301
300
|
// loadSpokeBilling reaches the spoke billing action only on a spoke that
|
|
302
301
|
// signs in through its hub and carries commerce (#8217); elsewhere, null.
|
|
303
302
|
// readOwnAccounts lists the signed-in person's own sign-in accounts through
|
|
304
|
-
// Better Auth on a hub (#8431); a spoke has none here, so it answers null
|
|
303
|
+
// Better Auth on a hub (#8431); a spoke has none here, so it answers null.
|
|
304
|
+
// readPhoneStep and loadPhoneApi read and write the account's phone step
|
|
305
|
+
// through Better Auth on a hub (#11138); a spoke's hub holds the person, so
|
|
306
|
+
// both answer null.`;
|
|
305
307
|
const MCP_SEAM_HEADER = `// topology.generated.ts — how this MCP server resolves its workspace store.
|
|
306
308
|
//
|
|
307
309
|
// GENERATED by create-ailk for this site's topology (#7426). Do not edit:
|
|
@@ -351,6 +353,70 @@ function ownAccountsReader(topology) {
|
|
|
351
353
|
return Promise.resolve(null);
|
|
352
354
|
}`;
|
|
353
355
|
}
|
|
356
|
+
/**
|
|
357
|
+
* The phone step's types (#11106 D9): its state, and the plugin's three calls.
|
|
358
|
+
* Function-typed properties, not methods, so the hub's `auth.api` assignment
|
|
359
|
+
* is checked strictly: a Better Auth change to these endpoints fails `tsc`.
|
|
360
|
+
*/
|
|
361
|
+
const PHONE_STEP_TYPES = `export type PhoneStep = {
|
|
362
|
+
available: boolean;
|
|
363
|
+
phone: { number: string; verified: boolean } | null;
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
export type PhoneApi = {
|
|
367
|
+
sendPhoneNumberOTP: (input: { body: { phoneNumber: string }; headers: Headers }) => Promise<unknown>;
|
|
368
|
+
verifyPhoneNumber: (input: {
|
|
369
|
+
body: { phoneNumber: string; code: string; updatePhoneNumber: boolean };
|
|
370
|
+
headers: Headers;
|
|
371
|
+
}) => Promise<unknown>;
|
|
372
|
+
updateUser: (input: { body: { phoneNumber: null }; headers: Headers }) => Promise<unknown>;
|
|
373
|
+
};`;
|
|
374
|
+
/**
|
|
375
|
+
* The account General page's phone step (#11138): `readPhoneStep` is the
|
|
376
|
+
* page's read — whether the phone plugin is installed, and the person's
|
|
377
|
+
* number — and `loadPhoneApi` the actions' writes, Better Auth's phone
|
|
378
|
+
* endpoints when the build turns the step on. The hub render loads `auth.ts`
|
|
379
|
+
* only when one is called; a spoke's hub holds the person, so its renders
|
|
380
|
+
* answer `null` — no phone step, and every action `unavailable` — and import
|
|
381
|
+
* nothing.
|
|
382
|
+
*/
|
|
383
|
+
function phoneStep(topology) {
|
|
384
|
+
if (topology === "hub") {
|
|
385
|
+
return `${PHONE_STEP_TYPES}
|
|
386
|
+
|
|
387
|
+
export async function readPhoneStep(headers: Headers): Promise<PhoneStep | null> {
|
|
388
|
+
const { auth } = await import("../auth");
|
|
389
|
+
// Whether the phone plugin is installed on this instance (#11106 D9).
|
|
390
|
+
const api: object = auth.api;
|
|
391
|
+
const available = "sendPhoneNumberOTP" in api;
|
|
392
|
+
if (!available) return { available, phone: null };
|
|
393
|
+
const session = await auth.api.getSession({ headers });
|
|
394
|
+
// The plugin's two user fields, which the conditional install leaves out
|
|
395
|
+
// of the inferred session type.
|
|
396
|
+
const user = (session?.user ?? {}) as { phoneNumber?: unknown; phoneNumberVerified?: unknown };
|
|
397
|
+
const phone =
|
|
398
|
+
typeof user.phoneNumber === "string" && user.phoneNumber !== ""
|
|
399
|
+
? { number: user.phoneNumber, verified: user.phoneNumberVerified === true }
|
|
400
|
+
: null;
|
|
401
|
+
return { available, phone };
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export async function loadPhoneApi(): Promise<PhoneApi | null> {
|
|
405
|
+
const { auth, phoneStepActive } = await import("../auth");
|
|
406
|
+
return phoneStepActive() ? auth.api : null;
|
|
407
|
+
}`;
|
|
408
|
+
}
|
|
409
|
+
return `${PHONE_STEP_TYPES}
|
|
410
|
+
|
|
411
|
+
export function readPhoneStep(headers: Headers): Promise<PhoneStep | null> {
|
|
412
|
+
void headers;
|
|
413
|
+
return Promise.resolve(null);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
export function loadPhoneApi(): Promise<PhoneApi | null> {
|
|
417
|
+
return Promise.resolve(null);
|
|
418
|
+
}`;
|
|
419
|
+
}
|
|
354
420
|
/** The sign-in exports every web seam render carries (#7894 D8). */
|
|
355
421
|
function signInExports(values) {
|
|
356
422
|
const literal = (value) => value === null ? "null" : JSON.stringify(value);
|
|
@@ -432,6 +498,8 @@ export async function readSession(headers: Headers): Promise<SiteSession> {
|
|
|
432
498
|
|
|
433
499
|
${ownAccountsReader("hub")}
|
|
434
500
|
|
|
501
|
+
${phoneStep("hub")}
|
|
502
|
+
|
|
435
503
|
export async function registerSiteStores(): Promise<void> {
|
|
436
504
|
const { registerLicenseKeyStore } = await import("./license-key-store");
|
|
437
505
|
await registerLicenseKeyStore();
|
|
@@ -456,6 +524,8 @@ export function readSession(headers: Headers): Promise<SiteSession> {
|
|
|
456
524
|
|
|
457
525
|
${ownAccountsReader("spoke")}
|
|
458
526
|
|
|
527
|
+
${phoneStep("spoke")}
|
|
528
|
+
|
|
459
529
|
export function registerSiteStores(): Promise<void> {
|
|
460
530
|
return Promise.resolve();
|
|
461
531
|
}
|
|
@@ -478,6 +548,8 @@ export function readSession(headers: Headers): Promise<SiteSession> {
|
|
|
478
548
|
|
|
479
549
|
${ownAccountsReader("spoke")}
|
|
480
550
|
|
|
551
|
+
${phoneStep("spoke")}
|
|
552
|
+
|
|
481
553
|
export function registerSiteStores(): Promise<void> {
|
|
482
554
|
return Promise.resolve();
|
|
483
555
|
}
|
|
@@ -488,9 +560,10 @@ ${spokeBillingLoader(false)}
|
|
|
488
560
|
const AUTHED_GATE_SEAM_HEADER = `// signed-out-gate.generated.tsx — what the (authed) group shows a signed-out visitor.
|
|
489
561
|
//
|
|
490
562
|
// GENERATED by create-ailk for this site's topology and sign-in mode (#7894).
|
|
491
|
-
// Do not edit: every scaffold rewrites it. A hub
|
|
492
|
-
//
|
|
493
|
-
// through its hub (\`--hub-sign-in\`)
|
|
563
|
+
// Do not edit: every scaffold rewrites it. A hub redirects to its own
|
|
564
|
+
// /sign-in (an account path with no sign-in method on says so in place); a
|
|
565
|
+
// spoke that signs in through its hub (\`--hub-sign-in\`) redirects to its
|
|
566
|
+
// hub-session sign-in route.`;
|
|
494
567
|
/**
|
|
495
568
|
* The packages the gate seam imports. Interpolated, not written inline, for
|
|
496
569
|
* the reason `CONTENT_ADAPTERS_PACKAGE` below is.
|
|
@@ -498,6 +571,7 @@ const AUTHED_GATE_SEAM_HEADER = `// signed-out-gate.generated.tsx — what the (
|
|
|
498
571
|
const UI_PACKAGE = "@working-theory/ui";
|
|
499
572
|
const WEB_I18N_PACKAGE = "@working-theory/web-i18n";
|
|
500
573
|
const NEXT_INTL_SERVER = "next-intl/server";
|
|
574
|
+
const NEXT_NAVIGATION = "next/navigation";
|
|
501
575
|
const REACT_PACKAGE = "react";
|
|
502
576
|
const AUTHED_GATE_PROPS = `export interface SignedOutGateProps {
|
|
503
577
|
locale: string;
|
|
@@ -506,8 +580,8 @@ const AUTHED_GATE_PROPS = `export interface SignedOutGateProps {
|
|
|
506
580
|
}`;
|
|
507
581
|
/**
|
|
508
582
|
* `apps/web/app/[locale]/(authed)/signed-out-gate.generated.tsx` (#7894 D8).
|
|
509
|
-
* The hub render
|
|
510
|
-
*
|
|
583
|
+
* The hub render redirects to `/sign-in` (#11095 D3); the `signIn: "hub"`
|
|
584
|
+
* render is the spoke's own sign-in form, `SpokeSignIn` (#11096 D1). A default-mode
|
|
511
585
|
* spoke carries no `(authed)` group, so it has no render.
|
|
512
586
|
* @throws TopologyError for a spoke in the default mode.
|
|
513
587
|
*/
|
|
@@ -516,20 +590,16 @@ export function renderAuthedGateSeam(topology, signIn = "off") {
|
|
|
516
590
|
return `${AUTHED_GATE_SEAM_HEADER}
|
|
517
591
|
import { localeHref } from "${UI_PACKAGE}";
|
|
518
592
|
import { Button, Heading, Link, Text } from "${UI_PACKAGE}/primitives";
|
|
519
|
-
import type { AuthPanelProvider } from "${UI_PACKAGE}/sections";
|
|
520
593
|
import { readLocales } from "${WEB_I18N_PACKAGE}";
|
|
594
|
+
import { redirect } from "${NEXT_NAVIGATION}";
|
|
521
595
|
import { getTranslations } from "${NEXT_INTL_SERVER}";
|
|
522
596
|
import type { ReactElement } from "${REACT_PACKAGE}";
|
|
523
597
|
|
|
524
|
-
import { legalFootnote } from "../(auth)/legal-footnote";
|
|
525
|
-
import { resolveSignInCardText } from "../(auth)/sign-in/sign-in-text";
|
|
526
598
|
import { getActiveProviderIds } from "../../../lib/auth-env";
|
|
527
599
|
import { isAccountPath } from "../../../lib/auth-routes";
|
|
528
|
-
import { siteLogo } from "../../../lib/site-logo";
|
|
529
600
|
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
const SUPPORTED_PROVIDERS: readonly AuthPanelProvider[] = ["google", "github"];
|
|
601
|
+
/** The methods a member signs in with on /sign-in's card. */
|
|
602
|
+
const MEMBER_METHODS: readonly string[] = ["google", "github", "magic-link"];
|
|
533
603
|
|
|
534
604
|
${AUTHED_GATE_PROPS}
|
|
535
605
|
|
|
@@ -537,23 +607,17 @@ export async function SignedOutGate({
|
|
|
537
607
|
locale,
|
|
538
608
|
requestHeaders,
|
|
539
609
|
}: SignedOutGateProps): Promise<ReactElement> {
|
|
540
|
-
// No \`x-pathname\`, no locale read: a render outside the middleware
|
|
541
|
-
// the
|
|
610
|
+
// No \`x-pathname\`, no locale read: a render outside the middleware
|
|
611
|
+
// redirects to the bare /sign-in without touching the locale config.
|
|
542
612
|
const pathname = requestHeaders.get("x-pathname");
|
|
543
613
|
const isAccount =
|
|
544
614
|
pathname !== null && isAccountPath(pathname, readLocales());
|
|
545
|
-
const
|
|
546
|
-
|
|
547
|
-
namespace: isAccount ? "account.gate" : "waitlistDashboard.gate",
|
|
548
|
-
});
|
|
549
|
-
const active = getActiveProviderIds();
|
|
550
|
-
const emailLink = active.includes("magic-link");
|
|
551
|
-
const providers = active.filter((id): id is AuthPanelProvider =>
|
|
552
|
-
(SUPPORTED_PROVIDERS as readonly string[]).includes(id),
|
|
615
|
+
const hasMemberMethod = getActiveProviderIds().some((id) =>
|
|
616
|
+
MEMBER_METHODS.includes(id),
|
|
553
617
|
);
|
|
554
|
-
const signInPath = localeHref(locale, "/sign-in");
|
|
555
618
|
|
|
556
|
-
if (isAccount &&
|
|
619
|
+
if (isAccount && !hasMemberMethod) {
|
|
620
|
+
const t = await getTranslations({ locale, namespace: "account.gate" });
|
|
557
621
|
return (
|
|
558
622
|
<div
|
|
559
623
|
className="flex min-h-screen flex-col items-center justify-center gap-4 py-section text-center"
|
|
@@ -581,36 +645,13 @@ export async function SignedOutGate({
|
|
|
581
645
|
);
|
|
582
646
|
}
|
|
583
647
|
|
|
584
|
-
//
|
|
585
|
-
//
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
text,
|
|
592
|
-
emailLink,
|
|
593
|
-
...(isAccount
|
|
594
|
-
? {
|
|
595
|
-
logo: siteLogo(),
|
|
596
|
-
prospect: { ...text.prospect, href: localeHref(locale, "/sign-up") },
|
|
597
|
-
footnote: legalFootnote(locale, text.acknowledgement),
|
|
598
|
-
}
|
|
599
|
-
: {}),
|
|
600
|
-
}
|
|
601
|
-
: undefined;
|
|
602
|
-
|
|
603
|
-
return (
|
|
604
|
-
<SignInGate
|
|
605
|
-
labels={{
|
|
606
|
-
emptyHeadline: t("emptyHeadline"),
|
|
607
|
-
emptyDescription: t("emptyDescription"),
|
|
608
|
-
signInLinkLabel: t("signInLink"),
|
|
609
|
-
}}
|
|
610
|
-
signInPath={signInPath}
|
|
611
|
-
providers={providers}
|
|
612
|
-
{...(card ? { card } : {})}
|
|
613
|
-
/>
|
|
648
|
+
// Every other signed-out render is a redirect to the sign-in card, with the
|
|
649
|
+
// requested path as \`next\` (#11095 D3): \`/sign-in\` sanitizes it.
|
|
650
|
+
const signInPath = localeHref(locale, "/sign-in");
|
|
651
|
+
redirect(
|
|
652
|
+
pathname === null
|
|
653
|
+
? signInPath
|
|
654
|
+
: \`\${signInPath}?next=\${encodeURIComponent(pathname)}\`,
|
|
614
655
|
);
|
|
615
656
|
}
|
|
616
657
|
`;
|
|
@@ -621,15 +662,18 @@ export async function SignedOutGate({
|
|
|
621
662
|
return `${AUTHED_GATE_SEAM_HEADER}
|
|
622
663
|
import type { ReactElement } from "${REACT_PACKAGE}";
|
|
623
664
|
|
|
624
|
-
import {
|
|
665
|
+
import { SpokeSignIn } from "../../../lib/hub-session";
|
|
625
666
|
|
|
626
667
|
${AUTHED_GATE_PROPS}
|
|
627
668
|
|
|
669
|
+
// The spoke's own sign-in form (#11096 D1): email, the hub's agreements and
|
|
670
|
+
// Google, posted to this site's own routes. The person never sees the hub's
|
|
671
|
+
// brand; every hub hop after it is a redirect.
|
|
628
672
|
export function SignedOutGate({
|
|
629
673
|
locale,
|
|
630
674
|
requestHeaders,
|
|
631
675
|
}: SignedOutGateProps): Promise<ReactElement> {
|
|
632
|
-
return
|
|
676
|
+
return SpokeSignIn({ locale, requestHeaders });
|
|
633
677
|
}
|
|
634
678
|
`;
|
|
635
679
|
}
|
package/dist/update.js
CHANGED
|
@@ -62,6 +62,7 @@ import { escapeBareBraces, findBareBraces } from "./mdx-braces.js";
|
|
|
62
62
|
import { MODULE_SLICES } from "./module-architecture.js";
|
|
63
63
|
import { MODULE_FLAGS_PATH, PAID_MCP_TOOLS_PATH, writeModuleFlags, writePaidMcpTools, } from "./paid-sections.js";
|
|
64
64
|
import { ParseError } from "./parse-args.js";
|
|
65
|
+
import { SITE_LISTING_PATH } from "./site-listing-path.js";
|
|
65
66
|
import { SITE_ROSTER_PATH, planServedRoster, readRosterPageRoutes } from "./site-roster.js";
|
|
66
67
|
import { SPOKE_CHECKOUT_TEMPLATE_PATHS } from "./spoke-checkout.js";
|
|
67
68
|
import { GATEABLE_SURFACES, excludedRoutePaths, isRemovedPublicRoutePath, resolveSurfaces, surfacesNamedByRoutes, } from "./surfaces.js";
|
|
@@ -1539,6 +1540,16 @@ export async function updateSite(opts) {
|
|
|
1539
1540
|
moved.added.push(MODULE_FLAGS_PATH);
|
|
1540
1541
|
else if (flags === "updated")
|
|
1541
1542
|
moved.updated.push(MODULE_FLAGS_PATH);
|
|
1543
|
+
// #10940 D5 — the site's listing is site-owned (REGENERATED_APP_PATHS):
|
|
1544
|
+
// written only when absent, so a site updated onto routes that import it
|
|
1545
|
+
// builds; a present one is never read or written.
|
|
1546
|
+
const listingAbs = join(targetDir, ...SITE_LISTING_PATH.split("/"));
|
|
1547
|
+
const listingBytes = runningRaw.get(SITE_LISTING_PATH);
|
|
1548
|
+
if (!existsSync(listingAbs) && listingBytes !== undefined) {
|
|
1549
|
+
mkdirSync(dirname(listingAbs), { recursive: true });
|
|
1550
|
+
writeFileSync(listingAbs, renderTemplateFile(listingBytes, SITE_LISTING_PATH, {}, markersForVersion(record.projectName, version)));
|
|
1551
|
+
moved.added.push(SITE_LISTING_PATH);
|
|
1552
|
+
}
|
|
1542
1553
|
// #9567 — the MCP move's writes, then the paid MCP tool registry from the
|
|
1543
1554
|
// site's own apps/mcp/package.json on every run (REGENERATED_APP_PATHS,
|
|
1544
1555
|
// #9460 DD6) — after the move, so a pack the move declared is a row.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-ailk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "Scaffolder for AI Launch Kit — `pnpm create ailk@latest <dir>` produces a starter repo consuming @working-theory/* from npm (per ADR 0007).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"tar": "^7.5.21"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@working-theory/schema": "0.
|
|
32
|
-
"@working-theory/templates": "0.
|
|
31
|
+
"@working-theory/schema": "0.60.0",
|
|
32
|
+
"@working-theory/templates": "0.60.0"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
package/templates/.env.example
CHANGED
|
@@ -202,6 +202,27 @@ CONTENT_ADAPTER=mdx
|
|
|
202
202
|
# default.
|
|
203
203
|
# RESEND_AUDIENCE_ID=
|
|
204
204
|
#
|
|
205
|
+
# ── Text messages (Twilio, apps/api) ─────────────────────────────────────────
|
|
206
|
+
# Phone verification (#11106 D9): a signed-in person sets and verifies a phone
|
|
207
|
+
# on the hub's Account page. apps/web's phone plugin signs one body with
|
|
208
|
+
# AUTH_EMAIL_WEBHOOK_SECRET and POSTs it to apps/api's
|
|
209
|
+
# /v1/auth/transactional-sms, which texts one fixed message ("Your
|
|
210
|
+
# verification code is …") through Twilio's Messages API. With any of the
|
|
211
|
+
# three unset the relay answers 503 sms_not_configured and no text is sent.
|
|
212
|
+
# Budgets (fail closed): 3 per number per hour, 5 per user per day, 200 per
|
|
213
|
+
# deployment per hour.
|
|
214
|
+
# TWILIO_ACCOUNT_SID=
|
|
215
|
+
# TWILIO_AUTH_TOKEN=
|
|
216
|
+
# TWILIO_FROM_NUMBER=
|
|
217
|
+
#
|
|
218
|
+
# The calling codes a code may be texted to, comma-separated (default "1").
|
|
219
|
+
# Read by BOTH apps: apps/web refuses any other number before a code exists,
|
|
220
|
+
# and the apps/api relay re-checks it — set the same value on both.
|
|
221
|
+
# Calling code 1 covers the whole North American Numbering Plan, Caribbean
|
|
222
|
+
# premium-rate destinations included: turn on Twilio's Geo Permissions (US and
|
|
223
|
+
# Canada only) and its SMS pumping protection for the sending account.
|
|
224
|
+
# AILK_SMS_COUNTRY_CODES=1
|
|
225
|
+
#
|
|
205
226
|
# Request-and-confirm (#5970) — the callback request a site owner confirms by
|
|
206
227
|
# an emailed link, which mints a Stripe Payment Link for the customer to pay
|
|
207
228
|
# on. Off by default: with the flag unset the callback route behaves exactly as
|
|
@@ -21,6 +21,13 @@ FRONTEND_URL=http://localhost:3000
|
|
|
21
21
|
# trust — list only origins the deployment owner operates.
|
|
22
22
|
# AILK_TRUSTED_ORIGINS=https://admin.your-domain.com,https://spoke.example
|
|
23
23
|
|
|
24
|
+
# Google One Tap on a hub's spokes (#11096 D10), off by default: the hub's own
|
|
25
|
+
# Google OAuth client id. Set, POST /v1/hub-sign-in/google verifies a spoke's
|
|
26
|
+
# One Tap ID token against Google's keys with this as its audience, and client
|
|
27
|
+
# info names it to the spoke. List each One Tap spoke's origin on that Google
|
|
28
|
+
# client's authorized JavaScript origins. Unset: the route answers 404.
|
|
29
|
+
# AILK_GOOGLE_ONE_TAP_CLIENT_ID=
|
|
30
|
+
|
|
24
31
|
# =============================================================================
|
|
25
32
|
# MCP OAuth issuer (#10912)
|
|
26
33
|
# =============================================================================
|