@schematics/angular 9.0.0-rc.9 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,12 @@ import {
7
7
  platformBrowserDynamicTesting
8
8
  } from '@angular/platform-browser-dynamic/testing';
9
9
 
10
- declare const require: any;
10
+ declare const require: {
11
+ context(path: string, deep?: boolean, filter?: RegExp): {
12
+ keys(): string[];
13
+ <T>(id: string): T;
14
+ };
15
+ };
11
16
 
12
17
  // First, initialize the Angular testing environment.
13
18
  getTestBed().initTestEnvironment(
@@ -17,7 +17,7 @@ export class <%= classify(name) %><%= classify(type) %> implements OnInit {
17
17
 
18
18
  constructor() { }
19
19
 
20
- ngOnInit() {
20
+ ngOnInit(): void {
21
21
  }
22
22
 
23
23
  }
@@ -1,11 +1,11 @@
1
1
  import { browser, by, element } from 'protractor';
2
2
 
3
3
  export class AppPage {
4
- navigateTo() {
5
- return browser.get(browser.baseUrl) as Promise<any>;
4
+ navigateTo(): Promise<unknown> {
5
+ return browser.get(browser.baseUrl) as Promise<unknown>;
6
6
  }
7
7
 
8
- getTitleText() {
8
+ getTitleText(): Promise<string> {
9
9
  return element(by.css('<%= rootSelector %> .content span')).getText() as Promise<string>;
10
10
  }
11
11
  }
@@ -8,7 +8,12 @@ import {
8
8
  platformBrowserDynamicTesting
9
9
  } from '@angular/platform-browser-dynamic/testing';
10
10
 
11
- declare const require: any;
11
+ declare const require: {
12
+ context(path: string, deep?: boolean, filter?: RegExp): {
13
+ keys(): string[];
14
+ <T>(id: string): T;
15
+ };
16
+ };
12
17
 
13
18
  // First, initialize the Angular testing environment.
14
19
  getTestBed().initTestEnvironment(
package/library/index.js CHANGED
@@ -27,7 +27,7 @@ function updateJsonFile(host, path, callback) {
27
27
  }
28
28
  return host;
29
29
  }
30
- function updateTsConfig(packageName, distRoot) {
30
+ function updateTsConfig(packageName, ...paths) {
31
31
  return (host) => {
32
32
  if (!host.exists('tsconfig.json')) {
33
33
  return host;
@@ -39,7 +39,7 @@ function updateTsConfig(packageName, distRoot) {
39
39
  if (!tsconfig.compilerOptions.paths[packageName]) {
40
40
  tsconfig.compilerOptions.paths[packageName] = [];
41
41
  }
42
- tsconfig.compilerOptions.paths[packageName].push(distRoot);
42
+ tsconfig.compilerOptions.paths[packageName].push(...paths);
43
43
  });
44
44
  };
45
45
  }
@@ -150,6 +150,7 @@ function default_1(options) {
150
150
  const folderName = `${scopeFolder}${core_1.strings.dasherize(options.name)}`;
151
151
  const projectRoot = core_1.join(core_1.normalize(newProjectRoot), folderName);
152
152
  const distRoot = `dist/${folderName}`;
153
+ const pathImportLib = `${distRoot}/${folderName.replace('/', '-')}`;
153
154
  const sourceDir = `${projectRoot}/src/lib`;
154
155
  const templateSource = schematics_1.apply(schematics_1.url('./files'), [
155
156
  schematics_1.applyTemplates({
@@ -170,7 +171,7 @@ function default_1(options) {
170
171
  schematics_1.mergeWith(templateSource),
171
172
  addLibToWorkspaceFile(options, projectRoot, projectName),
172
173
  options.skipPackageJson ? schematics_1.noop() : addDependenciesToPackageJson(),
173
- options.skipTsConfig ? schematics_1.noop() : updateTsConfig(packageName, distRoot),
174
+ options.skipTsConfig ? schematics_1.noop() : updateTsConfig(packageName, pathImportLib, distRoot),
174
175
  schematics_1.schematic('module', {
175
176
  name: options.name,
176
177
  commonModule: false,
@@ -83,13 +83,14 @@ function updateTsConfig(tree, builderConfig, builderName, logger) {
83
83
  const files = json_utils_1.findPropertyInAstObject(tsConfigAst, 'files');
84
84
  if (!files) {
85
85
  const newFiles = [];
86
+ const tsConfigDir = path_1.dirname(utils_1.forwardSlashPath(tsConfigPath));
86
87
  const mainOption = json_utils_1.findPropertyInAstObject(option, 'main');
87
88
  if (mainOption && mainOption.kind === 'string') {
88
- newFiles.push(path_1.posix.relative(path_1.posix.dirname(tsConfigPath), mainOption.value));
89
+ newFiles.push(utils_1.forwardSlashPath(path_1.relative(tsConfigDir, utils_1.forwardSlashPath(mainOption.value))));
89
90
  }
90
91
  const polyfillsOption = json_utils_1.findPropertyInAstObject(option, 'polyfills');
91
92
  if (polyfillsOption && polyfillsOption.kind === 'string') {
92
- newFiles.push(path_1.posix.relative(path_1.posix.dirname(tsConfigPath), polyfillsOption.value));
93
+ newFiles.push(utils_1.forwardSlashPath(path_1.relative(tsConfigDir, utils_1.forwardSlashPath(polyfillsOption.value))));
93
94
  }
94
95
  if (newFiles.length) {
95
96
  recorder = tree.beginUpdate(tsConfigPath);
@@ -19,3 +19,4 @@ export declare function getAllOptions(builderConfig: JsonAstObject, configuratio
19
19
  export declare function getWorkspace(host: Tree): JsonAstObject;
20
20
  export declare function readJsonFileAsAstObject(host: Tree, path: string): JsonAstObject | undefined;
21
21
  export declare function isIvyEnabled(tree: Tree, tsConfigPath: string): boolean;
22
+ export declare function forwardSlashPath(path: string): string;
@@ -113,3 +113,9 @@ function isIvyEnabled(tree, tsConfigPath) {
113
113
  return true;
114
114
  }
115
115
  exports.isIvyEnabled = isIvyEnabled;
116
+ // TS represents paths internally with '/' and expects paths to be in this format.
117
+ // angular.json expects paths with '/', but doesn't enforce them.
118
+ function forwardSlashPath(path) {
119
+ return path.replace(/\\/g, '/');
120
+ }
121
+ exports.forwardSlashPath = forwardSlashPath;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schematics/angular",
3
- "version": "9.0.0-rc.9",
3
+ "version": "9.0.0",
4
4
  "description": "Schematics specific to Angular",
5
5
  "keywords": [
6
6
  "angular",
@@ -14,8 +14,8 @@
14
14
  ],
15
15
  "schematics": "./collection.json",
16
16
  "dependencies": {
17
- "@angular-devkit/core": "9.0.0-rc.9",
18
- "@angular-devkit/schematics": "9.0.0-rc.9"
17
+ "@angular-devkit/core": "9.0.0",
18
+ "@angular-devkit/schematics": "9.0.0"
19
19
  },
20
20
  "repository": {
21
21
  "type": "git",
@@ -5,7 +5,7 @@ import { Pipe, PipeTransform } from '@angular/core';
5
5
  })
6
6
  export class <%= classify(name) %>Pipe implements PipeTransform {
7
7
 
8
- transform(value: any, ...args: any[]): any {
8
+ transform(value: unknown, ...args: unknown[]): unknown {
9
9
  return null;
10
10
  }
11
11
 
@@ -9,14 +9,14 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.latestVersions = {
11
11
  // These versions should be kept up to date with latest Angular peer dependencies.
12
- Angular: '~9.0.0-rc.9',
13
- RxJs: '~6.5.3',
12
+ Angular: '~9.0.0',
13
+ RxJs: '~6.5.4',
14
14
  ZoneJs: '~0.10.2',
15
- TypeScript: '~3.6.4',
15
+ TypeScript: '~3.7.5',
16
16
  TsLib: '^1.10.0',
17
17
  // The versions below must be manually updated when making a new devkit release.
18
- DevkitBuildAngular: '~0.900.0-rc.9',
19
- DevkitBuildNgPackagr: '~0.900.0-rc.9',
20
- DevkitBuildWebpack: '~0.900.0-rc.9',
21
- ngPackagr: '^9.0.0-rc.7',
18
+ DevkitBuildAngular: '~0.900.0',
19
+ DevkitBuildNgPackagr: '~0.900.0',
20
+ DevkitBuildWebpack: '~0.900.0',
21
+ ngPackagr: '^9.0.0',
22
22
  };
@@ -38,7 +38,7 @@
38
38
  "karma-coverage-istanbul-reporter": "~2.1.0",
39
39
  "karma-jasmine": "~2.0.1",
40
40
  "karma-jasmine-html-reporter": "^1.4.2",
41
- "protractor": "~5.4.2",<% } %>
41
+ "protractor": "~5.4.3",<% } %>
42
42
  "ts-node": "~8.3.0",
43
43
  "tslint": "~5.18.0",
44
44
  "typescript": "<%= latestVersions.TypeScript %>"
@@ -2,7 +2,7 @@
2
2
  "compileOnSave": false,
3
3
  "compilerOptions": {
4
4
  "baseUrl": "./",
5
- "outDir": "./dist",<% if (strict) { %>
5
+ "outDir": "./dist/out-tsc",<% if (strict) { %>
6
6
  "noImplicitAny": true,
7
7
  "noImplicitReturns": true,
8
8
  "noImplicitThis": true,