@teambit/envs 1.0.372 → 1.0.373

Sign up to get free protection for your applications and to get access to all the features.
@@ -570,12 +570,13 @@ class EnvsMain {
570
570
  }
571
571
  const envDef = this.getEnvFromComponent(envComponent);
572
572
  if (!envDef) return undefined;
573
- const services = this.getServices(envDef);
573
+ const rawServices = this.getServices(envDef);
574
+ const services = rawServices.toObject();
574
575
  // const selfDescriptor = (await this.getEnvDescriptorFromEnvDef(envDef)) || {};
575
576
  const selfDescriptor = await this.getEnvDescriptorFromEnvDef(envDef);
576
577
  if (!selfDescriptor) return undefined;
577
578
  return _objectSpread(_objectSpread({}, selfDescriptor), {}, {
578
- services: services.toObject()
579
+ services
579
580
  });
580
581
  }
581
582
 
@@ -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","services","getServices","selfDescriptor","getEnvDescriptorFromEnvDef","toObject","__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 services = this.getServices(envDef);\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: services.toObject(),\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,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,KAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,IAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,SAAA;EAAA,MAAAP,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAM,QAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,aAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,YAAA,YAAAA,CAAA;IA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AAAA5Q,eAAA,CAhBjBkB,QAAQ,WAq+BJ,CACbmR,eAAI,CAACC,QAAQ,CAAc,CAAC,EAC5BD,eAAI,CAACC,QAAQ,CAAkB,CAAC,EAChCD,eAAI,CAACC,QAAQ,CAAkC,CAAC,CACjD;AAAAtS,eAAA,CAz+BUkB,QAAQ,kBA2+BG,CAACqR,wBAAa,EAAEC,sBAAY,EAAEC,4BAAe,EAAEC,gBAAS,EAAEC,sBAAY,EAAEC,sBAAY,CAAC;AA0C7G1K,0BAAU,CAAC2K,UAAU,CAAC3R,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","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,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,KAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,IAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,SAAA;EAAA,MAAAP,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAM,QAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,aAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,YAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,S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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,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.envs_envs@1.0.372/dist/env.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.envs_envs@1.0.372/dist/envs.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.envs_envs@1.0.373/dist/env.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.envs_envs@1.0.373/dist/envs.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/envs",
3
- "version": "1.0.372",
3
+ "version": "1.0.373",
4
4
  "homepage": "https://bit.cloud/teambit/envs/envs",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.envs",
8
8
  "name": "envs",
9
- "version": "1.0.372"
9
+ "version": "1.0.373"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -20,30 +20,30 @@
20
20
  "@teambit/harmony": "0.4.6",
21
21
  "@teambit/bit-error": "0.0.404",
22
22
  "@teambit/component-id": "1.2.0",
23
- "@teambit/component": "1.0.372",
24
- "@teambit/aspect-loader": "1.0.372",
25
- "@teambit/cli": "0.0.949",
26
- "@teambit/logger": "0.0.1042",
27
- "@teambit/worker": "0.0.1253",
28
- "@teambit/builder": "1.0.372",
29
- "@teambit/bundler": "1.0.372",
30
- "@teambit/compiler": "1.0.372",
31
- "@teambit/dependency-resolver": "1.0.372",
32
- "@teambit/formatter": "1.0.372",
33
- "@teambit/isolator": "1.0.372",
34
- "@teambit/linter": "1.0.372",
35
- "@teambit/pkg": "1.0.372",
36
- "@teambit/preview": "1.0.372",
37
- "@teambit/schema": "1.0.372",
38
- "@teambit/tester": "1.0.372",
39
- "@teambit/typescript": "1.0.372",
40
- "@teambit/webpack": "1.0.372",
41
- "@teambit/graphql": "1.0.372",
42
- "@teambit/bit": "1.8.23",
23
+ "@teambit/component": "1.0.373",
24
+ "@teambit/aspect-loader": "1.0.373",
25
+ "@teambit/cli": "0.0.950",
26
+ "@teambit/logger": "0.0.1043",
27
+ "@teambit/worker": "0.0.1254",
28
+ "@teambit/builder": "1.0.373",
29
+ "@teambit/bundler": "1.0.373",
30
+ "@teambit/compiler": "1.0.373",
31
+ "@teambit/dependency-resolver": "1.0.373",
32
+ "@teambit/formatter": "1.0.373",
33
+ "@teambit/isolator": "1.0.373",
34
+ "@teambit/linter": "1.0.373",
35
+ "@teambit/pkg": "1.0.373",
36
+ "@teambit/preview": "1.0.373",
37
+ "@teambit/schema": "1.0.373",
38
+ "@teambit/tester": "1.0.373",
39
+ "@teambit/typescript": "1.0.373",
40
+ "@teambit/webpack": "1.0.373",
41
+ "@teambit/graphql": "1.0.373",
42
+ "@teambit/bit": "1.8.24",
43
43
  "@teambit/component-issues": "0.0.150",
44
44
  "@teambit/component.sources": "0.0.18",
45
- "@teambit/dev-files": "1.0.372",
46
- "@teambit/issues": "1.0.372",
45
+ "@teambit/dev-files": "1.0.373",
46
+ "@teambit/issues": "1.0.373",
47
47
  "@teambit/toolbox.array.duplications-finder": "0.0.1",
48
48
  "@teambit/toolbox.modules.module-resolver": "0.0.7",
49
49
  "@teambit/cli-table": "0.0.48"