-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support the ng-package.json in secondary entry points (#1406)
* fix: support the ng-package.json in secondary entry points Currently secondary entry points are breaking "no-implicit-dependencies" TSLint rule, because the rule is checking for package.json files, which in secondary entry points are anyway just containing "ngPackage" configuration. Adding the support for ng-package.json removes the need for package.json, thus TSLint will look correctly in parent package.json file and act accordingly. fix 1391 * test: add a missing test for the feature-d integration * docs: document the alternative secondary entry point setup
- Loading branch information
1 parent
88f8cb4
commit 8b97bfa
Showing
5 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { FEATURE_A } from '@sample/secondary/feature-a'; | ||
import { FEATURE_B } from '@sample/secondary/feature-b'; | ||
import { FEATURE_C } from '@sample/secondary/feature-c'; | ||
|
||
export const FEATURE_D = `Feature D: ${FEATURE_A} ${FEATURE_B} ${FEATURE_C}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"$schema": "../../../../src/ng-package.schema.json", | ||
"lib": { | ||
"entryFile": "feature-d.ts" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { expect } from 'chai'; | ||
|
||
describe(`@sample/secondary/feature-d`, () => { | ||
let PACKAGE; | ||
|
||
before(() => { | ||
PACKAGE = require('../dist/feature-d/package.json'); | ||
}); | ||
|
||
it(`should exist`, () => { | ||
expect(PACKAGE).to.be.ok; | ||
}); | ||
|
||
it(`should be named '@sample/secondary/feature-d'`, () => { | ||
expect(PACKAGE['name']).to.equal('@sample/secondary/feature-d'); | ||
}); | ||
|
||
it(`should reference "main" bundle (UMD)`, () => { | ||
expect(PACKAGE['main']).to.equal('../bundles/sample-secondary-feature-d.umd.js'); | ||
}); | ||
|
||
it(`should reference "module" bundle (FESM5)`, () => { | ||
expect(PACKAGE['module']).to.equal('../fesm5/sample-secondary-feature-d.js'); | ||
}); | ||
|
||
it(`should reference "typings" files`, () => { | ||
expect(PACKAGE['typings']).to.equal('sample-secondary-feature-d.d.ts'); | ||
}); | ||
|
||
it(`should reference "metadata" file`, () => { | ||
expect(PACKAGE['metadata']).to.equal('sample-secondary-feature-d.metadata.json'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters