@usethrottle/create-store 0.0.0-stage → 0.2.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/CLAUDE.md +48 -0
- package/README.md +29 -2
- package/dist/index.js +445 -0
- package/dist/index.js.map +1 -0
- package/package.json +49 -3
- package/template/.env.local.tmpl +11 -0
- package/template/.gitignore.tmpl +7 -0
- package/template/AGENTS.md +25 -0
- package/template/README.md +79 -0
- package/template/app/account/page.tsx +7 -0
- package/template/app/api/throttle/revalidate/route.ts +5 -0
- package/template/app/api/throttle/sync/route.ts +9 -0
- package/template/app/c/[handle]/page.tsx +7 -0
- package/template/app/collections/[handle]/page.tsx +7 -0
- package/template/app/layout.tsx +16 -0
- package/template/app/not-found.tsx +5 -0
- package/template/app/p/[handle]/page.tsx +11 -0
- package/template/app/page.tsx +2 -0
- package/template/app/providers.tsx +22 -0
- package/template/app/search/page.tsx +11 -0
- package/template/app/shop/page.tsx +7 -0
- package/template/app/tags/[tag]/page.tsx +7 -0
- package/template/lib/store.ts +19 -0
- package/template/next.config.ts +9 -0
- package/template/package.json.tmpl +22 -0
- package/template/proxy.ts +14 -0
- package/template/tsconfig.json +20 -0
- package/template-builder-build/.env.local.tmpl.append +11 -0
- package/template-builder-build/.gitignore.tmpl.append +3 -0
- package/template-builder-build/AGENTS.md.append +16 -0
- package/template-builder-build/README.md.append +49 -0
- package/template-builder-build/app/layout.tsx +36 -0
- package/template-builder-build/app/pages/[handle]/page.tsx +26 -0
- package/template-builder-build/app/providers.tsx +31 -0
- package/template-builder-build/app/sitemap.ts +10 -0
- package/template-builder-build/lib/builder.ts +75 -0
- package/template-builder-build/lib/packs.ts +9 -0
- package/template-builder-build/next.config.ts +61 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/pm.ts","../src/args.ts","../src/catalog-key.ts","../src/keys.ts","../src/prompt.ts","../src/scaffold.ts","../../auth-sdk/package.json","../../builder/package.json","../../builder-react/package.json","../../builder-schema/package.json","../../storefront-react/package.json","../../ui/package.json","../src/versions.ts"],"sourcesContent":["/* eslint-disable no-console -- a CLI talks to the terminal */\nimport { spawn } from 'node:child_process';\nimport { relative, resolve } from 'node:path';\nimport { parseArgs, USAGE } from './args';\nimport { classifyCatalogKey } from './catalog-key';\nimport { resolveKeys } from './keys';\nimport { detectPackageManager, installCommand, runScript } from './pm';\nimport { askCatalogKey } from './prompt';\nimport { scaffold } from './scaffold';\nimport { BUILD_MODE_VERSIONS, TEMPLATE_VERSIONS } from './versions';\n\nconst fail = (message: string): never => {\n console.error(`create-store: ${message}`);\n process.exit(1);\n};\n\nfunction install(pm: ReturnType<typeof detectPackageManager>, cwd: string): Promise<boolean> {\n const { command, args } = installCommand(pm);\n return new Promise((done) => {\n const child = spawn(command, args, { cwd, stdio: 'inherit', shell: process.platform === 'win32' });\n child.on('error', () => done(false));\n child.on('exit', (code) => done(code === 0));\n });\n}\n\nasync function main(): Promise<void> {\n let args;\n try {\n args = parseArgs(process.argv.slice(2));\n } catch (error) {\n console.error(`create-store: ${error instanceof Error ? error.message : 'bad arguments'}\\n\\n${USAGE}`);\n process.exit(1);\n }\n if (args.help) {\n console.log(USAGE);\n return;\n }\n\n let keys;\n try {\n keys = await resolveKeys(args, {\n classify: (key) => classifyCatalogKey(key),\n ask: askCatalogKey,\n });\n } catch (error) {\n return fail(error instanceof Error ? error.message : 'Could not settle the catalog keys.');\n }\n for (const note of keys.notes) console.warn(`create-store: ${note}`);\n\n let written: string[];\n try {\n written = await scaffold({\n dir: args.dir,\n catalogKey: keys.browserKey,\n ...(keys.serverKey ? { serverKey: keys.serverKey } : {}),\n builderMode: args.builderMode,\n versions: args.builderMode === 'build' ? { ...TEMPLATE_VERSIONS, ...BUILD_MODE_VERSIONS } : TEMPLATE_VERSIONS,\n });\n } catch (error) {\n return fail(error instanceof Error ? error.message : 'Could not write the store.');\n }\n const target = resolve(args.dir);\n console.log(`Created ${written.length} files in ${target}`);\n\n const pm = args.pm ?? detectPackageManager(process.env.npm_config_user_agent);\n if (!args.skipInstall) {\n console.log(`Installing with ${pm}...`);\n if (!(await install(pm, target))) console.warn(`create-store: ${pm} install did not finish. Run it yourself in the folder.`);\n }\n\n const rel = relative(process.cwd(), target) || '.';\n const cd = rel.startsWith('..') ? target : rel;\n console.log(`\\nNext:\\n cd ${cd}\\n${args.skipInstall ? ` ${pm} install\\n` : ''} ${runScript(pm, 'dev')}\\n\\nRead README.md for how the store stays cheap on Vercel before you deploy.`);\n}\n\nmain().catch((error: unknown) => {\n console.error(`create-store: ${error instanceof Error ? error.message : String(error)}`);\n process.exit(1);\n});\n","export type PackageManager = 'pnpm' | 'npm' | 'yarn' | 'bun';\n\nconst MANAGERS: readonly PackageManager[] = ['pnpm', 'npm', 'yarn', 'bun'];\n\n/** The manager that ran `create-store`, from `npm_config_user_agent` (`'pnpm/9.15.4 npm/? node/v20'` is pnpm). Unknown: npm. */\nexport function detectPackageManager(userAgent: string | undefined): PackageManager {\n const name = userAgent?.trim().split(/[\\s/]/u)[0];\n return MANAGERS.find((pm) => pm === name) ?? 'npm';\n}\n\nexport function isPackageManager(value: string): value is PackageManager {\n return (MANAGERS as readonly string[]).includes(value);\n}\n\n/** The command and arguments that install a project's dependencies. */\nexport function installCommand(pm: PackageManager): { command: string; args: string[] } {\n return { command: pm, args: ['install'] };\n}\n\n/** The command a user types to run a package script (`dev`). */\nexport function runScript(pm: PackageManager, script: string): string {\n return pm === 'npm' ? `npm run ${script}` : `${pm} ${script}`;\n}\n","import { isPackageManager, type PackageManager } from './pm';\n\nexport const BUILDER_MODES = ['live', 'build'] as const;\nexport type BuilderMode = (typeof BUILDER_MODES)[number];\n\nexport type Args = {\n dir: string;\n catalogKey?: string;\n serverKey?: string;\n yes: boolean;\n pm?: PackageManager;\n builderMode: BuilderMode;\n skipInstall: boolean;\n offline: boolean;\n help: boolean;\n};\n\nexport const DEFAULT_DIR = 'my-store';\n\nexport const USAGE = `Usage: create-store [dir] [options]\n\n dir Where to create the store (default: ${DEFAULT_DIR})\n --catalog-key <key> The catalog's browser key (pc_pk_...); asked for when missing. A server key is detected\n --server-key <key> The catalog's server key, for reads made by your store's server (asked for after the browser key)\n --yes, -y Take every default and ask nothing\n --builder-mode <m> live (default) or build. build adds a Throttle Builder site that is generated at build time from a frozen release, with no Builder reads while the store runs\n --pm <manager> pnpm, npm, yarn or bun (default: the one running this command)\n --skip-install Write the files and stop before installing dependencies\n --offline Do not call the catalog to tell the keys apart (then --catalog-key and --server-key are both needed)\n --help, -h Show this text`;\n\n/** Reads the command line (without `node` and the script). Throws a readable error for a flag it does not know. */\nexport function parseArgs(argv: string[]): Args {\n const args: Args = { dir: DEFAULT_DIR, builderMode: 'live', yes: false, skipInstall: false, offline: false, help: false };\n const positional: string[] = [];\n const valueOf = (flag: string, inline: string | undefined, index: number): { value: string; next: number } => {\n if (inline !== undefined) return { value: inline, next: index };\n const next = argv[index + 1];\n if (next === undefined || next.startsWith('-')) throw new Error(`${flag} needs a value.`);\n return { value: next, next: index + 1 };\n };\n for (let i = 0; i < argv.length; i++) {\n const raw = argv[i] ?? '';\n if (raw === '--') {\n positional.push(...argv.slice(i + 1));\n break;\n }\n if (!raw.startsWith('-')) {\n positional.push(raw);\n continue;\n }\n const eq = raw.startsWith('--') ? raw.indexOf('=') : -1;\n const flag = eq === -1 ? raw : raw.slice(0, eq);\n const inline = eq === -1 ? undefined : raw.slice(eq + 1);\n switch (flag) {\n case '--catalog-key': {\n const { value, next } = valueOf(flag, inline, i);\n args.catalogKey = value;\n i = next;\n break;\n }\n case '--server-key': {\n const { value, next } = valueOf(flag, inline, i);\n args.serverKey = value;\n i = next;\n break;\n }\n case '--builder-mode': {\n const { value, next } = valueOf(flag, inline, i);\n if (!(BUILDER_MODES as readonly string[]).includes(value)) throw new Error(`--builder-mode must be live or build, not \"${value}\".`);\n args.builderMode = value as BuilderMode;\n i = next;\n break;\n }\n case '--pm': {\n const { value, next } = valueOf(flag, inline, i);\n if (!isPackageManager(value)) throw new Error(`--pm must be pnpm, npm, yarn or bun, not \"${value}\".`);\n args.pm = value;\n i = next;\n break;\n }\n case '--yes':\n case '-y':\n args.yes = true;\n break;\n case '--skip-install':\n args.skipInstall = true;\n break;\n case '--offline':\n args.offline = true;\n break;\n case '--help':\n case '-h':\n args.help = true;\n break;\n default:\n throw new Error(`Unknown option ${flag}.`);\n }\n }\n if (positional.length > 1) throw new Error(`Give one directory, not ${positional.length} (${positional.join(', ')}).`);\n if (positional[0]) args.dir = positional[0];\n return args;\n}\n","export const DEFAULT_CATALOG_URL = 'https://catalog.usethrottle.dev';\n\n/** A catalog publishable key: `pc_pk_` and up to 94 printable characters, no spaces (the catalog SDK's rule). */\nexport function validateCatalogKey(key: string): boolean {\n return /^pc_pk_[\\x21-\\x7e]{1,94}$/u.test(key);\n}\n\n/** Why a key is not accepted, in words for the terminal. */\nexport function catalogKeyProblem(key: string): string | undefined {\n if (validateCatalogKey(key)) return undefined;\n if (key.startsWith('pc_sk_')) return 'That is a secret key (pc_sk_). A storefront takes the publishable key (pc_pk_).';\n return 'A catalog publishable key starts with pc_pk_ and has no spaces.';\n}\n\n/** `unchecked` is only ever made by the caller, when it chose not to ask the catalog (`--offline`). */\nexport type KeyKind = 'server' | 'browser' | 'rejected' | 'unknown' | 'unchecked';\nexport type KeyClassification = { kind: KeyKind; detail: string };\n\n/** The origin of the second request. It is not a real site: a browser key is not allowed from it, a server key is refused from any origin. */\nexport const PROBE_ORIGIN = 'https://create-store.invalid';\n\n/**\n * Tells a catalog server key from a browser key by asking the catalog for its config (`GET /v1/storefront/config`)\n * twice: with no origin (what the store's server sends) and with an `Origin` header (what a browser sends).\n * - 401 on either: the catalog does not know the key (`rejected`).\n * - 200 with no origin, or `SERVER_KEY_IN_BROWSER` with one: a server key.\n * - `ORIGIN_NOT_ALLOWED` with no origin, or 200 or `ORIGIN_NOT_ALLOWED` with one: a browser key.\n * Anything else, or no answer, is `unknown`: the key is never refused for a reason the catalog did not give.\n */\nexport async function classifyCatalogKey(\n key: string,\n options: { baseUrl?: string; fetch?: typeof fetch; timeoutMs?: number } = {},\n): Promise<KeyClassification> {\n const base = (options.baseUrl ?? DEFAULT_CATALOG_URL).replace(/\\/+$/u, '');\n const doFetch = options.fetch ?? fetch;\n const ask = async (origin: string | undefined): Promise<{ status: number; code: string } | undefined> => {\n try {\n const response = await doFetch(`${base}/v1/storefront/config`, {\n headers: { 'x-catalog-key': key, ...(origin ? { origin } : {}) },\n signal: AbortSignal.timeout(options.timeoutMs ?? 8000),\n });\n const text = response.ok ? '' : await response.text().catch(() => '');\n const code = /\"code\"\\s*:\\s*\"([A-Z_]+)\"/u.exec(text)?.[1] ?? '';\n return { status: response.status, code };\n } catch {\n return undefined;\n }\n };\n const [server, browser] = [await ask(undefined), await ask(PROBE_ORIGIN)];\n if (server?.status === 401 || browser?.status === 401) {\n return { kind: 'rejected', detail: 'The catalog does not know this key (401).' };\n }\n if (server?.status === 200 || browser?.code === 'SERVER_KEY_IN_BROWSER') {\n return { kind: 'server', detail: 'This is a server key.' };\n }\n if (server?.code === 'ORIGIN_NOT_ALLOWED' || browser?.status === 200 || browser?.code === 'ORIGIN_NOT_ALLOWED') {\n return { kind: 'browser', detail: 'This is a browser key.' };\n }\n return { kind: 'unknown', detail: server || browser ? `The catalog answered ${(server ?? browser)!.status}.` : 'The catalog did not answer.' };\n}\n","import { catalogKeyProblem, type KeyClassification, type KeyKind } from './catalog-key';\n\nexport type KeyRole = 'browser' | 'server';\n\nexport type KeyDeps = {\n /** Asks the catalog what kind of key this is. */\n classify(key: string): Promise<KeyClassification>;\n /** Asks the user for a key. `undefined` or an empty string: the user skipped or cancelled. */\n ask(role: KeyRole): Promise<string | undefined>;\n};\n\nexport type KeyInput = {\n /** `--catalog-key`: the browser key, or a server key (it is detected). */\n catalogKey?: string;\n /** `--server-key`. */\n serverKey?: string;\n yes: boolean;\n offline: boolean;\n};\n\nexport type ResolvedKeys = {\n /** Goes to `NEXT_PUBLIC_THROTTLE_CATALOG_KEY`. Never a server key. */\n browserKey: string;\n /** Goes to `THROTTLE_CATALOG_SERVER_KEY`. Never a browser key. */\n serverKey?: string;\n /** Things to tell the user, none of them fatal. */\n notes: string[];\n};\n\nconst NEEDS_BOTH =\n 'Could not tell whether the key is a browser key or a server key, and a server key must never be written as the browser key. Pass both: --catalog-key <browser key> --server-key <server key>.';\n\nconst SERVER_NEEDS_BROWSER =\n 'That is a server key, and a store also needs a browser key for the open tab. Pass it with --catalog-key and the server key with --server-key.';\n\nconst ON_YOUR_WORD =\n 'The catalog did not check which key is which, so the roles are taken on your word: --catalog-key as the browser key and --server-key as the server key. If they are the wrong way round, the server key is published to every visitor in NEXT_PUBLIC_THROTTLE_CATALOG_KEY. Check .env.local.';\n\n/**\n * The one rule that keeps a server key out of `NEXT_PUBLIC_THROTTLE_CATALOG_KEY`: the key placed there is either\n * one the catalog said is a browser key, or one the user named as the browser key while also giving a server key\n * (typed at the browser prompt, or `--catalog-key` beside `--server-key`) and nothing contradicted it. A key the\n * catalog said is a server key is never allowed. Anything else is `NEEDS_BOTH`.\n */\nexport function assertBrowserKeyPlacement(p: { browserKind: KeyKind | undefined; named: boolean; hasServerKey: boolean }): void {\n if (p.browserKind === 'browser') return;\n if (p.browserKind !== 'server' && p.named && p.hasServerKey) return;\n throw new Error(NEEDS_BOTH);\n}\n\n/**\n * Settles which key is the store's browser key and which is its server key. A catalog browser key is only\n * answered from an allowed website, so the store's server reads with a server key and the browser with a\n * browser key. A key is never written under the wrong name: a server key is never a `NEXT_PUBLIC_` value.\n * - A browser key (the usual first key): the server key is asked for next, and may be skipped.\n * - A server key: the browser key is asked for next, and is required (an error with `--yes`).\n * - Flags in the wrong order (`--catalog-key` is a server key): put right only when the catalog says the\n * other one is a browser key. Any other answer is an error, never a guess.\n * - A key the catalog cannot place (`--offline`, or no answer) is not taken for the browser key. With both\n * `--catalog-key` and `--server-key` the roles are the ones the user named, with a note that says so;\n * otherwise both are asked for (an error with `--yes`).\n * `assertBrowserKeyPlacement` runs last, whatever path was taken.\n */\nexport async function resolveKeys(o: KeyInput, deps: KeyDeps): Promise<ResolvedKeys> {\n const notes: string[] = [];\n const classify = async (key: string): Promise<KeyKind> => {\n const problem = catalogKeyProblem(key);\n if (problem) throw new Error(problem);\n if (o.offline) return 'unchecked';\n const result = await deps.classify(key);\n if (result.kind === 'rejected') throw new Error(`${result.detail} Check the key, or pass --offline to skip this check.`);\n if (result.kind === 'unknown') notes.push(`Could not tell what kind of key this is (${result.detail}).`);\n return result.kind;\n };\n const askFor = async (role: KeyRole): Promise<string | undefined> => (await deps.ask(role))?.trim() || undefined;\n\n let browser = o.catalogKey?.trim() || undefined;\n let server = o.serverKey?.trim() || undefined;\n /** The user named `browser` as the browser key: typed at the browser prompt, or `--catalog-key` beside `--server-key`. */\n let named = false;\n let browserKind: KeyKind | undefined;\n let serverChecked = false;\n\n if (!browser && !server) {\n if (o.yes) throw new Error('--yes needs --catalog-key <pc_pk_...>.');\n browser = await askFor('browser');\n if (!browser) throw new Error('Cancelled.');\n named = true;\n }\n\n if (browser) {\n browserKind = await classify(browser);\n if (browserKind === 'server') {\n if (server) {\n const other = await classify(server);\n if (other === 'server') throw new Error('--catalog-key and --server-key are both server keys. One of them has to be the browser key.');\n if (other !== 'browser') {\n throw new Error(\n `The catalog says --catalog-key is a server key, but could not confirm that --server-key is a browser key (${other === 'unchecked' ? 'not checked' : 'no clear answer'}). The flags are not swapped on a guess: pass them the right way round, or check the keys in the catalog.`,\n );\n }\n // The flags were the wrong way round, and the catalog confirms it.\n [browser, server] = [server, browser];\n browserKind = 'browser';\n } else {\n server = browser;\n browser = undefined;\n browserKind = undefined;\n }\n serverChecked = true;\n } else if (server) {\n named = true;\n }\n }\n if (server && !serverChecked) {\n if ((await classify(server)) === 'browser') throw new Error('The key given as the server key is a browser key. A server key is made in the catalog under server keys.');\n }\n\n if (!browser) {\n if (o.yes) throw new Error(SERVER_NEEDS_BROWSER);\n browser = await askFor('browser');\n if (!browser) throw new Error('A browser key is needed. Cancelled.');\n named = true;\n browserKind = await classify(browser);\n if (browserKind === 'server') throw new Error('That is a server key too. The browser key is the one the catalog allows your website to use.');\n }\n\n if (!server) {\n if (browserKind !== 'browser') {\n // The catalog could not place the key: it is not put under a name on a guess.\n if (o.yes) throw new Error(NEEDS_BOTH);\n if (!named) {\n notes.push('Could not tell what kind of key --catalog-key is, so both keys are asked for.');\n browser = await askFor('browser');\n if (!browser) throw new Error('A browser key is needed. Cancelled.');\n named = true;\n browserKind = await classify(browser);\n if (browserKind === 'server') throw new Error('That is a server key too. The browser key is the one the catalog allows your website to use.');\n }\n server = await askFor('server');\n if (!server) throw new Error('A server key is needed when the keys cannot be told apart. Cancelled.');\n if ((await classify(server)) === 'browser') throw new Error('That is a browser key, not a server key.');\n } else if (!o.yes) {\n const given = await askFor('server');\n if (given) {\n if ((await classify(given)) === 'browser') throw new Error('That is a browser key, not a server key.');\n server = given;\n }\n }\n }\n\n assertBrowserKeyPlacement({ browserKind, named, hasServerKey: server !== undefined });\n if (browserKind !== 'browser') notes.push(ON_YOUR_WORD);\n if (!server) {\n notes.push(\n 'No server key. The browser key is only answered from an allowed website, so your store\\'s server cannot read with it: add the catalog\\'s server key as THROTTLE_CATALOG_SERVER_KEY in .env.local (see README.md).',\n );\n }\n return { browserKey: browser, ...(server ? { serverKey: server } : {}), notes };\n}\n","import prompts from 'prompts';\nimport { catalogKeyProblem } from './catalog-key';\nimport type { KeyRole } from './keys';\n\nconst MESSAGES: Record<KeyRole, string> = {\n browser: 'Catalog publishable key (pc_pk_...)',\n server: 'Catalog server key, for your store\\'s server (pc_pk_..., press enter to skip)',\n};\n\n/** Asks for a catalog key. Returns undefined when the user cancels, or skips the optional server key. */\nexport async function askCatalogKey(role: KeyRole): Promise<string | undefined> {\n const answer = await prompts(\n {\n type: 'text',\n name: 'catalogKey',\n message: MESSAGES[role],\n validate: (value: string) => (role === 'server' && value.trim() === '' ? true : (catalogKeyProblem(value.trim()) ?? true)),\n },\n { onCancel: () => false },\n );\n const key: unknown = answer.catalogKey;\n return typeof key === 'string' ? key.trim() : undefined;\n}\n","import { mkdir, readdir, readFile, stat, writeFile } from 'node:fs/promises';\nimport { basename, dirname, join, relative, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport type { BuilderMode } from './args';\nimport { catalogKeyProblem } from './catalog-key';\n\n/** `template/` sits beside `src/` and `dist/`, so one path reaches it from the source and from the build. */\nexport const TEMPLATE_DIR = resolve(dirname(fileURLToPath(import.meta.url)), '../template');\n\n/**\n * What `--builder-mode build` lays over the template: a file replaces the template's file of the same path, a\n * `.append` file is added to the end of it, anything else is new. A live store never reads this folder.\n */\nexport const BUILD_TEMPLATE_DIR = resolve(dirname(fileURLToPath(import.meta.url)), '../template-builder-build');\n\nexport type ScaffoldOptions = {\n /** Where to write the store. It may exist, but must be empty. */\n dir: string;\n /** The catalog's browser key, written to `.env.local` as `NEXT_PUBLIC_THROTTLE_CATALOG_KEY`. */\n catalogKey: string;\n /** The catalog's server key, written as `THROTTLE_CATALOG_SERVER_KEY` (never a `NEXT_PUBLIC_` value). Optional. */\n serverKey?: string;\n /** `build`: statically generate a Throttle Builder site from a frozen release. `live` (default) adds nothing. */\n builderMode?: BuilderMode;\n /** The Throttle package versions for the store's `dependencies` (`TEMPLATE_VERSIONS`). */\n versions: Record<string, string>;\n};\n\nasync function filesUnder(root: string, dir = root): Promise<string[]> {\n const found: string[] = [];\n for (const entry of await readdir(dir, { withFileTypes: true })) {\n const path = join(dir, entry.name);\n if (entry.isDirectory()) found.push(...(await filesUnder(root, path)));\n else found.push(relative(root, path));\n }\n return found.sort();\n}\n\n/** A valid npm package name from a folder name. */\nexport function packageNameOf(dir: string): string {\n const cleaned = basename(resolve(dir))\n .toLowerCase()\n .replace(/[^a-z0-9._-]+/gu, '-')\n .replace(/^[._-]+|[-]+$/gu, '');\n return cleaned || 'throttle-store';\n}\n\nfunction render(text: string, values: Record<string, string>): string {\n return text.replace(/\\{\\{(\\w+)\\}\\}/gu, (_all, name: string) => {\n const value = values[name];\n if (value === undefined) throw new Error(`The template uses {{${name}}}, which scaffold does not set.`);\n return value;\n });\n}\n\n/**\n * Writes the store template into `dir` and returns the absolute paths it wrote. A `.tmpl` file loses its\n * suffix (npm drops `.gitignore` and renames `package.json` files, so those travel as templates) and has its\n * `{{name}}`, `{{catalogKey}}` and `{{serverKeyLine}}` filled in. `package.json` also gets the Throttle packages' versions.\n * Refuses a directory that already holds anything, so it never overwrites a project.\n */\nexport async function scaffold(o: ScaffoldOptions): Promise<string[]> {\n const problem = catalogKeyProblem(o.catalogKey);\n if (problem) throw new Error(problem);\n const serverProblem = o.serverKey === undefined ? undefined : catalogKeyProblem(o.serverKey);\n if (serverProblem) throw new Error(serverProblem);\n const target = resolve(o.dir);\n const existing = await stat(target).then(\n () => readdir(target),\n () => null,\n );\n if (existing && existing.length > 0) {\n throw new Error(`${target} is not empty. Pick a new directory, or empty this one first.`);\n }\n const values = {\n name: packageNameOf(target),\n catalogKey: o.catalogKey,\n serverKeyLine: o.serverKey\n ? `THROTTLE_CATALOG_SERVER_KEY=${o.serverKey}`\n : '# THROTTLE_CATALOG_SERVER_KEY= (the catalog\\'s server key; see README.md)',\n };\n // The text of every file to write, by its path in the store. The overlay of a build-mode store lands on top.\n const files = new Map<string, string>();\n const read = async (root: string, overlay: boolean) => {\n for (const file of await filesUnder(root)) {\n const append = overlay && file.endsWith('.append');\n const name = append ? file.slice(0, -'.append'.length) : file;\n const isTemplate = name.endsWith('.tmpl');\n const out = isTemplate ? name.slice(0, -'.tmpl'.length) : name;\n let text = await readFile(join(root, file), 'utf8');\n if (isTemplate) text = render(text, values);\n files.set(out, append ? (files.get(out) ?? '') + text : text);\n }\n };\n await read(TEMPLATE_DIR, false);\n if (o.builderMode === 'build') await read(BUILD_TEMPLATE_DIR, true);\n\n const written: string[] = [];\n for (const [file, content] of files) {\n const out = join(target, file);\n let text = content;\n if (basename(out) === 'package.json') {\n const manifest = JSON.parse(text) as { dependencies?: Record<string, string> };\n const dependencies = { ...manifest.dependencies, ...o.versions };\n manifest.dependencies = Object.fromEntries(Object.entries(dependencies).sort(([a], [b]) => a.localeCompare(b)));\n text = `${JSON.stringify(manifest, null, 2)}\\n`;\n }\n await mkdir(dirname(out), { recursive: true });\n await writeFile(out, text, 'utf8');\n written.push(out);\n }\n return written;\n}\n","{\n \"name\": \"@usethrottle/auth\",\n \"version\": \"0.15.0\",\n \"description\": \"Buyer authentication for Throttle storefronts — headless core, React hooks, and drop-in forms.\",\n \"type\": \"module\",\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"files\": [\n \"dist\",\n \"README.md\",\n \"CLAUDE.md\"\n ],\n \"sideEffects\": [\n \"**/*.css\"\n ],\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\",\n \"require\": \"./dist/index.cjs\"\n },\n \"./react\": {\n \"types\": \"./dist/react/index.d.ts\",\n \"import\": \"./dist/react/index.js\",\n \"require\": \"./dist/react/index.cjs\"\n },\n \"./forms\": {\n \"types\": \"./dist/react/forms/index.d.ts\",\n \"import\": \"./dist/react/forms/index.js\",\n \"require\": \"./dist/react/forms/index.cjs\"\n },\n \"./components\": {\n \"types\": \"./dist/react/components/index.d.ts\",\n \"import\": \"./dist/react/components/index.js\",\n \"require\": \"./dist/react/components/index.cjs\"\n },\n \"./styles.css\": \"./dist/styles.css\",\n \"./package.json\": \"./package.json\"\n },\n \"scripts\": {\n \"build\": \"tsup\",\n \"dev\": \"tsup --watch\",\n \"test\": \"vitest run\",\n \"typecheck\": \"tsc --noEmit\"\n },\n \"dependencies\": {\n \"@usethrottle/money\": \"workspace:^\",\n \"@usethrottle/ui\": \"workspace:^\"\n },\n \"peerDependencies\": {\n \"react\": \">=18\",\n \"react-dom\": \">=18\"\n },\n \"peerDependenciesMeta\": {\n \"react\": {\n \"optional\": true\n },\n \"react-dom\": {\n \"optional\": true\n }\n },\n \"devDependencies\": {\n \"@core/cadence\": \"workspace:*\",\n \"@testing-library/react\": \"^16.1.0\",\n \"@types/react\": \"^19.1.0\",\n \"@types/react-dom\": \"^19.1.0\",\n \"@vitejs/plugin-react\": \"^4.3.4\",\n \"jsdom\": \"^25.0.1\",\n \"react\": \"^19.1.0\",\n \"react-dom\": \"^19.1.0\",\n \"tsup\": \"^8.0.0\",\n \"typescript\": \"^5.7.0\",\n \"vitest\": \"^2.1.9\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"engines\": {\n \"node\": \">=20\"\n }\n}\n","{\n \"name\": \"@usethrottle/builder\",\n \"version\": \"0.2.0\",\n \"description\": \"Headless client for Throttle Builder: read published pages, parts, slots and site settings from a storefront, with Next.js cache, revalidation and preview helpers.\",\n \"license\": \"MIT\",\n \"type\": \"module\",\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/index.d.cts\",\n \"default\": \"./dist/index.cjs\"\n }\n },\n \"./next\": {\n \"import\": {\n \"types\": \"./dist/next.d.ts\",\n \"default\": \"./dist/next.js\"\n },\n \"require\": {\n \"types\": \"./dist/next.d.cts\",\n \"default\": \"./dist/next.cjs\"\n }\n },\n \"./watch\": {\n \"import\": {\n \"types\": \"./dist/watch.d.ts\",\n \"default\": \"./dist/watch.js\"\n },\n \"require\": {\n \"types\": \"./dist/watch.d.cts\",\n \"default\": \"./dist/watch.cjs\"\n }\n },\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"dist\"\n ],\n \"sideEffects\": [\n \"./dist/next.js\",\n \"./dist/next.cjs\"\n ],\n \"engines\": {\n \"node\": \">=20\"\n },\n \"scripts\": {\n \"build\": \"tsup\",\n \"test\": \"vitest run\",\n \"typecheck\": \"tsc --noEmit && tsc --noEmit -p tsconfig.test.json\"\n },\n \"keywords\": [\n \"throttle\",\n \"usethrottle\",\n \"builder\",\n \"page-builder\",\n \"nextjs\"\n ],\n \"dependencies\": {\n \"@usethrottle/builder-schema\": \"workspace:^\",\n \"server-only\": \"0.0.1\"\n },\n \"peerDependencies\": {\n \"next\": \">=14\",\n \"react\": \">=18\"\n },\n \"peerDependenciesMeta\": {\n \"next\": {\n \"optional\": true\n },\n \"react\": {\n \"optional\": true\n }\n },\n \"devDependencies\": {\n \"@testing-library/react\": \"^16.1.0\",\n \"@types/node\": \"^20.0.0\",\n \"@types/react\": \"^19.1.0\",\n \"@types/react-dom\": \"^19.1.0\",\n \"jsdom\": \"^25.0.1\",\n \"react\": \"^19.1.0\",\n \"react-dom\": \"^19.1.0\",\n \"tsup\": \"^8.0.0\",\n \"typescript\": \"^5.7.0\",\n \"vitest\": \"^2.1.9\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n","{\n \"name\": \"@usethrottle/builder-react\",\n \"version\": \"0.2.0\",\n \"description\": \"Renders a published Throttle Builder page document as React in a merchant's store: responsive CSS, header, footer, slots and the site design provider.\",\n \"license\": \"MIT\",\n \"type\": \"module\",\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/index.d.cts\",\n \"default\": \"./dist/index.cjs\"\n }\n },\n \"./server\": {\n \"import\": {\n \"types\": \"./dist/server.d.ts\",\n \"default\": \"./dist/server.js\"\n },\n \"require\": {\n \"types\": \"./dist/server.d.cts\",\n \"default\": \"./dist/server.cjs\"\n }\n },\n \"./next\": {\n \"import\": {\n \"types\": \"./dist/next.d.ts\",\n \"default\": \"./dist/next.js\"\n },\n \"require\": {\n \"types\": \"./dist/next.d.cts\",\n \"default\": \"./dist/next.cjs\"\n }\n },\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"dist\",\n \"CLAUDE.md\"\n ],\n \"sideEffects\": false,\n \"engines\": {\n \"node\": \">=20\"\n },\n \"scripts\": {\n \"build\": \"tsup\",\n \"dev\": \"node scripts/playground.mjs\",\n \"test\": \"vitest run\",\n \"typecheck\": \"tsc --noEmit && tsc --noEmit -p tsconfig.test.json\",\n \"size\": \"node scripts/size.mjs\",\n \"test:rsc\": \"node scripts/rsc-build.mjs\"\n },\n \"keywords\": [\n \"throttle\",\n \"usethrottle\",\n \"builder\",\n \"page-builder\",\n \"react\",\n \"nextjs\"\n ],\n \"dependencies\": {\n \"@usethrottle/builder\": \"workspace:^\",\n \"@usethrottle/builder-schema\": \"workspace:^\",\n \"@usethrottle/ui\": \"workspace:^\"\n },\n \"peerDependencies\": {\n \"next\": \">=15\",\n \"react\": \">=18\",\n \"react-dom\": \">=18\"\n },\n \"peerDependenciesMeta\": {\n \"next\": {\n \"optional\": true\n }\n },\n \"devDependencies\": {\n \"@testing-library/react\": \"^16.1.0\",\n \"@types/node\": \"^20.0.0\",\n \"@types/react\": \"^19.1.0\",\n \"@types/react-dom\": \"^19.1.0\",\n \"jsdom\": \"^25.0.1\",\n \"next\": \"15.5.15\",\n \"playwright\": \"^1.62.1\",\n \"react\": \"19.2.5\",\n \"react-dom\": \"19.2.5\",\n \"tsup\": \"^8.0.0\",\n \"typescript\": \"^5.7.0\",\n \"vitest\": \"^2.1.9\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n","{\n \"name\": \"@usethrottle/builder-schema\",\n \"version\": \"0.1.2\",\n \"description\": \"Throttle Builder page document, site settings, responsive rules, limits and basic widget definitions. Pure TypeScript plus zod, no React and no I/O.\",\n \"type\": \"module\",\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/index.d.cts\",\n \"default\": \"./dist/index.cjs\"\n }\n }\n },\n \"files\": [\n \"dist\",\n \"__tests__/fixtures/parity\"\n ],\n \"sideEffects\": [\n \"./dist/index.js\",\n \"./dist/index.cjs\",\n \"./src/jitless.ts\"\n ],\n \"scripts\": {\n \"build\": \"tsup\",\n \"test\": \"vitest run\",\n \"typecheck\": \"tsc --noEmit && tsc --noEmit -p tsconfig.test.json\"\n },\n \"keywords\": [\n \"throttle\",\n \"usethrottle\",\n \"builder\",\n \"page-builder\",\n \"schema\"\n ],\n \"dependencies\": {\n \"zod\": \"^4.4.3\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^20.0.0\",\n \"fast-check\": \"^3.23.0\",\n \"tsup\": \"^8.0.0\",\n \"typescript\": \"^5.7.0\",\n \"vitest\": \"^2.1.9\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n","{\n \"name\": \"@usethrottle/storefront-react\",\n \"version\": \"0.2.2\",\n \"description\": \"Drop-in, settings-driven React storefront components for Throttle catalogs.\",\n \"type\": \"module\",\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"files\": [\n \"dist\",\n \"builder-pack.json\",\n \"README.md\",\n \"CLAUDE.md\"\n ],\n \"sideEffects\": [\n \"**/*.css\"\n ],\n \"exports\": {\n \".\": {\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/index.d.cts\",\n \"default\": \"./dist/index.cjs\"\n }\n },\n \"./server\": {\n \"import\": {\n \"types\": \"./dist/server/index.d.ts\",\n \"default\": \"./dist/server/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/server/index.d.cts\",\n \"default\": \"./dist/server/index.cjs\"\n }\n },\n \"./next\": {\n \"import\": {\n \"types\": \"./dist/next/index.d.ts\",\n \"default\": \"./dist/next/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/next/index.d.cts\",\n \"default\": \"./dist/next/index.cjs\"\n }\n },\n \"./next/client\": {\n \"import\": {\n \"types\": \"./dist/next/client.d.ts\",\n \"default\": \"./dist/next/client.js\"\n },\n \"require\": {\n \"types\": \"./dist/next/client.d.cts\",\n \"default\": \"./dist/next/client.cjs\"\n }\n },\n \"./account\": {\n \"import\": {\n \"types\": \"./dist/account/index.d.ts\",\n \"default\": \"./dist/account/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/account/index.d.cts\",\n \"default\": \"./dist/account/index.cjs\"\n }\n },\n \"./builder\": {\n \"import\": {\n \"types\": \"./dist/builder/index.d.ts\",\n \"default\": \"./dist/builder/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/builder/index.d.cts\",\n \"default\": \"./dist/builder/index.cjs\"\n }\n },\n \"./builder-pack.json\": \"./builder-pack.json\",\n \"./styles.css\": \"./dist/styles.css\",\n \"./package.json\": \"./package.json\"\n },\n \"scripts\": {\n \"build\": \"tsup && node scripts/build-pack-manifest.mjs\",\n \"dev\": \"tsup --watch\",\n \"test\": \"vitest run\",\n \"typecheck\": \"tsc --noEmit\"\n },\n \"dependencies\": {\n \"@usethrottle/ui\": \"workspace:^\"\n },\n \"peerDependencies\": {\n \"@usethrottle/auth\": \">=0.15.0\",\n \"@usethrottle/builder-react\": \"^0.1.0 || ^0.2.0\",\n \"@usethrottle/builder-schema\": \"^0.1.2\",\n \"@usethrottle/catalog\": \"^1.4.1\",\n \"@usethrottle/money\": \"^1.1.0\",\n \"@usethrottle/scripts\": \">=0.4.0\",\n \"next\": \">=15\",\n \"react\": \">=18\",\n \"react-dom\": \">=18\"\n },\n \"peerDependenciesMeta\": {\n \"@usethrottle/auth\": {\n \"optional\": true\n },\n \"@usethrottle/builder-react\": {\n \"optional\": true\n },\n \"@usethrottle/builder-schema\": {\n \"optional\": true\n },\n \"@usethrottle/scripts\": {\n \"optional\": true\n },\n \"next\": {\n \"optional\": true\n }\n },\n \"devDependencies\": {\n \"@testing-library/react\": \"^16.1.0\",\n \"@types/node\": \"^20\",\n \"@types/react\": \"^19.1.0\",\n \"@types/react-dom\": \"^19.1.0\",\n \"@usethrottle/auth\": \"workspace:*\",\n \"@usethrottle/builder-react\": \"workspace:*\",\n \"@usethrottle/builder-schema\": \"workspace:*\",\n \"@usethrottle/catalog\": \"1.4.1\",\n \"@usethrottle/money\": \"workspace:*\",\n \"@usethrottle/scripts\": \"workspace:*\",\n \"@vitejs/plugin-react\": \"^4.3.4\",\n \"jsdom\": \"^25.0.1\",\n \"next\": \"16.3.5\",\n \"react\": \"^19.1.0\",\n \"react-dom\": \"^19.1.0\",\n \"tsup\": \"^8.0.0\",\n \"typescript\": \"^5.7.0\",\n \"vitest\": \"^2.1.9\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"engines\": {\n \"node\": \">=20\"\n }\n}\n","{\n \"name\": \"@usethrottle/ui\",\n \"version\": \"0.1.2\",\n \"description\": \"Shared theme, presets, primitives and icons for Throttle React components.\",\n \"type\": \"module\",\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"files\": [\n \"dist\",\n \"CLAUDE.md\"\n ],\n \"sideEffects\": false,\n \"exports\": {\n \".\": {\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/index.d.cts\",\n \"default\": \"./dist/index.cjs\"\n }\n },\n \"./presets\": {\n \"import\": {\n \"types\": \"./dist/presets.d.ts\",\n \"default\": \"./dist/presets.js\"\n },\n \"require\": {\n \"types\": \"./dist/presets.d.cts\",\n \"default\": \"./dist/presets.cjs\"\n }\n },\n \"./package.json\": \"./package.json\"\n },\n \"scripts\": {\n \"build\": \"tsup\",\n \"dev\": \"tsup --watch\",\n \"test\": \"vitest run\",\n \"typecheck\": \"tsc --noEmit\"\n },\n \"peerDependencies\": {\n \"react\": \">=18\",\n \"react-dom\": \">=18\"\n },\n \"devDependencies\": {\n \"@testing-library/react\": \"^16.1.0\",\n \"@types/react\": \"^19.1.0\",\n \"@types/react-dom\": \"^19.1.0\",\n \"@vitejs/plugin-react\": \"^4.3.4\",\n \"jsdom\": \"^25.0.1\",\n \"react\": \"^19.1.0\",\n \"react-dom\": \"^19.1.0\",\n \"tsup\": \"^8.0.0\",\n \"typescript\": \"^5.7.0\",\n \"vitest\": \"^2.1.9\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"engines\": {\n \"node\": \">=20\"\n }\n}\n","import { version as auth } from '../../auth-sdk/package.json';\nimport { version as builder } from '../../builder/package.json';\nimport { version as builderReact } from '../../builder-react/package.json';\nimport { version as builderSchema } from '../../builder-schema/package.json';\nimport { version as storefrontReact } from '../../storefront-react/package.json';\nimport { version as ui } from '../../ui/package.json';\n\n/**\n * The versions a new store depends on. The three Throttle packages that ship with this CLI take the\n * version they have in this workspace when the CLI is built, so a store always gets the release this\n * CLI was published with. The catalog SDK and `@usethrottle/money` live elsewhere and are ranges: one\n * `@usethrottle/money` for the whole tree is what `@usethrottle/storefront-react` needs.\n */\nexport const TEMPLATE_VERSIONS: Record<string, string> = {\n '@usethrottle/storefront-react': `^${storefrontReact}`,\n '@usethrottle/ui': `^${ui}`,\n '@usethrottle/auth': `^${auth}`,\n '@usethrottle/catalog': '^1.4.1',\n '@usethrottle/money': '^1.1.0',\n};\n\n/** What `--builder-mode build` adds to a store's `dependencies`, from the workspace versions at build like the rest. */\nexport const BUILD_MODE_VERSIONS: Record<string, string> = {\n '@usethrottle/builder': `^${builder}`,\n '@usethrottle/builder-react': `^${builderReact}`,\n '@usethrottle/builder-schema': `^${builderSchema}`,\n};\n"],"mappings":";;;AACA,SAAS,aAAa;AACtB,SAAS,YAAAA,WAAU,WAAAC,gBAAe;;;ACAlC,IAAM,WAAsC,CAAC,QAAQ,OAAO,QAAQ,KAAK;AAGlE,SAAS,qBAAqB,WAA+C;AAClF,QAAM,OAAO,WAAW,KAAK,EAAE,MAAM,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IAAI,IAAI,SAAS;AAC3C,UAAQ,IAAI;AAAA;AAAA,OAAiB,EAAE;AAAA,EAAK,KAAK,cAAc,KAAK,EAAE;AAAA,IAAe,EAAE,KAAK,UAAU,IAAI,KAAK,CAAC;AAAA;AAAA,0EAA+E;AACzL;AAEA,KAAK,EAAE,MAAM,CAAC,UAAmB;AAC/B,UAAQ,MAAM,iBAAiB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,EAAE;AACvF,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["relative","resolve","version","version","version","version","version","version","resolve","relative"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usethrottle/create-store",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Scaffold a complete Next.js storefront on @usethrottle/storefront-react.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"create-store": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"template",
|
|
12
|
+
"template-builder-build",
|
|
13
|
+
"README.md",
|
|
14
|
+
"CLAUDE.md"
|
|
15
|
+
],
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"prompts": "^2.4.2"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@playwright/test": "1.62.1",
|
|
21
|
+
"@types/node": "^20.0.0",
|
|
22
|
+
"@types/prompts": "^2.4.0",
|
|
23
|
+
"@types/react": "^19.1.0",
|
|
24
|
+
"@types/react-dom": "^19.1.0",
|
|
25
|
+
"@usethrottle/catalog": "1.4.1",
|
|
26
|
+
"next": "16.3.5",
|
|
27
|
+
"react": "19.2.8",
|
|
28
|
+
"react-dom": "19.2.8",
|
|
29
|
+
"tsup": "^8.0.0",
|
|
30
|
+
"typescript": "^5.7.0",
|
|
31
|
+
"vitest": "^2.1.9",
|
|
32
|
+
"@usethrottle/auth": "0.15.0",
|
|
33
|
+
"@usethrottle/builder-react": "0.2.0",
|
|
34
|
+
"@usethrottle/builder-schema": "0.1.2",
|
|
35
|
+
"@usethrottle/builder": "0.2.0",
|
|
36
|
+
"@usethrottle/storefront-react": "0.2.2",
|
|
37
|
+
"@usethrottle/money": "1.1.0",
|
|
38
|
+
"@usethrottle/ui": "0.1.2"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=20"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsup",
|
|
48
|
+
"dev": "tsup --watch",
|
|
49
|
+
"test": "vitest run",
|
|
50
|
+
"typecheck": "tsc --noEmit"
|
|
51
|
+
}
|
|
6
52
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# The catalog's browser key. It is sent to the browser (NEXT_PUBLIC_), so it must be a browser key, never a server key.
|
|
2
|
+
NEXT_PUBLIC_THROTTLE_CATALOG_KEY={{catalogKey}}
|
|
3
|
+
|
|
4
|
+
# The catalog's server key: your store's server reads with it (a browser key is only answered from an allowed website).
|
|
5
|
+
# Never put it in a NEXT_PUBLIC_ variable.
|
|
6
|
+
{{serverKeyLine}}
|
|
7
|
+
|
|
8
|
+
# Set these on your host, not here:
|
|
9
|
+
# NEXT_PUBLIC_SITE_URL the store's own origin (https://shop.example); canonical URLs are built from it
|
|
10
|
+
# THROTTLE_WEBHOOK_SECRET the signing secret of the catalog's storefront.changed webhook
|
|
11
|
+
# THROTTLE_PREVIEW set to 1 on a preview deployment only (see README.md)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Agent notes for this store
|
|
2
|
+
|
|
3
|
+
A Next.js App Router store on `@usethrottle/storefront-react`. The components read their display from the
|
|
4
|
+
catalog's storefront settings; change settings in the dashboard before you change code.
|
|
5
|
+
|
|
6
|
+
## Cost rules (do not break these)
|
|
7
|
+
|
|
8
|
+
This store was set up so Vercel ISR writes stay low. A change that breaks one can cost real money.
|
|
9
|
+
|
|
10
|
+
- No `export const revalidate = N` below 3600, no `fetch(..., { next: { revalidate } })` below 3600, no
|
|
11
|
+
`revalidatePath`, no per-product tags. Cache invalidation is the one coarse tag `throttle-catalog`, through
|
|
12
|
+
`app/api/throttle/revalidate` (signed webhook) and `app/api/throttle/sync`.
|
|
13
|
+
- Keep `staticParams: 0` in `app/p/[handle]/page.tsx`, and keep `app/search/page.tsx` dynamic.
|
|
14
|
+
- Keep `generationWatch.intervalMs` at 60000 or more in `app/providers.tsx`.
|
|
15
|
+
- Use `createStorefrontServerClient` for server reads (it carries `STOREFRONT_CACHE_POLICY`); do not build a
|
|
16
|
+
catalog client with a short cache time.
|
|
17
|
+
- Do not pass `previewToken` to a route on production: it makes the route render per request.
|
|
18
|
+
|
|
19
|
+
## Where things are
|
|
20
|
+
|
|
21
|
+
- `lib/store.ts`: the catalog key, the site origin and the preview switch every route reads.
|
|
22
|
+
- `app/*/page.tsx`: one route helper each (`createShopAllPage`, `createProductPage`, `createSearchPage`,
|
|
23
|
+
`createAccountPage`). Change a route's options there.
|
|
24
|
+
- `app/providers.tsx`: the provider and the page frame (header, footer, cart drawer).
|
|
25
|
+
- Never put a secret key (`pc_sk_`) in this project. Only the publishable key (`pc_pk_`) belongs here.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Your Throttle store
|
|
2
|
+
|
|
3
|
+
A Next.js storefront on [`@usethrottle/storefront-react`](https://www.npmjs.com/package/@usethrottle/storefront-react).
|
|
4
|
+
Products, collections, search, the cart drawer and the account page are the package's components; what they
|
|
5
|
+
show (menus, filters, sorts, badges, theme, text) comes from your catalog's storefront settings, so most changes
|
|
6
|
+
are made in the Throttle dashboard, not in this code.
|
|
7
|
+
|
|
8
|
+
## Run it
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pnpm dev # or npm run dev
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
A catalog has two kinds of key. `.env.local` holds both:
|
|
15
|
+
|
|
16
|
+
- **Browser key**, `NEXT_PUBLIC_THROTTLE_CATALOG_KEY`. It is sent to the browser, and the catalog only answers it from
|
|
17
|
+
the websites you allowed: add your site's https origin to the key's allowed websites in the dashboard.
|
|
18
|
+
- **Server key**, `THROTTLE_CATALOG_SERVER_KEY`. Your store's server reads with it. A request from your own server
|
|
19
|
+
carries no website origin, so a browser key is refused there. The catalog refuses a server key in the browser too,
|
|
20
|
+
so never put it in a `NEXT_PUBLIC_` variable. It also works for local development.
|
|
21
|
+
|
|
22
|
+
If `THROTTLE_CATALOG_SERVER_KEY` is missing the server tries the browser key, and the catalog answers 403.
|
|
23
|
+
|
|
24
|
+
| Variable | Where | What |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| `NEXT_PUBLIC_THROTTLE_CATALOG_KEY` | `.env.local` | The catalog's browser key (`pc_pk_...`). |
|
|
27
|
+
| `THROTTLE_CATALOG_SERVER_KEY` | `.env.local` or your host | The catalog's server key, used for reads made by your server. Never `NEXT_PUBLIC_`. |
|
|
28
|
+
| `NEXT_PUBLIC_SITE_URL` | your host | The store's own origin, for canonical URLs and the share image. |
|
|
29
|
+
| `THROTTLE_WEBHOOK_SECRET` | your host | Signing secret of the catalog's `storefront.changed` webhook. |
|
|
30
|
+
| `THROTTLE_PREVIEW` | a preview deployment only | `1` turns on draft preview. Never on production. |
|
|
31
|
+
|
|
32
|
+
## Keep hosting costs down (ISR)
|
|
33
|
+
|
|
34
|
+
A store that regenerates its pages too often is billed for it: on Vercel every regenerated page is an ISR write
|
|
35
|
+
(its HTML and its data), and a deploy writes every page again. This store is set up so its pages are
|
|
36
|
+
rendered per request from catalog data that is kept until your catalog changes, so it writes almost no ISR (only the
|
|
37
|
+
two static pages, `/account` and the not-found page, once per deploy). Keep it that way:
|
|
38
|
+
|
|
39
|
+
- **No short cache times.** Never set `revalidate` below 3600 seconds, on a route or in a `fetch`, and never call
|
|
40
|
+
`revalidatePath`. The catalog client is already on `STOREFRONT_CACHE_POLICY` (every read kept until the catalog
|
|
41
|
+
changes, search never cached). If you override a read's cache time, keep it at an hour or more.
|
|
42
|
+
- **One coarse tag.** A change clears the single tag `throttle-catalog`, not a tag per product, and at most once a
|
|
43
|
+
minute however many edits arrive. The signed webhook (`app/api/throttle/revalidate`) and the open tab's check
|
|
44
|
+
(`app/api/throttle/sync`) both go through that one limit. The webhook checks its signature first.
|
|
45
|
+
- **Set the webhook up.** Add `THROTTLE_WEBHOOK_SECRET` and point the catalog's `storefront.changed` webhook at
|
|
46
|
+
`https://your-store/api/throttle/revalidate`. Without it the store still updates, but only through open tabs
|
|
47
|
+
and the one-hour safety limit.
|
|
48
|
+
- **No prerendered products.** `app/p/[handle]/page.tsx` sets `staticParams: 0`. Product pages are rendered per
|
|
49
|
+
request from cached data: the page writes no ISR, and the catalog data behind it is kept until the catalog
|
|
50
|
+
changes. Prerendering 1,000 products would write 1,000 pages on every deploy.
|
|
51
|
+
- **Search stays dynamic.** `app/search/page.tsx` is `force-dynamic` and reads without a cache. Every query is a new
|
|
52
|
+
URL; caching them would write a page per query.
|
|
53
|
+
- **The open-tab check is 60 s or more.** `generationWatch` in `app/providers.tsx` is one cheap conditional read per
|
|
54
|
+
tab. 60 s is the package's floor; do not lower it, and raise it if your traffic is high.
|
|
55
|
+
- **Preview is for preview deployments.** `THROTTLE_PREVIEW=1` makes every route render per request. Leave it unset in
|
|
56
|
+
production.
|
|
57
|
+
- **Watch deploys.** Each production deploy starts with an empty page cache, so every visited page is written
|
|
58
|
+
again. Merge changes in batches rather than deploying a line at a time.
|
|
59
|
+
|
|
60
|
+
## Pages
|
|
61
|
+
|
|
62
|
+
| Route | Page |
|
|
63
|
+
|---|---|
|
|
64
|
+
| `/` and `/shop` | All products |
|
|
65
|
+
| `/collections/[handle]`, `/c/[handle]`, `/tags/[tag]` | A collection, category or tag |
|
|
66
|
+
| `/p/[handle]` | A product |
|
|
67
|
+
| `/search` | Search results (`?q=`) |
|
|
68
|
+
| `/account` | Sign in, sign up and the account (needs the account key in your catalog's brand settings; until then the page says it is not set up) |
|
|
69
|
+
|
|
70
|
+
Content pages (a Builder-managed home, landing pages) come with a later release. Replace `app/page.tsx` with your
|
|
71
|
+
own page to change the home.
|
|
72
|
+
|
|
73
|
+
## Make it yours
|
|
74
|
+
|
|
75
|
+
- Colours, fonts, shape: pick a preset and tokens in the dashboard, or pass `preset`, `theme` and `appearance` to
|
|
76
|
+
`StorefrontNextProvider` in `app/providers.tsx`.
|
|
77
|
+
- Every element carries `data-throttle-part="<part>"` and the class `tsf-<part>`, inside `@layer throttle`, so your own
|
|
78
|
+
CSS or Tailwind classes win without `!important`.
|
|
79
|
+
- Text: `localization` on the provider overrides any string.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRevalidateHandler } from '@usethrottle/storefront-react/next';
|
|
2
|
+
|
|
3
|
+
// The catalog's signed storefront.changed webhook. The signature is checked first (an unsigned request is a
|
|
4
|
+
// 401 and clears nothing). A verified notice clears one coarse tag, at most once a minute, however many arrive.
|
|
5
|
+
export const POST = createRevalidateHandler({ secret: process.env.THROTTLE_WEBHOOK_SECRET });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createGenerationSyncHandler } from '@usethrottle/storefront-react/next';
|
|
2
|
+
import { createStorefrontServerClient } from '@usethrottle/storefront-react/server';
|
|
3
|
+
import { store } from '@/lib/store';
|
|
4
|
+
|
|
5
|
+
// The open tab's backstop: when the tab sees the catalog's generation move it POSTs here before it refreshes.
|
|
6
|
+
// The cache is cleared only if the generation really moved, one coarse tag, at most once a minute.
|
|
7
|
+
export const { POST } = createGenerationSyncHandler({
|
|
8
|
+
client: createStorefrontServerClient({ catalogKey: store.catalogKey }),
|
|
9
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createShopAllPage } from '@usethrottle/storefront-react/next';
|
|
2
|
+
import { store } from '@/lib/store';
|
|
3
|
+
|
|
4
|
+
const route = createShopAllPage({ ...store, source: 'category' });
|
|
5
|
+
|
|
6
|
+
export default route.Page;
|
|
7
|
+
export const generateMetadata = route.generateMetadata;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createShopAllPage } from '@usethrottle/storefront-react/next';
|
|
2
|
+
import { store } from '@/lib/store';
|
|
3
|
+
|
|
4
|
+
const route = createShopAllPage({ ...store, source: 'collection' });
|
|
5
|
+
|
|
6
|
+
export default route.Page;
|
|
7
|
+
export const generateMetadata = route.generateMetadata;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import '@usethrottle/storefront-react/styles.css';
|
|
2
|
+
import { createStorefrontServerClient, loadSettings } from '@usethrottle/storefront-react/server';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
import { store } from '@/lib/store';
|
|
5
|
+
import { Providers } from './providers';
|
|
6
|
+
|
|
7
|
+
export default async function RootLayout({ children }: { children: ReactNode }) {
|
|
8
|
+
const settings = await loadSettings({ client: createStorefrontServerClient({ catalogKey: store.catalogKey }) });
|
|
9
|
+
return (
|
|
10
|
+
<html lang="en">
|
|
11
|
+
<body style={{ margin: 0 }}>
|
|
12
|
+
<Providers settings={settings}>{children}</Providers>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createProductPage } from '@usethrottle/storefront-react/next';
|
|
2
|
+
import { store } from '@/lib/store';
|
|
3
|
+
|
|
4
|
+
// staticParams: 0 prerenders no product at build (a deploy would write every prerendered page again).
|
|
5
|
+
// `generateStaticParams` is not exported on purpose: the page reads `?variant=` from the request, and Next
|
|
6
|
+
// refuses to serve a prerendered route that does. The product is rendered when asked for, from the catalog
|
|
7
|
+
// data cached until the catalog changes, so it costs no ISR write.
|
|
8
|
+
const route = createProductPage({ ...store, staticParams: 0 });
|
|
9
|
+
|
|
10
|
+
export default route.Page;
|
|
11
|
+
export const generateMetadata = route.generateMetadata;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { StoreFrame } from '@usethrottle/storefront-react';
|
|
3
|
+
import { StorefrontNextProvider, type StorefrontNextProviderProps } from '@usethrottle/storefront-react/next/client';
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The storefront provider and the page around every route (header, footer, cart drawer).
|
|
8
|
+
* `generationWatch` is the open tab's check for a catalog change: one cheap conditional read at this interval.
|
|
9
|
+
* 60 s is the least the package allows. Raise it if you like; do not lower it.
|
|
10
|
+
*/
|
|
11
|
+
export function Providers({ settings, children }: { settings: StorefrontNextProviderProps['settings']; children: ReactNode }) {
|
|
12
|
+
return (
|
|
13
|
+
<StorefrontNextProvider
|
|
14
|
+
catalogKey={process.env.NEXT_PUBLIC_THROTTLE_CATALOG_KEY}
|
|
15
|
+
settings={settings}
|
|
16
|
+
generationWatch={{ intervalMs: 60_000 }}
|
|
17
|
+
injectStyles={false}
|
|
18
|
+
>
|
|
19
|
+
<StoreFrame>{children}</StoreFrame>
|
|
20
|
+
</StorefrontNextProvider>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createSearchPage } from '@usethrottle/storefront-react/next';
|
|
2
|
+
import { store } from '@/lib/store';
|
|
3
|
+
|
|
4
|
+
const route = createSearchPage(store);
|
|
5
|
+
|
|
6
|
+
// Search results are never cached or written as a static page: every query is a new URL, and caching them is
|
|
7
|
+
// what makes a store's hosting bill grow.
|
|
8
|
+
export const dynamic = 'force-dynamic';
|
|
9
|
+
|
|
10
|
+
export default route.Page;
|
|
11
|
+
export const generateMetadata = route.generateMetadata;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getPreviewToken } from '@usethrottle/storefront-react/next';
|
|
2
|
+
|
|
3
|
+
// A browser key is checked against the website's origin, and a request from your server carries none, so the
|
|
4
|
+
// server reads with the server key (THROTTLE_CATALOG_SERVER_KEY). Without one it tries the browser key, which the
|
|
5
|
+
// catalog refuses (403 ORIGIN_NOT_ALLOWED).
|
|
6
|
+
const catalogKey = process.env.THROTTLE_CATALOG_SERVER_KEY || process.env.NEXT_PUBLIC_THROTTLE_CATALOG_KEY;
|
|
7
|
+
if (!catalogKey) throw new Error('Set NEXT_PUBLIC_THROTTLE_CATALOG_KEY (your catalog publishable key, pc_pk_...) in .env.local.');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* What every route needs. Pass it to a route helper: `createShopAllPage({ ...store })`.
|
|
11
|
+
*
|
|
12
|
+
* `previewToken` is added only when THROTTLE_PREVIEW=1 (a preview deployment). It reads the request's
|
|
13
|
+
* cookies, which makes a route render on every request, so a production store must not set it.
|
|
14
|
+
*/
|
|
15
|
+
export const store = {
|
|
16
|
+
catalogKey,
|
|
17
|
+
baseUrl: process.env.NEXT_PUBLIC_SITE_URL ?? 'http://localhost:3000',
|
|
18
|
+
...(process.env.THROTTLE_PREVIEW === '1' ? { previewToken: getPreviewToken } : {}),
|
|
19
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NextConfig } from 'next';
|
|
2
|
+
|
|
3
|
+
// Nothing here sets a cache time. Pages are cached until the catalog changes and are cleared by the signed
|
|
4
|
+
// webhook (app/api/throttle/revalidate) and the open tab's check (app/api/throttle/sync). See README.md.
|
|
5
|
+
const nextConfig: NextConfig = {
|
|
6
|
+
poweredByHeader: false,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default nextConfig;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{name}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev",
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"start": "next start",
|
|
9
|
+
"typecheck": "tsc --noEmit"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"next": "^16.3.5",
|
|
13
|
+
"react": "^19.2.8",
|
|
14
|
+
"react-dom": "^19.2.8"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/node": "^20",
|
|
18
|
+
"@types/react": "^19",
|
|
19
|
+
"@types/react-dom": "^19",
|
|
20
|
+
"typescript": "^5"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { previewMiddleware } from '@usethrottle/catalog/next';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Next 16's `proxy` (the former `middleware`). The dashboard's preview opens the store with
|
|
5
|
+
* ?throttle_preview=<token>. This moves the token into an HTTP-only cookie and redirects to the same URL
|
|
6
|
+
* without it. It runs only for a request that carries the token, so ordinary traffic never reaches it.
|
|
7
|
+
*/
|
|
8
|
+
export function proxy(request: Request) {
|
|
9
|
+
return previewMiddleware(request) ?? undefined;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const config = {
|
|
13
|
+
matcher: [{ source: '/((?!_next/|api/).*)', has: [{ type: 'query', key: 'throttle_preview' }] }],
|
|
14
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
+
"allowJs": false,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"module": "esnext",
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"jsx": "react-jsx",
|
|
15
|
+
"plugins": [{ "name": "next" }],
|
|
16
|
+
"paths": { "@/*": ["./*"] }
|
|
17
|
+
},
|
|
18
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
19
|
+
"exclude": ["node_modules"]
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
# Build mode (--builder-mode build). `next build` reads the Builder once and writes .builder/release.json; the running store never calls it.
|
|
3
|
+
# THROTTLE_BUILDER_KEY the Builder build key: the publishable key of a SERVER channel (tb_pk_...), or a secret key
|
|
4
|
+
# holding releases:read. Needed by `next build` only (set it here and on your host's build);
|
|
5
|
+
# never a NEXT_PUBLIC_ variable.
|
|
6
|
+
# THROTTLE_MEDIA_ORIGIN the https origin your Builder images are served from. Images on any other origin are not drawn,
|
|
7
|
+
# and a page has no og:image (share image) without it.
|
|
8
|
+
# NEXT_PUBLIC_SITE_URL (above) is also the origin of the canonical links and the sitemap of your Builder pages.
|
|
9
|
+
# BUILDER_RELEASE_ID optional: build this release instead of the newest (a rebuild of an older release)
|
|
10
|
+
# THROTTLE_BUILDER_KEY=
|
|
11
|
+
# THROTTLE_MEDIA_ORIGIN=
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
## Builder build mode (this store was created with `--builder-mode build`)
|
|
3
|
+
|
|
4
|
+
- The Builder is read once, by `next build` (`next.config.ts` writes `.builder/release.json`). Everything else, the pages, the
|
|
5
|
+
root layout and `app/sitemap.ts`, renders from that file through `lib/builder.ts` (`createBuilderClient({ mode: 'build' })`).
|
|
6
|
+
Do not call the Builder at request time, do not give `BuilderProvider` a `builderKey`, and do not use the live client
|
|
7
|
+
(`@usethrottle/builder` without `mode: 'build'`).
|
|
8
|
+
- Keep `outputFileTracingIncludes` in `next.config.ts`: without it the file is not in the deployed output and a cold
|
|
9
|
+
instance has no release to render, and a store with no release file fails on purpose instead of downloading the release.
|
|
10
|
+
An API route that renders pages or reads the Builder client must be added to it (the `/api` routes are left out).
|
|
11
|
+
- Keep `generateStaticParams` and `dynamicParams = false` in `app/pages/[handle]/page.tsx`: they are what makes a release
|
|
12
|
+
a single build with no Builder-driven ISR writes. The cap on prerendered pages that applies to catalog products does not apply
|
|
13
|
+
to a release. A renamed page's redirect lives in `next.config.ts`, because `dynamicParams = false` would 404 it first.
|
|
14
|
+
- `THROTTLE_BUILDER_KEY` is a build secret: never a `NEXT_PUBLIC_` variable.
|
|
15
|
+
- Keep `cachePolicy: { settings: '525600m' }` in `app/layout.tsx`: without it the layout's settings read is an hour, and Next
|
|
16
|
+
renders every release page again each hour.
|