Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: angular/angular-cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v9.1.5
Choose a base ref
...
head repository: angular/angular-cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v9.1.6
Choose a head ref
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on May 12, 2020

  1. fix(@ngtools/webpack): getCanonicalFileName should return FS compatib…

    …le paths
    
    Unlike TSC which has it's own mechanism the resolve and join paths in POSIX format, NGTSC heavily relies onNode.JS `fs` and `path` modules. This prevents `Path` usage because in Windows `path.resolve` will causes an absolute path to be resolved or joined incorrectly.  Example:  `/D/MyPath/MyProject` -> `D:/d/mypath/myproject`.
    
    With this change we change the `getCanonicalFileName` method to return FS compatible paths.
    
    (cherry picked from commit e8e832e)
    alan-agius4 authored and clydin committed May 12, 2020
    Copy the full SHA
    0b64bee View commit details

Commits on May 13, 2020

  1. release: v9.1.6

    Keen Yee Liau committed May 13, 2020
    Copy the full SHA
    27907dd View commit details
Showing with 9 additions and 7 deletions.
  1. +1 −1 packages/ngtools/webpack/src/compiler_host.ts
  2. +4 −2 packages/ngtools/webpack/src/utils.ts
  3. +4 −4 packages/schematics/angular/utility/latest-versions.ts
2 changes: 1 addition & 1 deletion packages/ngtools/webpack/src/compiler_host.ts
Original file line number Diff line number Diff line change
@@ -359,7 +359,7 @@ export class WebpackCompilerHost implements ts.CompilerHost {
}

getCanonicalFileName(fileName: string): string {
const path = this.resolve(fileName);
const path = workaroundResolve(this.resolve(fileName));

return this.useCaseSensitiveFileNames() ? path : path.toLowerCase();
}
6 changes: 4 additions & 2 deletions packages/ngtools/webpack/src/utils.ts
Original file line number Diff line number Diff line change
@@ -9,9 +9,11 @@ import { Path, getSystemPath, normalize } from '@angular-devkit/core';

// `TsCompilerAotCompilerTypeCheckHostAdapter` in @angular/compiler-cli seems to resolve module
// names directly via `resolveModuleName`, which prevents full Path usage.
// NSTSC also uses Node.JS `path.resolve` which will result in incorrect paths in Windows
// Example: `/D/MyPath/MyProject` -> `D:/d/mypath/myproject`
// To work around this we must provide the same path format as TS internally uses in
// the SourceFile paths.
export function workaroundResolve(path: Path | string) {
export function workaroundResolve(path: Path | string): string {
return forwardSlashPath(getSystemPath(normalize(path)));
}

@@ -20,6 +22,6 @@ export function flattenArray<T>(value: Array<T | T[]>): T[] {
}

// TS represents paths internally with '/' and expects paths to be in this format.
export function forwardSlashPath(path: string) {
export function forwardSlashPath(path: string): string {
return path.replace(/\\/g, '/');
}
8 changes: 4 additions & 4 deletions packages/schematics/angular/utility/latest-versions.ts
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@

export const latestVersions = {
// These versions should be kept up to date with latest Angular peer dependencies.
Angular: '~9.1.6',
Angular: '~9.1.7',
RxJs: '~6.5.4',
ZoneJs: '~0.10.2',
TypeScript: '~3.8.3',
@@ -18,9 +18,9 @@ export const latestVersions = {
// For our e2e tests, these versions must match the latest tag present on the branch.
// During RC periods they will not match the latest RC until there's a new git tag, and
// should not be updated.
DevkitBuildAngular: '~0.901.5',
DevkitBuildNgPackagr: '~0.901.5',
DevkitBuildWebpack: '~0.901.5',
DevkitBuildAngular: '~0.901.6',
DevkitBuildNgPackagr: '~0.901.6',
DevkitBuildWebpack: '~0.901.6',

ngPackagr: '^9.0.0',
};