@takuhon/cli 0.25.0 → 1.0.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.
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/scaffold/deps.ts","../src/scaffold/vercel.ts","../src/scaffold/wrangler-toml.ts","../src/scaffold/index.ts","../src/scaffold/env-example.ts","../src/scaffold/gitignore.ts","../src/scaffold/package-json.ts","../src/scaffold/readme.ts","../src/scaffold/takuhon-json.ts","../src/scaffold/tsconfig-json.ts","../src/scaffold/worker-index-ts.ts"],"sourcesContent":["/**\n * Single source of truth for the `@takuhon/*` dependency range pinned into\n * every scaffolded project (Cloudflare and Vercel alike).\n *\n * Under 0.x semver a caret does not span minors, so a scaffolded project must\n * pin the same minor the CLI itself ships at — all `@takuhon/*` packages release\n * in lockstep. Advancing this one constant on each minor release keeps both\n * platform scaffolds in step; the `scaffold.test.ts` pin-guard derives the\n * expected range from the CLI's own version, so a missed bump fails CI.\n */\nexport const TAKUHON_DEP_RANGE = '^0.25.0';\n","/**\n * Generators for the `--platform vercel` scaffold.\n *\n * The Vercel scaffold is a minimal Next.js App Router project whose single\n * catch-all Route Handler mounts `@takuhon/vercel`'s `createTakuhonVercelApp`\n * via `hono/vercel`'s `handle`. It is read-only — no database, admin UI, or\n * auth, unlike the Cloudflare scaffold: the profile is the bundled\n * `takuhon.json`, edited in Git and redeployed. The Cloudflare-only files\n * (`wrangler.toml`, the Worker entry, the admin bundle) are intentionally\n * absent.\n */\n\nimport type { ContentLicenseFragment } from '../licenses.js';\n\nimport { TAKUHON_DEP_RANGE } from './deps.js';\n\n/**\n * Validate a Vercel project name (also used as the npm `name`).\n *\n * Vercel project names are lowercase, up to 100 chars, and may contain letters,\n * digits, `.`, `_`, and `-`; they must start and end with an alphanumeric. This\n * is deliberately looser than the Cloudflare Worker-name rule (which maps to a\n * `workers.dev` DNS label) but still a safe npm `name`.\n */\nexport function isValidVercelProjectName(name: string): boolean {\n return /^[a-z0-9](?:[a-z0-9._-]{0,98}[a-z0-9])?$/.test(name);\n}\n\nexport interface VercelPackageJsonOptions {\n /** Used for the npm `name` field. */\n readonly projectName: string;\n}\n\nexport function buildVercelPackageJson(opts: VercelPackageJsonOptions): Record<string, unknown> {\n return {\n name: opts.projectName,\n version: '0.0.0',\n private: true,\n description: 'Takuhon profile deployment (Vercel).',\n scripts: {\n dev: 'next dev',\n build: 'next build',\n start: 'next start',\n },\n dependencies: {\n '@takuhon/vercel': TAKUHON_DEP_RANGE,\n hono: '^4.0.0',\n next: '^15.0.0',\n react: '^19.0.0',\n 'react-dom': '^19.0.0',\n },\n devDependencies: {\n '@types/node': '^22.0.0',\n typescript: '^5.7.0',\n },\n engines: {\n node: '>=22.0.0',\n },\n };\n}\n\nexport function renderVercelPackageJson(opts: VercelPackageJsonOptions): string {\n return `${JSON.stringify(buildVercelPackageJson(opts), null, 2)}\\n`;\n}\n\n/**\n * The catch-all Route Handler at `app/[[...route]]/route.ts`. The optional\n * catch-all matches `/` and every sub-path, so a single file serves the whole\n * public surface from `@takuhon/vercel`. `BundledTakuhonStorage` validates the\n * profile once at module load, so an invalid `takuhon.json` fails the build.\n */\nexport function renderVercelRouteTs(): string {\n return `import { BundledTakuhonStorage, createTakuhonVercelApp } from '@takuhon/vercel';\nimport { handle } from 'hono/vercel';\n\n// The project's own profile, bundled into the deployment. Edit takuhon.json and\n// redeploy (push to your Vercel-connected Git repo, or run \\`vercel\\`) to publish\n// changes — this adapter is read-only at runtime.\nimport takuhonJson from '../../takuhon.json';\n\nconst app = createTakuhonVercelApp({\n storage: new BundledTakuhonStorage(takuhonJson),\n});\n\nexport const GET = handle(app);\n`;\n}\n\n/** Minimal `next.config.mjs`. */\nexport function renderNextConfig(): string {\n return `/** @type {import('next').NextConfig} */\nconst nextConfig = {};\n\nexport default nextConfig;\n`;\n}\n\n/** `tsconfig.json` for the Next.js project (standard App Router settings). */\nexport function renderVercelTsconfigJson(): string {\n const config = {\n compilerOptions: {\n target: 'ES2022',\n lib: ['dom', 'dom.iterable', 'esnext'],\n allowJs: true,\n skipLibCheck: true,\n strict: true,\n noEmit: true,\n esModuleInterop: true,\n module: 'esnext',\n moduleResolution: 'bundler',\n resolveJsonModule: true,\n isolatedModules: true,\n jsx: 'preserve',\n incremental: true,\n plugins: [{ name: 'next' }],\n },\n include: ['next-env.d.ts', '**/*.ts', '**/*.tsx', '.next/types/**/*.ts'],\n exclude: ['node_modules'],\n };\n return `${JSON.stringify(config, null, 2)}\\n`;\n}\n\n/** `.gitignore` for a Next.js / Vercel project. */\nexport function renderVercelGitignore(): string {\n return `# Dependencies\nnode_modules/\n\n# Next.js build output\n.next/\nnext-env.d.ts\n\n# Vercel\n.vercel/\n\n# Environment variables (commit \\`.env.example\\` instead)\n.env\n.env.local\n.env.*.local\n\n# Logs\n*.log\nnpm-debug.log*\npnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# macOS\n.DS_Store\n`;\n}\n\n/** `.env.example` — only the optional remote-profile URL applies to Vercel. */\nexport function renderVercelEnvExample(): string {\n return `# ----------------------------------------------------------------\n# Local development variables for this Takuhon deployment (Vercel).\n#\n# This adapter is read-only: the profile is the bundled takuhon.json, edited in\n# Git. There are no admin tokens or KV/R2 bindings.\n# ----------------------------------------------------------------\n\n# Optional: fetch the profile from a URL at cold start instead of bundling it.\n# Leave unset to use the committed takuhon.json (the default). When set, switch\n# the route to UrlTakuhonStorage (see app/[[...route]]/route.ts).\n# TAKUHON_DATA_URL=https://example.com/takuhon.json\n`;\n}\n\nexport interface VercelReadmeOptions {\n readonly projectName: string;\n readonly license: ContentLicenseFragment;\n}\n\nfunction formatLicenseLine(license: ContentLicenseFragment): string {\n if (license.spdxId === 'Proprietary') {\n return '**Proprietary** — all rights reserved.';\n }\n if (license.url !== undefined) {\n return `[\\`${license.spdxId}\\`](${license.url})`;\n }\n return `\\`${license.spdxId}\\``;\n}\n\nexport function renderVercelReadme(opts: VercelReadmeOptions): string {\n const { projectName, license } = opts;\n const licenseLine = formatLicenseLine(license);\n return `# ${projectName}\n\nA [Takuhon](https://github.com/takuhon-dev/takuhon) profile deployment, running on [Vercel](https://vercel.com) via the read-only \\`@takuhon/vercel\\` adapter.\n\n> **Status**: pre-deploy. Edit \\`takuhon.json\\`, then deploy to Vercel.\n\n## What is Takuhon?\n\nTakuhon lets you own your profile as a portable JSON document and publish it as a mobile-first profile page plus a public API (JSON-LD for AI agents and search engines included).\n\n## How it works\n\nThis project is a minimal Next.js App Router app. The catch-all route at\n\\`app/[[...route]]/route.ts\\` mounts \\`@takuhon/vercel\\`, which serves:\n\n- \\`/\\` and \\`/<locale>/\\` — the server-rendered profile page with embedded Schema.org JSON-LD\n- \\`/api/profile\\`, \\`/api/jsonld\\`, \\`/api/schema\\`\n- \\`/takuhon.json\\`, \\`/.well-known/takuhon.json\\`\n\nIt is **read-only**: there is no admin UI, auth, or database. Your profile is the\ncommitted \\`takuhon.json\\` — edit it and redeploy to publish changes. (Image\nuploads, the MCP endpoint, and the activity badge are Cloudflare-adapter\nfeatures; use \\`@takuhon/cloudflare\\` if you need them.)\n\n## Setup\n\n1. **Install dependencies.**\n\n \\`\\`\\`sh\n pnpm install\n \\`\\`\\`\n\n2. **Edit your profile.** Open \\`takuhon.json\\` and replace the sample fields (\\`profile.displayName\\`, \\`links\\`, \\`careers\\`, \\`projects\\`, \\`skills\\`) with your own.\n\n3. **Run it locally.**\n\n \\`\\`\\`sh\n pnpm dev\n \\`\\`\\`\n\n Open the printed URL: \\`/\\` serves your profile page and \\`/api/*\\` serves the JSON API.\n\n## Deploy\n\nPush this project to a Git repository connected to Vercel, or deploy from the CLI:\n\n\\`\\`\\`sh\nnpx vercel\n\\`\\`\\`\n\nTo publish changes later, edit \\`takuhon.json\\`, commit, and push — Vercel redeploys automatically.\n\n## License\n\nProfile content (\\`takuhon.json\\`) is licensed under ${licenseLine}\n\nThe deployment code is your own; pick a license appropriate for it.\n`;\n}\n","/**\n * Generator for `wrangler.toml` in a freshly scaffolded project.\n *\n * The layout mirrors the reference Cloudflare adapter shipped in this\n * monorepo: a single KV namespace `TAKUHON_KV`, placeholder ids the user\n * fills in after running `wrangler kv namespace create`, and the\n * `TAKUHON_ADMIN_ORIGIN` var defaulting to \"\" (disabled). The admin bearer\n * token is provisioned as a Wrangler secret and is therefore not in this file.\n */\n\n/**\n * Validate a Cloudflare Worker name.\n *\n * Cloudflare itself accepts mixed-case DNS labels (1–63 chars, must not\n * start or end with a hyphen). This validator additionally enforces a\n * lowercase convention chosen for the scaffolder so that the resulting\n * `workers.dev` subdomain is predictable and matches the npm `name` field.\n */\nexport function isValidWorkerName(name: string): boolean {\n return /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(name);\n}\n\n/**\n * In-project directory the admin SPA bundle is copied into and the scaffolded\n * `wrangler.toml` binds as `ASSETS`. Shared so the copy destination and the\n * `[assets] directory` value cannot drift apart. Defined in this leaf module\n * (which `scaffold/index.ts` already imports) to avoid an import cycle.\n */\nexport const ADMIN_DIST_DIRNAME = 'admin-dist';\n\n/**\n * Render `wrangler.toml` for the given project name.\n *\n * Throws if `projectName` is not a valid Cloudflare Worker name. Callers are\n * responsible for sanitising/validating earlier in the prompt flow.\n */\nexport function renderWranglerToml(projectName: string): string {\n if (!isValidWorkerName(projectName)) {\n throw new Error(\n `Invalid Cloudflare Worker name: \"${projectName}\". Names must be lowercase, ` +\n `start with a letter or digit, and contain only letters, digits, and hyphens (max 63 chars).`,\n );\n }\n return `name = \"${projectName}\"\nmain = \"src/index.ts\"\ncompatibility_date = \"2026-05-01\"\ncompatibility_flags = [\"nodejs_compat\"]\n\n# Admin SPA bundle. The React admin UI is committed in ./${ADMIN_DIST_DIRNAME}\n# (copied here when this project was created with create-takuhon) and served at\n# /admin.\n#\n# run_worker_first = true makes the Worker mediate every request: the bundle's\n# files sit at the assets root, so without this they would shadow the public \"/\"\n# route. The Worker serves the bundle only for /admin/* (attaching the strict\n# admin CSP) and handles everything else itself.\n#\n# SECURITY-CRITICAL: do not set run_worker_first to false or remove it. The\n# Worker is the only thing that attaches the strict admin CSP (plus HSTS /\n# no-store) to the admin assets; serving them directly would expose the admin UI\n# with no policy. To deploy without the form UI, remove this whole [assets]\n# block — the Worker then falls back to a minimal inline editor.\n[assets]\ndirectory = \"${ADMIN_DIST_DIRNAME}\"\nbinding = \"ASSETS\"\nrun_worker_first = true\nnot_found_handling = \"single-page-application\"\n\n# Replace the placeholder ids after running:\n# wrangler kv namespace create TAKUHON_KV\n# wrangler kv namespace create TAKUHON_KV --preview\n[[kv_namespaces]]\nbinding = \"TAKUHON_KV\"\nid = \"REPLACE_WITH_PRODUCTION_NAMESPACE_ID\"\npreview_id = \"REPLACE_WITH_PREVIEW_NAMESPACE_ID\"\n\n# Admin Origin allowlist (comma-separated). Empty value disables the check.\n# Example for production: TAKUHON_ADMIN_ORIGIN = \"https://admin.example.com\"\n#\n# The admin bearer token MUST be provisioned as a Wrangler secret, never in\n# this file:\n# wrangler secret put TAKUHON_ADMIN_TOKEN\n# Use 32+ bytes of entropy, e.g. \\`openssl rand -base64 32\\`.\n[vars]\nTAKUHON_ADMIN_ORIGIN = \"\"\n\n# Image uploads (optional). Bind an R2 bucket to enable \\`POST /api/admin/assets\\`\n# and \\`GET /assets/*\\` delivery; without it the upload endpoint stays\n# unregistered (404) and avatars remain URL-only. Create the bucket, then\n# uncomment:\n# wrangler r2 bucket create ${projectName}-assets\n# [[r2_buckets]]\n# binding = \"TAKUHON_R2\"\n# bucket_name = \"${projectName}-assets\"\n\n# Developer-activity dashboard (optional). Enable settings.activity in your\n# takuhon.json, then uncomment the cron below to refresh the snapshot daily:\n# the Worker's scheduled handler fetches GitHub / WakaTime and stores the\n# result in the TAKUHON_KV namespace (a failed run keeps the last-known\n# snapshot). Secrets MUST be Wrangler secrets, never this file:\n# wrangler secret put TAKUHON_GITHUB_TOKEN # optional (contribution calendar)\n# wrangler secret put TAKUHON_WAKATIME_KEY # required for WakaTime\n# [triggers]\n# crons = [\"17 3 * * *\"]\n`;\n}\n","/**\n * Top-level scaffolding orchestrator for `create-takuhon`.\n *\n * `writeProject` creates the target directory (must not already exist), then\n * writes the eight files that make up the scaffold: `takuhon.json`,\n * `wrangler.toml`, `package.json`, `README.md`, `.gitignore`, `.env.example`,\n * `tsconfig.json`, and `src/index.ts` (the Cloudflare Worker entry composed via\n * `createTakuhonWorker` from `@takuhon/cloudflare`).\n *\n * `copyAdminBundle` then copies the bundled admin SPA into the project's\n * `admin-dist/` so the Worker can serve the form UI at `/admin`. `init.ts`\n * calls both in sequence.\n */\n\nimport { cp, mkdir, writeFile } from 'node:fs/promises';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport type { ContentLicenseFragment } from '../licenses.js';\n\nimport { renderEnvExample } from './env-example.js';\nimport { renderGitignore } from './gitignore.js';\nimport { renderPackageJson } from './package-json.js';\nimport { renderReadme } from './readme.js';\nimport { renderTakuhonJson } from './takuhon-json.js';\nimport { renderTsconfigJson } from './tsconfig-json.js';\nimport {\n renderNextConfig,\n renderVercelEnvExample,\n renderVercelGitignore,\n renderVercelPackageJson,\n renderVercelReadme,\n renderVercelRouteTs,\n renderVercelTsconfigJson,\n} from './vercel.js';\nimport { renderWorkerIndexTs } from './worker-index-ts.js';\nimport { ADMIN_DIST_DIRNAME, renderWranglerToml } from './wrangler-toml.js';\n\n/** Target platform for a scaffolded project. */\nexport type ScaffoldPlatform = 'cloudflare' | 'vercel';\n\nexport interface WriteProjectOptions {\n /** Absolute path of the directory to create. Must not exist. */\n readonly targetDir: string;\n /** Used for the npm `name`, Worker name, and README header. */\n readonly projectName: string;\n /** Chosen content license (already mapped via `buildContentLicense`). */\n readonly license: ContentLicenseFragment;\n /** Target platform. Defaults to `'cloudflare'` (backwards-compatible). */\n readonly platform?: ScaffoldPlatform;\n}\n\nexport interface WriteProjectResult {\n /** Relative paths of files that were written (in the order written). */\n readonly files: readonly string[];\n}\n\n/**\n * Error thrown when the target directory already exists. The caller is\n * expected to render a friendly message that references the user-supplied\n * path; the `code` is stable for tests. The absolute `targetDir` is exposed\n * as a field rather than embedded in the message so that bubbling the error\n * up through generic logging does not leak filesystem layout.\n */\nexport class TargetDirectoryExistsError extends Error {\n override readonly name = 'TargetDirectoryExistsError';\n readonly code = 'TARGET_EXISTS' as const;\n constructor(readonly targetDir: string) {\n super('Target directory already exists.');\n }\n}\n\n/**\n * Create the project directory and write the scaffolded files. Order is\n * deterministic so callers (and tests) can rely on it.\n */\nexport async function writeProject(opts: WriteProjectOptions): Promise<WriteProjectResult> {\n const { targetDir, projectName, license, platform = 'cloudflare' } = opts;\n\n // mkdir with recursive: false fails if the directory exists; we surface a\n // typed error so the CLI entry can render a friendly message.\n try {\n await mkdir(targetDir, { recursive: false });\n } catch (err) {\n if (isNodeErrnoException(err) && err.code === 'EEXIST') {\n throw new TargetDirectoryExistsError(targetDir);\n }\n throw err;\n }\n\n const files: { readonly path: string; readonly content: string }[] =\n platform === 'vercel'\n ? [\n { path: 'takuhon.json', content: renderTakuhonJson(license) },\n { path: 'package.json', content: renderVercelPackageJson({ projectName }) },\n { path: 'README.md', content: renderVercelReadme({ projectName, license }) },\n { path: '.gitignore', content: renderVercelGitignore() },\n { path: '.env.example', content: renderVercelEnvExample() },\n { path: 'tsconfig.json', content: renderVercelTsconfigJson() },\n { path: 'next.config.mjs', content: renderNextConfig() },\n { path: 'app/[[...route]]/route.ts', content: renderVercelRouteTs() },\n ]\n : [\n { path: 'takuhon.json', content: renderTakuhonJson(license) },\n { path: 'wrangler.toml', content: renderWranglerToml(projectName) },\n { path: 'package.json', content: renderPackageJson({ projectName }) },\n { path: 'README.md', content: renderReadme({ projectName, license }) },\n { path: '.gitignore', content: renderGitignore() },\n { path: '.env.example', content: renderEnvExample() },\n { path: 'tsconfig.json', content: renderTsconfigJson() },\n { path: 'src/index.ts', content: renderWorkerIndexTs() },\n ];\n\n for (const { path, content } of files) {\n const fullPath = join(targetDir, path);\n const parent = dirname(fullPath);\n if (parent !== targetDir) {\n await mkdir(parent, { recursive: true });\n }\n await writeFile(fullPath, content, 'utf8');\n }\n\n return { files: files.map((f) => f.path) };\n}\n\nfunction isNodeErrnoException(err: unknown): err is NodeJS.ErrnoException {\n return err instanceof Error && typeof (err as NodeJS.ErrnoException).code === 'string';\n}\n\n/**\n * Resolve the admin SPA bundle that ships inside this package. The bundle is\n * copied here from `apps/admin/dist` at build time (see\n * `scripts/copy-admin-bundle.mjs`) and listed in the package's `files`, so it\n * is present in the published `@takuhon/cli` tarball. Resolved relative to the\n * compiled module (`dist/init.js` or `dist/index.js`), whose sibling is\n * `admin-bundle/`.\n */\nexport function resolveAdminBundleDir(): string {\n return fileURLToPath(new URL('../admin-bundle', import.meta.url));\n}\n\nexport interface CopyAdminBundleOptions {\n /** Project directory previously created by {@link writeProject}. */\n readonly targetDir: string;\n /**\n * Source bundle directory. Defaults to the bundle shipped in this package\n * ({@link resolveAdminBundleDir}); overridable for tests.\n */\n readonly bundleDir?: string;\n}\n\nexport interface CopyAdminBundleResult {\n /** Absolute path of the directory the bundle was copied into. */\n readonly dest: string;\n}\n\n/**\n * Copy the admin SPA bundle into the scaffolded project's\n * `{@link ADMIN_DIST_DIRNAME}` directory. The generated `wrangler.toml` binds\n * this directory as `ASSETS`, and the Cloudflare Worker serves it at `/admin`\n * under a strict CSP (falling back to an inline editor when the binding is\n * absent). Kept separate from {@link writeProject} so the static-asset copy and\n * the generated-file rendering are independently testable.\n */\nexport async function copyAdminBundle(\n opts: CopyAdminBundleOptions,\n): Promise<CopyAdminBundleResult> {\n const bundleDir = opts.bundleDir ?? resolveAdminBundleDir();\n const dest = join(opts.targetDir, ADMIN_DIST_DIRNAME);\n try {\n await cp(bundleDir, dest, { recursive: true });\n } catch (err) {\n // The bundle ships inside @takuhon/cli, so a failure here means a broken\n // or incomplete install. Surface a sanitized message — the raw error would\n // embed the absolute node_modules path of this package.\n const code = isNodeErrnoException(err) ? ` (${err.code})` : '';\n throw new Error(\n `Failed to copy the admin UI bundle from @takuhon/cli${code}. ` +\n `Reinstall or upgrade @takuhon/cli and try again.`,\n { cause: err },\n );\n }\n return { dest };\n}\n","/**\n * Generator for the `.env.example` file in a freshly scaffolded project.\n *\n * The Wrangler-managed secrets (admin bearer token) are *not* read from `.env`\n * at deploy time — `wrangler secret put` is the source of truth. The\n * `.env.example` is therefore documentation: it lists the variables a developer\n * may want locally (e.g. for scripting or for the wrangler CLI itself) and\n * links each to its production provisioning path.\n */\n\nexport function renderEnvExample(): string {\n return `# ----------------------------------------------------------------\n# Local development variables for this Takuhon deployment.\n#\n# Production secrets (admin token) are provisioned via:\n# wrangler secret put TAKUHON_ADMIN_TOKEN\n# This file is a hint for local tooling, not a runtime source.\n# ----------------------------------------------------------------\n\n# Admin bearer token for /api/admin/* endpoints.\n# Generate with: openssl rand -base64 32\n# Then provision with:\n# echo \"$TAKUHON_ADMIN_TOKEN\" | wrangler secret put TAKUHON_ADMIN_TOKEN\nTAKUHON_ADMIN_TOKEN=\n\n# Comma-separated Origin allowlist for browser-originating admin requests.\n# Set in wrangler.toml [vars] for production. Local example:\n# TAKUHON_ADMIN_ORIGIN=https://admin.example.com,https://localhost:8787\nTAKUHON_ADMIN_ORIGIN=\n\n# Developer-activity sync secrets (only needed when settings.activity is\n# enabled in takuhon.json). Used by \\`takuhon activity sync\\` locally; for a\n# deployed Worker provision them as Wrangler secrets instead:\n# wrangler secret put TAKUHON_GITHUB_TOKEN\n# wrangler secret put TAKUHON_WAKATIME_KEY\n# Never commit the real values.\n#\n# Optional GitHub token: languages work without it; the contribution calendar\n# requires it (minimal read-only scope is enough).\nTAKUHON_GITHUB_TOKEN=\n# WakaTime API key (https://wakatime.com/settings/api-key); required to read\n# coding time.\nTAKUHON_WAKATIME_KEY=\n\n# Cloudflare account id (look up via \\`wrangler whoami\\`). Only needed if you\n# script Cloudflare API calls outside Wrangler itself.\nCLOUDFLARE_ACCOUNT_ID=\n`;\n}\n","/**\n * Generator for the scaffolded project's `.gitignore`.\n *\n * Covers Node, Wrangler local cache, and environment files. Kept conservative\n * — no opinions about lockfile preferences (the user picks their package\n * manager) or editor folders (per-editor patterns belong in a global ignore).\n */\n\nexport function renderGitignore(): string {\n return `# Dependencies\nnode_modules/\n\n# Wrangler local cache (do not commit; contains bundled output and tmp files)\n.wrangler/\n\n# Environment variables (commit \\`.env.example\\` instead)\n.env\n.env.local\n.env.*.local\n\n# Logs\n*.log\nnpm-debug.log*\npnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# macOS\n.DS_Store\n`;\n}\n","/**\n * Generator for the scaffolded project's `package.json`.\n *\n * Pinned dependency versions are caret ranges matched to the current\n * minor of the published `@takuhon/*` packages. Under 0.x semver, a caret\n * does not span minor versions, so the range must move forward with each\n * `@takuhon/core` minor release to keep scaffolded projects on the\n * matching schema generation. A guard test (`scaffold.test.ts`) asserts these\n * pins track the published minor, so a missed bump fails CI rather than\n * silently shipping a stale range. `hono` is included as a direct dependency for\n * projects that extend the Worker with their own Hono routes; the generated\n * `src/index.ts` reaches Takuhon's handlers through `@takuhon/cloudflare`\n * rather than importing `hono` directly. `wrangler` is a devDependency since\n * it's the deploy / dev-server tool.\n */\n\nimport { TAKUHON_DEP_RANGE } from './deps.js';\n\nexport interface PackageJsonOptions {\n /** Used for the npm `name` field. */\n readonly projectName: string;\n}\n\nexport function buildPackageJson(opts: PackageJsonOptions): Record<string, unknown> {\n return {\n name: opts.projectName,\n version: '0.0.0',\n private: true,\n type: 'module',\n description: 'Takuhon profile deployment.',\n scripts: {\n dev: 'wrangler dev',\n deploy: 'wrangler deploy',\n },\n dependencies: {\n '@takuhon/api': TAKUHON_DEP_RANGE,\n '@takuhon/cloudflare': TAKUHON_DEP_RANGE,\n '@takuhon/core': TAKUHON_DEP_RANGE,\n hono: '^4.0.0',\n },\n devDependencies: {\n wrangler: '^4.0.0',\n },\n engines: {\n node: '>=22.0.0',\n },\n };\n}\n\nexport function renderPackageJson(opts: PackageJsonOptions): string {\n return `${JSON.stringify(buildPackageJson(opts), null, 2)}\\n`;\n}\n","/**\n * Generator for the README.md placed in a freshly scaffolded project.\n *\n * Aims to give a first-time user enough to (1) install dependencies,\n * (2) fill in their profile data, (3) provision Cloudflare KV + admin\n * secret, and (4) `pnpm dev` / `pnpm deploy`. Cross-references the published\n * `@takuhon/cloudflare` adapter README as the next-step reference for the\n * route map.\n */\n\nimport type { ContentLicenseFragment } from '../licenses.js';\n\nexport interface ReadmeOptions {\n readonly projectName: string;\n readonly license: ContentLicenseFragment;\n}\n\n/**\n * Human-readable license attribution line for the README footer. Uses the\n * canonical URL when available; falls back to plain SPDX (or\n * \"All rights reserved\" for Proprietary).\n */\nfunction formatLicenseLine(license: ContentLicenseFragment): string {\n if (license.spdxId === 'Proprietary') {\n return '**Proprietary** — all rights reserved.';\n }\n if (license.url !== undefined) {\n return `[\\`${license.spdxId}\\`](${license.url})`;\n }\n return `\\`${license.spdxId}\\``;\n}\n\nexport function renderReadme(opts: ReadmeOptions): string {\n const { projectName, license } = opts;\n const licenseLine = formatLicenseLine(license);\n return `# ${projectName}\n\nA [Takuhon](https://github.com/takuhon-dev/takuhon) profile deployment, running on Cloudflare Workers.\n\n> **Status**: pre-deploy. Edit \\`takuhon.json\\`, provision Cloudflare KV, then \\`pnpm deploy\\`.\n\n## What is Takuhon?\n\nTakuhon lets you own your profile as a portable JSON document and publish it as a mobile-first profile page plus a public API (JSON-LD for AI agents and search engines included).\n\n## Setup\n\n1. **Install dependencies.**\n\n \\`\\`\\`sh\n pnpm install\n \\`\\`\\`\n\n2. **Edit your profile.** Open \\`takuhon.json\\` and replace the sample fields (\\`profile.displayName\\`, \\`links\\`, \\`careers\\`, \\`projects\\`, \\`skills\\`) with your own.\n\n3. **Create the Cloudflare KV namespaces** and copy the returned ids into \\`wrangler.toml\\`:\n\n \\`\\`\\`sh\n npx wrangler kv namespace create TAKUHON_KV\n npx wrangler kv namespace create TAKUHON_KV --preview\n \\`\\`\\`\n\n4. **Provision the admin token** as a Wrangler secret (used by \\`/api/admin/*\\`):\n\n \\`\\`\\`sh\n openssl rand -base64 32 | npx wrangler secret put TAKUHON_ADMIN_TOKEN\n \\`\\`\\`\n\n Leaving the secret unset disables admin writes entirely (every \\`PUT\\` / \\`DELETE\\` returns 401).\n\n## Develop\n\nThe Worker entry at \\`src/index.ts\\` composes the takuhon adapter via\n\\`createTakuhonWorker\\` and serves your \\`takuhon.json\\` as the fallback when\nKV has no stored profile yet.\n\n\\`\\`\\`sh\npnpm dev # runs \\`wrangler dev\\` locally\n\\`\\`\\`\n\nOpen the local URL it prints: the root serves your **profile page** — the same HTML a visitor and search-engine crawlers see in production, with Schema.org JSON-LD embedded — and the JSON API lives under \\`/api/*\\`. The full route map (public + admin) is documented in the [\\`@takuhon/cloudflare\\` README](https://github.com/takuhon-dev/takuhon/tree/main/adapters/cloudflare#readme).\n\n## Admin\n\nThe admin form UI is served at \\`/admin\\` under a strict Content-Security-Policy. Its compiled bundle is committed in \\`admin-dist/\\` and bound as Workers Assets in \\`wrangler.toml\\`. Sign in with the admin token you set as the \\`TAKUHON_ADMIN_TOKEN\\` Wrangler secret.\n\nThe bundle is a snapshot taken when this project was created. To pick up a newer admin UI, upgrade your \\`takuhon\\` CLI and run \\`takuhon admin update\\` in this project — it replaces \\`admin-dist/\\` with the bundle shipped in your installed \\`@takuhon/cli\\` (keep your \\`@takuhon/*\\` dependencies on a matching version). To deploy without the form UI, remove the \\`[assets]\\` block from \\`wrangler.toml\\`; the Worker then falls back to a minimal inline editor.\n\n### Image uploads (optional)\n\nImage uploads are off until you bind an R2 bucket. Create one and uncomment the \\`[[r2_buckets]]\\` block in \\`wrangler.toml\\`:\n\n\\`\\`\\`sh\nnpx wrangler r2 bucket create ${projectName}-assets\n\\`\\`\\`\n\nThe Worker then accepts uploads at \\`POST /api/admin/assets\\` (magic-byte check, 5 MB / 4096px limits, EXIF/metadata stripping) and serves them at \\`GET /assets/*\\` with \\`X-Content-Type-Options: nosniff\\`. Without the binding, avatars stay URL-only.\n\n### Developer-activity dashboard (optional)\n\nShow your GitHub language mix / contribution calendar and WakaTime coding time on the profile. The data is synced into a snapshot ahead of time — rendering never calls GitHub or WakaTime, and the API keys never leave the sync step.\n\n1. Opt in by adding \\`settings.activity\\` to \\`takuhon.json\\`:\n\n \\`\\`\\`jsonc\n \"settings\": {\n \"activity\": {\n \"enabled\": true,\n \"github\": { \"username\": \"your-github-login\" },\n \"wakatime\": { \"username\": \"your-wakatime-username\" }\n }\n }\n \\`\\`\\`\n\n2. Provision the sync secrets (see \\`.env.example\\`): \\`TAKUHON_WAKATIME_KEY\\` is required for coding time; \\`TAKUHON_GITHUB_TOKEN\\` is optional — languages work without it, the contribution calendar needs it.\n\n \\`\\`\\`sh\n npx wrangler secret put TAKUHON_GITHUB_TOKEN\n npx wrangler secret put TAKUHON_WAKATIME_KEY\n \\`\\`\\`\n\n3. Uncomment the \\`[triggers]\\` cron block in \\`wrangler.toml\\` so the Worker refreshes the snapshot daily, or run \\`takuhon activity sync\\` locally to write an \\`activity.json\\` next to your profile for \\`takuhon build\\` / \\`dev\\`.\n\nThe snapshot is served at \\`GET /api/activity\\` while enabled; a failed sync keeps the last-known data.\n\n### GitHub profile badge\n\nThe activity card is also available as a standalone SVG you can embed as an image — e.g. in your GitHub profile \\`README.md\\`:\n\n\\`\\`\\`md\n![My developer activity](https://your-worker.example/activity.svg)\n\\`\\`\\`\n\nTwo ways to host it (both require \\`settings.activity.enabled\\`):\n\n- **Dynamic (Worker):** \\`GET /activity.svg\\` renders the latest snapshot on every request. Add \\`?theme=dark\\` for the dark card.\n- **Static (\\`takuhon build\\`):** writes \\`dist/activity.svg\\` and \\`dist/activity-dark.svg\\` beside the pages, so a static deploy can serve the badge too.\n\nThe card carries an opaque background, so it stays readable on either GitHub theme. To follow the viewer's OS colour scheme automatically, use \\`<picture>\\`:\n\n\\`\\`\\`html\n<picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://your-worker.example/activity.svg?theme=dark\">\n <img alt=\"My developer activity\" src=\"https://your-worker.example/activity.svg\">\n</picture>\n\\`\\`\\`\n\nGitHub proxies the image through Camo and caches it for a few hours, so a fresh sync can take a little while to appear in your README.\n\n## Résumé / CV (optional)\n\nGenerate a print-ready CV from the same \\`takuhon.json\\` — no re-entry:\n\n\\`\\`\\`sh\nnpx takuhon build --cv\n\\`\\`\\`\n\nThis writes \\`dist/cv.html\\` (and \\`dist/<locale>/cv.html\\` for each locale) alongside the profile pages. Open it in a browser and use **Print → Save as PDF** to produce a résumé PDF. \\`npx takuhon dev\\` also serves it at \\`/cv\\` for previewing.\n\n## AI agents (MCP)\n\nYour profile is readable over the [Model Context Protocol](https://modelcontextprotocol.io) — read-only, the same data the public API exposes (with the privacy filter applied), no write access.\n\n- **Deployed:** the Worker serves a stateless MCP endpoint at \\`POST /mcp\\` (no extra binding or setup). Point an MCP client at \\`https://your-worker.example/mcp\\`. It is also advertised as \\`mcp\\` in \\`/.well-known/takuhon.json\\`.\n- **Local:** run an MCP server over stdio against your \\`takuhon.json\\`, e.g. for Claude Desktop:\n\n \\`\\`\\`jsonc\n // claude_desktop_config.json\n {\n \"mcpServers\": {\n \"my-profile\": { \"command\": \"npx\", \"args\": [\"takuhon\", \"mcp\", \"/path/to/takuhon.json\"] }\n }\n }\n \\`\\`\\`\n\nBoth expose the tools \\`get_profile\\`, \\`get_section\\`, \\`get_jsonld\\`, \\`list_locales\\` and the resources \\`takuhon://profile\\`, \\`takuhon://schema\\`.\n\n## Deploy\n\n\\`\\`\\`sh\npnpm deploy # runs \\`wrangler deploy\\`\n\\`\\`\\`\n\nOnce deployed, your Worker's root URL serves the **mobile profile page** with Schema.org JSON-LD embedded for search engines and AI agents; \\`/<locale>/\\` serves each translated page, and the JSON API stays under \\`/api/*\\`. Edits made in \\`/admin\\` appear on the page immediately.\n\n## License\n\nProfile content (\\`takuhon.json\\`) is licensed under ${licenseLine}\n\nThe deployment code is your own; pick a license appropriate for it.\n`;\n}\n","/**\n * Generator for the `takuhon.json` file written into a freshly scaffolded\n * project.\n *\n * The template is a copy of `examples/minimal-profile/takuhon.json` from the\n * monorepo. It is inlined here as a TypeScript constant rather than imported\n * from `examples/` so the published `@takuhon/cli` npm package does not need\n * to ship the examples directory.\n *\n * Only `meta.contentLicense` is rewritten per the user's choice; everything\n * else is the canonical minimal profile (one career, one project, three\n * skills, `en` locale only) that downstream `@takuhon/core` validation\n * already accepts (see `packages/core/src/__tests__/examples-fixtures.test.ts`).\n */\n\nimport type { ContentLicenseFragment } from '../licenses.js';\n\n/**\n * Build the `takuhon.json` payload as a deterministic, schema-valid object.\n * `meta.contentLicense` is filled from the supplied fragment so each\n * generated project carries the user's chosen SPDX identifier (and `url` /\n * `rights` where applicable).\n */\nexport function buildTakuhonJson(license: ContentLicenseFragment): unknown {\n return {\n schemaVersion: '0.7.0',\n profile: {\n displayName: {\n en: 'Sam Lee',\n },\n },\n links: [\n {\n id: 'github',\n type: 'github',\n url: 'https://example.com/github/sam-lee',\n featured: true,\n },\n ],\n careers: [\n {\n id: 'first-job',\n organization: {\n en: 'Example Co.',\n },\n role: {\n en: 'Junior Software Engineer',\n },\n startDate: '2026-04',\n endDate: null,\n isCurrent: true,\n },\n ],\n projects: [\n {\n id: 'personal-homepage',\n title: {\n en: 'Personal homepage',\n },\n },\n ],\n skills: [\n { id: 'html', label: 'HTML' },\n { id: 'css', label: 'CSS' },\n { id: 'javascript', label: 'JavaScript' },\n ],\n contact: {},\n settings: {\n defaultLocale: 'en',\n availableLocales: ['en'],\n },\n meta: {\n contentLicense: { ...license },\n },\n };\n}\n\n/** Serialise to a UTF-8 string with trailing newline (POSIX-friendly). */\nexport function renderTakuhonJson(license: ContentLicenseFragment): string {\n return `${JSON.stringify(buildTakuhonJson(license), null, 2)}\\n`;\n}\n","/**\n * Generator for the scaffolded project's `tsconfig.json`.\n *\n * Minimal configuration that makes the generated `src/index.ts` typecheck\n * with `tsc --noEmit` in a freshly scaffolded directory. The settings\n * mirror the upstream takuhon monorepo defaults (ES2022 target, ESNext\n * modules, strict mode, `noUncheckedIndexedAccess`) and explicitly enable\n * the two flags the Worker entry depends on:\n *\n * - `resolveJsonModule` — so `import takuhonJson from '../takuhon.json'`\n * resolves at type-check time.\n * - `moduleResolution: \"Bundler\"` — so the Wrangler / esbuild-style\n * resolution (no need for explicit file extensions) is the source of\n * truth that matches what `wrangler dev` actually runs.\n *\n * `noEmit: true` keeps `tsc` purely a type-checker; Wrangler's bundler\n * produces the deployable artifact.\n */\n\nexport function renderTsconfigJson(): string {\n const config = {\n compilerOptions: {\n target: 'ES2022',\n lib: ['ES2022'],\n module: 'ESNext',\n moduleResolution: 'Bundler',\n esModuleInterop: true,\n resolveJsonModule: true,\n isolatedModules: true,\n verbatimModuleSyntax: true,\n strict: true,\n noUncheckedIndexedAccess: true,\n noImplicitOverride: true,\n noFallthroughCasesInSwitch: true,\n skipLibCheck: true,\n noEmit: true,\n },\n include: ['src/**/*'],\n exclude: ['node_modules'],\n };\n return `${JSON.stringify(config, null, 2)}\\n`;\n}\n","/**\n * Generator for `src/index.ts` — the Cloudflare Worker entry file written\n * into a freshly scaffolded project.\n *\n * The generated file uses `createTakuhonWorker()` from `@takuhon/cloudflare`\n * so the scaffolded project does not need to know the internal wiring\n * (Hono router, KV-backed storage, edge cache purger, console audit logger).\n * The user's own `takuhon.json` is loaded via an ES module JSON import,\n * validated once at module load, and the resulting `Takuhon` value is\n * served as the fallback when KV has no stored profile yet.\n *\n * `wrangler.toml`'s `main` field already points at `src/index.ts`, and\n * `nodejs_compat` is enabled, so the file works under `wrangler dev` /\n * `wrangler deploy` without further configuration.\n */\n\nexport function renderWorkerIndexTs(): string {\n return `import { createTakuhonWorker } from '@takuhon/cloudflare';\nimport { validate } from '@takuhon/core';\n\n// Use the project's own takuhon.json as the fallback served when KV has no\n// stored profile yet. Validated once at module load so a malformed profile\n// fails fast rather than at first request.\nimport takuhonJson from '../takuhon.json' with { type: 'json' };\n\nconst fallback = validate(takuhonJson);\nif (!fallback.ok) {\n throw new Error(\n 'Project takuhon.json failed validation: ' +\n fallback.errors.map((e) => \\`\\${e.pointer}: \\${e.message}\\`).join('; '),\n );\n}\n\nconst fallbackTakuhon = fallback.data;\n\nexport default createTakuhonWorker({\n fallback: () => fallbackTakuhon,\n});\n`;\n}\n"],"mappings":";AAUO,IAAM,oBAAoB;;;ACc1B,SAAS,yBAAyB,MAAuB;AAC9D,SAAO,2CAA2C,KAAK,IAAI;AAC7D;AAOO,SAAS,uBAAuB,MAAyD;AAC9F,SAAO;AAAA,IACL,MAAM,KAAK;AAAA,IACX,SAAS;AAAA,IACT,SAAS;AAAA,IACT,aAAa;AAAA,IACb,SAAS;AAAA,MACP,KAAK;AAAA,MACL,OAAO;AAAA,MACP,OAAO;AAAA,IACT;AAAA,IACA,cAAc;AAAA,MACZ,mBAAmB;AAAA,MACnB,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IACf;AAAA,IACA,iBAAiB;AAAA,MACf,eAAe;AAAA,MACf,YAAY;AAAA,IACd;AAAA,IACA,SAAS;AAAA,MACP,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAEO,SAAS,wBAAwB,MAAwC;AAC9E,SAAO,GAAG,KAAK,UAAU,uBAAuB,IAAI,GAAG,MAAM,CAAC,CAAC;AAAA;AACjE;AAQO,SAAS,sBAA8B;AAC5C,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcT;AAGO,SAAS,mBAA2B;AACzC,SAAO;AAAA;AAAA;AAAA;AAAA;AAKT;AAGO,SAAS,2BAAmC;AACjD,QAAM,SAAS;AAAA,IACb,iBAAiB;AAAA,MACf,QAAQ;AAAA,MACR,KAAK,CAAC,OAAO,gBAAgB,QAAQ;AAAA,MACrC,SAAS;AAAA,MACT,cAAc;AAAA,MACd,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,kBAAkB;AAAA,M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