@@ -1285,6 +1285,9 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1285
1285
return path . join ( this . path , relativeComponentDir ) ;
1286
1286
}
1287
1287
1288
+ /**
1289
+ * @deprecated long long ago we added it to the componentId object. use `componentId.scope` instead.
1290
+ */
1288
1291
async componentDefaultScope ( componentId : ComponentID ) : Promise < string | undefined > {
1289
1292
const relativeComponentDir = this . componentDir ( componentId , { ignoreVersion : true } , { relative : true } ) ;
1290
1293
return this . componentDefaultScopeFromComponentDirAndName ( relativeComponentDir , componentId . fullName ) ;
@@ -1294,10 +1297,6 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1294
1297
relativeComponentDir : PathOsBasedRelative ,
1295
1298
name : string
1296
1299
) : Promise < string | undefined > {
1297
- const componentConfigFile = await this . componentConfigFileFromComponentDirAndName ( relativeComponentDir , name ) ;
1298
- if ( componentConfigFile && componentConfigFile . defaultScope ) {
1299
- return componentConfigFile . defaultScope ;
1300
- }
1301
1300
const bitMapId = this . consumer . bitMap . getExistingBitId ( name , false ) ;
1302
1301
const bitMapEntry = bitMapId ? this . consumer . bitMap . getComponent ( bitMapId ) : undefined ;
1303
1302
if ( bitMapEntry && bitMapEntry . defaultScope ) {
@@ -1590,7 +1589,7 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1590
1589
*/
1591
1590
public async componentConfigFile ( id : ComponentID ) : Promise < ComponentConfigFile | undefined > {
1592
1591
const relativeComponentDir = this . componentDir ( id , { ignoreVersion : true } , { relative : true } ) ;
1593
- return this . componentConfigFileFromComponentDirAndName ( relativeComponentDir , id . fullName ) ;
1592
+ return this . componentConfigFileFromComponentDirAndName ( relativeComponentDir ) ;
1594
1593
}
1595
1594
1596
1595
/**
@@ -1608,17 +1607,13 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1608
1607
1609
1608
private async componentConfigFileFromComponentDirAndName (
1610
1609
relativeComponentDir : PathOsBasedRelative ,
1611
- name : string
1612
1610
) : Promise < ComponentConfigFile | undefined > {
1613
1611
let componentConfigFile ;
1614
1612
if ( relativeComponentDir ) {
1615
1613
const absComponentDir = this . componentDirToAbsolute ( relativeComponentDir ) ;
1616
- const defaultScopeFromVariantsOrWs =
1617
- await this . componentDefaultScopeFromComponentDirAndNameWithoutConfigFile ( relativeComponentDir , name ) ;
1618
1614
componentConfigFile = await ComponentConfigFile . load (
1619
1615
absComponentDir ,
1620
1616
this . createAspectList . bind ( this ) ,
1621
- defaultScopeFromVariantsOrWs
1622
1617
) ;
1623
1618
}
1624
1619
0 commit comments