@teambit/envs 1.0.380 → 1.0.382

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  import { PluginDefinition } from '@teambit/aspect-loader';
2
- import { Aspect, Harmony } from '@teambit/harmony';
2
+ import { Harmony } from '@teambit/harmony';
3
3
  import { WorkerMain } from '@teambit/worker';
4
4
  import { LoggerMain } from '@teambit/logger';
5
5
  import { EnvsRegistry, ServicesRegistry } from './environments.main.runtime';
@@ -14,5 +14,7 @@ export declare class EnvPlugin implements PluginDefinition {
14
14
  runtimes: string[];
15
15
  private createContext;
16
16
  private transformToLegacyEnv;
17
- register(object: any, aspect: Aspect): void;
17
+ register(object: any, aspect: {
18
+ id: string;
19
+ }): undefined;
18
20
  }
@@ -64,6 +64,8 @@ class EnvPlugin {
64
64
  return _objectSpread(_objectSpread({}, transformers), {}, {
65
65
  name: env.name,
66
66
  icon: env.icon,
67
+ __path: env.__path,
68
+ __resolvedPath: env.__resolvedPath,
67
69
  __getDescriptor: async () => {
68
70
  return {
69
71
  type: env.type || env.name
@@ -75,7 +77,16 @@ class EnvPlugin {
75
77
  register(object, aspect) {
76
78
  const env = this.transformToLegacyEnv(aspect.id, object);
77
79
  if (!env) return undefined;
78
- return this.envSlot.register(env);
80
+ // This is required when we call it manually and the aspect id fn return the wrong
81
+ // id
82
+ // We call the set directly because when we call it manually during install
83
+ // the aspect id fn return the wrong id
84
+ // Please do not change this without consulting @GiladShoham
85
+ // This manual call from install is required to make sure we re-load the envs
86
+ // when they move to another location in the node_modules
87
+ // during process is still running (like during bit new, bit switch, bit server)
88
+ this.envSlot.map.set(aspect.id, env);
89
+ return;
79
90
  }
80
91
  }
81
92
  exports.EnvPlugin = EnvPlugin;
@@ -1 +1 @@
1
- {"version":3,"names":["_component","data","require","_cli","_lodash","_serviceHandlerContext","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","EnvPlugin","constructor","envSlot","servicesRegistry","loggerMain","workerMain","harmony","MainRuntime","name","createContext","envId","EnvContext","transformToLegacyEnv","env","envComponentId","ComponentID","fromString","envContext","allServices","flatten","values","transformers","reduce","acc","service","transform","currTransformer","preview","compiler","undefined","icon","__getDescriptor","type","id","register","object","aspect","exports"],"sources":["env.plugin.ts"],"sourcesContent":["import { PluginDefinition } from '@teambit/aspect-loader';\nimport { Aspect, Harmony } from '@teambit/harmony';\nimport { ComponentID } from '@teambit/component';\nimport { WorkerMain } from '@teambit/worker';\nimport { MainRuntime } from '@teambit/cli';\nimport { LoggerMain } from '@teambit/logger';\nimport { flatten } from 'lodash';\nimport { ServiceHandlerContext as EnvContext } from './services/service-handler-context';\nimport { Env } from './env-interface';\nimport { EnvsRegistry, ServicesRegistry } from './environments.main.runtime';\n\nexport class EnvPlugin implements PluginDefinition {\n constructor(\n private envSlot: EnvsRegistry,\n private servicesRegistry: ServicesRegistry,\n private loggerMain: LoggerMain,\n private workerMain: WorkerMain,\n private harmony: Harmony\n ) {}\n\n pattern = '*.bit-env.*';\n\n runtimes = [MainRuntime.name];\n\n private createContext(envId: ComponentID) {\n return new EnvContext(envId, this.loggerMain, this.workerMain, this.harmony);\n }\n\n private transformToLegacyEnv(envId: string, env: Env) {\n const envComponentId = ComponentID.fromString(envId);\n const envContext = this.createContext(envComponentId);\n const allServices = flatten(this.servicesRegistry.values());\n const transformers = allServices.reduce((acc, service) => {\n if (!service.transform) return acc;\n const currTransformer = service.transform(env, envContext);\n if (!currTransformer) return acc;\n return { ...acc, ...currTransformer };\n }, {});\n\n if (!env.preview && !env.compiler) return undefined;\n\n return {\n ...transformers,\n name: env.name,\n icon: env.icon,\n __getDescriptor: async () => {\n return {\n type: env.type || env.name,\n };\n },\n id: envId,\n };\n }\n\n register(object: any, aspect: Aspect) {\n const env = this.transformToLegacyEnv(asp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ACiB,IAAI;MACdC,eAAe,EAAE,MAAAA,CAAA,KAAY;QAC3B,OAAO;UACLC,IAAI,EAAEnB,GAAG,CAACmB,IAAI,IAAInB,GAAG,CAACL;QACxB,CAAC;MACH,CAAC;MACDyB,EAAE,EAAEvB;IAAK;EAEb;EAEAwB,QAAQA,CAACC,MAAW,EAAEC,MAAc,EAAE;IACpC,MAAMvB,GAAG,GAAG,IAAI,CAACD,oBAAoB,CAACwB,MAAM,CAACH,EAAE,EAAEE,MAAM,CAAC;IACxD,IAAI,CAACtB,GAAG,EAAE,OAAOgB,SAAS;IAC1B,OAAO,IAAI,CAAC3B,OAAO,CAACgC,QAAQ,CAACrB,GAAG,CAAC;EACnC;AACF;AAACwB,OAAA,CAAArC,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["_component","data","require","_cli","_lodash","_serviceHandlerContext","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","EnvPlugin","constructor","envSlot","servicesRegistry","loggerMain","workerMain","harmony","MainRuntime","name","createContext","envId","EnvContext","transformToLegacyEnv","env","envComponentId","ComponentID","fromString","envContext","allServices","flatten","values","transformers","reduce","acc","service","transform","currTransformer","preview","compiler","undefined","icon","__path","__resolvedPath","__getDescriptor","type","id","register","object","aspect","map","set","exports"],"sources":["env.plugin.ts"],"sourcesContent":["import { PluginDefinition } from '@teambit/aspect-loader';\nimport { Harmony } from '@teambit/harmony';\nimport { ComponentID } from '@teambit/component';\nimport { WorkerMain } from '@teambit/worker';\nimport { MainRuntime } from '@teambit/cli';\nimport { LoggerMain } from '@teambit/logger';\nimport { flatten } from 'lodash';\nimport { ServiceHandlerContext as EnvContext } from './services/service-handler-context';\nimport { Env } from './env-interface';\nimport { EnvsRegistry, ServicesRegistry } from './environments.main.runtime';\n\nexport class EnvPlugin implements PluginDefinition {\n constructor(\n private envSlot: EnvsRegistry,\n private servicesRegistry: ServicesRegistry,\n private loggerMain: LoggerMain,\n private workerMain: WorkerMain,\n private harmony: Harmony\n ) {}\n\n pattern = '*.bit-env.*';\n\n runtimes = [MainRuntime.name];\n\n private createContext(envId: ComponentID) {\n return new EnvContext(envId, this.loggerMain, this.workerMain, this.harmony);\n }\n\n private transformToLegacyEnv(envId: string, env: Env) {\n const envComponentId = ComponentID.fromString(envId);\n const envContext = this.createContext(envComponentId);\n const allServices = flatten(this.servicesRegistry.values());\n const transformers = allServices.reduce((acc, service) => {\n if (!service.transform) return acc;\n const currTransformer = service.transform(env, envContext);\n if (!currTransformer) return acc;\n return { ...acc, ...currTransformer };\n }, {});\n\n if (!env.preview && !env.compiler) return undefined;\n\n return {\n ...transformers,\n name: env.name,\n icon: env.icon,\n __path: env.__path,\n __resolvedPath: env.__resolvedPath,\n __getDescriptor: async () => {\n return {\n type: env.type || env.name,\n };\n },\n id: envId,\n };\n }\n\n register(object: any, aspect: { id: string }) {\n const env = this.transformToLegacyEnv(aspect.id, object);\n if (!env) return undefined;\n // This is required when we call it manually and the aspect id fn return the wrong\n // id\n // We call the set directly because when we call it manually during install\n // the aspect id fn return the wrong id\n // Please do not change this without consulting @GiladShoham\n // This manual call from install is required to make sure we re-load the envs\n // when they move to another location in the node_modules\n // during process is still running (like during bit new, bit switch, bit server)\n this.envSlot.map.set(aspect.id, env);\n return;\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,QAA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,CAACD,oBAAoB,CAAC0B,MAAM,CAACH,EAAE,EAAEE,MAAM,CAAC;IACxD,IAAI,CAACxB,GAAG,EAAE,OAAOgB,SAAS;IAC1B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,CAAC3B,OAAO,CAACqC,GAAG,CAACC,GAAG,CAACF,MAAM,CAACH,EAAE,EAAEtB,GAAG,CAAC;IACpC;EACF;AACF;AAAC4B,OAAA,CAAAzC,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -239,7 +239,8 @@ export declare class EnvsMain {
239
239
  * whether a component has an env configured (either by variant or .bitmap).
240
240
  */
241
241
  hasEnvConfigured(component: Component): boolean;
242
- getAllRegisteredEnvs(): string[];
242
+ getAllRegisteredEnvsIds(): string[];
243
+ getAllRegisteredEnvs(): Environment[];
243
244
  getAllRegisteredEnvJsoncCustomizers(): EnvJsoncMergeCustomizer[];
244
245
  getEnvPlugin(): EnvPlugin;
245
246
  /**
@@ -733,9 +733,12 @@ class EnvsMain {
733
733
  hasEnvConfigured(component) {
734
734
  return Boolean(this.getAllEnvsConfiguredOnComponent(component).length);
735
735
  }
736
- getAllRegisteredEnvs() {
736
+ getAllRegisteredEnvsIds() {
737
737
  return this.envSlot.toArray().map(envData => envData[0]);
738
738
  }
739
+ getAllRegisteredEnvs() {
740
+ return this.envSlot.toArray().map(envData => envData[1]);
741
+ }
739
742
  getAllRegisteredEnvJsoncCustomizers() {
740
743
  return this.envJsoncMergeCustomizerSlot.toArray().map(customizerEntry => customizerEntry[1]);
741
744
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_path","data","require","_findRoot","_interopRequireDefault","_toolboxModules","_bit","_fsExtra","_pLocate","_commentJson","_cli","_component","_graphql","_issues","_pMapSeries","_componentIssues","_harmony","_logger","_bitError","_toolboxArray","_lodash","_worker","_componentId","_environments","_environments2","_runtime","_envDefinition","_envServiceList","_envs","_env","_exceptions","_env2","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DEFAULT_ENV","exports","EnvsMain","icon","constructor","config","harmony","envSlot","logger","servicesRegistry","componentMain","loggerMain","workerMain","envJsoncMergeCustomizerSlot","Set","createEnvironment","components","createRuntime","addFailedToLoadEnvs","id","failedToLoadEnvs","add","envIds","addFailedToLoadExt","failedToLoadExt","has","resetFailedToLoadEnvs","clear","getFailedToLoadEnvs","Array","from","extId","uniq","getDefaultEnv","defaultEnv","get","Error","EnvDefinition","getCoreEnvsIds","compose","targetEnv","envTransformers","a","reduce","acc","transformer","override","propsToOverride","env","merge","sourceEnv","allNames","prototype","getPrototypeOf","name","getOwnPropertyNames","key","fn","includes","bind","hasEnvManifest","envComponent","legacyFiles","undefined","files","filesystem","envJson","find","file","relative","getEnvManifest","object","parse","contents","toString","resolvedObject","recursivelyMergeWithParentManifest","path","originPath","extends","parentPackageName","parentPath","resolveFrom","parentResolvedPath","findRoot","existsSync","info","parentEnvJsoncPath","map","fileName","join","filePath","consoleWarning","parentStr","readFileSync","parentObject","mergedObject","mergeEnvManifests","parent","child","merged","mergeCustomizer","getAllRegisteredEnvJsoncCustomizers","customizer","oneMerged","hasEnvManifestById","envId","requesting","component","getEnvComponentByEnvId","getEnvData","envsData","state","aspects","EnvsAspect","getEnvIdFromEnvsData","ignoreVersion","rawEnvId","envIdWithoutVersion","ComponentID","fromString","toStringWithoutVersion","getEnvId","envIdFromEnvData","withVersion","resolveEnv","withVersionMatch","toArray","withVersionMatchId","exactMatch","exactMatchId","EnvNotConfiguredForComponent","isUsingCoreEnv","isCoreEnv","getEnv","envDef","getEnvDefinitionByStringId","EnvNotFound","getEnvComponent","host","getHost","newId","resolveComponentId","BitError","getOrCalculateEnv","err","calculateEnv","getDescriptor","calcDescriptor","opts","componentDescriptor","getComponentEnvDescriptor","envComponentSelfDescriptor","getEnvSelfDescriptor","result","self","isEnvRegistered","getEnvFromComponent","rawServices","getServices","services","toObject","selfDescriptor","getEnvDescriptorFromEnvDef","__getDescriptor","systemDescriptor","type","split","description","matchedEntry","entries","aspectEntry","calculateEnvId","envIdFromEnvsConfig","getEnvIdFromEnvsConfig","envIdFromEnvsConfigWithoutVersion","ids","findFirstEnv","finalId","getEnvDefinitionById","skipWarnings","printWarningIfFirstTime","envDefFromList","getAllEnvsConfiguredOnComponent","getEnvFromEnvsConfig","getEnvsNotFromEnvsConfig","hasEnvConfigured","Boolean","getAllRegisteredEnvs","envData","customizerEntry","getEnvPlugin","EnvPlugin","getEnvIdFromEnvsLegacyExtensions","extensions","envsAspect","findCoreExtension","calculateEnvIdFromExtensions","extension","extensionId","stringId","calculateEnvFromExtensions","getEnvDefinitionByLegacyExtension","isFoundWithoutVersion","pLocate","idWithoutVersion","isCoreAspect","envDefWithoutVersion","hasManifest","isUsingEnvEnv","finalEnvId","getEnvDefinition","allVersions","all","first","head","getEnvsEnvDefinition","message","alreadyShownWarning","isUsingAspectEnv","isEnv","registerService","envServices","register","allServices","currentServices","service","implements","warn","EnvServiceList","registerEnv","registerEnvJsoncMergeCustomizer","addNonLoadedEnvAsComponentIssues","pMapSeries","envIdStr","foundComp","c","issues","getOrCreate","IssuesClasses","ExternalEnvWithoutVersion","componentId","NonLoadedEnv","Runtime","aggregateByDefs","throwForDuplicateComponents","envsMap","Promise","envAspectDef","getEnvAspectDef","EnvRuntime","resolvedAspects","resolveAspects","MainRuntime","requestedOnly","filterByRuntime","useScopeAspectsCapsule","def","idsStr","duplications","findDuplications","provider","graphql","loggerAspect","cli","worker","context","createLogger","envs","registerShowFragments","EnvFragment","registerAddComponentsIssues","envsCmd","EnvsCmd","commands","ListEnvsCmd","GetEnvCmd","environmentsSchema","Slot","withType","GraphqlAspect","LoggerAspect","ComponentAspect","CLIAspect","WorkerAspect","IssuesAspect","addRuntime"],"sources":["environments.main.runtime.ts"],"sourcesContent":["import { join } from 'path';\nimport findRoot from 'find-root';\nimport { resolveFrom } from '@teambit/toolbox.modules.module-resolver';\nimport { isCoreAspect } from '@teambit/bit';\nimport { existsSync, readFileSync } from 'fs-extra';\nimport pLocate from 'p-locate';\nimport { parse } from 'comment-json';\nimport { SourceFile } from '@teambit/component.sources';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Component, ComponentAspect, ComponentMain } from '@teambit/component';\nimport type { EnvPolicyConfigObject } from '@teambit/dependency-resolver';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport type { EnvJsoncPatterns } from '@teambit/dev-files';\nimport pMapSeries from 'p-map-series';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { Harmony, Slot, SlotRegistry } from '@teambit/harmony';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport type { AspectDefinition } from '@teambit/aspect-loader';\nimport { ExtensionDataList, ExtensionDataEntry } from '@teambit/legacy/dist/consumer/config/extension-data';\nimport { BitError } from '@teambit/bit-error';\nimport { findDuplications } from '@teambit/toolbox.array.duplications-finder';\nimport { head, uniq } from 'lodash';\nimport { WorkerAspect, WorkerMain } from '@teambit/worker';\nimport { ComponentID } from '@teambit/component-id';\nimport { EnvService } from './services';\nimport { Environment } from './environment';\nimport { EnvsAspect } from './environments.aspect';\nimport { environmentsSchema } from './environments.graphql';\nimport { EnvRuntime, Runtime } from './runtime';\nimport { EnvDefinition } from './env-definition';\nimport { EnvServiceList } from './env-service-list';\nimport { EnvsCmd, GetEnvCmd, ListEnvsCmd } from './envs.cmd';\nimport { EnvFragment } from './env.fragment';\nimport { EnvNotFound, EnvNotConfiguredForComponent } from './exceptions';\nimport { EnvPlugin } from './env.plugin';\n\nexport type EnvJsonc = {\n extends?: string;\n policy?: EnvPolicyConfigObject;\n patterns?: EnvJsoncPatterns;\n};\n\nexport type EnvJsoncMergeCustomizer = (parentObj: EnvJsonc, childObj: EnvJsonc) => Partial<EnvJsonc>;\n\nexport type EnvsRegistry = SlotRegistry<Environment>;\nexport type EnvJsoncMergeCustomizerRegistry = SlotRegistry<EnvJsoncMergeCustomizer>;\n\nexport type EnvsConfig = {\n env: string;\n options: EnvOptions;\n};\n\ntype GetCalcEnvOptions = {\n skipWarnings?: boolean;\n};\n\nexport type EnvOptions = {};\n\nexport type EnvTransformer = (env: Environment) => Environment;\n\nexport type ServicesRegistry = SlotRegistry<Array<EnvService<any>>>;\n\nexport type RegularCompDescriptor = {\n id: string;\n icon?: string;\n type?: string;\n name?: string;\n description?: string;\n};\nexport type EnvCompDescriptorProps = RegularCompDescriptor & {\n services?: {\n env: {\n id: string;\n icon: string;\n name?: string;\n description?: string;\n };\n services: Array<{\n id: string;\n name?: string;\n description?: string;\n data: any;\n }>;\n };\n};\n\nexport type EnvCompDescriptor = EnvCompDescriptorProps & {\n self?: EnvCompDescriptorProps;\n};\n\nexport type Descriptor = RegularCompDescriptor | EnvCompDescriptor;\n\nexport const DEFAULT_ENV = 'teambit.harmony/node';\n\nexport class EnvsMain {\n /**\n * Envs that are failed to load\n */\n private failedToLoadEnvs = new Set<string>();\n /**\n * Extensions that are failed to load\n * We use this as sometime when we couldn't load an extension we don't know if it's an env or not\n * We should ideally take it from the aspect loader aspect, but right now the aspect loader is using envs\n */\n private failedToLoadExt = new Set<string>();\n /**\n * Ids of envs (not neccesrraly loaded successfully)\n */\n public envIds = new Set<string>();\n\n static runtime = MainRuntime;\n\n private alreadyShownWarning = {};\n\n /**\n * icon of the extension.\n */\n icon() {\n return `<svg width=\"50\" height=\"50\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"25\" cy=\"25\" r=\"20\"/>\n </svg>`;\n }\n\n constructor(\n /**\n * environments extension configuration.\n */\n readonly config: EnvsConfig,\n\n /**\n * harmony context.\n */\n private harmony: Harmony,\n\n /**\n * slot for allowing extensions to register new environment.\n */\n private envSlot: EnvsRegistry,\n\n private logger: Logger,\n\n private servicesRegistry: ServicesRegistry,\n\n private componentMain: ComponentMain,\n\n private loggerMain: LoggerMain,\n\n private workerMain: WorkerMain,\n\n private envJsoncMergeCustomizerSlot: EnvJsoncMergeCustomizerRegistry\n ) {}\n\n /**\n * creates a new runtime environments for a set of components.\n */\n async createEnvironment(components: Component[]): Promise<Runtime> {\n return this.createRuntime(components);\n }\n\n /**\n *\n * @param id\n */\n /**\n * This function adds an extension ID to a set of failed to load extensions.\n * This mostly used by the aspect loader to add such issues\n * Then it is used to hide different errors that are caused by the same issue.\n * @param {string} id - string - represents the unique identifier of an extension that failed to load.\n */\n addFailedToLoadEnvs(id: string) {\n this.failedToLoadEnvs.add(id);\n this.envIds.add(id);\n }\n\n addFailedToLoadExt(id: string) {\n this.failedToLoadExt.add(id);\n if (this.envIds.has(id)) {\n this.addFailedToLoadEnvs(id);\n }\n }\n\n resetFailedToLoadEnvs() {\n this.failedToLoadEnvs.clear();\n this.failedToLoadExt.clear();\n }\n\n getFailedToLoadEnvs() {\n const failedToLoadEnvs = Array.from(this.failedToLoadEnvs);\n // Add all extensions which are also envs\n for (const extId of this.failedToLoadExt) {\n if (this.envIds.has(extId)) {\n failedToLoadEnvs.push(extId);\n }\n }\n return uniq(failedToLoadEnvs);\n }\n\n /**\n * get the configured default env.\n */\n getDefaultEnv(): EnvDefinition {\n const defaultEnv = this.envSlot.get(DEFAULT_ENV);\n if (!defaultEnv) throw new Error('default env must be set.');\n\n return new EnvDefinition(DEFAULT_ENV, defaultEnv);\n }\n\n getCoreEnvsIds(): string[] {\n return [\n 'teambit.harmony/aspect',\n 'teambit.react/react',\n 'teambit.harmony/node',\n 'teambit.react/react-native',\n 'teambit.html/html',\n 'teambit.mdx/mdx',\n 'teambit.envs/env',\n 'teambit.mdx/readme',\n 'teambit.harmony/bit-custom-aspect',\n ];\n }\n\n /**\n * compose a new environment from a list of environment transformers.\n */\n compose(targetEnv: Environment, envTransformers: EnvTransformer[]) {\n const a = envTransformers.reduce((acc, transformer) => {\n acc = transformer(acc);\n return acc;\n }, targetEnv);\n\n return a;\n }\n\n /**\n * create an env transformer which overrides specific env properties.\n */\n override(propsToOverride: Environment): EnvTransformer {\n return (env: Environment) => {\n return this.merge(propsToOverride, env);\n };\n }\n\n /**\n * compose two environments into one.\n */\n merge<T extends Environment, S extends Environment>(targetEnv: Environment, sourceEnv: Environment): T & S {\n const allNames = new Set<string>();\n const keys = ['icon', 'name', 'description'];\n for (let o = sourceEnv; o !== Object.prototype; o = Object.getPrototypeOf(o)) {\n for (const name of Object.getOwnPropertyNames(o)) {\n allNames.add(name);\n }\n }\n\n allNames.forEach((key: string) => {\n const fn = sourceEnv[key];\n if (targetEnv[key]) return;\n if (keys.includes(key)) targetEnv[key] = fn;\n if (!fn || !fn.bind) {\n return;\n }\n targetEnv[key] = fn.bind(sourceEnv);\n });\n\n return targetEnv as T & S;\n }\n\n /**\n * This function checks if an environment manifest file exists in a given component or set of legacy files.\n * @param {Component} [envComponent] - A component object that represents an environment. It contains information about\n * the files and directories that make up the environment.\n * @param {SourceFile[]} [legacyFiles] - An optional array of SourceFile objects representing the files in the legacy\n * file system. If this parameter is not provided, the function will attempt to retrieve the files from the envComponent\n * parameter.\n * @returns a boolean value indicating whether an `env.jsonc` or `env.json` file exists in the `files` array of either\n * the `envComponent` object or the `legacyFiles` array. If neither `envComponent` nor `legacyFiles` are provided, the\n * function returns `undefined`.\n */\n hasEnvManifest(envComponent?: Component, legacyFiles?: SourceFile[]): boolean | undefined {\n if (!envComponent && !legacyFiles) return undefined;\n // @ts-ignore\n const files = legacyFiles || envComponent.filesystem.files;\n const envJson = files.find((file) => {\n return file.relative === 'env.jsonc' || file.relative === 'env.json';\n });\n\n if (!envJson) return false;\n return true;\n }\n\n getEnvManifest(envComponent?: Component, legacyFiles?: SourceFile[]): EnvJsonc | undefined {\n // TODO: maybe throw an error here?\n if (!envComponent && !legacyFiles) return undefined;\n // @ts-ignore\n const files = legacyFiles || envComponent.filesystem.files;\n const envJson = files.find((file) => {\n return file.relative === 'env.jsonc' || file.relative === 'env.json';\n });\n\n if (!envJson) return undefined;\n\n const object: EnvJsonc = parse(envJson.contents.toString('utf8'), undefined, true);\n const resolvedObject = this.recursivelyMergeWithParentManifest(object, envJson.path);\n return resolvedObject;\n }\n\n recursivelyMergeWithParentManifest(object: EnvJsonc, originPath: string): EnvJsonc {\n if (!object.extends) return object;\n const parentPackageName = object.extends;\n const parentPath = resolveFrom(originPath, [parentPackageName]);\n const parentResolvedPath = findRoot(parentPath);\n if (!parentResolvedPath || !existsSync(parentResolvedPath)) {\n this.logger.info(`failed finding parent manifest for ${parentPackageName} at ${parentResolvedPath}`);\n }\n const parentEnvJsoncPath = ['env.jsonc', 'env.json']\n .map((fileName) => join(parentResolvedPath, fileName))\n .find((filePath) => {\n return existsSync(filePath);\n });\n if (!parentEnvJsoncPath) {\n this.logger.consoleWarning(\n `failed finding parent manifest for ${parentPackageName} at ${parentResolvedPath} referred from ${originPath}`\n );\n return object;\n }\n const parentStr = readFileSync(parentEnvJsoncPath).toString('utf8');\n const parentObject: EnvJsonc = parse(parentStr, undefined, true);\n const mergedObject = this.mergeEnvManifests(parentObject, object);\n if (mergedObject.extends) {\n return this.recursivelyMergeWithParentManifest(mergedObject, parentEnvJsoncPath);\n }\n return mergedObject;\n }\n\n mergeEnvManifests(parent: EnvJsonc, child: EnvJsonc): EnvJsonc {\n let merged: EnvJsonc = {};\n const mergeCustomizer = this.getAllRegisteredEnvJsoncCustomizers();\n for (const customizer of mergeCustomizer) {\n const oneMerged = customizer(parent, child);\n merged = { ...merged, ...oneMerged };\n }\n // Take extends specifically from the parent so we can propagate it to the next parent\n if (parent.extends) {\n merged.extends = parent.extends;\n }\n return merged;\n }\n\n async hasEnvManifestById(envId: string, requesting: string): Promise<boolean | undefined> {\n const component = await this.getEnvComponentByEnvId(envId, requesting);\n return this.hasEnvManifest(component);\n }\n\n getEnvData(component: Component): Descriptor {\n let envsData = component.state.aspects.get(EnvsAspect.id);\n if (!envsData) {\n // TODO: remove this once we re-export old components used to store the data here\n envsData = component.state.aspects.get('teambit.workspace/workspace');\n }\n if (!envsData) throw new Error(`env was not configured on component ${component.id.toString()}`);\n return envsData.data as Descriptor;\n }\n\n /**\n * Return the id of the env as configured in the envs data (without version by default)\n * The reason it's not contain version by default is that we want to take the version from the aspect defined on the component itself\n * As this version is stay up to date during tagging the env along with the component\n * @param component\n * @param ignoreVersion\n */\n private getEnvIdFromEnvsData(component: Component, ignoreVersion = true): string | undefined {\n const envsData = this.getEnvData(component);\n if (!envsData) return undefined;\n const rawEnvId = envsData.id;\n if (!rawEnvId) return undefined;\n if (!ignoreVersion) return rawEnvId;\n const envIdWithoutVersion = ComponentID.fromString(rawEnvId).toStringWithoutVersion();\n return envIdWithoutVersion;\n }\n\n /**\n * get the env id of the given component.\n */\n getEnvId(component: Component): string {\n const envIdFromEnvData = this.getEnvIdFromEnvsData(component);\n if (!envIdFromEnvData) {\n // This should never happen\n throw new Error(`no env found for ${component.id.toString()}`);\n }\n const withVersion = this.resolveEnv(component, envIdFromEnvData);\n const withVersionMatch = this.envSlot.toArray().find(([envId]) => {\n return withVersion?.toString() === envId;\n });\n const withVersionMatchId = withVersionMatch?.[0];\n if (withVersionMatchId) return withVersionMatchId;\n\n // Handle core envs\n const exactMatch = this.envSlot.toArray().find(([envId]) => {\n return envIdFromEnvData === envId;\n });\n\n const exactMatchId = exactMatch?.[0];\n if (exactMatchId) return exactMatchId;\n\n if (!withVersion) throw new EnvNotConfiguredForComponent(envIdFromEnvData, component.id.toString());\n return withVersion.toString();\n }\n\n isUsingCoreEnv(component: Component): boolean {\n const envId = this.getEnvId(component);\n return this.isCoreEnv(envId);\n }\n\n isCoreEnv(envId: string): boolean {\n return this.getCoreEnvsIds().includes(envId);\n }\n\n /**\n * get the env of the given component.\n * In case you are asking for the env during on load you should use calculateEnv instead\n */\n getEnv(component: Component): EnvDefinition {\n const id = this.getEnvId(component);\n const envDef = this.getEnvDefinitionByStringId(id);\n if (envDef) {\n return envDef;\n }\n // Do not allow a non existing env\n throw new EnvNotFound(id, component.id.toString());\n }\n\n /**\n * get the env component of the given component.\n */\n async getEnvComponent(component: Component): Promise<Component> {\n const envId = this.getEnvId(component);\n return this.getEnvComponentByEnvId(envId, component.id.toString());\n }\n\n /**\n * get the env component by the env id.\n */\n async getEnvComponentByEnvId(envId: string, requesting?: string): Promise<Component> {\n const host = this.componentMain.getHost();\n const newId = await host.resolveComponentId(envId);\n const envComponent = await host.get(newId);\n if (!envComponent) {\n throw new BitError(`can't load env. env id is ${envId} used by component ${requesting || 'unknown'}`);\n }\n return envComponent;\n }\n\n /**\n * get the env of the given component.\n * This will try to use the regular getEnv but fallback to the calculate env (in case you are using it during on load)\n * This is safe to be used on onLoad as well\n */\n getOrCalculateEnv(component: Component): EnvDefinition {\n try {\n return this.getEnv(component);\n } catch (err) {\n return this.calculateEnv(component);\n }\n }\n\n /**\n * get an environment Descriptor.\n */\n getDescriptor(component: Component): Descriptor | undefined {\n const envsData = this.getEnvData(component);\n envsData.id = this.resolveEnv(component, envsData.id)?.toString() || envsData.id;\n return envsData;\n }\n\n async calcDescriptor(component: Component, opts: GetCalcEnvOptions = {}): Promise<Descriptor | undefined> {\n const componentDescriptor = await this.getComponentEnvDescriptor(component, opts);\n if (!componentDescriptor) return undefined;\n const envComponentSelfDescriptor = await this.getEnvSelfDescriptor(component);\n const result = envComponentSelfDescriptor\n ? { ...componentDescriptor, self: envComponentSelfDescriptor }\n : componentDescriptor;\n return result;\n }\n\n /**\n * Get env descriptor from the env itself if the component is an env\n * This will be empty for regular component, and will only contain data for env themself\n */\n private async getEnvSelfDescriptor(envComponent: Component): Promise<EnvCompDescriptorProps | undefined> {\n // !important calculate only on the env itself.\n if (!this.isEnvRegistered(envComponent.id.toString())) {\n return undefined;\n }\n\n const envDef = this.getEnvFromComponent(envComponent);\n if (!envDef) return undefined;\n\n const rawServices = this.getServices(envDef);\n const services = rawServices.toObject();\n // const selfDescriptor = (await this.getEnvDescriptorFromEnvDef(envDef)) || {};\n const selfDescriptor = await this.getEnvDescriptorFromEnvDef(envDef);\n\n if (!selfDescriptor) return undefined;\n return {\n ...selfDescriptor,\n services,\n };\n }\n\n /**\n * Get env descriptor from the env that a given component is using\n */\n private async getComponentEnvDescriptor(\n component: Component,\n opts: GetCalcEnvOptions = {}\n ): Promise<RegularCompDescriptor | undefined> {\n const envDef = this.calculateEnv(component, opts);\n return this.getEnvDescriptorFromEnvDef(envDef);\n }\n\n private async getEnvDescriptorFromEnvDef(envDef: EnvDefinition): Promise<RegularCompDescriptor | undefined> {\n if (!envDef.env.__getDescriptor || typeof envDef.env.__getDescriptor !== 'function') {\n return undefined;\n }\n const systemDescriptor = await envDef.env.__getDescriptor();\n\n return {\n type: systemDescriptor.type,\n // Make sure to store the env id in the data without the version\n // The version should always come from the aspect id configured on the component\n id: envDef.id.split('@')[0],\n name: envDef.name,\n icon: envDef.env.icon,\n description: envDef.description,\n };\n }\n\n resolveEnv(component: Component, id: string) {\n const matchedEntry = component.state.aspects.entries.find((aspectEntry) => {\n return id === aspectEntry.id.toString() || id === aspectEntry.id.toString({ ignoreVersion: true });\n });\n\n return matchedEntry?.id;\n }\n\n /**\n * This used to calculate the actual env during the component load.\n * Do not use it to get the env (use getEnv instead)\n * This should be used only during on load\n */\n async calculateEnvId(component: Component): Promise<ComponentID> {\n // Search first for env configured via envs aspect itself\n const envIdFromEnvsConfig = this.getEnvIdFromEnvsConfig(component);\n // if (!envIdFromEnvsConfig) return this.getDefaultEnv();\n const envIdFromEnvsConfigWithoutVersion = envIdFromEnvsConfig\n ? ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion()\n : undefined;\n\n if (envIdFromEnvsConfig && this.isCoreEnv(envIdFromEnvsConfig)) {\n return ComponentID.fromString(envIdFromEnvsConfig);\n }\n\n // in some cases we have the id configured in the teambit.envs/envs but without the version\n // in such cases we won't find it in the slot\n // we search in the component aspect list a matching aspect which is match the id from the teambit.envs/envs\n if (envIdFromEnvsConfigWithoutVersion) {\n const matchedEntry = component.state.aspects.entries.find((aspectEntry) => {\n return (\n envIdFromEnvsConfigWithoutVersion === aspectEntry.id.toString() ||\n envIdFromEnvsConfigWithoutVersion === aspectEntry.id.toString({ ignoreVersion: true })\n );\n });\n\n if (matchedEntry?.id) return matchedEntry?.id;\n }\n\n // in case there is no config in teambit.envs/envs search the aspects for the first env that registered as env\n let ids: string[] = [];\n component.state.aspects.entries.forEach((aspectEntry) => {\n ids.push(aspectEntry.id.toString());\n // ids.push(aspectEntry.id.toString({ ignoreVersion: true }));\n });\n ids = uniq(ids);\n const envId = await this.findFirstEnv(ids);\n const finalId = envId || this.getDefaultEnv().id;\n return ComponentID.fromString(finalId);\n }\n\n /**\n * This used to calculate the actual env during the component load.\n * Do not use it to get the env (use getEnv instead)\n * This should be used only during on load\n */\n calculateEnv(component: Component, opts: GetCalcEnvOptions = {}): EnvDefinition {\n // Search first for env configured via envs aspect itself\n const envIdFromEnvsConfig = this.getEnvIdFromEnvsConfig(component);\n let envIdFromEnvsConfigWithoutVersion;\n if (envIdFromEnvsConfig) {\n envIdFromEnvsConfigWithoutVersion = ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion();\n const envDef = this.getEnvDefinitionByStringId(envIdFromEnvsConfigWithoutVersion);\n if (envDef) {\n this.envIds.add(envDef.id);\n return envDef;\n }\n }\n\n // in some cases we have the id configured in the teambit.envs/envs but without the version\n // in such cases we won't find it in the slot\n // we search in the component aspect list a matching aspect which is match the id from the teambit.envs/envs\n if (envIdFromEnvsConfigWithoutVersion) {\n const matchedEntry = component.state.aspects.entries.find((aspectEntry) => {\n return (\n envIdFromEnvsConfigWithoutVersion === aspectEntry.id.toString() ||\n envIdFromEnvsConfigWithoutVersion === aspectEntry.id.toString({ ignoreVersion: true })\n );\n });\n if (matchedEntry) {\n // during the tag process, the version in the aspect-entry-id is changed and is not the\n // same as it was when it registered to the slot.\n const envDef = this.getEnvDefinitionById(matchedEntry.id);\n if (envDef) {\n this.envIds.add(envDef.id);\n return envDef;\n }\n if (!opts.skipWarnings) {\n // Do not allow a non existing env\n this.printWarningIfFirstTime(\n matchedEntry.id.toString(),\n `environment with ID: ${matchedEntry.id.toString()} configured on component ${component.id.toString()} was not loaded (run \"bit install\")`\n );\n }\n }\n // Do not allow configure teambit.envs/envs on the component without configure the env aspect itself\n // const errMsg = new EnvNotConfiguredForComponent(envIdFromEnvsConfig as string, component.id.toString()).message;\n // this.printWarningIfFirstTime(envIdFromEnvsConfig as string, errMsg);\n }\n\n // in case there is no config in teambit.envs/envs search the aspects for the first env that registered as env\n let envDefFromList;\n component.state.aspects.entries.find((aspectEntry) => {\n const envDef = this.getEnvDefinitionById(aspectEntry.id);\n if (envDef) {\n envDefFromList = envDef;\n }\n return !!envDef;\n });\n\n if (envDefFromList) {\n this.envIds.add(envDefFromList.id);\n return envDefFromList;\n }\n return this.getDefaultEnv();\n }\n\n /**\n * an env can be configured on a component in two ways:\n * 1) explicitly inside \"teambit.envs/envs\". `{ \"teambit.envs/envs\": { \"env\": \"my-env\" } }`\n * 2) the env aspect is set on the variant as any other aspect, e.g. `{ \"my-env\": {} }`\n *\n * this method returns #1 if exists, otherwise, #2.\n */\n getAllEnvsConfiguredOnComponent(component: Component): EnvDefinition[] {\n // if a component has \"envs\" config, use it and ignore other components that are set up\n // in this components which happen to be envs.\n const envDef = this.getEnvFromEnvsConfig(component);\n if (envDef) {\n return [envDef];\n }\n\n return this.getEnvsNotFromEnvsConfig(component);\n }\n\n /**\n * whether a component has an env configured (either by variant or .bitmap).\n */\n hasEnvConfigured(component: Component): boolean {\n return Boolean(this.getAllEnvsConfiguredOnComponent(component).length);\n }\n\n getAllRegisteredEnvs(): string[] {\n return this.envSlot.toArray().map((envData) => envData[0]);\n }\n\n getAllRegisteredEnvJsoncCustomizers(): EnvJsoncMergeCustomizer[] {\n return this.envJsoncMergeCustomizerSlot.toArray().map((customizerEntry) => customizerEntry[1]);\n }\n\n getEnvPlugin() {\n return new EnvPlugin(this.envSlot, this.servicesRegistry, this.loggerMain, this.workerMain, this.harmony);\n }\n\n /**\n * an env can be configured on a component in two ways:\n * 1) explicitly inside \"teambit.envs/envs\". `{ \"teambit.envs/envs\": { \"env\": \"my-env\" } }`\n * 2) the env aspect is set on the variant as any other aspect, e.g. `{ \"my-env\": {} }`\n *\n * this method returns only #1\n */\n getEnvFromEnvsConfig(component: Component): EnvDefinition | undefined {\n const envIdFromEnvsConfig = this.getEnvIdFromEnvsConfig(component);\n if (!envIdFromEnvsConfig) {\n return undefined;\n }\n const envIdFromEnvsConfigWithoutVersion = ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion();\n const envDef = this.getEnvDefinitionByStringId(envIdFromEnvsConfigWithoutVersion);\n return envDef;\n }\n\n /**\n * an env can be configured on a component in two ways:\n * 1) explicitly inside \"teambit.envs/envs\". `{ \"teambit.envs/envs\": { \"env\": \"my-env\" } }`\n * 2) the env aspect is set on the variant as any other aspect, e.g. `{ \"my-env\": {} }`\n *\n * this method returns only #2\n */\n getEnvsNotFromEnvsConfig(component: Component): EnvDefinition[] {\n return component.state.aspects.entries.reduce((acc: EnvDefinition[], aspectEntry) => {\n const envDef = this.getEnvDefinitionById(aspectEntry.id);\n if (envDef) acc.push(envDef);\n return acc;\n }, []);\n }\n\n getEnvIdFromEnvsLegacyExtensions(extensions: ExtensionDataList): string | undefined {\n const envsAspect = extensions.findCoreExtension(EnvsAspect.id);\n const envIdFromEnvsConfig = envsAspect?.data.id;\n return envIdFromEnvsConfig;\n }\n\n /**\n * @deprecated DO NOT USE THIS METHOD ANYMORE!!! (PLEASE USE .calculateEnvId() instead!)\n */\n async calculateEnvIdFromExtensions(extensions: ExtensionDataList): Promise<string> {\n // Search first for env configured via envs aspect itself\n const envsAspect = extensions.findCoreExtension(EnvsAspect.id);\n const envIdFromEnvsConfig = envsAspect?.config.env;\n\n const envIdFromEnvsConfigWithoutVersion = envIdFromEnvsConfig\n ? ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion()\n : undefined;\n\n if (envIdFromEnvsConfig && this.isCoreEnv(envIdFromEnvsConfig)) {\n return envIdFromEnvsConfig;\n }\n\n // in some cases we have the id configured in the teambit.envs/envs but without the version\n // in such cases we won't find it in the slot\n // we search in the component aspect list a matching aspect which is match the id from the teambit.envs/envs\n if (envIdFromEnvsConfigWithoutVersion) {\n const matchedEntry = extensions.find((extension) => {\n if (extension.extensionId) {\n return (\n envIdFromEnvsConfigWithoutVersion === extension.extensionId.toString() ||\n envIdFromEnvsConfigWithoutVersion === extension.extensionId.toString({ ignoreVersion: true })\n );\n }\n return envIdFromEnvsConfigWithoutVersion === extension.stringId;\n });\n if (matchedEntry?.id) return matchedEntry?.stringId;\n }\n\n // in case there is no config in teambit.envs/envs search the aspects for the first env that registered as env\n const ids: string[] = [];\n extensions.forEach((extension) => {\n if (extension.extensionId) {\n ids.push(extension.extensionId.toString());\n } else {\n ids.push(extension.stringId);\n }\n });\n const envId = await this.findFirstEnv(ids);\n const finalId = envId || this.getDefaultEnv().id;\n return finalId;\n }\n\n /**\n * @deprecated DO NOT USE THIS METHOD ANYMORE!!! (PLEASE USE .calculateEnv() instead!)\n */\n async calculateEnvFromExtensions(extensions: ExtensionDataList): Promise<EnvDefinition> {\n // Search first for env configured via envs aspect itself\n const envsAspect = extensions.findCoreExtension(EnvsAspect.id);\n const envIdFromEnvsConfig = envsAspect?.config.env;\n let envIdFromEnvsConfigWithoutVersion;\n\n if (envIdFromEnvsConfig) {\n envIdFromEnvsConfigWithoutVersion = ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion();\n const envDef = this.getEnvDefinitionByStringId(envIdFromEnvsConfigWithoutVersion);\n if (envDef) {\n this.envIds.add(envDef.id);\n return envDef;\n }\n }\n\n // in some cases we have the id configured in the teambit.envs/envs but without the version\n // in such cases we won't find it in the slot\n // we search in the component aspect list a matching aspect which is match the id from the teambit.envs/envs\n if (envIdFromEnvsConfigWithoutVersion) {\n const matchedEntry = extensions.find((extension) => {\n if (extension.extensionId) {\n return (\n envIdFromEnvsConfigWithoutVersion === extension.extensionId.toString() ||\n envIdFromEnvsConfigWithoutVersion === extension.extensionId.toString({ ignoreVersion: true })\n );\n }\n return envIdFromEnvsConfigWithoutVersion === extension.stringId;\n });\n if (matchedEntry) {\n // during the tag process, the version in the aspect-entry-id is changed and is not the\n // same as it was when it registered to the slot.\n const envDef = this.getEnvDefinitionByLegacyExtension(matchedEntry);\n if (envDef) {\n this.envIds.add(envDef.id);\n return envDef;\n }\n // Do not allow a non existing env\n // this.printWarningIfFirstTime(\n // matchedEntry.id.toString(),\n // `environment with ID: ${matchedEntry.id.toString()} was not found`\n // );\n }\n // Do not allow configure teambit.envs/envs on the component without configure the env aspect itself\n // const errMsg = new EnvNotConfiguredForComponent(envIdFromEnvsConfig).message;\n // this.printWarningIfFirstTime(envIdFromEnvsConfig, errMsg);\n }\n\n // in case there is no config in teambit.envs/envs search the aspects for the first env that registered as env\n const ids: string[] = [];\n extensions.forEach((extension) => {\n if (extension.extensionId) {\n ids.push(extension.extensionId.toString());\n } else {\n ids.push(extension.stringId);\n }\n });\n const envId = await this.findFirstEnv(ids);\n const envDef = envId ? this.getEnvDefinitionByStringId(envId) : undefined;\n\n return envDef || this.getDefaultEnv();\n }\n\n /**\n * This function finds the first environment ID from a list of IDs by checking if it is register as env (to the slot).\n * or contains env.jsonc file\n * @param {string[]} ids - `ids` is an array of string values representing environment IDs. The function `findFirstEnv`\n * takes this array as input and returns a Promise that resolves to a string value representing the first environment ID\n * that matches certain conditions.\n * @returns The `findFirstEnv` function returns a Promise that resolves to a string or undefined. The string represents\n * the ID of the first environment that matches the conditions specified in the function, or undefined if no environment\n * is found.\n */\n private async findFirstEnv(ids: string[]): Promise<string | undefined> {\n let isFoundWithoutVersion = false;\n const envId = await pLocate(ids, async (id) => {\n const idWithoutVersion = id.split('@')[0];\n if (this.isCoreEnv(idWithoutVersion)) return true;\n if (isCoreAspect(idWithoutVersion)) return false;\n const envDef = this.getEnvDefinitionByStringId(id);\n if (envDef) return true;\n const envDefWithoutVersion = this.getEnvDefinitionByStringId(idWithoutVersion);\n if (envDefWithoutVersion) {\n isFoundWithoutVersion = true;\n return true;\n }\n const envComponent = await this.getEnvComponentByEnvId(id);\n const hasManifest = this.hasEnvManifest(envComponent);\n if (hasManifest) return true;\n const isUsingEnvEnv = this.isUsingEnvEnv(envComponent);\n return !!isUsingEnvEnv;\n });\n let finalEnvId;\n if (envId) {\n finalEnvId = isFoundWithoutVersion ? envId?.split('@')[0] : envId;\n this.envIds.add(envId);\n }\n return finalEnvId;\n }\n\n private getEnvDefinitionByLegacyExtension(extension: ExtensionDataEntry): EnvDefinition | undefined {\n const envDef = extension.extensionId\n ? this.getEnvDefinitionById(extension.extensionId)\n : this.getEnvDefinitionByStringId(extension.stringId);\n return envDef;\n }\n\n getEnvIdFromEnvsConfig(component: Component): string | undefined {\n const envsAspect = component.state.aspects.get(EnvsAspect.id);\n return envsAspect?.config.env;\n }\n\n getEnvDefinition(id: ComponentID) {\n const allVersions = this.envSlot.toArray();\n const all = allVersions.filter(([envId]) => envId.includes(id.toStringWithoutVersion()));\n const first = head(all);\n if (!first) return undefined;\n const [envId, env] = first;\n return new EnvDefinition(envId, env);\n }\n\n getEnvDefinitionById(id: ComponentID): EnvDefinition | undefined {\n const envDef =\n this.getEnvDefinitionByStringId(id.toString()) ||\n this.getEnvDefinitionByStringId(id.toString({ ignoreVersion: true }));\n return envDef;\n }\n\n public getEnvDefinitionByStringId(envId: string): EnvDefinition | undefined {\n const env = this.envSlot.get(envId);\n if (env) {\n return new EnvDefinition(envId, env as Environment);\n }\n return undefined;\n }\n\n getEnvFromComponent(envComponent: Component): EnvDefinition | undefined {\n const env = this.getEnvDefinitionById(envComponent.id);\n return env;\n }\n\n /**\n * Return the env definition of teambit.envs/env\n */\n getEnvsEnvDefinition(): EnvDefinition {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.getEnvDefinitionByStringId('teambit.envs/env')!;\n }\n\n private printWarningIfFirstTime(envId: string, message: string) {\n if (!this.alreadyShownWarning[envId] && !this.failedToLoadEnvs.has(envId)) {\n this.alreadyShownWarning[envId] = true;\n this.logger.consoleWarning(message);\n this.addFailedToLoadEnvs(envId);\n }\n }\n\n /**\n * determines whether an env is registered.\n */\n public isEnvRegistered(id: string) {\n return Boolean(this.envSlot.get(id));\n }\n\n isUsingAspectEnv(component: Component): boolean {\n const data = this.getEnvData(component);\n if (!data) return false;\n return data.type === 'aspect';\n }\n\n isUsingEnvEnv(component: Component): boolean {\n const data = this.getEnvData(component);\n if (!data) return false;\n return data.type === 'env';\n }\n\n /**\n * Check if the given component is an env component.\n * @param component\n * @returns\n */\n isEnv(component: Component): boolean {\n return (\n this.isUsingEnvEnv(component) ||\n this.isEnvRegistered(component.id.toString()) ||\n this.isEnvRegistered(component.id.toStringWithoutVersion())\n );\n }\n\n /**\n * register a new environment service.\n */\n registerService(...envServices: EnvService<any>[]) {\n this.servicesRegistry.register(envServices);\n return this;\n }\n\n /**\n * get list of services enabled on an env.\n */\n getServices(env: EnvDefinition): EnvServiceList {\n const allServices = this.servicesRegistry.toArray();\n const services: [string, EnvService<any>][] = [];\n allServices.forEach(([id, currentServices]) => {\n currentServices.forEach((service) => {\n try {\n if (this.implements(env, service)) {\n services.push([id, service]);\n }\n } catch (err) {\n this.logger.warn(`failed loading service ${id} for env ${env.id}`);\n }\n });\n });\n return new EnvServiceList(env, services);\n }\n\n implements(env: EnvDefinition, service: EnvService<any>) {\n // TODO: remove this after refactoring everything and remove getDescriptor from being optional.\n if (!service.getDescriptor) return false;\n return !!service.getDescriptor(env);\n }\n\n /**\n * register an environment.\n */\n registerEnv(env: Environment) {\n return this.envSlot.register(env);\n }\n\n /**\n * register an env.jsonc merge customizer.\n */\n registerEnvJsoncMergeCustomizer(customizer: EnvJsoncMergeCustomizer) {\n return this.envJsoncMergeCustomizerSlot.register(customizer);\n }\n\n async addNonLoadedEnvAsComponentIssues(components: Component[]) {\n await pMapSeries(components, async (component) => {\n const envId = await this.calculateEnvId(component);\n const envIdStr = envId.toString();\n if (!this.isEnvRegistered(envIdStr)) {\n this.addFailedToLoadEnvs(envIdStr);\n // If there is no version and the env is not in the workspace this is not valid\n // you can't set external env without version\n if (!envIdStr.includes('@')) {\n const foundComp = components.find((c) => c.id.toStringWithoutVersion() === envIdStr);\n if (!foundComp) {\n component.state.issues.getOrCreate(IssuesClasses.ExternalEnvWithoutVersion).data = {\n envId: envIdStr,\n componentId: component.id.toString(),\n };\n } else {\n component.state.issues.getOrCreate(IssuesClasses.NonLoadedEnv).data = envIdStr;\n }\n } else {\n component.state.issues.getOrCreate(IssuesClasses.NonLoadedEnv).data = envIdStr;\n }\n }\n });\n }\n\n // refactor here\n private async createRuntime(components: Component[]): Promise<Runtime> {\n return new Runtime(await this.aggregateByDefs(components), this.logger);\n }\n\n // :TODO can be refactored to few utilities who will make repeating this very easy.\n private async aggregateByDefs(components: Component[]): Promise<EnvRuntime[]> {\n this.throwForDuplicateComponents(components);\n const envsMap = {};\n components.forEach((component: Component) => {\n const envDef = this.getEnv(component);\n const envId = envDef.id;\n const env = envDef.env;\n // handle config as well when aggregating envs.\n if (envsMap[envId]) envsMap[envId].components.push(component);\n else\n envsMap[envId] = {\n components: [component],\n env,\n };\n });\n\n return Promise.all(\n Object.keys(envsMap).map(async (key) => {\n const envAspectDef = await this.getEnvAspectDef(key);\n return new EnvRuntime(key, envsMap[key].env, envsMap[key].components, envAspectDef);\n })\n );\n }\n\n private async getEnvAspectDef(envId: string): Promise<AspectDefinition> {\n const host = this.componentMain.getHost();\n const id = await host.resolveComponentId(envId);\n // We don't want to filter by runtime here as we want to also get envs that configured as plugins. so they don't\n // contain the runtime path.\n const resolvedAspects = await host.resolveAspects(MainRuntime.name, [id], {\n requestedOnly: true,\n filterByRuntime: false,\n useScopeAspectsCapsule: true,\n });\n const def = resolvedAspects[0];\n\n return def;\n }\n\n private throwForDuplicateComponents(components: Component[]) {\n const idsStr = components.map((c) => c.id.toString());\n const duplications = findDuplications(idsStr);\n if (duplications.length) {\n throw new Error(`found duplicated components: ${duplications.join(', ')}`);\n }\n }\n\n static slots = [\n Slot.withType<Environment>(),\n Slot.withType<EnvService<any>>(),\n Slot.withType<EnvJsoncMergeCustomizerRegistry>(),\n ];\n\n static dependencies = [GraphqlAspect, LoggerAspect, ComponentAspect, CLIAspect, WorkerAspect, IssuesAspect];\n\n static async provider(\n [graphql, loggerAspect, component, cli, worker, issues]: [\n GraphqlMain,\n LoggerMain,\n ComponentMain,\n CLIMain,\n WorkerMain,\n IssuesMain\n ],\n config: EnvsConfig,\n [envSlot, servicesRegistry, envJsoncMergeCustomizerSlot]: [\n EnvsRegistry,\n ServicesRegistry,\n EnvJsoncMergeCustomizerRegistry\n ],\n context: Harmony\n ) {\n const logger = loggerAspect.createLogger(EnvsAspect.id);\n const envs = new EnvsMain(\n config,\n context,\n envSlot,\n logger,\n servicesRegistry,\n component,\n loggerAspect,\n worker,\n envJsoncMergeCustomizerSlot\n );\n component.registerShowFragments([new EnvFragment(envs)]);\n if (issues) issues.registerAddComponentsIssues(envs.addNonLoadedEnvAsComponentIssues.bind(envs));\n\n const envsCmd = new EnvsCmd(envs, component);\n envsCmd.commands = [new ListEnvsCmd(envs, component), new GetEnvCmd(envs, component)];\n cli.register(envsCmd);\n graphql.register(environmentsSchema(envs));\n return envs;\n }\n}\n\nEnvsAspect.addRuntime(EnvsMain);\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,gBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,eAAA,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kC,2BAA2B,CAACH,IAAI,CAACpC,gCAAgC,CAAC7K,IAAI,CAACiN,IAAI,CAAC,CAAC;IAEhG,MAAMI,OAAO,GAAG,KAAIC,eAAO,EAACL,IAAI,EAAEhK,SAAS,CAAC;IAC5CoK,OAAO,CAACE,QAAQ,GAAG,CAAC,KAAIC,mBAAW,EAACP,IAAI,EAAEhK,SAAS,CAAC,EAAE,KAAIwK,iBAAS,EAACR,IAAI,EAAEhK,SAAS,CAAC,CAAC;IACrF4J,GAAG,CAACzC,QAAQ,CAACiD,OAAO,CAAC;IACrBV,OAAO,CAACvC,QAAQ,CAAC,IAAAsD,mCAAkB,EAACT,IAAI,CAAC,CAAC;IAC1C,OAAOA,IAAI;EACb;AACF;AAAC3Q,OAAA,CAAAC,QAAA,GAAAA,QAAA;AAAAlB,eAAA,CAphCYkB,QAAQ,aAgBF2P,kBAAW;AAAA7Q,eAAA,CAhBjBkB,QAAQ,WAs+BJ,CACboR,eAAI,CAACC,QAAQ,CAAc,CAAC,EAC5BD,eAAI,CAACC,QAAQ,CAAkB,CAAC,EAChCD,eAAI,CAACC,QAAQ,CAAkC,CAAC,CACjD;AAAAvS,eAAA,CA1+BUkB,QAAQ,kBA4+BG,CAACsR,wBAAa,EAAEC,sBAAY,EAAEC,4BAAe,EAAEC,gBAAS,EAAEC,sBAAY,EAAEC,sBAAY,CAAC;AA0C7G3K,0BAAU,CAAC4K,UAAU,CAAC5R,QAAQ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_path","data","require","_findRoot","_interopRequireDefault","_toolboxModules","_bit","_fsExtra","_pLocate","_commentJson","_cli","_component","_graphql","_issues","_pMapSeries","_componentIssues","_harmony","_logger","_bitError","_toolboxArray","_lodash","_worker","_componentId","_environments","_environments2","_runtime","_envDefinition","_envServiceList","_envs","_env","_exceptions","_env2","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DEFAULT_ENV","exports","EnvsMain","icon","constructor","config","harmony","envSlot","logger","servicesRegistry","componentMain","loggerMain","workerMain","envJsoncMergeCustomizerSlot","Set","createEnvironment","components","createRuntime","addFailedToLoadEnvs","id","failedToLoadEnvs","add","envIds","addFailedToLoadExt","failedToLoadExt","has","resetFailedToLoadEnvs","clear","getFailedToLoadEnvs","Array","from","extId","uniq","getDefaultEnv","defaultEnv","get","Error","EnvDefinition","getCoreEnvsIds","compose","targetEnv","envTransformers","a","reduce","acc","transformer","override","propsToOverride","env","merge","sourceEnv","allNames","prototype","getPrototypeOf","name","getOwnPropertyNames","key","fn","includes","bind","hasEnvManifest","envComponent","legacyFiles","undefined","files","filesystem","envJson","find","file","relative","getEnvManifest","object","parse","contents","toString","resolvedObject","recursivelyMergeWithParentManifest","path","originPath","extends","parentPackageName","parentPath","resolveFrom","parentResolvedPath","findRoot","existsSync","info","parentEnvJsoncPath","map","fileName","join","filePath","consoleWarning","parentStr","readFileSync","parentObject","mergedObject","mergeEnvManifests","parent","child","merged","mergeCustomizer","getAllRegisteredEnvJsoncCustomizers","customizer","oneMerged","hasEnvManifestById","envId","requesting","component","getEnvComponentByEnvId","getEnvData","envsData","state","aspects","EnvsAspect","getEnvIdFromEnvsData","ignoreVersion","rawEnvId","envIdWithoutVersion","ComponentID","fromString","toStringWithoutVersion","getEnvId","envIdFromEnvData","withVersion","resolveEnv","withVersionMatch","toArray","withVersionMatchId","exactMatch","exactMatchId","EnvNotConfiguredForComponent","isUsingCoreEnv","isCoreEnv","getEnv","envDef","getEnvDefinitionByStringId","EnvNotFound","getEnvComponent","host","getHost","newId","resolveComponentId","BitError","getOrCalculateEnv","err","calculateEnv","getDescriptor","calcDescriptor","opts","componentDescriptor","getComponentEnvDescriptor","envComponentSelfDescriptor","getEnvSelfDescriptor","result","self","isEnvRegistered","getEnvFromComponent","rawServices","getServices","services","toObject","selfDescriptor","getEnvDescriptorFromEnvDef","__getDescriptor","systemDescriptor","type","split","description","matchedEntry","entries","aspectEntry","calculateEnvId","envIdFromEnvsConfig","getEnvIdFromEnvsConfig","envIdFromEnvsConfigWithoutVersion","ids","findFirstEnv","finalId","getEnvDefinitionById","skipWarnings","printWarningIfFirstTime","envDefFromList","getAllEnvsConfiguredOnComponent","getEnvFromEnvsConfig","getEnvsNotFromEnvsConfig","hasEnvConfigured","Boolean","getAllRegisteredEnvsIds","envData","getAllRegisteredEnvs","customizerEntry","getEnvPlugin","EnvPlugin","getEnvIdFromEnvsLegacyExtensions","extensions","envsAspect","findCoreExtension","calculateEnvIdFromExtensions","extension","extensionId","stringId","calculateEnvFromExtensions","getEnvDefinitionByLegacyExtension","isFoundWithoutVersion","pLocate","idWithoutVersion","isCoreAspect","envDefWithoutVersion","hasManifest","isUsingEnvEnv","finalEnvId","getEnvDefinition","allVersions","all","first","head","getEnvsEnvDefinition","message","alreadyShownWarning","isUsingAspectEnv","isEnv","registerService","envServices","register","allServices","currentServices","service","implements","warn","EnvServiceList","registerEnv","registerEnvJsoncMergeCustomizer","addNonLoadedEnvAsComponentIssues","pMapSeries","envIdStr","foundComp","c","issues","getOrCreate","IssuesClasses","ExternalEnvWithoutVersion","componentId","NonLoadedEnv","Runtime","aggregateByDefs","throwForDuplicateComponents","envsMap","Promise","envAspectDef","getEnvAspectDef","EnvRuntime","resolvedAspects","resolveAspects","MainRuntime","requestedOnly","filterByRuntime","useScopeAspectsCapsule","def","idsStr","duplications","findDuplications","provider","graphql","loggerAspect","cli","worker","context","createLogger","envs","registerShowFragments","EnvFragment","registerAddComponentsIssues","envsCmd","EnvsCmd","commands","ListEnvsCmd","GetEnvCmd","environmentsSchema","Slot","withType","GraphqlAspect","LoggerAspect","ComponentAspect","CLIAspect","WorkerAspect","IssuesAspect","addRuntime"],"sources":["environments.main.runtime.ts"],"sourcesContent":["import { join } from 'path';\nimport findRoot from 'find-root';\nimport { resolveFrom } from '@teambit/toolbox.modules.module-resolver';\nimport { isCoreAspect } from '@teambit/bit';\nimport { existsSync, readFileSync } from 'fs-extra';\nimport pLocate from 'p-locate';\nimport { parse } from 'comment-json';\nimport { SourceFile } from '@teambit/component.sources';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Component, ComponentAspect, ComponentMain } from '@teambit/component';\nimport type { EnvPolicyConfigObject } from '@teambit/dependency-resolver';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport type { EnvJsoncPatterns } from '@teambit/dev-files';\nimport pMapSeries from 'p-map-series';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { Harmony, Slot, SlotRegistry } from '@teambit/harmony';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport type { AspectDefinition } from '@teambit/aspect-loader';\nimport { ExtensionDataList, ExtensionDataEntry } from '@teambit/legacy/dist/consumer/config/extension-data';\nimport { BitError } from '@teambit/bit-error';\nimport { findDuplications } from '@teambit/toolbox.array.duplications-finder';\nimport { head, uniq } from 'lodash';\nimport { WorkerAspect, WorkerMain } from '@teambit/worker';\nimport { ComponentID } from '@teambit/component-id';\nimport { EnvService } from './services';\nimport { Environment } from './environment';\nimport { EnvsAspect } from './environments.aspect';\nimport { environmentsSchema } from './environments.graphql';\nimport { EnvRuntime, Runtime } from './runtime';\nimport { EnvDefinition } from './env-definition';\nimport { EnvServiceList } from './env-service-list';\nimport { EnvsCmd, GetEnvCmd, ListEnvsCmd } from './envs.cmd';\nimport { EnvFragment } from './env.fragment';\nimport { EnvNotFound, EnvNotConfiguredForComponent } from './exceptions';\nimport { EnvPlugin } from './env.plugin';\n\nexport type EnvJsonc = {\n extends?: string;\n policy?: EnvPolicyConfigObject;\n patterns?: EnvJsoncPatterns;\n};\n\nexport type EnvJsoncMergeCustomizer = (parentObj: EnvJsonc, childObj: EnvJsonc) => Partial<EnvJsonc>;\n\nexport type EnvsRegistry = SlotRegistry<Environment>;\nexport type EnvJsoncMergeCustomizerRegistry = SlotRegistry<EnvJsoncMergeCustomizer>;\n\nexport type EnvsConfig = {\n env: string;\n options: EnvOptions;\n};\n\ntype GetCalcEnvOptions = {\n skipWarnings?: boolean;\n};\n\nexport type EnvOptions = {};\n\nexport type EnvTransformer = (env: Environment) => Environment;\n\nexport type ServicesRegistry = SlotRegistry<Array<EnvService<any>>>;\n\nexport type RegularCompDescriptor = {\n id: string;\n icon?: string;\n type?: string;\n name?: string;\n description?: string;\n};\nexport type EnvCompDescriptorProps = RegularCompDescriptor & {\n services?: {\n env: {\n id: string;\n icon: string;\n name?: string;\n description?: string;\n };\n services: Array<{\n id: string;\n name?: string;\n description?: string;\n data: any;\n }>;\n };\n};\n\nexport type EnvCompDescriptor = EnvCompDescriptorProps & {\n self?: EnvCompDescriptorProps;\n};\n\nexport type Descriptor = RegularCompDescriptor | EnvCompDescriptor;\n\nexport const DEFAULT_ENV = 'teambit.harmony/node';\n\nexport class EnvsMain {\n /**\n * Envs that are failed to load\n */\n private failedToLoadEnvs = new Set<string>();\n /**\n * Extensions that are failed to load\n * We use this as sometime when we couldn't load an extension we don't know if it's an env or not\n * We should ideally take it from the aspect loader aspect, but right now the aspect loader is using envs\n */\n private failedToLoadExt = new Set<string>();\n /**\n * Ids of envs (not neccesrraly loaded successfully)\n */\n public envIds = new Set<string>();\n\n static runtime = MainRuntime;\n\n private alreadyShownWarning = {};\n\n /**\n * icon of the extension.\n */\n icon() {\n return `<svg width=\"50\" height=\"50\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"25\" cy=\"25\" r=\"20\"/>\n </svg>`;\n }\n\n constructor(\n /**\n * environments extension configuration.\n */\n readonly config: EnvsConfig,\n\n /**\n * harmony context.\n */\n private harmony: Harmony,\n\n /**\n * slot for allowing extensions to register new environment.\n */\n private envSlot: EnvsRegistry,\n\n private logger: Logger,\n\n private servicesRegistry: ServicesRegistry,\n\n private componentMain: ComponentMain,\n\n private loggerMain: LoggerMain,\n\n private workerMain: WorkerMain,\n\n private envJsoncMergeCustomizerSlot: EnvJsoncMergeCustomizerRegistry\n ) {}\n\n /**\n * creates a new runtime environments for a set of components.\n */\n async createEnvironment(components: Component[]): Promise<Runtime> {\n return this.createRuntime(components);\n }\n\n /**\n *\n * @param id\n */\n /**\n * This function adds an extension ID to a set of failed to load extensions.\n * This mostly used by the aspect loader to add such issues\n * Then it is used to hide different errors that are caused by the same issue.\n * @param {string} id - string - represents the unique identifier of an extension that failed to load.\n */\n addFailedToLoadEnvs(id: string) {\n this.failedToLoadEnvs.add(id);\n this.envIds.add(id);\n }\n\n addFailedToLoadExt(id: string) {\n this.failedToLoadExt.add(id);\n if (this.envIds.has(id)) {\n this.addFailedToLoadEnvs(id);\n }\n }\n\n resetFailedToLoadEnvs() {\n this.failedToLoadEnvs.clear();\n this.failedToLoadExt.clear();\n }\n\n getFailedToLoadEnvs() {\n const failedToLoadEnvs = Array.from(this.failedToLoadEnvs);\n // Add all extensions which are also envs\n for (const extId of this.failedToLoadExt) {\n if (this.envIds.has(extId)) {\n failedToLoadEnvs.push(extId);\n }\n }\n return uniq(failedToLoadEnvs);\n }\n\n /**\n * get the configured default env.\n */\n getDefaultEnv(): EnvDefinition {\n const defaultEnv = this.envSlot.get(DEFAULT_ENV);\n if (!defaultEnv) throw new Error('default env must be set.');\n\n return new EnvDefinition(DEFAULT_ENV, defaultEnv);\n }\n\n getCoreEnvsIds(): string[] {\n return [\n 'teambit.harmony/aspect',\n 'teambit.react/react',\n 'teambit.harmony/node',\n 'teambit.react/react-native',\n 'teambit.html/html',\n 'teambit.mdx/mdx',\n 'teambit.envs/env',\n 'teambit.mdx/readme',\n 'teambit.harmony/bit-custom-aspect',\n ];\n }\n\n /**\n * compose a new environment from a list of environment transformers.\n */\n compose(targetEnv: Environment, envTransformers: EnvTransformer[]) {\n const a = envTransformers.reduce((acc, transformer) => {\n acc = transformer(acc);\n return acc;\n }, targetEnv);\n\n return a;\n }\n\n /**\n * create an env transformer which overrides specific env properties.\n */\n override(propsToOverride: Environment): EnvTransformer {\n return (env: Environment) => {\n return this.merge(propsToOverride, env);\n };\n }\n\n /**\n * compose two environments into one.\n */\n merge<T extends Environment, S extends Environment>(targetEnv: Environment, sourceEnv: Environment): T & S {\n const allNames = new Set<string>();\n const keys = ['icon', 'name', 'description'];\n for (let o = sourceEnv; o !== Object.prototype; o = Object.getPrototypeOf(o)) {\n for (const name of Object.getOwnPropertyNames(o)) {\n allNames.add(name);\n }\n }\n\n allNames.forEach((key: string) => {\n const fn = sourceEnv[key];\n if (targetEnv[key]) return;\n if (keys.includes(key)) targetEnv[key] = fn;\n if (!fn || !fn.bind) {\n return;\n }\n targetEnv[key] = fn.bind(sourceEnv);\n });\n\n return targetEnv as T & S;\n }\n\n /**\n * This function checks if an environment manifest file exists in a given component or set of legacy files.\n * @param {Component} [envComponent] - A component object that represents an environment. It contains information about\n * the files and directories that make up the environment.\n * @param {SourceFile[]} [legacyFiles] - An optional array of SourceFile objects representing the files in the legacy\n * file system. If this parameter is not provided, the function will attempt to retrieve the files from the envComponent\n * parameter.\n * @returns a boolean value indicating whether an `env.jsonc` or `env.json` file exists in the `files` array of either\n * the `envComponent` object or the `legacyFiles` array. If neither `envComponent` nor `legacyFiles` are provided, the\n * function returns `undefined`.\n */\n hasEnvManifest(envComponent?: Component, legacyFiles?: SourceFile[]): boolean | undefined {\n if (!envComponent && !legacyFiles) return undefined;\n // @ts-ignore\n const files = legacyFiles || envComponent.filesystem.files;\n const envJson = files.find((file) => {\n return file.relative === 'env.jsonc' || file.relative === 'env.json';\n });\n\n if (!envJson) return false;\n return true;\n }\n\n getEnvManifest(envComponent?: Component, legacyFiles?: SourceFile[]): EnvJsonc | undefined {\n // TODO: maybe throw an error here?\n if (!envComponent && !legacyFiles) return undefined;\n // @ts-ignore\n const files = legacyFiles || envComponent.filesystem.files;\n const envJson = files.find((file) => {\n return file.relative === 'env.jsonc' || file.relative === 'env.json';\n });\n\n if (!envJson) return undefined;\n\n const object: EnvJsonc = parse(envJson.contents.toString('utf8'), undefined, true);\n const resolvedObject = this.recursivelyMergeWithParentManifest(object, envJson.path);\n return resolvedObject;\n }\n\n recursivelyMergeWithParentManifest(object: EnvJsonc, originPath: string): EnvJsonc {\n if (!object.extends) return object;\n const parentPackageName = object.extends;\n const parentPath = resolveFrom(originPath, [parentPackageName]);\n const parentResolvedPath = findRoot(parentPath);\n if (!parentResolvedPath || !existsSync(parentResolvedPath)) {\n this.logger.info(`failed finding parent manifest for ${parentPackageName} at ${parentResolvedPath}`);\n }\n const parentEnvJsoncPath = ['env.jsonc', 'env.json']\n .map((fileName) => join(parentResolvedPath, fileName))\n .find((filePath) => {\n return existsSync(filePath);\n });\n if (!parentEnvJsoncPath) {\n this.logger.consoleWarning(\n `failed finding parent manifest for ${parentPackageName} at ${parentResolvedPath} referred from ${originPath}`\n );\n return object;\n }\n const parentStr = readFileSync(parentEnvJsoncPath).toString('utf8');\n const parentObject: EnvJsonc = parse(parentStr, undefined, true);\n const mergedObject = this.mergeEnvManifests(parentObject, object);\n if (mergedObject.extends) {\n return this.recursivelyMergeWithParentManifest(mergedObject, parentEnvJsoncPath);\n }\n return mergedObject;\n }\n\n mergeEnvManifests(parent: EnvJsonc, child: EnvJsonc): EnvJsonc {\n let merged: EnvJsonc = {};\n const mergeCustomizer = this.getAllRegisteredEnvJsoncCustomizers();\n for (const customizer of mergeCustomizer) {\n const oneMerged = customizer(parent, child);\n merged = { ...merged, ...oneMerged };\n }\n // Take extends specifically from the parent so we can propagate it to the next parent\n if (parent.extends) {\n merged.extends = parent.extends;\n }\n return merged;\n }\n\n async hasEnvManifestById(envId: string, requesting: string): Promise<boolean | undefined> {\n const component = await this.getEnvComponentByEnvId(envId, requesting);\n return this.hasEnvManifest(component);\n }\n\n getEnvData(component: Component): Descriptor {\n let envsData = component.state.aspects.get(EnvsAspect.id);\n if (!envsData) {\n // TODO: remove this once we re-export old components used to store the data here\n envsData = component.state.aspects.get('teambit.workspace/workspace');\n }\n if (!envsData) throw new Error(`env was not configured on component ${component.id.toString()}`);\n return envsData.data as Descriptor;\n }\n\n /**\n * Return the id of the env as configured in the envs data (without version by default)\n * The reason it's not contain version by default is that we want to take the version from the aspect defined on the component itself\n * As this version is stay up to date during tagging the env along with the component\n * @param component\n * @param ignoreVersion\n */\n private getEnvIdFromEnvsData(component: Component, ignoreVersion = true): string | undefined {\n const envsData = this.getEnvData(component);\n if (!envsData) return undefined;\n const rawEnvId = envsData.id;\n if (!rawEnvId) return undefined;\n if (!ignoreVersion) return rawEnvId;\n const envIdWithoutVersion = ComponentID.fromString(rawEnvId).toStringWithoutVersion();\n return envIdWithoutVersion;\n }\n\n /**\n * get the env id of the given component.\n */\n getEnvId(component: Component): string {\n const envIdFromEnvData = this.getEnvIdFromEnvsData(component);\n if (!envIdFromEnvData) {\n // This should never happen\n throw new Error(`no env found for ${component.id.toString()}`);\n }\n const withVersion = this.resolveEnv(component, envIdFromEnvData);\n const withVersionMatch = this.envSlot.toArray().find(([envId]) => {\n return withVersion?.toString() === envId;\n });\n const withVersionMatchId = withVersionMatch?.[0];\n if (withVersionMatchId) return withVersionMatchId;\n\n // Handle core envs\n const exactMatch = this.envSlot.toArray().find(([envId]) => {\n return envIdFromEnvData === envId;\n });\n\n const exactMatchId = exactMatch?.[0];\n if (exactMatchId) return exactMatchId;\n\n if (!withVersion) throw new EnvNotConfiguredForComponent(envIdFromEnvData, component.id.toString());\n return withVersion.toString();\n }\n\n isUsingCoreEnv(component: Component): boolean {\n const envId = this.getEnvId(component);\n return this.isCoreEnv(envId);\n }\n\n isCoreEnv(envId: string): boolean {\n return this.getCoreEnvsIds().includes(envId);\n }\n\n /**\n * get the env of the given component.\n * In case you are asking for the env during on load you should use calculateEnv instead\n */\n getEnv(component: Component): EnvDefinition {\n const id = this.getEnvId(component);\n const envDef = this.getEnvDefinitionByStringId(id);\n if (envDef) {\n return envDef;\n }\n // Do not allow a non existing env\n throw new EnvNotFound(id, component.id.toString());\n }\n\n /**\n * get the env component of the given component.\n */\n async getEnvComponent(component: Component): Promise<Component> {\n const envId = this.getEnvId(component);\n return this.getEnvComponentByEnvId(envId, component.id.toString());\n }\n\n /**\n * get the env component by the env id.\n */\n async getEnvComponentByEnvId(envId: string, requesting?: string): Promise<Component> {\n const host = this.componentMain.getHost();\n const newId = await host.resolveComponentId(envId);\n const envComponent = await host.get(newId);\n if (!envComponent) {\n throw new BitError(`can't load env. env id is ${envId} used by component ${requesting || 'unknown'}`);\n }\n return envComponent;\n }\n\n /**\n * get the env of the given component.\n * This will try to use the regular getEnv but fallback to the calculate env (in case you are using it during on load)\n * This is safe to be used on onLoad as well\n */\n getOrCalculateEnv(component: Component): EnvDefinition {\n try {\n return this.getEnv(component);\n } catch (err) {\n return this.calculateEnv(component);\n }\n }\n\n /**\n * get an environment Descriptor.\n */\n getDescriptor(component: Component): Descriptor | undefined {\n const envsData = this.getEnvData(component);\n envsData.id = this.resolveEnv(component, envsData.id)?.toString() || envsData.id;\n return envsData;\n }\n\n async calcDescriptor(component: Component, opts: GetCalcEnvOptions = {}): Promise<Descriptor | undefined> {\n const componentDescriptor = await this.getComponentEnvDescriptor(component, opts);\n if (!componentDescriptor) return undefined;\n const envComponentSelfDescriptor = await this.getEnvSelfDescriptor(component);\n const result = envComponentSelfDescriptor\n ? { ...componentDescriptor, self: envComponentSelfDescriptor }\n : componentDescriptor;\n return result;\n }\n\n /**\n * Get env descriptor from the env itself if the component is an env\n * This will be empty for regular component, and will only contain data for env themself\n */\n private async getEnvSelfDescriptor(envComponent: Component): Promise<EnvCompDescriptorProps | undefined> {\n // !important calculate only on the env itself.\n if (!this.isEnvRegistered(envComponent.id.toString())) {\n return undefined;\n }\n\n const envDef = this.getEnvFromComponent(envComponent);\n if (!envDef) return undefined;\n\n const rawServices = this.getServices(envDef);\n const services = rawServices.toObject();\n // const selfDescriptor = (await this.getEnvDescriptorFromEnvDef(envDef)) || {};\n const selfDescriptor = await this.getEnvDescriptorFromEnvDef(envDef);\n\n if (!selfDescriptor) return undefined;\n return {\n ...selfDescriptor,\n services,\n };\n }\n\n /**\n * Get env descriptor from the env that a given component is using\n */\n private async getComponentEnvDescriptor(\n component: Component,\n opts: GetCalcEnvOptions = {}\n ): Promise<RegularCompDescriptor | undefined> {\n const envDef = this.calculateEnv(component, opts);\n return this.getEnvDescriptorFromEnvDef(envDef);\n }\n\n private async getEnvDescriptorFromEnvDef(envDef: EnvDefinition): Promise<RegularCompDescriptor | undefined> {\n if (!envDef.env.__getDescriptor || typeof envDef.env.__getDescriptor !== 'function') {\n return undefined;\n }\n const systemDescriptor = await envDef.env.__getDescriptor();\n\n return {\n type: systemDescriptor.type,\n // Make sure to store the env id in the data without the version\n // The version should always come from the aspect id configured on the component\n id: envDef.id.split('@')[0],\n name: envDef.name,\n icon: envDef.env.icon,\n description: envDef.description,\n };\n }\n\n resolveEnv(component: Component, id: string) {\n const matchedEntry = component.state.aspects.entries.find((aspectEntry) => {\n return id === aspectEntry.id.toString() || id === aspectEntry.id.toString({ ignoreVersion: true });\n });\n\n return matchedEntry?.id;\n }\n\n /**\n * This used to calculate the actual env during the component load.\n * Do not use it to get the env (use getEnv instead)\n * This should be used only during on load\n */\n async calculateEnvId(component: Component): Promise<ComponentID> {\n // Search first for env configured via envs aspect itself\n const envIdFromEnvsConfig = this.getEnvIdFromEnvsConfig(component);\n // if (!envIdFromEnvsConfig) return this.getDefaultEnv();\n const envIdFromEnvsConfigWithoutVersion = envIdFromEnvsConfig\n ? ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion()\n : undefined;\n\n if (envIdFromEnvsConfig && this.isCoreEnv(envIdFromEnvsConfig)) {\n return ComponentID.fromString(envIdFromEnvsConfig);\n }\n\n // in some cases we have the id configured in the teambit.envs/envs but without the version\n // in such cases we won't find it in the slot\n // we search in the component aspect list a matching aspect which is match the id from the teambit.envs/envs\n if (envIdFromEnvsConfigWithoutVersion) {\n const matchedEntry = component.state.aspects.entries.find((aspectEntry) => {\n return (\n envIdFromEnvsConfigWithoutVersion === aspectEntry.id.toString() ||\n envIdFromEnvsConfigWithoutVersion === aspectEntry.id.toString({ ignoreVersion: true })\n );\n });\n\n if (matchedEntry?.id) return matchedEntry?.id;\n }\n\n // in case there is no config in teambit.envs/envs search the aspects for the first env that registered as env\n let ids: string[] = [];\n component.state.aspects.entries.forEach((aspectEntry) => {\n ids.push(aspectEntry.id.toString());\n // ids.push(aspectEntry.id.toString({ ignoreVersion: true }));\n });\n ids = uniq(ids);\n const envId = await this.findFirstEnv(ids);\n const finalId = envId || this.getDefaultEnv().id;\n return ComponentID.fromString(finalId);\n }\n\n /**\n * This used to calculate the actual env during the component load.\n * Do not use it to get the env (use getEnv instead)\n * This should be used only during on load\n */\n calculateEnv(component: Component, opts: GetCalcEnvOptions = {}): EnvDefinition {\n // Search first for env configured via envs aspect itself\n const envIdFromEnvsConfig = this.getEnvIdFromEnvsConfig(component);\n let envIdFromEnvsConfigWithoutVersion;\n if (envIdFromEnvsConfig) {\n envIdFromEnvsConfigWithoutVersion = ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion();\n const envDef = this.getEnvDefinitionByStringId(envIdFromEnvsConfigWithoutVersion);\n if (envDef) {\n this.envIds.add(envDef.id);\n return envDef;\n }\n }\n\n // in some cases we have the id configured in the teambit.envs/envs but without the version\n // in such cases we won't find it in the slot\n // we search in the component aspect list a matching aspect which is match the id from the teambit.envs/envs\n if (envIdFromEnvsConfigWithoutVersion) {\n const matchedEntry = component.state.aspects.entries.find((aspectEntry) => {\n return (\n envIdFromEnvsConfigWithoutVersion === aspectEntry.id.toString() ||\n envIdFromEnvsConfigWithoutVersion === aspectEntry.id.toString({ ignoreVersion: true })\n );\n });\n if (matchedEntry) {\n // during the tag process, the version in the aspect-entry-id is changed and is not the\n // same as it was when it registered to the slot.\n const envDef = this.getEnvDefinitionById(matchedEntry.id);\n if (envDef) {\n this.envIds.add(envDef.id);\n return envDef;\n }\n if (!opts.skipWarnings) {\n // Do not allow a non existing env\n this.printWarningIfFirstTime(\n matchedEntry.id.toString(),\n `environment with ID: ${matchedEntry.id.toString()} configured on component ${component.id.toString()} was not loaded (run \"bit install\")`\n );\n }\n }\n // Do not allow configure teambit.envs/envs on the component without configure the env aspect itself\n // const errMsg = new EnvNotConfiguredForComponent(envIdFromEnvsConfig as string, component.id.toString()).message;\n // this.printWarningIfFirstTime(envIdFromEnvsConfig as string, errMsg);\n }\n\n // in case there is no config in teambit.envs/envs search the aspects for the first env that registered as env\n let envDefFromList;\n component.state.aspects.entries.find((aspectEntry) => {\n const envDef = this.getEnvDefinitionById(aspectEntry.id);\n if (envDef) {\n envDefFromList = envDef;\n }\n return !!envDef;\n });\n\n if (envDefFromList) {\n this.envIds.add(envDefFromList.id);\n return envDefFromList;\n }\n return this.getDefaultEnv();\n }\n\n /**\n * an env can be configured on a component in two ways:\n * 1) explicitly inside \"teambit.envs/envs\". `{ \"teambit.envs/envs\": { \"env\": \"my-env\" } }`\n * 2) the env aspect is set on the variant as any other aspect, e.g. `{ \"my-env\": {} }`\n *\n * this method returns #1 if exists, otherwise, #2.\n */\n getAllEnvsConfiguredOnComponent(component: Component): EnvDefinition[] {\n // if a component has \"envs\" config, use it and ignore other components that are set up\n // in this components which happen to be envs.\n const envDef = this.getEnvFromEnvsConfig(component);\n if (envDef) {\n return [envDef];\n }\n\n return this.getEnvsNotFromEnvsConfig(component);\n }\n\n /**\n * whether a component has an env configured (either by variant or .bitmap).\n */\n hasEnvConfigured(component: Component): boolean {\n return Boolean(this.getAllEnvsConfiguredOnComponent(component).length);\n }\n\n getAllRegisteredEnvsIds(): string[] {\n return this.envSlot.toArray().map((envData) => envData[0]);\n }\n\n getAllRegisteredEnvs(): Environment[] {\n return this.envSlot.toArray().map((envData) => envData[1]);\n }\n\n getAllRegisteredEnvJsoncCustomizers(): EnvJsoncMergeCustomizer[] {\n return this.envJsoncMergeCustomizerSlot.toArray().map((customizerEntry) => customizerEntry[1]);\n }\n\n getEnvPlugin() {\n return new EnvPlugin(this.envSlot, this.servicesRegistry, this.loggerMain, this.workerMain, this.harmony);\n }\n\n /**\n * an env can be configured on a component in two ways:\n * 1) explicitly inside \"teambit.envs/envs\". `{ \"teambit.envs/envs\": { \"env\": \"my-env\" } }`\n * 2) the env aspect is set on the variant as any other aspect, e.g. `{ \"my-env\": {} }`\n *\n * this method returns only #1\n */\n getEnvFromEnvsConfig(component: Component): EnvDefinition | undefined {\n const envIdFromEnvsConfig = this.getEnvIdFromEnvsConfig(component);\n if (!envIdFromEnvsConfig) {\n return undefined;\n }\n const envIdFromEnvsConfigWithoutVersion = ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion();\n const envDef = this.getEnvDefinitionByStringId(envIdFromEnvsConfigWithoutVersion);\n return envDef;\n }\n\n /**\n * an env can be configured on a component in two ways:\n * 1) explicitly inside \"teambit.envs/envs\". `{ \"teambit.envs/envs\": { \"env\": \"my-env\" } }`\n * 2) the env aspect is set on the variant as any other aspect, e.g. `{ \"my-env\": {} }`\n *\n * this method returns only #2\n */\n getEnvsNotFromEnvsConfig(component: Component): EnvDefinition[] {\n return component.state.aspects.entries.reduce((acc: EnvDefinition[], aspectEntry) => {\n const envDef = this.getEnvDefinitionById(aspectEntry.id);\n if (envDef) acc.push(envDef);\n return acc;\n }, []);\n }\n\n getEnvIdFromEnvsLegacyExtensions(extensions: ExtensionDataList): string | undefined {\n const envsAspect = extensions.findCoreExtension(EnvsAspect.id);\n const envIdFromEnvsConfig = envsAspect?.data.id;\n return envIdFromEnvsConfig;\n }\n\n /**\n * @deprecated DO NOT USE THIS METHOD ANYMORE!!! (PLEASE USE .calculateEnvId() instead!)\n */\n async calculateEnvIdFromExtensions(extensions: ExtensionDataList): Promise<string> {\n // Search first for env configured via envs aspect itself\n const envsAspect = extensions.findCoreExtension(EnvsAspect.id);\n const envIdFromEnvsConfig = envsAspect?.config.env;\n\n const envIdFromEnvsConfigWithoutVersion = envIdFromEnvsConfig\n ? ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion()\n : undefined;\n\n if (envIdFromEnvsConfig && this.isCoreEnv(envIdFromEnvsConfig)) {\n return envIdFromEnvsConfig;\n }\n\n // in some cases we have the id configured in the teambit.envs/envs but without the version\n // in such cases we won't find it in the slot\n // we search in the component aspect list a matching aspect which is match the id from the teambit.envs/envs\n if (envIdFromEnvsConfigWithoutVersion) {\n const matchedEntry = extensions.find((extension) => {\n if (extension.extensionId) {\n return (\n envIdFromEnvsConfigWithoutVersion === extension.extensionId.toString() ||\n envIdFromEnvsConfigWithoutVersion === extension.extensionId.toString({ ignoreVersion: true })\n );\n }\n return envIdFromEnvsConfigWithoutVersion === extension.stringId;\n });\n if (matchedEntry?.id) return matchedEntry?.stringId;\n }\n\n // in case there is no config in teambit.envs/envs search the aspects for the first env that registered as env\n const ids: string[] = [];\n extensions.forEach((extension) => {\n if (extension.extensionId) {\n ids.push(extension.extensionId.toString());\n } else {\n ids.push(extension.stringId);\n }\n });\n const envId = await this.findFirstEnv(ids);\n const finalId = envId || this.getDefaultEnv().id;\n return finalId;\n }\n\n /**\n * @deprecated DO NOT USE THIS METHOD ANYMORE!!! (PLEASE USE .calculateEnv() instead!)\n */\n async calculateEnvFromExtensions(extensions: ExtensionDataList): Promise<EnvDefinition> {\n // Search first for env configured via envs aspect itself\n const envsAspect = extensions.findCoreExtension(EnvsAspect.id);\n const envIdFromEnvsConfig = envsAspect?.config.env;\n let envIdFromEnvsConfigWithoutVersion;\n\n if (envIdFromEnvsConfig) {\n envIdFromEnvsConfigWithoutVersion = ComponentID.fromString(envIdFromEnvsConfig).toStringWithoutVersion();\n const envDef = this.getEnvDefinitionByStringId(envIdFromEnvsConfigWithoutVersion);\n if (envDef) {\n this.envIds.add(envDef.id);\n return envDef;\n }\n }\n\n // in some cases we have the id configured in the teambit.envs/envs but without the version\n // in such cases we won't find it in the slot\n // we search in the component aspect list a matching aspect which is match the id from the teambit.envs/envs\n if (envIdFromEnvsConfigWithoutVersion) {\n const matchedEntry = extensions.find((extension) => {\n if (extension.extensionId) {\n return (\n envIdFromEnvsConfigWithoutVersion === extension.extensionId.toString() ||\n envIdFromEnvsConfigWithoutVersion === extension.extensionId.toString({ ignoreVersion: true })\n );\n }\n return envIdFromEnvsConfigWithoutVersion === extension.stringId;\n });\n if (matchedEntry) {\n // during the tag process, the version in the aspect-entry-id is changed and is not the\n // same as it was when it registered to the slot.\n const envDef = this.getEnvDefinitionByLegacyExtension(matchedEntry);\n if (envDef) {\n this.envIds.add(envDef.id);\n return envDef;\n }\n // Do not allow a non existing env\n // this.printWarningIfFirstTime(\n // matchedEntry.id.toString(),\n // `environment with ID: ${matchedEntry.id.toString()} was not found`\n // );\n }\n // Do not allow configure teambit.envs/envs on the component without configure the env aspect itself\n // const errMsg = new EnvNotConfiguredForComponent(envIdFromEnvsConfig).message;\n // this.printWarningIfFirstTime(envIdFromEnvsConfig, errMsg);\n }\n\n // in case there is no config in teambit.envs/envs search the aspects for the first env that registered as env\n const ids: string[] = [];\n extensions.forEach((extension) => {\n if (extension.extensionId) {\n ids.push(extension.extensionId.toString());\n } else {\n ids.push(extension.stringId);\n }\n });\n const envId = await this.findFirstEnv(ids);\n const envDef = envId ? this.getEnvDefinitionByStringId(envId) : undefined;\n\n return envDef || this.getDefaultEnv();\n }\n\n /**\n * This function finds the first environment ID from a list of IDs by checking if it is register as env (to the slot).\n * or contains env.jsonc file\n * @param {string[]} ids - `ids` is an array of string values representing environment IDs. The function `findFirstEnv`\n * takes this array as input and returns a Promise that resolves to a string value representing the first environment ID\n * that matches certain conditions.\n * @returns The `findFirstEnv` function returns a Promise that resolves to a string or undefined. The string represents\n * the ID of the first environment that matches the conditions specified in the function, or undefined if no environment\n * is found.\n */\n private async findFirstEnv(ids: string[]): Promise<string | undefined> {\n let isFoundWithoutVersion = false;\n const envId = await pLocate(ids, async (id) => {\n const idWithoutVersion = id.split('@')[0];\n if (this.isCoreEnv(idWithoutVersion)) return true;\n if (isCoreAspect(idWithoutVersion)) return false;\n const envDef = this.getEnvDefinitionByStringId(id);\n if (envDef) return true;\n const envDefWithoutVersion = this.getEnvDefinitionByStringId(idWithoutVersion);\n if (envDefWithoutVersion) {\n isFoundWithoutVersion = true;\n return true;\n }\n const envComponent = await this.getEnvComponentByEnvId(id);\n const hasManifest = this.hasEnvManifest(envComponent);\n if (hasManifest) return true;\n const isUsingEnvEnv = this.isUsingEnvEnv(envComponent);\n return !!isUsingEnvEnv;\n });\n let finalEnvId;\n if (envId) {\n finalEnvId = isFoundWithoutVersion ? envId?.split('@')[0] : envId;\n this.envIds.add(envId);\n }\n return finalEnvId;\n }\n\n private getEnvDefinitionByLegacyExtension(extension: ExtensionDataEntry): EnvDefinition | undefined {\n const envDef = extension.extensionId\n ? this.getEnvDefinitionById(extension.extensionId)\n : this.getEnvDefinitionByStringId(extension.stringId);\n return envDef;\n }\n\n getEnvIdFromEnvsConfig(component: Component): string | undefined {\n const envsAspect = component.state.aspects.get(EnvsAspect.id);\n return envsAspect?.config.env;\n }\n\n getEnvDefinition(id: ComponentID) {\n const allVersions = this.envSlot.toArray();\n const all = allVersions.filter(([envId]) => envId.includes(id.toStringWithoutVersion()));\n const first = head(all);\n if (!first) return undefined;\n const [envId, env] = first;\n return new EnvDefinition(envId, env);\n }\n\n getEnvDefinitionById(id: ComponentID): EnvDefinition | undefined {\n const envDef =\n this.getEnvDefinitionByStringId(id.toString()) ||\n this.getEnvDefinitionByStringId(id.toString({ ignoreVersion: true }));\n return envDef;\n }\n\n public getEnvDefinitionByStringId(envId: string): EnvDefinition | undefined {\n const env = this.envSlot.get(envId);\n if (env) {\n return new EnvDefinition(envId, env as Environment);\n }\n return undefined;\n }\n\n getEnvFromComponent(envComponent: Component): EnvDefinition | undefined {\n const env = this.getEnvDefinitionById(envComponent.id);\n return env;\n }\n\n /**\n * Return the env definition of teambit.envs/env\n */\n getEnvsEnvDefinition(): EnvDefinition {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.getEnvDefinitionByStringId('teambit.envs/env')!;\n }\n\n private printWarningIfFirstTime(envId: string, message: string) {\n if (!this.alreadyShownWarning[envId] && !this.failedToLoadEnvs.has(envId)) {\n this.alreadyShownWarning[envId] = true;\n this.logger.consoleWarning(message);\n this.addFailedToLoadEnvs(envId);\n }\n }\n\n /**\n * determines whether an env is registered.\n */\n public isEnvRegistered(id: string) {\n return Boolean(this.envSlot.get(id));\n }\n\n isUsingAspectEnv(component: Component): boolean {\n const data = this.getEnvData(component);\n if (!data) return false;\n return data.type === 'aspect';\n }\n\n isUsingEnvEnv(component: Component): boolean {\n const data = this.getEnvData(component);\n if (!data) return false;\n return data.type === 'env';\n }\n\n /**\n * Check if the given component is an env component.\n * @param component\n * @returns\n */\n isEnv(component: Component): boolean {\n return (\n this.isUsingEnvEnv(component) ||\n this.isEnvRegistered(component.id.toString()) ||\n this.isEnvRegistered(component.id.toStringWithoutVersion())\n );\n }\n\n /**\n * register a new environment service.\n */\n registerService(...envServices: EnvService<any>[]) {\n this.servicesRegistry.register(envServices);\n return this;\n }\n\n /**\n * get list of services enabled on an env.\n */\n getServices(env: EnvDefinition): EnvServiceList {\n const allServices = this.servicesRegistry.toArray();\n const services: [string, EnvService<any>][] = [];\n allServices.forEach(([id, currentServices]) => {\n currentServices.forEach((service) => {\n try {\n if (this.implements(env, service)) {\n services.push([id, service]);\n }\n } catch (err) {\n this.logger.warn(`failed loading service ${id} for env ${env.id}`);\n }\n });\n });\n return new EnvServiceList(env, services);\n }\n\n implements(env: EnvDefinition, service: EnvService<any>) {\n // TODO: remove this after refactoring everything and remove getDescriptor from being optional.\n if (!service.getDescriptor) return false;\n return !!service.getDescriptor(env);\n }\n\n /**\n * register an environment.\n */\n registerEnv(env: Environment) {\n return this.envSlot.register(env);\n }\n\n /**\n * register an env.jsonc merge customizer.\n */\n registerEnvJsoncMergeCustomizer(customizer: EnvJsoncMergeCustomizer) {\n return this.envJsoncMergeCustomizerSlot.register(customizer);\n }\n\n async addNonLoadedEnvAsComponentIssues(components: Component[]) {\n await pMapSeries(components, async (component) => {\n const envId = await this.calculateEnvId(component);\n const envIdStr = envId.toString();\n if (!this.isEnvRegistered(envIdStr)) {\n this.addFailedToLoadEnvs(envIdStr);\n // If there is no version and the env is not in the workspace this is not valid\n // you can't set external env without version\n if (!envIdStr.includes('@')) {\n const foundComp = components.find((c) => c.id.toStringWithoutVersion() === envIdStr);\n if (!foundComp) {\n component.state.issues.getOrCreate(IssuesClasses.ExternalEnvWithoutVersion).data = {\n envId: envIdStr,\n componentId: component.id.toString(),\n };\n } else {\n component.state.issues.getOrCreate(IssuesClasses.NonLoadedEnv).data = envIdStr;\n }\n } else {\n component.state.issues.getOrCreate(IssuesClasses.NonLoadedEnv).data = envIdStr;\n }\n }\n });\n }\n\n // refactor here\n private async createRuntime(components: Component[]): Promise<Runtime> {\n return new Runtime(await this.aggregateByDefs(components), this.logger);\n }\n\n // :TODO can be refactored to few utilities who will make repeating this very easy.\n private async aggregateByDefs(components: Component[]): Promise<EnvRuntime[]> {\n this.throwForDuplicateComponents(components);\n const envsMap = {};\n components.forEach((component: Component) => {\n const envDef = this.getEnv(component);\n const envId = envDef.id;\n const env = envDef.env;\n // handle config as well when aggregating envs.\n if (envsMap[envId]) envsMap[envId].components.push(component);\n else\n envsMap[envId] = {\n components: [component],\n env,\n };\n });\n\n return Promise.all(\n Object.keys(envsMap).map(async (key) => {\n const envAspectDef = await this.getEnvAspectDef(key);\n return new EnvRuntime(key, envsMap[key].env, envsMap[key].components, envAspectDef);\n })\n );\n }\n\n private async getEnvAspectDef(envId: string): Promise<AspectDefinition> {\n const host = this.componentMain.getHost();\n const id = await host.resolveComponentId(envId);\n // We don't want to filter by runtime here as we want to also get envs that configured as plugins. so they don't\n // contain the runtime path.\n const resolvedAspects = await host.resolveAspects(MainRuntime.name, [id], {\n requestedOnly: true,\n filterByRuntime: false,\n useScopeAspectsCapsule: true,\n });\n const def = resolvedAspects[0];\n\n return def;\n }\n\n private throwForDuplicateComponents(components: Component[]) {\n const idsStr = components.map((c) => c.id.toString());\n const duplications = findDuplications(idsStr);\n if (duplications.length) {\n throw new Error(`found duplicated components: ${duplications.join(', ')}`);\n }\n }\n\n static slots = [\n Slot.withType<Environment>(),\n Slot.withType<EnvService<any>>(),\n Slot.withType<EnvJsoncMergeCustomizerRegistry>(),\n ];\n\n static dependencies = [GraphqlAspect, LoggerAspect, ComponentAspect, CLIAspect, WorkerAspect, IssuesAspect];\n\n static async provider(\n [graphql, loggerAspect, component, cli, worker, issues]: [\n GraphqlMain,\n LoggerMain,\n ComponentMain,\n CLIMain,\n WorkerMain,\n IssuesMain\n ],\n config: EnvsConfig,\n [envSlot, servicesRegistry, envJsoncMergeCustomizerSlot]: [\n EnvsRegistry,\n ServicesRegistry,\n EnvJsoncMergeCustomizerRegistry\n ],\n context: Harmony\n ) {\n const logger = loggerAspect.createLogger(EnvsAspect.id);\n const envs = new EnvsMain(\n config,\n context,\n envSlot,\n logger,\n servicesRegistry,\n component,\n loggerAspect,\n worker,\n envJsoncMergeCustomizerSlot\n );\n component.registerShowFragments([new EnvFragment(envs)]);\n if (issues) issues.registerAddComponentsIssues(envs.addNonLoadedEnvAsComponentIssues.bind(envs));\n\n const envsCmd = new EnvsCmd(envs, component);\n envsCmd.commands = [new ListEnvsCmd(envs, component), new GetEnvCmd(envs, component)];\n cli.register(envsCmd);\n graphql.register(environmentsSchema(envs));\n return envs;\n }\n}\n\nEnvsAspect.addRuntime(EnvsMain);\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,gBAAA;EAAA,MAAAJ,IAAA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gBAAgB,EAChBmG,SAAS,EACT4J,YAAY,EACZE,MAAM,EACN7P,2BACF,CAAC;IACD+F,SAAS,CAACkK,qBAAqB,CAAC,CAAC,KAAIC,kBAAW,EAACF,IAAI,CAAC,CAAC,CAAC;IACxD,IAAI/B,MAAM,EAAEA,MAAM,CAACkC,2BAA2B,CAACH,IAAI,CAACpC,gCAAgC,CAAC9K,IAAI,CAACkN,IAAI,CAAC,CAAC;IAEhG,MAAMI,OAAO,GAAG,KAAIC,eAAO,EAACL,IAAI,EAAEjK,SAAS,CAAC;IAC5CqK,OAAO,CAACE,QAAQ,GAAG,CAAC,KAAIC,mBAAW,EAACP,IAAI,EAAEjK,SAAS,CAAC,EAAE,KAAIyK,iBAAS,EAACR,IAAI,EAAEjK,SAAS,CAAC,CAAC;IACrF6J,GAAG,CAACzC,QAAQ,CAACiD,OAAO,CAAC;IACrBV,OAAO,CAACvC,QAAQ,CAAC,IAAAsD,mCAAkB,EAACT,IAAI,CAAC,CAAC;IAC1C,OAAOA,IAAI;EACb;AACF;AAAC5Q,OAAA,CAAAC,QAAA,GAAAA,QAAA;AAAAlB,eAAA,CAxhCYkB,QAAQ,aAgBF4P,kBAAW;AAAA9Q,eAAA,CAhBjBkB,QAAQ,WA0+BJ,CACbqR,eAAI,CAACC,QAAQ,CAAc,CAAC,EAC5BD,eAAI,CAACC,QAAQ,CAAkB,CAAC,EAChCD,eAAI,CAACC,QAAQ,CAAkC,CAAC,CACjD;AAAAxS,eAAA,CA9+BUkB,QAAQ,kBAg/BG,CAACuR,wBAAa,EAAEC,sBAAY,EAAEC,4BAAe,EAAEC,gBAAS,EAAEC,sBAAY,EAAEC,sBAAY,CAAC;AA0C7G5K,0BAAU,CAAC6K,UAAU,CAAC7R,QAAQ,CAAC","ignoreList":[]}
package/dist/envs.cmd.js CHANGED
@@ -46,7 +46,7 @@ class ListEnvsCmd {
46
46
  _defineProperty(this, "group", 'development');
47
47
  }
48
48
  async report() {
49
- const allEnvs = this.envs.getAllRegisteredEnvs().join('\n');
49
+ const allEnvs = this.envs.getAllRegisteredEnvsIds().join('\n');
50
50
  const title = _chalk().default.green('the following envs are available in the workspace:');
51
51
  return `${title}\n${allEnvs}`;
52
52
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_chalk","_cliTable","_lodash","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ListEnvsCmd","constructor","envs","componentAspect","report","allEnvs","getAllRegisteredEnvs","join","title","chalk","green","exports","GetEnvCmd","name","description","showEnv","id","host","servicesArr","component","get","resolveComponentId","Error","env","getEnv","envRuntime","createEnvironment","envExecutionContext","getEnvExecutionContext","services","getServices","allP","map","serviceId","service","includes","serviceTitle","cyan","bold","underline","content","render","all","compact","Promise","envTitle","getHost","split","undefined","EnvsCmd","Set","components","list","table","getTable","warning","getNonLoadedEnvsWarning","tableData","pMapSeries","envId","calculateEnvId","envIdStr","toString","isLoaded","isEnvRegistered","nonLoadedEnvs","add","envWithErr","red","header","CLITable","fromObject","sort","size","Array","from","values","yellow"],"sources":["envs.cmd.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport pMapSeries from 'p-map-series';\nimport chalk from 'chalk';\nimport { CLITable } from '@teambit/cli-table';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { compact } from 'lodash';\nimport { ComponentMain, ComponentFactory, Component } from '@teambit/component';\nimport { EnvsMain } from './environments.main.runtime';\n\nexport class ListEnvsCmd implements Command {\n name = 'list';\n description = 'list all envs currently used in the workspace';\n options = [];\n group = 'development';\n\n constructor(private envs: EnvsMain, private componentAspect: ComponentMain) {}\n\n async report() {\n const allEnvs = this.envs.getAllRegisteredEnvs().join('\\n');\n const title = chalk.green('the following envs are available in the workspace:');\n return `${title}\\n${allEnvs}`;\n }\n}\n\ntype GetEnvOpts = {\n services: string;\n};\n\nexport class GetEnvCmd implements Command {\n name = 'get <component-name>';\n description = \"show config information from a component's env\";\n arguments = [\n {\n name: 'component-name',\n description: \"the 'component name' or 'component id' of the component whose env you'd like to inspect\",\n },\n ];\n examples: [{ cmd: 'get ui/button'; description: 'show config information from the env configured for ui/button' }];\n options = [\n [\n '',\n 'services <string>',\n 'show information about the specific services only. for multiple services, separate by a comma and wrap with quotes',\n ],\n ] as CommandOptions;\n group = 'development';\n\n constructor(private envs: EnvsMain, private componentAspect: ComponentMain) {}\n\n async showEnv(id: string, host: ComponentFactory, servicesArr: string[] | undefined) {\n const component = await host.get(await host.resolveComponentId(id));\n if (!component) throw new Error(`component for env ${id} was not found`);\n const env = this.envs.getEnv(component);\n const envRuntime = await this.envs.createEnvironment([component]);\n const envExecutionContext = envRuntime.getEnvExecutionContext();\n const services = this.envs.getServices(env);\n const allP = services.services.map(async ([serviceId, service]) => {\n if (servicesArr && !servicesArr.includes(serviceId)) return null;\n const serviceTitle = chalk.cyan.bold.underline(serviceId);\n const content = service.render ? await service.render(env, envExecutionContext) : '';\n return `${serviceTitle}\\n\\n${content}`;\n });\n\n const all = compact(await Promise.all(allP));\n\n const envTitle = chalk.green(`Environment: ${env.id}`);\n return `${envTitle}\\n${all.join('\\n\\n')}`;\n }\n\n async report([name]: [string], { services }: GetEnvOpts): Promise<string> {\n const host = this.componentAspect.getHost();\n const servicesArr = services ? services.split(',') : undefined;\n\n // TODO: think what to do re this line with gilad.\n if (!host) throw new Error('error: workspace not found');\n return this.showEnv(name, host, servicesArr);\n }\n}\n\nexport class EnvsCmd implements Command {\n name = 'envs';\n alias = 'env';\n description = 'list all components maintained by the workspace and their corresponding envs';\n options = [];\n group = 'development';\n commands: Command[] = [];\n\n // private showNonLoadedEnvsWarning = false;\n private nonLoadedEnvs = new Set<string>();\n\n constructor(private envs: EnvsMain, private componentAspect: ComponentMain) {}\n\n async report(): Promise<string> {\n const host = this.componentAspect.getHost();\n // TODO: think what to do re this line with gilad.\n if (!host) throw new Error('error: workspace not found');\n const components = await host.list();\n const table = await this.getTable(components);\n const warning = this.getNonLoadedEnvsWarning();\n return warning ? `${table}\\n${warning}` : table;\n }\n\n private async getTable(components: Component[]) {\n const tableData = await pMapSeries(components, async (component) => {\n // const envId = this.envs.getEnvId(component);\n const envId = await this.envs.calculateEnvId(component);\n const envIdStr = envId.toString();\n const isLoaded = this.envs.isEnvRegistered(envIdStr);\n if (!isLoaded) {\n this.nonLoadedEnvs.add(envIdStr);\n }\n const envWithErr = isLoaded ? envIdStr : `${envIdStr} ${chalk.red('(not loaded)')}`;\n return {\n component: component.id.toString(),\n env: envWithErr,\n };\n });\n\n const header = [\n {\n value: 'component',\n },\n {\n value: 'env',\n },\n ];\n const table = CLITable.fromObject(header, tableData);\n table.sort();\n return table.render();\n }\n\n getNonLoadedEnvsWarning() {\n if (!this.nonLoadedEnvs.size) return '';\n const list = Array.from(this.nonLoadedEnvs.values()).join(',');\n return chalk.yellow(`warning: bit wasn't able to load the following envs: ${chalk.cyan(list)}.\nplease run ${chalk.cyan(\"'bit install'\")} to fix. if this doesn't help, run ${chalk.cyan(\n \"'bit status'\"\n )} to see if there are any additional issues`);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAA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QAAQ,IAAIpD,gBAAK,CAAC2D,GAAG,CAAC,cAAc,CAAC,EAAE;MACnF,OAAO;QACLjD,SAAS,EAAEA,SAAS,CAACH,EAAE,CAAC8C,QAAQ,CAAC,CAAC;QAClCvC,GAAG,EAAE4C;MACP,CAAC;IACH,CAAC,CAAC;IAEF,MAAME,MAAM,GAAG,CACb;MACEjF,KAAK,EAAE;IACT,CAAC,EACD;MACEA,KAAK,EAAE;IACT,CAAC,CACF;IACD,MAAMiE,KAAK,GAAGiB,oBAAQ,CAACC,UAAU,CAACF,MAAM,EAAEZ,SAAS,CAAC;IACpDJ,KAAK,CAACmB,IAAI,CAAC,CAAC;IACZ,OAAOnB,KAAK,CAACZ,MAAM,CAAC,CAAC;EACvB;EAEAe,uBAAuBA,CAAA,EAAG;IACxB,IAAI,CAAC,IAAI,CAACS,aAAa,CAACQ,IAAI,EAAE,OAAO,EAAE;IACvC,MAAMrB,IAAI,GAAGsB,KAAK,CAACC,IAAI,CAAC,IAAI,CAACV,aAAa,CAACW,MAAM,CAAC,CAAC,CAAC,CAACrE,IAAI,CAAC,GAAG,CAAC;IAC9D,OAAOE,gBAAK,CAACoE,MAAM,CAAC,wDAAwDpE,gBAAK,CAAC4B,IAAI,CAACe,IAAI,CAAC;AAChG,aAAa3C,gBAAK,CAAC4B,IAAI,CAAC,eAAe,CAAC,sCAAsC5B,gBAAK,CAAC4B,IAAI,CAClF,cACF,CAAC,4CAA4C,CAAC;EAChD;AACF;AAAC1B,OAAA,CAAAsC,OAAA,GAAAA,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_chalk","_cliTable","_lodash","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","ListEnvsCmd","constructor","envs","componentAspect","report","allEnvs","getAllRegisteredEnvsIds","join","title","chalk","green","exports","GetEnvCmd","name","description","showEnv","id","host","servicesArr","component","get","resolveComponentId","Error","env","getEnv","envRuntime","createEnvironment","envExecutionContext","getEnvExecutionContext","services","getServices","allP","map","serviceId","service","includes","serviceTitle","cyan","bold","underline","content","render","all","compact","Promise","envTitle","getHost","split","undefined","EnvsCmd","Set","components","list","table","getTable","warning","getNonLoadedEnvsWarning","tableData","pMapSeries","envId","calculateEnvId","envIdStr","toString","isLoaded","isEnvRegistered","nonLoadedEnvs","add","envWithErr","red","header","CLITable","fromObject","sort","size","Array","from","values","yellow"],"sources":["envs.cmd.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport pMapSeries from 'p-map-series';\nimport chalk from 'chalk';\nimport { CLITable } from '@teambit/cli-table';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { compact } from 'lodash';\nimport { ComponentMain, ComponentFactory, Component } from '@teambit/component';\nimport { EnvsMain } from './environments.main.runtime';\n\nexport class ListEnvsCmd implements Command {\n name = 'list';\n description = 'list all envs currently used in the workspace';\n options = [];\n group = 'development';\n\n constructor(private envs: EnvsMain, private componentAspect: ComponentMain) {}\n\n async report() {\n const allEnvs = this.envs.getAllRegisteredEnvsIds().join('\\n');\n const title = chalk.green('the following envs are available in the workspace:');\n return `${title}\\n${allEnvs}`;\n }\n}\n\ntype GetEnvOpts = {\n services: string;\n};\n\nexport class GetEnvCmd implements Command {\n name = 'get <component-name>';\n description = \"show config information from a component's env\";\n arguments = [\n {\n name: 'component-name',\n description: \"the 'component name' or 'component id' of the component whose env you'd like to inspect\",\n },\n ];\n examples: [{ cmd: 'get ui/button'; description: 'show config information from the env configured for ui/button' }];\n options = [\n [\n '',\n 'services <string>',\n 'show information about the specific services only. for multiple services, separate by a comma and wrap with quotes',\n ],\n ] as CommandOptions;\n group = 'development';\n\n constructor(private envs: EnvsMain, private componentAspect: ComponentMain) {}\n\n async showEnv(id: string, host: ComponentFactory, servicesArr: string[] | undefined) {\n const component = await host.get(await host.resolveComponentId(id));\n if (!component) throw new Error(`component for env ${id} was not found`);\n const env = this.envs.getEnv(component);\n const envRuntime = await this.envs.createEnvironment([component]);\n const envExecutionContext = envRuntime.getEnvExecutionContext();\n const services = this.envs.getServices(env);\n const allP = services.services.map(async ([serviceId, service]) => {\n if (servicesArr && !servicesArr.includes(serviceId)) return null;\n const serviceTitle = chalk.cyan.bold.underline(serviceId);\n const content = service.render ? await service.render(env, envExecutionContext) : '';\n return `${serviceTitle}\\n\\n${content}`;\n });\n\n const all = compact(await Promise.all(allP));\n\n const envTitle = chalk.green(`Environment: ${env.id}`);\n return `${envTitle}\\n${all.join('\\n\\n')}`;\n }\n\n async report([name]: [string], { services }: GetEnvOpts): Promise<string> {\n const host = this.componentAspect.getHost();\n const servicesArr = services ? services.split(',') : undefined;\n\n // TODO: think what to do re this line with gilad.\n if (!host) throw new Error('error: workspace not found');\n return this.showEnv(name, host, servicesArr);\n }\n}\n\nexport class EnvsCmd implements Command {\n name = 'envs';\n alias = 'env';\n description = 'list all components maintained by the workspace and their corresponding envs';\n options = [];\n group = 'development';\n commands: Command[] = [];\n\n // private showNonLoadedEnvsWarning = false;\n private nonLoadedEnvs = new Set<string>();\n\n constructor(private envs: EnvsMain, private componentAspect: ComponentMain) {}\n\n async report(): Promise<string> {\n const host = this.componentAspect.getHost();\n // TODO: think what to do re this line with gilad.\n if (!host) throw new Error('error: workspace not found');\n const components = await host.list();\n const table = await this.getTable(components);\n const warning = this.getNonLoadedEnvsWarning();\n return warning ? `${table}\\n${warning}` : table;\n }\n\n private async getTable(components: Component[]) {\n const tableData = await pMapSeries(components, async (component) => {\n // const envId = this.envs.getEnvId(component);\n const envId = await this.envs.calculateEnvId(component);\n const envIdStr = envId.toString();\n const isLoaded = this.envs.isEnvRegistered(envIdStr);\n if (!isLoaded) {\n this.nonLoadedEnvs.add(envIdStr);\n }\n const envWithErr = isLoaded ? envIdStr : `${envIdStr} ${chalk.red('(not loaded)')}`;\n return {\n component: component.id.toString(),\n env: envWithErr,\n };\n });\n\n const header = [\n {\n value: 'component',\n },\n {\n value: 'env',\n },\n ];\n const table = CLITable.fromObject(header, tableData);\n table.sort();\n return table.render();\n }\n\n getNonLoadedEnvsWarning() {\n if (!this.nonLoadedEnvs.size) return '';\n const list = Array.from(this.nonLoadedEnvs.values()).join(',');\n return chalk.yellow(`warning: bit wasn't able to load the following envs: ${chalk.cyan(list)}.\nplease run ${chalk.cyan(\"'bit install'\")} to fix. if this doesn't help, run ${chalk.cyan(\n \"'bit status'\"\n )} to see if there are any additional issues`);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAiC,SAAAC,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA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Z,OAAOnB,KAAK,CAACZ,MAAM,CAAC,CAAC;EACvB;EAEAe,uBAAuBA,CAAA,EAAG;IACxB,IAAI,CAAC,IAAI,CAACS,aAAa,CAACQ,IAAI,EAAE,OAAO,EAAE;IACvC,MAAMrB,IAAI,GAAGsB,KAAK,CAACC,IAAI,CAAC,IAAI,CAACV,aAAa,CAACW,MAAM,CAAC,CAAC,CAAC,CAACrE,IAAI,CAAC,GAAG,CAAC;IAC9D,OAAOE,gBAAK,CAACoE,MAAM,CAAC,wDAAwDpE,gBAAK,CAAC4B,IAAI,CAACe,IAAI,CAAC;AAChG,aAAa3C,gBAAK,CAAC4B,IAAI,CAAC,eAAe,CAAC,sCAAsC5B,gBAAK,CAAC4B,IAAI,CAClF,cACF,CAAC,4CAA4C,CAAC;EAChD;AACF;AAAC1B,OAAA,CAAAsC,OAAA,GAAAA,OAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.envs_envs@1.0.380/dist/env.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.envs_envs@1.0.380/dist/envs.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.envs_envs@1.0.382/dist/env.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.envs_envs@1.0.382/dist/envs.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];