@alxia/create 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +37 -6
  2. package/dist/copy.d.ts +24 -0
  3. package/dist/copy.d.ts.map +1 -0
  4. package/dist/index.js +61 -281
  5. package/dist/index.js.map +8 -9
  6. package/dist/main.d.ts.map +1 -1
  7. package/dist/registry.d.ts +28 -7
  8. package/dist/registry.d.ts.map +1 -1
  9. package/dist/versions.d.ts +0 -2
  10. package/dist/versions.d.ts.map +1 -1
  11. package/dist/write.d.ts +2 -1
  12. package/dist/write.d.ts.map +1 -1
  13. package/docs/README.md +3 -3
  14. package/docs/guide.md +104 -27
  15. package/docs/roadmap.md +35 -9
  16. package/docs/troubleshooting.md +58 -63
  17. package/package.json +5 -3
  18. package/templates/api/.dockerignore +6 -0
  19. package/templates/api/.env.example +3 -0
  20. package/templates/api/Dockerfile +22 -0
  21. package/templates/api/README.md +64 -0
  22. package/templates/api/gitignore +6 -0
  23. package/templates/api/package.json +21 -0
  24. package/templates/api/src/app.spec.ts +46 -0
  25. package/templates/api/src/app.ts +33 -0
  26. package/templates/api/src/server.ts +4 -0
  27. package/templates/api/tsconfig.json +25 -0
  28. package/templates/react-router/.dockerignore +4 -0
  29. package/templates/react-router/Dockerfile +29 -0
  30. package/templates/react-router/README.md +87 -0
  31. package/templates/react-router/_bunfig.toml +4 -0
  32. package/templates/react-router/app/app.css +15 -0
  33. package/templates/react-router/app/root.tsx +75 -0
  34. package/templates/react-router/app/routes/home.tsx +13 -0
  35. package/templates/react-router/app/routes.ts +3 -0
  36. package/templates/react-router/app/welcome/logo-dark.svg +23 -0
  37. package/templates/react-router/app/welcome/logo-light.svg +23 -0
  38. package/templates/react-router/app/welcome/welcome.tsx +89 -0
  39. package/templates/react-router/gitignore +7 -0
  40. package/templates/react-router/package.json +31 -0
  41. package/templates/react-router/public/favicon.ico +0 -0
  42. package/templates/react-router/react-router.config.ts +7 -0
  43. package/templates/react-router/tsconfig.json +26 -0
  44. package/templates/react-router/vite.config.ts +11 -0
  45. package/dist/templates/api.d.ts +0 -16
  46. package/dist/templates/api.d.ts.map +0 -1
  47. package/dist/templates/react-router.d.ts +0 -26
  48. package/dist/templates/react-router.d.ts.map +0 -1
