@angular-devkit/core 14.0.0-next.0 → 14.0.0-next.11
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/node/BUILD.bazel +0 -1
- package/node/experimental/index.js +5 -1
- package/node/experimental/jobs/index.js +5 -1
- package/node/host.js +10 -42
- package/node/index.js +5 -1
- package/node/testing/index.js +5 -1
- package/package.json +4 -5
- package/src/analytics/index.d.ts +1 -1
- package/src/analytics/index.js +7 -3
- package/src/{exception/exception.d.ts → exception.d.ts} +15 -0
- package/src/{exception/exception.js → exception.js} +15 -0
- package/src/experimental/jobs/create-job-handler.d.ts +1 -1
- package/src/experimental/jobs/create-job-handler.js +4 -4
- package/src/experimental/jobs/exception.d.ts +1 -1
- package/src/experimental/jobs/exception.js +3 -3
- package/src/experimental/jobs/index.js +5 -1
- package/src/experimental/jobs/strategy.d.ts +2 -2
- package/src/experimental/jobs/strategy.js +11 -4
- package/src/experimental.js +5 -1
- package/src/index.d.ts +1 -1
- package/src/index.js +6 -2
- package/src/json/index.js +5 -1
- package/src/json/schema/index.js +5 -1
- package/src/json/schema/registry.d.ts +1 -1
- package/src/json/schema/registry.js +6 -2
- package/src/logger/index.js +5 -1
- package/src/utils/index.js +5 -1
- package/src/utils/strings.d.ts +1 -1
- package/src/utils/strings.js +2 -2
- package/src/virtual-fs/host/index.js +5 -1
- package/src/virtual-fs/index.js +5 -1
- package/src/virtual-fs/path.js +4 -4
- package/src/workspace/definitions.d.ts +1 -1
- package/src/workspace/definitions.js +8 -7
- package/src/workspace/index.js +5 -1
- package/src/workspace/json/metadata.d.ts +12 -13
- package/src/workspace/json/metadata.js +28 -19
- package/src/workspace/json/reader.js +71 -86
- package/src/workspace/json/utilities.d.ts +3 -7
- package/src/workspace/json/utilities.js +62 -180
- package/src/workspace/json/writer.js +26 -192
- package/src/exception/index.d.ts +0 -8
- package/src/exception/index.js +0 -20
- package/src/json/parser.d.ts +0 -104
- package/src/json/parser.js +0 -788
- package/src/json/parser_ast.d.ts +0 -67
- package/src/json/parser_ast.js +0 -9
package/node/BUILD.bazel
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
package/node/host.js
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
|
@@ -75,21 +79,7 @@ class NodeJsAsyncHost {
|
|
|
75
79
|
return (0, rxjs_1.from)(fs_1.promises.readFile((0, src_1.getSystemPath)(path))).pipe((0, operators_1.map)((buffer) => new Uint8Array(buffer).buffer));
|
|
76
80
|
}
|
|
77
81
|
delete(path) {
|
|
78
|
-
return
|
|
79
|
-
if (isDirectory) {
|
|
80
|
-
// The below should be removed and replaced with just `rm` when support for Node.Js 12 is removed.
|
|
81
|
-
const { rm, rmdir } = fs_1.promises;
|
|
82
|
-
if (rm) {
|
|
83
|
-
await rm((0, src_1.getSystemPath)(path), { force: true, recursive: true, maxRetries: 3 });
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
await rmdir((0, src_1.getSystemPath)(path), { recursive: true, maxRetries: 3 });
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
await fs_1.promises.unlink((0, src_1.getSystemPath)(path));
|
|
91
|
-
}
|
|
92
|
-
}));
|
|
82
|
+
return (0, rxjs_1.from)(fs_1.promises.rm((0, src_1.getSystemPath)(path), { force: true, recursive: true, maxRetries: 3 }));
|
|
93
83
|
}
|
|
94
84
|
rename(from, to) {
|
|
95
85
|
return (0, rxjs_1.from)(fs_1.promises.rename((0, src_1.getSystemPath)(from), (0, src_1.getSystemPath)(to)));
|
|
@@ -166,32 +156,10 @@ class NodeJsSyncHost {
|
|
|
166
156
|
});
|
|
167
157
|
}
|
|
168
158
|
delete(path) {
|
|
169
|
-
return
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
// The below should be removed and replaced with just `rmSync` when support for Node.Js 12 is removed.
|
|
174
|
-
const { rmSync, rmdirSync } = fs_1.default;
|
|
175
|
-
if (rmSync) {
|
|
176
|
-
rmSync((0, src_1.getSystemPath)(path), { force: true, recursive: true, maxRetries: 3 });
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
rmdirSync((0, src_1.getSystemPath)(path), { recursive: true, maxRetries: 3 });
|
|
180
|
-
}
|
|
181
|
-
obs.complete();
|
|
182
|
-
});
|
|
183
|
-
return (0, rxjs_1.concat)(...dirPaths.map((name) => this.delete((0, src_1.join)(path, name))), rmDirComplete);
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
try {
|
|
187
|
-
(0, fs_1.unlinkSync)((0, src_1.getSystemPath)(path));
|
|
188
|
-
}
|
|
189
|
-
catch (err) {
|
|
190
|
-
return (0, rxjs_1.throwError)(err);
|
|
191
|
-
}
|
|
192
|
-
return (0, rxjs_1.of)(undefined);
|
|
193
|
-
}
|
|
194
|
-
}));
|
|
159
|
+
return new rxjs_1.Observable((obs) => {
|
|
160
|
+
fs_1.default.rmSync((0, src_1.getSystemPath)(path), { force: true, recursive: true, maxRetries: 3 });
|
|
161
|
+
obs.complete();
|
|
162
|
+
});
|
|
195
163
|
}
|
|
196
164
|
rename(from, to) {
|
|
197
165
|
return new rxjs_1.Observable((obs) => {
|
package/node/index.js
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
package/node/testing/index.js
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/core",
|
|
3
|
-
"version": "14.0.0-next.
|
|
3
|
+
"version": "14.0.0-next.11",
|
|
4
4
|
"description": "Angular DevKit - Core Utility Library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"typings": "src/index.d.ts",
|
|
@@ -14,9 +14,8 @@
|
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"ajv-formats": "2.1.1",
|
|
17
|
-
"ajv": "8.
|
|
18
|
-
"
|
|
19
|
-
"magic-string": "0.25.7",
|
|
17
|
+
"ajv": "8.11.0",
|
|
18
|
+
"jsonc-parser": "3.0.0",
|
|
20
19
|
"rxjs": "6.6.7",
|
|
21
20
|
"source-map": "0.7.3"
|
|
22
21
|
},
|
|
@@ -33,7 +32,7 @@
|
|
|
33
32
|
"url": "https://github.com/angular/angular-cli.git"
|
|
34
33
|
},
|
|
35
34
|
"engines": {
|
|
36
|
-
"node": "^
|
|
35
|
+
"node": "^14.15.0 || >=16.10.0",
|
|
37
36
|
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
|
|
38
37
|
"yarn": ">= 1.13.0"
|
|
39
38
|
},
|
package/src/analytics/index.d.ts
CHANGED
package/src/analytics/index.js
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
|
@@ -39,7 +43,7 @@ var NgCliAnalyticsDimensions;
|
|
|
39
43
|
NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["RamInGigabytes"] = 3] = "RamInGigabytes";
|
|
40
44
|
NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["NodeVersion"] = 4] = "NodeVersion";
|
|
41
45
|
NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["NgAddCollection"] = 6] = "NgAddCollection";
|
|
42
|
-
NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["
|
|
46
|
+
NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["AngularCLIMajorVersion"] = 8] = "AngularCLIMajorVersion";
|
|
43
47
|
NgCliAnalyticsDimensions[NgCliAnalyticsDimensions["BuildErrors"] = 20] = "BuildErrors";
|
|
44
48
|
})(NgCliAnalyticsDimensions = exports.NgCliAnalyticsDimensions || (exports.NgCliAnalyticsDimensions = {}));
|
|
45
49
|
var NgCliAnalyticsMetrics;
|
|
@@ -68,7 +72,7 @@ exports.NgCliAnalyticsDimensionsFlagInfo = {
|
|
|
68
72
|
RamInGigabytes: ['RAM (In GB)', 'number'],
|
|
69
73
|
NodeVersion: ['Node Version', 'number'],
|
|
70
74
|
NgAddCollection: ['--collection', 'string'],
|
|
71
|
-
|
|
75
|
+
AngularCLIMajorVersion: ['Angular CLI Major Version', 'string'],
|
|
72
76
|
BuildErrors: ['Build Errors (comma separated)', 'string'],
|
|
73
77
|
};
|
|
74
78
|
// This table is used when generating the analytics.md file. It should match the enum above
|
|
@@ -23,18 +23,33 @@ export declare class PathIsDirectoryException extends BaseException {
|
|
|
23
23
|
export declare class PathIsFileException extends BaseException {
|
|
24
24
|
constructor(path: string);
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated since version 14. Use the same symbol from `@angular-devkit/schematics`.
|
|
28
|
+
*/
|
|
26
29
|
export declare class ContentHasMutatedException extends BaseException {
|
|
27
30
|
constructor(path: string);
|
|
28
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated since version 14. Use the same symbol from `@angular-devkit/schematics`.
|
|
34
|
+
*/
|
|
29
35
|
export declare class InvalidUpdateRecordException extends BaseException {
|
|
30
36
|
constructor();
|
|
31
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated since version 14. Use the same symbol from `@angular-devkit/schematics`.
|
|
40
|
+
*/
|
|
32
41
|
export declare class MergeConflictException extends BaseException {
|
|
33
42
|
constructor(path: string);
|
|
34
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated since version 14. Create a custom exception implementation instead.
|
|
46
|
+
*/
|
|
35
47
|
export declare class UnimplementedException extends BaseException {
|
|
36
48
|
constructor();
|
|
37
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated since version 14. Create a custom exception implementation instead.
|
|
52
|
+
*/
|
|
38
53
|
export declare class UnsupportedPlatformException extends BaseException {
|
|
39
54
|
constructor();
|
|
40
55
|
}
|
|
@@ -45,30 +45,45 @@ class PathIsFileException extends BaseException {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
exports.PathIsFileException = PathIsFileException;
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated since version 14. Use the same symbol from `@angular-devkit/schematics`.
|
|
50
|
+
*/
|
|
48
51
|
class ContentHasMutatedException extends BaseException {
|
|
49
52
|
constructor(path) {
|
|
50
53
|
super(`Content at path "${path}" has changed between the start and the end of an update.`);
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
56
|
exports.ContentHasMutatedException = ContentHasMutatedException;
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated since version 14. Use the same symbol from `@angular-devkit/schematics`.
|
|
59
|
+
*/
|
|
54
60
|
class InvalidUpdateRecordException extends BaseException {
|
|
55
61
|
constructor() {
|
|
56
62
|
super(`Invalid record instance.`);
|
|
57
63
|
}
|
|
58
64
|
}
|
|
59
65
|
exports.InvalidUpdateRecordException = InvalidUpdateRecordException;
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated since version 14. Use the same symbol from `@angular-devkit/schematics`.
|
|
68
|
+
*/
|
|
60
69
|
class MergeConflictException extends BaseException {
|
|
61
70
|
constructor(path) {
|
|
62
71
|
super(`A merge conflicted on path "${path}".`);
|
|
63
72
|
}
|
|
64
73
|
}
|
|
65
74
|
exports.MergeConflictException = MergeConflictException;
|
|
75
|
+
/**
|
|
76
|
+
* @deprecated since version 14. Create a custom exception implementation instead.
|
|
77
|
+
*/
|
|
66
78
|
class UnimplementedException extends BaseException {
|
|
67
79
|
constructor() {
|
|
68
80
|
super('This function is unimplemented.');
|
|
69
81
|
}
|
|
70
82
|
}
|
|
71
83
|
exports.UnimplementedException = UnimplementedException;
|
|
84
|
+
/**
|
|
85
|
+
* @deprecated since version 14. Create a custom exception implementation instead.
|
|
86
|
+
*/
|
|
72
87
|
class UnsupportedPlatformException extends BaseException {
|
|
73
88
|
constructor() {
|
|
74
89
|
super('This platform is not supported by this code path.');
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
import { Observable, Observer } from 'rxjs';
|
|
9
|
-
import { BaseException } from '../../exception
|
|
9
|
+
import { BaseException } from '../../exception';
|
|
10
10
|
import { JsonValue } from '../../json/index';
|
|
11
11
|
import { LoggerApi } from '../../logger';
|
|
12
12
|
import { JobDescription, JobHandler, JobHandlerContext } from './api';
|
|
@@ -10,10 +10,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.createLoggerJob = exports.createJobFactory = exports.createJobHandler = exports.ChannelAlreadyExistException = void 0;
|
|
11
11
|
const rxjs_1 = require("rxjs");
|
|
12
12
|
const operators_1 = require("rxjs/operators");
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const exception_1 = require("../../exception");
|
|
14
|
+
const index_1 = require("../../utils/index");
|
|
15
15
|
const api_1 = require("./api");
|
|
16
|
-
class ChannelAlreadyExistException extends
|
|
16
|
+
class ChannelAlreadyExistException extends exception_1.BaseException {
|
|
17
17
|
constructor(name) {
|
|
18
18
|
super(`Channel ${JSON.stringify(name)} already exist.`);
|
|
19
19
|
}
|
|
@@ -93,7 +93,7 @@ function createJobHandler(fn, options = {}) {
|
|
|
93
93
|
subject.next({ kind: api_1.JobOutboundMessageKind.Start, description });
|
|
94
94
|
let result = fn(argument, newContext);
|
|
95
95
|
// If the result is a promise, simply wait for it to complete before reporting the result.
|
|
96
|
-
if ((0,
|
|
96
|
+
if ((0, index_1.isPromise)(result)) {
|
|
97
97
|
result = (0, rxjs_1.from)(result);
|
|
98
98
|
}
|
|
99
99
|
else if (!(0, rxjs_1.isObservable)(result)) {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import { BaseException } from '../../exception
|
|
8
|
+
import { BaseException } from '../../exception';
|
|
9
9
|
import { JobName } from './api';
|
|
10
10
|
export declare class JobNameAlreadyRegisteredException extends BaseException {
|
|
11
11
|
constructor(name: JobName);
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.JobDoesNotExistException = exports.JobNameAlreadyRegisteredException = void 0;
|
|
11
|
-
const
|
|
12
|
-
class JobNameAlreadyRegisteredException extends
|
|
11
|
+
const exception_1 = require("../../exception");
|
|
12
|
+
class JobNameAlreadyRegisteredException extends exception_1.BaseException {
|
|
13
13
|
constructor(name) {
|
|
14
14
|
super(`Job named ${JSON.stringify(name)} already exists.`);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
exports.JobNameAlreadyRegisteredException = JobNameAlreadyRegisteredException;
|
|
18
|
-
class JobDoesNotExistException extends
|
|
18
|
+
class JobDoesNotExistException extends exception_1.BaseException {
|
|
19
19
|
constructor(name) {
|
|
20
20
|
super(`Job name ${JSON.stringify(name)} does not exist.`);
|
|
21
21
|
}
|
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
|
@@ -16,13 +16,13 @@ export declare namespace strategy {
|
|
|
16
16
|
/**
|
|
17
17
|
* Creates a JobStrategy that will always reuse a running job, and restart it if the job ended.
|
|
18
18
|
* @param replayMessages Replay ALL messages if a job is reused, otherwise just hook up where it
|
|
19
|
-
*
|
|
19
|
+
* is.
|
|
20
20
|
*/
|
|
21
21
|
function reuse<A extends JsonValue = JsonValue, I extends JsonValue = JsonValue, O extends JsonValue = JsonValue>(replayMessages?: boolean): JobStrategy<A, I, O>;
|
|
22
22
|
/**
|
|
23
23
|
* Creates a JobStrategy that will reuse a running job if the argument matches.
|
|
24
24
|
* @param replayMessages Replay ALL messages if a job is reused, otherwise just hook up where it
|
|
25
|
-
*
|
|
25
|
+
* is.
|
|
26
26
|
*/
|
|
27
27
|
function memoize<A extends JsonValue = JsonValue, I extends JsonValue = JsonValue, O extends JsonValue = JsonValue>(replayMessages?: boolean): JobStrategy<A, I, O>;
|
|
28
28
|
}
|
|
@@ -10,8 +10,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.strategy = void 0;
|
|
11
11
|
const rxjs_1 = require("rxjs");
|
|
12
12
|
const operators_1 = require("rxjs/operators");
|
|
13
|
+
const json_1 = require("../../json");
|
|
13
14
|
const api_1 = require("./api");
|
|
14
|
-
const stableStringify = require('fast-json-stable-stringify');
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
16
16
|
var strategy;
|
|
17
17
|
(function (strategy) {
|
|
@@ -35,7 +35,7 @@ var strategy;
|
|
|
35
35
|
/**
|
|
36
36
|
* Creates a JobStrategy that will always reuse a running job, and restart it if the job ended.
|
|
37
37
|
* @param replayMessages Replay ALL messages if a job is reused, otherwise just hook up where it
|
|
38
|
-
*
|
|
38
|
+
* is.
|
|
39
39
|
*/
|
|
40
40
|
function reuse(replayMessages = false) {
|
|
41
41
|
let inboundBus = new rxjs_1.Subject();
|
|
@@ -70,13 +70,20 @@ var strategy;
|
|
|
70
70
|
/**
|
|
71
71
|
* Creates a JobStrategy that will reuse a running job if the argument matches.
|
|
72
72
|
* @param replayMessages Replay ALL messages if a job is reused, otherwise just hook up where it
|
|
73
|
-
*
|
|
73
|
+
* is.
|
|
74
74
|
*/
|
|
75
75
|
function memoize(replayMessages = false) {
|
|
76
76
|
const runs = new Map();
|
|
77
77
|
return (handler, options) => {
|
|
78
78
|
const newHandler = (argument, context) => {
|
|
79
|
-
const argumentJson =
|
|
79
|
+
const argumentJson = JSON.stringify((0, json_1.isJsonObject)(argument)
|
|
80
|
+
? Object.keys(argument)
|
|
81
|
+
.sort()
|
|
82
|
+
.reduce((result, key) => {
|
|
83
|
+
result[key] = argument[key];
|
|
84
|
+
return result;
|
|
85
|
+
}, {})
|
|
86
|
+
: argument);
|
|
80
87
|
const maybeJob = runs.get(argumentJson);
|
|
81
88
|
if (maybeJob) {
|
|
82
89
|
return maybeJob;
|
package/src/experimental.js
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
package/src/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import * as experimental from './experimental';
|
|
|
10
10
|
import * as json from './json/index';
|
|
11
11
|
import * as logging from './logger/index';
|
|
12
12
|
import * as workspaces from './workspace';
|
|
13
|
-
export * from './exception
|
|
13
|
+
export * from './exception';
|
|
14
14
|
export * from './json/index';
|
|
15
15
|
export * from './utils/index';
|
|
16
16
|
export * from './virtual-fs/index';
|
package/src/index.js
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
|
@@ -40,7 +44,7 @@ const logging = __importStar(require("./logger/index"));
|
|
|
40
44
|
exports.logging = logging;
|
|
41
45
|
const workspaces = __importStar(require("./workspace"));
|
|
42
46
|
exports.workspaces = workspaces;
|
|
43
|
-
__exportStar(require("./exception
|
|
47
|
+
__exportStar(require("./exception"), exports);
|
|
44
48
|
__exportStar(require("./json/index"), exports);
|
|
45
49
|
__exportStar(require("./utils/index"), exports);
|
|
46
50
|
__exportStar(require("./virtual-fs/index"), exports);
|
package/src/json/index.js
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
package/src/json/schema/index.js
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { ValidateFunction } from 'ajv';
|
|
9
9
|
import { Observable } from 'rxjs';
|
|
10
|
-
import { BaseException } from '../../exception
|
|
10
|
+
import { BaseException } from '../../exception';
|
|
11
11
|
import { JsonObject } from '../utils';
|
|
12
12
|
import { JsonVisitor, PromptProvider, SchemaFormat, SchemaRegistry, SchemaValidator, SchemaValidatorError, SmartDefaultProvider } from './interface';
|
|
13
13
|
import { JsonSchema } from './schema';
|
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
|
@@ -37,7 +41,7 @@ const https = __importStar(require("https"));
|
|
|
37
41
|
const rxjs_1 = require("rxjs");
|
|
38
42
|
const operators_1 = require("rxjs/operators");
|
|
39
43
|
const Url = __importStar(require("url"));
|
|
40
|
-
const exception_1 = require("../../exception
|
|
44
|
+
const exception_1 = require("../../exception");
|
|
41
45
|
const utils_1 = require("../../utils");
|
|
42
46
|
const utils_2 = require("../utils");
|
|
43
47
|
const utility_1 = require("./utility");
|
package/src/logger/index.js
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
package/src/utils/index.js
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
package/src/utils/strings.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ export declare function camelize(str: string): string;
|
|
|
67
67
|
*/
|
|
68
68
|
export declare function classify(str: string): string;
|
|
69
69
|
/**
|
|
70
|
-
More general than decamelize. Returns the
|
|
70
|
+
More general than decamelize. Returns the lower_case_and_underscored
|
|
71
71
|
form of a string.
|
|
72
72
|
|
|
73
73
|
```javascript
|
package/src/utils/strings.js
CHANGED
|
@@ -94,7 +94,7 @@ function classify(str) {
|
|
|
94
94
|
}
|
|
95
95
|
exports.classify = classify;
|
|
96
96
|
/**
|
|
97
|
-
More general than decamelize. Returns the
|
|
97
|
+
More general than decamelize. Returns the lower_case_and_underscored
|
|
98
98
|
form of a string.
|
|
99
99
|
|
|
100
100
|
```javascript
|
|
@@ -130,7 +130,7 @@ exports.underscore = underscore;
|
|
|
130
130
|
@return {String} The capitalized string.
|
|
131
131
|
*/
|
|
132
132
|
function capitalize(str) {
|
|
133
|
-
return str.charAt(0).toUpperCase() + str.
|
|
133
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
134
134
|
}
|
|
135
135
|
exports.capitalize = capitalize;
|
|
136
136
|
/**
|
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
package/src/virtual-fs/index.js
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|