@angular-devkit/schematics 12.1.0-next.3 → 12.1.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/package.json +4 -4
- package/src/index.js +14 -2
- package/src/sink/host.js +9 -6
- package/tasks/node/index.js +23 -4
- package/tasks/package-manager/executor.js +25 -3
- package/tasks/repo-init/executor.js +20 -1
- package/tasks/tslint-fix/executor.js +22 -3
- package/tasks/tslint-fix/test/custom-rule.js +20 -1
- package/tools/file-system-engine-host.js +21 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/schematics",
|
|
3
|
-
"version": "12.1.0
|
|
3
|
+
"version": "12.1.0",
|
|
4
4
|
"description": "Angular Schematics - Library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"typings": "src/index.d.ts",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"schematics"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@angular-devkit/core": "12.1.0
|
|
22
|
-
"ora": "5.4.
|
|
21
|
+
"@angular-devkit/core": "12.1.0",
|
|
22
|
+
"ora": "5.4.1",
|
|
23
23
|
"rxjs": "6.6.7"
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"url": "https://github.com/angular/angular-cli.git"
|
|
28
28
|
},
|
|
29
29
|
"engines": {
|
|
30
|
-
"node": "^12.14.1 ||
|
|
30
|
+
"node": "^12.14.1 || >=14.0.0",
|
|
31
31
|
"npm": "^6.11.0 || ^7.5.6",
|
|
32
32
|
"yarn": ">= 1.13.0"
|
|
33
33
|
},
|
package/src/index.js
CHANGED
|
@@ -13,16 +13,28 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
if (k2 === undefined) k2 = k;
|
|
14
14
|
o[k2] = m[k];
|
|
15
15
|
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
16
28
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
29
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
30
|
};
|
|
19
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
32
|
exports.Tree = exports.workflow = exports.formats = exports.SchematicsException = void 0;
|
|
21
|
-
const formats = require("./formats/index");
|
|
33
|
+
const formats = __importStar(require("./formats/index"));
|
|
22
34
|
exports.formats = formats;
|
|
23
35
|
const interface_1 = require("./tree/interface");
|
|
24
36
|
const static_1 = require("./tree/static");
|
|
25
|
-
const workflow = require("./workflow/index");
|
|
37
|
+
const workflow = __importStar(require("./workflow/index"));
|
|
26
38
|
exports.workflow = workflow;
|
|
27
39
|
var exception_1 = require("./exception/exception");
|
|
28
40
|
Object.defineProperty(exports, "SchematicsException", { enumerable: true, get: function () { return exception_1.SchematicsException; } });
|
package/src/sink/host.js
CHANGED
|
@@ -29,15 +29,18 @@ class HostSink extends sink_1.SimpleSinkBase {
|
|
|
29
29
|
if (this._filesToCreate.has(p) || this._filesToUpdate.has(p)) {
|
|
30
30
|
return rxjs_1.of(true);
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
if (this._filesToDelete.has(p)) {
|
|
33
33
|
return rxjs_1.of(false);
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
for (const [from, to] of this._filesToRename.values()) {
|
|
36
|
+
switch (p) {
|
|
37
|
+
case from:
|
|
38
|
+
return rxjs_1.of(false);
|
|
39
|
+
case to:
|
|
40
|
+
return rxjs_1.of(true);
|
|
41
|
+
}
|
|
40
42
|
}
|
|
43
|
+
return this._host.exists(p);
|
|
41
44
|
}
|
|
42
45
|
_overwriteFile(path, content) {
|
|
43
46
|
this._filesToUpdate.set(path, new update_buffer_1.UpdateBuffer(content));
|
package/tasks/node/index.js
CHANGED
|
@@ -6,6 +6,25 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
9
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
29
|
exports.BuiltinTaskExecutor = void 0;
|
|
11
30
|
const options_1 = require("../package-manager/options");
|
|
@@ -17,18 +36,18 @@ class BuiltinTaskExecutor {
|
|
|
17
36
|
exports.BuiltinTaskExecutor = BuiltinTaskExecutor;
|
|
18
37
|
BuiltinTaskExecutor.NodePackage = {
|
|
19
38
|
name: options_1.NodePackageName,
|
|
20
|
-
create: (options) => Promise.resolve().then(() => require('../package-manager/executor')).then((mod) => mod.default(options)),
|
|
39
|
+
create: (options) => Promise.resolve().then(() => __importStar(require('../package-manager/executor'))).then((mod) => mod.default(options)),
|
|
21
40
|
};
|
|
22
41
|
BuiltinTaskExecutor.RepositoryInitializer = {
|
|
23
42
|
name: options_2.RepositoryInitializerName,
|
|
24
|
-
create: (options) => Promise.resolve().then(() => require('../repo-init/executor')).then((mod) => mod.default(options)),
|
|
43
|
+
create: (options) => Promise.resolve().then(() => __importStar(require('../repo-init/executor'))).then((mod) => mod.default(options)),
|
|
25
44
|
};
|
|
26
45
|
BuiltinTaskExecutor.RunSchematic = {
|
|
27
46
|
name: options_3.RunSchematicName,
|
|
28
|
-
create: () => Promise.resolve().then(() => require('../run-schematic/executor')).then((mod) => mod.default()),
|
|
47
|
+
create: () => Promise.resolve().then(() => __importStar(require('../run-schematic/executor'))).then((mod) => mod.default()),
|
|
29
48
|
};
|
|
30
49
|
/** @deprecated since version 11. Use `ng lint --fix` directly instead. */
|
|
31
50
|
BuiltinTaskExecutor.TslintFix = {
|
|
32
51
|
name: options_4.TslintFixName,
|
|
33
|
-
create: () => Promise.resolve().then(() => require('../tslint-fix/executor')).then((mod) => mod.default()),
|
|
52
|
+
create: () => Promise.resolve().then(() => __importStar(require('../tslint-fix/executor'))).then((mod) => mod.default()),
|
|
34
53
|
};
|
|
@@ -6,12 +6,34 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
9
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
32
|
exports.UnknownPackageManagerException = void 0;
|
|
11
33
|
const core_1 = require("@angular-devkit/core");
|
|
12
34
|
const child_process_1 = require("child_process");
|
|
13
|
-
const
|
|
14
|
-
const path = require("path");
|
|
35
|
+
const ora_1 = __importDefault(require("ora"));
|
|
36
|
+
const path = __importStar(require("path"));
|
|
15
37
|
const rxjs_1 = require("rxjs");
|
|
16
38
|
const src_1 = require("../../src");
|
|
17
39
|
const packageManagers = {
|
|
@@ -92,7 +114,7 @@ function default_1(factoryOptions = {}) {
|
|
|
92
114
|
}
|
|
93
115
|
return new rxjs_1.Observable((obs) => {
|
|
94
116
|
var _a, _b;
|
|
95
|
-
const spinner =
|
|
117
|
+
const spinner = ora_1.default({
|
|
96
118
|
text: `Installing packages (${taskPackageManagerName})...`,
|
|
97
119
|
// Workaround for https://github.com/sindresorhus/ora/issues/136.
|
|
98
120
|
discardStdin: process.platform != 'win32',
|
|
@@ -6,10 +6,29 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
9
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
29
|
const core_1 = require("@angular-devkit/core");
|
|
11
30
|
const child_process_1 = require("child_process");
|
|
12
|
-
const path = require("path");
|
|
31
|
+
const path = __importStar(require("path"));
|
|
13
32
|
function default_1(factoryOptions = {}) {
|
|
14
33
|
const rootDirectory = factoryOptions.rootDirectory || process.cwd();
|
|
15
34
|
return async (options = {}, context) => {
|
|
@@ -6,9 +6,28 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
9
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
const fs = require("fs");
|
|
11
|
-
const path = require("path");
|
|
29
|
+
const fs = __importStar(require("fs"));
|
|
30
|
+
const path = __importStar(require("path"));
|
|
12
31
|
function _loadConfiguration(Configuration, options, root, file) {
|
|
13
32
|
if (options.tslintConfig) {
|
|
14
33
|
return Configuration.parseConfigFile(options.tslintConfig, root);
|
|
@@ -64,7 +83,7 @@ function _listAllFiles(root) {
|
|
|
64
83
|
function default_1() {
|
|
65
84
|
return async (options = {}, context) => {
|
|
66
85
|
const root = process.cwd();
|
|
67
|
-
const tslint = await Promise.resolve().then(() => require('tslint')); // eslint-disable-line import/no-extraneous-dependencies
|
|
86
|
+
const tslint = await Promise.resolve().then(() => __importStar(require('tslint'))); // eslint-disable-line import/no-extraneous-dependencies
|
|
68
87
|
const includes = Array.isArray(options.includes)
|
|
69
88
|
? options.includes
|
|
70
89
|
: options.includes
|
|
@@ -6,9 +6,28 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
9
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
29
|
const tasks_1 = require("@angular-devkit/schematics/tasks"); // eslint-disable-line import/no-extraneous-dependencies
|
|
11
|
-
const path = require("path");
|
|
30
|
+
const path = __importStar(require("path"));
|
|
12
31
|
function default_1(options) {
|
|
13
32
|
return (_, context) => {
|
|
14
33
|
context.addTask(new tasks_1.TslintFixTask({
|
|
@@ -6,6 +6,25 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
9
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
29
|
exports.FileSystemEngineHost = void 0;
|
|
11
30
|
const fs_1 = require("fs");
|
|
@@ -83,7 +102,8 @@ class FileSystemEngineHost extends file_system_engine_host_base_1.FileSystemEngi
|
|
|
83
102
|
if (!super.hasTaskExecutor(name)) {
|
|
84
103
|
try {
|
|
85
104
|
const path = require.resolve(path_1.join(this._root, name));
|
|
86
|
-
|
|
105
|
+
// Default handling code is for old tasks that incorrectly export `default` with non-ESM module
|
|
106
|
+
return rxjs_1.from(Promise.resolve().then(() => __importStar(require(path))).then((mod) => { var _a; return (((_a = mod.default) === null || _a === void 0 ? void 0 : _a.default) || mod.default)(); })).pipe(operators_1.catchError(() => rxjs_1.throwError(new src_1.UnregisteredTaskException(name))));
|
|
87
107
|
}
|
|
88
108
|
catch { }
|
|
89
109
|
}
|