package/dist/index.js.map CHANGED
@@ -1,19 +1,18 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/main.ts", "../src/args.ts", "../src/target.ts", "../src/templates/react-router.ts", "../src/versions.ts", "../src/write.ts", "../src/registry.ts", "../src/templates/api.ts", "../src/io.ts", "../src/index.ts"],
3
+ "sources": ["../src/main.ts", "../src/args.ts", "../src/target.ts", "../src/versions.ts", "../src/write.ts", "../src/copy.ts", "../src/registry.ts", "../src/io.ts", "../src/index.ts"],
4
4
  "sourcesContent": [
5
- "/**\n * The `create-alxia` command: its arguments or answers, the project it\n * writes, what it prints, and its exit code. `index.ts` runs it on the\n * process's own streams; a spec runs it on its own.\n */\nimport { stat } from 'node:fs/promises';\nimport { relative, resolve } from 'node:path';\nimport { isTemplate, NAME, parseArgs, TEMPLATES, type Template } from './args';\nimport type { Io } from './io';\nimport { clean, refusal } from './target';\nimport { ScaffoldChanged } from './templates/react-router';\nimport { alxiaRanges } from './versions';\nimport { write } from './write';\n\nexport { NAME } from './args';\nexport type { Io } from './io';\nexport { processIo } from './io';\nexport { packageName, refusal } from './target';\n\nexport const USAGE = `Usage: bun create @alxia [dir] [options]\n\nWrites a new alxia app in dir, which must be empty or not exist yet. Asks\nfor what is not given.\n\nOptions:\n -t, --template <name> api an alxia app with Zod, a spec and the typed client\n react-router React Router's official template, served by alxia\n --no-install write the files, skip bun install\n -h, --help show this help`;\n\n/** Runs the command in `cwd`; resolves to the process's exit code. */\nexport async function main(\n\targs: readonly string[],\n\tcwd: string,\n\tio: Io,\n): Promise<number> {\n\tconst options = parseArgs(args);\n\tif ('error' in options) {\n\t\tio.err(`${NAME}: ${options.error}\\n\\n${USAGE}`);\n\t\treturn 1;\n\t}\n\tif (options.help) {\n\t\tio.out(USAGE);\n\t\treturn 0;\n\t}\n\n\tconst dir =\n\t\toptions.dir ?? io.ask('Where should the project go?', 'alxia-app');\n\tif (dir === null) {\n\t\tio.err(`${NAME}: cancelled, nothing written.`);\n\t\treturn 1;\n\t}\n\tif (dir === undefined) {\n\t\tio.err(\n\t\t\t`${NAME}: no directory given, and no terminal to ask in.\\n\\n${USAGE}`,\n\t\t);\n\t\treturn 1;\n\t}\n\tconst template = options.template ?? askTemplate(io);\n\tif (template === null) {\n\t\tio.err(`${NAME}: cancelled, nothing written.`);\n\t\treturn 1;\n\t}\n\tif (typeof template === 'object') {\n\t\tio.err(`${NAME}: ${template.error}\\n\\n${USAGE}`);\n\t\treturn 1;\n\t}\n\n\tconst target = resolve(cwd, dir);\n\tconst refused = await refusal(target, dir);\n\tif (refused) {\n\t\tio.err(`${NAME}: ${refused}`);\n\t\treturn 1;\n\t}\n\n\tconst existed = (await stat(target).catch(() => undefined)) !== undefined;\n\tconst made = await alxiaRanges()\n\t\t.then((alxia) => write(target, template, alxia, io))\n\t\t.catch(async (error) => {\n\t\t\t// The directory was empty or absent: what is in it now is ours.\n\t\t\tawait clean(target, existed);\n\t\t\tio.err(\n\t\t\t\t`${NAME}: ${error instanceof ScaffoldChanged ? '' : 'failed: '}${error instanceof Error ? error.message : String(error)}`,\n\t\t\t);\n\t\t\treturn false;\n\t\t});\n\tif (!made) return 1;\n\n\tlet installed = true;\n\tif (options.install) {\n\t\tio.out('\\nInstalling dependencies with bun install...');\n\t\tinstalled = (await io.run([process.execPath, 'install'], target)) === 0;\n\t\tif (!installed)\n\t\t\tio.err(`${NAME}: bun install failed; the files are written.`);\n\t}\n\tio.out(\n\t\tdone(relative(cwd, target) || '.', template, options.install && installed),\n\t);\n\treturn installed ? 0 : 1;\n}\n\n/** The last thing printed: what was written, and the commands to run next. */\nfunction done(where: string, template: Template, installed: boolean): string {\n\tconst steps = [\n\t\twhere === '.' ? undefined : `cd ${where}`,\n\t\tinstalled ? undefined : 'bun install',\n\t\t'bun dev',\n\t].filter((step) => step !== undefined);\n\treturn `\\nDone: ${where === '.' ? 'this directory' : where} holds the ${template} template. Next:\\n\\n${steps\n\t\t.map((step) => ` ${step}`)\n\t\t.join('\\n')}\\n`;\n}\n\n/** The template answered; null when cancelled. */\nfunction askTemplate(io: Io): Template | { error: string } | null {\n\tconst answer = io.ask(`Which template? ${TEMPLATES.join(' or ')}`, 'api');\n\tif (answer === null) return null;\n\tif (answer === undefined) {\n\t\treturn { error: 'no --template given, and no terminal to ask in.' };\n\t}\n\treturn isTemplate(answer)\n\t\t? answer\n\t\t: { error: `unknown template ${answer}: use ${TEMPLATES.join(' or ')}.` };\n}\n",
5
+ "/**\n * The `create-alxia` command: its arguments or answers, the project it\n * writes, what it prints, and its exit code. `index.ts` runs it on the\n * process's own streams; a spec runs it on its own.\n */\nimport { stat } from 'node:fs/promises';\nimport { relative, resolve } from 'node:path';\nimport { isTemplate, NAME, parseArgs, TEMPLATES, type Template } from './args';\nimport type { Io } from './io';\nimport { clean, refusal } from './target';\nimport { alxiaRanges } from './versions';\nimport { write } from './write';\n\nexport { NAME } from './args';\nexport type { Io } from './io';\nexport { processIo } from './io';\nexport { packageName, refusal } from './target';\n\nexport const USAGE = `Usage: bun create @alxia [dir] [options]\n\nWrites a new alxia app in dir, which must be empty or not exist yet. Asks\nfor what is not given.\n\nOptions:\n -t, --template <name> api an alxia app with Zod, a spec and the typed client\n react-router React Router's official template, served by alxia\n --no-install write the files, skip bun install\n -h, --help show this help`;\n\n/** Runs the command in `cwd`; resolves to the process's exit code. */\nexport async function main(\n\targs: readonly string[],\n\tcwd: string,\n\tio: Io,\n): Promise<number> {\n\tconst options = parseArgs(args);\n\tif ('error' in options) {\n\t\tio.err(`${NAME}: ${options.error}\\n\\n${USAGE}`);\n\t\treturn 1;\n\t}\n\tif (options.help) {\n\t\tio.out(USAGE);\n\t\treturn 0;\n\t}\n\n\tconst dir =\n\t\toptions.dir ?? io.ask('Where should the project go?', 'alxia-app');\n\tif (dir === null) {\n\t\tio.err(`${NAME}: cancelled, nothing written.`);\n\t\treturn 1;\n\t}\n\tif (dir === undefined) {\n\t\tio.err(\n\t\t\t`${NAME}: no directory given, and no terminal to ask in.\\n\\n${USAGE}`,\n\t\t);\n\t\treturn 1;\n\t}\n\tconst template = options.template ?? askTemplate(io);\n\tif (template === null) {\n\t\tio.err(`${NAME}: cancelled, nothing written.`);\n\t\treturn 1;\n\t}\n\tif (typeof template === 'object') {\n\t\tio.err(`${NAME}: ${template.error}\\n\\n${USAGE}`);\n\t\treturn 1;\n\t}\n\n\tconst target = resolve(cwd, dir);\n\tconst refused = await refusal(target, dir);\n\tif (refused) {\n\t\tio.err(`${NAME}: ${refused}`);\n\t\treturn 1;\n\t}\n\n\tconst existed = (await stat(target).catch(() => undefined)) !== undefined;\n\tconst made = await alxiaRanges()\n\t\t.then((alxia) => write(target, template, alxia, io))\n\t\t.catch(async (error) => {\n\t\t\t// The directory was empty or absent: what is in it now is ours.\n\t\t\tawait clean(target, existed);\n\t\t\tio.err(\n\t\t\t\t`${NAME}: failed: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t);\n\t\t\treturn false;\n\t\t});\n\tif (!made) return 1;\n\n\tlet installed = true;\n\tif (options.install) {\n\t\tio.out('\\nInstalling dependencies with bun install...');\n\t\tinstalled = (await io.run([process.execPath, 'install'], target)) === 0;\n\t\tif (!installed)\n\t\t\tio.err(`${NAME}: bun install failed; the files are written.`);\n\t}\n\tio.out(\n\t\tdone(relative(cwd, target) || '.', template, options.install && installed),\n\t);\n\treturn installed ? 0 : 1;\n}\n\n/** The last thing printed: what was written, and the commands to run next. */\nfunction done(where: string, template: Template, installed: boolean): string {\n\tconst steps = [\n\t\twhere === '.' ? undefined : `cd ${where}`,\n\t\tinstalled ? undefined : 'bun install',\n\t\t'bun dev',\n\t].filter((step) => step !== undefined);\n\treturn `\\nDone: ${where === '.' ? 'this directory' : where} holds the ${template} template. Next:\\n\\n${steps\n\t\t.map((step) => ` ${step}`)\n\t\t.join('\\n')}\\n`;\n}\n\n/** The template answered; null when cancelled. */\nfunction askTemplate(io: Io): Template | { error: string } | null {\n\tconst answer = io.ask(`Which template? ${TEMPLATES.join(' or ')}`, 'api');\n\tif (answer === null) return null;\n\tif (answer === undefined) {\n\t\treturn { error: 'no --template given, and no terminal to ask in.' };\n\t}\n\treturn isTemplate(answer)\n\t\t? answer\n\t\t: { error: `unknown template ${answer}: use ${TEMPLATES.join(' or ')}.` };\n}\n",
6
6
  "/** The command line of `create-alxia`, read into what to create. */\n\n/** The command's name, which starts every line it prints to stderr. */\nexport const NAME = 'create-alxia';\n\n/** The templates, in the order the prompt lists them. */\nexport const TEMPLATES = ['api', 'react-router'] as const;\nexport type Template = (typeof TEMPLATES)[number];\n\nexport function isTemplate(value: string): value is Template {\n\treturn (TEMPLATES as readonly string[]).includes(value);\n}\n\n/** What the arguments asked for. A missing `dir` or `template` is prompted. */\nexport interface Options {\n\treadonly dir?: string;\n\treadonly template?: Template;\n\treadonly install: boolean;\n\treadonly help: boolean;\n}\n\n/** The arguments as options, or the message that refuses them. */\nexport function parseArgs(\n\targs: readonly string[],\n): Options | { readonly error: string } {\n\tlet dir: string | undefined;\n\tlet template: Template | undefined;\n\tlet install = true;\n\tlet help = false;\n\tfor (let i = 0; i < args.length; i++) {\n\t\tconst arg = args[i] as string;\n\t\tif (arg === '--help' || arg === '-h') help = true;\n\t\telse if (arg === '--no-install') install = false;\n\t\telse if (\n\t\t\targ === '--template' ||\n\t\t\targ === '-t' ||\n\t\t\targ.startsWith('--template=')\n\t\t) {\n\t\t\tconst value = arg.includes('=')\n\t\t\t\t? arg.slice(arg.indexOf('=') + 1)\n\t\t\t\t: args[++i];\n\t\t\tif (value === undefined || value === '') {\n\t\t\t\treturn { error: `${arg} needs a template: ${TEMPLATES.join(' or ')}.` };\n\t\t\t}\n\t\t\tif (!isTemplate(value)) {\n\t\t\t\treturn {\n\t\t\t\t\terror: `unknown template ${value}: use ${TEMPLATES.join(' or ')}.`,\n\t\t\t\t};\n\t\t\t}\n\t\t\ttemplate = value;\n\t\t} else if (arg.startsWith('-')) return { error: `unknown option ${arg}.` };\n\t\telse if (dir === undefined) dir = arg;\n\t\telse return { error: `one directory only, given ${dir} and ${arg}.` };\n\t}\n\treturn {\n\t\t...(dir === undefined ? {} : { dir }),\n\t\t...(template === undefined ? {} : { template }),\n\t\tinstall,\n\t\thelp,\n\t};\n}\n",
7
7
  "/** The directory a project is written into: its name, whether it may be, and undoing it. */\nimport { readdir, rm, stat } from 'node:fs/promises';\nimport { basename, join } from 'node:path';\n\n/** A directory name as a package name: lowercased, `-` for the rest. */\nexport function packageName(dir: string): string {\n\tconst name = basename(dir)\n\t\t.toLowerCase()\n\t\t.replace(/[^a-z0-9._~-]+/g, '-')\n\t\t.replace(/^[._-]+|-+$/g, '');\n\treturn name || 'alxia-app';\n}\n\n/** Why `target` cannot take a new project, or undefined when it can. */\nexport async function refusal(\n\ttarget: string,\n\tshown: string = target,\n): Promise<string | undefined> {\n\tconst info = await stat(target).catch(() => undefined);\n\tif (!info) return undefined;\n\tif (!info.isDirectory()) return `${shown} exists and is not a directory.`;\n\tconst entries = (await readdir(target)).sort();\n\tif (entries.length === 0) return undefined;\n\treturn (\n\t\t`${shown} is not empty (${entries.slice(0, 3).join(', ')}${entries.length > 3 ? ', ...' : ''}), ` +\n\t\t'and create-alxia writes only into an empty directory. Choose another directory, or empty this one.'\n\t);\n}\n\n/** Removes what was written: the directory, or what is in the one that was there. */\nexport async function clean(target: string, existed: boolean): Promise<void> {\n\tif (!existed) {\n\t\tawait rm(target, { recursive: true, force: true });\n\t\treturn;\n\t}\n\tfor (const entry of await readdir(target).catch(() => [])) {\n\t\tawait rm(join(target, entry), { recursive: true, force: true });\n\t}\n}\n",
8
- "/**\n * The `react-router` template: React Router's official one, from its own\n * `create-react-router`, then alxia added as `examples/react-router` adds it\n * — `@alxia/core` and `@alxia/react-router` as dependencies, `alxia()` in\n * the Vite plugins, `start` running the build on Bun, and a `bunfig.toml`\n * that starts React Router's CLI on Bun. Each edit checks the file is the one\n * it expects first, and refuses rather than write a project that does not\n * work.\n */\nimport { join } from 'node:path';\nimport type { Manifest } from '../registry';\nimport { type AlxiaPackage, highestMajor, PEER_RANGES } from '../versions';\n\n/**\n * The scaffold's command line: the newest `create-react-router` of the\n * highest React Router major `@alxia/react-router` accepts, with no prompt,\n * no install and no git repository — the install is ours, once alxia is in.\n */\nexport function scaffoldCommand(dir: string): string[] {\n\treturn [\n\t\t`create-react-router@${highestMajor(PEER_RANGES['react-router'])}`,\n\t\tdir,\n\t\t'--yes',\n\t\t'--no-install',\n\t\t'--no-git-init',\n\t\t'--no-agent-skills',\n\t\t'--no-motion',\n\t];\n}\n\n/** The scaffold is not what the edits expect: nothing more is written, and `main` removes it. */\nexport class ScaffoldChanged extends Error {\n\tconstructor(file: string, expected: string) {\n\t\tsuper(\n\t\t\t`create-react-router's ${file} is not what this @alxia/create expects: ${expected}. ` +\n\t\t\t\t'Nothing was kept. Try the newest @alxia/create, or add @alxia/react-router to a React Router app by hand, as its README shows.',\n\t\t);\n\t\tthis.name = 'ScaffoldChanged';\n\t}\n}\n\nexport const BUNFIG = `[run]\n# The React Router CLI is a node script: this starts it on Bun, which\n# alxia's server needs, even where a node is installed.\nbun = true\n`;\n\nconst IMPORT = 'import { alxia } from \"@alxia/react-router/vite\";\\n';\n\n/** `vite.config.ts` with `alxia()` after `reactRouter()`. */\nexport function addPlugin(config: string): string {\n\tconst calls = config.match(/\\breactRouter\\(\\)/g) ?? [];\n\tif (\n\t\t!config.includes('from \"@react-router/dev/vite\"') ||\n\t\t!/plugins:\\s*\\[[^\\]]*\\breactRouter\\(\\)[^\\]]*\\]/.test(config) ||\n\t\tcalls.length !== 1\n\t) {\n\t\tthrow new ScaffoldChanged(\n\t\t\t'vite.config.ts',\n\t\t\t'reactRouter() from \"@react-router/dev/vite\", called once in plugins: [...]',\n\t\t);\n\t}\n\tif (config.includes('@alxia/react-router/vite')) {\n\t\tthrow new ScaffoldChanged(\n\t\t\t'vite.config.ts',\n\t\t\t'it already imports @alxia/react-router/vite',\n\t\t);\n\t}\n\treturn IMPORT + config.replace(/\\breactRouter\\(\\)/, 'reactRouter(), alxia()');\n}\n\n/** The manifest with alxia's dependencies and `start` on Bun. */\nexport function addAlxia(\n\tmanifest: Manifest,\n\talxia: Record<AlxiaPackage, string>,\n): Manifest {\n\tconst scripts = manifest['scripts'] as Record<string, string> | undefined;\n\tif (\n\t\tscripts?.['dev'] !== 'react-router dev' ||\n\t\tscripts['build'] !== 'react-router build' ||\n\t\tscripts['start'] === undefined ||\n\t\tmanifest.dependencies?.['react-router'] === undefined\n\t) {\n\t\tthrow new ScaffoldChanged(\n\t\t\t'package.json',\n\t\t\t'react-router in its dependencies, and the scripts `dev: react-router dev`, `build: react-router build` and a `start`',\n\t\t);\n\t}\n\tconst dependencies = sorted({\n\t\t...manifest.dependencies,\n\t\t'@alxia/core': alxia['@alxia/core'],\n\t\t'@alxia/react-router': alxia['@alxia/react-router'],\n\t});\n\treturn {\n\t\t...manifest,\n\t\tscripts: { ...scripts, start: 'bun build/server/index.js' },\n\t\tdependencies,\n\t};\n}\n\nfunction sorted(deps: Record<string, string>): Record<string, string> {\n\treturn Object.fromEntries(\n\t\tObject.entries(deps).sort(([a], [b]) => (a < b ? -1 : 1)),\n\t);\n}\n\n/**\n * Reads what the scaffold wrote in `dir` and checks it, without writing:\n * the manifest with alxia in, and the files to write beside it.\n */\nexport async function alxiaLayer(\n\tdir: string,\n\talxia: Record<AlxiaPackage, string>,\n): Promise<{ manifest: Manifest; files: Record<string, string> }> {\n\tconst read = async (file: string) => {\n\t\tconst handle = Bun.file(join(dir, file));\n\t\tif (!(await handle.exists())) {\n\t\t\tthrow new ScaffoldChanged(file, 'it is missing');\n\t\t}\n\t\treturn handle.text();\n\t};\n\tconst manifest = addAlxia(JSON.parse(await read('package.json')), alxia);\n\tconst config = addPlugin(await read('vite.config.ts'));\n\tif (await Bun.file(join(dir, 'bunfig.toml')).exists()) {\n\t\tthrow new ScaffoldChanged('bunfig.toml', 'none, and there is one');\n\t}\n\treturn {\n\t\tmanifest,\n\t\tfiles: { 'vite.config.ts': config, 'bunfig.toml': BUNFIG },\n\t};\n}\n",
9
- "/**\n * The versions a generated project starts from: alxia's own packages at the\n * versions this release of `@alxia/create` was published beside, and the\n * ranges alxia's peers accept, which the registry's newest versions must\n * stay within.\n */\nimport { dirname } from 'node:path';\n\n/** The `@alxia/*` packages a template depends on. */\nexport type AlxiaPackage =\n\t| '@alxia/client'\n\t| '@alxia/core'\n\t| '@alxia/react-router';\n\nconst ALXIA_PACKAGES: readonly AlxiaPackage[] = [\n\t'@alxia/client',\n\t'@alxia/core',\n\t'@alxia/react-router',\n];\n\n/**\n * The peer ranges of alxia's packages that a template's other dependencies\n * must stay within, by the package they constrain: `typescript` is every\n * package's, `zod` is `@alxia/zod`'s, `react-router` and `vite` are\n * `@alxia/react-router`'s. `versions.spec.ts` checks each against the\n * package that declares it, so a widened peer fails there until it is\n * widened here too.\n */\nexport const PEER_RANGES = {\n\ttypescript: '^6.0.3 || ^7.0.0',\n\tzod: '^4.2.0',\n\t'react-router': '^8.0.0',\n\tvite: '^7.0.0 || ^8.0.0',\n} as const;\n\n/** The highest major a range such as `^7.0.0 || ^8.0.0` names. */\nexport function highestMajor(range: string): number {\n\tconst majors = [...range.matchAll(/(?:^|[\\s|^~>=])(\\d+)/g)].map((match) =>\n\t\tNumber(match[1]),\n\t);\n\tif (majors.length === 0) throw new Error(`no major in range ${range}`);\n\treturn Math.max(...majors);\n}\n\n/**\n * The range a generated project declares for each `@alxia/*` package: what\n * this package's own `package.json` says. Published, that is `^<version>`,\n * which `bun publish` writes in place of `workspace:^` from the version\n * beside it in the workspace. Inside the workspace, `workspace:^` is\n * resolved the same way, from the sibling's installed `package.json`.\n */\nexport async function alxiaRanges(\n\tmanifestUrl: URL = new URL('../package.json', import.meta.url),\n): Promise<Record<AlxiaPackage, string>> {\n\tconst manifest = await Bun.file(manifestUrl).json();\n\tconst declared: Record<string, string> = manifest.devDependencies ?? {};\n\tconst ranges = {} as Record<AlxiaPackage, string>;\n\tfor (const name of ALXIA_PACKAGES) {\n\t\tconst range = declared[name];\n\t\tif (range === undefined) {\n\t\t\tthrow new Error(`@alxia/create: its package.json names no ${name}`);\n\t\t}\n\t\tranges[name] = range.startsWith('workspace:')\n\t\t\t? await workspaceRange(name, range, dirname(manifestUrl.pathname))\n\t\t\t: range;\n\t}\n\treturn ranges;\n}\n\n/** `workspace:^` as `bun publish` rewrites it: `^` and the sibling's version. */\nasync function workspaceRange(\n\tname: string,\n\trange: string,\n\tfrom: string,\n): Promise<string> {\n\tconst file = Bun.resolveSync(`${name}/package.json`, from);\n\tconst { version } = await Bun.file(file).json();\n\tconst prefix = range.slice('workspace:'.length);\n\treturn prefix === '*' ? version : `${prefix}${version}`;\n}\n",
10
- "/** Writes a template's project, its dependencies moved to the registry's newest. */\nimport { mkdir } from 'node:fs/promises';\nimport { basename, dirname, join } from 'node:path';\nimport { NAME, type Template } from './args';\nimport type { Io } from './io';\nimport { bumpDependencies, type Manifest, registryUrl } from './registry';\nimport { packageName } from './target';\nimport { apiFiles, apiManifest } from './templates/api';\nimport { alxiaLayer, scaffoldCommand } from './templates/react-router';\nimport type { AlxiaPackage } from './versions';\n\n/** Writes the project into `target`; throws on a scaffold that changed. */\nexport async function write(\n\ttarget: string,\n\ttemplate: Template,\n\talxia: Record<AlxiaPackage, string>,\n\tio: Io,\n): Promise<true> {\n\tlet manifest: Manifest;\n\tlet files: Record<string, string>;\n\tif (template === 'api') {\n\t\tmanifest = apiManifest(packageName(target), alxia);\n\t\tfiles = apiFiles(packageName(target));\n\t} else {\n\t\tawait mkdir(dirname(target), { recursive: true });\n\t\tconst code = await io.run(\n\t\t\t[process.execPath, 'x', ...scaffoldCommand(basename(target))],\n\t\t\tdirname(target),\n\t\t);\n\t\tif (code !== 0) {\n\t\t\tthrow new Error(`create-react-router exited with ${code}.`);\n\t\t}\n\t\t({ manifest, files } = await alxiaLayer(target, alxia));\n\t}\n\n\tio.out('Resolving the newest versions alxia accepts...');\n\tconst bumped = await bumpDependencies(\n\t\tmanifest,\n\t\t{ url: registryUrl(io.env), ...(io.fetch ? { fetch: io.fetch } : {}) },\n\t\tnew Set(Object.keys(alxia)),\n\t);\n\tfor (const line of bumped.moved) io.out(` ${line}`);\n\tfor (const line of [...bumped.held, ...bumped.unmatched]) io.out(` ${line}`);\n\tif (bumped.failed.length > 0) {\n\t\tio.err(\n\t\t\t`${NAME}: warning: the registry did not answer for ${bumped.failed.join(', ')}; ` +\n\t\t\t\t'kept the versions the template ships.',\n\t\t);\n\t}\n\n\tfiles['package.json'] = `${JSON.stringify(manifest, null, 2)}\\n`;\n\tfor (const [file, content] of Object.entries(files)) {\n\t\tawait Bun.write(join(target, file), content);\n\t}\n\treturn true;\n}\n",
11
- "/**\n * Moves a generated project's dependencies to their newest versions on the\n * registry, within what alxia accepts: a template ships the versions it was\n * written with, and React Router's lags behind its own releases.\n */\nimport { PEER_RANGES } from './versions';\n\n/** The dependency fields of a manifest, as a template writes them. */\nexport interface Manifest {\n\tdependencies?: Record<string, string>;\n\tdevDependencies?: Record<string, string>;\n\t[key: string]: unknown;\n}\n\n/** How to reach the registry: its URL, and the `fetch` to call it with. */\nexport interface Registry {\n\treadonly url: string;\n\treadonly fetch?: (request: Request) => Promise<Response>;\n\t/** How long one package's metadata may take, in milliseconds. */\n\treadonly timeout?: number;\n}\n\n/** What a bump changed, and what it could not. */\nexport interface Bumped {\n\t/** One line per dependency moved: `vite ^8.0.3 -> ^8.3.2`. */\n\treadonly moved: string[];\n\t/** A newer major that was left out, because a range refuses it. */\n\treadonly held: string[];\n\t/** A package whose metadata did not arrive: its version is unchanged. */\n\treadonly failed: string[];\n\t/** A package with no release within its range: its version is unchanged. */\n\treadonly unmatched: string[];\n}\n\n/** The registry to resolve against: the one Bun or npm was given, or npm's. */\nexport function registryUrl(env: Record<string, string | undefined>): string {\n\tconst url =\n\t\tenv['BUN_CONFIG_REGISTRY'] ||\n\t\tenv['npm_config_registry'] ||\n\t\t'https://registry.npmjs.org';\n\treturn url.replace(/\\/+$/, '');\n}\n\n/**\n * The range alxia's peers hold `name` to — React Router's packages follow\n * `react-router`'s — or undefined when none does, and npm's `latest` is\n * taken.\n */\nexport function allowedRange(name: string): string | undefined {\n\tif (name === 'react-router' || name.startsWith('@react-router/')) {\n\t\treturn PEER_RANGES['react-router'];\n\t}\n\treturn name in PEER_RANGES\n\t\t? PEER_RANGES[name as keyof typeof PEER_RANGES]\n\t\t: undefined;\n}\n\ninterface Packument {\n\treadonly 'dist-tags'?: Record<string, string>;\n\treadonly versions?: Record<string, unknown>;\n}\n\n/** The newest release (not a prerelease) of `versions` within `range`. */\nexport function newestWithin(\n\tversions: readonly string[],\n\trange: string,\n): string | undefined {\n\treturn versions\n\t\t.filter((v) => !v.includes('-') && Bun.semver.satisfies(v, range))\n\t\t.sort(Bun.semver.order)\n\t\t.at(-1);\n}\n\nasync function packument(name: string, registry: Registry): Promise<Packument> {\n\tconst call = registry.fetch ?? ((request: Request) => fetch(request));\n\tconst response = await call(\n\t\tnew Request(`${registry.url}/${name.replace('/', '%2f')}`, {\n\t\t\theaders: { accept: 'application/vnd.npm.install-v1+json' },\n\t\t\tsignal: AbortSignal.timeout(registry.timeout ?? 5000),\n\t\t}),\n\t);\n\tif (!response.ok) throw new Error(`${response.status}`);\n\treturn (await response.json()) as Packument;\n}\n\n/** Within `range`, the newest; with none, npm's `latest`. */\nfunction choose(\n\tversions: readonly string[],\n\trange: string | undefined,\n\tlatest: string | undefined,\n): string | undefined {\n\tif (range !== undefined) return newestWithin(versions, range);\n\treturn latest && versions.includes(latest)\n\t\t? latest\n\t\t: newestWithin(versions, '*');\n}\n\n/**\n * Rewrites every dependency of `manifest` but those in `keep` to `^` its\n * newest version: within the range alxia's peers hold it to, or npm's\n * `latest` when none does. React Router's own packages take the\n * version `react-router` resolved to, when they have it: `@react-router/node`\n * pins `react-router` exactly. A package whose metadata fails to arrive keeps\n * its version, and is named in `failed`.\n */\nexport async function bumpDependencies(\n\tmanifest: Manifest,\n\tregistry: Registry,\n\tkeep: ReadonlySet<string> = new Set(),\n): Promise<Bumped> {\n\tconst fields = ['dependencies', 'devDependencies'] as const;\n\tconst names = fields.flatMap((field) =>\n\t\tObject.keys(manifest[field] ?? {}).filter((name) => !keep.has(name)),\n\t);\n\tconst fetched = new Map(\n\t\tawait Promise.all(\n\t\t\tnames.map(\n\t\t\t\tasync (name) =>\n\t\t\t\t\t[\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tawait packument(name, registry).catch(() => undefined),\n\t\t\t\t\t] as const,\n\t\t\t),\n\t\t),\n\t);\n\tconst moved: string[] = [];\n\tconst held: string[] = [];\n\tconst failed: string[] = [];\n\tconst unmatched: string[] = [];\n\tconst chosen = new Map<string, string>();\n\t// react-router first: its siblings follow the version it settles on.\n\tconst ordered = [...names].sort(\n\t\t(a, b) => Number(b === 'react-router') - Number(a === 'react-router'),\n\t);\n\tfor (const name of ordered) {\n\t\tconst field = fields.find((f) => manifest[f]?.[name] !== undefined);\n\t\tconst deps = field && manifest[field];\n\t\tconst current = deps?.[name];\n\t\tif (!deps || current === undefined) continue;\n\t\tconst meta = fetched.get(name);\n\t\tif (!meta?.versions) {\n\t\t\tfailed.push(name);\n\t\t\tcontinue;\n\t\t}\n\t\tconst versions = Object.keys(meta.versions);\n\t\tconst range = allowedRange(name);\n\t\tconst latest = meta['dist-tags']?.['latest'];\n\t\tconst follow = chosen.get('react-router');\n\t\tconst version =\n\t\t\tname.startsWith('@react-router/') && follow && versions.includes(follow)\n\t\t\t\t? follow\n\t\t\t\t: choose(versions, range, latest);\n\t\tif (version === undefined) {\n\t\t\tunmatched.push(\n\t\t\t\t`${name}: no release within ${range ?? 'any range'}; kept ${current}`,\n\t\t\t);\n\t\t\tcontinue;\n\t\t}\n\t\tchosen.set(name, version);\n\t\tif (\n\t\t\trange !== undefined &&\n\t\t\tlatest &&\n\t\t\tBun.semver.order(latest, version) > 0 &&\n\t\t\t!Bun.semver.satisfies(latest, range)\n\t\t) {\n\t\t\theld.push(\n\t\t\t\t`${name}: kept to ${range}, where the newest is ${version}; npm's latest, ${latest}, is outside it`,\n\t\t\t);\n\t\t}\n\t\tconst next = `^${version}`;\n\t\tif (next !== current) moved.push(`${name} ${current} -> ${next}`);\n\t\tdeps[name] = next;\n\t}\n\treturn { moved, held, failed, unmatched };\n}\n",
12
- "/**\n * The `api` template: an alxia app with Zod, one validated route behind a\n * hook of its own, a spec that calls it in process and through the typed\n * client, and the scripts to run, test, typecheck and build it.\n */\nimport type { Manifest } from '../registry';\nimport type { AlxiaPackage } from '../versions';\n\n/**\n * The template's manifest. The versions of `zod`, `typescript` and\n * `@types/bun` are where it starts: `bumpDependencies` moves each to the\n * registry's newest within alxia's peer ranges.\n */\nexport function apiManifest(\n\tname: string,\n\talxia: Record<AlxiaPackage, string>,\n): Manifest {\n\treturn {\n\t\tname,\n\t\tprivate: true,\n\t\ttype: 'module',\n\t\tscripts: {\n\t\t\tdev: 'bun --watch src/server.ts',\n\t\t\tbuild: 'bun build src/server.ts --target=bun --outdir=dist',\n\t\t\tstart: 'bun dist/server.js',\n\t\t\ttest: 'bun test',\n\t\t\ttypecheck: 'tsc --noEmit',\n\t\t},\n\t\tdependencies: {\n\t\t\t'@alxia/core': alxia['@alxia/core'],\n\t\t\tzod: '^4.2.0',\n\t\t},\n\t\tdevDependencies: {\n\t\t\t'@alxia/client': alxia['@alxia/client'],\n\t\t\t'@types/bun': '^1.4.2',\n\t\t\ttypescript: '^6.0.3',\n\t\t},\n\t};\n}\n\nconst APP = `import { alxia, defineHook } from '@alxia/core';\nimport { z } from 'zod';\n\nconst Todo = z.object({ id: z.number(), title: z.string(), done: z.boolean() });\nconst NewTodo = z.object({ title: z.string().min(1) });\n\n/** Set API_KEY in the environment: this default is for development. */\nexport const apiKey = Bun.env['API_KEY'] ?? 'dev-key';\n\n// A hook of the routes it is given to: it answers 401 without the key, and\n// that 401 joins the type of each, so the client reads it.\nconst requireKey = defineHook(({ request, reply }) =>\n\trequest.headers.get('x-api-key') === apiKey\n\t\t? undefined\n\t\t: reply(401, { error: 'unauthorized' as const }),\n);\n\nconst todos: z.infer<typeof Todo>[] = [];\n\nexport const app = alxia()\n\t.decorate({ todos })\n\t.post(\n\t\t'/todos',\n\t\t[requireKey],\n\t\t{ body: NewTodo, response: { 201: Todo } },\n\t\t({ body, todos, reply }) => {\n\t\t\tconst todo = { id: todos.length + 1, title: body.title, done: false };\n\t\t\ttodos.push(todo);\n\t\t\treturn reply.created(todo);\n\t\t},\n\t);\n\nexport type App = typeof app;\n`;\n\nconst SERVER = `import { app } from './app';\n\nconst server = app.listen(Number(Bun.env['PORT'] ?? 3000));\nconsole.log(\\`listening on \\${server.url}\\`);\n`;\n\nconst SPEC = `import { expect, test } from 'bun:test';\nimport { client } from '@alxia/client';\nimport { apiKey, app } from './app';\n\nconst json = { 'content-type': 'application/json', 'x-api-key': apiKey };\n\ntest('creates a todo from JSON', async () => {\n\tconst response = await app.request('/todos', {\n\t\tmethod: 'POST',\n\t\theaders: json,\n\t\tbody: JSON.stringify({ title: 'Write a route' }),\n\t});\n\texpect(response.status).toBe(201);\n\texpect(await response.json()).toEqual({\n\t\tid: expect.any(Number),\n\t\ttitle: 'Write a route',\n\t\tdone: false,\n\t});\n});\n\ntest('refuses an empty title with a 400 naming it', async () => {\n\tconst response = await app.request('/todos', {\n\t\tmethod: 'POST',\n\t\theaders: json,\n\t\tbody: JSON.stringify({ title: '' }),\n\t});\n\texpect(response.status).toBe(400);\n\texpect((await response.json()).issues[0].path).toEqual(['title']);\n});\n\ntest('the typed client reads each status the route answers', async () => {\n\t// Given the app itself, the client calls its fetch in process.\n\tconst api = client(app, { headers: { 'x-api-key': apiKey } });\n\tconst created = await api.post('/todos', { body: { title: 'Call it typed' } });\n\tif (created.status !== 201) throw new Error(\\`got \\${created.status}\\`);\n\texpect(created.data.title).toBe('Call it typed'); // data is the Todo schema's type\n\n\tconst anonymous = await client(app).post('/todos', { body: { title: 'No key' } });\n\texpect(anonymous.status).toBe(401);\n\tif (anonymous.status === 401) expect(anonymous.data.error).toBe('unauthorized');\n});\n`;\n\nconst TSCONFIG = `{\n\t\"compilerOptions\": {\n\t\t\"types\": [\"bun\"],\n\t\t\"lib\": [\"ESNext\", \"DOM\"],\n\t\t\"target\": \"ESNext\",\n\t\t\"module\": \"ESNext\",\n\t\t\"moduleDetection\": \"force\",\n\t\t\"moduleResolution\": \"bundler\",\n\t\t\"verbatimModuleSyntax\": true,\n\t\t\"noEmit\": true,\n\t\t\"skipLibCheck\": true,\n\t\t\"resolveJsonModule\": true,\n\t\t\"strict\": true,\n\t\t\"noImplicitOverride\": true,\n\t\t\"noImplicitReturns\": true,\n\t\t\"noFallthroughCasesInSwitch\": true,\n\t\t\"noUncheckedIndexedAccess\": true,\n\t\t\"exactOptionalPropertyTypes\": true,\n\t\t\"noPropertyAccessFromIndexSignature\": true,\n\t\t\"noUnusedLocals\": true,\n\t\t\"noUnusedParameters\": true,\n\t\t\"forceConsistentCasingInFileNames\": true\n\t},\n\t\"include\": [\"src\"]\n}\n`;\n\nconst GITIGNORE = `node_modules\ndist\n*.log\n.DS_Store\n.env\n.env.local\n`;\n\nconst readme = (name: string) => `# ${name}\n\nAn [alxia](https://github.com/softistx/alxia) app with\n[Zod](https://zod.dev), made with \\`bun create @alxia\\`.\n\n\\`\\`\\`sh\nbun dev # http://localhost:3000, restarted on every change\nbun test # src/app.spec.ts: in process, and through the typed client\nbun run typecheck\nbun run build # dist/server.js, run with \\`bun start\\`\n\\`\\`\\`\n\n\\`\\`\\`sh\ncurl -X POST localhost:3000/todos \\\\\n -H 'content-type: application/json' -H 'x-api-key: dev-key' \\\\\n -d '{\"title\":\"Write a route\"}'\n\\`\\`\\`\n\n- \\`src/app.ts\\`: the app. \\`POST /todos\\` validates its body with Zod, and\n its own hook, \\`requireKey\\`, answers 401 without the \\`x-api-key\\` header.\n Set \\`API_KEY\\` in the environment outside development.\n- \\`src/server.ts\\`: listens on \\`PORT\\`, 3000 by default.\n- \\`src/app.spec.ts\\`: \\`app.request()\\` and \\`@alxia/client\\`, no port.\n\nNext: [Getting started](https://github.com/softistx/alxia/blob/develop/packages/core/docs/guide/getting-started.md)\nand the rest of [\\`@alxia/core\\`'s guide](https://github.com/softistx/alxia/tree/develop/packages/core/docs).\n`;\n\n/** The template's files but its manifest, by path. */\nexport function apiFiles(name: string): Record<string, string> {\n\treturn {\n\t\t'src/app.ts': APP,\n\t\t'src/server.ts': SERVER,\n\t\t'src/app.spec.ts': SPEC,\n\t\t'tsconfig.json': TSCONFIG,\n\t\t'.gitignore': GITIGNORE,\n\t\t'README.md': readme(name),\n\t};\n}\n",
8
+ "/**\n * The versions a generated project starts from: alxia's own packages at the\n * versions this release of `@alxia/create` was published beside, and the\n * ranges alxia's peers accept, which the registry's newest versions must\n * stay within.\n */\nimport { dirname } from 'node:path';\n\n/** The `@alxia/*` packages a template depends on. */\nexport type AlxiaPackage =\n\t| '@alxia/client'\n\t| '@alxia/core'\n\t| '@alxia/react-router';\n\nconst ALXIA_PACKAGES: readonly AlxiaPackage[] = [\n\t'@alxia/client',\n\t'@alxia/core',\n\t'@alxia/react-router',\n];\n\n/**\n * The peer ranges of alxia's packages that a template's other dependencies\n * must stay within, by the package they constrain: `typescript` is every\n * package's, `zod` is `@alxia/zod`'s, `react-router` and `vite` are\n * `@alxia/react-router`'s. `versions.spec.ts` checks each against the\n * package that declares it, so a widened peer fails there until it is\n * widened here too.\n */\nexport const PEER_RANGES = {\n\ttypescript: '^6.0.3 || ^7.0.0',\n\tzod: '^4.2.0',\n\t'react-router': '^8.0.0',\n\tvite: '^7.0.0 || ^8.0.0',\n} as const;\n\n/**\n * The range a generated project declares for each `@alxia/*` package: what\n * this package's own `package.json` says. Published, that is `^<version>`,\n * which `bun publish` writes in place of `workspace:^` from the version\n * beside it in the workspace. Inside the workspace, `workspace:^` is\n * resolved the same way, from the sibling's installed `package.json`.\n */\nexport async function alxiaRanges(\n\tmanifestUrl: URL = new URL('../package.json', import.meta.url),\n): Promise<Record<AlxiaPackage, string>> {\n\tconst manifest = await Bun.file(manifestUrl).json();\n\tconst declared: Record<string, string> = manifest.devDependencies ?? {};\n\tconst ranges = {} as Record<AlxiaPackage, string>;\n\tfor (const name of ALXIA_PACKAGES) {\n\t\tconst range = declared[name];\n\t\tif (range === undefined) {\n\t\t\tthrow new Error(`@alxia/create: its package.json names no ${name}`);\n\t\t}\n\t\tranges[name] = range.startsWith('workspace:')\n\t\t\t? await workspaceRange(name, range, dirname(manifestUrl.pathname))\n\t\t\t: range;\n\t}\n\treturn ranges;\n}\n\n/** `workspace:^` as `bun publish` rewrites it: `^` and the sibling's version. */\nasync function workspaceRange(\n\tname: string,\n\trange: string,\n\tfrom: string,\n): Promise<string> {\n\tconst file = Bun.resolveSync(`${name}/package.json`, from);\n\tconst { version } = await Bun.file(file).json();\n\tconst prefix = range.slice('workspace:'.length);\n\treturn prefix === '*' ? version : `${prefix}${version}`;\n}\n",
9
+ "/** Writes a template's project, its dependencies moved to the registry's newest. */\n\nimport { join } from 'node:path';\nimport { NAME, type Template } from './args';\nimport { copyTemplate } from './copy';\nimport type { Io } from './io';\nimport { bumpDependencies, registryUrl } from './registry';\nimport { packageName } from './target';\nimport type { AlxiaPackage } from './versions';\n\n/** Writes the project into `target`. */\nexport async function write(\n\ttarget: string,\n\ttemplate: Template,\n\talxia: Record<AlxiaPackage, string>,\n\tio: Io,\n): Promise<true> {\n\tconst { manifest, files } = await copyTemplate(\n\t\ttemplate,\n\t\tpackageName(target),\n\t\talxia,\n\t);\n\n\tio.out('Resolving the newest versions alxia accepts...');\n\tconst bumped = await bumpDependencies(\n\t\tmanifest,\n\t\t{ url: registryUrl(io.env), ...(io.fetch ? { fetch: io.fetch } : {}) },\n\t\talxia,\n\t);\n\tfor (const line of bumped.moved) io.out(` ${line}`);\n\tfor (const line of [...bumped.held, ...bumped.unmatched, ...bumped.behind])\n\t\tio.out(` ${line}`);\n\tif (bumped.failed.length > 0) {\n\t\tio.err(\n\t\t\t`${NAME}: warning: the registry did not answer for ${bumped.failed.join(', ')}; ` +\n\t\t\t\t'kept the versions the template ships.',\n\t\t);\n\t}\n\n\tfor (const [file, content] of Object.entries(files)) {\n\t\tawait Bun.write(join(target, file), content);\n\t}\n\tawait Bun.write(\n\t\tjoin(target, 'package.json'),\n\t\t`${JSON.stringify(manifest, null, 2)}\\n`,\n\t);\n\treturn true;\n}\n",
10
+ "/**\n * Copies a template stored under `templates/<template>/`: the `api` one,\n * alxia's own, and the `react-router` one, React Router's official scaffold\n * with the layer `examples/react-router` adds on top. The files are copied\n * as they are; only `package.json` is rewritten, with the project's name\n * and alxia's versions in place of `workspace:^`.\n */\nimport { join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport type { Template } from './args';\nimport type { Manifest } from './registry';\nimport type { AlxiaPackage } from './versions';\n\n/**\n * Where the templates are, beside `src/` here and beside `dist/` published:\n * this module is bundled into `dist/index.js`, as `versions.ts` reads\n * `../package.json`.\n */\nexport const TEMPLATES = fileURLToPath(\n\tnew URL('../templates', import.meta.url),\n);\n\n/**\n * Files a template stores under another name, because a published tarball\n * would not hold them: `bun publish`, as `npm publish`, leaves every\n * `.gitignore` out, and Bun leaves `bunfig.toml` out too.\n */\nexport const RENAMED: Readonly<Record<string, string>> = {\n\tgitignore: '.gitignore',\n\t'_bunfig.toml': 'bunfig.toml',\n};\n\n/**\n * `template`, from `root`: its manifest, named `name` with alxia's packages\n * at `alxia`'s ranges, and every other file, by the path it is written at.\n */\nexport async function copyTemplate(\n\ttemplate: Template,\n\tname: string,\n\talxia: Record<AlxiaPackage, string>,\n\troot: string = TEMPLATES,\n): Promise<{ manifest: Manifest; files: Record<string, Blob> }> {\n\tconst dir = join(root, template);\n\tconst stored: Manifest = await Bun.file(join(dir, 'package.json')).json();\n\tconst manifest: Manifest = { ...stored, name };\n\tfor (const field of ['dependencies', 'devDependencies'] as const) {\n\t\tconst deps = stored[field];\n\t\tif (deps === undefined) continue;\n\t\tmanifest[field] = Object.fromEntries(\n\t\t\tObject.entries(deps).map(([pkg, range]) => [\n\t\t\t\tpkg,\n\t\t\t\tObject.hasOwn(alxia, pkg) ? alxia[pkg as AlxiaPackage] : range,\n\t\t\t]),\n\t\t);\n\t}\n\t// A range only the workspace resolves would make the project uninstallable.\n\tconst left = JSON.stringify(manifest).match(/\"([^\"]+)\":\"workspace:/);\n\tif (left) {\n\t\tthrow new Error(\n\t\t\t`the ${template} template names ${left[1]} at workspace:, which this @alxia/create has no version for`,\n\t\t);\n\t}\n\tconst files: Record<string, Blob> = {};\n\tfor await (const path of new Bun.Glob('**').scan({ cwd: dir, dot: true })) {\n\t\t// A Finder file in a local checkout is not the template's.\n\t\tif (path === 'package.json' || path.endsWith('.DS_Store')) continue;\n\t\tfiles[RENAMED[path] ?? path] = Bun.file(join(dir, path));\n\t}\n\treturn { manifest, files };\n}\n",
11
+ "/**\n * Moves a generated project's dependencies to their newest versions on the\n * registry, within what alxia accepts: a template ships the versions it was\n * written with, and React Router's lags behind its own releases. alxia's own\n * packages move within the ranges this `@alxia/create` was published with,\n * and fall back on the same minor when the registry does not have the\n * version those ranges start at yet.\n */\nimport { PEER_RANGES } from './versions';\n\n/** The dependency fields of a manifest, as a template writes them. */\nexport interface Manifest {\n\tdependencies?: Record<string, string>;\n\tdevDependencies?: Record<string, string>;\n\t[key: string]: unknown;\n}\n\n/** How to reach the registry: its URL, and the `fetch` to call it with. */\nexport interface Registry {\n\treadonly url: string;\n\treadonly fetch?: (request: Request) => Promise<Response>;\n\t/** How long one package's metadata may take, in milliseconds. */\n\treadonly timeout?: number;\n}\n\n/** What a bump changed, and what it could not. */\nexport interface Bumped {\n\t/** One line per dependency moved: `vite ^8.0.3 -> ^8.3.2`. */\n\treadonly moved: string[];\n\t/** A newer major that was left out, because a range refuses it. */\n\treadonly held: string[];\n\t/** A package whose metadata did not arrive: its version is unchanged. */\n\treadonly failed: string[];\n\t/** A package with no release within its range: its version is unchanged. */\n\treadonly unmatched: string[];\n\t/**\n\t * An `@alxia/*` package whose version the range starts at is not on the\n\t * registry yet, as just after a release: the newest of the same minor\n\t * was written instead.\n\t */\n\treadonly behind: string[];\n}\n\n/** The registry to resolve against: the one Bun or npm was given, or npm's. */\nexport function registryUrl(env: Record<string, string | undefined>): string {\n\tconst url =\n\t\tenv['BUN_CONFIG_REGISTRY'] ||\n\t\tenv['npm_config_registry'] ||\n\t\t'https://registry.npmjs.org';\n\treturn url.replace(/\\/+$/, '');\n}\n\n/**\n * The range alxia's peers hold `name` to — React Router's packages follow\n * `react-router`'s — or undefined when none does, and npm's `latest` is\n * taken.\n */\nexport function allowedRange(name: string): string | undefined {\n\tif (name === 'react-router' || name.startsWith('@react-router/')) {\n\t\treturn PEER_RANGES['react-router'];\n\t}\n\treturn name in PEER_RANGES\n\t\t? PEER_RANGES[name as keyof typeof PEER_RANGES]\n\t\t: undefined;\n}\n\ninterface Packument {\n\treadonly 'dist-tags'?: Record<string, string>;\n\treadonly versions?: Record<string, unknown>;\n}\n\n/** The newest release (not a prerelease) of `versions` within `range`. */\nexport function newestWithin(\n\tversions: readonly string[],\n\trange: string,\n): string | undefined {\n\treturn versions\n\t\t.filter((v) => !v.includes('-') && Bun.semver.satisfies(v, range))\n\t\t.sort(Bun.semver.order)\n\t\t.at(-1);\n}\n\nasync function packument(name: string, registry: Registry): Promise<Packument> {\n\tconst call = registry.fetch ?? ((request: Request) => fetch(request));\n\tconst response = await call(\n\t\tnew Request(`${registry.url}/${name.replace('/', '%2f')}`, {\n\t\t\theaders: { accept: 'application/vnd.npm.install-v1+json' },\n\t\t\tsignal: AbortSignal.timeout(registry.timeout ?? 5000),\n\t\t}),\n\t);\n\tif (!response.ok) throw new Error(`${response.status}`);\n\treturn (await response.json()) as Packument;\n}\n\n/** Within `range`, the newest; with none, npm's `latest`. */\nfunction choose(\n\tversions: readonly string[],\n\trange: string | undefined,\n\tlatest: string | undefined,\n): string | undefined {\n\tif (range !== undefined) return newestWithin(versions, range);\n\treturn latest && versions.includes(latest)\n\t\t? latest\n\t\t: newestWithin(versions, '*');\n}\n\n/**\n * `range`'s own minor, from its first version: `~0.3.0` for `^0.3.1`, or\n * undefined for a range that names no version.\n */\nexport function sameMinor(range: string): string | undefined {\n\tconst match = /(\\d+)\\.(\\d+)\\.\\d+/.exec(range);\n\treturn match ? `~${match[1]}.${match[2]}.0` : undefined;\n}\n\n/**\n * For a `built` range with no release on the registry: the newest of its\n * own minor whose `^` still takes the version the range starts at, or\n * undefined. Below 0.1, `^0.0.2` does not take 0.0.3: no fallback there.\n */\nexport function newestOfMinor(\n\tversions: readonly string[],\n\trange: string,\n): string | undefined {\n\tconst minor = sameMinor(range);\n\tconst start = /\\d+\\.\\d+\\.\\d+/.exec(range)?.[0];\n\tconst version = minor && newestWithin(versions, minor);\n\treturn version && start && Bun.semver.satisfies(start, `^${version}`)\n\t\t? version\n\t\t: undefined;\n}\n\n/**\n * Rewrites every dependency of `manifest` to `^` its newest version: within\n * `built[name]` for a package it names — alxia's, at the ranges this\n * `@alxia/create` was published with — else within the range alxia's peers\n * hold it to, else npm's `latest`. A package of `built` with no release in\n * its range, as when npm has not yet propagated a version published minutes\n * ago, takes the newest of the range's own minor, named in `behind`: `^` it\n * is still within the range. React Router's own packages take the version\n * `react-router` resolved to, when they have it: `@react-router/node` pins\n * `react-router` exactly. A package whose metadata fails to arrive keeps its\n * version, and is named in `failed`.\n */\nexport async function bumpDependencies(\n\tmanifest: Manifest,\n\tregistry: Registry,\n\tbuilt: Readonly<Record<string, string>> = {},\n): Promise<Bumped> {\n\tconst fields = ['dependencies', 'devDependencies'] as const;\n\tconst names = fields.flatMap((field) => Object.keys(manifest[field] ?? {}));\n\tconst fetched = new Map(\n\t\tawait Promise.all(\n\t\t\tnames.map(\n\t\t\t\tasync (name) =>\n\t\t\t\t\t[\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tawait packument(name, registry).catch(() => undefined),\n\t\t\t\t\t] as const,\n\t\t\t),\n\t\t),\n\t);\n\tconst moved: string[] = [];\n\tconst held: string[] = [];\n\tconst failed: string[] = [];\n\tconst unmatched: string[] = [];\n\tconst behind: string[] = [];\n\tconst chosen = new Map<string, string>();\n\t// react-router first: its siblings follow the version it settles on.\n\tconst ordered = [...names].sort(\n\t\t(a, b) => Number(b === 'react-router') - Number(a === 'react-router'),\n\t);\n\tfor (const name of ordered) {\n\t\tconst field = fields.find((f) => manifest[f]?.[name] !== undefined);\n\t\tconst deps = field && manifest[field];\n\t\tconst current = deps?.[name];\n\t\tif (!deps || current === undefined) continue;\n\t\tconst meta = fetched.get(name);\n\t\tif (!meta?.versions) {\n\t\t\tfailed.push(name);\n\t\t\tcontinue;\n\t\t}\n\t\tconst versions = Object.keys(meta.versions);\n\t\tconst pinned = built[name];\n\t\tconst range = pinned ?? allowedRange(name);\n\t\tconst latest = meta['dist-tags']?.['latest'];\n\t\tconst follow = chosen.get('react-router');\n\t\tlet version =\n\t\t\tname.startsWith('@react-router/') && follow && versions.includes(follow)\n\t\t\t\t? follow\n\t\t\t\t: choose(versions, range, latest);\n\t\tif (version === undefined && pinned !== undefined) {\n\t\t\tversion = newestOfMinor(versions, pinned);\n\t\t\tif (version !== undefined) {\n\t\t\t\tbehind.push(\n\t\t\t\t\t`${name}: the registry has no release within ${range} yet; wrote ^${version}, the newest of ${sameMinor(pinned)}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (version === undefined) {\n\t\t\tunmatched.push(\n\t\t\t\t`${name}: no release within ${range ?? 'any range'}; kept ${current}`,\n\t\t\t);\n\t\t\tcontinue;\n\t\t}\n\t\tchosen.set(name, version);\n\t\tif (\n\t\t\trange !== undefined &&\n\t\t\tlatest &&\n\t\t\tBun.semver.order(latest, version) > 0 &&\n\t\t\t!Bun.semver.satisfies(latest, range)\n\t\t) {\n\t\t\theld.push(\n\t\t\t\t`${name}: kept to ${range}, where the newest is ${version}; npm's latest, ${latest}, is outside it`,\n\t\t\t);\n\t\t}\n\t\tconst next = `^${version}`;\n\t\tif (next !== current) moved.push(`${name} ${current} -> ${next}`);\n\t\tdeps[name] = next;\n\t}\n\treturn { moved, held, failed, unmatched, behind };\n}\n",
13
12
  "/** Where `create-alxia` prints, asks and runs: the process's own, or a spec's. */\n\nexport interface Io {\n\treadonly out: (line: string) => void;\n\treadonly err: (line: string) => void;\n\t/**\n\t * An answer to `question`, `fallback` when empty; undefined when there is\n\t * no terminal to ask in, null when the input ended (Ctrl-D) unanswered.\n\t */\n\treadonly ask: (\n\t\tquestion: string,\n\t\tfallback: string,\n\t) => string | null | undefined;\n\t/** Runs a command in `cwd` with the terminal's streams; its exit code. */\n\treadonly run: (command: readonly string[], cwd: string) => Promise<number>;\n\treadonly env: Record<string, string | undefined>;\n\t/** The registry's `fetch`, for a spec's fake one. */\n\treadonly fetch?: (request: Request) => Promise<Response>;\n}\n\n/** The process's own `Io`: its streams, `prompt()`, `Bun.spawn`. */\nexport function processIo(): Io {\n\treturn {\n\t\tout: (line) => console.log(line),\n\t\terr: (line) => console.error(line),\n\t\task: (question, fallback) => {\n\t\t\tif (!process.stdin.isTTY) return undefined;\n\t\t\t// Bun's prompt() prints the default as `[fallback]`, gives it for an\n\t\t\t// empty line, and null at the end of the input.\n\t\t\tconst answer = prompt(question, fallback);\n\t\t\treturn answer === null ? null : answer.trim() || fallback;\n\t\t},\n\t\trun: async (command, cwd) =>\n\t\t\tBun.spawn([...command], { cwd, stdio: ['inherit', 'inherit', 'inherit'] })\n\t\t\t\t.exited,\n\t\tenv: process.env,\n\t};\n}\n",
14
13
  "#!/usr/bin/env bun\n/**\n * `create-alxia`, the package's bin: `bun create @alxia` runs it, as do\n * `bunx @alxia/create` and `npm create @alxia`.\n */\nimport { main, processIo } from './main';\n\nprocess.exitCode = await main(\n\tprocess.argv.slice(2),\n\tprocess.cwd(),\n\tprocessIo(),\n);\n"
15
14
  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zB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,EAAE,GACJ,OAAO,CAAC,MAAM,CAAC,CAgEjB"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAK/B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEhD,eAAO,MAAM,KAAK,wbASsB,CAAC;AAEzC,sEAAsE;AACtE,wBAAsB,IAAI,CACzB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,EAAE,GACJ,OAAO,CAAC,MAAM,CAAC,CAgEjB"}
