nx-examples icon indicating copy to clipboard operation
nx-examples copied to clipboard

added basic reproduction for 'enforce-module-boundaries' es-lint rule…

Open morrisjdev opened this issue 3 years ago • 2 comments

… error in angular secondary entrypoints library

Basic steps for reproduction:

  1. Generate angular library (Note that it has to generate a package.json and allow secondary entrypoints) nx generate @nrwl/angular:library --name=example-lib --importPath=@example/lib --publishable

  2. Generate two secondary entrypoints for library (models/abstract and models/implementations) nx generate @nrwl/angular:library-secondary-entry-point --name=models/abstract --library=example-lib --skipModule nx generate @nrwl/angular:library-secondary-entry-point --name=models/implementations --library=example-lib --skipModule

  3. Create some exported file in first entrypoint. Example example-model.ts:

export interface ExampleModel {
  someField: string;
}
  1. Use exported file in second entrypoint:
import {ExampleModel as IExampleModel} from '@example/lib/models/abstract';

export class ExampleModel implements IExampleModel {
  someField!: string;
}
  1. Second file in secondary entrypoint should get a linting error

morrisjdev avatar Dec 08 '21 16:12 morrisjdev

✔️ Deploy Preview for nrwl-nx-examples-dep-graph ready!

🔨 Explore the source changes: f307124355bf4e25f2357dcab14defcfa5713443

🔍 Inspect the deploy log: https://app.netlify.com/sites/nrwl-nx-examples-dep-graph/deploys/61e56ec790587000076dc6e5

😎 Browse the preview: https://deploy-preview-179--nrwl-nx-examples-dep-graph.netlify.app

netlify[bot] avatar Dec 08 '21 16:12 netlify[bot]