@teambit/workspace-root 0.0.69 → 0.0.70

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
1
  ;
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace-root@0.0.69/dist/workspace-root.docs.mdx';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace-root@0.0.70/dist/workspace-root.docs.mdx';
3
3
 
4
4
  export const compositions = [];
5
5
  export const overview = [overview_0];
@@ -1,6 +1,7 @@
1
1
  import type { CLIMain } from '@teambit/cli';
2
2
  import type { Component, ComponentMain } from '@teambit/component';
3
3
  import { ComponentID } from '@teambit/component-id';
4
+ import type { ComponentWriterMain } from '@teambit/component-writer';
4
5
  import type { Workspace } from '@teambit/workspace';
5
6
  import type { CloneOptions, CloneResult, LoadBit } from './clone';
6
7
  /**
@@ -47,5 +48,10 @@ export declare class WorkspaceRootMain {
47
48
  private extensionsOf;
48
49
  static runtime: import("@teambit/harmony").RuntimeDefinition;
49
50
  static dependencies: import("@teambit/harmony").Aspect[];
50
- static provider([workspace, component, cli]: [Workspace | undefined, ComponentMain, CLIMain]): Promise<WorkspaceRootMain>;
51
+ static provider([workspace, component, cli, componentWriter]: [
52
+ Workspace | undefined,
53
+ ComponentMain,
54
+ CLIMain,
55
+ ComponentWriterMain
56
+ ]): Promise<WorkspaceRootMain>;
51
57
  }
@@ -39,6 +39,13 @@ function _componentId() {
39
39
  };
40
40
  return data;
41
41
  }
42
+ function _componentWriter() {
43
+ const data = require("@teambit/component-writer");
44
+ _componentWriter = function () {
45
+ return data;
46
+ };
47
+ return data;
48
+ }
42
49
  function _legacy() {
43
50
  const data = require("@teambit/legacy.bit-map");
44
51
  _legacy = function () {
@@ -156,11 +163,12 @@ class WorkspaceRootMain {
156
163
  extensionsOf(component) {
157
164
  return component.state._consumer.extensions;
158
165
  }
159
- static async provider([workspace, component, cli]) {
166
+ static async provider([workspace, component, cli, componentWriter]) {
160
167
  const workspaceRoot = new WorkspaceRootMain(workspace);
161
168
  component.registerShowFragments([new (_workspaceRoot2().WorkspaceRootFragment)(workspaceRoot)]);
162
169
  cli.register(new (_clone2().CloneCmd)(workspaceRoot));
163
170
  workspace?.registerOnComponentLoad(markWorkspaceRoot);
171
+ componentWriter.registerWorkspaceRootDetector(_workspaceRootData().isWorkspaceRootComponent);
164
172
  return workspaceRoot;
165
173
  }
166
174
  }
@@ -171,7 +179,7 @@ class WorkspaceRootMain {
171
179
  */
172
180
  exports.WorkspaceRootMain = WorkspaceRootMain;
173
181
  _defineProperty(WorkspaceRootMain, "runtime", _harmonyModules().MainRuntime);
