@teambit/config-merger 0.0.910 → 0.0.912
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/component-config-merger.js +19 -4
- package/dist/component-config-merger.js.map +1 -1
- package/dist/component-config-merger.spec.d.ts +1 -0
- package/dist/component-config-merger.spec.js +150 -0
- package/dist/component-config-merger.spec.js.map +1 -0
- package/package.json +15 -13
- /package/dist/{preview-1783010236244.js → preview-1783383307533.js} +0 -0
|
@@ -97,8 +97,12 @@ class ComponentConfigMerger {
|
|
|
97
97
|
_defineProperty(this, "currentEnv", void 0);
|
|
98
98
|
_defineProperty(this, "otherEnv", void 0);
|
|
99
99
|
_defineProperty(this, "baseEnv", void 0);
|
|
100
|
-
|
|
101
|
-
//
|
|
100
|
+
// don't try to merge builder, it's possible that at one end it wasn't built yet, so it's empty.
|
|
101
|
+
// teambit.envs/envs is handled exclusively by envStrategy() — the generic aspect merge only sees the
|
|
102
|
+
// raw `config.env`, which never carries the env's version (the version lives in the separate env-aspect
|
|
103
|
+
// entry that only envStrategy knows to attach). Letting the generic merge run would leak an unversioned
|
|
104
|
+
// external env and break the snap with ExternalEnvWithoutVersion.
|
|
105
|
+
_defineProperty(this, "handledExtIds", [_builder().BuilderAspect.id, _envs().EnvsAspect.id]);
|
|
102
106
|
_defineProperty(this, "otherLaneIdsStr", void 0);
|
|
103
107
|
this.otherLaneIdsStr = otherLane?.toComponentIds().map(id => id.toString()) || [];
|
|
104
108
|
}
|
|
@@ -240,8 +244,19 @@ class ComponentConfigMerger {
|
|
|
240
244
|
if (this.currentEnv.id === this.otherEnv.id && this.currentEnv.version === this.otherEnv.version) {
|
|
241
245
|
return null;
|
|
242
246
|
}
|
|
243
|
-
|
|
244
|
-
|
|
247
|
+
// did the current lane deliberately change its env away from the diversion point (base)?
|
|
248
|
+
// a version difference counts only when both sides have a known version — a missing base version
|
|
249
|
+
// (versionless/core env, or an absent base env-aspect entry) is "unknown", not "changed", so it must
|
|
250
|
+
// not block propagation of an env change made on the other lane.
|
|
251
|
+
const currentChangedEnvFromBase = !this.baseEnv || this.baseEnv.id !== this.currentEnv.id || Boolean(this.baseEnv.version && this.currentEnv.version && this.baseEnv.version !== this.currentEnv.version);
|
|
252
|
+
// did "other" switch to a *different* env (a migration), or merely bump the same env's version?
|
|
253
|
+
const envIdChanged = this.currentEnv.id !== this.otherEnv.id;
|
|
254
|
+
// keep the current env (don't sync from "other") when it's a workspace component (or exists on the other
|
|
255
|
+
// lane) AND either the current lane deliberately changed its env, OR only the env's *version* differs.
|
|
256
|
+
// rationale: a workspace env's version is owned by the workspace, so we never adopt a different version of
|
|
257
|
+
// the *same* env from the other lane. only a genuine env *migration* (id change) that the current lane did
|
|
258
|
+
// not make is allowed to propagate — handled by the 3-way merge below (with the new env's version).
|
|
259
|
+
if ((currentChangedEnvFromBase || !envIdChanged) && this.isIdInWorkspaceOrOtherLane(this.currentEnv.id, this.currentEnv.version)) {
|
|
245
260
|
return null;
|
|
246
261
|
}
|
|
247
262
|
return this.basicConfigMerge(mergeStrategyParams);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_semver","data","_interopRequireDefault","require","_builder","_componentVersion","_dependencyResolver","_envs","_lodash","_configMergeResult","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","conflictIndicator","exports","ComponentConfigMerger","constructor","compIdStr","workspaceIds","otherLane","currentAspects","baseAspects","otherAspects","currentLabel","otherLabel","logger","mergeStrategy","BuilderAspect","id","otherLaneIdsStr","toComponentIds","map","toString","merge","debug","populateEnvs","results","currentExt","stringId","handledExtIds","includes","baseExt","findExtension","otherExt","mergePerStrategy","mergedConfig","conflict","currentConfig","getConfig","otherConfig","otherAspectsNotHandledResults","extensionId","hasVersion","idFromWorkspace","getIdFromWorkspace","toStringWithoutVersion","existingExt","_legacy","envResult","envStrategy","ConfigMergeResult","compact","getEnvId","ext","envsAspect","findCoreExtension","EnvsAspect","Error","env","config","currentEnv","otherEnv","baseEnv","undefined","currentEnvAspect","version","otherEnvAspect","baseEnvAspect","mergeStrategyParams","baseConfig","isIdInWorkspaceOrOtherLane","basicConfigMerge","areConfigsEqual","configA","configB","JSON","stringify","depResolverResult","depResolverStrategy","params","DependencyResolverAspect","trace","currentConfigPolicy","getPolicy","otherConfigPolicy","baseConfigPolicy","getAllDeps","dependencies","policy","d","idWithoutVersion","__type","split","existingPolicy","find","p","dependencyId","getPolicyVer","getDataPolicy","getAutoDeps","allDeps","source","currentAutoData","currentAllData","currentDataPolicy","otherData","currentAndOtherData","uniqBy","concat","currentAndOtherComponentsData","c","baseData","getCompIdStrByPkgNameFromData","pkgName","found","packageName","getFromCurrentDataByPackageName","getFromCurrentDataPolicyByPackageName","mergedPolicy","devDependencies","peerDependencies","conflictedPolicy","hasConflict","lifecycleToDepType","runtime","dev","peer","handleConfigMerge","addVariantPolicyEntryToPolicy","dep","fromCurrentData","force","isHash","semver","satisfies","fromCurrentDataPolicy","depType","lifecycleType","name","currentDep","baseDep","otherDep","currentAndOtherConfig","currentVer","otherVer","baseVer","hasConfigForDep","depName","getDepIdAsPkgName","addSerializedDepToPolicy","lifecycle","join","depData","isEnv","currentId","versionOnOtherLane","Boolean","rawConfig","omit","VariantPolicy","fromConfigObject","entries"],"sources":["component-config-merger.ts"],"sourcesContent":["import type { ComponentID } from '@teambit/component-id';\nimport semver from 'semver';\nimport type { Logger } from '@teambit/logger';\nimport { BuilderAspect } from '@teambit/builder';\nimport { isHash } from '@teambit/component-version';\nimport type { SerializedDependency, VariantPolicyEntry } from '@teambit/dependency-resolver';\nimport { DependencyResolverAspect, VariantPolicy } from '@teambit/dependency-resolver';\nimport type { Lane } from '@teambit/objects';\nimport { EnvsAspect } from '@teambit/envs';\nimport type { ExtensionDataEntry, ExtensionDataList } from '@teambit/legacy.extension-data';\nimport type { MergeStrategy } from '@teambit/component.modules.merge-helper';\nimport { compact, omit, uniqBy } from 'lodash';\nimport { ConfigMergeResult } from './config-merge-result';\n\nexport type GenericConfigOrRemoved = Record<string, any> | '-';\n\ntype EnvData = { id: string; version?: string; config?: GenericConfigOrRemoved };\n\ntype SerializedDependencyWithPolicy = SerializedDependency & { policy?: string; packageName?: string };\n\nexport type PolicyDependency = {\n name: string;\n version: string;\n force?: boolean;\n};\n\nexport const conflictIndicator = 'CONFLICT::';\n\nexport type MergeStrategyResult = {\n id: string;\n mergedConfig?: GenericConfigOrRemoved;\n conflict?: Record<string, any>;\n};\ntype MergeStrategyParamsWithRemoved = {\n id: string;\n currentConfig: GenericConfigOrRemoved;\n otherConfig: GenericConfigOrRemoved;\n baseConfig?: GenericConfigOrRemoved;\n};\ntype MergeStrategyParams = {\n id: string;\n currentExt: ExtensionDataEntry;\n otherExt: ExtensionDataEntry;\n baseExt?: ExtensionDataEntry;\n};\n\n/**\n * perform 3-way merge of component configuration (aspects).\n * normally this is needed when merging one lane into another. the component may have different aspects config in each lane.\n * the baseAspects are the aspects of the component in the diversion point (the common ancestor of the two lanes).\n * the currentAspects are the aspects of the component in the current lane.\n * the otherAspects are the aspects of the component in the other lane. this is the lane we merge into the current lane.\n *\n * the basic merging strategy is a simple comparison between the aspect-configs, if they're different, we have a conflict.\n * we have two special cases:\n *\n * 1. dependency-resolver: we do a deeper check for the policy, we compare each dependency separately. also, we take\n * into account not only the config, but also the data. this is needed because some dependencies are automatically\n * added by Bit (from the import statements in the code) and they're not in the config. the final config has the deps\n * from both sources, the config and the data. The way we know to differentiate between them is by the \"force\" prop.\n * the config has always force: true.\n *\n * 2. envs: if we don't treat it specially, the user will need to make the change not only in the envs aspect, but also\n * in the deps-resolver (because the env is added as a devDependency) and also in the aspect itself (because\n * teambit.envs/env has only the id and not the version). to make it simpler, we ignore the envs in the deps-resolver\n * we ignore the individual aspect that is the env itself. we only show teambit.envs/env and we put the env id and\n * version. later, when the component is loaded, we split the id and the version and put them in the correct places.\n * see workspace.componentExtension / adjustEnvsOnConfigMerge for more details.\n */\nexport class ComponentConfigMerger {\n private currentEnv: EnvData;\n private otherEnv: EnvData;\n private baseEnv?: EnvData;\n private handledExtIds: string[] = [BuilderAspect.id]; // don't try to merge builder, it's possible that at one end it wasn't built yet, so it's empty\n private otherLaneIdsStr: string[];\n constructor(\n private compIdStr: string,\n private workspaceIds: ComponentID[],\n otherLane: Lane | undefined,\n private currentAspects: ExtensionDataList,\n private baseAspects: ExtensionDataList,\n private otherAspects: ExtensionDataList,\n private currentLabel: string,\n private otherLabel: string,\n private logger: Logger,\n private mergeStrategy: MergeStrategy\n ) {\n this.otherLaneIdsStr = otherLane?.toComponentIds().map((id) => id.toString()) || [];\n }\n\n merge(): ConfigMergeResult {\n this.logger.debug(`\\n************** start config-merger for ${this.compIdStr} **************`);\n this.logger.debug(`currentLabel: ${this.currentLabel}`);\n this.logger.debug(`otherLabel: ${this.otherLabel}`);\n this.populateEnvs();\n const results = this.currentAspects.map((currentExt) => {\n const id = currentExt.stringId;\n if (this.handledExtIds.includes(id)) return null;\n this.handledExtIds.push(id);\n const baseExt = this.baseAspects.findExtension(id, true);\n const otherExt = this.otherAspects.findExtension(id, true);\n if (otherExt) {\n // try to 3-way-merge\n return this.mergePerStrategy({ id, currentExt, otherExt, baseExt });\n }\n // exist in current but not in other\n if (baseExt) {\n // was removed on other\n if (this.mergeStrategy === 'theirs') {\n return { id, mergedConfig: '-' } as MergeStrategyResult;\n }\n if (this.mergeStrategy === 'ours') {\n return null;\n }\n return { id, conflict: { currentConfig: this.getConfig(currentExt), otherConfig: '-' } };\n }\n // exist in current but not in other and base, so it got created on current. nothing to do.\n return null;\n });\n const otherAspectsNotHandledResults = this.otherAspects.map((otherExt) => {\n let id = otherExt.stringId;\n if (this.handledExtIds.includes(id)) return null;\n this.handledExtIds.push(id);\n if (otherExt.extensionId && otherExt.extensionId.hasVersion()) {\n // avoid using the id from the other lane if it exits in the workspace. prefer the id from the workspace.\n const idFromWorkspace = this.getIdFromWorkspace(otherExt.extensionId.toStringWithoutVersion());\n if (idFromWorkspace) {\n const existingExt = this.currentAspects.findExtension(otherExt.extensionId.toStringWithoutVersion(), true);\n if (existingExt) return null; // the aspect is set currently, no need to add it again.\n id = idFromWorkspace._legacy.toString();\n }\n }\n const baseExt = this.baseAspects.findExtension(id, true);\n if (baseExt) {\n // was removed on current\n return { id, conflict: { currentConfig: '-', otherConfig: this.getConfig(otherExt) } };\n }\n // exist in other but not in current and base, so it got created on other.\n return { id, mergedConfig: this.getConfig(otherExt) };\n });\n const envResult = this.envStrategy();\n this.logger.debug(`*** end config-merger for ${this.compIdStr} ***\\n`);\n return new ConfigMergeResult(\n this.compIdStr,\n this.currentLabel,\n this.otherLabel,\n compact([...results, ...otherAspectsNotHandledResults, envResult])\n );\n }\n\n private populateEnvs() {\n // populate ids\n const getEnvId = (ext: ExtensionDataList) => {\n const envsAspect = ext.findCoreExtension(EnvsAspect.id);\n if (!envsAspect) throw new Error(`unable to find ${EnvsAspect.id} aspect for ${this.compIdStr}`);\n const env = envsAspect.config.env || envsAspect.data.id;\n if (!env)\n throw new Error(`unable to find env for ${this.compIdStr}, the config and data of ${EnvsAspect.id} are empty}`);\n return env;\n };\n const currentEnv = getEnvId(this.currentAspects);\n this.currentEnv = { id: currentEnv };\n const otherEnv = getEnvId(this.otherAspects);\n this.otherEnv = { id: otherEnv };\n const baseEnv = this.baseAspects ? getEnvId(this.baseAspects) : undefined;\n if (baseEnv) this.baseEnv = { id: baseEnv };\n\n // populate version\n const currentEnvAspect = this.currentAspects.findExtension(currentEnv, true);\n if (currentEnvAspect) {\n this.handledExtIds.push(currentEnvAspect.stringId);\n this.currentEnv.version = currentEnvAspect.extensionId?.version;\n this.currentEnv.config = this.getConfig(currentEnvAspect);\n }\n const otherEnvAspect = this.otherAspects.findExtension(otherEnv, true);\n if (otherEnvAspect) {\n this.handledExtIds.push(otherEnvAspect.stringId);\n this.otherEnv.version = otherEnvAspect.extensionId?.version;\n this.otherEnv.config = this.getConfig(otherEnvAspect);\n }\n if (this.baseEnv) {\n const baseEnvAspect = this.baseAspects.findExtension(baseEnv, true);\n if (baseEnvAspect) {\n this.baseEnv.version = baseEnvAspect.extensionId?.version;\n this.baseEnv.config = this.getConfig(baseEnvAspect);\n }\n }\n }\n\n private envStrategy(): MergeStrategyResult | null {\n const mergeStrategyParams: MergeStrategyParamsWithRemoved = {\n id: EnvsAspect.id,\n currentConfig: {\n env: this.currentEnv.version ? `${this.currentEnv.id}@${this.currentEnv.version}` : this.currentEnv.id,\n },\n otherConfig: { env: this.otherEnv.version ? `${this.otherEnv.id}@${this.otherEnv.version}` : this.otherEnv.id },\n };\n if (this.baseEnv) {\n mergeStrategyParams.baseConfig = {\n env: this.baseEnv?.version ? `${this.baseEnv.id}@${this.baseEnv.version}` : this.baseEnv?.id,\n };\n }\n if (this.currentEnv.id === this.otherEnv.id && this.currentEnv.version === this.otherEnv.version) {\n return null;\n }\n if (this.isIdInWorkspaceOrOtherLane(this.currentEnv.id, this.otherEnv.version)) {\n // the env currently used is part of the workspace, that's what the user needs. don't try to resolve anything.\n return null;\n }\n return this.basicConfigMerge(mergeStrategyParams);\n }\n\n private areConfigsEqual(configA: GenericConfigOrRemoved, configB: GenericConfigOrRemoved) {\n return JSON.stringify(configA) === JSON.stringify(configB);\n }\n\n private mergePerStrategy(mergeStrategyParams: MergeStrategyParams): MergeStrategyResult | null {\n const { id, currentExt, otherExt, baseExt } = mergeStrategyParams;\n const depResolverResult = this.depResolverStrategy(mergeStrategyParams);\n\n if (depResolverResult) {\n // if (depResolverResult.mergedConfig || depResolverResult?.conflict) console.log(\"\\n\\nDepResolverResult\", this.compIdStr, '\\n', JSON.stringify(depResolverResult, undefined, 2))\n return depResolverResult;\n }\n const currentConfig = this.getConfig(currentExt);\n const otherConfig = this.getConfig(otherExt);\n const baseConfig = baseExt ? this.getConfig(baseExt) : undefined;\n\n return this.basicConfigMerge({ id, currentConfig, otherConfig, baseConfig });\n }\n\n private basicConfigMerge(mergeStrategyParams: MergeStrategyParamsWithRemoved) {\n const { id, currentConfig, otherConfig, baseConfig } = mergeStrategyParams;\n if (this.areConfigsEqual(currentConfig, otherConfig)) {\n return null;\n }\n if (baseConfig && this.areConfigsEqual(baseConfig, otherConfig)) {\n // was changed on current\n return null;\n }\n if (baseConfig && this.areConfigsEqual(baseConfig, currentConfig)) {\n // was changed on other\n return { id, mergedConfig: otherConfig };\n }\n // either no baseConfig, or baseConfig is also different from both: other and local. that's a conflict.\n if (this.mergeStrategy === 'theirs') {\n return { id, mergedConfig: otherConfig };\n }\n if (this.mergeStrategy === 'ours') {\n return null;\n }\n return { id, conflict: { currentConfig, otherConfig, baseConfig } };\n }\n\n /**\n * Performs a specialized 3-way merge for the dependency-resolver aspect configuration.\n *\n * This method handles merging of dependency configurations which is more complex than other aspects because:\n * 1. Dependencies come from TWO sources:\n * - Config (policy): explicitly configured by user (marked with force: true)\n * - Data (auto): automatically detected from import statements in code (source: 'auto')\n * 2. We need to merge both sources together to get the complete dependency picture\n *\n * The merge process:\n * 1. Handles config policy merge (explicit dependencies):\n * - Compares each dependency in current vs other vs base config policies\n * - Uses 3-way merge: if base==other, use current; if base==current, use other; else conflict\n * - Skips dependencies that exist in workspace or other lane (they'll be resolved locally)\n *\n * 2. Handles data dependencies merge (auto-detected dependencies):\n * - Merges auto-detected deps from both current and other\n * - For each dependency, determines if it should be added, kept, or marked as conflict\n * - Ignores environment dependencies (handled separately by envStrategy)\n * - Skips workspace dependencies (resolved to workspace version)\n *\n * 3. Conflict detection:\n * - Version conflicts marked with special format: \"CONFLICT::currentVer::otherVer::\"\n * - Respects merge strategy (ours/theirs/manual) for automatic resolution\n *\n * Returns:\n * - undefined if this is not the dependency-resolver aspect\n * - MergeStrategyResult with either:\n * - mergedConfig: successfully merged dependency policy\n * - conflict: conflicted dependencies marked with version conflicts\n */\n private depResolverStrategy(params: MergeStrategyParams): MergeStrategyResult | undefined {\n if (params.id !== DependencyResolverAspect.id) return undefined;\n this.logger.trace(`start depResolverStrategy for ${this.compIdStr}`);\n const { currentExt, otherExt, baseExt } = params;\n\n const currentConfig = this.getConfig(currentExt);\n const currentConfigPolicy = this.getPolicy(currentConfig);\n const otherConfig = this.getConfig(otherExt);\n const otherConfigPolicy = this.getPolicy(otherConfig);\n\n const baseConfig = baseExt ? this.getConfig(baseExt) : undefined;\n const baseConfigPolicy = baseConfig ? this.getPolicy(baseConfig) : undefined;\n\n this.logger.debug(`currentConfig, ${JSON.stringify(currentConfig, undefined, 2)}`);\n this.logger.debug(`otherConfig, ${JSON.stringify(otherConfig, undefined, 2)}`);\n this.logger.debug(`baseConfig, ${JSON.stringify(baseConfig, undefined, 2)}`);\n\n const getAllDeps = (ext: ExtensionDataList): SerializedDependencyWithPolicy[] => {\n const data = ext.findCoreExtension(DependencyResolverAspect.id)?.data.dependencies;\n if (!data) return [];\n const policy = ext.findCoreExtension(DependencyResolverAspect.id)?.data.policy || [];\n return data.map((d) => {\n const idWithoutVersion = d.__type === 'package' ? d.id : d.id.split('@')[0];\n const existingPolicy = policy.find((p) => p.dependencyId === idWithoutVersion);\n const getPolicyVer = () => {\n if (d.__type === 'package') return undefined; // for packages, the policy is already the version\n if (existingPolicy) return existingPolicy.value.version; // currently it's missing, will be implemented by @Gilad\n return d.version;\n // if (!semver.valid(d.version)) return d.version; // could be a hash\n // // default to `^` or ~ if starts with zero, until we save the policy from the workspace during tag/snap.\n // return d.version.startsWith('0.') ? `~${d.version}` : `^${d.version}`;\n };\n return {\n ...d,\n id: idWithoutVersion,\n policy: getPolicyVer(),\n };\n });\n };\n const getDataPolicy = (ext: ExtensionDataList): VariantPolicyEntry[] => {\n return ext.findCoreExtension(DependencyResolverAspect.id)?.data.policy || [];\n };\n\n const getAutoDeps = (ext: ExtensionDataList): SerializedDependencyWithPolicy[] => {\n const allDeps = getAllDeps(ext);\n return allDeps.filter((d) => d.source === 'auto');\n };\n\n const currentAutoData = getAutoDeps(this.currentAspects);\n const currentAllData = getAllDeps(this.currentAspects);\n const currentDataPolicy = getDataPolicy(this.currentAspects);\n const otherData = getAutoDeps(this.otherAspects);\n const currentAndOtherData = uniqBy(currentAutoData.concat(otherData), (d) => d.id);\n const currentAndOtherComponentsData = currentAndOtherData.filter((c) => c.__type === 'component');\n const baseData = getAutoDeps(this.baseAspects);\n\n const getCompIdStrByPkgNameFromData = (pkgName: string): string | undefined => {\n const found = currentAndOtherComponentsData.find((d) => d.packageName === pkgName);\n return found?.id;\n };\n\n const getFromCurrentDataByPackageName = (pkgName: string) => {\n return currentAllData.find((d) => {\n if (d.__type === 'package') return d.id === pkgName;\n return d.packageName === pkgName;\n });\n };\n\n const getFromCurrentDataPolicyByPackageName = (pkgName: string) => {\n return currentDataPolicy.find((d) => d.dependencyId === pkgName);\n };\n\n const mergedPolicy: Record<string, PolicyDependency[]> = {\n dependencies: [],\n devDependencies: [],\n peerDependencies: [],\n };\n const conflictedPolicy: Record<string, PolicyDependency[]> = {\n dependencies: [],\n devDependencies: [],\n peerDependencies: [],\n };\n let hasConflict = false;\n const lifecycleToDepType = {\n runtime: 'dependencies',\n dev: 'devDependencies',\n peer: 'peerDependencies',\n };\n const handleConfigMerge = () => {\n const addVariantPolicyEntryToPolicy = (dep: VariantPolicyEntry) => {\n const compIdStr = getCompIdStrByPkgNameFromData(dep.dependencyId);\n if (compIdStr && this.isIdInWorkspaceOrOtherLane(compIdStr, dep.value.version)) {\n // no need to add if the id exists in the workspace (regardless the version)\n return;\n }\n const fromCurrentData = getFromCurrentDataByPackageName(dep.dependencyId);\n if (fromCurrentData && !dep.force) {\n if (fromCurrentData.version === dep.value.version) return;\n if (\n !isHash(fromCurrentData.version) &&\n !isHash(dep.value.version) &&\n semver.satisfies(fromCurrentData.version, dep.value.version)\n ) {\n return;\n }\n }\n const fromCurrentDataPolicy = getFromCurrentDataPolicyByPackageName(dep.dependencyId);\n if (fromCurrentDataPolicy && fromCurrentDataPolicy.value.version === dep.value.version) {\n // -- updated comment --\n // not sure why this block is needed. this gets called also from this if: `if (baseConfig && this.areConfigsEqual(baseConfig, currentConfig)) {`\n // and in this case, it's possible that current/base has 5 deps, and other just added one and it has 6.\n // in which case, we do need to add all these 5 in additional to the new one. otherwise, only the new one appears in the final\n // merged object, and all the 5 deps are lost.\n // --- previous comment ---\n // that's a bug. if it's in the data.policy, it should be in data.dependencies.\n // return;\n }\n const depType = lifecycleToDepType[dep.lifecycleType];\n mergedPolicy[depType].push({\n name: dep.dependencyId,\n version: dep.value.version,\n force: dep.force,\n });\n };\n\n if (this.areConfigsEqual(currentConfig, otherConfig)) {\n // No need to add unchanged config deps here - they will be rescued by\n // mergeScopeSpecificDepsPolicy() in merging.main.runtime during merge processing\n return;\n }\n if (baseConfig && this.areConfigsEqual(baseConfig, otherConfig)) {\n // was changed on current\n // No need to add unchanged config deps here - they will be rescued by\n // mergeScopeSpecificDepsPolicy() in merging.main.runtime during merge processing\n return;\n }\n if (currentConfig === '-' || otherConfig === '-') {\n throw new Error('not implemented. Is it possible to have it as minus?');\n }\n if (baseConfig && this.areConfigsEqual(baseConfig, currentConfig)) {\n // was changed on other\n if (otherConfigPolicy.length) {\n otherConfigPolicy.forEach((dep) => {\n addVariantPolicyEntryToPolicy(dep);\n });\n }\n // Check if any dependencies in current were deleted on other\n // If a dependency exists in base and current but not in other, it was deleted on other\n currentConfigPolicy.forEach((currentDep) => {\n const baseDep = baseConfigPolicy?.find((d) => d.dependencyId === currentDep.dependencyId);\n const otherDep = otherConfigPolicy.find((d) => d.dependencyId === currentDep.dependencyId);\n if (baseDep && !otherDep) {\n // Dependency was deleted on other - add it with version: '-' to mark for deletion\n const depType = lifecycleToDepType[currentDep.lifecycleType];\n mergedPolicy[depType].push({\n name: currentDep.dependencyId,\n version: '-',\n });\n }\n });\n return;\n }\n\n // either no baseConfig, or baseConfig is also different from both: other and local. that's a conflict.\n if (!currentConfig.policy && !otherConfig.policy) return;\n const currentAndOtherConfig = uniqBy(currentConfigPolicy.concat(otherConfigPolicy), (d) => d.dependencyId);\n currentAndOtherConfig.forEach((dep) => {\n const depType = lifecycleToDepType[dep.lifecycleType];\n const currentDep = currentConfigPolicy.find((d) => d.dependencyId === dep.dependencyId);\n const otherDep = otherConfigPolicy.find((d) => d.dependencyId === dep.dependencyId);\n const baseDep = baseConfigPolicy?.find((d) => d.dependencyId === dep.dependencyId);\n\n if (!otherDep) {\n return;\n }\n if (!currentDep) {\n // only on other\n addVariantPolicyEntryToPolicy(otherDep);\n return;\n }\n const currentVer = currentDep.value.version;\n const otherVer = otherDep.value.version;\n if (currentVer === otherVer) {\n return;\n }\n const baseVer = baseDep?.value.version;\n if (baseVer && baseVer === otherVer) {\n return;\n }\n if (baseVer && baseVer === currentVer) {\n addVariantPolicyEntryToPolicy(otherDep);\n return;\n }\n const compIdStr = getCompIdStrByPkgNameFromData(dep.dependencyId);\n if (compIdStr && this.isIdInWorkspaceOrOtherLane(compIdStr, otherVer)) {\n // no need to add if the id exists in the workspace (regardless the version)\n return;\n }\n if (this.mergeStrategy === 'theirs') {\n addVariantPolicyEntryToPolicy(otherDep);\n return;\n }\n if (this.mergeStrategy === 'ours') {\n return;\n }\n\n hasConflict = true;\n conflictedPolicy[depType].push({\n name: currentDep.dependencyId,\n version: `${conflictIndicator}${currentVer}::${otherVer}::`,\n force: currentDep.force,\n });\n });\n };\n\n handleConfigMerge();\n\n const hasConfigForDep = (depType: string, depName: string) => mergedPolicy[depType].find((d) => d.name === depName);\n const getDepIdAsPkgName = (dep: SerializedDependencyWithPolicy): string => {\n if (dep.__type !== 'component') {\n return dep.id;\n }\n return dep.packageName!;\n };\n\n const addSerializedDepToPolicy = (dep: SerializedDependencyWithPolicy) => {\n const depType = lifecycleToDepType[dep.lifecycle];\n if (dep.__type === 'component' && this.isIdInWorkspaceOrOtherLane(dep.id, dep.version)) {\n return;\n }\n if (hasConfigForDep(depType, dep.id)) {\n return; // there is already config for it.\n }\n mergedPolicy[depType].push({\n name: getDepIdAsPkgName(dep),\n version: dep.policy || dep.version,\n force: false,\n });\n };\n\n this.logger.debug(\n `currentData, ${currentAllData.length}\\n${currentAllData\n .map((d) => `${d.__type} ${d.id} ${d.version}`)\n .join('\\n')}`\n );\n this.logger.debug(\n `otherData, ${otherData.length}\\n${otherData.map((d) => `${d.__type} ${d.id} ${d.version}`).join('\\n')}`\n );\n this.logger.debug(\n `baseData, ${baseData.length}\\n${baseData.map((d) => `${d.__type} ${d.id} ${d.version}`).join('\\n')}`\n );\n\n // eslint-disable-next-line complexity\n currentAndOtherData.forEach((depData) => {\n this.logger.trace(`depData.id, ${depData.id}`);\n if (this.isEnv(depData.id)) {\n // ignore the envs\n return;\n }\n const currentDep = currentAllData.find((d) => d.id === depData.id);\n const otherDep = otherData.find((d) => d.id === depData.id);\n const baseDep = baseData.find((d) => d.id === depData.id);\n\n this.logger.trace(`currentDep`, currentDep);\n this.logger.trace(`otherDep`, otherDep);\n this.logger.trace(`baseDep`, baseDep);\n if (!otherDep) {\n return;\n }\n if (!currentDep) {\n if (baseDep) {\n // exists in other and base, so it was removed from current\n return;\n }\n // only on other\n addSerializedDepToPolicy(otherDep);\n return;\n }\n\n if (currentDep.policy && otherDep.policy) {\n if (semver.satisfies(currentDep.version, otherDep.policy)) {\n return;\n }\n if (semver.satisfies(otherDep.version, currentDep.policy)) {\n return;\n }\n }\n\n const currentVer = currentDep.policy || currentDep.version;\n const otherVer = otherDep.policy || otherDep.version;\n if (currentVer === otherVer) {\n return;\n }\n const baseVer = baseDep?.policy || baseDep?.version;\n if (baseVer && baseVer === otherVer) {\n return;\n }\n const currentId = currentDep.id;\n if (currentDep.__type === 'component' && this.isIdInWorkspaceOrOtherLane(currentId, otherDep.version)) {\n // dependencies that exist in the workspace, should be ignored. they'll be resolved later to the version in the ws.\n return;\n }\n const depType = lifecycleToDepType[currentDep.lifecycle];\n if (hasConfigForDep(depType, currentDep.id)) {\n return; // there is already config for it.\n }\n if (baseVer && baseVer === currentVer) {\n addSerializedDepToPolicy(otherDep);\n return;\n }\n if (this.mergeStrategy === 'theirs') {\n addSerializedDepToPolicy(otherDep);\n return;\n }\n if (this.mergeStrategy === 'ours') {\n return;\n }\n hasConflict = true;\n conflictedPolicy[depType].push({\n name: getDepIdAsPkgName(currentDep),\n version: `${conflictIndicator}${currentVer}::${otherVer}::`,\n force: false,\n });\n });\n\n ['dependencies', 'devDependencies', 'peerDependencies'].forEach((depType) => {\n if (!mergedPolicy[depType].length) delete mergedPolicy[depType];\n if (!conflictedPolicy[depType].length) delete conflictedPolicy[depType];\n });\n\n const config = Object.keys(mergedPolicy).length ? { policy: mergedPolicy } : undefined;\n const conflict = hasConflict ? conflictedPolicy : undefined;\n\n this.logger.debug('final mergedConfig', config);\n this.logger.debug('final conflict', conflict);\n\n return { id: params.id, mergedConfig: config, conflict };\n }\n\n private isIdInWorkspaceOrOtherLane(id: string, versionOnOtherLane?: string): boolean {\n return Boolean(this.getIdFromWorkspace(id)) || this.otherLaneIdsStr.includes(`${id}@${versionOnOtherLane}`);\n }\n\n private getIdFromWorkspace(id: string): ComponentID | undefined {\n return this.workspaceIds.find((c) => c.toStringWithoutVersion() === id);\n }\n\n private isEnv(id: string) {\n return id === this.currentEnv.id || id === this.otherEnv.id;\n }\n\n private getConfig(ext: ExtensionDataEntry): GenericConfigOrRemoved {\n if (ext.rawConfig === '-') return ext.rawConfig;\n return omit(ext.rawConfig, ['__specific']);\n }\n\n private getPolicy(config): VariantPolicyEntry[] {\n if (!config.policy) return [];\n return VariantPolicy.fromConfigObject(config.policy).entries;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,QAAA,YA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yI,kBAAkB,EAAE,CAAC;EAC7G;EAEQ/G,kBAAkBA,CAAC1B,EAAU,EAA2B;IAC9D,OAAO,IAAI,CAACV,YAAY,CAACsF,IAAI,CAAEgB,CAAC,IAAKA,CAAC,CAACjE,sBAAsB,CAAC,CAAC,KAAK3B,EAAE,CAAC;EACzE;EAEQuI,KAAKA,CAACvI,EAAU,EAAE;IACxB,OAAOA,EAAE,KAAK,IAAI,CAAC0C,UAAU,CAAC1C,EAAE,IAAIA,EAAE,KAAK,IAAI,CAAC2C,QAAQ,CAAC3C,EAAE;EAC7D;EAEQoB,SAASA,CAACe,GAAuB,EAA0B;IACjE,IAAIA,GAAG,CAACwG,SAAS,KAAK,GAAG,EAAE,OAAOxG,GAAG,CAACwG,SAAS;IAC/C,OAAO,IAAAC,cAAI,EAACzG,GAAG,CAACwG,SAAS,EAAE,CAAC,YAAY,CAAC,CAAC;EAC5C;EAEQ1E,SAASA,CAACxB,MAAM,EAAwB;IAC9C,IAAI,CAACA,MAAM,CAAC6B,MAAM,EAAE,OAAO,EAAE;IAC7B,OAAOuE,mCAAa,CAACC,gBAAgB,CAACrG,MAAM,CAAC6B,MAAM,CAAC,CAACyE,OAAO;EAC9D;AACF;AAAC7J,OAAA,CAAAC,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_semver","data","_interopRequireDefault","require","_builder","_componentVersion","_dependencyResolver","_envs","_lodash","_configMergeResult","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","conflictIndicator","exports","ComponentConfigMerger","constructor","compIdStr","workspaceIds","otherLane","currentAspects","baseAspects","otherAspects","currentLabel","otherLabel","logger","mergeStrategy","BuilderAspect","id","EnvsAspect","otherLaneIdsStr","toComponentIds","map","toString","merge","debug","populateEnvs","results","currentExt","stringId","handledExtIds","includes","baseExt","findExtension","otherExt","mergePerStrategy","mergedConfig","conflict","currentConfig","getConfig","otherConfig","otherAspectsNotHandledResults","extensionId","hasVersion","idFromWorkspace","getIdFromWorkspace","toStringWithoutVersion","existingExt","_legacy","envResult","envStrategy","ConfigMergeResult","compact","getEnvId","ext","envsAspect","findCoreExtension","Error","env","config","currentEnv","otherEnv","baseEnv","undefined","currentEnvAspect","version","otherEnvAspect","baseEnvAspect","mergeStrategyParams","baseConfig","currentChangedEnvFromBase","Boolean","envIdChanged","isIdInWorkspaceOrOtherLane","basicConfigMerge","areConfigsEqual","configA","configB","JSON","stringify","depResolverResult","depResolverStrategy","params","DependencyResolverAspect","trace","currentConfigPolicy","getPolicy","otherConfigPolicy","baseConfigPolicy","getAllDeps","dependencies","policy","d","idWithoutVersion","__type","split","existingPolicy","find","p","dependencyId","getPolicyVer","getDataPolicy","getAutoDeps","allDeps","source","currentAutoData","currentAllData","currentDataPolicy","otherData","currentAndOtherData","uniqBy","concat","currentAndOtherComponentsData","c","baseData","getCompIdStrByPkgNameFromData","pkgName","found","packageName","getFromCurrentDataByPackageName","getFromCurrentDataPolicyByPackageName","mergedPolicy","devDependencies","peerDependencies","conflictedPolicy","hasConflict","lifecycleToDepType","runtime","dev","peer","handleConfigMerge","addVariantPolicyEntryToPolicy","dep","fromCurrentData","force","isHash","semver","satisfies","fromCurrentDataPolicy","depType","lifecycleType","name","currentDep","baseDep","otherDep","currentAndOtherConfig","currentVer","otherVer","baseVer","hasConfigForDep","depName","getDepIdAsPkgName","addSerializedDepToPolicy","lifecycle","join","depData","isEnv","currentId","versionOnOtherLane","rawConfig","omit","VariantPolicy","fromConfigObject","entries"],"sources":["component-config-merger.ts"],"sourcesContent":["import type { ComponentID } from '@teambit/component-id';\nimport semver from 'semver';\nimport type { Logger } from '@teambit/logger';\nimport { BuilderAspect } from '@teambit/builder';\nimport { isHash } from '@teambit/component-version';\nimport type { SerializedDependency, VariantPolicyEntry } from '@teambit/dependency-resolver';\nimport { DependencyResolverAspect, VariantPolicy } from '@teambit/dependency-resolver';\nimport type { Lane } from '@teambit/objects';\nimport { EnvsAspect } from '@teambit/envs';\nimport type { ExtensionDataEntry, ExtensionDataList } from '@teambit/legacy.extension-data';\nimport type { MergeStrategy } from '@teambit/component.modules.merge-helper';\nimport { compact, omit, uniqBy } from 'lodash';\nimport { ConfigMergeResult } from './config-merge-result';\n\nexport type GenericConfigOrRemoved = Record<string, any> | '-';\n\ntype EnvData = { id: string; version?: string; config?: GenericConfigOrRemoved };\n\ntype SerializedDependencyWithPolicy = SerializedDependency & { policy?: string; packageName?: string };\n\nexport type PolicyDependency = {\n name: string;\n version: string;\n force?: boolean;\n};\n\nexport const conflictIndicator = 'CONFLICT::';\n\nexport type MergeStrategyResult = {\n id: string;\n mergedConfig?: GenericConfigOrRemoved;\n conflict?: Record<string, any>;\n};\ntype MergeStrategyParamsWithRemoved = {\n id: string;\n currentConfig: GenericConfigOrRemoved;\n otherConfig: GenericConfigOrRemoved;\n baseConfig?: GenericConfigOrRemoved;\n};\ntype MergeStrategyParams = {\n id: string;\n currentExt: ExtensionDataEntry;\n otherExt: ExtensionDataEntry;\n baseExt?: ExtensionDataEntry;\n};\n\n/**\n * perform 3-way merge of component configuration (aspects).\n * normally this is needed when merging one lane into another. the component may have different aspects config in each lane.\n * the baseAspects are the aspects of the component in the diversion point (the common ancestor of the two lanes).\n * the currentAspects are the aspects of the component in the current lane.\n * the otherAspects are the aspects of the component in the other lane. this is the lane we merge into the current lane.\n *\n * the basic merging strategy is a simple comparison between the aspect-configs, if they're different, we have a conflict.\n * we have two special cases:\n *\n * 1. dependency-resolver: we do a deeper check for the policy, we compare each dependency separately. also, we take\n * into account not only the config, but also the data. this is needed because some dependencies are automatically\n * added by Bit (from the import statements in the code) and they're not in the config. the final config has the deps\n * from both sources, the config and the data. The way we know to differentiate between them is by the \"force\" prop.\n * the config has always force: true.\n *\n * 2. envs: if we don't treat it specially, the user will need to make the change not only in the envs aspect, but also\n * in the deps-resolver (because the env is added as a devDependency) and also in the aspect itself (because\n * teambit.envs/env has only the id and not the version). to make it simpler, we ignore the envs in the deps-resolver\n * we ignore the individual aspect that is the env itself. we only show teambit.envs/env and we put the env id and\n * version. later, when the component is loaded, we split the id and the version and put them in the correct places.\n * see workspace.componentExtension / adjustEnvsOnConfigMerge for more details.\n */\nexport class ComponentConfigMerger {\n private currentEnv: EnvData;\n private otherEnv: EnvData;\n private baseEnv?: EnvData;\n // don't try to merge builder, it's possible that at one end it wasn't built yet, so it's empty.\n // teambit.envs/envs is handled exclusively by envStrategy() — the generic aspect merge only sees the\n // raw `config.env`, which never carries the env's version (the version lives in the separate env-aspect\n // entry that only envStrategy knows to attach). Letting the generic merge run would leak an unversioned\n // external env and break the snap with ExternalEnvWithoutVersion.\n private handledExtIds: string[] = [BuilderAspect.id, EnvsAspect.id];\n private otherLaneIdsStr: string[];\n constructor(\n private compIdStr: string,\n private workspaceIds: ComponentID[],\n otherLane: Lane | undefined,\n private currentAspects: ExtensionDataList,\n private baseAspects: ExtensionDataList,\n private otherAspects: ExtensionDataList,\n private currentLabel: string,\n private otherLabel: string,\n private logger: Logger,\n private mergeStrategy: MergeStrategy\n ) {\n this.otherLaneIdsStr = otherLane?.toComponentIds().map((id) => id.toString()) || [];\n }\n\n merge(): ConfigMergeResult {\n this.logger.debug(`\\n************** start config-merger for ${this.compIdStr} **************`);\n this.logger.debug(`currentLabel: ${this.currentLabel}`);\n this.logger.debug(`otherLabel: ${this.otherLabel}`);\n this.populateEnvs();\n const results = this.currentAspects.map((currentExt) => {\n const id = currentExt.stringId;\n if (this.handledExtIds.includes(id)) return null;\n this.handledExtIds.push(id);\n const baseExt = this.baseAspects.findExtension(id, true);\n const otherExt = this.otherAspects.findExtension(id, true);\n if (otherExt) {\n // try to 3-way-merge\n return this.mergePerStrategy({ id, currentExt, otherExt, baseExt });\n }\n // exist in current but not in other\n if (baseExt) {\n // was removed on other\n if (this.mergeStrategy === 'theirs') {\n return { id, mergedConfig: '-' } as MergeStrategyResult;\n }\n if (this.mergeStrategy === 'ours') {\n return null;\n }\n return { id, conflict: { currentConfig: this.getConfig(currentExt), otherConfig: '-' } };\n }\n // exist in current but not in other and base, so it got created on current. nothing to do.\n return null;\n });\n const otherAspectsNotHandledResults = this.otherAspects.map((otherExt) => {\n let id = otherExt.stringId;\n if (this.handledExtIds.includes(id)) return null;\n this.handledExtIds.push(id);\n if (otherExt.extensionId && otherExt.extensionId.hasVersion()) {\n // avoid using the id from the other lane if it exits in the workspace. prefer the id from the workspace.\n const idFromWorkspace = this.getIdFromWorkspace(otherExt.extensionId.toStringWithoutVersion());\n if (idFromWorkspace) {\n const existingExt = this.currentAspects.findExtension(otherExt.extensionId.toStringWithoutVersion(), true);\n if (existingExt) return null; // the aspect is set currently, no need to add it again.\n id = idFromWorkspace._legacy.toString();\n }\n }\n const baseExt = this.baseAspects.findExtension(id, true);\n if (baseExt) {\n // was removed on current\n return { id, conflict: { currentConfig: '-', otherConfig: this.getConfig(otherExt) } };\n }\n // exist in other but not in current and base, so it got created on other.\n return { id, mergedConfig: this.getConfig(otherExt) };\n });\n const envResult = this.envStrategy();\n this.logger.debug(`*** end config-merger for ${this.compIdStr} ***\\n`);\n return new ConfigMergeResult(\n this.compIdStr,\n this.currentLabel,\n this.otherLabel,\n compact([...results, ...otherAspectsNotHandledResults, envResult])\n );\n }\n\n private populateEnvs() {\n // populate ids\n const getEnvId = (ext: ExtensionDataList) => {\n const envsAspect = ext.findCoreExtension(EnvsAspect.id);\n if (!envsAspect) throw new Error(`unable to find ${EnvsAspect.id} aspect for ${this.compIdStr}`);\n const env = envsAspect.config.env || envsAspect.data.id;\n if (!env)\n throw new Error(`unable to find env for ${this.compIdStr}, the config and data of ${EnvsAspect.id} are empty}`);\n return env;\n };\n const currentEnv = getEnvId(this.currentAspects);\n this.currentEnv = { id: currentEnv };\n const otherEnv = getEnvId(this.otherAspects);\n this.otherEnv = { id: otherEnv };\n const baseEnv = this.baseAspects ? getEnvId(this.baseAspects) : undefined;\n if (baseEnv) this.baseEnv = { id: baseEnv };\n\n // populate version\n const currentEnvAspect = this.currentAspects.findExtension(currentEnv, true);\n if (currentEnvAspect) {\n this.handledExtIds.push(currentEnvAspect.stringId);\n this.currentEnv.version = currentEnvAspect.extensionId?.version;\n this.currentEnv.config = this.getConfig(currentEnvAspect);\n }\n const otherEnvAspect = this.otherAspects.findExtension(otherEnv, true);\n if (otherEnvAspect) {\n this.handledExtIds.push(otherEnvAspect.stringId);\n this.otherEnv.version = otherEnvAspect.extensionId?.version;\n this.otherEnv.config = this.getConfig(otherEnvAspect);\n }\n if (this.baseEnv) {\n const baseEnvAspect = this.baseAspects.findExtension(baseEnv, true);\n if (baseEnvAspect) {\n this.baseEnv.version = baseEnvAspect.extensionId?.version;\n this.baseEnv.config = this.getConfig(baseEnvAspect);\n }\n }\n }\n\n private envStrategy(): MergeStrategyResult | null {\n const mergeStrategyParams: MergeStrategyParamsWithRemoved = {\n id: EnvsAspect.id,\n currentConfig: {\n env: this.currentEnv.version ? `${this.currentEnv.id}@${this.currentEnv.version}` : this.currentEnv.id,\n },\n otherConfig: { env: this.otherEnv.version ? `${this.otherEnv.id}@${this.otherEnv.version}` : this.otherEnv.id },\n };\n if (this.baseEnv) {\n mergeStrategyParams.baseConfig = {\n env: this.baseEnv?.version ? `${this.baseEnv.id}@${this.baseEnv.version}` : this.baseEnv?.id,\n };\n }\n if (this.currentEnv.id === this.otherEnv.id && this.currentEnv.version === this.otherEnv.version) {\n return null;\n }\n // did the current lane deliberately change its env away from the diversion point (base)?\n // a version difference counts only when both sides have a known version — a missing base version\n // (versionless/core env, or an absent base env-aspect entry) is \"unknown\", not \"changed\", so it must\n // not block propagation of an env change made on the other lane.\n const currentChangedEnvFromBase =\n !this.baseEnv ||\n this.baseEnv.id !== this.currentEnv.id ||\n Boolean(this.baseEnv.version && this.currentEnv.version && this.baseEnv.version !== this.currentEnv.version);\n // did \"other\" switch to a *different* env (a migration), or merely bump the same env's version?\n const envIdChanged = this.currentEnv.id !== this.otherEnv.id;\n // keep the current env (don't sync from \"other\") when it's a workspace component (or exists on the other\n // lane) AND either the current lane deliberately changed its env, OR only the env's *version* differs.\n // rationale: a workspace env's version is owned by the workspace, so we never adopt a different version of\n // the *same* env from the other lane. only a genuine env *migration* (id change) that the current lane did\n // not make is allowed to propagate — handled by the 3-way merge below (with the new env's version).\n if (\n (currentChangedEnvFromBase || !envIdChanged) &&\n this.isIdInWorkspaceOrOtherLane(this.currentEnv.id, this.currentEnv.version)\n ) {\n return null;\n }\n return this.basicConfigMerge(mergeStrategyParams);\n }\n\n private areConfigsEqual(configA: GenericConfigOrRemoved, configB: GenericConfigOrRemoved) {\n return JSON.stringify(configA) === JSON.stringify(configB);\n }\n\n private mergePerStrategy(mergeStrategyParams: MergeStrategyParams): MergeStrategyResult | null {\n const { id, currentExt, otherExt, baseExt } = mergeStrategyParams;\n const depResolverResult = this.depResolverStrategy(mergeStrategyParams);\n\n if (depResolverResult) {\n // if (depResolverResult.mergedConfig || depResolverResult?.conflict) console.log(\"\\n\\nDepResolverResult\", this.compIdStr, '\\n', JSON.stringify(depResolverResult, undefined, 2))\n return depResolverResult;\n }\n const currentConfig = this.getConfig(currentExt);\n const otherConfig = this.getConfig(otherExt);\n const baseConfig = baseExt ? this.getConfig(baseExt) : undefined;\n\n return this.basicConfigMerge({ id, currentConfig, otherConfig, baseConfig });\n }\n\n private basicConfigMerge(mergeStrategyParams: MergeStrategyParamsWithRemoved) {\n const { id, currentConfig, otherConfig, baseConfig } = mergeStrategyParams;\n if (this.areConfigsEqual(currentConfig, otherConfig)) {\n return null;\n }\n if (baseConfig && this.areConfigsEqual(baseConfig, otherConfig)) {\n // was changed on current\n return null;\n }\n if (baseConfig && this.areConfigsEqual(baseConfig, currentConfig)) {\n // was changed on other\n return { id, mergedConfig: otherConfig };\n }\n // either no baseConfig, or baseConfig is also different from both: other and local. that's a conflict.\n if (this.mergeStrategy === 'theirs') {\n return { id, mergedConfig: otherConfig };\n }\n if (this.mergeStrategy === 'ours') {\n return null;\n }\n return { id, conflict: { currentConfig, otherConfig, baseConfig } };\n }\n\n /**\n * Performs a specialized 3-way merge for the dependency-resolver aspect configuration.\n *\n * This method handles merging of dependency configurations which is more complex than other aspects because:\n * 1. Dependencies come from TWO sources:\n * - Config (policy): explicitly configured by user (marked with force: true)\n * - Data (auto): automatically detected from import statements in code (source: 'auto')\n * 2. We need to merge both sources together to get the complete dependency picture\n *\n * The merge process:\n * 1. Handles config policy merge (explicit dependencies):\n * - Compares each dependency in current vs other vs base config policies\n * - Uses 3-way merge: if base==other, use current; if base==current, use other; else conflict\n * - Skips dependencies that exist in workspace or other lane (they'll be resolved locally)\n *\n * 2. Handles data dependencies merge (auto-detected dependencies):\n * - Merges auto-detected deps from both current and other\n * - For each dependency, determines if it should be added, kept, or marked as conflict\n * - Ignores environment dependencies (handled separately by envStrategy)\n * - Skips workspace dependencies (resolved to workspace version)\n *\n * 3. Conflict detection:\n * - Version conflicts marked with special format: \"CONFLICT::currentVer::otherVer::\"\n * - Respects merge strategy (ours/theirs/manual) for automatic resolution\n *\n * Returns:\n * - undefined if this is not the dependency-resolver aspect\n * - MergeStrategyResult with either:\n * - mergedConfig: successfully merged dependency policy\n * - conflict: conflicted dependencies marked with version conflicts\n */\n private depResolverStrategy(params: MergeStrategyParams): MergeStrategyResult | undefined {\n if (params.id !== DependencyResolverAspect.id) return undefined;\n this.logger.trace(`start depResolverStrategy for ${this.compIdStr}`);\n const { currentExt, otherExt, baseExt } = params;\n\n const currentConfig = this.getConfig(currentExt);\n const currentConfigPolicy = this.getPolicy(currentConfig);\n const otherConfig = this.getConfig(otherExt);\n const otherConfigPolicy = this.getPolicy(otherConfig);\n\n const baseConfig = baseExt ? this.getConfig(baseExt) : undefined;\n const baseConfigPolicy = baseConfig ? this.getPolicy(baseConfig) : undefined;\n\n this.logger.debug(`currentConfig, ${JSON.stringify(currentConfig, undefined, 2)}`);\n this.logger.debug(`otherConfig, ${JSON.stringify(otherConfig, undefined, 2)}`);\n this.logger.debug(`baseConfig, ${JSON.stringify(baseConfig, undefined, 2)}`);\n\n const getAllDeps = (ext: ExtensionDataList): SerializedDependencyWithPolicy[] => {\n const data = ext.findCoreExtension(DependencyResolverAspect.id)?.data.dependencies;\n if (!data) return [];\n const policy = ext.findCoreExtension(DependencyResolverAspect.id)?.data.policy || [];\n return data.map((d) => {\n const idWithoutVersion = d.__type === 'package' ? d.id : d.id.split('@')[0];\n const existingPolicy = policy.find((p) => p.dependencyId === idWithoutVersion);\n const getPolicyVer = () => {\n if (d.__type === 'package') return undefined; // for packages, the policy is already the version\n if (existingPolicy) return existingPolicy.value.version; // currently it's missing, will be implemented by @Gilad\n return d.version;\n // if (!semver.valid(d.version)) return d.version; // could be a hash\n // // default to `^` or ~ if starts with zero, until we save the policy from the workspace during tag/snap.\n // return d.version.startsWith('0.') ? `~${d.version}` : `^${d.version}`;\n };\n return {\n ...d,\n id: idWithoutVersion,\n policy: getPolicyVer(),\n };\n });\n };\n const getDataPolicy = (ext: ExtensionDataList): VariantPolicyEntry[] => {\n return ext.findCoreExtension(DependencyResolverAspect.id)?.data.policy || [];\n };\n\n const getAutoDeps = (ext: ExtensionDataList): SerializedDependencyWithPolicy[] => {\n const allDeps = getAllDeps(ext);\n return allDeps.filter((d) => d.source === 'auto');\n };\n\n const currentAutoData = getAutoDeps(this.currentAspects);\n const currentAllData = getAllDeps(this.currentAspects);\n const currentDataPolicy = getDataPolicy(this.currentAspects);\n const otherData = getAutoDeps(this.otherAspects);\n const currentAndOtherData = uniqBy(currentAutoData.concat(otherData), (d) => d.id);\n const currentAndOtherComponentsData = currentAndOtherData.filter((c) => c.__type === 'component');\n const baseData = getAutoDeps(this.baseAspects);\n\n const getCompIdStrByPkgNameFromData = (pkgName: string): string | undefined => {\n const found = currentAndOtherComponentsData.find((d) => d.packageName === pkgName);\n return found?.id;\n };\n\n const getFromCurrentDataByPackageName = (pkgName: string) => {\n return currentAllData.find((d) => {\n if (d.__type === 'package') return d.id === pkgName;\n return d.packageName === pkgName;\n });\n };\n\n const getFromCurrentDataPolicyByPackageName = (pkgName: string) => {\n return currentDataPolicy.find((d) => d.dependencyId === pkgName);\n };\n\n const mergedPolicy: Record<string, PolicyDependency[]> = {\n dependencies: [],\n devDependencies: [],\n peerDependencies: [],\n };\n const conflictedPolicy: Record<string, PolicyDependency[]> = {\n dependencies: [],\n devDependencies: [],\n peerDependencies: [],\n };\n let hasConflict = false;\n const lifecycleToDepType = {\n runtime: 'dependencies',\n dev: 'devDependencies',\n peer: 'peerDependencies',\n };\n const handleConfigMerge = () => {\n const addVariantPolicyEntryToPolicy = (dep: VariantPolicyEntry) => {\n const compIdStr = getCompIdStrByPkgNameFromData(dep.dependencyId);\n if (compIdStr && this.isIdInWorkspaceOrOtherLane(compIdStr, dep.value.version)) {\n // no need to add if the id exists in the workspace (regardless the version)\n return;\n }\n const fromCurrentData = getFromCurrentDataByPackageName(dep.dependencyId);\n if (fromCurrentData && !dep.force) {\n if (fromCurrentData.version === dep.value.version) return;\n if (\n !isHash(fromCurrentData.version) &&\n !isHash(dep.value.version) &&\n semver.satisfies(fromCurrentData.version, dep.value.version)\n ) {\n return;\n }\n }\n const fromCurrentDataPolicy = getFromCurrentDataPolicyByPackageName(dep.dependencyId);\n if (fromCurrentDataPolicy && fromCurrentDataPolicy.value.version === dep.value.version) {\n // -- updated comment --\n // not sure why this block is needed. this gets called also from this if: `if (baseConfig && this.areConfigsEqual(baseConfig, currentConfig)) {`\n // and in this case, it's possible that current/base has 5 deps, and other just added one and it has 6.\n // in which case, we do need to add all these 5 in additional to the new one. otherwise, only the new one appears in the final\n // merged object, and all the 5 deps are lost.\n // --- previous comment ---\n // that's a bug. if it's in the data.policy, it should be in data.dependencies.\n // return;\n }\n const depType = lifecycleToDepType[dep.lifecycleType];\n mergedPolicy[depType].push({\n name: dep.dependencyId,\n version: dep.value.version,\n force: dep.force,\n });\n };\n\n if (this.areConfigsEqual(currentConfig, otherConfig)) {\n // No need to add unchanged config deps here - they will be rescued by\n // mergeScopeSpecificDepsPolicy() in merging.main.runtime during merge processing\n return;\n }\n if (baseConfig && this.areConfigsEqual(baseConfig, otherConfig)) {\n // was changed on current\n // No need to add unchanged config deps here - they will be rescued by\n // mergeScopeSpecificDepsPolicy() in merging.main.runtime during merge processing\n return;\n }\n if (currentConfig === '-' || otherConfig === '-') {\n throw new Error('not implemented. Is it possible to have it as minus?');\n }\n if (baseConfig && this.areConfigsEqual(baseConfig, currentConfig)) {\n // was changed on other\n if (otherConfigPolicy.length) {\n otherConfigPolicy.forEach((dep) => {\n addVariantPolicyEntryToPolicy(dep);\n });\n }\n // Check if any dependencies in current were deleted on other\n // If a dependency exists in base and current but not in other, it was deleted on other\n currentConfigPolicy.forEach((currentDep) => {\n const baseDep = baseConfigPolicy?.find((d) => d.dependencyId === currentDep.dependencyId);\n const otherDep = otherConfigPolicy.find((d) => d.dependencyId === currentDep.dependencyId);\n if (baseDep && !otherDep) {\n // Dependency was deleted on other - add it with version: '-' to mark for deletion\n const depType = lifecycleToDepType[currentDep.lifecycleType];\n mergedPolicy[depType].push({\n name: currentDep.dependencyId,\n version: '-',\n });\n }\n });\n return;\n }\n\n // either no baseConfig, or baseConfig is also different from both: other and local. that's a conflict.\n if (!currentConfig.policy && !otherConfig.policy) return;\n const currentAndOtherConfig = uniqBy(currentConfigPolicy.concat(otherConfigPolicy), (d) => d.dependencyId);\n currentAndOtherConfig.forEach((dep) => {\n const depType = lifecycleToDepType[dep.lifecycleType];\n const currentDep = currentConfigPolicy.find((d) => d.dependencyId === dep.dependencyId);\n const otherDep = otherConfigPolicy.find((d) => d.dependencyId === dep.dependencyId);\n const baseDep = baseConfigPolicy?.find((d) => d.dependencyId === dep.dependencyId);\n\n if (!otherDep) {\n return;\n }\n if (!currentDep) {\n // only on other\n addVariantPolicyEntryToPolicy(otherDep);\n return;\n }\n const currentVer = currentDep.value.version;\n const otherVer = otherDep.value.version;\n if (currentVer === otherVer) {\n return;\n }\n const baseVer = baseDep?.value.version;\n if (baseVer && baseVer === otherVer) {\n return;\n }\n if (baseVer && baseVer === currentVer) {\n addVariantPolicyEntryToPolicy(otherDep);\n return;\n }\n const compIdStr = getCompIdStrByPkgNameFromData(dep.dependencyId);\n if (compIdStr && this.isIdInWorkspaceOrOtherLane(compIdStr, otherVer)) {\n // no need to add if the id exists in the workspace (regardless the version)\n return;\n }\n if (this.mergeStrategy === 'theirs') {\n addVariantPolicyEntryToPolicy(otherDep);\n return;\n }\n if (this.mergeStrategy === 'ours') {\n return;\n }\n\n hasConflict = true;\n conflictedPolicy[depType].push({\n name: currentDep.dependencyId,\n version: `${conflictIndicator}${currentVer}::${otherVer}::`,\n force: currentDep.force,\n });\n });\n };\n\n handleConfigMerge();\n\n const hasConfigForDep = (depType: string, depName: string) => mergedPolicy[depType].find((d) => d.name === depName);\n const getDepIdAsPkgName = (dep: SerializedDependencyWithPolicy): string => {\n if (dep.__type !== 'component') {\n return dep.id;\n }\n return dep.packageName!;\n };\n\n const addSerializedDepToPolicy = (dep: SerializedDependencyWithPolicy) => {\n const depType = lifecycleToDepType[dep.lifecycle];\n if (dep.__type === 'component' && this.isIdInWorkspaceOrOtherLane(dep.id, dep.version)) {\n return;\n }\n if (hasConfigForDep(depType, dep.id)) {\n return; // there is already config for it.\n }\n mergedPolicy[depType].push({\n name: getDepIdAsPkgName(dep),\n version: dep.policy || dep.version,\n force: false,\n });\n };\n\n this.logger.debug(\n `currentData, ${currentAllData.length}\\n${currentAllData\n .map((d) => `${d.__type} ${d.id} ${d.version}`)\n .join('\\n')}`\n );\n this.logger.debug(\n `otherData, ${otherData.length}\\n${otherData.map((d) => `${d.__type} ${d.id} ${d.version}`).join('\\n')}`\n );\n this.logger.debug(\n `baseData, ${baseData.length}\\n${baseData.map((d) => `${d.__type} ${d.id} ${d.version}`).join('\\n')}`\n );\n\n // eslint-disable-next-line complexity\n currentAndOtherData.forEach((depData) => {\n this.logger.trace(`depData.id, ${depData.id}`);\n if (this.isEnv(depData.id)) {\n // ignore the envs\n return;\n }\n const currentDep = currentAllData.find((d) => d.id === depData.id);\n const otherDep = otherData.find((d) => d.id === depData.id);\n const baseDep = baseData.find((d) => d.id === depData.id);\n\n this.logger.trace(`currentDep`, currentDep);\n this.logger.trace(`otherDep`, otherDep);\n this.logger.trace(`baseDep`, baseDep);\n if (!otherDep) {\n return;\n }\n if (!currentDep) {\n if (baseDep) {\n // exists in other and base, so it was removed from current\n return;\n }\n // only on other\n addSerializedDepToPolicy(otherDep);\n return;\n }\n\n if (currentDep.policy && otherDep.policy) {\n if (semver.satisfies(currentDep.version, otherDep.policy)) {\n return;\n }\n if (semver.satisfies(otherDep.version, currentDep.policy)) {\n return;\n }\n }\n\n const currentVer = currentDep.policy || currentDep.version;\n const otherVer = otherDep.policy || otherDep.version;\n if (currentVer === otherVer) {\n return;\n }\n const baseVer = baseDep?.policy || baseDep?.version;\n if (baseVer && baseVer === otherVer) {\n return;\n }\n const currentId = currentDep.id;\n if (currentDep.__type === 'component' && this.isIdInWorkspaceOrOtherLane(currentId, otherDep.version)) {\n // dependencies that exist in the workspace, should be ignored. they'll be resolved later to the version in the ws.\n return;\n }\n const depType = lifecycleToDepType[currentDep.lifecycle];\n if (hasConfigForDep(depType, currentDep.id)) {\n return; // there is already config for it.\n }\n if (baseVer && baseVer === currentVer) {\n addSerializedDepToPolicy(otherDep);\n return;\n }\n if (this.mergeStrategy === 'theirs') {\n addSerializedDepToPolicy(otherDep);\n return;\n }\n if (this.mergeStrategy === 'ours') {\n return;\n }\n hasConflict = true;\n conflictedPolicy[depType].push({\n name: getDepIdAsPkgName(currentDep),\n version: `${conflictIndicator}${currentVer}::${otherVer}::`,\n force: false,\n });\n });\n\n ['dependencies', 'devDependencies', 'peerDependencies'].forEach((depType) => {\n if (!mergedPolicy[depType].length) delete mergedPolicy[depType];\n if (!conflictedPolicy[depType].length) delete conflictedPolicy[depType];\n });\n\n const config = Object.keys(mergedPolicy).length ? { policy: mergedPolicy } : undefined;\n const conflict = hasConflict ? conflictedPolicy : undefined;\n\n this.logger.debug('final mergedConfig', config);\n this.logger.debug('final conflict', conflict);\n\n return { id: params.id, mergedConfig: config, conflict };\n }\n\n private isIdInWorkspaceOrOtherLane(id: string, versionOnOtherLane?: string): boolean {\n return Boolean(this.getIdFromWorkspace(id)) || this.otherLaneIdsStr.includes(`${id}@${versionOnOtherLane}`);\n }\n\n private getIdFromWorkspace(id: string): ComponentID | undefined {\n return this.workspaceIds.find((c) => c.toStringWithoutVersion() === id);\n }\n\n private isEnv(id: string) {\n return id === this.currentEnv.id || id === this.otherEnv.id;\n }\n\n private getConfig(ext: ExtensionDataEntry): GenericConfigOrRemoved {\n if (ext.rawConfig === '-') return ext.rawConfig;\n return omit(ext.rawConfig, ['__specific']);\n }\n\n private getPolicy(config): VariantPolicyEntry[] {\n if (!config.policy) return [];\n return VariantPolicy.fromConfigObject(config.policy).entries;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,kBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,iBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,oBAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,mBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,MAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,KAAA,Y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U,EAAE4I,kBAA2B,EAAW;IACnF,OAAOvF,OAAO,CAAC,IAAI,CAAC1B,kBAAkB,CAAC3B,EAAE,CAAC,CAAC,IAAI,IAAI,CAACE,eAAe,CAACW,QAAQ,CAAC,GAAGb,EAAE,IAAI4I,kBAAkB,EAAE,CAAC;EAC7G;EAEQjH,kBAAkBA,CAAC3B,EAAU,EAA2B;IAC9D,OAAO,IAAI,CAACV,YAAY,CAACyF,IAAI,CAAEgB,CAAC,IAAKA,CAAC,CAACnE,sBAAsB,CAAC,CAAC,KAAK5B,EAAE,CAAC;EACzE;EAEQ0I,KAAKA,CAAC1I,EAAU,EAAE;IACxB,OAAOA,EAAE,KAAK,IAAI,CAAC0C,UAAU,CAAC1C,EAAE,IAAIA,EAAE,KAAK,IAAI,CAAC2C,QAAQ,CAAC3C,EAAE;EAC7D;EAEQqB,SAASA,CAACe,GAAuB,EAA0B;IACjE,IAAIA,GAAG,CAACyG,SAAS,KAAK,GAAG,EAAE,OAAOzG,GAAG,CAACyG,SAAS;IAC/C,OAAO,IAAAC,cAAI,EAAC1G,GAAG,CAACyG,SAAS,EAAE,CAAC,YAAY,CAAC,CAAC;EAC5C;EAEQzE,SAASA,CAAC3B,MAAM,EAAwB;IAC9C,IAAI,CAACA,MAAM,CAACgC,MAAM,EAAE,OAAO,EAAE;IAC7B,OAAOsE,mCAAa,CAACC,gBAAgB,CAACvG,MAAM,CAACgC,MAAM,CAAC,CAACwE,OAAO;EAC9D;AACF;AAAC/J,OAAA,CAAAC,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _chai() {
|
|
4
|
+
const data = require("chai");
|
|
5
|
+
_chai = function () {
|
|
6
|
+
return data;
|
|
7
|
+
};
|
|
8
|
+
return data;
|
|
9
|
+
}
|
|
10
|
+
function _componentId() {
|
|
11
|
+
const data = require("@teambit/component-id");
|
|
12
|
+
_componentId = function () {
|
|
13
|
+
return data;
|
|
14
|
+
};
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
function _envs() {
|
|
18
|
+
const data = require("@teambit/envs");
|
|
19
|
+
_envs = function () {
|
|
20
|
+
return data;
|
|
21
|
+
};
|
|
22
|
+
return data;
|
|
23
|
+
}
|
|
24
|
+
function _legacy() {
|
|
25
|
+
const data = require("@teambit/legacy.extension-data");
|
|
26
|
+
_legacy = function () {
|
|
27
|
+
return data;
|
|
28
|
+
};
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
function _componentConfigMerger() {
|
|
32
|
+
const data = require("./component-config-merger");
|
|
33
|
+
_componentConfigMerger = function () {
|
|
34
|
+
return data;
|
|
35
|
+
};
|
|
36
|
+
return data;
|
|
37
|
+
}
|
|
38
|
+
const noopLogger = {
|
|
39
|
+
debug() {},
|
|
40
|
+
trace() {}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// A core-style teambit.envs/envs entry (matched by `name`, so it works without the runtime
|
|
44
|
+
// core-extensions registry being populated — as is the case in an isolated component test).
|
|
45
|
+
const envsEntry = env => new (_legacy().ExtensionDataEntry)(undefined, undefined, _envs().EnvsAspect.id, {
|
|
46
|
+
env
|
|
47
|
+
}, {});
|
|
48
|
+
// The separate env-aspect entry that carries the resolved version (`id@version`). As stored in a committed
|
|
49
|
+
// version, teambit.envs/envs.config.env holds the id WITHOUT a version; the version lives only here.
|
|
50
|
+
const envAspectEntry = idWithVersion => new (_legacy().ExtensionDataEntry)(undefined, _componentId().ComponentID.fromString(idWithVersion), undefined, {}, {});
|
|
51
|
+
function mergeEnvConfig(current, base, other, workspaceIds, mergeStrategy = 'ours') {
|
|
52
|
+
const merger = new (_componentConfigMerger().ComponentConfigMerger)('my-scope/some-comp', workspaceIds, undefined, current, base, other, 'lane', 'main', noopLogger, mergeStrategy);
|
|
53
|
+
return merger.merge().getSuccessfullyMergedConfig();
|
|
54
|
+
}
|
|
55
|
+
describe('ComponentConfigMerger', () => {
|
|
56
|
+
// teambit.envs/envs is a core extension at full runtime (registered by the core aspects). Register it here
|
|
57
|
+
// so the merger behaves the same inside an isolated component test, and restore the prior state afterwards
|
|
58
|
+
// so we don't leak into the shared static map (which would make other tests order-dependent).
|
|
59
|
+
let prevEnvsCoreName;
|
|
60
|
+
before(() => {
|
|
61
|
+
prevEnvsCoreName = _legacy().ExtensionDataList.coreExtensionsNames.get(_envs().EnvsAspect.id);
|
|
62
|
+
_legacy().ExtensionDataList.coreExtensionsNames.set(_envs().EnvsAspect.id, '');
|
|
63
|
+
});
|
|
64
|
+
after(() => {
|
|
65
|
+
if (prevEnvsCoreName === undefined) _legacy().ExtensionDataList.coreExtensionsNames.delete(_envs().EnvsAspect.id);else _legacy().ExtensionDataList.coreExtensionsNames.set(_envs().EnvsAspect.id, prevEnvsCoreName);
|
|
66
|
+
});
|
|
67
|
+
describe('env migrated on "other" (main) while the current lane kept the old env', () => {
|
|
68
|
+
// Reproduces the `bit ci pr` config-sync scenario: the PR lane never touched its env (base === current)
|
|
69
|
+
// and main migrated the component onto a different EXTERNAL env. The change should propagate from main,
|
|
70
|
+
// and critically must carry the version — syncing teambit.envs/envs.config.env alone (id without version)
|
|
71
|
+
// would produce an unversioned external env and crash the snap with ExternalEnvWithoutVersion.
|
|
72
|
+
let mergedConfig;
|
|
73
|
+
before(() => {
|
|
74
|
+
const oldEnv = 'my-scope.envs/ws-env'; // the env the lane keeps; it's also a workspace component.
|
|
75
|
+
const newEnv = 'other-scope.envs/ext-env'; // the external env main migrated to.
|
|
76
|
+
// base === current: the lane didn't change its env.
|
|
77
|
+
const base = new (_legacy().ExtensionDataList)(envsEntry(oldEnv), envAspectEntry(`${oldEnv}@0.0.1`));
|
|
78
|
+
const current = new (_legacy().ExtensionDataList)(envsEntry(oldEnv), envAspectEntry(`${oldEnv}@0.0.1`));
|
|
79
|
+
const other = new (_legacy().ExtensionDataList)(envsEntry(newEnv), envAspectEntry(`${newEnv}@1.0.0`));
|
|
80
|
+
// `oldEnv` is a workspace component — this used to make envStrategy keep it instead of propagating.
|
|
81
|
+
const workspaceIds = [_componentId().ComponentID.fromString(`${oldEnv}@0.0.1`)];
|
|
82
|
+
mergedConfig = mergeEnvConfig(current, base, other, workspaceIds);
|
|
83
|
+
});
|
|
84
|
+
it('should sync the env from main WITH its version (no unversioned env leak)', () => {
|
|
85
|
+
(0, _chai().expect)(mergedConfig[_envs().EnvsAspect.id]).to.deep.equal({
|
|
86
|
+
env: 'other-scope.envs/ext-env@1.0.0'
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
describe('current lane deliberately switched to a workspace env', () => {
|
|
91
|
+
// The lane changed its env (base !== current) to a workspace component. That's a deliberate choice for
|
|
92
|
+
// this lane, so a differing env on "other" must NOT override it.
|
|
93
|
+
let mergedConfig;
|
|
94
|
+
before(() => {
|
|
95
|
+
const baseEnv = 'other-scope.envs/orig-env';
|
|
96
|
+
const laneEnv = 'my-scope.envs/ws-env'; // the lane switched to this workspace env.
|
|
97
|
+
const otherEnv = 'other-scope.envs/ext-env';
|
|
98
|
+
const base = new (_legacy().ExtensionDataList)(envsEntry(baseEnv), envAspectEntry(`${baseEnv}@0.9.0`));
|
|
99
|
+
const current = new (_legacy().ExtensionDataList)(envsEntry(laneEnv), envAspectEntry(`${laneEnv}@0.0.1`));
|
|
100
|
+
const other = new (_legacy().ExtensionDataList)(envsEntry(otherEnv), envAspectEntry(`${otherEnv}@1.0.0`));
|
|
101
|
+
const workspaceIds = [_componentId().ComponentID.fromString(`${laneEnv}@0.0.1`)];
|
|
102
|
+
mergedConfig = mergeEnvConfig(current, base, other, workspaceIds);
|
|
103
|
+
});
|
|
104
|
+
it('should keep the lane env and not sync teambit.envs/envs from "other"', () => {
|
|
105
|
+
(0, _chai().expect)(mergedConfig[_envs().EnvsAspect.id]).to.be.undefined;
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
describe('base env version is unknown (base env-aspect entry absent)', () => {
|
|
109
|
+
// base and current share the env id, but base's version is unknown (its env-aspect entry is missing).
|
|
110
|
+
// that must NOT be treated as "the current lane changed its env" — otherwise the keep-workspace-env
|
|
111
|
+
// short-circuit would fire and silently swallow the env change made on "other". Instead the normal
|
|
112
|
+
// 3-way merge applies; with 'theirs' it takes the other lane's env (with its version).
|
|
113
|
+
let mergedConfig;
|
|
114
|
+
before(() => {
|
|
115
|
+
const env = 'my-scope.envs/ws-env'; // same env id on base & current; also a workspace component.
|
|
116
|
+
const otherEnv = 'other-scope.envs/ext-env';
|
|
117
|
+
// base carries the env id but NO env-aspect entry -> its version resolves to undefined (unknown).
|
|
118
|
+
const base = new (_legacy().ExtensionDataList)(envsEntry(env));
|
|
119
|
+
const current = new (_legacy().ExtensionDataList)(envsEntry(env), envAspectEntry(`${env}@0.0.1`));
|
|
120
|
+
const other = new (_legacy().ExtensionDataList)(envsEntry(otherEnv), envAspectEntry(`${otherEnv}@1.0.0`));
|
|
121
|
+
const workspaceIds = [_componentId().ComponentID.fromString(`${env}@0.0.1`)];
|
|
122
|
+
mergedConfig = mergeEnvConfig(current, base, other, workspaceIds, 'theirs');
|
|
123
|
+
});
|
|
124
|
+
it('should not short-circuit on the workspace env; the merge strategy decides (takes other)', () => {
|
|
125
|
+
(0, _chai().expect)(mergedConfig[_envs().EnvsAspect.id]).to.deep.equal({
|
|
126
|
+
env: 'other-scope.envs/ext-env@1.0.0'
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
describe('other bumped only the VERSION of the same workspace env (no id change)', () => {
|
|
131
|
+
// current and other use the SAME workspace env id; only the version differs and the current lane did not
|
|
132
|
+
// change it (base === current). A workspace env's version is owned by the workspace, so the other lane's
|
|
133
|
+
// version must NOT be synced. (Uses 'theirs' to prove it's the keep-env short-circuit, not the strategy,
|
|
134
|
+
// that prevents the sync — a plain 3-way merge with base===current would otherwise adopt other's version.)
|
|
135
|
+
let mergedConfig;
|
|
136
|
+
before(() => {
|
|
137
|
+
const env = 'my-scope.envs/ws-env'; // workspace-component env, same id on both sides.
|
|
138
|
+
const base = new (_legacy().ExtensionDataList)(envsEntry(env), envAspectEntry(`${env}@0.0.1`));
|
|
139
|
+
const current = new (_legacy().ExtensionDataList)(envsEntry(env), envAspectEntry(`${env}@0.0.1`));
|
|
140
|
+
const other = new (_legacy().ExtensionDataList)(envsEntry(env), envAspectEntry(`${env}@0.0.2`));
|
|
141
|
+
const workspaceIds = [_componentId().ComponentID.fromString(`${env}@0.0.1`)];
|
|
142
|
+
mergedConfig = mergeEnvConfig(current, base, other, workspaceIds, 'theirs');
|
|
143
|
+
});
|
|
144
|
+
it("should keep the workspace env and NOT sync the other lane's version", () => {
|
|
145
|
+
(0, _chai().expect)(mergedConfig[_envs().EnvsAspect.id]).to.be.undefined;
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
//# sourceMappingURL=component-config-merger.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_chai","data","require","_componentId","_envs","_legacy","_componentConfigMerger","noopLogger","debug","trace","envsEntry","env","ExtensionDataEntry","undefined","EnvsAspect","id","envAspectEntry","idWithVersion","ComponentID","fromString","mergeEnvConfig","current","base","other","workspaceIds","mergeStrategy","merger","ComponentConfigMerger","merge","getSuccessfullyMergedConfig","describe","prevEnvsCoreName","before","ExtensionDataList","coreExtensionsNames","get","set","after","delete","mergedConfig","oldEnv","newEnv","it","expect","to","deep","equal","baseEnv","laneEnv","otherEnv","be"],"sources":["component-config-merger.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport { ComponentID } from '@teambit/component-id';\nimport { EnvsAspect } from '@teambit/envs';\nimport { ExtensionDataEntry, ExtensionDataList } from '@teambit/legacy.extension-data';\nimport type { Logger } from '@teambit/logger';\nimport type { MergeStrategy } from '@teambit/component.modules.merge-helper';\nimport { ComponentConfigMerger } from './component-config-merger';\n\nconst noopLogger = { debug() {}, trace() {} } as unknown as Logger;\n\n// A core-style teambit.envs/envs entry (matched by `name`, so it works without the runtime\n// core-extensions registry being populated — as is the case in an isolated component test).\nconst envsEntry = (env: string) => new ExtensionDataEntry(undefined, undefined, EnvsAspect.id, { env }, {});\n// The separate env-aspect entry that carries the resolved version (`id@version`). As stored in a committed\n// version, teambit.envs/envs.config.env holds the id WITHOUT a version; the version lives only here.\nconst envAspectEntry = (idWithVersion: string) =>\n new ExtensionDataEntry(undefined, ComponentID.fromString(idWithVersion), undefined, {}, {});\n\nfunction mergeEnvConfig(\n current: ExtensionDataList,\n base: ExtensionDataList,\n other: ExtensionDataList,\n workspaceIds: ComponentID[],\n mergeStrategy: MergeStrategy = 'ours'\n) {\n const merger = new ComponentConfigMerger(\n 'my-scope/some-comp',\n workspaceIds,\n undefined,\n current,\n base,\n other,\n 'lane',\n 'main',\n noopLogger,\n mergeStrategy\n );\n return merger.merge().getSuccessfullyMergedConfig();\n}\n\ndescribe('ComponentConfigMerger', () => {\n // teambit.envs/envs is a core extension at full runtime (registered by the core aspects). Register it here\n // so the merger behaves the same inside an isolated component test, and restore the prior state afterwards\n // so we don't leak into the shared static map (which would make other tests order-dependent).\n let prevEnvsCoreName: string | undefined;\n before(() => {\n prevEnvsCoreName = ExtensionDataList.coreExtensionsNames.get(EnvsAspect.id);\n ExtensionDataList.coreExtensionsNames.set(EnvsAspect.id, '');\n });\n after(() => {\n if (prevEnvsCoreName === undefined) ExtensionDataList.coreExtensionsNames.delete(EnvsAspect.id);\n else ExtensionDataList.coreExtensionsNames.set(EnvsAspect.id, prevEnvsCoreName);\n });\n\n describe('env migrated on \"other\" (main) while the current lane kept the old env', () => {\n // Reproduces the `bit ci pr` config-sync scenario: the PR lane never touched its env (base === current)\n // and main migrated the component onto a different EXTERNAL env. The change should propagate from main,\n // and critically must carry the version — syncing teambit.envs/envs.config.env alone (id without version)\n // would produce an unversioned external env and crash the snap with ExternalEnvWithoutVersion.\n let mergedConfig: Record<string, any>;\n before(() => {\n const oldEnv = 'my-scope.envs/ws-env'; // the env the lane keeps; it's also a workspace component.\n const newEnv = 'other-scope.envs/ext-env'; // the external env main migrated to.\n // base === current: the lane didn't change its env.\n const base = new ExtensionDataList(envsEntry(oldEnv), envAspectEntry(`${oldEnv}@0.0.1`));\n const current = new ExtensionDataList(envsEntry(oldEnv), envAspectEntry(`${oldEnv}@0.0.1`));\n const other = new ExtensionDataList(envsEntry(newEnv), envAspectEntry(`${newEnv}@1.0.0`));\n // `oldEnv` is a workspace component — this used to make envStrategy keep it instead of propagating.\n const workspaceIds = [ComponentID.fromString(`${oldEnv}@0.0.1`)];\n mergedConfig = mergeEnvConfig(current, base, other, workspaceIds);\n });\n it('should sync the env from main WITH its version (no unversioned env leak)', () => {\n expect(mergedConfig[EnvsAspect.id]).to.deep.equal({ env: 'other-scope.envs/ext-env@1.0.0' });\n });\n });\n\n describe('current lane deliberately switched to a workspace env', () => {\n // The lane changed its env (base !== current) to a workspace component. That's a deliberate choice for\n // this lane, so a differing env on \"other\" must NOT override it.\n let mergedConfig: Record<string, any>;\n before(() => {\n const baseEnv = 'other-scope.envs/orig-env';\n const laneEnv = 'my-scope.envs/ws-env'; // the lane switched to this workspace env.\n const otherEnv = 'other-scope.envs/ext-env';\n const base = new ExtensionDataList(envsEntry(baseEnv), envAspectEntry(`${baseEnv}@0.9.0`));\n const current = new ExtensionDataList(envsEntry(laneEnv), envAspectEntry(`${laneEnv}@0.0.1`));\n const other = new ExtensionDataList(envsEntry(otherEnv), envAspectEntry(`${otherEnv}@1.0.0`));\n const workspaceIds = [ComponentID.fromString(`${laneEnv}@0.0.1`)];\n mergedConfig = mergeEnvConfig(current, base, other, workspaceIds);\n });\n it('should keep the lane env and not sync teambit.envs/envs from \"other\"', () => {\n expect(mergedConfig[EnvsAspect.id]).to.be.undefined;\n });\n });\n\n describe('base env version is unknown (base env-aspect entry absent)', () => {\n // base and current share the env id, but base's version is unknown (its env-aspect entry is missing).\n // that must NOT be treated as \"the current lane changed its env\" — otherwise the keep-workspace-env\n // short-circuit would fire and silently swallow the env change made on \"other\". Instead the normal\n // 3-way merge applies; with 'theirs' it takes the other lane's env (with its version).\n let mergedConfig: Record<string, any>;\n before(() => {\n const env = 'my-scope.envs/ws-env'; // same env id on base & current; also a workspace component.\n const otherEnv = 'other-scope.envs/ext-env';\n // base carries the env id but NO env-aspect entry -> its version resolves to undefined (unknown).\n const base = new ExtensionDataList(envsEntry(env));\n const current = new ExtensionDataList(envsEntry(env), envAspectEntry(`${env}@0.0.1`));\n const other = new ExtensionDataList(envsEntry(otherEnv), envAspectEntry(`${otherEnv}@1.0.0`));\n const workspaceIds = [ComponentID.fromString(`${env}@0.0.1`)];\n mergedConfig = mergeEnvConfig(current, base, other, workspaceIds, 'theirs');\n });\n it('should not short-circuit on the workspace env; the merge strategy decides (takes other)', () => {\n expect(mergedConfig[EnvsAspect.id]).to.deep.equal({ env: 'other-scope.envs/ext-env@1.0.0' });\n });\n });\n\n describe('other bumped only the VERSION of the same workspace env (no id change)', () => {\n // current and other use the SAME workspace env id; only the version differs and the current lane did not\n // change it (base === current). A workspace env's version is owned by the workspace, so the other lane's\n // version must NOT be synced. (Uses 'theirs' to prove it's the keep-env short-circuit, not the strategy,\n // that prevents the sync — a plain 3-way merge with base===current would otherwise adopt other's version.)\n let mergedConfig: Record<string, any>;\n before(() => {\n const env = 'my-scope.envs/ws-env'; // workspace-component env, same id on both sides.\n const base = new ExtensionDataList(envsEntry(env), envAspectEntry(`${env}@0.0.1`));\n const current = new ExtensionDataList(envsEntry(env), envAspectEntry(`${env}@0.0.1`));\n const other = new ExtensionDataList(envsEntry(env), envAspectEntry(`${env}@0.0.2`));\n const workspaceIds = [ComponentID.fromString(`${env}@0.0.1`)];\n mergedConfig = mergeEnvConfig(current, base, other, workspaceIds, 'theirs');\n });\n it(\"should keep the workspace env and NOT sync the other lane's version\", () => {\n expect(mergedConfig[EnvsAspect.id]).to.be.undefined;\n });\n });\n});\n"],"mappings":";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GAAG,EAAE;MAAiC,CAAC,CAAC;IAC9F,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFmB,QAAQ,CAAC,wEAAwE,EAAE,MAAM;IACvF;IACA;IACA;IACA;IACA,IAAIS,YAAiC;IACrCP,MAAM,CAAC,MAAM;MACX,MAAMrB,GAAG,GAAG,sBAAsB,CAAC,CAAC;MACpC,MAAMW,IAAI,GAAG,KAAIW,2BAAiB,EAACvB,SAAS,CAACC,GAAG,CAAC,EAAEK,cAAc,CAAC,GAAGL,GAAG,QAAQ,CAAC,CAAC;MAClF,MAAMU,OAAO,GAAG,KAAIY,2BAAiB,EAACvB,SAAS,CAACC,GAAG,CAAC,EAAEK,cAAc,CAAC,GAAGL,GAAG,QAAQ,CAAC,CAAC;MACrF,MAAMY,KAAK,GAAG,KAAIU,2BAAiB,EAACvB,SAAS,CAACC,GAAG,CAAC,EAAEK,cAAc,CAAC,GAAGL,GAAG,QAAQ,CAAC,CAAC;MACnF,MAAMa,YAAY,GAAG,CAACN,0BAAW,CAACC,UAAU,CAAC,GAAGR,GAAG,QAAQ,CAAC,CAAC;MAC7D4B,YAAY,GAAGnB,cAAc,CAACC,OAAO,EAAEC,IAAI,EAAEC,KAAK,EAAEC,YAAY,EAAE,QAAQ,CAAC;IAC7E,CAAC,CAAC;IACFkB,EAAE,CAAC,qEAAqE,EAAE,MAAM;MAC9E,IAAAC,cAAM,EAACJ,YAAY,CAACzB,kBAAU,CAACC,EAAE,CAAC,CAAC,CAAC6B,EAAE,CAACM,EAAE,CAACrC,SAAS;IACrD,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/config-merger",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.912",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/workspace/config-merger",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.workspace",
|
|
8
8
|
"name": "config-merger",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.912"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -15,22 +15,22 @@
|
|
|
15
15
|
"tempy": "1.0.1",
|
|
16
16
|
"@teambit/component-id": "1.2.4",
|
|
17
17
|
"@teambit/component-version": "1.0.4",
|
|
18
|
-
"@teambit/harmony": "0.4.11",
|
|
19
|
-
"@teambit/bit-error": "0.0.404",
|
|
20
|
-
"@teambit/component-package-version": "0.0.451",
|
|
21
|
-
"@teambit/legacy.constants": "0.0.31",
|
|
22
|
-
"@teambit/pkg.modules.semver-helper": "0.0.24",
|
|
23
|
-
"@teambit/builder": "1.0.1043",
|
|
24
18
|
"@teambit/component.modules.merge-helper": "0.0.74",
|
|
25
|
-
"@teambit/dependency-resolver": "1.0.1043",
|
|
26
|
-
"@teambit/envs": "1.0.1043",
|
|
27
19
|
"@teambit/legacy.extension-data": "0.0.133",
|
|
28
20
|
"@teambit/logger": "0.0.1438",
|
|
29
|
-
"@teambit/
|
|
21
|
+
"@teambit/harmony": "0.4.11",
|
|
22
|
+
"@teambit/bit-error": "0.0.404",
|
|
30
23
|
"@teambit/cli": "0.0.1345",
|
|
24
|
+
"@teambit/component-package-version": "0.0.451",
|
|
31
25
|
"@teambit/config": "0.0.1520",
|
|
26
|
+
"@teambit/legacy.constants": "0.0.31",
|
|
32
27
|
"@teambit/legacy.consumer-component": "0.0.132",
|
|
33
|
-
"@teambit/
|
|
28
|
+
"@teambit/pkg.modules.semver-helper": "0.0.24",
|
|
29
|
+
"@teambit/builder": "1.0.1045",
|
|
30
|
+
"@teambit/dependency-resolver": "1.0.1045",
|
|
31
|
+
"@teambit/envs": "1.0.1045",
|
|
32
|
+
"@teambit/objects": "0.0.552",
|
|
33
|
+
"@teambit/workspace": "1.0.1045"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/lodash": "4.14.165",
|
|
@@ -38,7 +38,9 @@
|
|
|
38
38
|
"@types/fs-extra": "9.0.7",
|
|
39
39
|
"@teambit/harmony.envs.core-aspect-env": "0.1.7"
|
|
40
40
|
},
|
|
41
|
-
"peerDependencies": {
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"chai": "5.2.1"
|
|
43
|
+
},
|
|
42
44
|
"license": "Apache-2.0",
|
|
43
45
|
"optionalDependencies": {},
|
|
44
46
|
"peerDependenciesMeta": {},
|
|
File without changes
|