@teambit/workspace 1.0.339 → 1.0.340

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.
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.339/dist/workspace.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.339/dist/workspace.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.340/dist/workspace.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.340/dist/workspace.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/dist/types.d.ts CHANGED
@@ -18,11 +18,6 @@ export interface WorkspaceExtConfig {
18
18
  * set the default directory when there is no matching for the component in the components array.
19
19
  */
20
20
  defaultDirectory: string;
21
- /**
22
- * sets the location of the root components directory.
23
- * The location is a relative path to the workspace root and should use linux path separators (/).
24
- */
25
- rootComponentsDirectory?: string;
26
21
  /**
27
22
  * set the default structure of components in your project
28
23
  */
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["interface VendorConfig {\n directory: string;\n}\n\nexport interface WorkspaceExtConfig {\n /**\n * name of the workspace.\n */\n name: string;\n\n /**\n * path to icon.\n */\n icon: string;\n\n /**\n * set the default scope when there is no matching for the component in the components array.\n */\n defaultScope: string;\n\n /**\n * set the default directory when there is no matching for the component in the components array.\n */\n defaultDirectory: string;\n\n /**\n * sets the location of the root components directory.\n * The location is a relative path to the workspace root and should use linux path separators (/).\n */\n rootComponentsDirectory?: string;\n\n /**\n * set the default structure of components in your project\n */\n vendor: VendorConfig;\n\n /**\n * All component extensions applied by default on all components in the workspace (except vendor components)\n */\n extensions: { [extensionsId: string]: string };\n\n /**\n * If set to\n * `true`, it allows the workspace to resolve scope's aspects from node modules\n * installed in the workspace's `node_modules` directory. If not set or set to `false`, aspects will only be resolved\n * from the scope aspects capsule.\n */\n resolveAspectsFromNodeModules?: boolean;\n\n /**\n * If set to `true`, it allows the workspace to resolve envs from node modules\n * installed in the workspace's `node_modules` directory.\n * the envs will be resolved from the node_modules of the env's root (workspace/node_modules/.bit_roots/{envId})\n * and if not found (usually when the env was hoisted to the root node_modules) then from the node_modules of the\n * workspace.\n * If not set or set to `false`, envs will only be resolved from the scope envs capsule.\n */\n resolveEnvsFromRoots?: boolean;\n\n /**\n * If set to `true`, bit will try to load aspects dependencies automatically.\n * even if the aspects dependencies are not configured in the workspace.jsonc root config.\n * for example having the aspect\n * main aspect\n * export class MainAspectMain {\n * ...\n * static dependencies = [MyDepAspect];\n * }\n * and the in the workspace.jsonc file:\n * {\n * ...\n * main-aspect: {}\n * }\n * when set to true, bit will try to load MyDepAspect automatically.\n */\n autoLoadAspectsDeps?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["interface VendorConfig {\n directory: string;\n}\n\nexport interface WorkspaceExtConfig {\n /**\n * name of the workspace.\n */\n name: string;\n\n /**\n * path to icon.\n */\n icon: string;\n\n /**\n * set the default scope when there is no matching for the component in the components array.\n */\n defaultScope: string;\n\n /**\n * set the default directory when there is no matching for the component in the components array.\n */\n defaultDirectory: string;\n\n /**\n * set the default structure of components in your project\n */\n vendor: VendorConfig;\n\n /**\n * All component extensions applied by default on all components in the workspace (except vendor components)\n */\n extensions: { [extensionsId: string]: string };\n\n /**\n * If set to\n * `true`, it allows the workspace to resolve scope's aspects from node modules\n * installed in the workspace's `node_modules` directory. If not set or set to `false`, aspects will only be resolved\n * from the scope aspects capsule.\n */\n resolveAspectsFromNodeModules?: boolean;\n\n /**\n * If set to `true`, it allows the workspace to resolve envs from node modules\n * installed in the workspace's `node_modules` directory.\n * the envs will be resolved from the node_modules of the env's root (workspace/node_modules/.bit_roots/{envId})\n * and if not found (usually when the env was hoisted to the root node_modules) then from the node_modules of the\n * workspace.\n * If not set or set to `false`, envs will only be resolved from the scope envs capsule.\n */\n resolveEnvsFromRoots?: boolean;\n\n /**\n * If set to `true`, bit will try to load aspects dependencies automatically.\n * even if the aspects dependencies are not configured in the workspace.jsonc root config.\n * for example having the aspect\n * main aspect\n * export class MainAspectMain {\n * ...\n * static dependencies = [MyDepAspect];\n * }\n * and the in the workspace.jsonc file:\n * {\n * ...\n * main-aspect: {}\n * }\n * when set to true, bit will try to load MyDepAspect automatically.\n */\n autoLoadAspectsDeps?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
@@ -178,10 +178,6 @@ export declare class Workspace implements ComponentFactory {
178
178
  * root path of the Workspace.
179
179
  */
180
180
  get path(): string;
181
- /**
182
- * Get the location of the bit roots folder
183
- */
184
- get rootComponentsPath(): string;
185
181
  /** get the `node_modules` folder of this workspace */
186
182
  private get modulesPath();
187
183
  get isLegacy(): boolean;
@@ -505,7 +501,6 @@ export declare class Workspace implements ComponentFactory {
505
501
  */
506
502
  _reloadConsumer(): Promise<void>;
507
503
  getComponentPackagePath(component: Component): Promise<string>;
508
- _getComponentRelativePath(component: Component): Promise<string>;
509
504
  get defaultDirectory(): string;
510
505
  get legacyDefaultDirectory(): string;
511
506
  resolveComponentIdFromPackageName(packageName: string): Promise<ComponentID>;
package/dist/workspace.js CHANGED
@@ -429,9 +429,6 @@ class Workspace {
429
429
  if ((0, _lodash().isEmpty)(this.config)) throw new (_bitError().BitError)(`fatal: workspace config is empty. probably one of bit files is missing. please run "bit init" to rewrite them`);
430
430
  const defaultScope = this.config.defaultScope;
431
431
  if (!defaultScope) throw new (_bitError().BitError)('defaultScope is missing');
432
- if (this.config.rootComponentsDirectory === '') {
433
- throw new (_bitError().BitError)('rootComponentsDirectory cannot be empty. Root components directory location cannot be the same as the workspace directory path');
434
- }
435
432
  if (!(0, _legacyBitId().isValidScopeName)(defaultScope)) throw new (_legacyBitId().InvalidScopeName)(defaultScope);
436
433
  }
437
434
 
@@ -442,13 +439,6 @@ class Workspace {
442
439
  return this.consumer.getPath();
443
440
  }
444
441
 
445
- /**
446
- * Get the location of the bit roots folder
447
- */
448
- get rootComponentsPath() {
449
- return this.config.rootComponentsDirectory ?? _path().default.join(this.modulesPath, '.bit_roots');
450
- }
451
-
452
442
  /** get the `node_modules` folder of this workspace */
453
443
  get modulesPath() {
454
444
  return _path().default.join(this.path, 'node_modules');
@@ -1687,16 +1677,9 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1687
1677
  await this.clearCache();
1688
1678
  }
1689
1679
  async getComponentPackagePath(component) {
1690
- return _path().default.join(this.path, await this._getComponentRelativePath(component));
1691
- }
1692
- async _getComponentRelativePath(component) {
1693
- if (this.hasId(component.id)) {
1694
- return this.dependencyResolver.getRuntimeModulePathInWorkspace(component, {
1695
- workspacePath: this.path,
1696
- rootComponentsPath: this.rootComponentsPath
1697
- });
1698
- }
1699
- return this.dependencyResolver.getRuntimeModulePathInCapsules(component);
1680
+ const inInWs = await this.hasId(component.id);
1681
+ const relativePath = this.dependencyResolver.getRuntimeModulePath(component, inInWs);
1682
+ return _path().default.join(this.path, relativePath);
1700
1683
  }
1701
1684
 
1702
1685
  // TODO: should we return here the dir as it defined (aka components) or with /{name} prefix (as it used in legacy)