Closed njourdain closed 1 year ago
Can you provide some more info about what error or warning you are seeing, and how you produce it?
In my example, I have a class that extends ComponentContext. The constructor adds provider like this :
super(
componentType,
extendMetadata(moduleMetadata, {
providers: [
MockBlobService,
{ provide: BlobService, useExisting: MockBlobService },
],
}),
);
Which requires the following import
// eslint-disable-next-line no-restricted-imports -- test
import { extendMetadata } from '@s-libs/ng-dev/lib/angular-context/angular-context';
And building this code generates the following error :
Error: Module not found: Error: Package path ./lib/angular-context/angular-context is not exported from package /Users/nicolasjourdain/Documents/Repositories/Sama/clone/workspace-core/node_modules/@s-libs/ng-dev (see exports field in /Users/nicolasjourdain/Documents/Repositories/Sama/clone/workspace-core/node_modules/@s-libs/ng-dev/package.json)
Ah I see. That function is intended for internal use within the library. It even has a special case just for ComponentContext
. If you want similar functionality, I recommend creating your own similar function (probably without the special case).
I don't see any reason why this function should be restricted.