Skip to content

Commit ee8657f

Browse files
committed
fix: warn instead of throw when cannot find component
1 parent c4f4ad9 commit ee8657f

File tree

25 files changed

+106
-102
lines changed

25 files changed

+106
-102
lines changed

.bitmap

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,42 @@
1212
"angular-env": {
1313
"name": "angular-env",
1414
"scope": "bitdev.angular",
15-
"version": "6.0.11",
15+
"version": "6.0.13",
1616
"mainFile": "index.ts",
1717
"rootDir": "angular/envs/angular-env"
1818
},
1919
"app-types/angular-app-type": {
2020
"name": "app-types/angular-app-type",
2121
"scope": "bitdev.angular",
22-
"version": "6.0.9",
22+
"version": "6.0.11",
2323
"mainFile": "index.ts",
2424
"rootDir": "angular/app-types/angular-app-type"
2525
},
2626
"dev-services/common": {
2727
"name": "dev-services/common",
2828
"scope": "bitdev.angular",
29-
"version": "6.0.6",
29+
"version": "6.0.8",
3030
"mainFile": "index.ts",
3131
"rootDir": "angular/devkit/common"
3232
},
3333
"dev-services/compiler/elements": {
3434
"name": "dev-services/compiler/elements",
3535
"scope": "bitdev.angular",
36-
"version": "6.0.6",
36+
"version": "6.0.8",
3737
"mainFile": "index.ts",
3838
"rootDir": "angular/devkit/compiler/elements"
3939
},
4040
"dev-services/compiler/multi-compiler": {
4141
"name": "dev-services/compiler/multi-compiler",
4242
"scope": "bitdev.angular",
43-
"version": "6.0.7",
43+
"version": "6.0.9",
4444
"mainFile": "index.ts",
4545
"rootDir": "angular/devkit/compiler/multi-compiler"
4646
},
4747
"dev-services/compiler/ng-packagr": {
4848
"name": "dev-services/compiler/ng-packagr",
4949
"scope": "bitdev.angular",
50-
"version": "6.0.7",
50+
"version": "6.0.9",
5151
"mainFile": "index.ts",
5252
"rootDir": "angular/devkit/compiler/ng-packagr"
5353
},
@@ -75,7 +75,7 @@
7575
"dev-services/preview/preview": {
7676
"name": "dev-services/preview/preview",
7777
"scope": "bitdev.angular",
78-
"version": "6.0.6",
78+
"version": "6.0.8",
7979
"mainFile": "index.ts",
8080
"rootDir": "angular/devkit/preview/preview"
8181
},
@@ -96,149 +96,163 @@
9696
"dev-services/webpack": {
9797
"name": "dev-services/webpack",
9898
"scope": "bitdev.angular",
99-
"version": "6.0.6",
99+
"version": "6.0.8",
100100
"mainFile": "index.ts",
101101
"rootDir": "angular/devkit/webpack"
102102
},
103103
"envs/angular-v13-env": {
104104
"name": "envs/angular-v13-env",
105105
"scope": "bitdev.angular",
106-
"version": "6.0.11",
106+
"version": "6.0.13",
107107
"mainFile": "index.ts",
108108
"rootDir": "angular/envs/angular-v13-env"
109109
},
110110
"envs/angular-v14-env": {
111111
"name": "envs/angular-v14-env",
112112
"scope": "bitdev.angular",
113-
"version": "6.0.11",
113+
"version": "6.0.13",
114114
"mainFile": "index.ts",
115115
"rootDir": "angular/envs/angular-v14-env"
116116
},
117117
"envs/angular-v15-env": {
118118
"name": "envs/angular-v15-env",
119119
"scope": "bitdev.angular",
120-
"version": "6.0.11",
120+
"version": "6.0.13",
121121
"mainFile": "index.ts",
122122
"rootDir": "angular/envs/angular-v15-env"
123123
},
124124
"envs/angular-v16-env": {
125125
"name": "envs/angular-v16-env",
126126
"scope": "bitdev.angular",
127-
"version": "6.0.11",
127+
"version": "6.0.13",
128128
"mainFile": "index.ts",
129129
"rootDir": "angular/envs/angular-v16-env"
130130
},
131131
"envs/angular-v17-env": {
132132
"name": "envs/angular-v17-env",
133133
"scope": "bitdev.angular",
134-
"version": "5.0.11",
134+
"version": "5.0.13",
135135
"mainFile": "index.ts",
136136
"rootDir": "angular/envs/angular-v17-env"
137137
},
138138
"envs/angular-v18-env": {
139139
"name": "envs/angular-v18-env",
140140
"scope": "bitdev.angular",
141-
"version": "1.0.11",
141+
"version": "1.0.13",
142142
"mainFile": "index.ts",
143143
"rootDir": "angular/envs/angular-v18-env"
144144
},
145145
"envs/base-env": {
146146
"name": "envs/base-env",
147147
"scope": "bitdev.angular",
148-
"version": "6.0.9",
148+
"version": "6.0.11",
149149
"mainFile": "index.ts",
150150
"rootDir": "angular/envs/base-env"
151151
},
152152
"examples/my-angular-env": {
153153
"name": "examples/my-angular-env",
154154
"scope": "bitdev.angular",
155-
"version": "6.0.11",
155+
"version": "6.0.13",
156156
"mainFile": "index.ts",
157157
"rootDir": "angular/examples/my-angular-env"
158158
},
159159
"examples/my-angular-v13-env": {
160160
"name": "examples/my-angular-v13-env",
161161
"scope": "bitdev.angular",
162-
"version": "5.0.11",
162+
"version": "5.0.13",
163163
"mainFile": "index.ts",
164164
"rootDir": "angular/examples/my-angular-v13-env"
165165
},
166166
"examples/my-angular-v14-env": {
167167
"name": "examples/my-angular-v14-env",
168168
"scope": "bitdev.angular",
169-
"version": "6.0.11",
169+
"version": "6.0.13",
170170
"mainFile": "index.ts",
171171
"rootDir": "angular/examples/my-angular-v14-env"
172172
},
173173
"examples/my-angular-v15-env": {
174174
"name": "examples/my-angular-v15-env",
175175
"scope": "bitdev.angular",
176-
"version": "6.0.11",
176+
"version": "6.0.13",
177177
"mainFile": "index.ts",
178178
"rootDir": "angular/examples/my-angular-v15-env"
179179
},
180180
"examples/my-angular-v16-env": {
181181
"name": "examples/my-angular-v16-env",
182182
"scope": "bitdev.angular",
183-
"version": "5.0.11",
183+
"version": "5.0.13",
184184
"mainFile": "index.ts",
185185
"rootDir": "angular/examples/my-angular-v16-env"
186186
},
187187
"examples/my-angular-v17-env": {
188188
"name": "examples/my-angular-v17-env",
189189
"scope": "bitdev.angular",
190-
"version": "5.0.11",
190+
"version": "5.0.13",
191191
"mainFile": "index.ts",
192192
"rootDir": "angular/examples/my-angular-v17-env"
193193
},
194194
"examples/my-angular-v18-env": {
195195
"name": "examples/my-angular-v18-env",
196196
"scope": "bitdev.angular",
197-
"version": "1.0.11",
197+
"version": "1.0.13",
198198
"mainFile": "index.ts",
199199
"rootDir": "angular/examples/my-angular-v18-env"
200200
},
201201
"integration/demo-app": {
202202
"name": "integration/demo-app",
203203
"scope": "bitdev.angular",
204-
"version": "0.0.3",
204+
"version": "0.0.5",
205205
"mainFile": "index.ts",
206206
"rootDir": "angular/integration/demo-app"
207207
},
208208
"integration/demo-lib": {
209209
"name": "integration/demo-lib",
210210
"scope": "bitdev.angular",
211-
"version": "0.0.8",
211+
"version": "0.0.10",
212212
"mainFile": "public-api.ts",
213213
"rootDir": "angular/integration/demo-lib"
214214
},
215215
"integration/demo-lib-v15": {
216216
"name": "integration/demo-lib-v15",
217217
"scope": "bitdev.angular",
218-
"version": "0.0.8",
218+
"version": "0.0.10",
219219
"mainFile": "public-api.ts",
220220
"rootDir": "angular/integration/demo-lib-v15"
221221
},
222222
"integration/demo-lib-v16": {
223223
"name": "integration/demo-lib-v16",
224224
"scope": "bitdev.angular",
225-
"version": "0.0.8",
225+
"version": "0.0.10",
226226
"mainFile": "public-api.ts",
227227
"rootDir": "angular/integration/demo-lib-v16"
228228
},
229229
"integration/demo-lib-v17": {
230230
"name": "integration/demo-lib-v17",
231231
"scope": "bitdev.angular",
232-
"version": "0.0.8",
232+
"version": "0.0.10",
233233
"mainFile": "public-api.ts",
234234
"rootDir": "angular/integration/demo-lib-v17"
235235
},
236236
"integration/demo-lib-v18": {
237237
"name": "integration/demo-lib-v18",
238238
"scope": "bitdev.angular",
239-
"version": "0.0.8",
239+
"version": "0.0.10",
240240
"mainFile": "public-api.ts",
241241
"rootDir": "angular/integration/demo-lib-v18"
242242
},
243+
"templates/generators": {
244+
"name": "templates/generators",
245+
"scope": "bitdev.angular",
246+
"version": "6.0.2",
247+
"mainFile": "index.ts",
248+
"rootDir": "angular/templates/generators"
249+
},
250+
"templates/starters": {
251+
"name": "templates/starters",
252+
"scope": "bitdev.angular",
253+
"version": "6.0.2",
254+
"mainFile": "index.ts",
255+
"rootDir": "angular/templates/starters"
256+
},
243257
"$schema-version": "17.0.0"
244258
}