174
- _defineProperty(WorkspaceRootMain, "dependencies", [_workspace().WorkspaceAspect, _component().ComponentAspect, _cli().CLIAspect]);
182
+ _defineProperty(WorkspaceRootMain, "dependencies", [_workspace().WorkspaceAspect, _component().ComponentAspect, _cli().CLIAspect, _componentWriter().ComponentWriterAspect]);
175
183
  async function markWorkspaceRoot(component) {
176
184
  const consumerComponent = component.state._consumer;
177
185
  return consumerComponent.componentMap?.rootDir === _legacy().WORKSPACE_ROOT_DIR ? {
@@ -1 +1 @@
1
- {"version":3,"names":["_bitError","data","require","_harmonyModules","_cli","_component","_componentId","_legacy","_workspace","_clone","_clone2","_workspaceRoot","_workspaceRoot2","_workspaceRootData","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","WorkspaceRootMain","constructor","workspace","setLoadBit","loadBit","clone","idStr","dir","options","BitError","path","Error","cloneWorkspace","ComponentID","fromString","getRootComponentId","undefined","findWorkspaceRootMap","consumer","bitMap","id","isWorkspaceRootComponent","component","extensionsOf","getRootOf","readWorkspaceRoot","state","_consumer","extensions","provider","cli","workspaceRoot","registerShowFragments","WorkspaceRootFragment","register","CloneCmd","registerOnComponentLoad","markWorkspaceRoot","exports","MainRuntime","WorkspaceAspect","ComponentAspect","CLIAspect","consumerComponent","componentMap","rootDir","WORKSPACE_ROOT_DIR","isRoot","WorkspaceRootAspect","addRuntime"],"sources":["workspace-root.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport type { CLIMain } from '@teambit/cli';\nimport { MainRuntime } from '@teambit/harmony.modules.runtimes';\nimport { CLIAspect } from '@teambit/cli';\nimport type { Component, ComponentMain } from '@teambit/component';\nimport { ComponentAspect } from '@teambit/component';\nimport { ComponentID } from '@teambit/component-id';\nimport { WORKSPACE_ROOT_DIR } from '@teambit/legacy.bit-map';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport type { CloneOptions, CloneResult, LoadBit } from './clone';\nimport { cloneWorkspace } from './clone';\nimport { CloneCmd } from './clone.cmd';\nimport { WorkspaceRootAspect } from './workspace-root.aspect';\nimport { WorkspaceRootFragment } from './workspace-root.fragment';\nimport type { WorkspaceRootData } from './workspace-root-data';\nimport { findWorkspaceRootMap, isWorkspaceRootComponent, readWorkspaceRoot } from './workspace-root-data';\n\n/**\n * the workspace-root component is the one tracked at the workspace root (rootDir \".\"). it versions\n * the workspace's own files - workspace.jsonc, .bitmap, the lockfile, repo scripts and configs - and\n * a git-free workspace is restored from it. this aspect is the home of that concept: the marker that\n * tells a root apart wherever it is, and the record every member carries of the root it was snapped\n * in.\n *\n * \"workspace-root component\" rather than \"root component\", which is the dependency-resolver's\n * rootComponents, or \"workspace component\", which is every component loaded from a workspace.\n */\nexport class WorkspaceRootMain {\n private loadBit?: LoadBit;\n\n constructor(private workspace?: Workspace) {}\n\n /**\n * a clone loads bit for the new workspace, in a process that started outside of one. the function\n * belongs to the bit aspect, which depends on this one, so it is handed over rather than imported\n * (see load-bit.ts).\n */\n setLoadBit(loadBit: LoadBit) {\n this.loadBit = loadBit;\n }\n\n /**\n * make a workspace out of a workspace-root component: its files at the root, every component it\n * lists in the directory it records, then install. see cloneWorkspace.\n */\n async clone(idStr: string, dir: string | undefined, options: CloneOptions = {}): Promise<CloneResult> {\n if (this.workspace) {\n throw new BitError(\n `unable to clone inside the workspace at \"${this.workspace.path}\", a clone is a new workspace. run it from a directory outside of any workspace`\n );\n }\n if (!this.loadBit) throw new Error('WorkspaceRootMain.clone: loadBit was not set, see load-bit.ts');\n return cloneWorkspace(ComponentID.fromString(idStr), dir, options, this.loadBit);\n }\n\n /**\n * the id of the component that owns the workspace root, if the workspace has one.\n */\n getRootComponentId(): ComponentID | undefined {\n if (!this.workspace) return undefined;\n return findWorkspaceRootMap(this.workspace.consumer.bitMap)?.id;\n }\n\n /**\n * whether the component is a workspace-root component. read from its aspect data, so it works\n * for a component loaded from a scope as well as from a workspace.\n */\n isWorkspaceRootComponent(component: Component): boolean {\n return isWorkspaceRootComponent(this.extensionsOf(component));\n }\n\n /**\n * the workspace-root component a component was snapped in, at the version the root had then. the\n * snap records it as aspect data, so it is available wherever the component is, a bare scope\n * included. it is the way to know which root files (lockfile, tsconfig, scripts) a version was\n * made with. a component snapped in a workspace without a root component has none.\n */\n getRootOf(component: Component): ComponentID | undefined {\n return readWorkspaceRoot(this.extensionsOf(component));\n }\n\n private extensionsOf(component: Component) {\n return (component.state._consumer as ConsumerComponent).extensions;\n }\n\n static runtime = MainRuntime;\n\n static dependencies = [WorkspaceAspect, ComponentAspect, CLIAspect];\n\n static async provider([workspace, component, cli]: [Workspace | undefined, ComponentMain, CLIMain]) {\n const workspaceRoot = new WorkspaceRootMain(workspace);\n component.registerShowFragments([new WorkspaceRootFragment(workspaceRoot)]);\n cli.register(new CloneCmd(workspaceRoot));\n workspace?.registerOnComponentLoad(markWorkspaceRoot);\n return workspaceRoot;\n }\n}\n\n/**\n * the root marks itself as such in its aspect data when loaded. the snap saves the data with the\n * version, and every consumer of the model reads the marker rather than guessing from the files.\n */\nasync function markWorkspaceRoot(component: Component): Promise<WorkspaceRootData | undefined> {\n const consumerComponent = component.state._consumer as ConsumerComponent;\n return consumerComponent.componentMap?.rootDir === WORKSPACE_ROOT_DIR ? { isRoot: true } : undefined;\n}\n\nWorkspaceRootAspect.addRuntime(WorkspaceRootMain);\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,KAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,IAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,aAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAO,WAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,UAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAQ,OAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,MAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,QAAA;EAAA,MAAAT,IAAA,G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C,SAAS,CAAuBC,UAAU;EACpE;EAMA,aAAaC,QAAQA,CAAC,CAAC3B,SAAS,EAAEoB,SAAS,EAAEQ,GAAG,CAAkD,EAAE;IAClG,MAAMC,aAAa,GAAG,IAAI/B,iBAAiB,CAACE,SAAS,CAAC;IACtDoB,SAAS,CAACU,qBAAqB,CAAC,CAAC,KAAIC,uCAAqB,EAACF,aAAa,CAAC,CAAC,CAAC;IAC3ED,GAAG,CAACI,QAAQ,CAAC,KAAIC,kBAAQ,EAACJ,aAAa,CAAC,CAAC;IACzC7B,SAAS,EAAEkC,uBAAuB,CAACC,iBAAiB,CAAC;IACrD,OAAON,aAAa;EACtB;AACF;;AAEA;AACA;AACA;AACA;AAHAO,OAAA,CAAAtC,iBAAA,GAAAA,iBAAA;AAAAnB,eAAA,CAvEamB,iBAAiB,aA0DXuC,6BAAW;AAAA1D,eAAA,CA1DjBmB,iBAAiB,kBA4DN,CAACwC,4BAAe,EAAEC,4BAAe,EAAEC,gBAAS,CAAC;AAerE,eAAeL,iBAAiBA,CAACf,SAAoB,EAA0C;EAC7F,MAAMqB,iBAAiB,GAAGrB,SAAS,CAACI,KAAK,CAACC,SAA8B;EACxE,OAAOgB,iBAAiB,CAACC,YAAY,EAAEC,OAAO,KAAKC,4BAAkB,GAAG;IAAEC,MAAM,EAAE;EAAK,CAAC,GAAG/B,SAAS;AACtG;AAEAgC,oCAAmB,CAACC,UAAU,CAACjD,iBAAiB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_bitError","data","require","_harmonyModules","_cli","_component","_componentId","_componentWriter","_legacy","_workspace","_clone","_clone2","_workspaceRoot","_workspaceRoot2","_workspaceRootData","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","WorkspaceRootMain","constructor","workspace","setLoadBit","loadBit","clone","idStr","dir","options","BitError","path","Error","cloneWorkspace","ComponentID","fromString","getRootComponentId","undefined","findWorkspaceRootMap","consumer","bitMap","id","isWorkspaceRootComponent","component","extensionsOf","getRootOf","readWorkspaceRoot","state","_consumer","extensions","provider","cli","componentWriter","workspaceRoot","registerShowFragments","WorkspaceRootFragment","register","CloneCmd","registerOnComponentLoad","markWorkspaceRoot","registerWorkspaceRootDetector","exports","MainRuntime","WorkspaceAspect","ComponentAspect","CLIAspect","ComponentWriterAspect","consumerComponent","componentMap","rootDir","WORKSPACE_ROOT_DIR","isRoot","WorkspaceRootAspect","addRuntime"],"sources":["workspace-root.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport type { CLIMain } from '@teambit/cli';\nimport { MainRuntime } from '@teambit/harmony.modules.runtimes';\nimport { CLIAspect } from '@teambit/cli';\nimport type { Component, ComponentMain } from '@teambit/component';\nimport { ComponentAspect } from '@teambit/component';\nimport { ComponentID } from '@teambit/component-id';\nimport type { ComponentWriterMain } from '@teambit/component-writer';\nimport { ComponentWriterAspect } from '@teambit/component-writer';\nimport { WORKSPACE_ROOT_DIR } from '@teambit/legacy.bit-map';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect } from '@teambit/workspace';\nimport type { CloneOptions, CloneResult, LoadBit } from './clone';\nimport { cloneWorkspace } from './clone';\nimport { CloneCmd } from './clone.cmd';\nimport { WorkspaceRootAspect } from './workspace-root.aspect';\nimport { WorkspaceRootFragment } from './workspace-root.fragment';\nimport type { WorkspaceRootData } from './workspace-root-data';\nimport { findWorkspaceRootMap, isWorkspaceRootComponent, readWorkspaceRoot } from './workspace-root-data';\n\n/**\n * the workspace-root component is the one tracked at the workspace root (rootDir \".\"). it versions\n * the workspace's own files - workspace.jsonc, .bitmap, the lockfile, repo scripts and configs - and\n * a git-free workspace is restored from it. this aspect is the home of that concept: the marker that\n * tells a root apart wherever it is, and the record every member carries of the root it was snapped\n * in.\n *\n * \"workspace-root component\" rather than \"root component\", which is the dependency-resolver's\n * rootComponents, or \"workspace component\", which is every component loaded from a workspace.\n */\nexport class WorkspaceRootMain {\n private loadBit?: LoadBit;\n\n constructor(private workspace?: Workspace) {}\n\n /**\n * a clone loads bit for the new workspace, in a process that started outside of one. the function\n * belongs to the bit aspect, which depends on this one, so it is handed over rather than imported\n * (see load-bit.ts).\n */\n setLoadBit(loadBit: LoadBit) {\n this.loadBit = loadBit;\n }\n\n /**\n * make a workspace out of a workspace-root component: its files at the root, every component it\n * lists in the directory it records, then install. see cloneWorkspace.\n */\n async clone(idStr: string, dir: string | undefined, options: CloneOptions = {}): Promise<CloneResult> {\n if (this.workspace) {\n throw new BitError(\n `unable to clone inside the workspace at \"${this.workspace.path}\", a clone is a new workspace. run it from a directory outside of any workspace`\n );\n }\n if (!this.loadBit) throw new Error('WorkspaceRootMain.clone: loadBit was not set, see load-bit.ts');\n return cloneWorkspace(ComponentID.fromString(idStr), dir, options, this.loadBit);\n }\n\n /**\n * the id of the component that owns the workspace root, if the workspace has one.\n */\n getRootComponentId(): ComponentID | undefined {\n if (!this.workspace) return undefined;\n return findWorkspaceRootMap(this.workspace.consumer.bitMap)?.id;\n }\n\n /**\n * whether the component is a workspace-root component. read from its aspect data, so it works\n * for a component loaded from a scope as well as from a workspace.\n */\n isWorkspaceRootComponent(component: Component): boolean {\n return isWorkspaceRootComponent(this.extensionsOf(component));\n }\n\n /**\n * the workspace-root component a component was snapped in, at the version the root had then. the\n * snap records it as aspect data, so it is available wherever the component is, a bare scope\n * included. it is the way to know which root files (lockfile, tsconfig, scripts) a version was\n * made with. a component snapped in a workspace without a root component has none.\n */\n getRootOf(component: Component): ComponentID | undefined {\n return readWorkspaceRoot(this.extensionsOf(component));\n }\n\n private extensionsOf(component: Component) {\n return (component.state._consumer as ConsumerComponent).extensions;\n }\n\n static runtime = MainRuntime;\n\n static dependencies = [WorkspaceAspect, ComponentAspect, CLIAspect, ComponentWriterAspect];\n\n static async provider([workspace, component, cli, componentWriter]: [\n Workspace | undefined,\n ComponentMain,\n CLIMain,\n ComponentWriterMain,\n ]) {\n const workspaceRoot = new WorkspaceRootMain(workspace);\n component.registerShowFragments([new WorkspaceRootFragment(workspaceRoot)]);\n cli.register(new CloneCmd(workspaceRoot));\n workspace?.registerOnComponentLoad(markWorkspaceRoot);\n componentWriter.registerWorkspaceRootDetector(isWorkspaceRootComponent);\n return workspaceRoot;\n }\n}\n\n/**\n * the root marks itself as such in its aspect data when loaded. the snap saves the data with the\n * version, and every consumer of the model reads the marker rather than guessing from the files.\n */\nasync function markWorkspaceRoot(component: Component): Promise<WorkspaceRootData | undefined> {\n const consumerComponent = component.state._consumer as ConsumerComponent;\n return consumerComponent.componentMap?.rootDir === WORKSPACE_ROOT_DIR ? { isRoot: true } : undefined;\n}\n\nWorkspaceRootAspect.addRuntime(WorkspaceRootMain);\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,KAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,IAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,aAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,iBAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,gBAAA,YAAAA,CAAA;IA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wB,iBAAiB,GAAGxB,SAAS,CAACI,KAAK,CAACC,SAA8B;EACxE,OAAOmB,iBAAiB,CAACC,YAAY,EAAEC,OAAO,KAAKC,4BAAkB,GAAG;IAAEC,MAAM,EAAE;EAAK,CAAC,GAAGlC,SAAS;AACtG;AAEAmC,oCAAmB,CAACC,UAAU,CAACpD,iBAAiB,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,34 +1,35 @@
1
1
  {
2
2
  "name": "@teambit/workspace-root",
3
- "version": "0.0.69",
3
+ "version": "0.0.70",
4
4
  "homepage": "https://bit.cloud/teambit/workspace/workspace-root",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.workspace",
8
8
  "name": "workspace-root",
9
- "version": "0.0.69"
9
+ "version": "0.0.70"
10
10
  },
11
11
  "dependencies": {
12
12
  "fs-extra": "10.0.0",
13
+ "@teambit/cli": "0.0.1420",
13
14
  "@teambit/bit-error": "0.0.404",
14
15
  "@teambit/component-id": "1.2.5",
15
16
  "@teambit/harmony": "0.4.12",
17
+ "@teambit/host-initializer": "0.0.929",
16
18
  "@teambit/lane-id": "0.0.312",
19
+ "@teambit/legacy.bit-map": "0.0.246",
17
20
  "@teambit/legacy.constants": "0.0.50",
18
21
  "@teambit/legacy.utils": "0.0.56",
19
- "@teambit/workspace.modules.workspace-locator": "0.0.51",
20
- "@teambit/harmony.modules.runtimes": "0.0.4",
21
- "@teambit/cli": "0.0.1420",
22
- "@teambit/host-initializer": "0.0.929",
23
- "@teambit/importer": "1.0.1243",
24
- "@teambit/install": "1.0.1243",
25
- "@teambit/legacy.bit-map": "0.0.246",
26
22
  "@teambit/scope.remotes": "0.0.189",
27
- "@teambit/scope": "1.0.1243",
28
- "@teambit/workspace": "1.0.1243",
23
+ "@teambit/workspace.modules.workspace-locator": "0.0.51",
29
24
  "@teambit/legacy.extension-data": "0.0.191",
30
25
  "@teambit/component": "1.0.1230",
31
- "@teambit/legacy.consumer-component": "0.0.190"
26
+ "@teambit/harmony.modules.runtimes": "0.0.4",
27
+ "@teambit/legacy.consumer-component": "0.0.190",
28
+ "@teambit/importer": "1.0.1244",
29
+ "@teambit/install": "1.0.1244",
30
+ "@teambit/scope": "1.0.1244",
31
+ "@teambit/workspace": "1.0.1244",
32
+ "@teambit/component-writer": "1.0.1244"
32
33
  },
33
34
  "devDependencies": {
34
35
  "@types/fs-extra": "9.0.7",