Skip to content
This repository was archived by the owner on Nov 12, 2024. It is now read-only.

Commit b588c31

Browse files
authored
Assume ES module (#131)
* assume es module even if it does not provide symbol * 0.6.1-prerelease.0
1 parent 7015c58 commit b588c31

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

libs/imports-orchestrator/src/lib/resolve/import-ng-module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export function importNgModule(
3434
}
3535

3636

37-
3837
const ngModuleRef = createNgModule(ngModuleConstructor, item.injector);
3938

4039
const componentConstructors = (

libs/imports-orchestrator/src/lib/resolve/util/resolve-constructor.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ import { ESModule, isESModule } from './module';
33

44
export type Constructor = Type<unknown>;
55

6+
export function isAssumedESModuleContainingAngularComponentsOrModules(type: any) {
7+
return typeof type === 'object' && Object.keys(type).some(key => key.includes('Module') || key.includes('Component'));
8+
}
9+
610
export function resolveConstructorsFromESModule(
711
esm: ESModule | Constructor
812
): Constructor[] {
9-
if (isESModule(esm)) {
13+
if (isESModule(esm) || isAssumedESModuleContainingAngularComponentsOrModules(esm)) {
1014
const constructors = Object.values<Constructor>(
1115
esm as unknown as { [index: string]: Constructor }
1216
).filter((v) => typeof v === 'function');
@@ -20,3 +24,4 @@ export function resolveConstructorsFromESModule(
2024

2125
return [esm];
2226
}
27+

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"prepare": "husky install",
8383
"prepare-imports-orchestrator-example": "nx run imports-orchestrator-example:prepare"
8484
},
85-
"version": "0.6.0",
85+
"version": "0.6.1-prerelease.0",
8686
"volta": {
8787
"node": "20.15.0",
8888
"yarn": "1.22.21"

0 commit comments

Comments
 (0)