houdini 1.0.0-next.4 → 1.0.0-next.5
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/cmd-cjs/index.js +1217 -1021
- package/build/cmd-esm/index.js +1217 -1021
- package/build/codegen/generators/artifacts/utils.d.ts +0 -1
- package/build/codegen-cjs/index.js +810 -676
- package/build/codegen-esm/index.js +810 -676
- package/build/lib/config.d.ts +10 -90
- package/build/lib/deepMerge.d.ts +1 -0
- package/build/lib/graphql.d.ts +5 -2
- package/build/lib/index.d.ts +2 -0
- package/build/lib/pipeline.d.ts +1 -1
- package/build/lib/plugin.d.ts +2 -0
- package/build/lib/types.d.ts +250 -2
- package/build/lib-cjs/index.js +351 -162
- package/build/lib-esm/index.js +349 -162
- package/build/runtime/cache/cache.d.ts +20 -3
- package/build/runtime/cache/staleManager.d.ts +30 -0
- package/build/runtime/cache/subscription.d.ts +2 -1
- package/build/runtime/client/plugins/subscription.d.ts +1 -2
- package/build/runtime/lib/config.d.ts +4 -0
- package/build/runtime/lib/index.d.ts +1 -0
- package/build/runtime/lib/key.d.ts +6 -0
- package/build/runtime/lib/types.d.ts +2 -2
- package/build/runtime/public/cache.d.ts +8 -1
- package/build/runtime/public/record.d.ts +11 -1
- package/build/runtime/public/tests/test.d.ts +9 -10
- package/build/runtime-cjs/cache/cache.d.ts +20 -3
- package/build/runtime-cjs/cache/cache.js +65 -6
- package/build/runtime-cjs/cache/gc.js +9 -0
- package/build/runtime-cjs/cache/staleManager.d.ts +30 -0
- package/build/runtime-cjs/cache/staleManager.js +95 -0
- package/build/runtime-cjs/cache/subscription.d.ts +2 -1
- package/build/runtime-cjs/cache/subscription.js +6 -3
- package/build/runtime-cjs/client/documentStore.js +1 -0
- package/build/runtime-cjs/client/plugins/cache.js +5 -3
- package/build/runtime-cjs/client/plugins/fetch.js +1 -0
- package/build/runtime-cjs/client/plugins/query.js +1 -0
- package/build/runtime-cjs/client/plugins/subscription.d.ts +1 -2
- package/build/runtime-cjs/client/plugins/subscription.js +2 -0
- package/build/runtime-cjs/lib/config.d.ts +4 -0
- package/build/runtime-cjs/lib/index.d.ts +1 -0
- package/build/runtime-cjs/lib/index.js +1 -0
- package/build/runtime-cjs/lib/key.d.ts +6 -0
- package/build/runtime-cjs/lib/key.js +41 -0
- package/build/runtime-cjs/lib/types.d.ts +2 -2
- package/build/runtime-cjs/public/cache.d.ts +8 -1
- package/build/runtime-cjs/public/cache.js +3 -0
- package/build/runtime-cjs/public/record.d.ts +11 -1
- package/build/runtime-cjs/public/record.js +8 -1
- package/build/runtime-cjs/public/tests/test.d.ts +9 -10
- package/build/runtime-esm/cache/cache.d.ts +20 -3
- package/build/runtime-esm/cache/cache.js +66 -7
- package/build/runtime-esm/cache/gc.js +9 -0
- package/build/runtime-esm/cache/staleManager.d.ts +30 -0
- package/build/runtime-esm/cache/staleManager.js +71 -0
- package/build/runtime-esm/cache/subscription.d.ts +2 -1
- package/build/runtime-esm/cache/subscription.js +6 -3
- package/build/runtime-esm/client/documentStore.js +1 -0
- package/build/runtime-esm/client/plugins/cache.js +5 -3
- package/build/runtime-esm/client/plugins/fetch.js +1 -0
- package/build/runtime-esm/client/plugins/query.js +1 -0
- package/build/runtime-esm/client/plugins/subscription.d.ts +1 -2
- package/build/runtime-esm/client/plugins/subscription.js +2 -0
- package/build/runtime-esm/lib/config.d.ts +4 -0
- package/build/runtime-esm/lib/index.d.ts +1 -0
- package/build/runtime-esm/lib/index.js +1 -0
- package/build/runtime-esm/lib/key.d.ts +6 -0
- package/build/runtime-esm/lib/key.js +17 -0
- package/build/runtime-esm/lib/types.d.ts +2 -2
- package/build/runtime-esm/public/cache.d.ts +8 -1
- package/build/runtime-esm/public/cache.js +3 -0
- package/build/runtime-esm/public/record.d.ts +11 -1
- package/build/runtime-esm/public/record.js +8 -1
- package/build/runtime-esm/public/tests/test.d.ts +9 -10
- package/build/test-cjs/index.js +893 -747
- package/build/test-esm/index.js +893 -747
- package/build/vite-cjs/index.js +1195 -998
- package/build/vite-esm/index.js +1195 -998
- package/package.json +3 -2
package/build/vite-cjs/index.js
CHANGED
|
@@ -13,8 +13,8 @@ var __commonJS = (cb, mod) => function __require() {
|
|
|
13
13
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
14
14
|
};
|
|
15
15
|
var __export = (target, all) => {
|
|
16
|
-
for (var
|
|
17
|
-
__defProp(target,
|
|
16
|
+
for (var name in all)
|
|
17
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
18
|
};
|
|
19
19
|
var __copyProps = (to, from, except, desc) => {
|
|
20
20
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -4986,9 +4986,9 @@ var require_inspect = __commonJS({
|
|
|
4986
4986
|
function getObjectTag2(object) {
|
|
4987
4987
|
var tag = Object.prototype.toString.call(object).replace(/^\[object /, "").replace(/]$/, "");
|
|
4988
4988
|
if (tag === "Object" && typeof object.constructor === "function") {
|
|
4989
|
-
var
|
|
4990
|
-
if (typeof
|
|
4991
|
-
return
|
|
4989
|
+
var name = object.constructor.name;
|
|
4990
|
+
if (typeof name === "string" && name !== "") {
|
|
4991
|
+
return name;
|
|
4992
4992
|
}
|
|
4993
4993
|
}
|
|
4994
4994
|
return tag;
|
|
@@ -5094,14 +5094,14 @@ var require_source = __commonJS({
|
|
|
5094
5094
|
}
|
|
5095
5095
|
var Source3 = /* @__PURE__ */ function() {
|
|
5096
5096
|
function Source4(body) {
|
|
5097
|
-
var
|
|
5097
|
+
var name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "GraphQL request";
|
|
5098
5098
|
var locationOffset = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
5099
5099
|
line: 1,
|
|
5100
5100
|
column: 1
|
|
5101
5101
|
};
|
|
5102
5102
|
typeof body === "string" || (0, _devAssert.default)(0, "Body must be a string. Received: ".concat((0, _inspect.default)(body), "."));
|
|
5103
5103
|
this.body = body;
|
|
5104
|
-
this.name =
|
|
5104
|
+
this.name = name;
|
|
5105
5105
|
this.locationOffset = locationOffset;
|
|
5106
5106
|
this.locationOffset.line > 0 || (0, _devAssert.default)(0, "line in locationOffset is 1-indexed and must be positive.");
|
|
5107
5107
|
this.locationOffset.column > 0 || (0, _devAssert.default)(0, "column in locationOffset is 1-indexed and must be positive.");
|
|
@@ -5717,14 +5717,14 @@ var require_parser = __commonJS({
|
|
|
5717
5717
|
};
|
|
5718
5718
|
}
|
|
5719
5719
|
var operation = this.parseOperationType();
|
|
5720
|
-
var
|
|
5720
|
+
var name;
|
|
5721
5721
|
if (this.peek(_tokenKind.TokenKind.NAME)) {
|
|
5722
|
-
|
|
5722
|
+
name = this.parseName();
|
|
5723
5723
|
}
|
|
5724
5724
|
return {
|
|
5725
5725
|
kind: _kinds.Kind.OPERATION_DEFINITION,
|
|
5726
5726
|
operation,
|
|
5727
|
-
name
|
|
5727
|
+
name,
|
|
5728
5728
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
5729
5729
|
directives: this.parseDirectives(false),
|
|
5730
5730
|
selectionSet: this.parseSelectionSet(),
|
|
@@ -5781,17 +5781,17 @@ var require_parser = __commonJS({
|
|
|
5781
5781
|
var start = this._lexer.token;
|
|
5782
5782
|
var nameOrAlias = this.parseName();
|
|
5783
5783
|
var alias;
|
|
5784
|
-
var
|
|
5784
|
+
var name;
|
|
5785
5785
|
if (this.expectOptionalToken(_tokenKind.TokenKind.COLON)) {
|
|
5786
5786
|
alias = nameOrAlias;
|
|
5787
|
-
|
|
5787
|
+
name = this.parseName();
|
|
5788
5788
|
} else {
|
|
5789
|
-
|
|
5789
|
+
name = nameOrAlias;
|
|
5790
5790
|
}
|
|
5791
5791
|
return {
|
|
5792
5792
|
kind: _kinds.Kind.FIELD,
|
|
5793
5793
|
alias,
|
|
5794
|
-
name
|
|
5794
|
+
name,
|
|
5795
5795
|
arguments: this.parseArguments(false),
|
|
5796
5796
|
directives: this.parseDirectives(false),
|
|
5797
5797
|
selectionSet: this.peek(_tokenKind.TokenKind.BRACE_L) ? this.parseSelectionSet() : void 0,
|
|
@@ -5804,11 +5804,11 @@ var require_parser = __commonJS({
|
|
|
5804
5804
|
};
|
|
5805
5805
|
_proto.parseArgument = function parseArgument() {
|
|
5806
5806
|
var start = this._lexer.token;
|
|
5807
|
-
var
|
|
5807
|
+
var name = this.parseName();
|
|
5808
5808
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
5809
5809
|
return {
|
|
5810
5810
|
kind: _kinds.Kind.ARGUMENT,
|
|
5811
|
-
name
|
|
5811
|
+
name,
|
|
5812
5812
|
value: this.parseValueLiteral(false),
|
|
5813
5813
|
loc: this.loc(start)
|
|
5814
5814
|
};
|
|
@@ -5967,11 +5967,11 @@ var require_parser = __commonJS({
|
|
|
5967
5967
|
};
|
|
5968
5968
|
_proto.parseObjectField = function parseObjectField(isConst) {
|
|
5969
5969
|
var start = this._lexer.token;
|
|
5970
|
-
var
|
|
5970
|
+
var name = this.parseName();
|
|
5971
5971
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
5972
5972
|
return {
|
|
5973
5973
|
kind: _kinds.Kind.OBJECT_FIELD,
|
|
5974
|
-
name
|
|
5974
|
+
name,
|
|
5975
5975
|
value: this.parseValueLiteral(isConst),
|
|
5976
5976
|
loc: this.loc(start)
|
|
5977
5977
|
};
|
|
@@ -6086,12 +6086,12 @@ var require_parser = __commonJS({
|
|
|
6086
6086
|
var start = this._lexer.token;
|
|
6087
6087
|
var description = this.parseDescription();
|
|
6088
6088
|
this.expectKeyword("scalar");
|
|
6089
|
-
var
|
|
6089
|
+
var name = this.parseName();
|
|
6090
6090
|
var directives = this.parseDirectives(true);
|
|
6091
6091
|
return {
|
|
6092
6092
|
kind: _kinds.Kind.SCALAR_TYPE_DEFINITION,
|
|
6093
6093
|
description,
|
|
6094
|
-
name
|
|
6094
|
+
name,
|
|
6095
6095
|
directives,
|
|
6096
6096
|
loc: this.loc(start)
|
|
6097
6097
|
};
|
|
@@ -6100,14 +6100,14 @@ var require_parser = __commonJS({
|
|
|
6100
6100
|
var start = this._lexer.token;
|
|
6101
6101
|
var description = this.parseDescription();
|
|
6102
6102
|
this.expectKeyword("type");
|
|
6103
|
-
var
|
|
6103
|
+
var name = this.parseName();
|
|
6104
6104
|
var interfaces = this.parseImplementsInterfaces();
|
|
6105
6105
|
var directives = this.parseDirectives(true);
|
|
6106
6106
|
var fields = this.parseFieldsDefinition();
|
|
6107
6107
|
return {
|
|
6108
6108
|
kind: _kinds.Kind.OBJECT_TYPE_DEFINITION,
|
|
6109
6109
|
description,
|
|
6110
|
-
name
|
|
6110
|
+
name,
|
|
6111
6111
|
interfaces,
|
|
6112
6112
|
directives,
|
|
6113
6113
|
fields,
|
|
@@ -6141,7 +6141,7 @@ var require_parser = __commonJS({
|
|
|
6141
6141
|
_proto.parseFieldDefinition = function parseFieldDefinition() {
|
|
6142
6142
|
var start = this._lexer.token;
|
|
6143
6143
|
var description = this.parseDescription();
|
|
6144
|
-
var
|
|
6144
|
+
var name = this.parseName();
|
|
6145
6145
|
var args = this.parseArgumentDefs();
|
|
6146
6146
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
6147
6147
|
var type = this.parseTypeReference();
|
|
@@ -6149,7 +6149,7 @@ var require_parser = __commonJS({
|
|
|
6149
6149
|
return {
|
|
6150
6150
|
kind: _kinds.Kind.FIELD_DEFINITION,
|
|
6151
6151
|
description,
|
|
6152
|
-
name
|
|
6152
|
+
name,
|
|
6153
6153
|
arguments: args,
|
|
6154
6154
|
type,
|
|
6155
6155
|
directives,
|
|
@@ -6162,7 +6162,7 @@ var require_parser = __commonJS({
|
|
|
6162
6162
|
_proto.parseInputValueDef = function parseInputValueDef() {
|
|
6163
6163
|
var start = this._lexer.token;
|
|
6164
6164
|
var description = this.parseDescription();
|
|
6165
|
-
var
|
|
6165
|
+
var name = this.parseName();
|
|
6166
6166
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
6167
6167
|
var type = this.parseTypeReference();
|
|
6168
6168
|
var defaultValue;
|
|
@@ -6173,7 +6173,7 @@ var require_parser = __commonJS({
|
|
|
6173
6173
|
return {
|
|
6174
6174
|
kind: _kinds.Kind.INPUT_VALUE_DEFINITION,
|
|
6175
6175
|
description,
|
|
6176
|
-
name
|
|
6176
|
+
name,
|
|
6177
6177
|
type,
|
|
6178
6178
|
defaultValue,
|
|
6179
6179
|
directives,
|
|
@@ -6184,14 +6184,14 @@ var require_parser = __commonJS({
|
|
|
6184
6184
|
var start = this._lexer.token;
|
|
6185
6185
|
var description = this.parseDescription();
|
|
6186
6186
|
this.expectKeyword("interface");
|
|
6187
|
-
var
|
|
6187
|
+
var name = this.parseName();
|
|
6188
6188
|
var interfaces = this.parseImplementsInterfaces();
|
|
6189
6189
|
var directives = this.parseDirectives(true);
|
|
6190
6190
|
var fields = this.parseFieldsDefinition();
|
|
6191
6191
|
return {
|
|
6192
6192
|
kind: _kinds.Kind.INTERFACE_TYPE_DEFINITION,
|
|
6193
6193
|
description,
|
|
6194
|
-
name
|
|
6194
|
+
name,
|
|
6195
6195
|
interfaces,
|
|
6196
6196
|
directives,
|
|
6197
6197
|
fields,
|
|
@@ -6202,13 +6202,13 @@ var require_parser = __commonJS({
|
|
|
6202
6202
|
var start = this._lexer.token;
|
|
6203
6203
|
var description = this.parseDescription();
|
|
6204
6204
|
this.expectKeyword("union");
|
|
6205
|
-
var
|
|
6205
|
+
var name = this.parseName();
|
|
6206
6206
|
var directives = this.parseDirectives(true);
|
|
6207
6207
|
var types17 = this.parseUnionMemberTypes();
|
|
6208
6208
|
return {
|
|
6209
6209
|
kind: _kinds.Kind.UNION_TYPE_DEFINITION,
|
|
6210
6210
|
description,
|
|
6211
|
-
name
|
|
6211
|
+
name,
|
|
6212
6212
|
directives,
|
|
6213
6213
|
types: types17,
|
|
6214
6214
|
loc: this.loc(start)
|
|
@@ -6221,13 +6221,13 @@ var require_parser = __commonJS({
|
|
|
6221
6221
|
var start = this._lexer.token;
|
|
6222
6222
|
var description = this.parseDescription();
|
|
6223
6223
|
this.expectKeyword("enum");
|
|
6224
|
-
var
|
|
6224
|
+
var name = this.parseName();
|
|
6225
6225
|
var directives = this.parseDirectives(true);
|
|
6226
6226
|
var values = this.parseEnumValuesDefinition();
|
|
6227
6227
|
return {
|
|
6228
6228
|
kind: _kinds.Kind.ENUM_TYPE_DEFINITION,
|
|
6229
6229
|
description,
|
|
6230
|
-
name
|
|
6230
|
+
name,
|
|
6231
6231
|
directives,
|
|
6232
6232
|
values,
|
|
6233
6233
|
loc: this.loc(start)
|
|
@@ -6239,12 +6239,12 @@ var require_parser = __commonJS({
|
|
|
6239
6239
|
_proto.parseEnumValueDefinition = function parseEnumValueDefinition() {
|
|
6240
6240
|
var start = this._lexer.token;
|
|
6241
6241
|
var description = this.parseDescription();
|
|
6242
|
-
var
|
|
6242
|
+
var name = this.parseName();
|
|
6243
6243
|
var directives = this.parseDirectives(true);
|
|
6244
6244
|
return {
|
|
6245
6245
|
kind: _kinds.Kind.ENUM_VALUE_DEFINITION,
|
|
6246
6246
|
description,
|
|
6247
|
-
name
|
|
6247
|
+
name,
|
|
6248
6248
|
directives,
|
|
6249
6249
|
loc: this.loc(start)
|
|
6250
6250
|
};
|
|
@@ -6253,13 +6253,13 @@ var require_parser = __commonJS({
|
|
|
6253
6253
|
var start = this._lexer.token;
|
|
6254
6254
|
var description = this.parseDescription();
|
|
6255
6255
|
this.expectKeyword("input");
|
|
6256
|
-
var
|
|
6256
|
+
var name = this.parseName();
|
|
6257
6257
|
var directives = this.parseDirectives(true);
|
|
6258
6258
|
var fields = this.parseInputFieldsDefinition();
|
|
6259
6259
|
return {
|
|
6260
6260
|
kind: _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION,
|
|
6261
6261
|
description,
|
|
6262
|
-
name
|
|
6262
|
+
name,
|
|
6263
6263
|
directives,
|
|
6264
6264
|
fields,
|
|
6265
6265
|
loc: this.loc(start)
|
|
@@ -6310,14 +6310,14 @@ var require_parser = __commonJS({
|
|
|
6310
6310
|
var start = this._lexer.token;
|
|
6311
6311
|
this.expectKeyword("extend");
|
|
6312
6312
|
this.expectKeyword("scalar");
|
|
6313
|
-
var
|
|
6313
|
+
var name = this.parseName();
|
|
6314
6314
|
var directives = this.parseDirectives(true);
|
|
6315
6315
|
if (directives.length === 0) {
|
|
6316
6316
|
throw this.unexpected();
|
|
6317
6317
|
}
|
|
6318
6318
|
return {
|
|
6319
6319
|
kind: _kinds.Kind.SCALAR_TYPE_EXTENSION,
|
|
6320
|
-
name
|
|
6320
|
+
name,
|
|
6321
6321
|
directives,
|
|
6322
6322
|
loc: this.loc(start)
|
|
6323
6323
|
};
|
|
@@ -6326,7 +6326,7 @@ var require_parser = __commonJS({
|
|
|
6326
6326
|
var start = this._lexer.token;
|
|
6327
6327
|
this.expectKeyword("extend");
|
|
6328
6328
|
this.expectKeyword("type");
|
|
6329
|
-
var
|
|
6329
|
+
var name = this.parseName();
|
|
6330
6330
|
var interfaces = this.parseImplementsInterfaces();
|
|
6331
6331
|
var directives = this.parseDirectives(true);
|
|
6332
6332
|
var fields = this.parseFieldsDefinition();
|
|
@@ -6335,7 +6335,7 @@ var require_parser = __commonJS({
|
|
|
6335
6335
|
}
|
|
6336
6336
|
return {
|
|
6337
6337
|
kind: _kinds.Kind.OBJECT_TYPE_EXTENSION,
|
|
6338
|
-
name
|
|
6338
|
+
name,
|
|
6339
6339
|
interfaces,
|
|
6340
6340
|
directives,
|
|
6341
6341
|
fields,
|
|
@@ -6346,7 +6346,7 @@ var require_parser = __commonJS({
|
|
|
6346
6346
|
var start = this._lexer.token;
|
|
6347
6347
|
this.expectKeyword("extend");
|
|
6348
6348
|
this.expectKeyword("interface");
|
|
6349
|
-
var
|
|
6349
|
+
var name = this.parseName();
|
|
6350
6350
|
var interfaces = this.parseImplementsInterfaces();
|
|
6351
6351
|
var directives = this.parseDirectives(true);
|
|
6352
6352
|
var fields = this.parseFieldsDefinition();
|
|
@@ -6355,7 +6355,7 @@ var require_parser = __commonJS({
|
|
|
6355
6355
|
}
|
|
6356
6356
|
return {
|
|
6357
6357
|
kind: _kinds.Kind.INTERFACE_TYPE_EXTENSION,
|
|
6358
|
-
name
|
|
6358
|
+
name,
|
|
6359
6359
|
interfaces,
|
|
6360
6360
|
directives,
|
|
6361
6361
|
fields,
|
|
@@ -6366,7 +6366,7 @@ var require_parser = __commonJS({
|
|
|
6366
6366
|
var start = this._lexer.token;
|
|
6367
6367
|
this.expectKeyword("extend");
|
|
6368
6368
|
this.expectKeyword("union");
|
|
6369
|
-
var
|
|
6369
|
+
var name = this.parseName();
|
|
6370
6370
|
var directives = this.parseDirectives(true);
|
|
6371
6371
|
var types17 = this.parseUnionMemberTypes();
|
|
6372
6372
|
if (directives.length === 0 && types17.length === 0) {
|
|
@@ -6374,7 +6374,7 @@ var require_parser = __commonJS({
|
|
|
6374
6374
|
}
|
|
6375
6375
|
return {
|
|
6376
6376
|
kind: _kinds.Kind.UNION_TYPE_EXTENSION,
|
|
6377
|
-
name
|
|
6377
|
+
name,
|
|
6378
6378
|
directives,
|
|
6379
6379
|
types: types17,
|
|
6380
6380
|
loc: this.loc(start)
|
|
@@ -6384,7 +6384,7 @@ var require_parser = __commonJS({
|
|
|
6384
6384
|
var start = this._lexer.token;
|
|
6385
6385
|
this.expectKeyword("extend");
|
|
6386
6386
|
this.expectKeyword("enum");
|
|
6387
|
-
var
|
|
6387
|
+
var name = this.parseName();
|
|
6388
6388
|
var directives = this.parseDirectives(true);
|
|
6389
6389
|
var values = this.parseEnumValuesDefinition();
|
|
6390
6390
|
if (directives.length === 0 && values.length === 0) {
|
|
@@ -6392,7 +6392,7 @@ var require_parser = __commonJS({
|
|
|
6392
6392
|
}
|
|
6393
6393
|
return {
|
|
6394
6394
|
kind: _kinds.Kind.ENUM_TYPE_EXTENSION,
|
|
6395
|
-
name
|
|
6395
|
+
name,
|
|
6396
6396
|
directives,
|
|
6397
6397
|
values,
|
|
6398
6398
|
loc: this.loc(start)
|
|
@@ -6402,7 +6402,7 @@ var require_parser = __commonJS({
|
|
|
6402
6402
|
var start = this._lexer.token;
|
|
6403
6403
|
this.expectKeyword("extend");
|
|
6404
6404
|
this.expectKeyword("input");
|
|
6405
|
-
var
|
|
6405
|
+
var name = this.parseName();
|
|
6406
6406
|
var directives = this.parseDirectives(true);
|
|
6407
6407
|
var fields = this.parseInputFieldsDefinition();
|
|
6408
6408
|
if (directives.length === 0 && fields.length === 0) {
|
|
@@ -6410,7 +6410,7 @@ var require_parser = __commonJS({
|
|
|
6410
6410
|
}
|
|
6411
6411
|
return {
|
|
6412
6412
|
kind: _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION,
|
|
6413
|
-
name
|
|
6413
|
+
name,
|
|
6414
6414
|
directives,
|
|
6415
6415
|
fields,
|
|
6416
6416
|
loc: this.loc(start)
|
|
@@ -6421,7 +6421,7 @@ var require_parser = __commonJS({
|
|
|
6421
6421
|
var description = this.parseDescription();
|
|
6422
6422
|
this.expectKeyword("directive");
|
|
6423
6423
|
this.expectToken(_tokenKind.TokenKind.AT);
|
|
6424
|
-
var
|
|
6424
|
+
var name = this.parseName();
|
|
6425
6425
|
var args = this.parseArgumentDefs();
|
|
6426
6426
|
var repeatable = this.expectOptionalKeyword("repeatable");
|
|
6427
6427
|
this.expectKeyword("on");
|
|
@@ -6429,7 +6429,7 @@ var require_parser = __commonJS({
|
|
|
6429
6429
|
return {
|
|
6430
6430
|
kind: _kinds.Kind.DIRECTIVE_DEFINITION,
|
|
6431
6431
|
description,
|
|
6432
|
-
name
|
|
6432
|
+
name,
|
|
6433
6433
|
arguments: args,
|
|
6434
6434
|
repeatable,
|
|
6435
6435
|
locations,
|
|
@@ -6441,9 +6441,9 @@ var require_parser = __commonJS({
|
|
|
6441
6441
|
};
|
|
6442
6442
|
_proto.parseDirectiveLocation = function parseDirectiveLocation() {
|
|
6443
6443
|
var start = this._lexer.token;
|
|
6444
|
-
var
|
|
6445
|
-
if (_directiveLocation.DirectiveLocation[
|
|
6446
|
-
return
|
|
6444
|
+
var name = this.parseName();
|
|
6445
|
+
if (_directiveLocation.DirectiveLocation[name.value] !== void 0) {
|
|
6446
|
+
return name;
|
|
6447
6447
|
}
|
|
6448
6448
|
throw this.unexpected(start);
|
|
6449
6449
|
};
|
|
@@ -6882,20 +6882,20 @@ var require_assertValidName = __commonJS({
|
|
|
6882
6882
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
6883
6883
|
}
|
|
6884
6884
|
var NAME_RX = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
6885
|
-
function assertValidName(
|
|
6886
|
-
var error = isValidNameError(
|
|
6885
|
+
function assertValidName(name) {
|
|
6886
|
+
var error = isValidNameError(name);
|
|
6887
6887
|
if (error) {
|
|
6888
6888
|
throw error;
|
|
6889
6889
|
}
|
|
6890
|
-
return
|
|
6890
|
+
return name;
|
|
6891
6891
|
}
|
|
6892
|
-
function isValidNameError(
|
|
6893
|
-
typeof
|
|
6894
|
-
if (
|
|
6895
|
-
return new _GraphQLError.GraphQLError('Name "'.concat(
|
|
6892
|
+
function isValidNameError(name) {
|
|
6893
|
+
typeof name === "string" || (0, _devAssert.default)(0, "Expected name to be a string.");
|
|
6894
|
+
if (name.length > 1 && name[0] === "_" && name[1] === "_") {
|
|
6895
|
+
return new _GraphQLError.GraphQLError('Name "'.concat(name, '" must not begin with "__", which is reserved by GraphQL introspection.'));
|
|
6896
6896
|
}
|
|
6897
|
-
if (!NAME_RX.test(
|
|
6898
|
-
return new _GraphQLError.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'.concat(
|
|
6897
|
+
if (!NAME_RX.test(name)) {
|
|
6898
|
+
return new _GraphQLError.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'.concat(name, '" does not.'));
|
|
6899
6899
|
}
|
|
6900
6900
|
}
|
|
6901
6901
|
}
|
|
@@ -7235,11 +7235,11 @@ var require_printer = __commonJS({
|
|
|
7235
7235
|
},
|
|
7236
7236
|
OperationDefinition: function OperationDefinition(node) {
|
|
7237
7237
|
var op = node.operation;
|
|
7238
|
-
var
|
|
7238
|
+
var name = node.name;
|
|
7239
7239
|
var varDefs = wrap2("(", join3(node.variableDefinitions, ", "), ")");
|
|
7240
7240
|
var directives = join3(node.directives, " ");
|
|
7241
7241
|
var selectionSet = node.selectionSet;
|
|
7242
|
-
return !
|
|
7242
|
+
return !name && !directives && !varDefs && op === "query" ? selectionSet : join3([op, join3([name, varDefs]), directives, selectionSet], " ");
|
|
7243
7243
|
},
|
|
7244
7244
|
VariableDefinition: function VariableDefinition(_ref) {
|
|
7245
7245
|
var variable = _ref.variable, type = _ref.type, defaultValue = _ref.defaultValue, directives = _ref.directives;
|
|
@@ -7250,8 +7250,8 @@ var require_printer = __commonJS({
|
|
|
7250
7250
|
return block2(selections);
|
|
7251
7251
|
},
|
|
7252
7252
|
Field: function Field(_ref3) {
|
|
7253
|
-
var alias = _ref3.alias,
|
|
7254
|
-
var prefix = wrap2("", alias, ": ") +
|
|
7253
|
+
var alias = _ref3.alias, name = _ref3.name, args = _ref3.arguments, directives = _ref3.directives, selectionSet = _ref3.selectionSet;
|
|
7254
|
+
var prefix = wrap2("", alias, ": ") + name;
|
|
7255
7255
|
var argsLine = prefix + wrap2("(", join3(args, ", "), ")");
|
|
7256
7256
|
if (argsLine.length > MAX_LINE_LENGTH2) {
|
|
7257
7257
|
argsLine = prefix + wrap2("(\n", indent2(join3(args, "\n")), "\n)");
|
|
@@ -7259,20 +7259,20 @@ var require_printer = __commonJS({
|
|
|
7259
7259
|
return join3([argsLine, join3(directives, " "), selectionSet], " ");
|
|
7260
7260
|
},
|
|
7261
7261
|
Argument: function Argument(_ref4) {
|
|
7262
|
-
var
|
|
7263
|
-
return
|
|
7262
|
+
var name = _ref4.name, value = _ref4.value;
|
|
7263
|
+
return name + ": " + value;
|
|
7264
7264
|
},
|
|
7265
7265
|
FragmentSpread: function FragmentSpread(_ref5) {
|
|
7266
|
-
var
|
|
7267
|
-
return "..." +
|
|
7266
|
+
var name = _ref5.name, directives = _ref5.directives;
|
|
7267
|
+
return "..." + name + wrap2(" ", join3(directives, " "));
|
|
7268
7268
|
},
|
|
7269
7269
|
InlineFragment: function InlineFragment(_ref6) {
|
|
7270
7270
|
var typeCondition = _ref6.typeCondition, directives = _ref6.directives, selectionSet = _ref6.selectionSet;
|
|
7271
7271
|
return join3(["...", wrap2("on ", typeCondition), join3(directives, " "), selectionSet], " ");
|
|
7272
7272
|
},
|
|
7273
7273
|
FragmentDefinition: function FragmentDefinition(_ref7) {
|
|
7274
|
-
var
|
|
7275
|
-
return "fragment ".concat(
|
|
7274
|
+
var name = _ref7.name, typeCondition = _ref7.typeCondition, variableDefinitions = _ref7.variableDefinitions, directives = _ref7.directives, selectionSet = _ref7.selectionSet;
|
|
7275
|
+
return "fragment ".concat(name).concat(wrap2("(", join3(variableDefinitions, ", "), ")"), " ") + "on ".concat(typeCondition, " ").concat(wrap2("", join3(directives, " "), " ")) + selectionSet;
|
|
7276
7276
|
},
|
|
7277
7277
|
IntValue: function IntValue(_ref8) {
|
|
7278
7278
|
var value = _ref8.value;
|
|
@@ -7306,16 +7306,16 @@ var require_printer = __commonJS({
|
|
|
7306
7306
|
return "{" + join3(fields, ", ") + "}";
|
|
7307
7307
|
},
|
|
7308
7308
|
ObjectField: function ObjectField(_ref15) {
|
|
7309
|
-
var
|
|
7310
|
-
return
|
|
7309
|
+
var name = _ref15.name, value = _ref15.value;
|
|
7310
|
+
return name + ": " + value;
|
|
7311
7311
|
},
|
|
7312
7312
|
Directive: function Directive(_ref16) {
|
|
7313
|
-
var
|
|
7314
|
-
return "@" +
|
|
7313
|
+
var name = _ref16.name, args = _ref16.arguments;
|
|
7314
|
+
return "@" + name + wrap2("(", join3(args, ", "), ")");
|
|
7315
7315
|
},
|
|
7316
7316
|
NamedType: function NamedType(_ref17) {
|
|
7317
|
-
var
|
|
7318
|
-
return
|
|
7317
|
+
var name = _ref17.name;
|
|
7318
|
+
return name;
|
|
7319
7319
|
},
|
|
7320
7320
|
ListType: function ListType(_ref18) {
|
|
7321
7321
|
var type = _ref18.type;
|
|
@@ -7334,72 +7334,72 @@ var require_printer = __commonJS({
|
|
|
7334
7334
|
return operation + ": " + type;
|
|
7335
7335
|
},
|
|
7336
7336
|
ScalarTypeDefinition: addDescription2(function(_ref22) {
|
|
7337
|
-
var
|
|
7338
|
-
return join3(["scalar",
|
|
7337
|
+
var name = _ref22.name, directives = _ref22.directives;
|
|
7338
|
+
return join3(["scalar", name, join3(directives, " ")], " ");
|
|
7339
7339
|
}),
|
|
7340
7340
|
ObjectTypeDefinition: addDescription2(function(_ref23) {
|
|
7341
|
-
var
|
|
7342
|
-
return join3(["type",
|
|
7341
|
+
var name = _ref23.name, interfaces = _ref23.interfaces, directives = _ref23.directives, fields = _ref23.fields;
|
|
7342
|
+
return join3(["type", name, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ");
|
|
7343
7343
|
}),
|
|
7344
7344
|
FieldDefinition: addDescription2(function(_ref24) {
|
|
7345
|
-
var
|
|
7346
|
-
return
|
|
7345
|
+
var name = _ref24.name, args = _ref24.arguments, type = _ref24.type, directives = _ref24.directives;
|
|
7346
|
+
return name + (hasMultilineItems2(args) ? wrap2("(\n", indent2(join3(args, "\n")), "\n)") : wrap2("(", join3(args, ", "), ")")) + ": " + type + wrap2(" ", join3(directives, " "));
|
|
7347
7347
|
}),
|
|
7348
7348
|
InputValueDefinition: addDescription2(function(_ref25) {
|
|
7349
|
-
var
|
|
7350
|
-
return join3([
|
|
7349
|
+
var name = _ref25.name, type = _ref25.type, defaultValue = _ref25.defaultValue, directives = _ref25.directives;
|
|
7350
|
+
return join3([name + ": " + type, wrap2("= ", defaultValue), join3(directives, " ")], " ");
|
|
7351
7351
|
}),
|
|
7352
7352
|
InterfaceTypeDefinition: addDescription2(function(_ref26) {
|
|
7353
|
-
var
|
|
7354
|
-
return join3(["interface",
|
|
7353
|
+
var name = _ref26.name, interfaces = _ref26.interfaces, directives = _ref26.directives, fields = _ref26.fields;
|
|
7354
|
+
return join3(["interface", name, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ");
|
|
7355
7355
|
}),
|
|
7356
7356
|
UnionTypeDefinition: addDescription2(function(_ref27) {
|
|
7357
|
-
var
|
|
7358
|
-
return join3(["union",
|
|
7357
|
+
var name = _ref27.name, directives = _ref27.directives, types17 = _ref27.types;
|
|
7358
|
+
return join3(["union", name, join3(directives, " "), types17 && types17.length !== 0 ? "= " + join3(types17, " | ") : ""], " ");
|
|
7359
7359
|
}),
|
|
7360
7360
|
EnumTypeDefinition: addDescription2(function(_ref28) {
|
|
7361
|
-
var
|
|
7362
|
-
return join3(["enum",
|
|
7361
|
+
var name = _ref28.name, directives = _ref28.directives, values = _ref28.values;
|
|
7362
|
+
return join3(["enum", name, join3(directives, " "), block2(values)], " ");
|
|
7363
7363
|
}),
|
|
7364
7364
|
EnumValueDefinition: addDescription2(function(_ref29) {
|
|
7365
|
-
var
|
|
7366
|
-
return join3([
|
|
7365
|
+
var name = _ref29.name, directives = _ref29.directives;
|
|
7366
|
+
return join3([name, join3(directives, " ")], " ");
|
|
7367
7367
|
}),
|
|
7368
7368
|
InputObjectTypeDefinition: addDescription2(function(_ref30) {
|
|
7369
|
-
var
|
|
7370
|
-
return join3(["input",
|
|
7369
|
+
var name = _ref30.name, directives = _ref30.directives, fields = _ref30.fields;
|
|
7370
|
+
return join3(["input", name, join3(directives, " "), block2(fields)], " ");
|
|
7371
7371
|
}),
|
|
7372
7372
|
DirectiveDefinition: addDescription2(function(_ref31) {
|
|
7373
|
-
var
|
|
7374
|
-
return "directive @" +
|
|
7373
|
+
var name = _ref31.name, args = _ref31.arguments, repeatable = _ref31.repeatable, locations = _ref31.locations;
|
|
7374
|
+
return "directive @" + name + (hasMultilineItems2(args) ? wrap2("(\n", indent2(join3(args, "\n")), "\n)") : wrap2("(", join3(args, ", "), ")")) + (repeatable ? " repeatable" : "") + " on " + join3(locations, " | ");
|
|
7375
7375
|
}),
|
|
7376
7376
|
SchemaExtension: function SchemaExtension(_ref32) {
|
|
7377
7377
|
var directives = _ref32.directives, operationTypes = _ref32.operationTypes;
|
|
7378
7378
|
return join3(["extend schema", join3(directives, " "), block2(operationTypes)], " ");
|
|
7379
7379
|
},
|
|
7380
7380
|
ScalarTypeExtension: function ScalarTypeExtension(_ref33) {
|
|
7381
|
-
var
|
|
7382
|
-
return join3(["extend scalar",
|
|
7381
|
+
var name = _ref33.name, directives = _ref33.directives;
|
|
7382
|
+
return join3(["extend scalar", name, join3(directives, " ")], " ");
|
|
7383
7383
|
},
|
|
7384
7384
|
ObjectTypeExtension: function ObjectTypeExtension(_ref34) {
|
|
7385
|
-
var
|
|
7386
|
-
return join3(["extend type",
|
|
7385
|
+
var name = _ref34.name, interfaces = _ref34.interfaces, directives = _ref34.directives, fields = _ref34.fields;
|
|
7386
|
+
return join3(["extend type", name, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ");
|
|
7387
7387
|
},
|
|
7388
7388
|
InterfaceTypeExtension: function InterfaceTypeExtension(_ref35) {
|
|
7389
|
-
var
|
|
7390
|
-
return join3(["extend interface",
|
|
7389
|
+
var name = _ref35.name, interfaces = _ref35.interfaces, directives = _ref35.directives, fields = _ref35.fields;
|
|
7390
|
+
return join3(["extend interface", name, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ");
|
|
7391
7391
|
},
|
|
7392
7392
|
UnionTypeExtension: function UnionTypeExtension(_ref36) {
|
|
7393
|
-
var
|
|
7394
|
-
return join3(["extend union",
|
|
7393
|
+
var name = _ref36.name, directives = _ref36.directives, types17 = _ref36.types;
|
|
7394
|
+
return join3(["extend union", name, join3(directives, " "), types17 && types17.length !== 0 ? "= " + join3(types17, " | ") : ""], " ");
|
|
7395
7395
|
},
|
|
7396
7396
|
EnumTypeExtension: function EnumTypeExtension(_ref37) {
|
|
7397
|
-
var
|
|
7398
|
-
return join3(["extend enum",
|
|
7397
|
+
var name = _ref37.name, directives = _ref37.directives, values = _ref37.values;
|
|
7398
|
+
return join3(["extend enum", name, join3(directives, " "), block2(values)], " ");
|
|
7399
7399
|
},
|
|
7400
7400
|
InputObjectTypeExtension: function InputObjectTypeExtension(_ref38) {
|
|
7401
|
-
var
|
|
7402
|
-
return join3(["extend input",
|
|
7401
|
+
var name = _ref38.name, directives = _ref38.directives, fields = _ref38.fields;
|
|
7402
|
+
return join3(["extend input", name, join3(directives, " "), block2(fields)], " ");
|
|
7403
7403
|
}
|
|
7404
7404
|
};
|
|
7405
7405
|
function addDescription2(cb) {
|
|
@@ -8086,8 +8086,8 @@ var require_definition = __commonJS({
|
|
|
8086
8086
|
_proto5.getValues = function getValues() {
|
|
8087
8087
|
return this._values;
|
|
8088
8088
|
};
|
|
8089
|
-
_proto5.getValue = function getValue(
|
|
8090
|
-
return this._nameLookup[
|
|
8089
|
+
_proto5.getValue = function getValue(name) {
|
|
8090
|
+
return this._nameLookup[name];
|
|
8091
8091
|
};
|
|
8092
8092
|
_proto5.serialize = function serialize(outputValue) {
|
|
8093
8093
|
var enumValue = this._valueLookup.get(outputValue);
|
|
@@ -8666,8 +8666,8 @@ var require_scalars = __commonJS({
|
|
|
8666
8666
|
exports.specifiedScalarTypes = specifiedScalarTypes;
|
|
8667
8667
|
function isSpecifiedScalarType5(type) {
|
|
8668
8668
|
return specifiedScalarTypes.some(function(_ref) {
|
|
8669
|
-
var
|
|
8670
|
-
return type.name ===
|
|
8669
|
+
var name = _ref.name;
|
|
8670
|
+
return type.name === name;
|
|
8671
8671
|
});
|
|
8672
8672
|
}
|
|
8673
8673
|
}
|
|
@@ -9348,9 +9348,9 @@ var require_introspection = __commonJS({
|
|
|
9348
9348
|
astNode: void 0
|
|
9349
9349
|
}],
|
|
9350
9350
|
resolve: function resolve2(_source, _ref8, _context, _ref9) {
|
|
9351
|
-
var
|
|
9351
|
+
var name = _ref8.name;
|
|
9352
9352
|
var schema = _ref9.schema;
|
|
9353
|
-
return schema.getType(
|
|
9353
|
+
return schema.getType(name);
|
|
9354
9354
|
},
|
|
9355
9355
|
isDeprecated: false,
|
|
9356
9356
|
deprecationReason: void 0,
|
|
@@ -9377,8 +9377,8 @@ var require_introspection = __commonJS({
|
|
|
9377
9377
|
exports.introspectionTypes = introspectionTypes;
|
|
9378
9378
|
function isIntrospectionType2(type) {
|
|
9379
9379
|
return introspectionTypes.some(function(_ref11) {
|
|
9380
|
-
var
|
|
9381
|
-
return type.name ===
|
|
9380
|
+
var name = _ref11.name;
|
|
9381
|
+
return type.name === name;
|
|
9382
9382
|
});
|
|
9383
9383
|
}
|
|
9384
9384
|
}
|
|
@@ -9544,8 +9544,8 @@ var require_directives = __commonJS({
|
|
|
9544
9544
|
exports.specifiedDirectives = specifiedDirectives;
|
|
9545
9545
|
function isSpecifiedDirective3(directive) {
|
|
9546
9546
|
return specifiedDirectives.some(function(_ref2) {
|
|
9547
|
-
var
|
|
9548
|
-
return
|
|
9547
|
+
var name = _ref2.name;
|
|
9548
|
+
return name === directive.name;
|
|
9549
9549
|
});
|
|
9550
9550
|
}
|
|
9551
9551
|
}
|
|
@@ -9702,8 +9702,8 @@ var require_schema = __commonJS({
|
|
|
9702
9702
|
_proto.getTypeMap = function getTypeMap() {
|
|
9703
9703
|
return this._typeMap;
|
|
9704
9704
|
};
|
|
9705
|
-
_proto.getType = function getType(
|
|
9706
|
-
return this.getTypeMap()[
|
|
9705
|
+
_proto.getType = function getType(name) {
|
|
9706
|
+
return this.getTypeMap()[name];
|
|
9707
9707
|
};
|
|
9708
9708
|
_proto.getPossibleTypes = function getPossibleTypes(abstractType) {
|
|
9709
9709
|
return (0, _definition.isUnionType)(abstractType) ? abstractType.getTypes() : this.getImplementations(abstractType).objects;
|
|
@@ -9745,9 +9745,9 @@ var require_schema = __commonJS({
|
|
|
9745
9745
|
_proto.getDirectives = function getDirectives() {
|
|
9746
9746
|
return this._directives;
|
|
9747
9747
|
};
|
|
9748
|
-
_proto.getDirective = function getDirective(
|
|
9748
|
+
_proto.getDirective = function getDirective(name) {
|
|
9749
9749
|
return (0, _find.default)(this.getDirectives(), function(directive) {
|
|
9750
|
-
return directive.name ===
|
|
9750
|
+
return directive.name === name;
|
|
9751
9751
|
});
|
|
9752
9752
|
};
|
|
9753
9753
|
_proto.toConfig = function toConfig() {
|
|
@@ -10457,18 +10457,18 @@ var require_TypeInfo = __commonJS({
|
|
|
10457
10457
|
}();
|
|
10458
10458
|
exports.TypeInfo = TypeInfo;
|
|
10459
10459
|
function getFieldDef(schema, parentType, fieldNode) {
|
|
10460
|
-
var
|
|
10461
|
-
if (
|
|
10460
|
+
var name = fieldNode.name.value;
|
|
10461
|
+
if (name === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === parentType) {
|
|
10462
10462
|
return _introspection.SchemaMetaFieldDef;
|
|
10463
10463
|
}
|
|
10464
|
-
if (
|
|
10464
|
+
if (name === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === parentType) {
|
|
10465
10465
|
return _introspection.TypeMetaFieldDef;
|
|
10466
10466
|
}
|
|
10467
|
-
if (
|
|
10467
|
+
if (name === _introspection.TypeNameMetaFieldDef.name && (0, _definition.isCompositeType)(parentType)) {
|
|
10468
10468
|
return _introspection.TypeNameMetaFieldDef;
|
|
10469
10469
|
}
|
|
10470
10470
|
if ((0, _definition.isObjectType)(parentType) || (0, _definition.isInterfaceType)(parentType)) {
|
|
10471
|
-
return parentType.getFields()[
|
|
10471
|
+
return parentType.getFields()[name];
|
|
10472
10472
|
}
|
|
10473
10473
|
}
|
|
10474
10474
|
function visitWithTypeInfo(typeInfo, visitor) {
|
|
@@ -11044,8 +11044,8 @@ var require_PossibleFragmentSpreadsRule = __commonJS({
|
|
|
11044
11044
|
}
|
|
11045
11045
|
};
|
|
11046
11046
|
}
|
|
11047
|
-
function getFragmentType(context,
|
|
11048
|
-
var frag = context.getFragment(
|
|
11047
|
+
function getFragmentType(context, name) {
|
|
11048
|
+
var frag = context.getFragment(name);
|
|
11049
11049
|
if (frag) {
|
|
11050
11050
|
var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), frag.typeCondition);
|
|
11051
11051
|
if ((0, _definition.isCompositeType)(type)) {
|
|
@@ -11248,22 +11248,22 @@ var require_KnownDirectivesRule = __commonJS({
|
|
|
11248
11248
|
for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {
|
|
11249
11249
|
var def = astDefinitions[_i4];
|
|
11250
11250
|
if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) {
|
|
11251
|
-
locationsMap[def.name.value] = def.locations.map(function(
|
|
11252
|
-
return
|
|
11251
|
+
locationsMap[def.name.value] = def.locations.map(function(name) {
|
|
11252
|
+
return name.value;
|
|
11253
11253
|
});
|
|
11254
11254
|
}
|
|
11255
11255
|
}
|
|
11256
11256
|
return {
|
|
11257
11257
|
Directive: function Directive(node, _key, _parent, _path, ancestors) {
|
|
11258
|
-
var
|
|
11259
|
-
var locations = locationsMap[
|
|
11258
|
+
var name = node.name.value;
|
|
11259
|
+
var locations = locationsMap[name];
|
|
11260
11260
|
if (!locations) {
|
|
11261
|
-
context.reportError(new _GraphQLError.GraphQLError('Unknown directive "@'.concat(
|
|
11261
|
+
context.reportError(new _GraphQLError.GraphQLError('Unknown directive "@'.concat(name, '".'), node));
|
|
11262
11262
|
return;
|
|
11263
11263
|
}
|
|
11264
11264
|
var candidateLocation = getDirectiveLocationForASTPath(ancestors);
|
|
11265
11265
|
if (candidateLocation && locations.indexOf(candidateLocation) === -1) {
|
|
11266
|
-
context.reportError(new _GraphQLError.GraphQLError('Directive "@'.concat(
|
|
11266
|
+
context.reportError(new _GraphQLError.GraphQLError('Directive "@'.concat(name, '" may not be used on ').concat(candidateLocation, "."), node));
|
|
11267
11267
|
}
|
|
11268
11268
|
}
|
|
11269
11269
|
};
|
|
@@ -12627,7 +12627,7 @@ var require_ValidationContext = __commonJS({
|
|
|
12627
12627
|
_proto.getDocument = function getDocument() {
|
|
12628
12628
|
return this._ast;
|
|
12629
12629
|
};
|
|
12630
|
-
_proto.getFragment = function getFragment(
|
|
12630
|
+
_proto.getFragment = function getFragment(name) {
|
|
12631
12631
|
var fragments = this._fragments;
|
|
12632
12632
|
if (!fragments) {
|
|
12633
12633
|
this._fragments = fragments = this.getDocument().definitions.reduce(function(frags, statement) {
|
|
@@ -12637,7 +12637,7 @@ var require_ValidationContext = __commonJS({
|
|
|
12637
12637
|
return frags;
|
|
12638
12638
|
}, /* @__PURE__ */ Object.create(null));
|
|
12639
12639
|
}
|
|
12640
|
-
return fragments[
|
|
12640
|
+
return fragments[name];
|
|
12641
12641
|
};
|
|
12642
12642
|
_proto.getFragmentSpreads = function getFragmentSpreads(node) {
|
|
12643
12643
|
var spreads = this._fragmentSpreads.get(node);
|
|
@@ -12934,8 +12934,8 @@ var require_promiseForObject = __commonJS({
|
|
|
12934
12934
|
exports.default = promiseForObject;
|
|
12935
12935
|
function promiseForObject(object) {
|
|
12936
12936
|
var keys = Object.keys(object);
|
|
12937
|
-
var valuesAndPromises = keys.map(function(
|
|
12938
|
-
return object[
|
|
12937
|
+
var valuesAndPromises = keys.map(function(name) {
|
|
12938
|
+
return object[name];
|
|
12939
12939
|
});
|
|
12940
12940
|
return Promise.all(valuesAndPromises).then(function(values) {
|
|
12941
12941
|
return values.reduce(function(resolvedObject, value, i2) {
|
|
@@ -13346,14 +13346,14 @@ var require_values = __commonJS({
|
|
|
13346
13346
|
});
|
|
13347
13347
|
for (var _i4 = 0, _def$args2 = def.args; _i4 < _def$args2.length; _i4++) {
|
|
13348
13348
|
var argDef = _def$args2[_i4];
|
|
13349
|
-
var
|
|
13349
|
+
var name = argDef.name;
|
|
13350
13350
|
var argType = argDef.type;
|
|
13351
|
-
var argumentNode2 = argNodeMap[
|
|
13351
|
+
var argumentNode2 = argNodeMap[name];
|
|
13352
13352
|
if (!argumentNode2) {
|
|
13353
13353
|
if (argDef.defaultValue !== void 0) {
|
|
13354
|
-
coercedValues[
|
|
13354
|
+
coercedValues[name] = argDef.defaultValue;
|
|
13355
13355
|
} else if ((0, _definition.isNonNullType)(argType)) {
|
|
13356
|
-
throw new _GraphQLError.GraphQLError('Argument "'.concat(
|
|
13356
|
+
throw new _GraphQLError.GraphQLError('Argument "'.concat(name, '" of required type "').concat((0, _inspect.default)(argType), '" ') + "was not provided.", node);
|
|
13357
13357
|
}
|
|
13358
13358
|
continue;
|
|
13359
13359
|
}
|
|
@@ -13363,22 +13363,22 @@ var require_values = __commonJS({
|
|
|
13363
13363
|
var variableName = valueNode.name.value;
|
|
13364
13364
|
if (variableValues == null || !hasOwnProperty(variableValues, variableName)) {
|
|
13365
13365
|
if (argDef.defaultValue !== void 0) {
|
|
13366
|
-
coercedValues[
|
|
13366
|
+
coercedValues[name] = argDef.defaultValue;
|
|
13367
13367
|
} else if ((0, _definition.isNonNullType)(argType)) {
|
|
13368
|
-
throw new _GraphQLError.GraphQLError('Argument "'.concat(
|
|
13368
|
+
throw new _GraphQLError.GraphQLError('Argument "'.concat(name, '" of required type "').concat((0, _inspect.default)(argType), '" ') + 'was provided the variable "$'.concat(variableName, '" which was not provided a runtime value.'), valueNode);
|
|
13369
13369
|
}
|
|
13370
13370
|
continue;
|
|
13371
13371
|
}
|
|
13372
13372
|
isNull = variableValues[variableName] == null;
|
|
13373
13373
|
}
|
|
13374
13374
|
if (isNull && (0, _definition.isNonNullType)(argType)) {
|
|
13375
|
-
throw new _GraphQLError.GraphQLError('Argument "'.concat(
|
|
13375
|
+
throw new _GraphQLError.GraphQLError('Argument "'.concat(name, '" of non-null type "').concat((0, _inspect.default)(argType), '" ') + "must not be null.", valueNode);
|
|
13376
13376
|
}
|
|
13377
13377
|
var coercedValue = (0, _valueFromAST.valueFromAST)(valueNode, argType, variableValues);
|
|
13378
13378
|
if (coercedValue === void 0) {
|
|
13379
|
-
throw new _GraphQLError.GraphQLError('Argument "'.concat(
|
|
13379
|
+
throw new _GraphQLError.GraphQLError('Argument "'.concat(name, '" has invalid value ').concat((0, _printer.print)(valueNode), "."), valueNode);
|
|
13380
13380
|
}
|
|
13381
|
-
coercedValues[
|
|
13381
|
+
coercedValues[name] = coercedValue;
|
|
13382
13382
|
}
|
|
13383
13383
|
return coercedValues;
|
|
13384
13384
|
}
|
|
@@ -13594,11 +13594,11 @@ var require_execute = __commonJS({
|
|
|
13594
13594
|
if (!shouldIncludeNode(exeContext, selection2)) {
|
|
13595
13595
|
continue;
|
|
13596
13596
|
}
|
|
13597
|
-
var
|
|
13598
|
-
if (!fields[
|
|
13599
|
-
fields[
|
|
13597
|
+
var name = getFieldEntryKey(selection2);
|
|
13598
|
+
if (!fields[name]) {
|
|
13599
|
+
fields[name] = [];
|
|
13600
13600
|
}
|
|
13601
|
-
fields[
|
|
13601
|
+
fields[name].push(selection2);
|
|
13602
13602
|
break;
|
|
13603
13603
|
}
|
|
13604
13604
|
case _kinds.Kind.INLINE_FRAGMENT: {
|
|
@@ -15914,8 +15914,8 @@ var require_extendSchema = __commonJS({
|
|
|
15914
15914
|
for (var _i6 = 0; _i6 < typeDefs.length; _i6++) {
|
|
15915
15915
|
var _stdTypeMap$name;
|
|
15916
15916
|
var typeNode = typeDefs[_i6];
|
|
15917
|
-
var
|
|
15918
|
-
typeMap[
|
|
15917
|
+
var name = typeNode.name.value;
|
|
15918
|
+
typeMap[name] = (_stdTypeMap$name = stdTypeMap[name]) !== null && _stdTypeMap$name !== void 0 ? _stdTypeMap$name : buildType(typeNode);
|
|
15919
15919
|
}
|
|
15920
15920
|
var operationTypes = _objectSpread(_objectSpread({
|
|
15921
15921
|
query: schemaConfig.query && replaceNamedType(schemaConfig.query),
|
|
@@ -16078,10 +16078,10 @@ var require_extendSchema = __commonJS({
|
|
|
16078
16078
|
}
|
|
16079
16079
|
function getNamedType5(node) {
|
|
16080
16080
|
var _stdTypeMap$name2;
|
|
16081
|
-
var
|
|
16082
|
-
var type = (_stdTypeMap$name2 = stdTypeMap[
|
|
16081
|
+
var name2 = node.name.value;
|
|
16082
|
+
var type = (_stdTypeMap$name2 = stdTypeMap[name2]) !== null && _stdTypeMap$name2 !== void 0 ? _stdTypeMap$name2 : typeMap[name2];
|
|
16083
16083
|
if (type === void 0) {
|
|
16084
|
-
throw new Error('Unknown type: "'.concat(
|
|
16084
|
+
throw new Error('Unknown type: "'.concat(name2, '".'));
|
|
16085
16085
|
}
|
|
16086
16086
|
return type;
|
|
16087
16087
|
}
|
|
@@ -16208,15 +16208,15 @@ var require_extendSchema = __commonJS({
|
|
|
16208
16208
|
}
|
|
16209
16209
|
function buildType(astNode) {
|
|
16210
16210
|
var _typeExtensionsMap$na;
|
|
16211
|
-
var
|
|
16211
|
+
var name2 = astNode.name.value;
|
|
16212
16212
|
var description = getDescription(astNode, options);
|
|
16213
|
-
var extensionNodes = (_typeExtensionsMap$na = typeExtensionsMap[
|
|
16213
|
+
var extensionNodes = (_typeExtensionsMap$na = typeExtensionsMap[name2]) !== null && _typeExtensionsMap$na !== void 0 ? _typeExtensionsMap$na : [];
|
|
16214
16214
|
switch (astNode.kind) {
|
|
16215
16215
|
case _kinds.Kind.OBJECT_TYPE_DEFINITION: {
|
|
16216
16216
|
var extensionASTNodes = extensionNodes;
|
|
16217
16217
|
var allNodes = [astNode].concat(extensionASTNodes);
|
|
16218
16218
|
return new _definition.GraphQLObjectType({
|
|
16219
|
-
name:
|
|
16219
|
+
name: name2,
|
|
16220
16220
|
description,
|
|
16221
16221
|
interfaces: function interfaces() {
|
|
16222
16222
|
return buildInterfaces(allNodes);
|
|
@@ -16232,7 +16232,7 @@ var require_extendSchema = __commonJS({
|
|
|
16232
16232
|
var _extensionASTNodes = extensionNodes;
|
|
16233
16233
|
var _allNodes = [astNode].concat(_extensionASTNodes);
|
|
16234
16234
|
return new _definition.GraphQLInterfaceType({
|
|
16235
|
-
name:
|
|
16235
|
+
name: name2,
|
|
16236
16236
|
description,
|
|
16237
16237
|
interfaces: function interfaces() {
|
|
16238
16238
|
return buildInterfaces(_allNodes);
|
|
@@ -16248,7 +16248,7 @@ var require_extendSchema = __commonJS({
|
|
|
16248
16248
|
var _extensionASTNodes2 = extensionNodes;
|
|
16249
16249
|
var _allNodes2 = [astNode].concat(_extensionASTNodes2);
|
|
16250
16250
|
return new _definition.GraphQLEnumType({
|
|
16251
|
-
name:
|
|
16251
|
+
name: name2,
|
|
16252
16252
|
description,
|
|
16253
16253
|
values: buildEnumValueMap(_allNodes2),
|
|
16254
16254
|
astNode,
|
|
@@ -16259,7 +16259,7 @@ var require_extendSchema = __commonJS({
|
|
|
16259
16259
|
var _extensionASTNodes3 = extensionNodes;
|
|
16260
16260
|
var _allNodes3 = [astNode].concat(_extensionASTNodes3);
|
|
16261
16261
|
return new _definition.GraphQLUnionType({
|
|
16262
|
-
name:
|
|
16262
|
+
name: name2,
|
|
16263
16263
|
description,
|
|
16264
16264
|
types: function types17() {
|
|
16265
16265
|
return buildUnionTypes(_allNodes3);
|
|
@@ -16271,7 +16271,7 @@ var require_extendSchema = __commonJS({
|
|
|
16271
16271
|
case _kinds.Kind.SCALAR_TYPE_DEFINITION: {
|
|
16272
16272
|
var _extensionASTNodes4 = extensionNodes;
|
|
16273
16273
|
return new _definition.GraphQLScalarType({
|
|
16274
|
-
name:
|
|
16274
|
+
name: name2,
|
|
16275
16275
|
description,
|
|
16276
16276
|
specifiedByUrl: getSpecifiedByUrl(astNode),
|
|
16277
16277
|
astNode,
|
|
@@ -16282,7 +16282,7 @@ var require_extendSchema = __commonJS({
|
|
|
16282
16282
|
var _extensionASTNodes5 = extensionNodes;
|
|
16283
16283
|
var _allNodes4 = [astNode].concat(_extensionASTNodes5);
|
|
16284
16284
|
return new _definition.GraphQLInputObjectType({
|
|
16285
|
-
name:
|
|
16285
|
+
name: name2,
|
|
16286
16286
|
description,
|
|
16287
16287
|
fields: function fields() {
|
|
16288
16288
|
return buildInputFieldMap(_allNodes4);
|
|
@@ -17379,12 +17379,12 @@ var require_findBreakingChanges = __commonJS({
|
|
|
17379
17379
|
var removed = [];
|
|
17380
17380
|
var persisted = [];
|
|
17381
17381
|
var oldMap = (0, _keyMap.default)(oldArray, function(_ref11) {
|
|
17382
|
-
var
|
|
17383
|
-
return
|
|
17382
|
+
var name = _ref11.name;
|
|
17383
|
+
return name;
|
|
17384
17384
|
});
|
|
17385
17385
|
var newMap = (0, _keyMap.default)(newArray, function(_ref12) {
|
|
17386
|
-
var
|
|
17387
|
-
return
|
|
17386
|
+
var name = _ref12.name;
|
|
17387
|
+
return name;
|
|
17388
17388
|
});
|
|
17389
17389
|
for (var _i44 = 0; _i44 < oldArray.length; _i44++) {
|
|
17390
17390
|
var oldItem = oldArray[_i44];
|
|
@@ -18857,6 +18857,109 @@ var require_graphql2 = __commonJS({
|
|
|
18857
18857
|
}
|
|
18858
18858
|
});
|
|
18859
18859
|
|
|
18860
|
+
// ../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js
|
|
18861
|
+
var require_cjs = __commonJS({
|
|
18862
|
+
"../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module2) {
|
|
18863
|
+
"use strict";
|
|
18864
|
+
var isMergeableObject = function isMergeableObject2(value) {
|
|
18865
|
+
return isNonNullObject(value) && !isSpecial(value);
|
|
18866
|
+
};
|
|
18867
|
+
function isNonNullObject(value) {
|
|
18868
|
+
return !!value && typeof value === "object";
|
|
18869
|
+
}
|
|
18870
|
+
function isSpecial(value) {
|
|
18871
|
+
var stringValue = Object.prototype.toString.call(value);
|
|
18872
|
+
return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
|
|
18873
|
+
}
|
|
18874
|
+
var canUseSymbol = typeof Symbol === "function" && Symbol.for;
|
|
18875
|
+
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
|
|
18876
|
+
function isReactElement(value) {
|
|
18877
|
+
return value.$$typeof === REACT_ELEMENT_TYPE;
|
|
18878
|
+
}
|
|
18879
|
+
function emptyTarget(val) {
|
|
18880
|
+
return Array.isArray(val) ? [] : {};
|
|
18881
|
+
}
|
|
18882
|
+
function cloneUnlessOtherwiseSpecified(value, options) {
|
|
18883
|
+
return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
|
|
18884
|
+
}
|
|
18885
|
+
function defaultArrayMerge(target, source, options) {
|
|
18886
|
+
return target.concat(source).map(function(element) {
|
|
18887
|
+
return cloneUnlessOtherwiseSpecified(element, options);
|
|
18888
|
+
});
|
|
18889
|
+
}
|
|
18890
|
+
function getMergeFunction(key, options) {
|
|
18891
|
+
if (!options.customMerge) {
|
|
18892
|
+
return deepmerge;
|
|
18893
|
+
}
|
|
18894
|
+
var customMerge = options.customMerge(key);
|
|
18895
|
+
return typeof customMerge === "function" ? customMerge : deepmerge;
|
|
18896
|
+
}
|
|
18897
|
+
function getEnumerableOwnPropertySymbols(target) {
|
|
18898
|
+
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
|
|
18899
|
+
return target.propertyIsEnumerable(symbol);
|
|
18900
|
+
}) : [];
|
|
18901
|
+
}
|
|
18902
|
+
function getKeys(target) {
|
|
18903
|
+
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
|
|
18904
|
+
}
|
|
18905
|
+
function propertyIsOnObject(object, property) {
|
|
18906
|
+
try {
|
|
18907
|
+
return property in object;
|
|
18908
|
+
} catch (_) {
|
|
18909
|
+
return false;
|
|
18910
|
+
}
|
|
18911
|
+
}
|
|
18912
|
+
function propertyIsUnsafe(target, key) {
|
|
18913
|
+
return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
|
|
18914
|
+
}
|
|
18915
|
+
function mergeObject(target, source, options) {
|
|
18916
|
+
var destination = {};
|
|
18917
|
+
if (options.isMergeableObject(target)) {
|
|
18918
|
+
getKeys(target).forEach(function(key) {
|
|
18919
|
+
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
|
18920
|
+
});
|
|
18921
|
+
}
|
|
18922
|
+
getKeys(source).forEach(function(key) {
|
|
18923
|
+
if (propertyIsUnsafe(target, key)) {
|
|
18924
|
+
return;
|
|
18925
|
+
}
|
|
18926
|
+
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
|
|
18927
|
+
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
|
|
18928
|
+
} else {
|
|
18929
|
+
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
|
|
18930
|
+
}
|
|
18931
|
+
});
|
|
18932
|
+
return destination;
|
|
18933
|
+
}
|
|
18934
|
+
function deepmerge(target, source, options) {
|
|
18935
|
+
options = options || {};
|
|
18936
|
+
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
|
|
18937
|
+
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
|
|
18938
|
+
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
|
18939
|
+
var sourceIsArray = Array.isArray(source);
|
|
18940
|
+
var targetIsArray = Array.isArray(target);
|
|
18941
|
+
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
18942
|
+
if (!sourceAndTargetTypesMatch) {
|
|
18943
|
+
return cloneUnlessOtherwiseSpecified(source, options);
|
|
18944
|
+
} else if (sourceIsArray) {
|
|
18945
|
+
return options.arrayMerge(target, source, options);
|
|
18946
|
+
} else {
|
|
18947
|
+
return mergeObject(target, source, options);
|
|
18948
|
+
}
|
|
18949
|
+
}
|
|
18950
|
+
deepmerge.all = function deepmergeAll(array, options) {
|
|
18951
|
+
if (!Array.isArray(array)) {
|
|
18952
|
+
throw new Error("first argument should be an array");
|
|
18953
|
+
}
|
|
18954
|
+
return array.reduce(function(prev, next) {
|
|
18955
|
+
return deepmerge(prev, next, options);
|
|
18956
|
+
}, {});
|
|
18957
|
+
};
|
|
18958
|
+
var deepmerge_1 = deepmerge;
|
|
18959
|
+
module2.exports = deepmerge_1;
|
|
18960
|
+
}
|
|
18961
|
+
});
|
|
18962
|
+
|
|
18860
18963
|
// ../../node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js
|
|
18861
18964
|
var require_universalify = __commonJS({
|
|
18862
18965
|
"../../node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js"(exports) {
|
|
@@ -22401,8 +22504,8 @@ var require_once = __commonJS({
|
|
|
22401
22504
|
f3.called = true;
|
|
22402
22505
|
return f3.value = fn.apply(this, arguments);
|
|
22403
22506
|
};
|
|
22404
|
-
var
|
|
22405
|
-
f3.onceError =
|
|
22507
|
+
var name = fn.name || "Function wrapped with `once`";
|
|
22508
|
+
f3.onceError = name + " shouldn't be called more than once";
|
|
22406
22509
|
f3.called = false;
|
|
22407
22510
|
return f3;
|
|
22408
22511
|
}
|
|
@@ -23312,9 +23415,9 @@ var require_errors = __commonJS({
|
|
|
23312
23415
|
E("ERR_HTTP_TRAILER_INVALID", "Trailers are invalid with this transfer encoding");
|
|
23313
23416
|
E("ERR_INDEX_OUT_OF_RANGE", "Index out of range");
|
|
23314
23417
|
E("ERR_INVALID_ARG_TYPE", invalidArgType);
|
|
23315
|
-
E("ERR_INVALID_ARRAY_LENGTH", function(
|
|
23418
|
+
E("ERR_INVALID_ARRAY_LENGTH", function(name, len, actual) {
|
|
23316
23419
|
assert.strictEqual(typeof actual, "number");
|
|
23317
|
-
return 'The array "'.concat(
|
|
23420
|
+
return 'The array "'.concat(name, '" (length ').concat(actual, ") must be of length ").concat(len, ".");
|
|
23318
23421
|
});
|
|
23319
23422
|
E("ERR_INVALID_BUFFER_SIZE", "Buffer size must be a multiple of %s");
|
|
23320
23423
|
E("ERR_INVALID_CALLBACK", "Callback must be a function");
|
|
@@ -23325,8 +23428,8 @@ var require_errors = __commonJS({
|
|
|
23325
23428
|
E("ERR_INVALID_FILE_URL_PATH", "File URL path %s");
|
|
23326
23429
|
E("ERR_INVALID_HANDLE_TYPE", "This handle type cannot be sent");
|
|
23327
23430
|
E("ERR_INVALID_IP_ADDRESS", "Invalid IP address: %s");
|
|
23328
|
-
E("ERR_INVALID_OPT_VALUE", function(
|
|
23329
|
-
return 'The value "'.concat(String(value), '" is invalid for option "').concat(
|
|
23431
|
+
E("ERR_INVALID_OPT_VALUE", function(name, value) {
|
|
23432
|
+
return 'The value "'.concat(String(value), '" is invalid for option "').concat(name, '"');
|
|
23330
23433
|
});
|
|
23331
23434
|
E("ERR_INVALID_OPT_VALUE_ENCODING", function(value) {
|
|
23332
23435
|
return 'The value "'.concat(String(value), '" is invalid for option "encoding"');
|
|
@@ -23374,8 +23477,8 @@ var require_errors = __commonJS({
|
|
|
23374
23477
|
E("ERR_UNKNOWN_STDIN_TYPE", "Unknown stdin file type");
|
|
23375
23478
|
E("ERR_UNKNOWN_STREAM_TYPE", "Unknown stream file type");
|
|
23376
23479
|
E("ERR_V8BREAKITERATOR", "Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl");
|
|
23377
|
-
function invalidArgType(
|
|
23378
|
-
assert(
|
|
23480
|
+
function invalidArgType(name, expected, actual) {
|
|
23481
|
+
assert(name, "name is required");
|
|
23379
23482
|
var determiner;
|
|
23380
23483
|
if (expected.includes("not ")) {
|
|
23381
23484
|
determiner = "must not be";
|
|
@@ -23384,16 +23487,16 @@ var require_errors = __commonJS({
|
|
|
23384
23487
|
determiner = "must be";
|
|
23385
23488
|
}
|
|
23386
23489
|
var msg;
|
|
23387
|
-
if (Array.isArray(
|
|
23388
|
-
var names =
|
|
23490
|
+
if (Array.isArray(name)) {
|
|
23491
|
+
var names = name.map(function(val) {
|
|
23389
23492
|
return '"'.concat(val, '"');
|
|
23390
23493
|
}).join(", ");
|
|
23391
23494
|
msg = "The ".concat(names, " arguments ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
23392
|
-
} else if (
|
|
23393
|
-
msg = "The ".concat(
|
|
23495
|
+
} else if (name.includes(" argument")) {
|
|
23496
|
+
msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
23394
23497
|
} else {
|
|
23395
|
-
var type =
|
|
23396
|
-
msg = 'The "'.concat(
|
|
23498
|
+
var type = name.includes(".") ? "property" : "argument";
|
|
23499
|
+
msg = 'The "'.concat(name, '" ').concat(type, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
23397
23500
|
}
|
|
23398
23501
|
if (arguments.length >= 3) {
|
|
23399
23502
|
msg += ". Received type ".concat(actual !== null ? typeof actual : "null");
|
|
@@ -23445,11 +23548,11 @@ var require_errors = __commonJS({
|
|
|
23445
23548
|
return "of ".concat(thing, " ").concat(String(expected));
|
|
23446
23549
|
}
|
|
23447
23550
|
}
|
|
23448
|
-
function bufferOutOfBounds(
|
|
23551
|
+
function bufferOutOfBounds(name, isWriting) {
|
|
23449
23552
|
if (isWriting) {
|
|
23450
23553
|
return "Attempt to write outside buffer bounds";
|
|
23451
23554
|
} else {
|
|
23452
|
-
return '"'.concat(
|
|
23555
|
+
return '"'.concat(name, '" is outside of buffer bounds');
|
|
23453
23556
|
}
|
|
23454
23557
|
}
|
|
23455
23558
|
}
|
|
@@ -23847,7 +23950,7 @@ var require_node = __commonJS({
|
|
|
23847
23950
|
exports.Node = Node;
|
|
23848
23951
|
var Link = function(_super) {
|
|
23849
23952
|
__extends(Link2, _super);
|
|
23850
|
-
function Link2(vol2, parent,
|
|
23953
|
+
function Link2(vol2, parent, name) {
|
|
23851
23954
|
var _this = _super.call(this) || this;
|
|
23852
23955
|
_this.children = {};
|
|
23853
23956
|
_this._steps = [];
|
|
@@ -23855,7 +23958,7 @@ var require_node = __commonJS({
|
|
|
23855
23958
|
_this.length = 0;
|
|
23856
23959
|
_this.vol = vol2;
|
|
23857
23960
|
_this.parent = parent;
|
|
23858
|
-
_this.name =
|
|
23961
|
+
_this.name = name;
|
|
23859
23962
|
_this.syncSteps();
|
|
23860
23963
|
return _this;
|
|
23861
23964
|
}
|
|
@@ -23880,22 +23983,22 @@ var require_node = __commonJS({
|
|
|
23880
23983
|
Link2.prototype.getNode = function() {
|
|
23881
23984
|
return this.node;
|
|
23882
23985
|
};
|
|
23883
|
-
Link2.prototype.createChild = function(
|
|
23986
|
+
Link2.prototype.createChild = function(name, node) {
|
|
23884
23987
|
if (node === void 0) {
|
|
23885
23988
|
node = this.vol.createNode();
|
|
23886
23989
|
}
|
|
23887
|
-
var link = new Link2(this.vol, this,
|
|
23990
|
+
var link = new Link2(this.vol, this, name);
|
|
23888
23991
|
link.setNode(node);
|
|
23889
23992
|
if (node.isDirectory()) {
|
|
23890
23993
|
}
|
|
23891
|
-
this.setChild(
|
|
23994
|
+
this.setChild(name, link);
|
|
23892
23995
|
return link;
|
|
23893
23996
|
};
|
|
23894
|
-
Link2.prototype.setChild = function(
|
|
23997
|
+
Link2.prototype.setChild = function(name, link) {
|
|
23895
23998
|
if (link === void 0) {
|
|
23896
|
-
link = new Link2(this.vol, this,
|
|
23999
|
+
link = new Link2(this.vol, this, name);
|
|
23897
24000
|
}
|
|
23898
|
-
this.children[
|
|
24001
|
+
this.children[name] = link;
|
|
23899
24002
|
link.parent = this;
|
|
23900
24003
|
this.length++;
|
|
23901
24004
|
this.emit("child:add", link, this);
|
|
@@ -23906,9 +24009,9 @@ var require_node = __commonJS({
|
|
|
23906
24009
|
this.length--;
|
|
23907
24010
|
this.emit("child:delete", link, this);
|
|
23908
24011
|
};
|
|
23909
|
-
Link2.prototype.getChild = function(
|
|
23910
|
-
if (Object.hasOwnProperty.call(this.children,
|
|
23911
|
-
return this.children[
|
|
24012
|
+
Link2.prototype.getChild = function(name) {
|
|
24013
|
+
if (Object.hasOwnProperty.call(this.children, name)) {
|
|
24014
|
+
return this.children[name];
|
|
23912
24015
|
}
|
|
23913
24016
|
};
|
|
23914
24017
|
Link2.prototype.getPath = function() {
|
|
@@ -24797,17 +24900,17 @@ var require_volume = __commonJS({
|
|
|
24797
24900
|
enumerable: false,
|
|
24798
24901
|
configurable: true
|
|
24799
24902
|
});
|
|
24800
|
-
Volume2.prototype.createLink = function(parent,
|
|
24903
|
+
Volume2.prototype.createLink = function(parent, name, isDirectory, perm) {
|
|
24801
24904
|
if (isDirectory === void 0) {
|
|
24802
24905
|
isDirectory = false;
|
|
24803
24906
|
}
|
|
24804
24907
|
if (!parent) {
|
|
24805
24908
|
return new this.props.Link(this, null, "");
|
|
24806
24909
|
}
|
|
24807
|
-
if (!
|
|
24910
|
+
if (!name) {
|
|
24808
24911
|
throw new Error("createLink: name cannot be empty");
|
|
24809
24912
|
}
|
|
24810
|
-
return parent.createChild(
|
|
24913
|
+
return parent.createChild(name, this.createNode(isDirectory, perm));
|
|
24811
24914
|
};
|
|
24812
24915
|
Volume2.prototype.deleteLink = function(link) {
|
|
24813
24916
|
var parent = link.parent;
|
|
@@ -25357,12 +25460,12 @@ var require_volume = __commonJS({
|
|
|
25357
25460
|
var dir2 = this.getLinkParent(steps2);
|
|
25358
25461
|
if (!dir2)
|
|
25359
25462
|
throw createError(ENOENT, "link", filename1, filename2);
|
|
25360
|
-
var
|
|
25361
|
-
if (dir2.getChild(
|
|
25463
|
+
var name = steps2[steps2.length - 1];
|
|
25464
|
+
if (dir2.getChild(name))
|
|
25362
25465
|
throw createError(EEXIST, "link", filename1, filename2);
|
|
25363
25466
|
var node = link1.getNode();
|
|
25364
25467
|
node.nlink++;
|
|
25365
|
-
dir2.createChild(
|
|
25468
|
+
dir2.createChild(name, node);
|
|
25366
25469
|
};
|
|
25367
25470
|
Volume2.prototype.copyFileBase = function(src, dest, flags) {
|
|
25368
25471
|
var buf = this.readFileSync(src);
|
|
@@ -25433,10 +25536,10 @@ var require_volume = __commonJS({
|
|
|
25433
25536
|
var dirLink = this.getLinkParent(pathSteps);
|
|
25434
25537
|
if (!dirLink)
|
|
25435
25538
|
throw createError(ENOENT, "symlink", targetFilename, pathFilename);
|
|
25436
|
-
var
|
|
25437
|
-
if (dirLink.getChild(
|
|
25539
|
+
var name = pathSteps[pathSteps.length - 1];
|
|
25540
|
+
if (dirLink.getChild(name))
|
|
25438
25541
|
throw createError(EEXIST, "symlink", targetFilename, pathFilename);
|
|
25439
|
-
var symlink = dirLink.createChild(
|
|
25542
|
+
var symlink = dirLink.createChild(name);
|
|
25440
25543
|
symlink.getNode().makeSymlink(filenameToSteps(targetFilename));
|
|
25441
25544
|
return symlink;
|
|
25442
25545
|
};
|
|
@@ -25542,9 +25645,9 @@ var require_volume = __commonJS({
|
|
|
25542
25645
|
if (oldLinkParent) {
|
|
25543
25646
|
oldLinkParent.deleteChild(link);
|
|
25544
25647
|
}
|
|
25545
|
-
var
|
|
25546
|
-
link.name =
|
|
25547
|
-
link.steps = __spreadArray(__spreadArray([], newPathDirLink.steps, true), [
|
|
25648
|
+
var name = newPathSteps[newPathSteps.length - 1];
|
|
25649
|
+
link.name = name;
|
|
25650
|
+
link.steps = __spreadArray(__spreadArray([], newPathDirLink.steps, true), [name], false);
|
|
25548
25651
|
newPathDirLink.setChild(link.getName(), link);
|
|
25549
25652
|
};
|
|
25550
25653
|
Volume2.prototype.renameSync = function(oldPath, newPath) {
|
|
@@ -25763,10 +25866,10 @@ var require_volume = __commonJS({
|
|
|
25763
25866
|
throw createError(EEXIST, "mkdir", filename);
|
|
25764
25867
|
}
|
|
25765
25868
|
var dir = this.getLinkParentAsDirOrThrow(filename, "mkdir");
|
|
25766
|
-
var
|
|
25767
|
-
if (dir.getChild(
|
|
25869
|
+
var name = steps[steps.length - 1];
|
|
25870
|
+
if (dir.getChild(name))
|
|
25768
25871
|
throw createError(EEXIST, "mkdir", filename);
|
|
25769
|
-
dir.createChild(
|
|
25872
|
+
dir.createChild(name, this.createNode(true, modeNum));
|
|
25770
25873
|
};
|
|
25771
25874
|
Volume2.prototype.mkdirpBase = function(filename, modeNum) {
|
|
25772
25875
|
var fullPath = resolve2(filename);
|
|
@@ -26690,8 +26793,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
26690
26793
|
reader._ownerReadableStream._reader = void 0;
|
|
26691
26794
|
reader._ownerReadableStream = void 0;
|
|
26692
26795
|
}
|
|
26693
|
-
function readerLockException(
|
|
26694
|
-
return new TypeError("Cannot " +
|
|
26796
|
+
function readerLockException(name) {
|
|
26797
|
+
return new TypeError("Cannot " + name + " a stream using a released reader");
|
|
26695
26798
|
}
|
|
26696
26799
|
function defaultReaderClosedPromiseInitialize(reader) {
|
|
26697
26800
|
reader._closedPromise = newPromise((resolve2, reject) => {
|
|
@@ -26918,8 +27021,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
26918
27021
|
stream._readableStreamController[PullSteps](readRequest);
|
|
26919
27022
|
}
|
|
26920
27023
|
}
|
|
26921
|
-
function defaultReaderBrandCheckException(
|
|
26922
|
-
return new TypeError(`ReadableStreamDefaultReader.prototype.${
|
|
27024
|
+
function defaultReaderBrandCheckException(name) {
|
|
27025
|
+
return new TypeError(`ReadableStreamDefaultReader.prototype.${name} can only be used on a ReadableStreamDefaultReader`);
|
|
26923
27026
|
}
|
|
26924
27027
|
const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () {
|
|
26925
27028
|
}).prototype);
|
|
@@ -27029,8 +27132,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
27029
27132
|
return false;
|
|
27030
27133
|
}
|
|
27031
27134
|
}
|
|
27032
|
-
function streamAsyncIteratorBrandCheckException(
|
|
27033
|
-
return new TypeError(`ReadableStreamAsyncIterator.${
|
|
27135
|
+
function streamAsyncIteratorBrandCheckException(name) {
|
|
27136
|
+
return new TypeError(`ReadableStreamAsyncIterator.${name} can only be used on a ReadableSteamAsyncIterator`);
|
|
27034
27137
|
}
|
|
27035
27138
|
const NumberIsNaN = Number.isNaN || function(x2) {
|
|
27036
27139
|
return x2 !== x2;
|
|
@@ -27670,11 +27773,11 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
27670
27773
|
request._associatedReadableByteStreamController = controller;
|
|
27671
27774
|
request._view = view;
|
|
27672
27775
|
}
|
|
27673
|
-
function byobRequestBrandCheckException(
|
|
27674
|
-
return new TypeError(`ReadableStreamBYOBRequest.prototype.${
|
|
27776
|
+
function byobRequestBrandCheckException(name) {
|
|
27777
|
+
return new TypeError(`ReadableStreamBYOBRequest.prototype.${name} can only be used on a ReadableStreamBYOBRequest`);
|
|
27675
27778
|
}
|
|
27676
|
-
function byteStreamControllerBrandCheckException(
|
|
27677
|
-
return new TypeError(`ReadableByteStreamController.prototype.${
|
|
27779
|
+
function byteStreamControllerBrandCheckException(name) {
|
|
27780
|
+
return new TypeError(`ReadableByteStreamController.prototype.${name} can only be used on a ReadableByteStreamController`);
|
|
27678
27781
|
}
|
|
27679
27782
|
function AcquireReadableStreamBYOBReader(stream) {
|
|
27680
27783
|
return new ReadableStreamBYOBReader(stream);
|
|
@@ -27807,8 +27910,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
27807
27910
|
ReadableByteStreamControllerPullInto(stream._readableStreamController, view, readIntoRequest);
|
|
27808
27911
|
}
|
|
27809
27912
|
}
|
|
27810
|
-
function byobReaderBrandCheckException(
|
|
27811
|
-
return new TypeError(`ReadableStreamBYOBReader.prototype.${
|
|
27913
|
+
function byobReaderBrandCheckException(name) {
|
|
27914
|
+
return new TypeError(`ReadableStreamBYOBReader.prototype.${name} can only be used on a ReadableStreamBYOBReader`);
|
|
27812
27915
|
}
|
|
27813
27916
|
function ExtractHighWaterMark(strategy, defaultHWM) {
|
|
27814
27917
|
const { highWaterMark } = strategy;
|
|
@@ -28578,17 +28681,17 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
28578
28681
|
WritableStreamDefaultControllerClearAlgorithms(controller);
|
|
28579
28682
|
WritableStreamStartErroring(stream, error);
|
|
28580
28683
|
}
|
|
28581
|
-
function streamBrandCheckException$2(
|
|
28582
|
-
return new TypeError(`WritableStream.prototype.${
|
|
28684
|
+
function streamBrandCheckException$2(name) {
|
|
28685
|
+
return new TypeError(`WritableStream.prototype.${name} can only be used on a WritableStream`);
|
|
28583
28686
|
}
|
|
28584
|
-
function defaultControllerBrandCheckException$2(
|
|
28585
|
-
return new TypeError(`WritableStreamDefaultController.prototype.${
|
|
28687
|
+
function defaultControllerBrandCheckException$2(name) {
|
|
28688
|
+
return new TypeError(`WritableStreamDefaultController.prototype.${name} can only be used on a WritableStreamDefaultController`);
|
|
28586
28689
|
}
|
|
28587
|
-
function defaultWriterBrandCheckException(
|
|
28588
|
-
return new TypeError(`WritableStreamDefaultWriter.prototype.${
|
|
28690
|
+
function defaultWriterBrandCheckException(name) {
|
|
28691
|
+
return new TypeError(`WritableStreamDefaultWriter.prototype.${name} can only be used on a WritableStreamDefaultWriter`);
|
|
28589
28692
|
}
|
|
28590
|
-
function defaultWriterLockException(
|
|
28591
|
-
return new TypeError("Cannot " +
|
|
28693
|
+
function defaultWriterLockException(name) {
|
|
28694
|
+
return new TypeError("Cannot " + name + " a stream using a released writer");
|
|
28592
28695
|
}
|
|
28593
28696
|
function defaultWriterClosedPromiseInitialize(writer) {
|
|
28594
28697
|
writer._closedPromise = newPromise((resolve2, reject) => {
|
|
@@ -28680,9 +28783,9 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
28680
28783
|
}
|
|
28681
28784
|
}
|
|
28682
28785
|
function createDOMExceptionPolyfill() {
|
|
28683
|
-
const ctor = function DOMException3(message,
|
|
28786
|
+
const ctor = function DOMException3(message, name) {
|
|
28684
28787
|
this.message = message || "";
|
|
28685
|
-
this.name =
|
|
28788
|
+
this.name = name || "Error";
|
|
28686
28789
|
if (Error.captureStackTrace) {
|
|
28687
28790
|
Error.captureStackTrace(this, this.constructor);
|
|
28688
28791
|
}
|
|
@@ -29070,8 +29173,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
29070
29173
|
}
|
|
29071
29174
|
SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);
|
|
29072
29175
|
}
|
|
29073
|
-
function defaultControllerBrandCheckException$1(
|
|
29074
|
-
return new TypeError(`ReadableStreamDefaultController.prototype.${
|
|
29176
|
+
function defaultControllerBrandCheckException$1(name) {
|
|
29177
|
+
return new TypeError(`ReadableStreamDefaultController.prototype.${name} can only be used on a ReadableStreamDefaultController`);
|
|
29075
29178
|
}
|
|
29076
29179
|
function ReadableStreamTee(stream, cloneForBranch2) {
|
|
29077
29180
|
if (IsReadableByteStreamController(stream._readableStreamController)) {
|
|
@@ -29679,8 +29782,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
29679
29782
|
reader._readIntoRequests = new SimpleQueue();
|
|
29680
29783
|
}
|
|
29681
29784
|
}
|
|
29682
|
-
function streamBrandCheckException$1(
|
|
29683
|
-
return new TypeError(`ReadableStream.prototype.${
|
|
29785
|
+
function streamBrandCheckException$1(name) {
|
|
29786
|
+
return new TypeError(`ReadableStream.prototype.${name} can only be used on a ReadableStream`);
|
|
29684
29787
|
}
|
|
29685
29788
|
function convertQueuingStrategyInit(init, context) {
|
|
29686
29789
|
assertDictionary(init, context);
|
|
@@ -29729,8 +29832,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
29729
29832
|
configurable: true
|
|
29730
29833
|
});
|
|
29731
29834
|
}
|
|
29732
|
-
function byteLengthBrandCheckException(
|
|
29733
|
-
return new TypeError(`ByteLengthQueuingStrategy.prototype.${
|
|
29835
|
+
function byteLengthBrandCheckException(name) {
|
|
29836
|
+
return new TypeError(`ByteLengthQueuingStrategy.prototype.${name} can only be used on a ByteLengthQueuingStrategy`);
|
|
29734
29837
|
}
|
|
29735
29838
|
function IsByteLengthQueuingStrategy(x2) {
|
|
29736
29839
|
if (!typeIsObject(x2)) {
|
|
@@ -29780,8 +29883,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
29780
29883
|
configurable: true
|
|
29781
29884
|
});
|
|
29782
29885
|
}
|
|
29783
|
-
function countBrandCheckException(
|
|
29784
|
-
return new TypeError(`CountQueuingStrategy.prototype.${
|
|
29886
|
+
function countBrandCheckException(name) {
|
|
29887
|
+
return new TypeError(`CountQueuingStrategy.prototype.${name} can only be used on a CountQueuingStrategy`);
|
|
29785
29888
|
}
|
|
29786
29889
|
function IsCountQueuingStrategy(x2) {
|
|
29787
29890
|
if (!typeIsObject(x2)) {
|
|
@@ -30081,11 +30184,11 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
30081
30184
|
TransformStreamSetBackpressure(stream, false);
|
|
30082
30185
|
return stream._backpressureChangePromise;
|
|
30083
30186
|
}
|
|
30084
|
-
function defaultControllerBrandCheckException(
|
|
30085
|
-
return new TypeError(`TransformStreamDefaultController.prototype.${
|
|
30187
|
+
function defaultControllerBrandCheckException(name) {
|
|
30188
|
+
return new TypeError(`TransformStreamDefaultController.prototype.${name} can only be used on a TransformStreamDefaultController`);
|
|
30086
30189
|
}
|
|
30087
|
-
function streamBrandCheckException(
|
|
30088
|
-
return new TypeError(`TransformStream.prototype.${
|
|
30190
|
+
function streamBrandCheckException(name) {
|
|
30191
|
+
return new TypeError(`TransformStream.prototype.${name} can only be used on a TransformStream`);
|
|
30089
30192
|
}
|
|
30090
30193
|
exports2.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy;
|
|
30091
30194
|
exports2.CountQueuingStrategy = CountQueuingStrategy;
|
|
@@ -30129,7 +30232,7 @@ var require_streams = __commonJS({
|
|
|
30129
30232
|
try {
|
|
30130
30233
|
const { Blob: Blob3 } = require("buffer");
|
|
30131
30234
|
if (Blob3 && !Blob3.prototype.stream) {
|
|
30132
|
-
Blob3.prototype.stream = function
|
|
30235
|
+
Blob3.prototype.stream = function name(params) {
|
|
30133
30236
|
let position = 0;
|
|
30134
30237
|
const blob = this;
|
|
30135
30238
|
return new ReadableStream({
|
|
@@ -30667,27 +30770,27 @@ var init_multipart_parser = __esm({
|
|
|
30667
30770
|
const bufferLength = data.length;
|
|
30668
30771
|
let c;
|
|
30669
30772
|
let cl;
|
|
30670
|
-
const mark = (
|
|
30671
|
-
this[
|
|
30773
|
+
const mark = (name) => {
|
|
30774
|
+
this[name + "Mark"] = i2;
|
|
30672
30775
|
};
|
|
30673
|
-
const clear = (
|
|
30674
|
-
delete this[
|
|
30776
|
+
const clear = (name) => {
|
|
30777
|
+
delete this[name + "Mark"];
|
|
30675
30778
|
};
|
|
30676
30779
|
const callback = (callbackSymbol, start, end, ui8a) => {
|
|
30677
30780
|
if (start === void 0 || start !== end) {
|
|
30678
30781
|
this[callbackSymbol](ui8a && ui8a.subarray(start, end));
|
|
30679
30782
|
}
|
|
30680
30783
|
};
|
|
30681
|
-
const dataCallback = (
|
|
30682
|
-
const markSymbol =
|
|
30784
|
+
const dataCallback = (name, clear2) => {
|
|
30785
|
+
const markSymbol = name + "Mark";
|
|
30683
30786
|
if (!(markSymbol in this)) {
|
|
30684
30787
|
return;
|
|
30685
30788
|
}
|
|
30686
30789
|
if (clear2) {
|
|
30687
|
-
callback(
|
|
30790
|
+
callback(name, this[markSymbol], i2, data);
|
|
30688
30791
|
delete this[markSymbol];
|
|
30689
30792
|
} else {
|
|
30690
|
-
callback(
|
|
30793
|
+
callback(name, this[markSymbol], data.length, data);
|
|
30691
30794
|
this[markSymbol] = 0;
|
|
30692
30795
|
}
|
|
30693
30796
|
};
|
|
@@ -31085,10 +31188,10 @@ var require_lib3 = __commonJS({
|
|
|
31085
31188
|
MissingSemicolon: "Missing semicolon.",
|
|
31086
31189
|
MissingPlugin: ({
|
|
31087
31190
|
missingPlugin
|
|
31088
|
-
}) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map((
|
|
31191
|
+
}) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map((name) => JSON.stringify(name)).join(", ")}.`,
|
|
31089
31192
|
MissingOneOfPlugins: ({
|
|
31090
31193
|
missingPlugin
|
|
31091
|
-
}) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map((
|
|
31194
|
+
}) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map((name) => JSON.stringify(name)).join(", ")}.`,
|
|
31092
31195
|
MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.",
|
|
31093
31196
|
MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.",
|
|
31094
31197
|
ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.",
|
|
@@ -31406,10 +31509,10 @@ var require_lib3 = __commonJS({
|
|
|
31406
31509
|
return this.convertPrivateNameToPrivateIdentifier(node);
|
|
31407
31510
|
}
|
|
31408
31511
|
convertPrivateNameToPrivateIdentifier(node) {
|
|
31409
|
-
const
|
|
31512
|
+
const name = super.getPrivateNameSV(node);
|
|
31410
31513
|
node = node;
|
|
31411
31514
|
delete node.id;
|
|
31412
|
-
node.name =
|
|
31515
|
+
node.name = name;
|
|
31413
31516
|
node.type = "PrivateIdentifier";
|
|
31414
31517
|
return node;
|
|
31415
31518
|
}
|
|
@@ -31682,14 +31785,14 @@ var require_lib3 = __commonJS({
|
|
|
31682
31785
|
}
|
|
31683
31786
|
};
|
|
31684
31787
|
var keywords$1 = /* @__PURE__ */ new Map();
|
|
31685
|
-
function createKeyword(
|
|
31686
|
-
options.keyword =
|
|
31687
|
-
const token = createToken(
|
|
31688
|
-
keywords$1.set(
|
|
31788
|
+
function createKeyword(name, options = {}) {
|
|
31789
|
+
options.keyword = name;
|
|
31790
|
+
const token = createToken(name, options);
|
|
31791
|
+
keywords$1.set(name, token);
|
|
31689
31792
|
return token;
|
|
31690
31793
|
}
|
|
31691
|
-
function createBinop(
|
|
31692
|
-
return createToken(
|
|
31794
|
+
function createBinop(name, binop) {
|
|
31795
|
+
return createToken(name, {
|
|
31693
31796
|
beforeExpr,
|
|
31694
31797
|
binop
|
|
31695
31798
|
});
|
|
@@ -31701,22 +31804,22 @@ var require_lib3 = __commonJS({
|
|
|
31701
31804
|
var tokenBeforeExprs = [];
|
|
31702
31805
|
var tokenStartsExprs = [];
|
|
31703
31806
|
var tokenPrefixes = [];
|
|
31704
|
-
function createToken(
|
|
31807
|
+
function createToken(name, options = {}) {
|
|
31705
31808
|
var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix;
|
|
31706
31809
|
++tokenTypeCounter;
|
|
31707
|
-
tokenLabels.push(
|
|
31810
|
+
tokenLabels.push(name);
|
|
31708
31811
|
tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1);
|
|
31709
31812
|
tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false);
|
|
31710
31813
|
tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false);
|
|
31711
31814
|
tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false);
|
|
31712
|
-
tokenTypes.push(new ExportedTokenType(
|
|
31815
|
+
tokenTypes.push(new ExportedTokenType(name, options));
|
|
31713
31816
|
return tokenTypeCounter;
|
|
31714
31817
|
}
|
|
31715
|
-
function createKeywordLike(
|
|
31818
|
+
function createKeywordLike(name, options = {}) {
|
|
31716
31819
|
var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2;
|
|
31717
31820
|
++tokenTypeCounter;
|
|
31718
|
-
keywords$1.set(
|
|
31719
|
-
tokenLabels.push(
|
|
31821
|
+
keywords$1.set(name, tokenTypeCounter);
|
|
31822
|
+
tokenLabels.push(name);
|
|
31720
31823
|
tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1);
|
|
31721
31824
|
tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false);
|
|
31722
31825
|
tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false);
|
|
@@ -32435,63 +32538,63 @@ var require_lib3 = __commonJS({
|
|
|
32435
32538
|
treatFunctionsAsVarInScope(scope) {
|
|
32436
32539
|
return !!(scope.flags & (SCOPE_FUNCTION | SCOPE_STATIC_BLOCK) || !this.parser.inModule && scope.flags & SCOPE_PROGRAM);
|
|
32437
32540
|
}
|
|
32438
|
-
declareName(
|
|
32541
|
+
declareName(name, bindingType, loc) {
|
|
32439
32542
|
let scope = this.currentScope();
|
|
32440
32543
|
if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) {
|
|
32441
|
-
this.checkRedeclarationInScope(scope,
|
|
32544
|
+
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
32442
32545
|
if (bindingType & BIND_SCOPE_FUNCTION) {
|
|
32443
|
-
scope.functions.add(
|
|
32546
|
+
scope.functions.add(name);
|
|
32444
32547
|
} else {
|
|
32445
|
-
scope.lexical.add(
|
|
32548
|
+
scope.lexical.add(name);
|
|
32446
32549
|
}
|
|
32447
32550
|
if (bindingType & BIND_SCOPE_LEXICAL) {
|
|
32448
|
-
this.maybeExportDefined(scope,
|
|
32551
|
+
this.maybeExportDefined(scope, name);
|
|
32449
32552
|
}
|
|
32450
32553
|
} else if (bindingType & BIND_SCOPE_VAR) {
|
|
32451
32554
|
for (let i2 = this.scopeStack.length - 1; i2 >= 0; --i2) {
|
|
32452
32555
|
scope = this.scopeStack[i2];
|
|
32453
|
-
this.checkRedeclarationInScope(scope,
|
|
32454
|
-
scope.var.add(
|
|
32455
|
-
this.maybeExportDefined(scope,
|
|
32556
|
+
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
32557
|
+
scope.var.add(name);
|
|
32558
|
+
this.maybeExportDefined(scope, name);
|
|
32456
32559
|
if (scope.flags & SCOPE_VAR)
|
|
32457
32560
|
break;
|
|
32458
32561
|
}
|
|
32459
32562
|
}
|
|
32460
32563
|
if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) {
|
|
32461
|
-
this.undefinedExports.delete(
|
|
32564
|
+
this.undefinedExports.delete(name);
|
|
32462
32565
|
}
|
|
32463
32566
|
}
|
|
32464
|
-
maybeExportDefined(scope,
|
|
32567
|
+
maybeExportDefined(scope, name) {
|
|
32465
32568
|
if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) {
|
|
32466
|
-
this.undefinedExports.delete(
|
|
32569
|
+
this.undefinedExports.delete(name);
|
|
32467
32570
|
}
|
|
32468
32571
|
}
|
|
32469
|
-
checkRedeclarationInScope(scope,
|
|
32470
|
-
if (this.isRedeclaredInScope(scope,
|
|
32572
|
+
checkRedeclarationInScope(scope, name, bindingType, loc) {
|
|
32573
|
+
if (this.isRedeclaredInScope(scope, name, bindingType)) {
|
|
32471
32574
|
this.parser.raise(Errors.VarRedeclaration, {
|
|
32472
32575
|
at: loc,
|
|
32473
|
-
identifierName:
|
|
32576
|
+
identifierName: name
|
|
32474
32577
|
});
|
|
32475
32578
|
}
|
|
32476
32579
|
}
|
|
32477
|
-
isRedeclaredInScope(scope,
|
|
32580
|
+
isRedeclaredInScope(scope, name, bindingType) {
|
|
32478
32581
|
if (!(bindingType & BIND_KIND_VALUE))
|
|
32479
32582
|
return false;
|
|
32480
32583
|
if (bindingType & BIND_SCOPE_LEXICAL) {
|
|
32481
|
-
return scope.lexical.has(
|
|
32584
|
+
return scope.lexical.has(name) || scope.functions.has(name) || scope.var.has(name);
|
|
32482
32585
|
}
|
|
32483
32586
|
if (bindingType & BIND_SCOPE_FUNCTION) {
|
|
32484
|
-
return scope.lexical.has(
|
|
32587
|
+
return scope.lexical.has(name) || !this.treatFunctionsAsVarInScope(scope) && scope.var.has(name);
|
|
32485
32588
|
}
|
|
32486
|
-
return scope.lexical.has(
|
|
32589
|
+
return scope.lexical.has(name) && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical.values().next().value === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name);
|
|
32487
32590
|
}
|
|
32488
32591
|
checkLocalExport(id) {
|
|
32489
32592
|
const {
|
|
32490
|
-
name
|
|
32593
|
+
name
|
|
32491
32594
|
} = id;
|
|
32492
32595
|
const topLevelScope = this.scopeStack[0];
|
|
32493
|
-
if (!topLevelScope.lexical.has(
|
|
32494
|
-
this.undefinedExports.set(
|
|
32596
|
+
if (!topLevelScope.lexical.has(name) && !topLevelScope.var.has(name) && !topLevelScope.functions.has(name)) {
|
|
32597
|
+
this.undefinedExports.set(name, id.loc.start);
|
|
32495
32598
|
}
|
|
32496
32599
|
}
|
|
32497
32600
|
currentScope() {
|
|
@@ -32528,21 +32631,21 @@ var require_lib3 = __commonJS({
|
|
|
32528
32631
|
createScope(flags) {
|
|
32529
32632
|
return new FlowScope(flags);
|
|
32530
32633
|
}
|
|
32531
|
-
declareName(
|
|
32634
|
+
declareName(name, bindingType, loc) {
|
|
32532
32635
|
const scope = this.currentScope();
|
|
32533
32636
|
if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {
|
|
32534
|
-
this.checkRedeclarationInScope(scope,
|
|
32535
|
-
this.maybeExportDefined(scope,
|
|
32536
|
-
scope.declareFunctions.add(
|
|
32637
|
+
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
32638
|
+
this.maybeExportDefined(scope, name);
|
|
32639
|
+
scope.declareFunctions.add(name);
|
|
32537
32640
|
return;
|
|
32538
32641
|
}
|
|
32539
|
-
super.declareName(
|
|
32642
|
+
super.declareName(name, bindingType, loc);
|
|
32540
32643
|
}
|
|
32541
|
-
isRedeclaredInScope(scope,
|
|
32542
|
-
if (super.isRedeclaredInScope(scope,
|
|
32644
|
+
isRedeclaredInScope(scope, name, bindingType) {
|
|
32645
|
+
if (super.isRedeclaredInScope(scope, name, bindingType))
|
|
32543
32646
|
return true;
|
|
32544
32647
|
if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {
|
|
32545
|
-
return !scope.declareFunctions.has(
|
|
32648
|
+
return !scope.declareFunctions.has(name) && (scope.lexical.has(name) || scope.functions.has(name));
|
|
32546
32649
|
}
|
|
32547
32650
|
return false;
|
|
32548
32651
|
}
|
|
@@ -32574,9 +32677,9 @@ var require_lib3 = __commonJS({
|
|
|
32574
32677
|
return true;
|
|
32575
32678
|
}
|
|
32576
32679
|
}
|
|
32577
|
-
getPluginOption(
|
|
32680
|
+
getPluginOption(plugin2, name) {
|
|
32578
32681
|
var _this$plugins$get;
|
|
32579
|
-
return (_this$plugins$get = this.plugins.get(
|
|
32682
|
+
return (_this$plugins$get = this.plugins.get(plugin2)) == null ? void 0 : _this$plugins$get[name];
|
|
32580
32683
|
}
|
|
32581
32684
|
};
|
|
32582
32685
|
function setTrailingComments(node, comments) {
|
|
@@ -34253,7 +34356,7 @@ var require_lib3 = __commonJS({
|
|
|
34253
34356
|
});
|
|
34254
34357
|
}
|
|
34255
34358
|
expectOnePlugin(pluginNames) {
|
|
34256
|
-
if (!pluginNames.some((
|
|
34359
|
+
if (!pluginNames.some((name) => this.hasPlugin(name))) {
|
|
34257
34360
|
throw this.raise(Errors.MissingOneOfPlugins, {
|
|
34258
34361
|
at: this.state.startLoc,
|
|
34259
34362
|
missingPlugin: pluginNames
|
|
@@ -34291,28 +34394,28 @@ var require_lib3 = __commonJS({
|
|
|
34291
34394
|
exit() {
|
|
34292
34395
|
const oldClassScope = this.stack.pop();
|
|
34293
34396
|
const current = this.current();
|
|
34294
|
-
for (const [
|
|
34397
|
+
for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) {
|
|
34295
34398
|
if (current) {
|
|
34296
|
-
if (!current.undefinedPrivateNames.has(
|
|
34297
|
-
current.undefinedPrivateNames.set(
|
|
34399
|
+
if (!current.undefinedPrivateNames.has(name)) {
|
|
34400
|
+
current.undefinedPrivateNames.set(name, loc);
|
|
34298
34401
|
}
|
|
34299
34402
|
} else {
|
|
34300
34403
|
this.parser.raise(Errors.InvalidPrivateFieldResolution, {
|
|
34301
34404
|
at: loc,
|
|
34302
|
-
identifierName:
|
|
34405
|
+
identifierName: name
|
|
34303
34406
|
});
|
|
34304
34407
|
}
|
|
34305
34408
|
}
|
|
34306
34409
|
}
|
|
34307
|
-
declarePrivateName(
|
|
34410
|
+
declarePrivateName(name, elementType, loc) {
|
|
34308
34411
|
const {
|
|
34309
34412
|
privateNames,
|
|
34310
34413
|
loneAccessors,
|
|
34311
34414
|
undefinedPrivateNames
|
|
34312
34415
|
} = this.current();
|
|
34313
|
-
let redefined = privateNames.has(
|
|
34416
|
+
let redefined = privateNames.has(name);
|
|
34314
34417
|
if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) {
|
|
34315
|
-
const accessor = redefined && loneAccessors.get(
|
|
34418
|
+
const accessor = redefined && loneAccessors.get(name);
|
|
34316
34419
|
if (accessor) {
|
|
34317
34420
|
const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC;
|
|
34318
34421
|
const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC;
|
|
@@ -34320,32 +34423,32 @@ var require_lib3 = __commonJS({
|
|
|
34320
34423
|
const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR;
|
|
34321
34424
|
redefined = oldKind === newKind || oldStatic !== newStatic;
|
|
34322
34425
|
if (!redefined)
|
|
34323
|
-
loneAccessors.delete(
|
|
34426
|
+
loneAccessors.delete(name);
|
|
34324
34427
|
} else if (!redefined) {
|
|
34325
|
-
loneAccessors.set(
|
|
34428
|
+
loneAccessors.set(name, elementType);
|
|
34326
34429
|
}
|
|
34327
34430
|
}
|
|
34328
34431
|
if (redefined) {
|
|
34329
34432
|
this.parser.raise(Errors.PrivateNameRedeclaration, {
|
|
34330
34433
|
at: loc,
|
|
34331
|
-
identifierName:
|
|
34434
|
+
identifierName: name
|
|
34332
34435
|
});
|
|
34333
34436
|
}
|
|
34334
|
-
privateNames.add(
|
|
34335
|
-
undefinedPrivateNames.delete(
|
|
34437
|
+
privateNames.add(name);
|
|
34438
|
+
undefinedPrivateNames.delete(name);
|
|
34336
34439
|
}
|
|
34337
|
-
usePrivateName(
|
|
34440
|
+
usePrivateName(name, loc) {
|
|
34338
34441
|
let classScope;
|
|
34339
34442
|
for (classScope of this.stack) {
|
|
34340
|
-
if (classScope.privateNames.has(
|
|
34443
|
+
if (classScope.privateNames.has(name))
|
|
34341
34444
|
return;
|
|
34342
34445
|
}
|
|
34343
34446
|
if (classScope) {
|
|
34344
|
-
classScope.undefinedPrivateNames.set(
|
|
34447
|
+
classScope.undefinedPrivateNames.set(name, loc);
|
|
34345
34448
|
} else {
|
|
34346
34449
|
this.parser.raise(Errors.InvalidPrivateFieldResolution, {
|
|
34347
34450
|
at: loc,
|
|
34348
|
-
identifierName:
|
|
34451
|
+
identifierName: name
|
|
34349
34452
|
});
|
|
34350
34453
|
}
|
|
34351
34454
|
}
|
|
@@ -34535,17 +34638,17 @@ var require_lib3 = __commonJS({
|
|
|
34535
34638
|
isContextual(token) {
|
|
34536
34639
|
return this.state.type === token && !this.state.containsEsc;
|
|
34537
34640
|
}
|
|
34538
|
-
isUnparsedContextual(nameStart,
|
|
34539
|
-
const nameEnd = nameStart +
|
|
34540
|
-
if (this.input.slice(nameStart, nameEnd) ===
|
|
34641
|
+
isUnparsedContextual(nameStart, name) {
|
|
34642
|
+
const nameEnd = nameStart + name.length;
|
|
34643
|
+
if (this.input.slice(nameStart, nameEnd) === name) {
|
|
34541
34644
|
const nextCh = this.input.charCodeAt(nameEnd);
|
|
34542
34645
|
return !(isIdentifierChar(nextCh) || (nextCh & 64512) === 55296);
|
|
34543
34646
|
}
|
|
34544
34647
|
return false;
|
|
34545
34648
|
}
|
|
34546
|
-
isLookaheadContextual(
|
|
34649
|
+
isLookaheadContextual(name) {
|
|
34547
34650
|
const next = this.nextTokenStart();
|
|
34548
|
-
return this.isUnparsedContextual(next,
|
|
34651
|
+
return this.isUnparsedContextual(next, name);
|
|
34549
34652
|
}
|
|
34550
34653
|
eatContextual(token) {
|
|
34551
34654
|
if (this.isContextual(token)) {
|
|
@@ -34780,7 +34883,7 @@ var require_lib3 = __commonJS({
|
|
|
34780
34883
|
loc,
|
|
34781
34884
|
range,
|
|
34782
34885
|
extra,
|
|
34783
|
-
name
|
|
34886
|
+
name
|
|
34784
34887
|
} = node;
|
|
34785
34888
|
const cloned = Object.create(NodePrototype);
|
|
34786
34889
|
cloned.type = type;
|
|
@@ -34789,7 +34892,7 @@ var require_lib3 = __commonJS({
|
|
|
34789
34892
|
cloned.loc = loc;
|
|
34790
34893
|
cloned.range = range;
|
|
34791
34894
|
cloned.extra = extra;
|
|
34792
|
-
cloned.name =
|
|
34895
|
+
cloned.name = name;
|
|
34793
34896
|
if (type === "Placeholder") {
|
|
34794
34897
|
cloned.expectedNode = node.expectedNode;
|
|
34795
34898
|
}
|
|
@@ -35749,7 +35852,7 @@ var require_lib3 = __commonJS({
|
|
|
35749
35852
|
return this.finishNode(node, "TupleTypeAnnotation");
|
|
35750
35853
|
}
|
|
35751
35854
|
flowParseFunctionTypeParam(first) {
|
|
35752
|
-
let
|
|
35855
|
+
let name = null;
|
|
35753
35856
|
let optional = false;
|
|
35754
35857
|
let typeAnnotation = null;
|
|
35755
35858
|
const node = this.startNode();
|
|
@@ -35761,7 +35864,7 @@ var require_lib3 = __commonJS({
|
|
|
35761
35864
|
at: node
|
|
35762
35865
|
});
|
|
35763
35866
|
}
|
|
35764
|
-
|
|
35867
|
+
name = this.parseIdentifier(isThis);
|
|
35765
35868
|
if (this.eat(17)) {
|
|
35766
35869
|
optional = true;
|
|
35767
35870
|
if (isThis) {
|
|
@@ -35774,7 +35877,7 @@ var require_lib3 = __commonJS({
|
|
|
35774
35877
|
} else {
|
|
35775
35878
|
typeAnnotation = this.flowParseType();
|
|
35776
35879
|
}
|
|
35777
|
-
node.name =
|
|
35880
|
+
node.name = name;
|
|
35778
35881
|
node.optional = optional;
|
|
35779
35882
|
node.typeAnnotation = typeAnnotation;
|
|
35780
35883
|
return this.finishNode(node, "FunctionTypeParam");
|
|
@@ -37786,11 +37889,11 @@ var require_lib3 = __commonJS({
|
|
|
37786
37889
|
}
|
|
37787
37890
|
jsxParseNamespacedName() {
|
|
37788
37891
|
const startLoc = this.state.startLoc;
|
|
37789
|
-
const
|
|
37892
|
+
const name = this.jsxParseIdentifier();
|
|
37790
37893
|
if (!this.eat(14))
|
|
37791
|
-
return
|
|
37894
|
+
return name;
|
|
37792
37895
|
const node = this.startNodeAt(startLoc);
|
|
37793
|
-
node.namespace =
|
|
37896
|
+
node.namespace = name;
|
|
37794
37897
|
node.name = this.jsxParseIdentifier();
|
|
37795
37898
|
return this.finishNode(node, "JSXNamespacedName");
|
|
37796
37899
|
}
|
|
@@ -38074,82 +38177,82 @@ var require_lib3 = __commonJS({
|
|
|
38074
38177
|
}
|
|
38075
38178
|
return flags;
|
|
38076
38179
|
}
|
|
38077
|
-
hasImport(
|
|
38180
|
+
hasImport(name, allowShadow) {
|
|
38078
38181
|
const len = this.importsStack.length;
|
|
38079
|
-
if (this.importsStack[len - 1].has(
|
|
38182
|
+
if (this.importsStack[len - 1].has(name)) {
|
|
38080
38183
|
return true;
|
|
38081
38184
|
}
|
|
38082
38185
|
if (!allowShadow && len > 1) {
|
|
38083
38186
|
for (let i2 = 0; i2 < len - 1; i2++) {
|
|
38084
|
-
if (this.importsStack[i2].has(
|
|
38187
|
+
if (this.importsStack[i2].has(name))
|
|
38085
38188
|
return true;
|
|
38086
38189
|
}
|
|
38087
38190
|
}
|
|
38088
38191
|
return false;
|
|
38089
38192
|
}
|
|
38090
|
-
declareName(
|
|
38193
|
+
declareName(name, bindingType, loc) {
|
|
38091
38194
|
if (bindingType & BIND_FLAGS_TS_IMPORT) {
|
|
38092
|
-
if (this.hasImport(
|
|
38195
|
+
if (this.hasImport(name, true)) {
|
|
38093
38196
|
this.parser.raise(Errors.VarRedeclaration, {
|
|
38094
38197
|
at: loc,
|
|
38095
|
-
identifierName:
|
|
38198
|
+
identifierName: name
|
|
38096
38199
|
});
|
|
38097
38200
|
}
|
|
38098
|
-
this.importsStack[this.importsStack.length - 1].add(
|
|
38201
|
+
this.importsStack[this.importsStack.length - 1].add(name);
|
|
38099
38202
|
return;
|
|
38100
38203
|
}
|
|
38101
38204
|
const scope = this.currentScope();
|
|
38102
38205
|
if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) {
|
|
38103
|
-
this.maybeExportDefined(scope,
|
|
38104
|
-
scope.exportOnlyBindings.add(
|
|
38206
|
+
this.maybeExportDefined(scope, name);
|
|
38207
|
+
scope.exportOnlyBindings.add(name);
|
|
38105
38208
|
return;
|
|
38106
38209
|
}
|
|
38107
|
-
super.declareName(
|
|
38210
|
+
super.declareName(name, bindingType, loc);
|
|
38108
38211
|
if (bindingType & BIND_KIND_TYPE) {
|
|
38109
38212
|
if (!(bindingType & BIND_KIND_VALUE)) {
|
|
38110
|
-
this.checkRedeclarationInScope(scope,
|
|
38111
|
-
this.maybeExportDefined(scope,
|
|
38213
|
+
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
38214
|
+
this.maybeExportDefined(scope, name);
|
|
38112
38215
|
}
|
|
38113
|
-
scope.types.add(
|
|
38216
|
+
scope.types.add(name);
|
|
38114
38217
|
}
|
|
38115
38218
|
if (bindingType & BIND_FLAGS_TS_ENUM)
|
|
38116
|
-
scope.enums.add(
|
|
38219
|
+
scope.enums.add(name);
|
|
38117
38220
|
if (bindingType & BIND_FLAGS_TS_CONST_ENUM)
|
|
38118
|
-
scope.constEnums.add(
|
|
38221
|
+
scope.constEnums.add(name);
|
|
38119
38222
|
if (bindingType & BIND_FLAGS_CLASS)
|
|
38120
|
-
scope.classes.add(
|
|
38223
|
+
scope.classes.add(name);
|
|
38121
38224
|
}
|
|
38122
|
-
isRedeclaredInScope(scope,
|
|
38123
|
-
if (scope.enums.has(
|
|
38225
|
+
isRedeclaredInScope(scope, name, bindingType) {
|
|
38226
|
+
if (scope.enums.has(name)) {
|
|
38124
38227
|
if (bindingType & BIND_FLAGS_TS_ENUM) {
|
|
38125
38228
|
const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM);
|
|
38126
|
-
const wasConst = scope.constEnums.has(
|
|
38229
|
+
const wasConst = scope.constEnums.has(name);
|
|
38127
38230
|
return isConst !== wasConst;
|
|
38128
38231
|
}
|
|
38129
38232
|
return true;
|
|
38130
38233
|
}
|
|
38131
|
-
if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(
|
|
38132
|
-
if (scope.lexical.has(
|
|
38234
|
+
if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(name)) {
|
|
38235
|
+
if (scope.lexical.has(name)) {
|
|
38133
38236
|
return !!(bindingType & BIND_KIND_VALUE);
|
|
38134
38237
|
} else {
|
|
38135
38238
|
return false;
|
|
38136
38239
|
}
|
|
38137
38240
|
}
|
|
38138
|
-
if (bindingType & BIND_KIND_TYPE && scope.types.has(
|
|
38241
|
+
if (bindingType & BIND_KIND_TYPE && scope.types.has(name)) {
|
|
38139
38242
|
return true;
|
|
38140
38243
|
}
|
|
38141
|
-
return super.isRedeclaredInScope(scope,
|
|
38244
|
+
return super.isRedeclaredInScope(scope, name, bindingType);
|
|
38142
38245
|
}
|
|
38143
38246
|
checkLocalExport(id) {
|
|
38144
38247
|
const {
|
|
38145
|
-
name
|
|
38248
|
+
name
|
|
38146
38249
|
} = id;
|
|
38147
|
-
if (this.hasImport(
|
|
38250
|
+
if (this.hasImport(name))
|
|
38148
38251
|
return;
|
|
38149
38252
|
const len = this.scopeStack.length;
|
|
38150
38253
|
for (let i2 = len - 1; i2 >= 0; i2--) {
|
|
38151
38254
|
const scope = this.scopeStack[i2];
|
|
38152
|
-
if (scope.types.has(
|
|
38255
|
+
if (scope.types.has(name) || scope.exportOnlyBindings.has(name))
|
|
38153
38256
|
return;
|
|
38154
38257
|
}
|
|
38155
38258
|
super.checkLocalExport(id);
|
|
@@ -40944,8 +41047,8 @@ var require_lib3 = __commonJS({
|
|
|
40944
41047
|
const node = this.startNode();
|
|
40945
41048
|
this.next();
|
|
40946
41049
|
if (tokenIsIdentifier(this.state.type)) {
|
|
40947
|
-
const
|
|
40948
|
-
const identifier = this.createIdentifier(node,
|
|
41050
|
+
const name = this.parseIdentifierName();
|
|
41051
|
+
const identifier = this.createIdentifier(node, name);
|
|
40949
41052
|
identifier.type = "V8IntrinsicIdentifier";
|
|
40950
41053
|
if (this.match(10)) {
|
|
40951
41054
|
return identifier;
|
|
@@ -40979,16 +41082,16 @@ var require_lib3 = __commonJS({
|
|
|
40979
41082
|
}
|
|
40980
41083
|
});
|
|
40981
41084
|
}
|
|
40982
|
-
function getPluginOption(plugins,
|
|
40983
|
-
const
|
|
40984
|
-
if (Array.isArray(
|
|
40985
|
-
return
|
|
41085
|
+
function getPluginOption(plugins, name, option) {
|
|
41086
|
+
const plugin2 = plugins.find((plugin3) => {
|
|
41087
|
+
if (Array.isArray(plugin3)) {
|
|
41088
|
+
return plugin3[0] === name;
|
|
40986
41089
|
} else {
|
|
40987
|
-
return
|
|
41090
|
+
return plugin3 === name;
|
|
40988
41091
|
}
|
|
40989
41092
|
});
|
|
40990
|
-
if (
|
|
40991
|
-
return
|
|
41093
|
+
if (plugin2 && Array.isArray(plugin2) && plugin2.length > 1) {
|
|
41094
|
+
return plugin2[1][option];
|
|
40992
41095
|
}
|
|
40993
41096
|
return null;
|
|
40994
41097
|
}
|
|
@@ -41407,15 +41510,15 @@ var require_lib3 = __commonJS({
|
|
|
41407
41510
|
if (expression.type === "Identifier") {
|
|
41408
41511
|
this.checkIdentifier(expression, binding, strictModeChanged, allowingSloppyLetBinding);
|
|
41409
41512
|
const {
|
|
41410
|
-
name
|
|
41513
|
+
name
|
|
41411
41514
|
} = expression;
|
|
41412
41515
|
if (checkClashes) {
|
|
41413
|
-
if (checkClashes.has(
|
|
41516
|
+
if (checkClashes.has(name)) {
|
|
41414
41517
|
this.raise(Errors.ParamDupe, {
|
|
41415
41518
|
at: expression
|
|
41416
41519
|
});
|
|
41417
41520
|
} else {
|
|
41418
|
-
checkClashes.add(
|
|
41521
|
+
checkClashes.add(name);
|
|
41419
41522
|
}
|
|
41420
41523
|
}
|
|
41421
41524
|
return;
|
|
@@ -41511,8 +41614,8 @@ var require_lib3 = __commonJS({
|
|
|
41511
41614
|
return;
|
|
41512
41615
|
}
|
|
41513
41616
|
const key = prop.key;
|
|
41514
|
-
const
|
|
41515
|
-
if (
|
|
41617
|
+
const name = key.type === "Identifier" ? key.name : key.value;
|
|
41618
|
+
if (name === "__proto__") {
|
|
41516
41619
|
if (isRecord) {
|
|
41517
41620
|
this.raise(Errors.RecordNoProto, {
|
|
41518
41621
|
at: key
|
|
@@ -42363,9 +42466,9 @@ var require_lib3 = __commonJS({
|
|
|
42363
42466
|
const id = this.startNodeAt(
|
|
42364
42467
|
createPositionWithColumnOffset(this.state.startLoc, 1)
|
|
42365
42468
|
);
|
|
42366
|
-
const
|
|
42469
|
+
const name = this.state.value;
|
|
42367
42470
|
this.next();
|
|
42368
|
-
node.id = this.createIdentifier(id,
|
|
42471
|
+
node.id = this.createIdentifier(id, name);
|
|
42369
42472
|
return this.finishNode(node, "PrivateName");
|
|
42370
42473
|
}
|
|
42371
42474
|
parseFunctionOrFunctionSent() {
|
|
@@ -43042,22 +43145,22 @@ var require_lib3 = __commonJS({
|
|
|
43042
43145
|
}
|
|
43043
43146
|
parseIdentifier(liberal) {
|
|
43044
43147
|
const node = this.startNode();
|
|
43045
|
-
const
|
|
43046
|
-
return this.createIdentifier(node,
|
|
43148
|
+
const name = this.parseIdentifierName(liberal);
|
|
43149
|
+
return this.createIdentifier(node, name);
|
|
43047
43150
|
}
|
|
43048
|
-
createIdentifier(node,
|
|
43049
|
-
node.name =
|
|
43050
|
-
node.loc.identifierName =
|
|
43151
|
+
createIdentifier(node, name) {
|
|
43152
|
+
node.name = name;
|
|
43153
|
+
node.loc.identifierName = name;
|
|
43051
43154
|
return this.finishNode(node, "Identifier");
|
|
43052
43155
|
}
|
|
43053
43156
|
parseIdentifierName(liberal) {
|
|
43054
|
-
let
|
|
43157
|
+
let name;
|
|
43055
43158
|
const {
|
|
43056
43159
|
startLoc,
|
|
43057
43160
|
type
|
|
43058
43161
|
} = this.state;
|
|
43059
43162
|
if (tokenIsKeywordOrIdentifier(type)) {
|
|
43060
|
-
|
|
43163
|
+
name = this.state.value;
|
|
43061
43164
|
} else {
|
|
43062
43165
|
throw this.unexpected();
|
|
43063
43166
|
}
|
|
@@ -43067,10 +43170,10 @@ var require_lib3 = __commonJS({
|
|
|
43067
43170
|
this.replaceToken(130);
|
|
43068
43171
|
}
|
|
43069
43172
|
} else {
|
|
43070
|
-
this.checkReservedWord(
|
|
43173
|
+
this.checkReservedWord(name, startLoc, tokenIsKeyword2, false);
|
|
43071
43174
|
}
|
|
43072
43175
|
this.next();
|
|
43073
|
-
return
|
|
43176
|
+
return name;
|
|
43074
43177
|
}
|
|
43075
43178
|
checkReservedWord(word, startLoc, checkKeywords, isBinding) {
|
|
43076
43179
|
if (word.length > 10) {
|
|
@@ -45318,10 +45421,10 @@ var require_lib3 = __commonJS({
|
|
|
45318
45421
|
};
|
|
45319
45422
|
function pluginsMap(plugins) {
|
|
45320
45423
|
const pluginMap = /* @__PURE__ */ new Map();
|
|
45321
|
-
for (const
|
|
45322
|
-
const [
|
|
45323
|
-
if (!pluginMap.has(
|
|
45324
|
-
pluginMap.set(
|
|
45424
|
+
for (const plugin2 of plugins) {
|
|
45425
|
+
const [name, options] = Array.isArray(plugin2) ? plugin2 : [plugin2, {}];
|
|
45426
|
+
if (!pluginMap.has(name))
|
|
45427
|
+
pluginMap.set(name, options || {});
|
|
45325
45428
|
}
|
|
45326
45429
|
return pluginMap;
|
|
45327
45430
|
}
|
|
@@ -45383,13 +45486,13 @@ var require_lib3 = __commonJS({
|
|
|
45383
45486
|
}
|
|
45384
45487
|
var parserClassCache = {};
|
|
45385
45488
|
function getParserClass(pluginsFromOptions) {
|
|
45386
|
-
const pluginList = mixinPluginNames.filter((
|
|
45489
|
+
const pluginList = mixinPluginNames.filter((name) => hasPlugin(pluginsFromOptions, name));
|
|
45387
45490
|
const key = pluginList.join("/");
|
|
45388
45491
|
let cls = parserClassCache[key];
|
|
45389
45492
|
if (!cls) {
|
|
45390
45493
|
cls = Parser;
|
|
45391
|
-
for (const
|
|
45392
|
-
cls = mixinPlugins[
|
|
45494
|
+
for (const plugin2 of pluginList) {
|
|
45495
|
+
cls = mixinPlugins[plugin2](cls);
|
|
45393
45496
|
}
|
|
45394
45497
|
parserClassCache[key] = cls;
|
|
45395
45498
|
}
|
|
@@ -46026,9 +46129,9 @@ var require_types = __commonJS({
|
|
|
46026
46129
|
}(BaseType);
|
|
46027
46130
|
var PredicateType = function(_super) {
|
|
46028
46131
|
tslib_1.__extends(PredicateType2, _super);
|
|
46029
|
-
function PredicateType2(
|
|
46132
|
+
function PredicateType2(name, predicate) {
|
|
46030
46133
|
var _this = _super.call(this) || this;
|
|
46031
|
-
_this.name =
|
|
46134
|
+
_this.name = name;
|
|
46032
46135
|
_this.predicate = predicate;
|
|
46033
46136
|
_this.kind = "PredicateType";
|
|
46034
46137
|
return _this;
|
|
@@ -46074,8 +46177,8 @@ var require_types = __commonJS({
|
|
|
46074
46177
|
if (this.finalized !== true) {
|
|
46075
46178
|
throw new Error("" + this.typeName);
|
|
46076
46179
|
}
|
|
46077
|
-
function checkFieldByName(
|
|
46078
|
-
var field = allFields[
|
|
46180
|
+
function checkFieldByName(name) {
|
|
46181
|
+
var field = allFields[name];
|
|
46079
46182
|
var type = field.type;
|
|
46080
46183
|
var child = field.getValue(value);
|
|
46081
46184
|
return type.check(child, deep);
|
|
@@ -46110,8 +46213,8 @@ var require_types = __commonJS({
|
|
|
46110
46213
|
}();
|
|
46111
46214
|
exports.Def = Def;
|
|
46112
46215
|
var Field = function() {
|
|
46113
|
-
function Field2(
|
|
46114
|
-
this.name =
|
|
46216
|
+
function Field2(name, type, defaultFn, hidden) {
|
|
46217
|
+
this.name = name;
|
|
46115
46218
|
this.type = type;
|
|
46116
46219
|
this.defaultFn = defaultFn;
|
|
46117
46220
|
this.hidden = !!hidden;
|
|
@@ -46153,7 +46256,7 @@ var require_types = __commonJS({
|
|
|
46153
46256
|
return Type.from(type);
|
|
46154
46257
|
}));
|
|
46155
46258
|
},
|
|
46156
|
-
from: function(value,
|
|
46259
|
+
from: function(value, name) {
|
|
46157
46260
|
if (value instanceof ArrayType || value instanceof IdentityType || value instanceof ObjectType || value instanceof OrType || value instanceof PredicateType) {
|
|
46158
46261
|
return value;
|
|
46159
46262
|
}
|
|
@@ -46167,8 +46270,8 @@ var require_types = __commonJS({
|
|
|
46167
46270
|
return new ArrayType(Type.from(value[0]));
|
|
46168
46271
|
}
|
|
46169
46272
|
if (isObject2.check(value)) {
|
|
46170
|
-
return new ObjectType(Object.keys(value).map(function(
|
|
46171
|
-
return new Field(
|
|
46273
|
+
return new ObjectType(Object.keys(value).map(function(name2) {
|
|
46274
|
+
return new Field(name2, Type.from(value[name2], name2));
|
|
46172
46275
|
}));
|
|
46173
46276
|
}
|
|
46174
46277
|
if (typeof value === "function") {
|
|
@@ -46176,10 +46279,10 @@ var require_types = __commonJS({
|
|
|
46176
46279
|
if (bicfIndex >= 0) {
|
|
46177
46280
|
return builtInCtorTypes[bicfIndex];
|
|
46178
46281
|
}
|
|
46179
|
-
if (typeof
|
|
46282
|
+
if (typeof name !== "string") {
|
|
46180
46283
|
throw new Error("missing name");
|
|
46181
46284
|
}
|
|
46182
|
-
return new PredicateType(
|
|
46285
|
+
return new PredicateType(name, value);
|
|
46183
46286
|
}
|
|
46184
46287
|
return new IdentityType(value);
|
|
46185
46288
|
},
|
|
@@ -46192,9 +46295,9 @@ var require_types = __commonJS({
|
|
|
46192
46295
|
};
|
|
46193
46296
|
var builtInCtorFns = [];
|
|
46194
46297
|
var builtInCtorTypes = [];
|
|
46195
|
-
function defBuiltInType(
|
|
46298
|
+
function defBuiltInType(name, example) {
|
|
46196
46299
|
var objStr = objToStr.call(example);
|
|
46197
|
-
var type = new PredicateType(
|
|
46300
|
+
var type = new PredicateType(name, function(value) {
|
|
46198
46301
|
return objToStr.call(value) === objStr;
|
|
46199
46302
|
});
|
|
46200
46303
|
if (example && typeof example.constructor === "function") {
|
|
@@ -46305,8 +46408,8 @@ var require_types = __commonJS({
|
|
|
46305
46408
|
} else if (field.defaultFn) {
|
|
46306
46409
|
value = field.defaultFn.call(built);
|
|
46307
46410
|
} else {
|
|
46308
|
-
var message = "no value or default function given for field " + JSON.stringify(param) + " of " + _this.typeName + "(" + _this.buildParams.map(function(
|
|
46309
|
-
return all[
|
|
46411
|
+
var message = "no value or default function given for field " + JSON.stringify(param) + " of " + _this.typeName + "(" + _this.buildParams.map(function(name) {
|
|
46412
|
+
return all[name];
|
|
46310
46413
|
}).join(", ") + ")";
|
|
46311
46414
|
throw new Error(message);
|
|
46312
46415
|
}
|
|
@@ -46363,12 +46466,12 @@ var require_types = __commonJS({
|
|
|
46363
46466
|
});
|
|
46364
46467
|
return this;
|
|
46365
46468
|
};
|
|
46366
|
-
DefImpl2.prototype.field = function(
|
|
46469
|
+
DefImpl2.prototype.field = function(name, type, defaultFn, hidden) {
|
|
46367
46470
|
if (this.finalized) {
|
|
46368
|
-
console.error("Ignoring attempt to redefine field " + JSON.stringify(
|
|
46471
|
+
console.error("Ignoring attempt to redefine field " + JSON.stringify(name) + " of finalized type " + JSON.stringify(this.typeName));
|
|
46369
46472
|
return this;
|
|
46370
46473
|
}
|
|
46371
|
-
this.ownFields[
|
|
46474
|
+
this.ownFields[name] = new Field(name, Type.from(type), defaultFn, hidden);
|
|
46372
46475
|
return this;
|
|
46373
46476
|
};
|
|
46374
46477
|
DefImpl2.prototype.finalize = function() {
|
|
@@ -46376,14 +46479,14 @@ var require_types = __commonJS({
|
|
|
46376
46479
|
if (!this.finalized) {
|
|
46377
46480
|
var allFields = this.allFields;
|
|
46378
46481
|
var allSupertypes = this.allSupertypes;
|
|
46379
|
-
this.baseNames.forEach(function(
|
|
46380
|
-
var def = defCache[
|
|
46482
|
+
this.baseNames.forEach(function(name) {
|
|
46483
|
+
var def = defCache[name];
|
|
46381
46484
|
if (def instanceof Def) {
|
|
46382
46485
|
def.finalize();
|
|
46383
46486
|
extend(allFields, def.allFields);
|
|
46384
46487
|
extend(allSupertypes, def.allSupertypes);
|
|
46385
46488
|
} else {
|
|
46386
|
-
var message = "unknown supertype name " + JSON.stringify(
|
|
46489
|
+
var message = "unknown supertype name " + JSON.stringify(name) + " for subtype " + JSON.stringify(_this.typeName);
|
|
46387
46490
|
throw new Error(message);
|
|
46388
46491
|
}
|
|
46389
46492
|
});
|
|
@@ -46440,13 +46543,13 @@ var require_types = __commonJS({
|
|
|
46440
46543
|
}
|
|
46441
46544
|
var builders = /* @__PURE__ */ Object.create(null);
|
|
46442
46545
|
var nodePrototype = {};
|
|
46443
|
-
function defineMethod(
|
|
46444
|
-
var old = nodePrototype[
|
|
46546
|
+
function defineMethod(name, func) {
|
|
46547
|
+
var old = nodePrototype[name];
|
|
46445
46548
|
if (isUndefined.check(func)) {
|
|
46446
|
-
delete nodePrototype[
|
|
46549
|
+
delete nodePrototype[name];
|
|
46447
46550
|
} else {
|
|
46448
46551
|
isFunction.assert(func);
|
|
46449
|
-
Object.defineProperty(nodePrototype,
|
|
46552
|
+
Object.defineProperty(nodePrototype, name, {
|
|
46450
46553
|
enumerable: true,
|
|
46451
46554
|
configurable: true,
|
|
46452
46555
|
value: func
|
|
@@ -46493,13 +46596,13 @@ var require_types = __commonJS({
|
|
|
46493
46596
|
return object && object[fieldName];
|
|
46494
46597
|
}
|
|
46495
46598
|
function eachField(object, callback, context) {
|
|
46496
|
-
getFieldNames(object).forEach(function(
|
|
46497
|
-
callback.call(this,
|
|
46599
|
+
getFieldNames(object).forEach(function(name) {
|
|
46600
|
+
callback.call(this, name, getFieldValue(object, name));
|
|
46498
46601
|
}, context);
|
|
46499
46602
|
}
|
|
46500
46603
|
function someField(object, callback, context) {
|
|
46501
|
-
return getFieldNames(object).some(function(
|
|
46502
|
-
return callback.call(this,
|
|
46604
|
+
return getFieldNames(object).some(function(name) {
|
|
46605
|
+
return callback.call(this, name, getFieldValue(object, name));
|
|
46503
46606
|
}, context);
|
|
46504
46607
|
}
|
|
46505
46608
|
function wrapExpressionBuilderWithStatement(typeName) {
|
|
@@ -46549,14 +46652,14 @@ var require_types = __commonJS({
|
|
|
46549
46652
|
list.length = to;
|
|
46550
46653
|
}
|
|
46551
46654
|
function extend(into, from) {
|
|
46552
|
-
Object.keys(from).forEach(function(
|
|
46553
|
-
into[
|
|
46655
|
+
Object.keys(from).forEach(function(name) {
|
|
46656
|
+
into[name] = from[name];
|
|
46554
46657
|
});
|
|
46555
46658
|
return into;
|
|
46556
46659
|
}
|
|
46557
46660
|
function finalize() {
|
|
46558
|
-
Object.keys(defCache).forEach(function(
|
|
46559
|
-
defCache[
|
|
46661
|
+
Object.keys(defCache).forEach(function(name) {
|
|
46662
|
+
defCache[name].finalize();
|
|
46560
46663
|
});
|
|
46561
46664
|
}
|
|
46562
46665
|
return {
|
|
@@ -46597,7 +46700,7 @@ var require_path2 = __commonJS({
|
|
|
46597
46700
|
var types17 = fork.use(types_1.default);
|
|
46598
46701
|
var isArray = types17.builtInTypes.array;
|
|
46599
46702
|
var isNumber = types17.builtInTypes.number;
|
|
46600
|
-
var Path = function Path2(value, parentPath,
|
|
46703
|
+
var Path = function Path2(value, parentPath, name) {
|
|
46601
46704
|
if (!(this instanceof Path2)) {
|
|
46602
46705
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
46603
46706
|
}
|
|
@@ -46607,28 +46710,28 @@ var require_path2 = __commonJS({
|
|
|
46607
46710
|
}
|
|
46608
46711
|
} else {
|
|
46609
46712
|
parentPath = null;
|
|
46610
|
-
|
|
46713
|
+
name = null;
|
|
46611
46714
|
}
|
|
46612
46715
|
this.value = value;
|
|
46613
46716
|
this.parentPath = parentPath;
|
|
46614
|
-
this.name =
|
|
46717
|
+
this.name = name;
|
|
46615
46718
|
this.__childCache = null;
|
|
46616
46719
|
};
|
|
46617
46720
|
var Pp = Path.prototype;
|
|
46618
46721
|
function getChildCache(path2) {
|
|
46619
46722
|
return path2.__childCache || (path2.__childCache = /* @__PURE__ */ Object.create(null));
|
|
46620
46723
|
}
|
|
46621
|
-
function getChildPath(path2,
|
|
46724
|
+
function getChildPath(path2, name) {
|
|
46622
46725
|
var cache = getChildCache(path2);
|
|
46623
|
-
var actualChildValue = path2.getValueProperty(
|
|
46624
|
-
var childPath = cache[
|
|
46625
|
-
if (!hasOwn.call(cache,
|
|
46626
|
-
childPath = cache[
|
|
46726
|
+
var actualChildValue = path2.getValueProperty(name);
|
|
46727
|
+
var childPath = cache[name];
|
|
46728
|
+
if (!hasOwn.call(cache, name) || childPath.value !== actualChildValue) {
|
|
46729
|
+
childPath = cache[name] = new path2.constructor(actualChildValue, path2, name);
|
|
46627
46730
|
}
|
|
46628
46731
|
return childPath;
|
|
46629
46732
|
}
|
|
46630
|
-
Pp.getValueProperty = function getValueProperty(
|
|
46631
|
-
return this.value[
|
|
46733
|
+
Pp.getValueProperty = function getValueProperty(name) {
|
|
46734
|
+
return this.value[name];
|
|
46632
46735
|
};
|
|
46633
46736
|
Pp.get = function get() {
|
|
46634
46737
|
var names = [];
|
|
@@ -46944,13 +47047,13 @@ var require_scope = __commonJS({
|
|
|
46944
47047
|
};
|
|
46945
47048
|
var Sp = Scope.prototype;
|
|
46946
47049
|
Sp.didScan = false;
|
|
46947
|
-
Sp.declares = function(
|
|
47050
|
+
Sp.declares = function(name) {
|
|
46948
47051
|
this.scan();
|
|
46949
|
-
return hasOwn.call(this.bindings,
|
|
47052
|
+
return hasOwn.call(this.bindings, name);
|
|
46950
47053
|
};
|
|
46951
|
-
Sp.declaresType = function(
|
|
47054
|
+
Sp.declaresType = function(name) {
|
|
46952
47055
|
this.scan();
|
|
46953
|
-
return hasOwn.call(this.types,
|
|
47056
|
+
return hasOwn.call(this.types, name);
|
|
46954
47057
|
};
|
|
46955
47058
|
Sp.declareTemporary = function(prefix) {
|
|
46956
47059
|
if (prefix) {
|
|
@@ -46966,8 +47069,8 @@ var require_scope = __commonJS({
|
|
|
46966
47069
|
while (this.declares(prefix + index)) {
|
|
46967
47070
|
++index;
|
|
46968
47071
|
}
|
|
46969
|
-
var
|
|
46970
|
-
return this.bindings[
|
|
47072
|
+
var name = prefix + index;
|
|
47073
|
+
return this.bindings[name] = types17.builders.identifier(name);
|
|
46971
47074
|
};
|
|
46972
47075
|
Sp.injectTemporary = function(identifier, init) {
|
|
46973
47076
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -46980,11 +47083,11 @@ var require_scope = __commonJS({
|
|
|
46980
47083
|
};
|
|
46981
47084
|
Sp.scan = function(force) {
|
|
46982
47085
|
if (force || !this.didScan) {
|
|
46983
|
-
for (var
|
|
46984
|
-
delete this.bindings[
|
|
47086
|
+
for (var name in this.bindings) {
|
|
47087
|
+
delete this.bindings[name];
|
|
46985
47088
|
}
|
|
46986
|
-
for (var
|
|
46987
|
-
delete this.types[
|
|
47089
|
+
for (var name in this.types) {
|
|
47090
|
+
delete this.types[name];
|
|
46988
47091
|
}
|
|
46989
47092
|
scanScope(this.path, this.bindings, this.types);
|
|
46990
47093
|
this.didScan = true;
|
|
@@ -47043,8 +47146,8 @@ var require_scope = __commonJS({
|
|
|
47043
47146
|
bindings
|
|
47044
47147
|
);
|
|
47045
47148
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
47046
|
-
types17.eachField(node, function(
|
|
47047
|
-
var childPath = path2.get(
|
|
47149
|
+
types17.eachField(node, function(name, child) {
|
|
47150
|
+
var childPath = path2.get(name);
|
|
47048
47151
|
if (!pathHasValue(childPath, child)) {
|
|
47049
47152
|
throw new Error("");
|
|
47050
47153
|
}
|
|
@@ -47141,15 +47244,15 @@ var require_scope = __commonJS({
|
|
|
47141
47244
|
types18[parameter.name] = [parameterPath];
|
|
47142
47245
|
}
|
|
47143
47246
|
}
|
|
47144
|
-
Sp.lookup = function(
|
|
47247
|
+
Sp.lookup = function(name) {
|
|
47145
47248
|
for (var scope = this; scope; scope = scope.parent)
|
|
47146
|
-
if (scope.declares(
|
|
47249
|
+
if (scope.declares(name))
|
|
47147
47250
|
break;
|
|
47148
47251
|
return scope;
|
|
47149
47252
|
};
|
|
47150
|
-
Sp.lookupType = function(
|
|
47253
|
+
Sp.lookupType = function(name) {
|
|
47151
47254
|
for (var scope = this; scope; scope = scope.parent)
|
|
47152
|
-
if (scope.declaresType(
|
|
47255
|
+
if (scope.declaresType(name))
|
|
47153
47256
|
break;
|
|
47154
47257
|
return scope;
|
|
47155
47258
|
};
|
|
@@ -47186,11 +47289,11 @@ var require_node_path = __commonJS({
|
|
|
47186
47289
|
var isArray = types17.builtInTypes.array;
|
|
47187
47290
|
var Path = fork.use(path_1.default);
|
|
47188
47291
|
var Scope = fork.use(scope_1.default);
|
|
47189
|
-
var NodePath = function NodePath2(value, parentPath,
|
|
47292
|
+
var NodePath = function NodePath2(value, parentPath, name) {
|
|
47190
47293
|
if (!(this instanceof NodePath2)) {
|
|
47191
47294
|
throw new Error("NodePath constructor cannot be invoked without 'new'");
|
|
47192
47295
|
}
|
|
47193
|
-
Path.call(this, value, parentPath,
|
|
47296
|
+
Path.call(this, value, parentPath, name);
|
|
47194
47297
|
};
|
|
47195
47298
|
var NPp = NodePath.prototype = Object.create(Path.prototype, {
|
|
47196
47299
|
constructor: {
|
|
@@ -47273,8 +47376,8 @@ var require_node_path = __commonJS({
|
|
|
47273
47376
|
}
|
|
47274
47377
|
return scope || null;
|
|
47275
47378
|
};
|
|
47276
|
-
NPp.getValueProperty = function(
|
|
47277
|
-
return types17.getFieldValue(this.value,
|
|
47379
|
+
NPp.getValueProperty = function(name) {
|
|
47380
|
+
return types17.getFieldValue(this.value, name);
|
|
47278
47381
|
};
|
|
47279
47382
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
47280
47383
|
var pp = this.parentPath;
|
|
@@ -47929,18 +48032,18 @@ var require_equiv = __commonJS({
|
|
|
47929
48032
|
var bNameCount = bNames.length;
|
|
47930
48033
|
if (aNameCount === bNameCount) {
|
|
47931
48034
|
for (var i2 = 0; i2 < aNameCount; ++i2) {
|
|
47932
|
-
var
|
|
47933
|
-
var aChild = getFieldValue(a,
|
|
47934
|
-
var bChild = getFieldValue(b,
|
|
48035
|
+
var name = aNames[i2];
|
|
48036
|
+
var aChild = getFieldValue(a, name);
|
|
48037
|
+
var bChild = getFieldValue(b, name);
|
|
47935
48038
|
if (problemPath) {
|
|
47936
|
-
problemPath.push(
|
|
48039
|
+
problemPath.push(name);
|
|
47937
48040
|
}
|
|
47938
48041
|
if (!areEquivalent(aChild, bChild, problemPath)) {
|
|
47939
48042
|
return false;
|
|
47940
48043
|
}
|
|
47941
48044
|
if (problemPath) {
|
|
47942
48045
|
var problemPathTail = problemPath.pop();
|
|
47943
|
-
if (problemPathTail !==
|
|
48046
|
+
if (problemPathTail !== name) {
|
|
47944
48047
|
throw new Error("" + problemPathTail);
|
|
47945
48048
|
}
|
|
47946
48049
|
}
|
|
@@ -47955,15 +48058,15 @@ var require_equiv = __commonJS({
|
|
|
47955
48058
|
seenNames[aNames[i2]] = true;
|
|
47956
48059
|
}
|
|
47957
48060
|
for (i2 = 0; i2 < bNameCount; ++i2) {
|
|
47958
|
-
|
|
47959
|
-
if (!hasOwn.call(seenNames,
|
|
47960
|
-
problemPath.push(
|
|
48061
|
+
name = bNames[i2];
|
|
48062
|
+
if (!hasOwn.call(seenNames, name)) {
|
|
48063
|
+
problemPath.push(name);
|
|
47961
48064
|
return false;
|
|
47962
48065
|
}
|
|
47963
|
-
delete seenNames[
|
|
48066
|
+
delete seenNames[name];
|
|
47964
48067
|
}
|
|
47965
|
-
for (
|
|
47966
|
-
problemPath.push(
|
|
48068
|
+
for (name in seenNames) {
|
|
48069
|
+
problemPath.push(name);
|
|
47967
48070
|
break;
|
|
47968
48071
|
}
|
|
47969
48072
|
return false;
|
|
@@ -48020,12 +48123,12 @@ var require_fork = __commonJS({
|
|
|
48020
48123
|
function createFork() {
|
|
48021
48124
|
var used = [];
|
|
48022
48125
|
var usedResult = [];
|
|
48023
|
-
function use(
|
|
48024
|
-
var idx = used.indexOf(
|
|
48126
|
+
function use(plugin2) {
|
|
48127
|
+
var idx = used.indexOf(plugin2);
|
|
48025
48128
|
if (idx === -1) {
|
|
48026
48129
|
idx = used.length;
|
|
48027
|
-
used.push(
|
|
48028
|
-
usedResult[idx] =
|
|
48130
|
+
used.push(plugin2);
|
|
48131
|
+
usedResult[idx] = plugin2(fork);
|
|
48029
48132
|
}
|
|
48030
48133
|
return usedResult[idx];
|
|
48031
48134
|
}
|
|
@@ -49781,9 +49884,9 @@ var require_source_map_generator = __commonJS({
|
|
|
49781
49884
|
var generated = util.getArg(aArgs, "generated");
|
|
49782
49885
|
var original = util.getArg(aArgs, "original", null);
|
|
49783
49886
|
var source = util.getArg(aArgs, "source", null);
|
|
49784
|
-
var
|
|
49887
|
+
var name = util.getArg(aArgs, "name", null);
|
|
49785
49888
|
if (!this._skipValidation) {
|
|
49786
|
-
this._validateMapping(generated, original, source,
|
|
49889
|
+
this._validateMapping(generated, original, source, name);
|
|
49787
49890
|
}
|
|
49788
49891
|
if (source != null) {
|
|
49789
49892
|
source = String(source);
|
|
@@ -49791,10 +49894,10 @@ var require_source_map_generator = __commonJS({
|
|
|
49791
49894
|
this._sources.add(source);
|
|
49792
49895
|
}
|
|
49793
49896
|
}
|
|
49794
|
-
if (
|
|
49795
|
-
|
|
49796
|
-
if (!this._names.has(
|
|
49797
|
-
this._names.add(
|
|
49897
|
+
if (name != null) {
|
|
49898
|
+
name = String(name);
|
|
49899
|
+
if (!this._names.has(name)) {
|
|
49900
|
+
this._names.add(name);
|
|
49798
49901
|
}
|
|
49799
49902
|
}
|
|
49800
49903
|
this._mappings.add({
|
|
@@ -49803,7 +49906,7 @@ var require_source_map_generator = __commonJS({
|
|
|
49803
49906
|
originalLine: original != null && original.line,
|
|
49804
49907
|
originalColumn: original != null && original.column,
|
|
49805
49908
|
source,
|
|
49806
|
-
name
|
|
49909
|
+
name
|
|
49807
49910
|
});
|
|
49808
49911
|
};
|
|
49809
49912
|
SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
|
|
@@ -49864,9 +49967,9 @@ var require_source_map_generator = __commonJS({
|
|
|
49864
49967
|
if (source != null && !newSources.has(source)) {
|
|
49865
49968
|
newSources.add(source);
|
|
49866
49969
|
}
|
|
49867
|
-
var
|
|
49868
|
-
if (
|
|
49869
|
-
newNames.add(
|
|
49970
|
+
var name = mapping.name;
|
|
49971
|
+
if (name != null && !newNames.has(name)) {
|
|
49972
|
+
newNames.add(name);
|
|
49870
49973
|
}
|
|
49871
49974
|
}, this);
|
|
49872
49975
|
this._sources = newSources;
|
|
@@ -50426,15 +50529,15 @@ var require_source_map_consumer = __commonJS({
|
|
|
50426
50529
|
source = this._sources.at(source);
|
|
50427
50530
|
source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
|
|
50428
50531
|
}
|
|
50429
|
-
var
|
|
50430
|
-
if (
|
|
50431
|
-
|
|
50532
|
+
var name = util.getArg(mapping, "name", null);
|
|
50533
|
+
if (name !== null) {
|
|
50534
|
+
name = this._names.at(name);
|
|
50432
50535
|
}
|
|
50433
50536
|
return {
|
|
50434
50537
|
source,
|
|
50435
50538
|
line: util.getArg(mapping, "originalLine", null),
|
|
50436
50539
|
column: util.getArg(mapping, "originalColumn", null),
|
|
50437
|
-
name
|
|
50540
|
+
name
|
|
50438
50541
|
};
|
|
50439
50542
|
}
|
|
50440
50543
|
}
|
|
@@ -50653,11 +50756,11 @@ var require_source_map_consumer = __commonJS({
|
|
|
50653
50756
|
source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
|
|
50654
50757
|
this._sources.add(source);
|
|
50655
50758
|
source = this._sources.indexOf(source);
|
|
50656
|
-
var
|
|
50759
|
+
var name = null;
|
|
50657
50760
|
if (mapping.name) {
|
|
50658
|
-
|
|
50659
|
-
this._names.add(
|
|
50660
|
-
|
|
50761
|
+
name = section.consumer._names.at(mapping.name);
|
|
50762
|
+
this._names.add(name);
|
|
50763
|
+
name = this._names.indexOf(name);
|
|
50661
50764
|
}
|
|
50662
50765
|
var adjustedMapping = {
|
|
50663
50766
|
source,
|
|
@@ -50665,7 +50768,7 @@ var require_source_map_consumer = __commonJS({
|
|
|
50665
50768
|
generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
|
|
50666
50769
|
originalLine: mapping.originalLine,
|
|
50667
50770
|
originalColumn: mapping.originalColumn,
|
|
50668
|
-
name
|
|
50771
|
+
name
|
|
50669
50772
|
};
|
|
50670
50773
|
this.__generatedMappings.push(adjustedMapping);
|
|
50671
50774
|
if (typeof adjustedMapping.originalLine === "number") {
|
|
@@ -51928,13 +52031,13 @@ var require_esprima2 = __commonJS({
|
|
|
51928
52031
|
};
|
|
51929
52032
|
JSXParser2.prototype.parseJSXNameValueAttribute = function() {
|
|
51930
52033
|
var node = this.createJSXNode();
|
|
51931
|
-
var
|
|
52034
|
+
var name = this.parseJSXAttributeName();
|
|
51932
52035
|
var value = null;
|
|
51933
52036
|
if (this.matchJSX("=")) {
|
|
51934
52037
|
this.expectJSX("=");
|
|
51935
52038
|
value = this.parseJSXAttributeValue();
|
|
51936
52039
|
}
|
|
51937
|
-
return this.finalize(node, new JSXNode.JSXAttribute(
|
|
52040
|
+
return this.finalize(node, new JSXNode.JSXAttribute(name, value));
|
|
51938
52041
|
};
|
|
51939
52042
|
JSXParser2.prototype.parseJSXSpreadAttribute = function() {
|
|
51940
52043
|
var node = this.createJSXNode();
|
|
@@ -51956,14 +52059,14 @@ var require_esprima2 = __commonJS({
|
|
|
51956
52059
|
JSXParser2.prototype.parseJSXOpeningElement = function() {
|
|
51957
52060
|
var node = this.createJSXNode();
|
|
51958
52061
|
this.expectJSX("<");
|
|
51959
|
-
var
|
|
52062
|
+
var name = this.parseJSXElementName();
|
|
51960
52063
|
var attributes = this.parseJSXAttributes();
|
|
51961
52064
|
var selfClosing = this.matchJSX("/");
|
|
51962
52065
|
if (selfClosing) {
|
|
51963
52066
|
this.expectJSX("/");
|
|
51964
52067
|
}
|
|
51965
52068
|
this.expectJSX(">");
|
|
51966
|
-
return this.finalize(node, new JSXNode.JSXOpeningElement(
|
|
52069
|
+
return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
|
|
51967
52070
|
};
|
|
51968
52071
|
JSXParser2.prototype.parseJSXBoundaryElement = function() {
|
|
51969
52072
|
var node = this.createJSXNode();
|
|
@@ -51974,14 +52077,14 @@ var require_esprima2 = __commonJS({
|
|
|
51974
52077
|
this.expectJSX(">");
|
|
51975
52078
|
return this.finalize(node, new JSXNode.JSXClosingElement(name_3));
|
|
51976
52079
|
}
|
|
51977
|
-
var
|
|
52080
|
+
var name = this.parseJSXElementName();
|
|
51978
52081
|
var attributes = this.parseJSXAttributes();
|
|
51979
52082
|
var selfClosing = this.matchJSX("/");
|
|
51980
52083
|
if (selfClosing) {
|
|
51981
52084
|
this.expectJSX("/");
|
|
51982
52085
|
}
|
|
51983
52086
|
this.expectJSX(">");
|
|
51984
|
-
return this.finalize(node, new JSXNode.JSXOpeningElement(
|
|
52087
|
+
return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
|
|
51985
52088
|
};
|
|
51986
52089
|
JSXParser2.prototype.parseJSXEmptyExpression = function() {
|
|
51987
52090
|
var node = this.createJSXChildNode();
|
|
@@ -52126,9 +52229,9 @@ var require_esprima2 = __commonJS({
|
|
|
52126
52229
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
52127
52230
|
var jsx_syntax_1 = __webpack_require__(6);
|
|
52128
52231
|
var JSXClosingElement = function() {
|
|
52129
|
-
function JSXClosingElement2(
|
|
52232
|
+
function JSXClosingElement2(name) {
|
|
52130
52233
|
this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement;
|
|
52131
|
-
this.name =
|
|
52234
|
+
this.name = name;
|
|
52132
52235
|
}
|
|
52133
52236
|
return JSXClosingElement2;
|
|
52134
52237
|
}();
|
|
@@ -52159,9 +52262,9 @@ var require_esprima2 = __commonJS({
|
|
|
52159
52262
|
}();
|
|
52160
52263
|
exports2.JSXExpressionContainer = JSXExpressionContainer;
|
|
52161
52264
|
var JSXIdentifier = function() {
|
|
52162
|
-
function JSXIdentifier2(
|
|
52265
|
+
function JSXIdentifier2(name) {
|
|
52163
52266
|
this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier;
|
|
52164
|
-
this.name =
|
|
52267
|
+
this.name = name;
|
|
52165
52268
|
}
|
|
52166
52269
|
return JSXIdentifier2;
|
|
52167
52270
|
}();
|
|
@@ -52176,27 +52279,27 @@ var require_esprima2 = __commonJS({
|
|
|
52176
52279
|
}();
|
|
52177
52280
|
exports2.JSXMemberExpression = JSXMemberExpression;
|
|
52178
52281
|
var JSXAttribute = function() {
|
|
52179
|
-
function JSXAttribute2(
|
|
52282
|
+
function JSXAttribute2(name, value) {
|
|
52180
52283
|
this.type = jsx_syntax_1.JSXSyntax.JSXAttribute;
|
|
52181
|
-
this.name =
|
|
52284
|
+
this.name = name;
|
|
52182
52285
|
this.value = value;
|
|
52183
52286
|
}
|
|
52184
52287
|
return JSXAttribute2;
|
|
52185
52288
|
}();
|
|
52186
52289
|
exports2.JSXAttribute = JSXAttribute;
|
|
52187
52290
|
var JSXNamespacedName = function() {
|
|
52188
|
-
function JSXNamespacedName2(namespace,
|
|
52291
|
+
function JSXNamespacedName2(namespace, name) {
|
|
52189
52292
|
this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName;
|
|
52190
52293
|
this.namespace = namespace;
|
|
52191
|
-
this.name =
|
|
52294
|
+
this.name = name;
|
|
52192
52295
|
}
|
|
52193
52296
|
return JSXNamespacedName2;
|
|
52194
52297
|
}();
|
|
52195
52298
|
exports2.JSXNamespacedName = JSXNamespacedName;
|
|
52196
52299
|
var JSXOpeningElement = function() {
|
|
52197
|
-
function JSXOpeningElement2(
|
|
52300
|
+
function JSXOpeningElement2(name, selfClosing, attributes) {
|
|
52198
52301
|
this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement;
|
|
52199
|
-
this.name =
|
|
52302
|
+
this.name = name;
|
|
52200
52303
|
this.selfClosing = selfClosing;
|
|
52201
52304
|
this.attributes = attributes;
|
|
52202
52305
|
}
|
|
@@ -52572,9 +52675,9 @@ var require_esprima2 = __commonJS({
|
|
|
52572
52675
|
}();
|
|
52573
52676
|
exports2.FunctionExpression = FunctionExpression;
|
|
52574
52677
|
var Identifier = function() {
|
|
52575
|
-
function Identifier2(
|
|
52678
|
+
function Identifier2(name) {
|
|
52576
52679
|
this.type = syntax_1.Syntax.Identifier;
|
|
52577
|
-
this.name =
|
|
52680
|
+
this.name = name;
|
|
52578
52681
|
}
|
|
52579
52682
|
return Identifier2;
|
|
52580
52683
|
}();
|
|
@@ -55081,10 +55184,10 @@ var require_esprima2 = __commonJS({
|
|
|
55081
55184
|
this.context.inFunctionBody = previousInFunctionBody;
|
|
55082
55185
|
return this.finalize(node, new Node.BlockStatement(body));
|
|
55083
55186
|
};
|
|
55084
|
-
Parser2.prototype.validateParam = function(options, param,
|
|
55085
|
-
var key = "$" +
|
|
55187
|
+
Parser2.prototype.validateParam = function(options, param, name) {
|
|
55188
|
+
var key = "$" + name;
|
|
55086
55189
|
if (this.context.strict) {
|
|
55087
|
-
if (this.scanner.isRestrictedWord(
|
|
55190
|
+
if (this.scanner.isRestrictedWord(name)) {
|
|
55088
55191
|
options.stricted = param;
|
|
55089
55192
|
options.message = messages_1.Messages.StrictParamName;
|
|
55090
55193
|
}
|
|
@@ -55093,10 +55196,10 @@ var require_esprima2 = __commonJS({
|
|
|
55093
55196
|
options.message = messages_1.Messages.StrictParamDupe;
|
|
55094
55197
|
}
|
|
55095
55198
|
} else if (!options.firstRestricted) {
|
|
55096
|
-
if (this.scanner.isRestrictedWord(
|
|
55199
|
+
if (this.scanner.isRestrictedWord(name)) {
|
|
55097
55200
|
options.firstRestricted = param;
|
|
55098
55201
|
options.message = messages_1.Messages.StrictParamName;
|
|
55099
|
-
} else if (this.scanner.isStrictModeReservedWord(
|
|
55202
|
+
} else if (this.scanner.isStrictModeReservedWord(name)) {
|
|
55100
55203
|
options.firstRestricted = param;
|
|
55101
55204
|
options.message = messages_1.Messages.StrictReservedWord;
|
|
55102
55205
|
} else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
|
|
@@ -57499,14 +57602,14 @@ var require_mapping = __commonJS({
|
|
|
57499
57602
|
var sourceLines = this.sourceLines;
|
|
57500
57603
|
var sourceLoc = this.sourceLoc;
|
|
57501
57604
|
var targetLoc = this.targetLoc;
|
|
57502
|
-
function skip(
|
|
57503
|
-
var sourceFromPos = sourceLoc[
|
|
57504
|
-
var targetFromPos = targetLoc[
|
|
57605
|
+
function skip(name) {
|
|
57606
|
+
var sourceFromPos = sourceLoc[name];
|
|
57607
|
+
var targetFromPos = targetLoc[name];
|
|
57505
57608
|
var targetToPos = start;
|
|
57506
|
-
if (
|
|
57609
|
+
if (name === "end") {
|
|
57507
57610
|
targetToPos = end;
|
|
57508
57611
|
} else {
|
|
57509
|
-
assert_1.default.strictEqual(
|
|
57612
|
+
assert_1.default.strictEqual(name, "start");
|
|
57510
57613
|
}
|
|
57511
57614
|
return skipChars(sourceLines, sourceFromPos, lines, targetFromPos, targetToPos);
|
|
57512
57615
|
}
|
|
@@ -58814,9 +58917,9 @@ var require_fast_path = __commonJS({
|
|
|
58814
58917
|
var value = s2[origLen - 1];
|
|
58815
58918
|
var argc = arguments.length;
|
|
58816
58919
|
for (var i2 = 1; i2 < argc; ++i2) {
|
|
58817
|
-
var
|
|
58818
|
-
value = value[
|
|
58819
|
-
s2.push(
|
|
58920
|
+
var name = arguments[i2];
|
|
58921
|
+
value = value[name];
|
|
58922
|
+
s2.push(name, value);
|
|
58820
58923
|
}
|
|
58821
58924
|
var result = callback(this);
|
|
58822
58925
|
s2.length = origLen;
|
|
@@ -58828,9 +58931,9 @@ var require_fast_path = __commonJS({
|
|
|
58828
58931
|
var value = s2[origLen - 1];
|
|
58829
58932
|
var argc = arguments.length;
|
|
58830
58933
|
for (var i2 = 1; i2 < argc; ++i2) {
|
|
58831
|
-
var
|
|
58832
|
-
value = value[
|
|
58833
|
-
s2.push(
|
|
58934
|
+
var name = arguments[i2];
|
|
58935
|
+
value = value[name];
|
|
58936
|
+
s2.push(name, value);
|
|
58834
58937
|
}
|
|
58835
58938
|
for (var i2 = 0; i2 < value.length; ++i2) {
|
|
58836
58939
|
if (i2 in value) {
|
|
@@ -58847,9 +58950,9 @@ var require_fast_path = __commonJS({
|
|
|
58847
58950
|
var value = s2[origLen - 1];
|
|
58848
58951
|
var argc = arguments.length;
|
|
58849
58952
|
for (var i2 = 1; i2 < argc; ++i2) {
|
|
58850
|
-
var
|
|
58851
|
-
value = value[
|
|
58852
|
-
s2.push(
|
|
58953
|
+
var name = arguments[i2];
|
|
58954
|
+
value = value[name];
|
|
58955
|
+
s2.push(name, value);
|
|
58853
58956
|
}
|
|
58854
58957
|
var result = new Array(value.length);
|
|
58855
58958
|
for (var i2 = 0; i2 < value.length; ++i2) {
|
|
@@ -58919,7 +59022,7 @@ var require_fast_path = __commonJS({
|
|
|
58919
59022
|
return true;
|
|
58920
59023
|
}
|
|
58921
59024
|
var parent = this.getParentNode();
|
|
58922
|
-
var
|
|
59025
|
+
var name = this.getName();
|
|
58923
59026
|
if (this.getValue() !== node) {
|
|
58924
59027
|
return false;
|
|
58925
59028
|
}
|
|
@@ -58941,18 +59044,18 @@ var require_fast_path = __commonJS({
|
|
|
58941
59044
|
case "UnaryExpression":
|
|
58942
59045
|
case "SpreadElement":
|
|
58943
59046
|
case "SpreadProperty":
|
|
58944
|
-
return parent.type === "MemberExpression" &&
|
|
59047
|
+
return parent.type === "MemberExpression" && name === "object" && parent.object === node;
|
|
58945
59048
|
case "BinaryExpression":
|
|
58946
59049
|
case "LogicalExpression":
|
|
58947
59050
|
switch (parent.type) {
|
|
58948
59051
|
case "CallExpression":
|
|
58949
|
-
return
|
|
59052
|
+
return name === "callee" && parent.callee === node;
|
|
58950
59053
|
case "UnaryExpression":
|
|
58951
59054
|
case "SpreadElement":
|
|
58952
59055
|
case "SpreadProperty":
|
|
58953
59056
|
return true;
|
|
58954
59057
|
case "MemberExpression":
|
|
58955
|
-
return
|
|
59058
|
+
return name === "object" && parent.object === node;
|
|
58956
59059
|
case "BinaryExpression":
|
|
58957
59060
|
case "LogicalExpression": {
|
|
58958
59061
|
var po = parent.operator;
|
|
@@ -58962,7 +59065,7 @@ var require_fast_path = __commonJS({
|
|
|
58962
59065
|
if (pp > np) {
|
|
58963
59066
|
return true;
|
|
58964
59067
|
}
|
|
58965
|
-
if (pp === np &&
|
|
59068
|
+
if (pp === np && name === "right") {
|
|
58966
59069
|
assert_1.default.strictEqual(parent.right, node);
|
|
58967
59070
|
return true;
|
|
58968
59071
|
}
|
|
@@ -58979,7 +59082,7 @@ var require_fast_path = __commonJS({
|
|
|
58979
59082
|
case "ForStatement":
|
|
58980
59083
|
return false;
|
|
58981
59084
|
case "ExpressionStatement":
|
|
58982
|
-
return
|
|
59085
|
+
return name !== "expression";
|
|
58983
59086
|
default:
|
|
58984
59087
|
return true;
|
|
58985
59088
|
}
|
|
@@ -58989,9 +59092,9 @@ var require_fast_path = __commonJS({
|
|
|
58989
59092
|
case "UnionTypeAnnotation":
|
|
58990
59093
|
return parent.type === "NullableTypeAnnotation";
|
|
58991
59094
|
case "Literal":
|
|
58992
|
-
return parent.type === "MemberExpression" && isNumber.check(node.value) &&
|
|
59095
|
+
return parent.type === "MemberExpression" && isNumber.check(node.value) && name === "object" && parent.object === node;
|
|
58993
59096
|
case "NumericLiteral":
|
|
58994
|
-
return parent.type === "MemberExpression" &&
|
|
59097
|
+
return parent.type === "MemberExpression" && name === "object" && parent.object === node;
|
|
58995
59098
|
case "YieldExpression":
|
|
58996
59099
|
case "AwaitExpression":
|
|
58997
59100
|
case "AssignmentExpression":
|
|
@@ -59005,41 +59108,41 @@ var require_fast_path = __commonJS({
|
|
|
59005
59108
|
return true;
|
|
59006
59109
|
case "CallExpression":
|
|
59007
59110
|
case "NewExpression":
|
|
59008
|
-
return
|
|
59111
|
+
return name === "callee" && parent.callee === node;
|
|
59009
59112
|
case "ConditionalExpression":
|
|
59010
|
-
return
|
|
59113
|
+
return name === "test" && parent.test === node;
|
|
59011
59114
|
case "MemberExpression":
|
|
59012
|
-
return
|
|
59115
|
+
return name === "object" && parent.object === node;
|
|
59013
59116
|
default:
|
|
59014
59117
|
return false;
|
|
59015
59118
|
}
|
|
59016
59119
|
case "ArrowFunctionExpression":
|
|
59017
|
-
if (n.CallExpression.check(parent) &&
|
|
59120
|
+
if (n.CallExpression.check(parent) && name === "callee" && parent.callee === node) {
|
|
59018
59121
|
return true;
|
|
59019
59122
|
}
|
|
59020
|
-
if (n.MemberExpression.check(parent) &&
|
|
59123
|
+
if (n.MemberExpression.check(parent) && name === "object" && parent.object === node) {
|
|
59021
59124
|
return true;
|
|
59022
59125
|
}
|
|
59023
|
-
if (n.TSAsExpression && n.TSAsExpression.check(parent) &&
|
|
59126
|
+
if (n.TSAsExpression && n.TSAsExpression.check(parent) && name === "expression" && parent.expression === node) {
|
|
59024
59127
|
return true;
|
|
59025
59128
|
}
|
|
59026
59129
|
return isBinary(parent);
|
|
59027
59130
|
case "ObjectExpression":
|
|
59028
|
-
if (parent.type === "ArrowFunctionExpression" &&
|
|
59131
|
+
if (parent.type === "ArrowFunctionExpression" && name === "body" && parent.body === node) {
|
|
59029
59132
|
return true;
|
|
59030
59133
|
}
|
|
59031
59134
|
break;
|
|
59032
59135
|
case "TSAsExpression":
|
|
59033
|
-
if (parent.type === "ArrowFunctionExpression" &&
|
|
59136
|
+
if (parent.type === "ArrowFunctionExpression" && name === "body" && parent.body === node && node.expression.type === "ObjectExpression") {
|
|
59034
59137
|
return true;
|
|
59035
59138
|
}
|
|
59036
59139
|
break;
|
|
59037
59140
|
case "CallExpression":
|
|
59038
|
-
if (
|
|
59141
|
+
if (name === "declaration" && n.ExportDefaultDeclaration.check(parent) && n.FunctionExpression.check(node.callee)) {
|
|
59039
59142
|
return true;
|
|
59040
59143
|
}
|
|
59041
59144
|
}
|
|
59042
|
-
if (parent.type === "NewExpression" &&
|
|
59145
|
+
if (parent.type === "NewExpression" && name === "callee" && parent.callee === node) {
|
|
59043
59146
|
return containsCallExpression(node);
|
|
59044
59147
|
}
|
|
59045
59148
|
if (assumeExpressionContext !== true && !this.canBeFirstInStatement() && this.firstInStatement()) {
|
|
@@ -60677,12 +60780,12 @@ var require_printer2 = __commonJS({
|
|
|
60677
60780
|
return (0, lines_1.concat)(parts);
|
|
60678
60781
|
}
|
|
60679
60782
|
case "FunctionTypeParam": {
|
|
60680
|
-
var
|
|
60681
|
-
parts.push(
|
|
60783
|
+
var name = path2.call(print12, "name");
|
|
60784
|
+
parts.push(name);
|
|
60682
60785
|
if (n.optional) {
|
|
60683
60786
|
parts.push("?");
|
|
60684
60787
|
}
|
|
60685
|
-
if (
|
|
60788
|
+
if (name.infos[0].line) {
|
|
60686
60789
|
parts.push(": ");
|
|
60687
60790
|
}
|
|
60688
60791
|
parts.push(path2.call(print12, "typeAnnotation"));
|
|
@@ -61875,8 +61978,8 @@ async function shouldRun(absolutePath, watchKind, watchAndRunConf) {
|
|
|
61875
61978
|
}
|
|
61876
61979
|
return null;
|
|
61877
61980
|
}
|
|
61878
|
-
function formatLog(str,
|
|
61879
|
-
return `${
|
|
61981
|
+
function formatLog(str, name) {
|
|
61982
|
+
return `${name ? logMagneta(`[${name}]`) : ""} ${str}`;
|
|
61880
61983
|
}
|
|
61881
61984
|
async function watcher(absolutePath, watchKind, watchAndRunConf) {
|
|
61882
61985
|
const info = await shouldRun(absolutePath, watchKind, watchAndRunConf);
|
|
@@ -61979,17 +62082,17 @@ function compareStrings(a, b) {
|
|
|
61979
62082
|
}
|
|
61980
62083
|
function nodeToString(a) {
|
|
61981
62084
|
var _a, _b;
|
|
61982
|
-
let
|
|
62085
|
+
let name;
|
|
61983
62086
|
if ("alias" in a) {
|
|
61984
|
-
|
|
62087
|
+
name = (_a = a.alias) === null || _a === void 0 ? void 0 : _a.value;
|
|
61985
62088
|
}
|
|
61986
|
-
if (
|
|
61987
|
-
|
|
62089
|
+
if (name == null && "name" in a) {
|
|
62090
|
+
name = (_b = a.name) === null || _b === void 0 ? void 0 : _b.value;
|
|
61988
62091
|
}
|
|
61989
|
-
if (
|
|
61990
|
-
|
|
62092
|
+
if (name == null) {
|
|
62093
|
+
name = a.kind;
|
|
61991
62094
|
}
|
|
61992
|
-
return
|
|
62095
|
+
return name;
|
|
61993
62096
|
}
|
|
61994
62097
|
function compareNodes(a, b, customFn) {
|
|
61995
62098
|
const aStr = nodeToString(a);
|
|
@@ -62106,9 +62209,9 @@ function formatArray(array, seenValues) {
|
|
|
62106
62209
|
function getObjectTag(object) {
|
|
62107
62210
|
const tag = Object.prototype.toString.call(object).replace(/^\[object /, "").replace(/]$/, "");
|
|
62108
62211
|
if (tag === "Object" && typeof object.constructor === "function") {
|
|
62109
|
-
const
|
|
62110
|
-
if (typeof
|
|
62111
|
-
return
|
|
62212
|
+
const name = object.constructor.name;
|
|
62213
|
+
if (typeof name === "string" && name !== "") {
|
|
62214
|
+
return name;
|
|
62112
62215
|
}
|
|
62113
62216
|
}
|
|
62114
62217
|
return tag;
|
|
@@ -62586,7 +62689,7 @@ function astFromEnumValue(value, schema, pathToDirectivesInExtensions) {
|
|
|
62586
62689
|
function makeDeprecatedDirective(deprecationReason) {
|
|
62587
62690
|
return makeDirectiveNode("deprecated", { reason: deprecationReason }, import_graphql4.GraphQLDeprecatedDirective);
|
|
62588
62691
|
}
|
|
62589
|
-
function makeDirectiveNode(
|
|
62692
|
+
function makeDirectiveNode(name, args, directive) {
|
|
62590
62693
|
const directiveArguments = [];
|
|
62591
62694
|
if (directive != null) {
|
|
62592
62695
|
for (const arg of directive.args) {
|
|
@@ -62626,7 +62729,7 @@ function makeDirectiveNode(name2, args, directive) {
|
|
|
62626
62729
|
kind: import_graphql4.Kind.DIRECTIVE,
|
|
62627
62730
|
name: {
|
|
62628
62731
|
kind: import_graphql4.Kind.NAME,
|
|
62629
|
-
value:
|
|
62732
|
+
value: name
|
|
62630
62733
|
},
|
|
62631
62734
|
arguments: directiveArguments
|
|
62632
62735
|
};
|
|
@@ -62766,8 +62869,8 @@ var printDocASTReducer = {
|
|
|
62766
62869
|
},
|
|
62767
62870
|
SelectionSet: { leave: ({ selections }) => block(selections) },
|
|
62768
62871
|
Field: {
|
|
62769
|
-
leave({ alias, name
|
|
62770
|
-
const prefix = wrap("", alias, ": ") +
|
|
62872
|
+
leave({ alias, name, arguments: args, directives, selectionSet }) {
|
|
62873
|
+
const prefix = wrap("", alias, ": ") + name;
|
|
62771
62874
|
let argsLine = prefix + wrap("(", join(args, ", "), ")");
|
|
62772
62875
|
if (argsLine.length > MAX_LINE_LENGTH) {
|
|
62773
62876
|
argsLine = prefix + wrap("(\n", indent(join(args, "\n")), "\n)");
|
|
@@ -62775,15 +62878,15 @@ var printDocASTReducer = {
|
|
|
62775
62878
|
return join([argsLine, join(directives, " "), selectionSet], " ");
|
|
62776
62879
|
}
|
|
62777
62880
|
},
|
|
62778
|
-
Argument: { leave: ({ name
|
|
62881
|
+
Argument: { leave: ({ name, value }) => name + ": " + value },
|
|
62779
62882
|
FragmentSpread: {
|
|
62780
|
-
leave: ({ name
|
|
62883
|
+
leave: ({ name, directives }) => "..." + name + wrap(" ", join(directives, " "))
|
|
62781
62884
|
},
|
|
62782
62885
|
InlineFragment: {
|
|
62783
62886
|
leave: ({ typeCondition, directives, selectionSet }) => join(["...", wrap("on ", typeCondition), join(directives, " "), selectionSet], " ")
|
|
62784
62887
|
},
|
|
62785
62888
|
FragmentDefinition: {
|
|
62786
|
-
leave: ({ name
|
|
62889
|
+
leave: ({ name, typeCondition, variableDefinitions, directives, selectionSet }) => `fragment ${name}${wrap("(", join(variableDefinitions, ", "), ")")} on ${typeCondition} ${wrap("", join(directives, " "), " ")}` + selectionSet
|
|
62787
62890
|
},
|
|
62788
62891
|
IntValue: { leave: ({ value }) => value },
|
|
62789
62892
|
FloatValue: { leave: ({ value }) => value },
|
|
@@ -62800,11 +62903,11 @@ var printDocASTReducer = {
|
|
|
62800
62903
|
EnumValue: { leave: ({ value }) => value },
|
|
62801
62904
|
ListValue: { leave: ({ values }) => "[" + join(values, ", ") + "]" },
|
|
62802
62905
|
ObjectValue: { leave: ({ fields }) => "{" + join(fields, ", ") + "}" },
|
|
62803
|
-
ObjectField: { leave: ({ name
|
|
62906
|
+
ObjectField: { leave: ({ name, value }) => name + ": " + value },
|
|
62804
62907
|
Directive: {
|
|
62805
|
-
leave: ({ name
|
|
62908
|
+
leave: ({ name, arguments: args }) => "@" + name + wrap("(", join(args, ", "), ")")
|
|
62806
62909
|
},
|
|
62807
|
-
NamedType: { leave: ({ name
|
|
62910
|
+
NamedType: { leave: ({ name }) => name },
|
|
62808
62911
|
ListType: { leave: ({ type }) => "[" + type + "]" },
|
|
62809
62912
|
NonNullType: { leave: ({ type }) => type + "!" },
|
|
62810
62913
|
SchemaDefinition: {
|
|
@@ -62814,55 +62917,55 @@ var printDocASTReducer = {
|
|
|
62814
62917
|
leave: ({ operation, type }) => operation + ": " + type
|
|
62815
62918
|
},
|
|
62816
62919
|
ScalarTypeDefinition: {
|
|
62817
|
-
leave: ({ name
|
|
62920
|
+
leave: ({ name, directives }) => join(["scalar", name, join(directives, " ")], " ")
|
|
62818
62921
|
},
|
|
62819
62922
|
ObjectTypeDefinition: {
|
|
62820
|
-
leave: ({ name
|
|
62923
|
+
leave: ({ name, interfaces, directives, fields }) => join(["type", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
62821
62924
|
},
|
|
62822
62925
|
FieldDefinition: {
|
|
62823
|
-
leave: ({ name
|
|
62926
|
+
leave: ({ name, arguments: args, type, directives }) => name + (hasMultilineItems(args) ? wrap("(\n", indent(join(args, "\n")), "\n)") : wrap("(", join(args, ", "), ")")) + ": " + type + wrap(" ", join(directives, " "))
|
|
62824
62927
|
},
|
|
62825
62928
|
InputValueDefinition: {
|
|
62826
|
-
leave: ({ name
|
|
62929
|
+
leave: ({ name, type, defaultValue, directives }) => join([name + ": " + type, wrap("= ", defaultValue), join(directives, " ")], " ")
|
|
62827
62930
|
},
|
|
62828
62931
|
InterfaceTypeDefinition: {
|
|
62829
|
-
leave: ({ name
|
|
62932
|
+
leave: ({ name, interfaces, directives, fields }) => join(["interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
62830
62933
|
},
|
|
62831
62934
|
UnionTypeDefinition: {
|
|
62832
|
-
leave: ({ name
|
|
62935
|
+
leave: ({ name, directives, types: types17 }) => join(["union", name, join(directives, " "), wrap("= ", join(types17, " | "))], " ")
|
|
62833
62936
|
},
|
|
62834
62937
|
EnumTypeDefinition: {
|
|
62835
|
-
leave: ({ name
|
|
62938
|
+
leave: ({ name, directives, values }) => join(["enum", name, join(directives, " "), block(values)], " ")
|
|
62836
62939
|
},
|
|
62837
62940
|
EnumValueDefinition: {
|
|
62838
|
-
leave: ({ name
|
|
62941
|
+
leave: ({ name, directives }) => join([name, join(directives, " ")], " ")
|
|
62839
62942
|
},
|
|
62840
62943
|
InputObjectTypeDefinition: {
|
|
62841
|
-
leave: ({ name
|
|
62944
|
+
leave: ({ name, directives, fields }) => join(["input", name, join(directives, " "), block(fields)], " ")
|
|
62842
62945
|
},
|
|
62843
62946
|
DirectiveDefinition: {
|
|
62844
|
-
leave: ({ name
|
|
62947
|
+
leave: ({ name, arguments: args, repeatable, locations }) => "directive @" + name + (hasMultilineItems(args) ? wrap("(\n", indent(join(args, "\n")), "\n)") : wrap("(", join(args, ", "), ")")) + (repeatable ? " repeatable" : "") + " on " + join(locations, " | ")
|
|
62845
62948
|
},
|
|
62846
62949
|
SchemaExtension: {
|
|
62847
62950
|
leave: ({ directives, operationTypes }) => join(["extend schema", join(directives, " "), block(operationTypes)], " ")
|
|
62848
62951
|
},
|
|
62849
62952
|
ScalarTypeExtension: {
|
|
62850
|
-
leave: ({ name
|
|
62953
|
+
leave: ({ name, directives }) => join(["extend scalar", name, join(directives, " ")], " ")
|
|
62851
62954
|
},
|
|
62852
62955
|
ObjectTypeExtension: {
|
|
62853
|
-
leave: ({ name
|
|
62956
|
+
leave: ({ name, interfaces, directives, fields }) => join(["extend type", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
62854
62957
|
},
|
|
62855
62958
|
InterfaceTypeExtension: {
|
|
62856
|
-
leave: ({ name
|
|
62959
|
+
leave: ({ name, interfaces, directives, fields }) => join(["extend interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
62857
62960
|
},
|
|
62858
62961
|
UnionTypeExtension: {
|
|
62859
|
-
leave: ({ name
|
|
62962
|
+
leave: ({ name, directives, types: types17 }) => join(["extend union", name, join(directives, " "), wrap("= ", join(types17, " | "))], " ")
|
|
62860
62963
|
},
|
|
62861
62964
|
EnumTypeExtension: {
|
|
62862
|
-
leave: ({ name
|
|
62965
|
+
leave: ({ name, directives, values }) => join(["extend enum", name, join(directives, " "), block(values)], " ")
|
|
62863
62966
|
},
|
|
62864
62967
|
InputObjectTypeExtension: {
|
|
62865
|
-
leave: ({ name
|
|
62968
|
+
leave: ({ name, directives, fields }) => join(["extend input", name, join(directives, " "), block(fields)], " ")
|
|
62866
62969
|
}
|
|
62867
62970
|
};
|
|
62868
62971
|
var printDocASTReducerWithComments = Object.keys(printDocASTReducer).reduce((prev, key) => ({
|
|
@@ -64377,8 +64480,8 @@ var import_graphql18 = __toESM(require_graphql2(), 1);
|
|
|
64377
64480
|
function directiveAlreadyExists(directivesArr, otherDirective) {
|
|
64378
64481
|
return !!directivesArr.find((directive) => directive.name.value === otherDirective.name.value);
|
|
64379
64482
|
}
|
|
64380
|
-
function nameAlreadyExists(
|
|
64381
|
-
return namesArr.some(({ value }) => value ===
|
|
64483
|
+
function nameAlreadyExists(name, namesArr) {
|
|
64484
|
+
return namesArr.some(({ value }) => value === name.value);
|
|
64382
64485
|
}
|
|
64383
64486
|
function mergeArguments2(a1, a2) {
|
|
64384
64487
|
const result = [...a2];
|
|
@@ -64455,7 +64558,7 @@ function mergeDirective(node, existingNode) {
|
|
|
64455
64558
|
...node,
|
|
64456
64559
|
locations: [
|
|
64457
64560
|
...existingNode.locations,
|
|
64458
|
-
...node.locations.filter((
|
|
64561
|
+
...node.locations.filter((name) => !nameAlreadyExists(name, existingNode.locations))
|
|
64459
64562
|
]
|
|
64460
64563
|
};
|
|
64461
64564
|
}
|
|
@@ -64812,43 +64915,43 @@ function mergeGraphQLNodes(nodes, config4) {
|
|
|
64812
64915
|
const mergedResultMap = {};
|
|
64813
64916
|
for (const nodeDefinition of nodes) {
|
|
64814
64917
|
if (isNamedDefinitionNode(nodeDefinition)) {
|
|
64815
|
-
const
|
|
64918
|
+
const name = (_a = nodeDefinition.name) === null || _a === void 0 ? void 0 : _a.value;
|
|
64816
64919
|
if (config4 === null || config4 === void 0 ? void 0 : config4.commentDescriptions) {
|
|
64817
64920
|
collectComment(nodeDefinition);
|
|
64818
64921
|
}
|
|
64819
|
-
if (
|
|
64922
|
+
if (name == null) {
|
|
64820
64923
|
continue;
|
|
64821
64924
|
}
|
|
64822
|
-
if (((_b = config4 === null || config4 === void 0 ? void 0 : config4.exclusions) === null || _b === void 0 ? void 0 : _b.includes(
|
|
64823
|
-
delete mergedResultMap[
|
|
64925
|
+
if (((_b = config4 === null || config4 === void 0 ? void 0 : config4.exclusions) === null || _b === void 0 ? void 0 : _b.includes(name + ".*")) || ((_c = config4 === null || config4 === void 0 ? void 0 : config4.exclusions) === null || _c === void 0 ? void 0 : _c.includes(name))) {
|
|
64926
|
+
delete mergedResultMap[name];
|
|
64824
64927
|
} else {
|
|
64825
64928
|
switch (nodeDefinition.kind) {
|
|
64826
64929
|
case import_graphql27.Kind.OBJECT_TYPE_DEFINITION:
|
|
64827
64930
|
case import_graphql27.Kind.OBJECT_TYPE_EXTENSION:
|
|
64828
|
-
mergedResultMap[
|
|
64931
|
+
mergedResultMap[name] = mergeType(nodeDefinition, mergedResultMap[name], config4);
|
|
64829
64932
|
break;
|
|
64830
64933
|
case import_graphql27.Kind.ENUM_TYPE_DEFINITION:
|
|
64831
64934
|
case import_graphql27.Kind.ENUM_TYPE_EXTENSION:
|
|
64832
|
-
mergedResultMap[
|
|
64935
|
+
mergedResultMap[name] = mergeEnum(nodeDefinition, mergedResultMap[name], config4);
|
|
64833
64936
|
break;
|
|
64834
64937
|
case import_graphql27.Kind.UNION_TYPE_DEFINITION:
|
|
64835
64938
|
case import_graphql27.Kind.UNION_TYPE_EXTENSION:
|
|
64836
|
-
mergedResultMap[
|
|
64939
|
+
mergedResultMap[name] = mergeUnion(nodeDefinition, mergedResultMap[name], config4);
|
|
64837
64940
|
break;
|
|
64838
64941
|
case import_graphql27.Kind.SCALAR_TYPE_DEFINITION:
|
|
64839
64942
|
case import_graphql27.Kind.SCALAR_TYPE_EXTENSION:
|
|
64840
|
-
mergedResultMap[
|
|
64943
|
+
mergedResultMap[name] = mergeScalar(nodeDefinition, mergedResultMap[name], config4);
|
|
64841
64944
|
break;
|
|
64842
64945
|
case import_graphql27.Kind.INPUT_OBJECT_TYPE_DEFINITION:
|
|
64843
64946
|
case import_graphql27.Kind.INPUT_OBJECT_TYPE_EXTENSION:
|
|
64844
|
-
mergedResultMap[
|
|
64947
|
+
mergedResultMap[name] = mergeInputType(nodeDefinition, mergedResultMap[name], config4);
|
|
64845
64948
|
break;
|
|
64846
64949
|
case import_graphql27.Kind.INTERFACE_TYPE_DEFINITION:
|
|
64847
64950
|
case import_graphql27.Kind.INTERFACE_TYPE_EXTENSION:
|
|
64848
|
-
mergedResultMap[
|
|
64951
|
+
mergedResultMap[name] = mergeInterface(nodeDefinition, mergedResultMap[name], config4);
|
|
64849
64952
|
break;
|
|
64850
64953
|
case import_graphql27.Kind.DIRECTIVE_DEFINITION:
|
|
64851
|
-
mergedResultMap[
|
|
64954
|
+
mergedResultMap[name] = mergeDirective(nodeDefinition, mergedResultMap[name]);
|
|
64852
64955
|
break;
|
|
64853
64956
|
}
|
|
64854
64957
|
}
|
|
@@ -65127,6 +65230,9 @@ var houdini_mode = {
|
|
|
65127
65230
|
}
|
|
65128
65231
|
};
|
|
65129
65232
|
|
|
65233
|
+
// src/lib/deepMerge.ts
|
|
65234
|
+
var import_deepmerge = __toESM(require_cjs(), 1);
|
|
65235
|
+
|
|
65130
65236
|
// src/lib/error.ts
|
|
65131
65237
|
var HoudiniError = class extends Error {
|
|
65132
65238
|
filepath = null;
|
|
@@ -65146,6 +65252,20 @@ var HoudiniError = class extends Error {
|
|
|
65146
65252
|
}
|
|
65147
65253
|
};
|
|
65148
65254
|
|
|
65255
|
+
// src/lib/deepMerge.ts
|
|
65256
|
+
function deepMerge(filepath, ...targets) {
|
|
65257
|
+
try {
|
|
65258
|
+
if (targets.length === 1) {
|
|
65259
|
+
return targets[0];
|
|
65260
|
+
} else if (targets.length === 2) {
|
|
65261
|
+
return (0, import_deepmerge.default)(targets[0], targets[1]);
|
|
65262
|
+
}
|
|
65263
|
+
return deepMerge(filepath, targets[0], deepMerge(filepath, ...targets.slice(1)));
|
|
65264
|
+
} catch (e2) {
|
|
65265
|
+
throw new HoudiniError({ filepath, message: "could not merge: " + targets });
|
|
65266
|
+
}
|
|
65267
|
+
}
|
|
65268
|
+
|
|
65149
65269
|
// src/lib/fs.ts
|
|
65150
65270
|
var fs_exports = {};
|
|
65151
65271
|
__export(fs_exports, {
|
|
@@ -65588,8 +65708,8 @@ var Body = class {
|
|
|
65588
65708
|
if (ct.startsWith("application/x-www-form-urlencoded")) {
|
|
65589
65709
|
const formData = new FormData();
|
|
65590
65710
|
const parameters = new URLSearchParams(await this.text());
|
|
65591
|
-
for (const [
|
|
65592
|
-
formData.append(
|
|
65711
|
+
for (const [name, value] of parameters) {
|
|
65712
|
+
formData.append(name, value);
|
|
65593
65713
|
}
|
|
65594
65714
|
return formData;
|
|
65595
65715
|
}
|
|
@@ -65750,16 +65870,16 @@ var writeToStream = async (dest, { body }) => {
|
|
|
65750
65870
|
// ../../node_modules/.pnpm/node-fetch@3.3.0/node_modules/node-fetch/src/headers.js
|
|
65751
65871
|
var import_node_util2 = require("node:util");
|
|
65752
65872
|
var import_node_http = __toESM(require("node:http"), 1);
|
|
65753
|
-
var validateHeaderName = typeof import_node_http.default.validateHeaderName === "function" ? import_node_http.default.validateHeaderName : (
|
|
65754
|
-
if (!/^[\^`\-\w!#$%&'*+.|~]+$/.test(
|
|
65755
|
-
const error = new TypeError(`Header name must be a valid HTTP token [${
|
|
65873
|
+
var validateHeaderName = typeof import_node_http.default.validateHeaderName === "function" ? import_node_http.default.validateHeaderName : (name) => {
|
|
65874
|
+
if (!/^[\^`\-\w!#$%&'*+.|~]+$/.test(name)) {
|
|
65875
|
+
const error = new TypeError(`Header name must be a valid HTTP token [${name}]`);
|
|
65756
65876
|
Object.defineProperty(error, "code", { value: "ERR_INVALID_HTTP_TOKEN" });
|
|
65757
65877
|
throw error;
|
|
65758
65878
|
}
|
|
65759
65879
|
};
|
|
65760
|
-
var validateHeaderValue = typeof import_node_http.default.validateHeaderValue === "function" ? import_node_http.default.validateHeaderValue : (
|
|
65880
|
+
var validateHeaderValue = typeof import_node_http.default.validateHeaderValue === "function" ? import_node_http.default.validateHeaderValue : (name, value) => {
|
|
65761
65881
|
if (/[^\t\u0020-\u007E\u0080-\u00FF]/.test(value)) {
|
|
65762
|
-
const error = new TypeError(`Invalid character in header content ["${
|
|
65882
|
+
const error = new TypeError(`Invalid character in header content ["${name}"]`);
|
|
65763
65883
|
Object.defineProperty(error, "code", { value: "ERR_INVALID_CHAR" });
|
|
65764
65884
|
throw error;
|
|
65765
65885
|
}
|
|
@@ -65769,8 +65889,8 @@ var Headers = class extends URLSearchParams {
|
|
|
65769
65889
|
let result = [];
|
|
65770
65890
|
if (init instanceof Headers) {
|
|
65771
65891
|
const raw = init.raw();
|
|
65772
|
-
for (const [
|
|
65773
|
-
result.push(...values.map((value) => [
|
|
65892
|
+
for (const [name, values] of Object.entries(raw)) {
|
|
65893
|
+
result.push(...values.map((value) => [name, value]));
|
|
65774
65894
|
}
|
|
65775
65895
|
} else if (init == null) {
|
|
65776
65896
|
} else if (typeof init === "object" && !import_node_util2.types.isBoxedPrimitive(init)) {
|
|
@@ -65796,10 +65916,10 @@ var Headers = class extends URLSearchParams {
|
|
|
65796
65916
|
} else {
|
|
65797
65917
|
throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");
|
|
65798
65918
|
}
|
|
65799
|
-
result = result.length > 0 ? result.map(([
|
|
65800
|
-
validateHeaderName(
|
|
65801
|
-
validateHeaderValue(
|
|
65802
|
-
return [String(
|
|
65919
|
+
result = result.length > 0 ? result.map(([name, value]) => {
|
|
65920
|
+
validateHeaderName(name);
|
|
65921
|
+
validateHeaderValue(name, String(value));
|
|
65922
|
+
return [String(name).toLowerCase(), String(value)];
|
|
65803
65923
|
}) : void 0;
|
|
65804
65924
|
super(result);
|
|
65805
65925
|
return new Proxy(this, {
|
|
@@ -65807,23 +65927,23 @@ var Headers = class extends URLSearchParams {
|
|
|
65807
65927
|
switch (p) {
|
|
65808
65928
|
case "append":
|
|
65809
65929
|
case "set":
|
|
65810
|
-
return (
|
|
65811
|
-
validateHeaderName(
|
|
65812
|
-
validateHeaderValue(
|
|
65930
|
+
return (name, value) => {
|
|
65931
|
+
validateHeaderName(name);
|
|
65932
|
+
validateHeaderValue(name, String(value));
|
|
65813
65933
|
return URLSearchParams.prototype[p].call(
|
|
65814
65934
|
target,
|
|
65815
|
-
String(
|
|
65935
|
+
String(name).toLowerCase(),
|
|
65816
65936
|
String(value)
|
|
65817
65937
|
);
|
|
65818
65938
|
};
|
|
65819
65939
|
case "delete":
|
|
65820
65940
|
case "has":
|
|
65821
65941
|
case "getAll":
|
|
65822
|
-
return (
|
|
65823
|
-
validateHeaderName(
|
|
65942
|
+
return (name) => {
|
|
65943
|
+
validateHeaderName(name);
|
|
65824
65944
|
return URLSearchParams.prototype[p].call(
|
|
65825
65945
|
target,
|
|
65826
|
-
String(
|
|
65946
|
+
String(name).toLowerCase()
|
|
65827
65947
|
);
|
|
65828
65948
|
};
|
|
65829
65949
|
case "keys":
|
|
@@ -65843,30 +65963,30 @@ var Headers = class extends URLSearchParams {
|
|
|
65843
65963
|
toString() {
|
|
65844
65964
|
return Object.prototype.toString.call(this);
|
|
65845
65965
|
}
|
|
65846
|
-
get(
|
|
65847
|
-
const values = this.getAll(
|
|
65966
|
+
get(name) {
|
|
65967
|
+
const values = this.getAll(name);
|
|
65848
65968
|
if (values.length === 0) {
|
|
65849
65969
|
return null;
|
|
65850
65970
|
}
|
|
65851
65971
|
let value = values.join(", ");
|
|
65852
|
-
if (/^content-encoding$/i.test(
|
|
65972
|
+
if (/^content-encoding$/i.test(name)) {
|
|
65853
65973
|
value = value.toLowerCase();
|
|
65854
65974
|
}
|
|
65855
65975
|
return value;
|
|
65856
65976
|
}
|
|
65857
65977
|
forEach(callback, thisArg = void 0) {
|
|
65858
|
-
for (const
|
|
65859
|
-
Reflect.apply(callback, thisArg, [this.get(
|
|
65978
|
+
for (const name of this.keys()) {
|
|
65979
|
+
Reflect.apply(callback, thisArg, [this.get(name), name, this]);
|
|
65860
65980
|
}
|
|
65861
65981
|
}
|
|
65862
65982
|
*values() {
|
|
65863
|
-
for (const
|
|
65864
|
-
yield this.get(
|
|
65983
|
+
for (const name of this.keys()) {
|
|
65984
|
+
yield this.get(name);
|
|
65865
65985
|
}
|
|
65866
65986
|
}
|
|
65867
65987
|
*entries() {
|
|
65868
|
-
for (const
|
|
65869
|
-
yield [
|
|
65988
|
+
for (const name of this.keys()) {
|
|
65989
|
+
yield [name, this.get(name)];
|
|
65870
65990
|
}
|
|
65871
65991
|
}
|
|
65872
65992
|
[Symbol.iterator]() {
|
|
@@ -65904,10 +66024,10 @@ function fromRawHeaders(headers = []) {
|
|
|
65904
66024
|
result.push(array.slice(index, index + 2));
|
|
65905
66025
|
}
|
|
65906
66026
|
return result;
|
|
65907
|
-
}, []).filter(([
|
|
66027
|
+
}, []).filter(([name, value]) => {
|
|
65908
66028
|
try {
|
|
65909
|
-
validateHeaderName(
|
|
65910
|
-
validateHeaderValue(
|
|
66029
|
+
validateHeaderName(name);
|
|
66030
|
+
validateHeaderValue(name, String(value));
|
|
65911
66031
|
return true;
|
|
65912
66032
|
} catch {
|
|
65913
66033
|
return false;
|
|
@@ -66489,8 +66609,8 @@ async function fetch(url, options_) {
|
|
|
66489
66609
|
referrerPolicy: request.referrerPolicy
|
|
66490
66610
|
};
|
|
66491
66611
|
if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) {
|
|
66492
|
-
for (const
|
|
66493
|
-
requestOptions.headers.delete(
|
|
66612
|
+
for (const name of ["authorization", "www-authenticate", "cookie", "cookie2"]) {
|
|
66613
|
+
requestOptions.headers.delete(name);
|
|
66494
66614
|
}
|
|
66495
66615
|
}
|
|
66496
66616
|
if (response_.statusCode !== 303 && request.body && options_.body instanceof import_node_stream2.default.Readable) {
|
|
@@ -66663,6 +66783,31 @@ async function pullSchema(url, schemaPath, headers) {
|
|
|
66663
66783
|
return false;
|
|
66664
66784
|
}
|
|
66665
66785
|
|
|
66786
|
+
// src/lib/plugin.ts
|
|
66787
|
+
function plugin(name, hooks) {
|
|
66788
|
+
const data = {
|
|
66789
|
+
name,
|
|
66790
|
+
plugin: hooks,
|
|
66791
|
+
__plugin_init__: true,
|
|
66792
|
+
with(config4) {
|
|
66793
|
+
return {
|
|
66794
|
+
...data,
|
|
66795
|
+
config: config4
|
|
66796
|
+
};
|
|
66797
|
+
}
|
|
66798
|
+
};
|
|
66799
|
+
return data;
|
|
66800
|
+
}
|
|
66801
|
+
|
|
66802
|
+
// src/lib/types.ts
|
|
66803
|
+
var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
66804
|
+
LogLevel2["Full"] = "full";
|
|
66805
|
+
LogLevel2["Summary"] = "summary";
|
|
66806
|
+
LogLevel2["ShortSummary"] = "short-summary";
|
|
66807
|
+
LogLevel2["Quiet"] = "quiet";
|
|
66808
|
+
return LogLevel2;
|
|
66809
|
+
})(LogLevel || {});
|
|
66810
|
+
|
|
66666
66811
|
// src/lib/config.ts
|
|
66667
66812
|
var import_meta = {};
|
|
66668
66813
|
var currentDir = global.__dirname || dirname((0, import_url.fileURLToPath)(import_meta.url));
|
|
@@ -66682,7 +66827,6 @@ var Config = class {
|
|
|
66682
66827
|
internalListPosition;
|
|
66683
66828
|
defaultListTarget = null;
|
|
66684
66829
|
definitionsFolder;
|
|
66685
|
-
newSchema = "";
|
|
66686
66830
|
newDocuments = "";
|
|
66687
66831
|
defaultKeys = ["id"];
|
|
66688
66832
|
typeConfig;
|
|
@@ -66736,7 +66880,7 @@ var Config = class {
|
|
|
66736
66880
|
Object.values(LogLevel)
|
|
66737
66881
|
)}`
|
|
66738
66882
|
);
|
|
66739
|
-
logLevel =
|
|
66883
|
+
logLevel = "summary" /* Summary */;
|
|
66740
66884
|
}
|
|
66741
66885
|
this.schemaPath = schemaPath;
|
|
66742
66886
|
this.filepath = filepath;
|
|
@@ -66752,7 +66896,7 @@ var Config = class {
|
|
|
66752
66896
|
this.internalListPosition = defaultListPosition === "append" ? "last" : "first";
|
|
66753
66897
|
this.defaultListTarget = defaultListTarget;
|
|
66754
66898
|
this.definitionsFolder = definitionsPath;
|
|
66755
|
-
this.logLevel = (logLevel ||
|
|
66899
|
+
this.logLevel = (logLevel || "summary" /* Summary */).toLowerCase();
|
|
66756
66900
|
this.defaultFragmentMasking = defaultFragmentMasking;
|
|
66757
66901
|
this.routesDir = join2(this.projectRoot, "src", "routes");
|
|
66758
66902
|
this.schemaPollInterval = watchSchema?.interval ?? 2e3;
|
|
@@ -66781,19 +66925,19 @@ var Config = class {
|
|
|
66781
66925
|
return Array.isArray(this.configFile.include) ? this.configFile.include : [this.configFile.include];
|
|
66782
66926
|
}
|
|
66783
66927
|
const extensions = [".graphql", ".gql", ".ts", ".js"].concat(
|
|
66784
|
-
this.plugins.flatMap((
|
|
66928
|
+
this.plugins.flatMap((plugin2) => plugin2.extensions ?? [])
|
|
66785
66929
|
);
|
|
66786
66930
|
return [`src/**/*{${extensions.join(",")}}`];
|
|
66787
66931
|
}
|
|
66788
|
-
pluginConfig(
|
|
66789
|
-
return this.configFile.plugins?.[
|
|
66932
|
+
pluginConfig(name) {
|
|
66933
|
+
return this.configFile.plugins?.[name] ?? {};
|
|
66790
66934
|
}
|
|
66791
66935
|
async getEnv() {
|
|
66792
66936
|
let env = process.env;
|
|
66793
|
-
for (const
|
|
66794
|
-
if (
|
|
66937
|
+
for (const plugin2 of this.plugins) {
|
|
66938
|
+
if (plugin2.env) {
|
|
66795
66939
|
env = {
|
|
66796
|
-
...await
|
|
66940
|
+
...await plugin2.env({ config: this, env })
|
|
66797
66941
|
};
|
|
66798
66942
|
}
|
|
66799
66943
|
}
|
|
@@ -66843,6 +66987,19 @@ var Config = class {
|
|
|
66843
66987
|
)
|
|
66844
66988
|
];
|
|
66845
66989
|
}
|
|
66990
|
+
#newSchemaInstance = null;
|
|
66991
|
+
#schemaString = "";
|
|
66992
|
+
set newSchema(value) {
|
|
66993
|
+
this.#schemaString = value;
|
|
66994
|
+
if (value) {
|
|
66995
|
+
this.#newSchemaInstance = graphql2.buildSchema(value);
|
|
66996
|
+
} else {
|
|
66997
|
+
this.#newSchemaInstance = null;
|
|
66998
|
+
}
|
|
66999
|
+
}
|
|
67000
|
+
get newSchema() {
|
|
67001
|
+
return this.#schemaString;
|
|
67002
|
+
}
|
|
66846
67003
|
get artifactDirectory() {
|
|
66847
67004
|
return join2(this.rootDir, this.artifactDirectoryName);
|
|
66848
67005
|
}
|
|
@@ -66879,23 +67036,8 @@ var Config = class {
|
|
|
66879
67036
|
get typeRootFile() {
|
|
66880
67037
|
return "$houdini.d.ts";
|
|
66881
67038
|
}
|
|
66882
|
-
findModule(pkg = "houdini", currentLocation = join2(dirname(this.filepath))) {
|
|
66883
|
-
const pathEndingBy = ["node_modules", pkg];
|
|
66884
|
-
let locationFound = join2(currentLocation, ...pathEndingBy);
|
|
66885
|
-
let previousLocation = "";
|
|
66886
|
-
const backFolder = [];
|
|
66887
|
-
while (previousLocation !== locationFound && !existsSync(locationFound)) {
|
|
66888
|
-
previousLocation = locationFound;
|
|
66889
|
-
backFolder.push("../");
|
|
66890
|
-
locationFound = join2(currentLocation, ...backFolder, ...pathEndingBy);
|
|
66891
|
-
}
|
|
66892
|
-
if (previousLocation === locationFound) {
|
|
66893
|
-
throw new Error("Could not find any node_modules/houdini folder");
|
|
66894
|
-
}
|
|
66895
|
-
return locationFound;
|
|
66896
|
-
}
|
|
66897
67039
|
get runtimeSource() {
|
|
66898
|
-
const relative2 = houdini_mode.is_testing ? join2(currentDir, "..", "..") : this.
|
|
67040
|
+
const relative2 = houdini_mode.is_testing ? join2(currentDir, "..", "..") : findModule("houdini", join2(dirname(this.filepath)));
|
|
66899
67041
|
const which = this.module === "esm" ? "esm" : "cjs";
|
|
66900
67042
|
return resolve(relative2, "build", `runtime-${which}`);
|
|
66901
67043
|
}
|
|
@@ -66905,8 +67047,8 @@ var Config = class {
|
|
|
66905
67047
|
artifactPath(document) {
|
|
66906
67048
|
return join2(this.artifactDirectory, this.documentName(document) + ".js");
|
|
66907
67049
|
}
|
|
66908
|
-
artifactImportPath(
|
|
66909
|
-
return `$houdini/${this.artifactDirectoryName}/${
|
|
67050
|
+
artifactImportPath(name) {
|
|
67051
|
+
return `$houdini/${this.artifactDirectoryName}/${name}`;
|
|
66910
67052
|
}
|
|
66911
67053
|
keyFieldsForType(type) {
|
|
66912
67054
|
return keyFieldsForType(this.configFile, type);
|
|
@@ -66950,16 +67092,27 @@ var Config = class {
|
|
|
66950
67092
|
relative(process.cwd(), filepath).replaceAll(sep, "_").replace(".ts", ".js")
|
|
66951
67093
|
);
|
|
66952
67094
|
}
|
|
67095
|
+
excludeFile(filepath) {
|
|
67096
|
+
if (this.exclude.length > 0 && this.exclude.some((pattern) => (0, import_minimatch.default)(filepath, pattern))) {
|
|
67097
|
+
return true;
|
|
67098
|
+
}
|
|
67099
|
+
for (const plugin2 of this.plugins) {
|
|
67100
|
+
if (plugin2?.exclude?.({ config: this, filepath })) {
|
|
67101
|
+
return true;
|
|
67102
|
+
}
|
|
67103
|
+
}
|
|
67104
|
+
return false;
|
|
67105
|
+
}
|
|
66953
67106
|
includeFile(filepath, {
|
|
66954
67107
|
root = this.projectRoot,
|
|
66955
67108
|
ignore_plugins = false
|
|
66956
67109
|
} = {}) {
|
|
66957
67110
|
let included = false;
|
|
66958
|
-
for (const
|
|
66959
|
-
if (!
|
|
67111
|
+
for (const plugin2 of ignore_plugins ? [] : this.plugins) {
|
|
67112
|
+
if (!plugin2.include) {
|
|
66960
67113
|
continue;
|
|
66961
67114
|
}
|
|
66962
|
-
if (
|
|
67115
|
+
if (plugin2.include({ config: this, filepath })) {
|
|
66963
67116
|
included = true;
|
|
66964
67117
|
break;
|
|
66965
67118
|
}
|
|
@@ -66967,16 +67120,16 @@ var Config = class {
|
|
|
66967
67120
|
if (!included && !this.include.some((pattern) => (0, import_minimatch.default)(filepath, join2(root, pattern)))) {
|
|
66968
67121
|
return false;
|
|
66969
67122
|
}
|
|
66970
|
-
return !this.
|
|
67123
|
+
return !this.excludeFile(filepath);
|
|
66971
67124
|
}
|
|
66972
|
-
pluginRuntimeDirectory(
|
|
66973
|
-
return join2(this.pluginDirectory(
|
|
67125
|
+
pluginRuntimeDirectory(name) {
|
|
67126
|
+
return join2(this.pluginDirectory(name), "runtime");
|
|
66974
67127
|
}
|
|
66975
67128
|
get pluginRootDirectory() {
|
|
66976
67129
|
return houdini_mode.is_testing ? "../../../" : join2(this.rootDir, "plugins");
|
|
66977
67130
|
}
|
|
66978
|
-
pluginDirectory(
|
|
66979
|
-
return join2(this.pluginRootDirectory,
|
|
67131
|
+
pluginDirectory(name) {
|
|
67132
|
+
return join2(this.pluginRootDirectory, name);
|
|
66980
67133
|
}
|
|
66981
67134
|
get loadDirective() {
|
|
66982
67135
|
return "load";
|
|
@@ -67053,59 +67206,45 @@ var Config = class {
|
|
|
67053
67206
|
paginationQueryName(documentName) {
|
|
67054
67207
|
return documentName + "_Pagination_Query";
|
|
67055
67208
|
}
|
|
67056
|
-
isDeleteDirective(
|
|
67057
|
-
return
|
|
67209
|
+
isDeleteDirective(name) {
|
|
67210
|
+
return name.endsWith(this.deleteDirectiveSuffix);
|
|
67058
67211
|
}
|
|
67059
|
-
listDeleteDirective(
|
|
67060
|
-
return
|
|
67212
|
+
listDeleteDirective(name) {
|
|
67213
|
+
return name + this.deleteDirectiveSuffix;
|
|
67061
67214
|
}
|
|
67062
|
-
deleteDirectiveType(
|
|
67063
|
-
return
|
|
67215
|
+
deleteDirectiveType(name) {
|
|
67216
|
+
return name.slice(0, name.length - this.deleteDirectiveSuffix.length);
|
|
67064
67217
|
}
|
|
67065
|
-
isInsertFragment(
|
|
67066
|
-
return
|
|
67218
|
+
isInsertFragment(name) {
|
|
67219
|
+
return name.endsWith(this.insertFragmentSuffix);
|
|
67067
67220
|
}
|
|
67068
|
-
listInsertFragment(
|
|
67069
|
-
return
|
|
67221
|
+
listInsertFragment(name) {
|
|
67222
|
+
return name + this.insertFragmentSuffix;
|
|
67070
67223
|
}
|
|
67071
|
-
listToggleFragment(
|
|
67072
|
-
return
|
|
67224
|
+
listToggleFragment(name) {
|
|
67225
|
+
return name + this.toggleFragmentSuffix;
|
|
67073
67226
|
}
|
|
67074
|
-
isRemoveFragment(
|
|
67075
|
-
return
|
|
67227
|
+
isRemoveFragment(name) {
|
|
67228
|
+
return name.endsWith(this.removeFragmentSuffix);
|
|
67076
67229
|
}
|
|
67077
|
-
isToggleFragment(
|
|
67078
|
-
return
|
|
67230
|
+
isToggleFragment(name) {
|
|
67231
|
+
return name.endsWith(this.toggleFragmentSuffix);
|
|
67079
67232
|
}
|
|
67080
|
-
listRemoveFragment(
|
|
67081
|
-
return
|
|
67233
|
+
listRemoveFragment(name) {
|
|
67234
|
+
return name + this.removeFragmentSuffix;
|
|
67082
67235
|
}
|
|
67083
67236
|
isInternalEnum(node) {
|
|
67084
67237
|
return node.name.value === "CachePolicy";
|
|
67085
67238
|
}
|
|
67086
|
-
isInternalDirective(
|
|
67087
|
-
|
|
67088
|
-
|
|
67089
|
-
|
|
67090
|
-
|
|
67091
|
-
|
|
67092
|
-
|
|
67093
|
-
|
|
67094
|
-
|
|
67095
|
-
this.argumentsDirective,
|
|
67096
|
-
this.withDirective,
|
|
67097
|
-
this.paginateDirective,
|
|
67098
|
-
this.cacheDirective,
|
|
67099
|
-
this.loadDirective,
|
|
67100
|
-
this.maskEnableDirective,
|
|
67101
|
-
this.maskDisableDirective
|
|
67102
|
-
].includes(name2.value) || this.isDeleteDirective(name2.value);
|
|
67103
|
-
}
|
|
67104
|
-
isListFragment(name2) {
|
|
67105
|
-
return name2.endsWith(this.insertFragmentSuffix) || name2.endsWith(this.removeFragmentSuffix) || name2.endsWith(this.toggleFragmentSuffix);
|
|
67106
|
-
}
|
|
67107
|
-
isListOperationDirective(name2) {
|
|
67108
|
-
return name2.endsWith(this.deleteDirectiveSuffix);
|
|
67239
|
+
isInternalDirective(name) {
|
|
67240
|
+
const internalDirectives = this.#newSchemaInstance?.getDirectives().map((directive) => directive.name) ?? [];
|
|
67241
|
+
return internalDirectives.includes(name) || this.isDeleteDirective(name);
|
|
67242
|
+
}
|
|
67243
|
+
isListFragment(name) {
|
|
67244
|
+
return name.endsWith(this.insertFragmentSuffix) || name.endsWith(this.removeFragmentSuffix) || name.endsWith(this.toggleFragmentSuffix);
|
|
67245
|
+
}
|
|
67246
|
+
isListOperationDirective(name) {
|
|
67247
|
+
return name.endsWith(this.deleteDirectiveSuffix);
|
|
67109
67248
|
}
|
|
67110
67249
|
isFragmentForList(listName, fragmentName) {
|
|
67111
67250
|
return fragmentName.startsWith(listName);
|
|
@@ -67152,58 +67291,12 @@ var Config = class {
|
|
|
67152
67291
|
}
|
|
67153
67292
|
return definition;
|
|
67154
67293
|
}
|
|
67155
|
-
variableFunctionName(
|
|
67156
|
-
return
|
|
67294
|
+
variableFunctionName(name) {
|
|
67295
|
+
return name + "Variables";
|
|
67157
67296
|
}
|
|
67158
67297
|
};
|
|
67159
67298
|
var DEFAULT_CONFIG_PATH = join2(process.cwd(), "houdini.config.js");
|
|
67160
|
-
async function readConfigFile(configPath = DEFAULT_CONFIG_PATH) {
|
|
67161
|
-
let importPath2 = importPath(configPath);
|
|
67162
|
-
let imported;
|
|
67163
|
-
try {
|
|
67164
|
-
imported = await import(importPath2);
|
|
67165
|
-
} catch (e2) {
|
|
67166
|
-
throw new Error(`Could not load config file at file://${configPath}.
|
|
67167
|
-
${e2.message}`);
|
|
67168
|
-
}
|
|
67169
|
-
const config4 = imported.default || imported;
|
|
67170
|
-
return config4;
|
|
67171
|
-
}
|
|
67172
67299
|
var _config;
|
|
67173
|
-
async function loadSchemaFile(schemaPath) {
|
|
67174
|
-
if (isAbsolute(schemaPath)) {
|
|
67175
|
-
const relPath = relative(process.cwd(), schemaPath);
|
|
67176
|
-
const error = new Error(
|
|
67177
|
-
`Invalid config value: 'schemaPath' must now be passed as a relative directory. Please change its value to "./${relPath}".`
|
|
67178
|
-
);
|
|
67179
|
-
error.stack = "";
|
|
67180
|
-
throw error;
|
|
67181
|
-
}
|
|
67182
|
-
if (glob.hasMagic(schemaPath)) {
|
|
67183
|
-
const sourceFiles = await glob(schemaPath);
|
|
67184
|
-
return mergeSchemas({
|
|
67185
|
-
typeDefs: await Promise.all(
|
|
67186
|
-
sourceFiles.map(async (filepath) => await readFile(filepath))
|
|
67187
|
-
)
|
|
67188
|
-
});
|
|
67189
|
-
}
|
|
67190
|
-
try {
|
|
67191
|
-
await stat(schemaPath);
|
|
67192
|
-
} catch {
|
|
67193
|
-
throw new HoudiniError({
|
|
67194
|
-
message: `Schema file does not exist! Create it using houdini pull-schema`
|
|
67195
|
-
});
|
|
67196
|
-
}
|
|
67197
|
-
const contents = await readFile(schemaPath);
|
|
67198
|
-
if (schemaPath.endsWith("gql") || schemaPath.endsWith("graphql")) {
|
|
67199
|
-
return graphql2.buildSchema(contents);
|
|
67200
|
-
}
|
|
67201
|
-
const jsonContents = JSON.parse(contents);
|
|
67202
|
-
if (jsonContents.data) {
|
|
67203
|
-
return graphql2.buildClientSchema(jsonContents.data);
|
|
67204
|
-
}
|
|
67205
|
-
return graphql2.buildClientSchema(jsonContents);
|
|
67206
|
-
}
|
|
67207
67300
|
var pendingConfigPromise = null;
|
|
67208
67301
|
async function getConfig({
|
|
67209
67302
|
configPath = DEFAULT_CONFIG_PATH,
|
|
@@ -67224,15 +67317,34 @@ async function getConfig({
|
|
|
67224
67317
|
resolve2 = res;
|
|
67225
67318
|
reject = rej;
|
|
67226
67319
|
});
|
|
67227
|
-
let configFile = {
|
|
67228
|
-
...await readConfigFile(configPath)
|
|
67229
|
-
};
|
|
67230
|
-
if (!configFile.plugins) {
|
|
67231
|
-
throw new HoudiniError({
|
|
67232
|
-
message: "Welcome to 0.17.0! Please following the migration guide here: http://www.houdinigraphql.com/guides/release-notes#0170"
|
|
67233
|
-
});
|
|
67234
|
-
}
|
|
67235
67320
|
try {
|
|
67321
|
+
let configFile = await readConfigFile(configPath);
|
|
67322
|
+
const pluginsNested = [];
|
|
67323
|
+
for (const [pluginName, plugin_config] of Object.entries(configFile.plugins ?? {})) {
|
|
67324
|
+
let pluginFile = join2(dirname(configPath), pluginName);
|
|
67325
|
+
if (!pluginName.startsWith(".")) {
|
|
67326
|
+
pluginFile = await pluginPath(pluginName, configPath);
|
|
67327
|
+
}
|
|
67328
|
+
const { default: pluginInit } = await import((0, import_url.pathToFileURL)(pluginFile).toString());
|
|
67329
|
+
if (!pluginInit.plugin || !pluginInit.name) {
|
|
67330
|
+
throw new HoudiniError({
|
|
67331
|
+
filepath: pluginFile,
|
|
67332
|
+
message: `The default export does not match the expected shape.`,
|
|
67333
|
+
description: "Please make sure that the file exports the default of the plugin function."
|
|
67334
|
+
});
|
|
67335
|
+
}
|
|
67336
|
+
const hooks = await pluginInit.plugin(plugin_config);
|
|
67337
|
+
const hooksList = (Array.isArray(hooks) ? hooks : [hooks]).filter(Boolean).flat();
|
|
67338
|
+
pluginsNested.push(
|
|
67339
|
+
await flattenPluginList(configPath, hooksList, pluginName, pluginFile)
|
|
67340
|
+
);
|
|
67341
|
+
}
|
|
67342
|
+
const plugins = pluginsNested.flat();
|
|
67343
|
+
for (const plugin2 of plugins) {
|
|
67344
|
+
if (plugin2.config) {
|
|
67345
|
+
configFile = deepMerge(configPath, configFile, await plugin2.config(configFile));
|
|
67346
|
+
}
|
|
67347
|
+
}
|
|
67236
67348
|
_config = new Config({
|
|
67237
67349
|
...configFile,
|
|
67238
67350
|
...extraConfig,
|
|
@@ -67245,7 +67357,7 @@ async function getConfig({
|
|
|
67245
67357
|
if (glob.hasMagic(_config.schemaPath)) {
|
|
67246
67358
|
console.log(
|
|
67247
67359
|
`\u26A0\uFE0F Your houdini configuration contains an apiUrl and a path pointing to multiple files.
|
|
67248
|
-
This will prevent your schema from being pulled.`
|
|
67360
|
+
This will prevent your schema from being pulled.`
|
|
67249
67361
|
);
|
|
67250
67362
|
} else if (!await readFile(_config.schemaPath)) {
|
|
67251
67363
|
console.log("\u231B Pulling schema from api");
|
|
@@ -67256,67 +67368,138 @@ This will prevent your schema from being pulled.`
|
|
|
67256
67368
|
_config.schema = await loadSchemaFile(_config.schemaPath);
|
|
67257
67369
|
}
|
|
67258
67370
|
}
|
|
67371
|
+
_config.plugins = orderedPlugins(plugins);
|
|
67372
|
+
await Promise.all(_config.plugins.map((plugin2) => plugin2.after_load?.({ config: _config })));
|
|
67373
|
+
resolve2(_config);
|
|
67374
|
+
return _config;
|
|
67259
67375
|
} catch (e2) {
|
|
67260
67376
|
reject(e2);
|
|
67261
67377
|
throw e2;
|
|
67262
67378
|
}
|
|
67263
|
-
|
|
67264
|
-
|
|
67265
|
-
|
|
67266
|
-
|
|
67267
|
-
|
|
67268
|
-
|
|
67269
|
-
|
|
67270
|
-
|
|
67271
|
-
|
|
67272
|
-
|
|
67273
|
-
|
|
67274
|
-
|
|
67275
|
-
|
|
67276
|
-
|
|
67277
|
-
|
|
67278
|
-
|
|
67279
|
-
|
|
67280
|
-
|
|
67281
|
-
|
|
67282
|
-
|
|
67379
|
+
}
|
|
67380
|
+
async function flattenPluginList(root, list, name, pluginFile) {
|
|
67381
|
+
const pluginsLeft = [
|
|
67382
|
+
{
|
|
67383
|
+
...plugin(name, async () => list),
|
|
67384
|
+
local: pluginFile
|
|
67385
|
+
}
|
|
67386
|
+
];
|
|
67387
|
+
const result = [];
|
|
67388
|
+
while (pluginsLeft.length > 0) {
|
|
67389
|
+
const head = pluginsLeft.shift();
|
|
67390
|
+
if (!head) {
|
|
67391
|
+
break;
|
|
67392
|
+
}
|
|
67393
|
+
const nestedFile = head.local ?? await pluginPath(head.name, root);
|
|
67394
|
+
const nestedPlugin = await head.plugin(head.config ?? {});
|
|
67395
|
+
const nestedPluginValues = Array.isArray(nestedPlugin) ? nestedPlugin : [nestedPlugin];
|
|
67396
|
+
for (const value of nestedPluginValues) {
|
|
67397
|
+
if (!value) {
|
|
67398
|
+
continue;
|
|
67283
67399
|
}
|
|
67284
|
-
if (
|
|
67285
|
-
|
|
67286
|
-
|
|
67287
|
-
|
|
67288
|
-
|
|
67289
|
-
|
|
67290
|
-
|
|
67400
|
+
if ("__plugin_init__" in value) {
|
|
67401
|
+
pluginsLeft.push(value);
|
|
67402
|
+
} else {
|
|
67403
|
+
result.push({
|
|
67404
|
+
...value,
|
|
67405
|
+
name: head.name,
|
|
67406
|
+
filepath: nestedFile
|
|
67291
67407
|
});
|
|
67292
|
-
|
|
67293
|
-
throw new Error(
|
|
67294
|
-
`Could not find plugin: ${pluginName}. Are you sure its installed? If so, please open a ticket on GitHub.`
|
|
67295
|
-
);
|
|
67408
|
+
}
|
|
67296
67409
|
}
|
|
67297
67410
|
}
|
|
67298
|
-
|
|
67299
|
-
|
|
67300
|
-
|
|
67301
|
-
|
|
67411
|
+
return result;
|
|
67412
|
+
}
|
|
67413
|
+
async function readConfigFile(configPath = DEFAULT_CONFIG_PATH) {
|
|
67414
|
+
let importPath2 = importPath(configPath);
|
|
67415
|
+
let imported;
|
|
67416
|
+
try {
|
|
67417
|
+
imported = await import(importPath2);
|
|
67418
|
+
} catch (e2) {
|
|
67419
|
+
throw new Error(`Could not load config file at file://${configPath}.
|
|
67420
|
+
${e2.message}`);
|
|
67421
|
+
}
|
|
67422
|
+
const config4 = imported.default || imported;
|
|
67423
|
+
return config4;
|
|
67302
67424
|
}
|
|
67303
|
-
var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
67304
|
-
LogLevel2["Full"] = "full";
|
|
67305
|
-
LogLevel2["Summary"] = "summary";
|
|
67306
|
-
LogLevel2["ShortSummary"] = "short-summary";
|
|
67307
|
-
LogLevel2["Quiet"] = "quiet";
|
|
67308
|
-
return LogLevel2;
|
|
67309
|
-
})(LogLevel || {});
|
|
67310
67425
|
var orderedPlugins = (plugins) => {
|
|
67311
67426
|
const ordered = plugins.filter(
|
|
67312
|
-
(
|
|
67427
|
+
(plugin2) => plugin2.order === "before" || plugin2.order === void 0
|
|
67313
67428
|
);
|
|
67314
67429
|
ordered.push(
|
|
67315
|
-
...plugins.filter((
|
|
67316
|
-
...plugins.filter((
|
|
67430
|
+
...plugins.filter((plugin2) => plugin2.order === "core"),
|
|
67431
|
+
...plugins.filter((plugin2) => plugin2.order === "after")
|
|
67317
67432
|
);
|
|
67318
67433
|
return ordered;
|
|
67319
67434
|
};
|
|
67435
|
+
async function pluginPath(plugin_name, config_path) {
|
|
67436
|
+
try {
|
|
67437
|
+
const pluginDirectory = findModule(plugin_name, config_path);
|
|
67438
|
+
const packageJsonSrc = await readFile(join2(pluginDirectory, "package.json"));
|
|
67439
|
+
if (!packageJsonSrc) {
|
|
67440
|
+
throw new Error("skip");
|
|
67441
|
+
}
|
|
67442
|
+
const packageJSON = JSON.parse(packageJsonSrc);
|
|
67443
|
+
if (!packageJSON.exports?.["."]?.import) {
|
|
67444
|
+
throw new Error("");
|
|
67445
|
+
}
|
|
67446
|
+
return join2(pluginDirectory, packageJSON.exports["."].import);
|
|
67447
|
+
} catch {
|
|
67448
|
+
const err = new Error(
|
|
67449
|
+
`Could not find plugin: ${plugin_name}. Are you sure its installed? If so, please open a ticket on GitHub.`
|
|
67450
|
+
);
|
|
67451
|
+
throw err;
|
|
67452
|
+
}
|
|
67453
|
+
}
|
|
67454
|
+
function findModule(pkg = "houdini", currentLocation) {
|
|
67455
|
+
const pathEndingBy = ["node_modules", pkg];
|
|
67456
|
+
let locationFound = join2(currentLocation, ...pathEndingBy);
|
|
67457
|
+
let previousLocation = "";
|
|
67458
|
+
const backFolder = [];
|
|
67459
|
+
while (previousLocation !== locationFound && !existsSync(locationFound)) {
|
|
67460
|
+
previousLocation = locationFound;
|
|
67461
|
+
backFolder.push("../");
|
|
67462
|
+
locationFound = join2(currentLocation, ...backFolder, ...pathEndingBy);
|
|
67463
|
+
}
|
|
67464
|
+
if (previousLocation === locationFound) {
|
|
67465
|
+
throw new Error("Could not find any node_modules/houdini folder");
|
|
67466
|
+
}
|
|
67467
|
+
return locationFound;
|
|
67468
|
+
}
|
|
67469
|
+
async function loadSchemaFile(schemaPath) {
|
|
67470
|
+
if (isAbsolute(schemaPath)) {
|
|
67471
|
+
const relPath = relative(process.cwd(), schemaPath);
|
|
67472
|
+
const error = new Error(
|
|
67473
|
+
`Invalid config value: 'schemaPath' must now be passed as a relative directory. Please change its value to "./${relPath}".`
|
|
67474
|
+
);
|
|
67475
|
+
error.stack = "";
|
|
67476
|
+
throw error;
|
|
67477
|
+
}
|
|
67478
|
+
if (glob.hasMagic(schemaPath)) {
|
|
67479
|
+
const sourceFiles = await glob(schemaPath);
|
|
67480
|
+
return mergeSchemas({
|
|
67481
|
+
typeDefs: await Promise.all(
|
|
67482
|
+
sourceFiles.map(async (filepath) => await readFile(filepath))
|
|
67483
|
+
)
|
|
67484
|
+
});
|
|
67485
|
+
}
|
|
67486
|
+
try {
|
|
67487
|
+
await stat(schemaPath);
|
|
67488
|
+
} catch {
|
|
67489
|
+
throw new HoudiniError({
|
|
67490
|
+
message: `Schema file does not exist! Create it using houdini pull-schema`
|
|
67491
|
+
});
|
|
67492
|
+
}
|
|
67493
|
+
const contents = await readFile(schemaPath);
|
|
67494
|
+
if (schemaPath.endsWith("gql") || schemaPath.endsWith("graphql")) {
|
|
67495
|
+
return graphql2.buildSchema(contents);
|
|
67496
|
+
}
|
|
67497
|
+
const jsonContents = JSON.parse(contents);
|
|
67498
|
+
if (jsonContents.data) {
|
|
67499
|
+
return graphql2.buildClientSchema(jsonContents.data);
|
|
67500
|
+
}
|
|
67501
|
+
return graphql2.buildClientSchema(jsonContents);
|
|
67502
|
+
}
|
|
67320
67503
|
|
|
67321
67504
|
// src/lib/graphql.ts
|
|
67322
67505
|
var import_crypto = __toESM(require("crypto"), 1);
|
|
@@ -67330,8 +67513,10 @@ function getRootType(type) {
|
|
|
67330
67513
|
}
|
|
67331
67514
|
return type;
|
|
67332
67515
|
}
|
|
67333
|
-
function hashDocument(
|
|
67334
|
-
|
|
67516
|
+
function hashDocument({
|
|
67517
|
+
document
|
|
67518
|
+
}) {
|
|
67519
|
+
const docString = typeof document === "string" ? document : graphql3.print(document.document);
|
|
67335
67520
|
return import_crypto.default.createHash("sha256").update(docString).digest("hex");
|
|
67336
67521
|
}
|
|
67337
67522
|
function parentTypeFromAncestors(schema, filepath, ancestors) {
|
|
@@ -67685,8 +67870,8 @@ async function find_graphql(config4, parsedScript, walker) {
|
|
|
67685
67870
|
return;
|
|
67686
67871
|
}
|
|
67687
67872
|
const definition = config4.extractDefinition(parsedTag);
|
|
67688
|
-
const
|
|
67689
|
-
if (!
|
|
67873
|
+
const name = definition.name?.value;
|
|
67874
|
+
if (!name) {
|
|
67690
67875
|
throw new Error("Could not find definition name");
|
|
67691
67876
|
}
|
|
67692
67877
|
let kind;
|
|
@@ -67711,7 +67896,7 @@ async function find_graphql(config4, parsedScript, walker) {
|
|
|
67711
67896
|
replaceWith: this.replace
|
|
67712
67897
|
},
|
|
67713
67898
|
artifact: {
|
|
67714
|
-
name
|
|
67899
|
+
name,
|
|
67715
67900
|
kind
|
|
67716
67901
|
},
|
|
67717
67902
|
parent,
|
|
@@ -67826,13 +68011,13 @@ var FieldCollection = class {
|
|
|
67826
68011
|
this.fragmentSpreads[selection2.name.value] = selection2;
|
|
67827
68012
|
let includeFragments = this.config.defaultFragmentMasking === "disable";
|
|
67828
68013
|
const maskEnableDirective = selection2.directives?.find(
|
|
67829
|
-
({ name
|
|
68014
|
+
({ name }) => name.value === this.config.maskEnableDirective
|
|
67830
68015
|
);
|
|
67831
68016
|
if (maskEnableDirective) {
|
|
67832
68017
|
includeFragments = false;
|
|
67833
68018
|
}
|
|
67834
68019
|
const maskDisableDirective = selection2.directives?.find(
|
|
67835
|
-
({ name
|
|
68020
|
+
({ name }) => name.value === this.config.maskDisableDirective
|
|
67836
68021
|
);
|
|
67837
68022
|
if (maskDisableDirective) {
|
|
67838
68023
|
includeFragments = true;
|
|
@@ -67987,7 +68172,7 @@ var graphql5 = __toESM(require_graphql2(), 1);
|
|
|
67987
68172
|
var import_graphql30 = __toESM(require_graphql2(), 1);
|
|
67988
68173
|
async function includeFragmentDefinitions(config4, documents) {
|
|
67989
68174
|
const fragments = collectFragments(config4, documents);
|
|
67990
|
-
for (const [index, { name
|
|
68175
|
+
for (const [index, { name, document, filename }] of documents.entries()) {
|
|
67991
68176
|
const operation = document.definitions.find(
|
|
67992
68177
|
({ kind }) => kind === import_graphql30.Kind.OPERATION_DEFINITION
|
|
67993
68178
|
);
|
|
@@ -68101,7 +68286,8 @@ async function fragmentVariables(config4, documents) {
|
|
|
68101
68286
|
generateStore: false,
|
|
68102
68287
|
generateArtifact: false,
|
|
68103
68288
|
filename: "generated::fragmentVariables",
|
|
68104
|
-
originalString: ""
|
|
68289
|
+
originalString: "",
|
|
68290
|
+
artifact: null
|
|
68105
68291
|
});
|
|
68106
68292
|
}
|
|
68107
68293
|
function inlineFragmentArgs({
|
|
@@ -68249,7 +68435,7 @@ function fragmentArguments(config4, filepath, definition) {
|
|
|
68249
68435
|
return [];
|
|
68250
68436
|
}
|
|
68251
68437
|
let type = typeArg.value;
|
|
68252
|
-
let
|
|
68438
|
+
let name = arg.name.value;
|
|
68253
68439
|
let required = false;
|
|
68254
68440
|
let defaultValue = arg.value.fields?.find((arg2) => arg2.name.value === "default")?.value || null;
|
|
68255
68441
|
if (type[type.length - 1] === "!") {
|
|
@@ -68259,7 +68445,7 @@ function fragmentArguments(config4, filepath, definition) {
|
|
|
68259
68445
|
}
|
|
68260
68446
|
return [
|
|
68261
68447
|
{
|
|
68262
|
-
name
|
|
68448
|
+
name,
|
|
68263
68449
|
type,
|
|
68264
68450
|
required,
|
|
68265
68451
|
defaultValue
|
|
@@ -68270,7 +68456,7 @@ function fragmentArguments(config4, filepath, definition) {
|
|
|
68270
68456
|
}
|
|
68271
68457
|
function collectDefaultArgumentValues(config4, filepath, definition) {
|
|
68272
68458
|
let result = {};
|
|
68273
|
-
for (const { name
|
|
68459
|
+
for (const { name, required, defaultValue } of fragmentArguments(
|
|
68274
68460
|
config4,
|
|
68275
68461
|
filepath,
|
|
68276
68462
|
definition
|
|
@@ -68278,7 +68464,7 @@ function collectDefaultArgumentValues(config4, filepath, definition) {
|
|
|
68278
68464
|
if (required || !defaultValue) {
|
|
68279
68465
|
continue;
|
|
68280
68466
|
}
|
|
68281
|
-
result[
|
|
68467
|
+
result[name] = defaultValue;
|
|
68282
68468
|
}
|
|
68283
68469
|
return result;
|
|
68284
68470
|
}
|
|
@@ -68445,30 +68631,6 @@ function serializeValue(value) {
|
|
|
68445
68631
|
}
|
|
68446
68632
|
return AST4.literal(value);
|
|
68447
68633
|
}
|
|
68448
|
-
function deepMerge(filepath, ...targets) {
|
|
68449
|
-
if (typeof targets[0] !== "object") {
|
|
68450
|
-
const matches = targets.filter((val) => val !== targets[0]).length === 0;
|
|
68451
|
-
if (!matches) {
|
|
68452
|
-
throw new HoudiniError({ filepath, message: "could not merge: " + targets });
|
|
68453
|
-
}
|
|
68454
|
-
return targets[0];
|
|
68455
|
-
}
|
|
68456
|
-
if (Array.isArray(targets[0])) {
|
|
68457
|
-
return targets[0].concat(...targets.slice(1));
|
|
68458
|
-
}
|
|
68459
|
-
const fields = {};
|
|
68460
|
-
for (const target of targets) {
|
|
68461
|
-
for (const [key, value] of Object.entries(target)) {
|
|
68462
|
-
if (!fields[key]) {
|
|
68463
|
-
fields[key] = [];
|
|
68464
|
-
}
|
|
68465
|
-
fields[key].push(value);
|
|
68466
|
-
}
|
|
68467
|
-
}
|
|
68468
|
-
return Object.fromEntries(
|
|
68469
|
-
Object.entries(fields).map(([key, value]) => [key, deepMerge(filepath, ...value)])
|
|
68470
|
-
);
|
|
68471
|
-
}
|
|
68472
68634
|
function convertValue(config4, val) {
|
|
68473
68635
|
let value;
|
|
68474
68636
|
let kind;
|
|
@@ -68553,14 +68715,14 @@ function operationObject({
|
|
|
68553
68715
|
let allLists = config4.defaultListTarget ?? void 0;
|
|
68554
68716
|
let operationWhen;
|
|
68555
68717
|
const internalDirectives = selection2.directives?.filter(
|
|
68556
|
-
(directive) => config4.isInternalDirective(directive)
|
|
68718
|
+
(directive) => config4.isInternalDirective(directive.name.value)
|
|
68557
68719
|
);
|
|
68558
68720
|
if (internalDirectives && internalDirectives.length > 0) {
|
|
68559
68721
|
const prepend = internalDirectives.find(
|
|
68560
|
-
({ name
|
|
68722
|
+
({ name }) => name.value === config4.listPrependDirective
|
|
68561
68723
|
);
|
|
68562
68724
|
const append = internalDirectives.find(
|
|
68563
|
-
({ name
|
|
68725
|
+
({ name }) => name.value === config4.listAppendDirective
|
|
68564
68726
|
);
|
|
68565
68727
|
if (append) {
|
|
68566
68728
|
position = "last";
|
|
@@ -68569,14 +68731,14 @@ function operationObject({
|
|
|
68569
68731
|
position = "first";
|
|
68570
68732
|
}
|
|
68571
68733
|
const allListsDirective = internalDirectives.find(
|
|
68572
|
-
({ name
|
|
68734
|
+
({ name }) => name.value === config4.listAllListsDirective
|
|
68573
68735
|
);
|
|
68574
68736
|
let parent = internalDirectives.find(
|
|
68575
|
-
({ name
|
|
68737
|
+
({ name }) => name.value === config4.listParentDirective
|
|
68576
68738
|
);
|
|
68577
68739
|
allLists = allListsDirective ? "all" : void 0;
|
|
68578
|
-
const when = internalDirectives.find(({ name
|
|
68579
|
-
const when_not = internalDirectives.find(({ name
|
|
68740
|
+
const when = internalDirectives.find(({ name }) => name.value === "when");
|
|
68741
|
+
const when_not = internalDirectives.find(({ name }) => name.value === "when_not");
|
|
68580
68742
|
let parentIDArg = parent?.arguments?.find((argument) => argument.name.value === "value");
|
|
68581
68743
|
if (parentIDArg) {
|
|
68582
68744
|
if (parentIDArg.value.kind === "StringValue") {
|
|
@@ -68587,9 +68749,9 @@ function operationObject({
|
|
|
68587
68749
|
parentID = parentIDArg.value.name.value;
|
|
68588
68750
|
}
|
|
68589
68751
|
}
|
|
68590
|
-
const whenArg = (append || prepend)?.arguments?.find(({ name
|
|
68752
|
+
const whenArg = (append || prepend)?.arguments?.find(({ name }) => name.value === "when");
|
|
68591
68753
|
const whenNotArg = (append || prepend)?.arguments?.find(
|
|
68592
|
-
({ name
|
|
68754
|
+
({ name }) => name.value === "when_not"
|
|
68593
68755
|
);
|
|
68594
68756
|
for (const [i2, arg] of [whenArg, whenNotArg].entries()) {
|
|
68595
68757
|
if (!arg || arg.value.kind !== "ObjectValue") {
|
|
@@ -68828,7 +68990,7 @@ async function paginate(config4, documents) {
|
|
|
68828
68990
|
Object.keys(operationVariables).concat(Object.keys(newVariables))
|
|
68829
68991
|
);
|
|
68830
68992
|
const finalVariables = [...variableNames].map(
|
|
68831
|
-
(
|
|
68993
|
+
(name) => operationVariables[name] || newVariables[name]
|
|
68832
68994
|
);
|
|
68833
68995
|
return {
|
|
68834
68996
|
...node,
|
|
@@ -68925,7 +69087,7 @@ async function paginate(config4, documents) {
|
|
|
68925
69087
|
value: config4.withDirective
|
|
68926
69088
|
},
|
|
68927
69089
|
["arguments"]: paginationArgs.map(
|
|
68928
|
-
({ name
|
|
69090
|
+
({ name }) => variableAsArgument(name)
|
|
68929
69091
|
)
|
|
68930
69092
|
}
|
|
68931
69093
|
]
|
|
@@ -69053,7 +69215,8 @@ async function paginate(config4, documents) {
|
|
|
69053
69215
|
generateArtifact: true,
|
|
69054
69216
|
generateStore: false,
|
|
69055
69217
|
refetch: doc.refetch,
|
|
69056
|
-
originalString: ""
|
|
69218
|
+
originalString: "",
|
|
69219
|
+
artifact: null
|
|
69057
69220
|
});
|
|
69058
69221
|
}
|
|
69059
69222
|
}
|
|
@@ -69076,32 +69239,32 @@ function replaceArgumentsWithVariables(args, flags) {
|
|
|
69076
69239
|
seenArgs[arg.name.value] = true;
|
|
69077
69240
|
return variableAsArgument(arg.name.value, flags[arg.name.value].variableName);
|
|
69078
69241
|
});
|
|
69079
|
-
for (const
|
|
69080
|
-
const spec = flags[
|
|
69081
|
-
if (flags[
|
|
69242
|
+
for (const name of Object.keys(flags)) {
|
|
69243
|
+
const spec = flags[name];
|
|
69244
|
+
if (flags[name].defaultValue || !spec.enabled || seenArgs[name]) {
|
|
69082
69245
|
continue;
|
|
69083
69246
|
}
|
|
69084
|
-
newArgs.push(variableAsArgument(
|
|
69247
|
+
newArgs.push(variableAsArgument(name));
|
|
69085
69248
|
}
|
|
69086
69249
|
return newArgs;
|
|
69087
69250
|
}
|
|
69088
|
-
function variableAsArgument(
|
|
69251
|
+
function variableAsArgument(name, variable) {
|
|
69089
69252
|
return {
|
|
69090
69253
|
kind: graphql10.Kind.ARGUMENT,
|
|
69091
69254
|
name: {
|
|
69092
69255
|
kind: graphql10.Kind.NAME,
|
|
69093
|
-
value:
|
|
69256
|
+
value: name
|
|
69094
69257
|
},
|
|
69095
69258
|
value: {
|
|
69096
69259
|
kind: graphql10.Kind.VARIABLE,
|
|
69097
69260
|
name: {
|
|
69098
69261
|
kind: graphql10.Kind.NAME,
|
|
69099
|
-
value: variable ??
|
|
69262
|
+
value: variable ?? name
|
|
69100
69263
|
}
|
|
69101
69264
|
}
|
|
69102
69265
|
};
|
|
69103
69266
|
}
|
|
69104
|
-
function staticVariableDefinition(
|
|
69267
|
+
function staticVariableDefinition(name, type, defaultValue, variableName) {
|
|
69105
69268
|
return {
|
|
69106
69269
|
kind: graphql10.Kind.VARIABLE_DEFINITION,
|
|
69107
69270
|
type: {
|
|
@@ -69115,7 +69278,7 @@ function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
|
69115
69278
|
kind: graphql10.Kind.VARIABLE,
|
|
69116
69279
|
name: {
|
|
69117
69280
|
kind: graphql10.Kind.NAME,
|
|
69118
|
-
value: variableName ??
|
|
69281
|
+
value: variableName ?? name
|
|
69119
69282
|
}
|
|
69120
69283
|
},
|
|
69121
69284
|
defaultValue: !defaultValue ? void 0 : {
|
|
@@ -69124,12 +69287,12 @@ function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
|
69124
69287
|
}
|
|
69125
69288
|
};
|
|
69126
69289
|
}
|
|
69127
|
-
function argumentNode(
|
|
69290
|
+
function argumentNode(name, value) {
|
|
69128
69291
|
return {
|
|
69129
69292
|
kind: graphql10.Kind.ARGUMENT,
|
|
69130
69293
|
name: {
|
|
69131
69294
|
kind: graphql10.Kind.NAME,
|
|
69132
|
-
value:
|
|
69295
|
+
value: name
|
|
69133
69296
|
},
|
|
69134
69297
|
value: objectNode(value)
|
|
69135
69298
|
};
|
|
@@ -69375,7 +69538,7 @@ async function addListFragments(config4, documents) {
|
|
|
69375
69538
|
const generatedDoc = {
|
|
69376
69539
|
kind: graphql11.Kind.DOCUMENT,
|
|
69377
69540
|
definitions: Object.entries(lists).flatMap(
|
|
69378
|
-
([
|
|
69541
|
+
([name, { selection: selection2, type }]) => {
|
|
69379
69542
|
const schemaType = config4.schema.getType(type.name);
|
|
69380
69543
|
if (!selection2) {
|
|
69381
69544
|
throw new HoudiniError({ message: "Lists must have a selection" });
|
|
@@ -69395,7 +69558,7 @@ async function addListFragments(config4, documents) {
|
|
|
69395
69558
|
return [
|
|
69396
69559
|
{
|
|
69397
69560
|
name: {
|
|
69398
|
-
value: config4.listInsertFragment(
|
|
69561
|
+
value: config4.listInsertFragment(name),
|
|
69399
69562
|
kind: graphql11.Kind.NAME
|
|
69400
69563
|
},
|
|
69401
69564
|
kind: graphql11.Kind.FRAGMENT_DEFINITION,
|
|
@@ -69410,7 +69573,7 @@ async function addListFragments(config4, documents) {
|
|
|
69410
69573
|
},
|
|
69411
69574
|
{
|
|
69412
69575
|
name: {
|
|
69413
|
-
value: config4.listToggleFragment(
|
|
69576
|
+
value: config4.listToggleFragment(name),
|
|
69414
69577
|
kind: graphql11.Kind.NAME
|
|
69415
69578
|
},
|
|
69416
69579
|
kind: graphql11.Kind.FRAGMENT_DEFINITION,
|
|
@@ -69426,7 +69589,7 @@ async function addListFragments(config4, documents) {
|
|
|
69426
69589
|
{
|
|
69427
69590
|
kind: graphql11.Kind.FRAGMENT_DEFINITION,
|
|
69428
69591
|
name: {
|
|
69429
|
-
value: config4.listRemoveFragment(
|
|
69592
|
+
value: config4.listRemoveFragment(name),
|
|
69430
69593
|
kind: graphql11.Kind.NAME
|
|
69431
69594
|
},
|
|
69432
69595
|
selectionSet: {
|
|
@@ -69470,7 +69633,8 @@ async function addListFragments(config4, documents) {
|
|
|
69470
69633
|
document: generatedDoc,
|
|
69471
69634
|
originalDocument: generatedDoc,
|
|
69472
69635
|
filename: "generated::lists",
|
|
69473
|
-
originalString: ""
|
|
69636
|
+
originalString: "",
|
|
69637
|
+
artifact: null
|
|
69474
69638
|
});
|
|
69475
69639
|
}
|
|
69476
69640
|
function connectionSelection(config4, field, type, selection2) {
|
|
@@ -69874,19 +70038,20 @@ function artifactGenerator(stats) {
|
|
|
69874
70038
|
});
|
|
69875
70039
|
}
|
|
69876
70040
|
const listOfArtifacts = [];
|
|
70041
|
+
const hash = config4.plugins?.find((plugin2) => plugin2.hash)?.hash ?? hashDocument;
|
|
69877
70042
|
await Promise.all(
|
|
69878
70043
|
[
|
|
69879
70044
|
writeIndexFile(config4, docs)
|
|
69880
70045
|
].concat(
|
|
69881
70046
|
docs.map(async (doc) => {
|
|
69882
|
-
const { document, name
|
|
70047
|
+
const { document, name, generateArtifact } = doc;
|
|
69883
70048
|
if (!generateArtifact) {
|
|
69884
70049
|
return;
|
|
69885
70050
|
}
|
|
69886
70051
|
const usedVariableNames = /* @__PURE__ */ new Set();
|
|
69887
70052
|
let documentWithoutInternalDirectives = graphql14.visit(document, {
|
|
69888
70053
|
Directive(node) {
|
|
69889
|
-
if (config4.isInternalDirective(node)) {
|
|
70054
|
+
if (config4.isInternalDirective(node.name.value)) {
|
|
69890
70055
|
return null;
|
|
69891
70056
|
}
|
|
69892
70057
|
},
|
|
@@ -69901,8 +70066,8 @@ function artifactGenerator(stats) {
|
|
|
69901
70066
|
documentWithoutInternalDirectives,
|
|
69902
70067
|
{
|
|
69903
70068
|
VariableDefinition(variableDefinitionNode) {
|
|
69904
|
-
const
|
|
69905
|
-
if (!usedVariableNames.has(
|
|
70069
|
+
const name2 = variableDefinitionNode.variable.name.value;
|
|
70070
|
+
if (!usedVariableNames.has(name2)) {
|
|
69906
70071
|
return null;
|
|
69907
70072
|
}
|
|
69908
70073
|
}
|
|
@@ -69936,12 +70101,12 @@ function artifactGenerator(stats) {
|
|
|
69936
70101
|
selectionSet = operation.selectionSet;
|
|
69937
70102
|
} else {
|
|
69938
70103
|
const matchingFragment = fragments.find(
|
|
69939
|
-
(fragment) => fragment.name.value ===
|
|
70104
|
+
(fragment) => fragment.name.value === name
|
|
69940
70105
|
);
|
|
69941
70106
|
if (!matchingFragment) {
|
|
69942
70107
|
throw new HoudiniError({
|
|
69943
70108
|
filepath: doc.filename,
|
|
69944
|
-
message: `Fragment "${
|
|
70109
|
+
message: `Fragment "${name}" doesn't exist in its own document?!`
|
|
69945
70110
|
});
|
|
69946
70111
|
}
|
|
69947
70112
|
rootType = matchingFragment.typeCondition.name.value;
|
|
@@ -69970,10 +70135,10 @@ function artifactGenerator(stats) {
|
|
|
69970
70135
|
ignoreMaskDisable: docKind === "HoudiniQuery",
|
|
69971
70136
|
applyFragments: docKind !== "HoudiniFragment"
|
|
69972
70137
|
});
|
|
69973
|
-
|
|
69974
|
-
name
|
|
70138
|
+
let artifact = {
|
|
70139
|
+
name,
|
|
69975
70140
|
kind: docKind,
|
|
69976
|
-
hash:
|
|
70141
|
+
hash: hash({ config: config4, document: doc }),
|
|
69977
70142
|
refetch: doc.refetch,
|
|
69978
70143
|
raw: rawString,
|
|
69979
70144
|
rootType,
|
|
@@ -69992,27 +70157,27 @@ function artifactGenerator(stats) {
|
|
|
69992
70157
|
document: doc
|
|
69993
70158
|
})
|
|
69994
70159
|
};
|
|
69995
|
-
const
|
|
69996
|
-
(prev,
|
|
69997
|
-
if (!
|
|
70160
|
+
const plugin_data = config4.plugins.reduce(
|
|
70161
|
+
(prev, plugin2) => {
|
|
70162
|
+
if (!plugin2.artifact_data) {
|
|
69998
70163
|
return prev;
|
|
69999
70164
|
}
|
|
70000
70165
|
const result = { ...prev };
|
|
70001
|
-
const dataToAdd =
|
|
70166
|
+
const dataToAdd = plugin2.artifact_data({ config: config4, document: doc }) ?? {};
|
|
70002
70167
|
if (Object.keys(dataToAdd).length > 0) {
|
|
70003
|
-
result[
|
|
70168
|
+
result[plugin2.name] = dataToAdd;
|
|
70004
70169
|
}
|
|
70005
70170
|
return result;
|
|
70006
70171
|
},
|
|
70007
70172
|
{}
|
|
70008
70173
|
);
|
|
70009
|
-
if (Object.keys(
|
|
70010
|
-
artifact.
|
|
70174
|
+
if (Object.keys(plugin_data).length > 0) {
|
|
70175
|
+
artifact.plugin_data = plugin_data;
|
|
70011
70176
|
}
|
|
70012
70177
|
if (inputs && inputs.length > 0) {
|
|
70013
70178
|
artifact.input = inputObject(config4, inputs);
|
|
70014
70179
|
}
|
|
70015
|
-
if (
|
|
70180
|
+
if (artifact.kind === "HoudiniQuery") {
|
|
70016
70181
|
const cacheDirective = operations[0].directives?.find(
|
|
70017
70182
|
(directive2) => directive2.name.value === config4.cacheDirective
|
|
70018
70183
|
);
|
|
@@ -70025,7 +70190,7 @@ function artifactGenerator(stats) {
|
|
|
70025
70190
|
{}
|
|
70026
70191
|
) || {};
|
|
70027
70192
|
const policy = args[config4.cachePolicyArg];
|
|
70028
|
-
if (policy && policy.value.kind === "EnumValue") {
|
|
70193
|
+
if (policy && policy.value.kind === "EnumValue" && policy.value.value) {
|
|
70029
70194
|
artifact.policy = policy.value.value;
|
|
70030
70195
|
} else {
|
|
70031
70196
|
artifact.policy = config4.defaultCachePolicy;
|
|
@@ -70041,10 +70206,17 @@ function artifactGenerator(stats) {
|
|
|
70041
70206
|
artifact.partial = config4.defaultPartial;
|
|
70042
70207
|
}
|
|
70043
70208
|
}
|
|
70209
|
+
doc.artifact = artifact;
|
|
70210
|
+
for (const plugin2 of config4.plugins) {
|
|
70211
|
+
if (!plugin2.artifact_end) {
|
|
70212
|
+
continue;
|
|
70213
|
+
}
|
|
70214
|
+
plugin2.artifact_end({ config: config4, document: doc });
|
|
70215
|
+
}
|
|
70044
70216
|
const file = AST5.program([
|
|
70045
70217
|
moduleExport(config4, "default", serializeValue(artifact)),
|
|
70046
70218
|
AST5.expressionStatement(
|
|
70047
|
-
AST5.stringLiteral(`HoudiniHash=${
|
|
70219
|
+
AST5.stringLiteral(`HoudiniHash=${hash({ config: config4, document: doc })}`)
|
|
70048
70220
|
)
|
|
70049
70221
|
]);
|
|
70050
70222
|
const artifactPath = config4.artifactPath(document);
|
|
@@ -70061,7 +70233,7 @@ function artifactGenerator(stats) {
|
|
|
70061
70233
|
return;
|
|
70062
70234
|
}
|
|
70063
70235
|
const match = existingArtifact && existingArtifact.match(/"HoudiniHash=(\w+)"/);
|
|
70064
|
-
if (match && match[1] !==
|
|
70236
|
+
if (match && match[1] !== hash({ config: config4, document: doc })) {
|
|
70065
70237
|
stats.changed.push(artifact.name);
|
|
70066
70238
|
}
|
|
70067
70239
|
stats.total.push(artifact.name);
|
|
@@ -70080,7 +70252,7 @@ async function generateGraphqlReturnTypes(config4, docs) {
|
|
|
70080
70252
|
const fileContent = await fs_exports.readFile(indexPath) || "";
|
|
70081
70253
|
const contents = await parseJS(fileContent);
|
|
70082
70254
|
const graphql_tag_return = config4.plugins.find(
|
|
70083
|
-
(
|
|
70255
|
+
(plugin2) => plugin2.graphql_tag_return
|
|
70084
70256
|
)?.graphql_tag_return;
|
|
70085
70257
|
if (!graphql_tag_return || !contents) {
|
|
70086
70258
|
return fileContent;
|
|
@@ -70089,7 +70261,7 @@ async function generateGraphqlReturnTypes(config4, docs) {
|
|
|
70089
70261
|
for (const doc of docs) {
|
|
70090
70262
|
const return_value = graphql_tag_return({
|
|
70091
70263
|
config: config4,
|
|
70092
|
-
doc,
|
|
70264
|
+
document: doc,
|
|
70093
70265
|
ensure_import({ identifier, module: module2 }) {
|
|
70094
70266
|
ensureImports({
|
|
70095
70267
|
config: config4,
|
|
@@ -70138,19 +70310,19 @@ async function injectPlugins({
|
|
|
70138
70310
|
importStatement,
|
|
70139
70311
|
exportStatement
|
|
70140
70312
|
}) {
|
|
70141
|
-
const client_plugins = config4.plugins.filter((
|
|
70142
|
-
let plugins =
|
|
70313
|
+
const client_plugins = config4.plugins.filter((plugin2) => plugin2.client_plugins).reduce((acc, plugin2) => {
|
|
70314
|
+
let plugins = plugin2.client_plugins;
|
|
70143
70315
|
if (typeof plugins === "function") {
|
|
70144
|
-
plugins = plugins(config4, config4.pluginConfig(
|
|
70316
|
+
plugins = plugins(config4, config4.pluginConfig(plugin2.name));
|
|
70145
70317
|
}
|
|
70146
70318
|
return [...acc, ...Object.entries(plugins)];
|
|
70147
70319
|
}, []);
|
|
70148
70320
|
return client_plugins.length > 0 ? `
|
|
70149
|
-
${client_plugins.map((
|
|
70321
|
+
${client_plugins.map((plugin2, i2) => importStatement(plugin2[0], `plugin${i2}`))}
|
|
70150
70322
|
|
|
70151
70323
|
const plugins = [
|
|
70152
|
-
${client_plugins.map((
|
|
70153
|
-
const suffix =
|
|
70324
|
+
${client_plugins.map((plugin2, i2) => {
|
|
70325
|
+
const suffix = `(${JSON.stringify(plugin2[1])})`;
|
|
70154
70326
|
return `plugin${i2}${suffix}`;
|
|
70155
70327
|
}).join(",\n")}
|
|
70156
70328
|
]
|
|
@@ -70193,37 +70365,35 @@ ${exportStatement("config")}
|
|
|
70193
70365
|
},
|
|
70194
70366
|
[path_exports.join(config4.runtimeSource, "client", "plugins", "injectedPlugins.js")]: (content) => injectPlugins({ config: config4, content, importStatement, exportStatement })
|
|
70195
70367
|
}),
|
|
70196
|
-
...config4.plugins.filter((
|
|
70368
|
+
...config4.plugins.filter((plugin2) => plugin2.include_runtime).map((plugin2) => generatePluginRuntime(config4, plugin2)),
|
|
70197
70369
|
generatePluginIndex({ config: config4, exportStatement: exportStar })
|
|
70198
70370
|
]);
|
|
70199
70371
|
await generateGraphqlReturnTypes(config4, docs);
|
|
70200
70372
|
}
|
|
70201
|
-
async function generatePluginRuntime(config4,
|
|
70202
|
-
if (houdini_mode.is_testing) {
|
|
70373
|
+
async function generatePluginRuntime(config4, plugin2) {
|
|
70374
|
+
if (houdini_mode.is_testing || !plugin2.include_runtime) {
|
|
70203
70375
|
return;
|
|
70204
70376
|
}
|
|
70205
|
-
const
|
|
70206
|
-
|
|
70207
|
-
"
|
|
70208
|
-
"runtime-" + (config4.module === "esm" ? "esm" : "cjs")
|
|
70377
|
+
const runtime_path = path_exports.join(
|
|
70378
|
+
path_exports.dirname(plugin2.filepath),
|
|
70379
|
+
typeof plugin2.include_runtime === "string" ? plugin2.include_runtime : plugin2.include_runtime[config4.module]
|
|
70209
70380
|
);
|
|
70210
70381
|
try {
|
|
70211
|
-
await fs_exports.stat(
|
|
70382
|
+
await fs_exports.stat(runtime_path);
|
|
70212
70383
|
} catch {
|
|
70213
70384
|
throw new HoudiniError({
|
|
70214
|
-
message:
|
|
70215
|
-
description: "
|
|
70385
|
+
message: "Cannot find runtime to generate for " + plugin2.name,
|
|
70386
|
+
description: "Maybe it was bundled?"
|
|
70216
70387
|
});
|
|
70217
70388
|
}
|
|
70218
|
-
const
|
|
70219
|
-
const pluginDir = config4.pluginRuntimeDirectory(plugin.name);
|
|
70389
|
+
const pluginDir = config4.pluginRuntimeDirectory(plugin2.name);
|
|
70220
70390
|
await fs_exports.mkdirp(pluginDir);
|
|
70221
70391
|
await fs_exports.recursiveCopy(
|
|
70222
|
-
|
|
70392
|
+
runtime_path,
|
|
70223
70393
|
pluginDir,
|
|
70224
70394
|
Object.fromEntries(
|
|
70225
|
-
Object.entries(
|
|
70226
|
-
path_exports.join(
|
|
70395
|
+
Object.entries(plugin2.transform_runtime ?? {}).map(([key, value]) => [
|
|
70396
|
+
path_exports.join(runtime_path, key),
|
|
70227
70397
|
(content) => value({ config: config4, content })
|
|
70228
70398
|
])
|
|
70229
70399
|
)
|
|
@@ -70624,7 +70794,7 @@ async function generateDocumentTypes(config4, docs) {
|
|
|
70624
70794
|
}
|
|
70625
70795
|
const missingScalars = /* @__PURE__ */ new Set();
|
|
70626
70796
|
await Promise.all(
|
|
70627
|
-
docs.map(async ({ originalDocument, name
|
|
70797
|
+
docs.map(async ({ originalDocument, name, filename, generateArtifact }) => {
|
|
70628
70798
|
if (!generateArtifact) {
|
|
70629
70799
|
return;
|
|
70630
70800
|
}
|
|
@@ -70632,7 +70802,7 @@ async function generateDocumentTypes(config4, docs) {
|
|
|
70632
70802
|
const program = AST11.program([]);
|
|
70633
70803
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
70634
70804
|
let definition = originalDocument.definitions.find(
|
|
70635
|
-
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value ===
|
|
70805
|
+
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value === name
|
|
70636
70806
|
);
|
|
70637
70807
|
const selections = flattenSelections({
|
|
70638
70808
|
config: config4,
|
|
@@ -70686,22 +70856,22 @@ export { default as ${as} } from "${module2}"
|
|
|
70686
70856
|
export * from "${module2}"
|
|
70687
70857
|
`;
|
|
70688
70858
|
let indexContent = recast11.print(typeIndex).code;
|
|
70689
|
-
for (const
|
|
70690
|
-
if (!
|
|
70859
|
+
for (const plugin2 of config4.plugins) {
|
|
70860
|
+
if (!plugin2.index_file) {
|
|
70691
70861
|
continue;
|
|
70692
70862
|
}
|
|
70693
|
-
indexContent =
|
|
70863
|
+
indexContent = plugin2.index_file({
|
|
70694
70864
|
config: config4,
|
|
70695
70865
|
content: indexContent,
|
|
70696
70866
|
export_default_as,
|
|
70697
70867
|
export_star_from,
|
|
70698
|
-
plugin_root: config4.pluginDirectory(
|
|
70868
|
+
plugin_root: config4.pluginDirectory(plugin2.name),
|
|
70699
70869
|
typedef: true,
|
|
70700
70870
|
documents: docs
|
|
70701
70871
|
});
|
|
70702
|
-
if (
|
|
70872
|
+
if (plugin2.include_runtime) {
|
|
70703
70873
|
indexContent += export_star_from({
|
|
70704
|
-
module: "./" + path_exports.relative(config4.rootDir, config4.pluginRuntimeDirectory(
|
|
70874
|
+
module: "./" + path_exports.relative(config4.rootDir, config4.pluginRuntimeDirectory(plugin2.name))
|
|
70705
70875
|
});
|
|
70706
70876
|
}
|
|
70707
70877
|
}
|
|
@@ -70947,9 +71117,9 @@ var graphql19 = __toESM(require_graphql2(), 1);
|
|
|
70947
71117
|
var recast12 = __toESM(require_main2(), 1);
|
|
70948
71118
|
var AST12 = recast12.types.builders;
|
|
70949
71119
|
async function imperativeCacheTypef(config4, docs) {
|
|
70950
|
-
const returnType = (doc) => config4.plugins.find((
|
|
71120
|
+
const returnType = (doc) => config4.plugins.find((plugin2) => plugin2.graphql_tag_return)?.graphql_tag_return?.({
|
|
70951
71121
|
config: config4,
|
|
70952
|
-
doc,
|
|
71122
|
+
document: doc,
|
|
70953
71123
|
ensure_import({ identifier, module: module2 }) {
|
|
70954
71124
|
ensureImports({
|
|
70955
71125
|
config: config4,
|
|
@@ -71294,12 +71464,12 @@ function fragmentListMap(config4, concreteTypes, body, docs, return_type) {
|
|
|
71294
71464
|
}, {});
|
|
71295
71465
|
}
|
|
71296
71466
|
var CacheTypeDefName = "CacheTypeDef";
|
|
71297
|
-
function record(
|
|
71467
|
+
function record(name) {
|
|
71298
71468
|
return AST12.tsTypeReference(
|
|
71299
71469
|
AST12.identifier("Record"),
|
|
71300
71470
|
AST12.tsTypeParameterInstantiation([
|
|
71301
71471
|
AST12.tsTypeReference(AST12.identifier(CacheTypeDefName)),
|
|
71302
|
-
AST12.tsLiteralType(AST12.stringLiteral(
|
|
71472
|
+
AST12.tsLiteralType(AST12.stringLiteral(name))
|
|
71303
71473
|
])
|
|
71304
71474
|
);
|
|
71305
71475
|
}
|
|
@@ -71328,7 +71498,7 @@ async function persistOutputGenerator(config4, docs) {
|
|
|
71328
71498
|
let rawString = graphql20.print(
|
|
71329
71499
|
graphql20.visit(document, {
|
|
71330
71500
|
Directive(node) {
|
|
71331
|
-
if (config4.isInternalDirective(node)) {
|
|
71501
|
+
if (config4.isInternalDirective(node.name.value)) {
|
|
71332
71502
|
return null;
|
|
71333
71503
|
}
|
|
71334
71504
|
}
|
|
@@ -71338,7 +71508,7 @@ async function persistOutputGenerator(config4, docs) {
|
|
|
71338
71508
|
({ kind }) => kind === graphql20.Kind.OPERATION_DEFINITION
|
|
71339
71509
|
);
|
|
71340
71510
|
if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
|
|
71341
|
-
acc[hashDocument(rawString)] = rawString;
|
|
71511
|
+
acc[hashDocument({ config: config4, document: rawString })] = rawString;
|
|
71342
71512
|
}
|
|
71343
71513
|
return acc;
|
|
71344
71514
|
}, {});
|
|
@@ -71358,10 +71528,10 @@ async function definitionsGenerator(config4) {
|
|
|
71358
71528
|
const runtimeDefinitions = recast13.print(
|
|
71359
71529
|
AST13.program(
|
|
71360
71530
|
enums.map((defn) => {
|
|
71361
|
-
const
|
|
71531
|
+
const name = defn.name.value;
|
|
71362
71532
|
return moduleExport(
|
|
71363
71533
|
config4,
|
|
71364
|
-
|
|
71534
|
+
name,
|
|
71365
71535
|
AST13.objectExpression(
|
|
71366
71536
|
defn.values?.map((value) => {
|
|
71367
71537
|
const str = value.name.value;
|
|
@@ -71418,24 +71588,24 @@ async function writeIndexFile2(config4, docs) {
|
|
|
71418
71588
|
export_star_from({ module: artifactDir }),
|
|
71419
71589
|
export_star_from({ module: definitionsDir })
|
|
71420
71590
|
].join("");
|
|
71421
|
-
for (const
|
|
71422
|
-
if (
|
|
71423
|
-
body =
|
|
71591
|
+
for (const plugin2 of config4.plugins) {
|
|
71592
|
+
if (plugin2.index_file) {
|
|
71593
|
+
body = plugin2.index_file({
|
|
71424
71594
|
config: config4,
|
|
71425
71595
|
content: body,
|
|
71426
71596
|
export_default_as,
|
|
71427
71597
|
export_star_from,
|
|
71428
|
-
plugin_root: config4.pluginDirectory(
|
|
71598
|
+
plugin_root: config4.pluginDirectory(plugin2.name),
|
|
71429
71599
|
typedef: false,
|
|
71430
71600
|
documents: docs
|
|
71431
71601
|
});
|
|
71432
71602
|
}
|
|
71433
|
-
if (
|
|
71603
|
+
if (plugin2.include_runtime) {
|
|
71434
71604
|
body += export_star_from({
|
|
71435
|
-
module: relative2(config4.pluginRuntimeDirectory(
|
|
71605
|
+
module: relative2(config4.pluginRuntimeDirectory(plugin2.name))
|
|
71436
71606
|
});
|
|
71437
71607
|
}
|
|
71438
|
-
if (!
|
|
71608
|
+
if (!plugin2.index_file) {
|
|
71439
71609
|
continue;
|
|
71440
71610
|
}
|
|
71441
71611
|
}
|
|
@@ -71445,7 +71615,7 @@ async function writeIndexFile2(config4, docs) {
|
|
|
71445
71615
|
// src/codegen/transforms/schema.ts
|
|
71446
71616
|
var graphql22 = __toESM(require_graphql2(), 1);
|
|
71447
71617
|
async function graphqlExtensions(config4, documents) {
|
|
71448
|
-
|
|
71618
|
+
let internalSchema = `
|
|
71449
71619
|
enum CachePolicy {
|
|
71450
71620
|
${"CacheAndNetwork" /* CacheAndNetwork */}
|
|
71451
71621
|
${"CacheOnly" /* CacheOnly */}
|
|
@@ -71486,6 +71656,7 @@ directive @${config4.listAllListsDirective} on FRAGMENT_SPREAD
|
|
|
71486
71656
|
"""
|
|
71487
71657
|
directive @${config4.listParentDirective}(value: ID!) on FRAGMENT_SPREAD
|
|
71488
71658
|
|
|
71659
|
+
|
|
71489
71660
|
"""
|
|
71490
71661
|
@${config4.whenDirective} is used to provide a conditional or in situations where it doesn't make sense (eg when removing or deleting a node.)
|
|
71491
71662
|
"""
|
|
@@ -71501,6 +71672,11 @@ directive @${config4.whenNotDirective} on FRAGMENT_SPREAD
|
|
|
71501
71672
|
"""
|
|
71502
71673
|
directive @${config4.argumentsDirective} on FRAGMENT_DEFINITION
|
|
71503
71674
|
|
|
71675
|
+
"""
|
|
71676
|
+
@${config4.withDirective} is used to provide arguments to fragments that have been marked with @${config4.argumentsDirective}
|
|
71677
|
+
"""
|
|
71678
|
+
directive @${config4.withDirective} on FRAGMENT_SPREAD
|
|
71679
|
+
|
|
71504
71680
|
"""
|
|
71505
71681
|
@${config4.cacheDirective} is used to specify cache rules for a query
|
|
71506
71682
|
"""
|
|
@@ -71521,6 +71697,12 @@ directive @${config4.maskEnableDirective} on FRAGMENT_SPREAD
|
|
|
71521
71697
|
"""
|
|
71522
71698
|
directive @${config4.maskDisableDirective} on FRAGMENT_SPREAD
|
|
71523
71699
|
`;
|
|
71700
|
+
for (const plugin2 of config4.plugins) {
|
|
71701
|
+
if (!plugin2.schema) {
|
|
71702
|
+
continue;
|
|
71703
|
+
}
|
|
71704
|
+
internalSchema += plugin2.schema({ config: config4 });
|
|
71705
|
+
}
|
|
71524
71706
|
let currentSchema = graphql22.printSchema(config4.schema);
|
|
71525
71707
|
if (!currentSchema.includes(`directive @${config4.listDirective}`)) {
|
|
71526
71708
|
currentSchema += internalSchema;
|
|
@@ -71703,7 +71885,7 @@ async function typeCheck(config4, docs) {
|
|
|
71703
71885
|
}
|
|
71704
71886
|
needsParent = needsParent || definition.kind === "FragmentDefinition";
|
|
71705
71887
|
const nameArg = directive.arguments?.find(
|
|
71706
|
-
({ name
|
|
71888
|
+
({ name }) => name.value === config4.listNameArg
|
|
71707
71889
|
);
|
|
71708
71890
|
if (!nameArg) {
|
|
71709
71891
|
if (directive.name.value === config4.listDirective) {
|
|
@@ -71873,14 +72055,14 @@ var validateLists = ({
|
|
|
71873
72055
|
return;
|
|
71874
72056
|
}
|
|
71875
72057
|
let directive = node.directives?.find(
|
|
71876
|
-
({ name
|
|
72058
|
+
({ name }) => name.value === config4.listParentDirective
|
|
71877
72059
|
);
|
|
71878
72060
|
if (directive) {
|
|
71879
72061
|
return;
|
|
71880
72062
|
}
|
|
71881
72063
|
let parentIdFound = false;
|
|
71882
|
-
directive = node.directives?.find(({ name
|
|
71883
|
-
[config4.listPrependDirective, config4.listAppendDirective].includes(
|
|
72064
|
+
directive = node.directives?.find(({ name }) => [
|
|
72065
|
+
[config4.listPrependDirective, config4.listAppendDirective].includes(name.value)
|
|
71884
72066
|
]);
|
|
71885
72067
|
if (directive) {
|
|
71886
72068
|
let parentArg = directive.arguments?.find(
|
|
@@ -71898,7 +72080,7 @@ var validateLists = ({
|
|
|
71898
72080
|
return;
|
|
71899
72081
|
}
|
|
71900
72082
|
const allLists = node.directives?.find(
|
|
71901
|
-
({ name
|
|
72083
|
+
({ name }) => config4.listAllListsDirective === name.value
|
|
71902
72084
|
);
|
|
71903
72085
|
if (allLists || config4.defaultListTarget === "all") {
|
|
71904
72086
|
return;
|
|
@@ -71920,7 +72102,7 @@ var validateLists = ({
|
|
|
71920
72102
|
);
|
|
71921
72103
|
return;
|
|
71922
72104
|
}
|
|
71923
|
-
if (!config4.isInternalDirective(node)) {
|
|
72105
|
+
if (!config4.isInternalDirective(node.name.value)) {
|
|
71924
72106
|
if (!config4.schema.getDirective(directiveName)) {
|
|
71925
72107
|
ctx.reportError(
|
|
71926
72108
|
new graphql25.GraphQLError(
|
|
@@ -72063,9 +72245,9 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
72063
72245
|
);
|
|
72064
72246
|
} else {
|
|
72065
72247
|
const zipped = appliedArgumentNames.map(
|
|
72066
|
-
(
|
|
72067
|
-
appliedArguments[
|
|
72068
|
-
fragmentArguments2[fragmentName].find((arg) => arg.name ===
|
|
72248
|
+
(name) => [
|
|
72249
|
+
appliedArguments[name],
|
|
72250
|
+
fragmentArguments2[fragmentName].find((arg) => arg.name === name).type
|
|
72069
72251
|
]
|
|
72070
72252
|
);
|
|
72071
72253
|
for (const [applied, target] of zipped) {
|
|
@@ -72391,9 +72573,9 @@ For more information, please visit these links:
|
|
|
72391
72573
|
// src/codegen/validators/uniqueNames.ts
|
|
72392
72574
|
async function uniqueDocumentNames(config4, docs) {
|
|
72393
72575
|
const nameMap = docs.reduce(
|
|
72394
|
-
(acc, { name
|
|
72576
|
+
(acc, { name, filename }) => ({
|
|
72395
72577
|
...acc,
|
|
72396
|
-
[
|
|
72578
|
+
[name]: [...acc[name] || [], filename]
|
|
72397
72579
|
}),
|
|
72398
72580
|
{}
|
|
72399
72581
|
);
|
|
@@ -72440,12 +72622,12 @@ async function noIDAlias(config4, docs) {
|
|
|
72440
72622
|
// src/codegen/validators/plugins.ts
|
|
72441
72623
|
async function validatePlugins(config4, documents) {
|
|
72442
72624
|
let errors = [];
|
|
72443
|
-
for (const
|
|
72444
|
-
if (!
|
|
72625
|
+
for (const plugin2 of config4.plugins) {
|
|
72626
|
+
if (!plugin2.validate) {
|
|
72445
72627
|
continue;
|
|
72446
72628
|
}
|
|
72447
72629
|
try {
|
|
72448
|
-
await
|
|
72630
|
+
await plugin2.validate({ config: config4, documents });
|
|
72449
72631
|
} catch (err) {
|
|
72450
72632
|
errors.push(err);
|
|
72451
72633
|
}
|
|
@@ -72470,40 +72652,55 @@ async function runPipeline2(config4, docs) {
|
|
|
72470
72652
|
new: [],
|
|
72471
72653
|
deleted: []
|
|
72472
72654
|
};
|
|
72473
|
-
const generatePlugins = config4.plugins.filter((
|
|
72655
|
+
const generatePlugins = config4.plugins.filter((plugin2) => plugin2.generate);
|
|
72656
|
+
const after_validate = config4.plugins.filter((plugin2) => plugin2.after_validate).map((plugin2) => plugin2.after_validate);
|
|
72657
|
+
const validate2 = config4.plugins.filter((plugin2) => plugin2.validate).map((plugin2) => plugin2.validate);
|
|
72658
|
+
const before_validate = config4.plugins.filter((plugin2) => plugin2.before_validate).map((plugin2) => plugin2.before_validate);
|
|
72659
|
+
const transform_before_generate = config4.plugins.filter((plugin2) => plugin2.transform_before_generate).map((plugin2) => plugin2.transform_before_generate);
|
|
72660
|
+
const wrapHook = (hooks) => hooks.map(
|
|
72661
|
+
(fn) => (config5, docs2) => fn({
|
|
72662
|
+
config: config5,
|
|
72663
|
+
documents: docs2
|
|
72664
|
+
})
|
|
72665
|
+
);
|
|
72474
72666
|
let error = null;
|
|
72475
72667
|
try {
|
|
72476
72668
|
await runPipeline(
|
|
72477
72669
|
config4,
|
|
72478
72670
|
[
|
|
72671
|
+
graphqlExtensions,
|
|
72672
|
+
...wrapHook(before_validate),
|
|
72479
72673
|
typeCheck,
|
|
72480
72674
|
uniqueDocumentNames,
|
|
72481
72675
|
noIDAlias,
|
|
72482
72676
|
validatePlugins,
|
|
72483
|
-
|
|
72677
|
+
...wrapHook(validate2),
|
|
72678
|
+
...wrapHook(after_validate),
|
|
72484
72679
|
addID,
|
|
72485
72680
|
addTypename,
|
|
72486
72681
|
addListFragments,
|
|
72487
72682
|
paginate,
|
|
72488
72683
|
fragmentVariables,
|
|
72489
72684
|
includeFragmentDefinitions,
|
|
72685
|
+
...wrapHook(transform_before_generate),
|
|
72686
|
+
artifactGenerator(artifactStats),
|
|
72490
72687
|
runtimeGenerator,
|
|
72491
72688
|
writeIndexFile2,
|
|
72492
|
-
artifactGenerator(artifactStats),
|
|
72493
72689
|
typescriptGenerator,
|
|
72494
72690
|
persistOutputGenerator,
|
|
72495
72691
|
schemaGenerator,
|
|
72496
72692
|
...generatePlugins.map(
|
|
72497
|
-
(
|
|
72693
|
+
(plugin2) => async (config5, docs2) => await plugin2.generate({
|
|
72498
72694
|
config: config5,
|
|
72499
72695
|
documents: docs2,
|
|
72500
|
-
plugin_root: config5.pluginDirectory(
|
|
72696
|
+
plugin_root: config5.pluginDirectory(plugin2.name)
|
|
72501
72697
|
})
|
|
72502
72698
|
)
|
|
72503
72699
|
],
|
|
72504
72700
|
docs
|
|
72505
72701
|
);
|
|
72506
72702
|
} catch (e2) {
|
|
72703
|
+
console.log(e2);
|
|
72507
72704
|
error = e2;
|
|
72508
72705
|
}
|
|
72509
72706
|
const unchanged = artifactStats.total.length - artifactStats.changed.length - artifactStats.new.length - artifactStats.deleted.length;
|
|
@@ -72552,15 +72749,19 @@ async function collectDocuments(config4) {
|
|
|
72552
72749
|
".js": [],
|
|
72553
72750
|
".ts": []
|
|
72554
72751
|
};
|
|
72555
|
-
for (const
|
|
72556
|
-
if (
|
|
72557
|
-
for (const extension of
|
|
72558
|
-
extractors[extension] = [...extractors[extension] || [],
|
|
72752
|
+
for (const plugin2 of config4.plugins) {
|
|
72753
|
+
if (plugin2.extensions && plugin2.extract_documents) {
|
|
72754
|
+
for (const extension of plugin2.extensions) {
|
|
72755
|
+
extractors[extension] = [...extractors[extension] || [], plugin2.extract_documents];
|
|
72559
72756
|
}
|
|
72560
72757
|
}
|
|
72561
72758
|
}
|
|
72562
|
-
const graphql_extractor = (
|
|
72563
|
-
|
|
72759
|
+
const graphql_extractor = ({
|
|
72760
|
+
content
|
|
72761
|
+
}) => [content];
|
|
72762
|
+
const javascript_extractor = ({
|
|
72763
|
+
content
|
|
72764
|
+
}) => processJSFile(config4, content);
|
|
72564
72765
|
extractors[".ts"].push(javascript_extractor);
|
|
72565
72766
|
extractors[".js"].push(javascript_extractor);
|
|
72566
72767
|
extractors[".graphql"].push(graphql_extractor);
|
|
@@ -72584,8 +72785,8 @@ async function collectDocuments(config4) {
|
|
|
72584
72785
|
if (!extractor) {
|
|
72585
72786
|
continue;
|
|
72586
72787
|
}
|
|
72587
|
-
const found = await extractor(config4, filepath, contents);
|
|
72588
|
-
if (found.length > 0) {
|
|
72788
|
+
const found = await extractor({ config: config4, filepath, content: contents });
|
|
72789
|
+
if (found && found.length > 0) {
|
|
72589
72790
|
documents.push(...found.map((document) => ({ filepath, document })));
|
|
72590
72791
|
}
|
|
72591
72792
|
}
|
|
@@ -72615,12 +72816,7 @@ async function processJSFile(config4, contents) {
|
|
|
72615
72816
|
return documents;
|
|
72616
72817
|
}
|
|
72617
72818
|
async function processGraphQLDocument(config4, filepath, document) {
|
|
72618
|
-
|
|
72619
|
-
var parsedDoc = graphql27.parse(document);
|
|
72620
|
-
} catch (e2) {
|
|
72621
|
-
console.log("error parsing!!");
|
|
72622
|
-
throw e2;
|
|
72623
|
-
}
|
|
72819
|
+
const parsedDoc = graphql27.parse(document);
|
|
72624
72820
|
const operations = parsedDoc.definitions.filter(
|
|
72625
72821
|
({ kind: kind2 }) => kind2 === graphql27.Kind.OPERATION_DEFINITION
|
|
72626
72822
|
);
|
|
@@ -72658,40 +72854,41 @@ async function processGraphQLDocument(config4, filepath, document) {
|
|
|
72658
72854
|
originalDocument: parsedDoc,
|
|
72659
72855
|
generateArtifact: true,
|
|
72660
72856
|
generateStore: true,
|
|
72661
|
-
originalString: document
|
|
72857
|
+
originalString: document,
|
|
72858
|
+
artifact: null
|
|
72662
72859
|
};
|
|
72663
72860
|
}
|
|
72664
|
-
function logStyled(kind, stat3, logLevel,
|
|
72861
|
+
function logStyled(kind, stat3, logLevel, plugin2) {
|
|
72665
72862
|
if (stat3.length > 0) {
|
|
72666
72863
|
const msg = [];
|
|
72667
|
-
if (
|
|
72864
|
+
if (plugin2) {
|
|
72668
72865
|
msg.push(`\u{1F3A9} `);
|
|
72669
72866
|
}
|
|
72670
72867
|
if (kind === "CREATED") {
|
|
72671
72868
|
msg.push(`\u2728 `);
|
|
72672
|
-
if (!
|
|
72869
|
+
if (!plugin2) {
|
|
72673
72870
|
msg.push(`New: ${stat3.length}`);
|
|
72674
72871
|
}
|
|
72675
72872
|
} else if (kind === "UPDATED") {
|
|
72676
72873
|
msg.push(`\u270F\uFE0F `);
|
|
72677
|
-
if (!
|
|
72874
|
+
if (!plugin2) {
|
|
72678
72875
|
msg.push(`Changed: ${stat3.length}`);
|
|
72679
72876
|
}
|
|
72680
72877
|
} else if (kind === "DELETED") {
|
|
72681
72878
|
msg.push(`\u{1F9F9} `);
|
|
72682
|
-
if (!
|
|
72879
|
+
if (!plugin2) {
|
|
72683
72880
|
msg.push(`Deleted: ${stat3.length}`);
|
|
72684
72881
|
}
|
|
72685
72882
|
}
|
|
72686
72883
|
const nbToDisplay = 5;
|
|
72687
|
-
if (
|
|
72884
|
+
if (plugin2) {
|
|
72688
72885
|
msg.push(`${stat3.slice(0, nbToDisplay).join(", ")}`);
|
|
72689
72886
|
if (stat3.length > 5) {
|
|
72690
72887
|
msg.push(`, ... ${stat3.length - nbToDisplay} more`);
|
|
72691
72888
|
}
|
|
72692
72889
|
}
|
|
72693
72890
|
console.log(msg.join(""));
|
|
72694
|
-
if (!
|
|
72891
|
+
if (!plugin2 && logLevel === "summary" /* Summary */) {
|
|
72695
72892
|
for (const artifact of stat3.slice(0, nbToDisplay)) {
|
|
72696
72893
|
console.log(` ${artifact}`);
|
|
72697
72894
|
}
|
|
@@ -72741,32 +72938,32 @@ function Plugin(opts = {}) {
|
|
|
72741
72938
|
config: config3,
|
|
72742
72939
|
filepath
|
|
72743
72940
|
};
|
|
72744
|
-
for (const
|
|
72745
|
-
if (!
|
|
72941
|
+
for (const plugin2 of config3.plugins) {
|
|
72942
|
+
if (!plugin2.transform_file) {
|
|
72746
72943
|
continue;
|
|
72747
72944
|
}
|
|
72748
|
-
const { code: code2 } = await
|
|
72945
|
+
const { code: code2 } = await plugin2.transform_file(ctx);
|
|
72749
72946
|
ctx.content = code2;
|
|
72750
72947
|
}
|
|
72751
72948
|
return { code: ctx.content };
|
|
72752
72949
|
},
|
|
72753
72950
|
async load(id, opts2, ...rest) {
|
|
72754
|
-
for (const
|
|
72755
|
-
if (typeof
|
|
72951
|
+
for (const plugin2 of config3.plugins) {
|
|
72952
|
+
if (typeof plugin2.vite?.load !== "function") {
|
|
72756
72953
|
continue;
|
|
72757
72954
|
}
|
|
72758
|
-
const result = await
|
|
72955
|
+
const result = await plugin2.vite.load.call(this, id, { ...opts2, config: config3 }, ...rest);
|
|
72759
72956
|
if (result) {
|
|
72760
72957
|
return result;
|
|
72761
72958
|
}
|
|
72762
72959
|
}
|
|
72763
72960
|
},
|
|
72764
72961
|
async resolveId(id, two, opts2, ...rest) {
|
|
72765
|
-
for (const
|
|
72766
|
-
if (typeof
|
|
72962
|
+
for (const plugin2 of config3.plugins) {
|
|
72963
|
+
if (typeof plugin2.vite?.resolveId !== "function") {
|
|
72767
72964
|
continue;
|
|
72768
72965
|
}
|
|
72769
|
-
const result = await
|
|
72966
|
+
const result = await plugin2.vite.resolveId.call(
|
|
72770
72967
|
this,
|
|
72771
72968
|
id,
|
|
72772
72969
|
two,
|
|
@@ -72846,7 +73043,7 @@ function find_insert_index(script) {
|
|
|
72846
73043
|
}
|
|
72847
73044
|
return insert_index;
|
|
72848
73045
|
}
|
|
72849
|
-
function find_exported_fn(body,
|
|
73046
|
+
function find_exported_fn(body, name) {
|
|
72850
73047
|
for (const statement of body) {
|
|
72851
73048
|
if (statement.type !== "ExportNamedDeclaration") {
|
|
72852
73049
|
continue;
|
|
@@ -72854,12 +73051,12 @@ function find_exported_fn(body, name2) {
|
|
|
72854
73051
|
const exportDeclaration = statement;
|
|
72855
73052
|
if (exportDeclaration.declaration?.type === "FunctionDeclaration") {
|
|
72856
73053
|
const value = exportDeclaration.declaration;
|
|
72857
|
-
if (value.id?.name ===
|
|
73054
|
+
if (value.id?.name === name) {
|
|
72858
73055
|
return exportDeclaration.declaration;
|
|
72859
73056
|
}
|
|
72860
73057
|
} else if (exportDeclaration.declaration?.type === "VariableDeclaration") {
|
|
72861
73058
|
const value = exportDeclaration.declaration;
|
|
72862
|
-
if (value.declarations.length !== 1 || value.declarations[0].type !== "VariableDeclarator" || value.declarations[0].id.type !== "Identifier" || value.declarations[0].id.name !==
|
|
73059
|
+
if (value.declarations.length !== 1 || value.declarations[0].type !== "VariableDeclarator" || value.declarations[0].id.type !== "Identifier" || value.declarations[0].id.name !== name) {
|
|
72863
73060
|
continue;
|
|
72864
73061
|
}
|
|
72865
73062
|
const declaration = value.declarations[0];
|
|
@@ -72878,16 +73075,16 @@ function find_exported_fn(body, name2) {
|
|
|
72878
73075
|
}
|
|
72879
73076
|
}
|
|
72880
73077
|
const exported = body.find(
|
|
72881
|
-
(expression) => expression.type === "ExportNamedDeclaration" && (expression.declaration?.type === "FunctionDeclaration" && expression.declaration.id?.name ===
|
|
73078
|
+
(expression) => expression.type === "ExportNamedDeclaration" && (expression.declaration?.type === "FunctionDeclaration" && expression.declaration.id?.name === name || expression.declaration?.type === "VariableDeclaration" && expression.declaration.declarations.length === 1 && expression.declaration.declarations[0].type === "Identifier" && expression.declaration.declarations[0].name === name)
|
|
72882
73079
|
);
|
|
72883
73080
|
if (!exported) {
|
|
72884
73081
|
return null;
|
|
72885
73082
|
}
|
|
72886
73083
|
return exported.declaration;
|
|
72887
73084
|
}
|
|
72888
|
-
function find_exported_id(program,
|
|
73085
|
+
function find_exported_id(program, name) {
|
|
72889
73086
|
return program.body.find(
|
|
72890
|
-
(statement) => statement.type === "ExportNamedDeclaration" && statement.declaration?.type === "VariableDeclaration" && statement.declaration.declarations.length === 1 && statement.declaration.declarations[0].type === "VariableDeclarator" && statement.declaration.declarations[0].id.type === "Identifier" && statement.declaration.declarations[0].id.name ===
|
|
73087
|
+
(statement) => statement.type === "ExportNamedDeclaration" && statement.declaration?.type === "VariableDeclaration" && statement.declaration.declarations.length === 1 && statement.declaration.declarations[0].type === "VariableDeclarator" && statement.declaration.declarations[0].id.type === "Identifier" && statement.declaration.declarations[0].id.name === name
|
|
72891
73088
|
);
|
|
72892
73089
|
}
|
|
72893
73090
|
|