@angular-devkit/core 14.0.0-next.5 → 14.0.0-next.8
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 +5 -1
- package/node/index.js +5 -1
- package/node/testing/index.js +5 -1
- package/package.json +2 -2
- 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.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/parser.d.ts +0 -34
- package/src/json/parser.js +4 -49
- 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.js +1 -1
- 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/index.js +5 -1
- package/src/workspace/json/utilities.js +1 -1
- package/src/exception/index.d.ts +0 -8
- package/src/exception/index.js +0 -20
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];
|
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.8",
|
|
4
4
|
"description": "Angular DevKit - Core Utility Library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"typings": "src/index.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"ajv-formats": "2.1.1",
|
|
17
|
-
"ajv": "8.
|
|
17
|
+
"ajv": "8.11.0",
|
|
18
18
|
"fast-json-stable-stringify": "2.1.0",
|
|
19
19
|
"magic-string": "0.26.1",
|
|
20
20
|
"rxjs": "6.6.7",
|
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];
|
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/parser.d.ts
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { BaseException } from '../exception';
|
|
9
9
|
import { JsonAstNode, Position } from './parser_ast';
|
|
10
|
-
import { JsonValue } from './utils';
|
|
11
10
|
export declare class JsonException extends BaseException {
|
|
12
11
|
}
|
|
13
12
|
/**
|
|
@@ -30,15 +29,6 @@ export declare class InvalidJsonCharacterException extends JsonException {
|
|
|
30
29
|
export declare class UnexpectedEndOfInputException extends JsonException {
|
|
31
30
|
constructor(_context: JsonParserContext);
|
|
32
31
|
}
|
|
33
|
-
/**
|
|
34
|
-
* An error happened within a file.
|
|
35
|
-
* @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
|
|
36
|
-
*/
|
|
37
|
-
export declare class PathSpecificJsonException extends JsonException {
|
|
38
|
-
path: string;
|
|
39
|
-
exception: JsonException;
|
|
40
|
-
constructor(path: string, exception: JsonException);
|
|
41
|
-
}
|
|
42
32
|
/**
|
|
43
33
|
* Context passed around the parser with information about where we currently are in the parse.
|
|
44
34
|
* @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
|
|
@@ -78,27 +68,3 @@ export declare enum JsonParseMode {
|
|
|
78
68
|
* @returns {JsonAstNode} The root node of the value of the AST.
|
|
79
69
|
*/
|
|
80
70
|
export declare function parseJsonAst(input: string, mode?: JsonParseMode): JsonAstNode;
|
|
81
|
-
/**
|
|
82
|
-
* Options for the parseJson() function.
|
|
83
|
-
* @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
|
|
84
|
-
*/
|
|
85
|
-
export interface ParseJsonOptions {
|
|
86
|
-
/**
|
|
87
|
-
* If omitted, will only emit errors related to the content of the JSON. If specified, any
|
|
88
|
-
* JSON errors will also include the path of the file that caused the error.
|
|
89
|
-
*/
|
|
90
|
-
path?: string;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Parse a JSON string into its value. This discards the AST and only returns the value itself.
|
|
94
|
-
*
|
|
95
|
-
* If a path option is pass, it also absorbs JSON parsing errors and return a new error with the
|
|
96
|
-
* path in it. Useful for showing errors when parsing from a file.
|
|
97
|
-
*
|
|
98
|
-
* @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
|
|
99
|
-
* @param input The string to parse.
|
|
100
|
-
* @param mode The mode to parse the input with. {@see JsonParseMode}.
|
|
101
|
-
* @param options Additional optinos for parsing.
|
|
102
|
-
* @returns {JsonValue} The value represented by the JSON string.
|
|
103
|
-
*/
|
|
104
|
-
export declare function parseJson(input: string, mode?: JsonParseMode, options?: ParseJsonOptions): JsonValue;
|
package/src/json/parser.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.parseJsonAst = exports.JsonParseMode = exports.UnexpectedEndOfInputException = exports.InvalidJsonCharacterException = exports.JsonException = void 0;
|
|
11
11
|
/* eslint-disable no-constant-condition */
|
|
12
12
|
const exception_1 = require("../exception");
|
|
13
13
|
class JsonException extends exception_1.BaseException {
|
|
@@ -41,18 +41,6 @@ class UnexpectedEndOfInputException extends JsonException {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
exports.UnexpectedEndOfInputException = UnexpectedEndOfInputException;
|
|
44
|
-
/**
|
|
45
|
-
* An error happened within a file.
|
|
46
|
-
* @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
|
|
47
|
-
*/
|
|
48
|
-
class PathSpecificJsonException extends JsonException {
|
|
49
|
-
constructor(path, exception) {
|
|
50
|
-
super(`An error happened at file path ${JSON.stringify(path)}: ${exception.message}`);
|
|
51
|
-
this.path = path;
|
|
52
|
-
this.exception = exception;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.PathSpecificJsonException = PathSpecificJsonException;
|
|
56
44
|
/**
|
|
57
45
|
* Peek and return the next character from the context.
|
|
58
46
|
* @private
|
|
@@ -480,7 +468,7 @@ function _readIdentifier(context, comments = _readBlanks(context)) {
|
|
|
480
468
|
kind: 'identifier',
|
|
481
469
|
start,
|
|
482
470
|
end: context.position,
|
|
483
|
-
text: context.original.
|
|
471
|
+
text: context.original.slice(start.offset, start.offset + context.position.offset),
|
|
484
472
|
value,
|
|
485
473
|
comments,
|
|
486
474
|
};
|
|
@@ -745,44 +733,11 @@ function parseJsonAst(input, mode = JsonParseMode.Default) {
|
|
|
745
733
|
};
|
|
746
734
|
const ast = _readValue(context);
|
|
747
735
|
if (context.position.offset < input.length) {
|
|
748
|
-
const rest = input.
|
|
749
|
-
const i = rest.length > 20 ? rest.
|
|
736
|
+
const rest = input.slice(context.position.offset);
|
|
737
|
+
const i = rest.length > 20 ? rest.slice(0, 20) + '...' : rest;
|
|
750
738
|
throw new Error(`Expected end of file, got "${i}" at ` +
|
|
751
739
|
`${context.position.line}:${context.position.character}.`);
|
|
752
740
|
}
|
|
753
741
|
return ast;
|
|
754
742
|
}
|
|
755
743
|
exports.parseJsonAst = parseJsonAst;
|
|
756
|
-
/**
|
|
757
|
-
* Parse a JSON string into its value. This discards the AST and only returns the value itself.
|
|
758
|
-
*
|
|
759
|
-
* If a path option is pass, it also absorbs JSON parsing errors and return a new error with the
|
|
760
|
-
* path in it. Useful for showing errors when parsing from a file.
|
|
761
|
-
*
|
|
762
|
-
* @deprecated Deprecated since version 11. Use 3rd party JSON parsers such as `jsonc-parser` instead.
|
|
763
|
-
* @param input The string to parse.
|
|
764
|
-
* @param mode The mode to parse the input with. {@see JsonParseMode}.
|
|
765
|
-
* @param options Additional optinos for parsing.
|
|
766
|
-
* @returns {JsonValue} The value represented by the JSON string.
|
|
767
|
-
*/
|
|
768
|
-
function parseJson(input, mode = JsonParseMode.Default, options) {
|
|
769
|
-
try {
|
|
770
|
-
// Try parsing for the fastest path available, if error, uses our own parser for better errors.
|
|
771
|
-
if (mode == JsonParseMode.Strict) {
|
|
772
|
-
try {
|
|
773
|
-
return JSON.parse(input);
|
|
774
|
-
}
|
|
775
|
-
catch (err) {
|
|
776
|
-
return parseJsonAst(input, mode).value;
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
return parseJsonAst(input, mode).value;
|
|
780
|
-
}
|
|
781
|
-
catch (e) {
|
|
782
|
-
if (options && options.path && e instanceof JsonException) {
|
|
783
|
-
throw new PathSpecificJsonException(options.path, e);
|
|
784
|
-
}
|
|
785
|
-
throw e;
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
exports.parseJson = parseJson;
|
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.js
CHANGED
|
@@ -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];
|
package/src/virtual-fs/path.js
CHANGED
|
@@ -61,7 +61,7 @@ function extname(path) {
|
|
|
61
61
|
return '';
|
|
62
62
|
}
|
|
63
63
|
else {
|
|
64
|
-
return base.
|
|
64
|
+
return base.slice(i);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
exports.extname = extname;
|
|
@@ -74,7 +74,7 @@ function basename(path) {
|
|
|
74
74
|
return fragment(path);
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
|
-
return fragment(path.
|
|
77
|
+
return fragment(path.slice(path.lastIndexOf(exports.NormalizedSep) + 1));
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
exports.basename = basename;
|
|
@@ -87,7 +87,7 @@ function dirname(path) {
|
|
|
87
87
|
return '';
|
|
88
88
|
}
|
|
89
89
|
const endIndex = index === 0 ? 1 : index; // case of file under root: '/file'
|
|
90
|
-
return normalize(path.
|
|
90
|
+
return normalize(path.slice(0, endIndex));
|
|
91
91
|
}
|
|
92
92
|
exports.dirname = dirname;
|
|
93
93
|
/**
|
|
@@ -214,7 +214,7 @@ function noCacheNormalize(path) {
|
|
|
214
214
|
// Match absolute windows path.
|
|
215
215
|
const original = path;
|
|
216
216
|
if (path.match(/^[A-Z]:[/\\]/i)) {
|
|
217
|
-
path = '\\' + path[0] + '\\' + path.
|
|
217
|
+
path = '\\' + path[0] + '\\' + path.slice(3);
|
|
218
218
|
}
|
|
219
219
|
// We convert Windows paths as well here.
|
|
220
220
|
const p = path.split(/[/\\]/g);
|
package/src/workspace/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];
|
|
@@ -222,7 +222,7 @@ function create(ast, path, reporter, excluded = new Set(), included, base) {
|
|
|
222
222
|
keys = [];
|
|
223
223
|
}
|
|
224
224
|
for (const key of cache.keys()) {
|
|
225
|
-
const relativeKey = key.
|
|
225
|
+
const relativeKey = key.slice(path.length + 1);
|
|
226
226
|
if (relativeKey.length > 0 && !relativeKey.includes('/')) {
|
|
227
227
|
keys.push(`${unescapeKey(relativeKey)}`);
|
|
228
228
|
}
|
package/src/exception/index.d.ts
DELETED
package/src/exception/index.js
DELETED
|
@@ -1,20 +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
|
-
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
__exportStar(require("./exception"), exports);
|