@cellajs/create-cella 0.6.1 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,7 +8,7 @@ CLI tool to create a new app from [the cella template](https://github.com/cellaj
8
8
  pnpm create @cellajs/cella my-app
9
9
  ```
10
10
 
11
- The directory must be new or empty, and its name becomes the app's slug: lowercase letters and digits, starting with a letter, single hyphens between parts and at least 4 characters besides hyphens. A run that fails or is interrupted removes what it wrote.
11
+ The directory must be new or empty. The name becomes the app's slug.
12
12
 
13
13
  ## CLI Options
14
14
 
@@ -27,7 +27,7 @@ pnpm create @cellajs/cella [directory] [options]
27
27
  ## What It Does
28
28
 
29
29
  1. Creates a new app from a cella template snapshot
30
- 2. Lets you choose an app number that is free on this machine, and the seed admin email
30
+ 2. Lets you choose an app number (port offset) and the seed admin email
31
31
  3. Cleans the template, generates the app's config and points coding agents at the template's rules and skills
32
32
  4. Initializes a fresh git repository with an initial commit
33
33
  5. Adds the cella upstream remote for `pnpm cella upgrade`
package/dist/index.js CHANGED
@@ -105,7 +105,7 @@ async function findBusyPorts(index) {
105
105
  return ports.filter((_, i) => listening[i]);
106
106
  }
107
107
  // package.json
108
- var version = "0.6.1";
108
+ var version = "0.6.3";
109
109
  var description = "Cella is a TypeScript template to create web apps with sync and offline capabilities.";
110
110
  var homepage = "https://cellajs.com";
111
111
  // src/display.ts
@@ -203,11 +203,15 @@ function githubGitUrl(template) {
203
203
  if (!owner || !repo) throw new Error(`Invalid template '${template}'. Expected 'github:owner/repo'.`);
204
204
  return `https://github.com/${owner}/${repo}.git`;
205
205
  }
206
- /** A version, with or without the `v` prefix; `create-cella-0.2.3` and `archive/pre-release` start with a name. */
207
- const releaseTagPattern = /^v?\d[\w.+-]*$/;
208
- /** The highest release tag, in git's `version:refname` order as `pnpm cella upgrade` sorts them, or null. */
206
+ /**
207
+ * A `major.minor.patch` version, with or without the `v` prefix; a pre-release (`1.0.0-rc.1`), `create-cella-0.2.3`
208
+ * and `archive/pre-release` are none.
209
+ */
210
+ const releaseTagPattern = /^v?\d+\.\d+\.\d+$/;
211
+ /** The highest release tag by version number, the `v` prefix aside, as `pnpm cella upgrade` picks it, or null. */
209
212
  function pickLatestReleaseTag(tags) {
210
- return tags.filter((tag) => releaseTagPattern.test(tag)).sort((a, b) => a.localeCompare(b, "en", { numeric: true })).at(-1) ?? null;
213
+ const version = (tag) => tag.replace(/^v/, "");
214
+ return tags.filter((tag) => releaseTagPattern.test(tag)).sort((a, b) => version(a).localeCompare(version(b), "en", { numeric: true })).at(-1) ?? null;
211
215
  }
