{"version":3,"sources":["../../src/bin/next.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport '../server/require-hook'\n\nimport os from 'os'\nimport {\n  Argument,\n  Command,\n  InvalidArgumentError,\n  Option,\n} from 'next/dist/compiled/commander'\n\nimport { warn } from '../build/output/log'\nimport semver from 'next/dist/compiled/semver'\nimport { bold, cyan, italic } from '../lib/picocolors'\nimport { formatCliHelpOutput } from '../lib/format-cli-help-output'\nimport { NON_STANDARD_NODE_ENV } from '../lib/constants'\nimport {\n  getParsedDebugAddress,\n  parseValidPositiveInteger,\n  type DebugAddress,\n} from '../server/lib/utils'\nimport {\n  SUPPORTED_TEST_RUNNERS_LIST,\n  type NextTestOptions,\n} from '../cli/next-test.js'\nimport type { NextTelemetryOptions } from '../cli/next-telemetry.js'\nimport type { NextStartOptions } from '../cli/next-start.js'\nimport type { NextInfoOptions } from '../cli/next-info.js'\nimport type { NextDevOptions } from '../cli/next-dev.js'\nimport type {\n  NextAnalyzeOptions,\n  NextAnalyzeExportOptions,\n} from '../cli/next-analyze.js'\nimport type { NextBuildOptions } from '../cli/next-build.js'\nimport type { NextTypegenOptions } from '../cli/next-typegen.js'\nimport type { NextPostBuildOptions } from '../cli/next-post-build.js'\nimport { ensureProfilesDir } from '../lib/profiles-dir'\nimport type { NextRequestInsightsOptions } from '../cli/next-request-insights.js'\n\n/**\n * Create `.next-profiles` (with its `.gitignore`) when profiling/tracing is\n * enabled — whether via the CLI flags or the env vars directly — so the\n * gitignore logic lives in one place. Also points CPU profiles at the directory.\n * Skipped for tracing when `NEXT_TURBOPACK_TRACING_PATH` redirects the output.\n */\nfunction setupProfilesDir(dir: string): void {\n  const cpuProf = !!process.env.NEXT_CPU_PROF\n  const turbopackTrace =\n    !!process.env.NEXT_TURBOPACK_TRACING &&\n    !process.env.NEXT_TURBOPACK_TRACING_PATH\n  if (!cpuProf && !turbopackTrace) {\n    return\n  }\n  const profilesDir = ensureProfilesDir(dir)\n  if (cpuProf) {\n    process.env.NEXT_CPU_PROF_DIR = profilesDir\n  }\n}\n\nif (process.env.NEXT_RSPACK) {\n  // silent rspack's schema check\n  process.env.RSPACK_CONFIG_VALIDATE = 'loose-silent'\n}\n\nif (\n  !semver.satisfies(\n    process.versions.node,\n    process.env.__NEXT_REQUIRED_NODE_VERSION_RANGE!,\n    { includePrerelease: true }\n  )\n) {\n  console.error(\n    `You are using Node.js ${process.versions.node}. For Next.js, Node.js version \"${process.env.__NEXT_REQUIRED_NODE_VERSION_RANGE}\" is required.`\n  )\n  process.exit(1)\n}\n\nprocess.env.NEXT_PRIVATE_START_TIME = Date.now().toString()\n\nclass NextRootCommand extends Command {\n  createCommand(name: string) {\n    const command = new Command(name)\n\n    command.hook('preAction', (event) => {\n      const commandName = event.name()\n      const defaultEnv = commandName === 'dev' ? 'development' : 'production'\n      const standardEnv = ['production', 'development', 'test']\n      // `next build` reruns itself as a child to show the upgrade menu. The\n      // parent already warned, and it sets NODE_ENV for --debug-prerender.\n      const isUpgradeBuildChild =\n        process.env.NEXT_PRIVATE_UPGRADE_BUILD_CHILD === '1'\n\n      if (process.env.NODE_ENV && !isUpgradeBuildChild) {\n        const isNotStandard = !standardEnv.includes(process.env.NODE_ENV)\n        const shouldWarnCommands =\n          process.env.NODE_ENV === 'development'\n            ? ['start', 'build']\n            : process.env.NODE_ENV === 'production'\n              ? ['dev']\n              : []\n\n        if (isNotStandard || shouldWarnCommands.includes(commandName)) {\n          warn(NON_STANDARD_NODE_ENV)\n        }\n      }\n\n      // The upgrade harness may run both dev and production checks. Preserve\n      // its caller's environment instead of forcing all child commands into\n      // production mode merely because they were launched through this CLI.\n      if (commandName !== 'upgrade' || !event.getOptionValue('agent')) {\n        ;(process.env as any).NODE_ENV = process.env.NODE_ENV || defaultEnv\n        ;(process.env as any).NEXT_RUNTIME = 'nodejs'\n      }\n\n      if (\n        !isUpgradeBuildChild &&\n        process.platform === 'darwin' &&\n        process.arch === 'x64' &&\n        os.cpus().some((cpu) => cpu.model.includes('Apple'))\n      ) {\n        warn(\n          'You are running Next.js on an Apple Silicon Mac with Rosetta 2 ' +\n            'translation, which may cause degraded performance. You may have ' +\n            'accidentally installed an x86-64 version of Node.js.'\n        )\n      }\n\n      if (\n        commandName !== 'dev' &&\n        commandName !== 'start' &&\n        event.getOptionValue('inspect') === true\n      ) {\n        console.error(\n          `\\`--inspect\\` flag is deprecated. Use env variable NODE_OPTIONS instead: NODE_OPTIONS='--inspect' next ${commandName}`\n        )\n        process.exit(1)\n      }\n    })\n\n    return command\n  }\n}\n\nfunction parseValidInspectAddress(value: string): DebugAddress {\n  const address = getParsedDebugAddress(value)\n\n  if (Number.isNaN(address.port)) {\n    throw new InvalidArgumentError(\n      'The given value is not a valid inspect address. ' +\n        'Did you mean to pass an app path?\\n' +\n        `Try switching the order of the arguments or set the default address explicitly e.g.\\n` +\n        `next dev ${value} --inspect\\n` +\n        `next dev --inspect= ${value}`\n    )\n  }\n\n  return address\n}\n\nconst program = new NextRootCommand()\n\n// Commander needs positional options on both ancestors (program and analyze)\n// to keep identically named capture/export flags local after the subcommand.\n// Leave option parsing for the rest of the CLI unchanged.\nprogram.enablePositionalOptions(\n  process.argv[2] === 'analyze' || process.argv[2] === 'experimental-analyze'\n)\n\nprogram\n  .name('next')\n  .description(\n    'The Next.js CLI allows you to develop, build, start your application, and more.'\n  )\n  .configureHelp({\n    formatHelp: (cmd, helper) => formatCliHelpOutput(cmd, helper),\n    subcommandTerm: (cmd) => `${cmd.name()} ${cmd.usage()}`,\n  })\n  .helpCommand(false)\n  .helpOption('-h, --help', 'Displays this message.')\n  .version(\n    `Next.js v${process.env.__NEXT_VERSION}`,\n    '-v, --version',\n    'Outputs the Next.js version.'\n  )\n\nprogram\n  .command('build')\n  .description(\n    'Creates an optimized production build of your application. The output displays information about each route.'\n  )\n  .argument(\n    '[directory]',\n    `A directory on which to build the application. ${italic(\n      'If no directory is provided, the current directory will be used.'\n    )}`\n  )\n  .option('--analyze', 'Analyze bundle output. Only compatible with Turbopack.')\n  .addOption(new Option('--experimental-analyze').hideHelp())\n  .option('-d, --debug', 'Enables a more verbose build output.')\n  .option(\n    '--debug-prerender',\n    'Enables debug mode for prerendering. Not for production use!'\n  )\n  .option('--no-mangling', 'Disables mangling.')\n  .option('--profile', 'Enables production profiling for React.')\n  .option('--experimental-app-only', 'Builds only App Router routes.')\n  .option('--turbo', 'Builds using Turbopack.')\n  .option('--turbopack', 'Builds using Turbopack.')\n  .option('--webpack', 'Builds using webpack.')\n  .addOption(\n    new Option(\n      '--experimental-build-mode [mode]',\n      'Uses an experimental build mode.'\n    )\n      .choices(['compile', 'generate', 'generate-env'])\n      .default('default')\n  )\n  .option(\n    '--experimental-debug-memory-usage',\n    'Enables memory profiling features to debug memory consumption.'\n  )\n  .option(\n    '--experimental-upload-trace, <traceUrl>',\n    'Reports a subset of the debugging trace to a remote HTTP URL. Includes sensitive data.'\n  )\n  .option(\n    '--experimental-next-config-strip-types',\n    'Use Node.js native TypeScript resolution for next.config.(ts|mts)'\n  )\n  .option(\n    '--debug-build-paths <patterns>',\n    'Comma-separated glob patterns or explicit paths for selective builds. Use \"!\" prefix to exclude. Examples: \"app/*\", \"app/page.tsx\", \"app/**/page.tsx\", \"app/**,!app/[slug]/**\"'\n  )\n  .option(\n    '--experimental-cpu-prof',\n    'Enable CPU profiling. Profile is saved to .next-profiles/ on exit.'\n  )\n  .addOption(\n    new Option(\n      '--internal-trace [level]',\n      'Enable Turbopack tracing. \"all\" (default) enables turbo-tasks level tracing, \"overview\" enables overview tracing.'\n    )\n      .choices(['all', 'overview'])\n      .preset('all')\n  )\n  .action((directory: string, options: NextBuildOptions) => {\n    if (options.debugPrerender) {\n      // @ts-expect-error not readonly\n      process.env.NODE_ENV = 'development'\n    }\n    if (options.experimentalNextConfigStripTypes) {\n      process.env.__NEXT_NODE_NATIVE_TS_LOADER_ENABLED = 'true'\n    }\n    if (options.experimentalCpuProf) {\n      process.env.NEXT_CPU_PROF = '1'\n      process.env.__NEXT_PRIVATE_CPU_PROFILE = 'build-main'\n    }\n    if (options.internalTrace) {\n      process.env.NEXT_TURBOPACK_TRACING =\n        options.internalTrace === 'all'\n          ? 'turbo-tasks'\n          : String(options.internalTrace)\n    }\n    setupProfilesDir(directory || process.cwd())\n\n    // ensure process exits after build completes so open handles/connections\n    // don't cause process to hang\n    return import('../cli/next-build.js').then((mod) =>\n      mod.nextBuild(options, directory).then(async () => {\n        // Save CPU profile before exiting if enabled\n        if (options.experimentalCpuProf) {\n          await mod.saveCpuProfile()\n        }\n        process.exit(0)\n      })\n    )\n  })\n  .usage('[directory] [options]')\n\nconst analyzeCommand = program\n  .command('analyze')\n  .alias('experimental-analyze')\n  .enablePositionalOptions()\n  .version(program.version()!, '-v, --version', 'Outputs the Next.js version.')\n  .description(\n    'Analyze production bundle output with an interactive web ui. Does not produce an application build. Only compatible with Turbopack.'\n  )\n  .argument(\n    '[directory]',\n    `A directory on which to analyze the application. ${italic(\n      'If no directory is provided, the current directory will be used.'\n    )}`\n  )\n  .option('--no-mangling', 'Disables mangling.')\n  .option('--profile', 'Enables production profiling for React.')\n  .option('--experimental-app-only', 'Analyzes only App Router routes.')\n  .option(\n    '--snapshot <name>',\n    'Save a named snapshot, replacing an existing capture with that name.'\n  )\n  .option(\n    '-o, --output',\n    'Only write analysis files to disk. Does not start the server.'\n  )\n  .addOption(\n    new Option(\n      '--port <port>',\n      'Specify a port number to serve the analyzer on.'\n    )\n      .implies({ serve: true })\n      .argParser(parseValidPositiveInteger)\n      .default(4000)\n      .env('PORT')\n  )\n  .action((directory: string, options: NextAnalyzeOptions) => {\n    const { nextAnalyze } =\n      require('../cli/next-analyze.js') as typeof import('../cli/next-analyze.js')\n    return nextAnalyze(options, directory)\n      .then(() => {\n        if (options.output) {\n          // The Next.js process is held open by something on the event loop. Exit manually like the `build` command does.\n          // TODO: Fix the underlying issue so this is not necessary.\n          process.exit(0)\n        }\n      })\n      .catch((error) => {\n        console.error(error)\n        process.exit(1)\n      })\n  })\n\nanalyzeCommand\n  .command('export')\n  .version(program.version()!, '-v, --version', 'Outputs the Next.js version.')\n  .description(\n    'Stream a saved analyzer graph as JSON Lines without building or serving.'\n  )\n  .argument(\n    '[directory]',\n    `The application directory containing the saved analysis. ${italic(\n      'If no directory is provided, the current directory will be used.'\n    )}`\n  )\n  .option(\n    '--snapshot <name>',\n    'Select a saved snapshot by name (defaults to latest).'\n  )\n  .option('--route <route>', 'Filter graph records to a route.')\n  .option(\n    '--dist-dir <directory>',\n    'Read from an explicitly chosen build directory (defaults to .next).'\n  )\n  .action(async (directory: string, options: NextAnalyzeExportOptions) => {\n    try {\n      // Reject explicit capture/server options before the subcommand, but\n      // ignore defaults and inherited PORT. Options after export are local.\n      const captureOptions = [\n        ['output', '--output'],\n        ['profile', '--profile'],\n        ['experimentalAppOnly', '--experimental-app-only'],\n        ['mangling', '--no-mangling'],\n        ['port', '--port'],\n        ['snapshot', '--snapshot'],\n      ]\n      const offending = captureOptions\n        .filter(([key]) => analyzeCommand.getOptionValueSource(key) === 'cli')\n        .map(([, flag]) => flag)\n      if (offending.length > 0) {\n        throw new Error(\n          `next analyze export cannot use capture/server options before export: ${offending.join(', ')}`\n        )\n      }\n      const { nextAnalyzeExport } =\n        require('../cli/next-analyze.js') as typeof import('../cli/next-analyze.js')\n      nextAnalyzeExport(options, directory)\n      // The synchronous exporter has completed every fd write, including slow pipes.\n      process.exit(0)\n    } catch (error) {\n      console.error(error)\n      process.exit(1)\n    }\n  })\n\nprogram\n  .command('dev', { isDefault: true })\n  .description(\n    'Starts Next.js in development mode with hot-code reloading, error reporting, and more.'\n  )\n  .argument(\n    '[directory]',\n    `A directory on which to build the application. ${italic(\n      'If no directory is provided, the current directory will be used.'\n    )}`\n  )\n  .addOption(\n    new Option(\n      '--inspect [[host:]port]',\n      'Allows inspecting server-side code. See https://nextjs.org/docs/app/guides/debugging#server-side-code'\n    ).argParser(parseValidInspectAddress)\n  )\n  .option('--turbo', 'Starts development mode using Turbopack.')\n  .option('--turbopack', 'Starts development mode using Turbopack.')\n  .option('--webpack', 'Starts development mode using webpack.')\n  .addOption(\n    new Option(\n      '-p, --port <port>',\n      'Specify a port number on which to start the application.'\n    )\n      .argParser(parseValidPositiveInteger)\n      .default(3000)\n      .env('PORT')\n  )\n  .option(\n    '-H, --hostname <hostname>',\n    'Specify a hostname on which to start the application (default: 0.0.0.0).'\n  )\n  .option(\n    '--disable-source-maps',\n    \"Don't start the Dev server with `--enable-source-maps`.\",\n    false\n  )\n  .option(\n    '--experimental-https',\n    'Starts the server with HTTPS and generates a self-signed certificate.'\n  )\n  .option('--experimental-https-key, <path>', 'Path to a HTTPS key file.')\n  .option(\n    '--experimental-https-cert, <path>',\n    'Path to a HTTPS certificate file.'\n  )\n  .option(\n    '--experimental-https-ca, <path>',\n    'Path to a HTTPS certificate authority file.'\n  )\n  // `--server-fast-refresh` is hidden because it's the default behavior and\n  // only needs to be explicitly passed to override a\n  // `experimental.turbopackServerFastRefresh: false` in next.config. The\n  // `--no-server-fast-refresh` negation is the meaningful user-facing flag.\n  .addOption(new Option('--server-fast-refresh').default(undefined).hideHelp())\n  .addOption(\n    new Option('--no-server-fast-refresh', 'Disable server-side Fast Refresh')\n  )\n  .option(\n    '--experimental-upload-trace, <traceUrl>',\n    'Reports a subset of the debugging trace to a remote HTTP URL. Includes sensitive data.'\n  )\n  .option(\n    '--experimental-next-config-strip-types',\n    'Use Node.js native TypeScript resolution for next.config.(ts|mts)'\n  )\n  .option(\n    '--experimental-cpu-prof',\n    'Enable CPU profiling. Profiles are saved to .next-profiles/ on exit.'\n  )\n  .addOption(\n    new Option(\n      '--internal-trace [level]',\n      'Enable Turbopack tracing. \"all\" (default) enables turbo-tasks level tracing, \"overview\" enables overview tracing.'\n    )\n      .choices(['all', 'overview'])\n      .preset('all')\n  )\n  .action(\n    (directory: string, options: NextDevOptions, { _optionValueSources }) => {\n      if (options.experimentalNextConfigStripTypes) {\n        process.env.__NEXT_NODE_NATIVE_TS_LOADER_ENABLED = 'true'\n      }\n      if (options.experimentalCpuProf) {\n        process.env.NEXT_CPU_PROF = '1'\n        process.env.__NEXT_PRIVATE_CPU_PROFILE = 'dev-main'\n      }\n      if (options.internalTrace) {\n        process.env.NEXT_TURBOPACK_TRACING =\n          options.internalTrace === 'all'\n            ? 'turbo-tasks'\n            : String(options.internalTrace)\n      }\n      setupProfilesDir(directory || process.cwd())\n      const portSource = _optionValueSources.port\n      import('../cli/next-dev.js').then((mod) =>\n        mod.nextDev(options, portSource, directory)\n      )\n    }\n  )\n  .usage('[directory] [options]')\n\nprogram\n  .command('export', { hidden: true })\n  .action(() => import('../cli/next-export.js').then((mod) => mod.nextExport()))\n  .helpOption(false)\n\nprogram\n  .command('info')\n  .description(\n    'Prints relevant details about the current system which can be used to report Next.js bugs.'\n  )\n  .addHelpText(\n    'after',\n    `\\nLearn more: ${cyan('https://nextjs.org/docs/api-reference/cli#info')}`\n  )\n  .option('--verbose', 'Collects additional information for debugging.')\n  .action((options: NextInfoOptions) =>\n    import('../cli/next-info.js').then((mod) => mod.nextInfo(options))\n  )\n\nprogram\n  .command('start')\n  .description(\n    'Starts Next.js in production mode. The application should be compiled with `next build` first.'\n  )\n  .argument(\n    '[directory]',\n    `A directory on which to start the application. ${italic(\n      'If no directory is provided, the current directory will be used.'\n    )}`\n  )\n  .addOption(\n    new Option(\n      '-p, --port <port>',\n      'Specify a port number on which to start the application.'\n    )\n      .argParser(parseValidPositiveInteger)\n      .default(3000)\n      .env('PORT')\n  )\n  .option(\n    '-H, --hostname <hostname>',\n    'Specify a hostname on which to start the application (default: 0.0.0.0).'\n  )\n  .addOption(\n    new Option(\n      '--inspect [[host:]port]',\n      'Allows inspecting server-side code. See https://nextjs.org/docs/app/guides/debugging#server-side-code'\n    ).argParser(parseValidInspectAddress)\n  )\n  .addOption(\n    new Option(\n      '--keepAliveTimeout <keepAliveTimeout>',\n      'Specify the maximum amount of milliseconds to wait before closing inactive connections.'\n    ).argParser(parseValidPositiveInteger)\n  )\n  .option(\n    '--experimental-next-config-strip-types',\n    'Use Node.js native TypeScript resolution for next.config.(ts|mts)'\n  )\n  .option(\n    '--experimental-cpu-prof',\n    'Enable CPU profiling. Profiles are saved to .next-profiles/ on exit.'\n  )\n  .action((directory: string, options: NextStartOptions) => {\n    if (options.experimentalNextConfigStripTypes) {\n      process.env.__NEXT_NODE_NATIVE_TS_LOADER_ENABLED = 'true'\n    }\n    if (options.experimentalCpuProf) {\n      process.env.NEXT_CPU_PROF = '1'\n      process.env.__NEXT_PRIVATE_CPU_PROFILE = 'start-main'\n    }\n    setupProfilesDir(directory || process.cwd())\n    return import('../cli/next-start.js').then((mod) =>\n      mod.nextStart(options, directory)\n    )\n  })\n  .usage('[directory] [options]')\n\nprogram\n  .command('telemetry')\n  .description(\n    `Allows you to enable or disable Next.js' ${bold(\n      'completely anonymous'\n    )} telemetry collection.`\n  )\n  .addArgument(new Argument('[arg]').choices(['disable', 'enable', 'status']))\n  .addHelpText('after', `\\nLearn more: ${cyan('https://nextjs.org/telemetry')}`)\n  .addOption(\n    new Option('--enable', `Enables Next.js' telemetry collection.`).conflicts(\n      'disable'\n    )\n  )\n  .option('--disable', `Disables Next.js' telemetry collection.`)\n  .action((arg: string, options: NextTelemetryOptions) =>\n    import('../cli/next-telemetry.js').then((mod) =>\n      mod.nextTelemetry(options, arg)\n    )\n  )\n\nprogram\n  .command('typegen')\n  .description(\n    'Generate TypeScript definitions for routes, pages, and layouts without running a full build.'\n  )\n  .argument(\n    '[directory]',\n    `A directory on which to generate types. ${italic(\n      'If no directory is provided, the current directory will be used.'\n    )}`\n  )\n  .option('--webpack', 'Use webpack when validating next.config.js')\n  .action((directory: string, options: NextTypegenOptions) =>\n    // ensure process exits after typegen completes so open handles/connections\n    // don't cause process to hang\n    import('../cli/next-typegen.js').then((mod) =>\n      mod\n        .nextTypegen(options, directory)\n        .then(() => process.exit(0))\n        .catch((err: unknown) => {\n          // Without this, a failed typegen (e.g. `next.config` throwing) is\n          // swallowed as an unhandled rejection that exits 0; surface it with a\n          // non-zero exit so `next typegen && tsc` halts instead of running\n          // against missing route types.\n          console.error(\n            '\\n> Unexpected error while generating route types. Original error:\\n'\n          )\n          console.error(err)\n          process.exit(1)\n        })\n    )\n  )\n  .usage('[directory] [options]')\n\nconst nextVersion = process.env.__NEXT_VERSION || 'unknown'\nprogram\n  .command('upgrade')\n  .aliases(['update', 'up'])\n  .description(\n    'Upgrade Next.js apps to desired versions with a single command.'\n  )\n  .argument(\n    '[directory]',\n    `A Next.js project directory to upgrade. ${italic(\n      'If no directory is provided, the current directory will be used.'\n    )}`\n  )\n  .usage('[directory] [options]')\n  .option(\n    '--revision <revision>',\n    'Specify the target Next.js version using an NPM dist tag (e.g. \"latest\", \"canary\", \"rc\", \"beta\") or an exact version number (e.g. \"15.0.0\").',\n    nextVersion.includes('-canary.')\n      ? 'canary'\n      : nextVersion.includes('-rc.')\n        ? 'rc'\n        : nextVersion.includes('-beta.')\n          ? 'beta'\n          : 'latest'\n  )\n  .option('--verbose', 'Verbose output', false)\n  .addOption(\n    new Option(\n      '--agent [type]',\n      'Upgrade with an agent to security, latest, or experimental-future. Defaults to security.'\n    ).conflicts('revision')\n  )\n  // Keep nudge attribution available to agents without exposing it in public help.\n  .addOption(new Option('--internal-nudge-id <id>').hideHelp())\n  .action(async (directory, options) => {\n    const mod = await import('../cli/next-upgrade.js')\n    await mod.spawnNextUpgrade(\n      directory,\n      options,\n      options.internalNudgeId !== undefined\n        ? { id: options.internalNudgeId, recipient: 'agent' }\n        : null\n    )\n  })\n\nprogram\n  .command('experimental-test')\n  .description(\n    `Execute \\`next/experimental/testmode\\` tests using a specified test runner. The test runner defaults to 'playwright' if the \\`experimental.defaultTestRunner\\` configuration option or the \\`--test-runner\\` option are not set.`\n  )\n  .argument(\n    '[directory]',\n    `A Next.js project directory to execute the test runner on. ${italic(\n      'If no directory is provided, the current directory will be used.'\n    )}`\n  )\n  .argument(\n    '[test-runner-args...]',\n    'Any additional arguments or options to pass down to the test runner `test` command.'\n  )\n  .option(\n    '--test-runner [test-runner]',\n    `Any supported test runner. Options: ${bold(\n      SUPPORTED_TEST_RUNNERS_LIST.join(', ')\n    )}. ${italic(\n      \"If no test runner is provided, the Next.js config option `experimental.defaultTestRunner`, or 'playwright' will be used.\"\n    )}`\n  )\n  .allowUnknownOption()\n  .action(\n    (directory: string, testRunnerArgs: string[], options: NextTestOptions) => {\n      return import('../cli/next-test.js').then((mod) => {\n        mod.nextTest(directory, testRunnerArgs, options)\n      })\n    }\n  )\n  .usage('[directory] [options]')\n\nprogram\n  .command('experimental-request-insights')\n  .description(\n    'Inspect experimental Request Insights from a running Next.js dev server.'\n  )\n  .argument(\n    '[directory]',\n    `A directory containing the Next.js application. ${italic(\n      'If no directory is provided, the current directory will be used.'\n    )}`\n  )\n  .option(\n    '--url <url>',\n    'Override automatic discovery with the complete HTTP(S) URL of the running Next.js dev server.'\n  )\n  .option('--json', 'Print raw request insight JSON.')\n  .addOption(\n    new Option(\n      '--limit <count>',\n      'Maximum number of recent request summaries to print.'\n    ).argParser(parseValidPositiveInteger)\n  )\n  .action((directory: string, options: NextRequestInsightsOptions) => {\n    return import('../cli/next-request-insights.js').then((mod) =>\n      mod.nextRequestInsights(options, directory)\n    )\n  })\n  .usage('[directory] [options]')\n\nconst internal = program\n  .command('internal')\n  .description(\n    'Internal debugging commands. Use with caution. Not covered by semver.'\n  )\n\n// Agents use the pinned CLI to report completion after the upgrade has changed dependencies.\ninternal\n  .command('report-agent-upgrade', { hidden: true })\n  .argument('<run-id>', 'The upgrade run UUID.')\n  .argument('<result>', 'The agent-reported success or failure result.')\n  .action((runId: string, result: string) =>\n    import('../cli/next-upgrade.js').then((mod) =>\n      mod.reportAgentUpgradeAgentResult(runId, result)\n    )\n  )\n\ninternal\n  .command('agent-feedback-instructions', { hidden: true })\n  .option(\n    '--dry-run',\n    'Print report preview URLs without opening the review form.'\n  )\n  .action((options: { dryRun?: boolean }) =>\n    import('../cli/internal/agent-feedback-instructions.js').then((mod) =>\n      mod.agentFeedbackInstructionsCli(options)\n    )\n  )\n\ninternal\n  .command('trace')\n  .alias('turbo-trace-server')\n  .argument('file', 'Trace file to serve.')\n  .addOption(\n    new Option('-p, --port <port>', 'Override the port.').argParser(\n      parseValidPositiveInteger\n    )\n  )\n  .addOption(\n    new Option(\n      '--mcp-port <mcpPort>',\n      'Port for the MCP (Model Context Protocol) server. Defaults to --port + 1.'\n    ).argParser(parseValidPositiveInteger)\n  )\n  .action(\n    (\n      file: string,\n      options: { port: number | undefined; mcpPort: number | undefined }\n    ) => {\n      return import('../cli/internal/turbo-trace-server.js').then((mod) =>\n        mod.startTurboTraceServerCli(file, options.port, options.mcpPort)\n      )\n    }\n  )\n\ninternal\n  .command('query-trace')\n  .description(\n    'Query a running turbopack trace server (started with `next internal trace --mcp-port <port>`).'\n  )\n  .addOption(\n    new Option(\n      '--port <port>',\n      'MCP port of the running trace server. Defaults to 5748.'\n    ).argParser(parseValidPositiveInteger)\n  )\n  .addOption(\n    new Option(\n      '--parent <parent>',\n      'Span ID to enumerate children of. Omit for root level.'\n    )\n  )\n  .addOption(\n    new Option(\n      '--no-aggregated',\n      'Disable aggregation of spans by name (aggregated by default).'\n    )\n  )\n  .addOption(\n    new Option(\n      '--sort <mode>',\n      'Sort mode: \"value\" for corrected duration descending, \"name\" for alphabetical, \"allocations\" for total allocated bytes descending, \"persistent-allocations\" for persistentAllocations descending.'\n    ).choices(['value', 'name', 'allocations', 'persistent-allocations'])\n  )\n  .addOption(\n    new Option(\n      '--search <search>',\n      'Substring filter on span name/category. Searches the whole subtree below --parent.'\n    )\n  )\n  .addOption(\n    new Option(\n      '--max-depth <depth>',\n      'Levels to descend for --search and --depth (default 32, also the cap).'\n    ).argParser(parseValidPositiveInteger)\n  )\n  .addOption(\n    new Option(\n      '--depth <depth>',\n      'Levels of descendants to nest inline under each span (default 1).'\n    ).argParser(parseValidPositiveInteger)\n  )\n  .addOption(new Option('--json', 'Output as JSON instead of markdown.'))\n  .addOption(\n    new Option('--page <page>', 'Page number (1-based, default 1).').argParser(\n      parseValidPositiveInteger\n    )\n  )\n  .addOption(\n    new Option(\n      '--page-size <size>',\n      'Spans per page (default 20, max 500).'\n    ).argParser(parseValidPositiveInteger)\n  )\n  .addHelpText('after', ({ command }) => {\n    const port = (command.opts() as { port?: number }).port ?? 5748\n    return `\\nExample:\\n  next internal query-trace --port ${port} --parent <id>`\n  })\n  .action((options) =>\n    import('../cli/internal/query-trace.js').then((mod) =>\n      mod.queryTraceCli(options)\n    )\n  )\n\ninternal\n  .command('post-build')\n  .description(\n    'Runs post-build optimization steps (e.g. Turbopack database compaction).'\n  )\n  .argument(\n    '[directory]',\n    `A directory on which to run post-build steps. ${italic(\n      'If no directory is provided, the current directory will be used.'\n    )}`\n  )\n  .action((directory: string, options: NextPostBuildOptions) => {\n    return (\n      require('../cli/next-post-build.js') as typeof import('../cli/next-post-build.js')\n    )\n      .nextPostBuild(options, directory)\n      .then(() => process.exit(0))\n  })\n  .usage('[directory] [options]')\n\ninternal\n  .command('upload-trace')\n  .description(\n    'Upload CPU profiles from .next-profiles/ to Vercel Blob storage.'\n  )\n  .argument(\n    '[directory]',\n    `The project directory containing .next-profiles/. ${italic(\n      'If no directory is provided, the current directory will be used.'\n    )}`\n  )\n  .action((directory: string) => {\n    return import('../cli/internal/upload-trace.js').then((mod) =>\n      mod.uploadTraceToBlob({ directory })\n    )\n  })\n  .usage('[directory] [options]')\n\ninternal\n  .command('static-routes-info')\n  .description(\n    'Analyze a built Next.js app and report per-route bundle sizes across server bundled JS, server source maps, server unbundled, client JS, client source maps, and client CSS categories.'\n  )\n  .argument(\n    '[directory]',\n    `A directory containing the built Next.js application. ${italic(\n      'If no directory is provided, the current directory will be used.'\n    )}`\n  )\n  .option('--json', 'Output as JSON instead of markdown.')\n  .option(\n    '--limit <n>',\n    'Only show the first N routes after sorting (totals always reflect all routes).',\n    parseInt\n  )\n  .option(\n    '--sort <key>',\n    'Sort routes by: name (default, ascending), or one of client, client-js, client-css, client-map, server, server-bundled-js, server-unbundled, server-map, total (descending).'\n  )\n  .option(\n    '--files',\n    'Include the list of files (relative to the output directory) per category in the JSON output. Requires --json.'\n  )\n  .action(\n    (\n      directory: string,\n      options: {\n        json?: boolean\n        limit?: number\n        sort?: string\n        files?: boolean\n      }\n    ) => {\n      return import('../cli/internal/static-routes-info.js').then((mod) =>\n        mod.staticRoutesInfoCli(options, directory)\n      )\n    }\n  )\n  .usage('[directory] [options]')\n\nprogram.parse(process.argv)\n"],"names":["setupProfilesDir","dir","cpuProf","process","env","NEXT_CPU_PROF","turbopackTrace","NEXT_TURBOPACK_TRACING","NEXT_TURBOPACK_TRACING_PATH","profilesDir","ensureProfilesDir","NEXT_CPU_PROF_DIR","NEXT_RSPACK","RSPACK_CONFIG_VALIDATE","semver","satisfies","versions","node","__NEXT_REQUIRED_NODE_VERSION_RANGE","includePrerelease","console","error","exit","NEXT_PRIVATE_START_TIME","Date","now","toString","NextRootCommand","Command","createCommand","name","command","hook","event","commandName","defaultEnv","standardEnv","isUpgradeBuildChild","NEXT_PRIVATE_UPGRADE_BUILD_CHILD","NODE_ENV","isNotStandard","includes","shouldWarnCommands","warn","NON_STANDARD_NODE_ENV","getOptionValue","NEXT_RUNTIME","platform","arch","os","cpus","some","cpu","model","parseValidInspectAddress","value","address","getParsedDebugAddress","Number","isNaN","port","InvalidArgumentError","program","enablePositionalOptions","argv","description","configureHelp","formatHelp","cmd","helper","formatCliHelpOutput","subcommandTerm","usage","helpCommand","helpOption","version","__NEXT_VERSION","argument","italic","option","addOption","Option","hideHelp","choices","default","preset","action","directory","options","debugPrerender","experimentalNextConfigStripTypes","__NEXT_NODE_NATIVE_TS_LOADER_ENABLED","experimentalCpuProf","__NEXT_PRIVATE_CPU_PROFILE","internalTrace","String","cwd","then","mod","nextBuild","saveCpuProfile","analyzeCommand","alias","implies","serve","argParser","parseValidPositiveInteger","nextAnalyze","require","output","catch","captureOptions","offending","filter","key","getOptionValueSource","map","flag","length","Error","join","nextAnalyzeExport","isDefault","undefined","_optionValueSources","portSource","nextDev","hidden","nextExport","addHelpText","cyan","nextInfo","nextStart","bold","addArgument","Argument","conflicts","arg","nextTelemetry","nextTypegen","err","nextVersion","aliases","spawnNextUpgrade","internalNudgeId","id","recipient","SUPPORTED_TEST_RUNNERS_LIST","allowUnknownOption","testRunnerArgs","nextTest","nextRequestInsights","internal","runId","result","reportAgentUpgradeAgentResult","agentFeedbackInstructionsCli","file","startTurboTraceServerCli","mcpPort","opts","queryTraceCli","nextPostBuild","uploadTraceToBlob","parseInt","staticRoutesInfoCli","parse"],"mappings":";;;;;QAEO;2DAEQ;2BAMR;qBAEc;+DACF;4BACgB;qCACC;2BACE;uBAK/B;0BAIA;6BAY2B;;;;;;AAGlC;;;;;CAKC,GACD,SAASA,iBAAiBC,GAAW;IACnC,MAAMC,UAAU,CAAC,CAACC,QAAQC,GAAG,CAACC,aAAa;IAC3C,MAAMC,iBACJ,CAAC,CAACH,QAAQC,GAAG,CAACG,sBAAsB,IACpC,CAACJ,QAAQC,GAAG,CAACI,2BAA2B;IAC1C,IAAI,CAACN,WAAW,CAACI,gBAAgB;QAC/B;IACF;IACA,MAAMG,cAAcC,IAAAA,8BAAiB,EAACT;IACtC,IAAIC,SAAS;QACXC,QAAQC,GAAG,CAACO,iBAAiB,GAAGF;IAClC;AACF;AAEA,IAAIN,QAAQC,GAAG,CAACQ,WAAW,EAAE;IAC3B,+BAA+B;IAC/BT,QAAQC,GAAG,CAACS,sBAAsB,GAAG;AACvC;AAEA,IACE,CAACC,eAAM,CAACC,SAAS,CACfZ,QAAQa,QAAQ,CAACC,IAAI,EACrBd,QAAQC,GAAG,CAACc,kCAAkC,EAC9C;IAAEC,mBAAmB;AAAK,IAE5B;IACAC,QAAQC,KAAK,CACX,CAAC,sBAAsB,EAAElB,QAAQa,QAAQ,CAACC,IAAI,CAAC,gCAAgC,EAAEd,QAAQC,GAAG,CAACc,kCAAkC,CAAC,cAAc,CAAC;IAEjJf,QAAQmB,IAAI,CAAC;AACf;AAEAnB,QA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