@orieljs/vercel 0.1.0-alpha.14 → 0.1.0-alpha.15

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/dist/index.js CHANGED
@@ -3,6 +3,7 @@ import { existsSync, readdirSync, readFileSync, realpathSync, statSync } from "f
3
3
  import { cp, mkdir, rm, writeFile } from "fs/promises";
4
4
  import { basename, dirname, join, relative, resolve } from "path";
5
5
  import { ConsoleKernel as ConsoleKernel2, Schedule as Schedule2 } from "@orieljs/contracts";
6
+ import { isPublicAsset } from "@orieljs/support";
6
7
  import { CronExpressionParser as CronExpressionParser2 } from "cron-parser";
7
8
 
8
9
  // cron.ts
@@ -122,7 +123,7 @@ async function buildVercelOutput(app, options = {}) {
122
123
  const staticFolder = join(output, "static");
123
124
  await mkdir(staticFolder, { recursive: true });
124
125
  if (existsSync(publicPath)) {
125
- await cp(publicPath, staticFolder, { recursive: true, filter: (source) => basename(source) !== "hot" && !isEnvFile(source) });
126
+ await cp(publicPath, staticFolder, { recursive: true, filter: (source) => basename(source) !== "hot" && !isEnvFile(source) && isPublicAsset(relative(publicPath, source)) });
126
127
  }
127
128
  const fn = join(output, "functions/index.func");
128
129
  for (const folder of APP_FOLDERS) {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../build.ts","../cron.ts","../launcher.ts","../VercelServiceProvider.ts"],"sourcesContent":["import { existsSync, readdirSync, readFileSync, realpathSync, statSync } from 'node:fs'\nimport { cp, mkdir, rm, writeFile } from 'node:fs/promises'\nimport { basename, dirname, join, relative, resolve } from 'node:path'\nimport { ConsoleKernel, Schedule, type Application } from '@orieljs/contracts'\nimport { CronExpressionParser } from 'cron-parser'\nimport { DEFAULT_CRON, SCHEDULE_PATH } from './cron'\nimport { LAUNCHER } from './launcher'\n\nexport interface VercelBuildOptions {\n /** Where the build output goes, relative to the app. Default: `.vercel/output` (where Vercel looks for it). */\n output?: string\n /** The function's Node runtime. Default: `nodejs22.x`. */\n runtime?: string\n /** The largest function Vercel accepts, unzipped. Default: 250 MB. */\n maxFunctionBytes?: number\n /** The machine the build runs on, which decides the native packages copied. Default: `process.platform`. */\n platform?: string\n /**\n * When Vercel calls the app's scheduler, as a cron expression (UTC), or `false` for never. Default: `0 3 * * *`,\n * daily at 03:00: Vercel's Hobby plan runs a cron at most once a day. Written only when the app schedules tasks.\n */\n cron?: string | false\n}\n\nexport interface VercelBuildResult {\n /** The function's size, unzipped. */\n functionBytes: number\n /** The files Vercel serves without the function. */\n staticFiles: number\n /** What the build got right but the deploy may not: a build off Linux. */\n warnings: string[]\n}\n\n/** Vercel's limit on a function's unzipped size. */\nexport const VERCEL_FUNCTION_LIMIT = 250 * 1024 * 1024\n\n/** The app's own code, copied whole: Oriel finds routes, providers and Live components by reading these folders. */\nconst APP_FOLDERS = ['app', 'bootstrap', 'config', 'routes', 'resources', 'lang', 'database']\nconst APP_FILES = ['package.json', 'tsconfig.json']\n/** What the app reads from public/build at run time: the Vite manifest (a scrambled build's class map is in bootstrap/cache). */\nconst BUILD_FILES = ['manifest.json']\nconst VITE_CONFIGS = ['vite.config.ts', 'vite.config.mts', 'vite.config.js', 'vite.config.mjs']\n\nconst isEnvFile = (path: string) => /^\\.env(\\..*)?$/.test(basename(path))\n/** A SQLite file in `database/`: local data, which the function couldn't write to anyway. */\nconst isSqliteFile = (path: string) => /\\.(sqlite3?|db)(-wal|-shm|-journal)?$/.test(basename(path))\nconst PLATFORM_NAMES: Record<string, string> = { darwin: 'macOS', win32: 'Windows' }\n\n/**\n * Writes Vercel's Build Output API v3 folder for an app: `static/` from `public/`, and one Node function holding the\n * app's code, the build files it reads at run time, its production dependencies and the launcher. `.env` files are\n * never copied: the secrets come from Vercel's environment variables.\n */\nexport async function buildVercelOutput(app: Application, options: VercelBuildOptions = {}): Promise<VercelBuildResult> {\n const base = app.basePath()\n const publicPath = app.publicPath()\n if (existsSync(join(publicPath, 'hot'))) {\n throw new Error('The Vite dev server is running (public/hot exists): stop `npm run dev` and build the assets with `npm run build` first.')\n }\n if (VITE_CONFIGS.some((file) => existsSync(join(base, file))) && !existsSync(join(publicPath, 'build/manifest.json'))) {\n throw new Error(\"The assets aren't built (public/build/manifest.json is missing): run `npm run build` first.\")\n }\n\n const output = resolve(base, options.output ?? '.vercel/output')\n await rm(output, { recursive: true, force: true })\n\n const staticFolder = join(output, 'static')\n await mkdir(staticFolder, { recursive: true })\n if (existsSync(publicPath)) {\n await cp(publicPath, staticFolder, { recursive: true, filter: (source) => basename(source) !== 'hot' && !isEnvFile(source) })\n }\n\n const fn = join(output, 'functions/index.func')\n for (const folder of APP_FOLDERS) {\n const filter = (source: string) => !isEnvFile(source) && !(folder === 'database' && isSqliteFile(source))\n if (existsSync(join(base, folder))) await cp(join(base, folder), join(fn, folder), { recursive: true, filter })\n }\n for (const file of APP_FILES) if (existsSync(join(base, file))) await cp(join(base, file), join(fn, file))\n for (const file of BUILD_FILES) {\n const source = join(publicPath, 'build', file)\n if (existsSync(source)) await cp(source, join(fn, relative(base, publicPath), 'build', file))\n }\n await copyDependencies(base, fn)\n await writeFile(join(fn, 'index.mjs'), LAUNCHER)\n const vcConfig = { runtime: options.runtime ?? 'nodejs22.x', handler: 'index.mjs', launcherType: 'Nodejs', shouldAddHelpers: false, supportsResponseStreaming: true }\n await writeFile(join(fn, '.vc-config.json'), `${JSON.stringify(vcConfig, null, 2)}\\n`)\n const { crons, cronWarnings } = await scheduleCron(app, options.cron)\n const config = {\n version: 3,\n ...(crons === undefined ? {} : { crons }),\n routes: [\n // The built assets' names change with their content, so they're cached for a year, as serve() does.\n { src: '^/build/assets/(.*)$', headers: { 'cache-control': 'public, max-age=31536000, immutable' }, continue: true },\n { handle: 'filesystem' },\n { src: '/(.*)', dest: '/index' },\n ],\n }\n await writeFile(join(output, 'config.json'), `${JSON.stringify(config, null, 2)}\\n`)\n\n const functionBytes = sizeOf(fn)\n const limit = options.maxFunctionBytes ?? VERCEL_FUNCTION_LIMIT\n if (functionBytes > limit) {\n throw new Error(`The function is ${megabytes(functionBytes)}, larger than Vercel allows (${megabytes(limit)}): move what it doesn't need at run time to devDependencies.`)\n }\n const platform = options.platform ?? process.platform\n const warnings =\n platform === 'linux'\n ? []\n : [\n `Built on ${PLATFORM_NAMES[platform] ?? platform}: the function's native packages (such as esbuild, which tsx needs) only run on this kind of machine, and Vercel's functions run on Linux. Let Vercel run the build, or build on Linux.`,\n ]\n return { functionBytes, staticFiles: countFiles(staticFolder), warnings: [...warnings, ...cronWarnings] }\n}\n\n/**\n * The cron entry Vercel calls the scheduler with, when the app schedules anything, and a warning for each task due more\n * often than it: such a task runs once per trigger. A task counts as more frequent when it falls due in both halves of\n * one trigger period.\n */\nasync function scheduleCron(app: Application, cron: string | false | undefined): Promise<{ crons?: { path: string; schedule: string }[]; cronWarnings: string[] }> {\n if (cron === false) return { cronWarnings: [] }\n if (app.bound(ConsoleKernel)) await app.make(ConsoleKernel).bootstrap()\n if (!app.bound(Schedule)) return { cronWarnings: [] }\n const schedule = app.make(Schedule)\n if (schedule.events().length === 0) return { cronWarnings: [] }\n const expression = cron ?? DEFAULT_CRON\n const fires = CronExpressionParser.parse(expression, { tz: 'UTC' })\n const start = fires.next().toDate()\n const end = fires.next().toDate()\n const middle = new Date((start.getTime() + end.getTime()) / 2)\n const later = new Set(schedule.dueBetween(middle, end))\n const often = schedule.dueBetween(start, middle).filter((event) => later.has(event))\n const plan = cron === undefined ? \" (once a day on Vercel's Hobby plan)\" : ''\n return {\n crons: [{ path: SCHEDULE_PATH, schedule: expression }],\n cronWarnings: often.map((event) => `\"${event.getSummaryForDisplay()}\" (${event.expression}) is due more often than the cron \"${expression}\", so it runs once per trigger${plan}.`),\n }\n}\n\n/**\n * Copies the app's production dependencies (its `dependencies`, and `tsx`, which the launcher uses) with everything\n * they depend on, found as Node finds them. A package needed in two versions keeps the first at the top and nests the\n * other under the package that needs it.\n */\nasync function copyDependencies(base: string, fn: string): Promise<void> {\n const manifest = JSON.parse(readFileSync(join(base, 'package.json'), 'utf8')) as { dependencies?: Record<string, string> }\n const topLevel = new Map<string, string>()\n const copied = new Set<string>()\n\n const visit = async (name: string, from: string, into: string): Promise<void> => {\n const found = locate(name, from)\n if (found === undefined) return\n const real = realpathSync(found)\n let destination = join(fn, 'node_modules', name)\n const top = topLevel.get(name)\n if (top === undefined) topLevel.set(name, real)\n else if (top !== real) destination = join(into, name)\n if (copied.has(destination)) return\n copied.add(destination)\n await cp(real, destination, {\n recursive: true,\n dereference: true,\n filter: (source) => source === real || !['node_modules', '.bin', '.git'].includes(basename(source)),\n })\n const pkg = JSON.parse(readFileSync(join(real, 'package.json'), 'utf8')) as { dependencies?: Record<string, string>; optionalDependencies?: Record<string, string> }\n for (const dependency of [...Object.keys(pkg.dependencies ?? {}), ...Object.keys(pkg.optionalDependencies ?? {})]) {\n await visit(dependency, real, join(destination, 'node_modules'))\n }\n }\n\n for (const name of [...Object.keys(manifest.dependencies ?? {}), 'tsx']) await visit(name, base, join(fn, 'node_modules'))\n}\n\n/** Where Node finds a package from a folder: `node_modules/<name>` in it or any folder above it. */\nfunction locate(name: string, from: string): string | undefined {\n for (let dir = from; ; dir = dirname(dir)) {\n const candidate = basename(dir) === 'node_modules' ? join(dir, name) : join(dir, 'node_modules', name)\n if (existsSync(join(candidate, 'package.json'))) return candidate\n if (dirname(dir) === dir) return undefined\n }\n}\n\nfunction sizeOf(folder: string): number {\n return readdirSync(folder, { withFileTypes: true, recursive: true })\n .filter((entry) => entry.isFile())\n .reduce((total, entry) => total + statSync(join(entry.parentPath, entry.name)).size, 0)\n}\n\nfunction countFiles(folder: string): number {\n return readdirSync(folder, { withFileTypes: true, recursive: true }).filter((entry) => entry.isFile()).length\n}\n\nconst megabytes = (bytes: number) => `${(bytes / 1024 / 1024).toFixed(1)} MB`\n","import { timingSafeEqual } from 'node:crypto'\nimport { inject } from '@orieljs/container'\nimport { CacheManager, ConsoleKernel, ExceptionHandler, Schedule } from '@orieljs/contracts'\nimport { CronExpressionParser } from 'cron-parser'\n\n/** Where Vercel's cron calls the app; `oriel vercel:build` puts it in the cron entry. */\nexport const SCHEDULE_PATH = '/_oriel/schedule'\n\n/** The cron `vercel:build` writes by default: daily at 03:00 UTC (Hobby runs a cron at most once a day). */\nexport const DEFAULT_CRON = '0 3 * * *'\n\nconst LAST_RUN = 'oriel:vercel:schedule:last'\nconst LOCK = 'oriel:vercel:schedule'\n\nconst json = (body: unknown, status = 200) => Response.json(body, { status, headers: { 'cache-control': 'no-store' } })\n\n/** Vercel sends `Authorization: Bearer <CRON_SECRET>`; compared in constant time. */\nfunction authorized(header: string | undefined, secret: string): boolean {\n const expected = Buffer.from(`Bearer ${secret}`)\n const given = Buffer.from(header ?? '')\n return given.length === expected.length && timingSafeEqual(given, expected)\n}\n\n/**\n * Where a trigger with no record starts: the trigger's fire time before the current one, so the first trigger covers\n * one full period, as every later one does (for a daily cron, yesterday's run time to now).\n */\nexport function previousTrigger(expression: string, now: Date): Date {\n const parsed = CronExpressionParser.parse(expression, { currentDate: new Date(now.getTime() + 60_000), tz: 'UTC' })\n parsed.prev()\n return parsed.prev().toDate()\n}\n\n/**\n * What Vercel's cron calls. Off (404) without `CRON_SECRET`; 401 for any other bearer token. Otherwise, holding a lock\n * so a doubled call runs nothing twice, it loads the app's schedule (a web request never has: routes/console.ts is the\n * console's) and runs every task due since the previous trigger, once each. A failing task is reported and counted,\n * and never stops the rest; the trigger is recorded either way. 200 `{ ran, failed: 0 }`, or 500 when any failed.\n */\nexport async function runVercelSchedule(authorization: string | undefined, options: { now?: () => Date; trigger?: string } = {}): Promise<Response> {\n const secret = process.env.CRON_SECRET\n if (!secret) return new Response('Not Found', { status: 404 })\n if (!authorized(authorization, secret)) return json({ error: 'Unauthorized' }, 401)\n\n const cache = inject(CacheManager)\n const lock = cache.lock(LOCK, 900)\n if (!(await lock.get())) return json({ ran: 0, failed: 0, skipped: 'busy' })\n try {\n await inject(ConsoleKernel).bootstrap()\n const now = options.now?.() ?? new Date()\n const last = await cache.get<string>(LAST_RUN)\n const from = last === undefined ? previousTrigger(options.trigger ?? process.env.ORIEL_VERCEL_CRON ?? DEFAULT_CRON, now) : new Date(last)\n const due = inject(Schedule).dueBetween(from, now)\n let failed = 0\n for (const event of due) {\n try {\n await event.run()\n } catch (error) {\n failed++\n await inject(ExceptionHandler).report(error)\n }\n }\n await cache.forever(LAST_RUN, now.toISOString())\n return json({ ran: due.length, failed }, failed > 0 ? 500 : 200)\n } finally {\n await lock.release()\n }\n}\n","/**\n * The function's entry (`index.mjs` in `.vercel/output/functions/index.func`): registers tsx as the app's `oriel`\n * file does, boots the app once per function instance, and hands each request to the Node request handler `serve`\n * uses. Public files never reach it: Vercel serves them from `static/`. A boot that fails answers a plain 500, logs\n * the error, and is tried again on the next request. Logs go to stderr unless `LOG_CHANNEL` is set, since the\n * function can't write files, and Vercel's proxy is trusted unless the app lists its own.\n */\nexport const LAUNCHER = `// Oriel on Vercel: boots the app once per function instance and hands it each request.\nimport { fileURLToPath } from 'node:url'\n\nlet ready\n\nasync function boot() {\n // Vercel's disk is read-only, so a log file can't open; stderr is what Vercel's log view shows.\n process.env.LOG_CHANNEL ??= 'stderr'\n if (!process.versions.bun) {\n const { register } = await import('tsx/esm/api')\n register({ tsconfig: fileURLToPath(new URL('./tsconfig.json', import.meta.url)) })\n }\n const { createApplication } = await import('./bootstrap/app.ts')\n const { nodeRequestHandler } = await import('@orieljs/framework')\n const { ConfigRepository } = await import('@orieljs/framework/contracts')\n const app = await createApplication()\n await app.boot()\n // Every request comes through Vercel's proxy, which sets the X-Forwarded-* headers itself: trust it, unless the app\n // lists its own proxies, so that URLs keep the browser's https and ip() is the visitor's.\n const config = app.make(ConfigRepository)\n const proxies = config.get('http.trusted_proxies', [])\n if (proxies === undefined || proxies === null || proxies.length === 0) config.set('http.trusted_proxies', '*')\n return nodeRequestHandler(app, { fallbackHost: 'localhost' })\n}\n\nexport default async function handler(req, res) {\n let handle\n try {\n ready ??= boot()\n handle = await ready\n } catch (error) {\n ready = undefined\n console.error(error)\n if (!res.headersSent) {\n res.statusCode = 500\n res.setHeader('content-type', 'text/plain; charset=utf-8')\n }\n res.end('Internal Server Error')\n return\n }\n await handle(req, res)\n}\n`\n","import { inject } from '@orieljs/container'\nimport { ConsoleKernel, HttpRequest, Router, type CommandContext } from '@orieljs/contracts'\nimport { ServiceProvider } from '@orieljs/support'\nimport { buildVercelOutput } from './build'\nimport { runVercelSchedule, SCHEDULE_PATH } from './cron'\n\nconst megabytes = (bytes: number) => `${(bytes / 1024 / 1024).toFixed(1)} MB`\n\n/** Registers `oriel vercel:build`, which writes Vercel's build output for the app, and the route Vercel Cron calls. */\nexport class VercelServiceProvider extends ServiceProvider {\n override boot(): void {\n // No `web` middleware: a cron call has no session or CSRF token; CRON_SECRET guards it.\n if (this.app.bound(Router)) {\n this.app\n .make(Router)\n .get(SCHEDULE_PATH, () => {\n const request = inject(HttpRequest)\n return runVercelSchedule(request.header('authorization'), { trigger: request.header('x-vercel-cron-schedule') })\n })\n .name('vercel.schedule')\n }\n if (!this.app.bound(ConsoleKernel)) return\n const app = this.app\n this.app\n .make(ConsoleKernel)\n .command('vercel:build {--cron= : When Vercel calls the scheduler, as a cron expression (UTC), or false for never}', async function (this: CommandContext) {\n try {\n const option = this.option('cron')\n const cron = typeof option === 'string' && option !== '' ? (option === 'false' ? false : option) : undefined\n const { staticFiles, functionBytes, warnings } = await buildVercelOutput(app, { cron })\n const files = staticFiles === 1 ? '1 static file' : `${staticFiles} static files`\n this.info(`Wrote .vercel/output: ${files}, a function of ${megabytes(functionBytes)}.`)\n for (const warning of warnings) this.warn(warning)\n return 0\n } catch (error) {\n this.error(error instanceof Error ? error.message : String(error))\n return 1\n }\n })\n .purpose(\"Write Vercel's build output (.vercel/output) for the application\")\n }\n}\n"],"mappings":";AAAA,SAAS,YAAY,aAAa,cAAc,cAAc,gBAAgB;AAC9E,SAAS,IAAI,OAAO,IAAI,iBAAiB;AACzC,SAAS,UAAU,SAAS,MAAM,UAAU,eAA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ACF,cAAM,SAAS,KAAK,OAAO,MAAM;AACjC,cAAM,OAAO,OAAO,WAAW,YAAY,WAAW,KAAM,WAAW,UAAU,QAAQ,SAAU;AACnG,cAAM,EAAE,aAAa,eAAe,SAAS,IAAI,MAAM,kBAAkB,KAAK,EAAE,KAAK,CAAC;AACtF,cAAM,QAAQ,gBAAgB,IAAI,kBAAkB,GAAG,WAAW;AAClE,aAAK,KAAK,yBAAyB,KAAK,mBAAmBF,WAAU,aAAa,CAAC,GAAG;AACtF,mBAAW,WAAW,SAAU,MAAK,KAAK,OAAO;AACjD,eAAO;AAAA,MACT,SAAS,OAAO;AACd,aAAK,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AACjE,eAAO;AAAA,MACT;AAAA,IACF,CAAC,EACA,QAAQ,kEAAkE;AAAA,EAC/E;AACF;","names":["ConsoleKernel","Schedule","CronExpressionParser","ConsoleKernel","Schedule","CronExpressionParser","inject","ConsoleKernel","megabytes","inject","ConsoleKernel"]}
1
+ {"version":3,"sources":["../build.ts","../cron.ts","../launcher.ts","../VercelServiceProvider.ts"],"sourcesContent":["import { existsSync, readdirSync, readFileSync, realpathSync, statSync } from 'node:fs'\nimport { cp, mkdir, rm, writeFile } from 'node:fs/promises'\nimport { basename, dirname, join, relative, resolve } from 'node:path'\nimport { ConsoleKernel, Schedule, type Application } from '@orieljs/contracts'\nimport { isPublicAsset } from '@orieljs/support'\nimport { CronExpressionParser } from 'cron-parser'\nimport { DEFAULT_CRON, SCHEDULE_PATH } from './cron'\nimport { LAUNCHER } from './launcher'\n\nexport interface VercelBuildOptions {\n /** Where the build output goes, relative to the app. Default: `.vercel/output` (where Vercel looks for it). */\n output?: string\n /** The function's Node runtime. Default: `nodejs22.x`. */\n runtime?: string\n /** The largest function Vercel accepts, unzipped. Default: 250 MB. */\n maxFunctionBytes?: number\n /** The machine the build runs on, which decides the native packages copied. Default: `process.platform`. */\n platform?: string\n /**\n * When Vercel calls the app's scheduler, as a cron expression (UTC), or `false` for never. Default: `0 3 * * *`,\n * daily at 03:00: Vercel's Hobby plan runs a cron at most once a day. Written only when the app schedules tasks.\n */\n cron?: string | false\n}\n\nexport interface VercelBuildResult {\n /** The function's size, unzipped. */\n functionBytes: number\n /** The files Vercel serves without the function. */\n staticFiles: number\n /** What the build got right but the deploy may not: a build off Linux. */\n warnings: string[]\n}\n\n/** Vercel's limit on a function's unzipped size. */\nexport const VERCEL_FUNCTION_LIMIT = 250 * 1024 * 1024\n\n/** The app's own code, copied whole: Oriel finds routes, providers and Live components by reading these folders. */\nconst APP_FOLDERS = ['app', 'bootstrap', 'config', 'routes', 'resources', 'lang', 'database']\nconst APP_FILES = ['package.json', 'tsconfig.json']\n/** What the app reads from public/build at run time: the Vite manifest (a scrambled build's class map is in bootstrap/cache). */\nconst BUILD_FILES = ['manifest.json']\nconst VITE_CONFIGS = ['vite.config.ts', 'vite.config.mts', 'vite.config.js', 'vite.config.mjs']\n\nconst isEnvFile = (path: string) => /^\\.env(\\..*)?$/.test(basename(path))\n/** A SQLite file in `database/`: local data, which the function couldn't write to anyway. */\nconst isSqliteFile = (path: string) => /\\.(sqlite3?|db)(-wal|-shm|-journal)?$/.test(basename(path))\nconst PLATFORM_NAMES: Record<string, string> = { darwin: 'macOS', win32: 'Windows' }\n\n/**\n * Writes Vercel's Build Output API v3 folder for an app: `static/` from `public/`, and one Node function holding the\n * app's code, the build files it reads at run time, its production dependencies and the launcher. `.env` files are\n * never copied: the secrets come from Vercel's environment variables.\n */\nexport async function buildVercelOutput(app: Application, options: VercelBuildOptions = {}): Promise<VercelBuildResult> {\n const base = app.basePath()\n const publicPath = app.publicPath()\n if (existsSync(join(publicPath, 'hot'))) {\n throw new Error('The Vite dev server is running (public/hot exists): stop `npm run dev` and build the assets with `npm run build` first.')\n }\n if (VITE_CONFIGS.some((file) => existsSync(join(base, file))) && !existsSync(join(publicPath, 'build/manifest.json'))) {\n throw new Error(\"The assets aren't built (public/build/manifest.json is missing): run `npm run build` first.\")\n }\n\n const output = resolve(base, options.output ?? '.vercel/output')\n await rm(output, { recursive: true, force: true })\n\n const staticFolder = join(output, 'static')\n await mkdir(staticFolder, { recursive: true })\n if (existsSync(publicPath)) {\n await cp(publicPath, staticFolder, { recursive: true, filter: (source) => basename(source) !== 'hot' && !isEnvFile(source) && isPublicAsset(relative(publicPath, source)) })\n }\n\n const fn = join(output, 'functions/index.func')\n for (const folder of APP_FOLDERS) {\n const filter = (source: string) => !isEnvFile(source) && !(folder === 'database' && isSqliteFile(source))\n if (existsSync(join(base, folder))) await cp(join(base, folder), join(fn, folder), { recursive: true, filter })\n }\n for (const file of APP_FILES) if (existsSync(join(base, file))) await cp(join(base, file), join(fn, file))\n for (const file of BUILD_FILES) {\n const source = join(publicPath, 'build', file)\n if (existsSync(source)) await cp(source, join(fn, relative(base, publicPath), 'build', file))\n }\n await copyDependencies(base, fn)\n await writeFile(join(fn, 'index.mjs'), LAUNCHER)\n const vcConfig = { runtime: options.runtime ?? 'nodejs22.x', handler: 'index.mjs', launcherType: 'Nodejs', shouldAddHelpers: false, supportsResponseStreaming: true }\n await writeFile(join(fn, '.vc-config.json'), `${JSON.stringify(vcConfig, null, 2)}\\n`)\n const { crons, cronWarnings } = await scheduleCron(app, options.cron)\n const config = {\n version: 3,\n ...(crons === undefined ? {} : { crons }),\n routes: [\n // The built assets' names change with their content, so they're cached for a year, as serve() does.\n { src: '^/build/assets/(.*)$', headers: { 'cache-control': 'public, max-age=31536000, immutable' }, continue: true },\n { handle: 'filesystem' },\n { src: '/(.*)', dest: '/index' },\n ],\n }\n await writeFile(join(output, 'config.json'), `${JSON.stringify(config, null, 2)}\\n`)\n\n const functionBytes = sizeOf(fn)\n const limit = options.maxFunctionBytes ?? VERCEL_FUNCTION_LIMIT\n if (functionBytes > limit) {\n throw new Error(`The function is ${megabytes(functionBytes)}, larger than Vercel allows (${megabytes(limit)}): move what it doesn't need at run time to devDependencies.`)\n }\n const platform = options.platform ?? process.platform\n const warnings =\n platform === 'linux'\n ? []\n : [\n `Built on ${PLATFORM_NAMES[platform] ?? platform}: the function's native packages (such as esbuild, which tsx needs) only run on this kind of machine, and Vercel's functions run on Linux. Let Vercel run the build, or build on Linux.`,\n ]\n return { functionBytes, staticFiles: countFiles(staticFolder), warnings: [...warnings, ...cronWarnings] }\n}\n\n/**\n * The cron entry Vercel calls the scheduler with, when the app schedules anything, and a warning for each task due more\n * often than it: such a task runs once per trigger. A task counts as more frequent when it falls due in both halves of\n * one trigger period.\n */\nasync function scheduleCron(app: Application, cron: string | false | undefined): Promise<{ crons?: { path: string; schedule: string }[]; cronWarnings: string[] }> {\n if (cron === false) return { cronWarnings: [] }\n if (app.bound(ConsoleKernel)) await app.make(ConsoleKernel).bootstrap()\n if (!app.bound(Schedule)) return { cronWarnings: [] }\n const schedule = app.make(Schedule)\n if (schedule.events().length === 0) return { cronWarnings: [] }\n const expression = cron ?? DEFAULT_CRON\n const fires = CronExpressionParser.parse(expression, { tz: 'UTC' })\n const start = fires.next().toDate()\n const end = fires.next().toDate()\n const middle = new Date((start.getTime() + end.getTime()) / 2)\n const later = new Set(schedule.dueBetween(middle, end))\n const often = schedule.dueBetween(start, middle).filter((event) => later.has(event))\n const plan = cron === undefined ? \" (once a day on Vercel's Hobby plan)\" : ''\n return {\n crons: [{ path: SCHEDULE_PATH, schedule: expression }],\n cronWarnings: often.map((event) => `\"${event.getSummaryForDisplay()}\" (${event.expression}) is due more often than the cron \"${expression}\", so it runs once per trigger${plan}.`),\n }\n}\n\n/**\n * Copies the app's production dependencies (its `dependencies`, and `tsx`, which the launcher uses) with everything\n * they depend on, found as Node finds them. A package needed in two versions keeps the first at the top and nests the\n * other under the package that needs it.\n */\nasync function copyDependencies(base: string, fn: string): Promise<void> {\n const manifest = JSON.parse(readFileSync(join(base, 'package.json'), 'utf8')) as { dependencies?: Record<string, string> }\n const topLevel = new Map<string, string>()\n const copied = new Set<string>()\n\n const visit = async (name: string, from: string, into: string): Promise<void> => {\n const found = locate(name, from)\n if (found === undefined) return\n const real = realpathSync(found)\n let destination = join(fn, 'node_modules', name)\n const top = topLevel.get(name)\n if (top === undefined) topLevel.set(name, real)\n else if (top !== real) destination = join(into, name)\n if (copied.has(destination)) return\n copied.add(destination)\n await cp(real, destination, {\n recursive: true,\n dereference: true,\n filter: (source) => source === real || !['node_modules', '.bin', '.git'].includes(basename(source)),\n })\n const pkg = JSON.parse(readFileSync(join(real, 'package.json'), 'utf8')) as { dependencies?: Record<string, string>; optionalDependencies?: Record<string, string> }\n for (const dependency of [...Object.keys(pkg.dependencies ?? {}), ...Object.keys(pkg.optionalDependencies ?? {})]) {\n await visit(dependency, real, join(destination, 'node_modules'))\n }\n }\n\n for (const name of [...Object.keys(manifest.dependencies ?? {}), 'tsx']) await visit(name, base, join(fn, 'node_modules'))\n}\n\n/** Where Node finds a package from a folder: `node_modules/<name>` in it or any folder above it. */\nfunction locate(name: string, from: string): string | undefined {\n for (let dir = from; ; dir = dirname(dir)) {\n const candidate = basename(dir) === 'node_modules' ? join(dir, name) : join(dir, 'node_modules', name)\n if (existsSync(join(candidate, 'package.json'))) return candidate\n if (dirname(dir) === dir) return undefined\n }\n}\n\nfunction sizeOf(folder: string): number {\n return readdirSync(folder, { withFileTypes: true, recursive: true })\n .filter((entry) => entry.isFile())\n .reduce((total, entry) => total + statSync(join(entry.parentPath, entry.name)).size, 0)\n}\n\nfunction countFiles(folder: string): number {\n return readdirSync(folder, { withFileTypes: true, recursive: true }).filter((entry) => entry.isFile()).length\n}\n\nconst megabytes = (bytes: number) => `${(bytes / 1024 / 1024).toFixed(1)} MB`\n","import { timingSafeEqual } from 'node:crypto'\nimport { inject } from '@orieljs/container'\nimport { CacheManager, ConsoleKernel, ExceptionHandler, Schedule } from '@orieljs/contracts'\nimport { CronExpressionParser } from 'cron-parser'\n\n/** Where Vercel's cron calls the app; `oriel vercel:build` puts it in the cron entry. */\nexport const SCHEDULE_PATH = '/_oriel/schedule'\n\n/** The cron `vercel:build` writes by default: daily at 03:00 UTC (Hobby runs a cron at most once a day). */\nexport const DEFAULT_CRON = '0 3 * * *'\n\nconst LAST_RUN = 'oriel:vercel:schedule:last'\nconst LOCK = 'oriel:vercel:schedule'\n\nconst json = (body: unknown, status = 200) => Response.json(body, { status, headers: { 'cache-control': 'no-store' } })\n\n/** Vercel sends `Authorization: Bearer <CRON_SECRET>`; compared in constant time. */\nfunction authorized(header: string | undefined, secret: string): boolean {\n const expected = Buffer.from(`Bearer ${secret}`)\n const given = Buffer.from(header ?? '')\n return given.length === expected.length && timingSafeEqual(given, expected)\n}\n\n/**\n * Where a trigger with no record starts: the trigger's fire time before the current one, so the first trigger covers\n * one full period, as every later one does (for a daily cron, yesterday's run time to now).\n */\nexport function previousTrigger(expression: string, now: Date): Date {\n const parsed = CronExpressionParser.parse(expression, { currentDate: new Date(now.getTime() + 60_000), tz: 'UTC' })\n parsed.prev()\n return parsed.prev().toDate()\n}\n\n/**\n * What Vercel's cron calls. Off (404) without `CRON_SECRET`; 401 for any other bearer token. Otherwise, holding a lock\n * so a doubled call runs nothing twice, it loads the app's schedule (a web request never has: routes/console.ts is the\n * console's) and runs every task due since the previous trigger, once each. A failing task is reported and counted,\n * and never stops the rest; the trigger is recorded either way. 200 `{ ran, failed: 0 }`, or 500 when any failed.\n */\nexport async function runVercelSchedule(authorization: string | undefined, options: { now?: () => Date; trigger?: string } = {}): Promise<Response> {\n const secret = process.env.CRON_SECRET\n if (!secret) return new Response('Not Found', { status: 404 })\n if (!authorized(authorization, secret)) return json({ error: 'Unauthorized' }, 401)\n\n const cache = inject(CacheManager)\n const lock = cache.lock(LOCK, 900)\n if (!(await lock.get())) return json({ ran: 0, failed: 0, skipped: 'busy' })\n try {\n await inject(ConsoleKernel).bootstrap()\n const now = options.now?.() ?? new Date()\n const last = await cache.get<string>(LAST_RUN)\n const from = last === undefined ? previousTrigger(options.trigger ?? process.env.ORIEL_VERCEL_CRON ?? DEFAULT_CRON, now) : new Date(last)\n const due = inject(Schedule).dueBetween(from, now)\n let failed = 0\n for (const event of due) {\n try {\n await event.run()\n } catch (error) {\n failed++\n await inject(ExceptionHandler).report(error)\n }\n }\n await cache.forever(LAST_RUN, now.toISOString())\n return json({ ran: due.length, failed }, failed > 0 ? 500 : 200)\n } finally {\n await lock.release()\n }\n}\n","/**\n * The function's entry (`index.mjs` in `.vercel/output/functions/index.func`): registers tsx as the app's `oriel`\n * file does, boots the app once per function instance, and hands each request to the Node request handler `serve`\n * uses. Public files never reach it: Vercel serves them from `static/`. A boot that fails answers a plain 500, logs\n * the error, and is tried again on the next request. Logs go to stderr unless `LOG_CHANNEL` is set, since the\n * function can't write files, and Vercel's proxy is trusted unless the app lists its own.\n */\nexport const LAUNCHER = `// Oriel on Vercel: boots the app once per function instance and hands it each request.\nimport { fileURLToPath } from 'node:url'\n\nlet ready\n\nasync function boot() {\n // Vercel's disk is read-only, so a log file can't open; stderr is what Vercel's log view shows.\n process.env.LOG_CHANNEL ??= 'stderr'\n if (!process.versions.bun) {\n const { register } = await import('tsx/esm/api')\n register({ tsconfig: fileURLToPath(new URL('./tsconfig.json', import.meta.url)) })\n }\n const { createApplication } = await import('./bootstrap/app.ts')\n const { nodeRequestHandler } = await import('@orieljs/framework')\n const { ConfigRepository } = await import('@orieljs/framework/contracts')\n const app = await createApplication()\n await app.boot()\n // Every request comes through Vercel's proxy, which sets the X-Forwarded-* headers itself: trust it, unless the app\n // lists its own proxies, so that URLs keep the browser's https and ip() is the visitor's.\n const config = app.make(ConfigRepository)\n const proxies = config.get('http.trusted_proxies', [])\n if (proxies === undefined || proxies === null || proxies.length === 0) config.set('http.trusted_proxies', '*')\n return nodeRequestHandler(app, { fallbackHost: 'localhost' })\n}\n\nexport default async function handler(req, res) {\n let handle\n try {\n ready ??= boot()\n handle = await ready\n } catch (error) {\n ready = undefined\n console.error(error)\n if (!res.headersSent) {\n res.statusCode = 500\n res.setHeader('content-type', 'text/plain; charset=utf-8')\n }\n res.end('Internal Server Error')\n return\n }\n await handle(req, res)\n}\n`\n","import { inject } from '@orieljs/container'\nimport { ConsoleKernel, HttpRequest, Router, type CommandContext } from '@orieljs/contracts'\nimport { ServiceProvider } from '@orieljs/support'\nimport { buildVercelOutput } from './build'\nimport { runVercelSchedule, SCHEDULE_PATH } from './cron'\n\nconst megabytes = (bytes: number) => `${(bytes / 1024 / 1024).toFixed(1)} MB`\n\n/** Registers `oriel vercel:build`, which writes Vercel's build output for the app, and the route Vercel Cron calls. */\nexport class VercelServiceProvider extends ServiceProvider {\n override boot(): void {\n // No `web` middleware: a cron call has no session or CSRF token; CRON_SECRET guards it.\n if (this.app.bound(Router)) {\n this.app\n .make(Router)\n .get(SCHEDULE_PATH, () => {\n const request = inject(HttpRequest)\n return runVercelSchedule(request.header('authorization'), { trigger: request.header('x-vercel-cron-schedule') })\n })\n .name('vercel.schedule')\n }\n if (!this.app.bound(ConsoleKernel)) return\n const app = this.app\n this.app\n .make(ConsoleKernel)\n .command('vercel:build {--cron= : When Vercel calls the scheduler, as a cron expression (UTC), or false for never}', async function (this: CommandContext) {\n try {\n const option = this.option('cron')\n const cron = typeof option === 'string' && option !== '' ? (option === 'false' ? false : option) : undefined\n const { staticFiles, functionBytes, warnings } = await buildVercelOutput(app, { cron })\n const files = staticFiles === 1 ? '1 static file' : `${staticFiles} static files`\n this.info(`Wrote .vercel/output: ${files}, a function of ${megabytes(functionBytes)}.`)\n for (const warning of warnings) this.warn(warning)\n return 0\n } catch (error) {\n this.error(error instanceof Error ? error.message : String(error))\n return 1\n }\n })\n .purpose(\"Write Vercel's build output (.vercel/output) for the application\")\n }\n}\n"],"mappings":";AAAA,SAAS,YAAY,aAAa,cAAc,cAAc,gBAAgB;AAC9E,SAAS,IAAI,OAAO,IAAI,iBAAiB;AACzC,SAAS,UAAU,SAAS,MAAM,UAAU,eAAe;AAC3D,SAAS,iBAAAA,gBAAe,YAAAC,iBAAkC;AAC1D,SAAS,qBAAqB;AAC9B,SAAS,wBAAAC,6BAA4B;;;ACLrC,SAAS,uBAAuB;AAChC,S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AW,KAAM,WAAW,UAAU,QAAQ,SAAU;AACnG,cAAM,EAAE,aAAa,eAAe,SAAS,IAAI,MAAM,kBAAkB,KAAK,EAAE,KAAK,CAAC;AACtF,cAAM,QAAQ,gBAAgB,IAAI,kBAAkB,GAAG,WAAW;AAClE,aAAK,KAAK,yBAAyB,KAAK,mBAAmBF,WAAU,aAAa,CAAC,GAAG;AACtF,mBAAW,WAAW,SAAU,MAAK,KAAK,OAAO;AACjD,eAAO;AAAA,MACT,SAAS,OAAO;AACd,aAAK,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AACjE,eAAO;AAAA,MACT;AAAA,IACF,CAAC,EACA,QAAQ,kEAAkE;AAAA,EAC/E;AACF;","names":["ConsoleKernel","Schedule","CronExpressionParser","ConsoleKernel","Schedule","CronExpressionParser","inject","ConsoleKernel","megabytes","inject","ConsoleKernel"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orieljs/vercel",
3
- "version": "0.1.0-alpha.14",
3
+ "version": "0.1.0-alpha.15",
4
4
  "description": "Deploy an Oriel app to Vercel: oriel vercel:build writes Vercel's build output, with the app as a Node function.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -32,9 +32,9 @@
32
32
  ],
33
33
  "dependencies": {
34
34
  "cron-parser": "5.10.1",
35
- "@orieljs/contracts": "0.1.0-alpha.14",
36
- "@orieljs/support": "0.1.0-alpha.14",
37
- "@orieljs/container": "0.1.0-alpha.14"
35
+ "@orieljs/contracts": "0.1.0-alpha.15",
36
+ "@orieljs/support": "0.1.0-alpha.15",
37
+ "@orieljs/container": "0.1.0-alpha.15"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "tsup && node ../../../scripts/copy-license.mjs"