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

@ -21,9 +21,9 @@ export function makeTestEntryPoint(
entryPointName: string, packageName: string = entryPointName, config?: TestConfig): EntryPoint {
return {
name: entryPointName,
packageJson: {name: entryPointName},
package: absoluteFrom(`/node_modules/${packageName}`),
path: absoluteFrom(`/node_modules/${entryPointName}`),
packagePath: absoluteFrom(`/node_modules/${packageName}`),
packageJson: {name: entryPointName},
typings: absoluteFrom(`/node_modules/${entryPointName}/index.d.ts`),
compiledByAngular: true,
ignoreMissingDependencies: false,
@ -43,8 +43,9 @@ export function makeTestEntryPointBundle(
enableI18nLegacyMessageIdFormat = false): EntryPointBundle {
const entryPoint = makeTestEntryPoint(packageName, packageName, config);
const src = makeTestBundleProgram(srcRootNames[0], isCore);
const dts =
dtsRootNames ? makeTestDtsBundleProgram(dtsRootNames[0], entryPoint.package, isCore) : null;
const dts = dtsRootNames ?
makeTestDtsBundleProgram(dtsRootNames[0], entryPoint.packagePath, isCore) :
null;
const isFlatCore = isCore && src.r3SymbolsFile === null;
return {
entryPoint,