@@ -21,6 +21,12 @@ export interface Bumped {
21
21
  readonly failed: string[];
22
22
  /** A package with no release within its range: its version is unchanged. */
23
23
  readonly unmatched: string[];
24
+ /**
25
+ * An `@alxia/*` package whose version the range starts at is not on the
26
+ * registry yet, as just after a release: the newest of the same minor
27
+ * was written instead.
28
+ */
29
+ readonly behind: string[];
24
30
  }
25
31
  /** The registry to resolve against: the one Bun or npm was given, or npm's. */
26
32
  export declare function registryUrl(env: Record<string, string | undefined>): string;
@@ -33,12 +39,27 @@ export declare function allowedRange(name: string): string | undefined;
33
39
  /** The newest release (not a prerelease) of `versions` within `range`. */
34
40
  export declare function newestWithin(versions: readonly string[], range: string): string | undefined;
35
41
  /**
36
- * Rewrites every dependency of `manifest` but those in `keep` to `^` its
37
- * newest version: within the range alxia's peers hold it to, or npm's
38
- * `latest` when none does. React Router's own packages take the
39
- * version `react-router` resolved to, when they have it: `@react-router/node`
40
- * pins `react-router` exactly. A package whose metadata fails to arrive keeps
41
- * its version, and is named in `failed`.
42
+ * `range`'s own minor, from its first version: `~0.3.0` for `^0.3.1`, or
43
+ * undefined for a range that names no version.
42
44
  */
