{"version":3,"file":"tsconfig.mjs","sources":["../../../../src/cli/utils/tsconfig.ts"],"sourcesContent":["import os from 'os';\nimport ts from 'typescript';\nimport type { Logger } from './logger';\n\ninterface TsConfig {\n config: ts.ParsedCommandLine;\n path: string;\n}\n\n/**\n * @description Load a tsconfig.json file and return the parsed config.\n *\n * @internal\n */\nconst loadTsConfig = ({\n cwd,\n path,\n logger,\n}: {\n cwd: string;\n path: string;\n logger: Logger;\n}): TsConfig | undefined => {\n const configPath = ts.findConfigFile(cwd, ts.sys.fileExists, path);\n\n if (!configPath) {\n return undefined;\n }\n\n const configFile = ts.readConfigFile(configPath, ts.sys.readFile);\n\n const parsedConfig = ts.parseJsonConfigFileContent(configFile.config, ts.sys, cwd);\n\n logger.debug(`Loaded user TS config:`, os.EOL, parsedConfig);\n\n return {\n config: parsedConfig,\n path: configPath,\n };\n};\n\nexport { loadTsConfig };\nexport type { TsConfig };\n"],"names":["loadTsConfig","cwd","path","logger","configPath","ts","findConfigFile","sys","fileExists","undefined","configFile","readConfigFile","readFile","parsedConfig","parseJsonConfigFileContent","config","debug","os","EOL"],"mappings":";;;AASA;;;;IAKA,MAAMA,eAAe,CAAC,EACpBC,GAAG,EACHC,IAAI,EACJC,MAAM,EAKP,GAAA;IACC,MAAMC,UAAAA,GAAaC,GAAGC,cAAc,CAACL,KAAKI,EAAGE,CAAAA,GAAG,CAACC,UAAU,EAAEN,IAAAA,CAAAA;AAE7D,IAAA,IAAI,CAACE,UAAY,EAAA;QACf,OAAOK,SAAAA;AACT;IAEA,MAAMC,UAAAA,GAAaL,GAAGM,cAAc,CAACP,YAAYC,EAAGE,CAAAA,GAAG,CAACK,QAAQ,CAAA;IAEhE,MAAMC,YAAAA,GAAeR,GAAGS,0BAA0B,CAACJ,WAAWK,MAAM,EAAEV,EAAGE,CAAAA,GAAG,EAAEN,GAAAA,CAAAA;IAE9EE,MAAOa,CAAAA,KAAK,CAAC,CAAC,sBAAsB,CAAC,EAAEC,EAAAA,CAAGC,GAAG,EAAEL,YAAAA,CAAAA;IAE/C,OAAO;QACLE,MAAQF,EAAAA,YAAAA;QACRX,IAAME,EAAAA;AACR,KAAA;AACF;;;;"}