🎉 initiate project *astro_rewrite*
This commit is contained in:
		
							parent
							
								
									ffd4d5e86c
								
							
						
					
					
						commit
						2ba37bfbe3
					
				
					 8658 changed files with 2268794 additions and 2538 deletions
				
			
		
							
								
								
									
										3
									
								
								node_modules/@babel/core/lib/config/cache-contexts.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								node_modules/@babel/core/lib/config/cache-contexts.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,3 @@ | |||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=cache-contexts.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/cache-contexts.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/cache-contexts.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| {"version":3,"names":[],"sources":["../../src/config/cache-contexts.ts"],"sourcesContent":["import type { Targets } from \"@babel/helper-compilation-targets\";\n\nimport type { ConfigContext } from \"./config-chain\";\nimport type { CallerMetadata } from \"./validation/options\";\n\nexport type { ConfigContext as FullConfig };\n\nexport type FullPreset = {\n  targets: Targets;\n} & ConfigContext;\nexport type FullPlugin = {\n  assumptions: { [name: string]: boolean };\n} & FullPreset;\n\n// Context not including filename since it is used in places that cannot\n// process 'ignore'/'only' and other filename-based logic.\nexport type SimpleConfig = {\n  envName: string;\n  caller: CallerMetadata | undefined;\n};\nexport type SimplePreset = {\n  targets: Targets;\n} & SimpleConfig;\nexport type SimplePlugin = {\n  assumptions: {\n    [name: string]: boolean;\n  };\n} & SimplePreset;\n"],"mappings":""} | ||||
							
								
								
									
										261
									
								
								node_modules/@babel/core/lib/config/caching.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										261
									
								
								node_modules/@babel/core/lib/config/caching.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,261 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.assertSimpleType = assertSimpleType; | ||||
