@schematics/angular 17.3.1 → 17.3.3
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.
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
2
|
import { <%= routerImports %> } from '@angular/router';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
4
3
|
|
|
5
4
|
@Injectable({
|
|
6
5
|
providedIn: 'root'
|
|
@@ -8,24 +7,24 @@ import { Observable } from 'rxjs';
|
|
|
8
7
|
export class <%= classify(name) %>Guard implements <%= implementations %> {
|
|
9
8
|
<% if (implements.includes('CanActivate')) { %>canActivate(
|
|
10
9
|
route: ActivatedRouteSnapshot,
|
|
11
|
-
state: RouterStateSnapshot):
|
|
10
|
+
state: RouterStateSnapshot): MaybeAsync<GuardResult> {
|
|
12
11
|
return true;
|
|
13
12
|
}
|
|
14
13
|
<% } %><% if (implements.includes('CanActivateChild')) { %>canActivateChild(
|
|
15
14
|
childRoute: ActivatedRouteSnapshot,
|
|
16
|
-
state: RouterStateSnapshot):
|
|
15
|
+
state: RouterStateSnapshot): MaybeAsync<GuardResult> {
|
|
17
16
|
return true;
|
|
18
17
|
}
|
|
19
18
|
<% } %><% if (implements.includes('CanDeactivate')) { %>canDeactivate(
|
|
20
19
|
component: unknown,
|
|
21
20
|
currentRoute: ActivatedRouteSnapshot,
|
|
22
21
|
currentState: RouterStateSnapshot,
|
|
23
|
-
nextState?: RouterStateSnapshot):
|
|
22
|
+
nextState?: RouterStateSnapshot): MaybeAsync<GuardResult> {
|
|
24
23
|
return true;
|
|
25
24
|
}
|
|
26
25
|
<% } %><% if (implements.includes('CanMatch')) { %>canMatch(
|
|
27
26
|
route: Route,
|
|
28
|
-
segments: UrlSegment[]):
|
|
27
|
+
segments: UrlSegment[]): MaybeAsync<GuardResult> {
|
|
29
28
|
return true;
|
|
30
29
|
}<% } %>
|
|
31
30
|
}
|
package/guard/index.js
CHANGED
|
@@ -26,7 +26,7 @@ function default_1(options) {
|
|
|
26
26
|
.map((implement) => (implement === 'CanDeactivate' ? 'CanDeactivate<unknown>' : implement))
|
|
27
27
|
.join(', ');
|
|
28
28
|
const commonRouterNameImports = ['ActivatedRouteSnapshot', 'RouterStateSnapshot'];
|
|
29
|
-
const routerNamedImports = [...options.implements, '
|
|
29
|
+
const routerNamedImports = [...options.implements, 'MaybeAsync', 'GuardResult'];
|
|
30
30
|
if (options.implements.includes(schema_1.Implement.CanMatch)) {
|
|
31
31
|
routerNamedImports.push('Route', 'UrlSegment');
|
|
32
32
|
if (options.implements.length > 1) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schematics/angular",
|
|
3
|
-
"version": "17.3.
|
|
3
|
+
"version": "17.3.3",
|
|
4
4
|
"description": "Schematics specific to Angular",
|
|
5
5
|
"homepage": "https://github.com/angular/angular-cli",
|
|
6
6
|
"keywords": [
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"schematics": "./collection.json",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@angular-devkit/core": "17.3.
|
|
27
|
-
"@angular-devkit/schematics": "17.3.
|
|
26
|
+
"@angular-devkit/core": "17.3.3",
|
|
27
|
+
"@angular-devkit/schematics": "17.3.3",
|
|
28
28
|
"jsonc-parser": "3.2.1"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.latestVersions = void 0;
|
|
11
|
+
// We could have used TypeScripts' `resolveJsonModule` to make the `latestVersion` object typesafe,
|
|
12
|
+
// but ts_library doesn't support JSON inputs.
|
|
13
|
+
const dependencies = require('./latest-versions/package.json')['dependencies'];
|
|
11
14
|
exports.latestVersions = {
|
|
12
|
-
|
|
13
|
-
// but ts_library doesn't support JSON inputs.
|
|
14
|
-
...require('./latest-versions/package.json')['dependencies'],
|
|
15
|
+
...dependencies,
|
|
15
16
|
// As Angular CLI works with same minor versions of Angular Framework, a tilde match for the current
|
|
16
|
-
Angular: '
|
|
17
|
-
DevkitBuildAngular: '^17.3.
|
|
18
|
-
AngularSSR: '^17.3.
|
|
17
|
+
Angular: dependencies['@angular/core'],
|
|
18
|
+
DevkitBuildAngular: '^17.3.3',
|
|
19
|
+
AngularSSR: '^17.3.3',
|
|
19
20
|
};
|