@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.
- package/application/files/src/test.ts.template +6 -1
- package/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.ts.template +1 -1
- package/e2e/files/src/app.po.ts.template +3 -3
- package/library/files/src/test.ts.template +6 -1
- package/library/index.js +4 -3
- package/migrations/update-9/update-app-tsconfigs.js +3 -2
- package/migrations/update-9/utils.d.ts +1 -0
- package/migrations/update-9/utils.js +6 -0
- package/package.json +3 -3
- package/pipe/files/__name@dasherize@if-flat__/__name@dasherize__.pipe.ts.template +1 -1
- package/utility/latest-versions.js +7 -7
- package/workspace/files/package.json.template +1 -1
- package/workspace/files/tsconfig.json.template +1 -1
|
@@ -7,7 +7,12 @@ import {
|
|
|
7
7
|
platformBrowserDynamicTesting
|
|
8
8
|
} from '@angular/platform-browser-dynamic/testing';
|
|
9
9
|
|
|
10
|
-
declare const require:
|
|
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(
|
|
@@ -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<
|
|
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:
|
|
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,
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
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
|
|
18
|
-
"@angular-devkit/schematics": "9.0.0
|
|
17
|
+
"@angular-devkit/core": "9.0.0",
|
|
18
|
+
"@angular-devkit/schematics": "9.0.0"
|
|
19
19
|
},
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
@@ -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
|
|
13
|
-
RxJs: '~6.5.
|
|
12
|
+
Angular: '~9.0.0',
|
|
13
|
+
RxJs: '~6.5.4',
|
|
14
14
|
ZoneJs: '~0.10.2',
|
|
15
|
-
TypeScript: '~3.
|
|
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
|
|
19
|
-
DevkitBuildNgPackagr: '~0.900.0
|
|
20
|
-
DevkitBuildWebpack: '~0.900.0
|
|
21
|
-
ngPackagr: '^9.0.0
|
|
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.
|
|
41
|
+
"protractor": "~5.4.3",<% } %>
|
|
42
42
|
"ts-node": "~8.3.0",
|
|
43
43
|
"tslint": "~5.18.0",
|
|
44
44
|
"typescript": "<%= latestVersions.TypeScript %>"
|