| exports.makeStrongCache = makeStrongCache; | ||||
| exports.makeStrongCacheSync = makeStrongCacheSync; | ||||
| exports.makeWeakCache = makeWeakCache; | ||||
| exports.makeWeakCacheSync = makeWeakCacheSync; | ||||
| function _gensync() { | ||||
|   const data = require("gensync"); | ||||
|   _gensync = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| var _async = require("../gensync-utils/async"); | ||||
| var _util = require("./util"); | ||||
| const synchronize = gen => { | ||||
|   return _gensync()(gen).sync; | ||||
| }; | ||||
| function* genTrue() { | ||||
|   return true; | ||||
| } | ||||
| function makeWeakCache(handler) { | ||||
|   return makeCachedFunction(WeakMap, handler); | ||||
| } | ||||
| function makeWeakCacheSync(handler) { | ||||
|   return synchronize(makeWeakCache(handler)); | ||||
| } | ||||
| function makeStrongCache(handler) { | ||||
|   return makeCachedFunction(Map, handler); | ||||
| } | ||||
| function makeStrongCacheSync(handler) { | ||||
|   return synchronize(makeStrongCache(handler)); | ||||
| } | ||||
| function makeCachedFunction(CallCache, handler) { | ||||
|   const callCacheSync = new CallCache(); | ||||
|   const callCacheAsync = new CallCache(); | ||||
|   const futureCache = new CallCache(); | ||||
|   return function* cachedFunction(arg, data) { | ||||
|     const asyncContext = yield* (0, _async.isAsync)(); | ||||
|     const callCache = asyncContext ? callCacheAsync : callCacheSync; | ||||
|     const cached = yield* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data); | ||||
|     if (cached.valid) return cached.value; | ||||
|     const cache = new CacheConfigurator(data); | ||||
|     const handlerResult = handler(arg, cache); | ||||
|     let finishLock; | ||||
|     let value; | ||||
|     if ((0, _util.isIterableIterator)(handlerResult)) { | ||||
|       value = yield* (0, _async.onFirstPause)(handlerResult, () => { | ||||
|         finishLock = setupAsyncLocks(cache, futureCache, arg); | ||||
|       }); | ||||
|     } else { | ||||
|       value = handlerResult; | ||||
|     } | ||||
|     updateFunctionCache(callCache, cache, arg, value); | ||||
|     if (finishLock) { | ||||
|       futureCache.delete(arg); | ||||
|       finishLock.release(value); | ||||
|     } | ||||
|     return value; | ||||
|   }; | ||||
| } | ||||
| function* getCachedValue(cache, arg, data) { | ||||
|   const cachedValue = cache.get(arg); | ||||
|   if (cachedValue) { | ||||
|     for (const { | ||||
|       value, | ||||
|       valid | ||||
|     } of cachedValue) { | ||||
|       if (yield* valid(data)) return { | ||||
|         valid: true, | ||||
|         value | ||||
|       }; | ||||
|     } | ||||
|   } | ||||
|   return { | ||||
|     valid: false, | ||||
|     value: null | ||||
|   }; | ||||
| } | ||||
| function* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data) { | ||||
|   const cached = yield* getCachedValue(callCache, arg, data); | ||||
|   if (cached.valid) { | ||||
|     return cached; | ||||
|   } | ||||
|   if (asyncContext) { | ||||
|     const cached = yield* getCachedValue(futureCache, arg, data); | ||||
|     if (cached.valid) { | ||||
|       const value = yield* (0, _async.waitFor)(cached.value.promise); | ||||
|       return { | ||||
|         valid: true, | ||||
|         value | ||||
|       }; | ||||
|     } | ||||
|   } | ||||
|   return { | ||||
|     valid: false, | ||||
|     value: null | ||||
|   }; | ||||
| } | ||||
| function setupAsyncLocks(config, futureCache, arg) { | ||||
|   const finishLock = new Lock(); | ||||
|   updateFunctionCache(futureCache, config, arg, finishLock); | ||||
|   return finishLock; | ||||
| } | ||||
| function updateFunctionCache(cache, config, arg, value) { | ||||
|   if (!config.configured()) config.forever(); | ||||
|   let cachedValue = cache.get(arg); | ||||
|   config.deactivate(); | ||||
|   switch (config.mode()) { | ||||
|     case "forever": | ||||
|       cachedValue = [{ | ||||
|         value, | ||||
|         valid: genTrue | ||||
|       }]; | ||||
|       cache.set(arg, cachedValue); | ||||
|       break; | ||||
|     case "invalidate": | ||||
|       cachedValue = [{ | ||||
|         value, | ||||
|         valid: config.validator() | ||||
|       }]; | ||||
|       cache.set(arg, cachedValue); | ||||
|       break; | ||||
|     case "valid": | ||||
|       if (cachedValue) { | ||||
|         cachedValue.push({ | ||||
|           value, | ||||
|           valid: config.validator() | ||||
|         }); | ||||
|       } else { | ||||
|         cachedValue = [{ | ||||
|           value, | ||||
|           valid: config.validator() | ||||
|         }]; | ||||
|         cache.set(arg, cachedValue); | ||||
|       } | ||||
|   } | ||||
| } | ||||
| class CacheConfigurator { | ||||
|   constructor(data) { | ||||
|     this._active = true; | ||||
|     this._never = false; | ||||
|     this._forever = false; | ||||
|     this._invalidate = false; | ||||
|     this._configured = false; | ||||
|     this._pairs = []; | ||||
|     this._data = void 0; | ||||
|     this._data = data; | ||||
|   } | ||||
|   simple() { | ||||
|     return makeSimpleConfigurator(this); | ||||
|   } | ||||
|   mode() { | ||||
|     if (this._never) return "never"; | ||||
|     if (this._forever) return "forever"; | ||||
|     if (this._invalidate) return "invalidate"; | ||||
|     return "valid"; | ||||
|   } | ||||
|   forever() { | ||||
|     if (!this._active) { | ||||
|       throw new Error("Cannot change caching after evaluation has completed."); | ||||
|     } | ||||
|     if (this._never) { | ||||
|       throw new Error("Caching has already been configured with .never()"); | ||||
|     } | ||||
|     this._forever = true; | ||||
|     this._configured = true; | ||||
|   } | ||||
|   never() { | ||||
|     if (!this._active) { | ||||
|       throw new Error("Cannot change caching after evaluation has completed."); | ||||
|     } | ||||
|     if (this._forever) { | ||||
|       throw new Error("Caching has already been configured with .forever()"); | ||||
|     } | ||||
|     this._never = true; | ||||
|     this._configured = true; | ||||
|   } | ||||
|   using(handler) { | ||||
|     if (!this._active) { | ||||
|       throw new Error("Cannot change caching after evaluation has completed."); | ||||
|     } | ||||
|     if (this._never || this._forever) { | ||||
|       throw new Error("Caching has already been configured with .never or .forever()"); | ||||
|     } | ||||
|     this._configured = true; | ||||
|     const key = handler(this._data); | ||||
|     const fn = (0, _async.maybeAsync)(handler, `You appear to be using an async cache handler, but Babel has been called synchronously`); | ||||
|     if ((0, _async.isThenable)(key)) { | ||||
|       return key.then(key => { | ||||
|         this._pairs.push([key, fn]); | ||||
|         return key; | ||||
|       }); | ||||
|     } | ||||
|     this._pairs.push([key, fn]); | ||||
|     return key; | ||||
|   } | ||||
|   invalidate(handler) { | ||||
|     this._invalidate = true; | ||||
|     return this.using(handler); | ||||
|   } | ||||
|   validator() { | ||||
|     const pairs = this._pairs; | ||||
|     return function* (data) { | ||||
|       for (const [key, fn] of pairs) { | ||||
|         if (key !== (yield* fn(data))) return false; | ||||
|       } | ||||
|       return true; | ||||
|     }; | ||||
|   } | ||||
|   deactivate() { | ||||
|     this._active = false; | ||||
|   } | ||||
|   configured() { | ||||
|     return this._configured; | ||||
|   } | ||||
| } | ||||
| function makeSimpleConfigurator(cache) { | ||||
|   function cacheFn(val) { | ||||
|     if (typeof val === "boolean") { | ||||
|       if (val) cache.forever();else cache.never(); | ||||
|       return; | ||||
|     } | ||||
|     return cache.using(() => assertSimpleType(val())); | ||||
|   } | ||||
|   cacheFn.forever = () => cache.forever(); | ||||
|   cacheFn.never = () => cache.never(); | ||||
|   cacheFn.using = cb => cache.using(() => assertSimpleType(cb())); | ||||
|   cacheFn.invalidate = cb => cache.invalidate(() => assertSimpleType(cb())); | ||||
|   return cacheFn; | ||||
| } | ||||
| function assertSimpleType(value) { | ||||
|   if ((0, _async.isThenable)(value)) { | ||||
|     throw new Error(`You appear to be using an async cache handler, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously handle your caching logic.`); | ||||
|   } | ||||
|   if (value != null && typeof value !== "string" && typeof value !== "boolean" && typeof value !== "number") { | ||||
|     throw new Error("Cache keys must be either string, boolean, number, null, or undefined."); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| class Lock { | ||||
|   constructor() { | ||||
|     this.released = false; | ||||
|     this.promise = void 0; | ||||
|     this._resolve = void 0; | ||||
|     this.promise = new Promise(resolve => { | ||||
|       this._resolve = resolve; | ||||
|     }); | ||||
|   } | ||||
|   release(value) { | ||||
|     this.released = true; | ||||
|     this._resolve(value); | ||||
|   } | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=caching.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/caching.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/caching.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										467
									
								
								node_modules/@babel/core/lib/config/config-chain.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										467
									
								
								node_modules/@babel/core/lib/config/config-chain.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,467 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.buildPresetChain = buildPresetChain; | ||||
| exports.buildPresetChainWalker = void 0; | ||||
| exports.buildRootChain = buildRootChain; | ||||
| function _path() { | ||||
|   const data = require("path"); | ||||
|   _path = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| function _debug() { | ||||
|   const data = require("debug"); | ||||
|   _debug = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| var _options = require("./validation/options"); | ||||
| var _patternToRegex = require("./pattern-to-regex"); | ||||
| var _printer = require("./printer"); | ||||
| var _rewriteStackTrace = require("../errors/rewrite-stack-trace"); | ||||
| var _configError = require("../errors/config-error"); | ||||
| var _files = require("./files"); | ||||
| var _caching = require("./caching"); | ||||
| var _configDescriptors = require("./config-descriptors"); | ||||
| const debug = _debug()("babel:config:config-chain"); | ||||
| function* buildPresetChain(arg, context) { | ||||
|   const chain = yield* buildPresetChainWalker(arg, context); | ||||
|   if (!chain) return null; | ||||
|   return { | ||||
|     plugins: dedupDescriptors(chain.plugins), | ||||
|     presets: dedupDescriptors(chain.presets), | ||||
|     options: chain.options.map(o => normalizeOptions(o)), | ||||
|     files: new Set() | ||||
|   }; | ||||
| } | ||||
| const buildPresetChainWalker = makeChainWalker({ | ||||
|   root: preset => loadPresetDescriptors(preset), | ||||
|   env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName), | ||||
|   overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index), | ||||
|   overridesEnv: (preset, index, envName) => loadPresetOverridesEnvDescriptors(preset)(index)(envName), | ||||
|   createLogger: () => () => {} | ||||
| }); | ||||
| exports.buildPresetChainWalker = buildPresetChainWalker; | ||||
| const loadPresetDescriptors = (0, _caching.makeWeakCacheSync)(preset => buildRootDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors)); | ||||
| const loadPresetEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, envName))); | ||||
| const loadPresetOverridesDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index))); | ||||
| const loadPresetOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(index => (0, _caching.makeStrongCacheSync)(envName => buildOverrideEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index, envName)))); | ||||
| function* buildRootChain(opts, context) { | ||||
|   let configReport, babelRcReport; | ||||
|   const programmaticLogger = new _printer.ConfigPrinter(); | ||||
|   const programmaticChain = yield* loadProgrammaticChain({ | ||||
|     options: opts, | ||||
|     dirname: context.cwd | ||||
|   }, context, undefined, programmaticLogger); | ||||
|   if (!programmaticChain) return null; | ||||
|   const programmaticReport = yield* programmaticLogger.output(); | ||||
|   let configFile; | ||||
|   if (typeof opts.configFile === "string") { | ||||
|     configFile = yield* (0, _files.loadConfig)(opts.configFile, context.cwd, context.envName, context.caller); | ||||
|   } else if (opts.configFile !== false) { | ||||
|     configFile = yield* (0, _files.findRootConfig)(context.root, context.envName, context.caller); | ||||
|   } | ||||
|   let { | ||||
|     babelrc, | ||||
|     babelrcRoots | ||||
|   } = opts; | ||||
|   let babelrcRootsDirectory = context.cwd; | ||||
|   const configFileChain = emptyChain(); | ||||
|   const configFileLogger = new _printer.ConfigPrinter(); | ||||
|   if (configFile) { | ||||
|     const validatedFile = validateConfigFile(configFile); | ||||
|     const result = yield* loadFileChain(validatedFile, context, undefined, configFileLogger); | ||||
|     if (!result) return null; | ||||
|     configReport = yield* configFileLogger.output(); | ||||
|     if (babelrc === undefined) { | ||||
|       babelrc = validatedFile.options.babelrc; | ||||
|     } | ||||
|     if (babelrcRoots === undefined) { | ||||
|       babelrcRootsDirectory = validatedFile.dirname; | ||||
|       babelrcRoots = validatedFile.options.babelrcRoots; | ||||
|     } | ||||
|     mergeChain(configFileChain, result); | ||||
|   } | ||||
|   let ignoreFile, babelrcFile; | ||||
|   let isIgnored = false; | ||||
|   const fileChain = emptyChain(); | ||||
|   if ((babelrc === true || babelrc === undefined) && typeof context.filename === "string") { | ||||
|     const pkgData = yield* (0, _files.findPackageData)(context.filename); | ||||
|     if (pkgData && babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)) { | ||||
|       ({ | ||||
|         ignore: ignoreFile, | ||||
|         config: babelrcFile | ||||
|       } = yield* (0, _files.findRelativeConfig)(pkgData, context.envName, context.caller)); | ||||
|       if (ignoreFile) { | ||||
|         fileChain.files.add(ignoreFile.filepath); | ||||
|       } | ||||
|       if (ignoreFile && shouldIgnore(context, ignoreFile.ignore, null, ignoreFile.dirname)) { | ||||
|         isIgnored = true; | ||||
|       } | ||||
|       if (babelrcFile && !isIgnored) { | ||||
|         const validatedFile = validateBabelrcFile(babelrcFile); | ||||
|         const babelrcLogger = new _printer.ConfigPrinter(); | ||||
|         const result = yield* loadFileChain(validatedFile, context, undefined, babelrcLogger); | ||||
|         if (!result) { | ||||
|           isIgnored = true; | ||||
|         } else { | ||||
|           babelRcReport = yield* babelrcLogger.output(); | ||||
|           mergeChain(fileChain, result); | ||||
|         } | ||||
|       } | ||||
|       if (babelrcFile && isIgnored) { | ||||
|         fileChain.files.add(babelrcFile.filepath); | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|   if (context.showConfig) { | ||||
|     console.log(`Babel configs on "${context.filename}" (ascending priority):\n` + [configReport, babelRcReport, programmaticReport].filter(x => !!x).join("\n\n") + "\n-----End Babel configs-----"); | ||||
|   } | ||||
|   const chain = mergeChain(mergeChain(mergeChain(emptyChain(), configFileChain), fileChain), programmaticChain); | ||||
|   return { | ||||
|     plugins: isIgnored ? [] : dedupDescriptors(chain.plugins), | ||||
|     presets: isIgnored ? [] : dedupDescriptors(chain.presets), | ||||
|     options: isIgnored ? [] : chain.options.map(o => normalizeOptions(o)), | ||||
|     fileHandling: isIgnored ? "ignored" : "transpile", | ||||
|     ignore: ignoreFile || undefined, | ||||
|     babelrc: babelrcFile || undefined, | ||||
|     config: configFile || undefined, | ||||
|     files: chain.files | ||||
|   }; | ||||
| } | ||||
| function babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory) { | ||||
|   if (typeof babelrcRoots === "boolean") return babelrcRoots; | ||||
|   const absoluteRoot = context.root; | ||||
|   if (babelrcRoots === undefined) { | ||||
|     return pkgData.directories.indexOf(absoluteRoot) !== -1; | ||||
|   } | ||||
|   let babelrcPatterns = babelrcRoots; | ||||
|   if (!Array.isArray(babelrcPatterns)) { | ||||
|     babelrcPatterns = [babelrcPatterns]; | ||||
|   } | ||||
|   babelrcPatterns = babelrcPatterns.map(pat => { | ||||
|     return typeof pat === "string" ? _path().resolve(babelrcRootsDirectory, pat) : pat; | ||||
|   }); | ||||
|   if (babelrcPatterns.length === 1 && babelrcPatterns[0] === absoluteRoot) { | ||||
|     return pkgData.directories.indexOf(absoluteRoot) !== -1; | ||||
|   } | ||||
|   return babelrcPatterns.some(pat => { | ||||
|     if (typeof pat === "string") { | ||||
|       pat = (0, _patternToRegex.default)(pat, babelrcRootsDirectory); | ||||
|     } | ||||
|     return pkgData.directories.some(directory => { | ||||
|       return matchPattern(pat, babelrcRootsDirectory, directory, context); | ||||
|     }); | ||||
|   }); | ||||
| } | ||||
| const validateConfigFile = (0, _caching.makeWeakCacheSync)(file => ({ | ||||
|   filepath: file.filepath, | ||||
|   dirname: file.dirname, | ||||
|   options: (0, _options.validate)("configfile", file.options, file.filepath) | ||||
| })); | ||||
| const validateBabelrcFile = (0, _caching.makeWeakCacheSync)(file => ({ | ||||
|   filepath: file.filepath, | ||||
|   dirname: file.dirname, | ||||
|   options: (0, _options.validate)("babelrcfile", file.options, file.filepath) | ||||
| })); | ||||
| const validateExtendFile = (0, _caching.makeWeakCacheSync)(file => ({ | ||||
|   filepath: file.filepath, | ||||
|   dirname: file.dirname, | ||||
|   options: (0, _options.validate)("extendsfile", file.options, file.filepath) | ||||
| })); | ||||
| const loadProgrammaticChain = makeChainWalker({ | ||||
|   root: input => buildRootDescriptors(input, "base", _configDescriptors.createCachedDescriptors), | ||||
|   env: (input, envName) => buildEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, envName), | ||||
|   overrides: (input, index) => buildOverrideDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index), | ||||
|   overridesEnv: (input, index, envName) => buildOverrideEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index, envName), | ||||
|   createLogger: (input, context, baseLogger) => buildProgrammaticLogger(input, context, baseLogger) | ||||
| }); | ||||
| const loadFileChainWalker = makeChainWalker({ | ||||
|   root: file => loadFileDescriptors(file), | ||||
|   env: (file, envName) => loadFileEnvDescriptors(file)(envName), | ||||
|   overrides: (file, index) => loadFileOverridesDescriptors(file)(index), | ||||
|   overridesEnv: (file, index, envName) => loadFileOverridesEnvDescriptors(file)(index)(envName), | ||||
|   createLogger: (file, context, baseLogger) => buildFileLogger(file.filepath, context, baseLogger) | ||||
| }); | ||||
| function* loadFileChain(input, context, files, baseLogger) { | ||||
|   const chain = yield* loadFileChainWalker(input, context, files, baseLogger); | ||||
|   chain == null ? void 0 : chain.files.add(input.filepath); | ||||
|   return chain; | ||||
| } | ||||
| const loadFileDescriptors = (0, _caching.makeWeakCacheSync)(file => buildRootDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors)); | ||||
| const loadFileEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, envName))); | ||||
| const loadFileOverridesDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index))); | ||||
| const loadFileOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => (0, _caching.makeStrongCacheSync)(envName => buildOverrideEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index, envName)))); | ||||
| function buildFileLogger(filepath, context, baseLogger) { | ||||
|   if (!baseLogger) { | ||||
|     return () => {}; | ||||
|   } | ||||
|   return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Config, { | ||||
|     filepath | ||||
|   }); | ||||
| } | ||||
| function buildRootDescriptors({ | ||||
|   dirname, | ||||
|   options | ||||
| }, alias, descriptors) { | ||||
|   return descriptors(dirname, options, alias); | ||||
| } | ||||
| function buildProgrammaticLogger(_, context, baseLogger) { | ||||
|   var _context$caller; | ||||
|   if (!baseLogger) { | ||||
|     return () => {}; | ||||
|   } | ||||
|   return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Programmatic, { | ||||
|     callerName: (_context$caller = context.caller) == null ? void 0 : _context$caller.name | ||||
|   }); | ||||
| } | ||||
| function buildEnvDescriptors({ | ||||
|   dirname, | ||||
|   options | ||||
| }, alias, descriptors, envName) { | ||||
|   const opts = options.env && options.env[envName]; | ||||
|   return opts ? descriptors(dirname, opts, `${alias}.env["${envName}"]`) : null; | ||||
| } | ||||
| function buildOverrideDescriptors({ | ||||
|   dirname, | ||||
|   options | ||||
| }, alias, descriptors, index) { | ||||
|   const opts = options.overrides && options.overrides[index]; | ||||
|   if (!opts) throw new Error("Assertion failure - missing override"); | ||||
|   return descriptors(dirname, opts, `${alias}.overrides[${index}]`); | ||||
| } | ||||
| function buildOverrideEnvDescriptors({ | ||||
|   dirname, | ||||
|   options | ||||
| }, alias, descriptors, index, envName) { | ||||
|   const override = options.overrides && options.overrides[index]; | ||||
|   if (!override) throw new Error("Assertion failure - missing override"); | ||||
|   const opts = override.env && override.env[envName]; | ||||
|   return opts ? descriptors(dirname, opts, `${alias}.overrides[${index}].env["${envName}"]`) : null; | ||||
| } | ||||
| function makeChainWalker({ | ||||
|   root, | ||||
|   env, | ||||
|   overrides, | ||||
|   overridesEnv, | ||||
|   createLogger | ||||
| }) { | ||||
|   return function* chainWalker(input, context, files = new Set(), baseLogger) { | ||||
|     const { | ||||
|       dirname | ||||
|     } = input; | ||||
|     const flattenedConfigs = []; | ||||
|     const rootOpts = root(input); | ||||
|     if (configIsApplicable(rootOpts, dirname, context, input.filepath)) { | ||||
|       flattenedConfigs.push({ | ||||
|         config: rootOpts, | ||||
|         envName: undefined, | ||||
|         index: undefined | ||||
|       }); | ||||
|       const envOpts = env(input, context.envName); | ||||
|       if (envOpts && configIsApplicable(envOpts, dirname, context, input.filepath)) { | ||||
|         flattenedConfigs.push({ | ||||
|           config: envOpts, | ||||
|           envName: context.envName, | ||||
|           index: undefined | ||||
|         }); | ||||
|       } | ||||
|       (rootOpts.options.overrides || []).forEach((_, index) => { | ||||
|         const overrideOps = overrides(input, index); | ||||
|         if (configIsApplicable(overrideOps, dirname, context, input.filepath)) { | ||||
|           flattenedConfigs.push({ | ||||
|             config: overrideOps, | ||||
|             index, | ||||
|             envName: undefined | ||||
|           }); | ||||
|           const overrideEnvOpts = overridesEnv(input, index, context.envName); | ||||
|           if (overrideEnvOpts && configIsApplicable(overrideEnvOpts, dirname, context, input.filepath)) { | ||||
|             flattenedConfigs.push({ | ||||
|               config: overrideEnvOpts, | ||||
|               index, | ||||
|               envName: context.envName | ||||
|             }); | ||||
|           } | ||||
|         } | ||||
|       }); | ||||
|     } | ||||
|     if (flattenedConfigs.some(({ | ||||
|       config: { | ||||
|         options: { | ||||
|           ignore, | ||||
|           only | ||||
|         } | ||||
|       } | ||||
|     }) => shouldIgnore(context, ignore, only, dirname))) { | ||||
|       return null; | ||||
|     } | ||||
|     const chain = emptyChain(); | ||||
|     const logger = createLogger(input, context, baseLogger); | ||||
|     for (const { | ||||
|       config, | ||||
|       index, | ||||
|       envName | ||||
|     } of flattenedConfigs) { | ||||
|       if (!(yield* mergeExtendsChain(chain, config.options, dirname, context, files, baseLogger))) { | ||||
|         return null; | ||||
|       } | ||||
|       logger(config, index, envName); | ||||
|       yield* mergeChainOpts(chain, config); | ||||
|     } | ||||
|     return chain; | ||||
|   }; | ||||
| } | ||||
| function* mergeExtendsChain(chain, opts, dirname, context, files, baseLogger) { | ||||
|   if (opts.extends === undefined) return true; | ||||
|   const file = yield* (0, _files.loadConfig)(opts.extends, dirname, context.envName, context.caller); | ||||
|   if (files.has(file)) { | ||||
|     throw new Error(`Configuration cycle detected loading ${file.filepath}.\n` + `File already loaded following the config chain:\n` + Array.from(files, file => ` - ${file.filepath}`).join("\n")); | ||||
|   } | ||||
|   files.add(file); | ||||
|   const fileChain = yield* loadFileChain(validateExtendFile(file), context, files, baseLogger); | ||||
|   files.delete(file); | ||||
|   if (!fileChain) return false; | ||||
|   mergeChain(chain, fileChain); | ||||
|   return true; | ||||
| } | ||||
| function mergeChain(target, source) { | ||||
|   target.options.push(...source.options); | ||||
|   target.plugins.push(...source.plugins); | ||||
|   target.presets.push(...source.presets); | ||||
|   for (const file of source.files) { | ||||
|     target.files.add(file); | ||||
|   } | ||||
|   return target; | ||||
| } | ||||
| function* mergeChainOpts(target, { | ||||
|   options, | ||||
|   plugins, | ||||
|   presets | ||||
| }) { | ||||
|   target.options.push(options); | ||||
|   target.plugins.push(...(yield* plugins())); | ||||
|   target.presets.push(...(yield* presets())); | ||||
|   return target; | ||||
| } | ||||
| function emptyChain() { | ||||
|   return { | ||||
|     options: [], | ||||
|     presets: [], | ||||
|     plugins: [], | ||||
|     files: new Set() | ||||
|   }; | ||||
| } | ||||
| function normalizeOptions(opts) { | ||||
|   const options = Object.assign({}, opts); | ||||
|   delete options.extends; | ||||
|   delete options.env; | ||||
|   delete options.overrides; | ||||
|   delete options.plugins; | ||||
|   delete options.presets; | ||||
|   delete options.passPerPreset; | ||||
|   delete options.ignore; | ||||
|   delete options.only; | ||||
|   delete options.test; | ||||
|   delete options.include; | ||||
|   delete options.exclude; | ||||
|   if (Object.prototype.hasOwnProperty.call(options, "sourceMap")) { | ||||
|     options.sourceMaps = options.sourceMap; | ||||
|     delete options.sourceMap; | ||||
|   } | ||||
|   return options; | ||||
| } | ||||
| function dedupDescriptors(items) { | ||||
|   const map = new Map(); | ||||
|   const descriptors = []; | ||||
|   for (const item of items) { | ||||
|     if (typeof item.value === "function") { | ||||
|       const fnKey = item.value; | ||||
|       let nameMap = map.get(fnKey); | ||||
|       if (!nameMap) { | ||||
|         nameMap = new Map(); | ||||
|         map.set(fnKey, nameMap); | ||||
|       } | ||||
|       let desc = nameMap.get(item.name); | ||||
|       if (!desc) { | ||||
|         desc = { | ||||
|           value: item | ||||
|         }; | ||||
|         descriptors.push(desc); | ||||
|         if (!item.ownPass) nameMap.set(item.name, desc); | ||||
|       } else { | ||||
|         desc.value = item; | ||||
|       } | ||||
|     } else { | ||||
|       descriptors.push({ | ||||
|         value: item | ||||
|       }); | ||||
|     } | ||||
|   } | ||||
|   return descriptors.reduce((acc, desc) => { | ||||
|     acc.push(desc.value); | ||||
|     return acc; | ||||
|   }, []); | ||||
| } | ||||
| function configIsApplicable({ | ||||
|   options | ||||
| }, dirname, context, configName) { | ||||
|   return (options.test === undefined || configFieldIsApplicable(context, options.test, dirname, configName)) && (options.include === undefined || configFieldIsApplicable(context, options.include, dirname, configName)) && (options.exclude === undefined || !configFieldIsApplicable(context, options.exclude, dirname, configName)); | ||||
| } | ||||
| function configFieldIsApplicable(context, test, dirname, configName) { | ||||
|   const patterns = Array.isArray(test) ? test : [test]; | ||||
|   return matchesPatterns(context, patterns, dirname, configName); | ||||
| } | ||||
| function ignoreListReplacer(_key, value) { | ||||
|   if (value instanceof RegExp) { | ||||
|     return String(value); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function shouldIgnore(context, ignore, only, dirname) { | ||||
|   if (ignore && matchesPatterns(context, ignore, dirname)) { | ||||
|     var _context$filename; | ||||
|     const message = `No config is applied to "${(_context$filename = context.filename) != null ? _context$filename : "(unknown)"}" because it matches one of \`ignore: ${JSON.stringify(ignore, ignoreListReplacer)}\` from "${dirname}"`; | ||||
|     debug(message); | ||||
|     if (context.showConfig) { | ||||
|       console.log(message); | ||||
|     } | ||||
|     return true; | ||||
|   } | ||||
|   if (only && !matchesPatterns(context, only, dirname)) { | ||||
|     var _context$filename2; | ||||
|     const message = `No config is applied to "${(_context$filename2 = context.filename) != null ? _context$filename2 : "(unknown)"}" because it fails to match one of \`only: ${JSON.stringify(only, ignoreListReplacer)}\` from "${dirname}"`; | ||||
|     debug(message); | ||||
|     if (context.showConfig) { | ||||
|       console.log(message); | ||||
|     } | ||||
|     return true; | ||||
|   } | ||||
|   return false; | ||||
| } | ||||
| function matchesPatterns(context, patterns, dirname, configName) { | ||||
|   return patterns.some(pattern => matchPattern(pattern, dirname, context.filename, context, configName)); | ||||
| } | ||||
| function matchPattern(pattern, dirname, pathToTest, context, configName) { | ||||
|   if (typeof pattern === "function") { | ||||
|     return !!(0, _rewriteStackTrace.endHiddenCallStack)(pattern)(pathToTest, { | ||||
|       dirname, | ||||
|       envName: context.envName, | ||||
|       caller: context.caller | ||||
|     }); | ||||
|   } | ||||
|   if (typeof pathToTest !== "string") { | ||||
|     throw new _configError.default(`Configuration contains string/RegExp pattern, but no filename was passed to Babel`, configName); | ||||
|   } | ||||
|   if (typeof pattern === "string") { | ||||
|     pattern = (0, _patternToRegex.default)(pattern, dirname); | ||||
|   } | ||||
|   return pattern.test(pathToTest); | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=config-chain.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/config-chain.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/config-chain.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										189
									
								
								node_modules/@babel/core/lib/config/config-descriptors.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										189
									
								
								node_modules/@babel/core/lib/config/config-descriptors.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,189 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.createCachedDescriptors = createCachedDescriptors; | ||||
| exports.createDescriptor = createDescriptor; | ||||
| exports.createUncachedDescriptors = createUncachedDescriptors; | ||||
| function _gensync() { | ||||
|   const data = require("gensync"); | ||||
|   _gensync = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| var _functional = require("../gensync-utils/functional"); | ||||
| var _files = require("./files"); | ||||
| var _item = require("./item"); | ||||
| var _caching = require("./caching"); | ||||
| var _resolveTargets = require("./resolve-targets"); | ||||
| function isEqualDescriptor(a, b) { | ||||
|   return a.name === b.name && a.value === b.value && a.options === b.options && a.dirname === b.dirname && a.alias === b.alias && a.ownPass === b.ownPass && (a.file && a.file.request) === (b.file && b.file.request) && (a.file && a.file.resolved) === (b.file && b.file.resolved); | ||||
| } | ||||
| function* handlerOf(value) { | ||||
|   return value; | ||||
| } | ||||
| function optionsWithResolvedBrowserslistConfigFile(options, dirname) { | ||||
|   if (typeof options.browserslistConfigFile === "string") { | ||||
|     options.browserslistConfigFile = (0, _resolveTargets.resolveBrowserslistConfigFile)(options.browserslistConfigFile, dirname); | ||||
|   } | ||||
|   return options; | ||||
| } | ||||
| function createCachedDescriptors(dirname, options, alias) { | ||||
|   const { | ||||
|     plugins, | ||||
|     presets, | ||||
|     passPerPreset | ||||
|   } = options; | ||||
|   return { | ||||
|     options: optionsWithResolvedBrowserslistConfigFile(options, dirname), | ||||
|     plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname)(alias) : () => handlerOf([]), | ||||
|     presets: presets ? () => createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset) : () => handlerOf([]) | ||||
|   }; | ||||
| } | ||||
| function createUncachedDescriptors(dirname, options, alias) { | ||||
|   return { | ||||
|     options: optionsWithResolvedBrowserslistConfigFile(options, dirname), | ||||
|     plugins: (0, _functional.once)(() => createPluginDescriptors(options.plugins || [], dirname, alias)), | ||||
|     presets: (0, _functional.once)(() => createPresetDescriptors(options.presets || [], dirname, alias, !!options.passPerPreset)) | ||||
|   }; | ||||
| } | ||||
| const PRESET_DESCRIPTOR_CACHE = new WeakMap(); | ||||
| const createCachedPresetDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => { | ||||
|   const dirname = cache.using(dir => dir); | ||||
|   return (0, _caching.makeStrongCacheSync)(alias => (0, _caching.makeStrongCache)(function* (passPerPreset) { | ||||
|     const descriptors = yield* createPresetDescriptors(items, dirname, alias, passPerPreset); | ||||
|     return descriptors.map(desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc)); | ||||
|   })); | ||||
| }); | ||||
| const PLUGIN_DESCRIPTOR_CACHE = new WeakMap(); | ||||
| const createCachedPluginDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => { | ||||
|   const dirname = cache.using(dir => dir); | ||||
|   return (0, _caching.makeStrongCache)(function* (alias) { | ||||
|     const descriptors = yield* createPluginDescriptors(items, dirname, alias); | ||||
|     return descriptors.map(desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc)); | ||||
|   }); | ||||
| }); | ||||
| const DEFAULT_OPTIONS = {}; | ||||
| function loadCachedDescriptor(cache, desc) { | ||||
|   const { | ||||
|     value, | ||||
|     options = DEFAULT_OPTIONS | ||||
|   } = desc; | ||||
|   if (options === false) return desc; | ||||
|   let cacheByOptions = cache.get(value); | ||||
|   if (!cacheByOptions) { | ||||
|     cacheByOptions = new WeakMap(); | ||||
|     cache.set(value, cacheByOptions); | ||||
|   } | ||||
|   let possibilities = cacheByOptions.get(options); | ||||
|   if (!possibilities) { | ||||
|     possibilities = []; | ||||
|     cacheByOptions.set(options, possibilities); | ||||
|   } | ||||
|   if (possibilities.indexOf(desc) === -1) { | ||||
|     const matches = possibilities.filter(possibility => isEqualDescriptor(possibility, desc)); | ||||
|     if (matches.length > 0) { | ||||
|       return matches[0]; | ||||
|     } | ||||
|     possibilities.push(desc); | ||||
|   } | ||||
|   return desc; | ||||
| } | ||||
| function* createPresetDescriptors(items, dirname, alias, passPerPreset) { | ||||
|   return yield* createDescriptors("preset", items, dirname, alias, passPerPreset); | ||||
| } | ||||
| function* createPluginDescriptors(items, dirname, alias) { | ||||
|   return yield* createDescriptors("plugin", items, dirname, alias); | ||||
| } | ||||
| function* createDescriptors(type, items, dirname, alias, ownPass) { | ||||
|   const descriptors = yield* _gensync().all(items.map((item, index) => createDescriptor(item, dirname, { | ||||
|     type, | ||||
|     alias: `${alias}$${index}`, | ||||
|     ownPass: !!ownPass | ||||
|   }))); | ||||
|   assertNoDuplicates(descriptors); | ||||
|   return descriptors; | ||||
| } | ||||
| function* createDescriptor(pair, dirname, { | ||||
|   type, | ||||
|   alias, | ||||
|   ownPass | ||||
| }) { | ||||
|   const desc = (0, _item.getItemDescriptor)(pair); | ||||
|   if (desc) { | ||||
|     return desc; | ||||
|   } | ||||
|   let name; | ||||
|   let options; | ||||
|   let value = pair; | ||||
|   if (Array.isArray(value)) { | ||||
|     if (value.length === 3) { | ||||
|       [value, options, name] = value; | ||||
|     } else { | ||||
|       [value, options] = value; | ||||
|     } | ||||
|   } | ||||
|   let file = undefined; | ||||
|   let filepath = null; | ||||
|   if (typeof value === "string") { | ||||
|     if (typeof type !== "string") { | ||||
|       throw new Error("To resolve a string-based item, the type of item must be given"); | ||||
|     } | ||||
|     const resolver = type === "plugin" ? _files.loadPlugin : _files.loadPreset; | ||||
|     const request = value; | ||||
|     ({ | ||||
|       filepath, | ||||
|       value | ||||
|     } = yield* resolver(value, dirname)); | ||||
|     file = { | ||||
|       request, | ||||
|       resolved: filepath | ||||
|     }; | ||||
|   } | ||||
|   if (!value) { | ||||
|     throw new Error(`Unexpected falsy value: ${String(value)}`); | ||||
|   } | ||||
|   if (typeof value === "object" && value.__esModule) { | ||||
|     if (value.default) { | ||||
|       value = value.default; | ||||
|     } else { | ||||
|       throw new Error("Must export a default export when using ES6 modules."); | ||||
|     } | ||||
|   } | ||||
|   if (typeof value !== "object" && typeof value !== "function") { | ||||
|     throw new Error(`Unsupported format: ${typeof value}. Expected an object or a function.`); | ||||
|   } | ||||
|   if (filepath !== null && typeof value === "object" && value) { | ||||
|     throw new Error(`Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`); | ||||
|   } | ||||
|   return { | ||||
|     name, | ||||
|     alias: filepath || alias, | ||||
|     value, | ||||
|     options, | ||||
|     dirname, | ||||
|     ownPass, | ||||
|     file | ||||
|   }; | ||||
| } | ||||
| function assertNoDuplicates(items) { | ||||
|   const map = new Map(); | ||||
|   for (const item of items) { | ||||
|     if (typeof item.value !== "function") continue; | ||||
|     let nameMap = map.get(item.value); | ||||
|     if (!nameMap) { | ||||
|       nameMap = new Set(); | ||||
|       map.set(item.value, nameMap); | ||||
|     } | ||||
|     if (nameMap.has(item.name)) { | ||||
|       const conflicts = items.filter(i => i.value === item.value); | ||||
|       throw new Error([`Duplicate plugin/preset detected.`, `If you'd like to use two separate instances of a plugin,`, `they need separate names, e.g.`, ``, `  plugins: [`, `    ['some-plugin', {}],`, `    ['some-plugin', {}, 'some unique name'],`, `  ]`, ``, `Duplicates detected are:`, `${JSON.stringify(conflicts, null, 2)}`].join("\n")); | ||||
|     } | ||||
|     nameMap.add(item.name); | ||||
|   } | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=config-descriptors.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/config-descriptors.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/config-descriptors.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										284
									
								
								node_modules/@babel/core/lib/config/files/configuration.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										284
									
								
								node_modules/@babel/core/lib/config/files/configuration.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,284 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.ROOT_CONFIG_FILENAMES = void 0; | ||||
| exports.findConfigUpwards = findConfigUpwards; | ||||
| exports.findRelativeConfig = findRelativeConfig; | ||||
| exports.findRootConfig = findRootConfig; | ||||
| exports.loadConfig = loadConfig; | ||||
| exports.resolveShowConfigPath = resolveShowConfigPath; | ||||
| function _debug() { | ||||
|   const data = require("debug"); | ||||
|   _debug = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| function _fs() { | ||||
|   const data = require("fs"); | ||||
|   _fs = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| function _path() { | ||||
|   const data = require("path"); | ||||
|   _path = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| function _json() { | ||||
|   const data = require("json5"); | ||||
|   _json = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| function _gensync() { | ||||
|   const data = require("gensync"); | ||||
|   _gensync = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| var _caching = require("../caching"); | ||||
| var _configApi = require("../helpers/config-api"); | ||||
| var _utils = require("./utils"); | ||||
| var _moduleTypes = require("./module-types"); | ||||
| var _patternToRegex = require("../pattern-to-regex"); | ||||
| var _configError = require("../../errors/config-error"); | ||||
| var fs = require("../../gensync-utils/fs"); | ||||
| var _rewriteStackTrace = require("../../errors/rewrite-stack-trace"); | ||||
| const debug = _debug()("babel:config:loading:files:configuration"); | ||||
| const ROOT_CONFIG_FILENAMES = ["babel.config.js", "babel.config.cjs", "babel.config.mjs", "babel.config.json", "babel.config.cts"]; | ||||
| exports.ROOT_CONFIG_FILENAMES = ROOT_CONFIG_FILENAMES; | ||||
| const RELATIVE_CONFIG_FILENAMES = [".babelrc", ".babelrc.js", ".babelrc.cjs", ".babelrc.mjs", ".babelrc.json", ".babelrc.cts"]; | ||||
| const BABELIGNORE_FILENAME = ".babelignore"; | ||||
| const LOADING_CONFIGS = new Set(); | ||||
| const readConfigCode = (0, _caching.makeStrongCache)(function* readConfigCode(filepath, cache) { | ||||
|   if (!_fs().existsSync(filepath)) { | ||||
|     cache.never(); | ||||
|     return null; | ||||
|   } | ||||
|   if (LOADING_CONFIGS.has(filepath)) { | ||||
|     cache.never(); | ||||
|     debug("Auto-ignoring usage of config %o.", filepath); | ||||
|     return { | ||||
|       filepath, | ||||
|       dirname: _path().dirname(filepath), | ||||
|       options: {} | ||||
|     }; | ||||
|   } | ||||
|   let options; | ||||
|   try { | ||||
|     LOADING_CONFIGS.add(filepath); | ||||
|     options = yield* (0, _moduleTypes.default)(filepath, "You appear to be using a native ECMAScript module configuration " + "file, which is only supported when running Babel asynchronously."); | ||||
|   } finally { | ||||
|     LOADING_CONFIGS.delete(filepath); | ||||
|   } | ||||
|   let assertCache = false; | ||||
|   if (typeof options === "function") { | ||||
|     yield* []; | ||||
|     options = (0, _rewriteStackTrace.endHiddenCallStack)(options)((0, _configApi.makeConfigAPI)(cache)); | ||||
|     assertCache = true; | ||||
|   } | ||||
|   if (!options || typeof options !== "object" || Array.isArray(options)) { | ||||
|     throw new _configError.default(`Configuration should be an exported JavaScript object.`, filepath); | ||||
|   } | ||||
|   if (typeof options.then === "function") { | ||||
|     throw new _configError.default(`You appear to be using an async configuration, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously return your config.`, filepath); | ||||
|   } | ||||
|   if (assertCache && !cache.configured()) throwConfigError(filepath); | ||||
|   return { | ||||
|     filepath, | ||||
|     dirname: _path().dirname(filepath), | ||||
|     options | ||||
|   }; | ||||
| }); | ||||
| const packageToBabelConfig = (0, _caching.makeWeakCacheSync)(file => { | ||||
|   const babel = file.options["babel"]; | ||||
|   if (typeof babel === "undefined") return null; | ||||
|   if (typeof babel !== "object" || Array.isArray(babel) || babel === null) { | ||||
|     throw new _configError.default(`.babel property must be an object`, file.filepath); | ||||
|   } | ||||
|   return { | ||||
|     filepath: file.filepath, | ||||
|     dirname: file.dirname, | ||||
|     options: babel | ||||
|   }; | ||||
| }); | ||||
| const readConfigJSON5 = (0, _utils.makeStaticFileCache)((filepath, content) => { | ||||
|   let options; | ||||
|   try { | ||||
|     options = _json().parse(content); | ||||
|   } catch (err) { | ||||
|     throw new _configError.default(`Error while parsing config - ${err.message}`, filepath); | ||||
|   } | ||||
|   if (!options) throw new _configError.default(`No config detected`, filepath); | ||||
|   if (typeof options !== "object") { | ||||
|     throw new _configError.default(`Config returned typeof ${typeof options}`, filepath); | ||||
|   } | ||||
|   if (Array.isArray(options)) { | ||||
|     throw new _configError.default(`Expected config object but found array`, filepath); | ||||
|   } | ||||
|   delete options["$schema"]; | ||||
|   return { | ||||
|     filepath, | ||||
|     dirname: _path().dirname(filepath), | ||||
|     options | ||||
|   }; | ||||
| }); | ||||
| const readIgnoreConfig = (0, _utils.makeStaticFileCache)((filepath, content) => { | ||||
|   const ignoreDir = _path().dirname(filepath); | ||||
|   const ignorePatterns = content.split("\n").map(line => line.replace(/#(.*?)$/, "").trim()).filter(line => !!line); | ||||
|   for (const pattern of ignorePatterns) { | ||||
|     if (pattern[0] === "!") { | ||||
|       throw new _configError.default(`Negation of file paths is not supported.`, filepath); | ||||
|     } | ||||
|   } | ||||
|   return { | ||||
|     filepath, | ||||
|     dirname: _path().dirname(filepath), | ||||
|     ignore: ignorePatterns.map(pattern => (0, _patternToRegex.default)(pattern, ignoreDir)) | ||||
|   }; | ||||
| }); | ||||
| function findConfigUpwards(rootDir) { | ||||
|   let dirname = rootDir; | ||||
|   for (;;) { | ||||
|     for (const filename of ROOT_CONFIG_FILENAMES) { | ||||
|       if (_fs().existsSync(_path().join(dirname, filename))) { | ||||
|         return dirname; | ||||
|       } | ||||
|     } | ||||
|     const nextDir = _path().dirname(dirname); | ||||
|     if (dirname === nextDir) break; | ||||
|     dirname = nextDir; | ||||
|   } | ||||
|   return null; | ||||
| } | ||||
| function* findRelativeConfig(packageData, envName, caller) { | ||||
|   let config = null; | ||||
|   let ignore = null; | ||||
|   const dirname = _path().dirname(packageData.filepath); | ||||
|   for (const loc of packageData.directories) { | ||||
|     if (!config) { | ||||
|       var _packageData$pkg; | ||||
|       config = yield* loadOneConfig(RELATIVE_CONFIG_FILENAMES, loc, envName, caller, ((_packageData$pkg = packageData.pkg) == null ? void 0 : _packageData$pkg.dirname) === loc ? packageToBabelConfig(packageData.pkg) : null); | ||||
|     } | ||||
|     if (!ignore) { | ||||
|       const ignoreLoc = _path().join(loc, BABELIGNORE_FILENAME); | ||||
|       ignore = yield* readIgnoreConfig(ignoreLoc); | ||||
|       if (ignore) { | ||||
|         debug("Found ignore %o from %o.", ignore.filepath, dirname); | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|   return { | ||||
|     config, | ||||
|     ignore | ||||
|   }; | ||||
| } | ||||
| function findRootConfig(dirname, envName, caller) { | ||||
|   return loadOneConfig(ROOT_CONFIG_FILENAMES, dirname, envName, caller); | ||||
| } | ||||
| function* loadOneConfig(names, dirname, envName, caller, previousConfig = null) { | ||||
|   const configs = yield* _gensync().all(names.map(filename => readConfig(_path().join(dirname, filename), envName, caller))); | ||||
|   const config = configs.reduce((previousConfig, config) => { | ||||
|     if (config && previousConfig) { | ||||
|       throw new _configError.default(`Multiple configuration files found. Please remove one:\n` + ` - ${_path().basename(previousConfig.filepath)}\n` + ` - ${config.filepath}\n` + `from ${dirname}`); | ||||
|     } | ||||
|     return config || previousConfig; | ||||
|   }, previousConfig); | ||||
|   if (config) { | ||||
|     debug("Found configuration %o from %o.", config.filepath, dirname); | ||||
|   } | ||||
|   return config; | ||||
| } | ||||
| function* loadConfig(name, dirname, envName, caller) { | ||||
|   const filepath = (((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, { | ||||
|     paths: [b] | ||||
|   }, M = require("module")) => { | ||||
|     let f = M._findPath(r, M._nodeModulePaths(b).concat(b)); | ||||
|     if (f) return f; | ||||
|     f = new Error(`Cannot resolve module '${r}'`); | ||||
|     f.code = "MODULE_NOT_FOUND"; | ||||
|     throw f; | ||||
|   })(name, { | ||||
|     paths: [dirname] | ||||
|   }); | ||||
|   const conf = yield* readConfig(filepath, envName, caller); | ||||
|   if (!conf) { | ||||
|     throw new _configError.default(`Config file contains no configuration data`, filepath); | ||||
|   } | ||||
|   debug("Loaded config %o from %o.", name, dirname); | ||||
|   return conf; | ||||
| } | ||||
| function readConfig(filepath, envName, caller) { | ||||
|   const ext = _path().extname(filepath); | ||||
|   switch (ext) { | ||||
|     case ".js": | ||||
|     case ".cjs": | ||||
|     case ".mjs": | ||||
|     case ".cts": | ||||
|       return readConfigCode(filepath, { | ||||
|         envName, | ||||
|         caller | ||||
|       }); | ||||
|     default: | ||||
|       return readConfigJSON5(filepath); | ||||
|   } | ||||
| } | ||||
| function* resolveShowConfigPath(dirname) { | ||||
|   const targetPath = process.env.BABEL_SHOW_CONFIG_FOR; | ||||
|   if (targetPath != null) { | ||||
|     const absolutePath = _path().resolve(dirname, targetPath); | ||||
|     const stats = yield* fs.stat(absolutePath); | ||||
|     if (!stats.isFile()) { | ||||
|       throw new Error(`${absolutePath}: BABEL_SHOW_CONFIG_FOR must refer to a regular file, directories are not supported.`); | ||||
|     } | ||||
|     return absolutePath; | ||||
|   } | ||||
|   return null; | ||||
| } | ||||
| function throwConfigError(filepath) { | ||||
|   throw new _configError.default(`\
 | ||||
| Caching was left unconfigured. Babel's plugins, presets, and .babelrc.js files can be configured | ||||
| for various types of caching, using the first param of their handler functions: | ||||
| 
 | ||||
| module.exports = function(api) { | ||||
|   // The API exposes the following:
 | ||||
| 
 | ||||
|   // Cache the returned value forever and don't call this function again.
 | ||||
|   api.cache(true); | ||||
| 
 | ||||
|   // Don't cache at all. Not recommended because it will be very slow.
 | ||||
|   api.cache(false); | ||||
| 
 | ||||
|   // Cached based on the value of some function. If this function returns a value different from
 | ||||
|   // a previously-encountered value, the plugins will re-evaluate.
 | ||||
|   var env = api.cache(() => process.env.NODE_ENV); | ||||
| 
 | ||||
|   // If testing for a specific env, we recommend specifics to avoid instantiating a plugin for
 | ||||
|   // any possible NODE_ENV value that might come up during plugin execution.
 | ||||
|   var isProd = api.cache(() => process.env.NODE_ENV === "production"); | ||||
| 
 | ||||
|   // .cache(fn) will perform a linear search though instances to find the matching plugin based
 | ||||
|   // based on previous instantiated plugins. If you want to recreate the plugin and discard the
 | ||||
|   // previous instance whenever something changes, you may use:
 | ||||
|   var isProd = api.cache.invalidate(() => process.env.NODE_ENV === "production"); | ||||
| 
 | ||||
|   // Note, we also expose the following more-verbose versions of the above examples:
 | ||||
|   api.cache.forever(); // api.cache(true)
 | ||||
|   api.cache.never();   // api.cache(false)
 | ||||
|   api.cache.using(fn); // api.cache(fn)
 | ||||
| 
 | ||||
|   // Return the value that will be cached.
 | ||||
|   return { }; | ||||
| };`, filepath);
 | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=configuration.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/files/configuration.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/files/configuration.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										17
									
								
								node_modules/@babel/core/lib/config/files/import-meta-resolve.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								node_modules/@babel/core/lib/config/files/import-meta-resolve.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.default = resolve; | ||||
| var _importMetaResolve = require("../../vendor/import-meta-resolve"); | ||||
| let importMetaResolve; | ||||
| { | ||||
|   importMetaResolve = _importMetaResolve.resolve; | ||||
| } | ||||
| function resolve(specifier, parent) { | ||||
|   return importMetaResolve(specifier, parent); | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=import-meta-resolve.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/files/import-meta-resolve.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/files/import-meta-resolve.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| {"version":3,"names":["_importMetaResolve","require","importMetaResolve","polyfill","resolve","specifier","parent"],"sources":["../../../src/config/files/import-meta-resolve.ts"],"sourcesContent":["import { resolve as polyfill } from \"../../vendor/import-meta-resolve\";\n\nlet importMetaResolve: (specifier: string, parent: string) => string;\n\nif (USE_ESM) {\n  // Node.js < 20, when using the `--experimental-import-meta-resolve` flag,\n  // have an asynchronous implementation of import.meta.resolve.\n  if (\n    typeof import.meta.resolve === \"function\" &&\n    typeof import.meta.resolve(import.meta.url) === \"string\"\n  ) {\n    // @ts-expect-error: TS defines import.meta as returning a promise\n    importMetaResolve = import.meta.resolve;\n  } else {\n    importMetaResolve = polyfill;\n  }\n} else {\n  importMetaResolve = polyfill;\n}\n\nexport default function resolve(\n  specifier: string,\n  parent?: string | URL,\n): string {\n  // @ts-expect-error: TS defines import.meta.resolve as returning a promises\n  return importMetaResolve(specifier, parent);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAEA,IAAIC,iBAAgE;AAc7D;EACLA,iBAAiB,GAAGC,0BAAQ;AAC9B;AAEe,SAASC,OAAOA,CAC7BC,SAAiB,EACjBC,MAAqB,EACb;EAER,OAAOJ,iBAAiB,CAACG,SAAS,EAAEC,MAAM,CAAC;AAC7C;AAAC"} | ||||
							
								
								
									
										6
									
								
								node_modules/@babel/core/lib/config/files/import.cjs
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								node_modules/@babel/core/lib/config/files/import.cjs
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| module.exports = function import_(filepath) { | ||||
|   return import(filepath); | ||||
| }; | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=import.cjs.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/files/import.cjs.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/files/import.cjs.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| {"version":3,"names":["module","exports","import_","filepath"],"sources":["../../../src/config/files/import.cjs"],"sourcesContent":["// We keep this in a separate file so that in older node versions, where\n// import() isn't supported, we can try/catch around the require() call\n// when loading this file.\n\nmodule.exports = function import_(filepath) {\n  return import(filepath);\n};\n"],"mappings":"AAIAA,MAAM,CAACC,OAAO,GAAG,SAASC,OAAOA,CAACC,QAAQ,EAAE;EAC1C,OAAO,MAAM,CAACA,QAAQ,CAAC;AACzB,CAAC;AAAC"} | ||||
							
								
								
									
										59
									
								
								node_modules/@babel/core/lib/config/files/index-browser.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								node_modules/@babel/core/lib/config/files/index-browser.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,59 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.ROOT_CONFIG_FILENAMES = void 0; | ||||
| exports.findConfigUpwards = findConfigUpwards; | ||||
| exports.findPackageData = findPackageData; | ||||
| exports.findRelativeConfig = findRelativeConfig; | ||||
| exports.findRootConfig = findRootConfig; | ||||
| exports.loadConfig = loadConfig; | ||||
| exports.loadPlugin = loadPlugin; | ||||
| exports.loadPreset = loadPreset; | ||||
| exports.resolvePlugin = resolvePlugin; | ||||
| exports.resolvePreset = resolvePreset; | ||||
| exports.resolveShowConfigPath = resolveShowConfigPath; | ||||
| function findConfigUpwards(rootDir) { | ||||
|   return null; | ||||
| } | ||||
| function* findPackageData(filepath) { | ||||
|   return { | ||||
|     filepath, | ||||
|     directories: [], | ||||
|     pkg: null, | ||||
|     isPackage: false | ||||
|   }; | ||||
| } | ||||
| function* findRelativeConfig(pkgData, envName, caller) { | ||||
|   return { | ||||
|     config: null, | ||||
|     ignore: null | ||||
|   }; | ||||
| } | ||||
| function* findRootConfig(dirname, envName, caller) { | ||||
|   return null; | ||||
| } | ||||
| function* loadConfig(name, dirname, envName, caller) { | ||||
|   throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`); | ||||
| } | ||||
| function* resolveShowConfigPath(dirname) { | ||||
|   return null; | ||||
| } | ||||
| const ROOT_CONFIG_FILENAMES = []; | ||||
| exports.ROOT_CONFIG_FILENAMES = ROOT_CONFIG_FILENAMES; | ||||
| function resolvePlugin(name, dirname) { | ||||
|   return null; | ||||
| } | ||||
| function resolvePreset(name, dirname) { | ||||
|   return null; | ||||
| } | ||||
| function loadPlugin(name, dirname) { | ||||
|   throw new Error(`Cannot load plugin ${name} relative to ${dirname} in a browser`); | ||||
| } | ||||
| function loadPreset(name, dirname) { | ||||
|   throw new Error(`Cannot load preset ${name} relative to ${dirname} in a browser`); | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=index-browser.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/files/index-browser.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/files/index-browser.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| {"version":3,"names":["findConfigUpwards","rootDir","findPackageData","filepath","directories","pkg","isPackage","findRelativeConfig","pkgData","envName","caller","config","ignore","findRootConfig","dirname","loadConfig","name","Error","resolveShowConfigPath","ROOT_CONFIG_FILENAMES","exports","resolvePlugin","resolvePreset","loadPlugin","loadPreset"],"sources":["../../../src/config/files/index-browser.ts"],"sourcesContent":["import type { Handler } from \"gensync\";\n\nimport type {\n  ConfigFile,\n  IgnoreFile,\n  RelativeConfig,\n  FilePackageData,\n} from \"./types\";\n\nimport type { CallerMetadata } from \"../validation/options\";\n\nexport type { ConfigFile, IgnoreFile, RelativeConfig, FilePackageData };\n\nexport function findConfigUpwards(\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  rootDir: string,\n): string | null {\n  return null;\n}\n\n// eslint-disable-next-line require-yield\nexport function* findPackageData(filepath: string): Handler<FilePackageData> {\n  return {\n    filepath,\n    directories: [],\n    pkg: null,\n    isPackage: false,\n  };\n}\n\n// eslint-disable-next-line require-yield\nexport function* findRelativeConfig(\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  pkgData: FilePackageData,\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  envName: string,\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  caller: CallerMetadata | undefined,\n): Handler<RelativeConfig> {\n  return { config: null, ignore: null };\n}\n\n// eslint-disable-next-line require-yield\nexport function* findRootConfig(\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  dirname: string,\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  envName: string,\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  caller: CallerMetadata | undefined,\n): Handler<ConfigFile | null> {\n  return null;\n}\n\n// eslint-disable-next-line require-yield\nexport function* loadConfig(\n  name: string,\n  dirname: string,\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  envName: string,\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  caller: CallerMetadata | undefined,\n): Handler<ConfigFile> {\n  throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`);\n}\n\n// eslint-disable-next-line require-yield\nexport function* resolveShowConfigPath(\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  dirname: string,\n): Handler<string | null> {\n  return null;\n}\n\nexport const ROOT_CONFIG_FILENAMES: string[] = [];\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function resolvePlugin(name: string, dirname: string): string | null {\n  return null;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function resolvePreset(name: string, dirname: string): string | null {\n  return null;\n}\n\nexport function loadPlugin(\n  name: string,\n  dirname: string,\n): Handler<{\n  filepath: string;\n  value: unknown;\n}> {\n  throw new Error(\n    `Cannot load plugin ${name} relative to ${dirname} in a browser`,\n  );\n}\n\nexport function loadPreset(\n  name: string,\n  dirname: string,\n): Handler<{\n  filepath: string;\n  value: unknown;\n}> {\n  throw new Error(\n    `Cannot load preset ${name} relative to ${dirname} in a browser`,\n  );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAaO,SAASA,iBAAiBA,CAE/BC,OAAe,EACA;EACf,OAAO,IAAI;AACb;AAGO,UAAUC,eAAeA,CAACC,QAAgB,EAA4B;EAC3E,OAAO;IACLA,QAAQ;IACRC,WAAW,EAAE,EAAE;IACfC,GAAG,EAAE,IAAI;IACTC,SAAS,EAAE;EACb,CAAC;AACH;AAGO,UAAUC,kBAAkBA,CAEjCC,OAAwB,EAExBC,OAAe,EAEfC,MAAkC,EACT;EACzB,OAAO;IAAEC,MAAM,EAAE,IAAI;IAAEC,MAAM,EAAE;EAAK,CAAC;AACvC;AAGO,UAAUC,cAAcA,CAE7BC,OAAe,EAEfL,OAAe,EAEfC,MAAkC,EACN;EAC5B,OAAO,IAAI;AACb;AAGO,UAAUK,UAAUA,CACzBC,IAAY,EACZF,OAAe,EAEfL,OAAe,EAEfC,MAAkC,EACb;EACrB,MAAM,IAAIO,KAAK,CAAE,eAAcD,IAAK,gBAAeF,OAAQ,eAAc,CAAC;AAC5E;AAGO,UAAUI,qBAAqBA,CAEpCJ,OAAe,EACS;EACxB,OAAO,IAAI;AACb;AAEO,MAAMK,qBAA+B,GAAG,EAAE;AAACC,OAAA,CAAAD,qBAAA,GAAAA,qBAAA;AAG3C,SAASE,aAAaA,CAACL,IAAY,EAAEF,OAAe,EAAiB;EAC1E,OAAO,IAAI;AACb;AAGO,SAASQ,aAAaA,CAACN,IAAY,EAAEF,OAAe,EAAiB;EAC1E,OAAO,IAAI;AACb;AAEO,SAASS,UAAUA,CACxBP,IAAY,EACZF,OAAe,EAId;EACD,MAAM,IAAIG,KAAK,CACZ,sBAAqBD,IAAK,gBAAeF,OAAQ,eACpD,CAAC;AACH;AAEO,SAASU,UAAUA,CACxBR,IAAY,EACZF,OAAe,EAId;EACD,MAAM,IAAIG,KAAK,CACZ,sBAAqBD,IAAK,gBAAeF,OAAQ,eACpD,CAAC;AACH;AAAC"} | ||||
							
								
								
									
										78
									
								
								node_modules/@babel/core/lib/config/files/index.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								node_modules/@babel/core/lib/config/files/index.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,78 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| Object.defineProperty(exports, "ROOT_CONFIG_FILENAMES", { | ||||
|   enumerable: true, | ||||
|   get: function () { | ||||
|     return _configuration.ROOT_CONFIG_FILENAMES; | ||||
|   } | ||||
| }); | ||||
| Object.defineProperty(exports, "findConfigUpwards", { | ||||
|   enumerable: true, | ||||
|   get: function () { | ||||
|     return _configuration.findConfigUpwards; | ||||
|   } | ||||
| }); | ||||
| Object.defineProperty(exports, "findPackageData", { | ||||
|   enumerable: true, | ||||
|   get: function () { | ||||
|     return _package.findPackageData; | ||||
|   } | ||||
| }); | ||||
| Object.defineProperty(exports, "findRelativeConfig", { | ||||
|   enumerable: true, | ||||
|   get: function () { | ||||
|     return _configuration.findRelativeConfig; | ||||
|   } | ||||
| }); | ||||
| Object.defineProperty(exports, "findRootConfig", { | ||||
|   enumerable: true, | ||||
|   get: function () { | ||||
|     return _configuration.findRootConfig; | ||||
|   } | ||||
| }); | ||||
| Object.defineProperty(exports, "loadConfig", { | ||||
|   enumerable: true, | ||||
|   get: function () { | ||||
|     return _configuration.loadConfig; | ||||
|   } | ||||
| }); | ||||
| Object.defineProperty(exports, "loadPlugin", { | ||||
|   enumerable: true, | ||||
|   get: function () { | ||||
|     return _plugins.loadPlugin; | ||||
|   } | ||||
| }); | ||||
| Object.defineProperty(exports, "loadPreset", { | ||||
|   enumerable: true, | ||||
|   get: function () { | ||||
|     return _plugins.loadPreset; | ||||
|   } | ||||
| }); | ||||
| Object.defineProperty(exports, "resolvePlugin", { | ||||
|   enumerable: true, | ||||
|   get: function () { | ||||
|     return _plugins.resolvePlugin; | ||||
|   } | ||||
| }); | ||||
| Object.defineProperty(exports, "resolvePreset", { | ||||
|   enumerable: true, | ||||
|   get: function () { | ||||
|     return _plugins.resolvePreset; | ||||
|   } | ||||
| }); | ||||
| Object.defineProperty(exports, "resolveShowConfigPath", { | ||||
|   enumerable: true, | ||||
|   get: function () { | ||||
|     return _configuration.resolveShowConfigPath; | ||||
|   } | ||||
| }); | ||||
| var _package = require("./package"); | ||||
| var _configuration = require("./configuration"); | ||||
| var _plugins = require("./plugins"); | ||||
| ({}); | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=index.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/files/index.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/files/index.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| {"version":3,"names":["_package","require","_configuration","_plugins"],"sources":["../../../src/config/files/index.ts"],"sourcesContent":["type indexBrowserType = typeof import(\"./index-browser\");\ntype indexType = typeof import(\"./index\");\n\n// Kind of gross, but essentially asserting that the exports of this module are the same as the\n// exports of index-browser, since this file may be replaced at bundle time with index-browser.\n({}) as any as indexBrowserType as indexType;\n\nexport { findPackageData } from \"./package\";\n\nexport {\n  findConfigUpwards,\n  findRelativeConfig,\n  findRootConfig,\n  loadConfig,\n  resolveShowConfigPath,\n  ROOT_CONFIG_FILENAMES,\n} from \"./configuration\";\nexport type {\n  ConfigFile,\n  IgnoreFile,\n  RelativeConfig,\n  FilePackageData,\n} from \"./types\";\nexport {\n  loadPlugin,\n  loadPreset,\n  resolvePlugin,\n  resolvePreset,\n} from \"./plugins\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAD,OAAA;AAcA,IAAAE,QAAA,GAAAF,OAAA;AAlBA,CAAC,CAAC,CAAC;AAA0C"} | ||||
							
								
								
									
										155
									
								
								node_modules/@babel/core/lib/config/files/module-types.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										155
									
								
								node_modules/@babel/core/lib/config/files/module-types.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,155 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.default = loadCodeDefault; | ||||
| exports.supportsESM = void 0; | ||||
| var _async = require("../../gensync-utils/async"); | ||||
| function _path() { | ||||
|   const data = require("path"); | ||||
|   _path = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| function _url() { | ||||
|   const data = require("url"); | ||||
|   _url = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| function _semver() { | ||||
|   const data = require("semver"); | ||||
|   _semver = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| var _rewriteStackTrace = require("../../errors/rewrite-stack-trace"); | ||||
| var _configError = require("../../errors/config-error"); | ||||
| var _transformFile = require("../../transform-file"); | ||||
| function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } | ||||
| function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } | ||||
| let import_; | ||||
| try { | ||||
|   import_ = require("./import.cjs"); | ||||
| } catch (_unused) {} | ||||
| const supportsESM = _semver().satisfies(process.versions.node, "^12.17 || >=13.2"); | ||||
| exports.supportsESM = supportsESM; | ||||
| function* loadCodeDefault(filepath, asyncError) { | ||||
|   switch (_path().extname(filepath)) { | ||||
|     case ".cjs": | ||||
|       { | ||||
|         return loadCjsDefault(filepath, arguments[2]); | ||||
|       } | ||||
|     case ".mjs": | ||||
|       break; | ||||
|     case ".cts": | ||||
|       return loadCtsDefault(filepath); | ||||
|     default: | ||||
|       try { | ||||
|         { | ||||
|           return loadCjsDefault(filepath, arguments[2]); | ||||
|         } | ||||
|       } catch (e) { | ||||
|         if (e.code !== "ERR_REQUIRE_ESM") throw e; | ||||
|       } | ||||
|   } | ||||
|   if (yield* (0, _async.isAsync)()) { | ||||
|     return yield* (0, _async.waitFor)(loadMjsDefault(filepath)); | ||||
|   } | ||||
|   throw new _configError.default(asyncError, filepath); | ||||
| } | ||||
| function loadCtsDefault(filepath) { | ||||
|   const ext = ".cts"; | ||||
|   const hasTsSupport = !!(require.extensions[".ts"] || require.extensions[".cts"] || require.extensions[".mts"]); | ||||
|   let handler; | ||||
|   if (!hasTsSupport) { | ||||
|     const opts = { | ||||
|       babelrc: false, | ||||
|       configFile: false, | ||||
|       sourceType: "unambiguous", | ||||
|       sourceMaps: "inline", | ||||
|       sourceFileName: _path().basename(filepath), | ||||
|       presets: [[getTSPreset(filepath), Object.assign({ | ||||
|         onlyRemoveTypeImports: true, | ||||
|         optimizeConstEnums: true | ||||
|       }, { | ||||
|         allowDeclareFields: true | ||||
|       })]] | ||||
|     }; | ||||
|     handler = function (m, filename) { | ||||
|       if (handler && filename.endsWith(ext)) { | ||||
|         try { | ||||
|           return m._compile((0, _transformFile.transformFileSync)(filename, Object.assign({}, opts, { | ||||
|             filename | ||||
|           })).code, filename); | ||||
|         } catch (error) { | ||||
|           if (!hasTsSupport) { | ||||
|             const packageJson = require("@babel/preset-typescript/package.json"); | ||||
|             if (_semver().lt(packageJson.version, "7.21.4")) { | ||||
|               console.error("`.cts` configuration file failed to load, please try to update `@babel/preset-typescript`."); | ||||
|             } | ||||
|           } | ||||
|           throw error; | ||||
|         } | ||||
|       } | ||||
|       return require.extensions[".js"](m, filename); | ||||
|     }; | ||||
|     require.extensions[ext] = handler; | ||||
|   } | ||||
|   try { | ||||
|     const module = (0, _rewriteStackTrace.endHiddenCallStack)(require)(filepath); | ||||
|     return module != null && module.__esModule ? module.default : module; | ||||
|   } finally { | ||||
|     if (!hasTsSupport) { | ||||
|       if (require.extensions[ext] === handler) delete require.extensions[ext]; | ||||
|       handler = undefined; | ||||
|     } | ||||
|   } | ||||
| } | ||||
| function loadCjsDefault(filepath) { | ||||
|   const module = (0, _rewriteStackTrace.endHiddenCallStack)(require)(filepath); | ||||
|   { | ||||
|     return module != null && module.__esModule ? module.default || (arguments[1] ? module : undefined) : module; | ||||
|   } | ||||
| } | ||||
| function loadMjsDefault(_x) { | ||||
|   return _loadMjsDefault.apply(this, arguments); | ||||
| } | ||||
| function _loadMjsDefault() { | ||||
|   _loadMjsDefault = _asyncToGenerator(function* (filepath) { | ||||
|     if (!import_) { | ||||
|       throw new _configError.default("Internal error: Native ECMAScript modules aren't supported by this platform.\n", filepath); | ||||
|     } | ||||
|     const module = yield (0, _rewriteStackTrace.endHiddenCallStack)(import_)((0, _url().pathToFileURL)(filepath)); | ||||
|     return module.default; | ||||
|   }); | ||||
|   return _loadMjsDefault.apply(this, arguments); | ||||
| } | ||||
| function getTSPreset(filepath) { | ||||
|   try { | ||||
|     return require("@babel/preset-typescript"); | ||||
|   } catch (error) { | ||||
|     if (error.code !== "MODULE_NOT_FOUND") throw error; | ||||
|     let message = "You appear to be using a .cts file as Babel configuration, but the `@babel/preset-typescript` package was not found: please install it!"; | ||||
|     { | ||||
|       if (process.versions.pnp) { | ||||
|         message += ` | ||||
| If you are using Yarn Plug'n'Play, you may also need to add the following configuration to your .yarnrc.yml file: | ||||
| 
 | ||||
| packageExtensions: | ||||
| \t"@babel/core@*": | ||||
| \t\tpeerDependencies: | ||||
| \t\t\t"@babel/preset-typescript": "*" | ||||
| `;
 | ||||
|       } | ||||
|     } | ||||
|     throw new _configError.default(message, filepath); | ||||
|   } | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=module-types.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/files/module-types.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/files/module-types.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										61
									
								
								node_modules/@babel/core/lib/config/files/package.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								node_modules/@babel/core/lib/config/files/package.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,61 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.findPackageData = findPackageData; | ||||
| function _path() { | ||||
|   const data = require("path"); | ||||
|   _path = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| var _utils = require("./utils"); | ||||
| var _configError = require("../../errors/config-error"); | ||||
| const PACKAGE_FILENAME = "package.json"; | ||||
| const readConfigPackage = (0, _utils.makeStaticFileCache)((filepath, content) => { | ||||
|   let options; | ||||
|   try { | ||||
|     options = JSON.parse(content); | ||||
|   } catch (err) { | ||||
|     throw new _configError.default(`Error while parsing JSON - ${err.message}`, filepath); | ||||
|   } | ||||
|   if (!options) throw new Error(`${filepath}: No config detected`); | ||||
|   if (typeof options !== "object") { | ||||
|     throw new _configError.default(`Config returned typeof ${typeof options}`, filepath); | ||||
|   } | ||||
|   if (Array.isArray(options)) { | ||||
|     throw new _configError.default(`Expected config object but found array`, filepath); | ||||
|   } | ||||
|   return { | ||||
|     filepath, | ||||
|     dirname: _path().dirname(filepath), | ||||
|     options | ||||
|   }; | ||||
| }); | ||||
| function* findPackageData(filepath) { | ||||
|   let pkg = null; | ||||
|   const directories = []; | ||||
|   let isPackage = true; | ||||
|   let dirname = _path().dirname(filepath); | ||||
|   while (!pkg && _path().basename(dirname) !== "node_modules") { | ||||
|     directories.push(dirname); | ||||
|     pkg = yield* readConfigPackage(_path().join(dirname, PACKAGE_FILENAME)); | ||||
|     const nextLoc = _path().dirname(dirname); | ||||
|     if (dirname === nextLoc) { | ||||
|       isPackage = false; | ||||
|       break; | ||||
|     } | ||||
|     dirname = nextLoc; | ||||
|   } | ||||
|   return { | ||||
|     filepath, | ||||
|     directories, | ||||
|     pkg, | ||||
|     isPackage | ||||
|   }; | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=package.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/files/package.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/files/package.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| {"version":3,"names":["_path","data","require","_utils","_configError","PACKAGE_FILENAME","readConfigPackage","makeStaticFileCache","filepath","content","options","JSON","parse","err","ConfigError","message","Error","Array","isArray","dirname","path","findPackageData","pkg","directories","isPackage","basename","push","join","nextLoc"],"sources":["../../../src/config/files/package.ts"],"sourcesContent":["import path from \"path\";\nimport type { Handler } from \"gensync\";\nimport { makeStaticFileCache } from \"./utils\";\n\nimport type { ConfigFile, FilePackageData } from \"./types\";\n\nimport ConfigError from \"../../errors/config-error\";\n\nconst PACKAGE_FILENAME = \"package.json\";\n\nconst readConfigPackage = makeStaticFileCache(\n  (filepath, content): ConfigFile => {\n    let options;\n    try {\n      options = JSON.parse(content) as unknown;\n    } catch (err) {\n      throw new ConfigError(\n        `Error while parsing JSON - ${err.message}`,\n        filepath,\n      );\n    }\n\n    if (!options) throw new Error(`${filepath}: No config detected`);\n\n    if (typeof options !== \"object\") {\n      throw new ConfigError(\n        `Config returned typeof ${typeof options}`,\n        filepath,\n      );\n    }\n    if (Array.isArray(options)) {\n      throw new ConfigError(`Expected config object but found array`, filepath);\n    }\n\n    return {\n      filepath,\n      dirname: path.dirname(filepath),\n      options,\n    };\n  },\n);\n\n/**\n * Find metadata about the package that this file is inside of. Resolution\n * of Babel's config requires general package information to decide when to\n * search for .babelrc files\n */\nexport function* findPackageData(filepath: string): Handler<FilePackageData> {\n  let pkg = null;\n  const directories = [];\n  let isPackage = true;\n\n  let dirname = path.dirname(filepath);\n  while (!pkg && path.basename(dirname) !== \"node_modules\") {\n    directories.push(dirname);\n\n    pkg = yield* readConfigPackage(path.join(dirname, PACKAGE_FILENAME));\n\n    const nextLoc = path.dirname(dirname);\n    if (dirname === nextLoc) {\n      isPackage = false;\n      break;\n    }\n    dirname = nextLoc;\n  }\n\n  return { filepath, directories, pkg, isPackage };\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAE,MAAA,GAAAD,OAAA;AAIA,IAAAE,YAAA,GAAAF,OAAA;AAEA,MAAMG,gBAAgB,GAAG,cAAc;AAEvC,MAAMC,iBAAiB,GAAG,IAAAC,0BAAmB,EAC3C,CAACC,QAAQ,EAAEC,OAAO,KAAiB;EACjC,IAAIC,OAAO;EACX,IAAI;IACFA,OAAO,GAAGC,IAAI,CAACC,KAAK,CAACH,OAAO,CAAY;EAC1C,CAAC,CAAC,OAAOI,GAAG,EAAE;IACZ,MAAM,IAAIC,oBAAW,CAClB,8BAA6BD,GAAG,CAACE,OAAQ,EAAC,EAC3CP,QACF,CAAC;EACH;EAEA,IAAI,CAACE,OAAO,EAAE,MAAM,IAAIM,KAAK,CAAE,GAAER,QAAS,sBAAqB,CAAC;EAEhE,IAAI,OAAOE,OAAO,KAAK,QAAQ,EAAE;IAC/B,MAAM,IAAII,oBAAW,CAClB,0BAAyB,OAAOJ,OAAQ,EAAC,EAC1CF,QACF,CAAC;EACH;EACA,IAAIS,KAAK,CAACC,OAAO,CAACR,OAAO,CAAC,EAAE;IAC1B,MAAM,IAAII,oBAAW,CAAE,wCAAuC,EAAEN,QAAQ,CAAC;EAC3E;EAEA,OAAO;IACLA,QAAQ;IACRW,OAAO,EAAEC,MAAGA,CAAC,CAACD,OAAO,CAACX,QAAQ,CAAC;IAC/BE;EACF,CAAC;AACH,CACF,CAAC;AAOM,UAAUW,eAAeA,CAACb,QAAgB,EAA4B;EAC3E,IAAIc,GAAG,GAAG,IAAI;EACd,MAAMC,WAAW,GAAG,EAAE;EACtB,IAAIC,SAAS,GAAG,IAAI;EAEpB,IAAIL,OAAO,GAAGC,MAAGA,CAAC,CAACD,OAAO,CAACX,QAAQ,CAAC;EACpC,OAAO,CAACc,GAAG,IAAIF,MAAGA,CAAC,CAACK,QAAQ,CAACN,OAAO,CAAC,KAAK,cAAc,EAAE;IACxDI,WAAW,CAACG,IAAI,CAACP,OAAO,CAAC;IAEzBG,GAAG,GAAG,OAAOhB,iBAAiB,CAACc,MAAGA,CAAC,CAACO,IAAI,CAACR,OAAO,EAAEd,gBAAgB,CAAC,CAAC;IAEpE,MAAMuB,OAAO,GAAGR,MAAGA,CAAC,CAACD,OAAO,CAACA,OAAO,CAAC;IACrC,IAAIA,OAAO,KAAKS,OAAO,EAAE;MACvBJ,SAAS,GAAG,KAAK;MACjB;IACF;IACAL,OAAO,GAAGS,OAAO;EACnB;EAEA,OAAO;IAAEpB,QAAQ;IAAEe,WAAW;IAAED,GAAG;IAAEE;EAAU,CAAC;AAClD;AAAC"} | ||||
							
								
								
									
										206
									
								
								node_modules/@babel/core/lib/config/files/plugins.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										206
									
								
								node_modules/@babel/core/lib/config/files/plugins.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,206 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.loadPlugin = loadPlugin; | ||||
| exports.loadPreset = loadPreset; | ||||
| exports.resolvePreset = exports.resolvePlugin = void 0; | ||||
| function _debug() { | ||||
|   const data = require("debug"); | ||||
|   _debug = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| function _path() { | ||||
|   const data = require("path"); | ||||
|   _path = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| var _async = require("../../gensync-utils/async"); | ||||
| var _moduleTypes = require("./module-types"); | ||||
| function _url() { | ||||
|   const data = require("url"); | ||||
|   _url = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| var _importMetaResolve = require("./import-meta-resolve"); | ||||
| const debug = _debug()("babel:config:loading:files:plugins"); | ||||
| const EXACT_RE = /^module:/; | ||||
| const BABEL_PLUGIN_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-plugin-)/; | ||||
| const BABEL_PRESET_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-preset-)/; | ||||
| const BABEL_PLUGIN_ORG_RE = /^(@babel\/)(?!plugin-|[^/]+\/)/; | ||||
| const BABEL_PRESET_ORG_RE = /^(@babel\/)(?!preset-|[^/]+\/)/; | ||||
| const OTHER_PLUGIN_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-plugin(?:-|\/|$)|[^/]+\/)/; | ||||
| const OTHER_PRESET_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-preset(?:-|\/|$)|[^/]+\/)/; | ||||
| const OTHER_ORG_DEFAULT_RE = /^(@(?!babel$)[^/]+)$/; | ||||
| const resolvePlugin = resolveStandardizedName.bind(null, "plugin"); | ||||
| exports.resolvePlugin = resolvePlugin; | ||||
| const resolvePreset = resolveStandardizedName.bind(null, "preset"); | ||||
| exports.resolvePreset = resolvePreset; | ||||
| function* loadPlugin(name, dirname) { | ||||
|   const filepath = resolvePlugin(name, dirname, yield* (0, _async.isAsync)()); | ||||
|   const value = yield* requireModule("plugin", filepath); | ||||
|   debug("Loaded plugin %o from %o.", name, dirname); | ||||
|   return { | ||||
|     filepath, | ||||
|     value | ||||
|   }; | ||||
| } | ||||
| function* loadPreset(name, dirname) { | ||||
|   const filepath = resolvePreset(name, dirname, yield* (0, _async.isAsync)()); | ||||
|   const value = yield* requireModule("preset", filepath); | ||||
|   debug("Loaded preset %o from %o.", name, dirname); | ||||
|   return { | ||||
|     filepath, | ||||
|     value | ||||
|   }; | ||||
| } | ||||
| function standardizeName(type, name) { | ||||
|   if (_path().isAbsolute(name)) return name; | ||||
|   const isPreset = type === "preset"; | ||||
|   return name.replace(isPreset ? BABEL_PRESET_PREFIX_RE : BABEL_PLUGIN_PREFIX_RE, `babel-${type}-`).replace(isPreset ? BABEL_PRESET_ORG_RE : BABEL_PLUGIN_ORG_RE, `$1${type}-`).replace(isPreset ? OTHER_PRESET_ORG_RE : OTHER_PLUGIN_ORG_RE, `$1babel-${type}-`).replace(OTHER_ORG_DEFAULT_RE, `$1/babel-${type}`).replace(EXACT_RE, ""); | ||||
| } | ||||
| function* resolveAlternativesHelper(type, name) { | ||||
|   const standardizedName = standardizeName(type, name); | ||||
|   const { | ||||
|     error, | ||||
|     value | ||||
|   } = yield standardizedName; | ||||
|   if (!error) return value; | ||||
|   if (error.code !== "MODULE_NOT_FOUND") throw error; | ||||
|   if (standardizedName !== name && !(yield name).error) { | ||||
|     error.message += `\n- If you want to resolve "${name}", use "module:${name}"`; | ||||
|   } | ||||
|   if (!(yield standardizeName(type, "@babel/" + name)).error) { | ||||
|     error.message += `\n- Did you mean "@babel/${name}"?`; | ||||
|   } | ||||
|   const oppositeType = type === "preset" ? "plugin" : "preset"; | ||||
|   if (!(yield standardizeName(oppositeType, name)).error) { | ||||
|     error.message += `\n- Did you accidentally pass a ${oppositeType} as a ${type}?`; | ||||
|   } | ||||
|   if (type === "plugin") { | ||||
|     const transformName = standardizedName.replace("-proposal-", "-transform-"); | ||||
|     if (transformName !== standardizedName && !(yield transformName).error) { | ||||
|       error.message += `\n- Did you mean "${transformName}"?`; | ||||
|     } | ||||
|   } | ||||
|   error.message += `\n | ||||
| Make sure that all the Babel plugins and presets you are using | ||||
| are defined as dependencies or devDependencies in your package.json | ||||
| file. It's possible that the missing plugin is loaded by a preset | ||||
| you are using that forgot to add the plugin to its dependencies: you | ||||
| can workaround this problem by explicitly adding the missing package | ||||
| to your top-level package.json. | ||||
| `;
 | ||||
|   throw error; | ||||
| } | ||||
| function tryRequireResolve(id, dirname) { | ||||
|   try { | ||||
|     if (dirname) { | ||||
|       return { | ||||
|         error: null, | ||||
|         value: (((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, { | ||||
|           paths: [b] | ||||
|         }, M = require("module")) => { | ||||
|           let f = M._findPath(r, M._nodeModulePaths(b).concat(b)); | ||||
|           if (f) return f; | ||||
|           f = new Error(`Cannot resolve module '${r}'`); | ||||
|           f.code = "MODULE_NOT_FOUND"; | ||||
|           throw f; | ||||
|         })(id, { | ||||
|           paths: [dirname] | ||||
|         }) | ||||
|       }; | ||||
|     } else { | ||||
|       return { | ||||
|         error: null, | ||||
|         value: require.resolve(id) | ||||
|       }; | ||||
|     } | ||||
|   } catch (error) { | ||||
|     return { | ||||
|       error, | ||||
|       value: null | ||||
|     }; | ||||
|   } | ||||
| } | ||||
| function tryImportMetaResolve(id, options) { | ||||
|   try { | ||||
|     return { | ||||
|       error: null, | ||||
|       value: (0, _importMetaResolve.default)(id, options) | ||||
|     }; | ||||
|   } catch (error) { | ||||
|     return { | ||||
|       error, | ||||
|       value: null | ||||
|     }; | ||||
|   } | ||||
| } | ||||
| function resolveStandardizedNameForRequire(type, name, dirname) { | ||||
|   const it = resolveAlternativesHelper(type, name); | ||||
|   let res = it.next(); | ||||
|   while (!res.done) { | ||||
|     res = it.next(tryRequireResolve(res.value, dirname)); | ||||
|   } | ||||
|   return res.value; | ||||
| } | ||||
| function resolveStandardizedNameForImport(type, name, dirname) { | ||||
|   const parentUrl = (0, _url().pathToFileURL)(_path().join(dirname, "./babel-virtual-resolve-base.js")).href; | ||||
|   const it = resolveAlternativesHelper(type, name); | ||||
|   let res = it.next(); | ||||
|   while (!res.done) { | ||||
|     res = it.next(tryImportMetaResolve(res.value, parentUrl)); | ||||
|   } | ||||
|   return (0, _url().fileURLToPath)(res.value); | ||||
| } | ||||
| function resolveStandardizedName(type, name, dirname, resolveESM) { | ||||
|   if (!_moduleTypes.supportsESM || !resolveESM) { | ||||
|     return resolveStandardizedNameForRequire(type, name, dirname); | ||||
|   } | ||||
|   try { | ||||
|     return resolveStandardizedNameForImport(type, name, dirname); | ||||
|   } catch (e) { | ||||
|     try { | ||||
|       return resolveStandardizedNameForRequire(type, name, dirname); | ||||
|     } catch (e2) { | ||||
|       if (e.type === "MODULE_NOT_FOUND") throw e; | ||||
|       if (e2.type === "MODULE_NOT_FOUND") throw e2; | ||||
|       throw e; | ||||
|     } | ||||
|   } | ||||
| } | ||||
| { | ||||
|   var LOADING_MODULES = new Set(); | ||||
| } | ||||
| function* requireModule(type, name) { | ||||
|   { | ||||
|     if (!(yield* (0, _async.isAsync)()) && LOADING_MODULES.has(name)) { | ||||
|       throw new Error(`Reentrant ${type} detected trying to load "${name}". This module is not ignored ` + "and is trying to load itself while compiling itself, leading to a dependency cycle. " + 'We recommend adding it to your "ignore" list in your babelrc, or to a .babelignore.'); | ||||
|     } | ||||
|   } | ||||
|   try { | ||||
|     { | ||||
|       LOADING_MODULES.add(name); | ||||
|     } | ||||
|     { | ||||
|       return yield* (0, _moduleTypes.default)(name, `You appear to be using a native ECMAScript module ${type}, ` + "which is only supported when running Babel asynchronously.", true); | ||||
|     } | ||||
|   } catch (err) { | ||||
|     err.message = `[BABEL]: ${err.message} (While processing: ${name})`; | ||||
|     throw err; | ||||
|   } finally { | ||||
|     { | ||||
|       LOADING_MODULES.delete(name); | ||||
|     } | ||||
|   } | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=plugins.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/files/plugins.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/files/plugins.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										3
									
								
								node_modules/@babel/core/lib/config/files/types.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								node_modules/@babel/core/lib/config/files/types.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,3 @@ | |||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=types.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/files/types.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/files/types.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| {"version":3,"names":[],"sources":["../../../src/config/files/types.ts"],"sourcesContent":["import type { InputOptions } from \"..\";\n\nexport type ConfigFile = {\n  filepath: string;\n  dirname: string;\n  options: InputOptions & { babel?: unknown };\n};\n\nexport type IgnoreFile = {\n  filepath: string;\n  dirname: string;\n  ignore: Array<RegExp>;\n};\n\nexport type RelativeConfig = {\n  // The actual config, either from package.json#babel, .babelrc, or\n  // .babelrc.js, if there was one.\n  config: ConfigFile | null;\n  // The .babelignore, if there was one.\n  ignore: IgnoreFile | null;\n};\n\nexport type FilePackageData = {\n  // The file in the package.\n  filepath: string;\n  // Any ancestor directories of the file that are within the package.\n  directories: Array<string>;\n  // The contents of the package.json. May not be found if the package just\n  // terminated at a node_modules folder without finding one.\n  pkg: ConfigFile | null;\n  // True if a package.json or node_modules folder was found while traversing\n  // the directory structure.\n  isPackage: boolean;\n};\n"],"mappings":""} | ||||
							
								
								
									
										36
									
								
								node_modules/@babel/core/lib/config/files/utils.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								node_modules/@babel/core/lib/config/files/utils.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,36 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.makeStaticFileCache = makeStaticFileCache; | ||||
| var _caching = require("../caching"); | ||||
| var fs = require("../../gensync-utils/fs"); | ||||
| function _fs2() { | ||||
|   const data = require("fs"); | ||||
|   _fs2 = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| function makeStaticFileCache(fn) { | ||||
|   return (0, _caching.makeStrongCache)(function* (filepath, cache) { | ||||
|     const cached = cache.invalidate(() => fileMtime(filepath)); | ||||
|     if (cached === null) { | ||||
|       return null; | ||||
|     } | ||||
|     return fn(filepath, yield* fs.readFile(filepath, "utf8")); | ||||
|   }); | ||||
| } | ||||
| function fileMtime(filepath) { | ||||
|   if (!_fs2().existsSync(filepath)) return null; | ||||
|   try { | ||||
|     return +_fs2().statSync(filepath).mtime; | ||||
|   } catch (e) { | ||||
|     if (e.code !== "ENOENT" && e.code !== "ENOTDIR") throw e; | ||||
|   } | ||||
|   return null; | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=utils.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/files/utils.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/files/utils.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| {"version":3,"names":["_caching","require","fs","_fs2","data","makeStaticFileCache","fn","makeStrongCache","filepath","cache","cached","invalidate","fileMtime","readFile","nodeFs","existsSync","statSync","mtime","e","code"],"sources":["../../../src/config/files/utils.ts"],"sourcesContent":["import type { Handler } from \"gensync\";\n\nimport { makeStrongCache } from \"../caching\";\nimport type { CacheConfigurator } from \"../caching\";\nimport * as fs from \"../../gensync-utils/fs\";\nimport nodeFs from \"fs\";\n\nexport function makeStaticFileCache<T>(\n  fn: (filepath: string, contents: string) => T,\n) {\n  return makeStrongCache(function* (\n    filepath: string,\n    cache: CacheConfigurator<void>,\n  ): Handler<null | T> {\n    const cached = cache.invalidate(() => fileMtime(filepath));\n\n    if (cached === null) {\n      return null;\n    }\n\n    return fn(filepath, yield* fs.readFile(filepath, \"utf8\"));\n  });\n}\n\nfunction fileMtime(filepath: string): number | null {\n  if (!nodeFs.existsSync(filepath)) return null;\n\n  try {\n    return +nodeFs.statSync(filepath).mtime;\n  } catch (e) {\n    if (e.code !== \"ENOENT\" && e.code !== \"ENOTDIR\") throw e;\n  }\n\n  return null;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,EAAA,GAAAD,OAAA;AACA,SAAAE,KAAA;EAAA,MAAAC,IAAA,GAAAH,OAAA;EAAAE,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,SAASC,mBAAmBA,CACjCC,EAA6C,EAC7C;EACA,OAAO,IAAAC,wBAAe,EAAC,WACrBC,QAAgB,EAChBC,KAA8B,EACX;IACnB,MAAMC,MAAM,GAAGD,KAAK,CAACE,UAAU,CAAC,MAAMC,SAAS,CAACJ,QAAQ,CAAC,CAAC;IAE1D,IAAIE,MAAM,KAAK,IAAI,EAAE;MACnB,OAAO,IAAI;IACb;IAEA,OAAOJ,EAAE,CAACE,QAAQ,EAAE,OAAON,EAAE,CAACW,QAAQ,CAACL,QAAQ,EAAE,MAAM,CAAC,CAAC;EAC3D,CAAC,CAAC;AACJ;AAEA,SAASI,SAASA,CAACJ,QAAgB,EAAiB;EAClD,IAAI,CAACM,KAAKA,CAAC,CAACC,UAAU,CAACP,QAAQ,CAAC,EAAE,OAAO,IAAI;EAE7C,IAAI;IACF,OAAO,CAACM,KAAKA,CAAC,CAACE,QAAQ,CAACR,QAAQ,CAAC,CAACS,KAAK;EACzC,CAAC,CAAC,OAAOC,CAAC,EAAE;IACV,IAAIA,CAAC,CAACC,IAAI,KAAK,QAAQ,IAAID,CAAC,CAACC,IAAI,KAAK,SAAS,EAAE,MAAMD,CAAC;EAC1D;EAEA,OAAO,IAAI;AACb;AAAC"} | ||||
							
								
								
									
										311
									
								
								node_modules/@babel/core/lib/config/full.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										311
									
								
								node_modules/@babel/core/lib/config/full.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,311 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.default = void 0; | ||||
| function _gensync() { | ||||
|   const data = require("gensync"); | ||||
|   _gensync = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| var _async = require("../gensync-utils/async"); | ||||
| var _util = require("./util"); | ||||
| var context = require("../index"); | ||||
| var _plugin = require("./plugin"); | ||||
| var _item = require("./item"); | ||||
| var _configChain = require("./config-chain"); | ||||
| var _deepArray = require("./helpers/deep-array"); | ||||
| function _traverse() { | ||||
|   const data = require("@babel/traverse"); | ||||
|   _traverse = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| var _caching = require("./caching"); | ||||
| var _options = require("./validation/options"); | ||||
| var _plugins = require("./validation/plugins"); | ||||
| var _configApi = require("./helpers/config-api"); | ||||
| var _partial = require("./partial"); | ||||
| var _configError = require("../errors/config-error"); | ||||
| var _default = _gensync()(function* loadFullConfig(inputOpts) { | ||||
|   var _opts$assumptions; | ||||
|   const result = yield* (0, _partial.default)(inputOpts); | ||||
|   if (!result) { | ||||
|     return null; | ||||
|   } | ||||
|   const { | ||||
|     options, | ||||
|     context, | ||||
|     fileHandling | ||||
|   } = result; | ||||
|   if (fileHandling === "ignored") { | ||||
|     return null; | ||||
|   } | ||||
|   const optionDefaults = {}; | ||||
|   const { | ||||
|     plugins, | ||||
|     presets | ||||
|   } = options; | ||||
|   if (!plugins || !presets) { | ||||
|     throw new Error("Assertion failure - plugins and presets exist"); | ||||
|   } | ||||
|   const presetContext = Object.assign({}, context, { | ||||
|     targets: options.targets | ||||
|   }); | ||||
|   const toDescriptor = item => { | ||||
|     const desc = (0, _item.getItemDescriptor)(item); | ||||
|     if (!desc) { | ||||
|       throw new Error("Assertion failure - must be config item"); | ||||
|     } | ||||
|     return desc; | ||||
|   }; | ||||
|   const presetsDescriptors = presets.map(toDescriptor); | ||||
|   const initialPluginsDescriptors = plugins.map(toDescriptor); | ||||
|   const pluginDescriptorsByPass = [[]]; | ||||
|   const passes = []; | ||||
|   const externalDependencies = []; | ||||
|   const ignored = yield* enhanceError(context, function* recursePresetDescriptors(rawPresets, pluginDescriptorsPass) { | ||||
|     const presets = []; | ||||
|     for (let i = 0; i < rawPresets.length; i++) { | ||||
|       const descriptor = rawPresets[i]; | ||||
|       if (descriptor.options !== false) { | ||||
|         try { | ||||
|           var preset = yield* loadPresetDescriptor(descriptor, presetContext); | ||||
|         } catch (e) { | ||||
|           if (e.code === "BABEL_UNKNOWN_OPTION") { | ||||
|             (0, _options.checkNoUnwrappedItemOptionPairs)(rawPresets, i, "preset", e); | ||||
|           } | ||||
|           throw e; | ||||
|         } | ||||
|         externalDependencies.push(preset.externalDependencies); | ||||
|         if (descriptor.ownPass) { | ||||
|           presets.push({ | ||||
|             preset: preset.chain, | ||||
|             pass: [] | ||||
|           }); | ||||
|         } else { | ||||
|           presets.unshift({ | ||||
|             preset: preset.chain, | ||||
|             pass: pluginDescriptorsPass | ||||
|           }); | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|     if (presets.length > 0) { | ||||
|       pluginDescriptorsByPass.splice(1, 0, ...presets.map(o => o.pass).filter(p => p !== pluginDescriptorsPass)); | ||||
|       for (const { | ||||
|         preset, | ||||
|         pass | ||||
|       } of presets) { | ||||
|         if (!preset) return true; | ||||
|         pass.push(...preset.plugins); | ||||
|         const ignored = yield* recursePresetDescriptors(preset.presets, pass); | ||||
|         if (ignored) return true; | ||||
|         preset.options.forEach(opts => { | ||||
|           (0, _util.mergeOptions)(optionDefaults, opts); | ||||
|         }); | ||||
|       } | ||||
|     } | ||||
|   })(presetsDescriptors, pluginDescriptorsByPass[0]); | ||||
|   if (ignored) return null; | ||||
|   const opts = optionDefaults; | ||||
|   (0, _util.mergeOptions)(opts, options); | ||||
|   const pluginContext = Object.assign({}, presetContext, { | ||||
|     assumptions: (_opts$assumptions = opts.assumptions) != null ? _opts$assumptions : {} | ||||
|   }); | ||||
|   yield* enhanceError(context, function* loadPluginDescriptors() { | ||||
|     pluginDescriptorsByPass[0].unshift(...initialPluginsDescriptors); | ||||
|     for (const descs of pluginDescriptorsByPass) { | ||||
|       const pass = []; | ||||
|       passes.push(pass); | ||||
|       for (let i = 0; i < descs.length; i++) { | ||||
|         const descriptor = descs[i]; | ||||
|         if (descriptor.options !== false) { | ||||
|           try { | ||||
|             var plugin = yield* loadPluginDescriptor(descriptor, pluginContext); | ||||
|           } catch (e) { | ||||
|             if (e.code === "BABEL_UNKNOWN_PLUGIN_PROPERTY") { | ||||
|               (0, _options.checkNoUnwrappedItemOptionPairs)(descs, i, "plugin", e); | ||||
|             } | ||||
|             throw e; | ||||
|           } | ||||
|           pass.push(plugin); | ||||
|           externalDependencies.push(plugin.externalDependencies); | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   })(); | ||||
|   opts.plugins = passes[0]; | ||||
|   opts.presets = passes.slice(1).filter(plugins => plugins.length > 0).map(plugins => ({ | ||||
|     plugins | ||||
|   })); | ||||
|   opts.passPerPreset = opts.presets.length > 0; | ||||
|   return { | ||||
|     options: opts, | ||||
|     passes: passes, | ||||
|     externalDependencies: (0, _deepArray.finalize)(externalDependencies) | ||||
|   }; | ||||
| }); | ||||
| exports.default = _default; | ||||
| function enhanceError(context, fn) { | ||||
|   return function* (arg1, arg2) { | ||||
|     try { | ||||
|       return yield* fn(arg1, arg2); | ||||
|     } catch (e) { | ||||
|       if (!/^\[BABEL\]/.test(e.message)) { | ||||
|         var _context$filename; | ||||
|         e.message = `[BABEL] ${(_context$filename = context.filename) != null ? _context$filename : "unknown file"}: ${e.message}`; | ||||
|       } | ||||
|       throw e; | ||||
|     } | ||||
|   }; | ||||
| } | ||||
| const makeDescriptorLoader = apiFactory => (0, _caching.makeWeakCache)(function* ({ | ||||
|   value, | ||||
|   options, | ||||
|   dirname, | ||||
|   alias | ||||
| }, cache) { | ||||
|   if (options === false) throw new Error("Assertion failure"); | ||||
|   options = options || {}; | ||||
|   const externalDependencies = []; | ||||
|   let item = value; | ||||
|   if (typeof value === "function") { | ||||
|     const factory = (0, _async.maybeAsync)(value, `You appear to be using an async plugin/preset, but Babel has been called synchronously`); | ||||
|     const api = Object.assign({}, context, apiFactory(cache, externalDependencies)); | ||||
|     try { | ||||
|       item = yield* factory(api, options, dirname); | ||||
|     } catch (e) { | ||||
|       if (alias) { | ||||
|         e.message += ` (While processing: ${JSON.stringify(alias)})`; | ||||
|       } | ||||
|       throw e; | ||||
|     } | ||||
|   } | ||||
|   if (!item || typeof item !== "object") { | ||||
|     throw new Error("Plugin/Preset did not return an object."); | ||||
|   } | ||||
|   if ((0, _async.isThenable)(item)) { | ||||
|     yield* []; | ||||
|     throw new Error(`You appear to be using a promise as a plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version. ` + `As an alternative, you can prefix the promise with "await". ` + `(While processing: ${JSON.stringify(alias)})`); | ||||
|   } | ||||
|   if (externalDependencies.length > 0 && (!cache.configured() || cache.mode() === "forever")) { | ||||
|     let error = `A plugin/preset has external untracked dependencies ` + `(${externalDependencies[0]}), but the cache `; | ||||
|     if (!cache.configured()) { | ||||
|       error += `has not been configured to be invalidated when the external dependencies change. `; | ||||
|     } else { | ||||
|       error += ` has been configured to never be invalidated. `; | ||||
|     } | ||||
|     error += `Plugins/presets should configure their cache to be invalidated when the external ` + `dependencies change, for example using \`api.cache.invalidate(() => ` + `statSync(filepath).mtimeMs)\` or \`api.cache.never()\`\n` + `(While processing: ${JSON.stringify(alias)})`; | ||||
|     throw new Error(error); | ||||
|   } | ||||
|   return { | ||||
|     value: item, | ||||
|     options, | ||||
|     dirname, | ||||
|     alias, | ||||
|     externalDependencies: (0, _deepArray.finalize)(externalDependencies) | ||||
|   }; | ||||
| }); | ||||
| const pluginDescriptorLoader = makeDescriptorLoader(_configApi.makePluginAPI); | ||||
| const presetDescriptorLoader = makeDescriptorLoader(_configApi.makePresetAPI); | ||||
| const instantiatePlugin = (0, _caching.makeWeakCache)(function* ({ | ||||
|   value, | ||||
|   options, | ||||
|   dirname, | ||||
|   alias, | ||||
|   externalDependencies | ||||
| }, cache) { | ||||
|   const pluginObj = (0, _plugins.validatePluginObject)(value); | ||||
|   const plugin = Object.assign({}, pluginObj); | ||||
|   if (plugin.visitor) { | ||||
|     plugin.visitor = _traverse().default.explode(Object.assign({}, plugin.visitor)); | ||||
|   } | ||||
|   if (plugin.inherits) { | ||||
|     const inheritsDescriptor = { | ||||
|       name: undefined, | ||||
|       alias: `${alias}$inherits`, | ||||
|       value: plugin.inherits, | ||||
|       options, | ||||
|       dirname | ||||
|     }; | ||||
|     const inherits = yield* (0, _async.forwardAsync)(loadPluginDescriptor, run => { | ||||
|       return cache.invalidate(data => run(inheritsDescriptor, data)); | ||||
|     }); | ||||
|     plugin.pre = chain(inherits.pre, plugin.pre); | ||||
|     plugin.post = chain(inherits.post, plugin.post); | ||||
|     plugin.manipulateOptions = chain(inherits.manipulateOptions, plugin.manipulateOptions); | ||||
|     plugin.visitor = _traverse().default.visitors.merge([inherits.visitor || {}, plugin.visitor || {}]); | ||||
|     if (inherits.externalDependencies.length > 0) { | ||||
|       if (externalDependencies.length === 0) { | ||||
|         externalDependencies = inherits.externalDependencies; | ||||
|       } else { | ||||
|         externalDependencies = (0, _deepArray.finalize)([externalDependencies, inherits.externalDependencies]); | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|   return new _plugin.default(plugin, options, alias, externalDependencies); | ||||
| }); | ||||
| function* loadPluginDescriptor(descriptor, context) { | ||||
|   if (descriptor.value instanceof _plugin.default) { | ||||
|     if (descriptor.options) { | ||||
|       throw new Error("Passed options to an existing Plugin instance will not work."); | ||||
|     } | ||||
|     return descriptor.value; | ||||
|   } | ||||
|   return yield* instantiatePlugin(yield* pluginDescriptorLoader(descriptor, context), context); | ||||
| } | ||||
| const needsFilename = val => val && typeof val !== "function"; | ||||
| const validateIfOptionNeedsFilename = (options, descriptor) => { | ||||
|   if (needsFilename(options.test) || needsFilename(options.include) || needsFilename(options.exclude)) { | ||||
|     const formattedPresetName = descriptor.name ? `"${descriptor.name}"` : "/* your preset */"; | ||||
|     throw new _configError.default([`Preset ${formattedPresetName} requires a filename to be set when babel is called directly,`, `\`\`\``, `babel.transformSync(code, { filename: 'file.ts', presets: [${formattedPresetName}] });`, `\`\`\``, `See https://babeljs.io/docs/en/options#filename for more information.`].join("\n")); | ||||
|   } | ||||
| }; | ||||
| const validatePreset = (preset, context, descriptor) => { | ||||
|   if (!context.filename) { | ||||
|     var _options$overrides; | ||||
|     const { | ||||
|       options | ||||
|     } = preset; | ||||
|     validateIfOptionNeedsFilename(options, descriptor); | ||||
|     (_options$overrides = options.overrides) == null ? void 0 : _options$overrides.forEach(overrideOptions => validateIfOptionNeedsFilename(overrideOptions, descriptor)); | ||||
|   } | ||||
| }; | ||||
| const instantiatePreset = (0, _caching.makeWeakCacheSync)(({ | ||||
|   value, | ||||
|   dirname, | ||||
|   alias, | ||||
|   externalDependencies | ||||
| }) => { | ||||
|   return { | ||||
|     options: (0, _options.validate)("preset", value), | ||||
|     alias, | ||||
|     dirname, | ||||
|     externalDependencies | ||||
|   }; | ||||
| }); | ||||
| function* loadPresetDescriptor(descriptor, context) { | ||||
|   const preset = instantiatePreset(yield* presetDescriptorLoader(descriptor, context)); | ||||
|   validatePreset(preset, context, descriptor); | ||||
|   return { | ||||
|     chain: yield* (0, _configChain.buildPresetChain)(preset, context), | ||||
|     externalDependencies: preset.externalDependencies | ||||
|   }; | ||||
| } | ||||
| function chain(a, b) { | ||||
|   const fns = [a, b].filter(Boolean); | ||||
|   if (fns.length <= 1) return fns[0]; | ||||
|   return function (...args) { | ||||
|     for (const fn of fns) { | ||||
|       fn.apply(this, args); | ||||
|     } | ||||
|   }; | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=full.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/full.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/full.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										85
									
								
								node_modules/@babel/core/lib/config/helpers/config-api.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										85
									
								
								node_modules/@babel/core/lib/config/helpers/config-api.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,85 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.makeConfigAPI = makeConfigAPI; | ||||
| exports.makePluginAPI = makePluginAPI; | ||||
| exports.makePresetAPI = makePresetAPI; | ||||
| function _semver() { | ||||
|   const data = require("semver"); | ||||
|   _semver = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| var _ = require("../../"); | ||||
| var _caching = require("../caching"); | ||||
| function makeConfigAPI(cache) { | ||||
|   const env = value => cache.using(data => { | ||||
|     if (typeof value === "undefined") return data.envName; | ||||
|     if (typeof value === "function") { | ||||
|       return (0, _caching.assertSimpleType)(value(data.envName)); | ||||
|     } | ||||
|     return (Array.isArray(value) ? value : [value]).some(entry => { | ||||
|       if (typeof entry !== "string") { | ||||
|         throw new Error("Unexpected non-string value"); | ||||
|       } | ||||
|       return entry === data.envName; | ||||
|     }); | ||||
|   }); | ||||
|   const caller = cb => cache.using(data => (0, _caching.assertSimpleType)(cb(data.caller))); | ||||
|   return { | ||||
|     version: _.version, | ||||
|     cache: cache.simple(), | ||||
|     env, | ||||
|     async: () => false, | ||||
|     caller, | ||||
|     assertVersion | ||||
|   }; | ||||
| } | ||||
| function makePresetAPI(cache, externalDependencies) { | ||||
|   const targets = () => JSON.parse(cache.using(data => JSON.stringify(data.targets))); | ||||
|   const addExternalDependency = ref => { | ||||
|     externalDependencies.push(ref); | ||||
|   }; | ||||
|   return Object.assign({}, makeConfigAPI(cache), { | ||||
|     targets, | ||||
|     addExternalDependency | ||||
|   }); | ||||
| } | ||||
| function makePluginAPI(cache, externalDependencies) { | ||||
|   const assumption = name => cache.using(data => data.assumptions[name]); | ||||
|   return Object.assign({}, makePresetAPI(cache, externalDependencies), { | ||||
|     assumption | ||||
|   }); | ||||
| } | ||||
| function assertVersion(range) { | ||||
|   if (typeof range === "number") { | ||||
|     if (!Number.isInteger(range)) { | ||||
|       throw new Error("Expected string or integer value."); | ||||
|     } | ||||
|     range = `^${range}.0.0-0`; | ||||
|   } | ||||
|   if (typeof range !== "string") { | ||||
|     throw new Error("Expected string or integer value."); | ||||
|   } | ||||
|   ; | ||||
|   if (_semver().satisfies(_.version, range)) return; | ||||
|   const limit = Error.stackTraceLimit; | ||||
|   if (typeof limit === "number" && limit < 25) { | ||||
|     Error.stackTraceLimit = 25; | ||||
|   } | ||||
|   const err = new Error(`Requires Babel "${range}", but was loaded with "${_.version}". ` + `If you are sure you have a compatible version of @babel/core, ` + `it is likely that something in your build process is loading the ` + `wrong version. Inspect the stack trace of this error to look for ` + `the first entry that doesn't mention "@babel/core" or "babel-core" ` + `to see what is calling Babel.`); | ||||
|   if (typeof limit === "number") { | ||||
|     Error.stackTraceLimit = limit; | ||||
|   } | ||||
|   throw Object.assign(err, { | ||||
|     code: "BABEL_VERSION_UNSUPPORTED", | ||||
|     version: _.version, | ||||
|     range | ||||
|   }); | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=config-api.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/helpers/config-api.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/helpers/config-api.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										23
									
								
								node_modules/@babel/core/lib/config/helpers/deep-array.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								node_modules/@babel/core/lib/config/helpers/deep-array.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,23 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.finalize = finalize; | ||||
| exports.flattenToSet = flattenToSet; | ||||
| function finalize(deepArr) { | ||||
|   return Object.freeze(deepArr); | ||||
| } | ||||
| function flattenToSet(arr) { | ||||
|   const result = new Set(); | ||||
|   const stack = [arr]; | ||||
|   while (stack.length > 0) { | ||||
|     for (const el of stack.pop()) { | ||||
|       if (Array.isArray(el)) stack.push(el);else result.add(el); | ||||
|     } | ||||
|   } | ||||
|   return result; | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=deep-array.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/helpers/deep-array.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/helpers/deep-array.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| {"version":3,"names":["finalize","deepArr","Object","freeze","flattenToSet","arr","result","Set","stack","length","el","pop","Array","isArray","push","add"],"sources":["../../../src/config/helpers/deep-array.ts"],"sourcesContent":["export type DeepArray<T> = Array<T | ReadonlyDeepArray<T>>;\n\n// Just to make sure that DeepArray<T> is not assignable to ReadonlyDeepArray<T>\ndeclare const __marker: unique symbol;\nexport type ReadonlyDeepArray<T> = ReadonlyArray<T | ReadonlyDeepArray<T>> & {\n  [__marker]: true;\n};\n\nexport function finalize<T>(deepArr: DeepArray<T>): ReadonlyDeepArray<T> {\n  return Object.freeze(deepArr) as ReadonlyDeepArray<T>;\n}\n\nexport function flattenToSet<T extends string>(\n  arr: ReadonlyDeepArray<T>,\n): Set<T> {\n  const result = new Set<T>();\n  const stack = [arr];\n  while (stack.length > 0) {\n    for (const el of stack.pop()) {\n      if (Array.isArray(el)) stack.push(el as ReadonlyDeepArray<T>);\n      else result.add(el as T);\n    }\n  }\n  return result;\n}\n"],"mappings":";;;;;;;AAQO,SAASA,QAAQA,CAAIC,OAAqB,EAAwB;EACvE,OAAOC,MAAM,CAACC,MAAM,CAACF,OAAO,CAAC;AAC/B;AAEO,SAASG,YAAYA,CAC1BC,GAAyB,EACjB;EACR,MAAMC,MAAM,GAAG,IAAIC,GAAG,CAAI,CAAC;EAC3B,MAAMC,KAAK,GAAG,CAACH,GAAG,CAAC;EACnB,OAAOG,KAAK,CAACC,MAAM,GAAG,CAAC,EAAE;IACvB,KAAK,MAAMC,EAAE,IAAIF,KAAK,CAACG,GAAG,CAAC,CAAC,EAAE;MAC5B,IAAIC,KAAK,CAACC,OAAO,CAACH,EAAE,CAAC,EAAEF,KAAK,CAACM,IAAI,CAACJ,EAA0B,CAAC,CAAC,KACzDJ,MAAM,CAACS,GAAG,CAACL,EAAO,CAAC;IAC1B;EACF;EACA,OAAOJ,MAAM;AACf;AAAC"} | ||||
							
								
								
									
										12
									
								
								node_modules/@babel/core/lib/config/helpers/environment.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								node_modules/@babel/core/lib/config/helpers/environment.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,12 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.getEnv = getEnv; | ||||
| function getEnv(defaultValue = "development") { | ||||
|   return process.env.BABEL_ENV || process.env.NODE_ENV || defaultValue; | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=environment.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/helpers/environment.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/helpers/environment.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| {"version":3,"names":["getEnv","defaultValue","process","env","BABEL_ENV","NODE_ENV"],"sources":["../../../src/config/helpers/environment.ts"],"sourcesContent":["export function getEnv(defaultValue: string = \"development\"): string {\n  return process.env.BABEL_ENV || process.env.NODE_ENV || defaultValue;\n}\n"],"mappings":";;;;;;AAAO,SAASA,MAAMA,CAACC,YAAoB,GAAG,aAAa,EAAU;EACnE,OAAOC,OAAO,CAACC,GAAG,CAACC,SAAS,IAAIF,OAAO,CAACC,GAAG,CAACE,QAAQ,IAAIJ,YAAY;AACtE;AAAC"} | ||||
							
								
								
									
										73
									
								
								node_modules/@babel/core/lib/config/index.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								node_modules/@babel/core/lib/config/index.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,73 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.createConfigItem = createConfigItem; | ||||
| exports.createConfigItemSync = exports.createConfigItemAsync = void 0; | ||||
| Object.defineProperty(exports, "default", { | ||||
|   enumerable: true, | ||||
|   get: function () { | ||||
|     return _full.default; | ||||
|   } | ||||
| }); | ||||
| exports.loadPartialConfigSync = exports.loadPartialConfigAsync = exports.loadPartialConfig = exports.loadOptionsSync = exports.loadOptionsAsync = exports.loadOptions = void 0; | ||||
| function _gensync() { | ||||
|   const data = require("gensync"); | ||||
|   _gensync = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| var _full = require("./full"); | ||||
| var _partial = require("./partial"); | ||||
| var _item = require("./item"); | ||||
| const loadOptionsRunner = _gensync()(function* (opts) { | ||||
|   var _config$options; | ||||
|   const config = yield* (0, _full.default)(opts); | ||||
|   return (_config$options = config == null ? void 0 : config.options) != null ? _config$options : null; | ||||
| }); | ||||
| const createConfigItemRunner = _gensync()(_item.createConfigItem); | ||||
| const maybeErrback = runner => (argOrCallback, maybeCallback) => { | ||||
|   let arg; | ||||
|   let callback; | ||||
|   if (maybeCallback === undefined && typeof argOrCallback === "function") { | ||||
|     callback = argOrCallback; | ||||
|     arg = undefined; | ||||
|   } else { | ||||
|     callback = maybeCallback; | ||||
|     arg = argOrCallback; | ||||
|   } | ||||
|   if (!callback) { | ||||
|     return runner.sync(arg); | ||||
|   } | ||||
|   runner.errback(arg, callback); | ||||
| }; | ||||
| const loadPartialConfig = maybeErrback(_partial.loadPartialConfig); | ||||
| exports.loadPartialConfig = loadPartialConfig; | ||||
| const loadPartialConfigSync = _partial.loadPartialConfig.sync; | ||||
| exports.loadPartialConfigSync = loadPartialConfigSync; | ||||
| const loadPartialConfigAsync = _partial.loadPartialConfig.async; | ||||
| exports.loadPartialConfigAsync = loadPartialConfigAsync; | ||||
| const loadOptions = maybeErrback(loadOptionsRunner); | ||||
| exports.loadOptions = loadOptions; | ||||
| const loadOptionsSync = loadOptionsRunner.sync; | ||||
| exports.loadOptionsSync = loadOptionsSync; | ||||
| const loadOptionsAsync = loadOptionsRunner.async; | ||||
| exports.loadOptionsAsync = loadOptionsAsync; | ||||
| const createConfigItemSync = createConfigItemRunner.sync; | ||||
| exports.createConfigItemSync = createConfigItemSync; | ||||
| const createConfigItemAsync = createConfigItemRunner.async; | ||||
| exports.createConfigItemAsync = createConfigItemAsync; | ||||
| function createConfigItem(target, options, callback) { | ||||
|   if (callback !== undefined) { | ||||
|     createConfigItemRunner.errback(target, options, callback); | ||||
|   } else if (typeof options === "function") { | ||||
|     createConfigItemRunner.errback(target, undefined, callback); | ||||
|   } else { | ||||
|     return createConfigItemRunner.sync(target, options); | ||||
|   } | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=index.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/index.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/index.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										67
									
								
								node_modules/@babel/core/lib/config/item.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								node_modules/@babel/core/lib/config/item.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,67 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.createConfigItem = createConfigItem; | ||||
| exports.createItemFromDescriptor = createItemFromDescriptor; | ||||
| exports.getItemDescriptor = getItemDescriptor; | ||||
| function _path() { | ||||
|   const data = require("path"); | ||||
|   _path = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| var _configDescriptors = require("./config-descriptors"); | ||||
| function createItemFromDescriptor(desc) { | ||||
|   return new ConfigItem(desc); | ||||
| } | ||||
| function* createConfigItem(value, { | ||||
|   dirname = ".", | ||||
|   type | ||||
| } = {}) { | ||||
|   const descriptor = yield* (0, _configDescriptors.createDescriptor)(value, _path().resolve(dirname), { | ||||
|     type, | ||||
|     alias: "programmatic item" | ||||
|   }); | ||||
|   return createItemFromDescriptor(descriptor); | ||||
| } | ||||
| const CONFIG_ITEM_BRAND = Symbol.for("@babel/core@7 - ConfigItem"); | ||||
| function getItemDescriptor(item) { | ||||
|   if (item != null && item[CONFIG_ITEM_BRAND]) { | ||||
|     return item._descriptor; | ||||
|   } | ||||
|   return undefined; | ||||
| } | ||||
| class ConfigItem { | ||||
|   constructor(descriptor) { | ||||
|     this._descriptor = void 0; | ||||
|     this[CONFIG_ITEM_BRAND] = true; | ||||
|     this.value = void 0; | ||||
|     this.options = void 0; | ||||
|     this.dirname = void 0; | ||||
|     this.name = void 0; | ||||
|     this.file = void 0; | ||||
|     this._descriptor = descriptor; | ||||
|     Object.defineProperty(this, "_descriptor", { | ||||
|       enumerable: false | ||||
|     }); | ||||
|     Object.defineProperty(this, CONFIG_ITEM_BRAND, { | ||||
|       enumerable: false | ||||
|     }); | ||||
|     this.value = this._descriptor.value; | ||||
|     this.options = this._descriptor.options; | ||||
|     this.dirname = this._descriptor.dirname; | ||||
|     this.name = this._descriptor.name; | ||||
|     this.file = this._descriptor.file ? { | ||||
|       request: this._descriptor.file.request, | ||||
|       resolved: this._descriptor.file.resolved | ||||
|     } : undefined; | ||||
|     Object.freeze(this); | ||||
|   } | ||||
| } | ||||
| Object.freeze(ConfigItem.prototype); | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=item.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/item.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/item.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										166
									
								
								node_modules/@babel/core/lib/config/partial.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										166
									
								
								node_modules/@babel/core/lib/config/partial.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,166 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.default = loadPrivatePartialConfig; | ||||
| exports.loadPartialConfig = void 0; | ||||
| function _path() { | ||||
|   const data = require("path"); | ||||
|   _path = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| function _gensync() { | ||||
|   const data = require("gensync"); | ||||
|   _gensync = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| var _plugin = require("./plugin"); | ||||
| var _util = require("./util"); | ||||
| var _item = require("./item"); | ||||
| var _configChain = require("./config-chain"); | ||||
| var _environment = require("./helpers/environment"); | ||||
| var _options = require("./validation/options"); | ||||
| var _files = require("./files"); | ||||
| var _resolveTargets = require("./resolve-targets"); | ||||
| const _excluded = ["showIgnoredFiles"]; | ||||
| function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } | ||||
| function resolveRootMode(rootDir, rootMode) { | ||||
|   switch (rootMode) { | ||||
|     case "root": | ||||
|       return rootDir; | ||||
|     case "upward-optional": | ||||
|       { | ||||
|         const upwardRootDir = (0, _files.findConfigUpwards)(rootDir); | ||||
|         return upwardRootDir === null ? rootDir : upwardRootDir; | ||||
|       } | ||||
|     case "upward": | ||||
|       { | ||||
|         const upwardRootDir = (0, _files.findConfigUpwards)(rootDir); | ||||
|         if (upwardRootDir !== null) return upwardRootDir; | ||||
|         throw Object.assign(new Error(`Babel was run with rootMode:"upward" but a root could not ` + `be found when searching upward from "${rootDir}".\n` + `One of the following config files must be in the directory tree: ` + `"${_files.ROOT_CONFIG_FILENAMES.join(", ")}".`), { | ||||
|           code: "BABEL_ROOT_NOT_FOUND", | ||||
|           dirname: rootDir | ||||
|         }); | ||||
|       } | ||||
|     default: | ||||
|       throw new Error(`Assertion failure - unknown rootMode value.`); | ||||
|   } | ||||
| } | ||||
| function* loadPrivatePartialConfig(inputOpts) { | ||||
|   if (inputOpts != null && (typeof inputOpts !== "object" || Array.isArray(inputOpts))) { | ||||
|     throw new Error("Babel options must be an object, null, or undefined"); | ||||
|   } | ||||
|   const args = inputOpts ? (0, _options.validate)("arguments", inputOpts) : {}; | ||||
|   const { | ||||
|     envName = (0, _environment.getEnv)(), | ||||
|     cwd = ".", | ||||
|     root: rootDir = ".", | ||||
|     rootMode = "root", | ||||
|     caller, | ||||
|     cloneInputAst = true | ||||
|   } = args; | ||||
|   const absoluteCwd = _path().resolve(cwd); | ||||
|   const absoluteRootDir = resolveRootMode(_path().resolve(absoluteCwd, rootDir), rootMode); | ||||
|   const filename = typeof args.filename === "string" ? _path().resolve(cwd, args.filename) : undefined; | ||||
|   const showConfigPath = yield* (0, _files.resolveShowConfigPath)(absoluteCwd); | ||||
|   const context = { | ||||
|     filename, | ||||
|     cwd: absoluteCwd, | ||||
|     root: absoluteRootDir, | ||||
|     envName, | ||||
|     caller, | ||||
|     showConfig: showConfigPath === filename | ||||
|   }; | ||||
|   const configChain = yield* (0, _configChain.buildRootChain)(args, context); | ||||
|   if (!configChain) return null; | ||||
|   const merged = { | ||||
|     assumptions: {} | ||||
|   }; | ||||
|   configChain.options.forEach(opts => { | ||||
|     (0, _util.mergeOptions)(merged, opts); | ||||
|   }); | ||||
|   const options = Object.assign({}, merged, { | ||||
|     targets: (0, _resolveTargets.resolveTargets)(merged, absoluteRootDir), | ||||
|     cloneInputAst, | ||||
|     babelrc: false, | ||||
|     configFile: false, | ||||
|     browserslistConfigFile: false, | ||||
|     passPerPreset: false, | ||||
|     envName: context.envName, | ||||
|     cwd: context.cwd, | ||||
|     root: context.root, | ||||
|     rootMode: "root", | ||||
|     filename: typeof context.filename === "string" ? context.filename : undefined, | ||||
|     plugins: configChain.plugins.map(descriptor => (0, _item.createItemFromDescriptor)(descriptor)), | ||||
|     presets: configChain.presets.map(descriptor => (0, _item.createItemFromDescriptor)(descriptor)) | ||||
|   }); | ||||
|   return { | ||||
|     options, | ||||
|     context, | ||||
|     fileHandling: configChain.fileHandling, | ||||
|     ignore: configChain.ignore, | ||||
|     babelrc: configChain.babelrc, | ||||
|     config: configChain.config, | ||||
|     files: configChain.files | ||||
|   }; | ||||
| } | ||||
| const loadPartialConfig = _gensync()(function* (opts) { | ||||
|   let showIgnoredFiles = false; | ||||
|   if (typeof opts === "object" && opts !== null && !Array.isArray(opts)) { | ||||
|     var _opts = opts; | ||||
|     ({ | ||||
|       showIgnoredFiles | ||||
|     } = _opts); | ||||
|     opts = _objectWithoutPropertiesLoose(_opts, _excluded); | ||||
|     _opts; | ||||
|   } | ||||
|   const result = yield* loadPrivatePartialConfig(opts); | ||||
|   if (!result) return null; | ||||
|   const { | ||||
|     options, | ||||
|     babelrc, | ||||
|     ignore, | ||||
|     config, | ||||
|     fileHandling, | ||||
|     files | ||||
|   } = result; | ||||
|   if (fileHandling === "ignored" && !showIgnoredFiles) { | ||||
|     return null; | ||||
|   } | ||||
|   (options.plugins || []).forEach(item => { | ||||
|     if (item.value instanceof _plugin.default) { | ||||
|       throw new Error("Passing cached plugin instances is not supported in " + "babel.loadPartialConfig()"); | ||||
|     } | ||||
|   }); | ||||
|   return new PartialConfig(options, babelrc ? babelrc.filepath : undefined, ignore ? ignore.filepath : undefined, config ? config.filepath : undefined, fileHandling, files); | ||||
| }); | ||||
| exports.loadPartialConfig = loadPartialConfig; | ||||
| class PartialConfig { | ||||
|   constructor(options, babelrc, ignore, config, fileHandling, files) { | ||||
|     this.options = void 0; | ||||
|     this.babelrc = void 0; | ||||
|     this.babelignore = void 0; | ||||
|     this.config = void 0; | ||||
|     this.fileHandling = void 0; | ||||
|     this.files = void 0; | ||||
|     this.options = options; | ||||
|     this.babelignore = ignore; | ||||
|     this.babelrc = babelrc; | ||||
|     this.config = config; | ||||
|     this.fileHandling = fileHandling; | ||||
|     this.files = files; | ||||
|     Object.freeze(this); | ||||
|   } | ||||
|   hasFilesystemConfig() { | ||||
|     return this.babelrc !== undefined || this.config !== undefined; | ||||
|   } | ||||
| } | ||||
| Object.freeze(PartialConfig.prototype); | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=partial.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/partial.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/partial.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										38
									
								
								node_modules/@babel/core/lib/config/pattern-to-regex.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								node_modules/@babel/core/lib/config/pattern-to-regex.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,38 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.default = pathToPattern; | ||||
| function _path() { | ||||
|   const data = require("path"); | ||||
|   _path = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| const sep = `\\${_path().sep}`; | ||||
| const endSep = `(?:${sep}|$)`; | ||||
| const substitution = `[^${sep}]+`; | ||||
| const starPat = `(?:${substitution}${sep})`; | ||||
| const starPatLast = `(?:${substitution}${endSep})`; | ||||
| const starStarPat = `${starPat}*?`; | ||||
| const starStarPatLast = `${starPat}*?${starPatLast}?`; | ||||
| function escapeRegExp(string) { | ||||
|   return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&"); | ||||
| } | ||||
| function pathToPattern(pattern, dirname) { | ||||
|   const parts = _path().resolve(dirname, pattern).split(_path().sep); | ||||
|   return new RegExp(["^", ...parts.map((part, i) => { | ||||
|     const last = i === parts.length - 1; | ||||
|     if (part === "**") return last ? starStarPatLast : starStarPat; | ||||
|     if (part === "*") return last ? starPatLast : starPat; | ||||
|     if (part.indexOf("*.") === 0) { | ||||
|       return substitution + escapeRegExp(part.slice(1)) + (last ? endSep : sep); | ||||
|     } | ||||
|     return escapeRegExp(part) + (last ? endSep : sep); | ||||
|   })].join("")); | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=pattern-to-regex.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/pattern-to-regex.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/pattern-to-regex.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| {"version":3,"names":["_path","data","require","sep","path","endSep","substitution","starPat","starPatLast","starStarPat","starStarPatLast","escapeRegExp","string","replace","pathToPattern","pattern","dirname","parts","resolve","split","RegExp","map","part","i","last","length","indexOf","slice","join"],"sources":["../../src/config/pattern-to-regex.ts"],"sourcesContent":["import path from \"path\";\n\nconst sep = `\\\\${path.sep}`;\nconst endSep = `(?:${sep}|$)`;\n\nconst substitution = `[^${sep}]+`;\n\nconst starPat = `(?:${substitution}${sep})`;\nconst starPatLast = `(?:${substitution}${endSep})`;\n\nconst starStarPat = `${starPat}*?`;\nconst starStarPatLast = `${starPat}*?${starPatLast}?`;\n\nfunction escapeRegExp(string: string) {\n  return string.replace(/[|\\\\{}()[\\]^$+*?.]/g, \"\\\\$&\");\n}\n\n/**\n * Implement basic pattern matching that will allow users to do the simple\n * tests with * and **. If users want full complex pattern matching, then can\n * always use regex matching, or function validation.\n */\nexport default function pathToPattern(\n  pattern: string,\n  dirname: string,\n): RegExp {\n  const parts = path.resolve(dirname, pattern).split(path.sep);\n\n  return new RegExp(\n    [\n      \"^\",\n      ...parts.map((part, i) => {\n        const last = i === parts.length - 1;\n\n        // ** matches 0 or more path parts.\n        if (part === \"**\") return last ? starStarPatLast : starStarPat;\n\n        // * matches 1 path part.\n        if (part === \"*\") return last ? starPatLast : starPat;\n\n        // *.ext matches a wildcard with an extension.\n        if (part.indexOf(\"*.\") === 0) {\n          return (\n            substitution + escapeRegExp(part.slice(1)) + (last ? endSep : sep)\n          );\n        }\n\n        // Otherwise match the pattern text.\n        return escapeRegExp(part) + (last ? endSep : sep);\n      }),\n    ].join(\"\"),\n  );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAME,GAAG,GAAI,KAAIC,MAAGA,CAAC,CAACD,GAAI,EAAC;AAC3B,MAAME,MAAM,GAAI,MAAKF,GAAI,KAAI;AAE7B,MAAMG,YAAY,GAAI,KAAIH,GAAI,IAAG;AAEjC,MAAMI,OAAO,GAAI,MAAKD,YAAa,GAAEH,GAAI,GAAE;AAC3C,MAAMK,WAAW,GAAI,MAAKF,YAAa,GAAED,MAAO,GAAE;AAElD,MAAMI,WAAW,GAAI,GAAEF,OAAQ,IAAG;AAClC,MAAMG,eAAe,GAAI,GAAEH,OAAQ,KAAIC,WAAY,GAAE;AAErD,SAASG,YAAYA,CAACC,MAAc,EAAE;EACpC,OAAOA,MAAM,CAACC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC;AACtD;AAOe,SAASC,aAAaA,CACnCC,OAAe,EACfC,OAAe,EACP;EACR,MAAMC,KAAK,GAAGb,MAAGA,CAAC,CAACc,OAAO,CAACF,OAAO,EAAED,OAAO,CAAC,CAACI,KAAK,CAACf,MAAGA,CAAC,CAACD,GAAG,CAAC;EAE5D,OAAO,IAAIiB,MAAM,CACf,CACE,GAAG,EACH,GAAGH,KAAK,CAACI,GAAG,CAAC,CAACC,IAAI,EAAEC,CAAC,KAAK;IACxB,MAAMC,IAAI,GAAGD,CAAC,KAAKN,KAAK,CAACQ,MAAM,GAAG,CAAC;IAGnC,IAAIH,IAAI,KAAK,IAAI,EAAE,OAAOE,IAAI,GAAGd,eAAe,GAAGD,WAAW;IAG9D,IAAIa,IAAI,KAAK,GAAG,EAAE,OAAOE,IAAI,GAAGhB,WAAW,GAAGD,OAAO;IAGrD,IAAIe,IAAI,CAACI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;MAC5B,OACEpB,YAAY,GAAGK,YAAY,CAACW,IAAI,CAACK,KAAK,CAAC,CAAC,CAAC,CAAC,IAAIH,IAAI,GAAGnB,MAAM,GAAGF,GAAG,CAAC;IAEtE;IAGA,OAAOQ,YAAY,CAACW,IAAI,CAAC,IAAIE,IAAI,GAAGnB,MAAM,GAAGF,GAAG,CAAC;EACnD,CAAC,CAAC,CACH,CAACyB,IAAI,CAAC,EAAE,CACX,CAAC;AACH;AAAC"} | ||||
							
								
								
									
										33
									
								
								node_modules/@babel/core/lib/config/plugin.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								node_modules/@babel/core/lib/config/plugin.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,33 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.default = void 0; | ||||
| var _deepArray = require("./helpers/deep-array"); | ||||
| class Plugin { | ||||
|   constructor(plugin, options, key, externalDependencies = (0, _deepArray.finalize)([])) { | ||||
|     this.key = void 0; | ||||
|     this.manipulateOptions = void 0; | ||||
|     this.post = void 0; | ||||
|     this.pre = void 0; | ||||
|     this.visitor = void 0; | ||||
|     this.parserOverride = void 0; | ||||
|     this.generatorOverride = void 0; | ||||
|     this.options = void 0; | ||||
|     this.externalDependencies = void 0; | ||||
|     this.key = plugin.name || key; | ||||
|     this.manipulateOptions = plugin.manipulateOptions; | ||||
|     this.post = plugin.post; | ||||
|     this.pre = plugin.pre; | ||||
|     this.visitor = plugin.visitor || {}; | ||||
|     this.parserOverride = plugin.parserOverride; | ||||
|     this.generatorOverride = plugin.generatorOverride; | ||||
|     this.options = options; | ||||
|     this.externalDependencies = externalDependencies; | ||||
|   } | ||||
| } | ||||
| exports.default = Plugin; | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=plugin.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/plugin.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/plugin.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| {"version":3,"names":["_deepArray","require","Plugin","constructor","plugin","options","key","externalDependencies","finalize","manipulateOptions","post","pre","visitor","parserOverride","generatorOverride","name","exports","default"],"sources":["../../src/config/plugin.ts"],"sourcesContent":["import { finalize } from \"./helpers/deep-array\";\nimport type { ReadonlyDeepArray } from \"./helpers/deep-array\";\nimport type { PluginObject } from \"./validation/plugins\";\n\nexport default class Plugin {\n  key: string | undefined | null;\n  manipulateOptions?: (options: unknown, parserOpts: unknown) => void;\n  post?: PluginObject[\"post\"];\n  pre?: PluginObject[\"pre\"];\n  visitor: PluginObject[\"visitor\"];\n\n  parserOverride?: Function;\n  generatorOverride?: Function;\n\n  options: {};\n\n  externalDependencies: ReadonlyDeepArray<string>;\n\n  constructor(\n    plugin: PluginObject,\n    options: {},\n    key?: string,\n    externalDependencies: ReadonlyDeepArray<string> = finalize([]),\n  ) {\n    this.key = plugin.name || key;\n\n    this.manipulateOptions = plugin.manipulateOptions;\n    this.post = plugin.post;\n    this.pre = plugin.pre;\n    this.visitor = plugin.visitor || {};\n    this.parserOverride = plugin.parserOverride;\n    this.generatorOverride = plugin.generatorOverride;\n\n    this.options = options;\n    this.externalDependencies = externalDependencies;\n  }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAIe,MAAMC,MAAM,CAAC;EAc1BC,WAAWA,CACTC,MAAoB,EACpBC,OAAW,EACXC,GAAY,EACZC,oBAA+C,GAAG,IAAAC,mBAAQ,EAAC,EAAE,CAAC,EAC9D;IAAA,KAlBFF,GAAG;IAAA,KACHG,iBAAiB;IAAA,KACjBC,IAAI;IAAA,KACJC,GAAG;IAAA,KACHC,OAAO;IAAA,KAEPC,cAAc;IAAA,KACdC,iBAAiB;IAAA,KAEjBT,OAAO;IAAA,KAEPE,oBAAoB;IAQlB,IAAI,CAACD,GAAG,GAAGF,MAAM,CAACW,IAAI,IAAIT,GAAG;IAE7B,IAAI,CAACG,iBAAiB,GAAGL,MAAM,CAACK,iBAAiB;IACjD,IAAI,CAACC,IAAI,GAAGN,MAAM,CAACM,IAAI;IACvB,IAAI,CAACC,GAAG,GAAGP,MAAM,CAACO,GAAG;IACrB,IAAI,CAACC,OAAO,GAAGR,MAAM,CAACQ,OAAO,IAAI,CAAC,CAAC;IACnC,IAAI,CAACC,cAAc,GAAGT,MAAM,CAACS,cAAc;IAC3C,IAAI,CAACC,iBAAiB,GAAGV,MAAM,CAACU,iBAAiB;IAEjD,IAAI,CAACT,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACE,oBAAoB,GAAGA,oBAAoB;EAClD;AACF;AAACS,OAAA,CAAAC,OAAA,GAAAf,MAAA;AAAA"} | ||||
							
								
								
									
										114
									
								
								node_modules/@babel/core/lib/config/printer.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										114
									
								
								node_modules/@babel/core/lib/config/printer.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,114 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.ConfigPrinter = exports.ChainFormatter = void 0; | ||||
| function _gensync() { | ||||
|   const data = require("gensync"); | ||||
|   _gensync = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| const ChainFormatter = { | ||||
|   Programmatic: 0, | ||||
|   Config: 1 | ||||
| }; | ||||
| exports.ChainFormatter = ChainFormatter; | ||||
| const Formatter = { | ||||
|   title(type, callerName, filepath) { | ||||
|     let title = ""; | ||||
|     if (type === ChainFormatter.Programmatic) { | ||||
|       title = "programmatic options"; | ||||
|       if (callerName) { | ||||
|         title += " from " + callerName; | ||||
|       } | ||||
|     } else { | ||||
|       title = "config " + filepath; | ||||
|     } | ||||
|     return title; | ||||
|   }, | ||||
|   loc(index, envName) { | ||||
|     let loc = ""; | ||||
|     if (index != null) { | ||||
|       loc += `.overrides[${index}]`; | ||||
|     } | ||||
|     if (envName != null) { | ||||
|       loc += `.env["${envName}"]`; | ||||
|     } | ||||
|     return loc; | ||||
|   }, | ||||
|   *optionsAndDescriptors(opt) { | ||||
|     const content = Object.assign({}, opt.options); | ||||
|     delete content.overrides; | ||||
|     delete content.env; | ||||
|     const pluginDescriptors = [...(yield* opt.plugins())]; | ||||
|     if (pluginDescriptors.length) { | ||||
|       content.plugins = pluginDescriptors.map(d => descriptorToConfig(d)); | ||||
|     } | ||||
|     const presetDescriptors = [...(yield* opt.presets())]; | ||||
|     if (presetDescriptors.length) { | ||||
|       content.presets = [...presetDescriptors].map(d => descriptorToConfig(d)); | ||||
|     } | ||||
|     return JSON.stringify(content, undefined, 2); | ||||
|   } | ||||
| }; | ||||
| function descriptorToConfig(d) { | ||||
|   var _d$file; | ||||
|   let name = (_d$file = d.file) == null ? void 0 : _d$file.request; | ||||
|   if (name == null) { | ||||
|     if (typeof d.value === "object") { | ||||
|       name = d.value; | ||||
|     } else if (typeof d.value === "function") { | ||||
|       name = `[Function: ${d.value.toString().slice(0, 50)} ... ]`; | ||||
|     } | ||||
|   } | ||||
|   if (name == null) { | ||||
|     name = "[Unknown]"; | ||||
|   } | ||||
|   if (d.options === undefined) { | ||||
|     return name; | ||||
|   } else if (d.name == null) { | ||||
|     return [name, d.options]; | ||||
|   } else { | ||||
|     return [name, d.options, d.name]; | ||||
|   } | ||||
| } | ||||
| class ConfigPrinter { | ||||
|   constructor() { | ||||
|     this._stack = []; | ||||
|   } | ||||
|   configure(enabled, type, { | ||||
|     callerName, | ||||
|     filepath | ||||
|   }) { | ||||
|     if (!enabled) return () => {}; | ||||
|     return (content, index, envName) => { | ||||
|       this._stack.push({ | ||||
|         type, | ||||
|         callerName, | ||||
|         filepath, | ||||
|         content, | ||||
|         index, | ||||
|         envName | ||||
|       }); | ||||
|     }; | ||||
|   } | ||||
|   static *format(config) { | ||||
|     let title = Formatter.title(config.type, config.callerName, config.filepath); | ||||
|     const loc = Formatter.loc(config.index, config.envName); | ||||
|     if (loc) title += ` ${loc}`; | ||||
|     const content = yield* Formatter.optionsAndDescriptors(config.content); | ||||
|     return `${title}\n${content}`; | ||||
|   } | ||||
|   *output() { | ||||
|     if (this._stack.length === 0) return ""; | ||||
|     const configs = yield* _gensync().all(this._stack.map(s => ConfigPrinter.format(s))); | ||||
|     return configs.join("\n\n"); | ||||
|   } | ||||
| } | ||||
| exports.ConfigPrinter = ConfigPrinter; | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=printer.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/printer.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/printer.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										41
									
								
								node_modules/@babel/core/lib/config/resolve-targets-browser.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								node_modules/@babel/core/lib/config/resolve-targets-browser.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,41 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.resolveBrowserslistConfigFile = resolveBrowserslistConfigFile; | ||||
| exports.resolveTargets = resolveTargets; | ||||
| function _helperCompilationTargets() { | ||||
|   const data = require("@babel/helper-compilation-targets"); | ||||
|   _helperCompilationTargets = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| function resolveBrowserslistConfigFile(browserslistConfigFile, configFilePath) { | ||||
|   return undefined; | ||||
| } | ||||
| function resolveTargets(options, root) { | ||||
|   const optTargets = options.targets; | ||||
|   let targets; | ||||
|   if (typeof optTargets === "string" || Array.isArray(optTargets)) { | ||||
|     targets = { | ||||
|       browsers: optTargets | ||||
|     }; | ||||
|   } else if (optTargets) { | ||||
|     if ("esmodules" in optTargets) { | ||||
|       targets = Object.assign({}, optTargets, { | ||||
|         esmodules: "intersect" | ||||
|       }); | ||||
|     } else { | ||||
|       targets = optTargets; | ||||
|     } | ||||
|   } | ||||
|   return (0, _helperCompilationTargets().default)(targets, { | ||||
|     ignoreBrowserslistConfig: true, | ||||
|     browserslistEnv: options.browserslistEnv | ||||
|   }); | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=resolve-targets-browser.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/resolve-targets-browser.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/resolve-targets-browser.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| {"version":3,"names":["_helperCompilationTargets","data","require","resolveBrowserslistConfigFile","browserslistConfigFile","configFilePath","undefined","resolveTargets","options","root","optTargets","targets","Array","isArray","browsers","Object","assign","esmodules","getTargets","ignoreBrowserslistConfig","browserslistEnv"],"sources":["../../src/config/resolve-targets-browser.ts"],"sourcesContent":["import type { ValidatedOptions } from \"./validation/options\";\nimport getTargets, {\n  type InputTargets,\n} from \"@babel/helper-compilation-targets\";\n\nimport type { Targets } from \"@babel/helper-compilation-targets\";\n\nexport function resolveBrowserslistConfigFile(\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  browserslistConfigFile: string,\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  configFilePath: string,\n): string | void {\n  return undefined;\n}\n\nexport function resolveTargets(\n  options: ValidatedOptions,\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  root: string,\n): Targets {\n  const optTargets = options.targets;\n  let targets: InputTargets;\n\n  if (typeof optTargets === \"string\" || Array.isArray(optTargets)) {\n    targets = { browsers: optTargets };\n  } else if (optTargets) {\n    if (\"esmodules\" in optTargets) {\n      targets = { ...optTargets, esmodules: \"intersect\" };\n    } else {\n      // https://github.com/microsoft/TypeScript/issues/17002\n      targets = optTargets as InputTargets;\n    }\n  }\n\n  return getTargets(targets, {\n    ignoreBrowserslistConfig: true,\n    browserslistEnv: options.browserslistEnv,\n  });\n}\n"],"mappings":";;;;;;;AACA,SAAAA,0BAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,yBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAMO,SAASE,6BAA6BA,CAE3CC,sBAA8B,EAE9BC,cAAsB,EACP;EACf,OAAOC,SAAS;AAClB;AAEO,SAASC,cAAcA,CAC5BC,OAAyB,EAEzBC,IAAY,EACH;EACT,MAAMC,UAAU,GAAGF,OAAO,CAACG,OAAO;EAClC,IAAIA,OAAqB;EAEzB,IAAI,OAAOD,UAAU,KAAK,QAAQ,IAAIE,KAAK,CAACC,OAAO,CAACH,UAAU,CAAC,EAAE;IAC/DC,OAAO,GAAG;MAAEG,QAAQ,EAAEJ;IAAW,CAAC;EACpC,CAAC,MAAM,IAAIA,UAAU,EAAE;IACrB,IAAI,WAAW,IAAIA,UAAU,EAAE;MAC7BC,OAAO,GAAAI,MAAA,CAAAC,MAAA,KAAQN,UAAU;QAAEO,SAAS,EAAE;MAAW,EAAE;IACrD,CAAC,MAAM;MAELN,OAAO,GAAGD,UAA0B;IACtC;EACF;EAEA,OAAO,IAAAQ,mCAAU,EAACP,OAAO,EAAE;IACzBQ,wBAAwB,EAAE,IAAI;IAC9BC,eAAe,EAAEZ,OAAO,CAACY;EAC3B,CAAC,CAAC;AACJ;AAAC"} | ||||
							
								
								
									
										61
									
								
								node_modules/@babel/core/lib/config/resolve-targets.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								node_modules/@babel/core/lib/config/resolve-targets.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,61 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.resolveBrowserslistConfigFile = resolveBrowserslistConfigFile; | ||||
| exports.resolveTargets = resolveTargets; | ||||
| function _path() { | ||||
|   const data = require("path"); | ||||
|   _path = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| function _helperCompilationTargets() { | ||||
|   const data = require("@babel/helper-compilation-targets"); | ||||
|   _helperCompilationTargets = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| ({}); | ||||
| function resolveBrowserslistConfigFile(browserslistConfigFile, configFileDir) { | ||||
|   return _path().resolve(configFileDir, browserslistConfigFile); | ||||
| } | ||||
| function resolveTargets(options, root) { | ||||
|   const optTargets = options.targets; | ||||
|   let targets; | ||||
|   if (typeof optTargets === "string" || Array.isArray(optTargets)) { | ||||
|     targets = { | ||||
|       browsers: optTargets | ||||
|     }; | ||||
|   } else if (optTargets) { | ||||
|     if ("esmodules" in optTargets) { | ||||
|       targets = Object.assign({}, optTargets, { | ||||
|         esmodules: "intersect" | ||||
|       }); | ||||
|     } else { | ||||
|       targets = optTargets; | ||||
|     } | ||||
|   } | ||||
|   const { | ||||
|     browserslistConfigFile | ||||
|   } = options; | ||||
|   let configFile; | ||||
|   let ignoreBrowserslistConfig = false; | ||||
|   if (typeof browserslistConfigFile === "string") { | ||||
|     configFile = browserslistConfigFile; | ||||
|   } else { | ||||
|     ignoreBrowserslistConfig = browserslistConfigFile === false; | ||||
|   } | ||||
|   return (0, _helperCompilationTargets().default)(targets, { | ||||
|     ignoreBrowserslistConfig, | ||||
|     configFile, | ||||
|     configPath: root, | ||||
|     browserslistEnv: options.browserslistEnv | ||||
|   }); | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=resolve-targets.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/resolve-targets.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/resolve-targets.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| {"version":3,"names":["_path","data","require","_helperCompilationTargets","resolveBrowserslistConfigFile","browserslistConfigFile","configFileDir","path","resolve","resolveTargets","options","root","optTargets","targets","Array","isArray","browsers","Object","assign","esmodules","configFile","ignoreBrowserslistConfig","getTargets","configPath","browserslistEnv"],"sources":["../../src/config/resolve-targets.ts"],"sourcesContent":["type browserType = typeof import(\"./resolve-targets-browser\");\ntype nodeType = typeof import(\"./resolve-targets\");\n\n// Kind of gross, but essentially asserting that the exports of this module are the same as the\n// exports of index-browser, since this file may be replaced at bundle time with index-browser.\n({}) as any as browserType as nodeType;\n\nimport type { ValidatedOptions } from \"./validation/options\";\nimport path from \"path\";\nimport getTargets, {\n  type InputTargets,\n} from \"@babel/helper-compilation-targets\";\n\nimport type { Targets } from \"@babel/helper-compilation-targets\";\n\nexport function resolveBrowserslistConfigFile(\n  browserslistConfigFile: string,\n  configFileDir: string,\n): string | undefined {\n  return path.resolve(configFileDir, browserslistConfigFile);\n}\n\nexport function resolveTargets(\n  options: ValidatedOptions,\n  root: string,\n): Targets {\n  const optTargets = options.targets;\n  let targets: InputTargets;\n\n  if (typeof optTargets === \"string\" || Array.isArray(optTargets)) {\n    targets = { browsers: optTargets };\n  } else if (optTargets) {\n    if (\"esmodules\" in optTargets) {\n      targets = { ...optTargets, esmodules: \"intersect\" };\n    } else {\n      // https://github.com/microsoft/TypeScript/issues/17002\n      targets = optTargets as InputTargets;\n    }\n  }\n\n  const { browserslistConfigFile } = options;\n  let configFile;\n  let ignoreBrowserslistConfig = false;\n  if (typeof browserslistConfigFile === \"string\") {\n    configFile = browserslistConfigFile;\n  } else {\n    ignoreBrowserslistConfig = browserslistConfigFile === false;\n  }\n\n  return getTargets(targets, {\n    ignoreBrowserslistConfig,\n    configFile,\n    configPath: root,\n    browserslistEnv: options.browserslistEnv,\n  });\n}\n"],"mappings":";;;;;;;AAQA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,0BAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,yBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAJA,CAAC,CAAC,CAAC;AAUI,SAASG,6BAA6BA,CAC3CC,sBAA8B,EAC9BC,aAAqB,EACD;EACpB,OAAOC,MAAGA,CAAC,CAACC,OAAO,CAACF,aAAa,EAAED,sBAAsB,CAAC;AAC5D;AAEO,SAASI,cAAcA,CAC5BC,OAAyB,EACzBC,IAAY,EACH;EACT,MAAMC,UAAU,GAAGF,OAAO,CAACG,OAAO;EAClC,IAAIA,OAAqB;EAEzB,IAAI,OAAOD,UAAU,KAAK,QAAQ,IAAIE,KAAK,CAACC,OAAO,CAACH,UAAU,CAAC,EAAE;IAC/DC,OAAO,GAAG;MAAEG,QAAQ,EAAEJ;IAAW,CAAC;EACpC,CAAC,MAAM,IAAIA,UAAU,EAAE;IACrB,IAAI,WAAW,IAAIA,UAAU,EAAE;MAC7BC,OAAO,GAAAI,MAAA,CAAAC,MAAA,KAAQN,UAAU;QAAEO,SAAS,EAAE;MAAW,EAAE;IACrD,CAAC,MAAM;MAELN,OAAO,GAAGD,UAA0B;IACtC;EACF;EAEA,MAAM;IAAEP;EAAuB,CAAC,GAAGK,OAAO;EAC1C,IAAIU,UAAU;EACd,IAAIC,wBAAwB,GAAG,KAAK;EACpC,IAAI,OAAOhB,sBAAsB,KAAK,QAAQ,EAAE;IAC9Ce,UAAU,GAAGf,sBAAsB;EACrC,CAAC,MAAM;IACLgB,wBAAwB,GAAGhB,sBAAsB,KAAK,KAAK;EAC7D;EAEA,OAAO,IAAAiB,mCAAU,EAACT,OAAO,EAAE;IACzBQ,wBAAwB;IACxBD,UAAU;IACVG,UAAU,EAAEZ,IAAI;IAChBa,eAAe,EAAEd,OAAO,CAACc;EAC3B,CAAC,CAAC;AACJ;AAAC"} | ||||
							
								
								
									
										31
									
								
								node_modules/@babel/core/lib/config/util.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								node_modules/@babel/core/lib/config/util.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,31 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.isIterableIterator = isIterableIterator; | ||||
| exports.mergeOptions = mergeOptions; | ||||
| function mergeOptions(target, source) { | ||||
|   for (const k of Object.keys(source)) { | ||||
|     if ((k === "parserOpts" || k === "generatorOpts" || k === "assumptions") && source[k]) { | ||||
|       const parserOpts = source[k]; | ||||
|       const targetObj = target[k] || (target[k] = {}); | ||||
|       mergeDefaultFields(targetObj, parserOpts); | ||||
|     } else { | ||||
|       const val = source[k]; | ||||
|       if (val !== undefined) target[k] = val; | ||||
|     } | ||||
|   } | ||||
| } | ||||
| function mergeDefaultFields(target, source) { | ||||
|   for (const k of Object.keys(source)) { | ||||
|     const val = source[k]; | ||||
|     if (val !== undefined) target[k] = val; | ||||
|   } | ||||
| } | ||||
| function isIterableIterator(value) { | ||||
|   return !!value && typeof value.next === "function" && typeof value[Symbol.iterator] === "function"; | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=util.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/util.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/util.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| {"version":3,"names":["mergeOptions","target","source","k","Object","keys","parserOpts","targetObj","mergeDefaultFields","val","undefined","isIterableIterator","value","next","Symbol","iterator"],"sources":["../../src/config/util.ts"],"sourcesContent":["import type { ValidatedOptions, NormalizedOptions } from \"./validation/options\";\n\nexport function mergeOptions(\n  target: ValidatedOptions,\n  source: ValidatedOptions | NormalizedOptions,\n): void {\n  for (const k of Object.keys(source)) {\n    if (\n      (k === \"parserOpts\" || k === \"generatorOpts\" || k === \"assumptions\") &&\n      source[k]\n    ) {\n      const parserOpts = source[k];\n      const targetObj = target[k] || (target[k] = {});\n      mergeDefaultFields(targetObj, parserOpts);\n    } else {\n      //@ts-expect-error k must index source\n      const val = source[k];\n      //@ts-expect-error assigning source to target\n      if (val !== undefined) target[k] = val as any;\n    }\n  }\n}\n\nfunction mergeDefaultFields<T extends {}>(target: T, source: T) {\n  for (const k of Object.keys(source) as (keyof T)[]) {\n    const val = source[k];\n    if (val !== undefined) target[k] = val;\n  }\n}\n\nexport function isIterableIterator(value: any): value is IterableIterator<any> {\n  return (\n    !!value &&\n    typeof value.next === \"function\" &&\n    typeof value[Symbol.iterator] === \"function\"\n  );\n}\n"],"mappings":";;;;;;;AAEO,SAASA,YAAYA,CAC1BC,MAAwB,EACxBC,MAA4C,EACtC;EACN,KAAK,MAAMC,CAAC,IAAIC,MAAM,CAACC,IAAI,CAACH,MAAM,CAAC,EAAE;IACnC,IACE,CAACC,CAAC,KAAK,YAAY,IAAIA,CAAC,KAAK,eAAe,IAAIA,CAAC,KAAK,aAAa,KACnED,MAAM,CAACC,CAAC,CAAC,EACT;MACA,MAAMG,UAAU,GAAGJ,MAAM,CAACC,CAAC,CAAC;MAC5B,MAAMI,SAAS,GAAGN,MAAM,CAACE,CAAC,CAAC,KAAKF,MAAM,CAACE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;MAC/CK,kBAAkB,CAACD,SAAS,EAAED,UAAU,CAAC;IAC3C,CAAC,MAAM;MAEL,MAAMG,GAAG,GAAGP,MAAM,CAACC,CAAC,CAAC;MAErB,IAAIM,GAAG,KAAKC,SAAS,EAAET,MAAM,CAACE,CAAC,CAAC,GAAGM,GAAU;IAC/C;EACF;AACF;AAEA,SAASD,kBAAkBA,CAAeP,MAAS,EAAEC,MAAS,EAAE;EAC9D,KAAK,MAAMC,CAAC,IAAIC,MAAM,CAACC,IAAI,CAACH,MAAM,CAAC,EAAiB;IAClD,MAAMO,GAAG,GAAGP,MAAM,CAACC,CAAC,CAAC;IACrB,IAAIM,GAAG,KAAKC,SAAS,EAAET,MAAM,CAACE,CAAC,CAAC,GAAGM,GAAG;EACxC;AACF;AAEO,SAASE,kBAAkBA,CAACC,KAAU,EAAkC;EAC7E,OACE,CAAC,CAACA,KAAK,IACP,OAAOA,KAAK,CAACC,IAAI,KAAK,UAAU,IAChC,OAAOD,KAAK,CAACE,MAAM,CAACC,QAAQ,CAAC,KAAK,UAAU;AAEhD;AAAC"} | ||||
							
								
								
									
										277
									
								
								node_modules/@babel/core/lib/config/validation/option-assertions.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										277
									
								
								node_modules/@babel/core/lib/config/validation/option-assertions.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,277 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.access = access; | ||||
| exports.assertArray = assertArray; | ||||
| exports.assertAssumptions = assertAssumptions; | ||||
| exports.assertBabelrcSearch = assertBabelrcSearch; | ||||
| exports.assertBoolean = assertBoolean; | ||||
| exports.assertCallerMetadata = assertCallerMetadata; | ||||
| exports.assertCompact = assertCompact; | ||||
| exports.assertConfigApplicableTest = assertConfigApplicableTest; | ||||
| exports.assertConfigFileSearch = assertConfigFileSearch; | ||||
| exports.assertFunction = assertFunction; | ||||
| exports.assertIgnoreList = assertIgnoreList; | ||||
| exports.assertInputSourceMap = assertInputSourceMap; | ||||
| exports.assertObject = assertObject; | ||||
| exports.assertPluginList = assertPluginList; | ||||
| exports.assertRootMode = assertRootMode; | ||||
| exports.assertSourceMaps = assertSourceMaps; | ||||
| exports.assertSourceType = assertSourceType; | ||||
| exports.assertString = assertString; | ||||
| exports.assertTargets = assertTargets; | ||||
| exports.msg = msg; | ||||
| function _helperCompilationTargets() { | ||||
|   const data = require("@babel/helper-compilation-targets"); | ||||
|   _helperCompilationTargets = function () { | ||||
|     return data; | ||||
|   }; | ||||
|   return data; | ||||
| } | ||||
| var _options = require("./options"); | ||||
| function msg(loc) { | ||||
|   switch (loc.type) { | ||||
|     case "root": | ||||
|       return ``; | ||||
|     case "env": | ||||
|       return `${msg(loc.parent)}.env["${loc.name}"]`; | ||||
|     case "overrides": | ||||
|       return `${msg(loc.parent)}.overrides[${loc.index}]`; | ||||
|     case "option": | ||||
|       return `${msg(loc.parent)}.${loc.name}`; | ||||
|     case "access": | ||||
|       return `${msg(loc.parent)}[${JSON.stringify(loc.name)}]`; | ||||
|     default: | ||||
|       throw new Error(`Assertion failure: Unknown type ${loc.type}`); | ||||
|   } | ||||
| } | ||||
| function access(loc, name) { | ||||
|   return { | ||||
|     type: "access", | ||||
|     name, | ||||
|     parent: loc | ||||
|   }; | ||||
| } | ||||
| function assertRootMode(loc, value) { | ||||
|   if (value !== undefined && value !== "root" && value !== "upward" && value !== "upward-optional") { | ||||
|     throw new Error(`${msg(loc)} must be a "root", "upward", "upward-optional" or undefined`); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function assertSourceMaps(loc, value) { | ||||
|   if (value !== undefined && typeof value !== "boolean" && value !== "inline" && value !== "both") { | ||||
|     throw new Error(`${msg(loc)} must be a boolean, "inline", "both", or undefined`); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function assertCompact(loc, value) { | ||||
|   if (value !== undefined && typeof value !== "boolean" && value !== "auto") { | ||||
|     throw new Error(`${msg(loc)} must be a boolean, "auto", or undefined`); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function assertSourceType(loc, value) { | ||||
|   if (value !== undefined && value !== "module" && value !== "script" && value !== "unambiguous") { | ||||
|     throw new Error(`${msg(loc)} must be "module", "script", "unambiguous", or undefined`); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function assertCallerMetadata(loc, value) { | ||||
|   const obj = assertObject(loc, value); | ||||
|   if (obj) { | ||||
|     if (typeof obj.name !== "string") { | ||||
|       throw new Error(`${msg(loc)} set but does not contain "name" property string`); | ||||
|     } | ||||
|     for (const prop of Object.keys(obj)) { | ||||
|       const propLoc = access(loc, prop); | ||||
|       const value = obj[prop]; | ||||
|       if (value != null && typeof value !== "boolean" && typeof value !== "string" && typeof value !== "number") { | ||||
|         throw new Error(`${msg(propLoc)} must be null, undefined, a boolean, a string, or a number.`); | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function assertInputSourceMap(loc, value) { | ||||
|   if (value !== undefined && typeof value !== "boolean" && (typeof value !== "object" || !value)) { | ||||
|     throw new Error(`${msg(loc)} must be a boolean, object, or undefined`); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function assertString(loc, value) { | ||||
|   if (value !== undefined && typeof value !== "string") { | ||||
|     throw new Error(`${msg(loc)} must be a string, or undefined`); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function assertFunction(loc, value) { | ||||
|   if (value !== undefined && typeof value !== "function") { | ||||
|     throw new Error(`${msg(loc)} must be a function, or undefined`); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function assertBoolean(loc, value) { | ||||
|   if (value !== undefined && typeof value !== "boolean") { | ||||
|     throw new Error(`${msg(loc)} must be a boolean, or undefined`); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function assertObject(loc, value) { | ||||
|   if (value !== undefined && (typeof value !== "object" || Array.isArray(value) || !value)) { | ||||
|     throw new Error(`${msg(loc)} must be an object, or undefined`); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function assertArray(loc, value) { | ||||
|   if (value != null && !Array.isArray(value)) { | ||||
|     throw new Error(`${msg(loc)} must be an array, or undefined`); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function assertIgnoreList(loc, value) { | ||||
|   const arr = assertArray(loc, value); | ||||
|   arr == null ? void 0 : arr.forEach((item, i) => assertIgnoreItem(access(loc, i), item)); | ||||
|   return arr; | ||||
| } | ||||
| function assertIgnoreItem(loc, value) { | ||||
|   if (typeof value !== "string" && typeof value !== "function" && !(value instanceof RegExp)) { | ||||
|     throw new Error(`${msg(loc)} must be an array of string/Function/RegExp values, or undefined`); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function assertConfigApplicableTest(loc, value) { | ||||
|   if (value === undefined) { | ||||
|     return value; | ||||
|   } | ||||
|   if (Array.isArray(value)) { | ||||
|     value.forEach((item, i) => { | ||||
|       if (!checkValidTest(item)) { | ||||
|         throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`); | ||||
|       } | ||||
|     }); | ||||
|   } else if (!checkValidTest(value)) { | ||||
|     throw new Error(`${msg(loc)} must be a string/Function/RegExp, or an array of those`); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function checkValidTest(value) { | ||||
|   return typeof value === "string" || typeof value === "function" || value instanceof RegExp; | ||||
| } | ||||
| function assertConfigFileSearch(loc, value) { | ||||
|   if (value !== undefined && typeof value !== "boolean" && typeof value !== "string") { | ||||
|     throw new Error(`${msg(loc)} must be a undefined, a boolean, a string, ` + `got ${JSON.stringify(value)}`); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function assertBabelrcSearch(loc, value) { | ||||
|   if (value === undefined || typeof value === "boolean") { | ||||
|     return value; | ||||
|   } | ||||
|   if (Array.isArray(value)) { | ||||
|     value.forEach((item, i) => { | ||||
|       if (!checkValidTest(item)) { | ||||
|         throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`); | ||||
|       } | ||||
|     }); | ||||
|   } else if (!checkValidTest(value)) { | ||||
|     throw new Error(`${msg(loc)} must be a undefined, a boolean, a string/Function/RegExp ` + `or an array of those, got ${JSON.stringify(value)}`); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function assertPluginList(loc, value) { | ||||
|   const arr = assertArray(loc, value); | ||||
|   if (arr) { | ||||
|     arr.forEach((item, i) => assertPluginItem(access(loc, i), item)); | ||||
|   } | ||||
|   return arr; | ||||
| } | ||||
| function assertPluginItem(loc, value) { | ||||
|   if (Array.isArray(value)) { | ||||
|     if (value.length === 0) { | ||||
|       throw new Error(`${msg(loc)} must include an object`); | ||||
|     } | ||||
|     if (value.length > 3) { | ||||
|       throw new Error(`${msg(loc)} may only be a two-tuple or three-tuple`); | ||||
|     } | ||||
|     assertPluginTarget(access(loc, 0), value[0]); | ||||
|     if (value.length > 1) { | ||||
|       const opts = value[1]; | ||||
|       if (opts !== undefined && opts !== false && (typeof opts !== "object" || Array.isArray(opts) || opts === null)) { | ||||
|         throw new Error(`${msg(access(loc, 1))} must be an object, false, or undefined`); | ||||
|       } | ||||
|     } | ||||
|     if (value.length === 3) { | ||||
|       const name = value[2]; | ||||
|       if (name !== undefined && typeof name !== "string") { | ||||
|         throw new Error(`${msg(access(loc, 2))} must be a string, or undefined`); | ||||
|       } | ||||
|     } | ||||
|   } else { | ||||
|     assertPluginTarget(loc, value); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function assertPluginTarget(loc, value) { | ||||
|   if ((typeof value !== "object" || !value) && typeof value !== "string" && typeof value !== "function") { | ||||
|     throw new Error(`${msg(loc)} must be a string, object, function`); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function assertTargets(loc, value) { | ||||
|   if ((0, _helperCompilationTargets().isBrowsersQueryValid)(value)) return value; | ||||
|   if (typeof value !== "object" || !value || Array.isArray(value)) { | ||||
|     throw new Error(`${msg(loc)} must be a string, an array of strings or an object`); | ||||
|   } | ||||
|   const browsersLoc = access(loc, "browsers"); | ||||
|   const esmodulesLoc = access(loc, "esmodules"); | ||||
|   assertBrowsersList(browsersLoc, value.browsers); | ||||
|   assertBoolean(esmodulesLoc, value.esmodules); | ||||
|   for (const key of Object.keys(value)) { | ||||
|     const val = value[key]; | ||||
|     const subLoc = access(loc, key); | ||||
|     if (key === "esmodules") assertBoolean(subLoc, val);else if (key === "browsers") assertBrowsersList(subLoc, val);else if (!Object.hasOwnProperty.call(_helperCompilationTargets().TargetNames, key)) { | ||||
|       const validTargets = Object.keys(_helperCompilationTargets().TargetNames).join(", "); | ||||
|       throw new Error(`${msg(subLoc)} is not a valid target. Supported targets are ${validTargets}`); | ||||
|     } else assertBrowserVersion(subLoc, val); | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| function assertBrowsersList(loc, value) { | ||||
|   if (value !== undefined && !(0, _helperCompilationTargets().isBrowsersQueryValid)(value)) { | ||||
|     throw new Error(`${msg(loc)} must be undefined, a string or an array of strings`); | ||||
|   } | ||||
| } | ||||
| function assertBrowserVersion(loc, value) { | ||||
|   if (typeof value === "number" && Math.round(value) === value) return; | ||||
|   if (typeof value === "string") return; | ||||
|   throw new Error(`${msg(loc)} must be a string or an integer number`); | ||||
| } | ||||
| function assertAssumptions(loc, value) { | ||||
|   if (value === undefined) return; | ||||
|   if (typeof value !== "object" || value === null) { | ||||
|     throw new Error(`${msg(loc)} must be an object or undefined.`); | ||||
|   } | ||||
|   let root = loc; | ||||
|   do { | ||||
|     root = root.parent; | ||||
|   } while (root.type !== "root"); | ||||
|   const inPreset = root.source === "preset"; | ||||
|   for (const name of Object.keys(value)) { | ||||
|     const subLoc = access(loc, name); | ||||
|     if (!_options.assumptionsNames.has(name)) { | ||||
|       throw new Error(`${msg(subLoc)} is not a supported assumption.`); | ||||
|     } | ||||
|     if (typeof value[name] !== "boolean") { | ||||
|       throw new Error(`${msg(subLoc)} must be a boolean.`); | ||||
|     } | ||||
|     if (inPreset && value[name] === false) { | ||||
|       throw new Error(`${msg(subLoc)} cannot be set to 'false' inside presets.`); | ||||
|     } | ||||
|   } | ||||
|   return value; | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=option-assertions.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/validation/option-assertions.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/validation/option-assertions.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										193
									
								
								node_modules/@babel/core/lib/config/validation/options.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										193
									
								
								node_modules/@babel/core/lib/config/validation/options.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,193 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.assumptionsNames = void 0; | ||||
| exports.checkNoUnwrappedItemOptionPairs = checkNoUnwrappedItemOptionPairs; | ||||
| exports.validate = validate; | ||||
| var _removed = require("./removed"); | ||||
| var _optionAssertions = require("./option-assertions"); | ||||
| var _configError = require("../../errors/config-error"); | ||||
| const ROOT_VALIDATORS = { | ||||
|   cwd: _optionAssertions.assertString, | ||||
|   root: _optionAssertions.assertString, | ||||
|   rootMode: _optionAssertions.assertRootMode, | ||||
|   configFile: _optionAssertions.assertConfigFileSearch, | ||||
|   caller: _optionAssertions.assertCallerMetadata, | ||||
|   filename: _optionAssertions.assertString, | ||||
|   filenameRelative: _optionAssertions.assertString, | ||||
|   code: _optionAssertions.assertBoolean, | ||||
|   ast: _optionAssertions.assertBoolean, | ||||
|   cloneInputAst: _optionAssertions.assertBoolean, | ||||
|   envName: _optionAssertions.assertString | ||||
| }; | ||||
| const BABELRC_VALIDATORS = { | ||||
|   babelrc: _optionAssertions.assertBoolean, | ||||
|   babelrcRoots: _optionAssertions.assertBabelrcSearch | ||||
| }; | ||||
| const NONPRESET_VALIDATORS = { | ||||
|   extends: _optionAssertions.assertString, | ||||
|   ignore: _optionAssertions.assertIgnoreList, | ||||
|   only: _optionAssertions.assertIgnoreList, | ||||
|   targets: _optionAssertions.assertTargets, | ||||
|   browserslistConfigFile: _optionAssertions.assertConfigFileSearch, | ||||
|   browserslistEnv: _optionAssertions.assertString | ||||
| }; | ||||
| const COMMON_VALIDATORS = { | ||||
|   inputSourceMap: _optionAssertions.assertInputSourceMap, | ||||
|   presets: _optionAssertions.assertPluginList, | ||||
|   plugins: _optionAssertions.assertPluginList, | ||||
|   passPerPreset: _optionAssertions.assertBoolean, | ||||
|   assumptions: _optionAssertions.assertAssumptions, | ||||
|   env: assertEnvSet, | ||||
|   overrides: assertOverridesList, | ||||
|   test: _optionAssertions.assertConfigApplicableTest, | ||||
|   include: _optionAssertions.assertConfigApplicableTest, | ||||
|   exclude: _optionAssertions.assertConfigApplicableTest, | ||||
|   retainLines: _optionAssertions.assertBoolean, | ||||
|   comments: _optionAssertions.assertBoolean, | ||||
|   shouldPrintComment: _optionAssertions.assertFunction, | ||||
|   compact: _optionAssertions.assertCompact, | ||||
|   minified: _optionAssertions.assertBoolean, | ||||
|   auxiliaryCommentBefore: _optionAssertions.assertString, | ||||
|   auxiliaryCommentAfter: _optionAssertions.assertString, | ||||
|   sourceType: _optionAssertions.assertSourceType, | ||||
|   wrapPluginVisitorMethod: _optionAssertions.assertFunction, | ||||
|   highlightCode: _optionAssertions.assertBoolean, | ||||
|   sourceMaps: _optionAssertions.assertSourceMaps, | ||||
|   sourceMap: _optionAssertions.assertSourceMaps, | ||||
|   sourceFileName: _optionAssertions.assertString, | ||||
|   sourceRoot: _optionAssertions.assertString, | ||||
|   parserOpts: _optionAssertions.assertObject, | ||||
|   generatorOpts: _optionAssertions.assertObject | ||||
| }; | ||||
| { | ||||
|   Object.assign(COMMON_VALIDATORS, { | ||||
|     getModuleId: _optionAssertions.assertFunction, | ||||
|     moduleRoot: _optionAssertions.assertString, | ||||
|     moduleIds: _optionAssertions.assertBoolean, | ||||
|     moduleId: _optionAssertions.assertString | ||||
|   }); | ||||
| } | ||||
| const knownAssumptions = ["arrayLikeIsIterable", "constantReexports", "constantSuper", "enumerableModuleMeta", "ignoreFunctionLength", "ignoreToPrimitiveHint", "iterableIsArray", "mutableTemplateObject", "noClassCalls", "noDocumentAll", "noIncompleteNsImportDetection", "noNewArrows", "objectRestNoSymbols", "privateFieldsAsSymbols", "privateFieldsAsProperties", "pureGetters", "setClassMethods", "setComputedProperties", "setPublicClassFields", "setSpreadProperties", "skipForOfIteratorClosing", "superIsCallableConstructor"]; | ||||
| const assumptionsNames = new Set(knownAssumptions); | ||||
| exports.assumptionsNames = assumptionsNames; | ||||
| function getSource(loc) { | ||||
|   return loc.type === "root" ? loc.source : getSource(loc.parent); | ||||
| } | ||||
| function validate(type, opts, filename) { | ||||
|   try { | ||||
|     return validateNested({ | ||||
|       type: "root", | ||||
|       source: type | ||||
|     }, opts); | ||||
|   } catch (error) { | ||||
|     const configError = new _configError.default(error.message, filename); | ||||
|     if (error.code) configError.code = error.code; | ||||
|     throw configError; | ||||
|   } | ||||
| } | ||||
| function validateNested(loc, opts) { | ||||
|   const type = getSource(loc); | ||||
|   assertNoDuplicateSourcemap(opts); | ||||
|   Object.keys(opts).forEach(key => { | ||||
|     const optLoc = { | ||||
|       type: "option", | ||||
|       name: key, | ||||
|       parent: loc | ||||
|     }; | ||||
|     if (type === "preset" && NONPRESET_VALIDATORS[key]) { | ||||
|       throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is not allowed in preset options`); | ||||
|     } | ||||
|     if (type !== "arguments" && ROOT_VALIDATORS[key]) { | ||||
|       throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is only allowed in root programmatic options`); | ||||
|     } | ||||
|     if (type !== "arguments" && type !== "configfile" && BABELRC_VALIDATORS[key]) { | ||||
|       if (type === "babelrcfile" || type === "extendsfile") { | ||||
|         throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is not allowed in .babelrc or "extends"ed files, only in root programmatic options, ` + `or babel.config.js/config file options`); | ||||
|       } | ||||
|       throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is only allowed in root programmatic options, or babel.config.js/config file options`); | ||||
|     } | ||||
|     const validator = COMMON_VALIDATORS[key] || NONPRESET_VALIDATORS[key] || BABELRC_VALIDATORS[key] || ROOT_VALIDATORS[key] || throwUnknownError; | ||||
|     validator(optLoc, opts[key]); | ||||
|   }); | ||||
|   return opts; | ||||
| } | ||||
| function throwUnknownError(loc) { | ||||
|   const key = loc.name; | ||||
|   if (_removed.default[key]) { | ||||
|     const { | ||||
|       message, | ||||
|       version = 5 | ||||
|     } = _removed.default[key]; | ||||
|     throw new Error(`Using removed Babel ${version} option: ${(0, _optionAssertions.msg)(loc)} - ${message}`); | ||||
|   } else { | ||||
|     const unknownOptErr = new Error(`Unknown option: ${(0, _optionAssertions.msg)(loc)}. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.`); | ||||
|     unknownOptErr.code = "BABEL_UNKNOWN_OPTION"; | ||||
|     throw unknownOptErr; | ||||
|   } | ||||
| } | ||||
| function has(obj, key) { | ||||
|   return Object.prototype.hasOwnProperty.call(obj, key); | ||||
| } | ||||
| function assertNoDuplicateSourcemap(opts) { | ||||
|   if (has(opts, "sourceMap") && has(opts, "sourceMaps")) { | ||||
|     throw new Error(".sourceMap is an alias for .sourceMaps, cannot use both"); | ||||
|   } | ||||
| } | ||||
| function assertEnvSet(loc, value) { | ||||
|   if (loc.parent.type === "env") { | ||||
|     throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside of another .env block`); | ||||
|   } | ||||
|   const parent = loc.parent; | ||||
|   const obj = (0, _optionAssertions.assertObject)(loc, value); | ||||
|   if (obj) { | ||||
|     for (const envName of Object.keys(obj)) { | ||||
|       const env = (0, _optionAssertions.assertObject)((0, _optionAssertions.access)(loc, envName), obj[envName]); | ||||
|       if (!env) continue; | ||||
|       const envLoc = { | ||||
|         type: "env", | ||||
|         name: envName, | ||||
|         parent | ||||
|       }; | ||||
|       validateNested(envLoc, env); | ||||
|     } | ||||
|   } | ||||
|   return obj; | ||||
| } | ||||
| function assertOverridesList(loc, value) { | ||||
|   if (loc.parent.type === "env") { | ||||
|     throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside an .env block`); | ||||
|   } | ||||
|   if (loc.parent.type === "overrides") { | ||||
|     throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside an .overrides block`); | ||||
|   } | ||||
|   const parent = loc.parent; | ||||
|   const arr = (0, _optionAssertions.assertArray)(loc, value); | ||||
|   if (arr) { | ||||
|     for (const [index, item] of arr.entries()) { | ||||
|       const objLoc = (0, _optionAssertions.access)(loc, index); | ||||
|       const env = (0, _optionAssertions.assertObject)(objLoc, item); | ||||
|       if (!env) throw new Error(`${(0, _optionAssertions.msg)(objLoc)} must be an object`); | ||||
|       const overridesLoc = { | ||||
|         type: "overrides", | ||||
|         index, | ||||
|         parent | ||||
|       }; | ||||
|       validateNested(overridesLoc, env); | ||||
|     } | ||||
|   } | ||||
|   return arr; | ||||
| } | ||||
| function checkNoUnwrappedItemOptionPairs(items, index, type, e) { | ||||
|   if (index === 0) return; | ||||
|   const lastItem = items[index - 1]; | ||||
|   const thisItem = items[index]; | ||||
|   if (lastItem.file && lastItem.options === undefined && typeof thisItem.value === "object") { | ||||
|     e.message += `\n- Maybe you meant to use\n` + `"${type}s": [\n  ["${lastItem.file.request}", ${JSON.stringify(thisItem.value, undefined, 2)}]\n]\n` + `To be a valid ${type}, its name and options should be wrapped in a pair of brackets`; | ||||
|   } | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=options.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/validation/options.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/validation/options.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										67
									
								
								node_modules/@babel/core/lib/config/validation/plugins.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								node_modules/@babel/core/lib/config/validation/plugins.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,67 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.validatePluginObject = validatePluginObject; | ||||
| var _optionAssertions = require("./option-assertions"); | ||||
| const VALIDATORS = { | ||||
|   name: _optionAssertions.assertString, | ||||
|   manipulateOptions: _optionAssertions.assertFunction, | ||||
|   pre: _optionAssertions.assertFunction, | ||||
|   post: _optionAssertions.assertFunction, | ||||
|   inherits: _optionAssertions.assertFunction, | ||||
|   visitor: assertVisitorMap, | ||||
|   parserOverride: _optionAssertions.assertFunction, | ||||
|   generatorOverride: _optionAssertions.assertFunction | ||||
| }; | ||||
| function assertVisitorMap(loc, value) { | ||||
|   const obj = (0, _optionAssertions.assertObject)(loc, value); | ||||
|   if (obj) { | ||||
|     Object.keys(obj).forEach(prop => { | ||||
|       if (prop !== "_exploded" && prop !== "_verified") { | ||||
|         assertVisitorHandler(prop, obj[prop]); | ||||
|       } | ||||
|     }); | ||||
|     if (obj.enter || obj.exit) { | ||||
|       throw new Error(`${(0, _optionAssertions.msg)(loc)} cannot contain catch-all "enter" or "exit" handlers. Please target individual nodes.`); | ||||
|     } | ||||
|   } | ||||
|   return obj; | ||||
| } | ||||
| function assertVisitorHandler(key, value) { | ||||
|   if (value && typeof value === "object") { | ||||
|     Object.keys(value).forEach(handler => { | ||||
|       if (handler !== "enter" && handler !== "exit") { | ||||
|         throw new Error(`.visitor["${key}"] may only have .enter and/or .exit handlers.`); | ||||
|       } | ||||
|     }); | ||||
|   } else if (typeof value !== "function") { | ||||
|     throw new Error(`.visitor["${key}"] must be a function`); | ||||
|   } | ||||
| } | ||||
| function validatePluginObject(obj) { | ||||
|   const rootPath = { | ||||
|     type: "root", | ||||
|     source: "plugin" | ||||
|   }; | ||||
|   Object.keys(obj).forEach(key => { | ||||
|     const validator = VALIDATORS[key]; | ||||
|     if (validator) { | ||||
|       const optLoc = { | ||||
|         type: "option", | ||||
|         name: key, | ||||
|         parent: rootPath | ||||
|       }; | ||||
|       validator(optLoc, obj[key]); | ||||
|     } else { | ||||
|       const invalidPluginPropertyError = new Error(`.${key} is not a valid Plugin property`); | ||||
|       invalidPluginPropertyError.code = "BABEL_UNKNOWN_PLUGIN_PROPERTY"; | ||||
|       throw invalidPluginPropertyError; | ||||
|     } | ||||
|   }); | ||||
|   return obj; | ||||
| } | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=plugins.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/validation/plugins.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/validation/plugins.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										69
									
								
								node_modules/@babel/core/lib/config/validation/removed.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										69
									
								
								node_modules/@babel/core/lib/config/validation/removed.js
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,69 @@ | |||
| "use strict"; | ||||
| 
 | ||||
| Object.defineProperty(exports, "__esModule", { | ||||
|   value: true | ||||
| }); | ||||
| exports.default = void 0; | ||||
| var _default = { | ||||
|   auxiliaryComment: { | ||||
|     message: "Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`" | ||||
|   }, | ||||
|   blacklist: { | ||||
|     message: "Put the specific transforms you want in the `plugins` option" | ||||
|   }, | ||||
|   breakConfig: { | ||||
|     message: "This is not a necessary option in Babel 6" | ||||
|   }, | ||||
|   experimental: { | ||||
|     message: "Put the specific transforms you want in the `plugins` option" | ||||
|   }, | ||||
|   externalHelpers: { | ||||
|     message: "Use the `external-helpers` plugin instead. " + "Check out http://babeljs.io/docs/plugins/external-helpers/" | ||||
|   }, | ||||
|   extra: { | ||||
|     message: "" | ||||
|   }, | ||||
|   jsxPragma: { | ||||
|     message: "use the `pragma` option in the `react-jsx` plugin. " + "Check out http://babeljs.io/docs/plugins/transform-react-jsx/" | ||||
|   }, | ||||
|   loose: { | ||||
|     message: "Specify the `loose` option for the relevant plugin you are using " + "or use a preset that sets the option." | ||||
|   }, | ||||
|   metadataUsedHelpers: { | ||||
|     message: "Not required anymore as this is enabled by default" | ||||
|   }, | ||||
|   modules: { | ||||
|     message: "Use the corresponding module transform plugin in the `plugins` option. " + "Check out http://babeljs.io/docs/plugins/#modules" | ||||
|   }, | ||||
|   nonStandard: { | ||||
|     message: "Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. " + "Also check out the react preset http://babeljs.io/docs/plugins/preset-react/" | ||||
|   }, | ||||
|   optional: { | ||||
|     message: "Put the specific transforms you want in the `plugins` option" | ||||
|   }, | ||||
|   sourceMapName: { | ||||
|     message: "The `sourceMapName` option has been removed because it makes more sense for the " + "tooling that calls Babel to assign `map.file` themselves." | ||||
|   }, | ||||
|   stage: { | ||||
|     message: "Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets" | ||||
|   }, | ||||
|   whitelist: { | ||||
|     message: "Put the specific transforms you want in the `plugins` option" | ||||
|   }, | ||||
|   resolveModuleSource: { | ||||
|     version: 6, | ||||
|     message: "Use `babel-plugin-module-resolver@3`'s 'resolvePath' options" | ||||
|   }, | ||||
|   metadata: { | ||||
|     version: 6, | ||||
|     message: "Generated plugin metadata is always included in the output result" | ||||
|   }, | ||||
|   sourceMapTarget: { | ||||
|     version: 6, | ||||
|     message: "The `sourceMapTarget` option has been removed because it makes more sense for the tooling " + "that calls Babel to assign `map.file` themselves." | ||||
|   } | ||||
| }; | ||||
| exports.default = _default; | ||||
| 0 && 0; | ||||
| 
 | ||||
| //# sourceMappingURL=removed.js.map
 | ||||
							
								
								
									
										1
									
								
								node_modules/@babel/core/lib/config/validation/removed.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/@babel/core/lib/config/validation/removed.js.map
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| {"version":3,"names":["auxiliaryComment","message","blacklist","breakConfig","experimental","externalHelpers","extra","jsxPragma","loose","metadataUsedHelpers","modules","nonStandard","optional","sourceMapName","stage","whitelist","resolveModuleSource","version","metadata","sourceMapTarget","exports","default","_default"],"sources":["../../../src/config/validation/removed.ts"],"sourcesContent":["export default {\n  auxiliaryComment: {\n    message: \"Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`\",\n  },\n  blacklist: {\n    message: \"Put the specific transforms you want in the `plugins` option\",\n  },\n  breakConfig: {\n    message: \"This is not a necessary option in Babel 6\",\n  },\n  experimental: {\n    message: \"Put the specific transforms you want in the `plugins` option\",\n  },\n  externalHelpers: {\n    message:\n      \"Use the `external-helpers` plugin instead. \" +\n      \"Check out http://babeljs.io/docs/plugins/external-helpers/\",\n  },\n  extra: {\n    message: \"\",\n  },\n  jsxPragma: {\n    message:\n      \"use the `pragma` option in the `react-jsx` plugin. \" +\n      \"Check out http://babeljs.io/docs/plugins/transform-react-jsx/\",\n  },\n  loose: {\n    message:\n      \"Specify the `loose` option for the relevant plugin you are using \" +\n      \"or use a preset that sets the option.\",\n  },\n  metadataUsedHelpers: {\n    message: \"Not required anymore as this is enabled by default\",\n  },\n  modules: {\n    message:\n      \"Use the corresponding module transform plugin in the `plugins` option. \" +\n      \"Check out http://babeljs.io/docs/plugins/#modules\",\n  },\n  nonStandard: {\n    message:\n      \"Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. \" +\n      \"Also check out the react preset http://babeljs.io/docs/plugins/preset-react/\",\n  },\n  optional: {\n    message: \"Put the specific transforms you want in the `plugins` option\",\n  },\n  sourceMapName: {\n    message:\n      \"The `sourceMapName` option has been removed because it makes more sense for the \" +\n      \"tooling that calls Babel to assign `map.file` themselves.\",\n  },\n  stage: {\n    message:\n      \"Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets\",\n  },\n  whitelist: {\n    message: \"Put the specific transforms you want in the `plugins` option\",\n  },\n\n  resolveModuleSource: {\n    version: 6,\n    message: \"Use `babel-plugin-module-resolver@3`'s 'resolvePath' options\",\n  },\n  metadata: {\n    version: 6,\n    message:\n      \"Generated plugin metadata is always included in the output result\",\n  },\n  sourceMapTarget: {\n    version: 6,\n    message:\n      \"The `sourceMapTarget` option has been removed because it makes more sense for the tooling \" +\n      \"that calls Babel to assign `map.file` themselves.\",\n  },\n} as { [name: string]: { version?: number; message: string } };\n"],"mappings":";;;;;;eAAe;EACbA,gBAAgB,EAAE;IAChBC,OAAO,EAAE;EACX,CAAC;EACDC,SAAS,EAAE;IACTD,OAAO,EAAE;EACX,CAAC;EACDE,WAAW,EAAE;IACXF,OAAO,EAAE;EACX,CAAC;EACDG,YAAY,EAAE;IACZH,OAAO,EAAE;EACX,CAAC;EACDI,eAAe,EAAE;IACfJ,OAAO,EACL,6CAA6C,GAC7C;EACJ,CAAC;EACDK,KAAK,EAAE;IACLL,OAAO,EAAE;EACX,CAAC;EACDM,SAAS,EAAE;IACTN,OAAO,EACL,qDAAqD,GACrD;EACJ,CAAC;EACDO,KAAK,EAAE;IACLP,OAAO,EACL,mEAAmE,GACnE;EACJ,CAAC;EACDQ,mBAAmB,EAAE;IACnBR,OAAO,EAAE;EACX,CAAC;EACDS,OAAO,EAAE;IACPT,OAAO,EACL,yEAAyE,GACzE;EACJ,CAAC;EACDU,WAAW,EAAE;IACXV,OAAO,EACL,8EAA8E,GAC9E;EACJ,CAAC;EACDW,QAAQ,EAAE;IACRX,OAAO,EAAE;EACX,CAAC;EACDY,aAAa,EAAE;IACbZ,OAAO,EACL,kFAAkF,GAClF;EACJ,CAAC;EACDa,KAAK,EAAE;IACLb,OAAO,EACL;EACJ,CAAC;EACDc,SAAS,EAAE;IACTd,OAAO,EAAE;EACX,CAAC;EAEDe,mBAAmB,EAAE;IACnBC,OAAO,EAAE,CAAC;IACVhB,OAAO,EAAE;EACX,CAAC;EACDiB,QAAQ,EAAE;IACRD,OAAO,EAAE,CAAC;IACVhB,OAAO,EACL;EACJ,CAAC;EACDkB,eAAe,EAAE;IACfF,OAAO,EAAE,CAAC;IACVhB,OAAO,EACL,4FAA4F,GAC5F;EACJ;AACF,CAAC;AAAAmB,OAAA,CAAAC,OAAA,GAAAC,QAAA;AAAA"} | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 sindrekjelsrud
						sindrekjelsrud