{"version":3,"file":"run-BoO7H8RA.cjs","names":["trackRun","process","memoryStorage","createKubb","isOutdated","version","Diagnostics","styleText","pluralize","formatMs","logLevelMap","Hookable","cliReporter","createPlainWriter","logBanner","getConfigs","createSpinner","path","jsonReporter","fileReporter","htmlReporter","selectReporters","trackBuild","getInputKind","diffBuilds","getElapsedMs","listenForKeys","startWatcher","logInfo","logError"],"sources":["../src/runners/generate/run.ts"],"sourcesContent":["import path from 'node:path'\nimport process from 'node:process'\nimport { styleText } from 'node:util'\nimport { formatMs, formatters, getElapsedMs, linters } from '@internals/utils'\nimport {\n  Hookable,\n  type CLIOptions,\n  cliReporter,\n  type Config,\n  createKubb,\n  Diagnostics,\n  fileReporter,\n  getInputKind,\n  htmlReporter,\n  jsonReporter,\n  type KubbHooks,\n  logLevel as logLevelMap,\n  memoryStorage,\n  type ReporterName,\n} from '@kubb/core'\nimport { version } from '../../../package.json'\nimport { trackRun } from '../../Telemetry.ts'\nimport { pluralize } from '../../ui/text.ts'\nimport setupReporters, { selectReporters } from '../../loggers/reporters.ts'\nimport { createPlainWriter } from '../../loggers/plainWriter.ts'\nimport { logIntro, logOutro, logSpacer, logTip } from '../../ui/intro.ts'\nimport { logError, logInfo, logStep, logWarn } from '../../ui/log.ts'\nimport { logBanner } from '../../ui/mascot.ts'\nimport { createSpinner } from '../../ui/spinner.ts'\nimport { getConfigs } from '../../config.ts'\nimport { isOutdated } from '../../utils/registry.ts'\nimport { type BuildDiff, type BuildSnapshot, diffBuilds, listenForKeys, startWatcher, trackBuild } from './utils.ts'\n\n/** NPM registry endpoint used to check for @kubb/cli updates. */\nconst KUBB_NPM_PACKAGE_URL = 'https://registry.npmjs.org/@kubb/cli/latest' as const\n\n/** Upper bound in milliseconds for the npm update check, so a slow registry never stalls a run. */\nconst UPDATE_CHECK_TIMEOUT_MS = 3_000\n\n/** The formatter names from `Config['output'].format`, without `'auto'` (detection, not a tool) and `false` (skip). */\ntype FormatterName = Exclude<NonNullable<Config['output']['format']>, 'auto' | false>\ntype LinterName = Exclude<NonNullable<Config['output']['lint']>, 'auto' | false>\n\n// Pinned here, not in `@internals/utils` (which must not import `@kubb/core`): a tool added to the union without a descriptor fails to compile.\nformatters satisfies Record<FormatterName, unknown>\nlinters satisfies Record<LinterName, unknown>\n\ntype GenerateProps = {\n  input?: string\n  config: Config\n  hooks: Hookable<KubbHooks>\n  /**\n   * When `true`, generates in memory instead of writing to disk, skips formatting, linting, and\n   * post-generate commands, and prints what would change on disk.\n   */\n  dryRun?: boolean\n}\n\nexport async function generate(options: GenerateProps): Promise<boolean> {\n  const { input, hooks, dryRun = false } = options\n\n  const report = trackRun({ command: 'generate', hrStart: process.hrtime() })\n\n  const config: Config = {\n    ...options.config,\n    input: input ?? options.config.input,\n    // Dry-run never touches disk, regardless of the config's own storage driver.\n    storage: dryRun ? memoryStorage() : options.config.storage,\n    // Also keeps core's `hasOutputPasses` false, so dry-run skips the output manifest write too.\n    output: dryRun ? { ...options.config.output, format: false, lint: false, postGenerate: [] } : options.config.output,\n  }\n\n  // Core formats, lints and runs `output.postGenerate` after an error-free build, and reports\n  // their failures as coded diagnostics that reach the summary, the json report and the exit code.\n  const kubb = createKubb(config, { hooks })\n  const result = await kubb.generate()\n\n  // Not awaited: the request finishes in the background, capped by its timeout, so it never delays the summary.\n  void report({\n    // A setup that threw leaves no driver, so read the configured plugins instead.\n    plugins: kubb.config.plugins.flatMap((p) =>\n      p && typeof p === 'object' ? [{ name: p.meta?.name ?? p.name ?? '', options: (p.options ?? {}) as Record<string, unknown> }] : [],\n    ),\n    filesCreated: result.files.length,\n    status: result.success ? 'success' : 'failed',\n  })\n\n  return result.success\n}\n\ntype GenerateCommandOptions = {\n  input?: string\n  configPath?: string\n  logLevel: string\n  watch: boolean\n  reporters?: Array<ReporterName>\n  dryRun?: boolean\n}\n\n/** The latest published version, `undefined` when the registry does not answer in time or `signal` aborts. Never rejects. */\nasync function fetchLatestVersion(signal: AbortSignal): Promise<string | undefined> {\n  try {\n    const res = await fetch(KUBB_NPM_PACKAGE_URL, { signal: AbortSignal.any([signal, AbortSignal.timeout(UPDATE_CHECK_TIMEOUT_MS)]) })\n    const data = (await res.json()) as { version: string }\n    return data.version\n  } catch {\n    // Ignore network errors\n    return undefined\n  }\n}\n\nasync function checkForUpdate({ hooks, latestVersion }: { hooks: Hookable<KubbHooks>; latestVersion: string | undefined }): Promise<void> {\n  if (latestVersion && isOutdated({ installed: version, latest: latestVersion })) {\n    await Diagnostics.emit(hooks, Diagnostics.update({ currentVersion: version, latestVersion }))\n  }\n}\n\n/** Prints `Rebuilt in 1.2s · +1 schema -2 operations`, without the names part when the spec kept the same names. */\nfunction logRebuild({ diff: { schemas, operations }, durationMs }: { diff: BuildDiff; durationMs: number }): void {\n  const specChange = [\n    schemas.added && styleText('green', `+${pluralize(schemas.added, 'schema')}`),\n    schemas.removed && styleText('red', `-${pluralize(schemas.removed, 'schema')}`),\n    operations.added && styleText('green', `+${pluralize(operations.added, 'operation')}`),\n    operations.removed && styleText('red', `-${pluralize(operations.removed, 'operation')}`),\n  ]\n    .filter(Boolean)\n    .join(' ')\n  logStep([`Rebuilt in ${formatMs(durationMs)}`, specChange].filter(Boolean).join(styleText('dim', ' · ')))\n}\n\n/**\n * Runs the full Kubb generation lifecycle for the given CLI options.\n * Loads configs, sets up the reporters (CLI `--reporter` picks which of `config.reporters` to trigger),\n * calls `generate` for each config entry, and prints an update notice when the registry answered in time.\n */\nexport async function run({ input, configPath, logLevel: logLevelKey, watch, reporters: cliReporters, dryRun }: GenerateCommandOptions): Promise<void> {\n  // Started first and never awaited: the notice prints at the end only when the registry has answered by then.\n  const updateCheck = new AbortController()\n  let latestVersion: string | undefined\n  void fetchLatestVersion(updateCheck.signal).then((value) => {\n    latestVersion = value\n  })\n  const logLevel = logLevelMap[logLevelKey as keyof typeof logLevelMap] ?? logLevelMap.info\n  const hooks = new Hookable<KubbHooks>()\n\n  // CLI `--reporter` selects which reporters to trigger by name, defaulting to `cli`. `defineConfig`\n  // registers the built-in reporters on the config; a config exported without it falls back to them below.\n  const requestedNames: Array<ReporterName> = cliReporters?.length ? cliReporters : ['cli']\n\n  // The `json` reporter owns stdout, so the command writes nothing of its own around it.\n  const json = requestedNames.includes('json')\n  const quiet = logLevel <= logLevelMap.silent || json\n\n  // Errors raised outside a build have no report entry. In `json` mode they go to a stderr logger,\n  // so they are never silent and stdout stays one JSON document.\n  const errorHooks = json ? new Hookable<KubbHooks>() : hooks\n  if (json) setupReporters(errorHooks, { logLevel, reporters: [cliReporter], writer: createPlainWriter(console.error) })\n\n  // The config loads while the banner plays; the output still prints in order once the banner is done.\n  const banner = quiet ? undefined : logBanner(version)\n  const loading = getConfigs({\n    configPath,\n    input,\n    watch,\n    logLevel: logLevelKey as CLIOptions['logLevel'],\n  })\n  // Handled below; this keeps a rejection during the banner from counting as unhandled.\n  loading.catch(() => undefined)\n  await banner\n\n  if (!quiet) {\n    logIntro({ title: 'Configuration' })\n  }\n\n  // Load the config first so `config.reporters` can pick the reporters. A failure here has no\n  // reporter installed yet, so fall back to the default `cli` reporter to surface it.\n  const configSpinner = createSpinner()\n  let configs: Array<Config>\n  let resolvedConfigPath: string\n  try {\n    if (!quiet) configSpinner.start('Loading config')\n\n    const loaded = await loading\n    configs = loaded.configs\n    resolvedConfigPath = loaded.configPath\n\n    if (!quiet) configSpinner.stop(`Loaded ${styleText('dim', path.relative(process.cwd(), resolvedConfigPath))}`)\n  } catch (error) {\n    if (!quiet) configSpinner.error('Config failed loading')\n\n    if (!json) setupReporters(hooks, { logLevel, reporters: [cliReporter] })\n    // A diagnostic thrown while the config file runs, such as invalid extension options, sits in the cause chain.\n    await Diagnostics.emit(errorHooks, error)\n\n    if (!quiet) logOutro(styleText('red', '✗ Configuration failed'))\n    process.exit(1)\n  }\n\n  // Without a reporter nothing is printed, not even an error, so a config written without\n  // `defineConfig` gets the same built-ins it would have registered.\n  const available = configs[0]?.reporters?.length ? configs[0].reporters : [cliReporter, jsonReporter, fileReporter, htmlReporter]\n  const reporters = selectReporters(available, requestedNames)\n  setupReporters(hooks, { logLevel, reporters, dryRun })\n\n  await hooks.callHook('kubb:lifecycle:start', { version })\n\n  if (!quiet) logOutro(`${pluralize(configs.length, 'config')} ready`)\n\n  try {\n    let anyFailed = false\n    // One tracker, one key listener and one build queue serve every watched config, so several configs never mix diffs or answer `r` twice.\n    const tracker = watch ? trackBuild(hooks) : undefined\n    const rebuilds: Array<() => Promise<void>> = []\n    let armKeys: (() => void) | undefined\n    // Configs share the hooks emitter, so every build, from any watcher or the `r` key, waits for the one before it.\n    let queue = Promise.resolve()\n    for (const config of configs) {\n      const effectiveInput = input ?? config.input\n      const inputKind = typeof effectiveInput === 'string' ? getInputKind(effectiveInput) : undefined\n      const watchPath = inputKind === 'file' ? (effectiveInput as string) : undefined\n      if (watchPath && tracker) {\n        const label = styleText('yellow', `Watching ${path.relative(process.cwd(), watchPath)}`)\n        let previous: BuildSnapshot | undefined\n        // Don't removeAll() between builds, that would also drop logger and lifecycle\n        // listeners. Plugin listeners are already disposed by safeBuild's dispose()\n        // in its finally block, so re-running generate() on the same hooks emitter is safe.\n        const build = async () => {\n          const hrStart = process.hrtime()\n          const succeeded = await generate({ input, config, hooks, dryRun })\n          const snapshot = tracker.take()\n          if (previous) logRebuild({ diff: diffBuilds(previous, snapshot), durationMs: getElapsedMs(hrStart) })\n          previous = snapshot\n\n          logStep(armKeys ? `${label}  ${styleText('dim', 'r rebuild · q quit')}` : label)\n          armKeys?.()\n          if (succeeded) {\n            logSpacer()\n            logTip()\n          }\n        }\n        // A trigger that lands while this config's build is queued joins it; one that lands during the build queues one more. Never rejects.\n        let pending = false\n        const rebuild = (): Promise<void> => {\n          if (pending) return queue\n          pending = true\n          queue = queue\n            .then(() => {\n              pending = false\n              return build()\n            })\n            .catch((error) => void Diagnostics.emit(errorHooks, error))\n          return queue\n        }\n        rebuilds.push(rebuild)\n        if (!quiet) {\n          armKeys ??= listenForKeys({\n            rebuild: () => rebuilds.forEach((trigger) => void trigger()),\n            quit: (code) => void Promise.resolve(hooks.callHook('kubb:lifecycle:end')).finally(() => process.exit(code)),\n          })\n        }\n\n        // The watcher ignores its startup state, so run the first build here; a failing one keeps watching so the user can fix the input.\n        await rebuild()\n\n        await startWatcher([watchPath], rebuild, { info: logInfo, error: logError })\n      } else {\n        if (tracker && !quiet) logWarn('Watch mode only follows a local `input` file, so this config is generated once.')\n        try {\n          const succeeded = await generate({ input, config, hooks, dryRun })\n          if (!succeeded) anyFailed = true\n        } catch (configError) {\n          await Diagnostics.emit(errorHooks, configError)\n          anyFailed = true\n        }\n      }\n    }\n\n    // A request still in flight would keep the process alive until its timeout.\n    updateCheck.abort()\n    await checkForUpdate({ hooks, latestVersion })\n\n    await hooks.callHook('kubb:lifecycle:end')\n\n    // Watch mode prints a tip after each successful build. Regular generate commands need to\n    // print one explicitly after the lifecycle group has closed so it stays outside the group.\n    if (!quiet && !watch && !anyFailed) {\n      logTip()\n    }\n\n    // `exitCode`, not `exit()`, so a telemetry request still in flight can finish within its timeout.\n    if (anyFailed) {\n      process.exitCode = 1\n    }\n  } catch (error) {\n    await Diagnostics.emit(errorHooks, error)\n    process.exit(1)\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkCA,MAAM,uBAAuB;;AAG7B,MAAM,0BAA0B;AAqBhC,eAAsB,SAAS,SAA0C;CACvE,MAAM,EAAE,OAAO,OAAO,SAAS,UAAU;CAEzC,MAAM,SAASA,kBAAAA,SAAS;EAAE,SAAS;EAAY,SAASC,aAAAA,QAAQ,OAAO;CAAE,CAAC;CAE1E,MAAM,SAAiB;EACrB,GAAG,QAAQ;EACX,OAAO,SAAS,QAAQ,OAAO;EAE/B,SAAS,UAAA,GAASC,WAAAA,cAAAA,CAAc,IAAI,QAAQ,OAAO;EAEnD,QAAQ,SAAS;GAAE,GAAG,QAAQ,OAAO;GAAQ,QAAQ;GAAO,MAAM;GAAO,cAAc,CAAC;EAAE,IAAI,QAAQ,OAAO;CAC/G;CAIA,MAAM,QA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