@lwrjs/diagnostics 0.5.11 → 0.6.0-alpha.12
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/build/cjs/descriptions/index.cjs +3 -1
- package/build/cjs/descriptions/server.cjs +35 -0
- package/build/cjs/errors.cjs +8 -1
- package/build/es/categories.d.ts +2 -1
- package/build/es/descriptions/compiler.d.ts +2 -2
- package/build/es/descriptions/configParser.d.ts +42 -42
- package/build/es/descriptions/index.d.ts +71 -62
- package/build/es/descriptions/index.js +2 -0
- package/build/es/descriptions/server.d.ts +10 -0
- package/build/es/descriptions/server.js +8 -0
- package/build/es/descriptions/unresolvable.d.ts +20 -20
- package/build/es/errors.d.ts +4 -0
- package/build/es/errors.js +6 -0
- package/package.json +4 -4
|
@@ -28,8 +28,10 @@ __export(exports, {
|
|
|
28
28
|
});
|
|
29
29
|
var import_configParser = __toModule(require("./configParser.cjs"));
|
|
30
30
|
var import_unresolvable = __toModule(require("./unresolvable.cjs"));
|
|
31
|
+
var import_server = __toModule(require("./server.cjs"));
|
|
31
32
|
__exportStar(exports, __toModule(require("./core-diagnostics.cjs")));
|
|
32
33
|
var descriptions = {
|
|
33
34
|
CONFIG_PARSER: import_configParser.configParser,
|
|
34
|
-
UNRESOLVABLE: import_unresolvable.unresolvable
|
|
35
|
+
UNRESOLVABLE: import_unresolvable.unresolvable,
|
|
36
|
+
SERVER: import_server.server
|
|
35
37
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, {get: all[name], enumerable: true});
|
|
11
|
+
};
|
|
12
|
+
var __exportStar = (target, module2, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
16
|
+
__defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable});
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toModule = (module2) => {
|
|
21
|
+
return __exportStar(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// packages/@lwrjs/diagnostics/src/descriptions/server.ts
|
|
25
|
+
__markAsModule(exports);
|
|
26
|
+
__export(exports, {
|
|
27
|
+
server: () => server
|
|
28
|
+
});
|
|
29
|
+
var import_core_diagnostics = __toModule(require("./core-diagnostics.cjs"));
|
|
30
|
+
var server = (0, import_core_diagnostics.createDiagnosticsCategory)({
|
|
31
|
+
WARMUP_ERROR: (error) => ({
|
|
32
|
+
category: "lwrServer/warmupError",
|
|
33
|
+
message: `An error occured during warmup: ${error}`
|
|
34
|
+
})
|
|
35
|
+
});
|
package/build/cjs/errors.cjs
CHANGED
|
@@ -10,9 +10,14 @@ __markAsModule(exports);
|
|
|
10
10
|
__export(exports, {
|
|
11
11
|
DiagnosticsError: () => DiagnosticsError,
|
|
12
12
|
LwrConfigValidationError: () => LwrConfigValidationError,
|
|
13
|
+
LwrServerError: () => LwrServerError,
|
|
13
14
|
LwrUnresolvableError: () => LwrUnresolvableError,
|
|
14
|
-
createSingleDiagnosticError: () => createSingleDiagnosticError
|
|
15
|
+
createSingleDiagnosticError: () => createSingleDiagnosticError,
|
|
16
|
+
isNodeError: () => isNodeError
|
|
15
17
|
});
|
|
18
|
+
function isNodeError(error) {
|
|
19
|
+
return error instanceof Error;
|
|
20
|
+
}
|
|
16
21
|
function createSingleDiagnosticError(diag, errorClass = DiagnosticsError) {
|
|
17
22
|
return new errorClass(diag.description.message, [diag]);
|
|
18
23
|
}
|
|
@@ -39,3 +44,5 @@ var LwrConfigValidationError = class extends DiagnosticsError {
|
|
|
39
44
|
};
|
|
40
45
|
var LwrUnresolvableError = class extends DiagnosticsError {
|
|
41
46
|
};
|
|
47
|
+
var LwrServerError = class extends DiagnosticsError {
|
|
48
|
+
};
|
package/build/es/categories.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export declare type DiagnosticCategory = DiagnosticLwrConfigCategory | DiagnosticCompiler | DiagnosticLwrUnresolvableCategory | '...more here';
|
|
1
|
+
export declare type DiagnosticCategory = DiagnosticLwrConfigCategory | DiagnosticCompiler | DiagnosticLwrUnresolvableCategory | DiagnosticLwrServer | '...more here';
|
|
2
2
|
export declare type DiagnosticLwrConfigCategory = 'lwrConfig/invalidJson' | 'lwrConfig/invalidSchema';
|
|
3
3
|
export declare type DiagnosticLwrUnresolvableCategory = 'lwrUnresolvable/asset' | 'lwrUnresolvable/module' | 'lwrUnresolvable/label' | 'lwrUnresolvable/resource' | 'lwrUnresolvable/invalid' | 'lwrUnresolvable/fatal';
|
|
4
4
|
export declare type DiagnosticCompiler = 'compile/umd_transform';
|
|
5
|
+
export declare type DiagnosticLwrServer = 'lwrServer/warmupError';
|
|
5
6
|
//# sourceMappingURL=categories.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DiagnosticLocation } from '../types.js';
|
|
2
2
|
export declare const configParser: {
|
|
3
|
-
TEST:
|
|
3
|
+
TEST: Omit<{
|
|
4
4
|
message: string;
|
|
5
|
-
},
|
|
5
|
+
}, "message" | "advice"> & {
|
|
6
6
|
advice: import("../types.js").DiagnosticAdvice;
|
|
7
7
|
message: string;
|
|
8
8
|
};
|
|
9
|
-
TEST_ADVICE: (tagName: string, openLocation: DiagnosticLocation) =>
|
|
9
|
+
TEST_ADVICE: (tagName: string, openLocation: DiagnosticLocation) => Omit<{
|
|
10
10
|
message: string;
|
|
11
11
|
advice: ({
|
|
12
12
|
type: "log";
|
|
@@ -19,140 +19,140 @@ export declare const configParser: {
|
|
|
19
19
|
category?: undefined;
|
|
20
20
|
text?: undefined;
|
|
21
21
|
})[];
|
|
22
|
-
},
|
|
22
|
+
}, "message" | "advice"> & {
|
|
23
23
|
advice: import("../types.js").DiagnosticAdvice;
|
|
24
24
|
message: string;
|
|
25
25
|
};
|
|
26
|
-
INVALID_JSON: (invalidJsonError: string) =>
|
|
26
|
+
INVALID_JSON: (invalidJsonError: string) => Omit<{
|
|
27
27
|
category: "lwrConfig/invalidJson";
|
|
28
28
|
message: string;
|
|
29
|
-
}, "
|
|
29
|
+
}, "message" | "advice"> & {
|
|
30
30
|
advice: import("../types.js").DiagnosticAdvice;
|
|
31
31
|
message: string;
|
|
32
32
|
};
|
|
33
|
-
INCORRECT_NODE_TYPE: (configProperty: string, expectedNodeType: string, actualNodeType: string) =>
|
|
33
|
+
INCORRECT_NODE_TYPE: (configProperty: string, expectedNodeType: string, actualNodeType: string) => Omit<{
|
|
34
34
|
category: "lwrConfig/invalidSchema";
|
|
35
35
|
message: string;
|
|
36
|
-
}, "
|
|
36
|
+
}, "message" | "advice"> & {
|
|
37
37
|
advice: import("../types.js").DiagnosticAdvice;
|
|
38
38
|
message: string;
|
|
39
39
|
};
|
|
40
|
-
INVALID_EMPTY_NODE: (configProperty: string) =>
|
|
40
|
+
INVALID_EMPTY_NODE: (configProperty: string) => Omit<{
|
|
41
41
|
category: "lwrConfig/invalidSchema";
|
|
42
42
|
message: string;
|
|
43
|
-
}, "
|
|
43
|
+
}, "message" | "advice"> & {
|
|
44
44
|
advice: import("../types.js").DiagnosticAdvice;
|
|
45
45
|
message: string;
|
|
46
46
|
};
|
|
47
|
-
INVALID_PROPERTY: (configProperty: string, prop: string) =>
|
|
47
|
+
INVALID_PROPERTY: (configProperty: string, prop: string) => Omit<{
|
|
48
48
|
category: "lwrConfig/invalidSchema";
|
|
49
49
|
message: string;
|
|
50
|
-
}, "
|
|
50
|
+
}, "message" | "advice"> & {
|
|
51
51
|
advice: import("../types.js").DiagnosticAdvice;
|
|
52
52
|
message: string;
|
|
53
53
|
};
|
|
54
|
-
NON_EMPTY_STRING: (configProperty: string, actualProp: string) =>
|
|
54
|
+
NON_EMPTY_STRING: (configProperty: string, actualProp: string) => Omit<{
|
|
55
55
|
category: "lwrConfig/invalidSchema";
|
|
56
56
|
message: string;
|
|
57
|
-
}, "
|
|
57
|
+
}, "message" | "advice"> & {
|
|
58
58
|
advice: import("../types.js").DiagnosticAdvice;
|
|
59
59
|
message: string;
|
|
60
60
|
};
|
|
61
|
-
NON_EMPTY_ARRAY: (configProperty: string, actualProp: string) =>
|
|
61
|
+
NON_EMPTY_ARRAY: (configProperty: string, actualProp: string) => Omit<{
|
|
62
62
|
category: "lwrConfig/invalidSchema";
|
|
63
63
|
message: string;
|
|
64
|
-
}, "
|
|
64
|
+
}, "message" | "advice"> & {
|
|
65
65
|
advice: import("../types.js").DiagnosticAdvice;
|
|
66
66
|
message: string;
|
|
67
67
|
};
|
|
68
|
-
INVALID_PORT: (configProperty: string, actualProp: string) =>
|
|
68
|
+
INVALID_PORT: (configProperty: string, actualProp: string) => Omit<{
|
|
69
69
|
category: "lwrConfig/invalidSchema";
|
|
70
70
|
message: string;
|
|
71
|
-
}, "
|
|
71
|
+
}, "message" | "advice"> & {
|
|
72
72
|
advice: import("../types.js").DiagnosticAdvice;
|
|
73
73
|
message: string;
|
|
74
74
|
};
|
|
75
|
-
INVALID_METHOD: (configProperty: string, actualProp: string) =>
|
|
75
|
+
INVALID_METHOD: (configProperty: string, actualProp: string) => Omit<{
|
|
76
76
|
category: "lwrConfig/invalidSchema";
|
|
77
77
|
message: string;
|
|
78
|
-
}, "
|
|
78
|
+
}, "message" | "advice"> & {
|
|
79
79
|
advice: import("../types.js").DiagnosticAdvice;
|
|
80
80
|
message: string;
|
|
81
81
|
};
|
|
82
|
-
INVALID_SERVER_TYPE: (configProperty: string, actualProp: string) =>
|
|
82
|
+
INVALID_SERVER_TYPE: (configProperty: string, actualProp: string) => Omit<{
|
|
83
83
|
category: "lwrConfig/invalidSchema";
|
|
84
84
|
message: string;
|
|
85
|
-
}, "
|
|
85
|
+
}, "message" | "advice"> & {
|
|
86
86
|
advice: import("../types.js").DiagnosticAdvice;
|
|
87
87
|
message: string;
|
|
88
88
|
};
|
|
89
|
-
INVALID_GENERATOR_CONFIG: (configProperty: string, actualProp: string) =>
|
|
89
|
+
INVALID_GENERATOR_CONFIG: (configProperty: string, actualProp: string) => Omit<{
|
|
90
90
|
category: "lwrConfig/invalidSchema";
|
|
91
91
|
message: string;
|
|
92
|
-
}, "
|
|
92
|
+
}, "message" | "advice"> & {
|
|
93
93
|
advice: import("../types.js").DiagnosticAdvice;
|
|
94
94
|
message: string;
|
|
95
95
|
};
|
|
96
|
-
INVALID_STATUS: (configProperty: string, actualProp: string) =>
|
|
96
|
+
INVALID_STATUS: (configProperty: string, actualProp: string) => Omit<{
|
|
97
97
|
category: "lwrConfig/invalidSchema";
|
|
98
98
|
message: string;
|
|
99
|
-
}, "
|
|
99
|
+
}, "message" | "advice"> & {
|
|
100
100
|
advice: import("../types.js").DiagnosticAdvice;
|
|
101
101
|
message: string;
|
|
102
102
|
};
|
|
103
|
-
INVALID_SPECIFIER: (configProperty: string, actualProp: string) =>
|
|
103
|
+
INVALID_SPECIFIER: (configProperty: string, actualProp: string) => Omit<{
|
|
104
104
|
category: "lwrConfig/invalidSchema";
|
|
105
105
|
message: string;
|
|
106
|
-
}, "
|
|
106
|
+
}, "message" | "advice"> & {
|
|
107
107
|
advice: import("../types.js").DiagnosticAdvice;
|
|
108
108
|
message: string;
|
|
109
109
|
};
|
|
110
|
-
INVALID_PATH: (configProperty: string, actualProp: string) =>
|
|
110
|
+
INVALID_PATH: (configProperty: string, actualProp: string) => Omit<{
|
|
111
111
|
category: "lwrConfig/invalidSchema";
|
|
112
112
|
message: string;
|
|
113
|
-
}, "
|
|
113
|
+
}, "message" | "advice"> & {
|
|
114
114
|
advice: import("../types.js").DiagnosticAdvice;
|
|
115
115
|
message: string;
|
|
116
116
|
};
|
|
117
|
-
INVALID_SERVICE: (configProperty: string, actualProp: string) =>
|
|
117
|
+
INVALID_SERVICE: (configProperty: string, actualProp: string) => Omit<{
|
|
118
118
|
category: "lwrConfig/invalidSchema";
|
|
119
119
|
message: string;
|
|
120
|
-
}, "
|
|
120
|
+
}, "message" | "advice"> & {
|
|
121
121
|
advice: import("../types.js").DiagnosticAdvice;
|
|
122
122
|
message: string;
|
|
123
123
|
};
|
|
124
|
-
INVALID_ENVIRONMENT: (configProperty: string) =>
|
|
124
|
+
INVALID_ENVIRONMENT: (configProperty: string) => Omit<{
|
|
125
125
|
category: "lwrConfig/invalidSchema";
|
|
126
126
|
message: string;
|
|
127
|
-
}, "
|
|
127
|
+
}, "message" | "advice"> & {
|
|
128
128
|
advice: import("../types.js").DiagnosticAdvice;
|
|
129
129
|
message: string;
|
|
130
130
|
};
|
|
131
|
-
MISSING_ONE_OF: (configProperty: string, childProps: string[]) =>
|
|
131
|
+
MISSING_ONE_OF: (configProperty: string, childProps: string[]) => Omit<{
|
|
132
132
|
category: "lwrConfig/invalidSchema";
|
|
133
133
|
message: string;
|
|
134
|
-
}, "
|
|
134
|
+
}, "message" | "advice"> & {
|
|
135
135
|
advice: import("../types.js").DiagnosticAdvice;
|
|
136
136
|
message: string;
|
|
137
137
|
};
|
|
138
|
-
TOO_MANY: (configProperty: string, childProps: string[]) =>
|
|
138
|
+
TOO_MANY: (configProperty: string, childProps: string[]) => Omit<{
|
|
139
139
|
category: "lwrConfig/invalidSchema";
|
|
140
140
|
message: string;
|
|
141
|
-
}, "
|
|
141
|
+
}, "message" | "advice"> & {
|
|
142
142
|
advice: import("../types.js").DiagnosticAdvice;
|
|
143
143
|
message: string;
|
|
144
144
|
};
|
|
145
|
-
MISSING_REQUIRED: (configProperty: string, childProps: string[]) =>
|
|
145
|
+
MISSING_REQUIRED: (configProperty: string, childProps: string[]) => Omit<{
|
|
146
146
|
category: "lwrConfig/invalidSchema";
|
|
147
147
|
message: string;
|
|
148
|
-
}, "
|
|
148
|
+
}, "message" | "advice"> & {
|
|
149
149
|
advice: import("../types.js").DiagnosticAdvice;
|
|
150
150
|
message: string;
|
|
151
151
|
};
|
|
152
|
-
DUPLICATE_IDS: (configProperty: string, dupeIds: string[]) =>
|
|
152
|
+
DUPLICATE_IDS: (configProperty: string, dupeIds: string[]) => Omit<{
|
|
153
153
|
category: "lwrConfig/invalidSchema";
|
|
154
154
|
message: string;
|
|
155
|
-
}, "
|
|
155
|
+
}, "message" | "advice"> & {
|
|
156
156
|
advice: import("../types.js").DiagnosticAdvice;
|
|
157
157
|
message: string;
|
|
158
158
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare const descriptions: {
|
|
2
2
|
CONFIG_PARSER: {
|
|
3
|
-
TEST:
|
|
3
|
+
TEST: Omit<{
|
|
4
4
|
message: string;
|
|
5
|
-
},
|
|
5
|
+
}, "message" | "advice"> & {
|
|
6
6
|
advice: import("../types.js").DiagnosticAdvice;
|
|
7
7
|
message: string;
|
|
8
8
|
};
|
|
9
|
-
TEST_ADVICE: (tagName: string, openLocation: import("../types.js").DiagnosticLocation) =>
|
|
9
|
+
TEST_ADVICE: (tagName: string, openLocation: import("../types.js").DiagnosticLocation) => Omit<{
|
|
10
10
|
message: string;
|
|
11
11
|
advice: ({
|
|
12
12
|
type: "log";
|
|
@@ -19,212 +19,221 @@ export declare const descriptions: {
|
|
|
19
19
|
category?: undefined;
|
|
20
20
|
text?: undefined;
|
|
21
21
|
})[];
|
|
22
|
-
},
|
|
22
|
+
}, "message" | "advice"> & {
|
|
23
23
|
advice: import("../types.js").DiagnosticAdvice;
|
|
24
24
|
message: string;
|
|
25
25
|
};
|
|
26
|
-
INVALID_JSON: (invalidJsonError: string) =>
|
|
26
|
+
INVALID_JSON: (invalidJsonError: string) => Omit<{
|
|
27
27
|
category: "lwrConfig/invalidJson";
|
|
28
28
|
message: string;
|
|
29
|
-
}, "
|
|
29
|
+
}, "message" | "advice"> & {
|
|
30
30
|
advice: import("../types.js").DiagnosticAdvice;
|
|
31
31
|
message: string;
|
|
32
32
|
};
|
|
33
|
-
INCORRECT_NODE_TYPE: (configProperty: string, expectedNodeType: string, actualNodeType: string) =>
|
|
33
|
+
INCORRECT_NODE_TYPE: (configProperty: string, expectedNodeType: string, actualNodeType: string) => Omit<{
|
|
34
34
|
category: "lwrConfig/invalidSchema";
|
|
35
35
|
message: string;
|
|
36
|
-
}, "
|
|
36
|
+
}, "message" | "advice"> & {
|
|
37
37
|
advice: import("../types.js").DiagnosticAdvice;
|
|
38
38
|
message: string;
|
|
39
39
|
};
|
|
40
|
-
INVALID_EMPTY_NODE: (configProperty: string) =>
|
|
40
|
+
INVALID_EMPTY_NODE: (configProperty: string) => Omit<{
|
|
41
41
|
category: "lwrConfig/invalidSchema";
|
|
42
42
|
message: string;
|
|
43
|
-
}, "
|
|
43
|
+
}, "message" | "advice"> & {
|
|
44
44
|
advice: import("../types.js").DiagnosticAdvice;
|
|
45
45
|
message: string;
|
|
46
46
|
};
|
|
47
|
-
INVALID_PROPERTY: (configProperty: string, prop: string) =>
|
|
47
|
+
INVALID_PROPERTY: (configProperty: string, prop: string) => Omit<{
|
|
48
48
|
category: "lwrConfig/invalidSchema";
|
|
49
49
|
message: string;
|
|
50
|
-
}, "
|
|
50
|
+
}, "message" | "advice"> & {
|
|
51
51
|
advice: import("../types.js").DiagnosticAdvice;
|
|
52
52
|
message: string;
|
|
53
53
|
};
|
|
54
|
-
NON_EMPTY_STRING: (configProperty: string, actualProp: string) =>
|
|
54
|
+
NON_EMPTY_STRING: (configProperty: string, actualProp: string) => Omit<{
|
|
55
55
|
category: "lwrConfig/invalidSchema";
|
|
56
56
|
message: string;
|
|
57
|
-
}, "
|
|
57
|
+
}, "message" | "advice"> & {
|
|
58
58
|
advice: import("../types.js").DiagnosticAdvice;
|
|
59
59
|
message: string;
|
|
60
60
|
};
|
|
61
|
-
NON_EMPTY_ARRAY: (configProperty: string, actualProp: string) =>
|
|
61
|
+
NON_EMPTY_ARRAY: (configProperty: string, actualProp: string) => Omit<{
|
|
62
62
|
category: "lwrConfig/invalidSchema";
|
|
63
63
|
message: string;
|
|
64
|
-
}, "
|
|
64
|
+
}, "message" | "advice"> & {
|
|
65
65
|
advice: import("../types.js").DiagnosticAdvice;
|
|
66
66
|
message: string;
|
|
67
67
|
};
|
|
68
|
-
INVALID_PORT: (configProperty: string, actualProp: string) =>
|
|
68
|
+
INVALID_PORT: (configProperty: string, actualProp: string) => Omit<{
|
|
69
69
|
category: "lwrConfig/invalidSchema";
|
|
70
70
|
message: string;
|
|
71
|
-
}, "
|
|
71
|
+
}, "message" | "advice"> & {
|
|
72
72
|
advice: import("../types.js").DiagnosticAdvice;
|
|
73
73
|
message: string;
|
|
74
74
|
};
|
|
75
|
-
INVALID_METHOD: (configProperty: string, actualProp: string) =>
|
|
75
|
+
INVALID_METHOD: (configProperty: string, actualProp: string) => Omit<{
|
|
76
76
|
category: "lwrConfig/invalidSchema";
|
|
77
77
|
message: string;
|
|
78
|
-
}, "
|
|
78
|
+
}, "message" | "advice"> & {
|
|
79
79
|
advice: import("../types.js").DiagnosticAdvice;
|
|
80
80
|
message: string;
|
|
81
81
|
};
|
|
82
|
-
INVALID_SERVER_TYPE: (configProperty: string, actualProp: string) =>
|
|
82
|
+
INVALID_SERVER_TYPE: (configProperty: string, actualProp: string) => Omit<{
|
|
83
83
|
category: "lwrConfig/invalidSchema";
|
|
84
84
|
message: string;
|
|
85
|
-
}, "
|
|
85
|
+
}, "message" | "advice"> & {
|
|
86
86
|
advice: import("../types.js").DiagnosticAdvice;
|
|
87
87
|
message: string;
|
|
88
88
|
};
|
|
89
|
-
INVALID_GENERATOR_CONFIG: (configProperty: string, actualProp: string) =>
|
|
89
|
+
INVALID_GENERATOR_CONFIG: (configProperty: string, actualProp: string) => Omit<{
|
|
90
90
|
category: "lwrConfig/invalidSchema";
|
|
91
91
|
message: string;
|
|
92
|
-
}, "
|
|
92
|
+
}, "message" | "advice"> & {
|
|
93
93
|
advice: import("../types.js").DiagnosticAdvice;
|
|
94
94
|
message: string;
|
|
95
95
|
};
|
|
96
|
-
INVALID_STATUS: (configProperty: string, actualProp: string) =>
|
|
96
|
+
INVALID_STATUS: (configProperty: string, actualProp: string) => Omit<{
|
|
97
97
|
category: "lwrConfig/invalidSchema";
|
|
98
98
|
message: string;
|
|
99
|
-
}, "
|
|
99
|
+
}, "message" | "advice"> & {
|
|
100
100
|
advice: import("../types.js").DiagnosticAdvice;
|
|
101
101
|
message: string;
|
|
102
102
|
};
|
|
103
|
-
INVALID_SPECIFIER: (configProperty: string, actualProp: string) =>
|
|
103
|
+
INVALID_SPECIFIER: (configProperty: string, actualProp: string) => Omit<{
|
|
104
104
|
category: "lwrConfig/invalidSchema";
|
|
105
105
|
message: string;
|
|
106
|
-
}, "
|
|
106
|
+
}, "message" | "advice"> & {
|
|
107
107
|
advice: import("../types.js").DiagnosticAdvice;
|
|
108
108
|
message: string;
|
|
109
109
|
};
|
|
110
|
-
INVALID_PATH: (configProperty: string, actualProp: string) =>
|
|
110
|
+
INVALID_PATH: (configProperty: string, actualProp: string) => Omit<{
|
|
111
111
|
category: "lwrConfig/invalidSchema";
|
|
112
112
|
message: string;
|
|
113
|
-
}, "
|
|
113
|
+
}, "message" | "advice"> & {
|
|
114
114
|
advice: import("../types.js").DiagnosticAdvice;
|
|
115
115
|
message: string;
|
|
116
116
|
};
|
|
117
|
-
INVALID_SERVICE: (configProperty: string, actualProp: string) =>
|
|
117
|
+
INVALID_SERVICE: (configProperty: string, actualProp: string) => Omit<{
|
|
118
118
|
category: "lwrConfig/invalidSchema";
|
|
119
119
|
message: string;
|
|
120
|
-
}, "
|
|
120
|
+
}, "message" | "advice"> & {
|
|
121
121
|
advice: import("../types.js").DiagnosticAdvice;
|
|
122
122
|
message: string;
|
|
123
123
|
};
|
|
124
|
-
INVALID_ENVIRONMENT: (configProperty: string) =>
|
|
124
|
+
INVALID_ENVIRONMENT: (configProperty: string) => Omit<{
|
|
125
125
|
category: "lwrConfig/invalidSchema";
|
|
126
126
|
message: string;
|
|
127
|
-
}, "
|
|
127
|
+
}, "message" | "advice"> & {
|
|
128
128
|
advice: import("../types.js").DiagnosticAdvice;
|
|
129
129
|
message: string;
|
|
130
130
|
};
|
|
131
|
-
MISSING_ONE_OF: (configProperty: string, childProps: string[]) =>
|
|
131
|
+
MISSING_ONE_OF: (configProperty: string, childProps: string[]) => Omit<{
|
|
132
132
|
category: "lwrConfig/invalidSchema";
|
|
133
133
|
message: string;
|
|
134
|
-
}, "
|
|
134
|
+
}, "message" | "advice"> & {
|
|
135
135
|
advice: import("../types.js").DiagnosticAdvice;
|
|
136
136
|
message: string;
|
|
137
137
|
};
|
|
138
|
-
TOO_MANY: (configProperty: string, childProps: string[]) =>
|
|
138
|
+
TOO_MANY: (configProperty: string, childProps: string[]) => Omit<{
|
|
139
139
|
category: "lwrConfig/invalidSchema";
|
|
140
140
|
message: string;
|
|
141
|
-
}, "
|
|
141
|
+
}, "message" | "advice"> & {
|
|
142
142
|
advice: import("../types.js").DiagnosticAdvice;
|
|
143
143
|
message: string;
|
|
144
144
|
};
|
|
145
|
-
MISSING_REQUIRED: (configProperty: string, childProps: string[]) =>
|
|
145
|
+
MISSING_REQUIRED: (configProperty: string, childProps: string[]) => Omit<{
|
|
146
146
|
category: "lwrConfig/invalidSchema";
|
|
147
147
|
message: string;
|
|
148
|
-
}, "
|
|
148
|
+
}, "message" | "advice"> & {
|
|
149
149
|
advice: import("../types.js").DiagnosticAdvice;
|
|
150
150
|
message: string;
|
|
151
151
|
};
|
|
152
|
-
DUPLICATE_IDS: (configProperty: string, dupeIds: string[]) =>
|
|
152
|
+
DUPLICATE_IDS: (configProperty: string, dupeIds: string[]) => Omit<{
|
|
153
153
|
category: "lwrConfig/invalidSchema";
|
|
154
154
|
message: string;
|
|
155
|
-
}, "
|
|
155
|
+
}, "message" | "advice"> & {
|
|
156
156
|
advice: import("../types.js").DiagnosticAdvice;
|
|
157
157
|
message: string;
|
|
158
158
|
};
|
|
159
159
|
};
|
|
160
160
|
UNRESOLVABLE: {
|
|
161
|
-
ASSET: (assetPath: string) =>
|
|
161
|
+
ASSET: (assetPath: string) => Omit<{
|
|
162
162
|
category: "lwrUnresolvable/asset";
|
|
163
163
|
message: string;
|
|
164
|
-
}, "
|
|
164
|
+
}, "message" | "advice"> & {
|
|
165
165
|
advice: import("../types.js").DiagnosticAdvice;
|
|
166
166
|
message: string;
|
|
167
167
|
};
|
|
168
|
-
DIR_ALIAS: (assetPath: string) =>
|
|
168
|
+
DIR_ALIAS: (assetPath: string) => Omit<{
|
|
169
169
|
category: "lwrUnresolvable/asset";
|
|
170
170
|
message: string;
|
|
171
|
-
}, "
|
|
171
|
+
}, "message" | "advice"> & {
|
|
172
172
|
advice: import("../types.js").DiagnosticAdvice;
|
|
173
173
|
message: string;
|
|
174
174
|
};
|
|
175
|
-
MODULE: (moduleSpecifier: string) =>
|
|
175
|
+
MODULE: (moduleSpecifier: string) => Omit<{
|
|
176
176
|
category: "lwrUnresolvable/module";
|
|
177
177
|
message: string;
|
|
178
|
-
}, "
|
|
178
|
+
}, "message" | "advice"> & {
|
|
179
179
|
advice: import("../types.js").DiagnosticAdvice;
|
|
180
180
|
message: string;
|
|
181
181
|
};
|
|
182
|
-
MODULE_ENTRY: (moduleSpecifier: string) =>
|
|
182
|
+
MODULE_ENTRY: (moduleSpecifier: string) => Omit<{
|
|
183
183
|
category: "lwrUnresolvable/module";
|
|
184
184
|
message: string;
|
|
185
|
-
}, "
|
|
185
|
+
}, "message" | "advice"> & {
|
|
186
186
|
advice: import("../types.js").DiagnosticAdvice;
|
|
187
187
|
message: string;
|
|
188
188
|
};
|
|
189
|
-
LWC_MODULE: (name: string) =>
|
|
189
|
+
LWC_MODULE: (name: string) => Omit<{
|
|
190
190
|
category: "lwrUnresolvable/module";
|
|
191
191
|
message: string;
|
|
192
|
-
}, "
|
|
192
|
+
}, "message" | "advice"> & {
|
|
193
193
|
advice: import("../types.js").DiagnosticAdvice;
|
|
194
194
|
message: string;
|
|
195
195
|
};
|
|
196
|
-
SIGNED_MODULE: (moduleSpecifier: string, signature: string) =>
|
|
196
|
+
SIGNED_MODULE: (moduleSpecifier: string, signature: string) => Omit<{
|
|
197
197
|
category: "lwrUnresolvable/module";
|
|
198
198
|
message: string;
|
|
199
|
-
}, "
|
|
199
|
+
}, "message" | "advice"> & {
|
|
200
200
|
advice: import("../types.js").DiagnosticAdvice;
|
|
201
201
|
message: string;
|
|
202
202
|
};
|
|
203
|
-
RESOURCE: (resourceSpecifier: string) =>
|
|
203
|
+
RESOURCE: (resourceSpecifier: string) => Omit<{
|
|
204
204
|
category: "lwrUnresolvable/resource";
|
|
205
205
|
message: string;
|
|
206
|
-
}, "
|
|
206
|
+
}, "message" | "advice"> & {
|
|
207
207
|
advice: import("../types.js").DiagnosticAdvice;
|
|
208
208
|
message: string;
|
|
209
209
|
};
|
|
210
|
-
SERVER_ERROR: (name: string) =>
|
|
210
|
+
SERVER_ERROR: (name: string) => Omit<{
|
|
211
211
|
category: "lwrUnresolvable/fatal";
|
|
212
212
|
message: string;
|
|
213
|
-
}, "
|
|
213
|
+
}, "message" | "advice"> & {
|
|
214
214
|
advice: import("../types.js").DiagnosticAdvice;
|
|
215
215
|
message: string;
|
|
216
216
|
};
|
|
217
|
-
INVALID_JSON: () =>
|
|
217
|
+
INVALID_JSON: () => Omit<{
|
|
218
218
|
category: "lwrUnresolvable/invalid";
|
|
219
219
|
message: string;
|
|
220
|
-
}, "
|
|
220
|
+
}, "message" | "advice"> & {
|
|
221
221
|
advice: import("../types.js").DiagnosticAdvice;
|
|
222
222
|
message: string;
|
|
223
223
|
};
|
|
224
|
-
LABEL_MODULE: (file: string, error: string) =>
|
|
224
|
+
LABEL_MODULE: (file: string, error: string) => Omit<{
|
|
225
225
|
category: "lwrUnresolvable/label";
|
|
226
226
|
message: string;
|
|
227
|
-
}, "
|
|
227
|
+
}, "message" | "advice"> & {
|
|
228
|
+
advice: import("../types.js").DiagnosticAdvice;
|
|
229
|
+
message: string;
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
SERVER: {
|
|
233
|
+
WARMUP_ERROR: (error: string) => Omit<{
|
|
234
|
+
category: "lwrServer/warmupError";
|
|
235
|
+
message: string;
|
|
236
|
+
}, "message" | "advice"> & {
|
|
228
237
|
advice: import("../types.js").DiagnosticAdvice;
|
|
229
238
|
message: string;
|
|
230
239
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { configParser } from './configParser.js';
|
|
2
2
|
import { unresolvable } from './unresolvable.js';
|
|
3
|
+
import { server } from './server.js';
|
|
3
4
|
export const descriptions = {
|
|
4
5
|
CONFIG_PARSER: configParser,
|
|
5
6
|
UNRESOLVABLE: unresolvable,
|
|
7
|
+
SERVER: server,
|
|
6
8
|
};
|
|
7
9
|
export * from './core-diagnostics.js';
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const server: {
|
|
2
|
+
WARMUP_ERROR: (error: string) => Omit<{
|
|
3
|
+
category: "lwrServer/warmupError";
|
|
4
|
+
message: string;
|
|
5
|
+
}, "message" | "advice"> & {
|
|
6
|
+
advice: import("../types.js").DiagnosticAdvice;
|
|
7
|
+
message: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createDiagnosticsCategory } from './core-diagnostics.js';
|
|
2
|
+
export const server = createDiagnosticsCategory({
|
|
3
|
+
WARMUP_ERROR: (error) => ({
|
|
4
|
+
category: 'lwrServer/warmupError',
|
|
5
|
+
message: `An error occured during warmup: ${error}`,
|
|
6
|
+
}),
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -1,71 +1,71 @@
|
|
|
1
1
|
export declare const unresolvable: {
|
|
2
|
-
ASSET: (assetPath: string) =>
|
|
2
|
+
ASSET: (assetPath: string) => Omit<{
|
|
3
3
|
category: "lwrUnresolvable/asset";
|
|
4
4
|
message: string;
|
|
5
|
-
}, "
|
|
5
|
+
}, "message" | "advice"> & {
|
|
6
6
|
advice: import("../types.js").DiagnosticAdvice;
|
|
7
7
|
message: string;
|
|
8
8
|
};
|
|
9
|
-
DIR_ALIAS: (assetPath: string) =>
|
|
9
|
+
DIR_ALIAS: (assetPath: string) => Omit<{
|
|
10
10
|
category: "lwrUnresolvable/asset";
|
|
11
11
|
message: string;
|
|
12
|
-
}, "
|
|
12
|
+
}, "message" | "advice"> & {
|
|
13
13
|
advice: import("../types.js").DiagnosticAdvice;
|
|
14
14
|
message: string;
|
|
15
15
|
};
|
|
16
|
-
MODULE: (moduleSpecifier: string) =>
|
|
16
|
+
MODULE: (moduleSpecifier: string) => Omit<{
|
|
17
17
|
category: "lwrUnresolvable/module";
|
|
18
18
|
message: string;
|
|
19
|
-
}, "
|
|
19
|
+
}, "message" | "advice"> & {
|
|
20
20
|
advice: import("../types.js").DiagnosticAdvice;
|
|
21
21
|
message: string;
|
|
22
22
|
};
|
|
23
|
-
MODULE_ENTRY: (moduleSpecifier: string) =>
|
|
23
|
+
MODULE_ENTRY: (moduleSpecifier: string) => Omit<{
|
|
24
24
|
category: "lwrUnresolvable/module";
|
|
25
25
|
message: string;
|
|
26
|
-
}, "
|
|
26
|
+
}, "message" | "advice"> & {
|
|
27
27
|
advice: import("../types.js").DiagnosticAdvice;
|
|
28
28
|
message: string;
|
|
29
29
|
};
|
|
30
|
-
LWC_MODULE: (name: string) =>
|
|
30
|
+
LWC_MODULE: (name: string) => Omit<{
|
|
31
31
|
category: "lwrUnresolvable/module";
|
|
32
32
|
message: string;
|
|
33
|
-
}, "
|
|
33
|
+
}, "message" | "advice"> & {
|
|
34
34
|
advice: import("../types.js").DiagnosticAdvice;
|
|
35
35
|
message: string;
|
|
36
36
|
};
|
|
37
|
-
SIGNED_MODULE: (moduleSpecifier: string, signature: string) =>
|
|
37
|
+
SIGNED_MODULE: (moduleSpecifier: string, signature: string) => Omit<{
|
|
38
38
|
category: "lwrUnresolvable/module";
|
|
39
39
|
message: string;
|
|
40
|
-
}, "
|
|
40
|
+
}, "message" | "advice"> & {
|
|
41
41
|
advice: import("../types.js").DiagnosticAdvice;
|
|
42
42
|
message: string;
|
|
43
43
|
};
|
|
44
|
-
RESOURCE: (resourceSpecifier: string) =>
|
|
44
|
+
RESOURCE: (resourceSpecifier: string) => Omit<{
|
|
45
45
|
category: "lwrUnresolvable/resource";
|
|
46
46
|
message: string;
|
|
47
|
-
}, "
|
|
47
|
+
}, "message" | "advice"> & {
|
|
48
48
|
advice: import("../types.js").DiagnosticAdvice;
|
|
49
49
|
message: string;
|
|
50
50
|
};
|
|
51
|
-
SERVER_ERROR: (name: string) =>
|
|
51
|
+
SERVER_ERROR: (name: string) => Omit<{
|
|
52
52
|
category: "lwrUnresolvable/fatal";
|
|
53
53
|
message: string;
|
|
54
|
-
}, "
|
|
54
|
+
}, "message" | "advice"> & {
|
|
55
55
|
advice: import("../types.js").DiagnosticAdvice;
|
|
56
56
|
message: string;
|
|
57
57
|
};
|
|
58
|
-
INVALID_JSON: () =>
|
|
58
|
+
INVALID_JSON: () => Omit<{
|
|
59
59
|
category: "lwrUnresolvable/invalid";
|
|
60
60
|
message: string;
|
|
61
|
-
}, "
|
|
61
|
+
}, "message" | "advice"> & {
|
|
62
62
|
advice: import("../types.js").DiagnosticAdvice;
|
|
63
63
|
message: string;
|
|
64
64
|
};
|
|
65
|
-
LABEL_MODULE: (file: string, error: string) =>
|
|
65
|
+
LABEL_MODULE: (file: string, error: string) => Omit<{
|
|
66
66
|
category: "lwrUnresolvable/label";
|
|
67
67
|
message: string;
|
|
68
|
-
}, "
|
|
68
|
+
}, "message" | "advice"> & {
|
|
69
69
|
advice: import("../types.js").DiagnosticAdvice;
|
|
70
70
|
message: string;
|
|
71
71
|
};
|
package/build/es/errors.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { Diagnostic, Diagnostics } from './types';
|
|
3
|
+
export declare function isNodeError(error: unknown): error is NodeJS.ErrnoException;
|
|
2
4
|
export declare function createSingleDiagnosticError(diag: Diagnostic, errorClass?: typeof DiagnosticsError): DiagnosticsError;
|
|
3
5
|
export declare class DiagnosticsError extends Error {
|
|
4
6
|
constructor(message: undefined | string, diagnostics: Diagnostics);
|
|
@@ -11,4 +13,6 @@ export declare class LwrConfigValidationError extends DiagnosticsError {
|
|
|
11
13
|
}
|
|
12
14
|
export declare class LwrUnresolvableError extends DiagnosticsError {
|
|
13
15
|
}
|
|
16
|
+
export declare class LwrServerError extends DiagnosticsError {
|
|
17
|
+
}
|
|
14
18
|
//# sourceMappingURL=errors.d.ts.map
|
package/build/es/errors.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// The NodeJS Error is different from the JavaScript Error (e.g. NodeJS Error has a code)
|
|
2
|
+
export function isNodeError(error) {
|
|
3
|
+
return error instanceof Error;
|
|
4
|
+
}
|
|
1
5
|
export function createSingleDiagnosticError(diag, errorClass = DiagnosticsError) {
|
|
2
6
|
return new errorClass(diag.description.message, [diag]);
|
|
3
7
|
}
|
|
@@ -26,4 +30,6 @@ export class LwrConfigValidationError extends DiagnosticsError {
|
|
|
26
30
|
}
|
|
27
31
|
export class LwrUnresolvableError extends DiagnosticsError {
|
|
28
32
|
}
|
|
33
|
+
export class LwrServerError extends DiagnosticsError {
|
|
34
|
+
}
|
|
29
35
|
//# sourceMappingURL=errors.js.map
|
package/package.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.
|
|
8
|
-
"homepage": "https://
|
|
7
|
+
"version": "0.6.0-alpha.12",
|
|
8
|
+
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/salesforce/lwr.git",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"build/**/*.d.ts"
|
|
31
31
|
],
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@lwrjs/types": "0.
|
|
33
|
+
"@lwrjs/types": "0.6.0-alpha.12"
|
|
34
34
|
},
|
|
35
35
|
"engines": {
|
|
36
36
|
"node": ">=14.15.4 <17"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "876b56ca4f98f3299303f2193c0dec8f46a69b84"
|
|
39
39
|
}
|