43
- export declare function bumpDependencies(manifest: Manifest, registry: Registry, keep?: ReadonlySet<string>): Promise<Bumped>;
45
+ export declare function sameMinor(range: string): string | undefined;
46
+ /**
47
+ * For a `built` range with no release on the registry: the newest of its
48
+ * own minor whose `^` still takes the version the range starts at, or
49
+ * undefined. Below 0.1, `^0.0.2` does not take 0.0.3: no fallback there.
50
+ */
51
+ export declare function newestOfMinor(versions: readonly string[], range: string): string | undefined;
52
+ /**
53
+ * Rewrites every dependency of `manifest` to `^` its newest version: within
54
+ * `built[name]` for a package it names — alxia's, at the ranges this
55
+ * `@alxia/create` was published with — else within the range alxia's peers
56
+ * hold it to, else npm's `latest`. A package of `built` with no release in
57
+ * its range, as when npm has not yet propagated a version published minutes
58
+ * ago, takes the newest of the range's own minor, named in `behind`: `^` it
59
+ * is still within the range. React Router's own packages take the version
60
+ * `react-router` resolved to, when they have it: `@react-router/node` pins
61
+ * `react-router` exactly. A package whose metadata fails to arrive keeps its
62
+ * version, and is named in `failed`.
63
+ */
64
+ export declare function bumpDependencies(manifest: Manifest, registry: Registry, built?: Readonly<Record<string, string>>): Promise<Bumped>;
44
65
  //# sourceMappingURL=registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAOA,sEAAsE;AACtE,MAAM,WAAW,QAAQ;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED,2EAA2E;AAC3E,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB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;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACrC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,KAAK,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM,GAC1C,OAAO,CAAC,MAAM,CAAC,CAyEjB"}
