{"version":3,"names":["_fs","data","require","_commander","_core","_glob","commander","option","collect","booleanify","undefined","DEFAULT_EXTENSIONS","join","version","usage","action","parseArgv","args","parse","errors","filenames","reduce","globbed","input","files","glob","sync","length","push","Array","from","Set","forEach","filename","fs","existsSync","outDir","outFile","relative","watch","skipInitialBuild","deleteDirOnStart","verbose","quiet","babelrc","keepFileExtension","outFileExtension","console","error","e","opts","babelOptions","presets","plugins","rootMode","configFile","envName","sourceType","ignore","only","retainLines","compact","minified","auxiliaryCommentBefore","auxiliaryCommentAfter","sourceMaps","sourceFileName","sourceRoot","highlightCode","comments","Object","assign","moduleRoot","moduleIds","moduleId","key","keys","cliOptions","extensions","copyFiles","copyIgnored","includeDotfiles","sourceMapTarget","val","value","previousValue","values","split"],"sources":["../../src/babel/options.ts"],"sourcesContent":["import fs from \"fs\";\n\nimport commander from \"commander\";\nimport { version, DEFAULT_EXTENSIONS } from \"@babel/core\";\nimport glob from \"glob\";\n\nimport type { InputOptions } from \"@babel/core\";\n\n// Standard Babel input configs.\ncommander.option(\n \"-f, --filename [filename]\",\n \"The filename to use when reading from stdin. This will be used in source-maps, errors etc.\",\n);\ncommander.option(\n \"--presets [list]\",\n \"A comma-separated list of preset names.\",\n collect,\n);\ncommander.option(\n \"--plugins [list]\",\n \"A comma-separated list of plugin names.\",\n collect,\n);\ncommander.option(\"--config-file [path]\", \"Path to a .babelrc file to use.\");\ncommander.option(\n \"--env-name [name]\",\n \"The name of the 'env' to use when loading configs and plugins. \" +\n \"Defaults to the value of BABEL_ENV, or else NODE_ENV, or else 'development'.\",\n);\ncommander.option(\n \"--root-mode [mode]\",\n \"The project-root resolution mode. \" +\n \"One of 'root' (the default), 'upward', or 'upward-optional'.\",\n);\n\n// Basic file input configuration.\ncommander.option(\"--source-type [script|module]\", \"\");\ncommander.option(\n \"--no-babelrc\",\n \"Whether or not to look up .babelrc and .babelignore files.\",\n);\ncommander.option(\n \"--ignore [list]\",\n \"List of glob paths to **not** compile.\",\n collect,\n);\ncommander.option(\n \"--only [list]\",\n \"List of glob paths to **only** compile.\",\n collect,\n);\n\n// Misc babel config.\ncommander.option(\n \"--no-highlight-code\",\n \"Enable or disable ANSI syntax highlighting of code frames. (on by default)\",\n);\n\n// General output formatting.\ncommander.option(\n \"--no-comments\",\n \"Write comments to generated output. (true by default)\",\n);\ncommander.option(\n \"--retain-lines\",\n \"Retain line numbers. This will result in really ugly code.\",\n);\ncommander.option(\n \"--compact [true|false|auto]\",\n \"Do not include superfluous whitespace characters and line terminators.\",\n booleanify,\n);\ncommander.option(\n \"--minified\",\n \"Save as many bytes when printing. (false by default)\",\n);\ncommander.option(\n \"--auxiliary-comment-before [string]\",\n \"Print a comment before any injected non-user code.\",\n);\ncommander.option(\n \"--auxiliary-comment-after [string]\",\n \"Print a comment after any injected non-user code.\",\n);\n\n// General source map formatting.\ncommander.option(\n \"-s, --source-maps [true|false|inline|both]\",\n \"\",\n booleanify,\n undefined,\n);\ncommander.option(\n \"--source-map-target [string]\",\n \"Set `file` on returned source map.\",\n);\ncommander.option(\n \"--source-file-name [string]\",\n \"Set `sources[0]` on returned source map.\",\n);\ncommander.option(\n \"--source-root [filename]\",\n \"The root from which all sources are relative.\",\n);\n\nif (!process.env.BABEL_8_BREAKING) {\n // Config params for certain module output formats.\n commander.option(\n \"--module-root [filename]\",\n \"Optional prefix for the AMD module formatter that will be prepended to the filename on module definitions.\",\n );\n commander.option(\"-M, --module-ids\", \"Insert an explicit id for modules.\");\n commander.option(\n \"--module-id [string]\",\n \"Specify a custom name for module ids.\",\n );\n}\n\n// \"babel\" command specific arguments that are not passed to @babel/core.\ncommander.option(\n \"-x, --extensions [extensions]\",\n \"List of extensions to compile when a directory has been the input. [\" +\n DEFAULT_EXTENSIONS.join() +\n \"]\",\n collect,\n);\ncommander.option(\n \"--keep-file-extension\",\n \"Preserve the file extensions of the input files.\",\n);\ncommander.option(\"-w, --watch\", \"Recompile files on changes.\");\ncommander.option(\n \"--skip-initial-build\",\n \"Do not compile files before watching.\",\n);\ncommander.option(\n \"-o, --out-file [out]\",\n \"Compile all input files into a single file.\",\n);\ncommander.option(\n \"-d, --out-dir [out]\",\n \"Compile an input directory of modules into an output directory.\",\n);\ncommander.option(\n \"--relative\",\n \"Compile into an output directory relative to input directory or file. Requires --out-dir [out]\",\n);\n\ncommander.option(\n \"-D, --copy-files\",\n \"When compiling a directory copy over non-compilable files.\",\n);\ncommander.option(\n \"--include-dotfiles\",\n \"Include dotfiles when compiling and copying non-compilable files.\",\n);\ncommander.option(\n \"--no-copy-ignored\",\n \"Exclude ignored files when copying non-compilable files.\",\n);\n\ncommander.option(\n \"--verbose\",\n \"Log everything. This option conflicts with --quiet\",\n);\ncommander.option(\n \"--quiet\",\n \"Don't log anything. This option conflicts with --verbose\",\n);\ncommander.option(\n \"--delete-dir-on-start\",\n \"Delete the out directory before compilation.\",\n);\ncommander.option(\n \"--out-file-extension [string]\",\n \"Use a specific extension for the output files\",\n);\n\ncommander.version(PACKAGE_JSON.version + \" (@babel/core \" + version + \")\");\ncommander.usage(\"[options] \");\n// register an empty action handler so that commander.js can throw on\n// unknown options _after_ args\n// see https://github.com/tj/commander.js/issues/561#issuecomment-522209408\ncommander.action(() => {});\n\nexport type CmdOptions = {\n babelOptions: InputOptions;\n cliOptions: {\n filename: string;\n filenames: string[];\n extensions: string[];\n keepFileExtension: boolean;\n outFileExtension: string;\n watch: boolean;\n skipInitialBuild: boolean;\n outFile: string;\n outDir: string;\n relative: boolean;\n copyFiles: boolean;\n copyIgnored: boolean;\n includeDotfiles: boolean;\n verbose: boolean;\n quiet: boolean;\n deleteDirOnStart: boolean;\n sourceMapTarget: string;\n };\n};\n\nexport default function parseArgv(args: Array): CmdOptions | null {\n //\n commander.parse(args);\n\n const errors: string[] = [];\n\n let filenames = commander.args.reduce(function (globbed: string[], input) {\n let files = glob.sync(input);\n if (!files.length) files = [input];\n globbed.push(...files);\n return globbed;\n }, []);\n\n filenames = Array.from(new Set(filenames));\n\n filenames.forEach(function (filename) {\n if (!fs.existsSync(filename)) {\n errors.push(filename + \" does not exist\");\n }\n });\n\n if (commander.outDir && !filenames.length) {\n errors.push(\"--out-dir requires filenames\");\n }\n\n if (commander.outFile && commander.outDir) {\n errors.push(\"--out-file and --out-dir cannot be used together\");\n }\n\n if (commander.relative && !commander.outDir) {\n errors.push(\"--relative requires --out-dir usage\");\n }\n\n if (commander.watch) {\n if (!commander.outFile && !commander.outDir) {\n errors.push(\"--watch requires --out-file or --out-dir\");\n }\n\n if (!filenames.length) {\n errors.push(\"--watch requires filenames\");\n }\n }\n\n if (commander.skipInitialBuild && !commander.watch) {\n errors.push(\"--skip-initial-build requires --watch\");\n }\n if (commander.deleteDirOnStart && !commander.outDir) {\n errors.push(\"--delete-dir-on-start requires --out-dir\");\n }\n\n if (commander.verbose && commander.quiet) {\n errors.push(\"--verbose and --quiet cannot be used together\");\n }\n\n if (\n !commander.outDir &&\n filenames.length === 0 &&\n typeof commander.filename !== \"string\" &&\n commander.babelrc !== false\n ) {\n errors.push(\n \"stdin compilation requires either -f/--filename [filename] or --no-babelrc\",\n );\n }\n\n if (commander.keepFileExtension && commander.outFileExtension) {\n errors.push(\n \"--out-file-extension cannot be used with --keep-file-extension\",\n );\n }\n\n if (errors.length) {\n console.error(\"babel:\");\n errors.forEach(function (e) {\n console.error(\" \" + e);\n });\n return null;\n }\n\n const opts = commander.opts();\n\n const babelOptions: InputOptions = {\n presets: opts.presets,\n plugins: opts.plugins,\n rootMode: opts.rootMode,\n configFile: opts.configFile,\n envName: opts.envName,\n sourceType: opts.sourceType,\n ignore: opts.ignore,\n only: opts.only,\n retainLines: opts.retainLines,\n compact: opts.compact,\n minified: opts.minified,\n auxiliaryCommentBefore: opts.auxiliaryCommentBefore,\n auxiliaryCommentAfter: opts.auxiliaryCommentAfter,\n sourceMaps: opts.sourceMaps,\n sourceFileName: opts.sourceFileName,\n sourceRoot: opts.sourceRoot,\n\n // Commander will default the \"--no-\" arguments to true, but we want to\n // leave them undefined so that @babel/core can handle the\n // default-assignment logic on its own.\n babelrc: opts.babelrc === true ? undefined : opts.babelrc,\n highlightCode: opts.highlightCode === true ? undefined : opts.highlightCode,\n comments: opts.comments === true ? undefined : opts.comments,\n };\n\n if (!process.env.BABEL_8_BREAKING) {\n Object.assign(babelOptions, {\n moduleRoot: opts.moduleRoot,\n moduleIds: opts.moduleIds,\n moduleId: opts.moduleId,\n });\n }\n\n // If the @babel/cli version is newer than the @babel/core version, and we have added\n // new options for @babel/core, we'll potentially get option validation errors from\n // @babel/core. To avoid that, we delete undefined options, so @babel/core will only\n // give the error if users actually pass an unsupported CLI option.\n for (const key of Object.keys(babelOptions) as Array<\n keyof typeof babelOptions\n >) {\n if (babelOptions[key] === undefined) {\n delete babelOptions[key];\n }\n }\n\n return {\n babelOptions,\n cliOptions: {\n filename: opts.filename,\n filenames,\n extensions: opts.extensions,\n keepFileExtension: opts.keepFileExtension,\n outFileExtension: opts.outFileExtension,\n watch: opts.watch,\n skipInitialBuild: opts.skipInitialBuild,\n outFile: opts.outFile,\n outDir: opts.outDir,\n relative: opts.relative,\n copyFiles: opts.copyFiles,\n copyIgnored: opts.copyFiles && opts.copyIgnored,\n includeDotfiles: opts.includeDotfiles,\n verbose: opts.verbose,\n quiet: opts.quiet,\n deleteDirOnStart: opts.deleteDirOnStart,\n sourceMapTarget: opts.sourceMapTarget,\n },\n };\n}\n\nfunction booleanify(val: \"false\" | 0 | \"\"): false;\nfunction booleanify(val: \"true\" | 1): true;\nfunction booleanify(val: any): any {\n if (val === undefined) return undefined;\n\n if (val === \"true\" || val == 1) {\n return true;\n }\n\n if (val === \"false\" || val == 0 || !val) {\n return false;\n }\n\n return val;\n}\n\nfunction collect(value: unknown, previousValue: Array): Array {\n // If the user passed the option with no value, like \"babel file.js --presets\", do nothing.\n if (typeof value !== \"string\") return previousValue;\n\n const values = value.split(\",\");\n\n if (previousValue) {\n previousValue.push(...values);\n return previousValue;\n }\n return values;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,IAAA;EA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