@teambit/workspace 1.0.1226 → 1.0.1228
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.
- package/dist/{preview-1792014337133.js → preview-1792080191119.js} +2 -2
- package/dist/workspace-aspects-loader.d.ts +9 -0
- package/dist/workspace-aspects-loader.js +48 -3
- package/dist/workspace-aspects-loader.js.map +1 -1
- package/dist/workspace-component/workspace-component-loader.js +27 -9
- package/dist/workspace-component/workspace-component-loader.js.map +1 -1
- package/package.json +16 -14
- package/workspace-component/workspace-component-loader.ts +20 -7
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/workspace",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1228",
|
|
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.1228"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.18.1",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"pluralize": "8.0.0",
|
|
30
30
|
"reset-css": "5.0.1",
|
|
31
31
|
"@teambit/component-id": "1.2.5",
|
|
32
|
-
"@teambit/component": "1.0.
|
|
33
|
-
"@teambit/dependency-resolver": "1.0.
|
|
34
|
-
"@teambit/envs": "1.0.
|
|
32
|
+
"@teambit/component": "1.0.1223",
|
|
33
|
+
"@teambit/dependency-resolver": "1.0.1223",
|
|
34
|
+
"@teambit/envs": "1.0.1223",
|
|
35
35
|
"@teambit/harmony": "0.4.12",
|
|
36
36
|
"@teambit/legacy.extension-data": "0.0.185",
|
|
37
37
|
"@teambit/legacy.scope": "0.0.183",
|
|
@@ -50,18 +50,20 @@
|
|
|
50
50
|
"@teambit/cli": "0.0.1414",
|
|
51
51
|
"@teambit/config-store": "0.0.295",
|
|
52
52
|
"@teambit/legacy.constants": "0.0.49",
|
|
53
|
-
"@teambit/component-tree": "1.0.
|
|
53
|
+
"@teambit/component-tree": "1.0.1223",
|
|
54
54
|
"@teambit/component.ui.component-status-resolver": "0.0.510",
|
|
55
55
|
"@teambit/harmony.modules.load-trace": "0.0.17",
|
|
56
56
|
"@teambit/harmony.modules.resolved-component": "0.0.530",
|
|
57
57
|
"@teambit/legacy.utils": "0.0.56",
|
|
58
58
|
"@teambit/scope.remotes": "0.0.183",
|
|
59
|
-
"@teambit/aspect-loader": "1.0.
|
|
59
|
+
"@teambit/aspect-loader": "1.0.1223",
|
|
60
|
+
"@teambit/component-package-version": "0.0.466",
|
|
60
61
|
"@teambit/config": "0.0.1589",
|
|
61
62
|
"@teambit/harmony.modules.requireable-component": "0.0.530",
|
|
62
63
|
"@teambit/harmony.modules.runtimes": "0.0.4",
|
|
63
64
|
"@teambit/toolbox.modules.module-resolver": "0.0.29",
|
|
64
65
|
"@teambit/workspace.modules.node-modules-linker": "0.0.416",
|
|
66
|
+
"@teambit/workspace.root-components": "1.0.1",
|
|
65
67
|
"@teambit/graphql": "1.0.1206",
|
|
66
68
|
"@teambit/global-config": "0.0.1418",
|
|
67
69
|
"@teambit/legacy.consumer-config": "0.0.183",
|
|
@@ -86,7 +88,7 @@
|
|
|
86
88
|
"@teambit/component.ui.component-filters.env-filter": "0.0.296",
|
|
87
89
|
"@teambit/component.ui.component-filters.show-main-filter": "0.0.243",
|
|
88
90
|
"@teambit/design.ui.surfaces.menu.link-item": "1.0.13",
|
|
89
|
-
"@teambit/sidebar": "1.0.
|
|
91
|
+
"@teambit/sidebar": "1.0.1223",
|
|
90
92
|
"@teambit/ui-foundation.ui.main-dropdown": "0.0.505",
|
|
91
93
|
"@teambit/ui-foundation.ui.menu": "0.0.503",
|
|
92
94
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.533",
|
|
@@ -111,12 +113,12 @@
|
|
|
111
113
|
"@teambit/workspace.hooks.use-url-change-broadcaster": "0.0.7",
|
|
112
114
|
"@teambit/workspace.ui.preserve-workspace-mode": "0.0.8",
|
|
113
115
|
"@teambit/evangelist.elements.icon": "1.0.5",
|
|
114
|
-
"@teambit/scope": "1.0.
|
|
115
|
-
"@teambit/graph": "1.0.
|
|
116
|
-
"@teambit/isolator": "1.0.
|
|
117
|
-
"@teambit/bundler": "1.0.
|
|
118
|
-
"@teambit/ui": "1.0.
|
|
119
|
-
"@teambit/command-bar": "1.0.
|
|
116
|
+
"@teambit/scope": "1.0.1228",
|
|
117
|
+
"@teambit/graph": "1.0.1228",
|
|
118
|
+
"@teambit/isolator": "1.0.1228",
|
|
119
|
+
"@teambit/bundler": "1.0.1228",
|
|
120
|
+
"@teambit/ui": "1.0.1228",
|
|
121
|
+
"@teambit/command-bar": "1.0.1228"
|
|
120
122
|
},
|
|
121
123
|
"devDependencies": {
|
|
122
124
|
"@types/lodash": "4.14.165",
|
|
@@ -574,20 +574,33 @@ export class WorkspaceComponentLoader {
|
|
|
574
574
|
});
|
|
575
575
|
if (!aspectIds.length) return;
|
|
576
576
|
|
|
577
|
+
const loadAsAspects = (ids: string[]) =>
|
|
578
|
+
this.workspace.loadAspects(ids, true, 'self loading aspects', { useScopeAspectsCapsule: true });
|
|
577
579
|
try {
|
|
578
|
-
await
|
|
580
|
+
await loadAsAspects(aspectIds);
|
|
579
581
|
} catch (err: any) {
|
|
580
582
|
this.logger.warn(`failed loading components as aspects for components ${aspectIds.join(', ')}`, err);
|
|
583
|
+
// one failing aspect fails the entire batch. load them one by one, so the aspects that are fine get loaded,
|
|
584
|
+
// and only the failing ones (and the components using them) are reported.
|
|
585
|
+
const failures: Array<{ aspectId: string; errMsg: string }> = [];
|
|
586
|
+
await mapSeries(aspectIds, async (aspectId) => {
|
|
587
|
+
let singleErr: any;
|
|
588
|
+
await loadAsAspects([aspectId]).catch((loadErr) => {
|
|
589
|
+
singleErr = loadErr;
|
|
590
|
+
});
|
|
591
|
+
// a load that doesn't throw is not enough. the loader hides errors it already reported in the batch.
|
|
592
|
+
if (!this.aspectLoader.hasAspectInstance(aspectId)) {
|
|
593
|
+
const failure = singleErr || err;
|
|
594
|
+
failures.push({ aspectId, errMsg: failure.message || String(failure) });
|
|
595
|
+
}
|
|
596
|
+
});
|
|
581
597
|
// the error is not thrown (best-effort loading), but it's surfaced as a component issue
|
|
582
598
|
// so it shows up in "bit status" instead of disappearing.
|
|
583
599
|
if (!this.workspace.inInstallContext) {
|
|
584
|
-
|
|
585
|
-
aspectIds.forEach((aspectId) => {
|
|
600
|
+
failures.forEach(({ aspectId, errMsg }) => {
|
|
586
601
|
reportLoadFailure({ failedId: aspectId, phase: 'load-comps-as-aspects', error: errMsg });
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
if (!aspectIds.includes(component.id.toString())) return;
|
|
590
|
-
this.addLoadFailureIssue(component, component.id.toString(), 'load-comps-as-aspects', errMsg);
|
|
602
|
+
const component = components.find((comp) => comp.id.toString() === aspectId);
|
|
603
|
+
if (component) this.addLoadFailureIssue(component, aspectId, 'load-comps-as-aspects', errMsg);
|
|
591
604
|
});
|
|
592
605
|
}
|
|
593
606
|
}
|