@teambit/workspace-config-files 1.0.188 → 1.0.190

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["config-writer-entry.ts"],"sourcesContent":["import { Environment, ExecutionContext } from '@teambit/envs';\nimport { EnvMapValue } from './workspace-config-files.main.runtime';\nimport { WrittenConfigFile } from './writers';\n\nexport type ConfigFile = {\n /**\n * Name of the config file.\n * supports also using `{hash}` in the name, which will be replaced by the hash of the config file.\n */\n name: string;\n /**\n * Content of the config file.\n * I.E the content of the tsconfig.json file.\n */\n content: string;\n /**\n * Hash of the config file.\n */\n hash?: string;\n};\n\nexport type ExtendingConfigFileAdditionalProp = {\n /**\n * the config file that this config file extends.\n */\n extendingTarget: WrittenConfigFile;\n\n /**\n * When replacing the config file name with the actual path of the config file, use absolute paths.\n */\n useAbsPaths?: boolean;\n};\n\nexport type ExtendingConfigFile = ConfigFile & ExtendingConfigFileAdditionalProp;\n\nexport type PostProcessExtendingConfigFilesArgs = {\n workspaceDir: string;\n configsRootDir: string;\n extendingConfigFile: ExtendingConfigFile;\n /**\n * Paths that the file will be written to.\n */\n paths: string[];\n envMapValue: EnvMapValue;\n /**\n * This is a flag for backward compatibility\n * We used to return string from the post process, so old versions of bit only knows to handle string results\n * while in new version we support getting array of objects\n * we need to know if bit the user is using support the new format or not\n */\n supportSpecificPathChange?: boolean;\n};\n\nexport type GenerateExtendingConfigFilesArgs = {\n workspaceDir: string;\n configsRootDir: string;\n writtenConfigFiles: WrittenConfigFile[];\n envMapValue: EnvMapValue;\n};\n\nexport type PostProcessExtendingConfigFilesOneFile = {\n path: string;\n content: string;\n};\n\nexport type MergeConfigFilesFunc = (configFile: ConfigFile, configFile2: ConfigFile) => string;\nexport interface ConfigWriterEntry {\n /**\n * Id is used for few things:\n * 1. merge/post process different configs files (from different envs) together.\n * 2. filter the config writer by the cli when using --writers flag.\n */\n id: string;\n\n /**\n * Name of the config writer.\n * used for outputs and logging.\n */\n name: string;\n\n /**\n * Get's the component env and return the config file content\n * for example the eslint config to tsconfig.\n * This also enable to return a hash of the config file, which will be used to determine if\n * 2 config files are the same.\n * If the hash is not provided, the content will be used as the hash.\n * This enables the specific config type to ignore specific fields when calculating the\n * hash in order to ignore theses fields when determining if 2 config files are the same.\n * The calc function also get the target directory of the config file (calculated by this aspect) as sometime there\n * is a need to change the config file content based on the target directory.\n * for example, change the includes/excludes paths to be relative to the target directory.\n * The calc can return undefined if the config file is not relevant for the component. or not supported by the subscriber.\n * for example if the component uses babel to compile, then tsconfig is not relevant.\n * @param env\n */\n calcConfigFiles(\n executionContext: ExecutionContext,\n env: Environment,\n dir: string,\n workspaceDir?: string\n ): ConfigFile[] | undefined;\n\n /**\n * Provide a function that knows how to merge 2 config files together.\n * This is used when 2 different envs generate the same config file hash.\n * sometime we want to merge the 2 config files together.\n * @param configFile\n * @param configFile2\n */\n mergeConfigFiles?: MergeConfigFilesFunc;\n\n /**\n * This will be used to generate an extending file content.\n * For example, the tsconfig.json file will extend the real tsconfig.{hash}.json file (that were coming from the env).\n * That way we can avoid writing the same config file multiple times.\n * It also reduces the risk of the user manually change the config file and then the changes will be lost.\n * This function support returning a file with content with a dsl using `{}` to replace the config file name.\n * for example:\n * content = `{\n * \"extends\": {configFile.name},\n * }`\n */\n generateExtendingFile(args: GenerateExtendingConfigFilesArgs): ExtendingConfigFile | undefined;\n\n /**\n * This enables the writer to do some post processing after the extending config files were calculated and deduped.\n * this is important in case when we need to change a config file / extending config file after it was calculated\n * based on all the environments in the ws\n * or based on other config files that were written.\n * @param args\n */\n postProcessExtendingConfigFiles?(\n args: PostProcessExtendingConfigFilesArgs\n ): Promise<string | Array<PostProcessExtendingConfigFilesOneFile> | undefined>;\n\n /**\n * Find all the files that are relevant for the config type.\n * This is used to clean / delete these files\n * This should return an array of glob patterns (that will passed to the globby/minimatch library)\n * @param dir\n */\n patterns: string[];\n\n /**\n * A function to determine if a file was generated by bit.\n * This is useful to check if the config file was generated by bit to prevent delete user's file.\n * @param filePath\n * @returns\n */\n isBitGenerated?: (filePath: string) => boolean;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["config-writer-entry.ts"],"sourcesContent":["import { Environment, ExecutionContext } from '@teambit/envs';\nimport { EnvMapValue } from './workspace-config-files.main.runtime';\nimport { WrittenConfigFile } from './writers';\n\nexport type ConfigFile = {\n /**\n * Name of the config file.\n * supports also using `{hash}` in the name, which will be replaced by the hash of the config file.\n */\n name: string;\n /**\n * Content of the config file.\n * I.E the content of the tsconfig.json file.\n */\n content: string;\n /**\n * Hash of the config file.\n */\n hash?: string;\n};\n\nexport type ExtendingConfigFileAdditionalProp = {\n /**\n * the config file that this config file extends.\n */\n extendingTarget: WrittenConfigFile;\n\n /**\n * When replacing the config file name with the actual path of the config file, use absolute paths.\n */\n useAbsPaths?: boolean;\n};\n\nexport type ExtendingConfigFile = ConfigFile & ExtendingConfigFileAdditionalProp;\n\nexport type PostProcessExtendingConfigFilesArgs = {\n workspaceDir: string;\n configsRootDir: string;\n extendingConfigFile: ExtendingConfigFile;\n /**\n * Paths that the file will be written to.\n */\n paths: string[];\n envMapValue: EnvMapValue;\n /**\n * This is a flag for backward compatibility\n * We used to return string from the post process, so old versions of bit only knows to handle string results\n * while in new version we support getting array of objects\n * we need to know if bit the user is using support the new format or not\n */\n supportSpecificPathChange?: boolean;\n};\n\nexport type GenerateExtendingConfigFilesArgs = {\n workspaceDir: string;\n configsRootDir: string;\n writtenConfigFiles: WrittenConfigFile[];\n envMapValue: EnvMapValue;\n};\n\nexport type PostProcessExtendingConfigFilesOneFile = {\n path: string;\n content: string;\n};\n\nexport type MergeConfigFilesFunc = (configFile: ConfigFile, configFile2: ConfigFile) => string;\nexport interface ConfigWriterEntry {\n /**\n * Id is used for few things:\n * 1. merge/post process different configs files (from different envs) together.\n * 2. filter the config writer by the cli when using --writers flag.\n */\n id: string;\n\n /**\n * Name of the config writer.\n * used for outputs and logging.\n */\n name: string;\n\n /**\n * Get's the component env and return the config file content\n * for example the eslint config to tsconfig.\n * This also enable to return a hash of the config file, which will be used to determine if\n * 2 config files are the same.\n * If the hash is not provided, the content will be used as the hash.\n * This enables the specific config type to ignore specific fields when calculating the\n * hash in order to ignore theses fields when determining if 2 config files are the same.\n * The calc function also get the target directory of the config file (calculated by this aspect) as sometime there\n * is a need to change the config file content based on the target directory.\n * for example, change the includes/excludes paths to be relative to the target directory.\n * The calc can return undefined if the config file is not relevant for the component. or not supported by the subscriber.\n * for example if the component uses babel to compile, then tsconfig is not relevant.\n * @param env\n */\n calcConfigFiles(\n executionContext: ExecutionContext,\n env: Environment,\n dir: string,\n workspaceDir?: string\n ): ConfigFile[] | undefined;\n\n /**\n * Provide a function that knows how to merge 2 config files together.\n * This is used when 2 different envs generate the same config file hash.\n * sometime we want to merge the 2 config files together.\n * @param configFile\n * @param configFile2\n */\n mergeConfigFiles?: MergeConfigFilesFunc;\n\n /**\n * This will be used to generate an extending file content.\n * For example, the tsconfig.json file will extend the real tsconfig.{hash}.json file (that were coming from the env).\n * That way we can avoid writing the same config file multiple times.\n * It also reduces the risk of the user manually change the config file and then the changes will be lost.\n * This function support returning a file with content with a dsl using `{}` to replace the config file name.\n * for example:\n * content = `{\n * \"extends\": {configFile.name},\n * }`\n */\n generateExtendingFile(args: GenerateExtendingConfigFilesArgs): ExtendingConfigFile | undefined;\n\n /**\n * This enables the writer to do some post processing after the extending config files were calculated and deduped.\n * this is important in case when we need to change a config file / extending config file after it was calculated\n * based on all the environments in the ws\n * or based on other config files that were written.\n * @param args\n */\n postProcessExtendingConfigFiles?(\n args: PostProcessExtendingConfigFilesArgs\n ): Promise<string | Array<PostProcessExtendingConfigFilesOneFile> | undefined>;\n\n /**\n * Find all the files that are relevant for the config type.\n * This is used to clean / delete these files\n * This should return an array of glob patterns (that will passed to the globby/minimatch library)\n * @param dir\n */\n patterns: string[];\n\n /**\n * A function to determine if a file was generated by bit.\n * This is useful to check if the config file was generated by bit to prevent delete user's file.\n * @param filePath\n * @returns\n */\n isBitGenerated?: (filePath: string) => boolean;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_lodash","data","require","ConfigWriterList","constructor","_writers","writers","initiateWriters","context","map","task","handler","add","concat","remove","writerNames","filter","writer","includes","name","replace","forEach","matchIndex","findIndex","origWriter","splice","writerList","compute","writerEntries","from","writersHandlers","exports"],"sources":["config-writer-list.ts"],"sourcesContent":["import { EnvContext, EnvHandler } from '@teambit/envs';\nimport { findIndex } from 'lodash';\nimport { ConfigWriterEntry } from './config-writer-entry';\n\nexport type ConfigWriterHandler = {\n handler: EnvHandler<ConfigWriterEntry>;\n name: string;\n};\n\n/**\n * create and maintain config writer list for component dev environments.\n */\nexport class ConfigWriterList {\n constructor(private _writers: ConfigWriterHandler[]) {}\n\n /**\n * list all congig writer handlers in the list.\n */\n get writers() {\n return this._writers;\n }\n\n private initiateWriters(writers: ConfigWriterHandler[], context: EnvContext): ConfigWriterEntry[] {\n return writers.map((task) => {\n return task.handler(context);\n });\n }\n\n /**\n * add writers to the list.\n */\n add(writers: ConfigWriterHandler[]) {\n this._writers = this._writers.concat(writers);\n return this;\n }\n\n /**\n * remove writers from the list.\n */\n remove(writerNames: string[]) {\n this._writers = this._writers.filter((writer) => {\n return !writerNames.includes(writer.name);\n });\n return this;\n }\n\n /**\n * replace writers in the list.\n */\n replace(writers: ConfigWriterHandler[]) {\n writers.forEach((writer) => {\n // Find Writer index using _.findIndex\n const matchIndex = findIndex(this._writers, (origWriter) => {\n return origWriter.name === writer.name;\n });\n if (matchIndex !== -1) {\n // Replace Writer at index using native splice\n this._writers.splice(matchIndex, 1, writer);\n }\n });\n return this;\n }\n\n /**\n * return a new list with the writers from the args added.\n * @param pipeline\n * @returns\n */\n concat(writerList: ConfigWriterList) {\n return new ConfigWriterList(this._writers.concat(writerList.writers));\n }\n\n /**\n * compute the list.\n */\n compute(context: EnvContext): ConfigWriterEntry[] {\n const writerEntries = this.initiateWriters(this._writers, context);\n return writerEntries;\n }\n\n static from(writersHandlers: ConfigWriterHandler[]): ConfigWriterList {\n return new ConfigWriterList(writersHandlers);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA;AACA;AACA;AACO,MAAME,gBAAgB,CAAC;EAC5BC,WAAWA,CAASC,QAA+B,EAAE;IAAA,KAAjCA,QAA+B,GAA/BA,QAA+B;EAAG;;EAEtD;AACF;AACA;EACE,IAAIC,OAAOA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACD,QAAQ;EACtB;EAEQE,eAAeA,CAACD,OAA8B,EAAEE,OAAmB,EAAuB;IAChG,OAAOF,OAAO,CAACG,GAAG,CAAEC,IAAI,IAAK;MAC3B,OAAOA,IAAI,CAACC,OAAO,CAACH,OAAO,CAAC;IAC9B,CAAC,CAAC;EACJ;;EAEA;AACF;AACA;EACEI,GAAGA,CAACN,OAA8B,EAAE;IAClC,IAAI,CAACD,QAAQ,GAAG,IAAI,CAACA,QAAQ,CAACQ,MAAM,CAACP,OAAO,CAAC;IAC7C,OAAO,IAAI;EACb;;EAEA;AACF;AACA;EACEQ,MAAMA,CAACC,WAAqB,EAAE;IAC5B,IAAI,CAACV,QAAQ,GAAG,IAAI,CAACA,QAAQ,CAACW,MAAM,CAAEC,MAAM,IAAK;MAC/C,OAAO,CAACF,WAAW,CAACG,QAAQ,CAACD,MAAM,CAACE,IAAI,CAAC;IAC3C,CAAC,CAAC;IACF,OAAO,IAAI;EACb;;EAEA;AACF;AACA;EACEC,OAAOA,CAACd,OAA8B,EAAE;IACtCA,OAAO,CAACe,OAAO,CAAEJ,MAAM,IAAK;MAC1B;MACA,MAAMK,UAAU,GAAG,IAAAC,mBAAS,EAAC,IAAI,CAAClB,QAAQ,EAAGmB,UAAU,IAAK;QAC1D,OAAOA,UAAU,CAACL,IAAI,KAAKF,MAAM,CAACE,IAAI;MACxC,CAAC,CAAC;MACF,IAAIG,UAAU,KAAK,CAAC,CAAC,EAAE;QACrB;QACA,IAAI,CAACjB,QAAQ,CAACoB,MAAM,CAACH,UAAU,EAAE,CAAC,EAAEL,MAAM,CAAC;MAC7C;IACF,CAAC,CAAC;IACF,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;EACEJ,MAAMA,CAACa,UAA4B,EAAE;IACnC,OAAO,IAAIvB,gBAAgB,CAAC,IAAI,CAACE,QAAQ,CAACQ,MAAM,CAACa,UAAU,CAACpB,OAAO,CAAC,CAAC;EACvE;;EAEA;AACF;AACA;EACEqB,OAAOA,CAACnB,OAAmB,EAAuB;IAChD,MAAMoB,aAAa,GAAG,IAAI,CAACrB,eAAe,CAAC,IAAI,CAACF,QAAQ,EAAEG,OAAO,CAAC;IAClE,OAAOoB,aAAa;EACtB;EAEA,OAAOC,IAAIA,CAACC,eAAsC,EAAoB;IACpE,OAAO,IAAI3B,gBAAgB,CAAC2B,eAAe,CAAC;EAC9C;AACF;AAACC,OAAA,CAAA5B,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"names":["_lodash","data","require","ConfigWriterList","constructor","_writers","writers","initiateWriters","context","map","task","handler","add","concat","remove","writerNames","filter","writer","includes","name","replace","forEach","matchIndex","findIndex","origWriter","splice","writerList","compute","writerEntries","from","writersHandlers","exports"],"sources":["config-writer-list.ts"],"sourcesContent":["import { EnvContext, EnvHandler } from '@teambit/envs';\nimport { findIndex } from 'lodash';\nimport { ConfigWriterEntry } from './config-writer-entry';\n\nexport type ConfigWriterHandler = {\n handler: EnvHandler<ConfigWriterEntry>;\n name: string;\n};\n\n/**\n * create and maintain config writer list for component dev environments.\n */\nexport class ConfigWriterList {\n constructor(private _writers: ConfigWriterHandler[]) {}\n\n /**\n * list all congig writer handlers in the list.\n */\n get writers() {\n return this._writers;\n }\n\n private initiateWriters(writers: ConfigWriterHandler[], context: EnvContext): ConfigWriterEntry[] {\n return writers.map((task) => {\n return task.handler(context);\n });\n }\n\n /**\n * add writers to the list.\n */\n add(writers: ConfigWriterHandler[]) {\n this._writers = this._writers.concat(writers);\n return this;\n }\n\n /**\n * remove writers from the list.\n */\n remove(writerNames: string[]) {\n this._writers = this._writers.filter((writer) => {\n return !writerNames.includes(writer.name);\n });\n return this;\n }\n\n /**\n * replace writers in the list.\n */\n replace(writers: ConfigWriterHandler[]) {\n writers.forEach((writer) => {\n // Find Writer index using _.findIndex\n const matchIndex = findIndex(this._writers, (origWriter) => {\n return origWriter.name === writer.name;\n });\n if (matchIndex !== -1) {\n // Replace Writer at index using native splice\n this._writers.splice(matchIndex, 1, writer);\n }\n });\n return this;\n }\n\n /**\n * return a new list with the writers from the args added.\n * @param pipeline\n * @returns\n */\n concat(writerList: ConfigWriterList) {\n return new ConfigWriterList(this._writers.concat(writerList.writers));\n }\n\n /**\n * compute the list.\n */\n compute(context: EnvContext): ConfigWriterEntry[] {\n const writerEntries = this.initiateWriters(this._writers, context);\n return writerEntries;\n }\n\n static from(writersHandlers: ConfigWriterHandler[]): ConfigWriterList {\n return new ConfigWriterList(writersHandlers);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA;AACA;AACA;AACO,MAAME,gBAAgB,CAAC;EAC5BC,WAAWA,CAASC,QAA+B,EAAE;IAAA,KAAjCA,QAA+B,GAA/BA,QAA+B;EAAG;;EAEtD;AACF;AACA;EACE,IAAIC,OAAOA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACD,QAAQ;EACtB;EAEQE,eAAeA,CAACD,OAA8B,EAAEE,OAAmB,EAAuB;IAChG,OAAOF,OAAO,CAACG,GAAG,CAAEC,IAAI,IAAK;MAC3B,OAAOA,IAAI,CAACC,OAAO,CAACH,O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A,CAACC,eAAsC,EAAoB;IACpE,OAAO,IAAI3B,gBAAgB,CAAC2B,eAAe,CAAC;EAC9C;AACF;AAACC,OAAA,CAAA5B,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_lodash","data","require","_path","getAllPossibleDirsFromPaths","paths","dirs","map","p","getAllParentsDirOfPath","flat","push","uniq","all","current","dirname","buildCompPathExtendingHashMap","extendingConfigFilesMap","envCompsDirsMap","Object","entries","reduce","acc","hash","envIds","forEach","envId","envCompDirs","compPath","dedupePaths","rootDir","compPathExtendingHashMap","allPaths","keys","allPossibleDirs","allPathsPerFileHash","calculateBestFileForDir","dir","allPathsShareSameDir","filter","startsWith","countPerFileHash","fileHash","max","Math","values","fileHashWithMax","length","Error","dirPath","dedupedPathsPerFileHash","fileHashPerDedupedPaths","invertBy","dedupedPaths"],"sources":["dedup-paths.ts"],"sourcesContent":["import { invertBy, uniq } from 'lodash';\nimport { dirname } from 'path';\nimport { PathLinuxRelative } from '@teambit/legacy/dist/utils/path';\nimport { CompPathExtendingHashMap, EnvCompsDirsMap } from './workspace-config-files.main.runtime';\nimport { ExtendingConfigFilesMap } from './writers';\n\nexport type DedupedPaths = Array<{\n fileHash: string;\n paths: string[];\n}>;\n\nfunction getAllPossibleDirsFromPaths(paths: PathLinuxRelative[]): PathLinuxRelative[] {\n const dirs = paths.map((p) => getAllParentsDirOfPath(p)).flat();\n dirs.push('.'); // add the root dir\n return uniq(dirs);\n}\n\nfunction getAllParentsDirOfPath(p: PathLinuxRelative): PathLinuxRelative[] {\n const all: string[] = [];\n let current = p;\n while (current !== '.') {\n all.push(current);\n current = dirname(current);\n }\n return all;\n}\n\nexport function buildCompPathExtendingHashMap(\n extendingConfigFilesMap: ExtendingConfigFilesMap,\n envCompsDirsMap: EnvCompsDirsMap\n): CompPathExtendingHashMap {\n const map = Object.entries(extendingConfigFilesMap).reduce((acc, [hash, { envIds }]) => {\n envIds.forEach((envId) => {\n const envCompDirs = envCompsDirsMap[envId];\n envCompDirs.paths.forEach((compPath) => {\n acc[compPath] = hash;\n });\n });\n return acc;\n }, {});\n return map;\n}\n\n/**\n * easier to understand by an example:\n * input:\n * [\n * { fileHash: hash1, paths: [ui/button, ui/form] },\n * { fileHash: hash2, paths: [p/a1, p/a2] },\n * { fileHash: hash3, paths: [p/n1] },\n * ]\n *\n * output:\n * [\n * { fileHash: hash1, paths: [ui] },\n * { fileHash: hash2, paths: [p] },\n * { fileHash: hash3, paths: [p/n1] },\n * ]\n *\n * the goal is to minimize the amount of files to write per env if possible.\n * when multiple components of the same env share a root-dir, then, it's enough to write a file in that shared dir.\n * if in a shared-dir, some components using env1 and some env2, it finds the env that has the max number of\n * components, this env will be optimized. other components, will have the files written inside their dirs.\n */\nexport function dedupePaths(\n extendingConfigFilesMap: ExtendingConfigFilesMap,\n envCompsDirsMap: EnvCompsDirsMap\n): DedupedPaths {\n const rootDir = '.';\n\n const compPathExtendingHashMap = buildCompPathExtendingHashMap(extendingConfigFilesMap, envCompsDirsMap);\n const allPaths = Object.keys(compPathExtendingHashMap);\n const allPossibleDirs = getAllPossibleDirsFromPaths(allPaths);\n\n const allPathsPerFileHash: { [path: string]: string | null } = {}; // null when parent-dir has same amount of comps per env.\n\n const calculateBestFileForDir = (dir: string) => {\n if (compPathExtendingHashMap[dir]) {\n // it's the component dir, so it's the file that should be written.\n allPathsPerFileHash[dir] = compPathExtendingHashMap[dir];\n return;\n }\n const allPathsShareSameDir = dir === rootDir ? allPaths : allPaths.filter((p) => p.startsWith(`${dir}/`));\n const countPerFileHash: { [fileHash: string]: number } = {};\n allPathsShareSameDir.forEach((p) => {\n const fileHash = compPathExtendingHashMap[p];\n if (countPerFileHash[fileHash]) countPerFileHash[fileHash] += 1;\n else countPerFileHash[fileHash] = 1;\n });\n const max = Math.max(...Object.values(countPerFileHash));\n const fileHashWithMax = Object.keys(countPerFileHash).filter((fileHash) => countPerFileHash[fileHash] === max);\n if (!fileHashWithMax.length) throw new Error(`must be at least one fileHash related to path \"${dir}\"`);\n if (fileHashWithMax.length > 1) allPathsPerFileHash[dir] = null;\n else allPathsPerFileHash[dir] = fileHashWithMax[0];\n };\n\n allPossibleDirs.forEach((dirPath) => {\n calculateBestFileForDir(dirPath);\n });\n\n // this is the actual deduping. if found a shorter path with the same env, then no need for this path.\n // in other words, return only the paths that their parent is null or has a different env.\n const dedupedPathsPerFileHash = Object.keys(allPathsPerFileHash).reduce((acc, current) => {\n if (allPathsPerFileHash[current] && allPathsPerFileHash[dirname(current)] !== allPathsPerFileHash[current]) {\n acc[current] = allPathsPerFileHash[current];\n }\n\n return acc;\n }, {});\n // rootDir parent is always rootDir, so leave it as is.\n if (allPathsPerFileHash[rootDir]) dedupedPathsPerFileHash[rootDir] = allPathsPerFileHash[rootDir];\n\n const fileHashPerDedupedPaths = invertBy(dedupedPathsPerFileHash);\n\n const dedupedPaths = Object.keys(fileHashPerDedupedPaths).map((fileHash) => ({\n fileHash,\n paths: fileHashPerDedupedPaths[fileHash],\n }));\n return dedupedPaths;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAUA,SAASG,2BAA2BA,CAACC,KAA0B,EAAuB;EACpF,MAAMC,IAAI,GAAGD,KAAK,CAACE,GAAG,CAAEC,CAAC,IAAKC,sBAAsB,CAACD,CAAC,CAAC,CAAC,CAACE,IAAI,CAAC,CAAC;EAC/DJ,IAAI,CAACK,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;EAChB,OAAO,IAAAC,cAAI,EAACN,IAAI,CAAC;AACnB;AAEA,SAASG,sBAAsBA,CAACD,CAAoB,EA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;;EAEF;EACA;EACA,MAAMC,uBAAuB,GAAG/B,MAAM,CAACc,IAAI,CAACE,mBAAmB,CAAC,CAACd,MAAM,CAAC,CAACC,GAAG,EAAER,OAAO,KAAK;IACxF,IAAIqB,mBAAmB,CAACrB,OAAO,CAAC,IAAIqB,mBAAmB,CAAC,IAAApB,eAAO,EAACD,OAAO,CAAC,CAAC,KAAKqB,mBAAmB,CAACrB,OAAO,CAAC,EAAE;MAC1GQ,GAAG,CAACR,OAAO,CAAC,GAAGqB,mBAAmB,CAACrB,OAAO,CAAC;IAC7C;IAEA,OAAOQ,GAAG;EACZ,CAAC,EAAE,CAAC,CAAC,CAAC;EACN;EACA,IAAIa,mBAAmB,CAACL,OAAO,CAAC,EAAEoB,uBAAuB,CAACpB,OAAO,CAAC,GAAGK,mBAAmB,CAACL,OAAO,CAAC;EAEjG,MAAMqB,uBAAuB,GAAG,IAAAC,kBAAQ,EAACF,uBAAuB,CAAC;EAEjE,MAAMG,YAAY,GAAGlC,MAAM,CAACc,IAAI,CAACkB,uBAAuB,CAAC,CAAC5C,GAAG,CAAEmC,QAAQ,KAAM;IAC3EA,QAAQ;IACRrC,KAAK,EAAE8C,uBAAuB,CAACT,QAAQ;EACzC,CAAC,CAAC,CAAC;EACH,OAAOW,YAAY;AACrB"}
1
+ {"version":3,"names":["_lodash","data","require","_path","getAllPossibleDirsFromPaths","paths","dirs","map","p","getAllParentsDirOfPath","flat","push","uniq","all","current","dirname","buildCompPathExtendingHashMap","extendingConfigFilesMap","envCompsDirsMap","Object","entries","reduce","acc","hash","envIds","forEach","envId","envCompDirs","compPath","dedupePaths","rootDir","compPathExtendingHashMap","allPaths","keys","allPossibleDirs","allPathsPerFileHash","calculateBestFileForDir","dir","allPathsShareSameDir","filter","startsWith","countPerFileHash","fileHash","max","Math","values","fileHashWithMax","length","Error","dirPath","dedupedPathsPerFileHash","fileHashPerDedupedPaths","invertBy","dedupedPaths"],"sources":["dedup-paths.ts"],"sourcesContent":["import { invertBy, uniq } from 'lodash';\nimport { dirname } from 'path';\nimport { PathLinuxRelative } from '@teambit/legacy/dist/utils/path';\nimport { CompPathExtendingHashMap, EnvCompsDirsMap } from './workspace-config-files.main.runtime';\nimport { ExtendingConfigFilesMap } from './writers';\n\nexport type DedupedPaths = Array<{\n fileHash: string;\n paths: string[];\n}>;\n\nfunction getAllPossibleDirsFromPaths(paths: PathLinuxRelative[]): PathLinuxRelative[] {\n const dirs = paths.map((p) => getAllParentsDirOfPath(p)).flat();\n dirs.push('.'); // add the root dir\n return uniq(dirs);\n}\n\nfunction getAllParentsDirOfPath(p: PathLinuxRelative): PathLinuxRelative[] {\n const all: string[] = [];\n let current = p;\n while (current !== '.') {\n all.push(current);\n current = dirname(current);\n }\n return all;\n}\n\nexport function buildCompPathExtendingHashMap(\n extendingConfigFilesMap: ExtendingConfigFilesMap,\n envCompsDirsMap: EnvCompsDirsMap\n): CompPathExtendingHashMap {\n const map = Object.entries(extendingConfigFilesMap).reduce((acc, [hash, { envIds }]) => {\n envIds.forEach((envId) => {\n const envCompDirs = envCompsDirsMap[envId];\n envCompDirs.paths.forEach((compPath) => {\n acc[compPath] = hash;\n });\n });\n return acc;\n }, {});\n return map;\n}\n\n/**\n * easier to understand by an example:\n * input:\n * [\n * { fileHash: hash1, paths: [ui/button, ui/form] },\n * { fileHash: hash2, paths: [p/a1, p/a2] },\n * { fileHash: hash3, paths: [p/n1] },\n * ]\n *\n * output:\n * [\n * { fileHash: hash1, paths: [ui] },\n * { fileHash: hash2, paths: [p] },\n * { fileHash: hash3, paths: [p/n1] },\n * ]\n *\n * the goal is to minimize the amount of files to write per env if possible.\n * when multiple components of the same env share a root-dir, then, it's enough to write a file in that shared dir.\n * if in a shared-dir, some components using env1 and some env2, it finds the env that has the max number of\n * components, this env will be optimized. other components, will have the files written inside their dirs.\n */\nexport function dedupePaths(\n extendingConfigFilesMap: ExtendingConfigFilesMap,\n envCompsDirsMap: EnvCompsDirsMap\n): DedupedPaths {\n const rootDir = '.';\n\n const compPathExtendingHashMap = buildCompPathExtendingHashMap(extendingConfigFilesMap, envCompsDirsMap);\n const allPaths = Object.keys(compPathExtendingHashMap);\n const allPossibleDirs = getAllPossibleDirsFromPaths(allPaths);\n\n const allPathsPerFileHash: { [path: string]: string | null } = {}; // null when parent-dir has same amount of comps per env.\n\n const calculateBestFileForDir = (dir: string) => {\n if (compPathExtendingHashMap[dir]) {\n // it's the component dir, so it's the file that should be written.\n allPathsPerFileHash[dir] = compPathExtendingHashMap[dir];\n return;\n }\n const allPathsShareSameDir = dir === rootDir ? allPaths : allPaths.filter((p) => p.startsWith(`${dir}/`));\n const countPerFileHash: { [fileHash: string]: number } = {};\n allPathsShareSameDir.forEach((p) => {\n const fileHash = compPathExtendingHashMap[p];\n if (countPerFileHash[fileHash]) countPerFileHash[fileHash] += 1;\n else countPerFileHash[fileHash] = 1;\n });\n const max = Math.max(...Object.values(countPerFileHash));\n const fileHashWithMax = Object.keys(countPerFileHash).filter((fileHash) => countPerFileHash[fileHash] === max);\n if (!fileHashWithMax.length) throw new Error(`must be at least one fileHash related to path \"${dir}\"`);\n if (fileHashWithMax.length > 1) allPathsPerFileHash[dir] = null;\n else allPathsPerFileHash[dir] = fileHashWithMax[0];\n };\n\n allPossibleDirs.forEach((dirPath) => {\n calculateBestFileForDir(dirPath);\n });\n\n // this is the actual deduping. if found a shorter path with the same env, then no need for this path.\n // in other words, return only the paths that their parent is null or has a different env.\n const dedupedPathsPerFileHash = Object.keys(allPathsPerFileHash).reduce((acc, current) => {\n if (allPathsPerFileHash[current] && allPathsPerFileHash[dirname(current)] !== allPathsPerFileHash[current]) {\n acc[current] = allPathsPerFileHash[current];\n }\n\n return acc;\n }, {});\n // rootDir parent is always rootDir, so leave it as is.\n if (allPathsPerFileHash[rootDir]) dedupedPathsPerFileHash[rootDir] = allPathsPerFileHash[rootDir];\n\n const fileHashPerDedupedPaths = invertBy(dedupedPathsPerFileHash);\n\n const dedupedPaths = Object.keys(fileHashPerDedupedPaths).map((fileH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C;EAEjE,MAAMG,YAAY,GAAGlC,MAAM,CAACc,IAAI,CAACkB,uBAAuB,CAAC,CAAC5C,GAAG,CAAEmC,QAAQ,KAAM;IAC3EA,QAAQ;IACRrC,KAAK,EAAE8C,uBAAuB,CAACT,QAAQ;EACzC,CAAC,CAAC,CAAC;EACH,OAAOW,YAAY;AACrB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_chai","data","require","_dedupPaths","envCompsDirsMap","id","paths","tsExtendingConfigFilesMap","extendingConfigFile","useAbsPaths","content","name","extendingTarget","hash","filePath","envIds","tsExpectedDedupedPaths","fileHash","eslintExtendingConfigFilesMap","ff6ea265e6f21ce25f7985570beef37dd957d0dc","f1743b227e588db0c59d4a43171653e6c4262816","eslintExpectedDedupedPaths","prettierExtendingConfigFilesMap","prettierExpectedDedupedPaths","describe","timeout","result","before","dedupePaths","it","expect","to","have","lengthOf","length","deep","equal"],"sources":["dedup-paths.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport { DedupedPaths, dedupePaths } from './dedup-paths';\nimport { ExtendingConfigFilesMap } from './writers';\n\nconst envCompsDirsMap = {\n 'teambit.harmony/node': {\n id: 'teambit.harmony/node',\n paths: [\n 'react/apps/react-app-types',\n 'compilation/babel-compiler',\n 'compilation/compiler-task',\n 'mdx/compilers/mdx-compiler',\n 'mdx/compilers/mdx-multi-compiler',\n 'compilation/compilers/multi-compiler',\n 'defender/eslint-linter',\n 'mdx/generator/mdx-starters',\n 'mdx/generator/mdx-templates',\n 'react/generator/react-starters',\n 'react/generator/react-templates',\n 'defender/jest-tester',\n 'react/jest/react-jest',\n 'defender/linter-task',\n 'defender/mocha-tester',\n 'compilation/modules/babel-file-transpiler',\n 'defender/prettier-formatter',\n 'preview/react-preview',\n 'defender/tester-task',\n 'typescript/typescript-compiler',\n 'webpack/webpack-bundler',\n 'webpack/webpack-dev-server',\n 'react/webpack/react-webpack',\n ],\n },\n 'teambit.react/react-env@0.0.44': {\n id: 'teambit.react/react-env@0.0.44',\n paths: ['test-new-envs-app/apps/test-app', 'test-new-env/ui/button2'],\n },\n 'teambit.react/react': {\n id: 'teambit.react/react',\n paths: ['docs/docs-template', 'react/mounter'],\n },\n 'teambit.envs/env': {\n id: 'teambit.envs/env',\n paths: [\n 'react/examples/my-react-env',\n 'mdx/mdx-env',\n 'node/node',\n 'node/node-env-extension',\n 'react/react-env',\n 'react/react-env-extension',\n ],\n },\n 'teambit.mdx/mdx-env@0.0.6': {\n id: 'teambit.mdx/mdx-env@0.0.6',\n paths: ['test-new-env/mdx/content-comp'],\n },\n 'teambit.node/node@0.0.16': {\n id: 'teambit.node/node@0.0.16',\n paths: ['test-new-env/node/node-comp1', 'test-new-env/node/node-comp2'],\n },\n 'teambit.react/examples/my-react-env@0.0.39': {\n id: 'teambit.react/examples/my-react-env@0.0.39',\n paths: ['test-new-env/ui/button'],\n },\n};\n\nconst tsExtendingConfigFilesMap: ExtendingConfigFilesMap = {\n '816b7f584991ff21a7682ef8a4229ebf312c457f': {\n extendingConfigFile: {\n useAbsPaths: false,\n content:\n '// bit-generated-typescript-config\\n' +\n '\\n' +\n '{\\n' +\n ' \"extends\": \"/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/tsconfig.bit.4957ea3122e57ea3302aadd885eed84127d9c54b.json\"\\n' +\n '}',\n name: 'tsconfig.json',\n extendingTarget: {\n hash: '4957ea3122e57ea3302aadd885eed84127d9c54b',\n content: 'does not matter',\n name: 'tsconfig.bit.4957ea3122e57ea3302aadd885eed84127d9c54b.json',\n filePath:\n '/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/tsconfig.bit.4957ea3122e57ea3302aadd885eed84127d9c54b.json',\n },\n\n hash: '816b7f584991ff21a7682ef8a4229ebf312c457f',\n },\n envIds: ['teambit.harmony/node', 'teambit.react/react'],\n },\n '00330a9c547353867d519c34f47e17ddc9f161d1': {\n extendingConfigFile: {\n useAbsPaths: false,\n content:\n '// bit-generated-typescript-config\\n' +\n '\\n' +\n '{\\n' +\n ' \"extends\": \"/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/tsconfig.bit.17b99a1071b1d2d86ed04ebce68903b82403f278.json\"\\n' +\n '}',\n name: 'tsconfig.json',\n extendingTarget: {\n hash: '17b99a1071b1d2d86ed04ebce68903b82403f278',\n content: 'does not matter',\n name: 'tsconfig.bit.17b99a1071b1d2d86ed04ebce68903b82403f278.json',\n filePath:\n '/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/tsconfig.bit.17b99a1071b1d2d86ed04ebce68903b82403f278.json',\n },\n hash: '00330a9c547353867d519c34f47e17ddc9f161d1',\n },\n envIds: ['teambit.react/react-env@0.0.44', 'teambit.react/examples/my-react-env@0.0.39'],\n },\n '3c5960bcad98570b98834a5c37f47dd4729dbef0': {\n extendingConfigFile: {\n useAbsPaths: false,\n content:\n '// bit-generated-typescript-config\\n' +\n '\\n' +\n '{\\n' +\n ' \"extends\": \"/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/tsconfig.bit.dab521d0914afe64de248743e05a169cf9b4b50c.json\"\\n' +\n '}',\n name: 'tsconfig.json',\n extendingTarget: {\n hash: 'dab521d0914afe64de248743e05a169cf9b4b50c',\n content: 'does not matter',\n name: 'tsconfig.bit.dab521d0914afe64de248743e05a169cf9b4b50c.json',\n filePath:\n '/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/tsconfig.bit.dab521d0914afe64de248743e05a169cf9b4b50c.json',\n },\n hash: '3c5960bcad98570b98834a5c37f47dd4729dbef0',\n },\n envIds: ['teambit.node/node@0.0.16'],\n },\n};\n\nconst tsExpectedDedupedPaths: DedupedPaths = [\n {\n fileHash: '00330a9c547353867d519c34f47e17ddc9f161d1',\n paths: ['test-new-envs-app', 'test-new-env/ui'],\n },\n {\n fileHash: '3c5960bcad98570b98834a5c37f47dd4729dbef0',\n paths: ['test-new-env/node'],\n },\n {\n fileHash: '816b7f584991ff21a7682ef8a4229ebf312c457f',\n paths: ['.'],\n },\n];\n\nconst eslintExtendingConfigFilesMap: ExtendingConfigFilesMap = {\n '8810839e74a9c41694bb5a2a8587dcae71dc389d': {\n extendingConfigFile: {\n useAbsPaths: false,\n content:\n '// bit-generated-eslint-config\\n' +\n '{\\n' +\n ' \"extends\": [\\n' +\n ' \"/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.eslintrc.bit.be8facfbdcf1db685d5020f8612d8c2c3ac2eb7c.json\"\\n' +\n ' ]\\n' +\n '}',\n name: '.eslintrc.json',\n extendingTarget: {\n hash: 'be8facfbdcf1db685d5020f8612d8c2c3ac2eb7c',\n content: 'does not matter',\n name: '.eslintrc.bit.be8facfbdcf1db685d5020f8612d8c2c3ac2eb7c.json',\n filePath:\n '/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.eslintrc.bit.be8facfbdcf1db685d5020f8612d8c2c3ac2eb7c.json',\n },\n hash: '8810839e74a9c41694bb5a2a8587dcae71dc389d',\n },\n envIds: ['teambit.harmony/node', 'teambit.react/react', 'teambit.envs/env'],\n },\n ff6ea265e6f21ce25f7985570beef37dd957d0dc: {\n extendingConfigFile: {\n useAbsPaths: false,\n content:\n '// bit-generated-eslint-config\\n' +\n '{\\n' +\n ' \"extends\": [\\n' +\n ' \"/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.eslintrc.bit.e5ca5528c64e0442b05b949fea42cdda4243d840.json\"\\n' +\n ' ]\\n' +\n '}',\n name: '.eslintrc.json',\n extendingTarget: {\n hash: 'e5ca5528c64e0442b05b949fea42cdda4243d840',\n content: 'does not matter',\n name: '.eslintrc.bit.e5ca5528c64e0442b05b949fea42cdda4243d840.json',\n filePath:\n '/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.eslintrc.bit.e5ca5528c64e0442b05b949fea42cdda4243d840.json',\n },\n hash: 'ff6ea265e6f21ce25f7985570beef37dd957d0dc',\n },\n envIds: ['teambit.react/react-env@0.0.44'],\n },\n '91021f2c973a2940c70b75447639e4ea2a799955': {\n extendingConfigFile: {\n useAbsPaths: false,\n content:\n '// bit-generated-eslint-config\\n' +\n '{\\n' +\n ' \"extends\": [\\n' +\n ' \"/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.eslintrc.bit.7f229bf5ab41e8bfe61916de6c68f9c14c76f23e.json\"\\n' +\n ' ]\\n' +\n '}',\n name: '.eslintrc.json',\n extendingTarget: {\n hash: '7f229bf5ab41e8bfe61916de6c68f9c14c76f23e',\n content: 'does not matter',\n name: '.eslintrc.bit.7f229bf5ab41e8bfe61916de6c68f9c14c76f23e.json',\n filePath:\n '/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.eslintrc.bit.7f229bf5ab41e8bfe61916de6c68f9c14c76f23e.json',\n },\n hash: '91021f2c973a2940c70b75447639e4ea2a799955',\n },\n envIds: ['teambit.mdx/mdx-env@0.0.6', 'teambit.react/examples/my-react-env@0.0.39'],\n },\n f1743b227e588db0c59d4a43171653e6c4262816: {\n extendingConfigFile: {\n useAbsPaths: false,\n content:\n '// bit-generated-eslint-config\\n' +\n '{\\n' +\n ' \"extends\": [\\n' +\n ' \"/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.eslintrc.bit.c503f7386e2a637d91c74f7df90d8fafe79c4378.json\"\\n' +\n ' ]\\n' +\n '}',\n name: '.eslintrc.json',\n extendingTarget: {\n hash: 'c503f7386e2a637d91c74f7df90d8fafe79c4378',\n content: 'does not matter',\n name: '.eslintrc.bit.c503f7386e2a637d91c74f7df90d8fafe79c4378.json',\n filePath:\n '/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.eslintrc.bit.c503f7386e2a637d91c74f7df90d8fafe79c4378.json',\n },\n hash: 'f1743b227e588db0c59d4a43171653e6c4262816',\n },\n envIds: ['teambit.node/node@0.0.16'],\n },\n};\n\nconst eslintExpectedDedupedPaths: DedupedPaths = [\n {\n fileHash: 'ff6ea265e6f21ce25f7985570beef37dd957d0dc',\n paths: ['test-new-envs-app', 'test-new-env/ui/button2'],\n },\n {\n fileHash: '91021f2c973a2940c70b75447639e4ea2a799955',\n paths: ['test-new-env/mdx', 'test-new-env/ui/button'],\n },\n {\n fileHash: 'f1743b227e588db0c59d4a43171653e6c4262816',\n paths: ['test-new-env/node'],\n },\n {\n fileHash: '8810839e74a9c41694bb5a2a8587dcae71dc389d',\n paths: ['.'],\n },\n];\n\nconst prettierExtendingConfigFilesMap: ExtendingConfigFilesMap = {\n '082f546b2555ea89e7063b20de47c039d387fc74': {\n extendingConfigFile: {\n useAbsPaths: false,\n content:\n '// bit-generated-prettier-config\\n' +\n 'module.exports = {\\n' +\n \" ...require('/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.prettierrc.bit.e4882af8861bcf5b0147891d8b70b40a10428881.cjs')\\n\" +\n '}',\n name: '.prettierrc.cjs',\n extendingTarget: {\n hash: 'e4882af8861bcf5b0147891d8b70b40a10428881',\n content: 'does not matter',\n name: '.prettierrc.bit.e4882af8861bcf5b0147891d8b70b40a10428881.cjs',\n filePath:\n '/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.prettierrc.bit.e4882af8861bcf5b0147891d8b70b40a10428881.cjs',\n },\n hash: '082f546b2555ea89e7063b20de47c039d387fc74',\n },\n envIds: [\n 'teambit.harmony/node',\n 'teambit.react/react-env@0.0.44',\n 'teambit.react/react',\n 'teambit.envs/env',\n 'teambit.mdx/mdx-env@0.0.6',\n 'teambit.node/node@0.0.16',\n 'teambit.react/examples/my-react-env@0.0.39',\n ],\n },\n};\n\nconst prettierExpectedDedupedPaths: DedupedPaths = [\n {\n fileHash: '082f546b2555ea89e7063b20de47c039d387fc74',\n paths: ['.'],\n },\n];\n\ndescribe('Workspace Config files - dedupe paths', function () {\n this.timeout(0);\n\n describe('dedupePaths', () => {\n describe('ts example', () => {\n let result: DedupedPaths;\n before(async () => {\n // @ts-ignore (we don't really care about the env itself here)\n result = dedupePaths(tsExtendingConfigFilesMap, envCompsDirsMap);\n });\n\n it('should reduce files to minimum necessary', async () => {\n expect(result).to.have.lengthOf(tsExpectedDedupedPaths.length);\n });\n\n it('should place files in correct folders', async () => {\n expect(result).to.deep.equal(tsExpectedDedupedPaths);\n });\n });\n\n describe('eslint example', () => {\n let result: DedupedPaths;\n before(async () => {\n // @ts-ignore (we don't really care about the env itself here)\n result = dedupePaths(eslintExtendingConfigFilesMap, envCompsDirsMap);\n });\n\n it('should reduce files to minimum necessary', async () => {\n expect(result).to.have.lengthOf(eslintExpectedDedupedPaths.length);\n });\n\n it('should place files in correct folders', async () => {\n expect(result).to.deep.equal(eslintExpectedDedupedPaths);\n });\n });\n\n describe('prettier example', () => {\n let result: DedupedPaths;\n before(async () => {\n // @ts-ignore (we don't really care about the env itself here)\n result = dedupePaths(prettierExtendingConfigFilesMap, envCompsDirsMap);\n });\n\n it('should reduce files to minimum necessary', async () => {\n expect(result).to.have.lengthOf(prettierExpectedDedupedPaths.length);\n });\n\n it('should place files in correct folders', async () => {\n expect(result).to.deep.equal(prettierExpectedDedupedPaths);\n });\n });\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,MAAMG,eAAe,GAAG;EACtB,sBAAsB,EAAE;IACtBC,EAAE,EAAE,sBAAsB;IAC1BC,KAAK,EAAE,CACL,4BAA4B,EAC5B,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,EAC5B,kCAAkC,EAClC,sCAAsC,EACtC,wBAAwB,EACxB,4BAA4B,EAC5B,6BAA6B,EAC7B,gCAAgC,EAChC,iCAAiC,EACjC,sBAAsB,EACtB,uB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;MACxBC,MAAM,CAAC,YAAY;QACjB;QACAD,MAAM,GAAG,IAAAE,yBAAW,EAACN,+BAA+B,EAAElB,eAAe,CAAC;MACxE,CAAC,CAAC;MAEFyB,EAAE,CAAC,0CAA0C,EAAE,YAAY;QACzD,IAAAC,cAAM,EAACJ,MAAM,CAAC,CAACK,EAAE,CAACC,IAAI,CAACC,QAAQ,CAACV,4BAA4B,CAACW,MAAM,CAAC;MACtE,CAAC,CAAC;MAEFL,EAAE,CAAC,uCAAuC,EAAE,YAAY;QACtD,IAAAC,cAAM,EAACJ,MAAM,CAAC,CAACK,EAAE,CAACI,IAAI,CAACC,KAAK,CAACb,4BAA4B,CAAC;MAC5D,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["_chai","data","require","_dedupPaths","envCompsDirsMap","id","paths","tsExtendingConfigFilesMap","extendingConfigFile","useAbsPaths","content","name","extendingTarget","hash","filePath","envIds","tsExpectedDedupedPaths","fileHash","eslintExtendingConfigFilesMap","ff6ea265e6f21ce25f7985570beef37dd957d0dc","f1743b227e588db0c59d4a43171653e6c4262816","eslintExpectedDedupedPaths","prettierExtendingConfigFilesMap","prettierExpectedDedupedPaths","describe","timeout","result","before","dedupePaths","it","expect","to","have","lengthOf","length","deep","equal"],"sources":["dedup-paths.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport { DedupedPaths, dedupePaths } from './dedup-paths';\nimport { ExtendingConfigFilesMap } from './writers';\n\nconst envCompsDirsMap = {\n 'teambit.harmony/node': {\n id: 'teambit.harmony/node',\n paths: [\n 'react/apps/react-app-types',\n 'compilation/babel-compiler',\n 'compilation/compiler-task',\n 'mdx/compilers/mdx-compiler',\n 'mdx/compilers/mdx-multi-compiler',\n 'compilation/compilers/multi-compiler',\n 'defender/eslint-linter',\n 'mdx/generator/mdx-starters',\n 'mdx/generator/mdx-templates',\n 'react/generator/react-starters',\n 'react/generator/react-templates',\n 'defender/jest-tester',\n 'react/jest/react-jest',\n 'defender/linter-task',\n 'defender/mocha-tester',\n 'compilation/modules/babel-file-transpiler',\n 'defender/prettier-formatter',\n 'preview/react-preview',\n 'defender/tester-task',\n 'typescript/typescript-compiler',\n 'webpack/webpack-bundler',\n 'webpack/webpack-dev-server',\n 'react/webpack/react-webpack',\n ],\n },\n 'teambit.react/react-env@0.0.44': {\n id: 'teambit.react/react-env@0.0.44',\n paths: ['test-new-envs-app/apps/test-app', 'test-new-env/ui/button2'],\n },\n 'teambit.react/react': {\n id: 'teambit.react/react',\n paths: ['docs/docs-template', 'react/mounter'],\n },\n 'teambit.envs/env': {\n id: 'teambit.envs/env',\n paths: [\n 'react/examples/my-react-env',\n 'mdx/mdx-env',\n 'node/node',\n 'node/node-env-extension',\n 'react/react-env',\n 'react/react-env-extension',\n ],\n },\n 'teambit.mdx/mdx-env@0.0.6': {\n id: 'teambit.mdx/mdx-env@0.0.6',\n paths: ['test-new-env/mdx/content-comp'],\n },\n 'teambit.node/node@0.0.16': {\n id: 'teambit.node/node@0.0.16',\n paths: ['test-new-env/node/node-comp1', 'test-new-env/node/node-comp2'],\n },\n 'teambit.react/examples/my-react-env@0.0.39': {\n id: 'teambit.react/examples/my-react-env@0.0.39',\n paths: ['test-new-env/ui/button'],\n },\n};\n\nconst tsExtendingConfigFilesMap: ExtendingConfigFilesMap = {\n '816b7f584991ff21a7682ef8a4229ebf312c457f': {\n extendingConfigFile: {\n useAbsPaths: false,\n content:\n '// bit-generated-typescript-config\\n' +\n '\\n' +\n '{\\n' +\n ' \"extends\": \"/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/tsconfig.bit.4957ea3122e57ea3302aadd885eed84127d9c54b.json\"\\n' +\n '}',\n name: 'tsconfig.json',\n extendingTarget: {\n hash: '4957ea3122e57ea3302aadd885eed84127d9c54b',\n content: 'does not matter',\n name: 'tsconfig.bit.4957ea3122e57ea3302aadd885eed84127d9c54b.json',\n filePath:\n '/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/tsconfig.bit.4957ea3122e57ea3302aadd885eed84127d9c54b.json',\n },\n\n hash: '816b7f584991ff21a7682ef8a4229ebf312c457f',\n },\n envIds: ['teambit.harmony/node', 'teambit.react/react'],\n },\n '00330a9c547353867d519c34f47e17ddc9f161d1': {\n extendingConfigFile: {\n useAbsPaths: false,\n content:\n '// bit-generated-typescript-config\\n' +\n '\\n' +\n '{\\n' +\n ' \"extends\": \"/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/tsconfig.bit.17b99a1071b1d2d86ed04ebce68903b82403f278.json\"\\n' +\n '}',\n name: 'tsconfig.json',\n extendingTarget: {\n hash: '17b99a1071b1d2d86ed04ebce68903b82403f278',\n content: 'does not matter',\n name: 'tsconfig.bit.17b99a1071b1d2d86ed04ebce68903b82403f278.json',\n filePath:\n '/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/tsconfig.bit.17b99a1071b1d2d86ed04ebce68903b82403f278.json',\n },\n hash: '00330a9c547353867d519c34f47e17ddc9f161d1',\n },\n envIds: ['teambit.react/react-env@0.0.44', 'teambit.react/examples/my-react-env@0.0.39'],\n },\n '3c5960bcad98570b98834a5c37f47dd4729dbef0': {\n extendingConfigFile: {\n useAbsPaths: false,\n content:\n '// bit-generated-typescript-config\\n' +\n '\\n' +\n '{\\n' +\n ' \"extends\": \"/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/tsconfig.bit.dab521d0914afe64de248743e05a169cf9b4b50c.json\"\\n' +\n '}',\n name: 'tsconfig.json',\n extendingTarget: {\n hash: 'dab521d0914afe64de248743e05a169cf9b4b50c',\n content: 'does not matter',\n name: 'tsconfig.bit.dab521d0914afe64de248743e05a169cf9b4b50c.json',\n filePath:\n '/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/tsconfig.bit.dab521d0914afe64de248743e05a169cf9b4b50c.json',\n },\n hash: '3c5960bcad98570b98834a5c37f47dd4729dbef0',\n },\n envIds: ['teambit.node/node@0.0.16'],\n },\n};\n\nconst tsExpectedDedupedPaths: DedupedPaths = [\n {\n fileHash: '00330a9c547353867d519c34f47e17ddc9f161d1',\n paths: ['test-new-envs-app', 'test-new-env/ui'],\n },\n {\n fileHash: '3c5960bcad98570b98834a5c37f47dd4729dbef0',\n paths: ['test-new-env/node'],\n },\n {\n fileHash: '816b7f584991ff21a7682ef8a4229ebf312c457f',\n paths: ['.'],\n },\n];\n\nconst eslintExtendingConfigFilesMap: ExtendingConfigFilesMap = {\n '8810839e74a9c41694bb5a2a8587dcae71dc389d': {\n extendingConfigFile: {\n useAbsPaths: false,\n content:\n '// bit-generated-eslint-config\\n' +\n '{\\n' +\n ' \"extends\": [\\n' +\n ' \"/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.eslintrc.bit.be8facfbdcf1db685d5020f8612d8c2c3ac2eb7c.json\"\\n' +\n ' ]\\n' +\n '}',\n name: '.eslintrc.json',\n extendingTarget: {\n hash: 'be8facfbdcf1db685d5020f8612d8c2c3ac2eb7c',\n content: 'does not matter',\n name: '.eslintrc.bit.be8facfbdcf1db685d5020f8612d8c2c3ac2eb7c.json',\n filePath:\n '/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.eslintrc.bit.be8facfbdcf1db685d5020f8612d8c2c3ac2eb7c.json',\n },\n hash: '8810839e74a9c41694bb5a2a8587dcae71dc389d',\n },\n envIds: ['teambit.harmony/node', 'teambit.react/react', 'teambit.envs/env'],\n },\n ff6ea265e6f21ce25f7985570beef37dd957d0dc: {\n extendingConfigFile: {\n useAbsPaths: false,\n content:\n '// bit-generated-eslint-config\\n' +\n '{\\n' +\n ' \"extends\": [\\n' +\n ' \"/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.eslintrc.bit.e5ca5528c64e0442b05b949fea42cdda4243d840.json\"\\n' +\n ' ]\\n' +\n '}',\n name: '.eslintrc.json',\n extendingTarget: {\n hash: 'e5ca5528c64e0442b05b949fea42cdda4243d840',\n content: 'does not matter',\n name: '.eslintrc.bit.e5ca5528c64e0442b05b949fea42cdda4243d840.json',\n filePath:\n '/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.eslintrc.bit.e5ca5528c64e0442b05b949fea42cdda4243d840.json',\n },\n hash: 'ff6ea265e6f21ce25f7985570beef37dd957d0dc',\n },\n envIds: ['teambit.react/react-env@0.0.44'],\n },\n '91021f2c973a2940c70b75447639e4ea2a799955': {\n extendingConfigFile: {\n useAbsPaths: false,\n content:\n '// bit-generated-eslint-config\\n' +\n '{\\n' +\n ' \"extends\": [\\n' +\n ' \"/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.eslintrc.bit.7f229bf5ab41e8bfe61916de6c68f9c14c76f23e.json\"\\n' +\n ' ]\\n' +\n '}',\n name: '.eslintrc.json',\n extendingTarget: {\n hash: '7f229bf5ab41e8bfe61916de6c68f9c14c76f23e',\n content: 'does not matter',\n name: '.eslintrc.bit.7f229bf5ab41e8bfe61916de6c68f9c14c76f23e.json',\n filePath:\n '/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.eslintrc.bit.7f229bf5ab41e8bfe61916de6c68f9c14c76f23e.json',\n },\n hash: '91021f2c973a2940c70b75447639e4ea2a799955',\n },\n envIds: ['teambit.mdx/mdx-env@0.0.6', 'teambit.react/examples/my-react-env@0.0.39'],\n },\n f1743b227e588db0c59d4a43171653e6c4262816: {\n extendingConfigFile: {\n useAbsPaths: false,\n content:\n '// bit-generated-eslint-config\\n' +\n '{\\n' +\n ' \"extends\": [\\n' +\n ' \"/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.eslintrc.bit.c503f7386e2a637d91c74f7df90d8fafe79c4378.json\"\\n' +\n ' ]\\n' +\n '}',\n name: '.eslintrc.json',\n extendingTarget: {\n hash: 'c503f7386e2a637d91c74f7df90d8fafe79c4378',\n content: 'does not matter',\n name: '.eslintrc.bit.c503f7386e2a637d91c74f7df90d8fafe79c4378.json',\n filePath:\n '/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.eslintrc.bit.c503f7386e2a637d91c74f7df90d8fafe79c4378.json',\n },\n hash: 'f1743b227e588db0c59d4a43171653e6c4262816',\n },\n envIds: ['teambit.node/node@0.0.16'],\n },\n};\n\nconst eslintExpectedDedupedPaths: DedupedPaths = [\n {\n fileHash: 'ff6ea265e6f21ce25f7985570beef37dd957d0dc',\n paths: ['test-new-envs-app', 'test-new-env/ui/button2'],\n },\n {\n fileHash: '91021f2c973a2940c70b75447639e4ea2a799955',\n paths: ['test-new-env/mdx', 'test-new-env/ui/button'],\n },\n {\n fileHash: 'f1743b227e588db0c59d4a43171653e6c4262816',\n paths: ['test-new-env/node'],\n },\n {\n fileHash: '8810839e74a9c41694bb5a2a8587dcae71dc389d',\n paths: ['.'],\n },\n];\n\nconst prettierExtendingConfigFilesMap: ExtendingConfigFilesMap = {\n '082f546b2555ea89e7063b20de47c039d387fc74': {\n extendingConfigFile: {\n useAbsPaths: false,\n content:\n '// bit-generated-prettier-config\\n' +\n 'module.exports = {\\n' +\n \" ...require('/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.prettierrc.bit.e4882af8861bcf5b0147891d8b70b40a10428881.cjs')\\n\" +\n '}',\n name: '.prettierrc.cjs',\n extendingTarget: {\n hash: 'e4882af8861bcf5b0147891d8b70b40a10428881',\n content: 'does not matter',\n name: '.prettierrc.bit.e4882af8861bcf5b0147891d8b70b40a10428881.cjs',\n filePath:\n '/Users/giladshoham/dev/temp/new-react-18-config-files/node_modules/.cache/.prettierrc.bit.e4882af8861bcf5b0147891d8b70b40a10428881.cjs',\n },\n hash: '082f546b2555ea89e7063b20de47c039d387fc74',\n },\n envIds: [\n 'teambit.harmony/node',\n 'teambit.react/react-env@0.0.44',\n 'teambit.react/react',\n 'teambit.envs/env',\n 'teambit.mdx/mdx-env@0.0.6',\n 'teambit.node/node@0.0.16',\n 'teambit.react/examples/my-react-env@0.0.39',\n ],\n },\n};\n\nconst prettierExpectedDedupedPaths: DedupedPaths = [\n {\n fileHash: '082f546b2555ea89e7063b20de47c039d387fc74',\n paths: ['.'],\n },\n];\n\ndescribe('Workspace Config files - dedupe paths', function () {\n this.timeout(0);\n\n describe('dedupePaths', () => {\n describe('ts example', () => {\n let result: DedupedPaths;\n before(async () => {\n // @ts-ignore (we don't really care about the env itself here)\n result = dedupePaths(tsExtendingConfigFilesMap, envCompsDirsMap);\n });\n\n it('should reduce files to minimum necessary', async () => {\n expect(result).to.have.lengthOf(tsExpectedDedupedPaths.length);\n });\n\n it('should place files in correct folders', async () => {\n expect(result).to.deep.equal(tsExpectedDedupedPaths);\n });\n });\n\n describe('eslint example', () => {\n let result: DedupedPaths;\n before(async () => {\n // @ts-ignore (we don't really care about the env itself here)\n result = dedupePaths(eslintExtendingConfigFilesMap, envCompsDirsMap);\n });\n\n it('should reduce files to minimum necessary', async () => {\n expect(result).to.have.lengthOf(eslintExpectedDedupedPaths.length);\n });\n\n it('should place files in correct folders', async () => {\n expect(result).to.deep.equal(eslintExpectedDedupedPaths);\n });\n });\n\n describe('prettier example', () => {\n let result: DedupedPaths;\n before(async () => {\n // @ts-ignore (we don't really care about the env itself here)\n result = dedupePaths(prettierExtendingConfigFilesMap, envCompsDirsMap);\n });\n\n it('should reduce files to minimum necessary', async () => {\n expect(result).to.have.lengthOf(prettierExpectedDedupedPaths.length);\n });\n\n it('should place files in correct folders', async () => {\n expect(result).to.deep.equal(prettierExpectedDedupedPaths);\n });\n });\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,MAAMG,eAAe,GAAG;E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AAC;MACpE,CAAC,CAAC;MAEFL,EAAE,CAAC,uCAAuC,EAAE,YAAY;QACtD,IAAAC,cAAM,EAACJ,MAAM,CAAC,CAACK,EAAE,CAACI,IAAI,CAACC,KAAK,CAACf,0BAA0B,CAAC;MAC1D,CAAC,CAAC;IACJ,CAAC,CAAC;IAEFG,QAAQ,CAAC,kBAAkB,EAAE,MAAM;MACjC,IAAIE,MAAoB;MACxBC,MAAM,CAAC,YAAY;QACjB;QACAD,MAAM,GAAG,IAAAE,yBAAW,EAACN,+BAA+B,EAAElB,eAAe,CAAC;MACxE,CAAC,CAAC;MAEFyB,EAAE,CAAC,0CAA0C,EAAE,YAAY;QACzD,IAAAC,cAAM,EAACJ,MAAM,CAAC,CAACK,EAAE,CAACC,IAAI,CAACC,QAAQ,CAACV,4BAA4B,CAACW,MAAM,CAAC;MACtE,CAAC,CAAC;MAEFL,EAAE,CAAC,uCAAuC,EAAE,YAAY;QACtD,IAAAC,cAAM,EAACJ,MAAM,CAAC,CAACK,EAAE,CAACI,IAAI,CAACC,KAAK,CAACb,4BAA4B,CAAC;MAC5D,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_bitError","data","require","WriteConfigFilesFailed","BitError","constructor","exports","default"],"sources":["write-failed.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\n\nexport default class WriteConfigFilesFailed extends BitError {\n constructor() {\n super('failed writing config files in the workspace. run with --log to see the error');\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEe,MAAME,sBAAsB,SAASC,oBAAQ,CAAC;EAC3DC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,+EAA+E,CAAC;EACxF;AACF;AAACC,OAAA,CAAAC,OAAA,GAAAJ,sBAAA"}
1
+ {"version":3,"names":["_bitError","data","require","WriteConfigFilesFailed","BitError","constructor","exports","default"],"sources":["write-failed.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\n\nexport default class WriteConfigFilesFailed extends BitError {\n constructor() {\n super('failed writing config files in the workspace. run with --log to see the error');\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEe,MAAME,sBAAsB,SAASC,oBAAQ,CAAC;EAC3DC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,+EAA+E,CAAC;EACxF;AACF;AAACC,OAAA,CAAAC,OAAA,GAAAJ,sBAAA","ignoreList":[]}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_workspaceConfigFiles","data","require","_configWriterList","_default","exports","default","WorkspaceConfigFilesAspect"],"sources":["index.ts"],"sourcesContent":["import { WorkspaceConfigFilesAspect } from './workspace-config-files.aspect';\n\nexport type {\n WorkspaceConfigFilesMain,\n WriteConfigFilesResult,\n EnvCompsDirsMap,\n EnvMapValue,\n OneConfigWriterIdResult,\n WriteResults,\n} from './workspace-config-files.main.runtime';\nexport type {\n ConfigWriterEntry,\n ExtendingConfigFile,\n ConfigFile,\n PostProcessExtendingConfigFilesArgs,\n GenerateExtendingConfigFilesArgs,\n} from './config-writer-entry';\nexport type { ConfigWriterHandler } from './config-writer-list';\nexport type { WorkspaceConfigEnv } from './workspace-config-env-type';\nexport { ConfigWriterList } from './config-writer-list';\nexport default WorkspaceConfigFilesAspect;\nexport { WorkspaceConfigFilesAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAAA,sBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,qBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAmBA,SAAAE,kBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,iBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAwD,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACzCC,kDAA0B"}
1
+ {"version":3,"names":["_workspaceConfigFiles","data","require","_configWriterList","_default","exports","default","WorkspaceConfigFilesAspect"],"sources":["index.ts"],"sourcesContent":["import { WorkspaceConfigFilesAspect } from './workspace-config-files.aspect';\n\nexport type {\n WorkspaceConfigFilesMain,\n WriteConfigFilesResult,\n EnvCompsDirsMap,\n EnvMapValue,\n OneConfigWriterIdResult,\n WriteResults,\n} from './workspace-config-files.main.runtime';\nexport type {\n ConfigWriterEntry,\n ExtendingConfigFile,\n ConfigFile,\n PostProcessExtendingConfigFilesArgs,\n GenerateExtendingConfigFilesArgs,\n} from './config-writer-entry';\nexport type { ConfigWriterHandler } from './config-writer-list';\nexport type { WorkspaceConfigEnv } from './workspace-config-env-type';\nexport { ConfigWriterList } from './config-writer-list';\nexport default WorkspaceConfigFilesAspect;\nexport { WorkspaceConfigFilesAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAAA,sBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,qBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAmBA,SAAAE,kBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,iBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAwD,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACzCC,kDAA0B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","formatCleanOutput","cleanResults","flags","isDryRun","dryRun","cleanResultsOutput","getCleanResultsOutput","chalk","green","length","join"],"sources":["format-clean-output.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { CleanConfigCmdFlags } from '../ws-config.cmd';\n\nexport function formatCleanOutput(cleanResults: string[] = [], flags: CleanConfigCmdFlags): string {\n const isDryRun = !!flags.dryRun;\n const cleanResultsOutput = getCleanResultsOutput(cleanResults, isDryRun);\n\n return `${cleanResultsOutput}`;\n}\n\nfunction getCleanResultsOutput(cleanResults: string[] | undefined, isDryRun: boolean) {\n const cleanResultsOutput = cleanResults\n ? `${chalk.green(\n `${cleanResults.length} config files ${isDryRun ? 'will be' : 'were'} deleted`\n )}\\n ${cleanResults.join('\\n ')}\\n`\n : '';\n return cleanResultsOutput;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGnB,SAASG,iBAAiBA,CAACC,YAAsB,GAAG,EAAE,EAAEC,KAA0B,EAAU;EACjG,MAAMC,QAAQ,GAAG,CAAC,CAACD,KAAK,CAACE,MAAM;EAC/B,MAAMC,kBAAkB,GAAGC,qBAAqB,CAACL,YAAY,EAAEE,QAAQ,CAAC;EAExE,OAAQ,GAAEE,kBAAmB,EAAC;AAChC;AAEA,SAASC,qBAAqBA,CAACL,YAAkC,EAAEE,QAAiB,EAAE;EACpF,MAAME,kBAAkB,GAAGJ,YAAY,GAClC,GAAEM,gBAAK,CAACC,KAAK,CACX,GAAEP,YAAY,CAACQ,MAAO,iBAAgBN,QAAQ,GAAG,SAAS,GAAG,MAAO,UACvE,CAAE,OAAMF,YAAY,CAACS,IAAI,CAAC,MAAM,CAAE,IAAG,GACrC,EAAE;EACN,OAAOL,kBAAkB;AAC3B"}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","formatCleanOutput","cleanResults","flags","isDryRun","dryRun","cleanResultsOutput","getCleanResultsOutput","chalk","green","length","join"],"sources":["format-clean-output.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { CleanConfigCmdFlags } from '../ws-config.cmd';\n\nexport function formatCleanOutput(cleanResults: string[] = [], flags: CleanConfigCmdFlags): string {\n const isDryRun = !!flags.dryRun;\n const cleanResultsOutput = getCleanResultsOutput(cleanResults, isDryRun);\n\n return `${cleanResultsOutput}`;\n}\n\nfunction getCleanResultsOutput(cleanResults: string[] | undefined, isDryRun: boolean) {\n const cleanResultsOutput = cleanResults\n ? `${chalk.green(\n `${cleanResults.length} config files ${isDryRun ? 'will be' : 'were'} deleted`\n )}\\n ${cleanResults.join('\\n ')}\\n`\n : '';\n return cleanResultsOutput;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGnB,SAASG,iBAAiBA,CAACC,YAAsB,GAAG,EAAE,EAAEC,KAA0B,EAAU;EACjG,MAAMC,QAAQ,GAAG,CAAC,CAACD,KAAK,CAACE,MAAM;EAC/B,MAAMC,kBAAkB,GAAGC,qBAAqB,CAACL,YAAY,EAAEE,QAAQ,CAAC;EAExE,OAAQ,GAAEE,kBAAmB,EAAC;AAChC;AAEA,SAASC,qBAAqBA,CAACL,YAAkC,EAAEE,QAAiB,EAAE;EACpF,MAAME,kBAAkB,GAAGJ,YAAY,GAClC,GAAEM,gBAAK,CAACC,KAAK,CACX,GAAEP,YAAY,CAACQ,MAAO,iBAAgBN,QAAQ,GAAG,SAAS,GAAG,MAAO,UACvE,CAAE,OAAMF,YAAY,CAACS,IAAI,CAAC,MAAM,CAAE,IAAG,GACrC,EAAE;EACN,OAAOL,kBAAkB;AAC3B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","formatListOutput","result","Object","values","map","item","getEnvOutput","envId","configWriters","join","title","chalk","bold","space","length","yellow","entries","configWriter","name","id"],"sources":["format-list-output.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { EnvConfigWritersList } from '../workspace-config-files.main.runtime';\nimport { ConfigWriterEntry } from '../config-writer-entry';\n\nexport function formatListOutput(result: EnvConfigWritersList): string {\n return Object.values(result)\n .map((item) => getEnvOutput(item.envId, item.configWriters))\n .join('\\n\\n');\n}\n\nfunction getEnvOutput(envId: string, configWriters: ConfigWriterEntry[]): string {\n const title = chalk.bold(envId);\n const space = ' ';\n if (!configWriters.length) return `${title}\\n${space}${chalk.yellow('no config writers found')}`;\n const entries = configWriters\n .map((configWriter) => {\n return `${configWriter.name} (${configWriter.id})`;\n })\n .join(`\\n${space}`);\n return `${title}\\n${space}${entries}`;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAInB,SAASG,gBAAgBA,CAACC,MAA4B,EAAU;EACrE,OAAOC,MAAM,CAACC,MAAM,CAACF,MAAM,CAAC,CACzBG,GAAG,CAAEC,IAAI,IAAKC,YAAY,CAACD,IAAI,CAACE,KAAK,EAAEF,IAAI,CAACG,aAAa,CAAC,CAAC,CAC3DC,IAAI,CAAC,MAAM,CAAC;AACjB;AAEA,SAASH,YAAYA,CAACC,KAAa,EAAEC,aAAkC,EAAU;EAC/E,MAAME,KAAK,GAAGC,gBAAK,CAACC,IAAI,CAACL,KAAK,CAAC;EAC/B,MAAMM,KAAK,GAAG,IAAI;EAClB,IAAI,CAACL,aAAa,CAACM,MAAM,EAAE,OAAQ,GAAEJ,KAAM,KAAIG,KAAM,GAAEF,gBAAK,CAACI,MAAM,CAAC,yBAAyB,CAAE,EAAC;EAChG,MAAMC,OAAO,GAAGR,aAAa,CAC1BJ,GAAG,CAAEa,YAAY,IAAK;IACrB,OAAQ,GAAEA,YAAY,CAACC,IAAK,KAAID,YAAY,CAACE,EAAG,GAAE;EACpD,CAAC,CAAC,CACDV,IAAI,CAAE,KAAII,KAAM,EAAC,CAAC;EACrB,OAAQ,GAAEH,KAAM,KAAIG,KAAM,GAAEG,OAAQ,EAAC;AACvC"}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","obj","__esModule","default","formatListOutput","result","Object","values","map","item","getEnvOutput","envId","configWriters","join","title","chalk","bold","space","length","yellow","entries","configWriter","name","id"],"sources":["format-list-output.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { EnvConfigWritersList } from '../workspace-config-files.main.runtime';\nimport { ConfigWriterEntry } from '../config-writer-entry';\n\nexport function formatListOutput(result: EnvConfigWritersList): string {\n return Object.values(result)\n .map((item) => getEnvOutput(item.envId, item.configWriters))\n .join('\\n\\n');\n}\n\nfunction getEnvOutput(envId: string, configWriters: ConfigWriterEntry[]): string {\n const title = chalk.bold(envId);\n const space = ' ';\n if (!configWriters.length) return `${title}\\n${space}${chalk.yellow('no config writers found')}`;\n const entries = configWriters\n .map((configWriter) => {\n return `${configWriter.name} (${configWriter.id})`;\n })\n .join(`\\n${space}`);\n return `${title}\\n${space}${entries}`;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAInB,SAASG,gBAAgBA,CAACC,MAA4B,EAAU;EACrE,OAAOC,MAAM,CAACC,MAAM,CAACF,MAAM,CAAC,CACzBG,GAAG,CAAEC,IAAI,IAAKC,YAAY,CAACD,IAAI,CAACE,KAAK,EAAEF,IAAI,CAACG,aAAa,CAAC,CAAC,CAC3DC,IAAI,CAAC,MAAM,CAAC;AACjB;AAEA,SAASH,YAAYA,CAACC,KAAa,EAAEC,aAAkC,EAAU;EAC/E,MAAME,KAAK,GAAGC,gBAAK,CAACC,IAAI,CAACL,KAAK,CAAC;EAC/B,MAAMM,KAAK,GAAG,IAAI;EAClB,IAAI,CAACL,aAAa,CAACM,MAAM,EAAE,OAAQ,GAAEJ,KAAM,KAAIG,KAAM,GAAEF,gBAAK,CAACI,MAAM,CAAC,yBAAyB,CAAE,EAAC;EAChG,MAAMC,OAAO,GAAGR,aAAa,CAC1BJ,GAAG,CAAEa,YAAY,IAAK;IACrB,OAAQ,GAAEA,YAAY,CAACC,IAAK,KAAID,YAAY,CAACE,EAAG,GAAE;EACpD,CAAC,CAAC,CACDV,IAAI,CAAE,KAAII,KAAM,EAAC,CAAC;EACrB,OAAQ,GAAEH,KAAM,KAAIG,KAAM,GAAEG,OAAQ,EAAC;AACvC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_path","_formatCleanOutput","_writeOutputsTexts","obj","__esModule","default","formatWriteOutput","writeConfigFilesResult","flags","cleanResults","writeResults","wsDir","isDryRun","dryRun","dryRunWithContent","cleanResultsOutput","length","formatCleanOutput","undefined","writeResultsOutput","getWriteResultsOutput","cleanWriteOutput","SUMMARY","totalExtendingConfigFiles","writeTitle","chalk","green","WRITE_TITLE","writeOutput","writersResult","map","writerResult","getOneWriterOutput","join","title","blue","bold","writerId","toString","writersOutput","getExtendingConfigFilesOutput","extendingConfigFiles","extendingConfigFilesOutput","envsWrittenExtendingConfigFile","getEnvGroupExtendingConfigFilesOutput","extendingConfigFile","paths","filePaths","p","relative"],"sources":["format-write-output.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { relative } from 'path';\nimport { OneConfigWriterIdResult, WriteConfigFilesResult, WriteResults } from '../workspace-config-files.main.runtime';\nimport type { WriteConfigCmdFlags } from '../ws-config.cmd';\nimport { formatCleanOutput } from './format-clean-output';\nimport { SUMMARY, WRITE_TITLE } from './write-outputs-texts';\nimport { EnvsWrittenExtendingConfigFile, EnvsWrittenExtendingConfigFiles } from '../writers';\n\nexport function formatWriteOutput(writeConfigFilesResult: WriteConfigFilesResult, flags: WriteConfigCmdFlags): string {\n const { cleanResults, writeResults, wsDir } = writeConfigFilesResult;\n const isDryRun = !!(flags.dryRun || flags.dryRunWithContent);\n const cleanResultsOutput = cleanResults?.length ? formatCleanOutput(cleanResults, { dryRun: isDryRun }) : undefined;\n const writeResultsOutput = getWriteResultsOutput(writeResults, wsDir, isDryRun);\n\n const cleanWriteOutput = cleanResultsOutput ? `${cleanResultsOutput}\\n${writeResultsOutput}` : writeResultsOutput;\n\n return `${cleanWriteOutput}\\n\\n${SUMMARY}`;\n}\n\nfunction getWriteResultsOutput(writeResults: WriteResults, wsDir: string, isDryRun: boolean) {\n const totalExtendingConfigFiles = writeResults.totalExtendingConfigFiles;\n\n const writeTitle = isDryRun\n ? chalk.green(`${totalExtendingConfigFiles} files will be written`)\n : chalk.green(WRITE_TITLE(totalExtendingConfigFiles));\n const writeOutput = writeResults.writersResult\n .map((writerResult) => getOneWriterOutput(writerResult, wsDir))\n .join('\\n\\n');\n return `${writeTitle}\\n${writeOutput}`;\n}\nfunction getOneWriterOutput(writerResult: OneConfigWriterIdResult, wsDir: string): string {\n const title = chalk.blue(\n `${writerResult.totalExtendingConfigFiles} ${chalk.bold(writerResult.writerId.toString())} configurations added`\n );\n const writersOutput = getExtendingConfigFilesOutput(writerResult.extendingConfigFiles, wsDir);\n return `${title}\\n${writersOutput}`;\n}\n\nfunction getExtendingConfigFilesOutput(extendingConfigFiles: EnvsWrittenExtendingConfigFiles, wsDir: string): string {\n const extendingConfigFilesOutput = extendingConfigFiles\n .map((envsWrittenExtendingConfigFile) =>\n getEnvGroupExtendingConfigFilesOutput(envsWrittenExtendingConfigFile, wsDir)\n )\n .join('\\n');\n return `${extendingConfigFilesOutput}`;\n}\nfunction getEnvGroupExtendingConfigFilesOutput(\n envsWrittenExtendingConfigFile: EnvsWrittenExtendingConfigFile,\n wsDir: string\n): string {\n const extendingConfigFile = envsWrittenExtendingConfigFile.extendingConfigFile;\n const paths = extendingConfigFile.filePaths.map((p) => ` ${relative(wsDir, p)}`).join('\\n');\n return `${paths}`;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,mBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,kBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,mBAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,kBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA6D,SAAAC,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGtD,SAASG,iBAAiBA,CAACC,sBAA8C,EAAEC,KAA0B,EAA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AQ,CAACC,QAAQ,CAAC,CAAC,CAAE,uBAC5F,CAAC;EACD,MAAMC,aAAa,GAAGC,6BAA6B,CAACT,YAAY,CAACU,oBAAoB,EAAE9B,KAAK,CAAC;EAC7F,OAAQ,GAAEuB,KAAM,KAAIK,aAAc,EAAC;AACrC;AAEA,SAASC,6BAA6BA,CAACC,oBAAqD,EAAE9B,KAAa,EAAU;EACnH,MAAM+B,0BAA0B,GAAGD,oBAAoB,CACpDX,GAAG,CAAEa,8BAA8B,IAClCC,qCAAqC,CAACD,8BAA8B,EAAEhC,KAAK,CAC7E,CAAC,CACAsB,IAAI,CAAC,IAAI,CAAC;EACb,OAAQ,GAAES,0BAA2B,EAAC;AACxC;AACA,SAASE,qCAAqCA,CAC5CD,8BAA8D,EAC9DhC,KAAa,EACL;EACR,MAAMkC,mBAAmB,GAAGF,8BAA8B,CAACE,mBAAmB;EAC9E,MAAMC,KAAK,GAAGD,mBAAmB,CAACE,SAAS,CAACjB,GAAG,CAAEkB,CAAC,IAAM,KAAI,IAAAC,gBAAQ,EAACtC,KAAK,EAAEqC,CAAC,CAAE,EAAC,CAAC,CAACf,IAAI,CAAC,IAAI,CAAC;EAC5F,OAAQ,GAAEa,KAAM,EAAC;AACnB"}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_path","_formatCleanOutput","_writeOutputsTexts","obj","__esModule","default","formatWriteOutput","writeConfigFilesResult","flags","cleanResults","writeResults","wsDir","isDryRun","dryRun","dryRunWithContent","cleanResultsOutput","length","formatCleanOutput","undefined","writeResultsOutput","getWriteResultsOutput","cleanWriteOutput","SUMMARY","totalExtendingConfigFiles","writeTitle","chalk","green","WRITE_TITLE","writeOutput","writersResult","map","writerResult","getOneWriterOutput","join","title","blue","bold","writerId","toString","writersOutput","getExtendingConfigFilesOutput","extendingConfigFiles","extendingConfigFilesOutput","envsWrittenExtendingConfigFile","getEnvGroupExtendingConfigFilesOutput","extendingConfigFile","paths","filePaths","p","relative"],"sources":["format-write-output.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { relative } from 'path';\nimport { OneConfigWriterIdResult, WriteConfigFilesResult, WriteResults } from '../workspace-config-files.main.runtime';\nimport type { WriteConfigCmdFlags } from '../ws-config.cmd';\nimport { formatCleanOutput } from './format-clean-output';\nimport { SUMMARY, WRITE_TITLE } from './write-outputs-texts';\nimport { EnvsWrittenExtendingConfigFile, EnvsWrittenExtendingConfigFiles } from '../writers';\n\nexport function formatWriteOutput(writeConfigFilesResult: WriteConfigFilesResult, flags: WriteConfigCmdFlags): string {\n const { cleanResults, writeResults, wsDir } = writeConfigFilesResult;\n const isDryRun = !!(flags.dryRun || flags.dryRunWithContent);\n const cleanResultsOutput = cleanResults?.length ? formatCleanOutput(cleanResults, { dryRun: isDryRun }) : undefined;\n const writeResultsOutput = getWriteResultsOutput(writeResults, wsDir, isDryRun);\n\n const cleanWriteOutput = cleanResultsOutput ? `${cleanResultsOutput}\\n${writeResultsOutput}` : writeResultsOutput;\n\n return `${cleanWriteOutput}\\n\\n${SUMMARY}`;\n}\n\nfunction getWriteResultsOutput(writeResults: WriteResults, wsDir: string, isDryRun: boolean) {\n const totalExtendingConfigFiles = writeResults.totalExtendingConfigFiles;\n\n const writeTitle = isDryRun\n ? chalk.green(`${totalExtendingConfigFiles} files will be written`)\n : chalk.green(WRITE_TITLE(totalExtendingConfigFiles));\n const writeOutput = writeResults.writersResult\n .map((writerResult) => getOneWriterOutput(writerResult, wsDir))\n .join('\\n\\n');\n return `${writeTitle}\\n${writeOutput}`;\n}\nfunction getOneWriterOutput(writerResult: OneConfigWriterIdResult, wsDir: string): string {\n const title = chalk.blue(\n `${writerResult.totalExtendingConfigFiles} ${chalk.bold(writerResult.writerId.toString())} configurations added`\n );\n const writersOutput = getExtendingConfigFilesOutput(writerResult.extendingConfigFiles, wsDir);\n return `${title}\\n${writersOutput}`;\n}\n\nfunction getExtendingConfigFilesOutput(extendingConfigFiles: EnvsWrittenExtendingConfigFiles, wsDir: string): string {\n const extendingConfigFilesOutput = extendingConfigFiles\n .map((envsWrittenExtendingConfigFile) =>\n getEnvGroupExtendingConfigFilesOutput(envsWrittenExtendingConfigFile, wsDir)\n )\n .join('\\n');\n return `${extendingConfigFilesOutput}`;\n}\nfunction getEnvGroupExtendingConfigFilesOutput(\n envsWrittenExtendingConfigFile: EnvsWrittenExtendingConfigFile,\n wsDir: string\n): string {\n const extendingConfigFile = envsWrittenExtendingConfigFile.extendingConfigFile;\n const paths = extendingConfigFile.filePaths.map((p) => ` ${relative(wsDir, p)}`).join('\\n');\n return `${paths}`;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,mBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,kBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,mBAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,kBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA6D,SAAAC,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGtD,SAASG,iBAAiBA,CAACC,sBAA8C,EAAEC,KAA0B,EAAU;EACpH,MAAM;IAAEC,YAAY;IAAEC,YAAY;IAAEC;EAAM,CAAC,GAAGJ,sBAAsB;EACpE,MAAMK,QAAQ,GAAG,CAAC,EAAEJ,KAAK,CAACK,MAAM,IAAIL,KAAK,CAACM,iBAAiB,CA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,aAAc,EAAC;AACrC;AAEA,SAASC,6BAA6BA,CAACC,oBAAqD,EAAE9B,KAAa,EAAU;EACnH,MAAM+B,0BAA0B,GAAGD,oBAAoB,CACpDX,GAAG,CAAEa,8BAA8B,IAClCC,qCAAqC,CAACD,8BAA8B,EAAEhC,KAAK,CAC7E,CAAC,CACAsB,IAAI,CAAC,IAAI,CAAC;EACb,OAAQ,GAAES,0BAA2B,EAAC;AACxC;AACA,SAASE,qCAAqCA,CAC5CD,8BAA8D,EAC9DhC,KAAa,EACL;EACR,MAAMkC,mBAAmB,GAAGF,8BAA8B,CAACE,mBAAmB;EAC9E,MAAMC,KAAK,GAAGD,mBAAmB,CAACE,SAAS,CAACjB,GAAG,CAAEkB,CAAC,IAAM,KAAI,IAAAC,gBAAQ,EAACtC,KAAK,EAAEqC,CAAC,CAAE,EAAC,CAAC,CAACf,IAAI,CAAC,IAAI,CAAC;EAC5F,OAAQ,GAAEa,KAAM,EAAC;AACnB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_formatCleanOutput","data","require","_formatListOutput","_formatWriteOutput","_verboseFormatWriteOutput"],"sources":["index.ts"],"sourcesContent":["export { formatCleanOutput } from './format-clean-output';\nexport { formatListOutput } from './format-list-output';\nexport { formatWriteOutput } from './format-write-output';\nexport { verboseFormatWriteOutput } from './verbose-format-write-output';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,kBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,iBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,0BAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,yBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA"}
1
+ {"version":3,"names":["_formatCleanOutput","data","require","_formatListOutput","_formatWriteOutput","_verboseFormatWriteOutput"],"sources":["index.ts"],"sourcesContent":["export { formatCleanOutput } from './format-clean-output';\nexport { formatListOutput } from './format-list-output';\nexport { formatWriteOutput } from './format-write-output';\nexport { verboseFormatWriteOutput } from './verbose-format-write-output';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,kBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,iBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,0BAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,yBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_path","_formatCleanOutput","_writeOutputsTexts","obj","__esModule","default","verboseFormatWriteOutput","writeConfigFilesResult","flags","cleanResults","writeResults","wsDir","isDryRun","dryRun","dryRunWithContent","cleanResultsOutput","formatCleanOutput","writeResultsOutput","getWriteResultsOutput","SUMMARY","totalFiles","totalWrittenFiles","writeTitle","chalk","green","WRITE_TITLE","writeOutput","writersResult","map","writerResult","getOneWriterOutput","join","oneWritersResults","title","cyan","bold","writerId","realConfigFilesOutput","getRealConfigFilesOutput","realConfigFiles","extendingConfigFilesOutput","getExtendingConfigFilesOutput","extendingConfigFiles","envsWrittenRealConfigFiles","magenta","writtenConfigFilesOutput","envsWrittenConfigFile","getEnvGroupConfigFilesOutput","envIds","filePath","relative","writtenRealConfigFile","envsWrittenExtendingConfigFile","getEnvGroupExtendingConfigFilesOutput","extendingConfigFile","paths","filePaths","p","extendingTarget"],"sources":["verbose-format-write-output.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { relative } from 'path';\nimport { OneConfigWriterIdResult, WriteConfigFilesResult, WriteResults } from '../workspace-config-files.main.runtime';\nimport type { WriteConfigCmdFlags } from '../ws-config.cmd';\nimport { formatCleanOutput } from './format-clean-output';\nimport { SUMMARY, WRITE_TITLE } from './write-outputs-texts';\nimport {\n EnvsWrittenExtendingConfigFile,\n EnvsWrittenExtendingConfigFiles,\n EnvsWrittenRealConfigFile,\n EnvsWrittenRealConfigFiles,\n} from '../writers';\n\nexport function verboseFormatWriteOutput(\n writeConfigFilesResult: WriteConfigFilesResult,\n flags: WriteConfigCmdFlags\n): string {\n const { cleanResults, writeResults, wsDir } = writeConfigFilesResult;\n const isDryRun = !!(flags.dryRun || flags.dryRunWithContent);\n const cleanResultsOutput = formatCleanOutput(cleanResults, { dryRun: isDryRun });\n const writeResultsOutput = getWriteResultsOutput(writeResults, wsDir, isDryRun);\n\n return `${cleanResultsOutput}\\n${writeResultsOutput}\\n\\n${SUMMARY}`;\n}\n\nfunction getWriteResultsOutput(writeResults: WriteResults, wsDir: string, isDryRun: boolean) {\n const totalFiles = writeResults.totalWrittenFiles;\n\n const writeTitle = isDryRun\n ? chalk.green(`${totalFiles} files will be written`)\n : chalk.green(WRITE_TITLE(totalFiles));\n const writeOutput = writeResults.writersResult\n .map((writerResult) => getOneWriterOutput(writerResult, wsDir))\n .join('\\n\\n');\n return `${writeTitle}\\n${writeOutput}`;\n}\n\nfunction getOneWriterOutput(oneWritersResults: OneConfigWriterIdResult, wsDir: string): string {\n const title = chalk.cyan(` The following paths are according to writer ${chalk.bold(oneWritersResults.writerId)}`);\n const realConfigFilesOutput = getRealConfigFilesOutput(oneWritersResults.realConfigFiles, wsDir);\n const extendingConfigFilesOutput = getExtendingConfigFilesOutput(oneWritersResults.extendingConfigFiles, wsDir);\n return `${title}\\n${realConfigFilesOutput}\\n\\n${extendingConfigFilesOutput}`;\n}\n\nfunction getRealConfigFilesOutput(envsWrittenRealConfigFiles: EnvsWrittenRealConfigFiles, wsDir: string): string {\n const title = chalk.magenta(` Real config files`);\n const writtenConfigFilesOutput = envsWrittenRealConfigFiles\n .map((envsWrittenConfigFile) => getEnvGroupConfigFilesOutput(envsWrittenConfigFile, wsDir))\n .join('\\n\\n');\n return `${title}\\n${writtenConfigFilesOutput}`;\n}\nfunction getEnvGroupConfigFilesOutput(envsWrittenConfigFile: EnvsWrittenRealConfigFile, wsDir: string): string {\n const title = ` The following paths are according to env(s) ${chalk.bold(\n envsWrittenConfigFile.envIds.join(', ')\n )}`;\n const filePath = relative(wsDir, envsWrittenConfigFile.writtenRealConfigFile.filePath);\n return `${title}\\n ${filePath}`;\n}\nfunction getExtendingConfigFilesOutput(extendingConfigFiles: EnvsWrittenExtendingConfigFiles, wsDir: string): string {\n const title = chalk.magenta(` Extending config files`);\n\n const extendingConfigFilesOutput = extendingConfigFiles\n .map((envsWrittenExtendingConfigFile) =>\n getEnvGroupExtendingConfigFilesOutput(envsWrittenExtendingConfigFile, wsDir)\n )\n .join('\\n\\n');\n return `${title}\\n${extendingConfigFilesOutput}`;\n}\nfunction getEnvGroupExtendingConfigFilesOutput(\n envsWrittenExtendingConfigFile: EnvsWrittenExtendingConfigFile,\n wsDir: string\n): string {\n const title = ` The following paths are according to env(s) ${chalk.bold(\n envsWrittenExtendingConfigFile.envIds.join(', ')\n )}`;\n const extendingConfigFile = envsWrittenExtendingConfigFile.extendingConfigFile;\n const paths = extendingConfigFile.filePaths\n .map((p) => ` ${relative(wsDir, p)} --> ${relative(wsDir, extendingConfigFile.extendingTarget.filePath)}`)\n .join('\\n ');\n return `${title}\\n ${paths}`;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,mBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,kBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,mBAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,kBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA6D,SAAAC,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAQtD,SAASG,wBAAwBA,CACtCC,sBAA8C,EAC9CC,KAA0B,EAClB;EACR,MAAM;IAAEC,YAAY;IAAEC,YAAY;IAAEC;EAAM,CAAC,GAAGJ,sBAAsB;EACpE,MAAMK,QAAQ,GAAG,CAAC,EAAEJ,KAAK,CAACK,MAAM,IAAIL,KAAK,CAACM,iBAAiB,CAAC;EAC5D,MAAMC,kBAAkB,GAAG,IAAAC,sCAAiB,EAACP,YAAY,EAAE;IAAEI,MAAM,EAAED;EAAS,CAAC,CAAC;EAChF,MAAMK,kBAAkB,GAAGC,qBAAqB,CAACR,YAAY,EAAEC,KAAK,EAAEC,QAAQ,CAAC;EAE/E,OAAQ,GAAEG,kBAAmB,KAA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AAC,QAAQ,CAAC;EACjB,OAAQ,GAAEE,KAAM,SAAQsB,KAAM,EAAC;AACjC"}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_path","_formatCleanOutput","_writeOutputsTexts","obj","__esModule","default","verboseFormatWriteOutput","writeConfigFilesResult","flags","cleanResults","writeResults","wsDir","isDryRun","dryRun","dryRunWithContent","cleanResultsOutput","formatCleanOutput","writeResultsOutput","getWriteResultsOutput","SUMMARY","totalFiles","totalWrittenFiles","writeTitle","chalk","green","WRITE_TITLE","writeOutput","writersResult","map","writerResult","getOneWriterOutput","join","oneWritersResults","title","cyan","bold","writerId","realConfigFilesOutput","getRealConfigFilesOutput","realConfigFiles","extendingConfigFilesOutput","getExtendingConfigFilesOutput","extendingConfigFiles","envsWrittenRealConfigFiles","magenta","writtenConfigFilesOutput","envsWrittenConfigFile","getEnvGroupConfigFilesOutput","envIds","filePath","relative","writtenRealConfigFile","envsWrittenExtendingConfigFile","getEnvGroupExtendingConfigFilesOutput","extendingConfigFile","paths","filePaths","p","extendingTarget"],"sources":["verbose-format-write-output.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { relative } from 'path';\nimport { OneConfigWriterIdResult, WriteConfigFilesResult, WriteResults } from '../workspace-config-files.main.runtime';\nimport type { WriteConfigCmdFlags } from '../ws-config.cmd';\nimport { formatCleanOutput } from './format-clean-output';\nimport { SUMMARY, WRITE_TITLE } from './write-outputs-texts';\nimport {\n EnvsWrittenExtendingConfigFile,\n EnvsWrittenExtendingConfigFiles,\n EnvsWrittenRealConfigFile,\n EnvsWrittenRealConfigFiles,\n} from '../writers';\n\nexport function verboseFormatWriteOutput(\n writeConfigFilesResult: WriteConfigFilesResult,\n flags: WriteConfigCmdFlags\n): string {\n const { cleanResults, writeResults, wsDir } = writeConfigFilesResult;\n const isDryRun = !!(flags.dryRun || flags.dryRunWithContent);\n const cleanResultsOutput = formatCleanOutput(cleanResults, { dryRun: isDryRun });\n const writeResultsOutput = getWriteResultsOutput(writeResults, wsDir, isDryRun);\n\n return `${cleanResultsOutput}\\n${writeResultsOutput}\\n\\n${SUMMARY}`;\n}\n\nfunction getWriteResultsOutput(writeResults: WriteResults, wsDir: string, isDryRun: boolean) {\n const totalFiles = writeResults.totalWrittenFiles;\n\n const writeTitle = isDryRun\n ? chalk.green(`${totalFiles} files will be written`)\n : chalk.green(WRITE_TITLE(totalFiles));\n const writeOutput = writeResults.writersResult\n .map((writerResult) => getOneWriterOutput(writerResult, wsDir))\n .join('\\n\\n');\n return `${writeTitle}\\n${writeOutput}`;\n}\n\nfunction getOneWriterOutput(oneWritersResults: OneConfigWriterIdResult, wsDir: string): string {\n const title = chalk.cyan(` The following paths are according to writer ${chalk.bold(oneWritersResults.writerId)}`);\n const realConfigFilesOutput = getRealConfigFilesOutput(oneWritersResults.realConfigFiles, wsDir);\n const extendingConfigFilesOutput = getExtendingConfigFilesOutput(oneWritersResults.extendingConfigFiles, wsDir);\n return `${title}\\n${realConfigFilesOutput}\\n\\n${extendingConfigFilesOutput}`;\n}\n\nfunction getRealConfigFilesOutput(envsWrittenRealConfigFiles: EnvsWrittenRealConfigFiles, wsDir: string): string {\n const title = chalk.magenta(` Real config files`);\n const writtenConfigFilesOutput = envsWrittenRealConfigFiles\n .map((envsWrittenConfigFile) => getEnvGroupConfigFilesOutput(envsWrittenConfigFile, wsDir))\n .join('\\n\\n');\n return `${title}\\n${writtenConfigFilesOutput}`;\n}\nfunction getEnvGroupConfigFilesOutput(envsWrittenConfigFile: EnvsWrittenRealConfigFile, wsDir: string): string {\n const title = ` The following paths are according to env(s) ${chalk.bold(\n envsWrittenConfigFile.envIds.join(', ')\n )}`;\n const filePath = relative(wsDir, envsWrittenConfigFile.writtenRealConfigFile.filePath);\n return `${title}\\n ${filePath}`;\n}\nfunction getExtendingConfigFilesOutput(extendingConfigFiles: EnvsWrittenExtendingConfigFiles, wsDir: string): string {\n const title = chalk.magenta(` Extending config files`);\n\n const extendingConfigFilesOutput = extendingConfigFiles\n .map((envsWrittenExtendingConfigFile) =>\n getEnvGroupExtendingConfigFilesOutput(envsWrittenExtendingConfigFile, wsDir)\n )\n .join('\\n\\n');\n return `${title}\\n${extendingConfigFilesOutput}`;\n}\nfunction getEnvGroupExtendingConfigFilesOutput(\n envsWrittenExtendingConfigFile: EnvsWrittenExtendingConfigFile,\n wsDir: string\n): string {\n const title = ` The following paths are according to env(s) ${chalk.bold(\n envsWrittenExtendingConfigFile.envIds.join(', ')\n )}`;\n const extendingConfigFile = envsWrittenExtendingConfigFile.extendingConfigFile;\n const paths = extendingConfigFile.filePaths\n .map((p) => ` ${relative(wsDir, p)} --> ${relative(wsDir, extendingConfigFile.extendingTarget.filePath)}`)\n .join('\\n ');\n return `${title}\\n ${paths}`;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,mBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,kBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,mBAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,kBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA6D,SAAAC,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAQtD,SAASG,wBAAwBA,CACtCC,sBAA8C,EAC9CC,KAA0B,EAClB;EACR,MAAM;IAAEC,YAAY;IAAEC,YAAY;IAAEC;EAAM,C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AAC,IAAI,CACjD,CAAE,EAAC;EACH,MAAMuB,mBAAmB,GAAGF,8BAA8B,CAACE,mBAAmB;EAC9E,MAAMC,KAAK,GAAGD,mBAAmB,CAACE,SAAS,CACxC5B,GAAG,CAAE6B,CAAC,IAAM,KAAI,IAAAP,gBAAQ,EAACvC,KAAK,EAAE8C,CAAC,CAAE,QAAO,IAAAP,gBAAQ,EAACvC,KAAK,EAAE2C,mBAAmB,CAACI,eAAe,CAACT,QAAQ,CAAE,EAAC,CAAC,CAC1GlB,IAAI,CAAC,QAAQ,CAAC;EACjB,OAAQ,GAAEE,KAAM,SAAQsB,KAAM,EAAC;AACjC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["WRITE_TITLE","total","exports","SUMMARY"],"sources":["write-outputs-texts.ts"],"sourcesContent":["export const WRITE_TITLE = (total: number) => `${total} config files added to workspace`;\n\nexport const SUMMARY = `bit writes configuration files in different nested locations in your workspace to meet the configuration needs of different components.\nIDE is now in-sync with component configuration`;\n"],"mappings":";;;;;;AAAO,MAAMA,WAAW,GAAIC,KAAa,IAAM,GAAEA,KAAM,kCAAiC;AAACC,OAAA,CAAAF,WAAA,GAAAA,WAAA;AAElF,MAAMG,OAAO,GAAAD,OAAA,CAAAC,OAAA,GAAI;AACxB,gDAAgD"}
1
+ {"version":3,"names":["WRITE_TITLE","total","exports","SUMMARY"],"sources":["write-outputs-texts.ts"],"sourcesContent":["export const WRITE_TITLE = (total: number) => `${total} config files added to workspace`;\n\nexport const SUMMARY = `bit writes configuration files in different nested locations in your workspace to meet the configuration needs of different components.\nIDE is now in-sync with component configuration`;\n"],"mappings":";;;;;;AAAO,MAAMA,WAAW,GAAIC,KAAa,IAAM,GAAEA,KAAM,kCAAiC;AAACC,OAAA,CAAAF,WAAA,GAAAA,WAAA;AAElF,MAAMG,OAAO,GAAAD,OAAA,CAAAC,OAAA,GAAI;AACxB,gDAAgD","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ ;
2
+ import * as overview_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/b5ea46ec36fa42b9dbedfc12ecb7bb63e03fcfe6/teambit.workspace_workspace-config-files@1.0.190/dist/workspace-config-files.docs.mdx';
3
+
4
+ export const compositions = [];
5
+ export const overview = [overview_0];
6
+
7
+ export const compositions_metadata = {"compositions":[]};
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["workspace-config-env-type.ts"],"sourcesContent":["import { ConfigWriterList } from './config-writer-list';\n\nexport interface WorkspaceConfigEnv {\n /**\n * return a ConfigWriterList instance.\n */\n workspaceConfig?(): ConfigWriterList;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["workspace-config-env-type.ts"],"sourcesContent":["import { ConfigWriterList } from './config-writer-list';\n\nexport interface WorkspaceConfigEnv {\n /**\n * return a ConfigWriterList instance.\n */\n workspaceConfig?(): ConfigWriterList;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_harmony","data","require","WorkspaceConfigFilesAspect","exports","Aspect","create","id"],"sources":["workspace-config-files.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const WorkspaceConfigFilesAspect = Aspect.create({\n id: 'teambit.workspace/workspace-config-files',\n});\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,0BAA0B,GAAAC,OAAA,CAAAD,0BAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EACtDC,EAAE,EAAE;AACN,CAAC,CAAC"}
1
+ {"version":3,"names":["_harmony","data","require","WorkspaceConfigFilesAspect","exports","Aspect","create","id"],"sources":["workspace-config-files.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const WorkspaceConfigFilesAspect = Aspect.create({\n id: 'teambit.workspace/workspace-config-files',\n});\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,0BAA0B,GAAAC,OAAA,CAAAD,0BAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EACtDC,EAAE,EAAE;AACN,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_path","_globby","_chalk","_exceptions","_pMapSeries","_exceptions2","_yesno","_lodash","_cli","_workspace","_envs","_logger","_workspaceConfigFiles","_wsConfig","_writeFailed","_workspaceConfigFiles2","_writers","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","WorkspaceConfigFilesMain","constructor","workspace","envs","logger","config","writeConfigFiles","options","ConsumerNotFound","defaultOpts","clean","dedupe","silent","dryRun","throw","optionsWithDefaults","defaults","execContext","getExecContext","pathsToClean","writeErr","writeResults","calcPathsToClean","writers","write","allWrittenFiles","writersResult","flatMap","writerResult","extendingConfigFiles","extendingConfigFile","filePaths","filter","pathToClean","includes","join","path","deleteFiles","err","info","WriteConfigFilesFailed","cleanResults","wsDir","writeConfigFilesIfEnabled","shouldWrite","isWorkspaceConfigWriteEnabled","undefined","cleanConfigFiles","enableWorkspaceConfigWrite","listConfigWriters","execContexts","result","map","executionContext","configWriters","getConfigWriters","envId","envRuntime","id","groupByWriterId","writerList","reduce","acc","envConfigWriter","forEach","configWriter","push","envsExecutionContext","opts","envCompDirsMap","getEnvComponentsDirsMap","configsRootDir","getConfigsRootDir","writerIdsToEnvEntriesMap","filteredWriterIdsToEnvEntriesMap","pick","totalRealConfigFiles","totalExtendingConfigFiles","results","pMapSeries","entries","writerId","envEntries","oneResult","handleOneIdWriter","totalWrittenFiles","envCompsDirsMap","writtenRealConfigFilesMap","handleRealConfigFiles","writtenExtendingConfigFiles","handleExtendingConfigFiles","writtenRealConfigFiles","values","length","curr","realConfigFiles","userConfiguredDir","getCacheDir","rootDir","components","list","runtime","createEnvironment","getEnvExecutionContext","envExecution","toString","env","paths","c","componentDir","relative","envExecutionContext","workspaceConfig","isFunction","addToEnvsNotImplementing","getFlatConfigWriters","promptForCleaning","filteredConfigWriters","uniq","patterns","currPaths","globby","sync","cwd","dot","onlyFiles","ignore","filteredPaths","fullPath","isBitGenerated","flat","envsNotImplementing","getEnvsNotImplementing","keys","clearStatusLine","ok","yesno","question","chalk","underline","bold","PromptCanceled","Promise","all","f","fs","remove","provider","cli","loggerAspect","createLogger","WorkspaceConfigFilesAspect","registerService","WorkspaceConfigFilesService","workspaceConfigFilesMain","wsConfigCmd","WsConfigCmd","commands","WsConfigWriteCmd","WsConfigCleanCmd","WsConfigListCmd","register","exports","CLIAspect","WorkspaceAspect","EnvsAspect","LoggerAspect","MainRuntime","addRuntime","_default"],"sources":["workspace-config-files.main.runtime.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport { join } from 'path';\nimport globby from 'globby';\nimport chalk from 'chalk';\nimport { PromptCanceled } from '@teambit/legacy/dist/prompts/exceptions';\nimport pMapSeries from 'p-map-series';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport yesno from 'yesno';\nimport { defaults, flatMap, isFunction, pick, uniq } from 'lodash';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport type { Workspace } from '@teambit/workspace';\nimport { Environment, EnvsAspect, ExecutionContext } from '@teambit/envs';\nimport type { EnvsMain } from '@teambit/envs';\nimport { Logger, LoggerAspect } from '@teambit/logger';\nimport type { LoggerMain } from '@teambit/logger';\nimport { WorkspaceConfigFilesAspect } from './workspace-config-files.aspect';\nimport { ConfigWriterEntry } from './config-writer-entry';\nimport { WsConfigCleanCmd, WsConfigCmd, WsConfigListCmd, WsConfigWriteCmd } from './ws-config.cmd';\nimport WriteConfigFilesFailed from './exceptions/write-failed';\nimport { WorkspaceConfigFilesService } from './workspace-config-files.service';\nimport {\n handleRealConfigFiles,\n handleExtendingConfigFiles,\n EnvsWrittenExtendingConfigFiles,\n EnvsWrittenRealConfigFiles,\n} from './writers';\n\n/**\n * Configs that can be configured in the workspace.jsonc file\n */\nexport type WorkspaceConfigFilesAspectConfig = {\n configsRootDir?: string;\n enableWorkspaceConfigWrite?: boolean;\n};\n\nexport type EnvConfigWriter = {\n envId: string;\n executionContext: ExecutionContext;\n configWriters: ConfigWriterEntry[];\n};\n\nexport type EnvConfigWriterEntry = {\n envId: string;\n configWriter: ConfigWriterEntry;\n executionContext: ExecutionContext;\n};\n\ntype WriterIdsToEnvEntriesMap = {\n [writerId: string]: EnvConfigWriterEntry[];\n};\n\nexport type EnvConfigWritersList = Array<EnvConfigWriter>;\n\nexport type CleanConfigFilesOptions = {\n silent?: boolean; // no prompt\n dryRun?: boolean;\n writers?: string[];\n};\n\nexport type WriteConfigFilesOptions = {\n clean?: boolean;\n silent?: boolean; // no prompt\n dedupe?: boolean;\n dryRun?: boolean;\n throw?: boolean;\n writers?: string[];\n};\n\nexport type CompPathExtendingHashMap = { [compPath: string]: string };\n\nexport type EnvMapValue = { env: Environment; id: string[]; paths: string[] };\nexport type EnvCompsDirsMap = { [envId: string]: EnvMapValue };\n\nexport type OneConfigWriterIdResult = {\n writerId: string;\n totalWrittenFiles: number;\n realConfigFiles: EnvsWrittenRealConfigFiles;\n totalRealConfigFiles: number;\n extendingConfigFiles: EnvsWrittenExtendingConfigFiles;\n totalExtendingConfigFiles: number;\n};\n\nexport type WriteResults = {\n writersResult: OneConfigWriterIdResult[];\n totalWrittenFiles: number;\n totalRealConfigFiles: number;\n totalExtendingConfigFiles: number;\n};\n\nexport type WriteConfigFilesResult = {\n cleanResults?: string[];\n writeResults: WriteResults;\n wsDir: string;\n err?: Error;\n};\n\nexport class WorkspaceConfigFilesMain {\n private envsNotImplementing = {};\n\n constructor(\n private workspace: Workspace,\n private envs: EnvsMain,\n private logger: Logger,\n private config: WorkspaceConfigFilesAspectConfig\n ) {}\n\n /**\n * It writes the configuration files for the workspace\n * for example: tsconfig, eslint config and prettier config files.\n * @param {WriteConfigFilesOptions} options - WriteConfigFilesOptions = {}\n * @returns An object with the following properties:\n * - writeResults: An object with the following properties:\n * - aspectsWritersResults: An array of objects with the following properties:\n * - aspect: The aspect that was written\n * - totalWrittenFiles: The number of files that were written\n * - totalWrittenFiles: The total number of files that were written\n * - cleanResults: array of deleted paths\n */\n async writeConfigFiles(options: WriteConfigFilesOptions = {}): Promise<WriteConfigFilesResult> {\n if (!this.workspace) {\n throw new ConsumerNotFound();\n }\n const defaultOpts: WriteConfigFilesOptions = {\n clean: false,\n dedupe: false,\n silent: false,\n dryRun: false,\n throw: true,\n };\n const optionsWithDefaults = defaults(options, defaultOpts);\n const execContext = await this.getExecContext();\n\n let pathsToClean: string[] | undefined = [];\n let writeErr;\n let writeResults;\n try {\n if (optionsWithDefaults.clean) {\n pathsToClean = await this.calcPathsToClean({ writers: optionsWithDefaults.writers });\n }\n\n writeResults = await this.write(execContext, optionsWithDefaults);\n const allWrittenFiles = writeResults.writersResult.flatMap((writerResult) => {\n return writerResult.extendingConfigFiles.flatMap((extendingConfigFile) => {\n return extendingConfigFile.extendingConfigFile.filePaths;\n });\n });\n // Avoid delete and re-create files that were written by other config writers\n // instead of deleting at the beginning then write all\n // we write all and then delete the files that were not written by the config writers\n // This reduces the config files that re-created (as many times no changes needed)\n // which prevent issues with needing to restart the ts-server in the ide\n pathsToClean = pathsToClean.filter(\n (pathToClean) => !allWrittenFiles.includes(join(this.workspace.path, pathToClean))\n );\n await this.deleteFiles(pathsToClean);\n } catch (err) {\n this.logger.info('writeConfigFiles failed', err);\n if (optionsWithDefaults.throw) {\n throw new WriteConfigFilesFailed();\n }\n writeErr = err;\n }\n\n return { writeResults, cleanResults: pathsToClean, wsDir: this.workspace.path, err: writeErr };\n }\n\n /**\n * This will check the config.enableWorkspaceConfigWrite before writing the config files.\n */\n async writeConfigFilesIfEnabled(options: WriteConfigFilesOptions = {}): Promise<WriteConfigFilesResult | undefined> {\n const shouldWrite = this.isWorkspaceConfigWriteEnabled();\n if (!shouldWrite) return undefined;\n return this.writeConfigFiles(options);\n }\n\n /**\n * It cleans (delete) the config files from the workspace.\n * This will check each file and will only delete it in case it was generated by bit\n * @param {CleanConfigFilesOptions} options - CleanConfigFilesOptions = {}\n * @returns An array of strings.\n */\n async cleanConfigFiles(options: CleanConfigFilesOptions = {}): Promise<string[]> {\n // const execContext = await this.getExecContext();\n if (!this.workspace) {\n throw new ConsumerNotFound();\n }\n const cleanResults = await this.clean(options);\n return cleanResults;\n }\n\n /**\n * The function checks if the auto writing of workspace configuration is enabled.\n * if it's enabled we will re-generate the configuration files upon bit create\n * @returns the boolean value of `!!this.config.enableWorkspaceConfigWrite`.\n */\n isWorkspaceConfigWriteEnabled() {\n return !!this.config.enableWorkspaceConfigWrite;\n }\n\n /**\n * It returns a list of all the config writers that have been registered with the config writer slot\n * @returns An array of objects with aspectId and configWriter properties.\n */\n async listConfigWriters(): Promise<EnvConfigWritersList> {\n if (!this.workspace) {\n throw new ConsumerNotFound();\n }\n const execContexts = await this.getExecContext();\n\n const result: EnvConfigWritersList = execContexts.map((executionContext) => {\n const configWriters = this.getConfigWriters(executionContext);\n return { envId: executionContext.envRuntime.id, executionContext, configWriters };\n });\n return result;\n }\n\n private groupByWriterId(writerList: EnvConfigWritersList): WriterIdsToEnvEntriesMap {\n return writerList.reduce((acc, envConfigWriter: EnvConfigWriter) => {\n envConfigWriter.configWriters.forEach((configWriter: ConfigWriterEntry) => {\n acc[configWriter.id] = acc[configWriter.id] || [];\n acc[configWriter.id].push({ configWriter, envId: envConfigWriter.envId });\n });\n return acc;\n }, {});\n }\n\n private async write(envsExecutionContext: ExecutionContext[], opts: WriteConfigFilesOptions): Promise<WriteResults> {\n const envCompDirsMap = this.getEnvComponentsDirsMap(envsExecutionContext);\n const configsRootDir = this.getConfigsRootDir();\n const configWriters = await this.listConfigWriters();\n const writerIdsToEnvEntriesMap = this.groupByWriterId(configWriters);\n const filteredWriterIdsToEnvEntriesMap = opts.writers\n ? pick(writerIdsToEnvEntriesMap, opts.writers)\n : writerIdsToEnvEntriesMap;\n let totalRealConfigFiles = 0;\n let totalExtendingConfigFiles = 0;\n const results = await pMapSeries(\n Object.entries(filteredWriterIdsToEnvEntriesMap),\n async ([writerId, envEntries]) => {\n const oneResult = await this.handleOneIdWriter(writerId, envEntries, envCompDirsMap, configsRootDir, opts);\n totalRealConfigFiles += oneResult.totalRealConfigFiles;\n totalExtendingConfigFiles += oneResult.totalExtendingConfigFiles;\n return oneResult;\n }\n );\n\n const totalWrittenFiles = totalRealConfigFiles + totalExtendingConfigFiles;\n return { writersResult: results, totalWrittenFiles, totalRealConfigFiles, totalExtendingConfigFiles };\n }\n\n private async handleOneIdWriter(\n writerId: string,\n envEntries: EnvConfigWriterEntry[],\n envCompsDirsMap: EnvCompsDirsMap,\n configsRootDir: string,\n opts: WriteConfigFilesOptions\n ): Promise<OneConfigWriterIdResult> {\n const writtenRealConfigFilesMap = await handleRealConfigFiles(\n envEntries,\n envCompsDirsMap,\n configsRootDir,\n this.workspace.path,\n opts\n );\n const writtenExtendingConfigFiles = await handleExtendingConfigFiles(\n envEntries,\n envCompsDirsMap,\n writtenRealConfigFilesMap,\n configsRootDir,\n this.workspace.path,\n opts\n );\n\n const writtenRealConfigFiles = Object.values(writtenRealConfigFilesMap);\n const totalRealConfigFiles = writtenRealConfigFiles.length;\n const totalExtendingConfigFiles = writtenExtendingConfigFiles.reduce(\n (acc, curr) => acc + curr.extendingConfigFile.filePaths.length,\n 0\n );\n const totalWrittenFiles = totalRealConfigFiles + totalExtendingConfigFiles;\n return {\n writerId,\n totalWrittenFiles,\n realConfigFiles: writtenRealConfigFiles,\n totalRealConfigFiles,\n extendingConfigFiles: writtenExtendingConfigFiles,\n totalExtendingConfigFiles,\n };\n }\n\n private getConfigsRootDir(): string {\n const userConfiguredDir = this.config.configsRootDir;\n return userConfiguredDir ? join(this.workspace.path, userConfiguredDir) : this.getCacheDir(this.workspace.path);\n }\n\n private getCacheDir(rootDir): string {\n return join(rootDir, 'node_modules', '.cache');\n }\n\n private async getExecContext(): Promise<ExecutionContext[]> {\n const components = await this.workspace.list();\n const runtime = await this.envs.createEnvironment(components);\n const execContext = runtime.getEnvExecutionContext();\n return execContext;\n }\n\n private getEnvComponentsDirsMap(envsExecutionContext: ExecutionContext[]): EnvCompsDirsMap {\n const envCompDirsMap = envsExecutionContext.reduce((acc, envExecution) => {\n const envRuntime = envExecution.envRuntime;\n const envId = envRuntime.id.toString();\n const value = {\n id: envRuntime.id,\n env: envRuntime.env,\n paths: envRuntime.components.map((c) => this.workspace.componentDir(c.id, undefined, { relative: true })),\n };\n acc[envId] = value;\n return acc;\n }, {});\n return envCompDirsMap;\n }\n\n private getConfigWriters(envExecutionContext: ExecutionContext): ConfigWriterEntry[] {\n if (envExecutionContext.env.workspaceConfig && isFunction(envExecutionContext.env.workspaceConfig)) {\n return envExecutionContext.env.workspaceConfig();\n }\n this.addToEnvsNotImplementing(envExecutionContext.env.id);\n return [];\n }\n\n private getFlatConfigWriters(envsExecutionContext: ExecutionContext[]): ConfigWriterEntry[] {\n return flatMap(envsExecutionContext, (envExecutionContext) => {\n return this.getConfigWriters(envExecutionContext);\n });\n }\n\n /**\n * Clean config files written by the config-writers\n * @param envsExecutionContext\n * @param param1\n * @returns Array of paths of deleted config files\n */\n async clean({ dryRun, silent, writers }: WriteConfigFilesOptions): Promise<string[]> {\n const paths = await this.calcPathsToClean({ writers });\n if (dryRun) return paths;\n if (!silent) await this.promptForCleaning(paths);\n await this.deleteFiles(paths);\n return paths;\n }\n\n private async calcPathsToClean({ writers }: WriteConfigFilesOptions): Promise<string[]> {\n const execContext = await this.getExecContext();\n const configWriters = this.getFlatConfigWriters(execContext);\n const filteredConfigWriters = writers\n ? configWriters.filter((configWriter) => writers.includes(configWriter.id))\n : configWriters;\n\n const paths = uniq(\n filteredConfigWriters\n .map((configWriter) => {\n const patterns = configWriter.patterns;\n const currPaths = globby.sync(patterns, {\n cwd: this.workspace.path,\n dot: true,\n onlyFiles: true,\n ignore: ['**/node_modules/**'],\n });\n const filteredPaths = currPaths.filter((path) => {\n const fullPath = join(this.workspace.path, path);\n return configWriter.isBitGenerated ? configWriter.isBitGenerated(fullPath) : true;\n });\n return filteredPaths;\n })\n .flat()\n );\n return paths;\n }\n\n private addToEnvsNotImplementing(envId: string) {\n this.envsNotImplementing[envId] = true;\n }\n\n getEnvsNotImplementing() {\n return Object.keys(this.envsNotImplementing);\n }\n\n private async promptForCleaning(paths: string[]) {\n this.logger.clearStatusLine();\n const ok = await yesno({\n question: `${chalk.underline('The following files will be deleted:')}\n${paths.join('\\n')}\n${chalk.bold('Do you want to continue? [yes(y)/no(n)]')}`,\n });\n if (!ok) {\n throw new PromptCanceled();\n }\n }\n\n private async deleteFiles(paths: string[]) {\n await Promise.all(paths.map((f) => fs.remove(join(this.workspace.path, f))));\n }\n\n static slots = [];\n // define your aspect dependencies here.\n // in case you need to use another aspect API.\n static dependencies = [CLIAspect, WorkspaceAspect, EnvsAspect, LoggerAspect];\n\n static runtime = MainRuntime;\n\n static defaultConfig: Partial<WorkspaceConfigFilesAspectConfig> = {\n enableWorkspaceConfigWrite: false,\n };\n\n static async provider(\n [cli, workspace, envs, loggerAspect]: [CLIMain, Workspace, EnvsMain, LoggerMain],\n config: WorkspaceConfigFilesAspectConfig\n ) {\n const logger = loggerAspect.createLogger(WorkspaceConfigFilesAspect.id);\n envs.registerService(new WorkspaceConfigFilesService(logger));\n\n const workspaceConfigFilesMain = new WorkspaceConfigFilesMain(workspace, envs, logger, config);\n const wsConfigCmd = new WsConfigCmd();\n wsConfigCmd.commands = [\n new WsConfigWriteCmd(workspaceConfigFilesMain),\n new WsConfigCleanCmd(workspaceConfigFilesMain),\n new WsConfigListCmd(workspaceConf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AAW,EAAC,CAAC;IACrCD,WAAW,CAACE,QAAQ,GAAG,CACrB,KAAIC,4BAAgB,EAACJ,wBAAwB,CAAC,EAC9C,KAAIK,4BAAgB,EAACL,wBAAwB,CAAC,EAC9C,KAAIM,2BAAe,EAACN,wBAAwB,CAAC,CAC9C;IACDN,GAAG,CAACa,QAAQ,CAACN,WAAW,CAAC;IACzB,OAAOD,wBAAwB;EACjC;AACF;AAACQ,OAAA,CAAAlK,wBAAA,GAAAA,wBAAA;AAAApB,eAAA,CA7UYoB,wBAAwB,WAiTpB,EAAE;AACjB;AACA;AAAApB,eAAA,CAnTWoB,wBAAwB,kBAoTb,CAACmK,gBAAS,EAAEC,4BAAe,EAAEC,kBAAU,EAAEC,sBAAY,CAAC;AAAA1L,eAAA,CApTjEoB,wBAAwB,aAsTlBuK,kBAAW;AAAA3L,eAAA,CAtTjBoB,wBAAwB,mBAwT+B;EAChEgD,0BAA0B,EAAE;AAC9B,CAAC;AAqBHuG,kDAA0B,CAACiB,UAAU,CAACxK,wBAAwB,CAAC;AAAC,IAAAyK,QAAA,GAAAP,OAAA,CAAAvL,OAAA,GAEjDqB,wBAAwB"}
1
+ {"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_path","_globby","_chalk","_exceptions","_pMapSeries","_exceptions2","_yesno","_lodash","_cli","_workspace","_envs","_logger","_workspaceConfigFiles","_wsConfig","_writeFailed","_workspaceConfigFiles2","_writers","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","WorkspaceConfigFilesMain","constructor","workspace","envs","logger","config","writeConfigFiles","options","ConsumerNotFound","defaultOpts","clean","dedupe","silent","dryRun","throw","optionsWithDefaults","defaults","execContext","getExecContext","pathsToClean","writeErr","writeResults","calcPathsToClean","writers","write","allWrittenFiles","writersResult","flatMap","writerResult","extendingConfigFiles","extendingConfigFile","filePaths","filter","pathToClean","includes","join","path","deleteFiles","err","info","WriteConfigFilesFailed","cleanResults","wsDir","writeConfigFilesIfEnabled","shouldWrite","isWorkspaceConfigWriteEnabled","undefined","cleanConfigFiles","enableWorkspaceConfigWrite","listConfigWriters","execContexts","result","map","executionContext","configWriters","getConfigWriters","envId","envRuntime","id","groupByWriterId","writerList","reduce","acc","envConfigWriter","forEach","configWriter","push","envsExecutionContext","opts","envCompDirsMap","getEnvComponentsDirsMap","configsRootDir","getConfigsRootDir","writerIdsToEnvEntriesMap","filteredWriterIdsToEnvEntriesMap","pick","totalRealConfigFiles","totalExtendingConfigFiles","results","pMapSeries","entries","writerId","envEntries","oneResult","handleOneIdWriter","totalWrittenFiles","envCompsDirsMap","writtenRealConfigFilesMap","handleRealConfigFiles","writtenExtendingConfigFiles","handleExtendingConfigFiles","writtenRealConfigFiles","values","length","curr","realConfigFiles","userConfiguredDir","getCacheDir","rootDir","components","list","runtime","createEnvironment","getEnvExecutionContext","envExecution","toString","env","paths","c","componentDir","relative","envExecutionContext","workspaceConfig","isFunction","addToEnvsNotImplementing","getFlatConfigWriters","promptForCleaning","filteredConfigWriters","uniq","patterns","currPaths","globby","sync","cwd","dot","onlyFiles","ignore","filteredPaths","fullPath","isBitGenerated","flat","envsNotImplementing","getEnvsNotImplementing","keys","clearStatusLine","ok","yesno","question","chalk","underline","bold","PromptCanceled","Promise","all","f","fs","remove","provider","cli","loggerAspect","createLogger","WorkspaceConfigFilesAspect","registerService","WorkspaceConfigFilesService","workspaceConfigFilesMain","wsConfigCmd","WsConfigCmd","commands","WsConfigWriteCmd","WsConfigCleanCmd","WsConfigListCmd","register","exports","CLIAspect","WorkspaceAspect","EnvsAspect","LoggerAspect","MainRuntime","addRuntime","_default"],"sources":["workspace-config-files.main.runtime.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport { join } from 'path';\nimport globby from 'globby';\nimport chalk from 'chalk';\nimport { PromptCanceled } from '@teambit/legacy/dist/prompts/exceptions';\nimport pMapSeries from 'p-map-series';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport yesno from 'yesno';\nimport { defaults, flatMap, isFunction, pick, uniq } from 'lodash';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport type { Workspace } from '@teambit/workspace';\nimport { Environment, EnvsAspect, ExecutionContext } from '@teambit/envs';\nimport type { EnvsMain } from '@teambit/envs';\nimport { Logger, LoggerAspect } from '@teambit/logger';\nimport type { LoggerMain } from '@teambit/logger';\nimport { WorkspaceConfigFilesAspect } from './workspace-config-files.aspect';\nimport { ConfigWriterEntry } from './config-writer-entry';\nimport { WsConfigCleanCmd, WsConfigCmd, WsConfigListCmd, WsConfigWriteCmd } from './ws-config.cmd';\nimport WriteConfigFilesFailed from './exceptions/write-failed';\nimport { WorkspaceConfigFilesService } from './workspace-config-files.service';\nimport {\n handleRealConfigFiles,\n handleExtendingConfigFiles,\n EnvsWrittenExtendingConfigFiles,\n EnvsWrittenRealConfigFiles,\n} from './writers';\n\n/**\n * Configs that can be configured in the workspace.jsonc file\n */\nexport type WorkspaceConfigFilesAspectConfig = {\n configsRootDir?: string;\n enableWorkspaceConfigWrite?: boolean;\n};\n\nexport type EnvConfigWriter = {\n envId: string;\n executionContext: ExecutionContext;\n configWriters: ConfigWriterEntry[];\n};\n\nexport type EnvConfigWriterEntry = {\n envId: string;\n configWriter: ConfigWriterEntry;\n executionContext: ExecutionContext;\n};\n\ntype WriterIdsToEnvEntriesMap = {\n [writerId: string]: EnvConfigWriterEntry[];\n};\n\nexport type EnvConfigWritersList = Array<EnvConfigWriter>;\n\nexport type CleanConfigFilesOptions = {\n silent?: boolean; // no prompt\n dryRun?: boolean;\n writers?: string[];\n};\n\nexport type WriteConfigFilesOptions = {\n clean?: boolean;\n silent?: boolean; // no prompt\n dedupe?: boolean;\n dryRun?: boolean;\n throw?: boolean;\n writers?: string[];\n};\n\nexport type CompPathExtendingHashMap = { [compPath: string]: string };\n\nexport type EnvMapValue = { env: Environment; id: string[]; paths: string[] };\nexport type EnvCompsDirsMap = { [envId: string]: EnvMapValue };\n\nexport type OneConfigWriterIdResult = {\n writerId: string;\n totalWrittenFiles: number;\n realConfigFiles: EnvsWrittenRealConfigFiles;\n totalRealConfigFiles: number;\n extendingConfigFiles: EnvsWrittenExtendingConfigFiles;\n totalExtendingConfigFiles: number;\n};\n\nexport type WriteResults = {\n writersResult: OneConfigWriterIdResult[];\n totalWrittenFiles: number;\n totalRealConfigFiles: number;\n totalExtendingConfigFiles: number;\n};\n\nexport type WriteConfigFilesResult = {\n cleanResults?: string[];\n writeResults: WriteResults;\n wsDir: string;\n err?: Error;\n};\n\nexport class WorkspaceConfigFilesMain {\n private envsNotImplementing = {};\n\n constructor(\n private workspace: Workspace,\n private envs: EnvsMain,\n private logger: Logger,\n private config: WorkspaceConfigFilesAspectConfig\n ) {}\n\n /**\n * It writes the configuration files for the workspace\n * for example: tsconfig, eslint config and prettier config files.\n * @param {WriteConfigFilesOptions} options - WriteConfigFilesOptions = {}\n * @returns An object with the following properties:\n * - writeResults: An object with the following properties:\n * - aspectsWritersResults: An array of objects with the following properties:\n * - aspect: The aspect that was written\n * - totalWrittenFiles: The number of files that were written\n * - totalWrittenFiles: The total number of files that were written\n * - cleanResults: array of deleted paths\n */\n async writeConfigFiles(options: WriteConfigFilesOptions = {}): Promise<WriteConfigFilesResult> {\n if (!this.workspace) {\n throw new ConsumerNotFound();\n }\n const defaultOpts: WriteConfigFilesOptions = {\n clean: false,\n dedupe: false,\n silent: false,\n dryRun: false,\n throw: true,\n };\n const optionsWithDefaults = defaults(options, defaultOpts);\n const execContext = await this.getExecContext();\n\n let pathsToClean: string[] | undefined = [];\n let writeErr;\n let writeResults;\n try {\n if (optionsWithDefaults.clean) {\n pathsToClean = await this.calcPathsToClean({ writers: optionsWithDefaults.writers });\n }\n\n writeResults = await this.write(execContext, optionsWithDefaults);\n const allWrittenFiles = writeResults.writersResult.flatMap((writerResult) => {\n return writerResult.extendingConfigFiles.flatMap((extendingConfigFile) => {\n return extendingConfigFile.extendingConfigFile.filePaths;\n });\n });\n // Avoid delete and re-create files that were written by other config writers\n // instead of deleting at the beginning then write all\n // we write all and then delete the files that were not written by the config writers\n // This reduces the config files that re-created (as many times no changes needed)\n // which prevent issues with needing to restart the ts-server in the ide\n pathsToClean = pathsToClean.filter(\n (pathToClean) => !allWrittenFiles.includes(join(this.workspace.path, pathToClean))\n );\n await this.deleteFiles(pathsToClean);\n } catch (err) {\n this.logger.info('writeConfigFiles failed', err);\n if (optionsWithDefaults.throw) {\n throw new WriteConfigFilesFailed();\n }\n writeErr = err;\n }\n\n return { writeResults, cleanResults: pathsToClean, wsDir: this.workspace.path, err: writeErr };\n }\n\n /**\n * This will check the config.enableWorkspaceConfigWrite before writing the config files.\n */\n async writeConfigFilesIfEnabled(options: WriteConfigFilesOptions = {}): Promise<WriteConfigFilesResult | undefined> {\n const shouldWrite = this.isWorkspaceConfigWriteEnabled();\n if (!shouldWrite) return undefined;\n return this.writeConfigFiles(options);\n }\n\n /**\n * It cleans (delete) the config files from the workspace.\n * This will check each file and will only delete it in case it was generated by bit\n * @param {CleanConfigFilesOptions} options - CleanConfigFilesOptions = {}\n * @returns An array of strings.\n */\n async cleanConfigFiles(options: CleanConfigFilesOptions = {}): Promise<string[]> {\n // const execContext = await this.getExecContext();\n if (!this.workspace) {\n throw new ConsumerNotFound();\n }\n const cleanResults = await this.clean(options);\n return cleanResults;\n }\n\n /**\n * The function checks if the auto writing of workspace configuration is enabled.\n * if it's enabled we will re-generate the configuration files upon bit create\n * @returns the boolean value of `!!this.config.enableWorkspaceConfigWrite`.\n */\n isWorkspaceConfigWriteEnabled() {\n return !!this.config.enableWorkspaceConfigWrite;\n }\n\n /**\n * It returns a list of all the config writers that have been registered with the config writer slot\n * @returns An array of objects with aspectId and configWriter properties.\n */\n async listConfigWriters(): Promise<EnvConfigWritersList> {\n if (!this.workspace) {\n throw new ConsumerNotFound();\n }\n const execContexts = await this.getExecContext();\n\n const result: EnvConfigWritersList = execContexts.map((executionContext) => {\n const configWriters = this.getConfigWriters(executionContext);\n return { envId: executionContext.envRuntime.id, executionContext, configWriters };\n });\n return result;\n }\n\n private groupByWriterId(writerList: EnvConfigWritersList): WriterIdsToEnvEntriesMap {\n return writerList.reduce((acc, envConfigWriter: EnvConfigWriter) => {\n envConfigWriter.configWriters.forEach((configWriter: ConfigWriterEntry) => {\n acc[configWriter.id] = acc[configWriter.id] || [];\n acc[configWriter.id].push({ configWriter, envId: envConfigWriter.envId });\n });\n return acc;\n }, {});\n }\n\n private async write(envsExecutionContext: ExecutionContext[], opts: WriteConfigFilesOptions): Promise<WriteResults> {\n const envCompDirsMap = this.getEnvComponentsDirsMap(envsExecutionContext);\n const configsRootDir = this.getConfigsRootDir();\n const configWriters = await this.listConfigWriters();\n const writerIdsToEnvEntriesMap = this.groupByWriterId(configWriters);\n const filteredWriterIdsToEnvEntriesMap = opts.writers\n ? pick(writerIdsToEnvEntriesMap, opts.writers)\n : writerIdsToEnvEntriesMap;\n let totalRealConfigFiles = 0;\n let totalExtendingConfigFiles = 0;\n const results = await pMapSeries(\n Object.entries(filteredWriterIdsToEnvEntriesMap),\n async ([writerId, envEntries]) => {\n const oneResult = await this.handleOneIdWriter(writerId, envEntries, envCompDirsMap, configsRootDir, opts);\n totalRealConfigFiles += oneResult.totalRealConfigFiles;\n totalExtendingConfigFiles += oneResult.totalExtendingConfigFiles;\n return oneResult;\n }\n );\n\n const totalWrittenFiles = totalRealConfigFiles + totalExtendingConfigFiles;\n return { writersResult: results, totalWrittenFiles, totalRealConfigFiles, totalExtendingConfigFiles };\n }\n\n private async handleOneIdWriter(\n writerId: string,\n envEntries: EnvConfigWriterEntry[],\n envCompsDirsMap: EnvCompsDirsMap,\n configsRootDir: string,\n opts: WriteConfigFilesOptions\n ): Promise<OneConfigWriterIdResult> {\n const writtenRealConfigFilesMap = await handleRealConfigFiles(\n envEntries,\n envCompsDirsMap,\n configsRootDir,\n this.workspace.path,\n opts\n );\n const writtenExtendingConfigFiles = await handleExtendingConfigFiles(\n envEntries,\n envCompsDirsMap,\n writtenRealConfigFilesMap,\n configsRootDir,\n this.workspace.path,\n opts\n );\n\n const writtenRealConfigFiles = Object.values(writtenRealConfigFilesMap);\n const totalRealConfigFiles = writtenRealConfigFiles.length;\n const totalExtendingConfigFiles = writtenExtendingConfigFiles.reduce(\n (acc, curr) => acc + curr.extendingConfigFile.filePaths.length,\n 0\n );\n const totalWrittenFiles = totalRealConfigFiles + totalExtendingConfigFiles;\n return {\n writerId,\n totalWrittenFiles,\n realConfigFiles: writtenRealConfigFiles,\n totalRealConfigFiles,\n extendingConfigFiles: writtenExtendingConfigFiles,\n totalExtendingConfigFiles,\n };\n }\n\n private getConfigsRootDir(): string {\n const userConfiguredDir = this.config.configsRootDir;\n return userConfiguredDir ? join(this.workspace.path, userConfiguredDir) : this.getCacheDir(this.workspace.path);\n }\n\n private getCacheDir(rootDir): string {\n return join(rootDir, 'node_modules', '.cache');\n }\n\n private async getExecContext(): Promise<ExecutionContext[]> {\n const components = await this.workspace.list();\n const runtime = await this.envs.createEnvironment(components);\n const execContext = runtime.getEnvExecutionContext();\n return execContext;\n }\n\n private getEnvComponentsDirsMap(envsExecutionContext: ExecutionContext[]): EnvCompsDirsMap {\n const envCompDirsMap = envsExecutionContext.reduce((acc, envExecution) => {\n const envRuntime = envExecution.envRuntime;\n const envId = envRuntime.id.toString();\n const value = {\n id: envRuntime.id,\n env: envRuntime.env,\n paths: envRuntime.components.map((c) => this.workspace.componentDir(c.id, undefined, { relative: true })),\n };\n acc[envId] = value;\n return acc;\n }, {});\n return envCompDirsMap;\n }\n\n private getConfigWriters(envExecutionContext: ExecutionContext): ConfigWriterEntry[] {\n if (envExecutionContext.env.workspaceConfig && isFunction(envExecutionContext.env.workspaceConfig)) {\n return envExecutionContext.env.workspaceConfig();\n }\n this.addToEnvsNotImplementing(envExecutionContext.env.id);\n return [];\n }\n\n private getFlatConfigWriters(envsExecutionContext: ExecutionContext[]): ConfigWriterEntry[] {\n return flatMap(envsExecutionContext, (envExecutionContext) => {\n return this.getConfigWriters(envExecutionContext);\n });\n }\n\n /**\n * Clean config files written by the config-writers\n * @param envsExecutionContext\n * @param param1\n * @returns Array of paths of deleted config files\n */\n async clean({ dryRun, silent, writers }: WriteConfigFilesOptions): Promise<string[]> {\n const paths = await this.calcPathsToClean({ writers });\n if (dryRun) return paths;\n if (!silent) await this.promptForCleaning(paths);\n await this.deleteFiles(paths);\n return paths;\n }\n\n private async calcPathsToClean({ writers }: WriteConfigFilesOptions): Promise<string[]> {\n const execContext = await this.getExecContext();\n const configWriters = this.getFlatConfigWriters(execContext);\n const filteredConfigWriters = writers\n ? configWriters.filter((configWriter) => writers.includes(configWriter.id))\n : configWriters;\n\n const paths = uniq(\n filteredConfigWriters\n .map((configWriter) => {\n const patterns = configWriter.patterns;\n const currPaths = globby.sync(patterns, {\n cwd: this.workspace.path,\n dot: true,\n onlyFiles: true,\n ignore: ['**/node_modules/**'],\n });\n const filteredPaths = currPaths.filter((path) => {\n const fullPath = join(this.workspace.path, path);\n return configWriter.isBitGenerated ? configWriter.isBitGenerated(fullPath) : true;\n });\n return filteredPaths;\n })\n .flat()\n );\n return paths;\n }\n\n private addToEnvsNotImplementing(envId: string) {\n this.envsNotImplementing[envId] = true;\n }\n\n getEnvsNotImplementing() {\n return Object.keys(this.envsNotImplementing);\n }\n\n private async promptForCleaning(paths: string[]) {\n this.logger.clearStatusLine();\n const ok = await yesno({\n question: `${chalk.underline('The following files will be deleted:')}\n${paths.join('\\n')}\n${chalk.bold('Do you want to continue? [yes(y)/no(n)]')}`,\n });\n if (!ok) {\n throw new PromptCanceled();\n }\n }\n\n private async deleteFiles(paths: string[]) {\n await Promise.all(paths.map((f) => fs.remove(join(this.workspace.path, f))));\n }\n\n static slots = [];\n // define your aspect dependencies here.\n // in case you need to use another aspect API.\n static dependencies = [CLIAspect, WorkspaceAspect, EnvsAspect, LoggerAspect];\n\n static runtime = MainRuntime;\n\n static defaultConfig: Partial<WorkspaceConfigFilesAspectConfig> = {\n enableWorkspaceConfigWrite: false,\n };\n\n static async provider(\n [cli, workspace, envs, loggerAspect]: [CLIMain, Workspace, EnvsMain, LoggerMain],\n config: WorkspaceConfigFilesAspectConfig\n ) {\n const logger = loggerAspect.createLogger(WorkspaceConfigFilesAspect.id);\n envs.registerService(new WorkspaceConfigFilesService(logger));\n\n const workspaceConfigFilesMain = new WorkspaceConfigFilesMain(workspace, envs, logger, config);\n const wsConfigCmd = new WsConfigCmd();\n wsConfigCmd.commands = [\n new WsConfigWriteCmd(workspaceConfigFilesMain),\n new WsConfigCleanCmd(workspaceConfigFilesMain),\n new WsConfigListCmd(workspaceConfigFilesMain),\n ];\n cli.register(wsConfigCmd);\n return workspaceConfigFilesMain;\n }\n}\n\nWorkspaceConfigFilesAspect.addRuntime(WorkspaceConfigFilesMain);\n\nexport default WorkspaceConfigFilesMain;\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,YAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,WAAA,YAAAA,CAAA;IAAA,O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","envContext","workspaceConfig","undefined","configWriterList","compute","Array","isArray","length","calcConfigFiles","exports"],"sources":["workspace-config-files.service.tsx"],"sourcesContent":["import { Logger } from '@teambit/logger';\nimport { EnvService, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs';\nimport { ConfigWriterList } from './config-writer-list';\nimport { ConfigWriterEntry } from './config-writer-entry';\n\nexport type PkgDescriptor = {\n id: string;\n displayName: string;\n config?: string;\n};\n\ntype PkgTransformationMap = ServiceTransformationMap & {\n workspaceConfig: () => ConfigWriterEntry[];\n};\n\nexport class WorkspaceConfigFilesService implements EnvService<any> {\n name = 'WorkspaceConfigFiles';\n\n constructor(private logger: Logger) {}\n\n transform(env: Env, envContext: EnvContext): PkgTransformationMap | undefined {\n // Old env\n if (!env?.workspaceConfig) {\n return undefined;\n }\n\n return {\n workspaceConfig: () => {\n const configWriterList: ConfigWriterList = env.workspaceConfig();\n if (!configWriterList) return [];\n if (!configWriterList.compute) {\n // This is a core env that doesn't use the ConfigWriterList but create the\n // ConfigWriterEntry directly.\n if (\n Array.isArray(configWriterList) &&\n configWriterList.length > 0 &&\n typeof configWriterList[0].calcConfigFiles === 'function'\n ) {\n return configWriterList;\n }\n return [];\n }\n return configWriterList?.compute(envContext);\n },\n };\n }\n}\n"],"mappings":";;;;;;;;;AAeO,MAAMA,2BAA2B,CAA4B;EAGlEC,WAAWA,CAASC,MAAc,EAAE;IAAA,KAAhBA,MAAc,GAAdA,MAAc;IAAAC,eAAA,eAF3B,sBAAsB;EAEQ;EAErCC,SAASA,CAACC,GAAQ,EAAEC,UAAsB,EAAoC;IAC5E;IACA,IAAI,CAACD,GAAG,EAAEE,eAAe,EAAE;MACzB,OAAOC,SAAS;IAClB;IAEA,OAAO;MACLD,eAAe,EAAEA,CAAA,KAAM;QACrB,MAAME,gBAAkC,GAAGJ,GAAG,CAACE,eAAe,CAAC,CAAC;QAChE,IAAI,CAACE,gBAAgB,EAAE,OAAO,EAAE;QAChC,IAAI,CAACA,gBAAgB,CAACC,OAAO,EAAE;UAC7B;UACA;UACA,IACEC,KAAK,CAACC,OAAO,CAACH,gBAAgB,CAAC,IAC/BA,gBAAgB,CAACI,MAAM,GAAG,CAAC,IAC3B,OAAOJ,gBAAgB,CAAC,CAAC,CAAC,CAACK,eAAe,KAAK,UAAU,EACzD;YACA,OAAOL,gBAAgB;UACzB;UACA,OAAO,EAAE;QACX;QACA,OAAOA,gBAAgB,EAAEC,OAAO,CAACJ,UAAU,CAAC;MAC9C;IACF,CAAC;EACH;AACF;AAACS,OAAA,CAAAf,2BAAA,GAAAA,2BAAA"}
1
+ {"version":3,"names":["WorkspaceConfigFilesService","constructor","logger","_defineProperty","transform","env","envContext","workspaceConfig","undefined","configWriterList","compute","Array","isArray","length","calcConfigFiles","exports"],"sources":["workspace-config-files.service.tsx"],"sourcesContent":["import { Logger } from '@teambit/logger';\nimport { EnvService, Env, EnvContext, ServiceTransformationMap } from '@teambit/envs';\nimport { ConfigWriterList } from './config-writer-list';\nimport { ConfigWriterEntry } from './config-writer-entry';\n\nexport type PkgDescriptor = {\n id: string;\n displayName: string;\n config?: string;\n};\n\ntype PkgTransformationMap = ServiceTransformationMap & {\n workspaceConfig: () => ConfigWriterEntry[];\n};\n\nexport class WorkspaceConfigFilesService implements EnvService<any> {\n name = 'WorkspaceConfigFiles';\n\n constructor(private logger: Logger) {}\n\n transform(env: Env, envContext: EnvContext): PkgTransformationMap | undefined {\n // Old env\n if (!env?.workspaceConfig) {\n return undefined;\n }\n\n return {\n workspaceConfig: () => {\n const configWriterList: ConfigWriterList = env.workspaceConfig();\n if (!configWriterList) return [];\n if (!configWriterList.compute) {\n // This is a core env that doesn't use the ConfigWriterList but create the\n // ConfigWriterEntry directly.\n if (\n Array.isArray(configWriterList) &&\n configWriterList.length > 0 &&\n typeof configWriterList[0].calcConfigFiles === 'function'\n ) {\n return configWriterList;\n }\n return [];\n }\n return configWriterList?.compute(envContext);\n },\n };\n }\n}\n"],"mappings":";;;;;;;;;AAeO,MAAMA,2BAA2B,CAA4B;EAGlEC,WAAWA,CAASC,MAAc,EAAE;IAAA,KAAhBA,MAAc,GAAdA,MAAc;IAAAC,eAAA,eAF3B,sBAAsB;EAEQ;EAErCC,SAASA,CAACC,GAAQ,EAAEC,UAAsB,EAAoC;IAC5E;IACA,IAAI,CAACD,GAAG,EAAEE,eAAe,EAAE;MACzB,OAAOC,SAAS;IAClB;IAEA,OAAO;MACLD,eAAe,EAAEA,CAAA,KAAM;QACrB,MAAME,gBAAkC,GAAGJ,GAAG,CAACE,eAAe,CAAC,CAAC;QAChE,IAAI,CAACE,gBAAgB,EAAE,OAAO,EAAE;QAChC,IAAI,CAACA,gBAAgB,CAACC,OAAO,EAAE;UAC7B;UACA;UACA,IACEC,KAAK,CAACC,OAAO,CAACH,gBAAgB,CAAC,IAC/BA,gBAAgB,CAACI,MAAM,GAAG,CAAC,IAC3B,OAAOJ,gBAAgB,CAAC,CAAC,CAAC,CAACK,eAAe,KAAK,UAAU,EACzD;YACA,OAAOL,gBAAgB;UACzB;UACA,OAAO,EAAE;QACX;QACA,OAAOA,gBAAgB,EAAEC,OAAO,CAACJ,UAAU,CAAC;MAC9C;IACF,CAAC;EACH;AACF;AAACS,OAAA,CAAAf,2BAAA,GAAAA,2BAAA","ignoreList":[]}