angular/app-types/angular-app-type/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"componentId": {
33
"scope": "bitdev.angular",
44
"name": "app-types/angular-app-type",
5-
"version": "6.0.9"
5+
"version": "6.0.11"
66
},
77
"propagate": false,
88
"extensions": {

angular/devkit/common/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"componentId": {
33
"scope": "bitdev.angular",
44
"name": "dev-services/common",
5-
"version": "6.0.6"
5+
"version": "6.0.8"
66
},
77
"propagate": false,
88
"extensions": {

angular/devkit/common/utils.ts

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -231,41 +231,43 @@ export async function writeTsconfig(
231231
}
232232

233233
// get the list of files for existing component compositions to include in the compilation
234-
components.forEach((component: Component) => {
234+
// eslint-disable-next-line no-restricted-syntax
235+
for (const component of components) {
235236
// we only want angular components
236237
if (component.config.main === 'public-api.ts') {
237238
let outputPath: string;
238-
239239
const isApp = componentIsApp(component, application);
240-
if (isApp) {
241-
return;
242-
}
243-
if (isBuildContext(context)) {
244-
const capsules = context.capsuleNetwork.graphCapsules;
245-
const capsule = capsules.getCapsule(component.id);
246-
if (!capsule) {
247-
throw new Error(`No capsule found for ${component.id} in network graph`);
240+
if (!isApp) {
241+
if (isBuildContext(context)) {
242+
// eslint-disable-next-line no-await-in-loop
243+
const capsule = context.capsuleNetwork.graphCapsules.getCapsule(component.id);
244+
if (!capsule) {
245+
// eslint-disable-next-line no-console
246+
console.warn(`No capsule found for ${component.id} in the network graph`);
247+
// eslint-disable-next-line no-continue
248+
continue;
249+
}
250+
outputPath = normalizePath(capsule.path);
251+
} else {
252+
outputPath = normalizePath(workspace?.componentDir(component.id, {
253+
ignoreVersion: true
254+
}) || '');
248255
}
249-
outputPath = normalizePath(capsule.path);
250-
} else {
251-
outputPath = normalizePath(workspace?.componentDir(component.id, {
252-
ignoreVersion: true
253-
}) || '');
256+
// map the package names to the workspace component paths for typescript in case a package references another local package
257+
const pkgName = pkg.getPackageName(component);
258+
tsPaths[pkgName] = [`${outputPath}/public-api.ts`];
259+
tsPaths[`${pkgName}/*`] = [`${outputPath}/*`];
260+
261+
includePaths.add(outputPath);
262+
263+
// get the list of spec patterns
264+
const devPatterns: string[] = devFilesMain.getDevPatterns(component, TesterAspect.id);
265+
devPatterns.forEach(specPattern => {
266+
excludePaths.add(posix.join(outputPath, specPattern));
267+
});
254268
}
255-
// map the package names to the workspace component paths for typescript in case a package references another local package
256-
const pkgName = pkg.getPackageName(component);
257-
tsPaths[pkgName] = [`${outputPath}/public-api.ts`];
258-
tsPaths[`${pkgName}/*`] = [`${outputPath}/*`];
259-
260-
includePaths.add(outputPath);
261-
262-
// get the list of spec patterns
263-
const devPatterns: string[] = devFilesMain.getDevPatterns(component, TesterAspect.id);
264-
devPatterns.forEach(specPattern => {
265-
excludePaths.add(posix.join(outputPath, specPattern));
266-
});
267269
}
268-
});
270+
}
269271

270272
const pAppPath = normalizePath(rootPath);
271273
const tsConfigAppPath = tsConfigPath ?? join(rootPath, 'tsconfig.app.json');

angular/devkit/compiler/elements/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"componentId": {
33
"scope": "bitdev.angular",
44
"name": "dev-services/compiler/elements",
5-
"version": "6.0.6"
5+
"version": "6.0.8"
66
},
77
"propagate": false,
88
"extensions": {

angular/devkit/compiler/multi-compiler/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"componentId": {
33
"scope": "bitdev.angular",
44
"name": "dev-services/compiler/multi-compiler",
5-
"version": "6.0.7"
5+
"version": "6.0.9"
66
},
77
"propagate": false,
88
"extensions": {

angular/devkit/compiler/ng-packagr/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"componentId": {
33
"scope": "bitdev.angular",
44
"name": "dev-services/compiler/ng-packagr",
5-
"version": "6.0.7"
5+
"version": "6.0.9"
66
},
77
"propagate": false,
88
"extensions": {

angular/devkit/preview/preview/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"componentId": {
33
"scope": "bitdev.angular",
44
"name": "dev-services/preview/preview",
5-
"version": "6.0.6"
5+
"version": "6.0.8"
66
},
77
"propagate": false,
88
"extensions": {

angular/devkit/webpack/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"componentId": {
33
"scope": "bitdev.angular",
44
"name": "dev-services/webpack",
5-
"version": "6.0.6"
5+
"version": "6.0.8"
66
},
77
"propagate": false,
88
"extensions": {

angular/envs/angular-env/component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"componentId": {
33
"scope": "bitdev.angular",
44
"name": "angular-env",
5-
"version": "6.0.11"
5+
"version": "6.0.13"
66
},
77
"propagate": false,
88
"extensions": {

0 commit comments

Comments
 (0)