@rm-industries/create-forge 0.3.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +61 -0
  3. package/dist/index.mjs +511 -0
  4. package/dist/index.mjs.map +1 -0
  5. package/dist/template/.editorconfig +10 -0
  6. package/dist/template/.markdownlint.json +10 -0
  7. package/dist/template/README.md +169 -0
  8. package/dist/template/astro.config.ts +15 -0
  9. package/dist/template/cspell.config.ts +6 -0
  10. package/dist/template/oxfmt.config.ts +9 -0
  11. package/dist/template/package-lock.json +10896 -0
  12. package/dist/template/package.json +61 -0
  13. package/dist/template/playwright.config.ts +24 -0
  14. package/dist/template/public/favicon.svg +4 -0
  15. package/dist/template/public/social-card.svg +8 -0
  16. package/dist/template/src/components/navigation/Footer.astro +33 -0
  17. package/dist/template/src/components/navigation/Header.astro +11 -0
  18. package/dist/template/src/components/navigation/Navbar.astro +60 -0
  19. package/dist/template/src/components/navigation/Pagination.astro +37 -0
  20. package/dist/template/src/components/seo/SeoHead.astro +48 -0
  21. package/dist/template/src/components/theme/ThemeHead.astro +6 -0
  22. package/dist/template/src/components/ui/Card.astro +26 -0
  23. package/dist/template/src/components/ui/Container.astro +17 -0
  24. package/dist/template/src/config/content-models/articles.ts +39 -0
  25. package/dist/template/src/config/content-models/registry.ts +5 -0
  26. package/dist/template/src/config/site.test.ts +37 -0
  27. package/dist/template/src/config/site.ts +95 -0
  28. package/dist/template/src/content/articles/accessible-by-default.md +22 -0
  29. package/dist/template/src/content/articles/content-that-travels-well.md +17 -0
  30. package/dist/template/src/content/articles/designing-a-calm-starting-point.md +22 -0
  31. package/dist/template/src/content/articles/future-draft.md +11 -0
  32. package/dist/template/src/content.config.ts +5 -0
  33. package/dist/template/src/integrations/sveltia/config.test.ts +35 -0
  34. package/dist/template/src/integrations/sveltia/config.ts +28 -0
  35. package/dist/template/src/integrations/sveltia/preview-collections.test.ts +8 -0
  36. package/dist/template/src/integrations/sveltia/preview-collections.ts +3 -0
  37. package/dist/template/src/integrations/sveltia/previews.ts +13 -0
  38. package/dist/template/src/layouts/BaseLayout.astro +41 -0
  39. package/dist/template/src/lib/articles.ts +20 -0
  40. package/dist/template/src/lib/navigation.test.ts +20 -0
  41. package/dist/template/src/lib/navigation.ts +22 -0
  42. package/dist/template/src/pages/404.astro +17 -0
  43. package/dist/template/src/pages/about.astro +22 -0
  44. package/dist/template/src/pages/admin/index.astro +24 -0
  45. package/dist/template/src/pages/articles/[slug].astro +58 -0
  46. package/dist/template/src/pages/articles/index.astro +34 -0
  47. package/dist/template/src/pages/index.astro +64 -0
  48. package/dist/template/src/pages/robots.txt.ts +8 -0
  49. package/dist/template/src/pages/rss.xml.ts +17 -0
  50. package/dist/template/src/pages/site.webmanifest.ts +19 -0
  51. package/dist/template/src/styles/global.css +73 -0
  52. package/dist/template/src/styles/print.css +34 -0
  53. package/dist/template/src/themes/catppuccinTheme.frappe.ts +5 -0
  54. package/dist/template/src/themes/catppuccinTheme.latte.ts +5 -0
  55. package/dist/template/src/themes/catppuccinTheme.macchiato.ts +5 -0
  56. package/dist/template/src/themes/catppuccinTheme.mocha.ts +5 -0
  57. package/dist/template/src/themes/site-theme.test.ts +19 -0
  58. package/dist/template/src/themes/site-theme.ts +13 -0
  59. package/dist/template/stylelint.config.ts +19 -0
  60. package/dist/template/tests/accessibility.spec.ts +47 -0
  61. package/dist/template/tests/routes.spec.ts +87 -0
  62. package/dist/template/tests/theme.spec.ts +47 -0
  63. package/dist/template/tsconfig.json +5 -0
  64. package/dist/template/vitest.config.ts +8 -0
  65. package/package.json +52 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/prompts.ts","../src/options.ts","../src/validation.ts","../src/resolve-options.ts","../src/cli.ts","../src/template-tokens.ts","../src/materialize.ts","../src/process.ts","../src/reporter.ts","../src/index.ts"],"sourcesContent":["import { confirm, isCancel, text } from '@clack/prompts';\n\nexport type TextPrompt = {\n message: string;\n initialValue?: string;\n placeholder?: string;\n validate?: (value: string | undefined) => string | Error | undefined;\n};\n\nexport type ConfirmPrompt = { message: string; initialValue: boolean };\n\nexport type PromptAdapter = {\n text(options: TextPrompt): Promise<string | symbol>;\n confirm(options: ConfirmPrompt): Promise<boolean | symbol>;\n isCancel(value: unknown): boolean;\n};\n\nexport const clackPrompts: PromptAdapter = {\n text: (options) =>\n text({\n message: options.message,\n ...(options.initialValue === undefined ? {} : { initialValue: options.initialValue }),\n ...(options.placeholder === undefined ? {} : { placeholder: options.placeholder }),\n ...(options.validate === undefined ? {} : { validate: options.validate }),\n }),\n confirm,\n isCancel,\n};\n","export type GeneratorOptions = {\n destination: string;\n packageName: string;\n siteName: string;\n description: string;\n author: string;\n url: string;\n repository: string;\n install: boolean;\n git: boolean;\n};\n\nexport type ProvidedOptions = {\n [Key in keyof GeneratorOptions]?: GeneratorOptions[Key] | undefined;\n} & { yes: boolean };\n\nexport const defaultDescription = 'A content-driven website built with Forge';\nexport const defaultUrl = 'https://example.com';\n\nexport const derivePackageName = (destination: string) => {\n return basename(resolve(destination)) || 'forge-site';\n};\n\nexport const humanizePackageName = (packageName: string) => {\n const unscopedName = packageName.split('/').at(-1) ?? packageName;\n return unscopedName\n .split(/[-_\\s]+/u)\n .filter(Boolean)\n .map((word) => `${word.charAt(0).toUpperCase()}${word.slice(1)}`)\n .join(' ');\n};\nimport { basename, resolve } from 'node:path';\n","import validateNpmPackageName from 'validate-npm-package-name';\n\nexport class InputError extends Error {}\n\nconst invalid = (option: string, value: string, reason: string): never => {\n throw new InputError(`Invalid ${option} value ${JSON.stringify(value)}: ${reason}`);\n};\n\nexport const validateDestination = (value: string) => {\n const destination = value.trim();\n if (!destination) invalid('destination', value, 'provide a non-empty path');\n if (destination.includes('\\0')) invalid('destination', value, 'paths cannot contain null bytes');\n return destination;\n};\n\nexport const validatePackageName = (value: string) => {\n const packageName = value.trim();\n const result = validateNpmPackageName(packageName);\n if (!result.validForNewPackages) {\n const reason = [...(result.errors ?? []), ...(result.warnings ?? [])].join('; ');\n invalid('--name', value, reason || 'provide a valid npm package name');\n }\n return packageName;\n};\n\nexport const validatePlainText = (option: string, value: string, required = false) => {\n const text = value.trim();\n if (required && !text) invalid(option, value, 'provide non-empty text');\n if (/\\p{Cc}/u.test(text)) invalid(option, value, 'control characters are not allowed');\n return text;\n};\n\nexport const validateUrl = (value: string) => {\n let url: URL;\n try {\n url = new URL(value);\n } catch {\n return invalid('--url', value, 'provide an absolute HTTP(S) URL');\n }\n if (!['http:', 'https:'].includes(url.protocol)) {\n invalid('--url', value, 'provide an absolute HTTP(S) URL');\n }\n return url.toString();\n};\n\nexport const validateRepository = (value: string) => {\n const repository = value.trim();\n if (!repository) return repository;\n if (!/^[\\w.-]+\\/[\\w.-]+$/u.test(repository)) {\n invalid('--repository', value, 'use the GitHub owner/repository format or leave it empty');\n }\n return repository;\n};\n","import {\n defaultDescription,\n defaultUrl,\n derivePackageName,\n humanizePackageName,\n type GeneratorOptions,\n type ProvidedOptions,\n} from './options';\nimport type { PromptAdapter, TextPrompt } from './prompts';\nimport {\n InputError,\n validateDestination,\n validatePackageName,\n validatePlainText,\n validateRepository,\n validateUrl,\n} from './validation';\n\nexport class CancellationError extends Error {}\n\ntype ResolutionContext = { interactive: boolean; prompts: PromptAdapter };\n\nconst textValidation = (validator: (value: string) => string) => (value: string | undefined) => {\n try {\n validator(value ?? '');\n return undefined;\n } catch (error) {\n return error instanceof Error ? error.message : 'Invalid value';\n }\n};\n\nconst promptText = async (prompts: PromptAdapter, options: TextPrompt) => {\n const value = await prompts.text(options);\n if (prompts.isCancel(value)) throw new CancellationError('Project creation cancelled.');\n return String(value);\n};\n\nconst promptConfirm = async (prompts: PromptAdapter, message: string) => {\n const value = await prompts.confirm({ message, initialValue: true });\n if (prompts.isCancel(value)) throw new CancellationError('Project creation cancelled.');\n return Boolean(value);\n};\n\nconst hasEveryExplicitValue = (options: ProvidedOptions) =>\n options.destination !== undefined &&\n options.packageName !== undefined &&\n options.siteName !== undefined &&\n options.description !== undefined &&\n options.author !== undefined &&\n options.url !== undefined &&\n options.repository !== undefined &&\n options.install !== undefined &&\n options.git !== undefined;\n\nexport const resolveOptions = async (\n provided: ProvidedOptions,\n { interactive, prompts }: ResolutionContext,\n): Promise<GeneratorOptions> => {\n const useDefaults = provided.yes;\n if (!interactive && !useDefaults && !hasEveryExplicitValue(provided)) {\n throw new InputError(\n 'Non-interactive use requires --yes or explicit values for every generator option. Run create-forge --help for details.',\n );\n }\n\n const destination = validateDestination(\n provided.destination ??\n (useDefaults\n ? '.'\n : await promptText(prompts, {\n message: 'Where should we create your project?',\n placeholder: '.',\n initialValue: '.',\n validate: textValidation(validateDestination),\n })),\n );\n const derivedPackageName = derivePackageName(destination);\n const packageName = validatePackageName(\n provided.packageName ??\n (useDefaults\n ? derivedPackageName\n : await promptText(prompts, {\n message: 'What should the npm package be named?',\n initialValue: derivedPackageName,\n validate: textValidation(validatePackageName),\n })),\n );\n const defaultSiteName = humanizePackageName(packageName);\n const siteName = validatePlainText(\n '--site-name',\n provided.siteName ??\n (useDefaults\n ? defaultSiteName\n : await promptText(prompts, {\n message: 'What should the site be called?',\n initialValue: defaultSiteName,\n validate: textValidation((value) => validatePlainText('--site-name', value, true)),\n })),\n true,\n );\n const description = validatePlainText(\n '--description',\n provided.description ??\n (useDefaults\n ? defaultDescription\n : await promptText(prompts, {\n message: 'How would you describe the site?',\n initialValue: defaultDescription,\n validate: textValidation((value) => validatePlainText('--description', value)),\n })),\n );\n const author = validatePlainText(\n '--author',\n provided.author ??\n (useDefaults\n ? ''\n : await promptText(prompts, {\n message: 'Who is the site author?',\n placeholder: 'Optional',\n validate: textValidation((value) => validatePlainText('--author', value)),\n })),\n );\n const url = validateUrl(\n provided.url ??\n (useDefaults\n ? defaultUrl\n : await promptText(prompts, {\n message: 'What is the canonical site URL?',\n initialValue: defaultUrl,\n validate: textValidation(validateUrl),\n })),\n );\n const repository = validateRepository(\n provided.repository ??\n (useDefaults\n ? ''\n : await promptText(prompts, {\n message: 'What is the GitHub repository?',\n placeholder: 'owner/repository (optional)',\n validate: textValidation(validateRepository),\n })),\n );\n const install = provided.install ?? (useDefaults ? true : await promptConfirm(prompts, 'Install dependencies?'));\n const git = provided.git ?? (useDefaults ? true : await promptConfirm(prompts, 'Initialize a Git repository?'));\n\n return { destination, packageName, siteName, description, author, url, repository, install, git };\n};\n","import { Command, CommanderError, Option } from 'commander';\n\nimport type { GeneratorOptions, ProvidedOptions } from './options';\nimport { clackPrompts, type PromptAdapter } from './prompts';\nimport { CancellationError, resolveOptions } from './resolve-options';\n\nexport type CliResult = { output: string; exitCode: number; options?: GeneratorOptions };\nexport type CliContext = { interactive?: boolean; prompts?: PromptAdapter };\n\nconst hasBoth = (args: readonly string[], positive: string, negative: string) =>\n args.includes(positive) && args.includes(negative);\n\nconst parseArguments = (args: readonly string[], version: string) => {\n let output = '';\n const program = new Command()\n .name('create-forge')\n .description('Create a content-driven Forge website')\n .argument('[destination]', 'directory where the project will be created')\n .option('--name <name>', 'npm package name (defaults to the directory basename)')\n .option('--site-name <name>', 'site name')\n .option('--description <text>', 'site description')\n .option('--author <name>', 'site author')\n .option('--url <url>', 'absolute canonical HTTP(S) URL')\n .option('--repository <owner/repository>', 'GitHub repository or an empty value')\n .addOption(new Option('--install', 'install dependencies'))\n .addOption(new Option('--no-install', 'do not install dependencies'))\n .addOption(new Option('--git', 'initialize a Git repository'))\n .addOption(new Option('--no-git', 'do not initialize a Git repository'))\n .option('-y, --yes', 'use documented defaults without prompting', false)\n .version(version, '-v, --version', 'show the installed package version')\n .helpOption('-h, --help', 'show this help message')\n .showHelpAfterError()\n .allowExcessArguments(false)\n .exitOverride()\n .configureOutput({\n writeOut: (value) => {\n output += value;\n },\n writeErr: (value) => {\n output += value;\n },\n });\n\n try {\n program.parse(args, { from: 'user' });\n } catch (error) {\n if (error instanceof CommanderError) return { output, exitCode: error.exitCode } as const;\n throw error;\n }\n\n if (hasBoth(args, '--install', '--no-install')) {\n return { output: 'error: --install cannot be used with --no-install\\n', exitCode: 1 } as const;\n }\n if (hasBoth(args, '--git', '--no-git')) {\n return { output: 'error: --git cannot be used with --no-git\\n', exitCode: 1 } as const;\n }\n\n const raw = program.opts();\n const provided: ProvidedOptions = {\n destination: program.args[0],\n packageName: raw.name,\n siteName: raw.siteName,\n description: raw.description,\n author: raw.author,\n url: raw.url,\n repository: raw.repository,\n install: raw.install,\n git: raw.git,\n yes: raw.yes,\n };\n return { provided } as const;\n};\n\nexport const runCli = async (\n args: readonly string[],\n version: string,\n context: CliContext = {},\n): Promise<CliResult> => {\n const parsed = parseArguments(args, version);\n if (!('provided' in parsed)) return parsed;\n\n try {\n const options = await resolveOptions(parsed.provided, {\n interactive: context.interactive ?? Boolean(process.stdin.isTTY && process.stdout.isTTY),\n prompts: context.prompts ?? clackPrompts,\n });\n return { output: '', exitCode: 0, options };\n } catch (error) {\n if (error instanceof CancellationError) return { output: `${error.message}\\n`, exitCode: 1 };\n if (error instanceof Error) return { output: `error: ${error.message}\\n`, exitCode: 1 };\n throw error;\n }\n};\n","const prefix = '__RM_INDUSTRIES_FORGE_TEMPLATE_V1_';\n\nexport const templateTokens = Object.freeze({\n packageName: `${prefix}PACKAGE_NAME__`,\n siteName: `${prefix}SITE_NAME__`,\n description: `${prefix}DESCRIPTION__`,\n author: `${prefix}AUTHOR__`,\n url: `${prefix}URL__`,\n repository: `${prefix}REPOSITORY__`,\n});\n\nexport const templateTokenPrefix = prefix;\n","import {\n chmod,\n copyFile,\n lstat,\n mkdir,\n mkdtemp,\n readdir,\n readFile,\n rm,\n rmdir,\n stat,\n writeFile,\n} from 'node:fs/promises';\nimport { tmpdir } from 'node:os';\nimport { dirname, isAbsolute, join, parse, relative, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport type { GeneratorOptions } from './options';\nimport { templateTokenPrefix, templateTokens } from './template-tokens';\n\nexport class MaterializationError extends Error {}\n\ntype MaterializationContext = {\n templateDirectory: string | URL;\n cwd?: string;\n signal?: AbortSignal;\n confirmOverwrite?: (destination: string) => Promise<boolean>;\n onFileCopied?: (path: string) => void;\n};\n\ntype TemplateFile = { source: string; relativePath: string; mode: number };\n\nconst pathExists = async (path: string) => {\n try {\n await lstat(path);\n return true;\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return false;\n throw error;\n }\n};\n\nconst getPathStat = async (path: string) => {\n try {\n return await lstat(path);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return undefined;\n throw error;\n }\n};\n\nconst assertNotAborted = (signal?: AbortSignal) => {\n if (signal?.aborted) throw new Error('Project creation was interrupted.');\n};\n\nconst resolveTemplateDirectory = (directory: string | URL) =>\n directory instanceof URL ? fileURLToPath(directory) : resolve(directory);\n\nconst resolveDestination = (destination: string, cwd: string) => {\n const segments = destination.split(/[\\\\/]/u);\n if (segments.includes('..')) {\n throw new MaterializationError(\n `Unsafe destination ${JSON.stringify(destination)}: parent traversal is not allowed.`,\n );\n }\n const resolved = isAbsolute(destination) ? resolve(destination) : resolve(cwd, destination);\n if (resolved === parse(resolved).root) {\n throw new MaterializationError(\n `Unsafe destination ${JSON.stringify(destination)}: a filesystem root is not allowed.`,\n );\n }\n return resolved;\n};\n\nconst listTemplateFiles = async (root: string, directory = root): Promise<TemplateFile[]> => {\n const entries = await readdir(directory, { withFileTypes: true });\n const files: TemplateFile[] = [];\n for (const entry of entries) {\n const source = join(directory, entry.name);\n if (entry.isDirectory()) {\n files.push(...(await listTemplateFiles(root, source)));\n continue;\n }\n if (!entry.isFile()) throw new MaterializationError(`Template entry ${source} is not a regular file.`);\n files.push({ source, relativePath: relative(root, source), mode: (await stat(source)).mode });\n }\n return files.sort((left, right) => left.relativePath.localeCompare(right.relativePath));\n};\n\nconst isDirectoryEmpty = async (directory: string) => (await readdir(directory)).length === 0;\n\nconst ensureDirectory = async (directory: string, created: Set<string>) => {\n const existing = await getPathStat(directory);\n if (existing) {\n if (existing.isSymbolicLink() || !existing.isDirectory()) {\n throw new Error(`Unsafe destination entry ${directory}: expected a regular directory.`);\n }\n return;\n }\n const parent = dirname(directory);\n if (parent !== directory) await ensureDirectory(parent, created);\n await mkdir(directory);\n created.add(directory);\n};\n\nconst replaceToken = (source: string, token: string, value: string, field: string) => {\n const quotedToken = `'${token}'`;\n if (!source.includes(quotedToken)) throw new Error(`Packaged template is missing the ${field} token.`);\n return source.replaceAll(quotedToken, JSON.stringify(value));\n};\n\nconst customizeTemplate = async (destination: string, options: GeneratorOptions) => {\n const packagePath = join(destination, 'package.json');\n const packageLockPath = join(destination, 'package-lock.json');\n const packageMetadata = JSON.parse(await readFile(packagePath, 'utf8')) as Record<string, unknown>;\n const packageLock = JSON.parse(await readFile(packageLockPath, 'utf8')) as {\n name?: string;\n packages?: Record<string, Record<string, unknown>>;\n };\n if (\n packageMetadata.name !== templateTokens.packageName ||\n packageLock.name !== templateTokens.packageName ||\n packageLock.packages?.['']?.name !== templateTokens.packageName\n ) {\n throw new Error('Packaged template contains unexpected package metadata tokens.');\n }\n packageMetadata.name = options.packageName;\n packageMetadata.version = '0.0.0';\n packageMetadata.private = true;\n packageLock.name = options.packageName;\n if (!packageLock.packages?.['']) throw new Error('Packaged template lockfile is missing its root package metadata.');\n packageLock.packages[''].name = options.packageName;\n packageLock.packages[''].version = '0.0.0';\n await writeFile(packagePath, `${JSON.stringify(packageMetadata, undefined, 2)}\\n`);\n await writeFile(packageLockPath, `${JSON.stringify(packageLock, undefined, 2)}\\n`);\n\n const siteConfigPath = join(destination, 'src', 'config', 'site.ts');\n let siteConfig = await readFile(siteConfigPath, 'utf8');\n siteConfig = replaceToken(siteConfig, templateTokens.siteName, options.siteName, 'site name');\n siteConfig = replaceToken(siteConfig, templateTokens.description, options.description, 'description');\n siteConfig = replaceToken(siteConfig, templateTokens.author, options.author, 'author');\n siteConfig = replaceToken(siteConfig, templateTokens.url, options.url, 'URL');\n siteConfig = replaceToken(siteConfig, templateTokens.repository, options.repository, 'repository');\n if (siteConfig.includes(templateTokenPrefix)) throw new Error('Packaged template contains unresolved tokens.');\n await writeFile(siteConfigPath, siteConfig);\n};\n\nexport const materializeProject = async (options: GeneratorOptions, context: MaterializationContext) => {\n const cwd = context.cwd ?? process.cwd();\n const destination = resolveDestination(options.destination, cwd);\n const templateDirectory = resolveTemplateDirectory(context.templateDirectory);\n const destinationExisted = await pathExists(destination);\n if (destinationExisted) {\n const destinationStat = await lstat(destination);\n if (destinationStat.isSymbolicLink() || !destinationStat.isDirectory()) {\n throw new MaterializationError(`Unsafe destination ${destination}: expected a regular directory.`);\n }\n }\n if (destinationExisted && !(await isDirectoryEmpty(destination))) {\n const confirmed = await context.confirmOverwrite?.(destination);\n if (!confirmed) {\n throw new MaterializationError(`Destination ${destination} is not empty. No files were changed.`);\n }\n }\n\n const files = await listTemplateFiles(templateDirectory);\n const backupDirectory = await mkdtemp(join(tmpdir(), 'create-forge-backup-'));\n const createdFiles = new Set<string>();\n const createdDirectories = new Set<string>();\n const backups = new Map<string, string>();\n\n try {\n assertNotAborted(context.signal);\n await ensureDirectory(destination, createdDirectories);\n for (const file of files) {\n assertNotAborted(context.signal);\n const target = join(destination, file.relativePath);\n const targetRelative = relative(destination, target);\n if (targetRelative.startsWith('..') || isAbsolute(targetRelative))\n throw new Error(`Unsafe template path ${file.relativePath}.`);\n await ensureDirectory(dirname(target), createdDirectories);\n const targetStat = await getPathStat(target);\n if (targetStat) {\n if (targetStat.isSymbolicLink() || !targetStat.isFile()) {\n throw new Error(`Unsafe destination entry ${target}: expected a regular file.`);\n }\n const backup = join(backupDirectory, file.relativePath);\n await mkdir(dirname(backup), { recursive: true });\n await copyFile(target, backup);\n backups.set(target, backup);\n } else {\n createdFiles.add(target);\n }\n await copyFile(file.source, target);\n await chmod(target, file.mode);\n context.onFileCopied?.(target);\n }\n assertNotAborted(context.signal);\n await customizeTemplate(destination, options);\n const tokenBytes = Buffer.from(templateTokenPrefix);\n for (const file of files) {\n assertNotAborted(context.signal);\n if ((await readFile(join(destination, file.relativePath))).includes(tokenBytes)) {\n throw new Error(`Generated file ${file.relativePath} contains an unresolved template token.`);\n }\n }\n return { destination, filesCopied: files.length };\n } catch (error) {\n const cleanupErrors: unknown[] = [];\n for (const [target, backup] of backups) {\n try {\n await copyFile(backup, target);\n } catch (cleanupError) {\n cleanupErrors.push(cleanupError);\n }\n }\n for (const file of createdFiles) {\n try {\n await rm(file, { force: true });\n } catch (cleanupError) {\n cleanupErrors.push(cleanupError);\n }\n }\n for (const directory of [...createdDirectories].sort((left, right) => right.length - left.length)) {\n try {\n await rmdir(directory);\n } catch (cleanupError) {\n if (!['ENOENT', 'ENOTEMPTY'].includes((cleanupError as NodeJS.ErrnoException).code ?? '')) {\n cleanupErrors.push(cleanupError);\n }\n }\n }\n const reason = error instanceof Error ? error.message : String(error);\n const recovery = cleanupErrors.length\n ? `Recovery: review ${destination}; some changes could not be rolled back automatically.`\n : `Recovery: changes from this invocation were rolled back; resolve the error and retry.`;\n throw new MaterializationError(`${reason} ${recovery}`, { cause: error });\n } finally {\n await rm(backupDirectory, { recursive: true, force: true });\n }\n};\n","import { spawn } from 'node:child_process';\n\nimport type { GeneratorOptions } from './options';\n\nexport class ProcessStepError extends Error {\n readonly exitCode: number;\n\n constructor(message: string, exitCode = 1, options?: ErrorOptions) {\n super(message, options);\n this.exitCode = exitCode;\n }\n}\n\nexport type Command = {\n executable: string;\n arguments: readonly string[];\n cwd: string;\n signal?: AbortSignal;\n environment?: NodeJS.ProcessEnv;\n};\n\nexport type CommandExecutor = (command: Command) => Promise<void>;\n\nconst signalExitCode = (signal: NodeJS.Signals | null) => {\n if (signal === 'SIGINT') return 130;\n if (signal === 'SIGTERM') return 143;\n return 1;\n};\n\nexport const executeCommand: CommandExecutor = ({ executable, arguments: args, cwd, signal, environment }) =>\n new Promise((resolve, reject) => {\n const child = spawn(executable, args, {\n cwd,\n stdio: 'inherit',\n ...(signal ? { signal } : {}),\n ...(environment ? { env: environment } : {}),\n });\n\n child.once('error', (error) => {\n const interrupted = signal?.aborted;\n reject(\n new ProcessStepError(\n interrupted\n ? `${executable} was interrupted. The generated project remains at ${cwd}.`\n : `Could not start ${executable}: ${error.message}. The generated project remains at ${cwd}.`,\n interrupted ? 130 : 1,\n { cause: error },\n ),\n );\n });\n child.once('close', (code, processSignal) => {\n if (code === 0) {\n resolve();\n return;\n }\n const detail = processSignal ? `signal ${processSignal}` : `exit code ${code ?? 'unknown'}`;\n reject(\n new ProcessStepError(\n `${executable} failed with ${detail}. The generated project remains at ${cwd}; review the output above and retry the command there.`,\n processSignal ? signalExitCode(processSignal) : (code ?? 1),\n ),\n );\n });\n });\n\ntype ProjectSetupContext = {\n destination: string;\n signal?: AbortSignal;\n execute?: CommandExecutor;\n environment?: NodeJS.ProcessEnv;\n};\n\nexport const runProjectSetup = async (options: GeneratorOptions, context: ProjectSetupContext) => {\n const execute = context.execute ?? executeCommand;\n const command = (executable: string, args: readonly string[]) =>\n execute({\n executable,\n arguments: args,\n cwd: context.destination,\n ...(context.signal ? { signal: context.signal } : {}),\n ...(context.environment ? { environment: context.environment } : {}),\n });\n\n if (options.install) await command('npm', ['install']);\n if (options.git) await command('git', ['init', '--initial-branch=main']);\n};\n","import { isAbsolute, relative } from 'node:path';\n\nimport type { GeneratorOptions } from './options';\n\ntype CompletionContext = {\n destination: string;\n cwd?: string;\n color?: boolean;\n};\n\nconst ansi = {\n bold: (value: string) => `\\u001B[1m${value}\\u001B[22m`,\n green: (value: string) => `\\u001B[32m${value}\\u001B[39m`,\n};\n\nconst commandPath = (path: string) => {\n if (/^[\\w./@-]+$/u.test(path)) return path;\n return `\"${path.replaceAll('\"', '\\\\\"')}\"`;\n};\n\nconst displayDestination = (destination: string, cwd: string) => {\n const path = relative(cwd, destination);\n if (!path) return '.';\n return isAbsolute(path) ? destination : path;\n};\n\nexport const supportsColor = (environment: NodeJS.ProcessEnv = process.env, terminal = Boolean(process.stdout.isTTY)) =>\n terminal && environment.NO_COLOR === undefined;\n\nexport const formatCompletion = (options: GeneratorOptions, context: CompletionContext) => {\n const cwd = context.cwd ?? process.cwd();\n const color = context.color ?? supportsColor();\n const decorate = color ? ansi : { bold: (value: string) => value, green: (value: string) => value };\n const destination = displayDestination(context.destination, cwd);\n const commands = [\n ...(destination === '.' ? [] : [`cd ${commandPath(destination)}`]),\n ...(options.install ? [] : ['npm install']),\n 'npm run dev',\n ];\n\n return `${decorate.green('✓')} Created ${options.siteName} in ${destination}\\n\\n${decorate.bold('Setup')}\\n Dependencies: ${options.install ? 'installed' : 'skipped'}\\n Git repository: ${options.git ? 'initialized' : 'skipped'}\\n\\n${decorate.bold('Next steps')}\\n${commands.map((command) => ` ${command}`).join('\\n')}\\n`;\n};\n","#!/usr/bin/env node\n\nimport { readFile } from 'node:fs/promises';\n\nimport { confirm, isCancel } from '@clack/prompts';\n\nimport { runCli } from './cli';\nimport { materializeProject } from './materialize';\nimport { ProcessStepError, runProjectSetup } from './process';\nimport { formatCompletion } from './reporter';\n\ntype PackageMetadata = {\n version: string;\n};\n\nconst packageJson = new URL('../package.json', import.meta.url);\nconst metadata = JSON.parse(await readFile(packageJson, 'utf8')) as PackageMetadata;\nconst interactive = Boolean(process.stdin.isTTY && process.stdout.isTTY);\nconst result = await runCli(process.argv.slice(2), metadata.version, { interactive });\n\nif (result.options) {\n const controller = new AbortController();\n let interruptedExitCode: number | undefined;\n const interrupt = () => {\n interruptedExitCode = 130;\n controller.abort();\n };\n const terminate = () => {\n interruptedExitCode = 143;\n controller.abort();\n };\n process.once('SIGINT', interrupt);\n process.once('SIGTERM', terminate);\n try {\n const materialized = await materializeProject(result.options, {\n templateDirectory: new URL('./template/', import.meta.url),\n signal: controller.signal,\n ...(interactive\n ? {\n confirmOverwrite: async (destination: string) => {\n const answer = await confirm({\n message: `${destination} is not empty. Continue and overwrite conflicting template files?`,\n initialValue: false,\n });\n return !isCancel(answer) && answer;\n },\n }\n : {}),\n });\n await runProjectSetup(result.options, {\n destination: materialized.destination,\n signal: controller.signal,\n });\n result.output = formatCompletion(result.options, { destination: materialized.destination });\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n result.output = `error: ${message}\\n`;\n result.exitCode = interruptedExitCode ?? (error instanceof ProcessStepError ? error.exitCode : 1);\n } finally {\n process.off('SIGINT', interrupt);\n process.off('SIGTERM', terminate);\n }\n}\n\nprocess.stdout.write(result.output);\nprocess.exitCode = result.exitCode;\n"],"mappings":";;;;;;;;;;AAiBA,MAAa,eAA8B;CACzC,OAAO,YACL,KAAK;EACH,SAAS,QAAQ;EACjB,GAAI,QAAQ,iBAAiB,KAAA,IAAY,CAAC,IAAI,EAAE,cAAc,QAAQ,aAAa;EACnF,GAAI,QAAQ,gBAAgB,KAAA,IAAY,CAAC,IAAI,EAAE,aAAa,QAAQ,YAAY;EAChF,GAAI,QAAQ,aAAa,KAAA,IAAY,CAAC,IAAI,EAAE,UAAU,QAAQ,SAAS;CACzE,CAAC;CACH;CACA;AACF;ACRA,MAAa,qBAAqB,gBAAwB;CACxD,OAAO,SAAS,QAAQ,WAAW,CAAC,KAAK;AAC3C;AAEA,MAAa,uBAAuB,gBAAwB;CAE1D,QADqB,YAAY,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,YAAA,CAEnD,MAAM,UAAU,CAAC,CACjB,OAAO,OAAO,CAAC,CACf,KAAK,SAAS,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,KAAK,MAAM,CAAC,GAAG,CAAC,CAChE,KAAK,GAAG;AACb;;;AC5BA,IAAa,aAAb,cAAgC,MAAM,CAAC;AAEvC,MAAM,WAAW,QAAgB,OAAe,WAA0B;CACxE,MAAM,IAAI,WAAW,WAAW,OAAO,SAAS,KAAK,UAAU,KAAK,EAAE,IAAI,QAAQ;AACpF;AAEA,MAAa,uBAAuB,UAAkB;CACpD,MAAM,cAAc,MAAM,KAAK;CAC/B,IAAI,CAAC,aAAa,QAAQ,eAAe,OAAO,0BAA0B;CAC1E,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D,QAAQ,WAAW;GACnB,GAAI,cACA,EACE,kBAAkB,OAAO,gBAAwB;IAC/C,MAAM,SAAS,MAAM,QAAQ;KAC3B,SAAS,GAAG,YAAY;KACxB,cAAc;IAChB,CAAC;IACD,OAAO,CAAC,SAAS,MAAM,KAAK;GAC9B,EACF,IACA,CAAC;EACP,CAAC;EACD,MAAM,gBAAgB,OAAO,SAAS;GACpC,aAAa,aAAa;GAC1B,QAAQ,WAAW;EACrB,CAAC;EACD,OAAO,SAAS,iBAAiB,OAAO,SAAS,EAAE,aAAa,aAAa,YAAY,CAAC;CAC5F,SAAS,OAAO;EAEd,OAAO,SAAS,UADA,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,EACnC;EAClC,OAAO,WAAW,wBAAwB,iBAAiB,mBAAmB,MAAM,WAAW;CACjG,UAAU;EACR,QAAQ,IAAI,UAAU,SAAS;EAC/B,QAAQ,IAAI,WAAW,SAAS;CAClC;AACF;AAEA,QAAQ,OAAO,MAAM,OAAO,MAAM;AAClC,QAAQ,WAAW,OAAO"}
@@ -0,0 +1,10 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ trim_trailing_whitespace = true
6
+ end_of_line = lf
7
+ insert_final_newline = true
8
+ indent_style = space
9
+ indent_size = 2
10
+ max_line_length = 120
@@ -0,0 +1,10 @@
1
+ {
2
+ "MD013": {
3
+ "line_length": 120,
4
+ "code_blocks": false,
5
+ "tables": false
6
+ },
7
+ "MD024": {
8
+ "siblings_only": true
9
+ }
10
+ }
@@ -0,0 +1,169 @@
1
+ # Forge site
2
+
3
+ This directory is a standalone Astro project and is intentionally excluded from
4
+ the parent npm workspace. Install and run all commands from this directory.
5
+
6
+ Install dependencies with `npm ci`, then use the local scripts below. Every
7
+ command resolves tools from this project's dependencies; no global installation
8
+ is required.
9
+
10
+ The template's `.editorconfig` shares UTF-8, LF, final-newline, two-space, and
11
+ 120-column settings with supported editors and Oxfmt. `oxfmt.config.ts` contains
12
+ only formatter-specific behavior such as quote and import ordering.
13
+
14
+ | Command | Purpose |
15
+ | ----------------------- | --------------------------------------------------------------------------- |
16
+ | `npm run dev` | Start Astro's local development server. |
17
+ | `npm run build` | Create the production site in `dist/`. |
18
+ | `npm run preview` | Serve the production build locally. Run `build` first. |
19
+ | `npm run typecheck` | Generate Astro types and run TypeScript without emitting files. |
20
+ | `npm run astro:check` | Validate Astro components, content, and diagnostics. |
21
+ | `npm run format` | Check formatting with Oxfmt. |
22
+ | `npm run format:fix` | Apply Oxfmt formatting. |
23
+ | `npm run lint` | Run code, CSS, Markdown, and spelling checks. |
24
+ | `npm run lint:code` | Check JavaScript and TypeScript with Oxlint. |
25
+ | `npm run lint:css` | Check CSS with Stylelint. |
26
+ | `npm run lint:markdown` | Check Markdown with Markdownlint. |
27
+ | `npm run spellcheck` | Check repository text with cspell. |
28
+ | `npm test` | Run TypeScript unit tests with Vitest. |
29
+ | `npm run test:e2e` | Run browser and accessibility tests with Playwright. |
30
+ | `npm run audit` | Report high-severity dependency vulnerabilities with npm. |
31
+ | `npm run quality` | Run the deterministic formatting, linting, type, unit-test, and build gate. |
32
+
33
+ During development, run `npm run dev`. Before committing, run
34
+ `npm run quality` and `npm run test:e2e`. Run `npm run audit` separately because
35
+ it queries the npm registry and its result can change without a source change.
36
+ The quality command remains deterministic and suitable for offline work after
37
+ dependencies are installed.
38
+
39
+ Edit `src/config/site.ts` to change the site name, description, author,
40
+ canonical URL, repository, language, navigation, social links, and derived CMS branding. The Astro
41
+ configuration, shared layout, and reusable SEO head consume this single
42
+ validated source. New pages should use `src/layouts/BaseLayout.astro` to inherit
43
+ the document shell and canonical metadata.
44
+
45
+ The standalone source template uses `https://example.com` as a valid,
46
+ non-production site origin. Projects created by Forge receive the values
47
+ selected through the generator input contract.
48
+
49
+ ## Styling and themes
50
+
51
+ The template uses Tailwind CSS v4 through its Vite plugin, DaisyUI, and the
52
+ Tailwind typography plugin. Catppuccin Latte is the default light theme and
53
+ Mocha is selected automatically for dark color-scheme preferences. All four
54
+ Catppuccin flavors are available by setting `data-theme` on the document:
55
+
56
+ - `data-theme="latte"`
57
+ - `data-theme="frappe"`
58
+ - `data-theme="macchiato"`
59
+ - `data-theme="mocha"`
60
+
61
+ Global styles live in `src/styles/global.css`; print-safe rules live in
62
+ `src/styles/print.css`; and theme configuration lives in `src/themes/`. The
63
+ default automatic theme behavior requires no client-side JavaScript.
64
+
65
+ ### Fonts
66
+
67
+ The template pairs Fira Sans for interface and article text with Fira Code for
68
+ code. Both families remain legible at small sizes, have complementary forms,
69
+ and are bundled through Fontsource so rendering does not depend on a remote font
70
+ service. Only the weights imported by `src/styles/global.css` are included in
71
+ the build.
72
+
73
+ To replace them with other Fontsource families, uninstall both defaults and
74
+ install the packages for the new sans-serif and monospace families. For example:
75
+
76
+ ```sh
77
+ npm uninstall @fontsource/fira-sans @fontsource/fira-code
78
+ npm install @fontsource/inter @fontsource/source-code-pro
79
+ ```
80
+
81
+ Then replace the Fontsource imports near the top of `src/styles/global.css` with
82
+ the families and weights the site uses:
83
+
84
+ ```css
85
+ @import '@fontsource/inter/400.css';
86
+ @import '@fontsource/inter/600.css';
87
+ @import '@fontsource/source-code-pro/400.css';
88
+ ```
89
+
90
+ Finally, update the Tailwind font tokens in the same file:
91
+
92
+ ```css
93
+ @theme {
94
+ --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
95
+ --font-mono: 'Source Code Pro', ui-monospace, monospace;
96
+ }
97
+ ```
98
+
99
+ For a system-font-only site, uninstall the two default Fontsource packages,
100
+ remove their CSS imports, and remove the custom family name at the start of each
101
+ font token. After either change, run `npm run build` to confirm every imported
102
+ weight is installed and bundled.
103
+
104
+ ## Layout primitives
105
+
106
+ `src/layouts/BaseLayout.astro` supplies the document shell, a keyboard-accessible
107
+ skip link, semantic header, main, and footer landmarks, and the shared metadata
108
+ components. Page content belongs inside `BaseLayout`; pages must not add another
109
+ `main` landmark.
110
+
111
+ Reusable components are organized by responsibility:
112
+
113
+ - `navigation/Header.astro` owns the semantic header and outer content boundary;
114
+ - `navigation/Navbar.astro` composes branding, responsive menus, configured links, and current-page state;
115
+ - `navigation/Footer.astro` renders site identity and optional social links;
116
+ - `navigation/Pagination.astro` provides typed previous and next navigation;
117
+ - `ui/Container.astro` provides consistent responsive content widths; and
118
+ - `ui/Card.astro` provides linked and non-linked DaisyUI card surfaces with typed sizing.
119
+
120
+ The template follows the operating-system light or dark preference and does not
121
+ include a theme control. This keeps the default experience functional without
122
+ client-side JavaScript; a future control can select any documented `data-theme`
123
+ value if a project chooses to persist a visitor preference.
124
+
125
+ `Pagination.astro` is intentionally not rendered on the starter homepage: the
126
+ template does not yet have a paginated collection, and fragment links would be
127
+ a misleading demonstration. The content-listing work will compose it with real
128
+ previous and next destinations.
129
+
130
+ ## Routes and metadata
131
+
132
+ The starter includes home, about, article index, article detail, content
133
+ manager, and custom 404 pages. The shared article model lives in
134
+ `src/config/content-models/articles.ts`; `src/content.config.ts` converts the
135
+ model into Astro validation, while the Sveltia configuration converts the same
136
+ model into CMS fields. Generic Markdown fixtures live in
137
+ `src/content/articles/`. Draft entries are available during local development
138
+ but are excluded from production routes and the RSS feed.
139
+
140
+ The seed articles intentionally include no article images or other binary
141
+ media. This keeps generated projects and repository checkouts small and avoids
142
+ shipping decorative assets that most projects would immediately replace. Add
143
+ purposeful media only when the site needs it, and pair each meaningful image
144
+ with context-appropriate alternative text where it is rendered.
145
+
146
+ Site configuration drives page titles, descriptions, canonical URLs, Open
147
+ Graph and Twitter metadata, the RSS feed, the web manifest, and the sitemap
148
+ reference in `robots.txt`. Replace `public/favicon.svg` and
149
+ `public/social-card.svg` when establishing a project identity, and update
150
+ `socialImage` in `src/config/site.ts` if the sharing image path changes.
151
+
152
+ ## Content manager
153
+
154
+ Run the development server and open `/admin/` to use Sveltia CMS. Sveltia
155
+ automatically offers its local repository workflow in a supported browser;
156
+ select the project root to write content directly to `src/content/articles/`.
157
+ Review and commit those file changes normally.
158
+
159
+ Before deploying the content manager, replace
160
+ `your-github-user/your-repository` in
161
+ `src/integrations/sveltia/config.ts` with the generated site's GitHub
162
+ repository. The default configuration offers Sveltia's token authentication
163
+ method but never stores a token in source: each editor supplies a token through
164
+ the CMS interface, and Sveltia stores it in that browser. A production project
165
+ can replace this with its own supported OAuth configuration.
166
+
167
+ The generated CMS configuration lives in code rather than a duplicated YAML
168
+ file. Change content fields in the shared model, then run `npm run typecheck`
169
+ and `npm test` to verify that Astro and Sveltia still derive the same contract.
@@ -0,0 +1,15 @@
1
+ import sitemap from '@astrojs/sitemap';
2
+ import tailwindcss from '@tailwindcss/vite';
3
+ import { defineConfig } from 'astro/config';
4
+
5
+ import { site } from './src/config/site';
6
+
7
+ export default defineConfig({
8
+ integrations: [sitemap()],
9
+ output: 'static',
10
+ site: site.url,
11
+ trailingSlash: 'always',
12
+ vite: {
13
+ plugins: [tailwindcss()],
14
+ },
15
+ });
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from 'cspell';
2
+
3
+ export default defineConfig({
4
+ ignorePaths: ['node_modules', 'dist', 'coverage', 'playwright-report', 'test-results'],
5
+ words: ['Catppuccin', 'contentinfo', 'daisyui', 'Fira', 'fontsource', 'Macchiato', 'prefersdark', 'Sveltia'],
6
+ });
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from 'oxfmt';
2
+
3
+ export default defineConfig({
4
+ singleQuote: true,
5
+ sortImports: true,
6
+ sortPackageJson: true,
7
+ sortTailwindcss: true,
8
+ trailingComma: 'all',
9
+ });