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-esm/index.js
CHANGED
|
@@ -19,8 +19,8 @@ var __commonJS = (cb, mod) => function __require2() {
|
|
|
19
19
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
20
20
|
};
|
|
21
21
|
var __export = (target, all) => {
|
|
22
|
-
for (var
|
|
23
|
-
__defProp(target,
|
|
22
|
+
for (var name in all)
|
|
23
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
24
24
|
};
|
|
25
25
|
var __copyProps = (to, from, except, desc) => {
|
|
26
26
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -4991,9 +4991,9 @@ var require_inspect = __commonJS({
|
|
|
4991
4991
|
function getObjectTag2(object) {
|
|
4992
4992
|
var tag = Object.prototype.toString.call(object).replace(/^\[object /, "").replace(/]$/, "");
|
|
4993
4993
|
if (tag === "Object" && typeof object.constructor === "function") {
|
|
4994
|
-
var
|
|
4995
|
-
if (typeof
|
|
4996
|
-
return
|
|
4994
|
+
var name = object.constructor.name;
|
|
4995
|
+
if (typeof name === "string" && name !== "") {
|
|
4996
|
+
return name;
|
|
4997
4997
|
}
|
|
4998
4998
|
}
|
|
4999
4999
|
return tag;
|
|
@@ -5099,14 +5099,14 @@ var require_source = __commonJS({
|
|
|
5099
5099
|
}
|
|
5100
5100
|
var Source3 = /* @__PURE__ */ function() {
|
|
5101
5101
|
function Source4(body) {
|
|
5102
|
-
var
|
|
5102
|
+
var name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "GraphQL request";
|
|
5103
5103
|
var locationOffset = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
5104
5104
|
line: 1,
|
|
5105
5105
|
column: 1
|
|
5106
5106
|
};
|
|
5107
5107
|
typeof body === "string" || (0, _devAssert.default)(0, "Body must be a string. Received: ".concat((0, _inspect.default)(body), "."));
|
|
5108
5108
|
this.body = body;
|
|
5109
|
-
this.name =
|
|
5109
|
+
this.name = name;
|
|
5110
5110
|
this.locationOffset = locationOffset;
|
|
5111
5111
|
this.locationOffset.line > 0 || (0, _devAssert.default)(0, "line in locationOffset is 1-indexed and must be positive.");
|
|
5112
5112
|
this.locationOffset.column > 0 || (0, _devAssert.default)(0, "column in locationOffset is 1-indexed and must be positive.");
|
|
@@ -5722,14 +5722,14 @@ var require_parser = __commonJS({
|
|
|
5722
5722
|
};
|
|
5723
5723
|
}
|
|
5724
5724
|
var operation = this.parseOperationType();
|
|
5725
|
-
var
|
|
5725
|
+
var name;
|
|
5726
5726
|
if (this.peek(_tokenKind.TokenKind.NAME)) {
|
|
5727
|
-
|
|
5727
|
+
name = this.parseName();
|
|
5728
5728
|
}
|
|
5729
5729
|
return {
|
|
5730
5730
|
kind: _kinds.Kind.OPERATION_DEFINITION,
|
|
5731
5731
|
operation,
|
|
5732
|
-
name
|
|
5732
|
+
name,
|
|
5733
5733
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
5734
5734
|
directives: this.parseDirectives(false),
|
|
5735
5735
|
selectionSet: this.parseSelectionSet(),
|
|
@@ -5786,17 +5786,17 @@ var require_parser = __commonJS({
|
|
|
5786
5786
|
var start = this._lexer.token;
|
|
5787
5787
|
var nameOrAlias = this.parseName();
|
|
5788
5788
|
var alias;
|
|
5789
|
-
var
|
|
5789
|
+
var name;
|
|
5790
5790
|
if (this.expectOptionalToken(_tokenKind.TokenKind.COLON)) {
|
|
5791
5791
|
alias = nameOrAlias;
|
|
5792
|
-
|
|
5792
|
+
name = this.parseName();
|
|
5793
5793
|
} else {
|
|
5794
|
-
|
|
5794
|
+
name = nameOrAlias;
|
|
5795
5795
|
}
|
|
5796
5796
|
return {
|
|
5797
5797
|
kind: _kinds.Kind.FIELD,
|
|
5798
5798
|
alias,
|
|
5799
|
-
name
|
|
5799
|
+
name,
|
|
5800
5800
|
arguments: this.parseArguments(false),
|
|
5801
5801
|
directives: this.parseDirectives(false),
|
|
5802
5802
|
selectionSet: this.peek(_tokenKind.TokenKind.BRACE_L) ? this.parseSelectionSet() : void 0,
|
|
@@ -5809,11 +5809,11 @@ var require_parser = __commonJS({
|
|
|
5809
5809
|
};
|
|
5810
5810
|
_proto.parseArgument = function parseArgument() {
|
|
5811
5811
|
var start = this._lexer.token;
|
|
5812
|
-
var
|
|
5812
|
+
var name = this.parseName();
|
|
5813
5813
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
5814
5814
|
return {
|
|
5815
5815
|
kind: _kinds.Kind.ARGUMENT,
|
|
5816
|
-
name
|
|
5816
|
+
name,
|
|
5817
5817
|
value: this.parseValueLiteral(false),
|
|
5818
5818
|
loc: this.loc(start)
|
|
5819
5819
|
};
|
|
@@ -5972,11 +5972,11 @@ var require_parser = __commonJS({
|
|
|
5972
5972
|
};
|
|
5973
5973
|
_proto.parseObjectField = function parseObjectField(isConst) {
|
|
5974
5974
|
var start = this._lexer.token;
|
|
5975
|
-
var
|
|
5975
|
+
var name = this.parseName();
|
|
5976
5976
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
5977
5977
|
return {
|
|
5978
5978
|
kind: _kinds.Kind.OBJECT_FIELD,
|
|
5979
|
-
name
|
|
5979
|
+
name,
|
|
5980
5980
|
value: this.parseValueLiteral(isConst),
|
|
5981
5981
|
loc: this.loc(start)
|
|
5982
5982
|
};
|
|
@@ -6091,12 +6091,12 @@ var require_parser = __commonJS({
|
|
|
6091
6091
|
var start = this._lexer.token;
|
|
6092
6092
|
var description = this.parseDescription();
|
|
6093
6093
|
this.expectKeyword("scalar");
|
|
6094
|
-
var
|
|
6094
|
+
var name = this.parseName();
|
|
6095
6095
|
var directives = this.parseDirectives(true);
|
|
6096
6096
|
return {
|
|
6097
6097
|
kind: _kinds.Kind.SCALAR_TYPE_DEFINITION,
|
|
6098
6098
|
description,
|
|
6099
|
-
name
|
|
6099
|
+
name,
|
|
6100
6100
|
directives,
|
|
6101
6101
|
loc: this.loc(start)
|
|
6102
6102
|
};
|
|
@@ -6105,14 +6105,14 @@ var require_parser = __commonJS({
|
|
|
6105
6105
|
var start = this._lexer.token;
|
|
6106
6106
|
var description = this.parseDescription();
|
|
6107
6107
|
this.expectKeyword("type");
|
|
6108
|
-
var
|
|
6108
|
+
var name = this.parseName();
|
|
6109
6109
|
var interfaces = this.parseImplementsInterfaces();
|
|
6110
6110
|
var directives = this.parseDirectives(true);
|
|
6111
6111
|
var fields = this.parseFieldsDefinition();
|
|
6112
6112
|
return {
|
|
6113
6113
|
kind: _kinds.Kind.OBJECT_TYPE_DEFINITION,
|
|
6114
6114
|
description,
|
|
6115
|
-
name
|
|
6115
|
+
name,
|
|
6116
6116
|
interfaces,
|
|
6117
6117
|
directives,
|
|
6118
6118
|
fields,
|
|
@@ -6146,7 +6146,7 @@ var require_parser = __commonJS({
|
|
|
6146
6146
|
_proto.parseFieldDefinition = function parseFieldDefinition() {
|
|
6147
6147
|
var start = this._lexer.token;
|
|
6148
6148
|
var description = this.parseDescription();
|
|
6149
|
-
var
|
|
6149
|
+
var name = this.parseName();
|
|
6150
6150
|
var args = this.parseArgumentDefs();
|
|
6151
6151
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
6152
6152
|
var type = this.parseTypeReference();
|
|
@@ -6154,7 +6154,7 @@ var require_parser = __commonJS({
|
|
|
6154
6154
|
return {
|
|
6155
6155
|
kind: _kinds.Kind.FIELD_DEFINITION,
|
|
6156
6156
|
description,
|
|
6157
|
-
name
|
|
6157
|
+
name,
|
|
6158
6158
|
arguments: args,
|
|
6159
6159
|
type,
|
|
6160
6160
|
directives,
|
|
@@ -6167,7 +6167,7 @@ var require_parser = __commonJS({
|
|
|
6167
6167
|
_proto.parseInputValueDef = function parseInputValueDef() {
|
|
6168
6168
|
var start = this._lexer.token;
|
|
6169
6169
|
var description = this.parseDescription();
|
|
6170
|
-
var
|
|
6170
|
+
var name = this.parseName();
|
|
6171
6171
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
6172
6172
|
var type = this.parseTypeReference();
|
|
6173
6173
|
var defaultValue;
|
|
@@ -6178,7 +6178,7 @@ var require_parser = __commonJS({
|
|
|
6178
6178
|
return {
|
|
6179
6179
|
kind: _kinds.Kind.INPUT_VALUE_DEFINITION,
|
|
6180
6180
|
description,
|
|
6181
|
-
name
|
|
6181
|
+
name,
|
|
6182
6182
|
type,
|
|
6183
6183
|
defaultValue,
|
|
6184
6184
|
directives,
|
|
@@ -6189,14 +6189,14 @@ var require_parser = __commonJS({
|
|
|
6189
6189
|
var start = this._lexer.token;
|
|
6190
6190
|
var description = this.parseDescription();
|
|
6191
6191
|
this.expectKeyword("interface");
|
|
6192
|
-
var
|
|
6192
|
+
var name = this.parseName();
|
|
6193
6193
|
var interfaces = this.parseImplementsInterfaces();
|
|
6194
6194
|
var directives = this.parseDirectives(true);
|
|
6195
6195
|
var fields = this.parseFieldsDefinition();
|
|
6196
6196
|
return {
|
|
6197
6197
|
kind: _kinds.Kind.INTERFACE_TYPE_DEFINITION,
|
|
6198
6198
|
description,
|
|
6199
|
-
name
|
|
6199
|
+
name,
|
|
6200
6200
|
interfaces,
|
|
6201
6201
|
directives,
|
|
6202
6202
|
fields,
|
|
@@ -6207,13 +6207,13 @@ var require_parser = __commonJS({
|
|
|
6207
6207
|
var start = this._lexer.token;
|
|
6208
6208
|
var description = this.parseDescription();
|
|
6209
6209
|
this.expectKeyword("union");
|
|
6210
|
-
var
|
|
6210
|
+
var name = this.parseName();
|
|
6211
6211
|
var directives = this.parseDirectives(true);
|
|
6212
6212
|
var types17 = this.parseUnionMemberTypes();
|
|
6213
6213
|
return {
|
|
6214
6214
|
kind: _kinds.Kind.UNION_TYPE_DEFINITION,
|
|
6215
6215
|
description,
|
|
6216
|
-
name
|
|
6216
|
+
name,
|
|
6217
6217
|
directives,
|
|
6218
6218
|
types: types17,
|
|
6219
6219
|
loc: this.loc(start)
|
|
@@ -6226,13 +6226,13 @@ var require_parser = __commonJS({
|
|
|
6226
6226
|
var start = this._lexer.token;
|
|
6227
6227
|
var description = this.parseDescription();
|
|
6228
6228
|
this.expectKeyword("enum");
|
|
6229
|
-
var
|
|
6229
|
+
var name = this.parseName();
|
|
6230
6230
|
var directives = this.parseDirectives(true);
|
|
6231
6231
|
var values = this.parseEnumValuesDefinition();
|
|
6232
6232
|
return {
|
|
6233
6233
|
kind: _kinds.Kind.ENUM_TYPE_DEFINITION,
|
|
6234
6234
|
description,
|
|
6235
|
-
name
|
|
6235
|
+
name,
|
|
6236
6236
|
directives,
|
|
6237
6237
|
values,
|
|
6238
6238
|
loc: this.loc(start)
|
|
@@ -6244,12 +6244,12 @@ var require_parser = __commonJS({
|
|
|
6244
6244
|
_proto.parseEnumValueDefinition = function parseEnumValueDefinition() {
|
|
6245
6245
|
var start = this._lexer.token;
|
|
6246
6246
|
var description = this.parseDescription();
|
|
6247
|
-
var
|
|
6247
|
+
var name = this.parseName();
|
|
6248
6248
|
var directives = this.parseDirectives(true);
|
|
6249
6249
|
return {
|
|
6250
6250
|
kind: _kinds.Kind.ENUM_VALUE_DEFINITION,
|
|
6251
6251
|
description,
|
|
6252
|
-
name
|
|
6252
|
+
name,
|
|
6253
6253
|
directives,
|
|
6254
6254
|
loc: this.loc(start)
|
|
6255
6255
|
};
|
|
@@ -6258,13 +6258,13 @@ var require_parser = __commonJS({
|
|
|
6258
6258
|
var start = this._lexer.token;
|
|
6259
6259
|
var description = this.parseDescription();
|
|
6260
6260
|
this.expectKeyword("input");
|
|
6261
|
-
var
|
|
6261
|
+
var name = this.parseName();
|
|
6262
6262
|
var directives = this.parseDirectives(true);
|
|
6263
6263
|
var fields = this.parseInputFieldsDefinition();
|
|
6264
6264
|
return {
|
|
6265
6265
|
kind: _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION,
|
|
6266
6266
|
description,
|
|
6267
|
-
name
|
|
6267
|
+
name,
|
|
6268
6268
|
directives,
|
|
6269
6269
|
fields,
|
|
6270
6270
|
loc: this.loc(start)
|
|
@@ -6315,14 +6315,14 @@ var require_parser = __commonJS({
|
|
|
6315
6315
|
var start = this._lexer.token;
|
|
6316
6316
|
this.expectKeyword("extend");
|
|
6317
6317
|
this.expectKeyword("scalar");
|
|
6318
|
-
var
|
|
6318
|
+
var name = this.parseName();
|
|
6319
6319
|
var directives = this.parseDirectives(true);
|
|
6320
6320
|
if (directives.length === 0) {
|
|
6321
6321
|
throw this.unexpected();
|
|
6322
6322
|
}
|
|
6323
6323
|
return {
|
|
6324
6324
|
kind: _kinds.Kind.SCALAR_TYPE_EXTENSION,
|
|
6325
|
-
name
|
|
6325
|
+
name,
|
|
6326
6326
|
directives,
|
|
6327
6327
|
loc: this.loc(start)
|
|
6328
6328
|
};
|
|
@@ -6331,7 +6331,7 @@ var require_parser = __commonJS({
|
|
|
6331
6331
|
var start = this._lexer.token;
|
|
6332
6332
|
this.expectKeyword("extend");
|
|
6333
6333
|
this.expectKeyword("type");
|
|
6334
|
-
var
|
|
6334
|
+
var name = this.parseName();
|
|
6335
6335
|
var interfaces = this.parseImplementsInterfaces();
|
|
6336
6336
|
var directives = this.parseDirectives(true);
|
|
6337
6337
|
var fields = this.parseFieldsDefinition();
|
|
@@ -6340,7 +6340,7 @@ var require_parser = __commonJS({
|
|
|
6340
6340
|
}
|
|
6341
6341
|
return {
|
|
6342
6342
|
kind: _kinds.Kind.OBJECT_TYPE_EXTENSION,
|
|
6343
|
-
name
|
|
6343
|
+
name,
|
|
6344
6344
|
interfaces,
|
|
6345
6345
|
directives,
|
|
6346
6346
|
fields,
|
|
@@ -6351,7 +6351,7 @@ var require_parser = __commonJS({
|
|
|
6351
6351
|
var start = this._lexer.token;
|
|
6352
6352
|
this.expectKeyword("extend");
|
|
6353
6353
|
this.expectKeyword("interface");
|
|
6354
|
-
var
|
|
6354
|
+
var name = this.parseName();
|
|
6355
6355
|
var interfaces = this.parseImplementsInterfaces();
|
|
6356
6356
|
var directives = this.parseDirectives(true);
|
|
6357
6357
|
var fields = this.parseFieldsDefinition();
|
|
@@ -6360,7 +6360,7 @@ var require_parser = __commonJS({
|
|
|
6360
6360
|
}
|
|
6361
6361
|
return {
|
|
6362
6362
|
kind: _kinds.Kind.INTERFACE_TYPE_EXTENSION,
|
|
6363
|
-
name
|
|
6363
|
+
name,
|
|
6364
6364
|
interfaces,
|
|
6365
6365
|
directives,
|
|
6366
6366
|
fields,
|
|
@@ -6371,7 +6371,7 @@ var require_parser = __commonJS({
|
|
|
6371
6371
|
var start = this._lexer.token;
|
|
6372
6372
|
this.expectKeyword("extend");
|
|
6373
6373
|
this.expectKeyword("union");
|
|
6374
|
-
var
|
|
6374
|
+
var name = this.parseName();
|
|
6375
6375
|
var directives = this.parseDirectives(true);
|
|
6376
6376
|
var types17 = this.parseUnionMemberTypes();
|
|
6377
6377
|
if (directives.length === 0 && types17.length === 0) {
|
|
@@ -6379,7 +6379,7 @@ var require_parser = __commonJS({
|
|
|
6379
6379
|
}
|
|
6380
6380
|
return {
|
|
6381
6381
|
kind: _kinds.Kind.UNION_TYPE_EXTENSION,
|
|
6382
|
-
name
|
|
6382
|
+
name,
|
|
6383
6383
|
directives,
|
|
6384
6384
|
types: types17,
|
|
6385
6385
|
loc: this.loc(start)
|
|
@@ -6389,7 +6389,7 @@ var require_parser = __commonJS({
|
|
|
6389
6389
|
var start = this._lexer.token;
|
|
6390
6390
|
this.expectKeyword("extend");
|
|
6391
6391
|
this.expectKeyword("enum");
|
|
6392
|
-
var
|
|
6392
|
+
var name = this.parseName();
|
|
6393
6393
|
var directives = this.parseDirectives(true);
|
|
6394
6394
|
var values = this.parseEnumValuesDefinition();
|
|
6395
6395
|
if (directives.length === 0 && values.length === 0) {
|
|
@@ -6397,7 +6397,7 @@ var require_parser = __commonJS({
|
|
|
6397
6397
|
}
|
|
6398
6398
|
return {
|
|
6399
6399
|
kind: _kinds.Kind.ENUM_TYPE_EXTENSION,
|
|
6400
|
-
name
|
|
6400
|
+
name,
|
|
6401
6401
|
directives,
|
|
6402
6402
|
values,
|
|
6403
6403
|
loc: this.loc(start)
|
|
@@ -6407,7 +6407,7 @@ var require_parser = __commonJS({
|
|
|
6407
6407
|
var start = this._lexer.token;
|
|
6408
6408
|
this.expectKeyword("extend");
|
|
6409
6409
|
this.expectKeyword("input");
|
|
6410
|
-
var
|
|
6410
|
+
var name = this.parseName();
|
|
6411
6411
|
var directives = this.parseDirectives(true);
|
|
6412
6412
|
var fields = this.parseInputFieldsDefinition();
|
|
6413
6413
|
if (directives.length === 0 && fields.length === 0) {
|
|
@@ -6415,7 +6415,7 @@ var require_parser = __commonJS({
|
|
|
6415
6415
|
}
|
|
6416
6416
|
return {
|
|
6417
6417
|
kind: _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION,
|
|
6418
|
-
name
|
|
6418
|
+
name,
|
|
6419
6419
|
directives,
|
|
6420
6420
|
fields,
|
|
6421
6421
|
loc: this.loc(start)
|
|
@@ -6426,7 +6426,7 @@ var require_parser = __commonJS({
|
|
|
6426
6426
|
var description = this.parseDescription();
|
|
6427
6427
|
this.expectKeyword("directive");
|
|
6428
6428
|
this.expectToken(_tokenKind.TokenKind.AT);
|
|
6429
|
-
var
|
|
6429
|
+
var name = this.parseName();
|
|
6430
6430
|
var args = this.parseArgumentDefs();
|
|
6431
6431
|
var repeatable = this.expectOptionalKeyword("repeatable");
|
|
6432
6432
|
this.expectKeyword("on");
|
|
@@ -6434,7 +6434,7 @@ var require_parser = __commonJS({
|
|
|
6434
6434
|
return {
|
|
6435
6435
|
kind: _kinds.Kind.DIRECTIVE_DEFINITION,
|
|
6436
6436
|
description,
|
|
6437
|
-
name
|
|
6437
|
+
name,
|
|
6438
6438
|
arguments: args,
|
|
6439
6439
|
repeatable,
|
|
6440
6440
|
locations,
|
|
@@ -6446,9 +6446,9 @@ var require_parser = __commonJS({
|
|
|
6446
6446
|
};
|
|
6447
6447
|
_proto.parseDirectiveLocation = function parseDirectiveLocation() {
|
|
6448
6448
|
var start = this._lexer.token;
|
|
6449
|
-
var
|
|
6450
|
-
if (_directiveLocation.DirectiveLocation[
|
|
6451
|
-
return
|
|
6449
|
+
var name = this.parseName();
|
|
6450
|
+
if (_directiveLocation.DirectiveLocation[name.value] !== void 0) {
|
|
6451
|
+
return name;
|
|
6452
6452
|
}
|
|
6453
6453
|
throw this.unexpected(start);
|
|
6454
6454
|
};
|
|
@@ -6887,20 +6887,20 @@ var require_assertValidName = __commonJS({
|
|
|
6887
6887
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
6888
6888
|
}
|
|
6889
6889
|
var NAME_RX = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
6890
|
-
function assertValidName(
|
|
6891
|
-
var error = isValidNameError(
|
|
6890
|
+
function assertValidName(name) {
|
|
6891
|
+
var error = isValidNameError(name);
|
|
6892
6892
|
if (error) {
|
|
6893
6893
|
throw error;
|
|
6894
6894
|
}
|
|
6895
|
-
return
|
|
6895
|
+
return name;
|
|
6896
6896
|
}
|
|
6897
|
-
function isValidNameError(
|
|
6898
|
-
typeof
|
|
6899
|
-
if (
|
|
6900
|
-
return new _GraphQLError.GraphQLError('Name "'.concat(
|
|
6897
|
+
function isValidNameError(name) {
|
|
6898
|
+
typeof name === "string" || (0, _devAssert.default)(0, "Expected name to be a string.");
|
|
6899
|
+
if (name.length > 1 && name[0] === "_" && name[1] === "_") {
|
|
6900
|
+
return new _GraphQLError.GraphQLError('Name "'.concat(name, '" must not begin with "__", which is reserved by GraphQL introspection.'));
|
|
6901
6901
|
}
|
|
6902
|
-
if (!NAME_RX.test(
|
|
6903
|
-
return new _GraphQLError.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'.concat(
|
|
6902
|
+
if (!NAME_RX.test(name)) {
|
|
6903
|
+
return new _GraphQLError.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'.concat(name, '" does not.'));
|
|
6904
6904
|
}
|
|
6905
6905
|
}
|
|
6906
6906
|
}
|
|
@@ -7240,11 +7240,11 @@ var require_printer = __commonJS({
|
|
|
7240
7240
|
},
|
|
7241
7241
|
OperationDefinition: function OperationDefinition(node) {
|
|
7242
7242
|
var op = node.operation;
|
|
7243
|
-
var
|
|
7243
|
+
var name = node.name;
|
|
7244
7244
|
var varDefs = wrap2("(", join3(node.variableDefinitions, ", "), ")");
|
|
7245
7245
|
var directives = join3(node.directives, " ");
|
|
7246
7246
|
var selectionSet = node.selectionSet;
|
|
7247
|
-
return !
|
|
7247
|
+
return !name && !directives && !varDefs && op === "query" ? selectionSet : join3([op, join3([name, varDefs]), directives, selectionSet], " ");
|
|
7248
7248
|
},
|
|
7249
7249
|
VariableDefinition: function VariableDefinition(_ref) {
|
|
7250
7250
|
var variable = _ref.variable, type = _ref.type, defaultValue = _ref.defaultValue, directives = _ref.directives;
|
|
@@ -7255,8 +7255,8 @@ var require_printer = __commonJS({
|
|
|
7255
7255
|
return block2(selections);
|
|
7256
7256
|
},
|
|
7257
7257
|
Field: function Field(_ref3) {
|
|
7258
|
-
var alias = _ref3.alias,
|
|
7259
|
-
var prefix = wrap2("", alias, ": ") +
|
|
7258
|
+
var alias = _ref3.alias, name = _ref3.name, args = _ref3.arguments, directives = _ref3.directives, selectionSet = _ref3.selectionSet;
|
|
7259
|
+
var prefix = wrap2("", alias, ": ") + name;
|
|
7260
7260
|
var argsLine = prefix + wrap2("(", join3(args, ", "), ")");
|
|
7261
7261
|
if (argsLine.length > MAX_LINE_LENGTH2) {
|
|
7262
7262
|
argsLine = prefix + wrap2("(\n", indent2(join3(args, "\n")), "\n)");
|
|
@@ -7264,20 +7264,20 @@ var require_printer = __commonJS({
|
|
|
7264
7264
|
return join3([argsLine, join3(directives, " "), selectionSet], " ");
|
|
7265
7265
|
},
|
|
7266
7266
|
Argument: function Argument(_ref4) {
|
|
7267
|
-
var
|
|
7268
|
-
return
|
|
7267
|
+
var name = _ref4.name, value = _ref4.value;
|
|
7268
|
+
return name + ": " + value;
|
|
7269
7269
|
},
|
|
7270
7270
|
FragmentSpread: function FragmentSpread(_ref5) {
|
|
7271
|
-
var
|
|
7272
|
-
return "..." +
|
|
7271
|
+
var name = _ref5.name, directives = _ref5.directives;
|
|
7272
|
+
return "..." + name + wrap2(" ", join3(directives, " "));
|
|
7273
7273
|
},
|
|
7274
7274
|
InlineFragment: function InlineFragment(_ref6) {
|
|
7275
7275
|
var typeCondition = _ref6.typeCondition, directives = _ref6.directives, selectionSet = _ref6.selectionSet;
|
|
7276
7276
|
return join3(["...", wrap2("on ", typeCondition), join3(directives, " "), selectionSet], " ");
|
|
7277
7277
|
},
|
|
7278
7278
|
FragmentDefinition: function FragmentDefinition(_ref7) {
|
|
7279
|
-
var
|
|
7280
|
-
return "fragment ".concat(
|
|
7279
|
+
var name = _ref7.name, typeCondition = _ref7.typeCondition, variableDefinitions = _ref7.variableDefinitions, directives = _ref7.directives, selectionSet = _ref7.selectionSet;
|
|
7280
|
+
return "fragment ".concat(name).concat(wrap2("(", join3(variableDefinitions, ", "), ")"), " ") + "on ".concat(typeCondition, " ").concat(wrap2("", join3(directives, " "), " ")) + selectionSet;
|
|
7281
7281
|
},
|
|
7282
7282
|
IntValue: function IntValue(_ref8) {
|
|
7283
7283
|
var value = _ref8.value;
|
|
@@ -7311,16 +7311,16 @@ var require_printer = __commonJS({
|
|
|
7311
7311
|
return "{" + join3(fields, ", ") + "}";
|
|
7312
7312
|
},
|
|
7313
7313
|
ObjectField: function ObjectField(_ref15) {
|
|
7314
|
-
var
|
|
7315
|
-
return
|
|
7314
|
+
var name = _ref15.name, value = _ref15.value;
|
|
7315
|
+
return name + ": " + value;
|
|
7316
7316
|
},
|
|
7317
7317
|
Directive: function Directive(_ref16) {
|
|
7318
|
-
var
|
|
7319
|
-
return "@" +
|
|
7318
|
+
var name = _ref16.name, args = _ref16.arguments;
|
|
7319
|
+
return "@" + name + wrap2("(", join3(args, ", "), ")");
|
|
7320
7320
|
},
|
|
7321
7321
|
NamedType: function NamedType(_ref17) {
|
|
7322
|
-
var
|
|
7323
|
-
return
|
|
7322
|
+
var name = _ref17.name;
|
|
7323
|
+
return name;
|
|
7324
7324
|
},
|
|
7325
7325
|
ListType: function ListType(_ref18) {
|
|
7326
7326
|
var type = _ref18.type;
|
|
@@ -7339,72 +7339,72 @@ var require_printer = __commonJS({
|
|
|
7339
7339
|
return operation + ": " + type;
|
|
7340
7340
|
},
|
|
7341
7341
|
ScalarTypeDefinition: addDescription2(function(_ref22) {
|
|
7342
|
-
var
|
|
7343
|
-
return join3(["scalar",
|
|
7342
|
+
var name = _ref22.name, directives = _ref22.directives;
|
|
7343
|
+
return join3(["scalar", name, join3(directives, " ")], " ");
|
|
7344
7344
|
}),
|
|
7345
7345
|
ObjectTypeDefinition: addDescription2(function(_ref23) {
|
|
7346
|
-
var
|
|
7347
|
-
return join3(["type",
|
|
7346
|
+
var name = _ref23.name, interfaces = _ref23.interfaces, directives = _ref23.directives, fields = _ref23.fields;
|
|
7347
|
+
return join3(["type", name, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ");
|
|
7348
7348
|
}),
|
|
7349
7349
|
FieldDefinition: addDescription2(function(_ref24) {
|
|
7350
|
-
var
|
|
7351
|
-
return
|
|
7350
|
+
var name = _ref24.name, args = _ref24.arguments, type = _ref24.type, directives = _ref24.directives;
|
|
7351
|
+
return name + (hasMultilineItems2(args) ? wrap2("(\n", indent2(join3(args, "\n")), "\n)") : wrap2("(", join3(args, ", "), ")")) + ": " + type + wrap2(" ", join3(directives, " "));
|
|
7352
7352
|
}),
|
|
7353
7353
|
InputValueDefinition: addDescription2(function(_ref25) {
|
|
7354
|
-
var
|
|
7355
|
-
return join3([
|
|
7354
|
+
var name = _ref25.name, type = _ref25.type, defaultValue = _ref25.defaultValue, directives = _ref25.directives;
|
|
7355
|
+
return join3([name + ": " + type, wrap2("= ", defaultValue), join3(directives, " ")], " ");
|
|
7356
7356
|
}),
|
|
7357
7357
|
InterfaceTypeDefinition: addDescription2(function(_ref26) {
|
|
7358
|
-
var
|
|
7359
|
-
return join3(["interface",
|
|
7358
|
+
var name = _ref26.name, interfaces = _ref26.interfaces, directives = _ref26.directives, fields = _ref26.fields;
|
|
7359
|
+
return join3(["interface", name, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ");
|
|
7360
7360
|
}),
|
|
7361
7361
|
UnionTypeDefinition: addDescription2(function(_ref27) {
|
|
7362
|
-
var
|
|
7363
|
-
return join3(["union",
|
|
7362
|
+
var name = _ref27.name, directives = _ref27.directives, types17 = _ref27.types;
|
|
7363
|
+
return join3(["union", name, join3(directives, " "), types17 && types17.length !== 0 ? "= " + join3(types17, " | ") : ""], " ");
|
|
7364
7364
|
}),
|
|
7365
7365
|
EnumTypeDefinition: addDescription2(function(_ref28) {
|
|
7366
|
-
var
|
|
7367
|
-
return join3(["enum",
|
|
7366
|
+
var name = _ref28.name, directives = _ref28.directives, values = _ref28.values;
|
|
7367
|
+
return join3(["enum", name, join3(directives, " "), block2(values)], " ");
|
|
7368
7368
|
}),
|
|
7369
7369
|
EnumValueDefinition: addDescription2(function(_ref29) {
|
|
7370
|
-
var
|
|
7371
|
-
return join3([
|
|
7370
|
+
var name = _ref29.name, directives = _ref29.directives;
|
|
7371
|
+
return join3([name, join3(directives, " ")], " ");
|
|
7372
7372
|
}),
|
|
7373
7373
|
InputObjectTypeDefinition: addDescription2(function(_ref30) {
|
|
7374
|
-
var
|
|
7375
|
-
return join3(["input",
|
|
7374
|
+
var name = _ref30.name, directives = _ref30.directives, fields = _ref30.fields;
|
|
7375
|
+
return join3(["input", name, join3(directives, " "), block2(fields)], " ");
|
|
7376
7376
|
}),
|
|
7377
7377
|
DirectiveDefinition: addDescription2(function(_ref31) {
|
|
7378
|
-
var
|
|
7379
|
-
return "directive @" +
|
|
7378
|
+
var name = _ref31.name, args = _ref31.arguments, repeatable = _ref31.repeatable, locations = _ref31.locations;
|
|
7379
|
+
return "directive @" + name + (hasMultilineItems2(args) ? wrap2("(\n", indent2(join3(args, "\n")), "\n)") : wrap2("(", join3(args, ", "), ")")) + (repeatable ? " repeatable" : "") + " on " + join3(locations, " | ");
|
|
7380
7380
|
}),
|
|
7381
7381
|
SchemaExtension: function SchemaExtension(_ref32) {
|
|
7382
7382
|
var directives = _ref32.directives, operationTypes = _ref32.operationTypes;
|
|
7383
7383
|
return join3(["extend schema", join3(directives, " "), block2(operationTypes)], " ");
|
|
7384
7384
|
},
|
|
7385
7385
|
ScalarTypeExtension: function ScalarTypeExtension(_ref33) {
|
|
7386
|
-
var
|
|
7387
|
-
return join3(["extend scalar",
|
|
7386
|
+
var name = _ref33.name, directives = _ref33.directives;
|
|
7387
|
+
return join3(["extend scalar", name, join3(directives, " ")], " ");
|
|
7388
7388
|
},
|
|
7389
7389
|
ObjectTypeExtension: function ObjectTypeExtension(_ref34) {
|
|
7390
|
-
var
|
|
7391
|
-
return join3(["extend type",
|
|
7390
|
+
var name = _ref34.name, interfaces = _ref34.interfaces, directives = _ref34.directives, fields = _ref34.fields;
|
|
7391
|
+
return join3(["extend type", name, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ");
|
|
7392
7392
|
},
|
|
7393
7393
|
InterfaceTypeExtension: function InterfaceTypeExtension(_ref35) {
|
|
7394
|
-
var
|
|
7395
|
-
return join3(["extend interface",
|
|
7394
|
+
var name = _ref35.name, interfaces = _ref35.interfaces, directives = _ref35.directives, fields = _ref35.fields;
|
|
7395
|
+
return join3(["extend interface", name, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ");
|
|
7396
7396
|
},
|
|
7397
7397
|
UnionTypeExtension: function UnionTypeExtension(_ref36) {
|
|
7398
|
-
var
|
|
7399
|
-
return join3(["extend union",
|
|
7398
|
+
var name = _ref36.name, directives = _ref36.directives, types17 = _ref36.types;
|
|
7399
|
+
return join3(["extend union", name, join3(directives, " "), types17 && types17.length !== 0 ? "= " + join3(types17, " | ") : ""], " ");
|
|
7400
7400
|
},
|
|
7401
7401
|
EnumTypeExtension: function EnumTypeExtension(_ref37) {
|
|
7402
|
-
var
|
|
7403
|
-
return join3(["extend enum",
|
|
7402
|
+
var name = _ref37.name, directives = _ref37.directives, values = _ref37.values;
|
|
7403
|
+
return join3(["extend enum", name, join3(directives, " "), block2(values)], " ");
|
|
7404
7404
|
},
|
|
7405
7405
|
InputObjectTypeExtension: function InputObjectTypeExtension(_ref38) {
|
|
7406
|
-
var
|
|
7407
|
-
return join3(["extend input",
|
|
7406
|
+
var name = _ref38.name, directives = _ref38.directives, fields = _ref38.fields;
|
|
7407
|
+
return join3(["extend input", name, join3(directives, " "), block2(fields)], " ");
|
|
7408
7408
|
}
|
|
7409
7409
|
};
|
|
7410
7410
|
function addDescription2(cb) {
|
|
@@ -8091,8 +8091,8 @@ var require_definition = __commonJS({
|
|
|
8091
8091
|
_proto5.getValues = function getValues() {
|
|
8092
8092
|
return this._values;
|
|
8093
8093
|
};
|
|
8094
|
-
_proto5.getValue = function getValue(
|
|
8095
|
-
return this._nameLookup[
|
|
8094
|
+
_proto5.getValue = function getValue(name) {
|
|
8095
|
+
return this._nameLookup[name];
|
|
8096
8096
|
};
|
|
8097
8097
|
_proto5.serialize = function serialize(outputValue) {
|
|
8098
8098
|
var enumValue = this._valueLookup.get(outputValue);
|
|
@@ -8671,8 +8671,8 @@ var require_scalars = __commonJS({
|
|
|
8671
8671
|
exports.specifiedScalarTypes = specifiedScalarTypes;
|
|
8672
8672
|
function isSpecifiedScalarType5(type) {
|
|
8673
8673
|
return specifiedScalarTypes.some(function(_ref) {
|
|
8674
|
-
var
|
|
8675
|
-
return type.name ===
|
|
8674
|
+
var name = _ref.name;
|
|
8675
|
+
return type.name === name;
|
|
8676
8676
|
});
|
|
8677
8677
|
}
|
|
8678
8678
|
}
|
|
@@ -9353,9 +9353,9 @@ var require_introspection = __commonJS({
|
|
|
9353
9353
|
astNode: void 0
|
|
9354
9354
|
}],
|
|
9355
9355
|
resolve: function resolve2(_source, _ref8, _context, _ref9) {
|
|
9356
|
-
var
|
|
9356
|
+
var name = _ref8.name;
|
|
9357
9357
|
var schema = _ref9.schema;
|
|
9358
|
-
return schema.getType(
|
|
9358
|
+
return schema.getType(name);
|
|
9359
9359
|
},
|
|
9360
9360
|
isDeprecated: false,
|
|
9361
9361
|
deprecationReason: void 0,
|
|
@@ -9382,8 +9382,8 @@ var require_introspection = __commonJS({
|
|
|
9382
9382
|
exports.introspectionTypes = introspectionTypes;
|
|
9383
9383
|
function isIntrospectionType2(type) {
|
|
9384
9384
|
return introspectionTypes.some(function(_ref11) {
|
|
9385
|
-
var
|
|
9386
|
-
return type.name ===
|
|
9385
|
+
var name = _ref11.name;
|
|
9386
|
+
return type.name === name;
|
|
9387
9387
|
});
|
|
9388
9388
|
}
|
|
9389
9389
|
}
|
|
@@ -9549,8 +9549,8 @@ var require_directives = __commonJS({
|
|
|
9549
9549
|
exports.specifiedDirectives = specifiedDirectives;
|
|
9550
9550
|
function isSpecifiedDirective3(directive) {
|
|
9551
9551
|
return specifiedDirectives.some(function(_ref2) {
|
|
9552
|
-
var
|
|
9553
|
-
return
|
|
9552
|
+
var name = _ref2.name;
|
|
9553
|
+
return name === directive.name;
|
|
9554
9554
|
});
|
|
9555
9555
|
}
|
|
9556
9556
|
}
|
|
@@ -9707,8 +9707,8 @@ var require_schema = __commonJS({
|
|
|
9707
9707
|
_proto.getTypeMap = function getTypeMap() {
|
|
9708
9708
|
return this._typeMap;
|
|
9709
9709
|
};
|
|
9710
|
-
_proto.getType = function getType(
|
|
9711
|
-
return this.getTypeMap()[
|
|
9710
|
+
_proto.getType = function getType(name) {
|
|
9711
|
+
return this.getTypeMap()[name];
|
|
9712
9712
|
};
|
|
9713
9713
|
_proto.getPossibleTypes = function getPossibleTypes(abstractType) {
|
|
9714
9714
|
return (0, _definition.isUnionType)(abstractType) ? abstractType.getTypes() : this.getImplementations(abstractType).objects;
|
|
@@ -9750,9 +9750,9 @@ var require_schema = __commonJS({
|
|
|
9750
9750
|
_proto.getDirectives = function getDirectives() {
|
|
9751
9751
|
return this._directives;
|
|
9752
9752
|
};
|
|
9753
|
-
_proto.getDirective = function getDirective(
|
|
9753
|
+
_proto.getDirective = function getDirective(name) {
|
|
9754
9754
|
return (0, _find.default)(this.getDirectives(), function(directive) {
|
|
9755
|
-
return directive.name ===
|
|
9755
|
+
return directive.name === name;
|
|
9756
9756
|
});
|
|
9757
9757
|
};
|
|
9758
9758
|
_proto.toConfig = function toConfig() {
|
|
@@ -10462,18 +10462,18 @@ var require_TypeInfo = __commonJS({
|
|
|
10462
10462
|
}();
|
|
10463
10463
|
exports.TypeInfo = TypeInfo;
|
|
10464
10464
|
function getFieldDef(schema, parentType, fieldNode) {
|
|
10465
|
-
var
|
|
10466
|
-
if (
|
|
10465
|
+
var name = fieldNode.name.value;
|
|
10466
|
+
if (name === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === parentType) {
|
|
10467
10467
|
return _introspection.SchemaMetaFieldDef;
|
|
10468
10468
|
}
|
|
10469
|
-
if (
|
|
10469
|
+
if (name === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === parentType) {
|
|
10470
10470
|
return _introspection.TypeMetaFieldDef;
|
|
10471
10471
|
}
|
|
10472
|
-
if (
|
|
10472
|
+
if (name === _introspection.TypeNameMetaFieldDef.name && (0, _definition.isCompositeType)(parentType)) {
|
|
10473
10473
|
return _introspection.TypeNameMetaFieldDef;
|
|
10474
10474
|
}
|
|
10475
10475
|
if ((0, _definition.isObjectType)(parentType) || (0, _definition.isInterfaceType)(parentType)) {
|
|
10476
|
-
return parentType.getFields()[
|
|
10476
|
+
return parentType.getFields()[name];
|
|
10477
10477
|
}
|
|
10478
10478
|
}
|
|
10479
10479
|
function visitWithTypeInfo(typeInfo, visitor) {
|
|
@@ -11049,8 +11049,8 @@ var require_PossibleFragmentSpreadsRule = __commonJS({
|
|
|
11049
11049
|
}
|
|
11050
11050
|
};
|
|
11051
11051
|
}
|
|
11052
|
-
function getFragmentType(context,
|
|
11053
|
-
var frag = context.getFragment(
|
|
11052
|
+
function getFragmentType(context, name) {
|
|
11053
|
+
var frag = context.getFragment(name);
|
|
11054
11054
|
if (frag) {
|
|
11055
11055
|
var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), frag.typeCondition);
|
|
11056
11056
|
if ((0, _definition.isCompositeType)(type)) {
|
|
@@ -11253,22 +11253,22 @@ var require_KnownDirectivesRule = __commonJS({
|
|
|
11253
11253
|
for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {
|
|
11254
11254
|
var def = astDefinitions[_i4];
|
|
11255
11255
|
if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) {
|
|
11256
|
-
locationsMap[def.name.value] = def.locations.map(function(
|
|
11257
|
-
return
|
|
11256
|
+
locationsMap[def.name.value] = def.locations.map(function(name) {
|
|
11257
|
+
return name.value;
|
|
11258
11258
|
});
|
|
11259
11259
|
}
|
|
11260
11260
|
}
|
|
11261
11261
|
return {
|
|
11262
11262
|
Directive: function Directive(node, _key, _parent, _path, ancestors) {
|
|
11263
|
-
var
|
|
11264
|
-
var locations = locationsMap[
|
|
11263
|
+
var name = node.name.value;
|
|
11264
|
+
var locations = locationsMap[name];
|
|
11265
11265
|
if (!locations) {
|
|
11266
|
-
context.reportError(new _GraphQLError.GraphQLError('Unknown directive "@'.concat(
|
|
11266
|
+
context.reportError(new _GraphQLError.GraphQLError('Unknown directive "@'.concat(name, '".'), node));
|
|
11267
11267
|
return;
|
|
11268
11268
|
}
|
|
11269
11269
|
var candidateLocation = getDirectiveLocationForASTPath(ancestors);
|
|
11270
11270
|
if (candidateLocation && locations.indexOf(candidateLocation) === -1) {
|
|
11271
|
-
context.reportError(new _GraphQLError.GraphQLError('Directive "@'.concat(
|
|
11271
|
+
context.reportError(new _GraphQLError.GraphQLError('Directive "@'.concat(name, '" may not be used on ').concat(candidateLocation, "."), node));
|
|
11272
11272
|
}
|
|
11273
11273
|
}
|
|
11274
11274
|
};
|
|
@@ -12632,7 +12632,7 @@ var require_ValidationContext = __commonJS({
|
|
|
12632
12632
|
_proto.getDocument = function getDocument() {
|
|
12633
12633
|
return this._ast;
|
|
12634
12634
|
};
|
|
12635
|
-
_proto.getFragment = function getFragment(
|
|
12635
|
+
_proto.getFragment = function getFragment(name) {
|
|
12636
12636
|
var fragments = this._fragments;
|
|
12637
12637
|
if (!fragments) {
|
|
12638
12638
|
this._fragments = fragments = this.getDocument().definitions.reduce(function(frags, statement) {
|
|
@@ -12642,7 +12642,7 @@ var require_ValidationContext = __commonJS({
|
|
|
12642
12642
|
return frags;
|
|
12643
12643
|
}, /* @__PURE__ */ Object.create(null));
|
|
12644
12644
|
}
|
|
12645
|
-
return fragments[
|
|
12645
|
+
return fragments[name];
|
|
12646
12646
|
};
|
|
12647
12647
|
_proto.getFragmentSpreads = function getFragmentSpreads(node) {
|
|
12648
12648
|
var spreads = this._fragmentSpreads.get(node);
|
|
@@ -12939,8 +12939,8 @@ var require_promiseForObject = __commonJS({
|
|
|
12939
12939
|
exports.default = promiseForObject;
|
|
12940
12940
|
function promiseForObject(object) {
|
|
12941
12941
|
var keys = Object.keys(object);
|
|
12942
|
-
var valuesAndPromises = keys.map(function(
|
|
12943
|
-
return object[
|
|
12942
|
+
var valuesAndPromises = keys.map(function(name) {
|
|
12943
|
+
return object[name];
|
|
12944
12944
|
});
|
|
12945
12945
|
return Promise.all(valuesAndPromises).then(function(values) {
|
|
12946
12946
|
return values.reduce(function(resolvedObject, value, i2) {
|
|
@@ -13351,14 +13351,14 @@ var require_values = __commonJS({
|
|
|
13351
13351
|
});
|
|
13352
13352
|
for (var _i4 = 0, _def$args2 = def.args; _i4 < _def$args2.length; _i4++) {
|
|
13353
13353
|
var argDef = _def$args2[_i4];
|
|
13354
|
-
var
|
|
13354
|
+
var name = argDef.name;
|
|
13355
13355
|
var argType = argDef.type;
|
|
13356
|
-
var argumentNode2 = argNodeMap[
|
|
13356
|
+
var argumentNode2 = argNodeMap[name];
|
|
13357
13357
|
if (!argumentNode2) {
|
|
13358
13358
|
if (argDef.defaultValue !== void 0) {
|
|
13359
|
-
coercedValues[
|
|
13359
|
+
coercedValues[name] = argDef.defaultValue;
|
|
13360
13360
|
} else if ((0, _definition.isNonNullType)(argType)) {
|
|
13361
|
-
throw new _GraphQLError.GraphQLError('Argument "'.concat(
|
|
13361
|
+
throw new _GraphQLError.GraphQLError('Argument "'.concat(name, '" of required type "').concat((0, _inspect.default)(argType), '" ') + "was not provided.", node);
|
|
13362
13362
|
}
|
|
13363
13363
|
continue;
|
|
13364
13364
|
}
|
|
@@ -13368,22 +13368,22 @@ var require_values = __commonJS({
|
|
|
13368
13368
|
var variableName = valueNode.name.value;
|
|
13369
13369
|
if (variableValues == null || !hasOwnProperty(variableValues, variableName)) {
|
|
13370
13370
|
if (argDef.defaultValue !== void 0) {
|
|
13371
|
-
coercedValues[
|
|
13371
|
+
coercedValues[name] = argDef.defaultValue;
|
|
13372
13372
|
} else if ((0, _definition.isNonNullType)(argType)) {
|
|
13373
|
-
throw new _GraphQLError.GraphQLError('Argument "'.concat(
|
|
13373
|
+
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);
|
|
13374
13374
|
}
|
|
13375
13375
|
continue;
|
|
13376
13376
|
}
|
|
13377
13377
|
isNull = variableValues[variableName] == null;
|
|
13378
13378
|
}
|
|
13379
13379
|
if (isNull && (0, _definition.isNonNullType)(argType)) {
|
|
13380
|
-
throw new _GraphQLError.GraphQLError('Argument "'.concat(
|
|
13380
|
+
throw new _GraphQLError.GraphQLError('Argument "'.concat(name, '" of non-null type "').concat((0, _inspect.default)(argType), '" ') + "must not be null.", valueNode);
|
|
13381
13381
|
}
|
|
13382
13382
|
var coercedValue = (0, _valueFromAST.valueFromAST)(valueNode, argType, variableValues);
|
|
13383
13383
|
if (coercedValue === void 0) {
|
|
13384
|
-
throw new _GraphQLError.GraphQLError('Argument "'.concat(
|
|
13384
|
+
throw new _GraphQLError.GraphQLError('Argument "'.concat(name, '" has invalid value ').concat((0, _printer.print)(valueNode), "."), valueNode);
|
|
13385
13385
|
}
|
|
13386
|
-
coercedValues[
|
|
13386
|
+
coercedValues[name] = coercedValue;
|
|
13387
13387
|
}
|
|
13388
13388
|
return coercedValues;
|
|
13389
13389
|
}
|
|
@@ -13599,11 +13599,11 @@ var require_execute = __commonJS({
|
|
|
13599
13599
|
if (!shouldIncludeNode(exeContext, selection2)) {
|
|
13600
13600
|
continue;
|
|
13601
13601
|
}
|
|
13602
|
-
var
|
|
13603
|
-
if (!fields[
|
|
13604
|
-
fields[
|
|
13602
|
+
var name = getFieldEntryKey(selection2);
|
|
13603
|
+
if (!fields[name]) {
|
|
13604
|
+
fields[name] = [];
|
|
13605
13605
|
}
|
|
13606
|
-
fields[
|
|
13606
|
+
fields[name].push(selection2);
|
|
13607
13607
|
break;
|
|
13608
13608
|
}
|
|
13609
13609
|
case _kinds.Kind.INLINE_FRAGMENT: {
|
|
@@ -15919,8 +15919,8 @@ var require_extendSchema = __commonJS({
|
|
|
15919
15919
|
for (var _i6 = 0; _i6 < typeDefs.length; _i6++) {
|
|
15920
15920
|
var _stdTypeMap$name;
|
|
15921
15921
|
var typeNode = typeDefs[_i6];
|
|
15922
|
-
var
|
|
15923
|
-
typeMap[
|
|
15922
|
+
var name = typeNode.name.value;
|
|
15923
|
+
typeMap[name] = (_stdTypeMap$name = stdTypeMap[name]) !== null && _stdTypeMap$name !== void 0 ? _stdTypeMap$name : buildType(typeNode);
|
|
15924
15924
|
}
|
|
15925
15925
|
var operationTypes = _objectSpread(_objectSpread({
|
|
15926
15926
|
query: schemaConfig.query && replaceNamedType(schemaConfig.query),
|
|
@@ -16083,10 +16083,10 @@ var require_extendSchema = __commonJS({
|
|
|
16083
16083
|
}
|
|
16084
16084
|
function getNamedType5(node) {
|
|
16085
16085
|
var _stdTypeMap$name2;
|
|
16086
|
-
var
|
|
16087
|
-
var type = (_stdTypeMap$name2 = stdTypeMap[
|
|
16086
|
+
var name2 = node.name.value;
|
|
16087
|
+
var type = (_stdTypeMap$name2 = stdTypeMap[name2]) !== null && _stdTypeMap$name2 !== void 0 ? _stdTypeMap$name2 : typeMap[name2];
|
|
16088
16088
|
if (type === void 0) {
|
|
16089
|
-
throw new Error('Unknown type: "'.concat(
|
|
16089
|
+
throw new Error('Unknown type: "'.concat(name2, '".'));
|
|
16090
16090
|
}
|
|
16091
16091
|
return type;
|
|
16092
16092
|
}
|
|
@@ -16213,15 +16213,15 @@ var require_extendSchema = __commonJS({
|
|
|
16213
16213
|
}
|
|
16214
16214
|
function buildType(astNode) {
|
|
16215
16215
|
var _typeExtensionsMap$na;
|
|
16216
|
-
var
|
|
16216
|
+
var name2 = astNode.name.value;
|
|
16217
16217
|
var description = getDescription(astNode, options);
|
|
16218
|
-
var extensionNodes = (_typeExtensionsMap$na = typeExtensionsMap[
|
|
16218
|
+
var extensionNodes = (_typeExtensionsMap$na = typeExtensionsMap[name2]) !== null && _typeExtensionsMap$na !== void 0 ? _typeExtensionsMap$na : [];
|
|
16219
16219
|
switch (astNode.kind) {
|
|
16220
16220
|
case _kinds.Kind.OBJECT_TYPE_DEFINITION: {
|
|
16221
16221
|
var extensionASTNodes = extensionNodes;
|
|
16222
16222
|
var allNodes = [astNode].concat(extensionASTNodes);
|
|
16223
16223
|
return new _definition.GraphQLObjectType({
|
|
16224
|
-
name:
|
|
16224
|
+
name: name2,
|
|
16225
16225
|
description,
|
|
16226
16226
|
interfaces: function interfaces() {
|
|
16227
16227
|
return buildInterfaces(allNodes);
|
|
@@ -16237,7 +16237,7 @@ var require_extendSchema = __commonJS({
|
|
|
16237
16237
|
var _extensionASTNodes = extensionNodes;
|
|
16238
16238
|
var _allNodes = [astNode].concat(_extensionASTNodes);
|
|
16239
16239
|
return new _definition.GraphQLInterfaceType({
|
|
16240
|
-
name:
|
|
16240
|
+
name: name2,
|
|
16241
16241
|
description,
|
|
16242
16242
|
interfaces: function interfaces() {
|
|
16243
16243
|
return buildInterfaces(_allNodes);
|
|
@@ -16253,7 +16253,7 @@ var require_extendSchema = __commonJS({
|
|
|
16253
16253
|
var _extensionASTNodes2 = extensionNodes;
|
|
16254
16254
|
var _allNodes2 = [astNode].concat(_extensionASTNodes2);
|
|
16255
16255
|
return new _definition.GraphQLEnumType({
|
|
16256
|
-
name:
|
|
16256
|
+
name: name2,
|
|
16257
16257
|
description,
|
|
16258
16258
|
values: buildEnumValueMap(_allNodes2),
|
|
16259
16259
|
astNode,
|
|
@@ -16264,7 +16264,7 @@ var require_extendSchema = __commonJS({
|
|
|
16264
16264
|
var _extensionASTNodes3 = extensionNodes;
|
|
16265
16265
|
var _allNodes3 = [astNode].concat(_extensionASTNodes3);
|
|
16266
16266
|
return new _definition.GraphQLUnionType({
|
|
16267
|
-
name:
|
|
16267
|
+
name: name2,
|
|
16268
16268
|
description,
|
|
16269
16269
|
types: function types17() {
|
|
16270
16270
|
return buildUnionTypes(_allNodes3);
|
|
@@ -16276,7 +16276,7 @@ var require_extendSchema = __commonJS({
|
|
|
16276
16276
|
case _kinds.Kind.SCALAR_TYPE_DEFINITION: {
|
|
16277
16277
|
var _extensionASTNodes4 = extensionNodes;
|
|
16278
16278
|
return new _definition.GraphQLScalarType({
|
|
16279
|
-
name:
|
|
16279
|
+
name: name2,
|
|
16280
16280
|
description,
|
|
16281
16281
|
specifiedByUrl: getSpecifiedByUrl(astNode),
|
|
16282
16282
|
astNode,
|
|
@@ -16287,7 +16287,7 @@ var require_extendSchema = __commonJS({
|
|
|
16287
16287
|
var _extensionASTNodes5 = extensionNodes;
|
|
16288
16288
|
var _allNodes4 = [astNode].concat(_extensionASTNodes5);
|
|
16289
16289
|
return new _definition.GraphQLInputObjectType({
|
|
16290
|
-
name:
|
|
16290
|
+
name: name2,
|
|
16291
16291
|
description,
|
|
16292
16292
|
fields: function fields() {
|
|
16293
16293
|
return buildInputFieldMap(_allNodes4);
|
|
@@ -17384,12 +17384,12 @@ var require_findBreakingChanges = __commonJS({
|
|
|
17384
17384
|
var removed = [];
|
|
17385
17385
|
var persisted = [];
|
|
17386
17386
|
var oldMap = (0, _keyMap.default)(oldArray, function(_ref11) {
|
|
17387
|
-
var
|
|
17388
|
-
return
|
|
17387
|
+
var name = _ref11.name;
|
|
17388
|
+
return name;
|
|
17389
17389
|
});
|
|
17390
17390
|
var newMap = (0, _keyMap.default)(newArray, function(_ref12) {
|
|
17391
|
-
var
|
|
17392
|
-
return
|
|
17391
|
+
var name = _ref12.name;
|
|
17392
|
+
return name;
|
|
17393
17393
|
});
|
|
17394
17394
|
for (var _i44 = 0; _i44 < oldArray.length; _i44++) {
|
|
17395
17395
|
var oldItem = oldArray[_i44];
|
|
@@ -18862,6 +18862,109 @@ var require_graphql2 = __commonJS({
|
|
|
18862
18862
|
}
|
|
18863
18863
|
});
|
|
18864
18864
|
|
|
18865
|
+
// ../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js
|
|
18866
|
+
var require_cjs = __commonJS({
|
|
18867
|
+
"../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module) {
|
|
18868
|
+
"use strict";
|
|
18869
|
+
var isMergeableObject = function isMergeableObject2(value) {
|
|
18870
|
+
return isNonNullObject(value) && !isSpecial(value);
|
|
18871
|
+
};
|
|
18872
|
+
function isNonNullObject(value) {
|
|
18873
|
+
return !!value && typeof value === "object";
|
|
18874
|
+
}
|
|
18875
|
+
function isSpecial(value) {
|
|
18876
|
+
var stringValue = Object.prototype.toString.call(value);
|
|
18877
|
+
return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
|
|
18878
|
+
}
|
|
18879
|
+
var canUseSymbol = typeof Symbol === "function" && Symbol.for;
|
|
18880
|
+
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
|
|
18881
|
+
function isReactElement(value) {
|
|
18882
|
+
return value.$$typeof === REACT_ELEMENT_TYPE;
|
|
18883
|
+
}
|
|
18884
|
+
function emptyTarget(val) {
|
|
18885
|
+
return Array.isArray(val) ? [] : {};
|
|
18886
|
+
}
|
|
18887
|
+
function cloneUnlessOtherwiseSpecified(value, options) {
|
|
18888
|
+
return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
|
|
18889
|
+
}
|
|
18890
|
+
function defaultArrayMerge(target, source, options) {
|
|
18891
|
+
return target.concat(source).map(function(element) {
|
|
18892
|
+
return cloneUnlessOtherwiseSpecified(element, options);
|
|
18893
|
+
});
|
|
18894
|
+
}
|
|
18895
|
+
function getMergeFunction(key, options) {
|
|
18896
|
+
if (!options.customMerge) {
|
|
18897
|
+
return deepmerge;
|
|
18898
|
+
}
|
|
18899
|
+
var customMerge = options.customMerge(key);
|
|
18900
|
+
return typeof customMerge === "function" ? customMerge : deepmerge;
|
|
18901
|
+
}
|
|
18902
|
+
function getEnumerableOwnPropertySymbols(target) {
|
|
18903
|
+
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
|
|
18904
|
+
return target.propertyIsEnumerable(symbol);
|
|
18905
|
+
}) : [];
|
|
18906
|
+
}
|
|
18907
|
+
function getKeys(target) {
|
|
18908
|
+
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
|
|
18909
|
+
}
|
|
18910
|
+
function propertyIsOnObject(object, property) {
|
|
18911
|
+
try {
|
|
18912
|
+
return property in object;
|
|
18913
|
+
} catch (_) {
|
|
18914
|
+
return false;
|
|
18915
|
+
}
|
|
18916
|
+
}
|
|
18917
|
+
function propertyIsUnsafe(target, key) {
|
|
18918
|
+
return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
|
|
18919
|
+
}
|
|
18920
|
+
function mergeObject(target, source, options) {
|
|
18921
|
+
var destination = {};
|
|
18922
|
+
if (options.isMergeableObject(target)) {
|
|
18923
|
+
getKeys(target).forEach(function(key) {
|
|
18924
|
+
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
|
18925
|
+
});
|
|
18926
|
+
}
|
|
18927
|
+
getKeys(source).forEach(function(key) {
|
|
18928
|
+
if (propertyIsUnsafe(target, key)) {
|
|
18929
|
+
return;
|
|
18930
|
+
}
|
|
18931
|
+
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
|
|
18932
|
+
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
|
|
18933
|
+
} else {
|
|
18934
|
+
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
|
|
18935
|
+
}
|
|
18936
|
+
});
|
|
18937
|
+
return destination;
|
|
18938
|
+
}
|
|
18939
|
+
function deepmerge(target, source, options) {
|
|
18940
|
+
options = options || {};
|
|
18941
|
+
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
|
|
18942
|
+
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
|
|
18943
|
+
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
|
18944
|
+
var sourceIsArray = Array.isArray(source);
|
|
18945
|
+
var targetIsArray = Array.isArray(target);
|
|
18946
|
+
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
18947
|
+
if (!sourceAndTargetTypesMatch) {
|
|
18948
|
+
return cloneUnlessOtherwiseSpecified(source, options);
|
|
18949
|
+
} else if (sourceIsArray) {
|
|
18950
|
+
return options.arrayMerge(target, source, options);
|
|
18951
|
+
} else {
|
|
18952
|
+
return mergeObject(target, source, options);
|
|
18953
|
+
}
|
|
18954
|
+
}
|
|
18955
|
+
deepmerge.all = function deepmergeAll(array, options) {
|
|
18956
|
+
if (!Array.isArray(array)) {
|
|
18957
|
+
throw new Error("first argument should be an array");
|
|
18958
|
+
}
|
|
18959
|
+
return array.reduce(function(prev, next) {
|
|
18960
|
+
return deepmerge(prev, next, options);
|
|
18961
|
+
}, {});
|
|
18962
|
+
};
|
|
18963
|
+
var deepmerge_1 = deepmerge;
|
|
18964
|
+
module.exports = deepmerge_1;
|
|
18965
|
+
}
|
|
18966
|
+
});
|
|
18967
|
+
|
|
18865
18968
|
// ../../node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js
|
|
18866
18969
|
var require_universalify = __commonJS({
|
|
18867
18970
|
"../../node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js"(exports) {
|
|
@@ -22406,8 +22509,8 @@ var require_once = __commonJS({
|
|
|
22406
22509
|
f3.called = true;
|
|
22407
22510
|
return f3.value = fn.apply(this, arguments);
|
|
22408
22511
|
};
|
|
22409
|
-
var
|
|
22410
|
-
f3.onceError =
|
|
22512
|
+
var name = fn.name || "Function wrapped with `once`";
|
|
22513
|
+
f3.onceError = name + " shouldn't be called more than once";
|
|
22411
22514
|
f3.called = false;
|
|
22412
22515
|
return f3;
|
|
22413
22516
|
}
|
|
@@ -23317,9 +23420,9 @@ var require_errors = __commonJS({
|
|
|
23317
23420
|
E("ERR_HTTP_TRAILER_INVALID", "Trailers are invalid with this transfer encoding");
|
|
23318
23421
|
E("ERR_INDEX_OUT_OF_RANGE", "Index out of range");
|
|
23319
23422
|
E("ERR_INVALID_ARG_TYPE", invalidArgType);
|
|
23320
|
-
E("ERR_INVALID_ARRAY_LENGTH", function(
|
|
23423
|
+
E("ERR_INVALID_ARRAY_LENGTH", function(name, len, actual) {
|
|
23321
23424
|
assert.strictEqual(typeof actual, "number");
|
|
23322
|
-
return 'The array "'.concat(
|
|
23425
|
+
return 'The array "'.concat(name, '" (length ').concat(actual, ") must be of length ").concat(len, ".");
|
|
23323
23426
|
});
|
|
23324
23427
|
E("ERR_INVALID_BUFFER_SIZE", "Buffer size must be a multiple of %s");
|
|
23325
23428
|
E("ERR_INVALID_CALLBACK", "Callback must be a function");
|
|
@@ -23330,8 +23433,8 @@ var require_errors = __commonJS({
|
|
|
23330
23433
|
E("ERR_INVALID_FILE_URL_PATH", "File URL path %s");
|
|
23331
23434
|
E("ERR_INVALID_HANDLE_TYPE", "This handle type cannot be sent");
|
|
23332
23435
|
E("ERR_INVALID_IP_ADDRESS", "Invalid IP address: %s");
|
|
23333
|
-
E("ERR_INVALID_OPT_VALUE", function(
|
|
23334
|
-
return 'The value "'.concat(String(value), '" is invalid for option "').concat(
|
|
23436
|
+
E("ERR_INVALID_OPT_VALUE", function(name, value) {
|
|
23437
|
+
return 'The value "'.concat(String(value), '" is invalid for option "').concat(name, '"');
|
|
23335
23438
|
});
|
|
23336
23439
|
E("ERR_INVALID_OPT_VALUE_ENCODING", function(value) {
|
|
23337
23440
|
return 'The value "'.concat(String(value), '" is invalid for option "encoding"');
|
|
@@ -23379,8 +23482,8 @@ var require_errors = __commonJS({
|
|
|
23379
23482
|
E("ERR_UNKNOWN_STDIN_TYPE", "Unknown stdin file type");
|
|
23380
23483
|
E("ERR_UNKNOWN_STREAM_TYPE", "Unknown stream file type");
|
|
23381
23484
|
E("ERR_V8BREAKITERATOR", "Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl");
|
|
23382
|
-
function invalidArgType(
|
|
23383
|
-
assert(
|
|
23485
|
+
function invalidArgType(name, expected, actual) {
|
|
23486
|
+
assert(name, "name is required");
|
|
23384
23487
|
var determiner;
|
|
23385
23488
|
if (expected.includes("not ")) {
|
|
23386
23489
|
determiner = "must not be";
|
|
@@ -23389,16 +23492,16 @@ var require_errors = __commonJS({
|
|
|
23389
23492
|
determiner = "must be";
|
|
23390
23493
|
}
|
|
23391
23494
|
var msg;
|
|
23392
|
-
if (Array.isArray(
|
|
23393
|
-
var names =
|
|
23495
|
+
if (Array.isArray(name)) {
|
|
23496
|
+
var names = name.map(function(val) {
|
|
23394
23497
|
return '"'.concat(val, '"');
|
|
23395
23498
|
}).join(", ");
|
|
23396
23499
|
msg = "The ".concat(names, " arguments ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
23397
|
-
} else if (
|
|
23398
|
-
msg = "The ".concat(
|
|
23500
|
+
} else if (name.includes(" argument")) {
|
|
23501
|
+
msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
23399
23502
|
} else {
|
|
23400
|
-
var type =
|
|
23401
|
-
msg = 'The "'.concat(
|
|
23503
|
+
var type = name.includes(".") ? "property" : "argument";
|
|
23504
|
+
msg = 'The "'.concat(name, '" ').concat(type, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
23402
23505
|
}
|
|
23403
23506
|
if (arguments.length >= 3) {
|
|
23404
23507
|
msg += ". Received type ".concat(actual !== null ? typeof actual : "null");
|
|
@@ -23450,11 +23553,11 @@ var require_errors = __commonJS({
|
|
|
23450
23553
|
return "of ".concat(thing, " ").concat(String(expected));
|
|
23451
23554
|
}
|
|
23452
23555
|
}
|
|
23453
|
-
function bufferOutOfBounds(
|
|
23556
|
+
function bufferOutOfBounds(name, isWriting) {
|
|
23454
23557
|
if (isWriting) {
|
|
23455
23558
|
return "Attempt to write outside buffer bounds";
|
|
23456
23559
|
} else {
|
|
23457
|
-
return '"'.concat(
|
|
23560
|
+
return '"'.concat(name, '" is outside of buffer bounds');
|
|
23458
23561
|
}
|
|
23459
23562
|
}
|
|
23460
23563
|
}
|
|
@@ -23852,7 +23955,7 @@ var require_node = __commonJS({
|
|
|
23852
23955
|
exports.Node = Node;
|
|
23853
23956
|
var Link = function(_super) {
|
|
23854
23957
|
__extends(Link2, _super);
|
|
23855
|
-
function Link2(vol2, parent,
|
|
23958
|
+
function Link2(vol2, parent, name) {
|
|
23856
23959
|
var _this = _super.call(this) || this;
|
|
23857
23960
|
_this.children = {};
|
|
23858
23961
|
_this._steps = [];
|
|
@@ -23860,7 +23963,7 @@ var require_node = __commonJS({
|
|
|
23860
23963
|
_this.length = 0;
|
|
23861
23964
|
_this.vol = vol2;
|
|
23862
23965
|
_this.parent = parent;
|
|
23863
|
-
_this.name =
|
|
23966
|
+
_this.name = name;
|
|
23864
23967
|
_this.syncSteps();
|
|
23865
23968
|
return _this;
|
|
23866
23969
|
}
|
|
@@ -23885,22 +23988,22 @@ var require_node = __commonJS({
|
|
|
23885
23988
|
Link2.prototype.getNode = function() {
|
|
23886
23989
|
return this.node;
|
|
23887
23990
|
};
|
|
23888
|
-
Link2.prototype.createChild = function(
|
|
23991
|
+
Link2.prototype.createChild = function(name, node) {
|
|
23889
23992
|
if (node === void 0) {
|
|
23890
23993
|
node = this.vol.createNode();
|
|
23891
23994
|
}
|
|
23892
|
-
var link = new Link2(this.vol, this,
|
|
23995
|
+
var link = new Link2(this.vol, this, name);
|
|
23893
23996
|
link.setNode(node);
|
|
23894
23997
|
if (node.isDirectory()) {
|
|
23895
23998
|
}
|
|
23896
|
-
this.setChild(
|
|
23999
|
+
this.setChild(name, link);
|
|
23897
24000
|
return link;
|
|
23898
24001
|
};
|
|
23899
|
-
Link2.prototype.setChild = function(
|
|
24002
|
+
Link2.prototype.setChild = function(name, link) {
|
|
23900
24003
|
if (link === void 0) {
|
|
23901
|
-
link = new Link2(this.vol, this,
|
|
24004
|
+
link = new Link2(this.vol, this, name);
|
|
23902
24005
|
}
|
|
23903
|
-
this.children[
|
|
24006
|
+
this.children[name] = link;
|
|
23904
24007
|
link.parent = this;
|
|
23905
24008
|
this.length++;
|
|
23906
24009
|
this.emit("child:add", link, this);
|
|
@@ -23911,9 +24014,9 @@ var require_node = __commonJS({
|
|
|
23911
24014
|
this.length--;
|
|
23912
24015
|
this.emit("child:delete", link, this);
|
|
23913
24016
|
};
|
|
23914
|
-
Link2.prototype.getChild = function(
|
|
23915
|
-
if (Object.hasOwnProperty.call(this.children,
|
|
23916
|
-
return this.children[
|
|
24017
|
+
Link2.prototype.getChild = function(name) {
|
|
24018
|
+
if (Object.hasOwnProperty.call(this.children, name)) {
|
|
24019
|
+
return this.children[name];
|
|
23917
24020
|
}
|
|
23918
24021
|
};
|
|
23919
24022
|
Link2.prototype.getPath = function() {
|
|
@@ -24802,17 +24905,17 @@ var require_volume = __commonJS({
|
|
|
24802
24905
|
enumerable: false,
|
|
24803
24906
|
configurable: true
|
|
24804
24907
|
});
|
|
24805
|
-
Volume2.prototype.createLink = function(parent,
|
|
24908
|
+
Volume2.prototype.createLink = function(parent, name, isDirectory, perm) {
|
|
24806
24909
|
if (isDirectory === void 0) {
|
|
24807
24910
|
isDirectory = false;
|
|
24808
24911
|
}
|
|
24809
24912
|
if (!parent) {
|
|
24810
24913
|
return new this.props.Link(this, null, "");
|
|
24811
24914
|
}
|
|
24812
|
-
if (!
|
|
24915
|
+
if (!name) {
|
|
24813
24916
|
throw new Error("createLink: name cannot be empty");
|
|
24814
24917
|
}
|
|
24815
|
-
return parent.createChild(
|
|
24918
|
+
return parent.createChild(name, this.createNode(isDirectory, perm));
|
|
24816
24919
|
};
|
|
24817
24920
|
Volume2.prototype.deleteLink = function(link) {
|
|
24818
24921
|
var parent = link.parent;
|
|
@@ -25362,12 +25465,12 @@ var require_volume = __commonJS({
|
|
|
25362
25465
|
var dir2 = this.getLinkParent(steps2);
|
|
25363
25466
|
if (!dir2)
|
|
25364
25467
|
throw createError(ENOENT, "link", filename1, filename2);
|
|
25365
|
-
var
|
|
25366
|
-
if (dir2.getChild(
|
|
25468
|
+
var name = steps2[steps2.length - 1];
|
|
25469
|
+
if (dir2.getChild(name))
|
|
25367
25470
|
throw createError(EEXIST, "link", filename1, filename2);
|
|
25368
25471
|
var node = link1.getNode();
|
|
25369
25472
|
node.nlink++;
|
|
25370
|
-
dir2.createChild(
|
|
25473
|
+
dir2.createChild(name, node);
|
|
25371
25474
|
};
|
|
25372
25475
|
Volume2.prototype.copyFileBase = function(src, dest, flags) {
|
|
25373
25476
|
var buf = this.readFileSync(src);
|
|
@@ -25438,10 +25541,10 @@ var require_volume = __commonJS({
|
|
|
25438
25541
|
var dirLink = this.getLinkParent(pathSteps);
|
|
25439
25542
|
if (!dirLink)
|
|
25440
25543
|
throw createError(ENOENT, "symlink", targetFilename, pathFilename);
|
|
25441
|
-
var
|
|
25442
|
-
if (dirLink.getChild(
|
|
25544
|
+
var name = pathSteps[pathSteps.length - 1];
|
|
25545
|
+
if (dirLink.getChild(name))
|
|
25443
25546
|
throw createError(EEXIST, "symlink", targetFilename, pathFilename);
|
|
25444
|
-
var symlink = dirLink.createChild(
|
|
25547
|
+
var symlink = dirLink.createChild(name);
|
|
25445
25548
|
symlink.getNode().makeSymlink(filenameToSteps(targetFilename));
|
|
25446
25549
|
return symlink;
|
|
25447
25550
|
};
|
|
@@ -25547,9 +25650,9 @@ var require_volume = __commonJS({
|
|
|
25547
25650
|
if (oldLinkParent) {
|
|
25548
25651
|
oldLinkParent.deleteChild(link);
|
|
25549
25652
|
}
|
|
25550
|
-
var
|
|
25551
|
-
link.name =
|
|
25552
|
-
link.steps = __spreadArray(__spreadArray([], newPathDirLink.steps, true), [
|
|
25653
|
+
var name = newPathSteps[newPathSteps.length - 1];
|
|
25654
|
+
link.name = name;
|
|
25655
|
+
link.steps = __spreadArray(__spreadArray([], newPathDirLink.steps, true), [name], false);
|
|
25553
25656
|
newPathDirLink.setChild(link.getName(), link);
|
|
25554
25657
|
};
|
|
25555
25658
|
Volume2.prototype.renameSync = function(oldPath, newPath) {
|
|
@@ -25768,10 +25871,10 @@ var require_volume = __commonJS({
|
|
|
25768
25871
|
throw createError(EEXIST, "mkdir", filename);
|
|
25769
25872
|
}
|
|
25770
25873
|
var dir = this.getLinkParentAsDirOrThrow(filename, "mkdir");
|
|
25771
|
-
var
|
|
25772
|
-
if (dir.getChild(
|
|
25874
|
+
var name = steps[steps.length - 1];
|
|
25875
|
+
if (dir.getChild(name))
|
|
25773
25876
|
throw createError(EEXIST, "mkdir", filename);
|
|
25774
|
-
dir.createChild(
|
|
25877
|
+
dir.createChild(name, this.createNode(true, modeNum));
|
|
25775
25878
|
};
|
|
25776
25879
|
Volume2.prototype.mkdirpBase = function(filename, modeNum) {
|
|
25777
25880
|
var fullPath = resolve2(filename);
|
|
@@ -26695,8 +26798,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
26695
26798
|
reader._ownerReadableStream._reader = void 0;
|
|
26696
26799
|
reader._ownerReadableStream = void 0;
|
|
26697
26800
|
}
|
|
26698
|
-
function readerLockException(
|
|
26699
|
-
return new TypeError("Cannot " +
|
|
26801
|
+
function readerLockException(name) {
|
|
26802
|
+
return new TypeError("Cannot " + name + " a stream using a released reader");
|
|
26700
26803
|
}
|
|
26701
26804
|
function defaultReaderClosedPromiseInitialize(reader) {
|
|
26702
26805
|
reader._closedPromise = newPromise((resolve2, reject) => {
|
|
@@ -26923,8 +27026,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
26923
27026
|
stream._readableStreamController[PullSteps](readRequest);
|
|
26924
27027
|
}
|
|
26925
27028
|
}
|
|
26926
|
-
function defaultReaderBrandCheckException(
|
|
26927
|
-
return new TypeError(`ReadableStreamDefaultReader.prototype.${
|
|
27029
|
+
function defaultReaderBrandCheckException(name) {
|
|
27030
|
+
return new TypeError(`ReadableStreamDefaultReader.prototype.${name} can only be used on a ReadableStreamDefaultReader`);
|
|
26928
27031
|
}
|
|
26929
27032
|
const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () {
|
|
26930
27033
|
}).prototype);
|
|
@@ -27034,8 +27137,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
27034
27137
|
return false;
|
|
27035
27138
|
}
|
|
27036
27139
|
}
|
|
27037
|
-
function streamAsyncIteratorBrandCheckException(
|
|
27038
|
-
return new TypeError(`ReadableStreamAsyncIterator.${
|
|
27140
|
+
function streamAsyncIteratorBrandCheckException(name) {
|
|
27141
|
+
return new TypeError(`ReadableStreamAsyncIterator.${name} can only be used on a ReadableSteamAsyncIterator`);
|
|
27039
27142
|
}
|
|
27040
27143
|
const NumberIsNaN = Number.isNaN || function(x2) {
|
|
27041
27144
|
return x2 !== x2;
|
|
@@ -27675,11 +27778,11 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
27675
27778
|
request._associatedReadableByteStreamController = controller;
|
|
27676
27779
|
request._view = view;
|
|
27677
27780
|
}
|
|
27678
|
-
function byobRequestBrandCheckException(
|
|
27679
|
-
return new TypeError(`ReadableStreamBYOBRequest.prototype.${
|
|
27781
|
+
function byobRequestBrandCheckException(name) {
|
|
27782
|
+
return new TypeError(`ReadableStreamBYOBRequest.prototype.${name} can only be used on a ReadableStreamBYOBRequest`);
|
|
27680
27783
|
}
|
|
27681
|
-
function byteStreamControllerBrandCheckException(
|
|
27682
|
-
return new TypeError(`ReadableByteStreamController.prototype.${
|
|
27784
|
+
function byteStreamControllerBrandCheckException(name) {
|
|
27785
|
+
return new TypeError(`ReadableByteStreamController.prototype.${name} can only be used on a ReadableByteStreamController`);
|
|
27683
27786
|
}
|
|
27684
27787
|
function AcquireReadableStreamBYOBReader(stream) {
|
|
27685
27788
|
return new ReadableStreamBYOBReader(stream);
|
|
@@ -27812,8 +27915,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
27812
27915
|
ReadableByteStreamControllerPullInto(stream._readableStreamController, view, readIntoRequest);
|
|
27813
27916
|
}
|
|
27814
27917
|
}
|
|
27815
|
-
function byobReaderBrandCheckException(
|
|
27816
|
-
return new TypeError(`ReadableStreamBYOBReader.prototype.${
|
|
27918
|
+
function byobReaderBrandCheckException(name) {
|
|
27919
|
+
return new TypeError(`ReadableStreamBYOBReader.prototype.${name} can only be used on a ReadableStreamBYOBReader`);
|
|
27817
27920
|
}
|
|
27818
27921
|
function ExtractHighWaterMark(strategy, defaultHWM) {
|
|
27819
27922
|
const { highWaterMark } = strategy;
|
|
@@ -28583,17 +28686,17 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
28583
28686
|
WritableStreamDefaultControllerClearAlgorithms(controller);
|
|
28584
28687
|
WritableStreamStartErroring(stream, error);
|
|
28585
28688
|
}
|
|
28586
|
-
function streamBrandCheckException$2(
|
|
28587
|
-
return new TypeError(`WritableStream.prototype.${
|
|
28689
|
+
function streamBrandCheckException$2(name) {
|
|
28690
|
+
return new TypeError(`WritableStream.prototype.${name} can only be used on a WritableStream`);
|
|
28588
28691
|
}
|
|
28589
|
-
function defaultControllerBrandCheckException$2(
|
|
28590
|
-
return new TypeError(`WritableStreamDefaultController.prototype.${
|
|
28692
|
+
function defaultControllerBrandCheckException$2(name) {
|
|
28693
|
+
return new TypeError(`WritableStreamDefaultController.prototype.${name} can only be used on a WritableStreamDefaultController`);
|
|
28591
28694
|
}
|
|
28592
|
-
function defaultWriterBrandCheckException(
|
|
28593
|
-
return new TypeError(`WritableStreamDefaultWriter.prototype.${
|
|
28695
|
+
function defaultWriterBrandCheckException(name) {
|
|
28696
|
+
return new TypeError(`WritableStreamDefaultWriter.prototype.${name} can only be used on a WritableStreamDefaultWriter`);
|
|
28594
28697
|
}
|
|
28595
|
-
function defaultWriterLockException(
|
|
28596
|
-
return new TypeError("Cannot " +
|
|
28698
|
+
function defaultWriterLockException(name) {
|
|
28699
|
+
return new TypeError("Cannot " + name + " a stream using a released writer");
|
|
28597
28700
|
}
|
|
28598
28701
|
function defaultWriterClosedPromiseInitialize(writer) {
|
|
28599
28702
|
writer._closedPromise = newPromise((resolve2, reject) => {
|
|
@@ -28685,9 +28788,9 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
28685
28788
|
}
|
|
28686
28789
|
}
|
|
28687
28790
|
function createDOMExceptionPolyfill() {
|
|
28688
|
-
const ctor = function DOMException3(message,
|
|
28791
|
+
const ctor = function DOMException3(message, name) {
|
|
28689
28792
|
this.message = message || "";
|
|
28690
|
-
this.name =
|
|
28793
|
+
this.name = name || "Error";
|
|
28691
28794
|
if (Error.captureStackTrace) {
|
|
28692
28795
|
Error.captureStackTrace(this, this.constructor);
|
|
28693
28796
|
}
|
|
@@ -29075,8 +29178,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
29075
29178
|
}
|
|
29076
29179
|
SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);
|
|
29077
29180
|
}
|
|
29078
|
-
function defaultControllerBrandCheckException$1(
|
|
29079
|
-
return new TypeError(`ReadableStreamDefaultController.prototype.${
|
|
29181
|
+
function defaultControllerBrandCheckException$1(name) {
|
|
29182
|
+
return new TypeError(`ReadableStreamDefaultController.prototype.${name} can only be used on a ReadableStreamDefaultController`);
|
|
29080
29183
|
}
|
|
29081
29184
|
function ReadableStreamTee(stream, cloneForBranch2) {
|
|
29082
29185
|
if (IsReadableByteStreamController(stream._readableStreamController)) {
|
|
@@ -29684,8 +29787,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
29684
29787
|
reader._readIntoRequests = new SimpleQueue();
|
|
29685
29788
|
}
|
|
29686
29789
|
}
|
|
29687
|
-
function streamBrandCheckException$1(
|
|
29688
|
-
return new TypeError(`ReadableStream.prototype.${
|
|
29790
|
+
function streamBrandCheckException$1(name) {
|
|
29791
|
+
return new TypeError(`ReadableStream.prototype.${name} can only be used on a ReadableStream`);
|
|
29689
29792
|
}
|
|
29690
29793
|
function convertQueuingStrategyInit(init, context) {
|
|
29691
29794
|
assertDictionary(init, context);
|
|
@@ -29734,8 +29837,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
29734
29837
|
configurable: true
|
|
29735
29838
|
});
|
|
29736
29839
|
}
|
|
29737
|
-
function byteLengthBrandCheckException(
|
|
29738
|
-
return new TypeError(`ByteLengthQueuingStrategy.prototype.${
|
|
29840
|
+
function byteLengthBrandCheckException(name) {
|
|
29841
|
+
return new TypeError(`ByteLengthQueuingStrategy.prototype.${name} can only be used on a ByteLengthQueuingStrategy`);
|
|
29739
29842
|
}
|
|
29740
29843
|
function IsByteLengthQueuingStrategy(x2) {
|
|
29741
29844
|
if (!typeIsObject(x2)) {
|
|
@@ -29785,8 +29888,8 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
29785
29888
|
configurable: true
|
|
29786
29889
|
});
|
|
29787
29890
|
}
|
|
29788
|
-
function countBrandCheckException(
|
|
29789
|
-
return new TypeError(`CountQueuingStrategy.prototype.${
|
|
29891
|
+
function countBrandCheckException(name) {
|
|
29892
|
+
return new TypeError(`CountQueuingStrategy.prototype.${name} can only be used on a CountQueuingStrategy`);
|
|
29790
29893
|
}
|
|
29791
29894
|
function IsCountQueuingStrategy(x2) {
|
|
29792
29895
|
if (!typeIsObject(x2)) {
|
|
@@ -30086,11 +30189,11 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
30086
30189
|
TransformStreamSetBackpressure(stream, false);
|
|
30087
30190
|
return stream._backpressureChangePromise;
|
|
30088
30191
|
}
|
|
30089
|
-
function defaultControllerBrandCheckException(
|
|
30090
|
-
return new TypeError(`TransformStreamDefaultController.prototype.${
|
|
30192
|
+
function defaultControllerBrandCheckException(name) {
|
|
30193
|
+
return new TypeError(`TransformStreamDefaultController.prototype.${name} can only be used on a TransformStreamDefaultController`);
|
|
30091
30194
|
}
|
|
30092
|
-
function streamBrandCheckException(
|
|
30093
|
-
return new TypeError(`TransformStream.prototype.${
|
|
30195
|
+
function streamBrandCheckException(name) {
|
|
30196
|
+
return new TypeError(`TransformStream.prototype.${name} can only be used on a TransformStream`);
|
|
30094
30197
|
}
|
|
30095
30198
|
exports2.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy;
|
|
30096
30199
|
exports2.CountQueuingStrategy = CountQueuingStrategy;
|
|
@@ -30134,7 +30237,7 @@ var require_streams = __commonJS({
|
|
|
30134
30237
|
try {
|
|
30135
30238
|
const { Blob: Blob3 } = __require("buffer");
|
|
30136
30239
|
if (Blob3 && !Blob3.prototype.stream) {
|
|
30137
|
-
Blob3.prototype.stream = function
|
|
30240
|
+
Blob3.prototype.stream = function name(params) {
|
|
30138
30241
|
let position = 0;
|
|
30139
30242
|
const blob = this;
|
|
30140
30243
|
return new ReadableStream({
|
|
@@ -30672,27 +30775,27 @@ var init_multipart_parser = __esm({
|
|
|
30672
30775
|
const bufferLength = data.length;
|
|
30673
30776
|
let c;
|
|
30674
30777
|
let cl;
|
|
30675
|
-
const mark = (
|
|
30676
|
-
this[
|
|
30778
|
+
const mark = (name) => {
|
|
30779
|
+
this[name + "Mark"] = i2;
|
|
30677
30780
|
};
|
|
30678
|
-
const clear = (
|
|
30679
|
-
delete this[
|
|
30781
|
+
const clear = (name) => {
|
|
30782
|
+
delete this[name + "Mark"];
|
|
30680
30783
|
};
|
|
30681
30784
|
const callback = (callbackSymbol, start, end, ui8a) => {
|
|
30682
30785
|
if (start === void 0 || start !== end) {
|
|
30683
30786
|
this[callbackSymbol](ui8a && ui8a.subarray(start, end));
|
|
30684
30787
|
}
|
|
30685
30788
|
};
|
|
30686
|
-
const dataCallback = (
|
|
30687
|
-
const markSymbol =
|
|
30789
|
+
const dataCallback = (name, clear2) => {
|
|
30790
|
+
const markSymbol = name + "Mark";
|
|
30688
30791
|
if (!(markSymbol in this)) {
|
|
30689
30792
|
return;
|
|
30690
30793
|
}
|
|
30691
30794
|
if (clear2) {
|
|
30692
|
-
callback(
|
|
30795
|
+
callback(name, this[markSymbol], i2, data);
|
|
30693
30796
|
delete this[markSymbol];
|
|
30694
30797
|
} else {
|
|
30695
|
-
callback(
|
|
30798
|
+
callback(name, this[markSymbol], data.length, data);
|
|
30696
30799
|
this[markSymbol] = 0;
|
|
30697
30800
|
}
|
|
30698
30801
|
};
|
|
@@ -31090,10 +31193,10 @@ var require_lib3 = __commonJS({
|
|
|
31090
31193
|
MissingSemicolon: "Missing semicolon.",
|
|
31091
31194
|
MissingPlugin: ({
|
|
31092
31195
|
missingPlugin
|
|
31093
|
-
}) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map((
|
|
31196
|
+
}) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map((name) => JSON.stringify(name)).join(", ")}.`,
|
|
31094
31197
|
MissingOneOfPlugins: ({
|
|
31095
31198
|
missingPlugin
|
|
31096
|
-
}) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map((
|
|
31199
|
+
}) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map((name) => JSON.stringify(name)).join(", ")}.`,
|
|
31097
31200
|
MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.",
|
|
31098
31201
|
MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.",
|
|
31099
31202
|
ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.",
|
|
@@ -31411,10 +31514,10 @@ var require_lib3 = __commonJS({
|
|
|
31411
31514
|
return this.convertPrivateNameToPrivateIdentifier(node);
|
|
31412
31515
|
}
|
|
31413
31516
|
convertPrivateNameToPrivateIdentifier(node) {
|
|
31414
|
-
const
|
|
31517
|
+
const name = super.getPrivateNameSV(node);
|
|
31415
31518
|
node = node;
|
|
31416
31519
|
delete node.id;
|
|
31417
|
-
node.name =
|
|
31520
|
+
node.name = name;
|
|
31418
31521
|
node.type = "PrivateIdentifier";
|
|
31419
31522
|
return node;
|
|
31420
31523
|
}
|
|
@@ -31687,14 +31790,14 @@ var require_lib3 = __commonJS({
|
|
|
31687
31790
|
}
|
|
31688
31791
|
};
|
|
31689
31792
|
var keywords$1 = /* @__PURE__ */ new Map();
|
|
31690
|
-
function createKeyword(
|
|
31691
|
-
options.keyword =
|
|
31692
|
-
const token = createToken(
|
|
31693
|
-
keywords$1.set(
|
|
31793
|
+
function createKeyword(name, options = {}) {
|
|
31794
|
+
options.keyword = name;
|
|
31795
|
+
const token = createToken(name, options);
|
|
31796
|
+
keywords$1.set(name, token);
|
|
31694
31797
|
return token;
|
|
31695
31798
|
}
|
|
31696
|
-
function createBinop(
|
|
31697
|
-
return createToken(
|
|
31799
|
+
function createBinop(name, binop) {
|
|
31800
|
+
return createToken(name, {
|
|
31698
31801
|
beforeExpr,
|
|
31699
31802
|
binop
|
|
31700
31803
|
});
|
|
@@ -31706,22 +31809,22 @@ var require_lib3 = __commonJS({
|
|
|
31706
31809
|
var tokenBeforeExprs = [];
|
|
31707
31810
|
var tokenStartsExprs = [];
|
|
31708
31811
|
var tokenPrefixes = [];
|
|
31709
|
-
function createToken(
|
|
31812
|
+
function createToken(name, options = {}) {
|
|
31710
31813
|
var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix;
|
|
31711
31814
|
++tokenTypeCounter;
|
|
31712
|
-
tokenLabels.push(
|
|
31815
|
+
tokenLabels.push(name);
|
|
31713
31816
|
tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1);
|
|
31714
31817
|
tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false);
|
|
31715
31818
|
tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false);
|
|
31716
31819
|
tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false);
|
|
31717
|
-
tokenTypes.push(new ExportedTokenType(
|
|
31820
|
+
tokenTypes.push(new ExportedTokenType(name, options));
|
|
31718
31821
|
return tokenTypeCounter;
|
|
31719
31822
|
}
|
|
31720
|
-
function createKeywordLike(
|
|
31823
|
+
function createKeywordLike(name, options = {}) {
|
|
31721
31824
|
var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2;
|
|
31722
31825
|
++tokenTypeCounter;
|
|
31723
|
-
keywords$1.set(
|
|
31724
|
-
tokenLabels.push(
|
|
31826
|
+
keywords$1.set(name, tokenTypeCounter);
|
|
31827
|
+
tokenLabels.push(name);
|
|
31725
31828
|
tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1);
|
|
31726
31829
|
tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false);
|
|
31727
31830
|
tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false);
|
|
@@ -32440,63 +32543,63 @@ var require_lib3 = __commonJS({
|
|
|
32440
32543
|
treatFunctionsAsVarInScope(scope) {
|
|
32441
32544
|
return !!(scope.flags & (SCOPE_FUNCTION | SCOPE_STATIC_BLOCK) || !this.parser.inModule && scope.flags & SCOPE_PROGRAM);
|
|
32442
32545
|
}
|
|
32443
|
-
declareName(
|
|
32546
|
+
declareName(name, bindingType, loc) {
|
|
32444
32547
|
let scope = this.currentScope();
|
|
32445
32548
|
if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) {
|
|
32446
|
-
this.checkRedeclarationInScope(scope,
|
|
32549
|
+
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
32447
32550
|
if (bindingType & BIND_SCOPE_FUNCTION) {
|
|
32448
|
-
scope.functions.add(
|
|
32551
|
+
scope.functions.add(name);
|
|
32449
32552
|
} else {
|
|
32450
|
-
scope.lexical.add(
|
|
32553
|
+
scope.lexical.add(name);
|
|
32451
32554
|
}
|
|
32452
32555
|
if (bindingType & BIND_SCOPE_LEXICAL) {
|
|
32453
|
-
this.maybeExportDefined(scope,
|
|
32556
|
+
this.maybeExportDefined(scope, name);
|
|
32454
32557
|
}
|
|
32455
32558
|
} else if (bindingType & BIND_SCOPE_VAR) {
|
|
32456
32559
|
for (let i2 = this.scopeStack.length - 1; i2 >= 0; --i2) {
|
|
32457
32560
|
scope = this.scopeStack[i2];
|
|
32458
|
-
this.checkRedeclarationInScope(scope,
|
|
32459
|
-
scope.var.add(
|
|
32460
|
-
this.maybeExportDefined(scope,
|
|
32561
|
+
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
32562
|
+
scope.var.add(name);
|
|
32563
|
+
this.maybeExportDefined(scope, name);
|
|
32461
32564
|
if (scope.flags & SCOPE_VAR)
|
|
32462
32565
|
break;
|
|
32463
32566
|
}
|
|
32464
32567
|
}
|
|
32465
32568
|
if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) {
|
|
32466
|
-
this.undefinedExports.delete(
|
|
32569
|
+
this.undefinedExports.delete(name);
|
|
32467
32570
|
}
|
|
32468
32571
|
}
|
|
32469
|
-
maybeExportDefined(scope,
|
|
32572
|
+
maybeExportDefined(scope, name) {
|
|
32470
32573
|
if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) {
|
|
32471
|
-
this.undefinedExports.delete(
|
|
32574
|
+
this.undefinedExports.delete(name);
|
|
32472
32575
|
}
|
|
32473
32576
|
}
|
|
32474
|
-
checkRedeclarationInScope(scope,
|
|
32475
|
-
if (this.isRedeclaredInScope(scope,
|
|
32577
|
+
checkRedeclarationInScope(scope, name, bindingType, loc) {
|
|
32578
|
+
if (this.isRedeclaredInScope(scope, name, bindingType)) {
|
|
32476
32579
|
this.parser.raise(Errors.VarRedeclaration, {
|
|
32477
32580
|
at: loc,
|
|
32478
|
-
identifierName:
|
|
32581
|
+
identifierName: name
|
|
32479
32582
|
});
|
|
32480
32583
|
}
|
|
32481
32584
|
}
|
|
32482
|
-
isRedeclaredInScope(scope,
|
|
32585
|
+
isRedeclaredInScope(scope, name, bindingType) {
|
|
32483
32586
|
if (!(bindingType & BIND_KIND_VALUE))
|
|
32484
32587
|
return false;
|
|
32485
32588
|
if (bindingType & BIND_SCOPE_LEXICAL) {
|
|
32486
|
-
return scope.lexical.has(
|
|
32589
|
+
return scope.lexical.has(name) || scope.functions.has(name) || scope.var.has(name);
|
|
32487
32590
|
}
|
|
32488
32591
|
if (bindingType & BIND_SCOPE_FUNCTION) {
|
|
32489
|
-
return scope.lexical.has(
|
|
32592
|
+
return scope.lexical.has(name) || !this.treatFunctionsAsVarInScope(scope) && scope.var.has(name);
|
|
32490
32593
|
}
|
|
32491
|
-
return scope.lexical.has(
|
|
32594
|
+
return scope.lexical.has(name) && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical.values().next().value === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name);
|
|
32492
32595
|
}
|
|
32493
32596
|
checkLocalExport(id) {
|
|
32494
32597
|
const {
|
|
32495
|
-
name
|
|
32598
|
+
name
|
|
32496
32599
|
} = id;
|
|
32497
32600
|
const topLevelScope = this.scopeStack[0];
|
|
32498
|
-
if (!topLevelScope.lexical.has(
|
|
32499
|
-
this.undefinedExports.set(
|
|
32601
|
+
if (!topLevelScope.lexical.has(name) && !topLevelScope.var.has(name) && !topLevelScope.functions.has(name)) {
|
|
32602
|
+
this.undefinedExports.set(name, id.loc.start);
|
|
32500
32603
|
}
|
|
32501
32604
|
}
|
|
32502
32605
|
currentScope() {
|
|
@@ -32533,21 +32636,21 @@ var require_lib3 = __commonJS({
|
|
|
32533
32636
|
createScope(flags) {
|
|
32534
32637
|
return new FlowScope(flags);
|
|
32535
32638
|
}
|
|
32536
|
-
declareName(
|
|
32639
|
+
declareName(name, bindingType, loc) {
|
|
32537
32640
|
const scope = this.currentScope();
|
|
32538
32641
|
if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {
|
|
32539
|
-
this.checkRedeclarationInScope(scope,
|
|
32540
|
-
this.maybeExportDefined(scope,
|
|
32541
|
-
scope.declareFunctions.add(
|
|
32642
|
+
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
32643
|
+
this.maybeExportDefined(scope, name);
|
|
32644
|
+
scope.declareFunctions.add(name);
|
|
32542
32645
|
return;
|
|
32543
32646
|
}
|
|
32544
|
-
super.declareName(
|
|
32647
|
+
super.declareName(name, bindingType, loc);
|
|
32545
32648
|
}
|
|
32546
|
-
isRedeclaredInScope(scope,
|
|
32547
|
-
if (super.isRedeclaredInScope(scope,
|
|
32649
|
+
isRedeclaredInScope(scope, name, bindingType) {
|
|
32650
|
+
if (super.isRedeclaredInScope(scope, name, bindingType))
|
|
32548
32651
|
return true;
|
|
32549
32652
|
if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {
|
|
32550
|
-
return !scope.declareFunctions.has(
|
|
32653
|
+
return !scope.declareFunctions.has(name) && (scope.lexical.has(name) || scope.functions.has(name));
|
|
32551
32654
|
}
|
|
32552
32655
|
return false;
|
|
32553
32656
|
}
|
|
@@ -32579,9 +32682,9 @@ var require_lib3 = __commonJS({
|
|
|
32579
32682
|
return true;
|
|
32580
32683
|
}
|
|
32581
32684
|
}
|
|
32582
|
-
getPluginOption(
|
|
32685
|
+
getPluginOption(plugin2, name) {
|
|
32583
32686
|
var _this$plugins$get;
|
|
32584
|
-
return (_this$plugins$get = this.plugins.get(
|
|
32687
|
+
return (_this$plugins$get = this.plugins.get(plugin2)) == null ? void 0 : _this$plugins$get[name];
|
|
32585
32688
|
}
|
|
32586
32689
|
};
|
|
32587
32690
|
function setTrailingComments(node, comments) {
|
|
@@ -34258,7 +34361,7 @@ var require_lib3 = __commonJS({
|
|
|
34258
34361
|
});
|
|
34259
34362
|
}
|
|
34260
34363
|
expectOnePlugin(pluginNames) {
|
|
34261
|
-
if (!pluginNames.some((
|
|
34364
|
+
if (!pluginNames.some((name) => this.hasPlugin(name))) {
|
|
34262
34365
|
throw this.raise(Errors.MissingOneOfPlugins, {
|
|
34263
34366
|
at: this.state.startLoc,
|
|
34264
34367
|
missingPlugin: pluginNames
|
|
@@ -34296,28 +34399,28 @@ var require_lib3 = __commonJS({
|
|
|
34296
34399
|
exit() {
|
|
34297
34400
|
const oldClassScope = this.stack.pop();
|
|
34298
34401
|
const current = this.current();
|
|
34299
|
-
for (const [
|
|
34402
|
+
for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) {
|
|
34300
34403
|
if (current) {
|
|
34301
|
-
if (!current.undefinedPrivateNames.has(
|
|
34302
|
-
current.undefinedPrivateNames.set(
|
|
34404
|
+
if (!current.undefinedPrivateNames.has(name)) {
|
|
34405
|
+
current.undefinedPrivateNames.set(name, loc);
|
|
34303
34406
|
}
|
|
34304
34407
|
} else {
|
|
34305
34408
|
this.parser.raise(Errors.InvalidPrivateFieldResolution, {
|
|
34306
34409
|
at: loc,
|
|
34307
|
-
identifierName:
|
|
34410
|
+
identifierName: name
|
|
34308
34411
|
});
|
|
34309
34412
|
}
|
|
34310
34413
|
}
|
|
34311
34414
|
}
|
|
34312
|
-
declarePrivateName(
|
|
34415
|
+
declarePrivateName(name, elementType, loc) {
|
|
34313
34416
|
const {
|
|
34314
34417
|
privateNames,
|
|
34315
34418
|
loneAccessors,
|
|
34316
34419
|
undefinedPrivateNames
|
|
34317
34420
|
} = this.current();
|
|
34318
|
-
let redefined = privateNames.has(
|
|
34421
|
+
let redefined = privateNames.has(name);
|
|
34319
34422
|
if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) {
|
|
34320
|
-
const accessor = redefined && loneAccessors.get(
|
|
34423
|
+
const accessor = redefined && loneAccessors.get(name);
|
|
34321
34424
|
if (accessor) {
|
|
34322
34425
|
const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC;
|
|
34323
34426
|
const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC;
|
|
@@ -34325,32 +34428,32 @@ var require_lib3 = __commonJS({
|
|
|
34325
34428
|
const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR;
|
|
34326
34429
|
redefined = oldKind === newKind || oldStatic !== newStatic;
|
|
34327
34430
|
if (!redefined)
|
|
34328
|
-
loneAccessors.delete(
|
|
34431
|
+
loneAccessors.delete(name);
|
|
34329
34432
|
} else if (!redefined) {
|
|
34330
|
-
loneAccessors.set(
|
|
34433
|
+
loneAccessors.set(name, elementType);
|
|
34331
34434
|
}
|
|
34332
34435
|
}
|
|
34333
34436
|
if (redefined) {
|
|
34334
34437
|
this.parser.raise(Errors.PrivateNameRedeclaration, {
|
|
34335
34438
|
at: loc,
|
|
34336
|
-
identifierName:
|
|
34439
|
+
identifierName: name
|
|
34337
34440
|
});
|
|
34338
34441
|
}
|
|
34339
|
-
privateNames.add(
|
|
34340
|
-
undefinedPrivateNames.delete(
|
|
34442
|
+
privateNames.add(name);
|
|
34443
|
+
undefinedPrivateNames.delete(name);
|
|
34341
34444
|
}
|
|
34342
|
-
usePrivateName(
|
|
34445
|
+
usePrivateName(name, loc) {
|
|
34343
34446
|
let classScope;
|
|
34344
34447
|
for (classScope of this.stack) {
|
|
34345
|
-
if (classScope.privateNames.has(
|
|
34448
|
+
if (classScope.privateNames.has(name))
|
|
34346
34449
|
return;
|
|
34347
34450
|
}
|
|
34348
34451
|
if (classScope) {
|
|
34349
|
-
classScope.undefinedPrivateNames.set(
|
|
34452
|
+
classScope.undefinedPrivateNames.set(name, loc);
|
|
34350
34453
|
} else {
|
|
34351
34454
|
this.parser.raise(Errors.InvalidPrivateFieldResolution, {
|
|
34352
34455
|
at: loc,
|
|
34353
|
-
identifierName:
|
|
34456
|
+
identifierName: name
|
|
34354
34457
|
});
|
|
34355
34458
|
}
|
|
34356
34459
|
}
|
|
@@ -34540,17 +34643,17 @@ var require_lib3 = __commonJS({
|
|
|
34540
34643
|
isContextual(token) {
|
|
34541
34644
|
return this.state.type === token && !this.state.containsEsc;
|
|
34542
34645
|
}
|
|
34543
|
-
isUnparsedContextual(nameStart,
|
|
34544
|
-
const nameEnd = nameStart +
|
|
34545
|
-
if (this.input.slice(nameStart, nameEnd) ===
|
|
34646
|
+
isUnparsedContextual(nameStart, name) {
|
|
34647
|
+
const nameEnd = nameStart + name.length;
|
|
34648
|
+
if (this.input.slice(nameStart, nameEnd) === name) {
|
|
34546
34649
|
const nextCh = this.input.charCodeAt(nameEnd);
|
|
34547
34650
|
return !(isIdentifierChar(nextCh) || (nextCh & 64512) === 55296);
|
|
34548
34651
|
}
|
|
34549
34652
|
return false;
|
|
34550
34653
|
}
|
|
34551
|
-
isLookaheadContextual(
|
|
34654
|
+
isLookaheadContextual(name) {
|
|
34552
34655
|
const next = this.nextTokenStart();
|
|
34553
|
-
return this.isUnparsedContextual(next,
|
|
34656
|
+
return this.isUnparsedContextual(next, name);
|
|
34554
34657
|
}
|
|
34555
34658
|
eatContextual(token) {
|
|
34556
34659
|
if (this.isContextual(token)) {
|
|
@@ -34785,7 +34888,7 @@ var require_lib3 = __commonJS({
|
|
|
34785
34888
|
loc,
|
|
34786
34889
|
range,
|
|
34787
34890
|
extra,
|
|
34788
|
-
name
|
|
34891
|
+
name
|
|
34789
34892
|
} = node;
|
|
34790
34893
|
const cloned = Object.create(NodePrototype);
|
|
34791
34894
|
cloned.type = type;
|
|
@@ -34794,7 +34897,7 @@ var require_lib3 = __commonJS({
|
|
|
34794
34897
|
cloned.loc = loc;
|
|
34795
34898
|
cloned.range = range;
|
|
34796
34899
|
cloned.extra = extra;
|
|
34797
|
-
cloned.name =
|
|
34900
|
+
cloned.name = name;
|
|
34798
34901
|
if (type === "Placeholder") {
|
|
34799
34902
|
cloned.expectedNode = node.expectedNode;
|
|
34800
34903
|
}
|
|
@@ -35754,7 +35857,7 @@ var require_lib3 = __commonJS({
|
|
|
35754
35857
|
return this.finishNode(node, "TupleTypeAnnotation");
|
|
35755
35858
|
}
|
|
35756
35859
|
flowParseFunctionTypeParam(first) {
|
|
35757
|
-
let
|
|
35860
|
+
let name = null;
|
|
35758
35861
|
let optional = false;
|
|
35759
35862
|
let typeAnnotation = null;
|
|
35760
35863
|
const node = this.startNode();
|
|
@@ -35766,7 +35869,7 @@ var require_lib3 = __commonJS({
|
|
|
35766
35869
|
at: node
|
|
35767
35870
|
});
|
|
35768
35871
|
}
|
|
35769
|
-
|
|
35872
|
+
name = this.parseIdentifier(isThis);
|
|
35770
35873
|
if (this.eat(17)) {
|
|
35771
35874
|
optional = true;
|
|
35772
35875
|
if (isThis) {
|
|
@@ -35779,7 +35882,7 @@ var require_lib3 = __commonJS({
|
|
|
35779
35882
|
} else {
|
|
35780
35883
|
typeAnnotation = this.flowParseType();
|
|
35781
35884
|
}
|
|
35782
|
-
node.name =
|
|
35885
|
+
node.name = name;
|
|
35783
35886
|
node.optional = optional;
|
|
35784
35887
|
node.typeAnnotation = typeAnnotation;
|
|
35785
35888
|
return this.finishNode(node, "FunctionTypeParam");
|
|
@@ -37791,11 +37894,11 @@ var require_lib3 = __commonJS({
|
|
|
37791
37894
|
}
|
|
37792
37895
|
jsxParseNamespacedName() {
|
|
37793
37896
|
const startLoc = this.state.startLoc;
|
|
37794
|
-
const
|
|
37897
|
+
const name = this.jsxParseIdentifier();
|
|
37795
37898
|
if (!this.eat(14))
|
|
37796
|
-
return
|
|
37899
|
+
return name;
|
|
37797
37900
|
const node = this.startNodeAt(startLoc);
|
|
37798
|
-
node.namespace =
|
|
37901
|
+
node.namespace = name;
|
|
37799
37902
|
node.name = this.jsxParseIdentifier();
|
|
37800
37903
|
return this.finishNode(node, "JSXNamespacedName");
|
|
37801
37904
|
}
|
|
@@ -38079,82 +38182,82 @@ var require_lib3 = __commonJS({
|
|
|
38079
38182
|
}
|
|
38080
38183
|
return flags;
|
|
38081
38184
|
}
|
|
38082
|
-
hasImport(
|
|
38185
|
+
hasImport(name, allowShadow) {
|
|
38083
38186
|
const len = this.importsStack.length;
|
|
38084
|
-
if (this.importsStack[len - 1].has(
|
|
38187
|
+
if (this.importsStack[len - 1].has(name)) {
|
|
38085
38188
|
return true;
|
|
38086
38189
|
}
|
|
38087
38190
|
if (!allowShadow && len > 1) {
|
|
38088
38191
|
for (let i2 = 0; i2 < len - 1; i2++) {
|
|
38089
|
-
if (this.importsStack[i2].has(
|
|
38192
|
+
if (this.importsStack[i2].has(name))
|
|
38090
38193
|
return true;
|
|
38091
38194
|
}
|
|
38092
38195
|
}
|
|
38093
38196
|
return false;
|
|
38094
38197
|
}
|
|
38095
|
-
declareName(
|
|
38198
|
+
declareName(name, bindingType, loc) {
|
|
38096
38199
|
if (bindingType & BIND_FLAGS_TS_IMPORT) {
|
|
38097
|
-
if (this.hasImport(
|
|
38200
|
+
if (this.hasImport(name, true)) {
|
|
38098
38201
|
this.parser.raise(Errors.VarRedeclaration, {
|
|
38099
38202
|
at: loc,
|
|
38100
|
-
identifierName:
|
|
38203
|
+
identifierName: name
|
|
38101
38204
|
});
|
|
38102
38205
|
}
|
|
38103
|
-
this.importsStack[this.importsStack.length - 1].add(
|
|
38206
|
+
this.importsStack[this.importsStack.length - 1].add(name);
|
|
38104
38207
|
return;
|
|
38105
38208
|
}
|
|
38106
38209
|
const scope = this.currentScope();
|
|
38107
38210
|
if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) {
|
|
38108
|
-
this.maybeExportDefined(scope,
|
|
38109
|
-
scope.exportOnlyBindings.add(
|
|
38211
|
+
this.maybeExportDefined(scope, name);
|
|
38212
|
+
scope.exportOnlyBindings.add(name);
|
|
38110
38213
|
return;
|
|
38111
38214
|
}
|
|
38112
|
-
super.declareName(
|
|
38215
|
+
super.declareName(name, bindingType, loc);
|
|
38113
38216
|
if (bindingType & BIND_KIND_TYPE) {
|
|
38114
38217
|
if (!(bindingType & BIND_KIND_VALUE)) {
|
|
38115
|
-
this.checkRedeclarationInScope(scope,
|
|
38116
|
-
this.maybeExportDefined(scope,
|
|
38218
|
+
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
38219
|
+
this.maybeExportDefined(scope, name);
|
|
38117
38220
|
}
|
|
38118
|
-
scope.types.add(
|
|
38221
|
+
scope.types.add(name);
|
|
38119
38222
|
}
|
|
38120
38223
|
if (bindingType & BIND_FLAGS_TS_ENUM)
|
|
38121
|
-
scope.enums.add(
|
|
38224
|
+
scope.enums.add(name);
|
|
38122
38225
|
if (bindingType & BIND_FLAGS_TS_CONST_ENUM)
|
|
38123
|
-
scope.constEnums.add(
|
|
38226
|
+
scope.constEnums.add(name);
|
|
38124
38227
|
if (bindingType & BIND_FLAGS_CLASS)
|
|
38125
|
-
scope.classes.add(
|
|
38228
|
+
scope.classes.add(name);
|
|
38126
38229
|
}
|
|
38127
|
-
isRedeclaredInScope(scope,
|
|
38128
|
-
if (scope.enums.has(
|
|
38230
|
+
isRedeclaredInScope(scope, name, bindingType) {
|
|
38231
|
+
if (scope.enums.has(name)) {
|
|
38129
38232
|
if (bindingType & BIND_FLAGS_TS_ENUM) {
|
|
38130
38233
|
const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM);
|
|
38131
|
-
const wasConst = scope.constEnums.has(
|
|
38234
|
+
const wasConst = scope.constEnums.has(name);
|
|
38132
38235
|
return isConst !== wasConst;
|
|
38133
38236
|
}
|
|
38134
38237
|
return true;
|
|
38135
38238
|
}
|
|
38136
|
-
if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(
|
|
38137
|
-
if (scope.lexical.has(
|
|
38239
|
+
if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(name)) {
|
|
38240
|
+
if (scope.lexical.has(name)) {
|
|
38138
38241
|
return !!(bindingType & BIND_KIND_VALUE);
|
|
38139
38242
|
} else {
|
|
38140
38243
|
return false;
|
|
38141
38244
|
}
|
|
38142
38245
|
}
|
|
38143
|
-
if (bindingType & BIND_KIND_TYPE && scope.types.has(
|
|
38246
|
+
if (bindingType & BIND_KIND_TYPE && scope.types.has(name)) {
|
|
38144
38247
|
return true;
|
|
38145
38248
|
}
|
|
38146
|
-
return super.isRedeclaredInScope(scope,
|
|
38249
|
+
return super.isRedeclaredInScope(scope, name, bindingType);
|
|
38147
38250
|
}
|
|
38148
38251
|
checkLocalExport(id) {
|
|
38149
38252
|
const {
|
|
38150
|
-
name
|
|
38253
|
+
name
|
|
38151
38254
|
} = id;
|
|
38152
|
-
if (this.hasImport(
|
|
38255
|
+
if (this.hasImport(name))
|
|
38153
38256
|
return;
|
|
38154
38257
|
const len = this.scopeStack.length;
|
|
38155
38258
|
for (let i2 = len - 1; i2 >= 0; i2--) {
|
|
38156
38259
|
const scope = this.scopeStack[i2];
|
|
38157
|
-
if (scope.types.has(
|
|
38260
|
+
if (scope.types.has(name) || scope.exportOnlyBindings.has(name))
|
|
38158
38261
|
return;
|
|
38159
38262
|
}
|
|
38160
38263
|
super.checkLocalExport(id);
|
|
@@ -40949,8 +41052,8 @@ var require_lib3 = __commonJS({
|
|
|
40949
41052
|
const node = this.startNode();
|
|
40950
41053
|
this.next();
|
|
40951
41054
|
if (tokenIsIdentifier(this.state.type)) {
|
|
40952
|
-
const
|
|
40953
|
-
const identifier = this.createIdentifier(node,
|
|
41055
|
+
const name = this.parseIdentifierName();
|
|
41056
|
+
const identifier = this.createIdentifier(node, name);
|
|
40954
41057
|
identifier.type = "V8IntrinsicIdentifier";
|
|
40955
41058
|
if (this.match(10)) {
|
|
40956
41059
|
return identifier;
|
|
@@ -40984,16 +41087,16 @@ var require_lib3 = __commonJS({
|
|
|
40984
41087
|
}
|
|
40985
41088
|
});
|
|
40986
41089
|
}
|
|
40987
|
-
function getPluginOption(plugins,
|
|
40988
|
-
const
|
|
40989
|
-
if (Array.isArray(
|
|
40990
|
-
return
|
|
41090
|
+
function getPluginOption(plugins, name, option) {
|
|
41091
|
+
const plugin2 = plugins.find((plugin3) => {
|
|
41092
|
+
if (Array.isArray(plugin3)) {
|
|
41093
|
+
return plugin3[0] === name;
|
|
40991
41094
|
} else {
|
|
40992
|
-
return
|
|
41095
|
+
return plugin3 === name;
|
|
40993
41096
|
}
|
|
40994
41097
|
});
|
|
40995
|
-
if (
|
|
40996
|
-
return
|
|
41098
|
+
if (plugin2 && Array.isArray(plugin2) && plugin2.length > 1) {
|
|
41099
|
+
return plugin2[1][option];
|
|
40997
41100
|
}
|
|
40998
41101
|
return null;
|
|
40999
41102
|
}
|
|
@@ -41412,15 +41515,15 @@ var require_lib3 = __commonJS({
|
|
|
41412
41515
|
if (expression.type === "Identifier") {
|
|
41413
41516
|
this.checkIdentifier(expression, binding, strictModeChanged, allowingSloppyLetBinding);
|
|
41414
41517
|
const {
|
|
41415
|
-
name
|
|
41518
|
+
name
|
|
41416
41519
|
} = expression;
|
|
41417
41520
|
if (checkClashes) {
|
|
41418
|
-
if (checkClashes.has(
|
|
41521
|
+
if (checkClashes.has(name)) {
|
|
41419
41522
|
this.raise(Errors.ParamDupe, {
|
|
41420
41523
|
at: expression
|
|
41421
41524
|
});
|
|
41422
41525
|
} else {
|
|
41423
|
-
checkClashes.add(
|
|
41526
|
+
checkClashes.add(name);
|
|
41424
41527
|
}
|
|
41425
41528
|
}
|
|
41426
41529
|
return;
|
|
@@ -41516,8 +41619,8 @@ var require_lib3 = __commonJS({
|
|
|
41516
41619
|
return;
|
|
41517
41620
|
}
|
|
41518
41621
|
const key = prop.key;
|
|
41519
|
-
const
|
|
41520
|
-
if (
|
|
41622
|
+
const name = key.type === "Identifier" ? key.name : key.value;
|
|
41623
|
+
if (name === "__proto__") {
|
|
41521
41624
|
if (isRecord) {
|
|
41522
41625
|
this.raise(Errors.RecordNoProto, {
|
|
41523
41626
|
at: key
|
|
@@ -42368,9 +42471,9 @@ var require_lib3 = __commonJS({
|
|
|
42368
42471
|
const id = this.startNodeAt(
|
|
42369
42472
|
createPositionWithColumnOffset(this.state.startLoc, 1)
|
|
42370
42473
|
);
|
|
42371
|
-
const
|
|
42474
|
+
const name = this.state.value;
|
|
42372
42475
|
this.next();
|
|
42373
|
-
node.id = this.createIdentifier(id,
|
|
42476
|
+
node.id = this.createIdentifier(id, name);
|
|
42374
42477
|
return this.finishNode(node, "PrivateName");
|
|
42375
42478
|
}
|
|
42376
42479
|
parseFunctionOrFunctionSent() {
|
|
@@ -43047,22 +43150,22 @@ var require_lib3 = __commonJS({
|
|
|
43047
43150
|
}
|
|
43048
43151
|
parseIdentifier(liberal) {
|
|
43049
43152
|
const node = this.startNode();
|
|
43050
|
-
const
|
|
43051
|
-
return this.createIdentifier(node,
|
|
43153
|
+
const name = this.parseIdentifierName(liberal);
|
|
43154
|
+
return this.createIdentifier(node, name);
|
|
43052
43155
|
}
|
|
43053
|
-
createIdentifier(node,
|
|
43054
|
-
node.name =
|
|
43055
|
-
node.loc.identifierName =
|
|
43156
|
+
createIdentifier(node, name) {
|
|
43157
|
+
node.name = name;
|
|
43158
|
+
node.loc.identifierName = name;
|
|
43056
43159
|
return this.finishNode(node, "Identifier");
|
|
43057
43160
|
}
|
|
43058
43161
|
parseIdentifierName(liberal) {
|
|
43059
|
-
let
|
|
43162
|
+
let name;
|
|
43060
43163
|
const {
|
|
43061
43164
|
startLoc,
|
|
43062
43165
|
type
|
|
43063
43166
|
} = this.state;
|
|
43064
43167
|
if (tokenIsKeywordOrIdentifier(type)) {
|
|
43065
|
-
|
|
43168
|
+
name = this.state.value;
|
|
43066
43169
|
} else {
|
|
43067
43170
|
throw this.unexpected();
|
|
43068
43171
|
}
|
|
@@ -43072,10 +43175,10 @@ var require_lib3 = __commonJS({
|
|
|
43072
43175
|
this.replaceToken(130);
|
|
43073
43176
|
}
|
|
43074
43177
|
} else {
|
|
43075
|
-
this.checkReservedWord(
|
|
43178
|
+
this.checkReservedWord(name, startLoc, tokenIsKeyword2, false);
|
|
43076
43179
|
}
|
|
43077
43180
|
this.next();
|
|
43078
|
-
return
|
|
43181
|
+
return name;
|
|
43079
43182
|
}
|
|
43080
43183
|
checkReservedWord(word, startLoc, checkKeywords, isBinding) {
|
|
43081
43184
|
if (word.length > 10) {
|
|
@@ -45323,10 +45426,10 @@ var require_lib3 = __commonJS({
|
|
|
45323
45426
|
};
|
|
45324
45427
|
function pluginsMap(plugins) {
|
|
45325
45428
|
const pluginMap = /* @__PURE__ */ new Map();
|
|
45326
|
-
for (const
|
|
45327
|
-
const [
|
|
45328
|
-
if (!pluginMap.has(
|
|
45329
|
-
pluginMap.set(
|
|
45429
|
+
for (const plugin2 of plugins) {
|
|
45430
|
+
const [name, options] = Array.isArray(plugin2) ? plugin2 : [plugin2, {}];
|
|
45431
|
+
if (!pluginMap.has(name))
|
|
45432
|
+
pluginMap.set(name, options || {});
|
|
45330
45433
|
}
|
|
45331
45434
|
return pluginMap;
|
|
45332
45435
|
}
|
|
@@ -45388,13 +45491,13 @@ var require_lib3 = __commonJS({
|
|
|
45388
45491
|
}
|
|
45389
45492
|
var parserClassCache = {};
|
|
45390
45493
|
function getParserClass(pluginsFromOptions) {
|
|
45391
|
-
const pluginList = mixinPluginNames.filter((
|
|
45494
|
+
const pluginList = mixinPluginNames.filter((name) => hasPlugin(pluginsFromOptions, name));
|
|
45392
45495
|
const key = pluginList.join("/");
|
|
45393
45496
|
let cls = parserClassCache[key];
|
|
45394
45497
|
if (!cls) {
|
|
45395
45498
|
cls = Parser;
|
|
45396
|
-
for (const
|
|
45397
|
-
cls = mixinPlugins[
|
|
45499
|
+
for (const plugin2 of pluginList) {
|
|
45500
|
+
cls = mixinPlugins[plugin2](cls);
|
|
45398
45501
|
}
|
|
45399
45502
|
parserClassCache[key] = cls;
|
|
45400
45503
|
}
|
|
@@ -46031,9 +46134,9 @@ var require_types = __commonJS({
|
|
|
46031
46134
|
}(BaseType);
|
|
46032
46135
|
var PredicateType = function(_super) {
|
|
46033
46136
|
tslib_1.__extends(PredicateType2, _super);
|
|
46034
|
-
function PredicateType2(
|
|
46137
|
+
function PredicateType2(name, predicate) {
|
|
46035
46138
|
var _this = _super.call(this) || this;
|
|
46036
|
-
_this.name =
|
|
46139
|
+
_this.name = name;
|
|
46037
46140
|
_this.predicate = predicate;
|
|
46038
46141
|
_this.kind = "PredicateType";
|
|
46039
46142
|
return _this;
|
|
@@ -46079,8 +46182,8 @@ var require_types = __commonJS({
|
|
|
46079
46182
|
if (this.finalized !== true) {
|
|
46080
46183
|
throw new Error("" + this.typeName);
|
|
46081
46184
|
}
|
|
46082
|
-
function checkFieldByName(
|
|
46083
|
-
var field = allFields[
|
|
46185
|
+
function checkFieldByName(name) {
|
|
46186
|
+
var field = allFields[name];
|
|
46084
46187
|
var type = field.type;
|
|
46085
46188
|
var child = field.getValue(value);
|
|
46086
46189
|
return type.check(child, deep);
|
|
@@ -46115,8 +46218,8 @@ var require_types = __commonJS({
|
|
|
46115
46218
|
}();
|
|
46116
46219
|
exports.Def = Def;
|
|
46117
46220
|
var Field = function() {
|
|
46118
|
-
function Field2(
|
|
46119
|
-
this.name =
|
|
46221
|
+
function Field2(name, type, defaultFn, hidden) {
|
|
46222
|
+
this.name = name;
|
|
46120
46223
|
this.type = type;
|
|
46121
46224
|
this.defaultFn = defaultFn;
|
|
46122
46225
|
this.hidden = !!hidden;
|
|
@@ -46158,7 +46261,7 @@ var require_types = __commonJS({
|
|
|
46158
46261
|
return Type.from(type);
|
|
46159
46262
|
}));
|
|
46160
46263
|
},
|
|
46161
|
-
from: function(value,
|
|
46264
|
+
from: function(value, name) {
|
|
46162
46265
|
if (value instanceof ArrayType || value instanceof IdentityType || value instanceof ObjectType || value instanceof OrType || value instanceof PredicateType) {
|
|
46163
46266
|
return value;
|
|
46164
46267
|
}
|
|
@@ -46172,8 +46275,8 @@ var require_types = __commonJS({
|
|
|
46172
46275
|
return new ArrayType(Type.from(value[0]));
|
|
46173
46276
|
}
|
|
46174
46277
|
if (isObject2.check(value)) {
|
|
46175
|
-
return new ObjectType(Object.keys(value).map(function(
|
|
46176
|
-
return new Field(
|
|
46278
|
+
return new ObjectType(Object.keys(value).map(function(name2) {
|
|
46279
|
+
return new Field(name2, Type.from(value[name2], name2));
|
|
46177
46280
|
}));
|
|
46178
46281
|
}
|
|
46179
46282
|
if (typeof value === "function") {
|
|
@@ -46181,10 +46284,10 @@ var require_types = __commonJS({
|
|
|
46181
46284
|
if (bicfIndex >= 0) {
|
|
46182
46285
|
return builtInCtorTypes[bicfIndex];
|
|
46183
46286
|
}
|
|
46184
|
-
if (typeof
|
|
46287
|
+
if (typeof name !== "string") {
|
|
46185
46288
|
throw new Error("missing name");
|
|
46186
46289
|
}
|
|
46187
|
-
return new PredicateType(
|
|
46290
|
+
return new PredicateType(name, value);
|
|
46188
46291
|
}
|
|
46189
46292
|
return new IdentityType(value);
|
|
46190
46293
|
},
|
|
@@ -46197,9 +46300,9 @@ var require_types = __commonJS({
|
|
|
46197
46300
|
};
|
|
46198
46301
|
var builtInCtorFns = [];
|
|
46199
46302
|
var builtInCtorTypes = [];
|
|
46200
|
-
function defBuiltInType(
|
|
46303
|
+
function defBuiltInType(name, example) {
|
|
46201
46304
|
var objStr = objToStr.call(example);
|
|
46202
|
-
var type = new PredicateType(
|
|
46305
|
+
var type = new PredicateType(name, function(value) {
|
|
46203
46306
|
return objToStr.call(value) === objStr;
|
|
46204
46307
|
});
|
|
46205
46308
|
if (example && typeof example.constructor === "function") {
|
|
@@ -46310,8 +46413,8 @@ var require_types = __commonJS({
|
|
|
46310
46413
|
} else if (field.defaultFn) {
|
|
46311
46414
|
value = field.defaultFn.call(built);
|
|
46312
46415
|
} else {
|
|
46313
|
-
var message = "no value or default function given for field " + JSON.stringify(param) + " of " + _this.typeName + "(" + _this.buildParams.map(function(
|
|
46314
|
-
return all[
|
|
46416
|
+
var message = "no value or default function given for field " + JSON.stringify(param) + " of " + _this.typeName + "(" + _this.buildParams.map(function(name) {
|
|
46417
|
+
return all[name];
|
|
46315
46418
|
}).join(", ") + ")";
|
|
46316
46419
|
throw new Error(message);
|
|
46317
46420
|
}
|
|
@@ -46368,12 +46471,12 @@ var require_types = __commonJS({
|
|
|
46368
46471
|
});
|
|
46369
46472
|
return this;
|
|
46370
46473
|
};
|
|
46371
|
-
DefImpl2.prototype.field = function(
|
|
46474
|
+
DefImpl2.prototype.field = function(name, type, defaultFn, hidden) {
|
|
46372
46475
|
if (this.finalized) {
|
|
46373
|
-
console.error("Ignoring attempt to redefine field " + JSON.stringify(
|
|
46476
|
+
console.error("Ignoring attempt to redefine field " + JSON.stringify(name) + " of finalized type " + JSON.stringify(this.typeName));
|
|
46374
46477
|
return this;
|
|
46375
46478
|
}
|
|
46376
|
-
this.ownFields[
|
|
46479
|
+
this.ownFields[name] = new Field(name, Type.from(type), defaultFn, hidden);
|
|
46377
46480
|
return this;
|
|
46378
46481
|
};
|
|
46379
46482
|
DefImpl2.prototype.finalize = function() {
|
|
@@ -46381,14 +46484,14 @@ var require_types = __commonJS({
|
|
|
46381
46484
|
if (!this.finalized) {
|
|
46382
46485
|
var allFields = this.allFields;
|
|
46383
46486
|
var allSupertypes = this.allSupertypes;
|
|
46384
|
-
this.baseNames.forEach(function(
|
|
46385
|
-
var def = defCache[
|
|
46487
|
+
this.baseNames.forEach(function(name) {
|
|
46488
|
+
var def = defCache[name];
|
|
46386
46489
|
if (def instanceof Def) {
|
|
46387
46490
|
def.finalize();
|
|
46388
46491
|
extend(allFields, def.allFields);
|
|
46389
46492
|
extend(allSupertypes, def.allSupertypes);
|
|
46390
46493
|
} else {
|
|
46391
|
-
var message = "unknown supertype name " + JSON.stringify(
|
|
46494
|
+
var message = "unknown supertype name " + JSON.stringify(name) + " for subtype " + JSON.stringify(_this.typeName);
|
|
46392
46495
|
throw new Error(message);
|
|
46393
46496
|
}
|
|
46394
46497
|
});
|
|
@@ -46445,13 +46548,13 @@ var require_types = __commonJS({
|
|
|
46445
46548
|
}
|
|
46446
46549
|
var builders = /* @__PURE__ */ Object.create(null);
|
|
46447
46550
|
var nodePrototype = {};
|
|
46448
|
-
function defineMethod(
|
|
46449
|
-
var old = nodePrototype[
|
|
46551
|
+
function defineMethod(name, func) {
|
|
46552
|
+
var old = nodePrototype[name];
|
|
46450
46553
|
if (isUndefined.check(func)) {
|
|
46451
|
-
delete nodePrototype[
|
|
46554
|
+
delete nodePrototype[name];
|
|
46452
46555
|
} else {
|
|
46453
46556
|
isFunction.assert(func);
|
|
46454
|
-
Object.defineProperty(nodePrototype,
|
|
46557
|
+
Object.defineProperty(nodePrototype, name, {
|
|
46455
46558
|
enumerable: true,
|
|
46456
46559
|
configurable: true,
|
|
46457
46560
|
value: func
|
|
@@ -46498,13 +46601,13 @@ var require_types = __commonJS({
|
|
|
46498
46601
|
return object && object[fieldName];
|
|
46499
46602
|
}
|
|
46500
46603
|
function eachField(object, callback, context) {
|
|
46501
|
-
getFieldNames(object).forEach(function(
|
|
46502
|
-
callback.call(this,
|
|
46604
|
+
getFieldNames(object).forEach(function(name) {
|
|
46605
|
+
callback.call(this, name, getFieldValue(object, name));
|
|
46503
46606
|
}, context);
|
|
46504
46607
|
}
|
|
46505
46608
|
function someField(object, callback, context) {
|
|
46506
|
-
return getFieldNames(object).some(function(
|
|
46507
|
-
return callback.call(this,
|
|
46609
|
+
return getFieldNames(object).some(function(name) {
|
|
46610
|
+
return callback.call(this, name, getFieldValue(object, name));
|
|
46508
46611
|
}, context);
|
|
46509
46612
|
}
|
|
46510
46613
|
function wrapExpressionBuilderWithStatement(typeName) {
|
|
@@ -46554,14 +46657,14 @@ var require_types = __commonJS({
|
|
|
46554
46657
|
list.length = to;
|
|
46555
46658
|
}
|
|
46556
46659
|
function extend(into, from) {
|
|
46557
|
-
Object.keys(from).forEach(function(
|
|
46558
|
-
into[
|
|
46660
|
+
Object.keys(from).forEach(function(name) {
|
|
46661
|
+
into[name] = from[name];
|
|
46559
46662
|
});
|
|
46560
46663
|
return into;
|
|
46561
46664
|
}
|
|
46562
46665
|
function finalize() {
|
|
46563
|
-
Object.keys(defCache).forEach(function(
|
|
46564
|
-
defCache[
|
|
46666
|
+
Object.keys(defCache).forEach(function(name) {
|
|
46667
|
+
defCache[name].finalize();
|
|
46565
46668
|
});
|
|
46566
46669
|
}
|
|
46567
46670
|
return {
|
|
@@ -46602,7 +46705,7 @@ var require_path2 = __commonJS({
|
|
|
46602
46705
|
var types17 = fork.use(types_1.default);
|
|
46603
46706
|
var isArray = types17.builtInTypes.array;
|
|
46604
46707
|
var isNumber = types17.builtInTypes.number;
|
|
46605
|
-
var Path = function Path2(value, parentPath,
|
|
46708
|
+
var Path = function Path2(value, parentPath, name) {
|
|
46606
46709
|
if (!(this instanceof Path2)) {
|
|
46607
46710
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
46608
46711
|
}
|
|
@@ -46612,28 +46715,28 @@ var require_path2 = __commonJS({
|
|
|
46612
46715
|
}
|
|
46613
46716
|
} else {
|
|
46614
46717
|
parentPath = null;
|
|
46615
|
-
|
|
46718
|
+
name = null;
|
|
46616
46719
|
}
|
|
46617
46720
|
this.value = value;
|
|
46618
46721
|
this.parentPath = parentPath;
|
|
46619
|
-
this.name =
|
|
46722
|
+
this.name = name;
|
|
46620
46723
|
this.__childCache = null;
|
|
46621
46724
|
};
|
|
46622
46725
|
var Pp = Path.prototype;
|
|
46623
46726
|
function getChildCache(path2) {
|
|
46624
46727
|
return path2.__childCache || (path2.__childCache = /* @__PURE__ */ Object.create(null));
|
|
46625
46728
|
}
|
|
46626
|
-
function getChildPath(path2,
|
|
46729
|
+
function getChildPath(path2, name) {
|
|
46627
46730
|
var cache = getChildCache(path2);
|
|
46628
|
-
var actualChildValue = path2.getValueProperty(
|
|
46629
|
-
var childPath = cache[
|
|
46630
|
-
if (!hasOwn.call(cache,
|
|
46631
|
-
childPath = cache[
|
|
46731
|
+
var actualChildValue = path2.getValueProperty(name);
|
|
46732
|
+
var childPath = cache[name];
|
|
46733
|
+
if (!hasOwn.call(cache, name) || childPath.value !== actualChildValue) {
|
|
46734
|
+
childPath = cache[name] = new path2.constructor(actualChildValue, path2, name);
|
|
46632
46735
|
}
|
|
46633
46736
|
return childPath;
|
|
46634
46737
|
}
|
|
46635
|
-
Pp.getValueProperty = function getValueProperty(
|
|
46636
|
-
return this.value[
|
|
46738
|
+
Pp.getValueProperty = function getValueProperty(name) {
|
|
46739
|
+
return this.value[name];
|
|
46637
46740
|
};
|
|
46638
46741
|
Pp.get = function get() {
|
|
46639
46742
|
var names = [];
|
|
@@ -46949,13 +47052,13 @@ var require_scope = __commonJS({
|
|
|
46949
47052
|
};
|
|
46950
47053
|
var Sp = Scope.prototype;
|
|
46951
47054
|
Sp.didScan = false;
|
|
46952
|
-
Sp.declares = function(
|
|
47055
|
+
Sp.declares = function(name) {
|
|
46953
47056
|
this.scan();
|
|
46954
|
-
return hasOwn.call(this.bindings,
|
|
47057
|
+
return hasOwn.call(this.bindings, name);
|
|
46955
47058
|
};
|
|
46956
|
-
Sp.declaresType = function(
|
|
47059
|
+
Sp.declaresType = function(name) {
|
|
46957
47060
|
this.scan();
|
|
46958
|
-
return hasOwn.call(this.types,
|
|
47061
|
+
return hasOwn.call(this.types, name);
|
|
46959
47062
|
};
|
|
46960
47063
|
Sp.declareTemporary = function(prefix) {
|
|
46961
47064
|
if (prefix) {
|
|
@@ -46971,8 +47074,8 @@ var require_scope = __commonJS({
|
|
|
46971
47074
|
while (this.declares(prefix + index)) {
|
|
46972
47075
|
++index;
|
|
46973
47076
|
}
|
|
46974
|
-
var
|
|
46975
|
-
return this.bindings[
|
|
47077
|
+
var name = prefix + index;
|
|
47078
|
+
return this.bindings[name] = types17.builders.identifier(name);
|
|
46976
47079
|
};
|
|
46977
47080
|
Sp.injectTemporary = function(identifier, init) {
|
|
46978
47081
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -46985,11 +47088,11 @@ var require_scope = __commonJS({
|
|
|
46985
47088
|
};
|
|
46986
47089
|
Sp.scan = function(force) {
|
|
46987
47090
|
if (force || !this.didScan) {
|
|
46988
|
-
for (var
|
|
46989
|
-
delete this.bindings[
|
|
47091
|
+
for (var name in this.bindings) {
|
|
47092
|
+
delete this.bindings[name];
|
|
46990
47093
|
}
|
|
46991
|
-
for (var
|
|
46992
|
-
delete this.types[
|
|
47094
|
+
for (var name in this.types) {
|
|
47095
|
+
delete this.types[name];
|
|
46993
47096
|
}
|
|
46994
47097
|
scanScope(this.path, this.bindings, this.types);
|
|
46995
47098
|
this.didScan = true;
|
|
@@ -47048,8 +47151,8 @@ var require_scope = __commonJS({
|
|
|
47048
47151
|
bindings
|
|
47049
47152
|
);
|
|
47050
47153
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
47051
|
-
types17.eachField(node, function(
|
|
47052
|
-
var childPath = path2.get(
|
|
47154
|
+
types17.eachField(node, function(name, child) {
|
|
47155
|
+
var childPath = path2.get(name);
|
|
47053
47156
|
if (!pathHasValue(childPath, child)) {
|
|
47054
47157
|
throw new Error("");
|
|
47055
47158
|
}
|
|
@@ -47146,15 +47249,15 @@ var require_scope = __commonJS({
|
|
|
47146
47249
|
types18[parameter.name] = [parameterPath];
|
|
47147
47250
|
}
|
|
47148
47251
|
}
|
|
47149
|
-
Sp.lookup = function(
|
|
47252
|
+
Sp.lookup = function(name) {
|
|
47150
47253
|
for (var scope = this; scope; scope = scope.parent)
|
|
47151
|
-
if (scope.declares(
|
|
47254
|
+
if (scope.declares(name))
|
|
47152
47255
|
break;
|
|
47153
47256
|
return scope;
|
|
47154
47257
|
};
|
|
47155
|
-
Sp.lookupType = function(
|
|
47258
|
+
Sp.lookupType = function(name) {
|
|
47156
47259
|
for (var scope = this; scope; scope = scope.parent)
|
|
47157
|
-
if (scope.declaresType(
|
|
47260
|
+
if (scope.declaresType(name))
|
|
47158
47261
|
break;
|
|
47159
47262
|
return scope;
|
|
47160
47263
|
};
|
|
@@ -47191,11 +47294,11 @@ var require_node_path = __commonJS({
|
|
|
47191
47294
|
var isArray = types17.builtInTypes.array;
|
|
47192
47295
|
var Path = fork.use(path_1.default);
|
|
47193
47296
|
var Scope = fork.use(scope_1.default);
|
|
47194
|
-
var NodePath = function NodePath2(value, parentPath,
|
|
47297
|
+
var NodePath = function NodePath2(value, parentPath, name) {
|
|
47195
47298
|
if (!(this instanceof NodePath2)) {
|
|
47196
47299
|
throw new Error("NodePath constructor cannot be invoked without 'new'");
|
|
47197
47300
|
}
|
|
47198
|
-
Path.call(this, value, parentPath,
|
|
47301
|
+
Path.call(this, value, parentPath, name);
|
|
47199
47302
|
};
|
|
47200
47303
|
var NPp = NodePath.prototype = Object.create(Path.prototype, {
|
|
47201
47304
|
constructor: {
|
|
@@ -47278,8 +47381,8 @@ var require_node_path = __commonJS({
|
|
|
47278
47381
|
}
|
|
47279
47382
|
return scope || null;
|
|
47280
47383
|
};
|
|
47281
|
-
NPp.getValueProperty = function(
|
|
47282
|
-
return types17.getFieldValue(this.value,
|
|
47384
|
+
NPp.getValueProperty = function(name) {
|
|
47385
|
+
return types17.getFieldValue(this.value, name);
|
|
47283
47386
|
};
|
|
47284
47387
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
47285
47388
|
var pp = this.parentPath;
|
|
@@ -47934,18 +48037,18 @@ var require_equiv = __commonJS({
|
|
|
47934
48037
|
var bNameCount = bNames.length;
|
|
47935
48038
|
if (aNameCount === bNameCount) {
|
|
47936
48039
|
for (var i2 = 0; i2 < aNameCount; ++i2) {
|
|
47937
|
-
var
|
|
47938
|
-
var aChild = getFieldValue(a,
|
|
47939
|
-
var bChild = getFieldValue(b,
|
|
48040
|
+
var name = aNames[i2];
|
|
48041
|
+
var aChild = getFieldValue(a, name);
|
|
48042
|
+
var bChild = getFieldValue(b, name);
|
|
47940
48043
|
if (problemPath) {
|
|
47941
|
-
problemPath.push(
|
|
48044
|
+
problemPath.push(name);
|
|
47942
48045
|
}
|
|
47943
48046
|
if (!areEquivalent(aChild, bChild, problemPath)) {
|
|
47944
48047
|
return false;
|
|
47945
48048
|
}
|
|
47946
48049
|
if (problemPath) {
|
|
47947
48050
|
var problemPathTail = problemPath.pop();
|
|
47948
|
-
if (problemPathTail !==
|
|
48051
|
+
if (problemPathTail !== name) {
|
|
47949
48052
|
throw new Error("" + problemPathTail);
|
|
47950
48053
|
}
|
|
47951
48054
|
}
|
|
@@ -47960,15 +48063,15 @@ var require_equiv = __commonJS({
|
|
|
47960
48063
|
seenNames[aNames[i2]] = true;
|
|
47961
48064
|
}
|
|
47962
48065
|
for (i2 = 0; i2 < bNameCount; ++i2) {
|
|
47963
|
-
|
|
47964
|
-
if (!hasOwn.call(seenNames,
|
|
47965
|
-
problemPath.push(
|
|
48066
|
+
name = bNames[i2];
|
|
48067
|
+
if (!hasOwn.call(seenNames, name)) {
|
|
48068
|
+
problemPath.push(name);
|
|
47966
48069
|
return false;
|
|
47967
48070
|
}
|
|
47968
|
-
delete seenNames[
|
|
48071
|
+
delete seenNames[name];
|
|
47969
48072
|
}
|
|
47970
|
-
for (
|
|
47971
|
-
problemPath.push(
|
|
48073
|
+
for (name in seenNames) {
|
|
48074
|
+
problemPath.push(name);
|
|
47972
48075
|
break;
|
|
47973
48076
|
}
|
|
47974
48077
|
return false;
|
|
@@ -48025,12 +48128,12 @@ var require_fork = __commonJS({
|
|
|
48025
48128
|
function createFork() {
|
|
48026
48129
|
var used = [];
|
|
48027
48130
|
var usedResult = [];
|
|
48028
|
-
function use(
|
|
48029
|
-
var idx = used.indexOf(
|
|
48131
|
+
function use(plugin2) {
|
|
48132
|
+
var idx = used.indexOf(plugin2);
|
|
48030
48133
|
if (idx === -1) {
|
|
48031
48134
|
idx = used.length;
|
|
48032
|
-
used.push(
|
|
48033
|
-
usedResult[idx] =
|
|
48135
|
+
used.push(plugin2);
|
|
48136
|
+
usedResult[idx] = plugin2(fork);
|
|
48034
48137
|
}
|
|
48035
48138
|
return usedResult[idx];
|
|
48036
48139
|
}
|
|
@@ -49786,9 +49889,9 @@ var require_source_map_generator = __commonJS({
|
|
|
49786
49889
|
var generated = util.getArg(aArgs, "generated");
|
|
49787
49890
|
var original = util.getArg(aArgs, "original", null);
|
|
49788
49891
|
var source = util.getArg(aArgs, "source", null);
|
|
49789
|
-
var
|
|
49892
|
+
var name = util.getArg(aArgs, "name", null);
|
|
49790
49893
|
if (!this._skipValidation) {
|
|
49791
|
-
this._validateMapping(generated, original, source,
|
|
49894
|
+
this._validateMapping(generated, original, source, name);
|
|
49792
49895
|
}
|
|
49793
49896
|
if (source != null) {
|
|
49794
49897
|
source = String(source);
|
|
@@ -49796,10 +49899,10 @@ var require_source_map_generator = __commonJS({
|
|
|
49796
49899
|
this._sources.add(source);
|
|
49797
49900
|
}
|
|
49798
49901
|
}
|
|
49799
|
-
if (
|
|
49800
|
-
|
|
49801
|
-
if (!this._names.has(
|
|
49802
|
-
this._names.add(
|
|
49902
|
+
if (name != null) {
|
|
49903
|
+
name = String(name);
|
|
49904
|
+
if (!this._names.has(name)) {
|
|
49905
|
+
this._names.add(name);
|
|
49803
49906
|
}
|
|
49804
49907
|
}
|
|
49805
49908
|
this._mappings.add({
|
|
@@ -49808,7 +49911,7 @@ var require_source_map_generator = __commonJS({
|
|
|
49808
49911
|
originalLine: original != null && original.line,
|
|
49809
49912
|
originalColumn: original != null && original.column,
|
|
49810
49913
|
source,
|
|
49811
|
-
name
|
|
49914
|
+
name
|
|
49812
49915
|
});
|
|
49813
49916
|
};
|
|
49814
49917
|
SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
|
|
@@ -49869,9 +49972,9 @@ var require_source_map_generator = __commonJS({
|
|
|
49869
49972
|
if (source != null && !newSources.has(source)) {
|
|
49870
49973
|
newSources.add(source);
|
|
49871
49974
|
}
|
|
49872
|
-
var
|
|
49873
|
-
if (
|
|
49874
|
-
newNames.add(
|
|
49975
|
+
var name = mapping.name;
|
|
49976
|
+
if (name != null && !newNames.has(name)) {
|
|
49977
|
+
newNames.add(name);
|
|
49875
49978
|
}
|
|
49876
49979
|
}, this);
|
|
49877
49980
|
this._sources = newSources;
|
|
@@ -50431,15 +50534,15 @@ var require_source_map_consumer = __commonJS({
|
|
|
50431
50534
|
source = this._sources.at(source);
|
|
50432
50535
|
source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
|
|
50433
50536
|
}
|
|
50434
|
-
var
|
|
50435
|
-
if (
|
|
50436
|
-
|
|
50537
|
+
var name = util.getArg(mapping, "name", null);
|
|
50538
|
+
if (name !== null) {
|
|
50539
|
+
name = this._names.at(name);
|
|
50437
50540
|
}
|
|
50438
50541
|
return {
|
|
50439
50542
|
source,
|
|
50440
50543
|
line: util.getArg(mapping, "originalLine", null),
|
|
50441
50544
|
column: util.getArg(mapping, "originalColumn", null),
|
|
50442
|
-
name
|
|
50545
|
+
name
|
|
50443
50546
|
};
|
|
50444
50547
|
}
|
|
50445
50548
|
}
|
|
@@ -50658,11 +50761,11 @@ var require_source_map_consumer = __commonJS({
|
|
|
50658
50761
|
source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
|
|
50659
50762
|
this._sources.add(source);
|
|
50660
50763
|
source = this._sources.indexOf(source);
|
|
50661
|
-
var
|
|
50764
|
+
var name = null;
|
|
50662
50765
|
if (mapping.name) {
|
|
50663
|
-
|
|
50664
|
-
this._names.add(
|
|
50665
|
-
|
|
50766
|
+
name = section.consumer._names.at(mapping.name);
|
|
50767
|
+
this._names.add(name);
|
|
50768
|
+
name = this._names.indexOf(name);
|
|
50666
50769
|
}
|
|
50667
50770
|
var adjustedMapping = {
|
|
50668
50771
|
source,
|
|
@@ -50670,7 +50773,7 @@ var require_source_map_consumer = __commonJS({
|
|
|
50670
50773
|
generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
|
|
50671
50774
|
originalLine: mapping.originalLine,
|
|
50672
50775
|
originalColumn: mapping.originalColumn,
|
|
50673
|
-
name
|
|
50776
|
+
name
|
|
50674
50777
|
};
|
|
50675
50778
|
this.__generatedMappings.push(adjustedMapping);
|
|
50676
50779
|
if (typeof adjustedMapping.originalLine === "number") {
|
|
@@ -51933,13 +52036,13 @@ var require_esprima2 = __commonJS({
|
|
|
51933
52036
|
};
|
|
51934
52037
|
JSXParser2.prototype.parseJSXNameValueAttribute = function() {
|
|
51935
52038
|
var node = this.createJSXNode();
|
|
51936
|
-
var
|
|
52039
|
+
var name = this.parseJSXAttributeName();
|
|
51937
52040
|
var value = null;
|
|
51938
52041
|
if (this.matchJSX("=")) {
|
|
51939
52042
|
this.expectJSX("=");
|
|
51940
52043
|
value = this.parseJSXAttributeValue();
|
|
51941
52044
|
}
|
|
51942
|
-
return this.finalize(node, new JSXNode.JSXAttribute(
|
|
52045
|
+
return this.finalize(node, new JSXNode.JSXAttribute(name, value));
|
|
51943
52046
|
};
|
|
51944
52047
|
JSXParser2.prototype.parseJSXSpreadAttribute = function() {
|
|
51945
52048
|
var node = this.createJSXNode();
|
|
@@ -51961,14 +52064,14 @@ var require_esprima2 = __commonJS({
|
|
|
51961
52064
|
JSXParser2.prototype.parseJSXOpeningElement = function() {
|
|
51962
52065
|
var node = this.createJSXNode();
|
|
51963
52066
|
this.expectJSX("<");
|
|
51964
|
-
var
|
|
52067
|
+
var name = this.parseJSXElementName();
|
|
51965
52068
|
var attributes = this.parseJSXAttributes();
|
|
51966
52069
|
var selfClosing = this.matchJSX("/");
|
|
51967
52070
|
if (selfClosing) {
|
|
51968
52071
|
this.expectJSX("/");
|
|
51969
52072
|
}
|
|
51970
52073
|
this.expectJSX(">");
|
|
51971
|
-
return this.finalize(node, new JSXNode.JSXOpeningElement(
|
|
52074
|
+
return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
|
|
51972
52075
|
};
|
|
51973
52076
|
JSXParser2.prototype.parseJSXBoundaryElement = function() {
|
|
51974
52077
|
var node = this.createJSXNode();
|
|
@@ -51979,14 +52082,14 @@ var require_esprima2 = __commonJS({
|
|
|
51979
52082
|
this.expectJSX(">");
|
|
51980
52083
|
return this.finalize(node, new JSXNode.JSXClosingElement(name_3));
|
|
51981
52084
|
}
|
|
51982
|
-
var
|
|
52085
|
+
var name = this.parseJSXElementName();
|
|
51983
52086
|
var attributes = this.parseJSXAttributes();
|
|
51984
52087
|
var selfClosing = this.matchJSX("/");
|
|
51985
52088
|
if (selfClosing) {
|
|
51986
52089
|
this.expectJSX("/");
|
|
51987
52090
|
}
|
|
51988
52091
|
this.expectJSX(">");
|
|
51989
|
-
return this.finalize(node, new JSXNode.JSXOpeningElement(
|
|
52092
|
+
return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
|
|
51990
52093
|
};
|
|
51991
52094
|
JSXParser2.prototype.parseJSXEmptyExpression = function() {
|
|
51992
52095
|
var node = this.createJSXChildNode();
|
|
@@ -52131,9 +52234,9 @@ var require_esprima2 = __commonJS({
|
|
|
52131
52234
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
52132
52235
|
var jsx_syntax_1 = __webpack_require__(6);
|
|
52133
52236
|
var JSXClosingElement = function() {
|
|
52134
|
-
function JSXClosingElement2(
|
|
52237
|
+
function JSXClosingElement2(name) {
|
|
52135
52238
|
this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement;
|
|
52136
|
-
this.name =
|
|
52239
|
+
this.name = name;
|
|
52137
52240
|
}
|
|
52138
52241
|
return JSXClosingElement2;
|
|
52139
52242
|
}();
|
|
@@ -52164,9 +52267,9 @@ var require_esprima2 = __commonJS({
|
|
|
52164
52267
|
}();
|
|
52165
52268
|
exports2.JSXExpressionContainer = JSXExpressionContainer;
|
|
52166
52269
|
var JSXIdentifier = function() {
|
|
52167
|
-
function JSXIdentifier2(
|
|
52270
|
+
function JSXIdentifier2(name) {
|
|
52168
52271
|
this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier;
|
|
52169
|
-
this.name =
|
|
52272
|
+
this.name = name;
|
|
52170
52273
|
}
|
|
52171
52274
|
return JSXIdentifier2;
|
|
52172
52275
|
}();
|
|
@@ -52181,27 +52284,27 @@ var require_esprima2 = __commonJS({
|
|
|
52181
52284
|
}();
|
|
52182
52285
|
exports2.JSXMemberExpression = JSXMemberExpression;
|
|
52183
52286
|
var JSXAttribute = function() {
|
|
52184
|
-
function JSXAttribute2(
|
|
52287
|
+
function JSXAttribute2(name, value) {
|
|
52185
52288
|
this.type = jsx_syntax_1.JSXSyntax.JSXAttribute;
|
|
52186
|
-
this.name =
|
|
52289
|
+
this.name = name;
|
|
52187
52290
|
this.value = value;
|
|
52188
52291
|
}
|
|
52189
52292
|
return JSXAttribute2;
|
|
52190
52293
|
}();
|
|
52191
52294
|
exports2.JSXAttribute = JSXAttribute;
|
|
52192
52295
|
var JSXNamespacedName = function() {
|
|
52193
|
-
function JSXNamespacedName2(namespace,
|
|
52296
|
+
function JSXNamespacedName2(namespace, name) {
|
|
52194
52297
|
this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName;
|
|
52195
52298
|
this.namespace = namespace;
|
|
52196
|
-
this.name =
|
|
52299
|
+
this.name = name;
|
|
52197
52300
|
}
|
|
52198
52301
|
return JSXNamespacedName2;
|
|
52199
52302
|
}();
|
|
52200
52303
|
exports2.JSXNamespacedName = JSXNamespacedName;
|
|
52201
52304
|
var JSXOpeningElement = function() {
|
|
52202
|
-
function JSXOpeningElement2(
|
|
52305
|
+
function JSXOpeningElement2(name, selfClosing, attributes) {
|
|
52203
52306
|
this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement;
|
|
52204
|
-
this.name =
|
|
52307
|
+
this.name = name;
|
|
52205
52308
|
this.selfClosing = selfClosing;
|
|
52206
52309
|
this.attributes = attributes;
|
|
52207
52310
|
}
|
|
@@ -52577,9 +52680,9 @@ var require_esprima2 = __commonJS({
|
|
|
52577
52680
|
}();
|
|
52578
52681
|
exports2.FunctionExpression = FunctionExpression;
|
|
52579
52682
|
var Identifier = function() {
|
|
52580
|
-
function Identifier2(
|
|
52683
|
+
function Identifier2(name) {
|
|
52581
52684
|
this.type = syntax_1.Syntax.Identifier;
|
|
52582
|
-
this.name =
|
|
52685
|
+
this.name = name;
|
|
52583
52686
|
}
|
|
52584
52687
|
return Identifier2;
|
|
52585
52688
|
}();
|
|
@@ -55086,10 +55189,10 @@ var require_esprima2 = __commonJS({
|
|
|
55086
55189
|
this.context.inFunctionBody = previousInFunctionBody;
|
|
55087
55190
|
return this.finalize(node, new Node.BlockStatement(body));
|
|
55088
55191
|
};
|
|
55089
|
-
Parser2.prototype.validateParam = function(options, param,
|
|
55090
|
-
var key = "$" +
|
|
55192
|
+
Parser2.prototype.validateParam = function(options, param, name) {
|
|
55193
|
+
var key = "$" + name;
|
|
55091
55194
|
if (this.context.strict) {
|
|
55092
|
-
if (this.scanner.isRestrictedWord(
|
|
55195
|
+
if (this.scanner.isRestrictedWord(name)) {
|
|
55093
55196
|
options.stricted = param;
|
|
55094
55197
|
options.message = messages_1.Messages.StrictParamName;
|
|
55095
55198
|
}
|
|
@@ -55098,10 +55201,10 @@ var require_esprima2 = __commonJS({
|
|
|
55098
55201
|
options.message = messages_1.Messages.StrictParamDupe;
|
|
55099
55202
|
}
|
|
55100
55203
|
} else if (!options.firstRestricted) {
|
|
55101
|
-
if (this.scanner.isRestrictedWord(
|
|
55204
|
+
if (this.scanner.isRestrictedWord(name)) {
|
|
55102
55205
|
options.firstRestricted = param;
|
|
55103
55206
|
options.message = messages_1.Messages.StrictParamName;
|
|
55104
|
-
} else if (this.scanner.isStrictModeReservedWord(
|
|
55207
|
+
} else if (this.scanner.isStrictModeReservedWord(name)) {
|
|
55105
55208
|
options.firstRestricted = param;
|
|
55106
55209
|
options.message = messages_1.Messages.StrictReservedWord;
|
|
55107
55210
|
} else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
|
|
@@ -57504,14 +57607,14 @@ var require_mapping = __commonJS({
|
|
|
57504
57607
|
var sourceLines = this.sourceLines;
|
|
57505
57608
|
var sourceLoc = this.sourceLoc;
|
|
57506
57609
|
var targetLoc = this.targetLoc;
|
|
57507
|
-
function skip(
|
|
57508
|
-
var sourceFromPos = sourceLoc[
|
|
57509
|
-
var targetFromPos = targetLoc[
|
|
57610
|
+
function skip(name) {
|
|
57611
|
+
var sourceFromPos = sourceLoc[name];
|
|
57612
|
+
var targetFromPos = targetLoc[name];
|
|
57510
57613
|
var targetToPos = start;
|
|
57511
|
-
if (
|
|
57614
|
+
if (name === "end") {
|
|
57512
57615
|
targetToPos = end;
|
|
57513
57616
|
} else {
|
|
57514
|
-
assert_1.default.strictEqual(
|
|
57617
|
+
assert_1.default.strictEqual(name, "start");
|
|
57515
57618
|
}
|
|
57516
57619
|
return skipChars(sourceLines, sourceFromPos, lines, targetFromPos, targetToPos);
|
|
57517
57620
|
}
|
|
@@ -58819,9 +58922,9 @@ var require_fast_path = __commonJS({
|
|
|
58819
58922
|
var value = s2[origLen - 1];
|
|
58820
58923
|
var argc = arguments.length;
|
|
58821
58924
|
for (var i2 = 1; i2 < argc; ++i2) {
|
|
58822
|
-
var
|
|
58823
|
-
value = value[
|
|
58824
|
-
s2.push(
|
|
58925
|
+
var name = arguments[i2];
|
|
58926
|
+
value = value[name];
|
|
58927
|
+
s2.push(name, value);
|
|
58825
58928
|
}
|
|
58826
58929
|
var result = callback(this);
|
|
58827
58930
|
s2.length = origLen;
|
|
@@ -58833,9 +58936,9 @@ var require_fast_path = __commonJS({
|
|
|
58833
58936
|
var value = s2[origLen - 1];
|
|
58834
58937
|
var argc = arguments.length;
|
|
58835
58938
|
for (var i2 = 1; i2 < argc; ++i2) {
|
|
58836
|
-
var
|
|
58837
|
-
value = value[
|
|
58838
|
-
s2.push(
|
|
58939
|
+
var name = arguments[i2];
|
|
58940
|
+
value = value[name];
|
|
58941
|
+
s2.push(name, value);
|
|
58839
58942
|
}
|
|
58840
58943
|
for (var i2 = 0; i2 < value.length; ++i2) {
|
|
58841
58944
|
if (i2 in value) {
|
|
@@ -58852,9 +58955,9 @@ var require_fast_path = __commonJS({
|
|
|
58852
58955
|
var value = s2[origLen - 1];
|
|
58853
58956
|
var argc = arguments.length;
|
|
58854
58957
|
for (var i2 = 1; i2 < argc; ++i2) {
|
|
58855
|
-
var
|
|
58856
|
-
value = value[
|
|
58857
|
-
s2.push(
|
|
58958
|
+
var name = arguments[i2];
|
|
58959
|
+
value = value[name];
|
|
58960
|
+
s2.push(name, value);
|
|
58858
58961
|
}
|
|
58859
58962
|
var result = new Array(value.length);
|
|
58860
58963
|
for (var i2 = 0; i2 < value.length; ++i2) {
|
|
@@ -58924,7 +59027,7 @@ var require_fast_path = __commonJS({
|
|
|
58924
59027
|
return true;
|
|
58925
59028
|
}
|
|
58926
59029
|
var parent = this.getParentNode();
|
|
58927
|
-
var
|
|
59030
|
+
var name = this.getName();
|
|
58928
59031
|
if (this.getValue() !== node) {
|
|
58929
59032
|
return false;
|
|
58930
59033
|
}
|
|
@@ -58946,18 +59049,18 @@ var require_fast_path = __commonJS({
|
|
|
58946
59049
|
case "UnaryExpression":
|
|
58947
59050
|
case "SpreadElement":
|
|
58948
59051
|
case "SpreadProperty":
|
|
58949
|
-
return parent.type === "MemberExpression" &&
|
|
59052
|
+
return parent.type === "MemberExpression" && name === "object" && parent.object === node;
|
|
58950
59053
|
case "BinaryExpression":
|
|
58951
59054
|
case "LogicalExpression":
|
|
58952
59055
|
switch (parent.type) {
|
|
58953
59056
|
case "CallExpression":
|
|
58954
|
-
return
|
|
59057
|
+
return name === "callee" && parent.callee === node;
|
|
58955
59058
|
case "UnaryExpression":
|
|
58956
59059
|
case "SpreadElement":
|
|
58957
59060
|
case "SpreadProperty":
|
|
58958
59061
|
return true;
|
|
58959
59062
|
case "MemberExpression":
|
|
58960
|
-
return
|
|
59063
|
+
return name === "object" && parent.object === node;
|
|
58961
59064
|
case "BinaryExpression":
|
|
58962
59065
|
case "LogicalExpression": {
|
|
58963
59066
|
var po = parent.operator;
|
|
@@ -58967,7 +59070,7 @@ var require_fast_path = __commonJS({
|
|
|
58967
59070
|
if (pp > np) {
|
|
58968
59071
|
return true;
|
|
58969
59072
|
}
|
|
58970
|
-
if (pp === np &&
|
|
59073
|
+
if (pp === np && name === "right") {
|
|
58971
59074
|
assert_1.default.strictEqual(parent.right, node);
|
|
58972
59075
|
return true;
|
|
58973
59076
|
}
|
|
@@ -58984,7 +59087,7 @@ var require_fast_path = __commonJS({
|
|
|
58984
59087
|
case "ForStatement":
|
|
58985
59088
|
return false;
|
|
58986
59089
|
case "ExpressionStatement":
|
|
58987
|
-
return
|
|
59090
|
+
return name !== "expression";
|
|
58988
59091
|
default:
|
|
58989
59092
|
return true;
|
|
58990
59093
|
}
|
|
@@ -58994,9 +59097,9 @@ var require_fast_path = __commonJS({
|
|
|
58994
59097
|
case "UnionTypeAnnotation":
|
|
58995
59098
|
return parent.type === "NullableTypeAnnotation";
|
|
58996
59099
|
case "Literal":
|
|
58997
|
-
return parent.type === "MemberExpression" && isNumber.check(node.value) &&
|
|
59100
|
+
return parent.type === "MemberExpression" && isNumber.check(node.value) && name === "object" && parent.object === node;
|
|
58998
59101
|
case "NumericLiteral":
|
|
58999
|
-
return parent.type === "MemberExpression" &&
|
|
59102
|
+
return parent.type === "MemberExpression" && name === "object" && parent.object === node;
|
|
59000
59103
|
case "YieldExpression":
|
|
59001
59104
|
case "AwaitExpression":
|
|
59002
59105
|
case "AssignmentExpression":
|
|
@@ -59010,41 +59113,41 @@ var require_fast_path = __commonJS({
|
|
|
59010
59113
|
return true;
|
|
59011
59114
|
case "CallExpression":
|
|
59012
59115
|
case "NewExpression":
|
|
59013
|
-
return
|
|
59116
|
+
return name === "callee" && parent.callee === node;
|
|
59014
59117
|
case "ConditionalExpression":
|
|
59015
|
-
return
|
|
59118
|
+
return name === "test" && parent.test === node;
|
|
59016
59119
|
case "MemberExpression":
|
|
59017
|
-
return
|
|
59120
|
+
return name === "object" && parent.object === node;
|
|
59018
59121
|
default:
|
|
59019
59122
|
return false;
|
|
59020
59123
|
}
|
|
59021
59124
|
case "ArrowFunctionExpression":
|
|
59022
|
-
if (n.CallExpression.check(parent) &&
|
|
59125
|
+
if (n.CallExpression.check(parent) && name === "callee" && parent.callee === node) {
|
|
59023
59126
|
return true;
|
|
59024
59127
|
}
|
|
59025
|
-
if (n.MemberExpression.check(parent) &&
|
|
59128
|
+
if (n.MemberExpression.check(parent) && name === "object" && parent.object === node) {
|
|
59026
59129
|
return true;
|
|
59027
59130
|
}
|
|
59028
|
-
if (n.TSAsExpression && n.TSAsExpression.check(parent) &&
|
|
59131
|
+
if (n.TSAsExpression && n.TSAsExpression.check(parent) && name === "expression" && parent.expression === node) {
|
|
59029
59132
|
return true;
|
|
59030
59133
|
}
|
|
59031
59134
|
return isBinary(parent);
|
|
59032
59135
|
case "ObjectExpression":
|
|
59033
|
-
if (parent.type === "ArrowFunctionExpression" &&
|
|
59136
|
+
if (parent.type === "ArrowFunctionExpression" && name === "body" && parent.body === node) {
|
|
59034
59137
|
return true;
|
|
59035
59138
|
}
|
|
59036
59139
|
break;
|
|
59037
59140
|
case "TSAsExpression":
|
|
59038
|
-
if (parent.type === "ArrowFunctionExpression" &&
|
|
59141
|
+
if (parent.type === "ArrowFunctionExpression" && name === "body" && parent.body === node && node.expression.type === "ObjectExpression") {
|
|
59039
59142
|
return true;
|
|
59040
59143
|
}
|
|
59041
59144
|
break;
|
|
59042
59145
|
case "CallExpression":
|
|
59043
|
-
if (
|
|
59146
|
+
if (name === "declaration" && n.ExportDefaultDeclaration.check(parent) && n.FunctionExpression.check(node.callee)) {
|
|
59044
59147
|
return true;
|
|
59045
59148
|
}
|
|
59046
59149
|
}
|
|
59047
|
-
if (parent.type === "NewExpression" &&
|
|
59150
|
+
if (parent.type === "NewExpression" && name === "callee" && parent.callee === node) {
|
|
59048
59151
|
return containsCallExpression(node);
|
|
59049
59152
|
}
|
|
59050
59153
|
if (assumeExpressionContext !== true && !this.canBeFirstInStatement() && this.firstInStatement()) {
|
|
@@ -60682,12 +60785,12 @@ var require_printer2 = __commonJS({
|
|
|
60682
60785
|
return (0, lines_1.concat)(parts);
|
|
60683
60786
|
}
|
|
60684
60787
|
case "FunctionTypeParam": {
|
|
60685
|
-
var
|
|
60686
|
-
parts.push(
|
|
60788
|
+
var name = path2.call(print12, "name");
|
|
60789
|
+
parts.push(name);
|
|
60687
60790
|
if (n.optional) {
|
|
60688
60791
|
parts.push("?");
|
|
60689
60792
|
}
|
|
60690
|
-
if (
|
|
60793
|
+
if (name.infos[0].line) {
|
|
60691
60794
|
parts.push(": ");
|
|
60692
60795
|
}
|
|
60693
60796
|
parts.push(path2.call(print12, "typeAnnotation"));
|
|
@@ -61870,8 +61973,8 @@ async function shouldRun(absolutePath, watchKind, watchAndRunConf) {
|
|
|
61870
61973
|
}
|
|
61871
61974
|
return null;
|
|
61872
61975
|
}
|
|
61873
|
-
function formatLog(str,
|
|
61874
|
-
return `${
|
|
61976
|
+
function formatLog(str, name) {
|
|
61977
|
+
return `${name ? logMagneta(`[${name}]`) : ""} ${str}`;
|
|
61875
61978
|
}
|
|
61876
61979
|
async function watcher(absolutePath, watchKind, watchAndRunConf) {
|
|
61877
61980
|
const info = await shouldRun(absolutePath, watchKind, watchAndRunConf);
|
|
@@ -61974,17 +62077,17 @@ function compareStrings(a, b) {
|
|
|
61974
62077
|
}
|
|
61975
62078
|
function nodeToString(a) {
|
|
61976
62079
|
var _a, _b;
|
|
61977
|
-
let
|
|
62080
|
+
let name;
|
|
61978
62081
|
if ("alias" in a) {
|
|
61979
|
-
|
|
62082
|
+
name = (_a = a.alias) === null || _a === void 0 ? void 0 : _a.value;
|
|
61980
62083
|
}
|
|
61981
|
-
if (
|
|
61982
|
-
|
|
62084
|
+
if (name == null && "name" in a) {
|
|
62085
|
+
name = (_b = a.name) === null || _b === void 0 ? void 0 : _b.value;
|
|
61983
62086
|
}
|
|
61984
|
-
if (
|
|
61985
|
-
|
|
62087
|
+
if (name == null) {
|
|
62088
|
+
name = a.kind;
|
|
61986
62089
|
}
|
|
61987
|
-
return
|
|
62090
|
+
return name;
|
|
61988
62091
|
}
|
|
61989
62092
|
function compareNodes(a, b, customFn) {
|
|
61990
62093
|
const aStr = nodeToString(a);
|
|
@@ -62101,9 +62204,9 @@ function formatArray(array, seenValues) {
|
|
|
62101
62204
|
function getObjectTag(object) {
|
|
62102
62205
|
const tag = Object.prototype.toString.call(object).replace(/^\[object /, "").replace(/]$/, "");
|
|
62103
62206
|
if (tag === "Object" && typeof object.constructor === "function") {
|
|
62104
|
-
const
|
|
62105
|
-
if (typeof
|
|
62106
|
-
return
|
|
62207
|
+
const name = object.constructor.name;
|
|
62208
|
+
if (typeof name === "string" && name !== "") {
|
|
62209
|
+
return name;
|
|
62107
62210
|
}
|
|
62108
62211
|
}
|
|
62109
62212
|
return tag;
|
|
@@ -62581,7 +62684,7 @@ function astFromEnumValue(value, schema, pathToDirectivesInExtensions) {
|
|
|
62581
62684
|
function makeDeprecatedDirective(deprecationReason) {
|
|
62582
62685
|
return makeDirectiveNode("deprecated", { reason: deprecationReason }, import_graphql4.GraphQLDeprecatedDirective);
|
|
62583
62686
|
}
|
|
62584
|
-
function makeDirectiveNode(
|
|
62687
|
+
function makeDirectiveNode(name, args, directive) {
|
|
62585
62688
|
const directiveArguments = [];
|
|
62586
62689
|
if (directive != null) {
|
|
62587
62690
|
for (const arg of directive.args) {
|
|
@@ -62621,7 +62724,7 @@ function makeDirectiveNode(name2, args, directive) {
|
|
|
62621
62724
|
kind: import_graphql4.Kind.DIRECTIVE,
|
|
62622
62725
|
name: {
|
|
62623
62726
|
kind: import_graphql4.Kind.NAME,
|
|
62624
|
-
value:
|
|
62727
|
+
value: name
|
|
62625
62728
|
},
|
|
62626
62729
|
arguments: directiveArguments
|
|
62627
62730
|
};
|
|
@@ -62761,8 +62864,8 @@ var printDocASTReducer = {
|
|
|
62761
62864
|
},
|
|
62762
62865
|
SelectionSet: { leave: ({ selections }) => block(selections) },
|
|
62763
62866
|
Field: {
|
|
62764
|
-
leave({ alias, name
|
|
62765
|
-
const prefix = wrap("", alias, ": ") +
|
|
62867
|
+
leave({ alias, name, arguments: args, directives, selectionSet }) {
|
|
62868
|
+
const prefix = wrap("", alias, ": ") + name;
|
|
62766
62869
|
let argsLine = prefix + wrap("(", join(args, ", "), ")");
|
|
62767
62870
|
if (argsLine.length > MAX_LINE_LENGTH) {
|
|
62768
62871
|
argsLine = prefix + wrap("(\n", indent(join(args, "\n")), "\n)");
|
|
@@ -62770,15 +62873,15 @@ var printDocASTReducer = {
|
|
|
62770
62873
|
return join([argsLine, join(directives, " "), selectionSet], " ");
|
|
62771
62874
|
}
|
|
62772
62875
|
},
|
|
62773
|
-
Argument: { leave: ({ name
|
|
62876
|
+
Argument: { leave: ({ name, value }) => name + ": " + value },
|
|
62774
62877
|
FragmentSpread: {
|
|
62775
|
-
leave: ({ name
|
|
62878
|
+
leave: ({ name, directives }) => "..." + name + wrap(" ", join(directives, " "))
|
|
62776
62879
|
},
|
|
62777
62880
|
InlineFragment: {
|
|
62778
62881
|
leave: ({ typeCondition, directives, selectionSet }) => join(["...", wrap("on ", typeCondition), join(directives, " "), selectionSet], " ")
|
|
62779
62882
|
},
|
|
62780
62883
|
FragmentDefinition: {
|
|
62781
|
-
leave: ({ name
|
|
62884
|
+
leave: ({ name, typeCondition, variableDefinitions, directives, selectionSet }) => `fragment ${name}${wrap("(", join(variableDefinitions, ", "), ")")} on ${typeCondition} ${wrap("", join(directives, " "), " ")}` + selectionSet
|
|
62782
62885
|
},
|
|
62783
62886
|
IntValue: { leave: ({ value }) => value },
|
|
62784
62887
|
FloatValue: { leave: ({ value }) => value },
|
|
@@ -62795,11 +62898,11 @@ var printDocASTReducer = {
|
|
|
62795
62898
|
EnumValue: { leave: ({ value }) => value },
|
|
62796
62899
|
ListValue: { leave: ({ values }) => "[" + join(values, ", ") + "]" },
|
|
62797
62900
|
ObjectValue: { leave: ({ fields }) => "{" + join(fields, ", ") + "}" },
|
|
62798
|
-
ObjectField: { leave: ({ name
|
|
62901
|
+
ObjectField: { leave: ({ name, value }) => name + ": " + value },
|
|
62799
62902
|
Directive: {
|
|
62800
|
-
leave: ({ name
|
|
62903
|
+
leave: ({ name, arguments: args }) => "@" + name + wrap("(", join(args, ", "), ")")
|
|
62801
62904
|
},
|
|
62802
|
-
NamedType: { leave: ({ name
|
|
62905
|
+
NamedType: { leave: ({ name }) => name },
|
|
62803
62906
|
ListType: { leave: ({ type }) => "[" + type + "]" },
|
|
62804
62907
|
NonNullType: { leave: ({ type }) => type + "!" },
|
|
62805
62908
|
SchemaDefinition: {
|
|
@@ -62809,55 +62912,55 @@ var printDocASTReducer = {
|
|
|
62809
62912
|
leave: ({ operation, type }) => operation + ": " + type
|
|
62810
62913
|
},
|
|
62811
62914
|
ScalarTypeDefinition: {
|
|
62812
|
-
leave: ({ name
|
|
62915
|
+
leave: ({ name, directives }) => join(["scalar", name, join(directives, " ")], " ")
|
|
62813
62916
|
},
|
|
62814
62917
|
ObjectTypeDefinition: {
|
|
62815
|
-
leave: ({ name
|
|
62918
|
+
leave: ({ name, interfaces, directives, fields }) => join(["type", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
62816
62919
|
},
|
|
62817
62920
|
FieldDefinition: {
|
|
62818
|
-
leave: ({ name
|
|
62921
|
+
leave: ({ name, arguments: args, type, directives }) => name + (hasMultilineItems(args) ? wrap("(\n", indent(join(args, "\n")), "\n)") : wrap("(", join(args, ", "), ")")) + ": " + type + wrap(" ", join(directives, " "))
|
|
62819
62922
|
},
|
|
62820
62923
|
InputValueDefinition: {
|
|
62821
|
-
leave: ({ name
|
|
62924
|
+
leave: ({ name, type, defaultValue, directives }) => join([name + ": " + type, wrap("= ", defaultValue), join(directives, " ")], " ")
|
|
62822
62925
|
},
|
|
62823
62926
|
InterfaceTypeDefinition: {
|
|
62824
|
-
leave: ({ name
|
|
62927
|
+
leave: ({ name, interfaces, directives, fields }) => join(["interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
62825
62928
|
},
|
|
62826
62929
|
UnionTypeDefinition: {
|
|
62827
|
-
leave: ({ name
|
|
62930
|
+
leave: ({ name, directives, types: types17 }) => join(["union", name, join(directives, " "), wrap("= ", join(types17, " | "))], " ")
|
|
62828
62931
|
},
|
|
62829
62932
|
EnumTypeDefinition: {
|
|
62830
|
-
leave: ({ name
|
|
62933
|
+
leave: ({ name, directives, values }) => join(["enum", name, join(directives, " "), block(values)], " ")
|
|
62831
62934
|
},
|
|
62832
62935
|
EnumValueDefinition: {
|
|
62833
|
-
leave: ({ name
|
|
62936
|
+
leave: ({ name, directives }) => join([name, join(directives, " ")], " ")
|
|
62834
62937
|
},
|
|
62835
62938
|
InputObjectTypeDefinition: {
|
|
62836
|
-
leave: ({ name
|
|
62939
|
+
leave: ({ name, directives, fields }) => join(["input", name, join(directives, " "), block(fields)], " ")
|
|
62837
62940
|
},
|
|
62838
62941
|
DirectiveDefinition: {
|
|
62839
|
-
leave: ({ name
|
|
62942
|
+
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, " | ")
|
|
62840
62943
|
},
|
|
62841
62944
|
SchemaExtension: {
|
|
62842
62945
|
leave: ({ directives, operationTypes }) => join(["extend schema", join(directives, " "), block(operationTypes)], " ")
|
|
62843
62946
|
},
|
|
62844
62947
|
ScalarTypeExtension: {
|
|
62845
|
-
leave: ({ name
|
|
62948
|
+
leave: ({ name, directives }) => join(["extend scalar", name, join(directives, " ")], " ")
|
|
62846
62949
|
},
|
|
62847
62950
|
ObjectTypeExtension: {
|
|
62848
|
-
leave: ({ name
|
|
62951
|
+
leave: ({ name, interfaces, directives, fields }) => join(["extend type", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
62849
62952
|
},
|
|
62850
62953
|
InterfaceTypeExtension: {
|
|
62851
|
-
leave: ({ name
|
|
62954
|
+
leave: ({ name, interfaces, directives, fields }) => join(["extend interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
62852
62955
|
},
|
|
62853
62956
|
UnionTypeExtension: {
|
|
62854
|
-
leave: ({ name
|
|
62957
|
+
leave: ({ name, directives, types: types17 }) => join(["extend union", name, join(directives, " "), wrap("= ", join(types17, " | "))], " ")
|
|
62855
62958
|
},
|
|
62856
62959
|
EnumTypeExtension: {
|
|
62857
|
-
leave: ({ name
|
|
62960
|
+
leave: ({ name, directives, values }) => join(["extend enum", name, join(directives, " "), block(values)], " ")
|
|
62858
62961
|
},
|
|
62859
62962
|
InputObjectTypeExtension: {
|
|
62860
|
-
leave: ({ name
|
|
62963
|
+
leave: ({ name, directives, fields }) => join(["extend input", name, join(directives, " "), block(fields)], " ")
|
|
62861
62964
|
}
|
|
62862
62965
|
};
|
|
62863
62966
|
var printDocASTReducerWithComments = Object.keys(printDocASTReducer).reduce((prev, key) => ({
|
|
@@ -64372,8 +64475,8 @@ var import_graphql18 = __toESM(require_graphql2(), 1);
|
|
|
64372
64475
|
function directiveAlreadyExists(directivesArr, otherDirective) {
|
|
64373
64476
|
return !!directivesArr.find((directive) => directive.name.value === otherDirective.name.value);
|
|
64374
64477
|
}
|
|
64375
|
-
function nameAlreadyExists(
|
|
64376
|
-
return namesArr.some(({ value }) => value ===
|
|
64478
|
+
function nameAlreadyExists(name, namesArr) {
|
|
64479
|
+
return namesArr.some(({ value }) => value === name.value);
|
|
64377
64480
|
}
|
|
64378
64481
|
function mergeArguments2(a1, a2) {
|
|
64379
64482
|
const result = [...a2];
|
|
@@ -64450,7 +64553,7 @@ function mergeDirective(node, existingNode) {
|
|
|
64450
64553
|
...node,
|
|
64451
64554
|
locations: [
|
|
64452
64555
|
...existingNode.locations,
|
|
64453
|
-
...node.locations.filter((
|
|
64556
|
+
...node.locations.filter((name) => !nameAlreadyExists(name, existingNode.locations))
|
|
64454
64557
|
]
|
|
64455
64558
|
};
|
|
64456
64559
|
}
|
|
@@ -64807,43 +64910,43 @@ function mergeGraphQLNodes(nodes, config4) {
|
|
|
64807
64910
|
const mergedResultMap = {};
|
|
64808
64911
|
for (const nodeDefinition of nodes) {
|
|
64809
64912
|
if (isNamedDefinitionNode(nodeDefinition)) {
|
|
64810
|
-
const
|
|
64913
|
+
const name = (_a = nodeDefinition.name) === null || _a === void 0 ? void 0 : _a.value;
|
|
64811
64914
|
if (config4 === null || config4 === void 0 ? void 0 : config4.commentDescriptions) {
|
|
64812
64915
|
collectComment(nodeDefinition);
|
|
64813
64916
|
}
|
|
64814
|
-
if (
|
|
64917
|
+
if (name == null) {
|
|
64815
64918
|
continue;
|
|
64816
64919
|
}
|
|
64817
|
-
if (((_b = config4 === null || config4 === void 0 ? void 0 : config4.exclusions) === null || _b === void 0 ? void 0 : _b.includes(
|
|
64818
|
-
delete mergedResultMap[
|
|
64920
|
+
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))) {
|
|
64921
|
+
delete mergedResultMap[name];
|
|
64819
64922
|
} else {
|
|
64820
64923
|
switch (nodeDefinition.kind) {
|
|
64821
64924
|
case import_graphql27.Kind.OBJECT_TYPE_DEFINITION:
|
|
64822
64925
|
case import_graphql27.Kind.OBJECT_TYPE_EXTENSION:
|
|
64823
|
-
mergedResultMap[
|
|
64926
|
+
mergedResultMap[name] = mergeType(nodeDefinition, mergedResultMap[name], config4);
|
|
64824
64927
|
break;
|
|
64825
64928
|
case import_graphql27.Kind.ENUM_TYPE_DEFINITION:
|
|
64826
64929
|
case import_graphql27.Kind.ENUM_TYPE_EXTENSION:
|
|
64827
|
-
mergedResultMap[
|
|
64930
|
+
mergedResultMap[name] = mergeEnum(nodeDefinition, mergedResultMap[name], config4);
|
|
64828
64931
|
break;
|
|
64829
64932
|
case import_graphql27.Kind.UNION_TYPE_DEFINITION:
|
|
64830
64933
|
case import_graphql27.Kind.UNION_TYPE_EXTENSION:
|
|
64831
|
-
mergedResultMap[
|
|
64934
|
+
mergedResultMap[name] = mergeUnion(nodeDefinition, mergedResultMap[name], config4);
|
|
64832
64935
|
break;
|
|
64833
64936
|
case import_graphql27.Kind.SCALAR_TYPE_DEFINITION:
|
|
64834
64937
|
case import_graphql27.Kind.SCALAR_TYPE_EXTENSION:
|
|
64835
|
-
mergedResultMap[
|
|
64938
|
+
mergedResultMap[name] = mergeScalar(nodeDefinition, mergedResultMap[name], config4);
|
|
64836
64939
|
break;
|
|
64837
64940
|
case import_graphql27.Kind.INPUT_OBJECT_TYPE_DEFINITION:
|
|
64838
64941
|
case import_graphql27.Kind.INPUT_OBJECT_TYPE_EXTENSION:
|
|
64839
|
-
mergedResultMap[
|
|
64942
|
+
mergedResultMap[name] = mergeInputType(nodeDefinition, mergedResultMap[name], config4);
|
|
64840
64943
|
break;
|
|
64841
64944
|
case import_graphql27.Kind.INTERFACE_TYPE_DEFINITION:
|
|
64842
64945
|
case import_graphql27.Kind.INTERFACE_TYPE_EXTENSION:
|
|
64843
|
-
mergedResultMap[
|
|
64946
|
+
mergedResultMap[name] = mergeInterface(nodeDefinition, mergedResultMap[name], config4);
|
|
64844
64947
|
break;
|
|
64845
64948
|
case import_graphql27.Kind.DIRECTIVE_DEFINITION:
|
|
64846
|
-
mergedResultMap[
|
|
64949
|
+
mergedResultMap[name] = mergeDirective(nodeDefinition, mergedResultMap[name]);
|
|
64847
64950
|
break;
|
|
64848
64951
|
}
|
|
64849
64952
|
}
|
|
@@ -65122,6 +65225,9 @@ var houdini_mode = {
|
|
|
65122
65225
|
}
|
|
65123
65226
|
};
|
|
65124
65227
|
|
|
65228
|
+
// src/lib/deepMerge.ts
|
|
65229
|
+
var import_deepmerge = __toESM(require_cjs(), 1);
|
|
65230
|
+
|
|
65125
65231
|
// src/lib/error.ts
|
|
65126
65232
|
var HoudiniError = class extends Error {
|
|
65127
65233
|
filepath = null;
|
|
@@ -65141,6 +65247,20 @@ var HoudiniError = class extends Error {
|
|
|
65141
65247
|
}
|
|
65142
65248
|
};
|
|
65143
65249
|
|
|
65250
|
+
// src/lib/deepMerge.ts
|
|
65251
|
+
function deepMerge(filepath, ...targets) {
|
|
65252
|
+
try {
|
|
65253
|
+
if (targets.length === 1) {
|
|
65254
|
+
return targets[0];
|
|
65255
|
+
} else if (targets.length === 2) {
|
|
65256
|
+
return (0, import_deepmerge.default)(targets[0], targets[1]);
|
|
65257
|
+
}
|
|
65258
|
+
return deepMerge(filepath, targets[0], deepMerge(filepath, ...targets.slice(1)));
|
|
65259
|
+
} catch (e2) {
|
|
65260
|
+
throw new HoudiniError({ filepath, message: "could not merge: " + targets });
|
|
65261
|
+
}
|
|
65262
|
+
}
|
|
65263
|
+
|
|
65144
65264
|
// src/lib/fs.ts
|
|
65145
65265
|
var fs_exports = {};
|
|
65146
65266
|
__export(fs_exports, {
|
|
@@ -65583,8 +65703,8 @@ var Body = class {
|
|
|
65583
65703
|
if (ct.startsWith("application/x-www-form-urlencoded")) {
|
|
65584
65704
|
const formData = new FormData();
|
|
65585
65705
|
const parameters = new URLSearchParams(await this.text());
|
|
65586
|
-
for (const [
|
|
65587
|
-
formData.append(
|
|
65706
|
+
for (const [name, value] of parameters) {
|
|
65707
|
+
formData.append(name, value);
|
|
65588
65708
|
}
|
|
65589
65709
|
return formData;
|
|
65590
65710
|
}
|
|
@@ -65745,16 +65865,16 @@ var writeToStream = async (dest, { body }) => {
|
|
|
65745
65865
|
// ../../node_modules/.pnpm/node-fetch@3.3.0/node_modules/node-fetch/src/headers.js
|
|
65746
65866
|
import { types as types2 } from "node:util";
|
|
65747
65867
|
import http from "node:http";
|
|
65748
|
-
var validateHeaderName = typeof http.validateHeaderName === "function" ? http.validateHeaderName : (
|
|
65749
|
-
if (!/^[\^`\-\w!#$%&'*+.|~]+$/.test(
|
|
65750
|
-
const error = new TypeError(`Header name must be a valid HTTP token [${
|
|
65868
|
+
var validateHeaderName = typeof http.validateHeaderName === "function" ? http.validateHeaderName : (name) => {
|
|
65869
|
+
if (!/^[\^`\-\w!#$%&'*+.|~]+$/.test(name)) {
|
|
65870
|
+
const error = new TypeError(`Header name must be a valid HTTP token [${name}]`);
|
|
65751
65871
|
Object.defineProperty(error, "code", { value: "ERR_INVALID_HTTP_TOKEN" });
|
|
65752
65872
|
throw error;
|
|
65753
65873
|
}
|
|
65754
65874
|
};
|
|
65755
|
-
var validateHeaderValue = typeof http.validateHeaderValue === "function" ? http.validateHeaderValue : (
|
|
65875
|
+
var validateHeaderValue = typeof http.validateHeaderValue === "function" ? http.validateHeaderValue : (name, value) => {
|
|
65756
65876
|
if (/[^\t\u0020-\u007E\u0080-\u00FF]/.test(value)) {
|
|
65757
|
-
const error = new TypeError(`Invalid character in header content ["${
|
|
65877
|
+
const error = new TypeError(`Invalid character in header content ["${name}"]`);
|
|
65758
65878
|
Object.defineProperty(error, "code", { value: "ERR_INVALID_CHAR" });
|
|
65759
65879
|
throw error;
|
|
65760
65880
|
}
|
|
@@ -65764,8 +65884,8 @@ var Headers = class extends URLSearchParams {
|
|
|
65764
65884
|
let result = [];
|
|
65765
65885
|
if (init instanceof Headers) {
|
|
65766
65886
|
const raw = init.raw();
|
|
65767
|
-
for (const [
|
|
65768
|
-
result.push(...values.map((value) => [
|
|
65887
|
+
for (const [name, values] of Object.entries(raw)) {
|
|
65888
|
+
result.push(...values.map((value) => [name, value]));
|
|
65769
65889
|
}
|
|
65770
65890
|
} else if (init == null) {
|
|
65771
65891
|
} else if (typeof init === "object" && !types2.isBoxedPrimitive(init)) {
|
|
@@ -65791,10 +65911,10 @@ var Headers = class extends URLSearchParams {
|
|
|
65791
65911
|
} else {
|
|
65792
65912
|
throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");
|
|
65793
65913
|
}
|
|
65794
|
-
result = result.length > 0 ? result.map(([
|
|
65795
|
-
validateHeaderName(
|
|
65796
|
-
validateHeaderValue(
|
|
65797
|
-
return [String(
|
|
65914
|
+
result = result.length > 0 ? result.map(([name, value]) => {
|
|
65915
|
+
validateHeaderName(name);
|
|
65916
|
+
validateHeaderValue(name, String(value));
|
|
65917
|
+
return [String(name).toLowerCase(), String(value)];
|
|
65798
65918
|
}) : void 0;
|
|
65799
65919
|
super(result);
|
|
65800
65920
|
return new Proxy(this, {
|
|
@@ -65802,23 +65922,23 @@ var Headers = class extends URLSearchParams {
|
|
|
65802
65922
|
switch (p) {
|
|
65803
65923
|
case "append":
|
|
65804
65924
|
case "set":
|
|
65805
|
-
return (
|
|
65806
|
-
validateHeaderName(
|
|
65807
|
-
validateHeaderValue(
|
|
65925
|
+
return (name, value) => {
|
|
65926
|
+
validateHeaderName(name);
|
|
65927
|
+
validateHeaderValue(name, String(value));
|
|
65808
65928
|
return URLSearchParams.prototype[p].call(
|
|
65809
65929
|
target,
|
|
65810
|
-
String(
|
|
65930
|
+
String(name).toLowerCase(),
|
|
65811
65931
|
String(value)
|
|
65812
65932
|
);
|
|
65813
65933
|
};
|
|
65814
65934
|
case "delete":
|
|
65815
65935
|
case "has":
|
|
65816
65936
|
case "getAll":
|
|
65817
|
-
return (
|
|
65818
|
-
validateHeaderName(
|
|
65937
|
+
return (name) => {
|
|
65938
|
+
validateHeaderName(name);
|
|
65819
65939
|
return URLSearchParams.prototype[p].call(
|
|
65820
65940
|
target,
|
|
65821
|
-
String(
|
|
65941
|
+
String(name).toLowerCase()
|
|
65822
65942
|
);
|
|
65823
65943
|
};
|
|
65824
65944
|
case "keys":
|
|
@@ -65838,30 +65958,30 @@ var Headers = class extends URLSearchParams {
|
|
|
65838
65958
|
toString() {
|
|
65839
65959
|
return Object.prototype.toString.call(this);
|
|
65840
65960
|
}
|
|
65841
|
-
get(
|
|
65842
|
-
const values = this.getAll(
|
|
65961
|
+
get(name) {
|
|
65962
|
+
const values = this.getAll(name);
|
|
65843
65963
|
if (values.length === 0) {
|
|
65844
65964
|
return null;
|
|
65845
65965
|
}
|
|
65846
65966
|
let value = values.join(", ");
|
|
65847
|
-
if (/^content-encoding$/i.test(
|
|
65967
|
+
if (/^content-encoding$/i.test(name)) {
|
|
65848
65968
|
value = value.toLowerCase();
|
|
65849
65969
|
}
|
|
65850
65970
|
return value;
|
|
65851
65971
|
}
|
|
65852
65972
|
forEach(callback, thisArg = void 0) {
|
|
65853
|
-
for (const
|
|
65854
|
-
Reflect.apply(callback, thisArg, [this.get(
|
|
65973
|
+
for (const name of this.keys()) {
|
|
65974
|
+
Reflect.apply(callback, thisArg, [this.get(name), name, this]);
|
|
65855
65975
|
}
|
|
65856
65976
|
}
|
|
65857
65977
|
*values() {
|
|
65858
|
-
for (const
|
|
65859
|
-
yield this.get(
|
|
65978
|
+
for (const name of this.keys()) {
|
|
65979
|
+
yield this.get(name);
|
|
65860
65980
|
}
|
|
65861
65981
|
}
|
|
65862
65982
|
*entries() {
|
|
65863
|
-
for (const
|
|
65864
|
-
yield [
|
|
65983
|
+
for (const name of this.keys()) {
|
|
65984
|
+
yield [name, this.get(name)];
|
|
65865
65985
|
}
|
|
65866
65986
|
}
|
|
65867
65987
|
[Symbol.iterator]() {
|
|
@@ -65899,10 +66019,10 @@ function fromRawHeaders(headers = []) {
|
|
|
65899
66019
|
result.push(array.slice(index, index + 2));
|
|
65900
66020
|
}
|
|
65901
66021
|
return result;
|
|
65902
|
-
}, []).filter(([
|
|
66022
|
+
}, []).filter(([name, value]) => {
|
|
65903
66023
|
try {
|
|
65904
|
-
validateHeaderName(
|
|
65905
|
-
validateHeaderValue(
|
|
66024
|
+
validateHeaderName(name);
|
|
66025
|
+
validateHeaderValue(name, String(value));
|
|
65906
66026
|
return true;
|
|
65907
66027
|
} catch {
|
|
65908
66028
|
return false;
|
|
@@ -66484,8 +66604,8 @@ async function fetch(url, options_) {
|
|
|
66484
66604
|
referrerPolicy: request.referrerPolicy
|
|
66485
66605
|
};
|
|
66486
66606
|
if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) {
|
|
66487
|
-
for (const
|
|
66488
|
-
requestOptions.headers.delete(
|
|
66607
|
+
for (const name of ["authorization", "www-authenticate", "cookie", "cookie2"]) {
|
|
66608
|
+
requestOptions.headers.delete(name);
|
|
66489
66609
|
}
|
|
66490
66610
|
}
|
|
66491
66611
|
if (response_.statusCode !== 303 && request.body && options_.body instanceof Stream2.Readable) {
|
|
@@ -66658,6 +66778,31 @@ async function pullSchema(url, schemaPath, headers) {
|
|
|
66658
66778
|
return false;
|
|
66659
66779
|
}
|
|
66660
66780
|
|
|
66781
|
+
// src/lib/plugin.ts
|
|
66782
|
+
function plugin(name, hooks) {
|
|
66783
|
+
const data = {
|
|
66784
|
+
name,
|
|
66785
|
+
plugin: hooks,
|
|
66786
|
+
__plugin_init__: true,
|
|
66787
|
+
with(config4) {
|
|
66788
|
+
return {
|
|
66789
|
+
...data,
|
|
66790
|
+
config: config4
|
|
66791
|
+
};
|
|
66792
|
+
}
|
|
66793
|
+
};
|
|
66794
|
+
return data;
|
|
66795
|
+
}
|
|
66796
|
+
|
|
66797
|
+
// src/lib/types.ts
|
|
66798
|
+
var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
66799
|
+
LogLevel2["Full"] = "full";
|
|
66800
|
+
LogLevel2["Summary"] = "summary";
|
|
66801
|
+
LogLevel2["ShortSummary"] = "short-summary";
|
|
66802
|
+
LogLevel2["Quiet"] = "quiet";
|
|
66803
|
+
return LogLevel2;
|
|
66804
|
+
})(LogLevel || {});
|
|
66805
|
+
|
|
66661
66806
|
// src/lib/config.ts
|
|
66662
66807
|
var currentDir = global.__dirname || dirname(fileURLToPath(import.meta.url));
|
|
66663
66808
|
var Config = class {
|
|
@@ -66676,7 +66821,6 @@ var Config = class {
|
|
|
66676
66821
|
internalListPosition;
|
|
66677
66822
|
defaultListTarget = null;
|
|
66678
66823
|
definitionsFolder;
|
|
66679
|
-
newSchema = "";
|
|
66680
66824
|
newDocuments = "";
|
|
66681
66825
|
defaultKeys = ["id"];
|
|
66682
66826
|
typeConfig;
|
|
@@ -66730,7 +66874,7 @@ var Config = class {
|
|
|
66730
66874
|
Object.values(LogLevel)
|
|
66731
66875
|
)}`
|
|
66732
66876
|
);
|
|
66733
|
-
logLevel =
|
|
66877
|
+
logLevel = "summary" /* Summary */;
|
|
66734
66878
|
}
|
|
66735
66879
|
this.schemaPath = schemaPath;
|
|
66736
66880
|
this.filepath = filepath;
|
|
@@ -66746,7 +66890,7 @@ var Config = class {
|
|
|
66746
66890
|
this.internalListPosition = defaultListPosition === "append" ? "last" : "first";
|
|
66747
66891
|
this.defaultListTarget = defaultListTarget;
|
|
66748
66892
|
this.definitionsFolder = definitionsPath;
|
|
66749
|
-
this.logLevel = (logLevel ||
|
|
66893
|
+
this.logLevel = (logLevel || "summary" /* Summary */).toLowerCase();
|
|
66750
66894
|
this.defaultFragmentMasking = defaultFragmentMasking;
|
|
66751
66895
|
this.routesDir = join2(this.projectRoot, "src", "routes");
|
|
66752
66896
|
this.schemaPollInterval = watchSchema?.interval ?? 2e3;
|
|
@@ -66775,19 +66919,19 @@ var Config = class {
|
|
|
66775
66919
|
return Array.isArray(this.configFile.include) ? this.configFile.include : [this.configFile.include];
|
|
66776
66920
|
}
|
|
66777
66921
|
const extensions = [".graphql", ".gql", ".ts", ".js"].concat(
|
|
66778
|
-
this.plugins.flatMap((
|
|
66922
|
+
this.plugins.flatMap((plugin2) => plugin2.extensions ?? [])
|
|
66779
66923
|
);
|
|
66780
66924
|
return [`src/**/*{${extensions.join(",")}}`];
|
|
66781
66925
|
}
|
|
66782
|
-
pluginConfig(
|
|
66783
|
-
return this.configFile.plugins?.[
|
|
66926
|
+
pluginConfig(name) {
|
|
66927
|
+
return this.configFile.plugins?.[name] ?? {};
|
|
66784
66928
|
}
|
|
66785
66929
|
async getEnv() {
|
|
66786
66930
|
let env = process.env;
|
|
66787
|
-
for (const
|
|
66788
|
-
if (
|
|
66931
|
+
for (const plugin2 of this.plugins) {
|
|
66932
|
+
if (plugin2.env) {
|
|
66789
66933
|
env = {
|
|
66790
|
-
...await
|
|
66934
|
+
...await plugin2.env({ config: this, env })
|
|
66791
66935
|
};
|
|
66792
66936
|
}
|
|
66793
66937
|
}
|
|
@@ -66837,6 +66981,19 @@ var Config = class {
|
|
|
66837
66981
|
)
|
|
66838
66982
|
];
|
|
66839
66983
|
}
|
|
66984
|
+
#newSchemaInstance = null;
|
|
66985
|
+
#schemaString = "";
|
|
66986
|
+
set newSchema(value) {
|
|
66987
|
+
this.#schemaString = value;
|
|
66988
|
+
if (value) {
|
|
66989
|
+
this.#newSchemaInstance = graphql2.buildSchema(value);
|
|
66990
|
+
} else {
|
|
66991
|
+
this.#newSchemaInstance = null;
|
|
66992
|
+
}
|
|
66993
|
+
}
|
|
66994
|
+
get newSchema() {
|
|
66995
|
+
return this.#schemaString;
|
|
66996
|
+
}
|
|
66840
66997
|
get artifactDirectory() {
|
|
66841
66998
|
return join2(this.rootDir, this.artifactDirectoryName);
|
|
66842
66999
|
}
|
|
@@ -66873,23 +67030,8 @@ var Config = class {
|
|
|
66873
67030
|
get typeRootFile() {
|
|
66874
67031
|
return "$houdini.d.ts";
|
|
66875
67032
|
}
|
|
66876
|
-
findModule(pkg = "houdini", currentLocation = join2(dirname(this.filepath))) {
|
|
66877
|
-
const pathEndingBy = ["node_modules", pkg];
|
|
66878
|
-
let locationFound = join2(currentLocation, ...pathEndingBy);
|
|
66879
|
-
let previousLocation = "";
|
|
66880
|
-
const backFolder = [];
|
|
66881
|
-
while (previousLocation !== locationFound && !existsSync(locationFound)) {
|
|
66882
|
-
previousLocation = locationFound;
|
|
66883
|
-
backFolder.push("../");
|
|
66884
|
-
locationFound = join2(currentLocation, ...backFolder, ...pathEndingBy);
|
|
66885
|
-
}
|
|
66886
|
-
if (previousLocation === locationFound) {
|
|
66887
|
-
throw new Error("Could not find any node_modules/houdini folder");
|
|
66888
|
-
}
|
|
66889
|
-
return locationFound;
|
|
66890
|
-
}
|
|
66891
67033
|
get runtimeSource() {
|
|
66892
|
-
const relative2 = houdini_mode.is_testing ? join2(currentDir, "..", "..") : this.
|
|
67034
|
+
const relative2 = houdini_mode.is_testing ? join2(currentDir, "..", "..") : findModule("houdini", join2(dirname(this.filepath)));
|
|
66893
67035
|
const which = this.module === "esm" ? "esm" : "cjs";
|
|
66894
67036
|
return resolve(relative2, "build", `runtime-${which}`);
|
|
66895
67037
|
}
|
|
@@ -66899,8 +67041,8 @@ var Config = class {
|
|
|
66899
67041
|
artifactPath(document) {
|
|
66900
67042
|
return join2(this.artifactDirectory, this.documentName(document) + ".js");
|
|
66901
67043
|
}
|
|
66902
|
-
artifactImportPath(
|
|
66903
|
-
return `$houdini/${this.artifactDirectoryName}/${
|
|
67044
|
+
artifactImportPath(name) {
|
|
67045
|
+
return `$houdini/${this.artifactDirectoryName}/${name}`;
|
|
66904
67046
|
}
|
|
66905
67047
|
keyFieldsForType(type) {
|
|
66906
67048
|
return keyFieldsForType(this.configFile, type);
|
|
@@ -66944,16 +67086,27 @@ var Config = class {
|
|
|
66944
67086
|
relative(process.cwd(), filepath).replaceAll(sep, "_").replace(".ts", ".js")
|
|
66945
67087
|
);
|
|
66946
67088
|
}
|
|
67089
|
+
excludeFile(filepath) {
|
|
67090
|
+
if (this.exclude.length > 0 && this.exclude.some((pattern) => (0, import_minimatch.default)(filepath, pattern))) {
|
|
67091
|
+
return true;
|
|
67092
|
+
}
|
|
67093
|
+
for (const plugin2 of this.plugins) {
|
|
67094
|
+
if (plugin2?.exclude?.({ config: this, filepath })) {
|
|
67095
|
+
return true;
|
|
67096
|
+
}
|
|
67097
|
+
}
|
|
67098
|
+
return false;
|
|
67099
|
+
}
|
|
66947
67100
|
includeFile(filepath, {
|
|
66948
67101
|
root = this.projectRoot,
|
|
66949
67102
|
ignore_plugins = false
|
|
66950
67103
|
} = {}) {
|
|
66951
67104
|
let included = false;
|
|
66952
|
-
for (const
|
|
66953
|
-
if (!
|
|
67105
|
+
for (const plugin2 of ignore_plugins ? [] : this.plugins) {
|
|
67106
|
+
if (!plugin2.include) {
|
|
66954
67107
|
continue;
|
|
66955
67108
|
}
|
|
66956
|
-
if (
|
|
67109
|
+
if (plugin2.include({ config: this, filepath })) {
|
|
66957
67110
|
included = true;
|
|
66958
67111
|
break;
|
|
66959
67112
|
}
|
|
@@ -66961,16 +67114,16 @@ var Config = class {
|
|
|
66961
67114
|
if (!included && !this.include.some((pattern) => (0, import_minimatch.default)(filepath, join2(root, pattern)))) {
|
|
66962
67115
|
return false;
|
|
66963
67116
|
}
|
|
66964
|
-
return !this.
|
|
67117
|
+
return !this.excludeFile(filepath);
|
|
66965
67118
|
}
|
|
66966
|
-
pluginRuntimeDirectory(
|
|
66967
|
-
return join2(this.pluginDirectory(
|
|
67119
|
+
pluginRuntimeDirectory(name) {
|
|
67120
|
+
return join2(this.pluginDirectory(name), "runtime");
|
|
66968
67121
|
}
|
|
66969
67122
|
get pluginRootDirectory() {
|
|
66970
67123
|
return houdini_mode.is_testing ? "../../../" : join2(this.rootDir, "plugins");
|
|
66971
67124
|
}
|
|
66972
|
-
pluginDirectory(
|
|
66973
|
-
return join2(this.pluginRootDirectory,
|
|
67125
|
+
pluginDirectory(name) {
|
|
67126
|
+
return join2(this.pluginRootDirectory, name);
|
|
66974
67127
|
}
|
|
66975
67128
|
get loadDirective() {
|
|
66976
67129
|
return "load";
|
|
@@ -67047,59 +67200,45 @@ var Config = class {
|
|
|
67047
67200
|
paginationQueryName(documentName) {
|
|
67048
67201
|
return documentName + "_Pagination_Query";
|
|
67049
67202
|
}
|
|
67050
|
-
isDeleteDirective(
|
|
67051
|
-
return
|
|
67203
|
+
isDeleteDirective(name) {
|
|
67204
|
+
return name.endsWith(this.deleteDirectiveSuffix);
|
|
67052
67205
|
}
|
|
67053
|
-
listDeleteDirective(
|
|
67054
|
-
return
|
|
67206
|
+
listDeleteDirective(name) {
|
|
67207
|
+
return name + this.deleteDirectiveSuffix;
|
|
67055
67208
|
}
|
|
67056
|
-
deleteDirectiveType(
|
|
67057
|
-
return
|
|
67209
|
+
deleteDirectiveType(name) {
|
|
67210
|
+
return name.slice(0, name.length - this.deleteDirectiveSuffix.length);
|
|
67058
67211
|
}
|
|
67059
|
-
isInsertFragment(
|
|
67060
|
-
return
|
|
67212
|
+
isInsertFragment(name) {
|
|
67213
|
+
return name.endsWith(this.insertFragmentSuffix);
|
|
67061
67214
|
}
|
|
67062
|
-
listInsertFragment(
|
|
67063
|
-
return
|
|
67215
|
+
listInsertFragment(name) {
|
|
67216
|
+
return name + this.insertFragmentSuffix;
|
|
67064
67217
|
}
|
|
67065
|
-
listToggleFragment(
|
|
67066
|
-
return
|
|
67218
|
+
listToggleFragment(name) {
|
|
67219
|
+
return name + this.toggleFragmentSuffix;
|
|
67067
67220
|
}
|
|
67068
|
-
isRemoveFragment(
|
|
67069
|
-
return
|
|
67221
|
+
isRemoveFragment(name) {
|
|
67222
|
+
return name.endsWith(this.removeFragmentSuffix);
|
|
67070
67223
|
}
|
|
67071
|
-
isToggleFragment(
|
|
67072
|
-
return
|
|
67224
|
+
isToggleFragment(name) {
|
|
67225
|
+
return name.endsWith(this.toggleFragmentSuffix);
|
|
67073
67226
|
}
|
|
67074
|
-
listRemoveFragment(
|
|
67075
|
-
return
|
|
67227
|
+
listRemoveFragment(name) {
|
|
67228
|
+
return name + this.removeFragmentSuffix;
|
|
67076
67229
|
}
|
|
67077
67230
|
isInternalEnum(node) {
|
|
67078
67231
|
return node.name.value === "CachePolicy";
|
|
67079
67232
|
}
|
|
67080
|
-
isInternalDirective(
|
|
67081
|
-
|
|
67082
|
-
|
|
67083
|
-
|
|
67084
|
-
|
|
67085
|
-
|
|
67086
|
-
|
|
67087
|
-
|
|
67088
|
-
|
|
67089
|
-
this.argumentsDirective,
|
|
67090
|
-
this.withDirective,
|
|
67091
|
-
this.paginateDirective,
|
|
67092
|
-
this.cacheDirective,
|
|
67093
|
-
this.loadDirective,
|
|
67094
|
-
this.maskEnableDirective,
|
|
67095
|
-
this.maskDisableDirective
|
|
67096
|
-
].includes(name2.value) || this.isDeleteDirective(name2.value);
|
|
67097
|
-
}
|
|
67098
|
-
isListFragment(name2) {
|
|
67099
|
-
return name2.endsWith(this.insertFragmentSuffix) || name2.endsWith(this.removeFragmentSuffix) || name2.endsWith(this.toggleFragmentSuffix);
|
|
67100
|
-
}
|
|
67101
|
-
isListOperationDirective(name2) {
|
|
67102
|
-
return name2.endsWith(this.deleteDirectiveSuffix);
|
|
67233
|
+
isInternalDirective(name) {
|
|
67234
|
+
const internalDirectives = this.#newSchemaInstance?.getDirectives().map((directive) => directive.name) ?? [];
|
|
67235
|
+
return internalDirectives.includes(name) || this.isDeleteDirective(name);
|
|
67236
|
+
}
|
|
67237
|
+
isListFragment(name) {
|
|
67238
|
+
return name.endsWith(this.insertFragmentSuffix) || name.endsWith(this.removeFragmentSuffix) || name.endsWith(this.toggleFragmentSuffix);
|
|
67239
|
+
}
|
|
67240
|
+
isListOperationDirective(name) {
|
|
67241
|
+
return name.endsWith(this.deleteDirectiveSuffix);
|
|
67103
67242
|
}
|
|
67104
67243
|
isFragmentForList(listName, fragmentName) {
|
|
67105
67244
|
return fragmentName.startsWith(listName);
|
|
@@ -67146,58 +67285,12 @@ var Config = class {
|
|
|
67146
67285
|
}
|
|
67147
67286
|
return definition;
|
|
67148
67287
|
}
|
|
67149
|
-
variableFunctionName(
|
|
67150
|
-
return
|
|
67288
|
+
variableFunctionName(name) {
|
|
67289
|
+
return name + "Variables";
|
|
67151
67290
|
}
|
|
67152
67291
|
};
|
|
67153
67292
|
var DEFAULT_CONFIG_PATH = join2(process.cwd(), "houdini.config.js");
|
|
67154
|
-
async function readConfigFile(configPath = DEFAULT_CONFIG_PATH) {
|
|
67155
|
-
let importPath2 = importPath(configPath);
|
|
67156
|
-
let imported;
|
|
67157
|
-
try {
|
|
67158
|
-
imported = await import(importPath2);
|
|
67159
|
-
} catch (e2) {
|
|
67160
|
-
throw new Error(`Could not load config file at file://${configPath}.
|
|
67161
|
-
${e2.message}`);
|
|
67162
|
-
}
|
|
67163
|
-
const config4 = imported.default || imported;
|
|
67164
|
-
return config4;
|
|
67165
|
-
}
|
|
67166
67293
|
var _config;
|
|
67167
|
-
async function loadSchemaFile(schemaPath) {
|
|
67168
|
-
if (isAbsolute(schemaPath)) {
|
|
67169
|
-
const relPath = relative(process.cwd(), schemaPath);
|
|
67170
|
-
const error = new Error(
|
|
67171
|
-
`Invalid config value: 'schemaPath' must now be passed as a relative directory. Please change its value to "./${relPath}".`
|
|
67172
|
-
);
|
|
67173
|
-
error.stack = "";
|
|
67174
|
-
throw error;
|
|
67175
|
-
}
|
|
67176
|
-
if (glob.hasMagic(schemaPath)) {
|
|
67177
|
-
const sourceFiles = await glob(schemaPath);
|
|
67178
|
-
return mergeSchemas({
|
|
67179
|
-
typeDefs: await Promise.all(
|
|
67180
|
-
sourceFiles.map(async (filepath) => await readFile(filepath))
|
|
67181
|
-
)
|
|
67182
|
-
});
|
|
67183
|
-
}
|
|
67184
|
-
try {
|
|
67185
|
-
await stat(schemaPath);
|
|
67186
|
-
} catch {
|
|
67187
|
-
throw new HoudiniError({
|
|
67188
|
-
message: `Schema file does not exist! Create it using houdini pull-schema`
|
|
67189
|
-
});
|
|
67190
|
-
}
|
|
67191
|
-
const contents = await readFile(schemaPath);
|
|
67192
|
-
if (schemaPath.endsWith("gql") || schemaPath.endsWith("graphql")) {
|
|
67193
|
-
return graphql2.buildSchema(contents);
|
|
67194
|
-
}
|
|
67195
|
-
const jsonContents = JSON.parse(contents);
|
|
67196
|
-
if (jsonContents.data) {
|
|
67197
|
-
return graphql2.buildClientSchema(jsonContents.data);
|
|
67198
|
-
}
|
|
67199
|
-
return graphql2.buildClientSchema(jsonContents);
|
|
67200
|
-
}
|
|
67201
67294
|
var pendingConfigPromise = null;
|
|
67202
67295
|
async function getConfig({
|
|
67203
67296
|
configPath = DEFAULT_CONFIG_PATH,
|
|
@@ -67218,15 +67311,34 @@ async function getConfig({
|
|
|
67218
67311
|
resolve2 = res;
|
|
67219
67312
|
reject = rej;
|
|
67220
67313
|
});
|
|
67221
|
-
let configFile = {
|
|
67222
|
-
...await readConfigFile(configPath)
|
|
67223
|
-
};
|
|
67224
|
-
if (!configFile.plugins) {
|
|
67225
|
-
throw new HoudiniError({
|
|
67226
|
-
message: "Welcome to 0.17.0! Please following the migration guide here: http://www.houdinigraphql.com/guides/release-notes#0170"
|
|
67227
|
-
});
|
|
67228
|
-
}
|
|
67229
67314
|
try {
|
|
67315
|
+
let configFile = await readConfigFile(configPath);
|
|
67316
|
+
const pluginsNested = [];
|
|
67317
|
+
for (const [pluginName, plugin_config] of Object.entries(configFile.plugins ?? {})) {
|
|
67318
|
+
let pluginFile = join2(dirname(configPath), pluginName);
|
|
67319
|
+
if (!pluginName.startsWith(".")) {
|
|
67320
|
+
pluginFile = await pluginPath(pluginName, configPath);
|
|
67321
|
+
}
|
|
67322
|
+
const { default: pluginInit } = await import(pathToFileURL(pluginFile).toString());
|
|
67323
|
+
if (!pluginInit.plugin || !pluginInit.name) {
|
|
67324
|
+
throw new HoudiniError({
|
|
67325
|
+
filepath: pluginFile,
|
|
67326
|
+
message: `The default export does not match the expected shape.`,
|
|
67327
|
+
description: "Please make sure that the file exports the default of the plugin function."
|
|
67328
|
+
});
|
|
67329
|
+
}
|
|
67330
|
+
const hooks = await pluginInit.plugin(plugin_config);
|
|
67331
|
+
const hooksList = (Array.isArray(hooks) ? hooks : [hooks]).filter(Boolean).flat();
|
|
67332
|
+
pluginsNested.push(
|
|
67333
|
+
await flattenPluginList(configPath, hooksList, pluginName, pluginFile)
|
|
67334
|
+
);
|
|
67335
|
+
}
|
|
67336
|
+
const plugins = pluginsNested.flat();
|
|
67337
|
+
for (const plugin2 of plugins) {
|
|
67338
|
+
if (plugin2.config) {
|
|
67339
|
+
configFile = deepMerge(configPath, configFile, await plugin2.config(configFile));
|
|
67340
|
+
}
|
|
67341
|
+
}
|
|
67230
67342
|
_config = new Config({
|
|
67231
67343
|
...configFile,
|
|
67232
67344
|
...extraConfig,
|
|
@@ -67239,7 +67351,7 @@ async function getConfig({
|
|
|
67239
67351
|
if (glob.hasMagic(_config.schemaPath)) {
|
|
67240
67352
|
console.log(
|
|
67241
67353
|
`\u26A0\uFE0F Your houdini configuration contains an apiUrl and a path pointing to multiple files.
|
|
67242
|
-
This will prevent your schema from being pulled.`
|
|
67354
|
+
This will prevent your schema from being pulled.`
|
|
67243
67355
|
);
|
|
67244
67356
|
} else if (!await readFile(_config.schemaPath)) {
|
|
67245
67357
|
console.log("\u231B Pulling schema from api");
|
|
@@ -67250,67 +67362,138 @@ This will prevent your schema from being pulled.`
|
|
|
67250
67362
|
_config.schema = await loadSchemaFile(_config.schemaPath);
|
|
67251
67363
|
}
|
|
67252
67364
|
}
|
|
67365
|
+
_config.plugins = orderedPlugins(plugins);
|
|
67366
|
+
await Promise.all(_config.plugins.map((plugin2) => plugin2.after_load?.({ config: _config })));
|
|
67367
|
+
resolve2(_config);
|
|
67368
|
+
return _config;
|
|
67253
67369
|
} catch (e2) {
|
|
67254
67370
|
reject(e2);
|
|
67255
67371
|
throw e2;
|
|
67256
67372
|
}
|
|
67257
|
-
|
|
67258
|
-
|
|
67259
|
-
|
|
67260
|
-
|
|
67261
|
-
|
|
67262
|
-
|
|
67263
|
-
|
|
67264
|
-
|
|
67265
|
-
|
|
67266
|
-
|
|
67267
|
-
|
|
67268
|
-
|
|
67269
|
-
|
|
67270
|
-
|
|
67271
|
-
|
|
67272
|
-
|
|
67273
|
-
|
|
67274
|
-
|
|
67275
|
-
|
|
67276
|
-
|
|
67373
|
+
}
|
|
67374
|
+
async function flattenPluginList(root, list, name, pluginFile) {
|
|
67375
|
+
const pluginsLeft = [
|
|
67376
|
+
{
|
|
67377
|
+
...plugin(name, async () => list),
|
|
67378
|
+
local: pluginFile
|
|
67379
|
+
}
|
|
67380
|
+
];
|
|
67381
|
+
const result = [];
|
|
67382
|
+
while (pluginsLeft.length > 0) {
|
|
67383
|
+
const head = pluginsLeft.shift();
|
|
67384
|
+
if (!head) {
|
|
67385
|
+
break;
|
|
67386
|
+
}
|
|
67387
|
+
const nestedFile = head.local ?? await pluginPath(head.name, root);
|
|
67388
|
+
const nestedPlugin = await head.plugin(head.config ?? {});
|
|
67389
|
+
const nestedPluginValues = Array.isArray(nestedPlugin) ? nestedPlugin : [nestedPlugin];
|
|
67390
|
+
for (const value of nestedPluginValues) {
|
|
67391
|
+
if (!value) {
|
|
67392
|
+
continue;
|
|
67277
67393
|
}
|
|
67278
|
-
if (
|
|
67279
|
-
|
|
67280
|
-
|
|
67281
|
-
|
|
67282
|
-
|
|
67283
|
-
|
|
67284
|
-
|
|
67394
|
+
if ("__plugin_init__" in value) {
|
|
67395
|
+
pluginsLeft.push(value);
|
|
67396
|
+
} else {
|
|
67397
|
+
result.push({
|
|
67398
|
+
...value,
|
|
67399
|
+
name: head.name,
|
|
67400
|
+
filepath: nestedFile
|
|
67285
67401
|
});
|
|
67286
|
-
|
|
67287
|
-
throw new Error(
|
|
67288
|
-
`Could not find plugin: ${pluginName}. Are you sure its installed? If so, please open a ticket on GitHub.`
|
|
67289
|
-
);
|
|
67402
|
+
}
|
|
67290
67403
|
}
|
|
67291
67404
|
}
|
|
67292
|
-
|
|
67293
|
-
|
|
67294
|
-
|
|
67295
|
-
|
|
67405
|
+
return result;
|
|
67406
|
+
}
|
|
67407
|
+
async function readConfigFile(configPath = DEFAULT_CONFIG_PATH) {
|
|
67408
|
+
let importPath2 = importPath(configPath);
|
|
67409
|
+
let imported;
|
|
67410
|
+
try {
|
|
67411
|
+
imported = await import(importPath2);
|
|
67412
|
+
} catch (e2) {
|
|
67413
|
+
throw new Error(`Could not load config file at file://${configPath}.
|
|
67414
|
+
${e2.message}`);
|
|
67415
|
+
}
|
|
67416
|
+
const config4 = imported.default || imported;
|
|
67417
|
+
return config4;
|
|
67296
67418
|
}
|
|
67297
|
-
var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
67298
|
-
LogLevel2["Full"] = "full";
|
|
67299
|
-
LogLevel2["Summary"] = "summary";
|
|
67300
|
-
LogLevel2["ShortSummary"] = "short-summary";
|
|
67301
|
-
LogLevel2["Quiet"] = "quiet";
|
|
67302
|
-
return LogLevel2;
|
|
67303
|
-
})(LogLevel || {});
|
|
67304
67419
|
var orderedPlugins = (plugins) => {
|
|
67305
67420
|
const ordered = plugins.filter(
|
|
67306
|
-
(
|
|
67421
|
+
(plugin2) => plugin2.order === "before" || plugin2.order === void 0
|
|
67307
67422
|
);
|
|
67308
67423
|
ordered.push(
|
|
67309
|
-
...plugins.filter((
|
|
67310
|
-
...plugins.filter((
|
|
67424
|
+
...plugins.filter((plugin2) => plugin2.order === "core"),
|
|
67425
|
+
...plugins.filter((plugin2) => plugin2.order === "after")
|
|
67311
67426
|
);
|
|
67312
67427
|
return ordered;
|
|
67313
67428
|
};
|
|
67429
|
+
async function pluginPath(plugin_name, config_path) {
|
|
67430
|
+
try {
|
|
67431
|
+
const pluginDirectory = findModule(plugin_name, config_path);
|
|
67432
|
+
const packageJsonSrc = await readFile(join2(pluginDirectory, "package.json"));
|
|
67433
|
+
if (!packageJsonSrc) {
|
|
67434
|
+
throw new Error("skip");
|
|
67435
|
+
}
|
|
67436
|
+
const packageJSON = JSON.parse(packageJsonSrc);
|
|
67437
|
+
if (!packageJSON.exports?.["."]?.import) {
|
|
67438
|
+
throw new Error("");
|
|
67439
|
+
}
|
|
67440
|
+
return join2(pluginDirectory, packageJSON.exports["."].import);
|
|
67441
|
+
} catch {
|
|
67442
|
+
const err = new Error(
|
|
67443
|
+
`Could not find plugin: ${plugin_name}. Are you sure its installed? If so, please open a ticket on GitHub.`
|
|
67444
|
+
);
|
|
67445
|
+
throw err;
|
|
67446
|
+
}
|
|
67447
|
+
}
|
|
67448
|
+
function findModule(pkg = "houdini", currentLocation) {
|
|
67449
|
+
const pathEndingBy = ["node_modules", pkg];
|
|
67450
|
+
let locationFound = join2(currentLocation, ...pathEndingBy);
|
|
67451
|
+
let previousLocation = "";
|
|
67452
|
+
const backFolder = [];
|
|
67453
|
+
while (previousLocation !== locationFound && !existsSync(locationFound)) {
|
|
67454
|
+
previousLocation = locationFound;
|
|
67455
|
+
backFolder.push("../");
|
|
67456
|
+
locationFound = join2(currentLocation, ...backFolder, ...pathEndingBy);
|
|
67457
|
+
}
|
|
67458
|
+
if (previousLocation === locationFound) {
|
|
67459
|
+
throw new Error("Could not find any node_modules/houdini folder");
|
|
67460
|
+
}
|
|
67461
|
+
return locationFound;
|
|
67462
|
+
}
|
|
67463
|
+
async function loadSchemaFile(schemaPath) {
|
|
67464
|
+
if (isAbsolute(schemaPath)) {
|
|
67465
|
+
const relPath = relative(process.cwd(), schemaPath);
|
|
67466
|
+
const error = new Error(
|
|
67467
|
+
`Invalid config value: 'schemaPath' must now be passed as a relative directory. Please change its value to "./${relPath}".`
|
|
67468
|
+
);
|
|
67469
|
+
error.stack = "";
|
|
67470
|
+
throw error;
|
|
67471
|
+
}
|
|
67472
|
+
if (glob.hasMagic(schemaPath)) {
|
|
67473
|
+
const sourceFiles = await glob(schemaPath);
|
|
67474
|
+
return mergeSchemas({
|
|
67475
|
+
typeDefs: await Promise.all(
|
|
67476
|
+
sourceFiles.map(async (filepath) => await readFile(filepath))
|
|
67477
|
+
)
|
|
67478
|
+
});
|
|
67479
|
+
}
|
|
67480
|
+
try {
|
|
67481
|
+
await stat(schemaPath);
|
|
67482
|
+
} catch {
|
|
67483
|
+
throw new HoudiniError({
|
|
67484
|
+
message: `Schema file does not exist! Create it using houdini pull-schema`
|
|
67485
|
+
});
|
|
67486
|
+
}
|
|
67487
|
+
const contents = await readFile(schemaPath);
|
|
67488
|
+
if (schemaPath.endsWith("gql") || schemaPath.endsWith("graphql")) {
|
|
67489
|
+
return graphql2.buildSchema(contents);
|
|
67490
|
+
}
|
|
67491
|
+
const jsonContents = JSON.parse(contents);
|
|
67492
|
+
if (jsonContents.data) {
|
|
67493
|
+
return graphql2.buildClientSchema(jsonContents.data);
|
|
67494
|
+
}
|
|
67495
|
+
return graphql2.buildClientSchema(jsonContents);
|
|
67496
|
+
}
|
|
67314
67497
|
|
|
67315
67498
|
// src/lib/graphql.ts
|
|
67316
67499
|
var graphql3 = __toESM(require_graphql2(), 1);
|
|
@@ -67324,8 +67507,10 @@ function getRootType(type) {
|
|
|
67324
67507
|
}
|
|
67325
67508
|
return type;
|
|
67326
67509
|
}
|
|
67327
|
-
function hashDocument(
|
|
67328
|
-
|
|
67510
|
+
function hashDocument({
|
|
67511
|
+
document
|
|
67512
|
+
}) {
|
|
67513
|
+
const docString = typeof document === "string" ? document : graphql3.print(document.document);
|
|
67329
67514
|
return crypto.createHash("sha256").update(docString).digest("hex");
|
|
67330
67515
|
}
|
|
67331
67516
|
function parentTypeFromAncestors(schema, filepath, ancestors) {
|
|
@@ -67679,8 +67864,8 @@ async function find_graphql(config4, parsedScript, walker) {
|
|
|
67679
67864
|
return;
|
|
67680
67865
|
}
|
|
67681
67866
|
const definition = config4.extractDefinition(parsedTag);
|
|
67682
|
-
const
|
|
67683
|
-
if (!
|
|
67867
|
+
const name = definition.name?.value;
|
|
67868
|
+
if (!name) {
|
|
67684
67869
|
throw new Error("Could not find definition name");
|
|
67685
67870
|
}
|
|
67686
67871
|
let kind;
|
|
@@ -67705,7 +67890,7 @@ async function find_graphql(config4, parsedScript, walker) {
|
|
|
67705
67890
|
replaceWith: this.replace
|
|
67706
67891
|
},
|
|
67707
67892
|
artifact: {
|
|
67708
|
-
name
|
|
67893
|
+
name,
|
|
67709
67894
|
kind
|
|
67710
67895
|
},
|
|
67711
67896
|
parent,
|
|
@@ -67820,13 +68005,13 @@ var FieldCollection = class {
|
|
|
67820
68005
|
this.fragmentSpreads[selection2.name.value] = selection2;
|
|
67821
68006
|
let includeFragments = this.config.defaultFragmentMasking === "disable";
|
|
67822
68007
|
const maskEnableDirective = selection2.directives?.find(
|
|
67823
|
-
({ name
|
|
68008
|
+
({ name }) => name.value === this.config.maskEnableDirective
|
|
67824
68009
|
);
|
|
67825
68010
|
if (maskEnableDirective) {
|
|
67826
68011
|
includeFragments = false;
|
|
67827
68012
|
}
|
|
67828
68013
|
const maskDisableDirective = selection2.directives?.find(
|
|
67829
|
-
({ name
|
|
68014
|
+
({ name }) => name.value === this.config.maskDisableDirective
|
|
67830
68015
|
);
|
|
67831
68016
|
if (maskDisableDirective) {
|
|
67832
68017
|
includeFragments = true;
|
|
@@ -67981,7 +68166,7 @@ var graphql5 = __toESM(require_graphql2(), 1);
|
|
|
67981
68166
|
var import_graphql30 = __toESM(require_graphql2(), 1);
|
|
67982
68167
|
async function includeFragmentDefinitions(config4, documents) {
|
|
67983
68168
|
const fragments = collectFragments(config4, documents);
|
|
67984
|
-
for (const [index, { name
|
|
68169
|
+
for (const [index, { name, document, filename }] of documents.entries()) {
|
|
67985
68170
|
const operation = document.definitions.find(
|
|
67986
68171
|
({ kind }) => kind === import_graphql30.Kind.OPERATION_DEFINITION
|
|
67987
68172
|
);
|
|
@@ -68095,7 +68280,8 @@ async function fragmentVariables(config4, documents) {
|
|
|
68095
68280
|
generateStore: false,
|
|
68096
68281
|
generateArtifact: false,
|
|
68097
68282
|
filename: "generated::fragmentVariables",
|
|
68098
|
-
originalString: ""
|
|
68283
|
+
originalString: "",
|
|
68284
|
+
artifact: null
|
|
68099
68285
|
});
|
|
68100
68286
|
}
|
|
68101
68287
|
function inlineFragmentArgs({
|
|
@@ -68243,7 +68429,7 @@ function fragmentArguments(config4, filepath, definition) {
|
|
|
68243
68429
|
return [];
|
|
68244
68430
|
}
|
|
68245
68431
|
let type = typeArg.value;
|
|
68246
|
-
let
|
|
68432
|
+
let name = arg.name.value;
|
|
68247
68433
|
let required = false;
|
|
68248
68434
|
let defaultValue = arg.value.fields?.find((arg2) => arg2.name.value === "default")?.value || null;
|
|
68249
68435
|
if (type[type.length - 1] === "!") {
|
|
@@ -68253,7 +68439,7 @@ function fragmentArguments(config4, filepath, definition) {
|
|
|
68253
68439
|
}
|
|
68254
68440
|
return [
|
|
68255
68441
|
{
|
|
68256
|
-
name
|
|
68442
|
+
name,
|
|
68257
68443
|
type,
|
|
68258
68444
|
required,
|
|
68259
68445
|
defaultValue
|
|
@@ -68264,7 +68450,7 @@ function fragmentArguments(config4, filepath, definition) {
|
|
|
68264
68450
|
}
|
|
68265
68451
|
function collectDefaultArgumentValues(config4, filepath, definition) {
|
|
68266
68452
|
let result = {};
|
|
68267
|
-
for (const { name
|
|
68453
|
+
for (const { name, required, defaultValue } of fragmentArguments(
|
|
68268
68454
|
config4,
|
|
68269
68455
|
filepath,
|
|
68270
68456
|
definition
|
|
@@ -68272,7 +68458,7 @@ function collectDefaultArgumentValues(config4, filepath, definition) {
|
|
|
68272
68458
|
if (required || !defaultValue) {
|
|
68273
68459
|
continue;
|
|
68274
68460
|
}
|
|
68275
|
-
result[
|
|
68461
|
+
result[name] = defaultValue;
|
|
68276
68462
|
}
|
|
68277
68463
|
return result;
|
|
68278
68464
|
}
|
|
@@ -68439,30 +68625,6 @@ function serializeValue(value) {
|
|
|
68439
68625
|
}
|
|
68440
68626
|
return AST4.literal(value);
|
|
68441
68627
|
}
|
|
68442
|
-
function deepMerge(filepath, ...targets) {
|
|
68443
|
-
if (typeof targets[0] !== "object") {
|
|
68444
|
-
const matches = targets.filter((val) => val !== targets[0]).length === 0;
|
|
68445
|
-
if (!matches) {
|
|
68446
|
-
throw new HoudiniError({ filepath, message: "could not merge: " + targets });
|
|
68447
|
-
}
|
|
68448
|
-
return targets[0];
|
|
68449
|
-
}
|
|
68450
|
-
if (Array.isArray(targets[0])) {
|
|
68451
|
-
return targets[0].concat(...targets.slice(1));
|
|
68452
|
-
}
|
|
68453
|
-
const fields = {};
|
|
68454
|
-
for (const target of targets) {
|
|
68455
|
-
for (const [key, value] of Object.entries(target)) {
|
|
68456
|
-
if (!fields[key]) {
|
|
68457
|
-
fields[key] = [];
|
|
68458
|
-
}
|
|
68459
|
-
fields[key].push(value);
|
|
68460
|
-
}
|
|
68461
|
-
}
|
|
68462
|
-
return Object.fromEntries(
|
|
68463
|
-
Object.entries(fields).map(([key, value]) => [key, deepMerge(filepath, ...value)])
|
|
68464
|
-
);
|
|
68465
|
-
}
|
|
68466
68628
|
function convertValue(config4, val) {
|
|
68467
68629
|
let value;
|
|
68468
68630
|
let kind;
|
|
@@ -68547,14 +68709,14 @@ function operationObject({
|
|
|
68547
68709
|
let allLists = config4.defaultListTarget ?? void 0;
|
|
68548
68710
|
let operationWhen;
|
|
68549
68711
|
const internalDirectives = selection2.directives?.filter(
|
|
68550
|
-
(directive) => config4.isInternalDirective(directive)
|
|
68712
|
+
(directive) => config4.isInternalDirective(directive.name.value)
|
|
68551
68713
|
);
|
|
68552
68714
|
if (internalDirectives && internalDirectives.length > 0) {
|
|
68553
68715
|
const prepend = internalDirectives.find(
|
|
68554
|
-
({ name
|
|
68716
|
+
({ name }) => name.value === config4.listPrependDirective
|
|
68555
68717
|
);
|
|
68556
68718
|
const append = internalDirectives.find(
|
|
68557
|
-
({ name
|
|
68719
|
+
({ name }) => name.value === config4.listAppendDirective
|
|
68558
68720
|
);
|
|
68559
68721
|
if (append) {
|
|
68560
68722
|
position = "last";
|
|
@@ -68563,14 +68725,14 @@ function operationObject({
|
|
|
68563
68725
|
position = "first";
|
|
68564
68726
|
}
|
|
68565
68727
|
const allListsDirective = internalDirectives.find(
|
|
68566
|
-
({ name
|
|
68728
|
+
({ name }) => name.value === config4.listAllListsDirective
|
|
68567
68729
|
);
|
|
68568
68730
|
let parent = internalDirectives.find(
|
|
68569
|
-
({ name
|
|
68731
|
+
({ name }) => name.value === config4.listParentDirective
|
|
68570
68732
|
);
|
|
68571
68733
|
allLists = allListsDirective ? "all" : void 0;
|
|
68572
|
-
const when = internalDirectives.find(({ name
|
|
68573
|
-
const when_not = internalDirectives.find(({ name
|
|
68734
|
+
const when = internalDirectives.find(({ name }) => name.value === "when");
|
|
68735
|
+
const when_not = internalDirectives.find(({ name }) => name.value === "when_not");
|
|
68574
68736
|
let parentIDArg = parent?.arguments?.find((argument) => argument.name.value === "value");
|
|
68575
68737
|
if (parentIDArg) {
|
|
68576
68738
|
if (parentIDArg.value.kind === "StringValue") {
|
|
@@ -68581,9 +68743,9 @@ function operationObject({
|
|
|
68581
68743
|
parentID = parentIDArg.value.name.value;
|
|
68582
68744
|
}
|
|
68583
68745
|
}
|
|
68584
|
-
const whenArg = (append || prepend)?.arguments?.find(({ name
|
|
68746
|
+
const whenArg = (append || prepend)?.arguments?.find(({ name }) => name.value === "when");
|
|
68585
68747
|
const whenNotArg = (append || prepend)?.arguments?.find(
|
|
68586
|
-
({ name
|
|
68748
|
+
({ name }) => name.value === "when_not"
|
|
68587
68749
|
);
|
|
68588
68750
|
for (const [i2, arg] of [whenArg, whenNotArg].entries()) {
|
|
68589
68751
|
if (!arg || arg.value.kind !== "ObjectValue") {
|
|
@@ -68822,7 +68984,7 @@ async function paginate(config4, documents) {
|
|
|
68822
68984
|
Object.keys(operationVariables).concat(Object.keys(newVariables))
|
|
68823
68985
|
);
|
|
68824
68986
|
const finalVariables = [...variableNames].map(
|
|
68825
|
-
(
|
|
68987
|
+
(name) => operationVariables[name] || newVariables[name]
|
|
68826
68988
|
);
|
|
68827
68989
|
return {
|
|
68828
68990
|
...node,
|
|
@@ -68919,7 +69081,7 @@ async function paginate(config4, documents) {
|
|
|
68919
69081
|
value: config4.withDirective
|
|
68920
69082
|
},
|
|
68921
69083
|
["arguments"]: paginationArgs.map(
|
|
68922
|
-
({ name
|
|
69084
|
+
({ name }) => variableAsArgument(name)
|
|
68923
69085
|
)
|
|
68924
69086
|
}
|
|
68925
69087
|
]
|
|
@@ -69047,7 +69209,8 @@ async function paginate(config4, documents) {
|
|
|
69047
69209
|
generateArtifact: true,
|
|
69048
69210
|
generateStore: false,
|
|
69049
69211
|
refetch: doc.refetch,
|
|
69050
|
-
originalString: ""
|
|
69212
|
+
originalString: "",
|
|
69213
|
+
artifact: null
|
|
69051
69214
|
});
|
|
69052
69215
|
}
|
|
69053
69216
|
}
|
|
@@ -69070,32 +69233,32 @@ function replaceArgumentsWithVariables(args, flags) {
|
|
|
69070
69233
|
seenArgs[arg.name.value] = true;
|
|
69071
69234
|
return variableAsArgument(arg.name.value, flags[arg.name.value].variableName);
|
|
69072
69235
|
});
|
|
69073
|
-
for (const
|
|
69074
|
-
const spec = flags[
|
|
69075
|
-
if (flags[
|
|
69236
|
+
for (const name of Object.keys(flags)) {
|
|
69237
|
+
const spec = flags[name];
|
|
69238
|
+
if (flags[name].defaultValue || !spec.enabled || seenArgs[name]) {
|
|
69076
69239
|
continue;
|
|
69077
69240
|
}
|
|
69078
|
-
newArgs.push(variableAsArgument(
|
|
69241
|
+
newArgs.push(variableAsArgument(name));
|
|
69079
69242
|
}
|
|
69080
69243
|
return newArgs;
|
|
69081
69244
|
}
|
|
69082
|
-
function variableAsArgument(
|
|
69245
|
+
function variableAsArgument(name, variable) {
|
|
69083
69246
|
return {
|
|
69084
69247
|
kind: graphql10.Kind.ARGUMENT,
|
|
69085
69248
|
name: {
|
|
69086
69249
|
kind: graphql10.Kind.NAME,
|
|
69087
|
-
value:
|
|
69250
|
+
value: name
|
|
69088
69251
|
},
|
|
69089
69252
|
value: {
|
|
69090
69253
|
kind: graphql10.Kind.VARIABLE,
|
|
69091
69254
|
name: {
|
|
69092
69255
|
kind: graphql10.Kind.NAME,
|
|
69093
|
-
value: variable ??
|
|
69256
|
+
value: variable ?? name
|
|
69094
69257
|
}
|
|
69095
69258
|
}
|
|
69096
69259
|
};
|
|
69097
69260
|
}
|
|
69098
|
-
function staticVariableDefinition(
|
|
69261
|
+
function staticVariableDefinition(name, type, defaultValue, variableName) {
|
|
69099
69262
|
return {
|
|
69100
69263
|
kind: graphql10.Kind.VARIABLE_DEFINITION,
|
|
69101
69264
|
type: {
|
|
@@ -69109,7 +69272,7 @@ function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
|
69109
69272
|
kind: graphql10.Kind.VARIABLE,
|
|
69110
69273
|
name: {
|
|
69111
69274
|
kind: graphql10.Kind.NAME,
|
|
69112
|
-
value: variableName ??
|
|
69275
|
+
value: variableName ?? name
|
|
69113
69276
|
}
|
|
69114
69277
|
},
|
|
69115
69278
|
defaultValue: !defaultValue ? void 0 : {
|
|
@@ -69118,12 +69281,12 @@ function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
|
69118
69281
|
}
|
|
69119
69282
|
};
|
|
69120
69283
|
}
|
|
69121
|
-
function argumentNode(
|
|
69284
|
+
function argumentNode(name, value) {
|
|
69122
69285
|
return {
|
|
69123
69286
|
kind: graphql10.Kind.ARGUMENT,
|
|
69124
69287
|
name: {
|
|
69125
69288
|
kind: graphql10.Kind.NAME,
|
|
69126
|
-
value:
|
|
69289
|
+
value: name
|
|
69127
69290
|
},
|
|
69128
69291
|
value: objectNode(value)
|
|
69129
69292
|
};
|
|
@@ -69369,7 +69532,7 @@ async function addListFragments(config4, documents) {
|
|
|
69369
69532
|
const generatedDoc = {
|
|
69370
69533
|
kind: graphql11.Kind.DOCUMENT,
|
|
69371
69534
|
definitions: Object.entries(lists).flatMap(
|
|
69372
|
-
([
|
|
69535
|
+
([name, { selection: selection2, type }]) => {
|
|
69373
69536
|
const schemaType = config4.schema.getType(type.name);
|
|
69374
69537
|
if (!selection2) {
|
|
69375
69538
|
throw new HoudiniError({ message: "Lists must have a selection" });
|
|
@@ -69389,7 +69552,7 @@ async function addListFragments(config4, documents) {
|
|
|
69389
69552
|
return [
|
|
69390
69553
|
{
|
|
69391
69554
|
name: {
|
|
69392
|
-
value: config4.listInsertFragment(
|
|
69555
|
+
value: config4.listInsertFragment(name),
|
|
69393
69556
|
kind: graphql11.Kind.NAME
|
|
69394
69557
|
},
|
|
69395
69558
|
kind: graphql11.Kind.FRAGMENT_DEFINITION,
|
|
@@ -69404,7 +69567,7 @@ async function addListFragments(config4, documents) {
|
|
|
69404
69567
|
},
|
|
69405
69568
|
{
|
|
69406
69569
|
name: {
|
|
69407
|
-
value: config4.listToggleFragment(
|
|
69570
|
+
value: config4.listToggleFragment(name),
|
|
69408
69571
|
kind: graphql11.Kind.NAME
|
|
69409
69572
|
},
|
|
69410
69573
|
kind: graphql11.Kind.FRAGMENT_DEFINITION,
|
|
@@ -69420,7 +69583,7 @@ async function addListFragments(config4, documents) {
|
|
|
69420
69583
|
{
|
|
69421
69584
|
kind: graphql11.Kind.FRAGMENT_DEFINITION,
|
|
69422
69585
|
name: {
|
|
69423
|
-
value: config4.listRemoveFragment(
|
|
69586
|
+
value: config4.listRemoveFragment(name),
|
|
69424
69587
|
kind: graphql11.Kind.NAME
|
|
69425
69588
|
},
|
|
69426
69589
|
selectionSet: {
|
|
@@ -69464,7 +69627,8 @@ async function addListFragments(config4, documents) {
|
|
|
69464
69627
|
document: generatedDoc,
|
|
69465
69628
|
originalDocument: generatedDoc,
|
|
69466
69629
|
filename: "generated::lists",
|
|
69467
|
-
originalString: ""
|
|
69630
|
+
originalString: "",
|
|
69631
|
+
artifact: null
|
|
69468
69632
|
});
|
|
69469
69633
|
}
|
|
69470
69634
|
function connectionSelection(config4, field, type, selection2) {
|
|
@@ -69868,19 +70032,20 @@ function artifactGenerator(stats) {
|
|
|
69868
70032
|
});
|
|
69869
70033
|
}
|
|
69870
70034
|
const listOfArtifacts = [];
|
|
70035
|
+
const hash = config4.plugins?.find((plugin2) => plugin2.hash)?.hash ?? hashDocument;
|
|
69871
70036
|
await Promise.all(
|
|
69872
70037
|
[
|
|
69873
70038
|
writeIndexFile(config4, docs)
|
|
69874
70039
|
].concat(
|
|
69875
70040
|
docs.map(async (doc) => {
|
|
69876
|
-
const { document, name
|
|
70041
|
+
const { document, name, generateArtifact } = doc;
|
|
69877
70042
|
if (!generateArtifact) {
|
|
69878
70043
|
return;
|
|
69879
70044
|
}
|
|
69880
70045
|
const usedVariableNames = /* @__PURE__ */ new Set();
|
|
69881
70046
|
let documentWithoutInternalDirectives = graphql14.visit(document, {
|
|
69882
70047
|
Directive(node) {
|
|
69883
|
-
if (config4.isInternalDirective(node)) {
|
|
70048
|
+
if (config4.isInternalDirective(node.name.value)) {
|
|
69884
70049
|
return null;
|
|
69885
70050
|
}
|
|
69886
70051
|
},
|
|
@@ -69895,8 +70060,8 @@ function artifactGenerator(stats) {
|
|
|
69895
70060
|
documentWithoutInternalDirectives,
|
|
69896
70061
|
{
|
|
69897
70062
|
VariableDefinition(variableDefinitionNode) {
|
|
69898
|
-
const
|
|
69899
|
-
if (!usedVariableNames.has(
|
|
70063
|
+
const name2 = variableDefinitionNode.variable.name.value;
|
|
70064
|
+
if (!usedVariableNames.has(name2)) {
|
|
69900
70065
|
return null;
|
|
69901
70066
|
}
|
|
69902
70067
|
}
|
|
@@ -69930,12 +70095,12 @@ function artifactGenerator(stats) {
|
|
|
69930
70095
|
selectionSet = operation.selectionSet;
|
|
69931
70096
|
} else {
|
|
69932
70097
|
const matchingFragment = fragments.find(
|
|
69933
|
-
(fragment) => fragment.name.value ===
|
|
70098
|
+
(fragment) => fragment.name.value === name
|
|
69934
70099
|
);
|
|
69935
70100
|
if (!matchingFragment) {
|
|
69936
70101
|
throw new HoudiniError({
|
|
69937
70102
|
filepath: doc.filename,
|
|
69938
|
-
message: `Fragment "${
|
|
70103
|
+
message: `Fragment "${name}" doesn't exist in its own document?!`
|
|
69939
70104
|
});
|
|
69940
70105
|
}
|
|
69941
70106
|
rootType = matchingFragment.typeCondition.name.value;
|
|
@@ -69964,10 +70129,10 @@ function artifactGenerator(stats) {
|
|
|
69964
70129
|
ignoreMaskDisable: docKind === "HoudiniQuery",
|
|
69965
70130
|
applyFragments: docKind !== "HoudiniFragment"
|
|
69966
70131
|
});
|
|
69967
|
-
|
|
69968
|
-
name
|
|
70132
|
+
let artifact = {
|
|
70133
|
+
name,
|
|
69969
70134
|
kind: docKind,
|
|
69970
|
-
hash:
|
|
70135
|
+
hash: hash({ config: config4, document: doc }),
|
|
69971
70136
|
refetch: doc.refetch,
|
|
69972
70137
|
raw: rawString,
|
|
69973
70138
|
rootType,
|
|
@@ -69986,27 +70151,27 @@ function artifactGenerator(stats) {
|
|
|
69986
70151
|
document: doc
|
|
69987
70152
|
})
|
|
69988
70153
|
};
|
|
69989
|
-
const
|
|
69990
|
-
(prev,
|
|
69991
|
-
if (!
|
|
70154
|
+
const plugin_data = config4.plugins.reduce(
|
|
70155
|
+
(prev, plugin2) => {
|
|
70156
|
+
if (!plugin2.artifact_data) {
|
|
69992
70157
|
return prev;
|
|
69993
70158
|
}
|
|
69994
70159
|
const result = { ...prev };
|
|
69995
|
-
const dataToAdd =
|
|
70160
|
+
const dataToAdd = plugin2.artifact_data({ config: config4, document: doc }) ?? {};
|
|
69996
70161
|
if (Object.keys(dataToAdd).length > 0) {
|
|
69997
|
-
result[
|
|
70162
|
+
result[plugin2.name] = dataToAdd;
|
|
69998
70163
|
}
|
|
69999
70164
|
return result;
|
|
70000
70165
|
},
|
|
70001
70166
|
{}
|
|
70002
70167
|
);
|
|
70003
|
-
if (Object.keys(
|
|
70004
|
-
artifact.
|
|
70168
|
+
if (Object.keys(plugin_data).length > 0) {
|
|
70169
|
+
artifact.plugin_data = plugin_data;
|
|
70005
70170
|
}
|
|
70006
70171
|
if (inputs && inputs.length > 0) {
|
|
70007
70172
|
artifact.input = inputObject(config4, inputs);
|
|
70008
70173
|
}
|
|
70009
|
-
if (
|
|
70174
|
+
if (artifact.kind === "HoudiniQuery") {
|
|
70010
70175
|
const cacheDirective = operations[0].directives?.find(
|
|
70011
70176
|
(directive2) => directive2.name.value === config4.cacheDirective
|
|
70012
70177
|
);
|
|
@@ -70019,7 +70184,7 @@ function artifactGenerator(stats) {
|
|
|
70019
70184
|
{}
|
|
70020
70185
|
) || {};
|
|
70021
70186
|
const policy = args[config4.cachePolicyArg];
|
|
70022
|
-
if (policy && policy.value.kind === "EnumValue") {
|
|
70187
|
+
if (policy && policy.value.kind === "EnumValue" && policy.value.value) {
|
|
70023
70188
|
artifact.policy = policy.value.value;
|
|
70024
70189
|
} else {
|
|
70025
70190
|
artifact.policy = config4.defaultCachePolicy;
|
|
@@ -70035,10 +70200,17 @@ function artifactGenerator(stats) {
|
|
|
70035
70200
|
artifact.partial = config4.defaultPartial;
|
|
70036
70201
|
}
|
|
70037
70202
|
}
|
|
70203
|
+
doc.artifact = artifact;
|
|
70204
|
+
for (const plugin2 of config4.plugins) {
|
|
70205
|
+
if (!plugin2.artifact_end) {
|
|
70206
|
+
continue;
|
|
70207
|
+
}
|
|
70208
|
+
plugin2.artifact_end({ config: config4, document: doc });
|
|
70209
|
+
}
|
|
70038
70210
|
const file = AST5.program([
|
|
70039
70211
|
moduleExport(config4, "default", serializeValue(artifact)),
|
|
70040
70212
|
AST5.expressionStatement(
|
|
70041
|
-
AST5.stringLiteral(`HoudiniHash=${
|
|
70213
|
+
AST5.stringLiteral(`HoudiniHash=${hash({ config: config4, document: doc })}`)
|
|
70042
70214
|
)
|
|
70043
70215
|
]);
|
|
70044
70216
|
const artifactPath = config4.artifactPath(document);
|
|
@@ -70055,7 +70227,7 @@ function artifactGenerator(stats) {
|
|
|
70055
70227
|
return;
|
|
70056
70228
|
}
|
|
70057
70229
|
const match = existingArtifact && existingArtifact.match(/"HoudiniHash=(\w+)"/);
|
|
70058
|
-
if (match && match[1] !==
|
|
70230
|
+
if (match && match[1] !== hash({ config: config4, document: doc })) {
|
|
70059
70231
|
stats.changed.push(artifact.name);
|
|
70060
70232
|
}
|
|
70061
70233
|
stats.total.push(artifact.name);
|
|
@@ -70074,7 +70246,7 @@ async function generateGraphqlReturnTypes(config4, docs) {
|
|
|
70074
70246
|
const fileContent = await fs_exports.readFile(indexPath) || "";
|
|
70075
70247
|
const contents = await parseJS(fileContent);
|
|
70076
70248
|
const graphql_tag_return = config4.plugins.find(
|
|
70077
|
-
(
|
|
70249
|
+
(plugin2) => plugin2.graphql_tag_return
|
|
70078
70250
|
)?.graphql_tag_return;
|
|
70079
70251
|
if (!graphql_tag_return || !contents) {
|
|
70080
70252
|
return fileContent;
|
|
@@ -70083,7 +70255,7 @@ async function generateGraphqlReturnTypes(config4, docs) {
|
|
|
70083
70255
|
for (const doc of docs) {
|
|
70084
70256
|
const return_value = graphql_tag_return({
|
|
70085
70257
|
config: config4,
|
|
70086
|
-
doc,
|
|
70258
|
+
document: doc,
|
|
70087
70259
|
ensure_import({ identifier, module }) {
|
|
70088
70260
|
ensureImports({
|
|
70089
70261
|
config: config4,
|
|
@@ -70132,19 +70304,19 @@ async function injectPlugins({
|
|
|
70132
70304
|
importStatement,
|
|
70133
70305
|
exportStatement
|
|
70134
70306
|
}) {
|
|
70135
|
-
const client_plugins = config4.plugins.filter((
|
|
70136
|
-
let plugins =
|
|
70307
|
+
const client_plugins = config4.plugins.filter((plugin2) => plugin2.client_plugins).reduce((acc, plugin2) => {
|
|
70308
|
+
let plugins = plugin2.client_plugins;
|
|
70137
70309
|
if (typeof plugins === "function") {
|
|
70138
|
-
plugins = plugins(config4, config4.pluginConfig(
|
|
70310
|
+
plugins = plugins(config4, config4.pluginConfig(plugin2.name));
|
|
70139
70311
|
}
|
|
70140
70312
|
return [...acc, ...Object.entries(plugins)];
|
|
70141
70313
|
}, []);
|
|
70142
70314
|
return client_plugins.length > 0 ? `
|
|
70143
|
-
${client_plugins.map((
|
|
70315
|
+
${client_plugins.map((plugin2, i2) => importStatement(plugin2[0], `plugin${i2}`))}
|
|
70144
70316
|
|
|
70145
70317
|
const plugins = [
|
|
70146
|
-
${client_plugins.map((
|
|
70147
|
-
const suffix =
|
|
70318
|
+
${client_plugins.map((plugin2, i2) => {
|
|
70319
|
+
const suffix = `(${JSON.stringify(plugin2[1])})`;
|
|
70148
70320
|
return `plugin${i2}${suffix}`;
|
|
70149
70321
|
}).join(",\n")}
|
|
70150
70322
|
]
|
|
@@ -70187,37 +70359,35 @@ ${exportStatement("config")}
|
|
|
70187
70359
|
},
|
|
70188
70360
|
[path_exports.join(config4.runtimeSource, "client", "plugins", "injectedPlugins.js")]: (content) => injectPlugins({ config: config4, content, importStatement, exportStatement })
|
|
70189
70361
|
}),
|
|
70190
|
-
...config4.plugins.filter((
|
|
70362
|
+
...config4.plugins.filter((plugin2) => plugin2.include_runtime).map((plugin2) => generatePluginRuntime(config4, plugin2)),
|
|
70191
70363
|
generatePluginIndex({ config: config4, exportStatement: exportStar })
|
|
70192
70364
|
]);
|
|
70193
70365
|
await generateGraphqlReturnTypes(config4, docs);
|
|
70194
70366
|
}
|
|
70195
|
-
async function generatePluginRuntime(config4,
|
|
70196
|
-
if (houdini_mode.is_testing) {
|
|
70367
|
+
async function generatePluginRuntime(config4, plugin2) {
|
|
70368
|
+
if (houdini_mode.is_testing || !plugin2.include_runtime) {
|
|
70197
70369
|
return;
|
|
70198
70370
|
}
|
|
70199
|
-
const
|
|
70200
|
-
|
|
70201
|
-
"
|
|
70202
|
-
"runtime-" + (config4.module === "esm" ? "esm" : "cjs")
|
|
70371
|
+
const runtime_path = path_exports.join(
|
|
70372
|
+
path_exports.dirname(plugin2.filepath),
|
|
70373
|
+
typeof plugin2.include_runtime === "string" ? plugin2.include_runtime : plugin2.include_runtime[config4.module]
|
|
70203
70374
|
);
|
|
70204
70375
|
try {
|
|
70205
|
-
await fs_exports.stat(
|
|
70376
|
+
await fs_exports.stat(runtime_path);
|
|
70206
70377
|
} catch {
|
|
70207
70378
|
throw new HoudiniError({
|
|
70208
|
-
message:
|
|
70209
|
-
description: "
|
|
70379
|
+
message: "Cannot find runtime to generate for " + plugin2.name,
|
|
70380
|
+
description: "Maybe it was bundled?"
|
|
70210
70381
|
});
|
|
70211
70382
|
}
|
|
70212
|
-
const
|
|
70213
|
-
const pluginDir = config4.pluginRuntimeDirectory(plugin.name);
|
|
70383
|
+
const pluginDir = config4.pluginRuntimeDirectory(plugin2.name);
|
|
70214
70384
|
await fs_exports.mkdirp(pluginDir);
|
|
70215
70385
|
await fs_exports.recursiveCopy(
|
|
70216
|
-
|
|
70386
|
+
runtime_path,
|
|
70217
70387
|
pluginDir,
|
|
70218
70388
|
Object.fromEntries(
|
|
70219
|
-
Object.entries(
|
|
70220
|
-
path_exports.join(
|
|
70389
|
+
Object.entries(plugin2.transform_runtime ?? {}).map(([key, value]) => [
|
|
70390
|
+
path_exports.join(runtime_path, key),
|
|
70221
70391
|
(content) => value({ config: config4, content })
|
|
70222
70392
|
])
|
|
70223
70393
|
)
|
|
@@ -70618,7 +70788,7 @@ async function generateDocumentTypes(config4, docs) {
|
|
|
70618
70788
|
}
|
|
70619
70789
|
const missingScalars = /* @__PURE__ */ new Set();
|
|
70620
70790
|
await Promise.all(
|
|
70621
|
-
docs.map(async ({ originalDocument, name
|
|
70791
|
+
docs.map(async ({ originalDocument, name, filename, generateArtifact }) => {
|
|
70622
70792
|
if (!generateArtifact) {
|
|
70623
70793
|
return;
|
|
70624
70794
|
}
|
|
@@ -70626,7 +70796,7 @@ async function generateDocumentTypes(config4, docs) {
|
|
|
70626
70796
|
const program = AST11.program([]);
|
|
70627
70797
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
70628
70798
|
let definition = originalDocument.definitions.find(
|
|
70629
|
-
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value ===
|
|
70799
|
+
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value === name
|
|
70630
70800
|
);
|
|
70631
70801
|
const selections = flattenSelections({
|
|
70632
70802
|
config: config4,
|
|
@@ -70680,22 +70850,22 @@ export { default as ${as} } from "${module}"
|
|
|
70680
70850
|
export * from "${module}"
|
|
70681
70851
|
`;
|
|
70682
70852
|
let indexContent = recast11.print(typeIndex).code;
|
|
70683
|
-
for (const
|
|
70684
|
-
if (!
|
|
70853
|
+
for (const plugin2 of config4.plugins) {
|
|
70854
|
+
if (!plugin2.index_file) {
|
|
70685
70855
|
continue;
|
|
70686
70856
|
}
|
|
70687
|
-
indexContent =
|
|
70857
|
+
indexContent = plugin2.index_file({
|
|
70688
70858
|
config: config4,
|
|
70689
70859
|
content: indexContent,
|
|
70690
70860
|
export_default_as,
|
|
70691
70861
|
export_star_from,
|
|
70692
|
-
plugin_root: config4.pluginDirectory(
|
|
70862
|
+
plugin_root: config4.pluginDirectory(plugin2.name),
|
|
70693
70863
|
typedef: true,
|
|
70694
70864
|
documents: docs
|
|
70695
70865
|
});
|
|
70696
|
-
if (
|
|
70866
|
+
if (plugin2.include_runtime) {
|
|
70697
70867
|
indexContent += export_star_from({
|
|
70698
|
-
module: "./" + path_exports.relative(config4.rootDir, config4.pluginRuntimeDirectory(
|
|
70868
|
+
module: "./" + path_exports.relative(config4.rootDir, config4.pluginRuntimeDirectory(plugin2.name))
|
|
70699
70869
|
});
|
|
70700
70870
|
}
|
|
70701
70871
|
}
|
|
@@ -70941,9 +71111,9 @@ var graphql19 = __toESM(require_graphql2(), 1);
|
|
|
70941
71111
|
var recast12 = __toESM(require_main2(), 1);
|
|
70942
71112
|
var AST12 = recast12.types.builders;
|
|
70943
71113
|
async function imperativeCacheTypef(config4, docs) {
|
|
70944
|
-
const returnType = (doc) => config4.plugins.find((
|
|
71114
|
+
const returnType = (doc) => config4.plugins.find((plugin2) => plugin2.graphql_tag_return)?.graphql_tag_return?.({
|
|
70945
71115
|
config: config4,
|
|
70946
|
-
doc,
|
|
71116
|
+
document: doc,
|
|
70947
71117
|
ensure_import({ identifier, module }) {
|
|
70948
71118
|
ensureImports({
|
|
70949
71119
|
config: config4,
|
|
@@ -71288,12 +71458,12 @@ function fragmentListMap(config4, concreteTypes, body, docs, return_type) {
|
|
|
71288
71458
|
}, {});
|
|
71289
71459
|
}
|
|
71290
71460
|
var CacheTypeDefName = "CacheTypeDef";
|
|
71291
|
-
function record(
|
|
71461
|
+
function record(name) {
|
|
71292
71462
|
return AST12.tsTypeReference(
|
|
71293
71463
|
AST12.identifier("Record"),
|
|
71294
71464
|
AST12.tsTypeParameterInstantiation([
|
|
71295
71465
|
AST12.tsTypeReference(AST12.identifier(CacheTypeDefName)),
|
|
71296
|
-
AST12.tsLiteralType(AST12.stringLiteral(
|
|
71466
|
+
AST12.tsLiteralType(AST12.stringLiteral(name))
|
|
71297
71467
|
])
|
|
71298
71468
|
);
|
|
71299
71469
|
}
|
|
@@ -71322,7 +71492,7 @@ async function persistOutputGenerator(config4, docs) {
|
|
|
71322
71492
|
let rawString = graphql20.print(
|
|
71323
71493
|
graphql20.visit(document, {
|
|
71324
71494
|
Directive(node) {
|
|
71325
|
-
if (config4.isInternalDirective(node)) {
|
|
71495
|
+
if (config4.isInternalDirective(node.name.value)) {
|
|
71326
71496
|
return null;
|
|
71327
71497
|
}
|
|
71328
71498
|
}
|
|
@@ -71332,7 +71502,7 @@ async function persistOutputGenerator(config4, docs) {
|
|
|
71332
71502
|
({ kind }) => kind === graphql20.Kind.OPERATION_DEFINITION
|
|
71333
71503
|
);
|
|
71334
71504
|
if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
|
|
71335
|
-
acc[hashDocument(rawString)] = rawString;
|
|
71505
|
+
acc[hashDocument({ config: config4, document: rawString })] = rawString;
|
|
71336
71506
|
}
|
|
71337
71507
|
return acc;
|
|
71338
71508
|
}, {});
|
|
@@ -71352,10 +71522,10 @@ async function definitionsGenerator(config4) {
|
|
|
71352
71522
|
const runtimeDefinitions = recast13.print(
|
|
71353
71523
|
AST13.program(
|
|
71354
71524
|
enums.map((defn) => {
|
|
71355
|
-
const
|
|
71525
|
+
const name = defn.name.value;
|
|
71356
71526
|
return moduleExport(
|
|
71357
71527
|
config4,
|
|
71358
|
-
|
|
71528
|
+
name,
|
|
71359
71529
|
AST13.objectExpression(
|
|
71360
71530
|
defn.values?.map((value) => {
|
|
71361
71531
|
const str = value.name.value;
|
|
@@ -71412,24 +71582,24 @@ async function writeIndexFile2(config4, docs) {
|
|
|
71412
71582
|
export_star_from({ module: artifactDir }),
|
|
71413
71583
|
export_star_from({ module: definitionsDir })
|
|
71414
71584
|
].join("");
|
|
71415
|
-
for (const
|
|
71416
|
-
if (
|
|
71417
|
-
body =
|
|
71585
|
+
for (const plugin2 of config4.plugins) {
|
|
71586
|
+
if (plugin2.index_file) {
|
|
71587
|
+
body = plugin2.index_file({
|
|
71418
71588
|
config: config4,
|
|
71419
71589
|
content: body,
|
|
71420
71590
|
export_default_as,
|
|
71421
71591
|
export_star_from,
|
|
71422
|
-
plugin_root: config4.pluginDirectory(
|
|
71592
|
+
plugin_root: config4.pluginDirectory(plugin2.name),
|
|
71423
71593
|
typedef: false,
|
|
71424
71594
|
documents: docs
|
|
71425
71595
|
});
|
|
71426
71596
|
}
|
|
71427
|
-
if (
|
|
71597
|
+
if (plugin2.include_runtime) {
|
|
71428
71598
|
body += export_star_from({
|
|
71429
|
-
module: relative2(config4.pluginRuntimeDirectory(
|
|
71599
|
+
module: relative2(config4.pluginRuntimeDirectory(plugin2.name))
|
|
71430
71600
|
});
|
|
71431
71601
|
}
|
|
71432
|
-
if (!
|
|
71602
|
+
if (!plugin2.index_file) {
|
|
71433
71603
|
continue;
|
|
71434
71604
|
}
|
|
71435
71605
|
}
|
|
@@ -71439,7 +71609,7 @@ async function writeIndexFile2(config4, docs) {
|
|
|
71439
71609
|
// src/codegen/transforms/schema.ts
|
|
71440
71610
|
var graphql22 = __toESM(require_graphql2(), 1);
|
|
71441
71611
|
async function graphqlExtensions(config4, documents) {
|
|
71442
|
-
|
|
71612
|
+
let internalSchema = `
|
|
71443
71613
|
enum CachePolicy {
|
|
71444
71614
|
${"CacheAndNetwork" /* CacheAndNetwork */}
|
|
71445
71615
|
${"CacheOnly" /* CacheOnly */}
|
|
@@ -71480,6 +71650,7 @@ directive @${config4.listAllListsDirective} on FRAGMENT_SPREAD
|
|
|
71480
71650
|
"""
|
|
71481
71651
|
directive @${config4.listParentDirective}(value: ID!) on FRAGMENT_SPREAD
|
|
71482
71652
|
|
|
71653
|
+
|
|
71483
71654
|
"""
|
|
71484
71655
|
@${config4.whenDirective} is used to provide a conditional or in situations where it doesn't make sense (eg when removing or deleting a node.)
|
|
71485
71656
|
"""
|
|
@@ -71495,6 +71666,11 @@ directive @${config4.whenNotDirective} on FRAGMENT_SPREAD
|
|
|
71495
71666
|
"""
|
|
71496
71667
|
directive @${config4.argumentsDirective} on FRAGMENT_DEFINITION
|
|
71497
71668
|
|
|
71669
|
+
"""
|
|
71670
|
+
@${config4.withDirective} is used to provide arguments to fragments that have been marked with @${config4.argumentsDirective}
|
|
71671
|
+
"""
|
|
71672
|
+
directive @${config4.withDirective} on FRAGMENT_SPREAD
|
|
71673
|
+
|
|
71498
71674
|
"""
|
|
71499
71675
|
@${config4.cacheDirective} is used to specify cache rules for a query
|
|
71500
71676
|
"""
|
|
@@ -71515,6 +71691,12 @@ directive @${config4.maskEnableDirective} on FRAGMENT_SPREAD
|
|
|
71515
71691
|
"""
|
|
71516
71692
|
directive @${config4.maskDisableDirective} on FRAGMENT_SPREAD
|
|
71517
71693
|
`;
|
|
71694
|
+
for (const plugin2 of config4.plugins) {
|
|
71695
|
+
if (!plugin2.schema) {
|
|
71696
|
+
continue;
|
|
71697
|
+
}
|
|
71698
|
+
internalSchema += plugin2.schema({ config: config4 });
|
|
71699
|
+
}
|
|
71518
71700
|
let currentSchema = graphql22.printSchema(config4.schema);
|
|
71519
71701
|
if (!currentSchema.includes(`directive @${config4.listDirective}`)) {
|
|
71520
71702
|
currentSchema += internalSchema;
|
|
@@ -71697,7 +71879,7 @@ async function typeCheck(config4, docs) {
|
|
|
71697
71879
|
}
|
|
71698
71880
|
needsParent = needsParent || definition.kind === "FragmentDefinition";
|
|
71699
71881
|
const nameArg = directive.arguments?.find(
|
|
71700
|
-
({ name
|
|
71882
|
+
({ name }) => name.value === config4.listNameArg
|
|
71701
71883
|
);
|
|
71702
71884
|
if (!nameArg) {
|
|
71703
71885
|
if (directive.name.value === config4.listDirective) {
|
|
@@ -71867,14 +72049,14 @@ var validateLists = ({
|
|
|
71867
72049
|
return;
|
|
71868
72050
|
}
|
|
71869
72051
|
let directive = node.directives?.find(
|
|
71870
|
-
({ name
|
|
72052
|
+
({ name }) => name.value === config4.listParentDirective
|
|
71871
72053
|
);
|
|
71872
72054
|
if (directive) {
|
|
71873
72055
|
return;
|
|
71874
72056
|
}
|
|
71875
72057
|
let parentIdFound = false;
|
|
71876
|
-
directive = node.directives?.find(({ name
|
|
71877
|
-
[config4.listPrependDirective, config4.listAppendDirective].includes(
|
|
72058
|
+
directive = node.directives?.find(({ name }) => [
|
|
72059
|
+
[config4.listPrependDirective, config4.listAppendDirective].includes(name.value)
|
|
71878
72060
|
]);
|
|
71879
72061
|
if (directive) {
|
|
71880
72062
|
let parentArg = directive.arguments?.find(
|
|
@@ -71892,7 +72074,7 @@ var validateLists = ({
|
|
|
71892
72074
|
return;
|
|
71893
72075
|
}
|
|
71894
72076
|
const allLists = node.directives?.find(
|
|
71895
|
-
({ name
|
|
72077
|
+
({ name }) => config4.listAllListsDirective === name.value
|
|
71896
72078
|
);
|
|
71897
72079
|
if (allLists || config4.defaultListTarget === "all") {
|
|
71898
72080
|
return;
|
|
@@ -71914,7 +72096,7 @@ var validateLists = ({
|
|
|
71914
72096
|
);
|
|
71915
72097
|
return;
|
|
71916
72098
|
}
|
|
71917
|
-
if (!config4.isInternalDirective(node)) {
|
|
72099
|
+
if (!config4.isInternalDirective(node.name.value)) {
|
|
71918
72100
|
if (!config4.schema.getDirective(directiveName)) {
|
|
71919
72101
|
ctx.reportError(
|
|
71920
72102
|
new graphql25.GraphQLError(
|
|
@@ -72057,9 +72239,9 @@ function validateFragmentArguments(config4, filepath, fragments) {
|
|
|
72057
72239
|
);
|
|
72058
72240
|
} else {
|
|
72059
72241
|
const zipped = appliedArgumentNames.map(
|
|
72060
|
-
(
|
|
72061
|
-
appliedArguments[
|
|
72062
|
-
fragmentArguments2[fragmentName].find((arg) => arg.name ===
|
|
72242
|
+
(name) => [
|
|
72243
|
+
appliedArguments[name],
|
|
72244
|
+
fragmentArguments2[fragmentName].find((arg) => arg.name === name).type
|
|
72063
72245
|
]
|
|
72064
72246
|
);
|
|
72065
72247
|
for (const [applied, target] of zipped) {
|
|
@@ -72385,9 +72567,9 @@ For more information, please visit these links:
|
|
|
72385
72567
|
// src/codegen/validators/uniqueNames.ts
|
|
72386
72568
|
async function uniqueDocumentNames(config4, docs) {
|
|
72387
72569
|
const nameMap = docs.reduce(
|
|
72388
|
-
(acc, { name
|
|
72570
|
+
(acc, { name, filename }) => ({
|
|
72389
72571
|
...acc,
|
|
72390
|
-
[
|
|
72572
|
+
[name]: [...acc[name] || [], filename]
|
|
72391
72573
|
}),
|
|
72392
72574
|
{}
|
|
72393
72575
|
);
|
|
@@ -72434,12 +72616,12 @@ async function noIDAlias(config4, docs) {
|
|
|
72434
72616
|
// src/codegen/validators/plugins.ts
|
|
72435
72617
|
async function validatePlugins(config4, documents) {
|
|
72436
72618
|
let errors = [];
|
|
72437
|
-
for (const
|
|
72438
|
-
if (!
|
|
72619
|
+
for (const plugin2 of config4.plugins) {
|
|
72620
|
+
if (!plugin2.validate) {
|
|
72439
72621
|
continue;
|
|
72440
72622
|
}
|
|
72441
72623
|
try {
|
|
72442
|
-
await
|
|
72624
|
+
await plugin2.validate({ config: config4, documents });
|
|
72443
72625
|
} catch (err) {
|
|
72444
72626
|
errors.push(err);
|
|
72445
72627
|
}
|
|
@@ -72464,40 +72646,55 @@ async function runPipeline2(config4, docs) {
|
|
|
72464
72646
|
new: [],
|
|
72465
72647
|
deleted: []
|
|
72466
72648
|
};
|
|
72467
|
-
const generatePlugins = config4.plugins.filter((
|
|
72649
|
+
const generatePlugins = config4.plugins.filter((plugin2) => plugin2.generate);
|
|
72650
|
+
const after_validate = config4.plugins.filter((plugin2) => plugin2.after_validate).map((plugin2) => plugin2.after_validate);
|
|
72651
|
+
const validate2 = config4.plugins.filter((plugin2) => plugin2.validate).map((plugin2) => plugin2.validate);
|
|
72652
|
+
const before_validate = config4.plugins.filter((plugin2) => plugin2.before_validate).map((plugin2) => plugin2.before_validate);
|
|
72653
|
+
const transform_before_generate = config4.plugins.filter((plugin2) => plugin2.transform_before_generate).map((plugin2) => plugin2.transform_before_generate);
|
|
72654
|
+
const wrapHook = (hooks) => hooks.map(
|
|
72655
|
+
(fn) => (config5, docs2) => fn({
|
|
72656
|
+
config: config5,
|
|
72657
|
+
documents: docs2
|
|
72658
|
+
})
|
|
72659
|
+
);
|
|
72468
72660
|
let error = null;
|
|
72469
72661
|
try {
|
|
72470
72662
|
await runPipeline(
|
|
72471
72663
|
config4,
|
|
72472
72664
|
[
|
|
72665
|
+
graphqlExtensions,
|
|
72666
|
+
...wrapHook(before_validate),
|
|
72473
72667
|
typeCheck,
|
|
72474
72668
|
uniqueDocumentNames,
|
|
72475
72669
|
noIDAlias,
|
|
72476
72670
|
validatePlugins,
|
|
72477
|
-
|
|
72671
|
+
...wrapHook(validate2),
|
|
72672
|
+
...wrapHook(after_validate),
|
|
72478
72673
|
addID,
|
|
72479
72674
|
addTypename,
|
|
72480
72675
|
addListFragments,
|
|
72481
72676
|
paginate,
|
|
72482
72677
|
fragmentVariables,
|
|
72483
72678
|
includeFragmentDefinitions,
|
|
72679
|
+
...wrapHook(transform_before_generate),
|
|
72680
|
+
artifactGenerator(artifactStats),
|
|
72484
72681
|
runtimeGenerator,
|
|
72485
72682
|
writeIndexFile2,
|
|
72486
|
-
artifactGenerator(artifactStats),
|
|
72487
72683
|
typescriptGenerator,
|
|
72488
72684
|
persistOutputGenerator,
|
|
72489
72685
|
schemaGenerator,
|
|
72490
72686
|
...generatePlugins.map(
|
|
72491
|
-
(
|
|
72687
|
+
(plugin2) => async (config5, docs2) => await plugin2.generate({
|
|
72492
72688
|
config: config5,
|
|
72493
72689
|
documents: docs2,
|
|
72494
|
-
plugin_root: config5.pluginDirectory(
|
|
72690
|
+
plugin_root: config5.pluginDirectory(plugin2.name)
|
|
72495
72691
|
})
|
|
72496
72692
|
)
|
|
72497
72693
|
],
|
|
72498
72694
|
docs
|
|
72499
72695
|
);
|
|
72500
72696
|
} catch (e2) {
|
|
72697
|
+
console.log(e2);
|
|
72501
72698
|
error = e2;
|
|
72502
72699
|
}
|
|
72503
72700
|
const unchanged = artifactStats.total.length - artifactStats.changed.length - artifactStats.new.length - artifactStats.deleted.length;
|
|
@@ -72546,15 +72743,19 @@ async function collectDocuments(config4) {
|
|
|
72546
72743
|
".js": [],
|
|
72547
72744
|
".ts": []
|
|
72548
72745
|
};
|
|
72549
|
-
for (const
|
|
72550
|
-
if (
|
|
72551
|
-
for (const extension of
|
|
72552
|
-
extractors[extension] = [...extractors[extension] || [],
|
|
72746
|
+
for (const plugin2 of config4.plugins) {
|
|
72747
|
+
if (plugin2.extensions && plugin2.extract_documents) {
|
|
72748
|
+
for (const extension of plugin2.extensions) {
|
|
72749
|
+
extractors[extension] = [...extractors[extension] || [], plugin2.extract_documents];
|
|
72553
72750
|
}
|
|
72554
72751
|
}
|
|
72555
72752
|
}
|
|
72556
|
-
const graphql_extractor = (
|
|
72557
|
-
|
|
72753
|
+
const graphql_extractor = ({
|
|
72754
|
+
content
|
|
72755
|
+
}) => [content];
|
|
72756
|
+
const javascript_extractor = ({
|
|
72757
|
+
content
|
|
72758
|
+
}) => processJSFile(config4, content);
|
|
72558
72759
|
extractors[".ts"].push(javascript_extractor);
|
|
72559
72760
|
extractors[".js"].push(javascript_extractor);
|
|
72560
72761
|
extractors[".graphql"].push(graphql_extractor);
|
|
@@ -72578,8 +72779,8 @@ async function collectDocuments(config4) {
|
|
|
72578
72779
|
if (!extractor) {
|
|
72579
72780
|
continue;
|
|
72580
72781
|
}
|
|
72581
|
-
const found = await extractor(config4, filepath, contents);
|
|
72582
|
-
if (found.length > 0) {
|
|
72782
|
+
const found = await extractor({ config: config4, filepath, content: contents });
|
|
72783
|
+
if (found && found.length > 0) {
|
|
72583
72784
|
documents.push(...found.map((document) => ({ filepath, document })));
|
|
72584
72785
|
}
|
|
72585
72786
|
}
|
|
@@ -72609,12 +72810,7 @@ async function processJSFile(config4, contents) {
|
|
|
72609
72810
|
return documents;
|
|
72610
72811
|
}
|
|
72611
72812
|
async function processGraphQLDocument(config4, filepath, document) {
|
|
72612
|
-
|
|
72613
|
-
var parsedDoc = graphql27.parse(document);
|
|
72614
|
-
} catch (e2) {
|
|
72615
|
-
console.log("error parsing!!");
|
|
72616
|
-
throw e2;
|
|
72617
|
-
}
|
|
72813
|
+
const parsedDoc = graphql27.parse(document);
|
|
72618
72814
|
const operations = parsedDoc.definitions.filter(
|
|
72619
72815
|
({ kind: kind2 }) => kind2 === graphql27.Kind.OPERATION_DEFINITION
|
|
72620
72816
|
);
|
|
@@ -72652,40 +72848,41 @@ async function processGraphQLDocument(config4, filepath, document) {
|
|
|
72652
72848
|
originalDocument: parsedDoc,
|
|
72653
72849
|
generateArtifact: true,
|
|
72654
72850
|
generateStore: true,
|
|
72655
|
-
originalString: document
|
|
72851
|
+
originalString: document,
|
|
72852
|
+
artifact: null
|
|
72656
72853
|
};
|
|
72657
72854
|
}
|
|
72658
|
-
function logStyled(kind, stat3, logLevel,
|
|
72855
|
+
function logStyled(kind, stat3, logLevel, plugin2) {
|
|
72659
72856
|
if (stat3.length > 0) {
|
|
72660
72857
|
const msg = [];
|
|
72661
|
-
if (
|
|
72858
|
+
if (plugin2) {
|
|
72662
72859
|
msg.push(`\u{1F3A9} `);
|
|
72663
72860
|
}
|
|
72664
72861
|
if (kind === "CREATED") {
|
|
72665
72862
|
msg.push(`\u2728 `);
|
|
72666
|
-
if (!
|
|
72863
|
+
if (!plugin2) {
|
|
72667
72864
|
msg.push(`New: ${stat3.length}`);
|
|
72668
72865
|
}
|
|
72669
72866
|
} else if (kind === "UPDATED") {
|
|
72670
72867
|
msg.push(`\u270F\uFE0F `);
|
|
72671
|
-
if (!
|
|
72868
|
+
if (!plugin2) {
|
|
72672
72869
|
msg.push(`Changed: ${stat3.length}`);
|
|
72673
72870
|
}
|
|
72674
72871
|
} else if (kind === "DELETED") {
|
|
72675
72872
|
msg.push(`\u{1F9F9} `);
|
|
72676
|
-
if (!
|
|
72873
|
+
if (!plugin2) {
|
|
72677
72874
|
msg.push(`Deleted: ${stat3.length}`);
|
|
72678
72875
|
}
|
|
72679
72876
|
}
|
|
72680
72877
|
const nbToDisplay = 5;
|
|
72681
|
-
if (
|
|
72878
|
+
if (plugin2) {
|
|
72682
72879
|
msg.push(`${stat3.slice(0, nbToDisplay).join(", ")}`);
|
|
72683
72880
|
if (stat3.length > 5) {
|
|
72684
72881
|
msg.push(`, ... ${stat3.length - nbToDisplay} more`);
|
|
72685
72882
|
}
|
|
72686
72883
|
}
|
|
72687
72884
|
console.log(msg.join(""));
|
|
72688
|
-
if (!
|
|
72885
|
+
if (!plugin2 && logLevel === "summary" /* Summary */) {
|
|
72689
72886
|
for (const artifact of stat3.slice(0, nbToDisplay)) {
|
|
72690
72887
|
console.log(` ${artifact}`);
|
|
72691
72888
|
}
|
|
@@ -72735,32 +72932,32 @@ function Plugin(opts = {}) {
|
|
|
72735
72932
|
config: config3,
|
|
72736
72933
|
filepath
|
|
72737
72934
|
};
|
|
72738
|
-
for (const
|
|
72739
|
-
if (!
|
|
72935
|
+
for (const plugin2 of config3.plugins) {
|
|
72936
|
+
if (!plugin2.transform_file) {
|
|
72740
72937
|
continue;
|
|
72741
72938
|
}
|
|
72742
|
-
const { code: code2 } = await
|
|
72939
|
+
const { code: code2 } = await plugin2.transform_file(ctx);
|
|
72743
72940
|
ctx.content = code2;
|
|
72744
72941
|
}
|
|
72745
72942
|
return { code: ctx.content };
|
|
72746
72943
|
},
|
|
72747
72944
|
async load(id, opts2, ...rest) {
|
|
72748
|
-
for (const
|
|
72749
|
-
if (typeof
|
|
72945
|
+
for (const plugin2 of config3.plugins) {
|
|
72946
|
+
if (typeof plugin2.vite?.load !== "function") {
|
|
72750
72947
|
continue;
|
|
72751
72948
|
}
|
|
72752
|
-
const result = await
|
|
72949
|
+
const result = await plugin2.vite.load.call(this, id, { ...opts2, config: config3 }, ...rest);
|
|
72753
72950
|
if (result) {
|
|
72754
72951
|
return result;
|
|
72755
72952
|
}
|
|
72756
72953
|
}
|
|
72757
72954
|
},
|
|
72758
72955
|
async resolveId(id, two, opts2, ...rest) {
|
|
72759
|
-
for (const
|
|
72760
|
-
if (typeof
|
|
72956
|
+
for (const plugin2 of config3.plugins) {
|
|
72957
|
+
if (typeof plugin2.vite?.resolveId !== "function") {
|
|
72761
72958
|
continue;
|
|
72762
72959
|
}
|
|
72763
|
-
const result = await
|
|
72960
|
+
const result = await plugin2.vite.resolveId.call(
|
|
72764
72961
|
this,
|
|
72765
72962
|
id,
|
|
72766
72963
|
two,
|
|
@@ -72840,7 +73037,7 @@ function find_insert_index(script) {
|
|
|
72840
73037
|
}
|
|
72841
73038
|
return insert_index;
|
|
72842
73039
|
}
|
|
72843
|
-
function find_exported_fn(body,
|
|
73040
|
+
function find_exported_fn(body, name) {
|
|
72844
73041
|
for (const statement of body) {
|
|
72845
73042
|
if (statement.type !== "ExportNamedDeclaration") {
|
|
72846
73043
|
continue;
|
|
@@ -72848,12 +73045,12 @@ function find_exported_fn(body, name2) {
|
|
|
72848
73045
|
const exportDeclaration = statement;
|
|
72849
73046
|
if (exportDeclaration.declaration?.type === "FunctionDeclaration") {
|
|
72850
73047
|
const value = exportDeclaration.declaration;
|
|
72851
|
-
if (value.id?.name ===
|
|
73048
|
+
if (value.id?.name === name) {
|
|
72852
73049
|
return exportDeclaration.declaration;
|
|
72853
73050
|
}
|
|
72854
73051
|
} else if (exportDeclaration.declaration?.type === "VariableDeclaration") {
|
|
72855
73052
|
const value = exportDeclaration.declaration;
|
|
72856
|
-
if (value.declarations.length !== 1 || value.declarations[0].type !== "VariableDeclarator" || value.declarations[0].id.type !== "Identifier" || value.declarations[0].id.name !==
|
|
73053
|
+
if (value.declarations.length !== 1 || value.declarations[0].type !== "VariableDeclarator" || value.declarations[0].id.type !== "Identifier" || value.declarations[0].id.name !== name) {
|
|
72857
73054
|
continue;
|
|
72858
73055
|
}
|
|
72859
73056
|
const declaration = value.declarations[0];
|
|
@@ -72872,16 +73069,16 @@ function find_exported_fn(body, name2) {
|
|
|
72872
73069
|
}
|
|
72873
73070
|
}
|
|
72874
73071
|
const exported = body.find(
|
|
72875
|
-
(expression) => expression.type === "ExportNamedDeclaration" && (expression.declaration?.type === "FunctionDeclaration" && expression.declaration.id?.name ===
|
|
73072
|
+
(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)
|
|
72876
73073
|
);
|
|
72877
73074
|
if (!exported) {
|
|
72878
73075
|
return null;
|
|
72879
73076
|
}
|
|
72880
73077
|
return exported.declaration;
|
|
72881
73078
|
}
|
|
72882
|
-
function find_exported_id(program,
|
|
73079
|
+
function find_exported_id(program, name) {
|
|
72883
73080
|
return program.body.find(
|
|
72884
|
-
(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 ===
|
|
73081
|
+
(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
|
|
72885
73082
|
);
|
|
72886
73083
|
}
|
|
72887
73084
|
|