212
216
  /**
213
217
  * The latest template release: its tag from the git tags, over the transport the clone uses, so the GitHub API limit
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["packageJson.version","packageJson.description","packageJson.homepage","fs","fs"],"sources":["../src/colors.ts","../src/dev-ports.ts","../package.json","../src/display.ts","../src/template.ts","../src/answers.ts","../src/app-files.ts","../src/app-repo.ts","../src/create-cella-cli.ts"],"sourcesContent":["import { styleText } from 'node:util';\n\ntype ColorStyle = 'bold' | 'cyan' | 'dim' | 'gray' | 'green' | 'red' | 'yellow';\n\nfunction colorsEnabled(): boolean {\n // biome-ignore lint/style/noProcessEnv: the color switches are the only environment this package reads.\n const { NO_COLOR, FORCE_COLOR } = process.env;\n if (NO_COLOR !== undefined) return false;\n if (FORCE_COLOR !== undefined) return FORCE_COLOR !== '0' && FORCE_COLOR !== 'false';\n return !!process.stdout.isTTY;\n}\n\nfunction applyStyle(style: ColorStyle, text: string): string {\n if (!colorsEnabled()) return text;\n return styleText(style, text, { validateStream: false });\n}\n\nconst pc = {\n bold: (text: string) => applyStyle('bold', text),\n cyan: (text: string) => applyStyle('cyan', text),\n dim: (text: string) => applyStyle('dim', text),\n gray: (text: string) => applyStyle('gray', text),\n green: (text: string) => applyStyle('green', text),\n red: (text: string) => applyStyle('red', text),\n yellow: (text: string) => applyStyle('yellow', text),\n};\n\nexport default pc;\n","import { readdir, readFile } from 'node:fs/promises';\nimport { connect } from 'node:net';\nimport { dirname, join } from 'node:path';\n\n/**\n * The local ports the template's dev stack takes for an app index, as its config shifts them: the index is added to\n * the frontend's and Drizzle Studio's, ten times the index to the seven services' and the dev and test databases'.\n */\nexport const appPorts = (index: number) => ({\n frontend: 3000 + index,\n drizzleStudio: 3983 + index,\n services: Array.from({ length: 7 }, (_, i) => 4000 + index * 10 + i),\n databases: [5432 + index * 10, 5434 + index * 10],\n});\n\n/** Index 4 is never offered: its internal listener would sit on 4045, which fetch refuses. */\nexport const isAppIndex = (index: number): boolean =>\n Number.isInteger(index) && index >= 0 && index <= 9 && index !== 4;\n\n/** The rule `isAppIndex` checks, worded for a refusal. */\nexport const appIndexRule = 'a whole number from 0 to 9, not 4';\n\ninterface SiblingApp {\n project: string;\n frontend: number;\n backend: number;\n}\n\n/**\n * The dev ports of the cella apps beside `targetFolder`, found by their `shared/config/config.development.ts`. The\n * frontend port sits in that file's `origin`, or `frontendUrl` in older apps; the backend port in\n * `services.backend.port` of `config.default.ts`, or `devPorts` in either file before that, or `backendUrl` on a port\n * of its own before that; `devAppIndex` in the default config moves whatever ports the files carry.\n */\nexport async function detectUsedPorts(targetFolder: string): Promise<SiblingApp[]> {\n const parentDir = dirname(targetFolder);\n const siblings = await readdir(parentDir).catch(() => []);\n const used: SiblingApp[] = [];\n\n for (const name of siblings) {\n const configDir = join(parentDir, name, 'shared/config');\n const development = await readFile(join(configDir, 'config.development.ts'), 'utf8').catch(() => null);\n const frontendMatch = development?.match(/(?:origin|frontendUrl):\\s*'http:\\/\\/localhost:(\\d+)/);\n if (!development || !frontendMatch) continue;\n const defaults = await readFile(join(configDir, 'config.default.ts'), 'utf8').catch(() => '');\n const frontend = Number(frontendMatch[1]);\n const index = Number(defaults.match(/devAppIndex:\\s*(\\d+)/)?.[1] ?? 0);\n const servicePattern = /backend:\\s*\\{[^}]*?\\bport:\\s*(\\d+)/;\n const apiPattern = /devPorts:\\s*\\{[^}]*?\\bapi:\\s*(\\d+)/;\n const portMatch =\n defaults.match(servicePattern) ??\n development.match(apiPattern) ??\n defaults.match(apiPattern) ??\n development.match(/backendUrl:\\s*'http:\\/\\/localhost:(\\d+)'/);\n // The oldest apps carry no backend port at all: assume the paired one\n const backend = portMatch ? Number(portMatch[1]) : frontend + 1000;\n used.push({ project: name, frontend: frontend + index, backend: backend + index * 10 });\n }\n\n return used;\n}\n\n/** The first app index whose frontend port and service block no sibling uses and that `isBusy` leaves free, else 0. */\nexport function findNextAppIndex(siblings: SiblingApp[], isBusy: (index: number) => boolean = () => false): number {\n for (let index = 0; index <= 9; index += 1) {\n if (!isAppIndex(index) || isBusy(index)) continue;\n const { frontend, services } = appPorts(index);\n const api = services[0];\n const taken = siblings.some((p) => p.frontend === frontend || (p.backend >= api && p.backend < api + 10));\n if (!taken) return index;\n }\n return 0;\n}\n\n/** Whether something on this machine accepts a connection on the port. */\nconst isListening = (port: number): Promise<boolean> =>\n new Promise((resolve) => {\n const socket = connect({ port, host: '127.0.0.1', timeout: 300 });\n const finish = (listening: boolean) => {\n socket.destroy();\n resolve(listening);\n };\n socket.once('connect', () => finish(true));\n socket.once('timeout', () => finish(false));\n socket.once('error', () => finish(false));\n });\n\n/** The ports of an app index that are already taken, lowest first. */\nexport async function findBusyPorts(index: number): Promise<number[]> {\n const ports = Object.values(appPorts(index)).flat();\n const listening = await Promise.all(ports.map(isListening));\n return ports.filter((_, i) => listening[i]);\n}\n","","import { relative } from 'node:path';\nimport packageJson from '../package.json' with { type: 'json' };\nimport type { Answers } from './answers';\nimport pc from './colors';\nimport { appPorts } from './dev-ports';\n\nexport const cliName = 'create cella';\nexport const cliVersion = packageJson.version;\n\nconst divider = '─'.repeat(60);\nconst checkMark = pc.green('✓');\n\nexport function showBanner(): void {\n console.info();\n console.info(pc.cyan(' _ _ '));\n console.info(pc.cyan('▒▓█████▓▒ ___ ___| | | __ _ '));\n console.info(pc.cyan('▒▓█ █▓▒ / __/ _ \\\\ | |/ _` | '));\n console.info(pc.cyan('▒▓█ █▓▒ | (_| __/ | | (_| | '));\n console.info(pc.cyan('▒▓█████▓▒ \\\\___\\\\___|_|_|\\\\__,_| '));\n console.info();\n console.info(pc.dim(packageJson.description));\n console.info();\n const left = `⧈ ${cliName}`;\n const right = packageJson.homepage;\n // Padding counts the visible characters only, not the ANSI codes\n const padding = Math.max(1, divider.length - `${left} · ${cliVersion}${right}`.length);\n console.info(`${pc.cyan(left)} ${pc.dim(`· ${cliVersion}`)}${' '.repeat(padding)}${pc.cyan(right)}`);\n console.info(divider);\n}\n\n/** Keep the answer of a prompt that clears itself on screen. */\nexport function confirmChoice(label: string, value: string): void {\n console.info(`${checkMark} ${label} · ${value}`);\n console.info();\n}\n\nlet stepText: string | undefined;\nlet timer: ReturnType<typeof setInterval> | undefined;\n\n/** Animate the running step on a terminal only: a log gets the finished steps. Stdin stays untouched, so ctrl-c reaches the run. */\nfunction spin(): void {\n if (!stepText || !process.stdout.isTTY) return;\n const frames = ['-', '\\\\', '|', '/'];\n let frame = 0;\n const render = () => process.stdout.write(`\\r${pc.cyan(frames[frame++ % frames.length])} ${stepText}`);\n render();\n timer = setInterval(render, 80);\n}\n\nfunction clearSpinner(): void {\n if (!timer) return;\n clearInterval(timer);\n timer = undefined;\n process.stdout.write('\\r\\x1b[2K');\n}\n\n/** Mark the running step done and start `text`; without text the steps end. */\nexport function step(text?: string): void {\n clearSpinner();\n if (stepText) console.info(`${checkMark} ${stepText}`);\n stepText = text;\n spin();\n}\n\n/** End the steps without marking the running one done. */\nexport function stopSpinner(): void {\n clearSpinner();\n stepText = undefined;\n}\n\n/** Print a warning above the running step. */\nexport function warn(message: string): void {\n clearSpinner();\n console.warn(`${pc.yellow('⚠')} ${message}`);\n spin();\n}\n\nexport function showNextSteps({ name, targetFolder, appIndex, adminEmail }: Answers): void {\n const path = relative(process.cwd(), targetFolder);\n const and = pc.dim('&&');\n\n console.info();\n console.info(`${checkMark} ${pc.bold(`created ${name}`)}`);\n console.info();\n console.info(pc.bold('Next steps'));\n console.info(divider);\n console.info();\n if (path) console.info(`${pc.dim('$')} cd ${pc.cyan(path)}`);\n console.info(`${pc.dim('$')} ${pc.cyan('pnpm install')}`);\n console.info(`${pc.dim('$')} ${pc.cyan('pnpm generate')}`);\n console.info(`${pc.dim('$')} ${pc.cyan('pnpm docker')} ${and} ${pc.cyan('pnpm seed')} ${and} ${pc.cyan('pnpm dev')}`);\n console.info();\n console.info(\n `${pc.gray('Then open')} ${pc.cyan(`http://localhost:${appPorts(appIndex).frontend}`)} ${pc.gray('and sign in as')} ${pc.cyan(adminEmail)}${pc.gray(': the magic link is printed in the pnpm dev output.')}`,\n );\n console.info();\n // Relative to the new app, so the terminal links the app's README, not this package's\n console.info(\n `${pc.gray('To get started building, please read:')} ${pc.cyan(path ? `${path}/README.md` : 'README.md')}`,\n );\n console.info();\n console.info(`🥳 enjoy building ${pc.green(name)} with cella!`);\n console.info();\n}\n","import fs, { existsSync } from 'node:fs';\nimport { cp, mkdir, rm } from 'node:fs/promises';\nimport { dirname, isAbsolute, join, relative, resolve } from 'node:path';\nimport git from 'isomorphic-git';\nimport http from 'isomorphic-git/http/node';\nimport type { Answers } from './answers';\nimport { step } from './display';\n\nexport const templateRepository = 'cellajs/cella';\n\n/** The HTTPS git URL of `github:owner/repo` or `owner/repo`: reading a public repository needs no SSH key. */\nexport function githubGitUrl(template: string): string {\n const [owner, repo] = template.replace(/^github:/, '').split('/');\n if (!owner || !repo) throw new Error(`Invalid template '${template}'. Expected 'github:owner/repo'.`);\n return `https://github.com/${owner}/${repo}.git`;\n}\n\n/** A version, with or without the `v` prefix; `create-cella-0.2.3` and `archive/pre-release` start with a name. */\nconst releaseTagPattern = /^v?\\d[\\w.+-]*$/;\n\n/** The highest release tag, in git's `version:refname` order as `pnpm cella upgrade` sorts them, or null. */\nexport function pickLatestReleaseTag(tags: string[]): string | null {\n const releases = tags.filter((tag) => releaseTagPattern.test(tag));\n return releases.sort((a, b) => a.localeCompare(b, 'en', { numeric: true })).at(-1) ?? null;\n}\n\n/**\n * The latest template release: its tag from the git tags, over the transport the clone uses, so the GitHub API limit\n * for callers without a token cannot hide it; its date (YYYY-MM-DD) from that API when it answers. Null offline.\n */\nexport async function fetchLatestRelease(): Promise<{ tag: string; date?: string } | null> {\n const refs = await git\n .listServerRefs({ http, url: githubGitUrl(templateRepository), prefix: 'refs/tags/' })\n .catch(() => []);\n const tag = pickLatestReleaseTag(refs.map(({ ref }) => ref.slice('refs/tags/'.length)));\n if (!tag) return null;\n\n const release = await fetchGithub<{ published_at?: string }>(`releases/tags/${tag}`);\n return { tag, date: release?.published_at?.slice(0, 10) };\n}\n\n/** The latest commit on the template's main branch, with its subject and date (YYYY-MM-DD), or null. */\nexport async function fetchLatestCommit(): Promise<{ sha: string; message: string; date: string } | null> {\n const data = await fetchGithub<{ sha?: string; commit?: { message?: string; author?: { date?: string } } }>(\n 'commits/main',\n );\n if (!data?.sha) return null;\n const message = (data.commit?.message ?? '').split('\\n')[0];\n return { sha: data.sha, message, date: data.commit?.author?.date?.slice(0, 10) ?? 'unknown' };\n}\n\n/** A GitHub API answer about the template, or null: callers without a token have a low limit. */\nasync function fetchGithub<T>(path: string): Promise<T | null> {\n try {\n const url = `https://api.github.com/repos/${templateRepository}/${path}`;\n const response = await fetch(url, { headers: { Accept: 'application/vnd.github+json' } });\n return response.ok ? ((await response.json()) as T) : null;\n } catch {\n return null;\n }\n}\n\nconst isLocalPath = (path: string): boolean => path.startsWith('/') || path.startsWith('./') || path.startsWith('../');\n\n/**\n * Put the template's files in `targetFolder`: a shallow clone of a GitHub template, or the tracked files of a local\n * checkout from its working tree, so build output and local `.env` secrets stay behind.\n * @returns The template commit the files come from; null when isomorphic-git cannot resolve a local checkout's `HEAD`,\n * as in a linked worktree.\n */\nexport async function getTemplate({ template, templateRef, targetFolder, name }: Answers): Promise<string | null> {\n if (!template || !isLocalPath(template)) {\n step(`downloading cella template${templateRef ? ` (${templateRef})` : ''}`);\n const url = githubGitUrl(template ?? templateRepository);\n // Isomorphic-git needs no git binary and no shell; the clone's history goes, since the app starts its own\n await git.clone({ fs, http, dir: targetFolder, url, ref: templateRef ?? 'main', singleBranch: true, depth: 1 });\n const baseCommit = await git.resolveRef({ fs, dir: targetFolder, ref: 'HEAD' });\n await rm(join(targetFolder, '.git'), { recursive: true, force: true });\n return baseCommit;\n }\n\n step('copying local template');\n const source = resolve(template);\n const rel = relative(source, targetFolder);\n if (rel === '' || (!rel.startsWith('..') && !isAbsolute(rel))) {\n throw new Error(\n 'Cannot create the app inside the template directory.\\n' +\n ` Run from outside: cd ~ && pnpm create @cellajs/cella ${name} --template ${template}`,\n );\n }\n\n const files = await git.listFiles({ fs, dir: source });\n if (files.length === 0) throw new Error(`${source} is no git checkout: a local template must be one.`);\n for (const file of files) {\n const from = join(source, file);\n // Tracked, but deleted in the working tree\n if (!existsSync(from)) continue;\n const to = join(targetFolder, file);\n await mkdir(dirname(to), { recursive: true });\n await cp(from, to);\n }\n return git.resolveRef({ fs, dir: source, ref: 'HEAD' }).catch(() => null);\n}\n","import { existsSync } from 'node:fs';\nimport { readdir } from 'node:fs/promises';\nimport { basename, resolve } from 'node:path';\nimport { input, select } from '@inquirer/prompts';\nimport pc from './colors';\nimport { appIndexRule, appPorts, detectUsedPorts, findBusyPorts, findNextAppIndex, isAppIndex } from './dev-ports';\nimport { confirmChoice, warn } from './display';\nimport { fetchLatestCommit, fetchLatestRelease, templateRepository } from './template';\n\n/** The template's config refuses any other `slug` at its first load (cella `shared/src/config-builder/app-config.ts`). */\nexport const isAppSlug = (name: string): boolean =>\n /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(name) && name.replaceAll('-', '').length >= 4;\n\n/** The rule `isAppSlug` checks, worded for a refusal. */\nexport const appSlugRule =\n 'the name becomes the app slug: lowercase letters and digits, starting with a letter, single hyphens between parts and at least 4 characters besides hyphens, such as my-app';\n\n/** A plain shape check: the value lands on one line of the app's `.env` and is the seed user's sign-in address. */\nexport const isEmail = (value: string): boolean => /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value);\n\n/** What the command line answered already. */\nexport interface Flags {\n directory?: string;\n /** A local git checkout or `github:owner/repo`. */\n template?: string;\n appIndex?: number;\n adminEmail?: string;\n}\n\nexport interface Answers {\n template?: string;\n /** The release tag or branch to clone; the default branch when absent, and unused for a local template. */\n templateRef?: string;\n targetFolder: string;\n /** The app's slug: the name of its folder. */\n name: string;\n appIndex: number;\n adminEmail: string;\n}\n\n// A prompt clears itself once answered, and `confirmChoice` keeps the answer on screen\nconst theme = { prefix: '', style: { answer: (text: string) => text } };\nconst context = { clearPromptOnDone: true };\n\n/** Ask what the flags leave open, and refuse a folder that is not empty. */\nexport async function askAnswers({ directory, template, ...flags }: Flags): Promise<Answers> {\n // A custom template is taken as it is\n const templateRef = template ? undefined : await askTemplateRef();\n\n const targetFolder = resolve(\n directory ??\n (await input(\n {\n message: 'Enter your app name',\n default: 'my-cella-app',\n theme,\n validate: (name) => (isAppSlug(basename(resolve(name))) ? true : `Invalid app name: ${appSlugRule}`),\n },\n context,\n )),\n );\n if (existsSync(targetFolder) && (await readdir(targetFolder)).length > 0) {\n throw new Error(`${targetFolder} is not empty: choose a new folder, or empty this one first.`);\n }\n\n const appIndex = flags.appIndex ?? (await askAppIndex(targetFolder));\n confirmChoice('App index', formatAppIndex(appIndex));\n const busyPorts = await findBusyPorts(appIndex);\n if (busyPorts.length > 0) {\n warn(`In use on this machine: ${busyPorts.join(', ')}. Stop what holds them before pnpm docker and pnpm dev.`);\n console.info();\n }\n\n // The reserved example.com domain (RFC 2606) can never route real mail\n const adminEmail =\n flags.adminEmail ??\n (await input(\n {\n message: 'Admin email for initial seed user',\n default: 'admin@example.com',\n theme,\n validate: (email) => (isEmail(email) ? true : 'Enter an address such as admin@example.com'),\n },\n context,\n ));\n confirmChoice('Admin email', adminEmail);\n\n return { template, templateRef, targetFolder, name: basename(targetFolder), appIndex, adminEmail };\n}\n\n/**\n * Offer the latest release and the latest commit, each with its date, as the template to start from.\n * @returns The release tag, or `main` for the latest commit; undefined when neither is known (offline).\n */\nasync function askTemplateRef(): Promise<string | undefined> {\n const [release, commit] = await Promise.all([fetchLatestRelease(), fetchLatestCommit()]);\n\n console.info(pc.dim('This create CLI allows you to get started with cella quickly.'));\n console.info();\n if (release)\n console.info(` Latest release: ${release.tag}${release.date ? ` ${pc.dim(`· ${release.date}`)}` : ''}`);\n if (commit) {\n console.info(` Latest commit: ${commit.sha.slice(0, 7)} ${pc.dim(`· ${commit.message} · ${commit.date}`)}`);\n console.info(` ${pc.gray(`https://github.com/${templateRepository}/commit/${commit.sha}`)}`);\n }\n if (release || commit) console.info();\n\n if (!release) {\n warn('Latest release not found · using the latest commit on main');\n console.info();\n return commit ? 'main' : undefined;\n }\n\n // Without a commit to offer or a terminal to choose on (CI, piped stdin), the release is the reproducible start\n const choices = [\n { name: 'Latest release', value: 'release' },\n { name: 'Latest commit', value: 'commit' },\n ];\n if (\n !commit ||\n !process.stdin.isTTY ||\n (await select({ message: 'Choose which cella version to start from:', theme, choices }, context)) === 'release'\n ) {\n confirmChoice('Latest release', release.tag);\n return release.tag;\n }\n // The tip of main: a shallow clone over GitHub's smart HTTP cannot reliably fetch an arbitrary sha\n confirmChoice('Latest commit', commit.sha.slice(0, 7));\n return 'main';\n}\n\n/** An app index with its frontend, backend and database ports, such as \"1 → :3001 / :4010 / :5442\". */\nfunction formatAppIndex(index: number, note = ''): string {\n const { frontend, services, databases } = appPorts(index);\n return `${index} → :${frontend} / :${services[0]} / :${databases[0]}${note}`;\n}\n\n/** Suggest an app index no sibling app and no listener on this machine takes, and ask for one. */\nasync function askAppIndex(targetFolder: string): Promise<number> {\n const siblings = await detectUsedPorts(targetFolder);\n const presets = [1, 2, 3];\n const busy = new Map(await Promise.all([0, ...presets].map(async (i) => [i, await findBusyPorts(i)] as const)));\n const isBusy = (i: number) => (busy.get(i)?.length ?? 0) > 0;\n const suggested = findNextAppIndex(siblings, isBusy);\n const label = (i: number, note = '') => formatAppIndex(i, isBusy(i) ? ` (port ${busy.get(i)?.[0]} in use)` : note);\n\n // The hint sits in the message, so clearPromptOnDone wipes it; a plain message style keeps the title alone bold\n let message = `${pc.bold('App index')} ${pc.dim('· to avoid port conflicts with other apps on this machine')}`;\n if (siblings.length > 0) {\n const count = siblings.length;\n message += pc.dim(`\\nDetected ${count} sibling app${count === 1 ? '' : 's'} · suggested index ${suggested}`);\n }\n\n // 0 is the default and the suggestion comes first, so neither repeats among the presets\n const choice = await select(\n {\n message,\n theme: { ...theme, style: { ...theme.style, message: (text: string) => text } },\n choices: [\n ...(suggested > 0 ? [{ name: formatAppIndex(suggested, ' (suggested)'), value: suggested }] : []),\n { name: label(0, ' (default)'), value: 0 },\n ...presets.filter((i) => i !== suggested).map((i) => ({ name: label(i), value: i })),\n { name: 'Custom index', value: -1 },\n ],\n },\n context,\n );\n if (choice !== -1) return choice;\n\n const custom = await input(\n {\n message: `Enter custom index, ${appIndexRule}`,\n default: String(suggested),\n theme,\n validate: (value) => (isAppIndex(Number(value)) ? true : `Must be ${appIndexRule}`),\n },\n context,\n );\n return Number(custom);\n}\n","import fs from 'node:fs/promises';\nimport { dirname, join, posix, relative } from 'node:path';\nimport type { Answers } from './answers';\nimport { appPorts } from './dev-ports';\nimport { warn } from './display';\n\n/** The version an app starts from, so release-please cuts its first release from a clean slate. */\nconst initialVersion = '0.0.0';\n\n/** Entry points a coding agent reads from the repo root; the rules and skills live in the template's `cella/` folder. */\nconst agentFiles: Record<string, string> = {\n 'AGENTS.md':\n '# Agent guidelines\\n\\nThis app is built from the cella template. Read [cella/AGENTS.md](./cella/AGENTS.md) before changing code: it holds the project rules. Skills, such as `add-entity`, live in [cella/skills](./cella/skills).\\n',\n 'CLAUDE.md': '@cella/AGENTS.md\\n',\n};\n\nconst manifestPath = 'cella/create-cella.json';\nconst editNames = [\n 'quickstart',\n 'configTemplate',\n 'config',\n 'cliConfig',\n 'envExample',\n 'releaseConfig',\n 'releaseManifest',\n] as const;\n\n/** The template paths a new app changes, as the template itself names them in `cella/create-cella.json`. */\ninterface Manifest {\n remove: string[];\n empty: string[];\n /** Template path to the copy's path in the app. */\n copy: Record<string, string>;\n /** Template path to the symlink's path in the app. */\n link: Record<string, string>;\n edit: Record<(typeof editNames)[number], string>;\n}\n\n/** @throws When the template has no manifest, or its manifest names no path for an edit this version makes. */\nasync function readManifest(targetFolder: string): Promise<Manifest> {\n const source = await fs.readFile(join(targetFolder, manifestPath), 'utf8').catch(() => null);\n if (source === null) throw new Error(`This template has no ${manifestPath}: use a newer template.`);\n const manifest: Manifest = JSON.parse(source);\n const unnamed = editNames.filter((name) => typeof manifest.edit?.[name] !== 'string');\n if (unnamed.length > 0) {\n throw new Error(`${manifestPath} names no path for ${unnamed.join(', ')}: use a newer template.`);\n }\n return manifest;\n}\n\n/**\n * Turn the template's files in `targetFolder` into the app's: its name, index and admin email in the config and the\n * `.env`, its own release state, the quickstart as README, and none of the template's own repos, migrations or stack.\n * @returns The template paths it expected and did not find; a template without one skips that edit.\n */\nexport async function writeAppFiles({ targetFolder, name, appIndex, adminEmail }: Answers): Promise<string[]> {\n const missing: string[] = [];\n const at = (path: string) => join(targetFolder, path);\n // A template path that is not there goes into `missing`, and its edit is skipped\n const edit = async (path: string, change: (file: string) => Promise<unknown>) => {\n try {\n await change(at(path));\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error;\n missing.push(path);\n }\n };\n const rewrite = (path: string, change: (source: string) => string) =>\n edit(path, async (file) => fs.writeFile(file, change(await fs.readFile(file, 'utf8')), 'utf8'));\n const displayName = name.replace(/-/g, ' ').replace(/\\b\\w/g, (c) => c.toUpperCase());\n const { remove, empty, copy, link, edit: paths } = await readManifest(targetFolder);\n\n try {\n for (const [from, to] of Object.entries(copy)) await edit(from, (file) => fs.copyFile(file, at(to)));\n await edit(paths.quickstart, async (file) =>\n fs.writeFile(\n at('README.md'),\n quickstartToReadme(await fs.readFile(file, 'utf8'), paths.quickstart, displayName, appIndex),\n 'utf8',\n ),\n );\n await writeAgentEntry(targetFolder, link);\n\n // The placeholder config becomes the app's default config, and goes\n await edit(paths.configTemplate, async (file) => {\n const source = await fs.readFile(file, 'utf8');\n const config = source\n .replaceAll('__project_name__', displayName)\n .replaceAll('__project_slug__', name)\n .replace(/^(\\s*devAppIndex:\\s*)\\d+/m, (_, head: string) => `${head}${appIndex}`);\n await fs.writeFile(at(paths.config), config, 'utf8');\n await fs.rm(file);\n });\n\n // The app's own identity: the template's metadata keys stay, emptied, for the app to fill in\n await rewrite('package.json', (source) => {\n let pkg = source\n .replace(/^(\\s*\"name\":\\s*)\"[^\"]*\"/m, `$1\"${name}\"`)\n .replace(/^(\\s*\"version\":\\s*)\"[^\"]*\"/m, `$1\"${initialVersion}\"`)\n .replace(/^(\\s*\"keywords\":\\s*)\\[[^\\]]*\\]/m, '$1[]');\n for (const field of ['license', 'repository', 'description', 'author', 'homepage']) {\n pkg = pkg.replace(new RegExp(`^(\\\\s*\"${field}\":\\\\s*)\"[^\"]*\"`, 'm'), '$1\"\"');\n }\n return pkg;\n });\n // The template keeps its changelog in `cella/`, which the app keeps as upstream reference\n await rewrite(paths.releaseConfig, (source) => {\n const config = JSON.parse(source) as { packages?: Record<string, Record<string, unknown>> };\n config.packages ??= {};\n config.packages['.'] ??= {};\n config.packages['.']['changelog-path'] = 'CHANGELOG.md';\n return `${JSON.stringify(config, null, 2)}\\n`;\n });\n await edit(paths.releaseManifest, (file) => fs.writeFile(file, `{\\n \".\": \"${initialVersion}\"\\n}\\n`, 'utf8'));\n await fs.writeFile(at('CHANGELOG.md'), '# Changelog\\n', 'utf8');\n\n // `pnpm cella upgrade` never merges this file, so the list goes once here\n await rewrite(paths.cliConfig, stripForks);\n // Every port follows `devAppIndex` in the config, so the admin is the one value the app's `.env` changes\n await edit(paths.envExample, async (file) => {\n const env = (await fs.readFile(file, 'utf8')).replace(/^ADMIN_EMAIL=.*$/gm, () => `ADMIN_EMAIL=${adminEmail}`);\n await fs.writeFile(file.replace(/\\.example$/, ''), env, 'utf8');\n });\n\n // What an app starts without: the template's own migrations, and its stack file with the template's encryption salt\n for (const folder of empty) {\n await edit(folder, async (dir) => {\n const entries = await fs.readdir(dir);\n await Promise.all(entries.map((entry) => fs.rm(join(dir, entry), { recursive: true, force: true })));\n });\n }\n for (const path of remove) await edit(path, (file) => fs.rm(file, { recursive: true }));\n } catch (error) {\n throw new Error(`Error during the cleaning process: ${error instanceof Error ? error.message : error}`);\n }\n return missing;\n}\n\n/**\n * The quickstart as the README of a new app: at the repo root, with this app's port and without the step that just ran.\n * Its relative links resolve from the quickstart's folder in the template (`path`), and are rewritten from the root.\n */\nfunction quickstartToReadme(source: string, path: string, displayName: string, appIndex: number): string {\n const folder = posix.dirname(path);\n return source\n .replace(/^# .*$/m, `# ${displayName}`)\n .replace(/^## Create\\n[\\s\\S]*?(?=^## )/m, '')\n .replace(/\\]\\((\\.\\.?\\/[^)\\s]*)\\)/g, (_, target: string) => `](./${posix.join(folder, target)})`)\n .replaceAll('http://localhost:3000', `http://localhost:${appPorts(appIndex).frontend}`);\n}\n\n/** Point coding agents at the template's rules and skills, which sit in `cella/`, out of a root they would not search. */\nasync function writeAgentEntry(targetFolder: string, link: Manifest['link']): Promise<void> {\n await Promise.all(\n Object.entries(agentFiles).map(([file, content]) => fs.writeFile(join(targetFolder, file), content, 'utf8')),\n );\n\n // Local to this clone: `.claude` is gitignored, and the check scripts read tracked paths as files. AGENTS.md names the folder for a new clone.\n for (const [target, path] of Object.entries(link)) {\n const file = join(targetFolder, path);\n try {\n await fs.mkdir(dirname(file), { recursive: true });\n await fs.symlink(relative(dirname(file), join(targetFolder, target)), file);\n } catch (error) {\n // Windows refuses a symlink without developer mode; the skills stay readable in their own folder\n warn(`skipped ${path}: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n}\n\n/** The source of an upgrade config (`cella/cella.config.ts`) without its `forks` property and a comment line directly above it. */\nexport function stripForks(source: string): string {\n // The closing bracket sits at the property's own indent, or on the same line for a short list\n return source.replace(\n /^(?:[ \\t]*\\/\\/[^\\n]*\\n)?([ \\t]*)forks:\\s*\\[(?:[^\\n]*|[\\s\\S]*?\\n\\1)\\],?[ \\t]*\\n(?:[ \\t]*\\n)?/m,\n '',\n );\n}\n","import fs from 'node:fs';\nimport git from 'isomorphic-git';\nimport { warn } from './display';\nimport { githubGitUrl, templateRepository } from './template';\n\n/**\n * Make the app's repository: one commit of its files, and the template as remote `cella-upstream`, the name\n * `pnpm cella upgrade` looks for. The commit's `Cella-Base:` trailer names the template commit the files come from,\n * which the upgrade reads from the root commit to find its first merge base: the app shares no history with the template.\n * A failure only warns: the app's files stay usable without git.\n */\nexport async function makeRepository(dir: string, baseCommit: string | null): Promise<void> {\n try {\n await git.init({ fs, dir, defaultBranch: 'main' });\n await git.add({ fs, dir, filepath: '.' });\n const message = baseCommit ? `Initial commit\\n\\nCella-Base: ${baseCommit}` : 'Initial commit';\n // An explicit author, so the commit needs no git config on this machine\n await git.commit({ fs, dir, message, author: { name: 'cella', email: 'info@cellajs.com' } });\n await git.addRemote({ fs, dir, remote: 'cella-upstream', url: githubGitUrl(templateRepository), force: true });\n } catch (error) {\n warn(`skipped git init: ${error instanceof Error ? error.message : String(error)}`);\n }\n}\n","#!/usr/bin/env tsx\n\nimport { mkdir, readdir, rm } from 'node:fs/promises';\nimport { basename, join, resolve } from 'node:path';\nimport { Command, InvalidArgumentError } from 'commander';\nimport { appSlugRule, askAnswers, type Flags, isAppSlug, isEmail } from './answers';\nimport { writeAppFiles } from './app-files';\nimport { makeRepository } from './app-repo';\nimport pc from './colors';\nimport { appIndexRule, isAppIndex } from './dev-ports';\nimport { cliName, cliVersion, showBanner, showNextSteps, step, stopSpinner, warn } from './display';\nimport { getTemplate } from './template';\n\nfunction parseFlags(): Flags {\n const program = new Command(cliName)\n .version(cliVersion, '-v, --version', `output the current version of ${cliName}`)\n .argument('[directory]', 'the directory name for the new app')\n .usage('[directory] [options]')\n .helpOption('-h, --help', 'display this help message')\n .option('--template <path>', 'use a custom template (local git checkout or github:user/repo)')\n .option('--app-index <number>', `set this app's number for its dev ports, ${appIndexRule}`, (value) => {\n if (!isAppIndex(Number(value))) throw new InvalidArgumentError(`App index must be ${appIndexRule}`);\n return Number(value);\n })\n .option('--admin-email <email>', 'set the admin email for the initial seed user', (value) => {\n if (!isEmail(value)) throw new InvalidArgumentError('Admin email must be an address such as admin@example.com');\n return value;\n })\n .parse();\n\n const directory = program.args[0]?.trim() || undefined;\n if (directory && !isAppSlug(basename(resolve(directory)))) {\n program.error(`error: invalid app name \"${directory}\": ${appSlugRule}.`);\n }\n return { directory, ...program.opts<Omit<Flags, 'directory'>>() };\n}\n\nasync function main(): Promise<void> {\n const flags = parseFlags();\n showBanner();\n const answers = await askAnswers(flags);\n const { targetFolder } = answers;\n\n // Until the app is made, a failure or a signal removes what the run wrote\n let undo = async () => {};\n const onSignal = (code: number) => () => {\n stopSpinner();\n void undo().finally(() => process.exit(code));\n };\n const onSigint = onSignal(130);\n const onSigterm = onSignal(143);\n process.once('SIGINT', onSigint).once('SIGTERM', onSigterm);\n\n let missing: string[];\n try {\n step('creating app folder');\n const createdFolder = await mkdir(targetFolder, { recursive: true });\n undo = () => removeOutput(targetFolder, createdFolder);\n const baseCommit = await getTemplate(answers);\n step('cleaning template');\n missing = await writeAppFiles(answers);\n step('initializing git');\n await makeRepository(targetFolder, baseCommit);\n step();\n } catch (error) {\n stopSpinner();\n await undo();\n throw error;\n } finally {\n process.off('SIGINT', onSigint).off('SIGTERM', onSigterm);\n }\n\n if (missing.length > 0) warn(`Not in the template, skipped: ${missing.join(', ')}`);\n showNextSteps(answers);\n}\n\n/** Remove what a run wrote: the folders `mkdir` made, else everything in the target, which the run only accepts empty. */\nasync function removeOutput(targetFolder: string, createdFolder: string | undefined): Promise<void> {\n if (createdFolder) return rm(createdFolder, { recursive: true, force: true });\n const entries = await readdir(targetFolder);\n await Promise.all(entries.map((entry) => rm(join(targetFolder, entry), { recursive: true, force: true })));\n}\n\nmain().catch((error) => {\n // Ctrl-c at a prompt. Its class lives in @inquirer/core, which is no direct dependency: match the name.\n if (error instanceof Error && error.name === 'ExitPromptError') process.exit(130);\n console.error(`${pc.red('✗')} ${pc.red(error instanceof Error ? error.message : String(error))}`);\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;;;AAIA,SAAS,gBAAyB;CAEhC,MAAM,EAAE,UAAU,gBAAgB,QAAQ;CAC1C,IAAI,aAAa,KAAA,GAAW,OAAO;CACnC,IAAI,gBAAgB,KAAA,GAAW,OAAO,gBAAgB,OAAO,gBAAgB;CAC7E,OAAO,CAAC,CAAC,QAAQ,OAAO;AAC1B;AAEA,SAAS,WAAW,OAAmB,MAAsB;CAC3D,IAAI,CAAC,cAAc,GAAG,OAAO;CAC7B,OAAO,UAAU,OAAO,MAAM,EAAE,gBAAgB,MAAM,CAAC;AACzD;AAEA,MAAM,KAAK;CACT,OAAO,SAAiB,WAAW,QAAQ,IAAI;CAC/C,OAAO,SAAiB,WAAW,QAAQ,IAAI;CAC/C,MAAM,SAAiB,WAAW,OAAO,IAAI;CAC7C,OAAO,SAAiB,WAAW,QAAQ,IAAI;CAC/C,QAAQ,SAAiB,WAAW,SAAS,IAAI;CACjD,MAAM,SAAiB,WAAW,OAAO,IAAI;CAC7C,SAAS,SAAiB,WAAW,UAAU,IAAI;AACrD;;;;;;ACjBA,MAAa,YAAY,WAAmB;CAC1C,UAAU,MAAO;CACjB,eAAe,OAAO;CACtB,UAAU,MAAM,KAAK,EAAE,QAAQ,EAAE,IAAI,GAAG,MAAM,MAAO,QAAQ,KAAK,CAAC;CACnE,WAAW,CAAC,OAAO,QAAQ,IAAI,OAAO,QAAQ,EAAE;AAClD;;AAGA,MAAa,cAAc,UACzB,OAAO,UAAU,KAAK,KAAK,SAAS,KAAK,SAAS,KAAK,UAAU;;AAGnE,MAAa,eAAe;;;;;;;AAc5B,eAAsB,gBAAgB,cAA6C;CACjF,MAAM,YAAY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c,OAAO;AACvB;;AAGA,eAAe,aAAa,cAAsB,eAAkD;CAClG,IAAI,eAAe,OAAO,GAAG,eAAe;EAAE,WAAW;EAAM,OAAO;CAAK,CAAC;CAC5E,MAAM,UAAU,MAAM,QAAQ,YAAY;CAC1C,MAAM,QAAQ,IAAI,QAAQ,KAAK,UAAU,GAAG,KAAK,cAAc,KAAK,GAAG;EAAE,WAAW;EAAM,OAAO;CAAK,CAAC,CAAC,CAAC;AAC3G;AAEA,KAAK,CAAC,CAAC,OAAO,UAAU;CAEtB,IAAI,iBAAiB,SAAS,MAAM,SAAS,mBAAmB,QAAQ,KAAK,GAAG;CAChF,QAAQ,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,GAAG,GAAG,IAAI,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,GAAG;CAChG,QAAQ,KAAK,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"index.js","names":["packageJson.version","packageJson.description","packageJson.homepage","fs","fs"],"sources":["../src/colors.ts","../src/dev-ports.ts","../package.json","../src/display.ts","../src/template.ts","../src/answers.ts","../src/app-files.ts","../src/app-repo.ts","../src/create-cella-cli.ts"],"sourcesContent":["import { styleText } from 'node:util';\n\ntype ColorStyle = 'bold' | 'cyan' | 'dim' | 'gray' | 'green' | 'red' | 'yellow';\n\nfunction colorsEnabled(): boolean {\n // biome-ignore lint/style/noProcessEnv: the color switches are the only environment this package reads.\n const { NO_COLOR, FORCE_COLOR } = process.env;\n if (NO_COLOR !== undefined) return false;\n if (FORCE_COLOR !== undefined) return FORCE_COLOR !== '0' && FORCE_COLOR !== 'false';\n return !!process.stdout.isTTY;\n}\n\nfunction applyStyle(style: ColorStyle, text: string): string {\n if (!colorsEnabled()) return text;\n return styleText(style, text, { validateStream: false });\n}\n\nconst pc = {\n bold: (text: string) => applyStyle('bold', text),\n cyan: (text: string) => applyStyle('cyan', text),\n dim: (text: string) => applyStyle('dim', text),\n gray: (text: string) => applyStyle('gray', text),\n green: (text: string) => applyStyle('green', text),\n red: (text: string) => applyStyle('red', text),\n yellow: (text: string) => applyStyle('yellow', text),\n};\n\nexport default pc;\n","import { readdir, readFile } from 'node:fs/promises';\nimport { connect } from 'node:net';\nimport { dirname, join } from 'node:path';\n\n/**\n * The local ports the template's dev stack takes for an app index, as its config shifts them: the index is added to\n * the frontend's and Drizzle Studio's, ten times the index to the seven services' and the dev and test databases'.\n */\nexport const appPorts = (index: number) => ({\n frontend: 3000 + index,\n drizzleStudio: 3983 + index,\n services: Array.from({ length: 7 }, (_, i) => 4000 + index * 10 + i),\n databases: [5432 + index * 10, 5434 + index * 10],\n});\n\n/** Index 4 is never offered: its internal listener would sit on 4045, which fetch refuses. */\nexport const isAppIndex = (index: number): boolean =>\n Number.isInteger(index) && index >= 0 && index <= 9 && index !== 4;\n\n/** The rule `isAppIndex` checks, worded for a refusal. */\nexport const appIndexRule = 'a whole number from 0 to 9, not 4';\n\ninterface SiblingApp {\n project: string;\n frontend: number;\n backend: number;\n}\n\n/**\n * The dev ports of the cella apps beside `targetFolder`, found by their `shared/config/config.development.ts`. The\n * frontend port sits in that file's `origin`, or `frontendUrl` in older apps; the backend port in\n * `services.backend.port` of `config.default.ts`, or `devPorts` in either file before that, or `backendUrl` on a port\n * of its own before that; `devAppIndex` in the default config moves whatever ports the files carry.\n */\nexport async function detectUsedPorts(targetFolder: string): Promise<SiblingApp[]> {\n const parentDir = dirname(targetFolder);\n const siblings = await readdir(parentDir).catch(() => []);\n const used: SiblingApp[] = [];\n\n for (const name of siblings) {\n const configDir = join(parentDir, name, 'shared/config');\n const development = await readFile(join(configDir, 'config.development.ts'), 'utf8').catch(() => null);\n const frontendMatch = development?.match(/(?:origin|frontendUrl):\\s*'http:\\/\\/localhost:(\\d+)/);\n if (!development || !frontendMatch) continue;\n const defaults = await readFile(join(configDir, 'config.default.ts'), 'utf8').catch(() => '');\n const frontend = Number(frontendMatch[1]);\n const index = Number(defaults.match(/devAppIndex:\\s*(\\d+)/)?.[1] ?? 0);\n const servicePattern = /backend:\\s*\\{[^}]*?\\bport:\\s*(\\d+)/;\n const apiPattern = /devPorts:\\s*\\{[^}]*?\\bapi:\\s*(\\d+)/;\n const portMatch =\n defaults.match(servicePattern) ??\n development.match(apiPattern) ??\n defaults.match(apiPattern) ??\n development.match(/backendUrl:\\s*'http:\\/\\/localhost:(\\d+)'/);\n // The oldest apps carry no backend port at all: assume the paired one\n const backend = portMatch ? Number(portMatch[1]) : frontend + 1000;\n used.push({ project: name, frontend: frontend + index, backend: backend + index * 10 });\n }\n\n return used;\n}\n\n/** The first app index whose frontend port and service block no sibling uses and that `isBusy` leaves free, else 0. */\nexport function findNextAppIndex(siblings: SiblingApp[], isBusy: (index: number) => boolean = () => false): number {\n for (let index = 0; index <= 9; index += 1) {\n if (!isAppIndex(index) || isBusy(index)) continue;\n const { frontend, services } = appPorts(index);\n const api = services[0];\n const taken = siblings.some((p) => p.frontend === frontend || (p.backend >= api && p.backend < api + 10));\n if (!taken) return index;\n }\n return 0;\n}\n\n/** Whether something on this machine accepts a connection on the port. */\nconst isListening = (port: number): Promise<boolean> =>\n new Promise((resolve) => {\n const socket = connect({ port, host: '127.0.0.1', timeout: 300 });\n const finish = (listening: boolean) => {\n socket.destroy();\n resolve(listening);\n };\n socket.once('connect', () => finish(true));\n socket.once('timeout', () => finish(false));\n socket.once('error', () => finish(false));\n });\n\n/** The ports of an app index that are already taken, lowest first. */\nexport async function findBusyPorts(index: number): Promise<number[]> {\n const ports = Object.values(appPorts(index)).flat();\n const listening = await Promise.all(ports.map(isListening));\n return ports.filter((_, i) => listening[i]);\n}\n","","import { relative } from 'node:path';\nimport packageJson from '../package.json' with { type: 'json' };\nimport type { Answers } from './answers';\nimport pc from './colors';\nimport { appPorts } from './dev-ports';\n\nexport const cliName = 'create cella';\nexport const cliVersion = packageJson.version;\n\nconst divider = '─'.repeat(60);\nconst checkMark = pc.green('✓');\n\nexport function showBanner(): void {\n console.info();\n console.info(pc.cyan(' _ _ '));\n console.info(pc.cyan('▒▓█████▓▒ ___ ___| | | __ _ '));\n console.info(pc.cyan('▒▓█ █▓▒ / __/ _ \\\\ | |/ _` | '));\n console.info(pc.cyan('▒▓█ █▓▒ | (_| __/ | | (_| | '));\n console.info(pc.cyan('▒▓█████▓▒ \\\\___\\\\___|_|_|\\\\__,_| '));\n console.info();\n console.info(pc.dim(packageJson.description));\n console.info();\n const left = `⧈ ${cliName}`;\n const right = packageJson.homepage;\n // Padding counts the visible characters only, not the ANSI codes\n const padding = Math.max(1, divider.length - `${left} · ${cliVersion}${right}`.length);\n console.info(`${pc.cyan(left)} ${pc.dim(`· ${cliVersion}`)}${' '.repeat(padding)}${pc.cyan(right)}`);\n console.info(divider);\n}\n\n/** Keep the answer of a prompt that clears itself on screen. */\nexport function confirmChoice(label: string, value: string): void {\n console.info(`${checkMark} ${label} · ${value}`);\n console.info();\n}\n\nlet stepText: string | undefined;\nlet timer: ReturnType<typeof setInterval> | undefined;\n\n/** Animate the running step on a terminal only: a log gets the finished steps. Stdin stays untouched, so ctrl-c reaches the run. */\nfunction spin(): void {\n if (!stepText || !process.stdout.isTTY) return;\n const frames = ['-', '\\\\', '|', '/'];\n let frame = 0;\n const render = () => process.stdout.write(`\\r${pc.cyan(frames[frame++ % frames.length])} ${stepText}`);\n render();\n timer = setInterval(render, 80);\n}\n\nfunction clearSpinner(): void {\n if (!timer) return;\n clearInterval(timer);\n timer = undefined;\n process.stdout.write('\\r\\x1b[2K');\n}\n\n/** Mark the running step done and start `text`; without text the steps end. */\nexport function step(text?: string): void {\n clearSpinner();\n if (stepText) console.info(`${checkMark} ${stepText}`);\n stepText = text;\n spin();\n}\n\n/** End the steps without marking the running one done. */\nexport function stopSpinner(): void {\n clearSpinner();\n stepText = undefined;\n}\n\n/** Print a warning above the running step. */\nexport function warn(message: string): void {\n clearSpinner();\n console.warn(`${pc.yellow('⚠')} ${message}`);\n spin();\n}\n\nexport function showNextSteps({ name, targetFolder, appIndex, adminEmail }: Answers): void {\n const path = relative(process.cwd(), targetFolder);\n const and = pc.dim('&&');\n\n console.info();\n console.info(`${checkMark} ${pc.bold(`created ${name}`)}`);\n console.info();\n console.info(pc.bold('Next steps'));\n console.info(divider);\n console.info();\n if (path) console.info(`${pc.dim('$')} cd ${pc.cyan(path)}`);\n console.info(`${pc.dim('$')} ${pc.cyan('pnpm install')}`);\n console.info(`${pc.dim('$')} ${pc.cyan('pnpm generate')}`);\n console.info(`${pc.dim('$')} ${pc.cyan('pnpm docker')} ${and} ${pc.cyan('pnpm seed')} ${and} ${pc.cyan('pnpm dev')}`);\n console.info();\n console.info(\n `${pc.gray('Then open')} ${pc.cyan(`http://localhost:${appPorts(appIndex).frontend}`)} ${pc.gray('and sign in as')} ${pc.cyan(adminEmail)}${pc.gray(': the magic link is printed in the pnpm dev output.')}`,\n );\n console.info();\n // Relative to the new app, so the terminal links the app's README, not this package's\n console.info(\n `${pc.gray('To get started building, please read:')} ${pc.cyan(path ? `${path}/README.md` : 'README.md')}`,\n );\n console.info();\n console.info(`🥳 enjoy building ${pc.green(name)} with cella!`);\n console.info();\n}\n","import fs, { existsSync } from 'node:fs';\nimport { cp, mkdir, rm } from 'node:fs/promises';\nimport { dirname, isAbsolute, join, relative, resolve } from 'node:path';\nimport git from 'isomorphic-git';\nimport http from 'isomorphic-git/http/node';\nimport type { Answers } from './answers';\nimport { step } from './display';\n\nexport const templateRepository = 'cellajs/cella';\n\n/** The HTTPS git URL of `github:owner/repo` or `owner/repo`: reading a public repository needs no SSH key. */\nexport function githubGitUrl(template: string): string {\n const [owner, repo] = template.replace(/^github:/, '').split('/');\n if (!owner || !repo) throw new Error(`Invalid template '${template}'. Expected 'github:owner/repo'.`);\n return `https://github.com/${owner}/${repo}.git`;\n}\n\n/**\n * A `major.minor.patch` version, with or without the `v` prefix; a pre-release (`1.0.0-rc.1`), `create-cella-0.2.3`\n * and `archive/pre-release` are none.\n */\nconst releaseTagPattern = /^v?\\d+\\.\\d+\\.\\d+$/;\n\n/** The highest release tag by version number, the `v` prefix aside, as `pnpm cella upgrade` picks it, or null. */\nexport function pickLatestReleaseTag(tags: string[]): string | null {\n const version = (tag: string) => tag.replace(/^v/, '');\n const releases = tags.filter((tag) => releaseTagPattern.test(tag));\n return releases.sort((a, b) => version(a).localeCompare(version(b), 'en', { numeric: true })).at(-1) ?? null;\n}\n\n/**\n * The latest template release: its tag from the git tags, over the transport the clone uses, so the GitHub API limit\n * for callers without a token cannot hide it; its date (YYYY-MM-DD) from that API when it answers. Null offline.\n */\nexport async function fetchLatestRelease(): Promise<{ tag: string; date?: string } | null> {\n const refs = await git\n .listServerRefs({ http, url: githubGitUrl(templateRepository), prefix: 'refs/tags/' })\n .catch(() => []);\n const tag = pickLatestReleaseTag(refs.map(({ ref }) => ref.slice('refs/tags/'.length)));\n if (!tag) return null;\n\n const release = await fetchGithub<{ published_at?: string }>(`releases/tags/${tag}`);\n return { tag, date: release?.published_at?.slice(0, 10) };\n}\n\n/** The latest commit on the template's main branch, with its subject and date (YYYY-MM-DD), or null. */\nexport async function fetchLatestCommit(): Promise<{ sha: string; message: string; date: string } | null> {\n const data = await fetchGithub<{ sha?: string; commit?: { message?: string; author?: { date?: string } } }>(\n 'commits/main',\n );\n if (!data?.sha) return null;\n const message = (data.commit?.message ?? '').split('\\n')[0];\n return { sha: data.sha, message, date: data.commit?.author?.date?.slice(0, 10) ?? 'unknown' };\n}\n\n/** A GitHub API answer about the template, or null: callers without a token have a low limit. */\nasync function fetchGithub<T>(path: string): Promise<T | null> {\n try {\n const url = `https://api.github.com/repos/${templateRepository}/${path}`;\n const response = await fetch(url, { headers: { Accept: 'application/vnd.github+json' } });\n return response.ok ? ((await response.json()) as T) : null;\n } catch {\n return null;\n }\n}\n\nconst isLocalPath = (path: string): boolean => path.startsWith('/') || path.startsWith('./') || path.startsWith('../');\n\n/**\n * Put the template's files in `targetFolder`: a shallow clone of a GitHub template, or the tracked files of a local\n * checkout from its working tree, so build output and local `.env` secrets stay behind.\n * @returns The template commit the files come from; null when isomorphic-git cannot resolve a local checkout's `HEAD`,\n * as in a linked worktree.\n */\nexport async function getTemplate({ template, templateRef, targetFolder, name }: Answers): Promise<string | null> {\n if (!template || !isLocalPath(template)) {\n step(`downloading cella template${templateRef ? ` (${templateRef})` : ''}`);\n const url = githubGitUrl(template ?? templateRepository);\n // Isomorphic-git needs no git binary and no shell; the clone's history goes, since the app starts its own\n await git.clone({ fs, http, dir: targetFolder, url, ref: templateRef ?? 'main', singleBranch: true, depth: 1 });\n const baseCommit = await git.resolveRef({ fs, dir: targetFolder, ref: 'HEAD' });\n await rm(join(targetFolder, '.git'), { recursive: true, force: true });\n return baseCommit;\n }\n\n step('copying local template');\n const source = resolve(template);\n const rel = relative(source, targetFolder);\n if (rel === '' || (!rel.startsWith('..') && !isAbsolute(rel))) {\n throw new Error(\n 'Cannot create the app inside the template directory.\\n' +\n ` Run from outside: cd ~ && pnpm create @cellajs/cella ${name} --template ${template}`,\n );\n }\n\n const files = await git.listFiles({ fs, dir: source });\n if (files.length === 0) throw new Error(`${source} is no git checkout: a local template must be one.`);\n for (const file of files) {\n const from = join(source, file);\n // Tracked, but deleted in the working tree\n if (!existsSync(from)) continue;\n const to = join(targetFolder, file);\n await mkdir(dirname(to), { recursive: true });\n await cp(from, to);\n }\n return git.resolveRef({ fs, dir: source, ref: 'HEAD' }).catch(() => null);\n}\n","import { existsSync } from 'node:fs';\nimport { readdir } from 'node:fs/promises';\nimport { basename, resolve } from 'node:path';\nimport { input, select } from '@inquirer/prompts';\nimport pc from './colors';\nimport { appIndexRule, appPorts, detectUsedPorts, findBusyPorts, findNextAppIndex, isAppIndex } from './dev-ports';\nimport { confirmChoice, warn } from './display';\nimport { fetchLatestCommit, fetchLatestRelease, templateRepository } from './template';\n\n/** The template's config refuses any other `slug` at its first load (cella `shared/src/config-builder/app-config.ts`). */\nexport const isAppSlug = (name: string): boolean =>\n /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(name) && name.replaceAll('-', '').length >= 4;\n\n/** The rule `isAppSlug` checks, worded for a refusal. */\nexport const appSlugRule =\n 'the name becomes the app slug: lowercase letters and digits, starting with a letter, single hyphens between parts and at least 4 characters besides hyphens, such as my-app';\n\n/** A plain shape check: the value lands on one line of the app's `.env` and is the seed user's sign-in address. */\nexport const isEmail = (value: string): boolean => /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value);\n\n/** What the command line answered already. */\nexport interface Flags {\n directory?: string;\n /** A local git checkout or `github:owner/repo`. */\n template?: string;\n appIndex?: number;\n adminEmail?: string;\n}\n\nexport interface Answers {\n template?: string;\n /** The release tag or branch to clone; the default branch when absent, and unused for a local template. */\n templateRef?: string;\n targetFolder: string;\n /** The app's slug: the name of its folder. */\n name: string;\n appIndex: number;\n adminEmail: string;\n}\n\n// A prompt clears itself once answered, and `confirmChoice` keeps the answer on screen\nconst theme = { prefix: '', style: { answer: (text: string) => text } };\nconst context = { clearPromptOnDone: true };\n\n/** Ask what the flags leave open, and refuse a folder that is not empty. */\nexport async function askAnswers({ directory, template, ...flags }: Flags): Promise<Answers> {\n // A custom template is taken as it is\n const templateRef = template ? undefined : await askTemplateRef();\n\n const targetFolder = resolve(\n directory ??\n (await input(\n {\n message: 'Enter your app name',\n default: 'my-cella-app',\n theme,\n validate: (name) => (isAppSlug(basename(resolve(name))) ? true : `Invalid app name: ${appSlugRule}`),\n },\n context,\n )),\n );\n if (existsSync(targetFolder) && (await readdir(targetFolder)).length > 0) {\n throw new Error(`${targetFolder} is not empty: choose a new folder, or empty this one first.`);\n }\n\n const appIndex = flags.appIndex ?? (await askAppIndex(targetFolder));\n confirmChoice('App index', formatAppIndex(appIndex));\n const busyPorts = await findBusyPorts(appIndex);\n if (busyPorts.length > 0) {\n warn(`In use on this machine: ${busyPorts.join(', ')}. Stop what holds them before pnpm docker and pnpm dev.`);\n console.info();\n }\n\n // The reserved example.com domain (RFC 2606) can never route real mail\n const adminEmail =\n flags.adminEmail ??\n (await input(\n {\n message: 'Admin email for initial seed user',\n default: 'admin@example.com',\n theme,\n validate: (email) => (isEmail(email) ? true : 'Enter an address such as admin@example.com'),\n },\n context,\n ));\n confirmChoice('Admin email', adminEmail);\n\n return { template, templateRef, targetFolder, name: basename(targetFolder), appIndex, adminEmail };\n}\n\n/**\n * Offer the latest release and the latest commit, each with its date, as the template to start from.\n * @returns The release tag, or `main` for the latest commit; undefined when neither is known (offline).\n */\nasync function askTemplateRef(): Promise<string | undefined> {\n const [release, commit] = await Promise.all([fetchLatestRelease(), fetchLatestCommit()]);\n\n console.info(pc.dim('This create CLI allows you to get started with cella quickly.'));\n console.info();\n if (release)\n console.info(` Latest release: ${release.tag}${release.date ? ` ${pc.dim(`· ${release.date}`)}` : ''}`);\n if (commit) {\n console.info(` Latest commit: ${commit.sha.slice(0, 7)} ${pc.dim(`· ${commit.message} · ${commit.date}`)}`);\n console.info(` ${pc.gray(`https://github.com/${templateRepository}/commit/${commit.sha}`)}`);\n }\n if (release || commit) console.info();\n\n if (!release) {\n warn('Latest release not found · using the latest commit on main');\n console.info();\n return commit ? 'main' : undefined;\n }\n\n // Without a commit to offer or a terminal to choose on (CI, piped stdin), the release is the reproducible start\n const choices = [\n { name: 'Latest release', value: 'release' },\n { name: 'Latest commit', value: 'commit' },\n ];\n if (\n !commit ||\n !process.stdin.isTTY ||\n (await select({ message: 'Choose which cella version to start from:', theme, choices }, context)) === 'release'\n ) {\n confirmChoice('Latest release', release.tag);\n return release.tag;\n }\n // The tip of main: a shallow clone over GitHub's smart HTTP cannot reliably fetch an arbitrary sha\n confirmChoice('Latest commit', commit.sha.slice(0, 7));\n return 'main';\n}\n\n/** An app index with its frontend, backend and database ports, such as \"1 → :3001 / :4010 / :5442\". */\nfunction formatAppIndex(index: number, note = ''): string {\n const { frontend, services, databases } = appPorts(index);\n return `${index} → :${frontend} / :${services[0]} / :${databases[0]}${note}`;\n}\n\n/** Suggest an app index no sibling app and no listener on this machine takes, and ask for one. */\nasync function askAppIndex(targetFolder: string): Promise<number> {\n const siblings = await detectUsedPorts(targetFolder);\n const presets = [1, 2, 3];\n const busy = new Map(await Promise.all([0, ...presets].map(async (i) => [i, await findBusyPorts(i)] as const)));\n const isBusy = (i: number) => (busy.get(i)?.length ?? 0) > 0;\n const suggested = findNextAppIndex(siblings, isBusy);\n const label = (i: number, note = '') => formatAppIndex(i, isBusy(i) ? ` (port ${busy.get(i)?.[0]} in use)` : note);\n\n // The hint sits in the message, so clearPromptOnDone wipes it; a plain message style keeps the title alone bold\n let message = `${pc.bold('App index')} ${pc.dim('· to avoid port conflicts with other apps on this machine')}`;\n if (siblings.length > 0) {\n const count = siblings.length;\n message += pc.dim(`\\nDetected ${count} sibling app${count === 1 ? '' : 's'} · suggested index ${suggested}`);\n }\n\n // 0 is the default and the suggestion comes first, so neither repeats among the presets\n const choice = await select(\n {\n message,\n theme: { ...theme, style: { ...theme.style, message: (text: string) => text } },\n choices: [\n ...(suggested > 0 ? [{ name: formatAppIndex(suggested, ' (suggested)'), value: suggested }] : []),\n { name: label(0, ' (default)'), value: 0 },\n ...presets.filter((i) => i !== suggested).map((i) => ({ name: label(i), value: i })),\n { name: 'Custom index', value: -1 },\n ],\n },\n context,\n );\n if (choice !== -1) return choice;\n\n const custom = await input(\n {\n message: `Enter custom index, ${appIndexRule}`,\n default: String(suggested),\n theme,\n validate: (value) => (isAppIndex(Number(value)) ? true : `Must be ${appIndexRule}`),\n },\n context,\n );\n return Number(custom);\n}\n","import fs from 'node:fs/promises';\nimport { dirname, join, posix, relative } from 'node:path';\nimport type { Answers } from './answers';\nimport { appPorts } from './dev-ports';\nimport { warn } from './display';\n\n/** The version an app starts from, so release-please cuts its first release from a clean slate. */\nconst initialVersion = '0.0.0';\n\n/** Entry points a coding agent reads from the repo root; the rules and skills live in the template's `cella/` folder. */\nconst agentFiles: Record<string, string> = {\n 'AGENTS.md':\n '# Agent guidelines\\n\\nThis app is built from the cella template. Read [cella/AGENTS.md](./cella/AGENTS.md) before changing code: it holds the project rules. Skills, such as `add-entity`, live in [cella/skills](./cella/skills).\\n',\n 'CLAUDE.md': '@cella/AGENTS.md\\n',\n};\n\nconst manifestPath = 'cella/create-cella.json';\nconst editNames = [\n 'quickstart',\n 'configTemplate',\n 'config',\n 'cliConfig',\n 'envExample',\n 'releaseConfig',\n 'releaseManifest',\n] as const;\n\n/** The template paths a new app changes, as the template itself names them in `cella/create-cella.json`. */\ninterface Manifest {\n remove: string[];\n empty: string[];\n /** Template path to the copy's path in the app. */\n copy: Record<string, string>;\n /** Template path to the symlink's path in the app. */\n link: Record<string, string>;\n edit: Record<(typeof editNames)[number], string>;\n}\n\n/** @throws When the template has no manifest, or its manifest names no path for an edit this version makes. */\nasync function readManifest(targetFolder: string): Promise<Manifest> {\n const source = await fs.readFile(join(targetFolder, manifestPath), 'utf8').catch(() => null);\n if (source === null) throw new Error(`This template has no ${manifestPath}: use a newer template.`);\n const manifest: Manifest = JSON.parse(source);\n const unnamed = editNames.filter((name) => typeof manifest.edit?.[name] !== 'string');\n if (unnamed.length > 0) {\n throw new Error(`${manifestPath} names no path for ${unnamed.join(', ')}: use a newer template.`);\n }\n return manifest;\n}\n\n/**\n * Turn the template's files in `targetFolder` into the app's: its name, index and admin email in the config and the\n * `.env`, its own release state, the quickstart as README, and none of the template's own repos, migrations or stack.\n * @returns The template paths it expected and did not find; a template without one skips that edit.\n */\nexport async function writeAppFiles({ targetFolder, name, appIndex, adminEmail }: Answers): Promise<string[]> {\n const missing: string[] = [];\n const at = (path: string) => join(targetFolder, path);\n // A template path that is not there goes into `missing`, and its edit is skipped\n const edit = async (path: string, change: (file: string) => Promise<unknown>) => {\n try {\n await change(at(path));\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error;\n missing.push(path);\n }\n };\n const rewrite = (path: string, change: (source: string) => string) =>\n edit(path, async (file) => fs.writeFile(file, change(await fs.readFile(file, 'utf8')), 'utf8'));\n const displayName = name.replace(/-/g, ' ').replace(/\\b\\w/g, (c) => c.toUpperCase());\n const { remove, empty, copy, link, edit: paths } = await readManifest(targetFolder);\n\n try {\n for (const [from, to] of Object.entries(copy)) await edit(from, (file) => fs.copyFile(file, at(to)));\n await edit(paths.quickstart, async (file) =>\n fs.writeFile(\n at('README.md'),\n quickstartToReadme(await fs.readFile(file, 'utf8'), paths.quickstart, displayName, appIndex),\n 'utf8',\n ),\n );\n await writeAgentEntry(targetFolder, link);\n\n // The placeholder config becomes the app's default config, and goes\n await edit(paths.configTemplate, async (file) => {\n const source = await fs.readFile(file, 'utf8');\n const config = source\n .replaceAll('__project_name__', displayName)\n .replaceAll('__project_slug__', name)\n .replace(/^(\\s*devAppIndex:\\s*)\\d+/m, (_, head: string) => `${head}${appIndex}`);\n await fs.writeFile(at(paths.config), config, 'utf8');\n await fs.rm(file);\n });\n\n // The app's own identity: the template's metadata keys stay, emptied, for the app to fill in\n await rewrite('package.json', (source) => {\n let pkg = source\n .replace(/^(\\s*\"name\":\\s*)\"[^\"]*\"/m, `$1\"${name}\"`)\n .replace(/^(\\s*\"version\":\\s*)\"[^\"]*\"/m, `$1\"${initialVersion}\"`)\n .replace(/^(\\s*\"keywords\":\\s*)\\[[^\\]]*\\]/m, '$1[]');\n for (const field of ['license', 'repository', 'description', 'author', 'homepage']) {\n pkg = pkg.replace(new RegExp(`^(\\\\s*\"${field}\":\\\\s*)\"[^\"]*\"`, 'm'), '$1\"\"');\n }\n return pkg;\n });\n // The template keeps its changelog in `cella/`, which the app keeps as upstream reference\n await rewrite(paths.releaseConfig, (source) => {\n const config = JSON.parse(source) as { packages?: Record<string, Record<string, unknown>> };\n config.packages ??= {};\n config.packages['.'] ??= {};\n config.packages['.']['changelog-path'] = 'CHANGELOG.md';\n return `${JSON.stringify(config, null, 2)}\\n`;\n });\n await edit(paths.releaseManifest, (file) => fs.writeFile(file, `{\\n \".\": \"${initialVersion}\"\\n}\\n`, 'utf8'));\n await fs.writeFile(at('CHANGELOG.md'), '# Changelog\\n', 'utf8');\n\n // `pnpm cella upgrade` never merges this file, so the list goes once here\n await rewrite(paths.cliConfig, stripForks);\n // Every port follows `devAppIndex` in the config, so the admin is the one value the app's `.env` changes\n await edit(paths.envExample, async (file) => {\n const env = (await fs.readFile(file, 'utf8')).replace(/^ADMIN_EMAIL=.*$/gm, () => `ADMIN_EMAIL=${adminEmail}`);\n await fs.writeFile(file.replace(/\\.example$/, ''), env, 'utf8');\n });\n\n // What an app starts without: the template's own migrations, and its stack file with the template's encryption salt\n for (const folder of empty) {\n await edit(folder, async (dir) => {\n const entries = await fs.readdir(dir);\n await Promise.all(entries.map((entry) => fs.rm(join(dir, entry), { recursive: true, force: true })));\n });\n }\n for (const path of remove) await edit(path, (file) => fs.rm(file, { recursive: true }));\n } catch (error) {\n throw new Error(`Error during the cleaning process: ${error instanceof Error ? error.message : error}`);\n }\n return missing;\n}\n\n/**\n * The quickstart as the README of a new app: at the repo root, with this app's port and without the step that just ran.\n * Its relative links resolve from the quickstart's folder in the template (`path`), and are rewritten from the root.\n */\nfunction quickstartToReadme(source: string, path: string, displayName: string, appIndex: number): string {\n const folder = posix.dirname(path);\n return source\n .replace(/^# .*$/m, `# ${displayName}`)\n .replace(/^## Create\\n[\\s\\S]*?(?=^## )/m, '')\n .replace(/\\]\\((\\.\\.?\\/[^)\\s]*)\\)/g, (_, target: string) => `](./${posix.join(folder, target)})`)\n .replaceAll('http://localhost:3000', `http://localhost:${appPorts(appIndex).frontend}`);\n}\n\n/** Point coding agents at the template's rules and skills, which sit in `cella/`, out of a root they would not search. */\nasync function writeAgentEntry(targetFolder: string, link: Manifest['link']): Promise<void> {\n await Promise.all(\n Object.entries(agentFiles).map(([file, content]) => fs.writeFile(join(targetFolder, file), content, 'utf8')),\n );\n\n // Local to this clone: `.claude` is gitignored, and the check scripts read tracked paths as files. AGENTS.md names the folder for a new clone.\n for (const [target, path] of Object.entries(link)) {\n const file = join(targetFolder, path);\n try {\n await fs.mkdir(dirname(file), { recursive: true });\n await fs.symlink(relative(dirname(file), join(targetFolder, target)), file);\n } catch (error) {\n // Windows refuses a symlink without developer mode; the skills stay readable in their own folder\n warn(`skipped ${path}: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n}\n\n/** The source of an upgrade config (`cella/cella.config.ts`) without its `forks` property and a comment line directly above it. */\nexport function stripForks(source: string): string {\n // The closing bracket sits at the property's own indent, or on the same line for a short list\n return source.replace(\n /^(?:[ \\t]*\\/\\/[^\\n]*\\n)?([ \\t]*)forks:\\s*\\[(?:[^\\n]*|[\\s\\S]*?\\n\\1)\\],?[ \\t]*\\n(?:[ \\t]*\\n)?/m,\n '',\n );\n}\n","import fs from 'node:fs';\nimport git from 'isomorphic-git';\nimport { warn } from './display';\nimport { githubGitUrl, templateRepository } from './template';\n\n/**\n * Make the app's repository: one commit of its files, and the template as remote `cella-upstream`, the name\n * `pnpm cella upgrade` looks for. The commit's `Cella-Base:` trailer names the template commit the files come from,\n * which the upgrade reads from the root commit to find its first merge base: the app shares no history with the template.\n * A failure only warns: the app's files stay usable without git.\n */\nexport async function makeRepository(dir: string, baseCommit: string | null): Promise<void> {\n try {\n await git.init({ fs, dir, defaultBranch: 'main' });\n await git.add({ fs, dir, filepath: '.' });\n const message = baseCommit ? `Initial commit\\n\\nCella-Base: ${baseCommit}` : 'Initial commit';\n // An explicit author, so the commit needs no git config on this machine\n await git.commit({ fs, dir, message, author: { name: 'cella', email: 'info@cellajs.com' } });\n await git.addRemote({ fs, dir, remote: 'cella-upstream', url: githubGitUrl(templateRepository), force: true });\n } catch (error) {\n warn(`skipped git init: ${error instanceof Error ? error.message : String(error)}`);\n }\n}\n","#!/usr/bin/env tsx\n\nimport { mkdir, readdir, rm } from 'node:fs/promises';\nimport { basename, join, resolve } from 'node:path';\nimport { Command, InvalidArgumentError } from 'commander';\nimport { appSlugRule, askAnswers, type Flags, isAppSlug, isEmail } from './answers';\nimport { writeAppFiles } from './app-files';\nimport { makeRepository } from './app-repo';\nimport pc from './colors';\nimport { appIndexRule, isAppIndex } from './dev-ports';\nimport { cliName, cliVersion, showBanner, showNextSteps, step, stopSpinner, warn } from './display';\nimport { getTemplate } from './template';\n\nfunction parseFlags(): Flags {\n const program = new Command(cliName)\n .version(cliVersion, '-v, --version', `output the current version of ${cliName}`)\n .argument('[directory]', 'the directory name for the new app')\n .usage('[directory] [options]')\n .helpOption('-h, --help', 'display this help message')\n .option('--template <path>', 'use a custom template (local git checkout or github:user/repo)')\n .option('--app-index <number>', `set this app's number for its dev ports, ${appIndexRule}`, (value) => {\n if (!isAppIndex(Number(value))) throw new InvalidArgumentError(`App index must be ${appIndexRule}`);\n return Number(value);\n })\n .option('--admin-email <email>', 'set the admin email for the initial seed user', (value) => {\n if (!isEmail(value)) throw new InvalidArgumentError('Admin email must be an address such as admin@example.com');\n return value;\n })\n .parse();\n\n const directory = program.args[0]?.trim() || undefined;\n if (directory && !isAppSlug(basename(resolve(directory)))) {\n program.error(`error: invalid app name \"${directory}\": ${appSlugRule}.`);\n }\n return { directory, ...program.opts<Omit<Flags, 'directory'>>() };\n}\n\nasync function main(): Promise<void> {\n const flags = parseFlags();\n showBanner();\n const answers = await askAnswers(flags);\n const { targetFolder } = answers;\n\n // Until the app is made, a failure or a signal removes what the run wrote\n let undo = async () => {};\n const onSignal = (code: number) => () => {\n stopSpinner();\n void undo().finally(() => process.exit(code));\n };\n const onSigint = onSignal(130);\n const onSigterm = onSignal(143);\n process.once('SIGINT', onSigint).once('SIGTERM', onSigterm);\n\n let missing: string[];\n try {\n step('creating app folder');\n const createdFolder = await mkdir(targetFolder, { recursive: true });\n undo = () => removeOutput(targetFolder, createdFolder);\n const baseCommit = await getTemplate(answers);\n step('cleaning template');\n missing = await writeAppFiles(answers);\n step('initializing git');\n await makeRepository(targetFolder, baseCommit);\n step();\n } catch (error) {\n stopSpinner();\n await undo();\n throw error;\n } finally {\n process.off('SIGINT', onSigint).off('SIGTERM', onSigterm);\n }\n\n if (missing.length > 0) warn(`Not in the template, skipped: ${missing.join(', ')}`);\n showNextSteps(answers);\n}\n\n/** Remove what a run wrote: the folders `mkdir` made, else everything in the target, which the run only accepts empty. */\nasync function removeOutput(targetFolder: string, createdFolder: string | undefined): Promise<void> {\n if (createdFolder) return rm(createdFolder, { recursive: true, force: true });\n const entries = await readdir(targetFolder);\n await Promise.all(entries.map((entry) => rm(join(targetFolder, entry), { recursive: true, force: true })));\n}\n\nmain().catch((error) => {\n // Ctrl-c at a prompt. Its class lives in @inquirer/core, which is no direct dependency: match the name.\n if (error instanceof Error && error.name === 'ExitPromptError') process.exit(130);\n console.error(`${pc.red('✗')} ${pc.red(error instanceof Error ? error.message : String(error))}`);\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;;;AAIA,SAAS,gBAAyB;CAEhC,MAAM,EAAE,UAAU,gBAAgB,QAAQ;CAC1C,IAAI,aAAa,KAAA,GAAW,OAAO;CACnC,IAAI,gBAAgB,KAAA,GAAW,OAAO,gBAAgB,OAAO,gBAAgB;CAC7E,OAAO,CAAC,CAAC,QAAQ,OAAO;AAC1B;AAEA,SAAS,WAAW,OAAmB,MAAsB;CAC3D,IAAI,CAAC,cAAc,GAAG,OAAO;CAC7B,OAAO,UAAU,OAAO,MAAM,EAAE,gBAAgB,MAAM,CAAC;AACzD;AAEA,MAAM,KAAK;CACT,OAAO,SAAiB,WAAW,QAAQ,IAAI;CAC/C,OAAO,SAAiB,WAAW,QAAQ,IAAI;CAC/C,MAAM,SAAiB,WAAW,OAAO,IAAI;CAC7C,OAAO,SAAiB,WAAW,QAAQ,IAAI;CAC/C,QAAQ,SAAiB,WAAW,SAAS,IAAI;CACjD,MAAM,SAAiB,WAAW,OAAO,IAAI;CAC7C,SAAS,SAAiB,WAAW,UAAU,IAAI;AACrD;;;;;;ACjBA,MAAa,YAAY,WAAmB;CAC1C,UAAU,MAAO;CACjB,eAAe,OAAO;CACtB,UAAU,MAAM,KAAK,EAAE,QAAQ,EAAE,IAAI,GAAG,MAAM,MAAO,QAAQ,KAAK,CAAC;CACnE,WAAW,CAAC,OAAO,QAAQ,IAAI,OAAO,QAAQ,EAAE;AAClD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cAAc,UAAU;EAC7C,KAAK;CACP,SAAS,OAAO;EACd,YAAY;EACZ,MAAM,KAAK;EACX,MAAM;CACR,UAAU;EACR,QAAQ,IAAI,UAAU,QAAQ,CAAC,CAAC,IAAI,WAAW,SAAS;CAC1D;CAEA,IAAI,QAAQ,SAAS,GAAG,KAAK,iCAAiC,QAAQ,KAAK,IAAI,GAAG;CAClF,cAAc,OAAO;AACvB;;AAGA,eAAe,aAAa,cAAsB,eAAkD;CAClG,IAAI,eAAe,OAAO,GAAG,eAAe;EAAE,WAAW;EAAM,OAAO;CAAK,CAAC;CAC5E,MAAM,UAAU,MAAM,QAAQ,YAAY;CAC1C,MAAM,QAAQ,IAAI,QAAQ,KAAK,UAAU,GAAG,KAAK,cAAc,KAAK,GAAG;EAAE,WAAW;EAAM,OAAO;CAAK,CAAC,CAAC,CAAC;AAC3G;AAEA,KAAK,CAAC,CAAC,OAAO,UAAU;CAEtB,IAAI,iBAAiB,SAAS,MAAM,SAAS,mBAAmB,QAAQ,KAAK,GAAG;CAChF,QAAQ,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,GAAG,GAAG,IAAI,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,GAAG;CAChG,QAAQ,KAAK,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cellajs/create-cella",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "description": "Cella is a TypeScript template to create web apps with sync and offline capabilities.",
@@ -26,22 +26,22 @@
26
26
  "create-cella": "index.js"
27
27
  },
28
28
  "dependencies": {
29
- "@inquirer/prompts": "^8.8.0",
29
+ "@inquirer/prompts": "^8.8.1",
30
30
  "commander": "^15.1.0",
31
- "isomorphic-git": "^1.44.13"
31
+ "isomorphic-git": "^1.44.19"
32
32
  },
33
33
  "devDependencies": {
34
- "@biomejs/biome": "^2.6.7",
34
+ "@biomejs/biome": "^2.6.9",
35
35
  "@commitlint/cli": "^21.2.4",
36
36
  "@commitlint/config-conventional": "^21.2.4",
37
- "@evilmartians/lefthook": "^2.2.2",
37
+ "@evilmartians/lefthook": "^2.2.4",
38
38
  "@types/node": "26.6.6",
39
39
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
40
40
  "rimraf": "^6.1.4",
41
41
  "tsdown": "^0.23.7",
42
42
  "tsx": "^4.23.15",
43
43
  "typescript": "6.0.3",
44
- "vitest": "^5.1.0"
44
+ "vitest": "^5.1.2"
45
45
  },
46
46
  "commitlint": {
47
47
  "extends": [