@teambit/isolator 1.0.480 → 1.0.482

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.
@@ -10,6 +10,7 @@ export default class CapsuleList extends Array<Capsule> {
10
10
  getAllCapsuleDirs(): string[];
11
11
  getIdByPathInCapsule(pathInCapsule: string): ComponentID | null;
12
12
  getAllComponents(): Component[];
13
+ getAllComponentIDs(): ComponentID[];
13
14
  getGraphIds(): Graph<Component, string>;
14
15
  toposort(depResolver: DependencyResolverMain): Promise<CapsuleList>;
15
16
  static fromArray(capsules: Capsule[]): CapsuleList;
@@ -41,6 +41,9 @@ class CapsuleList extends Array {
41
41
  getAllComponents() {
42
42
  return this.map(c => c.component);
43
43
  }
44
+ getAllComponentIDs() {
45
+ return this.map(c => c.component.id);
46
+ }
44
47
  getGraphIds() {
45
48
  const components = this.getAllComponents();
46
49
  const graph = new (_graph().Graph)();
@@ -1 +1 @@
1
- {"version":3,"names":["_graph","data","require","_path","CapsuleList","Array","getCapsule","id","find","capsule","component","isEqual","getCapsuleByLegacyId","getCapsuleIgnoreVersion","ignoreVersion","getAllCapsuleDirs","map","path","getIdByPathInCapsule","pathInCapsule","normalizedPathInCapsule","normalize","found","getAllComponents","c","getGraphIds","components","graph","Graph","forEach","comp","setNode","Node","toString","compIdsStr","deps","getDependencies","dep","includes","setEdge","Edge","type","toposort","depResolver","getPackageName","node","nodes","attr","depPkgName","hasNode","lifecycle","sortedSeeders","sortedCapsules","fromArray","capsules","capsuleUsePreviouslySavedDists","isModified","buildStatus","exports","default"],"sources":["capsule-list.ts"],"sourcesContent":["import type { Component } from '@teambit/component';\nimport { Dependency, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { Edge, Graph, Node } from '@teambit/graph.cleargraph';\nimport { ComponentID } from '@teambit/component-id';\nimport { normalize } from 'path';\nimport { Capsule } from './capsule';\n\nexport default class CapsuleList extends Array<Capsule> {\n getCapsule(id: ComponentID): Capsule | undefined {\n return this.find((capsule) => capsule.component.id.isEqual(id));\n }\n getCapsuleByLegacyId(id: ComponentID): Capsule | undefined {\n return this.find((capsule) => capsule.component.id.isEqual(id));\n }\n getCapsuleIgnoreVersion(id: ComponentID): Capsule | undefined {\n return this.find((capsule) => capsule.component.id.isEqual(id, { ignoreVersion: true }));\n }\n getAllCapsuleDirs(): string[] {\n return this.map((capsule) => capsule.path);\n }\n getIdByPathInCapsule(pathInCapsule: string): ComponentID | null {\n const normalizedPathInCapsule = normalize(pathInCapsule);\n const found = this.find((capsule) => normalizedPathInCapsule === normalize(capsule.path));\n return found ? found.component.id : null;\n }\n getAllComponents(): Component[] {\n return this.map((c) => c.component);\n }\n getGraphIds(): Graph<Component, string> {\n const components = this.getAllComponents();\n const graph = new Graph<Component, string>();\n\n components.forEach((comp: Component) => graph.setNode(new Node(comp.id.toString(), comp)));\n const compIdsStr = components.map((c) => c.id.toString());\n\n components.forEach((comp) => {\n const deps = comp.getDependencies();\n deps.forEach((dep) => {\n if (compIdsStr.includes(dep.id)) {\n graph.setEdge(new Edge(comp.id.toString(), dep.id, dep.type));\n }\n });\n });\n\n return graph;\n }\n // Sort the capsules by their dependencies. The capsules with no dependencies will be first. Returns a new array.\n async toposort(depResolver: DependencyResolverMain): Promise<CapsuleList> {\n const components = this.getAllComponents();\n const graph = new Graph<Component, string>();\n\n // Build a graph with all the components from the current capsule list\n components.forEach((comp: Component) => graph.setNode(new Node(depResolver.getPackageName(comp), comp)));\n\n // Add edges between the components according to their interdependencies\n for (const node of graph.nodes) {\n // eslint-disable-next-line no-await-in-loop\n const deps = await depResolver.getDependencies(node.attr);\n deps.forEach((dep: Dependency) => {\n const depPkgName = dep.getPackageName?.();\n if (depPkgName && graph.hasNode(depPkgName)) {\n graph.setEdge(new Edge(node.id, depPkgName, dep.lifecycle));\n }\n });\n }\n\n const sortedSeeders = graph.toposort(true);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const sortedCapsules: Capsule[] = sortedSeeders.map((node: Node<Component>) => this.getCapsule(node.attr.id)!);\n return CapsuleList.fromArray(sortedCapsules);\n }\n static fromArray(capsules: Capsule[]) {\n return new CapsuleList(...capsules);\n }\n /**\n * determines whether or not a capsule can theoretically use the dists saved in the last snap, rather than re-compile them.\n * practically, this optimization is used for components that have typescript as their compiler.\n */\n static async capsuleUsePreviouslySavedDists(component: Component): Promise<boolean> {\n const isModified = await component.isModified();\n return component.buildStatus === 'succeed' && !isModified;\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGe,MAAMG,WAAW,SAASC,KAAK,CAAU;EACtDC,UAAUA,CAACC,EAAe,EAAuB;IAC/C,OAAO,IAAI,CAACC,IAAI,CAAEC,OAAO,IAAKA,OAAO,CAACC,SAAS,CAACH,EAAE,CAACI,OAAO,CAACJ,EAAE,CAAC,CAAC;EACjE;EACAK,oBAAoBA,CAACL,EAAe,EAAuB;IACzD,OAAO,IAAI,CAACC,IAAI,CAAEC,OAAO,IAAKA,OAAO,CAACC,SAAS,CAACH,EAAE,CAACI,OAAO,CAACJ,EAAE,CAAC,CAAC;EACjE;EACAM,uBAAuBA,CAACN,EAAe,EAAuB;IAC5D,OAAO,IAAI,CAACC,IAAI,CAAEC,OAAO,IAAKA,OAAO,CAACC,SAAS,CAACH,EAAE,CAACI,OAAO,CAACJ,EAAE,EAAE;MAAEO,aAAa,EAAE;IAAK,CAAC,CAAC,CAAC;EAC1F;EACAC,iBAAiBA,CAAA,EAAa;IAC5B,OAAO,IAAI,CAACC,GAAG,CAAEP,OAAO,IAAKA,OAAO,CAACQ,IAAI,CAAC;EAC5C;EACAC,oBA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ACA;AACA;EACE,aAAaC,8BAA8BA,CAAC7C,SAAoB,EAAoB;IAClF,MAAM8C,UAAU,GAAG,MAAM9C,SAAS,CAAC8C,UAAU,CAAC,CAAC;IAC/C,OAAO9C,SAAS,CAAC+C,WAAW,KAAK,SAAS,IAAI,CAACD,UAAU;EAC3D;AACF;AAACE,OAAA,CAAAC,OAAA,GAAAvD,WAAA","ignoreList":[]}
1
+ {"version":3,"names":["_graph","data","require","_path","CapsuleList","Array","getCapsule","id","find","capsule","component","isEqual","getCapsuleByLegacyId","getCapsuleIgnoreVersion","ignoreVersion","getAllCapsuleDirs","map","path","getIdByPathInCapsule","pathInCapsule","normalizedPathInCapsule","normalize","found","getAllComponents","c","getAllComponentIDs","getGraphIds","components","graph","Graph","forEach","comp","setNode","Node","toString","compIdsStr","deps","getDependencies","dep","includes","setEdge","Edge","type","toposort","depResolver","getPackageName","node","nodes","attr","depPkgName","hasNode","lifecycle","sortedSeeders","sortedCapsules","fromArray","capsules","capsuleUsePreviouslySavedDists","isModified","buildStatus","exports","default"],"sources":["capsule-list.ts"],"sourcesContent":["import type { Component } from '@teambit/component';\nimport { Dependency, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { Edge, Graph, Node } from '@teambit/graph.cleargraph';\nimport { ComponentID } from '@teambit/component-id';\nimport { normalize } from 'path';\nimport { Capsule } from './capsule';\n\nexport default class CapsuleList extends Array<Capsule> {\n getCapsule(id: ComponentID): Capsule | undefined {\n return this.find((capsule) => capsule.component.id.isEqual(id));\n }\n getCapsuleByLegacyId(id: ComponentID): Capsule | undefined {\n return this.find((capsule) => capsule.component.id.isEqual(id));\n }\n getCapsuleIgnoreVersion(id: ComponentID): Capsule | undefined {\n return this.find((capsule) => capsule.component.id.isEqual(id, { ignoreVersion: true }));\n }\n getAllCapsuleDirs(): string[] {\n return this.map((capsule) => capsule.path);\n }\n getIdByPathInCapsule(pathInCapsule: string): ComponentID | null {\n const normalizedPathInCapsule = normalize(pathInCapsule);\n const found = this.find((capsule) => normalizedPathInCapsule === normalize(capsule.path));\n return found ? found.component.id : null;\n }\n getAllComponents(): Component[] {\n return this.map((c) => c.component);\n }\n getAllComponentIDs(): ComponentID[] {\n return this.map((c) => c.component.id);\n }\n getGraphIds(): Graph<Component, string> {\n const components = this.getAllComponents();\n const graph = new Graph<Component, string>();\n\n components.forEach((comp: Component) => graph.setNode(new Node(comp.id.toString(), comp)));\n const compIdsStr = components.map((c) => c.id.toString());\n\n components.forEach((comp) => {\n const deps = comp.getDependencies();\n deps.forEach((dep) => {\n if (compIdsStr.includes(dep.id)) {\n graph.setEdge(new Edge(comp.id.toString(), dep.id, dep.type));\n }\n });\n });\n\n return graph;\n }\n // Sort the capsules by their dependencies. The capsules with no dependencies will be first. Returns a new array.\n async toposort(depResolver: DependencyResolverMain): Promise<CapsuleList> {\n const components = this.getAllComponents();\n const graph = new Graph<Component, string>();\n\n // Build a graph with all the components from the current capsule list\n components.forEach((comp: Component) => graph.setNode(new Node(depResolver.getPackageName(comp), comp)));\n\n // Add edges between the components according to their interdependencies\n for (const node of graph.nodes) {\n // eslint-disable-next-line no-await-in-loop\n const deps = await depResolver.getDependencies(node.attr);\n deps.forEach((dep: Dependency) => {\n const depPkgName = dep.getPackageName?.();\n if (depPkgName && graph.hasNode(depPkgName)) {\n graph.setEdge(new Edge(node.id, depPkgName, dep.lifecycle));\n }\n });\n }\n\n const sortedSeeders = graph.toposort(true);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const sortedCapsules: Capsule[] = sortedSeeders.map((node: Node<Component>) => this.getCapsule(node.attr.id)!);\n return CapsuleList.fromArray(sortedCapsules);\n }\n static fromArray(capsules: Capsule[]) {\n return new CapsuleList(...capsules);\n }\n /**\n * determines whether or not a capsule can theoretically use the dists saved in the last snap, rather than re-compile them.\n * practically, this optimization is used for components that have typescript as their compiler.\n */\n static async capsuleUsePreviouslySavedDists(component: Component): Promise<boolean> {\n const isModified = await component.isModified();\n return component.buildStatus === 'succeed' && !isModified;\n }\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,KAAK,SAAS,IAAI,CAACD,UAAU;EAC3D;AACF;AAACE,OAAA,CAAAC,OAAA,GAAAxD,WAAA","ignoreList":[]}
@@ -227,6 +227,7 @@ export declare class IsolatorMain {
227
227
  * @param legacyScope
228
228
  */
229
229
  private createCapsules;
230
+ private addDependenciesGraphToComponents;
230
231
  private markCapsulesAsReady;
231
232
  private markCapsuleAsReady;
232
233
  private removeCapsuleReadyFileSync;
@@ -528,6 +528,7 @@ class IsolatorMain {
528
528
  * @param opts
529
529
  * @param legacyScope
530
530
  */
531
+ /* eslint-disable complexity */
531
532
  async createCapsules(components, capsulesDir, opts, legacyScope) {
532
533
  this.logger.debug(`createCapsules, ${components.length} components`);
533
534
  let longProcessLogger;
@@ -611,13 +612,20 @@ class IsolatorMain {
611
612
  });
612
613
  }));
613
614
  } else {
615
+ const dependenciesGraph = await legacyScope?.getDependenciesGraphByComponentIds(capsuleList.getAllComponentIDs());
614
616
  const linkedDependencies = await this.linkInCapsules(capsuleList, capsulesWithPackagesData);
615
617
  linkedDependencies[capsulesDir] = rootLinks;
616
618
  await this.installInCapsules(capsulesDir, capsuleList, installOptions, {
617
619
  cachePackagesOnCapsulesRoot,
618
620
  linkedDependencies,
619
- packageManager: opts.packageManager
621
+ packageManager: opts.packageManager,
622
+ dependenciesGraph
620
623
  });
624
+ if (dependenciesGraph == null) {
625
+ // If the graph was not present in the model, we use the just created lockfile inside the capsules
626
+ // to populate the graph.
627
+ await this.addDependenciesGraphToComponents(capsuleList, components, capsulesDir);
628
+ }
621
629
  }
622
630
  if (installLongProcessLogger) {
623
631
  installLongProcessLogger.end('success');
@@ -647,6 +655,16 @@ class IsolatorMain {
647
655
  }
648
656
  return allCapsuleList;
649
657
  }
658
+ /* eslint-enable complexity */
659
+
660
+ async addDependenciesGraphToComponents(capsuleList, components, capsulesDir) {
661
+ const componentIdByPkgName = this.dependencyResolver.createComponentIdByPkgNameMap(components);
662
+ const opts = {
663
+ componentIdByPkgName,
664
+ rootDir: capsulesDir
665
+ };
666
+ await Promise.all(capsuleList.map(capsule => this.dependencyResolver.addDependenciesGraph(capsule.component, _path().default.relative(capsulesDir, capsule.path), opts)));
667
+ }
650
668
  async markCapsulesAsReady(capsuleList) {
651
669
  await Promise.all(capsuleList.map(async capsule => {
652
670
  return this.markCapsuleAsReady(capsule);
@@ -692,7 +710,8 @@ class IsolatorMain {
692
710
  linkedDependencies: opts.linkedDependencies,
693
711
  forceTeambitHarmonyLink: !this.dependencyResolver.hasHarmonyInRootPolicy(),
694
712
  excludeExtensionsDependencies: true,
695
- dedupeInjectedDeps: true
713
+ dedupeInjectedDeps: true,
714
+ dependenciesGraph: opts.dependenciesGraph
696
715
  };
697
716
  const packageManagerInstallOptions = {
698
717
  autoInstallPeers: this.dependencyResolver.config.autoInstallPeers,