@teambit/workspace 1.0.845 → 1.0.847
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.
|
@@ -44,6 +44,16 @@ export declare class GraphFromFsBuilder {
|
|
|
44
44
|
* we keep performance sane as the importMany doesn't run multiple time and therefore the round
|
|
45
45
|
* trips to the remotes are minimal.
|
|
46
46
|
*
|
|
47
|
+
* LAZY IMPORT MODE (when shouldLoadItsDeps is provided):
|
|
48
|
+
* when a filter function (shouldLoadItsDeps) is provided, we use "lazy import" mode to optimize
|
|
49
|
+
* performance. instead of importing all flattened dependencies at once, we:
|
|
50
|
+
* 1. only import dependencies that pass the filter (e.g., only aspects)
|
|
51
|
+
* 2. don't fetch their flattened dependencies upfront (includeDependencies: false)
|
|
52
|
+
* 3. let the recursive depth iteration handle importing deps as needed
|
|
53
|
+
* this is much more efficient when building filtered graphs (e.g., aspects-only graph) because
|
|
54
|
+
* we avoid fetching huge dependency trees for components we don't care about.
|
|
55
|
+
*
|
|
56
|
+
* TRADITIONAL MODE (without filter):
|
|
47
57
|
* normally, one importMany of the seeders is enough as importMany knows to fetch all flattened.
|
|
48
58
|
* however, since this buildGraph is performed on the workspace, a dependency may be new or
|
|
49
59
|
* modified and as such, we don't know its flattened yet.
|
|
@@ -55,8 +65,16 @@ export declare class GraphFromFsBuilder {
|
|
|
55
65
|
/**
|
|
56
66
|
* only for components from the workspace that can be modified to add/remove dependencies, we need to make sure that
|
|
57
67
|
* all their dependencies are imported.
|
|
58
|
-
*
|
|
59
|
-
*
|
|
68
|
+
*
|
|
69
|
+
* when `shouldLoadItsDeps` is provided, we use "lazy import" mode:
|
|
70
|
+
* - only import filtered dependencies (those passing the shouldLoadItsDeps check)
|
|
71
|
+
* - use preferDependencyGraph to avoid fetching flattened dependencies
|
|
72
|
+
* - the recursive depth iteration will handle importing deps as needed
|
|
73
|
+
* this is much more efficient when building a filtered graph (e.g., aspects-only graph)
|
|
74
|
+
*
|
|
75
|
+
* without a filter, we use the traditional approach:
|
|
76
|
+
* - `importMany` fetches all flattened dependencies (preferDependencyGraph: false)
|
|
77
|
+
* - once a component from scope is imported, all its flattened dependencies are there
|
|
60
78
|
*/
|
|
61
79
|
private importObjects;
|
|
62
80
|
private processOneComponent;
|
|
@@ -107,6 +107,16 @@ class GraphFromFsBuilder {
|
|
|
107
107
|
* we keep performance sane as the importMany doesn't run multiple time and therefore the round
|
|
108
108
|
* trips to the remotes are minimal.
|
|
109
109
|
*
|
|
110
|
+
* LAZY IMPORT MODE (when shouldLoadItsDeps is provided):
|
|
111
|
+
* when a filter function (shouldLoadItsDeps) is provided, we use "lazy import" mode to optimize
|
|
112
|
+
* performance. instead of importing all flattened dependencies at once, we:
|
|
113
|
+
* 1. only import dependencies that pass the filter (e.g., only aspects)
|
|
114
|
+
* 2. don't fetch their flattened dependencies upfront (includeDependencies: false)
|
|
115
|
+
* 3. let the recursive depth iteration handle importing deps as needed
|
|
116
|
+
* this is much more efficient when building filtered graphs (e.g., aspects-only graph) because
|
|
117
|
+
* we avoid fetching huge dependency trees for components we don't care about.
|
|
118
|
+
*
|
|
119
|
+
* TRADITIONAL MODE (without filter):
|
|
110
120
|
* normally, one importMany of the seeders is enough as importMany knows to fetch all flattened.
|
|
111
121
|
* however, since this buildGraph is performed on the workspace, a dependency may be new or
|
|
112
122
|
* modified and as such, we don't know its flattened yet.
|
|
@@ -148,24 +158,36 @@ class GraphFromFsBuilder {
|
|
|
148
158
|
/**
|
|
149
159
|
* only for components from the workspace that can be modified to add/remove dependencies, we need to make sure that
|
|
150
160
|
* all their dependencies are imported.
|
|
151
|
-
*
|
|
152
|
-
*
|
|
161
|
+
*
|
|
162
|
+
* when `shouldLoadItsDeps` is provided, we use "lazy import" mode:
|
|
163
|
+
* - only import filtered dependencies (those passing the shouldLoadItsDeps check)
|
|
164
|
+
* - use preferDependencyGraph to avoid fetching flattened dependencies
|
|
165
|
+
* - the recursive depth iteration will handle importing deps as needed
|
|
166
|
+
* this is much more efficient when building a filtered graph (e.g., aspects-only graph)
|
|
167
|
+
*
|
|
168
|
+
* without a filter, we use the traditional approach:
|
|
169
|
+
* - `importMany` fetches all flattened dependencies (preferDependencyGraph: false)
|
|
170
|
+
* - once a component from scope is imported, all its flattened dependencies are there
|
|
153
171
|
*/
|
|
154
172
|
async importObjects(components) {
|
|
155
173
|
const workspaceIds = this.workspace.listIds();
|
|
156
174
|
const compOnWorkspaceOnly = components.filter(comp => workspaceIds.find(id => id.isEqual(comp.id)));
|
|
157
|
-
|
|
175
|
+
|
|
176
|
+
// when shouldLoadItsDeps is provided, use lazy import: only import filtered deps without their flattened
|
|
177
|
+
const useLazyImport = Boolean(this.shouldLoadItsDeps);
|
|
178
|
+
const getDepsFunc = useLazyImport ? c => this.getAllDepsFiltered(c) : c => this.getAllDepsUnfiltered(c);
|
|
179
|
+
const allDeps = (await Promise.all(compOnWorkspaceOnly.map(getDepsFunc))).flat();
|
|
158
180
|
const allDepsNotImported = allDeps.filter(d => !this.importedIds.includes(d.toString()));
|
|
159
181
|
const exportedDeps = allDepsNotImported.map(id => id).filter(dep => this.workspace.isExported(dep));
|
|
160
182
|
const scopeComponentsImporter = this.consumer.scope.scopeImporter;
|
|
161
183
|
await scopeComponentsImporter.importMany({
|
|
162
184
|
ids: _componentId().ComponentIdList.uniqFromArray(exportedDeps),
|
|
163
|
-
preferDependencyGraph:
|
|
185
|
+
preferDependencyGraph: useLazyImport,
|
|
164
186
|
throwForDependencyNotFound: this.shouldThrowOnMissingDep,
|
|
165
187
|
throwForSeederNotFound: this.shouldThrowOnMissingDep,
|
|
166
188
|
reFetchUnBuiltVersion: false,
|
|
167
189
|
lane: this.currentLane,
|
|
168
|
-
reason: 'for building a graph from the workspace'
|
|
190
|
+
reason: useLazyImport ? 'for building a filtered graph from the workspace (lazy)' : 'for building a graph from the workspace'
|
|
169
191
|
});
|
|
170
192
|
allDepsNotImported.map(id => this.importedIds.push(id.toString()));
|
|
171
193
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_graph","_lodash","_componentId","_legacy","_scope","_lodash2","_bitError","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","GraphFromFsBuilder","constructor","workspace","logger","dependencyResolver","ignoreIds","shouldLoadItsDeps","shouldThrowOnMissingDep","Graph","consumer","buildGraph","ids","debug","length","start","Date","now","components","loadManyComponents","currentLane","getCurrentLaneObject","processManyComponents","graph","getAllDepsUnfiltered","component","deps","getComponentDependencies","depsIds","map","dep","componentId","filter","depId","includes","toString","getAllDepsFiltered","depsWithoutIgnore","shouldLoadFunc","mapSeries","shouldLoad","push","compact","depth","importObjects","allDependencies","processOneComponent","allDependenciesFlattened","flatten","workspaceIds","listIds","compOnWorkspaceOnly","comp","find","id","isEqual","allDeps","Promise","all","c","flat","allDepsNotImported","d","importedIds","exportedDeps","isExported","scopeComponentsImporter","scope","scopeImporter","importMany","ComponentIdList","uniqFromArray","preferDependencyGraph","throwForDependencyNotFound","throwForSeederNotFound","reFetchUnBuiltVersion","lane","reason","idStr","completed","allIds","allDependenciesComps","forEach","hasNode","Error","warn","setEdge","Edge","lifecycle","componentsIds","dependenciesOf","fromGraph","node","attr","get","setNode","Node","err","ComponentNotFound","ComponentNotFoundInScope","ScopeNotFound","BitError","error","exports"],"sources":["build-graph-from-fs.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport { Graph, Node, Edge } from '@teambit/graph.cleargraph';\nimport { flatten } from 'lodash';\nimport type { Consumer } from '@teambit/legacy.consumer';\nimport type { Component, ComponentID } from '@teambit/component';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { ComponentIdList } from '@teambit/component-id';\nimport type { Lane } from '@teambit/objects';\nimport { ComponentNotFound, ScopeNotFound } from '@teambit/legacy.scope';\nimport { ComponentNotFound as ComponentNotFoundInScope } from '@teambit/scope';\nimport compact from 'lodash.compact';\nimport type { Logger } from '@teambit/logger';\nimport { BitError } from '@teambit/bit-error';\nimport type { Workspace } from './workspace';\n\nexport type ShouldLoadFunc = (id: ComponentID) => Promise<boolean>;\n\nexport class GraphFromFsBuilder {\n private graph = new Graph<Component, string>();\n private completed: string[] = [];\n private depth = 1;\n private consumer: Consumer;\n private importedIds: string[] = [];\n private currentLane: Lane | undefined;\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private dependencyResolver: DependencyResolverMain,\n private ignoreIds: string[] = [],\n private shouldLoadItsDeps?: ShouldLoadFunc,\n private shouldThrowOnMissingDep = true\n ) {\n this.consumer = this.workspace.consumer;\n }\n\n /**\n * create a graph with all dependencies and flattened dependencies of the given components.\n * the nodes are components and the edges has a label of the dependency type.\n *\n * the way how it is done is iterations by depths. each depth we gather all the dependencies of\n * that depths, make sure all objects exist and then check their dependencies for the next depth.\n * once there is no dependency left, we're on the last depth level and the graph is ready.\n *\n * for example, imagine the following graph:\n * A1 -> A2 -> A3\n * B1 -> B2 -> B3\n * C1 -> C2 -> C3\n *\n * where the buildGraph is given [A1, B1, C1].\n * first, it saves all these components as nodes in the graph. then, it finds the dependencies of\n * the next level, in this case they're [A2, B2, C2]. it runs `importMany` in case some objects\n * are missing. then, it loads them all (some from FS, some from the model) and sets the edges\n * between the component and the dependencies.\n * once done, it finds all their dependencies, which are [A3, B3, C3] and repeat the process\n * above. since there are no more dependencies, the graph is completed.\n * in this case, the total depth levels are 3.\n *\n * even with a huge project, there are not many depth levels. by iterating through depth levels\n * we keep performance sane as the importMany doesn't run multiple time and therefore the round\n * trips to the remotes are minimal.\n *\n * normally, one importMany of the seeders is enough as importMany knows to fetch all flattened.\n * however, since this buildGraph is performed on the workspace, a dependency may be new or\n * modified and as such, we don't know its flattened yet.\n */\n async buildGraph(ids: ComponentID[]): Promise<Graph<Component, string>> {\n this.logger.debug(`GraphFromFsBuilder, buildGraph with ${ids.length} seeders`);\n const start = Date.now();\n const components = await this.loadManyComponents(ids);\n this.currentLane = await this.workspace.consumer.getCurrentLaneObject();\n await this.processManyComponents(components);\n this.logger.debug(\n `GraphFromFsBuilder, buildGraph with ${ids.length} seeders completed (${(Date.now() - start) / 1000} sec)`\n );\n return this.graph;\n }\n\n private async getAllDepsUnfiltered(component: Component): Promise<ComponentID[]> {\n const deps = await this.dependencyResolver.getComponentDependencies(component);\n const depsIds = deps.map((dep) => dep.componentId);\n\n return depsIds.filter((depId) => !this.ignoreIds.includes(depId.toString()));\n }\n\n private async getAllDepsFiltered(component: Component): Promise<ComponentID[]> {\n const depsWithoutIgnore = await this.getAllDepsUnfiltered(component);\n const shouldLoadFunc = this.shouldLoadItsDeps;\n if (!shouldLoadFunc) return depsWithoutIgnore;\n const deps = await mapSeries(depsWithoutIgnore, async (depId) => {\n const shouldLoad = await shouldLoadFunc(depId);\n if (!shouldLoad) this.ignoreIds.push(depId.toString());\n return shouldLoad ? depId : null;\n });\n return compact(deps);\n }\n\n private async processManyComponents(components: Component[]) {\n this.logger.debug(`GraphFromFsBuilder.processManyComponents depth ${this.depth}, ${components.length} components`);\n this.depth += 1;\n await this.importObjects(components);\n const allDependencies = await mapSeries(components, (component) => this.processOneComponent(component));\n const allDependenciesFlattened = flatten(allDependencies);\n if (allDependenciesFlattened.length) await this.processManyComponents(allDependenciesFlattened);\n }\n\n /**\n * only for components from the workspace that can be modified to add/remove dependencies, we need to make sure that\n * all their dependencies are imported.\n * remember that `importMany` fetches all flattened dependencies. once a component from scope is imported, we know\n * that all its flattened dependencies are there. no need to call importMany again for them.\n */\n private async importObjects(components: Component[]) {\n const workspaceIds = this.workspace.listIds();\n const compOnWorkspaceOnly = components.filter((comp) => workspaceIds.find((id) => id.isEqual(comp.id)));\n const allDeps = (await Promise.all(compOnWorkspaceOnly.map((c) => this.getAllDepsUnfiltered(c)))).flat();\n const allDepsNotImported = allDeps.filter((d) => !this.importedIds.includes(d.toString()));\n const exportedDeps = allDepsNotImported.map((id) => id).filter((dep) => this.workspace.isExported(dep));\n const scopeComponentsImporter = this.consumer.scope.scopeImporter;\n await scopeComponentsImporter.importMany({\n ids: ComponentIdList.uniqFromArray(exportedDeps),\n preferDependencyGraph: false,\n throwForDependencyNotFound: this.shouldThrowOnMissingDep,\n throwForSeederNotFound: this.shouldThrowOnMissingDep,\n reFetchUnBuiltVersion: false,\n lane: this.currentLane,\n reason: 'for building a graph from the workspace',\n });\n allDepsNotImported.map((id) => this.importedIds.push(id.toString()));\n }\n\n private async processOneComponent(component: Component) {\n const idStr = component.id.toString();\n if (this.completed.includes(idStr)) return [];\n const allIds = await this.getAllDepsFiltered(component);\n\n const allDependenciesComps = await this.loadManyComponents(allIds, idStr);\n const deps = await this.dependencyResolver.getComponentDependencies(component);\n deps.forEach((dep) => {\n const depId = dep.componentId;\n if (this.ignoreIds.includes(depId.toString())) return;\n if (!this.graph.hasNode(depId.toString())) {\n if (this.shouldThrowOnMissingDep) {\n throw new Error(`buildOneComponent: missing node of ${depId.toString()}`);\n }\n this.logger.warn(`ignoring missing ${depId.toString()}`);\n return;\n }\n this.graph.setEdge(new Edge(idStr, depId.toString(), dep.lifecycle));\n });\n\n this.completed.push(idStr);\n return allDependenciesComps;\n }\n\n private async loadManyComponents(componentsIds: ComponentID[], dependenciesOf?: string): Promise<Component[]> {\n const components = await mapSeries(componentsIds, async (comp) => {\n const idStr = comp.toString();\n const fromGraph = this.graph.node(idStr)?.attr;\n if (fromGraph) return fromGraph;\n try {\n const component = await this.workspace.get(comp);\n this.graph.setNode(new Node(idStr, component));\n return component;\n } catch (err: any) {\n if (\n err instanceof ComponentNotFound ||\n err instanceof ComponentNotFoundInScope ||\n err instanceof ScopeNotFound\n ) {\n if (dependenciesOf && !this.shouldThrowOnMissingDep) {\n this.logger.warn(\n `component ${idStr}, dependency of ${dependenciesOf} was not found. continuing without it`\n );\n return null;\n }\n throw new BitError(\n `error: component \"${idStr}\" was not found.\\nthis component is a dependency of \"${\n dependenciesOf || '<none>'\n }\" and is needed as part of the graph generation`\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1
|
+
{"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_graph","_lodash","_componentId","_legacy","_scope","_lodash2","_bitError","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","GraphFromFsBuilder","constructor","workspace","logger","dependencyResolver","ignoreIds","shouldLoadItsDeps","shouldThrowOnMissingDep","Graph","consumer","buildGraph","ids","debug","length","start","Date","now","components","loadManyComponents","currentLane","getCurrentLaneObject","processManyComponents","graph","getAllDepsUnfiltered","component","deps","getComponentDependencies","depsIds","map","dep","componentId","filter","depId","includes","toString","getAllDepsFiltered","depsWithoutIgnore","shouldLoadFunc","mapSeries","shouldLoad","push","compact","depth","importObjects","allDependencies","processOneComponent","allDependenciesFlattened","flatten","workspaceIds","listIds","compOnWorkspaceOnly","comp","find","id","isEqual","useLazyImport","Boolean","getDepsFunc","c","allDeps","Promise","all","flat","allDepsNotImported","d","importedIds","exportedDeps","isExported","scopeComponentsImporter","scope","scopeImporter","importMany","ComponentIdList","uniqFromArray","preferDependencyGraph","throwForDependencyNotFound","throwForSeederNotFound","reFetchUnBuiltVersion","lane","reason","idStr","completed","allIds","allDependenciesComps","forEach","hasNode","Error","warn","setEdge","Edge","lifecycle","componentsIds","dependenciesOf","fromGraph","node","attr","get","setNode","Node","err","ComponentNotFound","ComponentNotFoundInScope","ScopeNotFound","BitError","error","exports"],"sources":["build-graph-from-fs.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport { Graph, Node, Edge } from '@teambit/graph.cleargraph';\nimport { flatten } from 'lodash';\nimport type { Consumer } from '@teambit/legacy.consumer';\nimport type { Component, ComponentID } from '@teambit/component';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { ComponentIdList } from '@teambit/component-id';\nimport type { Lane } from '@teambit/objects';\nimport { ComponentNotFound, ScopeNotFound } from '@teambit/legacy.scope';\nimport { ComponentNotFound as ComponentNotFoundInScope } from '@teambit/scope';\nimport compact from 'lodash.compact';\nimport type { Logger } from '@teambit/logger';\nimport { BitError } from '@teambit/bit-error';\nimport type { Workspace } from './workspace';\n\nexport type ShouldLoadFunc = (id: ComponentID) => Promise<boolean>;\n\nexport class GraphFromFsBuilder {\n private graph = new Graph<Component, string>();\n private completed: string[] = [];\n private depth = 1;\n private consumer: Consumer;\n private importedIds: string[] = [];\n private currentLane: Lane | undefined;\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private dependencyResolver: DependencyResolverMain,\n private ignoreIds: string[] = [],\n private shouldLoadItsDeps?: ShouldLoadFunc,\n private shouldThrowOnMissingDep = true\n ) {\n this.consumer = this.workspace.consumer;\n }\n\n /**\n * create a graph with all dependencies and flattened dependencies of the given components.\n * the nodes are components and the edges has a label of the dependency type.\n *\n * the way how it is done is iterations by depths. each depth we gather all the dependencies of\n * that depths, make sure all objects exist and then check their dependencies for the next depth.\n * once there is no dependency left, we're on the last depth level and the graph is ready.\n *\n * for example, imagine the following graph:\n * A1 -> A2 -> A3\n * B1 -> B2 -> B3\n * C1 -> C2 -> C3\n *\n * where the buildGraph is given [A1, B1, C1].\n * first, it saves all these components as nodes in the graph. then, it finds the dependencies of\n * the next level, in this case they're [A2, B2, C2]. it runs `importMany` in case some objects\n * are missing. then, it loads them all (some from FS, some from the model) and sets the edges\n * between the component and the dependencies.\n * once done, it finds all their dependencies, which are [A3, B3, C3] and repeat the process\n * above. since there are no more dependencies, the graph is completed.\n * in this case, the total depth levels are 3.\n *\n * even with a huge project, there are not many depth levels. by iterating through depth levels\n * we keep performance sane as the importMany doesn't run multiple time and therefore the round\n * trips to the remotes are minimal.\n *\n * LAZY IMPORT MODE (when shouldLoadItsDeps is provided):\n * when a filter function (shouldLoadItsDeps) is provided, we use \"lazy import\" mode to optimize\n * performance. instead of importing all flattened dependencies at once, we:\n * 1. only import dependencies that pass the filter (e.g., only aspects)\n * 2. don't fetch their flattened dependencies upfront (includeDependencies: false)\n * 3. let the recursive depth iteration handle importing deps as needed\n * this is much more efficient when building filtered graphs (e.g., aspects-only graph) because\n * we avoid fetching huge dependency trees for components we don't care about.\n *\n * TRADITIONAL MODE (without filter):\n * normally, one importMany of the seeders is enough as importMany knows to fetch all flattened.\n * however, since this buildGraph is performed on the workspace, a dependency may be new or\n * modified and as such, we don't know its flattened yet.\n */\n async buildGraph(ids: ComponentID[]): Promise<Graph<Component, string>> {\n this.logger.debug(`GraphFromFsBuilder, buildGraph with ${ids.length} seeders`);\n const start = Date.now();\n const components = await this.loadManyComponents(ids);\n this.currentLane = await this.workspace.consumer.getCurrentLaneObject();\n await this.processManyComponents(components);\n this.logger.debug(\n `GraphFromFsBuilder, buildGraph with ${ids.length} seeders completed (${(Date.now() - start) / 1000} sec)`\n );\n return this.graph;\n }\n\n private async getAllDepsUnfiltered(component: Component): Promise<ComponentID[]> {\n const deps = await this.dependencyResolver.getComponentDependencies(component);\n const depsIds = deps.map((dep) => dep.componentId);\n\n return depsIds.filter((depId) => !this.ignoreIds.includes(depId.toString()));\n }\n\n private async getAllDepsFiltered(component: Component): Promise<ComponentID[]> {\n const depsWithoutIgnore = await this.getAllDepsUnfiltered(component);\n const shouldLoadFunc = this.shouldLoadItsDeps;\n if (!shouldLoadFunc) return depsWithoutIgnore;\n const deps = await mapSeries(depsWithoutIgnore, async (depId) => {\n const shouldLoad = await shouldLoadFunc(depId);\n if (!shouldLoad) this.ignoreIds.push(depId.toString());\n return shouldLoad ? depId : null;\n });\n return compact(deps);\n }\n\n private async processManyComponents(components: Component[]) {\n this.logger.debug(`GraphFromFsBuilder.processManyComponents depth ${this.depth}, ${components.length} components`);\n this.depth += 1;\n await this.importObjects(components);\n const allDependencies = await mapSeries(components, (component) => this.processOneComponent(component));\n const allDependenciesFlattened = flatten(allDependencies);\n if (allDependenciesFlattened.length) await this.processManyComponents(allDependenciesFlattened);\n }\n\n /**\n * only for components from the workspace that can be modified to add/remove dependencies, we need to make sure that\n * all their dependencies are imported.\n *\n * when `shouldLoadItsDeps` is provided, we use \"lazy import\" mode:\n * - only import filtered dependencies (those passing the shouldLoadItsDeps check)\n * - use preferDependencyGraph to avoid fetching flattened dependencies\n * - the recursive depth iteration will handle importing deps as needed\n * this is much more efficient when building a filtered graph (e.g., aspects-only graph)\n *\n * without a filter, we use the traditional approach:\n * - `importMany` fetches all flattened dependencies (preferDependencyGraph: false)\n * - once a component from scope is imported, all its flattened dependencies are there\n */\n private async importObjects(components: Component[]) {\n const workspaceIds = this.workspace.listIds();\n const compOnWorkspaceOnly = components.filter((comp) => workspaceIds.find((id) => id.isEqual(comp.id)));\n\n // when shouldLoadItsDeps is provided, use lazy import: only import filtered deps without their flattened\n const useLazyImport = Boolean(this.shouldLoadItsDeps);\n const getDepsFunc = useLazyImport\n ? (c: Component) => this.getAllDepsFiltered(c)\n : (c: Component) => this.getAllDepsUnfiltered(c);\n\n const allDeps = (await Promise.all(compOnWorkspaceOnly.map(getDepsFunc))).flat();\n const allDepsNotImported = allDeps.filter((d) => !this.importedIds.includes(d.toString()));\n const exportedDeps = allDepsNotImported.map((id) => id).filter((dep) => this.workspace.isExported(dep));\n const scopeComponentsImporter = this.consumer.scope.scopeImporter;\n await scopeComponentsImporter.importMany({\n ids: ComponentIdList.uniqFromArray(exportedDeps),\n preferDependencyGraph: useLazyImport,\n throwForDependencyNotFound: this.shouldThrowOnMissingDep,\n throwForSeederNotFound: this.shouldThrowOnMissingDep,\n reFetchUnBuiltVersion: false,\n lane: this.currentLane,\n reason: useLazyImport\n ? 'for building a filtered graph from the workspace (lazy)'\n : 'for building a graph from the workspace',\n });\n allDepsNotImported.map((id) => this.importedIds.push(id.toString()));\n }\n\n private async processOneComponent(component: Component) {\n const idStr = component.id.toString();\n if (this.completed.includes(idStr)) return [];\n const allIds = await this.getAllDepsFiltered(component);\n\n const allDependenciesComps = await this.loadManyComponents(allIds, idStr);\n const deps = await this.dependencyResolver.getComponentDependencies(component);\n deps.forEach((dep) => {\n const depId = dep.componentId;\n if (this.ignoreIds.includes(depId.toString())) return;\n if (!this.graph.hasNode(depId.toString())) {\n if (this.shouldThrowOnMissingDep) {\n throw new Error(`buildOneComponent: missing node of ${depId.toString()}`);\n }\n this.logger.warn(`ignoring missing ${depId.toString()}`);\n return;\n }\n this.graph.setEdge(new Edge(idStr, depId.toString(), dep.lifecycle));\n });\n\n this.completed.push(idStr);\n return allDependenciesComps;\n }\n\n private async loadManyComponents(componentsIds: ComponentID[], dependenciesOf?: string): Promise<Component[]> {\n const components = await mapSeries(componentsIds, async (comp) => {\n const idStr = comp.toString();\n const fromGraph = this.graph.node(idStr)?.attr;\n if (fromGraph) return fromGraph;\n try {\n const component = await this.workspace.get(comp);\n this.graph.setNode(new Node(idStr, component));\n return component;\n } catch (err: any) {\n if (\n err instanceof ComponentNotFound ||\n err instanceof ComponentNotFoundInScope ||\n err instanceof ScopeNotFound\n ) {\n if (dependenciesOf && !this.shouldThrowOnMissingDep) {\n this.logger.warn(\n `component ${idStr}, dependency of ${dependenciesOf} was not found. continuing without it`\n );\n return null;\n }\n throw new BitError(\n `error: component \"${idStr}\" was not found.\\nthis component is a dependency of \"${\n dependenciesOf || '<none>'\n }\" and is needed as part of the graph generation`\n );\n }\n if (dependenciesOf) this.logger.error(`failed loading dependencies of ${dependenciesOf}`);\n throw err;\n }\n });\n return compact(components);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;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AAI,CAACjB,QAAQ,CAAC,CAAC;MAC7B,MAAM2D,SAAS,GAAG,IAAI,CAACvE,KAAK,CAACwE,IAAI,CAACd,KAAK,CAAC,EAAEe,IAAI;MAC9C,IAAIF,SAAS,EAAE,OAAOA,SAAS;MAC/B,IAAI;QACF,MAAMrE,SAAS,GAAG,MAAM,IAAI,CAACtB,SAAS,CAAC8F,GAAG,CAAC7C,IAAI,CAAC;QAChD,IAAI,CAAC7B,KAAK,CAAC2E,OAAO,CAAC,KAAIC,aAAI,EAAClB,KAAK,EAAExD,SAAS,CAAC,CAAC;QAC9C,OAAOA,SAAS;MAClB,CAAC,CAAC,OAAO2E,GAAQ,EAAE;QACjB,IACEA,GAAG,YAAYC,2BAAiB,IAChCD,GAAG,YAAYE,0BAAwB,IACvCF,GAAG,YAAYG,uBAAa,EAC5B;UACA,IAAIV,cAAc,IAAI,CAAC,IAAI,CAACrF,uBAAuB,EAAE;YACnD,IAAI,CAACJ,MAAM,CAACoF,IAAI,CACd,aAAaP,KAAK,mBAAmBY,cAAc,uCACrD,CAAC;YACD,OAAO,IAAI;UACb;UACA,MAAM,KAAIW,oBAAQ,EAChB,qBAAqBvB,KAAK,wDACxBY,cAAc,IAAI,QAAQ,iDAE9B,CAAC;QACH;QACA,IAAIA,cAAc,EAAE,IAAI,CAACzF,MAAM,CAACqG,KAAK,CAAC,kCAAkCZ,cAAc,EAAE,CAAC;QACzF,MAAMO,GAAG;MACX;IACF,CAAC,CAAC;IACF,OAAO,IAAA1D,kBAAO,EAACxB,UAAU,CAAC;EAC5B;AACF;AAACwF,OAAA,CAAAzG,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.847/dist/workspace.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.847/dist/workspace.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/workspace",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.847",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/workspace/workspace",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.workspace",
|
|
8
8
|
"name": "workspace",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.847"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -105,23 +105,23 @@
|
|
|
105
105
|
"@teambit/scopes.scope-id": "0.0.9",
|
|
106
106
|
"@teambit/workspace.ui.empty-workspace": "0.0.509",
|
|
107
107
|
"@teambit/workspace.ui.workspace-component-card": "0.0.565",
|
|
108
|
-
"@teambit/component": "1.0.
|
|
109
|
-
"@teambit/dependency-resolver": "1.0.
|
|
110
|
-
"@teambit/envs": "1.0.
|
|
111
|
-
"@teambit/objects": "0.0.
|
|
112
|
-
"@teambit/scope": "1.0.
|
|
113
|
-
"@teambit/graph": "1.0.
|
|
114
|
-
"@teambit/isolator": "1.0.
|
|
115
|
-
"@teambit/component-tree": "1.0.
|
|
116
|
-
"@teambit/watcher": "1.0.
|
|
117
|
-
"@teambit/aspect-loader": "1.0.
|
|
118
|
-
"@teambit/graphql": "1.0.
|
|
119
|
-
"@teambit/bundler": "1.0.
|
|
120
|
-
"@teambit/ui": "1.0.
|
|
121
|
-
"@teambit/command-bar": "1.0.
|
|
122
|
-
"@teambit/sidebar": "1.0.
|
|
123
|
-
"@teambit/pubsub": "1.0.
|
|
124
|
-
"@teambit/deprecation": "1.0.
|
|
108
|
+
"@teambit/component": "1.0.847",
|
|
109
|
+
"@teambit/dependency-resolver": "1.0.847",
|
|
110
|
+
"@teambit/envs": "1.0.847",
|
|
111
|
+
"@teambit/objects": "0.0.354",
|
|
112
|
+
"@teambit/scope": "1.0.847",
|
|
113
|
+
"@teambit/graph": "1.0.847",
|
|
114
|
+
"@teambit/isolator": "1.0.847",
|
|
115
|
+
"@teambit/component-tree": "1.0.847",
|
|
116
|
+
"@teambit/watcher": "1.0.847",
|
|
117
|
+
"@teambit/aspect-loader": "1.0.847",
|
|
118
|
+
"@teambit/graphql": "1.0.847",
|
|
119
|
+
"@teambit/bundler": "1.0.847",
|
|
120
|
+
"@teambit/ui": "1.0.847",
|
|
121
|
+
"@teambit/command-bar": "1.0.847",
|
|
122
|
+
"@teambit/sidebar": "1.0.847",
|
|
123
|
+
"@teambit/pubsub": "1.0.847",
|
|
124
|
+
"@teambit/deprecation": "1.0.847"
|
|
125
125
|
},
|
|
126
126
|
"devDependencies": {
|
|
127
127
|
"@types/lodash": "4.14.165",
|