@@ -14,8 +14,6 @@ export declare const PEER_RANGES: {
14
14
  readonly 'react-router': "^8.0.0";
15
15
  readonly vite: "^7.0.0 || ^8.0.0";
16
16
  };
17
- /** The highest major a range such as `^7.0.0 || ^8.0.0` names. */
18
- export declare function highestMajor(range: string): number;
19
17
  /**
20
18
  * The range a generated project declares for each `@alxia/*` package: what
21
19
  * this package's own `package.json` says. Published, that is `^<version>`,
@@ -1 +1 @@
1
- {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../src/versions.ts"],"names":[],"mappings":"AAQA,qDAAqD;AACrD,MAAM,MAAM,YAAY,GACrB,eAAe,GACf,aAAa,GACb,qBAAqB,CAAC;AAQzB;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW;;;;;CAKd,CAAC;AAEX,kEAAkE;AAClE,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMlD;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAChC,WAAW,GAAE,GAAiD,GAC5D,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAcvC"}
1
+ {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../src/versions.ts"],"names":[],"mappings":"AAQA,qDAAqD;AACrD,MAAM,MAAM,YAAY,GACrB,eAAe,GACf,aAAa,GACb,qBAAqB,CAAC;AAQzB;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW;;;;;CAKd,CAAC;AAEX;;;;;;GAMG;AACH,wBAAsB,WAAW,CAChC,WAAW,GAAE,GAAiD,GAC5D,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAcvC"}
package/dist/write.d.ts CHANGED
@@ -1,6 +1,7 @@
1
+ /** Writes a template's project, its dependencies moved to the registry's newest. */
1
2
  import { type Template } from './args';
