@teambit/workspace-config-files 1.0.41 → 1.0.43
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.
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/outputs/write-outputs-texts.js +1 -2
- package/dist/outputs/write-outputs-texts.js.map +1 -1
- package/dist/{preview-1698981534427.js → preview-1699369416537.js} +1 -1
- package/dist/workspace-config-files.aspect.js +1 -2
- package/dist/workspace-config-files.aspect.js.map +1 -1
- package/dist/workspace-config-files.main.runtime.js +1 -2
- package/dist/workspace-config-files.main.runtime.js.map +1 -1
- package/dist/ws-config.cmd.js +3 -3
- package/dist/ws-config.cmd.js.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -30,7 +30,6 @@ function _configWriterList() {
|
|
|
30
30
|
};
|
|
31
31
|
return data;
|
|
32
32
|
}
|
|
33
|
-
var _default = _workspaceConfigFiles().WorkspaceConfigFilesAspect;
|
|
34
|
-
exports.default = _default;
|
|
33
|
+
var _default = exports.default = _workspaceConfigFiles().WorkspaceConfigFilesAspect;
|
|
35
34
|
|
|
36
35
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_workspaceConfigFiles","data","require","_configWriterList","_default","
|
|
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"}
|
|
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.WRITE_TITLE = exports.SUMMARY = void 0;
|
|
7
7
|
const WRITE_TITLE = total => `${total} config files added to workspace`;
|
|
8
8
|
exports.WRITE_TITLE = WRITE_TITLE;
|
|
9
|
-
const SUMMARY = `bit writes configuration files in different nested locations in your workspace to meet the configuration needs of different components.
|
|
9
|
+
const SUMMARY = exports.SUMMARY = `bit writes configuration files in different nested locations in your workspace to meet the configuration needs of different components.
|
|
10
10
|
IDE is now in-sync with component configuration`;
|
|
11
|
-
exports.SUMMARY = SUMMARY;
|
|
12
11
|
|
|
13
12
|
//# sourceMappingURL=write-outputs-texts.js.map
|
|
@@ -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,
|
|
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,5 +1,5 @@
|
|
|
1
1
|
;
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace-config-files@1.0.
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace-config-files@1.0.43/dist/workspace-config-files.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -11,9 +11,8 @@ function _harmony() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
const WorkspaceConfigFilesAspect = _harmony().Aspect.create({
|
|
14
|
+
const WorkspaceConfigFilesAspect = exports.WorkspaceConfigFilesAspect = _harmony().Aspect.create({
|
|
15
15
|
id: 'teambit.workspace/workspace-config-files'
|
|
16
16
|
});
|
|
17
|
-
exports.WorkspaceConfigFilesAspect = WorkspaceConfigFilesAspect;
|
|
18
17
|
|
|
19
18
|
//# sourceMappingURL=workspace-config-files.aspect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_harmony","data","require","WorkspaceConfigFilesAspect","Aspect","create","id"
|
|
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"}
|
|
@@ -396,7 +396,6 @@ _defineProperty(WorkspaceConfigFilesMain, "defaultConfig", {
|
|
|
396
396
|
enableWorkspaceConfigWrite: false
|
|
397
397
|
});
|
|
398
398
|
_workspaceConfigFiles().WorkspaceConfigFilesAspect.addRuntime(WorkspaceConfigFilesMain);
|
|
399
|
-
var _default = WorkspaceConfigFilesMain;
|
|
400
|
-
exports.default = _default;
|
|
399
|
+
var _default = exports.default = WorkspaceConfigFilesMain;
|
|
401
400
|
|
|
402
401
|
//# sourceMappingURL=workspace-config-files.main.runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_path","_globby","_chalk","_exceptions","_pMapSeries","_yesno","_lodash","_cli","_workspace","_envs","_logger","_workspaceConfigFiles","_wsConfig","_writeFailed","_workspaceConfigFiles2","_writers","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","WorkspaceConfigFilesMain","constructor","workspace","envs","logger","config","writeConfigFiles","options","defaultOpts","clean","dedupe","silent","dryRun","throw","optionsWithDefaults","defaults","execContext","getExecContext","cleanResults","writeErr","writeResults","write","err","info","WriteConfigFilesFailed","wsDir","path","writeConfigFilesIfEnabled","shouldWrite","isWorkspaceConfigWriteEnabled","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","writers","pick","totalRealConfigFiles","totalExtendingConfigFiles","results","pMapSeries","entries","writerId","envEntries","oneResult","handleOneIdWriter","totalWrittenFiles","writersResult","envCompsDirsMap","writtenRealConfigFilesMap","handleRealConfigFiles","writtenExtendingConfigFiles","handleExtendingConfigFiles","writtenRealConfigFiles","values","length","curr","extendingConfigFile","filePaths","realConfigFiles","extendingConfigFiles","userConfiguredDir","join","getCacheDir","rootDir","components","list","runtime","createEnvironment","getEnvExecutionContext","envExecution","toString","env","paths","c","componentDir","relative","envExecutionContext","workspaceConfig","isFunction","addToEnvsNotImplementing","getFlatConfigWriters","flatMap","filteredConfigWriters","filter","includes","uniq","patterns","currPaths","globby","sync","cwd","dot","onlyFiles","ignore","filteredPaths","fullPath","isBitGenerated","flat","promptForCleaning","deleteFiles","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 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 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 cleanResults: string[] | undefined;\n if (optionsWithDefaults.clean) {\n cleanResults = await this.clean(options);\n }\n\n let writeErr;\n let writeResults;\n try {\n writeResults = await this.write(execContext, optionsWithDefaults);\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, 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 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 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(envEntries, envCompsDirsMap, configsRootDir, opts);\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 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 if (dryRun) return paths;\n if (!silent) await this.promptForCleaning(paths);\n await this.deleteFiles(paths);\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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J,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,CAAA3J,wBAAA,GAAAA,wBAAA;AAAAtB,eAAA,CA3SYsB,wBAAwB,WA+QpB,EAAE;AACjB;AACA;AAAAtB,eAAA,CAjRWsB,wBAAwB,kBAkRb,CAAC4J,gBAAS,EAAEC,4BAAe,EAAEC,kBAAU,EAAEC,sBAAY,CAAC;AAAArL,eAAA,CAlRjEsB,wBAAwB,aAoRlBgK,kBAAW;AAAAtL,eAAA,CApRjBsB,wBAAwB,mBAsR+B;EAChE+B,0BAA0B,EAAE;AAC9B,CAAC;AAqBHiH,kDAA0B,CAACiB,UAAU,CAACjK,wBAAwB,CAAC;AAAC,IAAAkK,QAAA,GAEjDlK,wBAAwB;AAAA2J,OAAA,CAAAlL,OAAA,GAAAyL,QAAA"}
|
|
1
|
+
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_path","_globby","_chalk","_exceptions","_pMapSeries","_yesno","_lodash","_cli","_workspace","_envs","_logger","_workspaceConfigFiles","_wsConfig","_writeFailed","_workspaceConfigFiles2","_writers","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","WorkspaceConfigFilesMain","constructor","workspace","envs","logger","config","writeConfigFiles","options","defaultOpts","clean","dedupe","silent","dryRun","throw","optionsWithDefaults","defaults","execContext","getExecContext","cleanResults","writeErr","writeResults","write","err","info","WriteConfigFilesFailed","wsDir","path","writeConfigFilesIfEnabled","shouldWrite","isWorkspaceConfigWriteEnabled","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","writers","pick","totalRealConfigFiles","totalExtendingConfigFiles","results","pMapSeries","entries","writerId","envEntries","oneResult","handleOneIdWriter","totalWrittenFiles","writersResult","envCompsDirsMap","writtenRealConfigFilesMap","handleRealConfigFiles","writtenExtendingConfigFiles","handleExtendingConfigFiles","writtenRealConfigFiles","values","length","curr","extendingConfigFile","filePaths","realConfigFiles","extendingConfigFiles","userConfiguredDir","join","getCacheDir","rootDir","components","list","runtime","createEnvironment","getEnvExecutionContext","envExecution","toString","env","paths","c","componentDir","relative","envExecutionContext","workspaceConfig","isFunction","addToEnvsNotImplementing","getFlatConfigWriters","flatMap","filteredConfigWriters","filter","includes","uniq","patterns","currPaths","globby","sync","cwd","dot","onlyFiles","ignore","filteredPaths","fullPath","isBitGenerated","flat","promptForCleaning","deleteFiles","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 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 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 cleanResults: string[] | undefined;\n if (optionsWithDefaults.clean) {\n cleanResults = await this.clean(options);\n }\n\n let writeErr;\n let writeResults;\n try {\n writeResults = await this.write(execContext, optionsWithDefaults);\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, 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 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 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(envEntries, envCompsDirsMap, configsRootDir, opts);\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 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 if (dryRun) return paths;\n if (!silent) await this.promptForCleaning(paths);\n await this.deleteFiles(paths);\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,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ACF;AAACQ,OAAA,CAAA3J,wBAAA,GAAAA,wBAAA;AAAAtB,eAAA,CA3SYsB,wBAAwB,WA+QpB,EAAE;AACjB;AACA;AAAAtB,eAAA,CAjRWsB,wBAAwB,kBAkRb,CAAC4J,gBAAS,EAAEC,4BAAe,EAAEC,kBAAU,EAAEC,sBAAY,CAAC;AAAArL,eAAA,CAlRjEsB,wBAAwB,aAoRlBgK,kBAAW;AAAAtL,eAAA,CApRjBsB,wBAAwB,mBAsR+B;EAChE+B,0BAA0B,EAAE;AAC9B,CAAC;AAqBHiH,kDAA0B,CAACiB,UAAU,CAACjK,wBAAwB,CAAC;AAAC,IAAAkK,QAAA,GAAAP,OAAA,CAAAlL,OAAA,GAEjDuB,wBAAwB"}
|
package/dist/ws-config.cmd.js
CHANGED
|
@@ -43,7 +43,7 @@ class WsConfigWriteCmd {
|
|
|
43
43
|
constructor(workspaceConfigFilesMain) {
|
|
44
44
|
this.workspaceConfigFilesMain = workspaceConfigFilesMain;
|
|
45
45
|
_defineProperty(this, "name", 'write');
|
|
46
|
-
_defineProperty(this, "description", '
|
|
46
|
+
_defineProperty(this, "description", 'write config files in the workspace. useful for IDEs');
|
|
47
47
|
_defineProperty(this, "alias", '');
|
|
48
48
|
_defineProperty(this, "group", 'development');
|
|
49
49
|
_defineProperty(this, "options", [['c', 'clean', 'delete existing config files from the workspace. highly recommended to run it with "--dry-run" first'], ['w', 'writers <writers>', `only write config files for the given writers. use comma to separate multiple writers. use ${COMMAND_NAME} list to see all writers`], ['s', 'silent', 'do not prompt for confirmation'], ['', 'no-dedupe', "write configs inside each one of the component's dir, avoid deduping"], ['', 'dry-run', 'show the paths that configs will be written per env'], ['', 'dry-run-with-content', 'use with --json flag. show the config content and the paths that will be written per env'], ['v', 'verbose', 'showing verbose output for writing'], ['j', 'json', 'json format']]);
|
|
@@ -109,7 +109,7 @@ class WsConfigCleanCmd {
|
|
|
109
109
|
constructor(workspaceConfigFilesMain) {
|
|
110
110
|
this.workspaceConfigFilesMain = workspaceConfigFilesMain;
|
|
111
111
|
_defineProperty(this, "name", 'clean');
|
|
112
|
-
_defineProperty(this, "description", '
|
|
112
|
+
_defineProperty(this, "description", 'clean (delete) written config files in the workspace. useful for IDEs');
|
|
113
113
|
_defineProperty(this, "alias", '');
|
|
114
114
|
_defineProperty(this, "group", 'development');
|
|
115
115
|
_defineProperty(this, "options", [['s', 'silent', 'do not prompt for confirmation'], ['w', 'writers <writers>', `only clean config files for the given writers. use comma to separate multiple writers. use ${COMMAND_NAME} list to see all writers`], ['', 'dry-run', 'show the paths of configs that will be cleaned'], ['j', 'json', 'json format']]);
|
|
@@ -140,7 +140,7 @@ class WsConfigListCmd {
|
|
|
140
140
|
constructor(workspaceConfigFilesMain) {
|
|
141
141
|
this.workspaceConfigFilesMain = workspaceConfigFilesMain;
|
|
142
142
|
_defineProperty(this, "name", 'list');
|
|
143
|
-
_defineProperty(this, "description", '
|
|
143
|
+
_defineProperty(this, "description", 'list config writers');
|
|
144
144
|
_defineProperty(this, "alias", '');
|
|
145
145
|
_defineProperty(this, "group", 'development');
|
|
146
146
|
_defineProperty(this, "options", [['j', 'json', 'json format']]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_outputs","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","COMMAND_NAME","WsConfigCmd","constructor","report","unrecognizedSubcommand","chalk","red","exports","WsConfigWriteCmd","workspaceConfigFilesMain","_args","flags","results","json","dryRunWithContent","Error","envsNotImplementing","getEnvsNotImplementing","warning","getWarningForNonImplementingEnvs","output","verbose","verboseFormatWriteOutput","formatWriteOutput","clean","silent","noDedupe","writers","dryRun","cleanResults","writeResults","wsDir","writeConfigFiles","dedupe","split","updatedWriteResults","writersResult","map","oneWriterResult","realConfigFiles","forEach","realConfigFile","writtenRealConfigFile","content","extendingConfigFiles","extendingConfigFile","WsConfigCleanCmd","formatCleanOutput","_flags$writers","cleanConfigFiles","WsConfigListCmd","formatListOutput","listConfigWriters","length","message","yellow","cyan","join"],"sources":["ws-config.cmd.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\n\nimport { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { WorkspaceConfigFilesMain, WriteConfigFilesResult } from './workspace-config-files.main.runtime';\nimport { formatCleanOutput, formatListOutput, formatWriteOutput, verboseFormatWriteOutput } from './outputs';\n\nexport type CleanConfigCmdFlags = {\n dryRun?: boolean;\n silent?: boolean;\n};\n\nexport type WriteConfigCmdFlags = {\n dryRun?: boolean;\n writers?: string;\n noDedupe?: boolean;\n dryRunWithContent?: boolean;\n clean?: boolean;\n silent?: boolean;\n verbose?: boolean;\n};\n\nconst COMMAND_NAME = 'ws-config';\n\nexport class WsConfigCmd implements Command {\n name = `${COMMAND_NAME} <sub-command>`;\n alias = 'workspace-config';\n description = 'manage workspace config files';\n options = [];\n group = 'development';\n commands: Command[] = [];\n // helpUrl = '';\n\n async report([unrecognizedSubcommand]: [string]) {\n return chalk.red(\n `\"${unrecognizedSubcommand}\" is not a subcommand of \"ws-config\", please run \"bit ws-config --help\" to list the subcommands`\n );\n }\n}\n\nexport class WsConfigWriteCmd implements Command {\n name = 'write';\n description = 'EXPERIMENTAL. write config files in the workspace. useful for IDEs';\n alias = '';\n group = 'development';\n options = [\n [\n 'c',\n 'clean',\n 'delete existing config files from the workspace. highly recommended to run it with \"--dry-run\" first',\n ],\n [\n 'w',\n 'writers <writers>',\n `only write config files for the given writers. use comma to separate multiple writers. use ${COMMAND_NAME} list to see all writers`,\n ],\n ['s', 'silent', 'do not prompt for confirmation'],\n ['', 'no-dedupe', \"write configs inside each one of the component's dir, avoid deduping\"],\n ['', 'dry-run', 'show the paths that configs will be written per env'],\n [\n '',\n 'dry-run-with-content',\n 'use with --json flag. show the config content and the paths that will be written per env',\n ],\n ['v', 'verbose', 'showing verbose output for writing'],\n ['j', 'json', 'json format'],\n ] as CommandOptions;\n\n constructor(private workspaceConfigFilesMain: WorkspaceConfigFilesMain) {}\n\n async report(_args, flags: WriteConfigCmdFlags) {\n const results = (await this.json(_args, flags)) as WriteConfigFilesResult;\n if (flags.dryRunWithContent) {\n throw new Error(`use --json flag along with --dry-run-with-content`);\n }\n const envsNotImplementing = this.workspaceConfigFilesMain.getEnvsNotImplementing();\n const warning = getWarningForNonImplementingEnvs(envsNotImplementing);\n const output = flags.verbose ? verboseFormatWriteOutput(results, flags) : formatWriteOutput(results, flags);\n return warning + output;\n }\n\n async json(_args, flags: WriteConfigCmdFlags) {\n const { clean, silent, noDedupe, dryRunWithContent, writers } = flags;\n const dryRun = dryRunWithContent ? true : !!flags.dryRun;\n const { cleanResults, writeResults, wsDir } = await this.workspaceConfigFilesMain.writeConfigFiles({\n clean,\n dedupe: !noDedupe,\n dryRun,\n silent,\n writers: writers?.split(','),\n });\n\n if (dryRun) {\n const updatedWriteResults = writeResults;\n if (!dryRunWithContent) {\n updatedWriteResults.writersResult = updatedWriteResults.writersResult.map((oneWriterResult) => {\n oneWriterResult.realConfigFiles.forEach((realConfigFile) => {\n realConfigFile.writtenRealConfigFile.content = '';\n });\n oneWriterResult.extendingConfigFiles.forEach((extendingConfigFile) => {\n extendingConfigFile.extendingConfigFile.content = '';\n });\n return oneWriterResult;\n });\n }\n\n return {\n wsDir,\n cleanResults,\n writeResults: updatedWriteResults,\n };\n }\n return { wsDir, cleanResults, writeResults };\n }\n}\n\nexport class WsConfigCleanCmd implements Command {\n name = 'clean';\n description = 'EXPERIMENTAL. clean (delete) written config files in the workspace. useful for IDEs';\n alias = '';\n group = 'development';\n options = [\n ['s', 'silent', 'do not prompt for confirmation'],\n [\n 'w',\n 'writers <writers>',\n `only clean config files for the given writers. use comma to separate multiple writers. use ${COMMAND_NAME} list to see all writers`,\n ],\n ['', 'dry-run', 'show the paths of configs that will be cleaned'],\n ['j', 'json', 'json format'],\n ] as CommandOptions;\n\n constructor(private workspaceConfigFilesMain: WorkspaceConfigFilesMain) {}\n\n async report(_args, flags: CleanConfigCmdFlags) {\n const results = await this.json(_args, flags);\n const envsNotImplementing = this.workspaceConfigFilesMain.getEnvsNotImplementing();\n const warning = getWarningForNonImplementingEnvs(envsNotImplementing);\n const output = formatCleanOutput(results, flags);\n return warning + output;\n }\n\n async json(_args, flags: WriteConfigCmdFlags) {\n const { silent, dryRun } = flags;\n const cleanResults = await this.workspaceConfigFilesMain.cleanConfigFiles({\n dryRun,\n silent,\n writers: flags.writers?.split(','),\n });\n return cleanResults;\n }\n}\n\nexport class WsConfigListCmd implements Command {\n name = 'list';\n description = 'EXPERIMENTAL. list config writers';\n alias = '';\n group = 'development';\n options = [['j', 'json', 'json format']] as CommandOptions;\n\n constructor(private workspaceConfigFilesMain: WorkspaceConfigFilesMain) {}\n\n async report() {\n const results = await this.json();\n const envsNotImplementing = this.workspaceConfigFilesMain.getEnvsNotImplementing();\n const warning = getWarningForNonImplementingEnvs(envsNotImplementing);\n const output = formatListOutput(results);\n return warning + output;\n }\n\n async json() {\n const cleanResults = await this.workspaceConfigFilesMain.listConfigWriters();\n return cleanResults;\n }\n}\n\nfunction getWarningForNonImplementingEnvs(envsNotImplementing: string[]) {\n if (!envsNotImplementing.length) return '';\n const message =\n chalk.yellow(`Bit cannot determine the correct contents for the config files to write. this may result in incorrect content.\nThe following environments need to add support for config files: ${chalk.cyan(envsNotImplementing.join(', '))}.\nRead here how to correct and improve dev-ex - LINK\n\n`);\n return message;\n}\n"],"mappings":";;;;;;AAGA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,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AY;EACrB;AACF;AAACtB,OAAA,CAAAuC,gBAAA,GAAAA,gBAAA;AAEM,MAAMI,eAAe,CAAoB;EAO9ChD,WAAWA,CAASO,wBAAkD,EAAE;IAAA,KAApDA,wBAAkD,GAAlDA,wBAAkD;IAAA/B,eAAA,eAN/D,MAAM;IAAAA,eAAA,sBACC,mCAAmC;IAAAA,eAAA,gBACzC,EAAE;IAAAA,eAAA,gBACF,aAAa;IAAAA,eAAA,kBACX,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;EAEiC;EAEzE,MAAMyB,MAAMA,CAAA,EAAG;IACb,MAAMS,OAAO,GAAG,MAAM,IAAI,CAACC,IAAI,CAAC,CAAC;IACjC,MAAMG,mBAAmB,GAAG,IAAI,CAACP,wBAAwB,CAACQ,sBAAsB,CAAC,CAAC;IAClF,MAAMC,OAAO,GAAGC,gCAAgC,CAACH,mBAAmB,CAAC;IACrE,MAAMI,MAAM,GAAG,IAAA+B,2BAAgB,EAACvC,OAAO,CAAC;IACxC,OAAOM,OAAO,GAAGE,MAAM;EACzB;EAEA,MAAMP,IAAIA,CAAA,EAAG;IACX,MAAMgB,YAAY,GAAG,MAAM,IAAI,CAACpB,wBAAwB,CAAC2C,iBAAiB,CAAC,CAAC;IAC5E,OAAOvB,YAAY;EACrB;AACF;AAACtB,OAAA,CAAA2C,eAAA,GAAAA,eAAA;AAED,SAAS/B,gCAAgCA,CAACH,mBAA6B,EAAE;EACvE,IAAI,CAACA,mBAAmB,CAACqC,MAAM,EAAE,OAAO,EAAE;EAC1C,MAAMC,OAAO,GACXjD,gBAAK,CAACkD,MAAM,CAAE;AAClB,mEAAmElD,gBAAK,CAACmD,IAAI,CAACxC,mBAAmB,CAACyC,IAAI,CAAC,IAAI,CAAC,CAAE;AAC9G;AACA;AACA,CAAC,CAAC;EACA,OAAOH,OAAO;AAChB"}
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_outputs","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","COMMAND_NAME","WsConfigCmd","constructor","report","unrecognizedSubcommand","chalk","red","exports","WsConfigWriteCmd","workspaceConfigFilesMain","_args","flags","results","json","dryRunWithContent","Error","envsNotImplementing","getEnvsNotImplementing","warning","getWarningForNonImplementingEnvs","output","verbose","verboseFormatWriteOutput","formatWriteOutput","clean","silent","noDedupe","writers","dryRun","cleanResults","writeResults","wsDir","writeConfigFiles","dedupe","split","updatedWriteResults","writersResult","map","oneWriterResult","realConfigFiles","forEach","realConfigFile","writtenRealConfigFile","content","extendingConfigFiles","extendingConfigFile","WsConfigCleanCmd","formatCleanOutput","_flags$writers","cleanConfigFiles","WsConfigListCmd","formatListOutput","listConfigWriters","length","message","yellow","cyan","join"],"sources":["ws-config.cmd.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\n\nimport { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { WorkspaceConfigFilesMain, WriteConfigFilesResult } from './workspace-config-files.main.runtime';\nimport { formatCleanOutput, formatListOutput, formatWriteOutput, verboseFormatWriteOutput } from './outputs';\n\nexport type CleanConfigCmdFlags = {\n dryRun?: boolean;\n silent?: boolean;\n};\n\nexport type WriteConfigCmdFlags = {\n dryRun?: boolean;\n writers?: string;\n noDedupe?: boolean;\n dryRunWithContent?: boolean;\n clean?: boolean;\n silent?: boolean;\n verbose?: boolean;\n};\n\nconst COMMAND_NAME = 'ws-config';\n\nexport class WsConfigCmd implements Command {\n name = `${COMMAND_NAME} <sub-command>`;\n alias = 'workspace-config';\n description = 'manage workspace config files';\n options = [];\n group = 'development';\n commands: Command[] = [];\n // helpUrl = '';\n\n async report([unrecognizedSubcommand]: [string]) {\n return chalk.red(\n `\"${unrecognizedSubcommand}\" is not a subcommand of \"ws-config\", please run \"bit ws-config --help\" to list the subcommands`\n );\n }\n}\n\nexport class WsConfigWriteCmd implements Command {\n name = 'write';\n description = 'write config files in the workspace. useful for IDEs';\n alias = '';\n group = 'development';\n options = [\n [\n 'c',\n 'clean',\n 'delete existing config files from the workspace. highly recommended to run it with \"--dry-run\" first',\n ],\n [\n 'w',\n 'writers <writers>',\n `only write config files for the given writers. use comma to separate multiple writers. use ${COMMAND_NAME} list to see all writers`,\n ],\n ['s', 'silent', 'do not prompt for confirmation'],\n ['', 'no-dedupe', \"write configs inside each one of the component's dir, avoid deduping\"],\n ['', 'dry-run', 'show the paths that configs will be written per env'],\n [\n '',\n 'dry-run-with-content',\n 'use with --json flag. show the config content and the paths that will be written per env',\n ],\n ['v', 'verbose', 'showing verbose output for writing'],\n ['j', 'json', 'json format'],\n ] as CommandOptions;\n\n constructor(private workspaceConfigFilesMain: WorkspaceConfigFilesMain) {}\n\n async report(_args, flags: WriteConfigCmdFlags) {\n const results = (await this.json(_args, flags)) as WriteConfigFilesResult;\n if (flags.dryRunWithContent) {\n throw new Error(`use --json flag along with --dry-run-with-content`);\n }\n const envsNotImplementing = this.workspaceConfigFilesMain.getEnvsNotImplementing();\n const warning = getWarningForNonImplementingEnvs(envsNotImplementing);\n const output = flags.verbose ? verboseFormatWriteOutput(results, flags) : formatWriteOutput(results, flags);\n return warning + output;\n }\n\n async json(_args, flags: WriteConfigCmdFlags) {\n const { clean, silent, noDedupe, dryRunWithContent, writers } = flags;\n const dryRun = dryRunWithContent ? true : !!flags.dryRun;\n const { cleanResults, writeResults, wsDir } = await this.workspaceConfigFilesMain.writeConfigFiles({\n clean,\n dedupe: !noDedupe,\n dryRun,\n silent,\n writers: writers?.split(','),\n });\n\n if (dryRun) {\n const updatedWriteResults = writeResults;\n if (!dryRunWithContent) {\n updatedWriteResults.writersResult = updatedWriteResults.writersResult.map((oneWriterResult) => {\n oneWriterResult.realConfigFiles.forEach((realConfigFile) => {\n realConfigFile.writtenRealConfigFile.content = '';\n });\n oneWriterResult.extendingConfigFiles.forEach((extendingConfigFile) => {\n extendingConfigFile.extendingConfigFile.content = '';\n });\n return oneWriterResult;\n });\n }\n\n return {\n wsDir,\n cleanResults,\n writeResults: updatedWriteResults,\n };\n }\n return { wsDir, cleanResults, writeResults };\n }\n}\n\nexport class WsConfigCleanCmd implements Command {\n name = 'clean';\n description = 'clean (delete) written config files in the workspace. useful for IDEs';\n alias = '';\n group = 'development';\n options = [\n ['s', 'silent', 'do not prompt for confirmation'],\n [\n 'w',\n 'writers <writers>',\n `only clean config files for the given writers. use comma to separate multiple writers. use ${COMMAND_NAME} list to see all writers`,\n ],\n ['', 'dry-run', 'show the paths of configs that will be cleaned'],\n ['j', 'json', 'json format'],\n ] as CommandOptions;\n\n constructor(private workspaceConfigFilesMain: WorkspaceConfigFilesMain) {}\n\n async report(_args, flags: CleanConfigCmdFlags) {\n const results = await this.json(_args, flags);\n const envsNotImplementing = this.workspaceConfigFilesMain.getEnvsNotImplementing();\n const warning = getWarningForNonImplementingEnvs(envsNotImplementing);\n const output = formatCleanOutput(results, flags);\n return warning + output;\n }\n\n async json(_args, flags: WriteConfigCmdFlags) {\n const { silent, dryRun } = flags;\n const cleanResults = await this.workspaceConfigFilesMain.cleanConfigFiles({\n dryRun,\n silent,\n writers: flags.writers?.split(','),\n });\n return cleanResults;\n }\n}\n\nexport class WsConfigListCmd implements Command {\n name = 'list';\n description = 'list config writers';\n alias = '';\n group = 'development';\n options = [['j', 'json', 'json format']] as CommandOptions;\n\n constructor(private workspaceConfigFilesMain: WorkspaceConfigFilesMain) {}\n\n async report() {\n const results = await this.json();\n const envsNotImplementing = this.workspaceConfigFilesMain.getEnvsNotImplementing();\n const warning = getWarningForNonImplementingEnvs(envsNotImplementing);\n const output = formatListOutput(results);\n return warning + output;\n }\n\n async json() {\n const cleanResults = await this.workspaceConfigFilesMain.listConfigWriters();\n return cleanResults;\n }\n}\n\nfunction getWarningForNonImplementingEnvs(envsNotImplementing: string[]) {\n if (!envsNotImplementing.length) return '';\n const message =\n chalk.yellow(`Bit cannot determine the correct contents for the config files to write. this may result in incorrect content.\nThe following environments need to add support for config files: ${chalk.cyan(envsNotImplementing.join(', '))}.\nRead here how to correct and improve dev-ex - LINK\n\n`);\n return message;\n}\n"],"mappings":";;;;;;AAGA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA6G,SAAAC,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;AAAA,SAAAM,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,M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AAA,GAAAA,eAAA;AAED,SAAS/B,gCAAgCA,CAACH,mBAA6B,EAAE;EACvE,IAAI,CAACA,mBAAmB,CAACqC,MAAM,EAAE,OAAO,EAAE;EAC1C,MAAMC,OAAO,GACXjD,gBAAK,CAACkD,MAAM,CAAE;AAClB,mEAAmElD,gBAAK,CAACmD,IAAI,CAACxC,mBAAmB,CAACyC,IAAI,CAAC,IAAI,CAAC,CAAE;AAC9G;AACA;AACA,CAAC,CAAC;EACA,OAAOH,OAAO;AAChB"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/workspace-config-files",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.43",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/workspace/workspace-config-files",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.workspace",
|
|
8
8
|
"name": "workspace-config-files",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.43"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"normalize-path": "3.0.0",
|
|
19
19
|
"string-format": "0.5.0",
|
|
20
20
|
"core-js": "^3.0.0",
|
|
21
|
-
"@babel/runtime": "7.
|
|
21
|
+
"@babel/runtime": "7.23.2",
|
|
22
22
|
"@teambit/harmony": "0.4.6",
|
|
23
23
|
"@teambit/bit-error": "0.0.404",
|
|
24
|
-
"@teambit/envs": "1.0.
|
|
25
|
-
"@teambit/cli": "0.0.
|
|
26
|
-
"@teambit/logger": "0.0.
|
|
27
|
-
"@teambit/workspace": "1.0.
|
|
24
|
+
"@teambit/envs": "1.0.43",
|
|
25
|
+
"@teambit/cli": "0.0.808",
|
|
26
|
+
"@teambit/logger": "0.0.901",
|
|
27
|
+
"@teambit/workspace": "1.0.43"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/lodash": "4.14.165",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@types/testing-library__jest-dom": "5.9.5"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@teambit/legacy": "1.0.
|
|
43
|
+
"@teambit/legacy": "1.0.590",
|
|
44
44
|
"react": "^16.8.0 || ^17.0.0",
|
|
45
45
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
46
46
|
},
|