refactor(ngcc): rename EntryPoint#package to EntryPoint#packagePath (#37040)

Rename the `package` property to `packagePath` on the `EntryPoint`
interface. This makes it more clear that the `packagePath` property
holds the absolute path to the containing package (similar to how `path`
holds the path to the entry-point). This will also align with the
`packageName` property that will be added in a subsequent commit.

This commit also re-orders the `EntryPoint` properties to group related
properties together and to match the order of properties on instances
with that on the interface.

PR Close #37040
This commit is contained in:
George Kalpakas
2020-06-08 22:04:28 +03:00
committed by Misko Hevery
parent e7a0e87c41
commit 8197557fcf
23 changed files with 89 additions and 85 deletions

View File

@ -60,52 +60,52 @@ runInEachFileSystem(() => {
first = {
name: 'first',
path: _('/first'),
package: _('/first'),
packagePath: _('/first'),
packageJson: {esm5: './index.js'},
typings: _('/first/index.d.ts'),
compiledByAngular: true,
ignoreMissingDependencies: false,
typings: _('/first/index.d.ts'),
} as EntryPoint;
second = {
path: _('/second'),
package: _('/second'),
packagePath: _('/second'),
packageJson: {esm2015: './sub/index.js'},
typings: _('/second/sub/index.d.ts'),
compiledByAngular: true,
ignoreMissingDependencies: false,
typings: _('/second/sub/index.d.ts'),
} as EntryPoint;
third = {
path: _('/third'),
package: _('/third'),
packagePath: _('/third'),
packageJson: {fesm5: './index.js'},
typings: _('/third/index.d.ts'),
compiledByAngular: true,
ignoreMissingDependencies: false,
typings: _('/third/index.d.ts'),
} as EntryPoint;
fourth = {
path: _('/fourth'),
package: _('/fourth'),
packagePath: _('/fourth'),
packageJson: {fesm2015: './sub2/index.js'},
typings: _('/fourth/sub2/index.d.ts'),
compiledByAngular: true,
ignoreMissingDependencies: false,
typings: _('/fourth/sub2/index.d.ts'),
} as EntryPoint;
fifth = {
path: _('/fifth'),
package: _('/fifth'),
packagePath: _('/fifth'),
packageJson: {module: './index.js'},
typings: _('/fifth/index.d.ts'),
compiledByAngular: true,
ignoreMissingDependencies: false,
typings: _('/fifth/index.d.ts'),
} as EntryPoint;
sixthIgnoreMissing = {
path: _('/sixth'),
package: _('/sixth'),
packagePath: _('/sixth'),
packageJson: {module: './index.js'},
typings: _('/sixth/index.d.ts'),
compiledByAngular: true,
ignoreMissingDependencies: true,
typings: _('/sixth/index.d.ts'),
} as EntryPoint;
dependencies = {
@ -291,11 +291,11 @@ runInEachFileSystem(() => {
const testEntryPoint = {
name: 'test-package',
path: _('/project/node_modules/test-package'),
package: _('/project/node_modules/test-package'),
packagePath: _('/project/node_modules/test-package'),
packageJson: {esm5: './index.js'},
typings: _('/project/node_modules/test-package/index.d.ts'),
compiledByAngular: true,
ignoreMissingDependencies: false,
typings: _('/project/node_modules/test-package/index.d.ts'),
} as EntryPoint;
const result = resolver.sortEntryPointsByDependency(