2
3
  import type { Io } from './io';
3
4
  import type { AlxiaPackage } from './versions';
4
- /** Writes the project into `target`; throws on a scaffold that changed. */
5
+ /** Writes the project into `target`. */
5
6
  export declare function write(target: string, template: Template, alxia: Record<AlxiaPackage, string>, io: Io): Promise<true>;
6
7
  //# sourceMappingURL=write.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":"AAGA,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAK/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,2EAA2E;AAC3E,wBAAsB,KAAK,CAC1B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,EACnC,EAAE,EAAE,EAAE,GACJ,OAAO,CAAC,IAAI,CAAC,CAsCf"}
1
+ {"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":"AAAA,oFAAoF;AAGpF,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE7C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAG/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,wCAAwC;AACxC,wBAAsB,KAAK,CAC1B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,EACnC,EAAE,EAAE,EAAE,GACJ,OAAO,CAAC,IAAI,CAAC,CA+Bf"}
package/docs/README.md CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  The [package README](../README.md) is the short version. This folder is the
4
4
  long one: what each template writes, what the `react-router` template
5
- changes in React Router's own, how the versions are chosen, and the errors
5
+ adds to React Router's own, how the versions are chosen, and the errors
6
6
  the command prints.
7
7
 
8
8
  | Page | Read it when |
9
9
  | --- | --- |
10
- | [Guide](guide.md) | choosing a template, reading what it wrote, pinning or moving versions, or running the command in a script or CI |
11
- | [Troubleshooting](troubleshooting.md) | the command refused a directory, a template or an option, `create-react-router` changed, the registry did not answer, or `bun install` failed |
10
+ | [Guide](guide.md) | choosing a template, reading what it wrote, building its Docker image, pinning or moving versions, or running the command in a script or CI |
11
+ | [Troubleshooting](troubleshooting.md) | the command refused a directory, a template or an option, the registry did not answer or lacked a version, or `bun install` failed |
12
12
  | [Roadmap](roadmap.md) | wondering what is coming, and what is not planned |
package/docs/guide.md CHANGED
@@ -6,6 +6,7 @@ chooses the versions it writes.
6
6
  - [Running it](#running-it)
7
7
  - [The `api` template](#the-api-template)
8
8
  - [The `react-router` template](#the-react-router-template)
9
+ - [Docker](#docker)
9
10
  - [Versions](#versions)
10
11
  - [In a script or CI](#in-a-script-or-ci)
11
12
 
@@ -50,6 +51,15 @@ directory's name, lowercased, with `-` for anything npm refuses.
50
51
  to the package `@scope/create`, and npm maps `npm create @scope` the same
51
52
  way. Any of the three runs the same bin, on Bun.
52
53
 
54
+ Both templates are files shipped in this package, under
55
+ `templates/api/` and `templates/react-router/`, and copied as they are:
56
+ nothing is downloaded but the dependencies, and only `package.json` is
57
+ written again, with the directory's name, alxia's versions and the newest
58
+ of the others ([Versions](#versions)). Two files are stored under another
59
+ name, since `bun publish` leaves them out of a tarball, and take theirs
60
+ back on the copy: `gitignore` is written as `.gitignore`, `_bunfig.toml`
61
+ as `bunfig.toml`.
62
+
53
63
  ## The `api` template
54
64
 
55
65
  ```
@@ -60,6 +70,9 @@ my-api/
60
70
  │ └── server.ts app.listen(PORT)
61
71
  ├── package.json
62
72
  ├── tsconfig.json
73
+ ├── Dockerfile the production dependencies and src/, on oven/bun:1
74
+ ├── .dockerignore
75
+ ├── .env.example PORT and API_KEY, for a .env Bun loads
63
76
  ├── .gitignore
64
77
  └── README.md
65
78
  ```
@@ -127,7 +140,16 @@ The scripts:
127
140
  | `bun test` | the spec |
128
141
  | `bun run typecheck` | `tsc --noEmit` |
129
142
  | `bun run build` | `bun build src/server.ts --target=bun --outdir=dist`: one file, its dependencies bundled |
130
- | `bun start` | `bun dist/server.js` |
143
+ | `bun start` | `bun src/server.ts`: Bun runs the TypeScript as it is, no build first |
144
+
145
+ `build` is for a host that has Bun and no `node_modules`: `dist/server.js`
146
+ holds the dependencies, and runs as `bun dist/server.js`. `start`, `bun dev`
147
+ and the image need no build.
148
+
149
+ Bun loads `.env` on every command. `.env.example` names the two variables
150
+ the app reads, `PORT` (3000 by default) and `API_KEY` (`dev-key` by
151
+ default, for development only): copy it to `.env`, which `.gitignore`
152
+ keeps out of git and `.dockerignore` out of the image.
131
153
 
132
154
  `tsconfig.json` holds the settings alxia's own packages are checked under:
133
155
  `strict`, and past it `exactOptionalPropertyTypes`,
@@ -138,16 +160,12 @@ compile under each one, and under none.
138
160
 
139
161
  ## The `react-router` template
140
162
 
141
- It is React Router's template, not a copy of it: the command runs
142
-
143
- ```sh
144
- bunx create-react-router@8 my-site --yes --no-install --no-git-init --no-agent-skills --no-motion
145
- ```
146
-
147
- — the newest `create-react-router` of the React Router major
148
- `@alxia/react-router` accepts — and then makes the same small change
163
+ It is React Router's official template, shipped inside this package and
164
+ copied: what `create-react-router` wrote, committed as it wrote it, with the
165
+ same small change
149
166
  [`examples/react-router`](https://github.com/softistx/alxia/tree/develop/examples/react-router)
150
- made to it, in code:
167
+ made to it. Nothing is downloaded but the dependencies, and nothing runs
168
+ before `bun install`. The change, against React Router's files:
151
169
 
152
170
  ```diff
153
171
  // package.json
@@ -156,7 +174,7 @@ made to it, in code:
156
174
  + "start": "bun build/server/index.js",
157
175
  },
158
176
  "dependencies": {
159
- + "@alxia/core": "^0.3.0",
177
+ + "@alxia/core": "^0.3.1",
160
178
  + "@alxia/react-router": "^0.2.0",
161
179
  ```
162
180
 
@@ -177,12 +195,19 @@ made to it, in code:
177
195
  bun = true
178
196
  ```
179
197
 
180
- Every other file is React Router's, as it wrote it. Each edit checks first
181
- that the file is the one it expects — `reactRouter()` once in `plugins`,
182
- the `dev`, `build` and `start` scripts, no `bunfig.toml` yet — and when
183
- React Router's template has changed, the command stops, removes what was
184
- written, and says which file
185
- ([Troubleshooting](troubleshooting.md#create-alxia-create-react-routers--is-not-what-this-alxiacreate-expects-)).
198
+ The `Dockerfile` is alxia's, in place of React Router's, which builds and
199
+ runs on Node ([Docker](#docker)). Every other file is React Router's:
200
+ `app/`, `public/`, `tsconfig.json`, `react-router.config.ts`, its
201
+ `README.md` (with Bun's commands where it wrote npm's: `bun install`,
202
+ `bun dev`, `bun run build`), `.gitignore` and `.dockerignore`. `package.json` takes the directory's name, and its
203
+ versions are moved to the newest the registry has ([Versions](#versions)):
204
+ the template's own are where they start.
205
+
206
+ The template follows React Router's majors, not its every release: it is
207
+ written again from `create-react-router` when React Router ships one that
208
+ `@alxia/react-router` accepts, in a new `@alxia/create`. Between two, the
209
+ files are what `create-react-router` wrote when the template was last
210
+ generated (React Router 8.4.0 in this release), and the versions are the newest of that major.
186
211
 
187
212
  There is no `app/server.ts`: the plugin's default server serves the pages
188
213
  in `bun dev` and from the build. To put alxia's hooks or `/api` routes in
@@ -193,21 +218,63 @@ bunx alxia-react-router reveal
193
218
  ```
194
219
 
195
220
  The [`@alxia/react-router` guide](https://github.com/softistx/alxia/blob/develop/packages/react-router/docs/guide.md)
196
- goes from there. React Router's `Dockerfile` is kept as it wrote it, based
197
- on Node: deploy on Bun as that guide's
198
- [Deploying](https://github.com/softistx/alxia/blob/develop/packages/react-router/docs/guide.md#deploying)
199
- says.
221
+ goes from there.
222
+
223
+ ## Docker
224
+
225
+ Each project's `Dockerfile` runs it on Bun, on the official `oven/bun:1`
226
+ image, as the image's non-root `bun` user. The installs are
227
+ `--frozen-lockfile`, from the `bun.lock` the command's `bun install`
228
+ wrote: commit it.
229
+
230
+ ### `api`
231
+
232
+ Two stages: the production dependencies, installed with
233
+ `bun install --frozen-lockfile --production`, then an image with them,
234
+ `package.json` and `src/`, running `bun src/server.ts`, `start`'s command,
235
+ written out so that Bun is the container's process. There is no build
236
+ stage: Bun runs the TypeScript as it is, so a build would only add a
237
+ second, full install and a bundle the image does not need.
238
+ `.dockerignore` keeps `node_modules`, `dist`, `.env`, the README and the
239
+ specs out of the context.
240
+
241
+ ```sh
242
+ cd my-api
243
+ docker build -t my-api .
244
+ docker run -p 3000:3000 -e API_KEY=change-me my-api
245
+ ```
246
+
247
+ The server listens on `PORT`, 3000 in the image; set `API_KEY`, whose
248
+ default is for development.
249
+
250
+ ### `react-router`
251
+
252
+ Three stages: the production dependencies, then every dependency and
253
+ `bun run build`, then an image with `build/` and the production
254
+ `node_modules` alone, running `bun build/server/index.js`, `start`'s
255
+ command. `.dockerignore` keeps `node_modules`, `build` and
256
+ `.react-router` out of the context.
257
+
258
+ ```sh
259
+ cd my-site
260
+ docker build -t my-site .
261
+ docker run -p 3000:3000 my-site
262
+ ```
263
+
264
+ The commented file, and what to change to write files from the container,
265
+ are in
266
+ [`@alxia/react-router`'s guide](https://github.com/softistx/alxia/blob/develop/packages/react-router/docs/guide.md#docker).
200
267
 
201
268
  ## Versions
202
269
 
203
- A template is written with the versions it was written with, and React
204
- Router's lags behind its own releases. So before installing, the command
270
+ A template ships the versions it was generated with, and React Router's
271
+ lags behind its own releases. So before installing, the command
205
272
  asks the registry for every dependency's versions, and writes `^` the
206
273
  newest one alxia accepts:
207
274
 
208
275
  | dependency | moved to the newest within |
209
276
  | --- | --- |
210
- | `@alxia/core`, `@alxia/client`, `@alxia/react-router` | not moved: the versions this `@alxia/create` was published with |
277
+ | `@alxia/core`, `@alxia/client`, `@alxia/react-router` | the ranges this `@alxia/create` was published with, such as `^0.3.1`; while the registry does not serve that version yet, the newest of its minor, `~0.3.0` |
211
278
  | `typescript` | `^6.0.3 \|\| ^7.0.0`, every alxia package's peer range |
212
279
  | `zod` | `^4.2.0`, `@alxia/zod`'s |
213
280
  | `vite` | `^7.0.0 \|\| ^8.0.0`, `@alxia/react-router`'s |
@@ -235,9 +302,19 @@ The registry is the one `BUN_CONFIG_REGISTRY` names, else
235
302
  that does not arrive keeps the template's version, and the command warns
236
303
  and goes on.
237
304
 
238
- alxia's own packages are not moved, so a project is always written with a
239
- set released together. `bunx @alxia/create@latest` takes the newest set;
240
- `bun update` moves an existing project's within its ranges.
305
+ alxia's own packages stay within the ranges they were published with, so
306
+ a project is always written with a set released together, and its patches
307
+ since. `bunx @alxia/create@latest` takes the newest set; `bun update` moves
308
+ an existing project's within its ranges.
309
+
310
+ Right after a release, npm can take a few minutes to serve a version
311
+ while the `@alxia/create` published beside it is already there. The
312
+ command then writes the newest release of the same minor, whose `^` range
313
+ takes the new version once it arrives, and says so:
314
+
315
+ ```
316
+ @alxia/core: the registry has no release within ^0.3.1 yet; wrote ^0.3.0, the newest of ~0.3.0
317
+ ```
241
318
 
242
319
  ## In a script or CI
243
320
 
package/docs/roadmap.md CHANGED
@@ -15,23 +15,49 @@ Nothing scheduled yet.
15
15
 
16
16
  ## Later
17
17
 
18
- - **A Dockerfile on Bun for the `react-router` template.** React Router's
19
- template ships one based on Node, which no longer runs the app once
20
- `start` runs Bun; the
21
- [`@alxia/react-router` guide](https://github.com/softistx/alxia/blob/develop/packages/react-router/docs/guide.md#deploying)
22
- says what to change. The template keeps React Router's files as they are
23
- written today, so this waits for a decision to edit more of them.
18
+ Nothing scheduled yet.
24
19
 
25
20
  ## Not planned
26
21
 
27
- - **A copy of React Router's template.** The `react-router` template runs
28
- React Router's own `create-react-router` and edits what it writes, as
29
- `examples/react-router` was made: a frozen copy would drift from it.
22
+ - **Running `create-react-router` at creation.** The template is its
23
+ output, committed and copied: a new project needs nothing but the
24
+ registry, and no change upstream can stop the command. It is generated
25
+ again from the scaffold when React Router ships a new major.
30
26
  - **A runtime dependency.** The prompts are Bun's `prompt()`, the registry
31
27
  is read with `fetch`, versions are compared with `Bun.semver`.
32
28
 
33
29
  ## Shipped
34
30
 
31
+ ### Next release
32
+
33
+ - **The `api` template is files, copied, with a `Dockerfile`.** It ships
34
+ under `templates/api/` and is copied as `react-router`'s is. New in it:
35
+ a `Dockerfile` on `oven/bun:1` that installs the production
36
+ dependencies and runs `src/server.ts` as the non-root `bun` user,
37
+ `.dockerignore`, `.env.example`, and `start` running the source with no
38
+ build first.
39
+
40
+ ### 0.1.1
41
+
42
+ - **The `react-router` template's `Dockerfile` runs on Bun.** It replaces
43
+ React Router's Node one: multi-stage on `oven/bun:1`, the production
44
+ dependencies apart, `bun run build`, then `bun build/server/index.js` as
45
+ the image's non-root `bun` user. `docker build` works in a new project
46
+ as it is.
47
+ - **The `react-router` project's README runs Bun.** React Router's own
48
+ README, with `bun install`, `bun dev` and `bun run build` where it wrote
49
+ npm's commands.
50
+ - **The `react-router` template is files, copied.** React Router's official
51
+ template ships inside `@alxia/create`, with alxia's layer, and is copied
52
+ as it is: no `create-react-router` runs, and no change in it can make the
53
+ command refuse.
54
+ - **alxia's packages resolve at creation too.** `@alxia/core`,
55
+ `@alxia/client` and `@alxia/react-router` move to the newest version
56
+ within the ranges `@alxia/create` was published with. Right after a
57
+ release, while the registry does not serve that version yet, the newest
58
+ of the same minor is written, so `bun install` no longer fails with
59
+ `No version matching "^0.3.1"`.
60
+
35
61
  ### 0.1.0
36
62
 
37
63
  - `bun create @alxia [dir] [--template api|react-router] [--no-install]`,