@angular-devkit/schematics 15.0.0-next.3 → 15.0.0-next.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-devkit/schematics",
3
- "version": "15.0.0-next.3",
3
+ "version": "15.0.0-next.4",
4
4
  "description": "Angular Schematics - Library",
5
5
  "main": "src/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -18,9 +18,9 @@
18
18
  "schematics"
19
19
  ],
20
20
  "dependencies": {
21
- "@angular-devkit/core": "15.0.0-next.3",
21
+ "@angular-devkit/core": "15.0.0-next.4",
22
22
  "jsonc-parser": "3.2.0",
23
- "magic-string": "0.26.4",
23
+ "magic-string": "0.26.5",
24
24
  "ora": "5.4.1",
25
25
  "rxjs": "6.6.7"
26
26
  },
@@ -29,7 +29,7 @@
29
29
  "url": "https://github.com/angular/angular-cli.git"
30
30
  },
31
31
  "engines": {
32
- "node": "^14.15.0 || >=16.10.0",
32
+ "node": "^14.20.0 || >=16.10.0",
33
33
  "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
34
34
  "yarn": ">= 1.13.0"
35
35
  },
package/src/rules/call.js CHANGED
@@ -86,7 +86,7 @@ async function callRuleAsync(rule, tree, context) {
86
86
  if ((0, rxjs_1.isObservable)(result)) {
87
87
  result = await result.pipe((0, operators_1.defaultIfEmpty)(tree)).toPromise();
88
88
  }
89
- if (interface_1.TreeSymbol in result) {
89
+ if (result && interface_1.TreeSymbol in result) {
90
90
  return result;
91
91
  }
92
92
  throw new InvalidRuleResultException(result);
@@ -11,7 +11,6 @@ exports.applyTemplates = exports.template = exports.renameTemplateFiles = export
11
11
  const core_1 = require("@angular-devkit/core");
12
12
  const util_1 = require("util");
13
13
  const base_1 = require("./base");
14
- const rename_1 = require("./rename");
15
14
  exports.TEMPLATE_FILENAME_RE = /\.template$/;
16
15
  class OptionIsNotDefinedException extends core_1.BaseException {
17
16
  constructor(name) {
@@ -122,7 +121,17 @@ exports.pathTemplate = pathTemplate;
122
121
  * Remove every `.template` suffix from file names.
123
122
  */
124
123
  function renameTemplateFiles() {
125
- return (0, rename_1.rename)((path) => !!path.match(exports.TEMPLATE_FILENAME_RE), (path) => path.replace(exports.TEMPLATE_FILENAME_RE, ''));
124
+ return (0, base_1.forEach)((entry) => {
125
+ if (entry.path.match(exports.TEMPLATE_FILENAME_RE)) {
126
+ return {
127
+ content: entry.content,
128
+ path: (0, core_1.normalize)(entry.path.replace(exports.TEMPLATE_FILENAME_RE, '')),
129
+ };
130
+ }
131
+ else {
132
+ return entry;
133
+ }
134
+ });
126
135
  }
127
136
  exports.renameTemplateFiles = renameTemplateFiles;
128
137
  function template(options) {
@@ -1,10 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- import { Rule } from '../engine/interface';
9
- import { FilePredicate } from '../tree/interface';
10
- export declare function rename(match: FilePredicate<boolean>, to: FilePredicate<string>): Rule;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.rename = void 0;
11
- const core_1 = require("@angular-devkit/core");
12
- const base_1 = require("./base");
13
- function rename(match, to) {
14
- return (0, base_1.forEach)((entry) => {
15
- if (match(entry.path, entry)) {
16
- return {
17
- content: entry.content,
18
- path: (0, core_1.normalize)(to(entry.path, entry)),
19
- };
20
- }
21
- else {
22
- return entry;
23
- }
24
- });
25
- }
26
- exports.rename = rename;