diff --git a/libs/imports-orchestrator/src/lib/resolve/import-ng-module.ts b/libs/imports-orchestrator/src/lib/resolve/import-ng-module.ts index fa6c48d..2b54a23 100644 --- a/libs/imports-orchestrator/src/lib/resolve/import-ng-module.ts +++ b/libs/imports-orchestrator/src/lib/resolve/import-ng-module.ts @@ -34,7 +34,6 @@ export function importNgModule( } - const ngModuleRef = createNgModule(ngModuleConstructor, item.injector); const componentConstructors = ( diff --git a/libs/imports-orchestrator/src/lib/resolve/util/resolve-constructor.ts b/libs/imports-orchestrator/src/lib/resolve/util/resolve-constructor.ts index cf6f751..67dcf76 100644 --- a/libs/imports-orchestrator/src/lib/resolve/util/resolve-constructor.ts +++ b/libs/imports-orchestrator/src/lib/resolve/util/resolve-constructor.ts @@ -3,10 +3,14 @@ import { ESModule, isESModule } from './module'; export type Constructor = Type; +export function isAssumedESModuleContainingAngularComponentsOrModules(type: any) { + return typeof type === 'object' && Object.keys(type).some(key => key.includes('Module') || key.includes('Component')); +} + export function resolveConstructorsFromESModule( esm: ESModule | Constructor ): Constructor[] { - if (isESModule(esm)) { + if (isESModule(esm) || isAssumedESModuleContainingAngularComponentsOrModules(esm)) { const constructors = Object.values( esm as unknown as { [index: string]: Constructor } ).filter((v) => typeof v === 'function'); @@ -20,3 +24,4 @@ export function resolveConstructorsFromESModule( return [esm]; } + diff --git a/package-lock.json b/package-lock.json index d9b4f99..49364bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "lotto24-angular", - "version": "0.6.0", + "version": "0.6.1-prerelease.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "lotto24-angular", - "version": "0.6.0", + "version": "0.6.1-prerelease.0", "license": "MIT", "devDependencies": { "@angular-devkit/build-angular": "18.0.7", diff --git a/package.json b/package.json index 3cbb81d..b0e2c26 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "prepare": "husky install", "prepare-imports-orchestrator-example": "nx run imports-orchestrator-example:prepare" }, - "version": "0.6.0", + "version": "0.6.1-prerelease.0", "volta": { "node": "20.15.0", "yarn": "1.22.21"