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
|
@@ -16,8 +16,8 @@ var __commonJS = (cb, mod) => function __require2() {
|
|
|
16
16
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
17
17
|
};
|
|
18
18
|
var __export = (target, all) => {
|
|
19
|
-
for (var
|
|
20
|
-
__defProp(target,
|
|
19
|
+
for (var name in all)
|
|
20
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
21
21
|
};
|
|
22
22
|
var __copyProps = (to, from, except, desc) => {
|
|
23
23
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -843,9 +843,9 @@ var require_inspect = __commonJS({
|
|
|
843
843
|
function getObjectTag(object) {
|
|
844
844
|
var tag = Object.prototype.toString.call(object).replace(/^\[object /, "").replace(/]$/, "");
|
|
845
845
|
if (tag === "Object" && typeof object.constructor === "function") {
|
|
846
|
-
var
|
|
847
|
-
if (typeof
|
|
848
|
-
return
|
|
846
|
+
var name = object.constructor.name;
|
|
847
|
+
if (typeof name === "string" && name !== "") {
|
|
848
|
+
return name;
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
851
|
return tag;
|
|
@@ -951,14 +951,14 @@ var require_source = __commonJS({
|
|
|
951
951
|
}
|
|
952
952
|
var Source2 = /* @__PURE__ */ function() {
|
|
953
953
|
function Source3(body) {
|
|
954
|
-
var
|
|
954
|
+
var name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "GraphQL request";
|
|
955
955
|
var locationOffset = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
956
956
|
line: 1,
|
|
957
957
|
column: 1
|
|
958
958
|
};
|
|
959
959
|
typeof body === "string" || (0, _devAssert.default)(0, "Body must be a string. Received: ".concat((0, _inspect.default)(body), "."));
|
|
960
960
|
this.body = body;
|
|
961
|
-
this.name =
|
|
961
|
+
this.name = name;
|
|
962
962
|
this.locationOffset = locationOffset;
|
|
963
963
|
this.locationOffset.line > 0 || (0, _devAssert.default)(0, "line in locationOffset is 1-indexed and must be positive.");
|
|
964
964
|
this.locationOffset.column > 0 || (0, _devAssert.default)(0, "column in locationOffset is 1-indexed and must be positive.");
|
|
@@ -1574,14 +1574,14 @@ var require_parser = __commonJS({
|
|
|
1574
1574
|
};
|
|
1575
1575
|
}
|
|
1576
1576
|
var operation = this.parseOperationType();
|
|
1577
|
-
var
|
|
1577
|
+
var name;
|
|
1578
1578
|
if (this.peek(_tokenKind.TokenKind.NAME)) {
|
|
1579
|
-
|
|
1579
|
+
name = this.parseName();
|
|
1580
1580
|
}
|
|
1581
1581
|
return {
|
|
1582
1582
|
kind: _kinds.Kind.OPERATION_DEFINITION,
|
|
1583
1583
|
operation,
|
|
1584
|
-
name
|
|
1584
|
+
name,
|
|
1585
1585
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
1586
1586
|
directives: this.parseDirectives(false),
|
|
1587
1587
|
selectionSet: this.parseSelectionSet(),
|
|
@@ -1638,17 +1638,17 @@ var require_parser = __commonJS({
|
|
|
1638
1638
|
var start = this._lexer.token;
|
|
1639
1639
|
var nameOrAlias = this.parseName();
|
|
1640
1640
|
var alias;
|
|
1641
|
-
var
|
|
1641
|
+
var name;
|
|
1642
1642
|
if (this.expectOptionalToken(_tokenKind.TokenKind.COLON)) {
|
|
1643
1643
|
alias = nameOrAlias;
|
|
1644
|
-
|
|
1644
|
+
name = this.parseName();
|
|
1645
1645
|
} else {
|
|
1646
|
-
|
|
1646
|
+
name = nameOrAlias;
|
|
1647
1647
|
}
|
|
1648
1648
|
return {
|
|
1649
1649
|
kind: _kinds.Kind.FIELD,
|
|
1650
1650
|
alias,
|
|
1651
|
-
name
|
|
1651
|
+
name,
|
|
1652
1652
|
arguments: this.parseArguments(false),
|
|
1653
1653
|
directives: this.parseDirectives(false),
|
|
1654
1654
|
selectionSet: this.peek(_tokenKind.TokenKind.BRACE_L) ? this.parseSelectionSet() : void 0,
|
|
@@ -1661,11 +1661,11 @@ var require_parser = __commonJS({
|
|
|
1661
1661
|
};
|
|
1662
1662
|
_proto.parseArgument = function parseArgument() {
|
|
1663
1663
|
var start = this._lexer.token;
|
|
1664
|
-
var
|
|
1664
|
+
var name = this.parseName();
|
|
1665
1665
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
1666
1666
|
return {
|
|
1667
1667
|
kind: _kinds.Kind.ARGUMENT,
|
|
1668
|
-
name
|
|
1668
|
+
name,
|
|
1669
1669
|
value: this.parseValueLiteral(false),
|
|
1670
1670
|
loc: this.loc(start)
|
|
1671
1671
|
};
|
|
@@ -1824,11 +1824,11 @@ var require_parser = __commonJS({
|
|
|
1824
1824
|
};
|
|
1825
1825
|
_proto.parseObjectField = function parseObjectField(isConst) {
|
|
1826
1826
|
var start = this._lexer.token;
|
|
1827
|
-
var
|
|
1827
|
+
var name = this.parseName();
|
|
1828
1828
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
1829
1829
|
return {
|
|
1830
1830
|
kind: _kinds.Kind.OBJECT_FIELD,
|
|
1831
|
-
name
|
|
1831
|
+
name,
|
|
1832
1832
|
value: this.parseValueLiteral(isConst),
|
|
1833
1833
|
loc: this.loc(start)
|
|
1834
1834
|
};
|
|
@@ -1943,12 +1943,12 @@ var require_parser = __commonJS({
|
|
|
1943
1943
|
var start = this._lexer.token;
|
|
1944
1944
|
var description = this.parseDescription();
|
|
1945
1945
|
this.expectKeyword("scalar");
|
|
1946
|
-
var
|
|
1946
|
+
var name = this.parseName();
|
|
1947
1947
|
var directives = this.parseDirectives(true);
|
|
1948
1948
|
return {
|
|
1949
1949
|
kind: _kinds.Kind.SCALAR_TYPE_DEFINITION,
|
|
1950
1950
|
description,
|
|
1951
|
-
name
|
|
1951
|
+
name,
|
|
1952
1952
|
directives,
|
|
1953
1953
|
loc: this.loc(start)
|
|
1954
1954
|
};
|
|
@@ -1957,14 +1957,14 @@ var require_parser = __commonJS({
|
|
|
1957
1957
|
var start = this._lexer.token;
|
|
1958
1958
|
var description = this.parseDescription();
|
|
1959
1959
|
this.expectKeyword("type");
|
|
1960
|
-
var
|
|
1960
|
+
var name = this.parseName();
|
|
1961
1961
|
var interfaces = this.parseImplementsInterfaces();
|
|
1962
1962
|
var directives = this.parseDirectives(true);
|
|
1963
1963
|
var fields = this.parseFieldsDefinition();
|
|
1964
1964
|
return {
|
|
1965
1965
|
kind: _kinds.Kind.OBJECT_TYPE_DEFINITION,
|
|
1966
1966
|
description,
|
|
1967
|
-
name
|
|
1967
|
+
name,
|
|
1968
1968
|
interfaces,
|
|
1969
1969
|
directives,
|
|
1970
1970
|
fields,
|
|
@@ -1998,7 +1998,7 @@ var require_parser = __commonJS({
|
|
|
1998
1998
|
_proto.parseFieldDefinition = function parseFieldDefinition() {
|
|
1999
1999
|
var start = this._lexer.token;
|
|
2000
2000
|
var description = this.parseDescription();
|
|
2001
|
-
var
|
|
2001
|
+
var name = this.parseName();
|
|
2002
2002
|
var args = this.parseArgumentDefs();
|
|
2003
2003
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
2004
2004
|
var type = this.parseTypeReference();
|
|
@@ -2006,7 +2006,7 @@ var require_parser = __commonJS({
|
|
|
2006
2006
|
return {
|
|
2007
2007
|
kind: _kinds.Kind.FIELD_DEFINITION,
|
|
2008
2008
|
description,
|
|
2009
|
-
name
|
|
2009
|
+
name,
|
|
2010
2010
|
arguments: args,
|
|
2011
2011
|
type,
|
|
2012
2012
|
directives,
|
|
@@ -2019,7 +2019,7 @@ var require_parser = __commonJS({
|
|
|
2019
2019
|
_proto.parseInputValueDef = function parseInputValueDef() {
|
|
2020
2020
|
var start = this._lexer.token;
|
|
2021
2021
|
var description = this.parseDescription();
|
|
2022
|
-
var
|
|
2022
|
+
var name = this.parseName();
|
|
2023
2023
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
2024
2024
|
var type = this.parseTypeReference();
|
|
2025
2025
|
var defaultValue;
|
|
@@ -2030,7 +2030,7 @@ var require_parser = __commonJS({
|
|
|
2030
2030
|
return {
|
|
2031
2031
|
kind: _kinds.Kind.INPUT_VALUE_DEFINITION,
|
|
2032
2032
|
description,
|
|
2033
|
-
name
|
|
2033
|
+
name,
|
|
2034
2034
|
type,
|
|
2035
2035
|
defaultValue,
|
|
2036
2036
|
directives,
|
|
@@ -2041,14 +2041,14 @@ var require_parser = __commonJS({
|
|
|
2041
2041
|
var start = this._lexer.token;
|
|
2042
2042
|
var description = this.parseDescription();
|
|
2043
2043
|
this.expectKeyword("interface");
|
|
2044
|
-
var
|
|
2044
|
+
var name = this.parseName();
|
|
2045
2045
|
var interfaces = this.parseImplementsInterfaces();
|
|
2046
2046
|
var directives = this.parseDirectives(true);
|
|
2047
2047
|
var fields = this.parseFieldsDefinition();
|
|
2048
2048
|
return {
|
|
2049
2049
|
kind: _kinds.Kind.INTERFACE_TYPE_DEFINITION,
|
|
2050
2050
|
description,
|
|
2051
|
-
name
|
|
2051
|
+
name,
|
|
2052
2052
|
interfaces,
|
|
2053
2053
|
directives,
|
|
2054
2054
|
fields,
|
|
@@ -2059,13 +2059,13 @@ var require_parser = __commonJS({
|
|
|
2059
2059
|
var start = this._lexer.token;
|
|
2060
2060
|
var description = this.parseDescription();
|
|
2061
2061
|
this.expectKeyword("union");
|
|
2062
|
-
var
|
|
2062
|
+
var name = this.parseName();
|
|
2063
2063
|
var directives = this.parseDirectives(true);
|
|
2064
2064
|
var types14 = this.parseUnionMemberTypes();
|
|
2065
2065
|
return {
|
|
2066
2066
|
kind: _kinds.Kind.UNION_TYPE_DEFINITION,
|
|
2067
2067
|
description,
|
|
2068
|
-
name
|
|
2068
|
+
name,
|
|
2069
2069
|
directives,
|
|
2070
2070
|
types: types14,
|
|
2071
2071
|
loc: this.loc(start)
|
|
@@ -2078,13 +2078,13 @@ var require_parser = __commonJS({
|
|
|
2078
2078
|
var start = this._lexer.token;
|
|
2079
2079
|
var description = this.parseDescription();
|
|
2080
2080
|
this.expectKeyword("enum");
|
|
2081
|
-
var
|
|
2081
|
+
var name = this.parseName();
|
|
2082
2082
|
var directives = this.parseDirectives(true);
|
|
2083
2083
|
var values = this.parseEnumValuesDefinition();
|
|
2084
2084
|
return {
|
|
2085
2085
|
kind: _kinds.Kind.ENUM_TYPE_DEFINITION,
|
|
2086
2086
|
description,
|
|
2087
|
-
name
|
|
2087
|
+
name,
|
|
2088
2088
|
directives,
|
|
2089
2089
|
values,
|
|
2090
2090
|
loc: this.loc(start)
|
|
@@ -2096,12 +2096,12 @@ var require_parser = __commonJS({
|
|
|
2096
2096
|
_proto.parseEnumValueDefinition = function parseEnumValueDefinition() {
|
|
2097
2097
|
var start = this._lexer.token;
|
|
2098
2098
|
var description = this.parseDescription();
|
|
2099
|
-
var
|
|
2099
|
+
var name = this.parseName();
|
|
2100
2100
|
var directives = this.parseDirectives(true);
|
|
2101
2101
|
return {
|
|
2102
2102
|
kind: _kinds.Kind.ENUM_VALUE_DEFINITION,
|
|
2103
2103
|
description,
|
|
2104
|
-
name
|
|
2104
|
+
name,
|
|
2105
2105
|
directives,
|
|
2106
2106
|
loc: this.loc(start)
|
|
2107
2107
|
};
|
|
@@ -2110,13 +2110,13 @@ var require_parser = __commonJS({
|
|
|
2110
2110
|
var start = this._lexer.token;
|
|
2111
2111
|
var description = this.parseDescription();
|
|
2112
2112
|
this.expectKeyword("input");
|
|
2113
|
-
var
|
|
2113
|
+
var name = this.parseName();
|
|
2114
2114
|
var directives = this.parseDirectives(true);
|
|
2115
2115
|
var fields = this.parseInputFieldsDefinition();
|
|
2116
2116
|
return {
|
|
2117
2117
|
kind: _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION,
|
|
2118
2118
|
description,
|
|
2119
|
-
name
|
|
2119
|
+
name,
|
|
2120
2120
|
directives,
|
|
2121
2121
|
fields,
|
|
2122
2122
|
loc: this.loc(start)
|
|
@@ -2167,14 +2167,14 @@ var require_parser = __commonJS({
|
|
|
2167
2167
|
var start = this._lexer.token;
|
|
2168
2168
|
this.expectKeyword("extend");
|
|
2169
2169
|
this.expectKeyword("scalar");
|
|
2170
|
-
var
|
|
2170
|
+
var name = this.parseName();
|
|
2171
2171
|
var directives = this.parseDirectives(true);
|
|
2172
2172
|
if (directives.length === 0) {
|
|
2173
2173
|
throw this.unexpected();
|
|
2174
2174
|
}
|
|
2175
2175
|
return {
|
|
2176
2176
|
kind: _kinds.Kind.SCALAR_TYPE_EXTENSION,
|
|
2177
|
-
name
|
|
2177
|
+
name,
|
|
2178
2178
|
directives,
|
|
2179
2179
|
loc: this.loc(start)
|
|
2180
2180
|
};
|
|
@@ -2183,7 +2183,7 @@ var require_parser = __commonJS({
|
|
|
2183
2183
|
var start = this._lexer.token;
|
|
2184
2184
|
this.expectKeyword("extend");
|
|
2185
2185
|
this.expectKeyword("type");
|
|
2186
|
-
var
|
|
2186
|
+
var name = this.parseName();
|
|
2187
2187
|
var interfaces = this.parseImplementsInterfaces();
|
|
2188
2188
|
var directives = this.parseDirectives(true);
|
|
2189
2189
|
var fields = this.parseFieldsDefinition();
|
|
@@ -2192,7 +2192,7 @@ var require_parser = __commonJS({
|
|
|
2192
2192
|
}
|
|
2193
2193
|
return {
|
|
2194
2194
|
kind: _kinds.Kind.OBJECT_TYPE_EXTENSION,
|
|
2195
|
-
name
|
|
2195
|
+
name,
|
|
2196
2196
|
interfaces,
|
|
2197
2197
|
directives,
|
|
2198
2198
|
fields,
|
|
@@ -2203,7 +2203,7 @@ var require_parser = __commonJS({
|
|
|
2203
2203
|
var start = this._lexer.token;
|
|
2204
2204
|
this.expectKeyword("extend");
|
|
2205
2205
|
this.expectKeyword("interface");
|
|
2206
|
-
var
|
|
2206
|
+
var name = this.parseName();
|
|
2207
2207
|
var interfaces = this.parseImplementsInterfaces();
|
|
2208
2208
|
var directives = this.parseDirectives(true);
|
|
2209
2209
|
var fields = this.parseFieldsDefinition();
|
|
@@ -2212,7 +2212,7 @@ var require_parser = __commonJS({
|
|
|
2212
2212
|
}
|
|
2213
2213
|
return {
|
|
2214
2214
|
kind: _kinds.Kind.INTERFACE_TYPE_EXTENSION,
|
|
2215
|
-
name
|
|
2215
|
+
name,
|
|
2216
2216
|
interfaces,
|
|
2217
2217
|
directives,
|
|
2218
2218
|
fields,
|
|
@@ -2223,7 +2223,7 @@ var require_parser = __commonJS({
|
|
|
2223
2223
|
var start = this._lexer.token;
|
|
2224
2224
|
this.expectKeyword("extend");
|
|
2225
2225
|
this.expectKeyword("union");
|
|
2226
|
-
var
|
|
2226
|
+
var name = this.parseName();
|
|
2227
2227
|
var directives = this.parseDirectives(true);
|
|
2228
2228
|
var types14 = this.parseUnionMemberTypes();
|
|
2229
2229
|
if (directives.length === 0 && types14.length === 0) {
|
|
@@ -2231,7 +2231,7 @@ var require_parser = __commonJS({
|
|
|
2231
2231
|
}
|
|
2232
2232
|
return {
|
|
2233
2233
|
kind: _kinds.Kind.UNION_TYPE_EXTENSION,
|
|
2234
|
-
name
|
|
2234
|
+
name,
|
|
2235
2235
|
directives,
|
|
2236
2236
|
types: types14,
|
|
2237
2237
|
loc: this.loc(start)
|
|
@@ -2241,7 +2241,7 @@ var require_parser = __commonJS({
|
|
|
2241
2241
|
var start = this._lexer.token;
|
|
2242
2242
|
this.expectKeyword("extend");
|
|
2243
2243
|
this.expectKeyword("enum");
|
|
2244
|
-
var
|
|
2244
|
+
var name = this.parseName();
|
|
2245
2245
|
var directives = this.parseDirectives(true);
|
|
2246
2246
|
var values = this.parseEnumValuesDefinition();
|
|
2247
2247
|
if (directives.length === 0 && values.length === 0) {
|
|
@@ -2249,7 +2249,7 @@ var require_parser = __commonJS({
|
|
|
2249
2249
|
}
|
|
2250
2250
|
return {
|
|
2251
2251
|
kind: _kinds.Kind.ENUM_TYPE_EXTENSION,
|
|
2252
|
-
name
|
|
2252
|
+
name,
|
|
2253
2253
|
directives,
|
|
2254
2254
|
values,
|
|
2255
2255
|
loc: this.loc(start)
|
|
@@ -2259,7 +2259,7 @@ var require_parser = __commonJS({
|
|
|
2259
2259
|
var start = this._lexer.token;
|
|
2260
2260
|
this.expectKeyword("extend");
|
|
2261
2261
|
this.expectKeyword("input");
|
|
2262
|
-
var
|
|
2262
|
+
var name = this.parseName();
|
|
2263
2263
|
var directives = this.parseDirectives(true);
|
|
2264
2264
|
var fields = this.parseInputFieldsDefinition();
|
|
2265
2265
|
if (directives.length === 0 && fields.length === 0) {
|
|
@@ -2267,7 +2267,7 @@ var require_parser = __commonJS({
|
|
|
2267
2267
|
}
|
|
2268
2268
|
return {
|
|
2269
2269
|
kind: _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION,
|
|
2270
|
-
name
|
|
2270
|
+
name,
|
|
2271
2271
|
directives,
|
|
2272
2272
|
fields,
|
|
2273
2273
|
loc: this.loc(start)
|
|
@@ -2278,7 +2278,7 @@ var require_parser = __commonJS({
|
|
|
2278
2278
|
var description = this.parseDescription();
|
|
2279
2279
|
this.expectKeyword("directive");
|
|
2280
2280
|
this.expectToken(_tokenKind.TokenKind.AT);
|
|
2281
|
-
var
|
|
2281
|
+
var name = this.parseName();
|
|
2282
2282
|
var args = this.parseArgumentDefs();
|
|
2283
2283
|
var repeatable = this.expectOptionalKeyword("repeatable");
|
|
2284
2284
|
this.expectKeyword("on");
|
|
@@ -2286,7 +2286,7 @@ var require_parser = __commonJS({
|
|
|
2286
2286
|
return {
|
|
2287
2287
|
kind: _kinds.Kind.DIRECTIVE_DEFINITION,
|
|
2288
2288
|
description,
|
|
2289
|
-
name
|
|
2289
|
+
name,
|
|
2290
2290
|
arguments: args,
|
|
2291
2291
|
repeatable,
|
|
2292
2292
|
locations,
|
|
@@ -2298,9 +2298,9 @@ var require_parser = __commonJS({
|
|
|
2298
2298
|
};
|
|
2299
2299
|
_proto.parseDirectiveLocation = function parseDirectiveLocation() {
|
|
2300
2300
|
var start = this._lexer.token;
|
|
2301
|
-
var
|
|
2302
|
-
if (_directiveLocation.DirectiveLocation[
|
|
2303
|
-
return
|
|
2301
|
+
var name = this.parseName();
|
|
2302
|
+
if (_directiveLocation.DirectiveLocation[name.value] !== void 0) {
|
|
2303
|
+
return name;
|
|
2304
2304
|
}
|
|
2305
2305
|
throw this.unexpected(start);
|
|
2306
2306
|
};
|
|
@@ -2739,20 +2739,20 @@ var require_assertValidName = __commonJS({
|
|
|
2739
2739
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
2740
2740
|
}
|
|
2741
2741
|
var NAME_RX = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
2742
|
-
function assertValidName(
|
|
2743
|
-
var error = isValidNameError(
|
|
2742
|
+
function assertValidName(name) {
|
|
2743
|
+
var error = isValidNameError(name);
|
|
2744
2744
|
if (error) {
|
|
2745
2745
|
throw error;
|
|
2746
2746
|
}
|
|
2747
|
-
return
|
|
2747
|
+
return name;
|
|
2748
2748
|
}
|
|
2749
|
-
function isValidNameError(
|
|
2750
|
-
typeof
|
|
2751
|
-
if (
|
|
2752
|
-
return new _GraphQLError.GraphQLError('Name "'.concat(
|
|
2749
|
+
function isValidNameError(name) {
|
|
2750
|
+
typeof name === "string" || (0, _devAssert.default)(0, "Expected name to be a string.");
|
|
2751
|
+
if (name.length > 1 && name[0] === "_" && name[1] === "_") {
|
|
2752
|
+
return new _GraphQLError.GraphQLError('Name "'.concat(name, '" must not begin with "__", which is reserved by GraphQL introspection.'));
|
|
2753
2753
|
}
|
|
2754
|
-
if (!NAME_RX.test(
|
|
2755
|
-
return new _GraphQLError.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'.concat(
|
|
2754
|
+
if (!NAME_RX.test(name)) {
|
|
2755
|
+
return new _GraphQLError.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'.concat(name, '" does not.'));
|
|
2756
2756
|
}
|
|
2757
2757
|
}
|
|
2758
2758
|
}
|
|
@@ -3092,11 +3092,11 @@ var require_printer = __commonJS({
|
|
|
3092
3092
|
},
|
|
3093
3093
|
OperationDefinition: function OperationDefinition(node) {
|
|
3094
3094
|
var op = node.operation;
|
|
3095
|
-
var
|
|
3095
|
+
var name = node.name;
|
|
3096
3096
|
var varDefs = wrap("(", join2(node.variableDefinitions, ", "), ")");
|
|
3097
3097
|
var directives = join2(node.directives, " ");
|
|
3098
3098
|
var selectionSet = node.selectionSet;
|
|
3099
|
-
return !
|
|
3099
|
+
return !name && !directives && !varDefs && op === "query" ? selectionSet : join2([op, join2([name, varDefs]), directives, selectionSet], " ");
|
|
3100
3100
|
},
|
|
3101
3101
|
VariableDefinition: function VariableDefinition(_ref) {
|
|
3102
3102
|
var variable = _ref.variable, type = _ref.type, defaultValue = _ref.defaultValue, directives = _ref.directives;
|
|
@@ -3107,8 +3107,8 @@ var require_printer = __commonJS({
|
|
|
3107
3107
|
return block(selections);
|
|
3108
3108
|
},
|
|
3109
3109
|
Field: function Field(_ref3) {
|
|
3110
|
-
var alias = _ref3.alias,
|
|
3111
|
-
var prefix = wrap("", alias, ": ") +
|
|
3110
|
+
var alias = _ref3.alias, name = _ref3.name, args = _ref3.arguments, directives = _ref3.directives, selectionSet = _ref3.selectionSet;
|
|
3111
|
+
var prefix = wrap("", alias, ": ") + name;
|
|
3112
3112
|
var argsLine = prefix + wrap("(", join2(args, ", "), ")");
|
|
3113
3113
|
if (argsLine.length > MAX_LINE_LENGTH) {
|
|
3114
3114
|
argsLine = prefix + wrap("(\n", indent(join2(args, "\n")), "\n)");
|
|
@@ -3116,20 +3116,20 @@ var require_printer = __commonJS({
|
|
|
3116
3116
|
return join2([argsLine, join2(directives, " "), selectionSet], " ");
|
|
3117
3117
|
},
|
|
3118
3118
|
Argument: function Argument(_ref4) {
|
|
3119
|
-
var
|
|
3120
|
-
return
|
|
3119
|
+
var name = _ref4.name, value = _ref4.value;
|
|
3120
|
+
return name + ": " + value;
|
|
3121
3121
|
},
|
|
3122
3122
|
FragmentSpread: function FragmentSpread(_ref5) {
|
|
3123
|
-
var
|
|
3124
|
-
return "..." +
|
|
3123
|
+
var name = _ref5.name, directives = _ref5.directives;
|
|
3124
|
+
return "..." + name + wrap(" ", join2(directives, " "));
|
|
3125
3125
|
},
|
|
3126
3126
|
InlineFragment: function InlineFragment(_ref6) {
|
|
3127
3127
|
var typeCondition = _ref6.typeCondition, directives = _ref6.directives, selectionSet = _ref6.selectionSet;
|
|
3128
3128
|
return join2(["...", wrap("on ", typeCondition), join2(directives, " "), selectionSet], " ");
|
|
3129
3129
|
},
|
|
3130
3130
|
FragmentDefinition: function FragmentDefinition(_ref7) {
|
|
3131
|
-
var
|
|
3132
|
-
return "fragment ".concat(
|
|
3131
|
+
var name = _ref7.name, typeCondition = _ref7.typeCondition, variableDefinitions = _ref7.variableDefinitions, directives = _ref7.directives, selectionSet = _ref7.selectionSet;
|
|
3132
|
+
return "fragment ".concat(name).concat(wrap("(", join2(variableDefinitions, ", "), ")"), " ") + "on ".concat(typeCondition, " ").concat(wrap("", join2(directives, " "), " ")) + selectionSet;
|
|
3133
3133
|
},
|
|
3134
3134
|
IntValue: function IntValue(_ref8) {
|
|
3135
3135
|
var value = _ref8.value;
|
|
@@ -3163,16 +3163,16 @@ var require_printer = __commonJS({
|
|
|
3163
3163
|
return "{" + join2(fields, ", ") + "}";
|
|
3164
3164
|
},
|
|
3165
3165
|
ObjectField: function ObjectField(_ref15) {
|
|
3166
|
-
var
|
|
3167
|
-
return
|
|
3166
|
+
var name = _ref15.name, value = _ref15.value;
|
|
3167
|
+
return name + ": " + value;
|
|
3168
3168
|
},
|
|
3169
3169
|
Directive: function Directive(_ref16) {
|
|
3170
|
-
var
|
|
3171
|
-
return "@" +
|
|
3170
|
+
var name = _ref16.name, args = _ref16.arguments;
|
|
3171
|
+
return "@" + name + wrap("(", join2(args, ", "), ")");
|
|
3172
3172
|
},
|
|
3173
3173
|
NamedType: function NamedType(_ref17) {
|
|
3174
|
-
var
|
|
3175
|
-
return
|
|
3174
|
+
var name = _ref17.name;
|
|
3175
|
+
return name;
|
|
3176
3176
|
},
|
|
3177
3177
|
ListType: function ListType(_ref18) {
|
|
3178
3178
|
var type = _ref18.type;
|
|
@@ -3191,72 +3191,72 @@ var require_printer = __commonJS({
|
|
|
3191
3191
|
return operation + ": " + type;
|
|
3192
3192
|
},
|
|
3193
3193
|
ScalarTypeDefinition: addDescription(function(_ref22) {
|
|
3194
|
-
var
|
|
3195
|
-
return join2(["scalar",
|
|
3194
|
+
var name = _ref22.name, directives = _ref22.directives;
|
|
3195
|
+
return join2(["scalar", name, join2(directives, " ")], " ");
|
|
3196
3196
|
}),
|
|
3197
3197
|
ObjectTypeDefinition: addDescription(function(_ref23) {
|
|
3198
|
-
var
|
|
3199
|
-
return join2(["type",
|
|
3198
|
+
var name = _ref23.name, interfaces = _ref23.interfaces, directives = _ref23.directives, fields = _ref23.fields;
|
|
3199
|
+
return join2(["type", name, wrap("implements ", join2(interfaces, " & ")), join2(directives, " "), block(fields)], " ");
|
|
3200
3200
|
}),
|
|
3201
3201
|
FieldDefinition: addDescription(function(_ref24) {
|
|
3202
|
-
var
|
|
3203
|
-
return
|
|
3202
|
+
var name = _ref24.name, args = _ref24.arguments, type = _ref24.type, directives = _ref24.directives;
|
|
3203
|
+
return name + (hasMultilineItems(args) ? wrap("(\n", indent(join2(args, "\n")), "\n)") : wrap("(", join2(args, ", "), ")")) + ": " + type + wrap(" ", join2(directives, " "));
|
|
3204
3204
|
}),
|
|
3205
3205
|
InputValueDefinition: addDescription(function(_ref25) {
|
|
3206
|
-
var
|
|
3207
|
-
return join2([
|
|
3206
|
+
var name = _ref25.name, type = _ref25.type, defaultValue = _ref25.defaultValue, directives = _ref25.directives;
|
|
3207
|
+
return join2([name + ": " + type, wrap("= ", defaultValue), join2(directives, " ")], " ");
|
|
3208
3208
|
}),
|
|
3209
3209
|
InterfaceTypeDefinition: addDescription(function(_ref26) {
|
|
3210
|
-
var
|
|
3211
|
-
return join2(["interface",
|
|
3210
|
+
var name = _ref26.name, interfaces = _ref26.interfaces, directives = _ref26.directives, fields = _ref26.fields;
|
|
3211
|
+
return join2(["interface", name, wrap("implements ", join2(interfaces, " & ")), join2(directives, " "), block(fields)], " ");
|
|
3212
3212
|
}),
|
|
3213
3213
|
UnionTypeDefinition: addDescription(function(_ref27) {
|
|
3214
|
-
var
|
|
3215
|
-
return join2(["union",
|
|
3214
|
+
var name = _ref27.name, directives = _ref27.directives, types14 = _ref27.types;
|
|
3215
|
+
return join2(["union", name, join2(directives, " "), types14 && types14.length !== 0 ? "= " + join2(types14, " | ") : ""], " ");
|
|
3216
3216
|
}),
|
|
3217
3217
|
EnumTypeDefinition: addDescription(function(_ref28) {
|
|
3218
|
-
var
|
|
3219
|
-
return join2(["enum",
|
|
3218
|
+
var name = _ref28.name, directives = _ref28.directives, values = _ref28.values;
|
|
3219
|
+
return join2(["enum", name, join2(directives, " "), block(values)], " ");
|
|
3220
3220
|
}),
|
|
3221
3221
|
EnumValueDefinition: addDescription(function(_ref29) {
|
|
3222
|
-
var
|
|
3223
|
-
return join2([
|
|
3222
|
+
var name = _ref29.name, directives = _ref29.directives;
|
|
3223
|
+
return join2([name, join2(directives, " ")], " ");
|
|
3224
3224
|
}),
|
|
3225
3225
|
InputObjectTypeDefinition: addDescription(function(_ref30) {
|
|
3226
|
-
var
|
|
3227
|
-
return join2(["input",
|
|
3226
|
+
var name = _ref30.name, directives = _ref30.directives, fields = _ref30.fields;
|
|
3227
|
+
return join2(["input", name, join2(directives, " "), block(fields)], " ");
|
|
3228
3228
|
}),
|
|
3229
3229
|
DirectiveDefinition: addDescription(function(_ref31) {
|
|
3230
|
-
var
|
|
3231
|
-
return "directive @" +
|
|
3230
|
+
var name = _ref31.name, args = _ref31.arguments, repeatable = _ref31.repeatable, locations = _ref31.locations;
|
|
3231
|
+
return "directive @" + name + (hasMultilineItems(args) ? wrap("(\n", indent(join2(args, "\n")), "\n)") : wrap("(", join2(args, ", "), ")")) + (repeatable ? " repeatable" : "") + " on " + join2(locations, " | ");
|
|
3232
3232
|
}),
|
|
3233
3233
|
SchemaExtension: function SchemaExtension(_ref32) {
|
|
3234
3234
|
var directives = _ref32.directives, operationTypes = _ref32.operationTypes;
|
|
3235
3235
|
return join2(["extend schema", join2(directives, " "), block(operationTypes)], " ");
|
|
3236
3236
|
},
|
|
3237
3237
|
ScalarTypeExtension: function ScalarTypeExtension(_ref33) {
|
|
3238
|
-
var
|
|
3239
|
-
return join2(["extend scalar",
|
|
3238
|
+
var name = _ref33.name, directives = _ref33.directives;
|
|
3239
|
+
return join2(["extend scalar", name, join2(directives, " ")], " ");
|
|
3240
3240
|
},
|
|
3241
3241
|
ObjectTypeExtension: function ObjectTypeExtension(_ref34) {
|
|
3242
|
-
var
|
|
3243
|
-
return join2(["extend type",
|
|
3242
|
+
var name = _ref34.name, interfaces = _ref34.interfaces, directives = _ref34.directives, fields = _ref34.fields;
|
|
3243
|
+
return join2(["extend type", name, wrap("implements ", join2(interfaces, " & ")), join2(directives, " "), block(fields)], " ");
|
|
3244
3244
|
},
|
|
3245
3245
|
InterfaceTypeExtension: function InterfaceTypeExtension(_ref35) {
|
|
3246
|
-
var
|
|
3247
|
-
return join2(["extend interface",
|
|
3246
|
+
var name = _ref35.name, interfaces = _ref35.interfaces, directives = _ref35.directives, fields = _ref35.fields;
|
|
3247
|
+
return join2(["extend interface", name, wrap("implements ", join2(interfaces, " & ")), join2(directives, " "), block(fields)], " ");
|
|
3248
3248
|
},
|
|
3249
3249
|
UnionTypeExtension: function UnionTypeExtension(_ref36) {
|
|
3250
|
-
var
|
|
3251
|
-
return join2(["extend union",
|
|
3250
|
+
var name = _ref36.name, directives = _ref36.directives, types14 = _ref36.types;
|
|
3251
|
+
return join2(["extend union", name, join2(directives, " "), types14 && types14.length !== 0 ? "= " + join2(types14, " | ") : ""], " ");
|
|
3252
3252
|
},
|
|
3253
3253
|
EnumTypeExtension: function EnumTypeExtension(_ref37) {
|
|
3254
|
-
var
|
|
3255
|
-
return join2(["extend enum",
|
|
3254
|
+
var name = _ref37.name, directives = _ref37.directives, values = _ref37.values;
|
|
3255
|
+
return join2(["extend enum", name, join2(directives, " "), block(values)], " ");
|
|
3256
3256
|
},
|
|
3257
3257
|
InputObjectTypeExtension: function InputObjectTypeExtension(_ref38) {
|
|
3258
|
-
var
|
|
3259
|
-
return join2(["extend input",
|
|
3258
|
+
var name = _ref38.name, directives = _ref38.directives, fields = _ref38.fields;
|
|
3259
|
+
return join2(["extend input", name, join2(directives, " "), block(fields)], " ");
|
|
3260
3260
|
}
|
|
3261
3261
|
};
|
|
3262
3262
|
function addDescription(cb) {
|
|
@@ -3943,8 +3943,8 @@ var require_definition = __commonJS({
|
|
|
3943
3943
|
_proto5.getValues = function getValues() {
|
|
3944
3944
|
return this._values;
|
|
3945
3945
|
};
|
|
3946
|
-
_proto5.getValue = function getValue(
|
|
3947
|
-
return this._nameLookup[
|
|
3946
|
+
_proto5.getValue = function getValue(name) {
|
|
3947
|
+
return this._nameLookup[name];
|
|
3948
3948
|
};
|
|
3949
3949
|
_proto5.serialize = function serialize(outputValue) {
|
|
3950
3950
|
var enumValue = this._valueLookup.get(outputValue);
|
|
@@ -4523,8 +4523,8 @@ var require_scalars = __commonJS({
|
|
|
4523
4523
|
exports.specifiedScalarTypes = specifiedScalarTypes;
|
|
4524
4524
|
function isSpecifiedScalarType(type) {
|
|
4525
4525
|
return specifiedScalarTypes.some(function(_ref) {
|
|
4526
|
-
var
|
|
4527
|
-
return type.name ===
|
|
4526
|
+
var name = _ref.name;
|
|
4527
|
+
return type.name === name;
|
|
4528
4528
|
});
|
|
4529
4529
|
}
|
|
4530
4530
|
}
|
|
@@ -5205,9 +5205,9 @@ var require_introspection = __commonJS({
|
|
|
5205
5205
|
astNode: void 0
|
|
5206
5206
|
}],
|
|
5207
5207
|
resolve: function resolve2(_source, _ref8, _context, _ref9) {
|
|
5208
|
-
var
|
|
5208
|
+
var name = _ref8.name;
|
|
5209
5209
|
var schema = _ref9.schema;
|
|
5210
|
-
return schema.getType(
|
|
5210
|
+
return schema.getType(name);
|
|
5211
5211
|
},
|
|
5212
5212
|
isDeprecated: false,
|
|
5213
5213
|
deprecationReason: void 0,
|
|
@@ -5234,8 +5234,8 @@ var require_introspection = __commonJS({
|
|
|
5234
5234
|
exports.introspectionTypes = introspectionTypes;
|
|
5235
5235
|
function isIntrospectionType(type) {
|
|
5236
5236
|
return introspectionTypes.some(function(_ref11) {
|
|
5237
|
-
var
|
|
5238
|
-
return type.name ===
|
|
5237
|
+
var name = _ref11.name;
|
|
5238
|
+
return type.name === name;
|
|
5239
5239
|
});
|
|
5240
5240
|
}
|
|
5241
5241
|
}
|
|
@@ -5401,8 +5401,8 @@ var require_directives = __commonJS({
|
|
|
5401
5401
|
exports.specifiedDirectives = specifiedDirectives;
|
|
5402
5402
|
function isSpecifiedDirective(directive) {
|
|
5403
5403
|
return specifiedDirectives.some(function(_ref2) {
|
|
5404
|
-
var
|
|
5405
|
-
return
|
|
5404
|
+
var name = _ref2.name;
|
|
5405
|
+
return name === directive.name;
|
|
5406
5406
|
});
|
|
5407
5407
|
}
|
|
5408
5408
|
}
|
|
@@ -5559,8 +5559,8 @@ var require_schema = __commonJS({
|
|
|
5559
5559
|
_proto.getTypeMap = function getTypeMap() {
|
|
5560
5560
|
return this._typeMap;
|
|
5561
5561
|
};
|
|
5562
|
-
_proto.getType = function getType(
|
|
5563
|
-
return this.getTypeMap()[
|
|
5562
|
+
_proto.getType = function getType(name) {
|
|
5563
|
+
return this.getTypeMap()[name];
|
|
5564
5564
|
};
|
|
5565
5565
|
_proto.getPossibleTypes = function getPossibleTypes(abstractType) {
|
|
5566
5566
|
return (0, _definition.isUnionType)(abstractType) ? abstractType.getTypes() : this.getImplementations(abstractType).objects;
|
|
@@ -5602,9 +5602,9 @@ var require_schema = __commonJS({
|
|
|
5602
5602
|
_proto.getDirectives = function getDirectives() {
|
|
5603
5603
|
return this._directives;
|
|
5604
5604
|
};
|
|
5605
|
-
_proto.getDirective = function getDirective(
|
|
5605
|
+
_proto.getDirective = function getDirective(name) {
|
|
5606
5606
|
return (0, _find.default)(this.getDirectives(), function(directive) {
|
|
5607
|
-
return directive.name ===
|
|
5607
|
+
return directive.name === name;
|
|
5608
5608
|
});
|
|
5609
5609
|
};
|
|
5610
5610
|
_proto.toConfig = function toConfig() {
|
|
@@ -6314,18 +6314,18 @@ var require_TypeInfo = __commonJS({
|
|
|
6314
6314
|
}();
|
|
6315
6315
|
exports.TypeInfo = TypeInfo;
|
|
6316
6316
|
function getFieldDef(schema, parentType, fieldNode) {
|
|
6317
|
-
var
|
|
6318
|
-
if (
|
|
6317
|
+
var name = fieldNode.name.value;
|
|
6318
|
+
if (name === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === parentType) {
|
|
6319
6319
|
return _introspection.SchemaMetaFieldDef;
|
|
6320
6320
|
}
|
|
6321
|
-
if (
|
|
6321
|
+
if (name === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === parentType) {
|
|
6322
6322
|
return _introspection.TypeMetaFieldDef;
|
|
6323
6323
|
}
|
|
6324
|
-
if (
|
|
6324
|
+
if (name === _introspection.TypeNameMetaFieldDef.name && (0, _definition.isCompositeType)(parentType)) {
|
|
6325
6325
|
return _introspection.TypeNameMetaFieldDef;
|
|
6326
6326
|
}
|
|
6327
6327
|
if ((0, _definition.isObjectType)(parentType) || (0, _definition.isInterfaceType)(parentType)) {
|
|
6328
|
-
return parentType.getFields()[
|
|
6328
|
+
return parentType.getFields()[name];
|
|
6329
6329
|
}
|
|
6330
6330
|
}
|
|
6331
6331
|
function visitWithTypeInfo(typeInfo, visitor) {
|
|
@@ -6901,8 +6901,8 @@ var require_PossibleFragmentSpreadsRule = __commonJS({
|
|
|
6901
6901
|
}
|
|
6902
6902
|
};
|
|
6903
6903
|
}
|
|
6904
|
-
function getFragmentType(context,
|
|
6905
|
-
var frag = context.getFragment(
|
|
6904
|
+
function getFragmentType(context, name) {
|
|
6905
|
+
var frag = context.getFragment(name);
|
|
6906
6906
|
if (frag) {
|
|
6907
6907
|
var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), frag.typeCondition);
|
|
6908
6908
|
if ((0, _definition.isCompositeType)(type)) {
|
|
@@ -7105,22 +7105,22 @@ var require_KnownDirectivesRule = __commonJS({
|
|
|
7105
7105
|
for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {
|
|
7106
7106
|
var def = astDefinitions[_i4];
|
|
7107
7107
|
if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) {
|
|
7108
|
-
locationsMap[def.name.value] = def.locations.map(function(
|
|
7109
|
-
return
|
|
7108
|
+
locationsMap[def.name.value] = def.locations.map(function(name) {
|
|
7109
|
+
return name.value;
|
|
7110
7110
|
});
|
|
7111
7111
|
}
|
|
7112
7112
|
}
|
|
7113
7113
|
return {
|
|
7114
7114
|
Directive: function Directive(node, _key, _parent, _path, ancestors) {
|
|
7115
|
-
var
|
|
7116
|
-
var locations = locationsMap[
|
|
7115
|
+
var name = node.name.value;
|
|
7116
|
+
var locations = locationsMap[name];
|
|
7117
7117
|
if (!locations) {
|
|
7118
|
-
context.reportError(new _GraphQLError.GraphQLError('Unknown directive "@'.concat(
|
|
7118
|
+
context.reportError(new _GraphQLError.GraphQLError('Unknown directive "@'.concat(name, '".'), node));
|
|
7119
7119
|
return;
|
|
7120
7120
|
}
|
|
7121
7121
|
var candidateLocation = getDirectiveLocationForASTPath(ancestors);
|
|
7122
7122
|
if (candidateLocation && locations.indexOf(candidateLocation) === -1) {
|
|
7123
|
-
context.reportError(new _GraphQLError.GraphQLError('Directive "@'.concat(
|
|
7123
|
+
context.reportError(new _GraphQLError.GraphQLError('Directive "@'.concat(name, '" may not be used on ').concat(candidateLocation, "."), node));
|
|
7124
7124
|
}
|
|
7125
7125
|
}
|
|
7126
7126
|
};
|
|
@@ -8484,7 +8484,7 @@ var require_ValidationContext = __commonJS({
|
|
|
8484
8484
|
_proto.getDocument = function getDocument() {
|
|
8485
8485
|
return this._ast;
|
|
8486
8486
|
};
|
|
8487
|
-
_proto.getFragment = function getFragment(
|
|
8487
|
+
_proto.getFragment = function getFragment(name) {
|
|
8488
8488
|
var fragments = this._fragments;
|
|
8489
8489
|
if (!fragments) {
|
|
8490
8490
|
this._fragments = fragments = this.getDocument().definitions.reduce(function(frags, statement) {
|
|
@@ -8494,7 +8494,7 @@ var require_ValidationContext = __commonJS({
|
|
|
8494
8494
|
return frags;
|
|
8495
8495
|
}, /* @__PURE__ */ Object.create(null));
|
|
8496
8496
|
}
|
|
8497
|
-
return fragments[
|
|
8497
|
+
return fragments[name];
|
|
8498
8498
|
};
|
|
8499
8499
|
_proto.getFragmentSpreads = function getFragmentSpreads(node) {
|
|
8500
8500
|
var spreads = this._fragmentSpreads.get(node);
|
|
@@ -8791,8 +8791,8 @@ var require_promiseForObject = __commonJS({
|
|
|
8791
8791
|
exports.default = promiseForObject;
|
|
8792
8792
|
function promiseForObject(object) {
|
|
8793
8793
|
var keys = Object.keys(object);
|
|
8794
|
-
var valuesAndPromises = keys.map(function(
|
|
8795
|
-
return object[
|
|
8794
|
+
var valuesAndPromises = keys.map(function(name) {
|
|
8795
|
+
return object[name];
|
|
8796
8796
|
});
|
|
8797
8797
|
return Promise.all(valuesAndPromises).then(function(values) {
|
|
8798
8798
|
return values.reduce(function(resolvedObject, value, i) {
|
|
@@ -9203,14 +9203,14 @@ var require_values = __commonJS({
|
|
|
9203
9203
|
});
|
|
9204
9204
|
for (var _i4 = 0, _def$args2 = def.args; _i4 < _def$args2.length; _i4++) {
|
|
9205
9205
|
var argDef = _def$args2[_i4];
|
|
9206
|
-
var
|
|
9206
|
+
var name = argDef.name;
|
|
9207
9207
|
var argType = argDef.type;
|
|
9208
|
-
var argumentNode2 = argNodeMap[
|
|
9208
|
+
var argumentNode2 = argNodeMap[name];
|
|
9209
9209
|
if (!argumentNode2) {
|
|
9210
9210
|
if (argDef.defaultValue !== void 0) {
|
|
9211
|
-
coercedValues[
|
|
9211
|
+
coercedValues[name] = argDef.defaultValue;
|
|
9212
9212
|
} else if ((0, _definition.isNonNullType)(argType)) {
|
|
9213
|
-
throw new _GraphQLError.GraphQLError('Argument "'.concat(
|
|
9213
|
+
throw new _GraphQLError.GraphQLError('Argument "'.concat(name, '" of required type "').concat((0, _inspect.default)(argType), '" ') + "was not provided.", node);
|
|
9214
9214
|
}
|
|
9215
9215
|
continue;
|
|
9216
9216
|
}
|
|
@@ -9220,22 +9220,22 @@ var require_values = __commonJS({
|
|
|
9220
9220
|
var variableName = valueNode.name.value;
|
|
9221
9221
|
if (variableValues == null || !hasOwnProperty(variableValues, variableName)) {
|
|
9222
9222
|
if (argDef.defaultValue !== void 0) {
|
|
9223
|
-
coercedValues[
|
|
9223
|
+
coercedValues[name] = argDef.defaultValue;
|
|
9224
9224
|
} else if ((0, _definition.isNonNullType)(argType)) {
|
|
9225
|
-
throw new _GraphQLError.GraphQLError('Argument "'.concat(
|
|
9225
|
+
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);
|
|
9226
9226
|
}
|
|
9227
9227
|
continue;
|
|
9228
9228
|
}
|
|
9229
9229
|
isNull = variableValues[variableName] == null;
|
|
9230
9230
|
}
|
|
9231
9231
|
if (isNull && (0, _definition.isNonNullType)(argType)) {
|
|
9232
|
-
throw new _GraphQLError.GraphQLError('Argument "'.concat(
|
|
9232
|
+
throw new _GraphQLError.GraphQLError('Argument "'.concat(name, '" of non-null type "').concat((0, _inspect.default)(argType), '" ') + "must not be null.", valueNode);
|
|
9233
9233
|
}
|
|
9234
9234
|
var coercedValue = (0, _valueFromAST.valueFromAST)(valueNode, argType, variableValues);
|
|
9235
9235
|
if (coercedValue === void 0) {
|
|
9236
|
-
throw new _GraphQLError.GraphQLError('Argument "'.concat(
|
|
9236
|
+
throw new _GraphQLError.GraphQLError('Argument "'.concat(name, '" has invalid value ').concat((0, _printer.print)(valueNode), "."), valueNode);
|
|
9237
9237
|
}
|
|
9238
|
-
coercedValues[
|
|
9238
|
+
coercedValues[name] = coercedValue;
|
|
9239
9239
|
}
|
|
9240
9240
|
return coercedValues;
|
|
9241
9241
|
}
|
|
@@ -9451,11 +9451,11 @@ var require_execute = __commonJS({
|
|
|
9451
9451
|
if (!shouldIncludeNode(exeContext, selection2)) {
|
|
9452
9452
|
continue;
|
|
9453
9453
|
}
|
|
9454
|
-
var
|
|
9455
|
-
if (!fields[
|
|
9456
|
-
fields[
|
|
9454
|
+
var name = getFieldEntryKey(selection2);
|
|
9455
|
+
if (!fields[name]) {
|
|
9456
|
+
fields[name] = [];
|
|
9457
9457
|
}
|
|
9458
|
-
fields[
|
|
9458
|
+
fields[name].push(selection2);
|
|
9459
9459
|
break;
|
|
9460
9460
|
}
|
|
9461
9461
|
case _kinds.Kind.INLINE_FRAGMENT: {
|
|
@@ -11771,8 +11771,8 @@ var require_extendSchema = __commonJS({
|
|
|
11771
11771
|
for (var _i6 = 0; _i6 < typeDefs.length; _i6++) {
|
|
11772
11772
|
var _stdTypeMap$name;
|
|
11773
11773
|
var typeNode = typeDefs[_i6];
|
|
11774
|
-
var
|
|
11775
|
-
typeMap[
|
|
11774
|
+
var name = typeNode.name.value;
|
|
11775
|
+
typeMap[name] = (_stdTypeMap$name = stdTypeMap[name]) !== null && _stdTypeMap$name !== void 0 ? _stdTypeMap$name : buildType(typeNode);
|
|
11776
11776
|
}
|
|
11777
11777
|
var operationTypes = _objectSpread(_objectSpread({
|
|
11778
11778
|
query: schemaConfig.query && replaceNamedType(schemaConfig.query),
|
|
@@ -11935,10 +11935,10 @@ var require_extendSchema = __commonJS({
|
|
|
11935
11935
|
}
|
|
11936
11936
|
function getNamedType2(node) {
|
|
11937
11937
|
var _stdTypeMap$name2;
|
|
11938
|
-
var
|
|
11939
|
-
var type = (_stdTypeMap$name2 = stdTypeMap[
|
|
11938
|
+
var name2 = node.name.value;
|
|
11939
|
+
var type = (_stdTypeMap$name2 = stdTypeMap[name2]) !== null && _stdTypeMap$name2 !== void 0 ? _stdTypeMap$name2 : typeMap[name2];
|
|
11940
11940
|
if (type === void 0) {
|
|
11941
|
-
throw new Error('Unknown type: "'.concat(
|
|
11941
|
+
throw new Error('Unknown type: "'.concat(name2, '".'));
|
|
11942
11942
|
}
|
|
11943
11943
|
return type;
|
|
11944
11944
|
}
|
|
@@ -12065,15 +12065,15 @@ var require_extendSchema = __commonJS({
|
|
|
12065
12065
|
}
|
|
12066
12066
|
function buildType(astNode) {
|
|
12067
12067
|
var _typeExtensionsMap$na;
|
|
12068
|
-
var
|
|
12068
|
+
var name2 = astNode.name.value;
|
|
12069
12069
|
var description = getDescription(astNode, options);
|
|
12070
|
-
var extensionNodes = (_typeExtensionsMap$na = typeExtensionsMap[
|
|
12070
|
+
var extensionNodes = (_typeExtensionsMap$na = typeExtensionsMap[name2]) !== null && _typeExtensionsMap$na !== void 0 ? _typeExtensionsMap$na : [];
|
|
12071
12071
|
switch (astNode.kind) {
|
|
12072
12072
|
case _kinds.Kind.OBJECT_TYPE_DEFINITION: {
|
|
12073
12073
|
var extensionASTNodes = extensionNodes;
|
|
12074
12074
|
var allNodes = [astNode].concat(extensionASTNodes);
|
|
12075
12075
|
return new _definition.GraphQLObjectType({
|
|
12076
|
-
name:
|
|
12076
|
+
name: name2,
|
|
12077
12077
|
description,
|
|
12078
12078
|
interfaces: function interfaces() {
|
|
12079
12079
|
return buildInterfaces(allNodes);
|
|
@@ -12089,7 +12089,7 @@ var require_extendSchema = __commonJS({
|
|
|
12089
12089
|
var _extensionASTNodes = extensionNodes;
|
|
12090
12090
|
var _allNodes = [astNode].concat(_extensionASTNodes);
|
|
12091
12091
|
return new _definition.GraphQLInterfaceType({
|
|
12092
|
-
name:
|
|
12092
|
+
name: name2,
|
|
12093
12093
|
description,
|
|
12094
12094
|
interfaces: function interfaces() {
|
|
12095
12095
|
return buildInterfaces(_allNodes);
|
|
@@ -12105,7 +12105,7 @@ var require_extendSchema = __commonJS({
|
|
|
12105
12105
|
var _extensionASTNodes2 = extensionNodes;
|
|
12106
12106
|
var _allNodes2 = [astNode].concat(_extensionASTNodes2);
|
|
12107
12107
|
return new _definition.GraphQLEnumType({
|
|
12108
|
-
name:
|
|
12108
|
+
name: name2,
|
|
12109
12109
|
description,
|
|
12110
12110
|
values: buildEnumValueMap(_allNodes2),
|
|
12111
12111
|
astNode,
|
|
@@ -12116,7 +12116,7 @@ var require_extendSchema = __commonJS({
|
|
|
12116
12116
|
var _extensionASTNodes3 = extensionNodes;
|
|
12117
12117
|
var _allNodes3 = [astNode].concat(_extensionASTNodes3);
|
|
12118
12118
|
return new _definition.GraphQLUnionType({
|
|
12119
|
-
name:
|
|
12119
|
+
name: name2,
|
|
12120
12120
|
description,
|
|
12121
12121
|
types: function types14() {
|
|
12122
12122
|
return buildUnionTypes(_allNodes3);
|
|
@@ -12128,7 +12128,7 @@ var require_extendSchema = __commonJS({
|
|
|
12128
12128
|
case _kinds.Kind.SCALAR_TYPE_DEFINITION: {
|
|
12129
12129
|
var _extensionASTNodes4 = extensionNodes;
|
|
12130
12130
|
return new _definition.GraphQLScalarType({
|
|
12131
|
-
name:
|
|
12131
|
+
name: name2,
|
|
12132
12132
|
description,
|
|
12133
12133
|
specifiedByUrl: getSpecifiedByUrl(astNode),
|
|
12134
12134
|
astNode,
|
|
@@ -12139,7 +12139,7 @@ var require_extendSchema = __commonJS({
|
|
|
12139
12139
|
var _extensionASTNodes5 = extensionNodes;
|
|
12140
12140
|
var _allNodes4 = [astNode].concat(_extensionASTNodes5);
|
|
12141
12141
|
return new _definition.GraphQLInputObjectType({
|
|
12142
|
-
name:
|
|
12142
|
+
name: name2,
|
|
12143
12143
|
description,
|
|
12144
12144
|
fields: function fields() {
|
|
12145
12145
|
return buildInputFieldMap(_allNodes4);
|
|
@@ -13236,12 +13236,12 @@ var require_findBreakingChanges = __commonJS({
|
|
|
13236
13236
|
var removed = [];
|
|
13237
13237
|
var persisted = [];
|
|
13238
13238
|
var oldMap = (0, _keyMap.default)(oldArray, function(_ref11) {
|
|
13239
|
-
var
|
|
13240
|
-
return
|
|
13239
|
+
var name = _ref11.name;
|
|
13240
|
+
return name;
|
|
13241
13241
|
});
|
|
13242
13242
|
var newMap = (0, _keyMap.default)(newArray, function(_ref12) {
|
|
13243
|
-
var
|
|
13244
|
-
return
|
|
13243
|
+
var name = _ref12.name;
|
|
13244
|
+
return name;
|
|
13245
13245
|
});
|
|
13246
13246
|
for (var _i44 = 0; _i44 < oldArray.length; _i44++) {
|
|
13247
13247
|
var oldItem = oldArray[_i44];
|
|
@@ -15477,6 +15477,109 @@ var require_minimatch = __commonJS({
|
|
|
15477
15477
|
}
|
|
15478
15478
|
});
|
|
15479
15479
|
|
|
15480
|
+
// ../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js
|
|
15481
|
+
var require_cjs = __commonJS({
|
|
15482
|
+
"../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module) {
|
|
15483
|
+
"use strict";
|
|
15484
|
+
var isMergeableObject = function isMergeableObject2(value) {
|
|
15485
|
+
return isNonNullObject(value) && !isSpecial(value);
|
|
15486
|
+
};
|
|
15487
|
+
function isNonNullObject(value) {
|
|
15488
|
+
return !!value && typeof value === "object";
|
|
15489
|
+
}
|
|
15490
|
+
function isSpecial(value) {
|
|
15491
|
+
var stringValue = Object.prototype.toString.call(value);
|
|
15492
|
+
return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
|
|
15493
|
+
}
|
|
15494
|
+
var canUseSymbol = typeof Symbol === "function" && Symbol.for;
|
|
15495
|
+
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
|
|
15496
|
+
function isReactElement(value) {
|
|
15497
|
+
return value.$$typeof === REACT_ELEMENT_TYPE;
|
|
15498
|
+
}
|
|
15499
|
+
function emptyTarget(val) {
|
|
15500
|
+
return Array.isArray(val) ? [] : {};
|
|
15501
|
+
}
|
|
15502
|
+
function cloneUnlessOtherwiseSpecified(value, options) {
|
|
15503
|
+
return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
|
|
15504
|
+
}
|
|
15505
|
+
function defaultArrayMerge(target, source, options) {
|
|
15506
|
+
return target.concat(source).map(function(element) {
|
|
15507
|
+
return cloneUnlessOtherwiseSpecified(element, options);
|
|
15508
|
+
});
|
|
15509
|
+
}
|
|
15510
|
+
function getMergeFunction(key, options) {
|
|
15511
|
+
if (!options.customMerge) {
|
|
15512
|
+
return deepmerge;
|
|
15513
|
+
}
|
|
15514
|
+
var customMerge = options.customMerge(key);
|
|
15515
|
+
return typeof customMerge === "function" ? customMerge : deepmerge;
|
|
15516
|
+
}
|
|
15517
|
+
function getEnumerableOwnPropertySymbols(target) {
|
|
15518
|
+
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
|
|
15519
|
+
return target.propertyIsEnumerable(symbol);
|
|
15520
|
+
}) : [];
|
|
15521
|
+
}
|
|
15522
|
+
function getKeys(target) {
|
|
15523
|
+
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
|
|
15524
|
+
}
|
|
15525
|
+
function propertyIsOnObject(object, property) {
|
|
15526
|
+
try {
|
|
15527
|
+
return property in object;
|
|
15528
|
+
} catch (_) {
|
|
15529
|
+
return false;
|
|
15530
|
+
}
|
|
15531
|
+
}
|
|
15532
|
+
function propertyIsUnsafe(target, key) {
|
|
15533
|
+
return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
|
|
15534
|
+
}
|
|
15535
|
+
function mergeObject(target, source, options) {
|
|
15536
|
+
var destination = {};
|
|
15537
|
+
if (options.isMergeableObject(target)) {
|
|
15538
|
+
getKeys(target).forEach(function(key) {
|
|
15539
|
+
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
|
15540
|
+
});
|
|
15541
|
+
}
|
|
15542
|
+
getKeys(source).forEach(function(key) {
|
|
15543
|
+
if (propertyIsUnsafe(target, key)) {
|
|
15544
|
+
return;
|
|
15545
|
+
}
|
|
15546
|
+
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
|
|
15547
|
+
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
|
|
15548
|
+
} else {
|
|
15549
|
+
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
|
|
15550
|
+
}
|
|
15551
|
+
});
|
|
15552
|
+
return destination;
|
|
15553
|
+
}
|
|
15554
|
+
function deepmerge(target, source, options) {
|
|
15555
|
+
options = options || {};
|
|
15556
|
+
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
|
|
15557
|
+
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
|
|
15558
|
+
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
|
15559
|
+
var sourceIsArray = Array.isArray(source);
|
|
15560
|
+
var targetIsArray = Array.isArray(target);
|
|
15561
|
+
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
15562
|
+
if (!sourceAndTargetTypesMatch) {
|
|
15563
|
+
return cloneUnlessOtherwiseSpecified(source, options);
|
|
15564
|
+
} else if (sourceIsArray) {
|
|
15565
|
+
return options.arrayMerge(target, source, options);
|
|
15566
|
+
} else {
|
|
15567
|
+
return mergeObject(target, source, options);
|
|
15568
|
+
}
|
|
15569
|
+
}
|
|
15570
|
+
deepmerge.all = function deepmergeAll(array, options) {
|
|
15571
|
+
if (!Array.isArray(array)) {
|
|
15572
|
+
throw new Error("first argument should be an array");
|
|
15573
|
+
}
|
|
15574
|
+
return array.reduce(function(prev, next) {
|
|
15575
|
+
return deepmerge(prev, next, options);
|
|
15576
|
+
}, {});
|
|
15577
|
+
};
|
|
15578
|
+
var deepmerge_1 = deepmerge;
|
|
15579
|
+
module.exports = deepmerge_1;
|
|
15580
|
+
}
|
|
15581
|
+
});
|
|
15582
|
+
|
|
15480
15583
|
// ../../node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js
|
|
15481
15584
|
var require_universalify = __commonJS({
|
|
15482
15585
|
"../../node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js"(exports) {
|
|
@@ -19021,8 +19124,8 @@ var require_once = __commonJS({
|
|
|
19021
19124
|
f.called = true;
|
|
19022
19125
|
return f.value = fn.apply(this, arguments);
|
|
19023
19126
|
};
|
|
19024
|
-
var
|
|
19025
|
-
f.onceError =
|
|
19127
|
+
var name = fn.name || "Function wrapped with `once`";
|
|
19128
|
+
f.onceError = name + " shouldn't be called more than once";
|
|
19026
19129
|
f.called = false;
|
|
19027
19130
|
return f;
|
|
19028
19131
|
}
|
|
@@ -19932,9 +20035,9 @@ var require_errors = __commonJS({
|
|
|
19932
20035
|
E("ERR_HTTP_TRAILER_INVALID", "Trailers are invalid with this transfer encoding");
|
|
19933
20036
|
E("ERR_INDEX_OUT_OF_RANGE", "Index out of range");
|
|
19934
20037
|
E("ERR_INVALID_ARG_TYPE", invalidArgType);
|
|
19935
|
-
E("ERR_INVALID_ARRAY_LENGTH", function(
|
|
20038
|
+
E("ERR_INVALID_ARRAY_LENGTH", function(name, len, actual) {
|
|
19936
20039
|
assert.strictEqual(typeof actual, "number");
|
|
19937
|
-
return 'The array "'.concat(
|
|
20040
|
+
return 'The array "'.concat(name, '" (length ').concat(actual, ") must be of length ").concat(len, ".");
|
|
19938
20041
|
});
|
|
19939
20042
|
E("ERR_INVALID_BUFFER_SIZE", "Buffer size must be a multiple of %s");
|
|
19940
20043
|
E("ERR_INVALID_CALLBACK", "Callback must be a function");
|
|
@@ -19945,8 +20048,8 @@ var require_errors = __commonJS({
|
|
|
19945
20048
|
E("ERR_INVALID_FILE_URL_PATH", "File URL path %s");
|
|
19946
20049
|
E("ERR_INVALID_HANDLE_TYPE", "This handle type cannot be sent");
|
|
19947
20050
|
E("ERR_INVALID_IP_ADDRESS", "Invalid IP address: %s");
|
|
19948
|
-
E("ERR_INVALID_OPT_VALUE", function(
|
|
19949
|
-
return 'The value "'.concat(String(value), '" is invalid for option "').concat(
|
|
20051
|
+
E("ERR_INVALID_OPT_VALUE", function(name, value) {
|
|
20052
|
+
return 'The value "'.concat(String(value), '" is invalid for option "').concat(name, '"');
|
|
19950
20053
|
});
|
|
19951
20054
|
E("ERR_INVALID_OPT_VALUE_ENCODING", function(value) {
|
|
19952
20055
|
return 'The value "'.concat(String(value), '" is invalid for option "encoding"');
|
|
@@ -19994,8 +20097,8 @@ var require_errors = __commonJS({
|
|
|
19994
20097
|
E("ERR_UNKNOWN_STDIN_TYPE", "Unknown stdin file type");
|
|
19995
20098
|
E("ERR_UNKNOWN_STREAM_TYPE", "Unknown stream file type");
|
|
19996
20099
|
E("ERR_V8BREAKITERATOR", "Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl");
|
|
19997
|
-
function invalidArgType(
|
|
19998
|
-
assert(
|
|
20100
|
+
function invalidArgType(name, expected, actual) {
|
|
20101
|
+
assert(name, "name is required");
|
|
19999
20102
|
var determiner;
|
|
20000
20103
|
if (expected.includes("not ")) {
|
|
20001
20104
|
determiner = "must not be";
|
|
@@ -20004,16 +20107,16 @@ var require_errors = __commonJS({
|
|
|
20004
20107
|
determiner = "must be";
|
|
20005
20108
|
}
|
|
20006
20109
|
var msg;
|
|
20007
|
-
if (Array.isArray(
|
|
20008
|
-
var names =
|
|
20110
|
+
if (Array.isArray(name)) {
|
|
20111
|
+
var names = name.map(function(val) {
|
|
20009
20112
|
return '"'.concat(val, '"');
|
|
20010
20113
|
}).join(", ");
|
|
20011
20114
|
msg = "The ".concat(names, " arguments ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
20012
|
-
} else if (
|
|
20013
|
-
msg = "The ".concat(
|
|
20115
|
+
} else if (name.includes(" argument")) {
|
|
20116
|
+
msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
20014
20117
|
} else {
|
|
20015
|
-
var type =
|
|
20016
|
-
msg = 'The "'.concat(
|
|
20118
|
+
var type = name.includes(".") ? "property" : "argument";
|
|
20119
|
+
msg = 'The "'.concat(name, '" ').concat(type, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
20017
20120
|
}
|
|
20018
20121
|
if (arguments.length >= 3) {
|
|
20019
20122
|
msg += ". Received type ".concat(actual !== null ? typeof actual : "null");
|
|
@@ -20065,11 +20168,11 @@ var require_errors = __commonJS({
|
|
|
20065
20168
|
return "of ".concat(thing, " ").concat(String(expected));
|
|
20066
20169
|
}
|
|
20067
20170
|
}
|
|
20068
|
-
function bufferOutOfBounds(
|
|
20171
|
+
function bufferOutOfBounds(name, isWriting) {
|
|
20069
20172
|
if (isWriting) {
|
|
20070
20173
|
return "Attempt to write outside buffer bounds";
|
|
20071
20174
|
} else {
|
|
20072
|
-
return '"'.concat(
|
|
20175
|
+
return '"'.concat(name, '" is outside of buffer bounds');
|
|
20073
20176
|
}
|
|
20074
20177
|
}
|
|
20075
20178
|
}
|
|
@@ -20467,7 +20570,7 @@ var require_node = __commonJS({
|
|
|
20467
20570
|
exports.Node = Node;
|
|
20468
20571
|
var Link = function(_super) {
|
|
20469
20572
|
__extends(Link2, _super);
|
|
20470
|
-
function Link2(vol2, parent,
|
|
20573
|
+
function Link2(vol2, parent, name) {
|
|
20471
20574
|
var _this = _super.call(this) || this;
|
|
20472
20575
|
_this.children = {};
|
|
20473
20576
|
_this._steps = [];
|
|
@@ -20475,7 +20578,7 @@ var require_node = __commonJS({
|
|
|
20475
20578
|
_this.length = 0;
|
|
20476
20579
|
_this.vol = vol2;
|
|
20477
20580
|
_this.parent = parent;
|
|
20478
|
-
_this.name =
|
|
20581
|
+
_this.name = name;
|
|
20479
20582
|
_this.syncSteps();
|
|
20480
20583
|
return _this;
|
|
20481
20584
|
}
|
|
@@ -20500,22 +20603,22 @@ var require_node = __commonJS({
|
|
|
20500
20603
|
Link2.prototype.getNode = function() {
|
|
20501
20604
|
return this.node;
|
|
20502
20605
|
};
|
|
20503
|
-
Link2.prototype.createChild = function(
|
|
20606
|
+
Link2.prototype.createChild = function(name, node) {
|
|
20504
20607
|
if (node === void 0) {
|
|
20505
20608
|
node = this.vol.createNode();
|
|
20506
20609
|
}
|
|
20507
|
-
var link = new Link2(this.vol, this,
|
|
20610
|
+
var link = new Link2(this.vol, this, name);
|
|
20508
20611
|
link.setNode(node);
|
|
20509
20612
|
if (node.isDirectory()) {
|
|
20510
20613
|
}
|
|
20511
|
-
this.setChild(
|
|
20614
|
+
this.setChild(name, link);
|
|
20512
20615
|
return link;
|
|
20513
20616
|
};
|
|
20514
|
-
Link2.prototype.setChild = function(
|
|
20617
|
+
Link2.prototype.setChild = function(name, link) {
|
|
20515
20618
|
if (link === void 0) {
|
|
20516
|
-
link = new Link2(this.vol, this,
|
|
20619
|
+
link = new Link2(this.vol, this, name);
|
|
20517
20620
|
}
|
|
20518
|
-
this.children[
|
|
20621
|
+
this.children[name] = link;
|
|
20519
20622
|
link.parent = this;
|
|
20520
20623
|
this.length++;
|
|
20521
20624
|
this.emit("child:add", link, this);
|
|
@@ -20526,9 +20629,9 @@ var require_node = __commonJS({
|
|
|
20526
20629
|
this.length--;
|
|
20527
20630
|
this.emit("child:delete", link, this);
|
|
20528
20631
|
};
|
|
20529
|
-
Link2.prototype.getChild = function(
|
|
20530
|
-
if (Object.hasOwnProperty.call(this.children,
|
|
20531
|
-
return this.children[
|
|
20632
|
+
Link2.prototype.getChild = function(name) {
|
|
20633
|
+
if (Object.hasOwnProperty.call(this.children, name)) {
|
|
20634
|
+
return this.children[name];
|
|
20532
20635
|
}
|
|
20533
20636
|
};
|
|
20534
20637
|
Link2.prototype.getPath = function() {
|
|
@@ -21417,17 +21520,17 @@ var require_volume = __commonJS({
|
|
|
21417
21520
|
enumerable: false,
|
|
21418
21521
|
configurable: true
|
|
21419
21522
|
});
|
|
21420
|
-
Volume2.prototype.createLink = function(parent,
|
|
21523
|
+
Volume2.prototype.createLink = function(parent, name, isDirectory, perm) {
|
|
21421
21524
|
if (isDirectory === void 0) {
|
|
21422
21525
|
isDirectory = false;
|
|
21423
21526
|
}
|
|
21424
21527
|
if (!parent) {
|
|
21425
21528
|
return new this.props.Link(this, null, "");
|
|
21426
21529
|
}
|
|
21427
|
-
if (!
|
|
21530
|
+
if (!name) {
|
|
21428
21531
|
throw new Error("createLink: name cannot be empty");
|
|
21429
21532
|
}
|
|
21430
|
-
return parent.createChild(
|
|
21533
|
+
return parent.createChild(name, this.createNode(isDirectory, perm));
|
|
21431
21534
|
};
|
|
21432
21535
|
Volume2.prototype.deleteLink = function(link) {
|
|
21433
21536
|
var parent = link.parent;
|
|
@@ -21977,12 +22080,12 @@ var require_volume = __commonJS({
|
|
|
21977
22080
|
var dir2 = this.getLinkParent(steps2);
|
|
21978
22081
|
if (!dir2)
|
|
21979
22082
|
throw createError(ENOENT, "link", filename1, filename2);
|
|
21980
|
-
var
|
|
21981
|
-
if (dir2.getChild(
|
|
22083
|
+
var name = steps2[steps2.length - 1];
|
|
22084
|
+
if (dir2.getChild(name))
|
|
21982
22085
|
throw createError(EEXIST, "link", filename1, filename2);
|
|
21983
22086
|
var node = link1.getNode();
|
|
21984
22087
|
node.nlink++;
|
|
21985
|
-
dir2.createChild(
|
|
22088
|
+
dir2.createChild(name, node);
|
|
21986
22089
|
};
|
|
21987
22090
|
Volume2.prototype.copyFileBase = function(src, dest, flags) {
|
|
21988
22091
|
var buf = this.readFileSync(src);
|
|
@@ -22053,10 +22156,10 @@ var require_volume = __commonJS({
|
|
|
22053
22156
|
var dirLink = this.getLinkParent(pathSteps);
|
|
22054
22157
|
if (!dirLink)
|
|
22055
22158
|
throw createError(ENOENT, "symlink", targetFilename, pathFilename);
|
|
22056
|
-
var
|
|
22057
|
-
if (dirLink.getChild(
|
|
22159
|
+
var name = pathSteps[pathSteps.length - 1];
|
|
22160
|
+
if (dirLink.getChild(name))
|
|
22058
22161
|
throw createError(EEXIST, "symlink", targetFilename, pathFilename);
|
|
22059
|
-
var symlink = dirLink.createChild(
|
|
22162
|
+
var symlink = dirLink.createChild(name);
|
|
22060
22163
|
symlink.getNode().makeSymlink(filenameToSteps(targetFilename));
|
|
22061
22164
|
return symlink;
|
|
22062
22165
|
};
|
|
@@ -22162,9 +22265,9 @@ var require_volume = __commonJS({
|
|
|
22162
22265
|
if (oldLinkParent) {
|
|
22163
22266
|
oldLinkParent.deleteChild(link);
|
|
22164
22267
|
}
|
|
22165
|
-
var
|
|
22166
|
-
link.name =
|
|
22167
|
-
link.steps = __spreadArray(__spreadArray([], newPathDirLink.steps, true), [
|
|
22268
|
+
var name = newPathSteps[newPathSteps.length - 1];
|
|
22269
|
+
link.name = name;
|
|
22270
|
+
link.steps = __spreadArray(__spreadArray([], newPathDirLink.steps, true), [name], false);
|
|
22168
22271
|
newPathDirLink.setChild(link.getName(), link);
|
|
22169
22272
|
};
|
|
22170
22273
|
Volume2.prototype.renameSync = function(oldPath, newPath) {
|
|
@@ -22383,10 +22486,10 @@ var require_volume = __commonJS({
|
|
|
22383
22486
|
throw createError(EEXIST, "mkdir", filename);
|
|
22384
22487
|
}
|
|
22385
22488
|
var dir = this.getLinkParentAsDirOrThrow(filename, "mkdir");
|
|
22386
|
-
var
|
|
22387
|
-
if (dir.getChild(
|
|
22489
|
+
var name = steps[steps.length - 1];
|
|
22490
|
+
if (dir.getChild(name))
|
|
22388
22491
|
throw createError(EEXIST, "mkdir", filename);
|
|
22389
|
-
dir.createChild(
|
|
22492
|
+
dir.createChild(name, this.createNode(true, modeNum));
|
|
22390
22493
|
};
|
|
22391
22494
|
Volume2.prototype.mkdirpBase = function(filename, modeNum) {
|
|
22392
22495
|
var fullPath = resolve2(filename);
|
|
@@ -23356,10 +23459,10 @@ var require_lib3 = __commonJS({
|
|
|
23356
23459
|
MissingSemicolon: "Missing semicolon.",
|
|
23357
23460
|
MissingPlugin: ({
|
|
23358
23461
|
missingPlugin
|
|
23359
|
-
}) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map((
|
|
23462
|
+
}) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map((name) => JSON.stringify(name)).join(", ")}.`,
|
|
23360
23463
|
MissingOneOfPlugins: ({
|
|
23361
23464
|
missingPlugin
|
|
23362
|
-
}) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map((
|
|
23465
|
+
}) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map((name) => JSON.stringify(name)).join(", ")}.`,
|
|
23363
23466
|
MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.",
|
|
23364
23467
|
MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.",
|
|
23365
23468
|
ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.",
|
|
@@ -23677,10 +23780,10 @@ var require_lib3 = __commonJS({
|
|
|
23677
23780
|
return this.convertPrivateNameToPrivateIdentifier(node);
|
|
23678
23781
|
}
|
|
23679
23782
|
convertPrivateNameToPrivateIdentifier(node) {
|
|
23680
|
-
const
|
|
23783
|
+
const name = super.getPrivateNameSV(node);
|
|
23681
23784
|
node = node;
|
|
23682
23785
|
delete node.id;
|
|
23683
|
-
node.name =
|
|
23786
|
+
node.name = name;
|
|
23684
23787
|
node.type = "PrivateIdentifier";
|
|
23685
23788
|
return node;
|
|
23686
23789
|
}
|
|
@@ -23953,14 +24056,14 @@ var require_lib3 = __commonJS({
|
|
|
23953
24056
|
}
|
|
23954
24057
|
};
|
|
23955
24058
|
var keywords$1 = /* @__PURE__ */ new Map();
|
|
23956
|
-
function createKeyword(
|
|
23957
|
-
options.keyword =
|
|
23958
|
-
const token = createToken(
|
|
23959
|
-
keywords$1.set(
|
|
24059
|
+
function createKeyword(name, options = {}) {
|
|
24060
|
+
options.keyword = name;
|
|
24061
|
+
const token = createToken(name, options);
|
|
24062
|
+
keywords$1.set(name, token);
|
|
23960
24063
|
return token;
|
|
23961
24064
|
}
|
|
23962
|
-
function createBinop(
|
|
23963
|
-
return createToken(
|
|
24065
|
+
function createBinop(name, binop) {
|
|
24066
|
+
return createToken(name, {
|
|
23964
24067
|
beforeExpr,
|
|
23965
24068
|
binop
|
|
23966
24069
|
});
|
|
@@ -23972,22 +24075,22 @@ var require_lib3 = __commonJS({
|
|
|
23972
24075
|
var tokenBeforeExprs = [];
|
|
23973
24076
|
var tokenStartsExprs = [];
|
|
23974
24077
|
var tokenPrefixes = [];
|
|
23975
|
-
function createToken(
|
|
24078
|
+
function createToken(name, options = {}) {
|
|
23976
24079
|
var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix;
|
|
23977
24080
|
++tokenTypeCounter;
|
|
23978
|
-
tokenLabels.push(
|
|
24081
|
+
tokenLabels.push(name);
|
|
23979
24082
|
tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1);
|
|
23980
24083
|
tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false);
|
|
23981
24084
|
tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false);
|
|
23982
24085
|
tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false);
|
|
23983
|
-
tokenTypes.push(new ExportedTokenType(
|
|
24086
|
+
tokenTypes.push(new ExportedTokenType(name, options));
|
|
23984
24087
|
return tokenTypeCounter;
|
|
23985
24088
|
}
|
|
23986
|
-
function createKeywordLike(
|
|
24089
|
+
function createKeywordLike(name, options = {}) {
|
|
23987
24090
|
var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2;
|
|
23988
24091
|
++tokenTypeCounter;
|
|
23989
|
-
keywords$1.set(
|
|
23990
|
-
tokenLabels.push(
|
|
24092
|
+
keywords$1.set(name, tokenTypeCounter);
|
|
24093
|
+
tokenLabels.push(name);
|
|
23991
24094
|
tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1);
|
|
23992
24095
|
tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false);
|
|
23993
24096
|
tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false);
|
|
@@ -24706,63 +24809,63 @@ var require_lib3 = __commonJS({
|
|
|
24706
24809
|
treatFunctionsAsVarInScope(scope) {
|
|
24707
24810
|
return !!(scope.flags & (SCOPE_FUNCTION | SCOPE_STATIC_BLOCK) || !this.parser.inModule && scope.flags & SCOPE_PROGRAM);
|
|
24708
24811
|
}
|
|
24709
|
-
declareName(
|
|
24812
|
+
declareName(name, bindingType, loc) {
|
|
24710
24813
|
let scope = this.currentScope();
|
|
24711
24814
|
if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) {
|
|
24712
|
-
this.checkRedeclarationInScope(scope,
|
|
24815
|
+
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
24713
24816
|
if (bindingType & BIND_SCOPE_FUNCTION) {
|
|
24714
|
-
scope.functions.add(
|
|
24817
|
+
scope.functions.add(name);
|
|
24715
24818
|
} else {
|
|
24716
|
-
scope.lexical.add(
|
|
24819
|
+
scope.lexical.add(name);
|
|
24717
24820
|
}
|
|
24718
24821
|
if (bindingType & BIND_SCOPE_LEXICAL) {
|
|
24719
|
-
this.maybeExportDefined(scope,
|
|
24822
|
+
this.maybeExportDefined(scope, name);
|
|
24720
24823
|
}
|
|
24721
24824
|
} else if (bindingType & BIND_SCOPE_VAR) {
|
|
24722
24825
|
for (let i = this.scopeStack.length - 1; i >= 0; --i) {
|
|
24723
24826
|
scope = this.scopeStack[i];
|
|
24724
|
-
this.checkRedeclarationInScope(scope,
|
|
24725
|
-
scope.var.add(
|
|
24726
|
-
this.maybeExportDefined(scope,
|
|
24827
|
+
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
24828
|
+
scope.var.add(name);
|
|
24829
|
+
this.maybeExportDefined(scope, name);
|
|
24727
24830
|
if (scope.flags & SCOPE_VAR)
|
|
24728
24831
|
break;
|
|
24729
24832
|
}
|
|
24730
24833
|
}
|
|
24731
24834
|
if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) {
|
|
24732
|
-
this.undefinedExports.delete(
|
|
24835
|
+
this.undefinedExports.delete(name);
|
|
24733
24836
|
}
|
|
24734
24837
|
}
|
|
24735
|
-
maybeExportDefined(scope,
|
|
24838
|
+
maybeExportDefined(scope, name) {
|
|
24736
24839
|
if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) {
|
|
24737
|
-
this.undefinedExports.delete(
|
|
24840
|
+
this.undefinedExports.delete(name);
|
|
24738
24841
|
}
|
|
24739
24842
|
}
|
|
24740
|
-
checkRedeclarationInScope(scope,
|
|
24741
|
-
if (this.isRedeclaredInScope(scope,
|
|
24843
|
+
checkRedeclarationInScope(scope, name, bindingType, loc) {
|
|
24844
|
+
if (this.isRedeclaredInScope(scope, name, bindingType)) {
|
|
24742
24845
|
this.parser.raise(Errors.VarRedeclaration, {
|
|
24743
24846
|
at: loc,
|
|
24744
|
-
identifierName:
|
|
24847
|
+
identifierName: name
|
|
24745
24848
|
});
|
|
24746
24849
|
}
|
|
24747
24850
|
}
|
|
24748
|
-
isRedeclaredInScope(scope,
|
|
24851
|
+
isRedeclaredInScope(scope, name, bindingType) {
|
|
24749
24852
|
if (!(bindingType & BIND_KIND_VALUE))
|
|
24750
24853
|
return false;
|
|
24751
24854
|
if (bindingType & BIND_SCOPE_LEXICAL) {
|
|
24752
|
-
return scope.lexical.has(
|
|
24855
|
+
return scope.lexical.has(name) || scope.functions.has(name) || scope.var.has(name);
|
|
24753
24856
|
}
|
|
24754
24857
|
if (bindingType & BIND_SCOPE_FUNCTION) {
|
|
24755
|
-
return scope.lexical.has(
|
|
24858
|
+
return scope.lexical.has(name) || !this.treatFunctionsAsVarInScope(scope) && scope.var.has(name);
|
|
24756
24859
|
}
|
|
24757
|
-
return scope.lexical.has(
|
|
24860
|
+
return scope.lexical.has(name) && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical.values().next().value === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name);
|
|
24758
24861
|
}
|
|
24759
24862
|
checkLocalExport(id) {
|
|
24760
24863
|
const {
|
|
24761
|
-
name
|
|
24864
|
+
name
|
|
24762
24865
|
} = id;
|
|
24763
24866
|
const topLevelScope = this.scopeStack[0];
|
|
24764
|
-
if (!topLevelScope.lexical.has(
|
|
24765
|
-
this.undefinedExports.set(
|
|
24867
|
+
if (!topLevelScope.lexical.has(name) && !topLevelScope.var.has(name) && !topLevelScope.functions.has(name)) {
|
|
24868
|
+
this.undefinedExports.set(name, id.loc.start);
|
|
24766
24869
|
}
|
|
24767
24870
|
}
|
|
24768
24871
|
currentScope() {
|
|
@@ -24799,21 +24902,21 @@ var require_lib3 = __commonJS({
|
|
|
24799
24902
|
createScope(flags) {
|
|
24800
24903
|
return new FlowScope(flags);
|
|
24801
24904
|
}
|
|
24802
|
-
declareName(
|
|
24905
|
+
declareName(name, bindingType, loc) {
|
|
24803
24906
|
const scope = this.currentScope();
|
|
24804
24907
|
if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {
|
|
24805
|
-
this.checkRedeclarationInScope(scope,
|
|
24806
|
-
this.maybeExportDefined(scope,
|
|
24807
|
-
scope.declareFunctions.add(
|
|
24908
|
+
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
24909
|
+
this.maybeExportDefined(scope, name);
|
|
24910
|
+
scope.declareFunctions.add(name);
|
|
24808
24911
|
return;
|
|
24809
24912
|
}
|
|
24810
|
-
super.declareName(
|
|
24913
|
+
super.declareName(name, bindingType, loc);
|
|
24811
24914
|
}
|
|
24812
|
-
isRedeclaredInScope(scope,
|
|
24813
|
-
if (super.isRedeclaredInScope(scope,
|
|
24915
|
+
isRedeclaredInScope(scope, name, bindingType) {
|
|
24916
|
+
if (super.isRedeclaredInScope(scope, name, bindingType))
|
|
24814
24917
|
return true;
|
|
24815
24918
|
if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {
|
|
24816
|
-
return !scope.declareFunctions.has(
|
|
24919
|
+
return !scope.declareFunctions.has(name) && (scope.lexical.has(name) || scope.functions.has(name));
|
|
24817
24920
|
}
|
|
24818
24921
|
return false;
|
|
24819
24922
|
}
|
|
@@ -24845,9 +24948,9 @@ var require_lib3 = __commonJS({
|
|
|
24845
24948
|
return true;
|
|
24846
24949
|
}
|
|
24847
24950
|
}
|
|
24848
|
-
getPluginOption(
|
|
24951
|
+
getPluginOption(plugin2, name) {
|
|
24849
24952
|
var _this$plugins$get;
|
|
24850
|
-
return (_this$plugins$get = this.plugins.get(
|
|
24953
|
+
return (_this$plugins$get = this.plugins.get(plugin2)) == null ? void 0 : _this$plugins$get[name];
|
|
24851
24954
|
}
|
|
24852
24955
|
};
|
|
24853
24956
|
function setTrailingComments(node, comments) {
|
|
@@ -26524,7 +26627,7 @@ var require_lib3 = __commonJS({
|
|
|
26524
26627
|
});
|
|
26525
26628
|
}
|
|
26526
26629
|
expectOnePlugin(pluginNames) {
|
|
26527
|
-
if (!pluginNames.some((
|
|
26630
|
+
if (!pluginNames.some((name) => this.hasPlugin(name))) {
|
|
26528
26631
|
throw this.raise(Errors.MissingOneOfPlugins, {
|
|
26529
26632
|
at: this.state.startLoc,
|
|
26530
26633
|
missingPlugin: pluginNames
|
|
@@ -26562,28 +26665,28 @@ var require_lib3 = __commonJS({
|
|
|
26562
26665
|
exit() {
|
|
26563
26666
|
const oldClassScope = this.stack.pop();
|
|
26564
26667
|
const current = this.current();
|
|
26565
|
-
for (const [
|
|
26668
|
+
for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) {
|
|
26566
26669
|
if (current) {
|
|
26567
|
-
if (!current.undefinedPrivateNames.has(
|
|
26568
|
-
current.undefinedPrivateNames.set(
|
|
26670
|
+
if (!current.undefinedPrivateNames.has(name)) {
|
|
26671
|
+
current.undefinedPrivateNames.set(name, loc);
|
|
26569
26672
|
}
|
|
26570
26673
|
} else {
|
|
26571
26674
|
this.parser.raise(Errors.InvalidPrivateFieldResolution, {
|
|
26572
26675
|
at: loc,
|
|
26573
|
-
identifierName:
|
|
26676
|
+
identifierName: name
|
|
26574
26677
|
});
|
|
26575
26678
|
}
|
|
26576
26679
|
}
|
|
26577
26680
|
}
|
|
26578
|
-
declarePrivateName(
|
|
26681
|
+
declarePrivateName(name, elementType, loc) {
|
|
26579
26682
|
const {
|
|
26580
26683
|
privateNames,
|
|
26581
26684
|
loneAccessors,
|
|
26582
26685
|
undefinedPrivateNames
|
|
26583
26686
|
} = this.current();
|
|
26584
|
-
let redefined = privateNames.has(
|
|
26687
|
+
let redefined = privateNames.has(name);
|
|
26585
26688
|
if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) {
|
|
26586
|
-
const accessor = redefined && loneAccessors.get(
|
|
26689
|
+
const accessor = redefined && loneAccessors.get(name);
|
|
26587
26690
|
if (accessor) {
|
|
26588
26691
|
const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC;
|
|
26589
26692
|
const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC;
|
|
@@ -26591,32 +26694,32 @@ var require_lib3 = __commonJS({
|
|
|
26591
26694
|
const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR;
|
|
26592
26695
|
redefined = oldKind === newKind || oldStatic !== newStatic;
|
|
26593
26696
|
if (!redefined)
|
|
26594
|
-
loneAccessors.delete(
|
|
26697
|
+
loneAccessors.delete(name);
|
|
26595
26698
|
} else if (!redefined) {
|
|
26596
|
-
loneAccessors.set(
|
|
26699
|
+
loneAccessors.set(name, elementType);
|
|
26597
26700
|
}
|
|
26598
26701
|
}
|
|
26599
26702
|
if (redefined) {
|
|
26600
26703
|
this.parser.raise(Errors.PrivateNameRedeclaration, {
|
|
26601
26704
|
at: loc,
|
|
26602
|
-
identifierName:
|
|
26705
|
+
identifierName: name
|
|
26603
26706
|
});
|
|
26604
26707
|
}
|
|
26605
|
-
privateNames.add(
|
|
26606
|
-
undefinedPrivateNames.delete(
|
|
26708
|
+
privateNames.add(name);
|
|
26709
|
+
undefinedPrivateNames.delete(name);
|
|
26607
26710
|
}
|
|
26608
|
-
usePrivateName(
|
|
26711
|
+
usePrivateName(name, loc) {
|
|
26609
26712
|
let classScope;
|
|
26610
26713
|
for (classScope of this.stack) {
|
|
26611
|
-
if (classScope.privateNames.has(
|
|
26714
|
+
if (classScope.privateNames.has(name))
|
|
26612
26715
|
return;
|
|
26613
26716
|
}
|
|
26614
26717
|
if (classScope) {
|
|
26615
|
-
classScope.undefinedPrivateNames.set(
|
|
26718
|
+
classScope.undefinedPrivateNames.set(name, loc);
|
|
26616
26719
|
} else {
|
|
26617
26720
|
this.parser.raise(Errors.InvalidPrivateFieldResolution, {
|
|
26618
26721
|
at: loc,
|
|
26619
|
-
identifierName:
|
|
26722
|
+
identifierName: name
|
|
26620
26723
|
});
|
|
26621
26724
|
}
|
|
26622
26725
|
}
|
|
@@ -26806,17 +26909,17 @@ var require_lib3 = __commonJS({
|
|
|
26806
26909
|
isContextual(token) {
|
|
26807
26910
|
return this.state.type === token && !this.state.containsEsc;
|
|
26808
26911
|
}
|
|
26809
|
-
isUnparsedContextual(nameStart,
|
|
26810
|
-
const nameEnd = nameStart +
|
|
26811
|
-
if (this.input.slice(nameStart, nameEnd) ===
|
|
26912
|
+
isUnparsedContextual(nameStart, name) {
|
|
26913
|
+
const nameEnd = nameStart + name.length;
|
|
26914
|
+
if (this.input.slice(nameStart, nameEnd) === name) {
|
|
26812
26915
|
const nextCh = this.input.charCodeAt(nameEnd);
|
|
26813
26916
|
return !(isIdentifierChar(nextCh) || (nextCh & 64512) === 55296);
|
|
26814
26917
|
}
|
|
26815
26918
|
return false;
|
|
26816
26919
|
}
|
|
26817
|
-
isLookaheadContextual(
|
|
26920
|
+
isLookaheadContextual(name) {
|
|
26818
26921
|
const next = this.nextTokenStart();
|
|
26819
|
-
return this.isUnparsedContextual(next,
|
|
26922
|
+
return this.isUnparsedContextual(next, name);
|
|
26820
26923
|
}
|
|
26821
26924
|
eatContextual(token) {
|
|
26822
26925
|
if (this.isContextual(token)) {
|
|
@@ -27051,7 +27154,7 @@ var require_lib3 = __commonJS({
|
|
|
27051
27154
|
loc,
|
|
27052
27155
|
range,
|
|
27053
27156
|
extra,
|
|
27054
|
-
name
|
|
27157
|
+
name
|
|
27055
27158
|
} = node;
|
|
27056
27159
|
const cloned = Object.create(NodePrototype);
|
|
27057
27160
|
cloned.type = type;
|
|
@@ -27060,7 +27163,7 @@ var require_lib3 = __commonJS({
|
|
|
27060
27163
|
cloned.loc = loc;
|
|
27061
27164
|
cloned.range = range;
|
|
27062
27165
|
cloned.extra = extra;
|
|
27063
|
-
cloned.name =
|
|
27166
|
+
cloned.name = name;
|
|
27064
27167
|
if (type === "Placeholder") {
|
|
27065
27168
|
cloned.expectedNode = node.expectedNode;
|
|
27066
27169
|
}
|
|
@@ -28020,7 +28123,7 @@ var require_lib3 = __commonJS({
|
|
|
28020
28123
|
return this.finishNode(node, "TupleTypeAnnotation");
|
|
28021
28124
|
}
|
|
28022
28125
|
flowParseFunctionTypeParam(first) {
|
|
28023
|
-
let
|
|
28126
|
+
let name = null;
|
|
28024
28127
|
let optional = false;
|
|
28025
28128
|
let typeAnnotation = null;
|
|
28026
28129
|
const node = this.startNode();
|
|
@@ -28032,7 +28135,7 @@ var require_lib3 = __commonJS({
|
|
|
28032
28135
|
at: node
|
|
28033
28136
|
});
|
|
28034
28137
|
}
|
|
28035
|
-
|
|
28138
|
+
name = this.parseIdentifier(isThis);
|
|
28036
28139
|
if (this.eat(17)) {
|
|
28037
28140
|
optional = true;
|
|
28038
28141
|
if (isThis) {
|
|
@@ -28045,7 +28148,7 @@ var require_lib3 = __commonJS({
|
|
|
28045
28148
|
} else {
|
|
28046
28149
|
typeAnnotation = this.flowParseType();
|
|
28047
28150
|
}
|
|
28048
|
-
node.name =
|
|
28151
|
+
node.name = name;
|
|
28049
28152
|
node.optional = optional;
|
|
28050
28153
|
node.typeAnnotation = typeAnnotation;
|
|
28051
28154
|
return this.finishNode(node, "FunctionTypeParam");
|
|
@@ -30057,11 +30160,11 @@ var require_lib3 = __commonJS({
|
|
|
30057
30160
|
}
|
|
30058
30161
|
jsxParseNamespacedName() {
|
|
30059
30162
|
const startLoc = this.state.startLoc;
|
|
30060
|
-
const
|
|
30163
|
+
const name = this.jsxParseIdentifier();
|
|
30061
30164
|
if (!this.eat(14))
|
|
30062
|
-
return
|
|
30165
|
+
return name;
|
|
30063
30166
|
const node = this.startNodeAt(startLoc);
|
|
30064
|
-
node.namespace =
|
|
30167
|
+
node.namespace = name;
|
|
30065
30168
|
node.name = this.jsxParseIdentifier();
|
|
30066
30169
|
return this.finishNode(node, "JSXNamespacedName");
|
|
30067
30170
|
}
|
|
@@ -30345,82 +30448,82 @@ var require_lib3 = __commonJS({
|
|
|
30345
30448
|
}
|
|
30346
30449
|
return flags;
|
|
30347
30450
|
}
|
|
30348
|
-
hasImport(
|
|
30451
|
+
hasImport(name, allowShadow) {
|
|
30349
30452
|
const len = this.importsStack.length;
|
|
30350
|
-
if (this.importsStack[len - 1].has(
|
|
30453
|
+
if (this.importsStack[len - 1].has(name)) {
|
|
30351
30454
|
return true;
|
|
30352
30455
|
}
|
|
30353
30456
|
if (!allowShadow && len > 1) {
|
|
30354
30457
|
for (let i = 0; i < len - 1; i++) {
|
|
30355
|
-
if (this.importsStack[i].has(
|
|
30458
|
+
if (this.importsStack[i].has(name))
|
|
30356
30459
|
return true;
|
|
30357
30460
|
}
|
|
30358
30461
|
}
|
|
30359
30462
|
return false;
|
|
30360
30463
|
}
|
|
30361
|
-
declareName(
|
|
30464
|
+
declareName(name, bindingType, loc) {
|
|
30362
30465
|
if (bindingType & BIND_FLAGS_TS_IMPORT) {
|
|
30363
|
-
if (this.hasImport(
|
|
30466
|
+
if (this.hasImport(name, true)) {
|
|
30364
30467
|
this.parser.raise(Errors.VarRedeclaration, {
|
|
30365
30468
|
at: loc,
|
|
30366
|
-
identifierName:
|
|
30469
|
+
identifierName: name
|
|
30367
30470
|
});
|
|
30368
30471
|
}
|
|
30369
|
-
this.importsStack[this.importsStack.length - 1].add(
|
|
30472
|
+
this.importsStack[this.importsStack.length - 1].add(name);
|
|
30370
30473
|
return;
|
|
30371
30474
|
}
|
|
30372
30475
|
const scope = this.currentScope();
|
|
30373
30476
|
if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) {
|
|
30374
|
-
this.maybeExportDefined(scope,
|
|
30375
|
-
scope.exportOnlyBindings.add(
|
|
30477
|
+
this.maybeExportDefined(scope, name);
|
|
30478
|
+
scope.exportOnlyBindings.add(name);
|
|
30376
30479
|
return;
|
|
30377
30480
|
}
|
|
30378
|
-
super.declareName(
|
|
30481
|
+
super.declareName(name, bindingType, loc);
|
|
30379
30482
|
if (bindingType & BIND_KIND_TYPE) {
|
|
30380
30483
|
if (!(bindingType & BIND_KIND_VALUE)) {
|
|
30381
|
-
this.checkRedeclarationInScope(scope,
|
|
30382
|
-
this.maybeExportDefined(scope,
|
|
30484
|
+
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
30485
|
+
this.maybeExportDefined(scope, name);
|
|
30383
30486
|
}
|
|
30384
|
-
scope.types.add(
|
|
30487
|
+
scope.types.add(name);
|
|
30385
30488
|
}
|
|
30386
30489
|
if (bindingType & BIND_FLAGS_TS_ENUM)
|
|
30387
|
-
scope.enums.add(
|
|
30490
|
+
scope.enums.add(name);
|
|
30388
30491
|
if (bindingType & BIND_FLAGS_TS_CONST_ENUM)
|
|
30389
|
-
scope.constEnums.add(
|
|
30492
|
+
scope.constEnums.add(name);
|
|
30390
30493
|
if (bindingType & BIND_FLAGS_CLASS)
|
|
30391
|
-
scope.classes.add(
|
|
30494
|
+
scope.classes.add(name);
|
|
30392
30495
|
}
|
|
30393
|
-
isRedeclaredInScope(scope,
|
|
30394
|
-
if (scope.enums.has(
|
|
30496
|
+
isRedeclaredInScope(scope, name, bindingType) {
|
|
30497
|
+
if (scope.enums.has(name)) {
|
|
30395
30498
|
if (bindingType & BIND_FLAGS_TS_ENUM) {
|
|
30396
30499
|
const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM);
|
|
30397
|
-
const wasConst = scope.constEnums.has(
|
|
30500
|
+
const wasConst = scope.constEnums.has(name);
|
|
30398
30501
|
return isConst !== wasConst;
|
|
30399
30502
|
}
|
|
30400
30503
|
return true;
|
|
30401
30504
|
}
|
|
30402
|
-
if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(
|
|
30403
|
-
if (scope.lexical.has(
|
|
30505
|
+
if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(name)) {
|
|
30506
|
+
if (scope.lexical.has(name)) {
|
|
30404
30507
|
return !!(bindingType & BIND_KIND_VALUE);
|
|
30405
30508
|
} else {
|
|
30406
30509
|
return false;
|
|
30407
30510
|
}
|
|
30408
30511
|
}
|
|
30409
|
-
if (bindingType & BIND_KIND_TYPE && scope.types.has(
|
|
30512
|
+
if (bindingType & BIND_KIND_TYPE && scope.types.has(name)) {
|
|
30410
30513
|
return true;
|
|
30411
30514
|
}
|
|
30412
|
-
return super.isRedeclaredInScope(scope,
|
|
30515
|
+
return super.isRedeclaredInScope(scope, name, bindingType);
|
|
30413
30516
|
}
|
|
30414
30517
|
checkLocalExport(id) {
|
|
30415
30518
|
const {
|
|
30416
|
-
name
|
|
30519
|
+
name
|
|
30417
30520
|
} = id;
|
|
30418
|
-
if (this.hasImport(
|
|
30521
|
+
if (this.hasImport(name))
|
|
30419
30522
|
return;
|
|
30420
30523
|
const len = this.scopeStack.length;
|
|
30421
30524
|
for (let i = len - 1; i >= 0; i--) {
|
|
30422
30525
|
const scope = this.scopeStack[i];
|
|
30423
|
-
if (scope.types.has(
|
|
30526
|
+
if (scope.types.has(name) || scope.exportOnlyBindings.has(name))
|
|
30424
30527
|
return;
|
|
30425
30528
|
}
|
|
30426
30529
|
super.checkLocalExport(id);
|
|
@@ -33215,8 +33318,8 @@ var require_lib3 = __commonJS({
|
|
|
33215
33318
|
const node = this.startNode();
|
|
33216
33319
|
this.next();
|
|
33217
33320
|
if (tokenIsIdentifier(this.state.type)) {
|
|
33218
|
-
const
|
|
33219
|
-
const identifier = this.createIdentifier(node,
|
|
33321
|
+
const name = this.parseIdentifierName();
|
|
33322
|
+
const identifier = this.createIdentifier(node, name);
|
|
33220
33323
|
identifier.type = "V8IntrinsicIdentifier";
|
|
33221
33324
|
if (this.match(10)) {
|
|
33222
33325
|
return identifier;
|
|
@@ -33250,16 +33353,16 @@ var require_lib3 = __commonJS({
|
|
|
33250
33353
|
}
|
|
33251
33354
|
});
|
|
33252
33355
|
}
|
|
33253
|
-
function getPluginOption(plugins,
|
|
33254
|
-
const
|
|
33255
|
-
if (Array.isArray(
|
|
33256
|
-
return
|
|
33356
|
+
function getPluginOption(plugins, name, option) {
|
|
33357
|
+
const plugin2 = plugins.find((plugin3) => {
|
|
33358
|
+
if (Array.isArray(plugin3)) {
|
|
33359
|
+
return plugin3[0] === name;
|
|
33257
33360
|
} else {
|
|
33258
|
-
return
|
|
33361
|
+
return plugin3 === name;
|
|
33259
33362
|
}
|
|
33260
33363
|
});
|
|
33261
|
-
if (
|
|
33262
|
-
return
|
|
33364
|
+
if (plugin2 && Array.isArray(plugin2) && plugin2.length > 1) {
|
|
33365
|
+
return plugin2[1][option];
|
|
33263
33366
|
}
|
|
33264
33367
|
return null;
|
|
33265
33368
|
}
|
|
@@ -33678,15 +33781,15 @@ var require_lib3 = __commonJS({
|
|
|
33678
33781
|
if (expression.type === "Identifier") {
|
|
33679
33782
|
this.checkIdentifier(expression, binding, strictModeChanged, allowingSloppyLetBinding);
|
|
33680
33783
|
const {
|
|
33681
|
-
name
|
|
33784
|
+
name
|
|
33682
33785
|
} = expression;
|
|
33683
33786
|
if (checkClashes) {
|
|
33684
|
-
if (checkClashes.has(
|
|
33787
|
+
if (checkClashes.has(name)) {
|
|
33685
33788
|
this.raise(Errors.ParamDupe, {
|
|
33686
33789
|
at: expression
|
|
33687
33790
|
});
|
|
33688
33791
|
} else {
|
|
33689
|
-
checkClashes.add(
|
|
33792
|
+
checkClashes.add(name);
|
|
33690
33793
|
}
|
|
33691
33794
|
}
|
|
33692
33795
|
return;
|
|
@@ -33782,8 +33885,8 @@ var require_lib3 = __commonJS({
|
|
|
33782
33885
|
return;
|
|
33783
33886
|
}
|
|
33784
33887
|
const key = prop.key;
|
|
33785
|
-
const
|
|
33786
|
-
if (
|
|
33888
|
+
const name = key.type === "Identifier" ? key.name : key.value;
|
|
33889
|
+
if (name === "__proto__") {
|
|
33787
33890
|
if (isRecord) {
|
|
33788
33891
|
this.raise(Errors.RecordNoProto, {
|
|
33789
33892
|
at: key
|
|
@@ -34634,9 +34737,9 @@ var require_lib3 = __commonJS({
|
|
|
34634
34737
|
const id = this.startNodeAt(
|
|
34635
34738
|
createPositionWithColumnOffset(this.state.startLoc, 1)
|
|
34636
34739
|
);
|
|
34637
|
-
const
|
|
34740
|
+
const name = this.state.value;
|
|
34638
34741
|
this.next();
|
|
34639
|
-
node.id = this.createIdentifier(id,
|
|
34742
|
+
node.id = this.createIdentifier(id, name);
|
|
34640
34743
|
return this.finishNode(node, "PrivateName");
|
|
34641
34744
|
}
|
|
34642
34745
|
parseFunctionOrFunctionSent() {
|
|
@@ -35313,22 +35416,22 @@ var require_lib3 = __commonJS({
|
|
|
35313
35416
|
}
|
|
35314
35417
|
parseIdentifier(liberal) {
|
|
35315
35418
|
const node = this.startNode();
|
|
35316
|
-
const
|
|
35317
|
-
return this.createIdentifier(node,
|
|
35419
|
+
const name = this.parseIdentifierName(liberal);
|
|
35420
|
+
return this.createIdentifier(node, name);
|
|
35318
35421
|
}
|
|
35319
|
-
createIdentifier(node,
|
|
35320
|
-
node.name =
|
|
35321
|
-
node.loc.identifierName =
|
|
35422
|
+
createIdentifier(node, name) {
|
|
35423
|
+
node.name = name;
|
|
35424
|
+
node.loc.identifierName = name;
|
|
35322
35425
|
return this.finishNode(node, "Identifier");
|
|
35323
35426
|
}
|
|
35324
35427
|
parseIdentifierName(liberal) {
|
|
35325
|
-
let
|
|
35428
|
+
let name;
|
|
35326
35429
|
const {
|
|
35327
35430
|
startLoc,
|
|
35328
35431
|
type
|
|
35329
35432
|
} = this.state;
|
|
35330
35433
|
if (tokenIsKeywordOrIdentifier(type)) {
|
|
35331
|
-
|
|
35434
|
+
name = this.state.value;
|
|
35332
35435
|
} else {
|
|
35333
35436
|
throw this.unexpected();
|
|
35334
35437
|
}
|
|
@@ -35338,10 +35441,10 @@ var require_lib3 = __commonJS({
|
|
|
35338
35441
|
this.replaceToken(130);
|
|
35339
35442
|
}
|
|
35340
35443
|
} else {
|
|
35341
|
-
this.checkReservedWord(
|
|
35444
|
+
this.checkReservedWord(name, startLoc, tokenIsKeyword2, false);
|
|
35342
35445
|
}
|
|
35343
35446
|
this.next();
|
|
35344
|
-
return
|
|
35447
|
+
return name;
|
|
35345
35448
|
}
|
|
35346
35449
|
checkReservedWord(word, startLoc, checkKeywords, isBinding) {
|
|
35347
35450
|
if (word.length > 10) {
|
|
@@ -37589,10 +37692,10 @@ var require_lib3 = __commonJS({
|
|
|
37589
37692
|
};
|
|
37590
37693
|
function pluginsMap(plugins) {
|
|
37591
37694
|
const pluginMap = /* @__PURE__ */ new Map();
|
|
37592
|
-
for (const
|
|
37593
|
-
const [
|
|
37594
|
-
if (!pluginMap.has(
|
|
37595
|
-
pluginMap.set(
|
|
37695
|
+
for (const plugin2 of plugins) {
|
|
37696
|
+
const [name, options] = Array.isArray(plugin2) ? plugin2 : [plugin2, {}];
|
|
37697
|
+
if (!pluginMap.has(name))
|
|
37698
|
+
pluginMap.set(name, options || {});
|
|
37596
37699
|
}
|
|
37597
37700
|
return pluginMap;
|
|
37598
37701
|
}
|
|
@@ -37654,13 +37757,13 @@ var require_lib3 = __commonJS({
|
|
|
37654
37757
|
}
|
|
37655
37758
|
var parserClassCache = {};
|
|
37656
37759
|
function getParserClass(pluginsFromOptions) {
|
|
37657
|
-
const pluginList = mixinPluginNames.filter((
|
|
37760
|
+
const pluginList = mixinPluginNames.filter((name) => hasPlugin(pluginsFromOptions, name));
|
|
37658
37761
|
const key = pluginList.join("/");
|
|
37659
37762
|
let cls = parserClassCache[key];
|
|
37660
37763
|
if (!cls) {
|
|
37661
37764
|
cls = Parser;
|
|
37662
|
-
for (const
|
|
37663
|
-
cls = mixinPlugins[
|
|
37765
|
+
for (const plugin2 of pluginList) {
|
|
37766
|
+
cls = mixinPlugins[plugin2](cls);
|
|
37664
37767
|
}
|
|
37665
37768
|
parserClassCache[key] = cls;
|
|
37666
37769
|
}
|
|
@@ -38297,9 +38400,9 @@ var require_types = __commonJS({
|
|
|
38297
38400
|
}(BaseType);
|
|
38298
38401
|
var PredicateType = function(_super) {
|
|
38299
38402
|
tslib_1.__extends(PredicateType2, _super);
|
|
38300
|
-
function PredicateType2(
|
|
38403
|
+
function PredicateType2(name, predicate) {
|
|
38301
38404
|
var _this = _super.call(this) || this;
|
|
38302
|
-
_this.name =
|
|
38405
|
+
_this.name = name;
|
|
38303
38406
|
_this.predicate = predicate;
|
|
38304
38407
|
_this.kind = "PredicateType";
|
|
38305
38408
|
return _this;
|
|
@@ -38345,8 +38448,8 @@ var require_types = __commonJS({
|
|
|
38345
38448
|
if (this.finalized !== true) {
|
|
38346
38449
|
throw new Error("" + this.typeName);
|
|
38347
38450
|
}
|
|
38348
|
-
function checkFieldByName(
|
|
38349
|
-
var field = allFields[
|
|
38451
|
+
function checkFieldByName(name) {
|
|
38452
|
+
var field = allFields[name];
|
|
38350
38453
|
var type = field.type;
|
|
38351
38454
|
var child = field.getValue(value);
|
|
38352
38455
|
return type.check(child, deep);
|
|
@@ -38381,8 +38484,8 @@ var require_types = __commonJS({
|
|
|
38381
38484
|
}();
|
|
38382
38485
|
exports.Def = Def;
|
|
38383
38486
|
var Field = function() {
|
|
38384
|
-
function Field2(
|
|
38385
|
-
this.name =
|
|
38487
|
+
function Field2(name, type, defaultFn, hidden) {
|
|
38488
|
+
this.name = name;
|
|
38386
38489
|
this.type = type;
|
|
38387
38490
|
this.defaultFn = defaultFn;
|
|
38388
38491
|
this.hidden = !!hidden;
|
|
@@ -38424,7 +38527,7 @@ var require_types = __commonJS({
|
|
|
38424
38527
|
return Type.from(type);
|
|
38425
38528
|
}));
|
|
38426
38529
|
},
|
|
38427
|
-
from: function(value,
|
|
38530
|
+
from: function(value, name) {
|
|
38428
38531
|
if (value instanceof ArrayType || value instanceof IdentityType || value instanceof ObjectType || value instanceof OrType || value instanceof PredicateType) {
|
|
38429
38532
|
return value;
|
|
38430
38533
|
}
|
|
@@ -38438,8 +38541,8 @@ var require_types = __commonJS({
|
|
|
38438
38541
|
return new ArrayType(Type.from(value[0]));
|
|
38439
38542
|
}
|
|
38440
38543
|
if (isObject.check(value)) {
|
|
38441
|
-
return new ObjectType(Object.keys(value).map(function(
|
|
38442
|
-
return new Field(
|
|
38544
|
+
return new ObjectType(Object.keys(value).map(function(name2) {
|
|
38545
|
+
return new Field(name2, Type.from(value[name2], name2));
|
|
38443
38546
|
}));
|
|
38444
38547
|
}
|
|
38445
38548
|
if (typeof value === "function") {
|
|
@@ -38447,10 +38550,10 @@ var require_types = __commonJS({
|
|
|
38447
38550
|
if (bicfIndex >= 0) {
|
|
38448
38551
|
return builtInCtorTypes[bicfIndex];
|
|
38449
38552
|
}
|
|
38450
|
-
if (typeof
|
|
38553
|
+
if (typeof name !== "string") {
|
|
38451
38554
|
throw new Error("missing name");
|
|
38452
38555
|
}
|
|
38453
|
-
return new PredicateType(
|
|
38556
|
+
return new PredicateType(name, value);
|
|
38454
38557
|
}
|
|
38455
38558
|
return new IdentityType(value);
|
|
38456
38559
|
},
|
|
@@ -38463,9 +38566,9 @@ var require_types = __commonJS({
|
|
|
38463
38566
|
};
|
|
38464
38567
|
var builtInCtorFns = [];
|
|
38465
38568
|
var builtInCtorTypes = [];
|
|
38466
|
-
function defBuiltInType(
|
|
38569
|
+
function defBuiltInType(name, example) {
|
|
38467
38570
|
var objStr = objToStr.call(example);
|
|
38468
|
-
var type = new PredicateType(
|
|
38571
|
+
var type = new PredicateType(name, function(value) {
|
|
38469
38572
|
return objToStr.call(value) === objStr;
|
|
38470
38573
|
});
|
|
38471
38574
|
if (example && typeof example.constructor === "function") {
|
|
@@ -38576,8 +38679,8 @@ var require_types = __commonJS({
|
|
|
38576
38679
|
} else if (field.defaultFn) {
|
|
38577
38680
|
value = field.defaultFn.call(built);
|
|
38578
38681
|
} else {
|
|
38579
|
-
var message = "no value or default function given for field " + JSON.stringify(param) + " of " + _this.typeName + "(" + _this.buildParams.map(function(
|
|
38580
|
-
return all[
|
|
38682
|
+
var message = "no value or default function given for field " + JSON.stringify(param) + " of " + _this.typeName + "(" + _this.buildParams.map(function(name) {
|
|
38683
|
+
return all[name];
|
|
38581
38684
|
}).join(", ") + ")";
|
|
38582
38685
|
throw new Error(message);
|
|
38583
38686
|
}
|
|
@@ -38634,12 +38737,12 @@ var require_types = __commonJS({
|
|
|
38634
38737
|
});
|
|
38635
38738
|
return this;
|
|
38636
38739
|
};
|
|
38637
|
-
DefImpl2.prototype.field = function(
|
|
38740
|
+
DefImpl2.prototype.field = function(name, type, defaultFn, hidden) {
|
|
38638
38741
|
if (this.finalized) {
|
|
38639
|
-
console.error("Ignoring attempt to redefine field " + JSON.stringify(
|
|
38742
|
+
console.error("Ignoring attempt to redefine field " + JSON.stringify(name) + " of finalized type " + JSON.stringify(this.typeName));
|
|
38640
38743
|
return this;
|
|
38641
38744
|
}
|
|
38642
|
-
this.ownFields[
|
|
38745
|
+
this.ownFields[name] = new Field(name, Type.from(type), defaultFn, hidden);
|
|
38643
38746
|
return this;
|
|
38644
38747
|
};
|
|
38645
38748
|
DefImpl2.prototype.finalize = function() {
|
|
@@ -38647,14 +38750,14 @@ var require_types = __commonJS({
|
|
|
38647
38750
|
if (!this.finalized) {
|
|
38648
38751
|
var allFields = this.allFields;
|
|
38649
38752
|
var allSupertypes = this.allSupertypes;
|
|
38650
|
-
this.baseNames.forEach(function(
|
|
38651
|
-
var def = defCache[
|
|
38753
|
+
this.baseNames.forEach(function(name) {
|
|
38754
|
+
var def = defCache[name];
|
|
38652
38755
|
if (def instanceof Def) {
|
|
38653
38756
|
def.finalize();
|
|
38654
38757
|
extend(allFields, def.allFields);
|
|
38655
38758
|
extend(allSupertypes, def.allSupertypes);
|
|
38656
38759
|
} else {
|
|
38657
|
-
var message = "unknown supertype name " + JSON.stringify(
|
|
38760
|
+
var message = "unknown supertype name " + JSON.stringify(name) + " for subtype " + JSON.stringify(_this.typeName);
|
|
38658
38761
|
throw new Error(message);
|
|
38659
38762
|
}
|
|
38660
38763
|
});
|
|
@@ -38711,13 +38814,13 @@ var require_types = __commonJS({
|
|
|
38711
38814
|
}
|
|
38712
38815
|
var builders = /* @__PURE__ */ Object.create(null);
|
|
38713
38816
|
var nodePrototype = {};
|
|
38714
|
-
function defineMethod(
|
|
38715
|
-
var old = nodePrototype[
|
|
38817
|
+
function defineMethod(name, func) {
|
|
38818
|
+
var old = nodePrototype[name];
|
|
38716
38819
|
if (isUndefined.check(func)) {
|
|
38717
|
-
delete nodePrototype[
|
|
38820
|
+
delete nodePrototype[name];
|
|
38718
38821
|
} else {
|
|
38719
38822
|
isFunction.assert(func);
|
|
38720
|
-
Object.defineProperty(nodePrototype,
|
|
38823
|
+
Object.defineProperty(nodePrototype, name, {
|
|
38721
38824
|
enumerable: true,
|
|
38722
38825
|
configurable: true,
|
|
38723
38826
|
value: func
|
|
@@ -38764,13 +38867,13 @@ var require_types = __commonJS({
|
|
|
38764
38867
|
return object && object[fieldName];
|
|
38765
38868
|
}
|
|
38766
38869
|
function eachField(object, callback, context) {
|
|
38767
|
-
getFieldNames(object).forEach(function(
|
|
38768
|
-
callback.call(this,
|
|
38870
|
+
getFieldNames(object).forEach(function(name) {
|
|
38871
|
+
callback.call(this, name, getFieldValue(object, name));
|
|
38769
38872
|
}, context);
|
|
38770
38873
|
}
|
|
38771
38874
|
function someField(object, callback, context) {
|
|
38772
|
-
return getFieldNames(object).some(function(
|
|
38773
|
-
return callback.call(this,
|
|
38875
|
+
return getFieldNames(object).some(function(name) {
|
|
38876
|
+
return callback.call(this, name, getFieldValue(object, name));
|
|
38774
38877
|
}, context);
|
|
38775
38878
|
}
|
|
38776
38879
|
function wrapExpressionBuilderWithStatement(typeName) {
|
|
@@ -38820,14 +38923,14 @@ var require_types = __commonJS({
|
|
|
38820
38923
|
list.length = to;
|
|
38821
38924
|
}
|
|
38822
38925
|
function extend(into, from) {
|
|
38823
|
-
Object.keys(from).forEach(function(
|
|
38824
|
-
into[
|
|
38926
|
+
Object.keys(from).forEach(function(name) {
|
|
38927
|
+
into[name] = from[name];
|
|
38825
38928
|
});
|
|
38826
38929
|
return into;
|
|
38827
38930
|
}
|
|
38828
38931
|
function finalize() {
|
|
38829
|
-
Object.keys(defCache).forEach(function(
|
|
38830
|
-
defCache[
|
|
38932
|
+
Object.keys(defCache).forEach(function(name) {
|
|
38933
|
+
defCache[name].finalize();
|
|
38831
38934
|
});
|
|
38832
38935
|
}
|
|
38833
38936
|
return {
|
|
@@ -38868,7 +38971,7 @@ var require_path2 = __commonJS({
|
|
|
38868
38971
|
var types14 = fork.use(types_1.default);
|
|
38869
38972
|
var isArray = types14.builtInTypes.array;
|
|
38870
38973
|
var isNumber = types14.builtInTypes.number;
|
|
38871
|
-
var Path = function Path2(value, parentPath,
|
|
38974
|
+
var Path = function Path2(value, parentPath, name) {
|
|
38872
38975
|
if (!(this instanceof Path2)) {
|
|
38873
38976
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
38874
38977
|
}
|
|
@@ -38878,28 +38981,28 @@ var require_path2 = __commonJS({
|
|
|
38878
38981
|
}
|
|
38879
38982
|
} else {
|
|
38880
38983
|
parentPath = null;
|
|
38881
|
-
|
|
38984
|
+
name = null;
|
|
38882
38985
|
}
|
|
38883
38986
|
this.value = value;
|
|
38884
38987
|
this.parentPath = parentPath;
|
|
38885
|
-
this.name =
|
|
38988
|
+
this.name = name;
|
|
38886
38989
|
this.__childCache = null;
|
|
38887
38990
|
};
|
|
38888
38991
|
var Pp = Path.prototype;
|
|
38889
38992
|
function getChildCache(path2) {
|
|
38890
38993
|
return path2.__childCache || (path2.__childCache = /* @__PURE__ */ Object.create(null));
|
|
38891
38994
|
}
|
|
38892
|
-
function getChildPath(path2,
|
|
38995
|
+
function getChildPath(path2, name) {
|
|
38893
38996
|
var cache = getChildCache(path2);
|
|
38894
|
-
var actualChildValue = path2.getValueProperty(
|
|
38895
|
-
var childPath = cache[
|
|
38896
|
-
if (!hasOwn.call(cache,
|
|
38897
|
-
childPath = cache[
|
|
38997
|
+
var actualChildValue = path2.getValueProperty(name);
|
|
38998
|
+
var childPath = cache[name];
|
|
38999
|
+
if (!hasOwn.call(cache, name) || childPath.value !== actualChildValue) {
|
|
39000
|
+
childPath = cache[name] = new path2.constructor(actualChildValue, path2, name);
|
|
38898
39001
|
}
|
|
38899
39002
|
return childPath;
|
|
38900
39003
|
}
|
|
38901
|
-
Pp.getValueProperty = function getValueProperty(
|
|
38902
|
-
return this.value[
|
|
39004
|
+
Pp.getValueProperty = function getValueProperty(name) {
|
|
39005
|
+
return this.value[name];
|
|
38903
39006
|
};
|
|
38904
39007
|
Pp.get = function get() {
|
|
38905
39008
|
var names = [];
|
|
@@ -39215,13 +39318,13 @@ var require_scope = __commonJS({
|
|
|
39215
39318
|
};
|
|
39216
39319
|
var Sp = Scope.prototype;
|
|
39217
39320
|
Sp.didScan = false;
|
|
39218
|
-
Sp.declares = function(
|
|
39321
|
+
Sp.declares = function(name) {
|
|
39219
39322
|
this.scan();
|
|
39220
|
-
return hasOwn.call(this.bindings,
|
|
39323
|
+
return hasOwn.call(this.bindings, name);
|
|
39221
39324
|
};
|
|
39222
|
-
Sp.declaresType = function(
|
|
39325
|
+
Sp.declaresType = function(name) {
|
|
39223
39326
|
this.scan();
|
|
39224
|
-
return hasOwn.call(this.types,
|
|
39327
|
+
return hasOwn.call(this.types, name);
|
|
39225
39328
|
};
|
|
39226
39329
|
Sp.declareTemporary = function(prefix) {
|
|
39227
39330
|
if (prefix) {
|
|
@@ -39237,8 +39340,8 @@ var require_scope = __commonJS({
|
|
|
39237
39340
|
while (this.declares(prefix + index)) {
|
|
39238
39341
|
++index;
|
|
39239
39342
|
}
|
|
39240
|
-
var
|
|
39241
|
-
return this.bindings[
|
|
39343
|
+
var name = prefix + index;
|
|
39344
|
+
return this.bindings[name] = types14.builders.identifier(name);
|
|
39242
39345
|
};
|
|
39243
39346
|
Sp.injectTemporary = function(identifier, init) {
|
|
39244
39347
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -39251,11 +39354,11 @@ var require_scope = __commonJS({
|
|
|
39251
39354
|
};
|
|
39252
39355
|
Sp.scan = function(force) {
|
|
39253
39356
|
if (force || !this.didScan) {
|
|
39254
|
-
for (var
|
|
39255
|
-
delete this.bindings[
|
|
39357
|
+
for (var name in this.bindings) {
|
|
39358
|
+
delete this.bindings[name];
|
|
39256
39359
|
}
|
|
39257
|
-
for (var
|
|
39258
|
-
delete this.types[
|
|
39360
|
+
for (var name in this.types) {
|
|
39361
|
+
delete this.types[name];
|
|
39259
39362
|
}
|
|
39260
39363
|
scanScope(this.path, this.bindings, this.types);
|
|
39261
39364
|
this.didScan = true;
|
|
@@ -39314,8 +39417,8 @@ var require_scope = __commonJS({
|
|
|
39314
39417
|
bindings
|
|
39315
39418
|
);
|
|
39316
39419
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
39317
|
-
types14.eachField(node, function(
|
|
39318
|
-
var childPath = path2.get(
|
|
39420
|
+
types14.eachField(node, function(name, child) {
|
|
39421
|
+
var childPath = path2.get(name);
|
|
39319
39422
|
if (!pathHasValue(childPath, child)) {
|
|
39320
39423
|
throw new Error("");
|
|
39321
39424
|
}
|
|
@@ -39412,15 +39515,15 @@ var require_scope = __commonJS({
|
|
|
39412
39515
|
types15[parameter.name] = [parameterPath];
|
|
39413
39516
|
}
|
|
39414
39517
|
}
|
|
39415
|
-
Sp.lookup = function(
|
|
39518
|
+
Sp.lookup = function(name) {
|
|
39416
39519
|
for (var scope = this; scope; scope = scope.parent)
|
|
39417
|
-
if (scope.declares(
|
|
39520
|
+
if (scope.declares(name))
|
|
39418
39521
|
break;
|
|
39419
39522
|
return scope;
|
|
39420
39523
|
};
|
|
39421
|
-
Sp.lookupType = function(
|
|
39524
|
+
Sp.lookupType = function(name) {
|
|
39422
39525
|
for (var scope = this; scope; scope = scope.parent)
|
|
39423
|
-
if (scope.declaresType(
|
|
39526
|
+
if (scope.declaresType(name))
|
|
39424
39527
|
break;
|
|
39425
39528
|
return scope;
|
|
39426
39529
|
};
|
|
@@ -39457,11 +39560,11 @@ var require_node_path = __commonJS({
|
|
|
39457
39560
|
var isArray = types14.builtInTypes.array;
|
|
39458
39561
|
var Path = fork.use(path_1.default);
|
|
39459
39562
|
var Scope = fork.use(scope_1.default);
|
|
39460
|
-
var NodePath = function NodePath2(value, parentPath,
|
|
39563
|
+
var NodePath = function NodePath2(value, parentPath, name) {
|
|
39461
39564
|
if (!(this instanceof NodePath2)) {
|
|
39462
39565
|
throw new Error("NodePath constructor cannot be invoked without 'new'");
|
|
39463
39566
|
}
|
|
39464
|
-
Path.call(this, value, parentPath,
|
|
39567
|
+
Path.call(this, value, parentPath, name);
|
|
39465
39568
|
};
|
|
39466
39569
|
var NPp = NodePath.prototype = Object.create(Path.prototype, {
|
|
39467
39570
|
constructor: {
|
|
@@ -39544,8 +39647,8 @@ var require_node_path = __commonJS({
|
|
|
39544
39647
|
}
|
|
39545
39648
|
return scope || null;
|
|
39546
39649
|
};
|
|
39547
|
-
NPp.getValueProperty = function(
|
|
39548
|
-
return types14.getFieldValue(this.value,
|
|
39650
|
+
NPp.getValueProperty = function(name) {
|
|
39651
|
+
return types14.getFieldValue(this.value, name);
|
|
39549
39652
|
};
|
|
39550
39653
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
39551
39654
|
var pp = this.parentPath;
|
|
@@ -40200,18 +40303,18 @@ var require_equiv = __commonJS({
|
|
|
40200
40303
|
var bNameCount = bNames.length;
|
|
40201
40304
|
if (aNameCount === bNameCount) {
|
|
40202
40305
|
for (var i = 0; i < aNameCount; ++i) {
|
|
40203
|
-
var
|
|
40204
|
-
var aChild = getFieldValue(a,
|
|
40205
|
-
var bChild = getFieldValue(b,
|
|
40306
|
+
var name = aNames[i];
|
|
40307
|
+
var aChild = getFieldValue(a, name);
|
|
40308
|
+
var bChild = getFieldValue(b, name);
|
|
40206
40309
|
if (problemPath) {
|
|
40207
|
-
problemPath.push(
|
|
40310
|
+
problemPath.push(name);
|
|
40208
40311
|
}
|
|
40209
40312
|
if (!areEquivalent(aChild, bChild, problemPath)) {
|
|
40210
40313
|
return false;
|
|
40211
40314
|
}
|
|
40212
40315
|
if (problemPath) {
|
|
40213
40316
|
var problemPathTail = problemPath.pop();
|
|
40214
|
-
if (problemPathTail !==
|
|
40317
|
+
if (problemPathTail !== name) {
|
|
40215
40318
|
throw new Error("" + problemPathTail);
|
|
40216
40319
|
}
|
|
40217
40320
|
}
|
|
@@ -40226,15 +40329,15 @@ var require_equiv = __commonJS({
|
|
|
40226
40329
|
seenNames[aNames[i]] = true;
|
|
40227
40330
|
}
|
|
40228
40331
|
for (i = 0; i < bNameCount; ++i) {
|
|
40229
|
-
|
|
40230
|
-
if (!hasOwn.call(seenNames,
|
|
40231
|
-
problemPath.push(
|
|
40332
|
+
name = bNames[i];
|
|
40333
|
+
if (!hasOwn.call(seenNames, name)) {
|
|
40334
|
+
problemPath.push(name);
|
|
40232
40335
|
return false;
|
|
40233
40336
|
}
|
|
40234
|
-
delete seenNames[
|
|
40337
|
+
delete seenNames[name];
|
|
40235
40338
|
}
|
|
40236
|
-
for (
|
|
40237
|
-
problemPath.push(
|
|
40339
|
+
for (name in seenNames) {
|
|
40340
|
+
problemPath.push(name);
|
|
40238
40341
|
break;
|
|
40239
40342
|
}
|
|
40240
40343
|
return false;
|
|
@@ -40291,12 +40394,12 @@ var require_fork = __commonJS({
|
|
|
40291
40394
|
function createFork() {
|
|
40292
40395
|
var used = [];
|
|
40293
40396
|
var usedResult = [];
|
|
40294
|
-
function use(
|
|
40295
|
-
var idx = used.indexOf(
|
|
40397
|
+
function use(plugin2) {
|
|
40398
|
+
var idx = used.indexOf(plugin2);
|
|
40296
40399
|
if (idx === -1) {
|
|
40297
40400
|
idx = used.length;
|
|
40298
|
-
used.push(
|
|
40299
|
-
usedResult[idx] =
|
|
40401
|
+
used.push(plugin2);
|
|
40402
|
+
usedResult[idx] = plugin2(fork);
|
|
40300
40403
|
}
|
|
40301
40404
|
return usedResult[idx];
|
|
40302
40405
|
}
|
|
@@ -42052,9 +42155,9 @@ var require_source_map_generator = __commonJS({
|
|
|
42052
42155
|
var generated = util.getArg(aArgs, "generated");
|
|
42053
42156
|
var original = util.getArg(aArgs, "original", null);
|
|
42054
42157
|
var source = util.getArg(aArgs, "source", null);
|
|
42055
|
-
var
|
|
42158
|
+
var name = util.getArg(aArgs, "name", null);
|
|
42056
42159
|
if (!this._skipValidation) {
|
|
42057
|
-
this._validateMapping(generated, original, source,
|
|
42160
|
+
this._validateMapping(generated, original, source, name);
|
|
42058
42161
|
}
|
|
42059
42162
|
if (source != null) {
|
|
42060
42163
|
source = String(source);
|
|
@@ -42062,10 +42165,10 @@ var require_source_map_generator = __commonJS({
|
|
|
42062
42165
|
this._sources.add(source);
|
|
42063
42166
|
}
|
|
42064
42167
|
}
|
|
42065
|
-
if (
|
|
42066
|
-
|
|
42067
|
-
if (!this._names.has(
|
|
42068
|
-
this._names.add(
|
|
42168
|
+
if (name != null) {
|
|
42169
|
+
name = String(name);
|
|
42170
|
+
if (!this._names.has(name)) {
|
|
42171
|
+
this._names.add(name);
|
|
42069
42172
|
}
|
|
42070
42173
|
}
|
|
42071
42174
|
this._mappings.add({
|
|
@@ -42074,7 +42177,7 @@ var require_source_map_generator = __commonJS({
|
|
|
42074
42177
|
originalLine: original != null && original.line,
|
|
42075
42178
|
originalColumn: original != null && original.column,
|
|
42076
42179
|
source,
|
|
42077
|
-
name
|
|
42180
|
+
name
|
|
42078
42181
|
});
|
|
42079
42182
|
};
|
|
42080
42183
|
SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
|
|
@@ -42135,9 +42238,9 @@ var require_source_map_generator = __commonJS({
|
|
|
42135
42238
|
if (source != null && !newSources.has(source)) {
|
|
42136
42239
|
newSources.add(source);
|
|
42137
42240
|
}
|
|
42138
|
-
var
|
|
42139
|
-
if (
|
|
42140
|
-
newNames.add(
|
|
42241
|
+
var name = mapping.name;
|
|
42242
|
+
if (name != null && !newNames.has(name)) {
|
|
42243
|
+
newNames.add(name);
|
|
42141
42244
|
}
|
|
42142
42245
|
}, this);
|
|
42143
42246
|
this._sources = newSources;
|
|
@@ -42697,15 +42800,15 @@ var require_source_map_consumer = __commonJS({
|
|
|
42697
42800
|
source = this._sources.at(source);
|
|
42698
42801
|
source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
|
|
42699
42802
|
}
|
|
42700
|
-
var
|
|
42701
|
-
if (
|
|
42702
|
-
|
|
42803
|
+
var name = util.getArg(mapping, "name", null);
|
|
42804
|
+
if (name !== null) {
|
|
42805
|
+
name = this._names.at(name);
|
|
42703
42806
|
}
|
|
42704
42807
|
return {
|
|
42705
42808
|
source,
|
|
42706
42809
|
line: util.getArg(mapping, "originalLine", null),
|
|
42707
42810
|
column: util.getArg(mapping, "originalColumn", null),
|
|
42708
|
-
name
|
|
42811
|
+
name
|
|
42709
42812
|
};
|
|
42710
42813
|
}
|
|
42711
42814
|
}
|
|
@@ -42924,11 +43027,11 @@ var require_source_map_consumer = __commonJS({
|
|
|
42924
43027
|
source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
|
|
42925
43028
|
this._sources.add(source);
|
|
42926
43029
|
source = this._sources.indexOf(source);
|
|
42927
|
-
var
|
|
43030
|
+
var name = null;
|
|
42928
43031
|
if (mapping.name) {
|
|
42929
|
-
|
|
42930
|
-
this._names.add(
|
|
42931
|
-
|
|
43032
|
+
name = section.consumer._names.at(mapping.name);
|
|
43033
|
+
this._names.add(name);
|
|
43034
|
+
name = this._names.indexOf(name);
|
|
42932
43035
|
}
|
|
42933
43036
|
var adjustedMapping = {
|
|
42934
43037
|
source,
|
|
@@ -42936,7 +43039,7 @@ var require_source_map_consumer = __commonJS({
|
|
|
42936
43039
|
generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
|
|
42937
43040
|
originalLine: mapping.originalLine,
|
|
42938
43041
|
originalColumn: mapping.originalColumn,
|
|
42939
|
-
name
|
|
43042
|
+
name
|
|
42940
43043
|
};
|
|
42941
43044
|
this.__generatedMappings.push(adjustedMapping);
|
|
42942
43045
|
if (typeof adjustedMapping.originalLine === "number") {
|
|
@@ -44199,13 +44302,13 @@ var require_esprima2 = __commonJS({
|
|
|
44199
44302
|
};
|
|
44200
44303
|
JSXParser2.prototype.parseJSXNameValueAttribute = function() {
|
|
44201
44304
|
var node = this.createJSXNode();
|
|
44202
|
-
var
|
|
44305
|
+
var name = this.parseJSXAttributeName();
|
|
44203
44306
|
var value = null;
|
|
44204
44307
|
if (this.matchJSX("=")) {
|
|
44205
44308
|
this.expectJSX("=");
|
|
44206
44309
|
value = this.parseJSXAttributeValue();
|
|
44207
44310
|
}
|
|
44208
|
-
return this.finalize(node, new JSXNode.JSXAttribute(
|
|
44311
|
+
return this.finalize(node, new JSXNode.JSXAttribute(name, value));
|
|
44209
44312
|
};
|
|
44210
44313
|
JSXParser2.prototype.parseJSXSpreadAttribute = function() {
|
|
44211
44314
|
var node = this.createJSXNode();
|
|
@@ -44227,14 +44330,14 @@ var require_esprima2 = __commonJS({
|
|
|
44227
44330
|
JSXParser2.prototype.parseJSXOpeningElement = function() {
|
|
44228
44331
|
var node = this.createJSXNode();
|
|
44229
44332
|
this.expectJSX("<");
|
|
44230
|
-
var
|
|
44333
|
+
var name = this.parseJSXElementName();
|
|
44231
44334
|
var attributes = this.parseJSXAttributes();
|
|
44232
44335
|
var selfClosing = this.matchJSX("/");
|
|
44233
44336
|
if (selfClosing) {
|
|
44234
44337
|
this.expectJSX("/");
|
|
44235
44338
|
}
|
|
44236
44339
|
this.expectJSX(">");
|
|
44237
|
-
return this.finalize(node, new JSXNode.JSXOpeningElement(
|
|
44340
|
+
return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
|
|
44238
44341
|
};
|
|
44239
44342
|
JSXParser2.prototype.parseJSXBoundaryElement = function() {
|
|
44240
44343
|
var node = this.createJSXNode();
|
|
@@ -44245,14 +44348,14 @@ var require_esprima2 = __commonJS({
|
|
|
44245
44348
|
this.expectJSX(">");
|
|
44246
44349
|
return this.finalize(node, new JSXNode.JSXClosingElement(name_3));
|
|
44247
44350
|
}
|
|
44248
|
-
var
|
|
44351
|
+
var name = this.parseJSXElementName();
|
|
44249
44352
|
var attributes = this.parseJSXAttributes();
|
|
44250
44353
|
var selfClosing = this.matchJSX("/");
|
|
44251
44354
|
if (selfClosing) {
|
|
44252
44355
|
this.expectJSX("/");
|
|
44253
44356
|
}
|
|
44254
44357
|
this.expectJSX(">");
|
|
44255
|
-
return this.finalize(node, new JSXNode.JSXOpeningElement(
|
|
44358
|
+
return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
|
|
44256
44359
|
};
|
|
44257
44360
|
JSXParser2.prototype.parseJSXEmptyExpression = function() {
|
|
44258
44361
|
var node = this.createJSXChildNode();
|
|
@@ -44397,9 +44500,9 @@ var require_esprima2 = __commonJS({
|
|
|
44397
44500
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
44398
44501
|
var jsx_syntax_1 = __webpack_require__(6);
|
|
44399
44502
|
var JSXClosingElement = function() {
|
|
44400
|
-
function JSXClosingElement2(
|
|
44503
|
+
function JSXClosingElement2(name) {
|
|
44401
44504
|
this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement;
|
|
44402
|
-
this.name =
|
|
44505
|
+
this.name = name;
|
|
44403
44506
|
}
|
|
44404
44507
|
return JSXClosingElement2;
|
|
44405
44508
|
}();
|
|
@@ -44430,9 +44533,9 @@ var require_esprima2 = __commonJS({
|
|
|
44430
44533
|
}();
|
|
44431
44534
|
exports2.JSXExpressionContainer = JSXExpressionContainer;
|
|
44432
44535
|
var JSXIdentifier = function() {
|
|
44433
|
-
function JSXIdentifier2(
|
|
44536
|
+
function JSXIdentifier2(name) {
|
|
44434
44537
|
this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier;
|
|
44435
|
-
this.name =
|
|
44538
|
+
this.name = name;
|
|
44436
44539
|
}
|
|
44437
44540
|
return JSXIdentifier2;
|
|
44438
44541
|
}();
|
|
@@ -44447,27 +44550,27 @@ var require_esprima2 = __commonJS({
|
|
|
44447
44550
|
}();
|
|
44448
44551
|
exports2.JSXMemberExpression = JSXMemberExpression;
|
|
44449
44552
|
var JSXAttribute = function() {
|
|
44450
|
-
function JSXAttribute2(
|
|
44553
|
+
function JSXAttribute2(name, value) {
|
|
44451
44554
|
this.type = jsx_syntax_1.JSXSyntax.JSXAttribute;
|
|
44452
|
-
this.name =
|
|
44555
|
+
this.name = name;
|
|
44453
44556
|
this.value = value;
|
|
44454
44557
|
}
|
|
44455
44558
|
return JSXAttribute2;
|
|
44456
44559
|
}();
|
|
44457
44560
|
exports2.JSXAttribute = JSXAttribute;
|
|
44458
44561
|
var JSXNamespacedName = function() {
|
|
44459
|
-
function JSXNamespacedName2(namespace,
|
|
44562
|
+
function JSXNamespacedName2(namespace, name) {
|
|
44460
44563
|
this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName;
|
|
44461
44564
|
this.namespace = namespace;
|
|
44462
|
-
this.name =
|
|
44565
|
+
this.name = name;
|
|
44463
44566
|
}
|
|
44464
44567
|
return JSXNamespacedName2;
|
|
44465
44568
|
}();
|
|
44466
44569
|
exports2.JSXNamespacedName = JSXNamespacedName;
|
|
44467
44570
|
var JSXOpeningElement = function() {
|
|
44468
|
-
function JSXOpeningElement2(
|
|
44571
|
+
function JSXOpeningElement2(name, selfClosing, attributes) {
|
|
44469
44572
|
this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement;
|
|
44470
|
-
this.name =
|
|
44573
|
+
this.name = name;
|
|
44471
44574
|
this.selfClosing = selfClosing;
|
|
44472
44575
|
this.attributes = attributes;
|
|
44473
44576
|
}
|
|
@@ -44843,9 +44946,9 @@ var require_esprima2 = __commonJS({
|
|
|
44843
44946
|
}();
|
|
44844
44947
|
exports2.FunctionExpression = FunctionExpression;
|
|
44845
44948
|
var Identifier = function() {
|
|
44846
|
-
function Identifier2(
|
|
44949
|
+
function Identifier2(name) {
|
|
44847
44950
|
this.type = syntax_1.Syntax.Identifier;
|
|
44848
|
-
this.name =
|
|
44951
|
+
this.name = name;
|
|
44849
44952
|
}
|
|
44850
44953
|
return Identifier2;
|
|
44851
44954
|
}();
|
|
@@ -47352,10 +47455,10 @@ var require_esprima2 = __commonJS({
|
|
|
47352
47455
|
this.context.inFunctionBody = previousInFunctionBody;
|
|
47353
47456
|
return this.finalize(node, new Node.BlockStatement(body));
|
|
47354
47457
|
};
|
|
47355
|
-
Parser2.prototype.validateParam = function(options, param,
|
|
47356
|
-
var key = "$" +
|
|
47458
|
+
Parser2.prototype.validateParam = function(options, param, name) {
|
|
47459
|
+
var key = "$" + name;
|
|
47357
47460
|
if (this.context.strict) {
|
|
47358
|
-
if (this.scanner.isRestrictedWord(
|
|
47461
|
+
if (this.scanner.isRestrictedWord(name)) {
|
|
47359
47462
|
options.stricted = param;
|
|
47360
47463
|
options.message = messages_1.Messages.StrictParamName;
|
|
47361
47464
|
}
|
|
@@ -47364,10 +47467,10 @@ var require_esprima2 = __commonJS({
|
|
|
47364
47467
|
options.message = messages_1.Messages.StrictParamDupe;
|
|
47365
47468
|
}
|
|
47366
47469
|
} else if (!options.firstRestricted) {
|
|
47367
|
-
if (this.scanner.isRestrictedWord(
|
|
47470
|
+
if (this.scanner.isRestrictedWord(name)) {
|
|
47368
47471
|
options.firstRestricted = param;
|
|
47369
47472
|
options.message = messages_1.Messages.StrictParamName;
|
|
47370
|
-
} else if (this.scanner.isStrictModeReservedWord(
|
|
47473
|
+
} else if (this.scanner.isStrictModeReservedWord(name)) {
|
|
47371
47474
|
options.firstRestricted = param;
|
|
47372
47475
|
options.message = messages_1.Messages.StrictReservedWord;
|
|
47373
47476
|
} else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
|
|
@@ -49770,14 +49873,14 @@ var require_mapping = __commonJS({
|
|
|
49770
49873
|
var sourceLines = this.sourceLines;
|
|
49771
49874
|
var sourceLoc = this.sourceLoc;
|
|
49772
49875
|
var targetLoc = this.targetLoc;
|
|
49773
|
-
function skip(
|
|
49774
|
-
var sourceFromPos = sourceLoc[
|
|
49775
|
-
var targetFromPos = targetLoc[
|
|
49876
|
+
function skip(name) {
|
|
49877
|
+
var sourceFromPos = sourceLoc[name];
|
|
49878
|
+
var targetFromPos = targetLoc[name];
|
|
49776
49879
|
var targetToPos = start;
|
|
49777
|
-
if (
|
|
49880
|
+
if (name === "end") {
|
|
49778
49881
|
targetToPos = end;
|
|
49779
49882
|
} else {
|
|
49780
|
-
assert_1.default.strictEqual(
|
|
49883
|
+
assert_1.default.strictEqual(name, "start");
|
|
49781
49884
|
}
|
|
49782
49885
|
return skipChars(sourceLines, sourceFromPos, lines, targetFromPos, targetToPos);
|
|
49783
49886
|
}
|
|
@@ -51085,9 +51188,9 @@ var require_fast_path = __commonJS({
|
|
|
51085
51188
|
var value = s[origLen - 1];
|
|
51086
51189
|
var argc = arguments.length;
|
|
51087
51190
|
for (var i = 1; i < argc; ++i) {
|
|
51088
|
-
var
|
|
51089
|
-
value = value[
|
|
51090
|
-
s.push(
|
|
51191
|
+
var name = arguments[i];
|
|
51192
|
+
value = value[name];
|
|
51193
|
+
s.push(name, value);
|
|
51091
51194
|
}
|
|
51092
51195
|
var result = callback(this);
|
|
51093
51196
|
s.length = origLen;
|
|
@@ -51099,9 +51202,9 @@ var require_fast_path = __commonJS({
|
|
|
51099
51202
|
var value = s[origLen - 1];
|
|
51100
51203
|
var argc = arguments.length;
|
|
51101
51204
|
for (var i = 1; i < argc; ++i) {
|
|
51102
|
-
var
|
|
51103
|
-
value = value[
|
|
51104
|
-
s.push(
|
|
51205
|
+
var name = arguments[i];
|
|
51206
|
+
value = value[name];
|
|
51207
|
+
s.push(name, value);
|
|
51105
51208
|
}
|
|
51106
51209
|
for (var i = 0; i < value.length; ++i) {
|
|
51107
51210
|
if (i in value) {
|
|
@@ -51118,9 +51221,9 @@ var require_fast_path = __commonJS({
|
|
|
51118
51221
|
var value = s[origLen - 1];
|
|
51119
51222
|
var argc = arguments.length;
|
|
51120
51223
|
for (var i = 1; i < argc; ++i) {
|
|
51121
|
-
var
|
|
51122
|
-
value = value[
|
|
51123
|
-
s.push(
|
|
51224
|
+
var name = arguments[i];
|
|
51225
|
+
value = value[name];
|
|
51226
|
+
s.push(name, value);
|
|
51124
51227
|
}
|
|
51125
51228
|
var result = new Array(value.length);
|
|
51126
51229
|
for (var i = 0; i < value.length; ++i) {
|
|
@@ -51190,7 +51293,7 @@ var require_fast_path = __commonJS({
|
|
|
51190
51293
|
return true;
|
|
51191
51294
|
}
|
|
51192
51295
|
var parent = this.getParentNode();
|
|
51193
|
-
var
|
|
51296
|
+
var name = this.getName();
|
|
51194
51297
|
if (this.getValue() !== node) {
|
|
51195
51298
|
return false;
|
|
51196
51299
|
}
|
|
@@ -51212,18 +51315,18 @@ var require_fast_path = __commonJS({
|
|
|
51212
51315
|
case "UnaryExpression":
|
|
51213
51316
|
case "SpreadElement":
|
|
51214
51317
|
case "SpreadProperty":
|
|
51215
|
-
return parent.type === "MemberExpression" &&
|
|
51318
|
+
return parent.type === "MemberExpression" && name === "object" && parent.object === node;
|
|
51216
51319
|
case "BinaryExpression":
|
|
51217
51320
|
case "LogicalExpression":
|
|
51218
51321
|
switch (parent.type) {
|
|
51219
51322
|
case "CallExpression":
|
|
51220
|
-
return
|
|
51323
|
+
return name === "callee" && parent.callee === node;
|
|
51221
51324
|
case "UnaryExpression":
|
|
51222
51325
|
case "SpreadElement":
|
|
51223
51326
|
case "SpreadProperty":
|
|
51224
51327
|
return true;
|
|
51225
51328
|
case "MemberExpression":
|
|
51226
|
-
return
|
|
51329
|
+
return name === "object" && parent.object === node;
|
|
51227
51330
|
case "BinaryExpression":
|
|
51228
51331
|
case "LogicalExpression": {
|
|
51229
51332
|
var po = parent.operator;
|
|
@@ -51233,7 +51336,7 @@ var require_fast_path = __commonJS({
|
|
|
51233
51336
|
if (pp > np) {
|
|
51234
51337
|
return true;
|
|
51235
51338
|
}
|
|
51236
|
-
if (pp === np &&
|
|
51339
|
+
if (pp === np && name === "right") {
|
|
51237
51340
|
assert_1.default.strictEqual(parent.right, node);
|
|
51238
51341
|
return true;
|
|
51239
51342
|
}
|
|
@@ -51250,7 +51353,7 @@ var require_fast_path = __commonJS({
|
|
|
51250
51353
|
case "ForStatement":
|
|
51251
51354
|
return false;
|
|
51252
51355
|
case "ExpressionStatement":
|
|
51253
|
-
return
|
|
51356
|
+
return name !== "expression";
|
|
51254
51357
|
default:
|
|
51255
51358
|
return true;
|
|
51256
51359
|
}
|
|
@@ -51260,9 +51363,9 @@ var require_fast_path = __commonJS({
|
|
|
51260
51363
|
case "UnionTypeAnnotation":
|
|
51261
51364
|
return parent.type === "NullableTypeAnnotation";
|
|
51262
51365
|
case "Literal":
|
|
51263
|
-
return parent.type === "MemberExpression" && isNumber.check(node.value) &&
|
|
51366
|
+
return parent.type === "MemberExpression" && isNumber.check(node.value) && name === "object" && parent.object === node;
|
|
51264
51367
|
case "NumericLiteral":
|
|
51265
|
-
return parent.type === "MemberExpression" &&
|
|
51368
|
+
return parent.type === "MemberExpression" && name === "object" && parent.object === node;
|
|
51266
51369
|
case "YieldExpression":
|
|
51267
51370
|
case "AwaitExpression":
|
|
51268
51371
|
case "AssignmentExpression":
|
|
@@ -51276,41 +51379,41 @@ var require_fast_path = __commonJS({
|
|
|
51276
51379
|
return true;
|
|
51277
51380
|
case "CallExpression":
|
|
51278
51381
|
case "NewExpression":
|
|
51279
|
-
return
|
|
51382
|
+
return name === "callee" && parent.callee === node;
|
|
51280
51383
|
case "ConditionalExpression":
|
|
51281
|
-
return
|
|
51384
|
+
return name === "test" && parent.test === node;
|
|
51282
51385
|
case "MemberExpression":
|
|
51283
|
-
return
|
|
51386
|
+
return name === "object" && parent.object === node;
|
|
51284
51387
|
default:
|
|
51285
51388
|
return false;
|
|
51286
51389
|
}
|
|
51287
51390
|
case "ArrowFunctionExpression":
|
|
51288
|
-
if (n.CallExpression.check(parent) &&
|
|
51391
|
+
if (n.CallExpression.check(parent) && name === "callee" && parent.callee === node) {
|
|
51289
51392
|
return true;
|
|
51290
51393
|
}
|
|
51291
|
-
if (n.MemberExpression.check(parent) &&
|
|
51394
|
+
if (n.MemberExpression.check(parent) && name === "object" && parent.object === node) {
|
|
51292
51395
|
return true;
|
|
51293
51396
|
}
|
|
51294
|
-
if (n.TSAsExpression && n.TSAsExpression.check(parent) &&
|
|
51397
|
+
if (n.TSAsExpression && n.TSAsExpression.check(parent) && name === "expression" && parent.expression === node) {
|
|
51295
51398
|
return true;
|
|
51296
51399
|
}
|
|
51297
51400
|
return isBinary(parent);
|
|
51298
51401
|
case "ObjectExpression":
|
|
51299
|
-
if (parent.type === "ArrowFunctionExpression" &&
|
|
51402
|
+
if (parent.type === "ArrowFunctionExpression" && name === "body" && parent.body === node) {
|
|
51300
51403
|
return true;
|
|
51301
51404
|
}
|
|
51302
51405
|
break;
|
|
51303
51406
|
case "TSAsExpression":
|
|
51304
|
-
if (parent.type === "ArrowFunctionExpression" &&
|
|
51407
|
+
if (parent.type === "ArrowFunctionExpression" && name === "body" && parent.body === node && node.expression.type === "ObjectExpression") {
|
|
51305
51408
|
return true;
|
|
51306
51409
|
}
|
|
51307
51410
|
break;
|
|
51308
51411
|
case "CallExpression":
|
|
51309
|
-
if (
|
|
51412
|
+
if (name === "declaration" && n.ExportDefaultDeclaration.check(parent) && n.FunctionExpression.check(node.callee)) {
|
|
51310
51413
|
return true;
|
|
51311
51414
|
}
|
|
51312
51415
|
}
|
|
51313
|
-
if (parent.type === "NewExpression" &&
|
|
51416
|
+
if (parent.type === "NewExpression" && name === "callee" && parent.callee === node) {
|
|
51314
51417
|
return containsCallExpression(node);
|
|
51315
51418
|
}
|
|
51316
51419
|
if (assumeExpressionContext !== true && !this.canBeFirstInStatement() && this.firstInStatement()) {
|
|
@@ -52948,12 +53051,12 @@ var require_printer2 = __commonJS({
|
|
|
52948
53051
|
return (0, lines_1.concat)(parts);
|
|
52949
53052
|
}
|
|
52950
53053
|
case "FunctionTypeParam": {
|
|
52951
|
-
var
|
|
52952
|
-
parts.push(
|
|
53054
|
+
var name = path2.call(print9, "name");
|
|
53055
|
+
parts.push(name);
|
|
52953
53056
|
if (n.optional) {
|
|
52954
53057
|
parts.push("?");
|
|
52955
53058
|
}
|
|
52956
|
-
if (
|
|
53059
|
+
if (name.infos[0].line) {
|
|
52957
53060
|
parts.push(": ");
|
|
52958
53061
|
}
|
|
52959
53062
|
parts.push(path2.call(print9, "typeAnnotation"));
|
|
@@ -53970,6 +54073,9 @@ var houdini_mode = {
|
|
|
53970
54073
|
}
|
|
53971
54074
|
};
|
|
53972
54075
|
|
|
54076
|
+
// src/lib/deepMerge.ts
|
|
54077
|
+
var import_deepmerge = __toESM(require_cjs(), 1);
|
|
54078
|
+
|
|
53973
54079
|
// src/lib/error.ts
|
|
53974
54080
|
var HoudiniError = class extends Error {
|
|
53975
54081
|
filepath = null;
|
|
@@ -53989,6 +54095,20 @@ var HoudiniError = class extends Error {
|
|
|
53989
54095
|
}
|
|
53990
54096
|
};
|
|
53991
54097
|
|
|
54098
|
+
// src/lib/deepMerge.ts
|
|
54099
|
+
function deepMerge(filepath, ...targets) {
|
|
54100
|
+
try {
|
|
54101
|
+
if (targets.length === 1) {
|
|
54102
|
+
return targets[0];
|
|
54103
|
+
} else if (targets.length === 2) {
|
|
54104
|
+
return (0, import_deepmerge.default)(targets[0], targets[1]);
|
|
54105
|
+
}
|
|
54106
|
+
return deepMerge(filepath, targets[0], deepMerge(filepath, ...targets.slice(1)));
|
|
54107
|
+
} catch (e) {
|
|
54108
|
+
throw new HoudiniError({ filepath, message: "could not merge: " + targets });
|
|
54109
|
+
}
|
|
54110
|
+
}
|
|
54111
|
+
|
|
53992
54112
|
// src/lib/fs.ts
|
|
53993
54113
|
var fs_exports = {};
|
|
53994
54114
|
__export(fs_exports, {
|
|
@@ -54282,8 +54402,10 @@ function getRootType(type) {
|
|
|
54282
54402
|
}
|
|
54283
54403
|
return type;
|
|
54284
54404
|
}
|
|
54285
|
-
function hashDocument(
|
|
54286
|
-
|
|
54405
|
+
function hashDocument({
|
|
54406
|
+
document
|
|
54407
|
+
}) {
|
|
54408
|
+
const docString = typeof document === "string" ? document : graphql.print(document.document);
|
|
54287
54409
|
return crypto.createHash("sha256").update(docString).digest("hex");
|
|
54288
54410
|
}
|
|
54289
54411
|
function parentTypeFromAncestors(schema, filepath, ancestors) {
|
|
@@ -54619,8 +54741,8 @@ async function find_graphql(config2, parsedScript, walker) {
|
|
|
54619
54741
|
return;
|
|
54620
54742
|
}
|
|
54621
54743
|
const definition = config2.extractDefinition(parsedTag);
|
|
54622
|
-
const
|
|
54623
|
-
if (!
|
|
54744
|
+
const name = definition.name?.value;
|
|
54745
|
+
if (!name) {
|
|
54624
54746
|
throw new Error("Could not find definition name");
|
|
54625
54747
|
}
|
|
54626
54748
|
let kind;
|
|
@@ -54645,7 +54767,7 @@ async function find_graphql(config2, parsedScript, walker) {
|
|
|
54645
54767
|
replaceWith: this.replace
|
|
54646
54768
|
},
|
|
54647
54769
|
artifact: {
|
|
54648
|
-
name
|
|
54770
|
+
name,
|
|
54649
54771
|
kind
|
|
54650
54772
|
},
|
|
54651
54773
|
parent,
|
|
@@ -54760,13 +54882,13 @@ var FieldCollection = class {
|
|
|
54760
54882
|
this.fragmentSpreads[selection2.name.value] = selection2;
|
|
54761
54883
|
let includeFragments = this.config.defaultFragmentMasking === "disable";
|
|
54762
54884
|
const maskEnableDirective = selection2.directives?.find(
|
|
54763
|
-
({ name
|
|
54885
|
+
({ name }) => name.value === this.config.maskEnableDirective
|
|
54764
54886
|
);
|
|
54765
54887
|
if (maskEnableDirective) {
|
|
54766
54888
|
includeFragments = false;
|
|
54767
54889
|
}
|
|
54768
54890
|
const maskDisableDirective = selection2.directives?.find(
|
|
54769
|
-
({ name
|
|
54891
|
+
({ name }) => name.value === this.config.maskDisableDirective
|
|
54770
54892
|
);
|
|
54771
54893
|
if (maskDisableDirective) {
|
|
54772
54894
|
includeFragments = true;
|
|
@@ -54921,7 +55043,7 @@ var graphql3 = __toESM(require_graphql2(), 1);
|
|
|
54921
55043
|
var import_graphql = __toESM(require_graphql2(), 1);
|
|
54922
55044
|
async function includeFragmentDefinitions(config2, documents) {
|
|
54923
55045
|
const fragments = collectFragments(config2, documents);
|
|
54924
|
-
for (const [index, { name
|
|
55046
|
+
for (const [index, { name, document, filename }] of documents.entries()) {
|
|
54925
55047
|
const operation = document.definitions.find(
|
|
54926
55048
|
({ kind }) => kind === import_graphql.Kind.OPERATION_DEFINITION
|
|
54927
55049
|
);
|
|
@@ -55035,7 +55157,8 @@ async function fragmentVariables(config2, documents) {
|
|
|
55035
55157
|
generateStore: false,
|
|
55036
55158
|
generateArtifact: false,
|
|
55037
55159
|
filename: "generated::fragmentVariables",
|
|
55038
|
-
originalString: ""
|
|
55160
|
+
originalString: "",
|
|
55161
|
+
artifact: null
|
|
55039
55162
|
});
|
|
55040
55163
|
}
|
|
55041
55164
|
function inlineFragmentArgs({
|
|
@@ -55183,7 +55306,7 @@ function fragmentArguments(config2, filepath, definition) {
|
|
|
55183
55306
|
return [];
|
|
55184
55307
|
}
|
|
55185
55308
|
let type = typeArg.value;
|
|
55186
|
-
let
|
|
55309
|
+
let name = arg.name.value;
|
|
55187
55310
|
let required = false;
|
|
55188
55311
|
let defaultValue = arg.value.fields?.find((arg2) => arg2.name.value === "default")?.value || null;
|
|
55189
55312
|
if (type[type.length - 1] === "!") {
|
|
@@ -55193,7 +55316,7 @@ function fragmentArguments(config2, filepath, definition) {
|
|
|
55193
55316
|
}
|
|
55194
55317
|
return [
|
|
55195
55318
|
{
|
|
55196
|
-
name
|
|
55319
|
+
name,
|
|
55197
55320
|
type,
|
|
55198
55321
|
required,
|
|
55199
55322
|
defaultValue
|
|
@@ -55204,7 +55327,7 @@ function fragmentArguments(config2, filepath, definition) {
|
|
|
55204
55327
|
}
|
|
55205
55328
|
function collectDefaultArgumentValues(config2, filepath, definition) {
|
|
55206
55329
|
let result = {};
|
|
55207
|
-
for (const { name
|
|
55330
|
+
for (const { name, required, defaultValue } of fragmentArguments(
|
|
55208
55331
|
config2,
|
|
55209
55332
|
filepath,
|
|
55210
55333
|
definition
|
|
@@ -55212,7 +55335,7 @@ function collectDefaultArgumentValues(config2, filepath, definition) {
|
|
|
55212
55335
|
if (required || !defaultValue) {
|
|
55213
55336
|
continue;
|
|
55214
55337
|
}
|
|
55215
|
-
result[
|
|
55338
|
+
result[name] = defaultValue;
|
|
55216
55339
|
}
|
|
55217
55340
|
return result;
|
|
55218
55341
|
}
|
|
@@ -55379,30 +55502,6 @@ function serializeValue(value) {
|
|
|
55379
55502
|
}
|
|
55380
55503
|
return AST4.literal(value);
|
|
55381
55504
|
}
|
|
55382
|
-
function deepMerge(filepath, ...targets) {
|
|
55383
|
-
if (typeof targets[0] !== "object") {
|
|
55384
|
-
const matches = targets.filter((val) => val !== targets[0]).length === 0;
|
|
55385
|
-
if (!matches) {
|
|
55386
|
-
throw new HoudiniError({ filepath, message: "could not merge: " + targets });
|
|
55387
|
-
}
|
|
55388
|
-
return targets[0];
|
|
55389
|
-
}
|
|
55390
|
-
if (Array.isArray(targets[0])) {
|
|
55391
|
-
return targets[0].concat(...targets.slice(1));
|
|
55392
|
-
}
|
|
55393
|
-
const fields = {};
|
|
55394
|
-
for (const target of targets) {
|
|
55395
|
-
for (const [key, value] of Object.entries(target)) {
|
|
55396
|
-
if (!fields[key]) {
|
|
55397
|
-
fields[key] = [];
|
|
55398
|
-
}
|
|
55399
|
-
fields[key].push(value);
|
|
55400
|
-
}
|
|
55401
|
-
}
|
|
55402
|
-
return Object.fromEntries(
|
|
55403
|
-
Object.entries(fields).map(([key, value]) => [key, deepMerge(filepath, ...value)])
|
|
55404
|
-
);
|
|
55405
|
-
}
|
|
55406
55505
|
function convertValue(config2, val) {
|
|
55407
55506
|
let value;
|
|
55408
55507
|
let kind;
|
|
@@ -55487,14 +55586,14 @@ function operationObject({
|
|
|
55487
55586
|
let allLists = config2.defaultListTarget ?? void 0;
|
|
55488
55587
|
let operationWhen;
|
|
55489
55588
|
const internalDirectives = selection2.directives?.filter(
|
|
55490
|
-
(directive) => config2.isInternalDirective(directive)
|
|
55589
|
+
(directive) => config2.isInternalDirective(directive.name.value)
|
|
55491
55590
|
);
|
|
55492
55591
|
if (internalDirectives && internalDirectives.length > 0) {
|
|
55493
55592
|
const prepend = internalDirectives.find(
|
|
55494
|
-
({ name
|
|
55593
|
+
({ name }) => name.value === config2.listPrependDirective
|
|
55495
55594
|
);
|
|
55496
55595
|
const append = internalDirectives.find(
|
|
55497
|
-
({ name
|
|
55596
|
+
({ name }) => name.value === config2.listAppendDirective
|
|
55498
55597
|
);
|
|
55499
55598
|
if (append) {
|
|
55500
55599
|
position = "last";
|
|
@@ -55503,14 +55602,14 @@ function operationObject({
|
|
|
55503
55602
|
position = "first";
|
|
55504
55603
|
}
|
|
55505
55604
|
const allListsDirective = internalDirectives.find(
|
|
55506
|
-
({ name
|
|
55605
|
+
({ name }) => name.value === config2.listAllListsDirective
|
|
55507
55606
|
);
|
|
55508
55607
|
let parent = internalDirectives.find(
|
|
55509
|
-
({ name
|
|
55608
|
+
({ name }) => name.value === config2.listParentDirective
|
|
55510
55609
|
);
|
|
55511
55610
|
allLists = allListsDirective ? "all" : void 0;
|
|
55512
|
-
const when = internalDirectives.find(({ name
|
|
55513
|
-
const when_not = internalDirectives.find(({ name
|
|
55611
|
+
const when = internalDirectives.find(({ name }) => name.value === "when");
|
|
55612
|
+
const when_not = internalDirectives.find(({ name }) => name.value === "when_not");
|
|
55514
55613
|
let parentIDArg = parent?.arguments?.find((argument) => argument.name.value === "value");
|
|
55515
55614
|
if (parentIDArg) {
|
|
55516
55615
|
if (parentIDArg.value.kind === "StringValue") {
|
|
@@ -55521,9 +55620,9 @@ function operationObject({
|
|
|
55521
55620
|
parentID = parentIDArg.value.name.value;
|
|
55522
55621
|
}
|
|
55523
55622
|
}
|
|
55524
|
-
const whenArg = (append || prepend)?.arguments?.find(({ name
|
|
55623
|
+
const whenArg = (append || prepend)?.arguments?.find(({ name }) => name.value === "when");
|
|
55525
55624
|
const whenNotArg = (append || prepend)?.arguments?.find(
|
|
55526
|
-
({ name
|
|
55625
|
+
({ name }) => name.value === "when_not"
|
|
55527
55626
|
);
|
|
55528
55627
|
for (const [i, arg] of [whenArg, whenNotArg].entries()) {
|
|
55529
55628
|
if (!arg || arg.value.kind !== "ObjectValue") {
|
|
@@ -55756,7 +55855,7 @@ async function paginate(config2, documents) {
|
|
|
55756
55855
|
Object.keys(operationVariables).concat(Object.keys(newVariables))
|
|
55757
55856
|
);
|
|
55758
55857
|
const finalVariables = [...variableNames].map(
|
|
55759
|
-
(
|
|
55858
|
+
(name) => operationVariables[name] || newVariables[name]
|
|
55760
55859
|
);
|
|
55761
55860
|
return {
|
|
55762
55861
|
...node,
|
|
@@ -55853,7 +55952,7 @@ async function paginate(config2, documents) {
|
|
|
55853
55952
|
value: config2.withDirective
|
|
55854
55953
|
},
|
|
55855
55954
|
["arguments"]: paginationArgs.map(
|
|
55856
|
-
({ name
|
|
55955
|
+
({ name }) => variableAsArgument(name)
|
|
55857
55956
|
)
|
|
55858
55957
|
}
|
|
55859
55958
|
]
|
|
@@ -55981,7 +56080,8 @@ async function paginate(config2, documents) {
|
|
|
55981
56080
|
generateArtifact: true,
|
|
55982
56081
|
generateStore: false,
|
|
55983
56082
|
refetch: doc.refetch,
|
|
55984
|
-
originalString: ""
|
|
56083
|
+
originalString: "",
|
|
56084
|
+
artifact: null
|
|
55985
56085
|
});
|
|
55986
56086
|
}
|
|
55987
56087
|
}
|
|
@@ -56004,32 +56104,32 @@ function replaceArgumentsWithVariables(args, flags) {
|
|
|
56004
56104
|
seenArgs[arg.name.value] = true;
|
|
56005
56105
|
return variableAsArgument(arg.name.value, flags[arg.name.value].variableName);
|
|
56006
56106
|
});
|
|
56007
|
-
for (const
|
|
56008
|
-
const spec = flags[
|
|
56009
|
-
if (flags[
|
|
56107
|
+
for (const name of Object.keys(flags)) {
|
|
56108
|
+
const spec = flags[name];
|
|
56109
|
+
if (flags[name].defaultValue || !spec.enabled || seenArgs[name]) {
|
|
56010
56110
|
continue;
|
|
56011
56111
|
}
|
|
56012
|
-
newArgs.push(variableAsArgument(
|
|
56112
|
+
newArgs.push(variableAsArgument(name));
|
|
56013
56113
|
}
|
|
56014
56114
|
return newArgs;
|
|
56015
56115
|
}
|
|
56016
|
-
function variableAsArgument(
|
|
56116
|
+
function variableAsArgument(name, variable) {
|
|
56017
56117
|
return {
|
|
56018
56118
|
kind: graphql8.Kind.ARGUMENT,
|
|
56019
56119
|
name: {
|
|
56020
56120
|
kind: graphql8.Kind.NAME,
|
|
56021
|
-
value:
|
|
56121
|
+
value: name
|
|
56022
56122
|
},
|
|
56023
56123
|
value: {
|
|
56024
56124
|
kind: graphql8.Kind.VARIABLE,
|
|
56025
56125
|
name: {
|
|
56026
56126
|
kind: graphql8.Kind.NAME,
|
|
56027
|
-
value: variable ??
|
|
56127
|
+
value: variable ?? name
|
|
56028
56128
|
}
|
|
56029
56129
|
}
|
|
56030
56130
|
};
|
|
56031
56131
|
}
|
|
56032
|
-
function staticVariableDefinition(
|
|
56132
|
+
function staticVariableDefinition(name, type, defaultValue, variableName) {
|
|
56033
56133
|
return {
|
|
56034
56134
|
kind: graphql8.Kind.VARIABLE_DEFINITION,
|
|
56035
56135
|
type: {
|
|
@@ -56043,7 +56143,7 @@ function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
|
56043
56143
|
kind: graphql8.Kind.VARIABLE,
|
|
56044
56144
|
name: {
|
|
56045
56145
|
kind: graphql8.Kind.NAME,
|
|
56046
|
-
value: variableName ??
|
|
56146
|
+
value: variableName ?? name
|
|
56047
56147
|
}
|
|
56048
56148
|
},
|
|
56049
56149
|
defaultValue: !defaultValue ? void 0 : {
|
|
@@ -56052,12 +56152,12 @@ function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
|
56052
56152
|
}
|
|
56053
56153
|
};
|
|
56054
56154
|
}
|
|
56055
|
-
function argumentNode(
|
|
56155
|
+
function argumentNode(name, value) {
|
|
56056
56156
|
return {
|
|
56057
56157
|
kind: graphql8.Kind.ARGUMENT,
|
|
56058
56158
|
name: {
|
|
56059
56159
|
kind: graphql8.Kind.NAME,
|
|
56060
|
-
value:
|
|
56160
|
+
value: name
|
|
56061
56161
|
},
|
|
56062
56162
|
value: objectNode(value)
|
|
56063
56163
|
};
|
|
@@ -56303,7 +56403,7 @@ async function addListFragments(config2, documents) {
|
|
|
56303
56403
|
const generatedDoc = {
|
|
56304
56404
|
kind: graphql9.Kind.DOCUMENT,
|
|
56305
56405
|
definitions: Object.entries(lists).flatMap(
|
|
56306
|
-
([
|
|
56406
|
+
([name, { selection: selection2, type }]) => {
|
|
56307
56407
|
const schemaType = config2.schema.getType(type.name);
|
|
56308
56408
|
if (!selection2) {
|
|
56309
56409
|
throw new HoudiniError({ message: "Lists must have a selection" });
|
|
@@ -56323,7 +56423,7 @@ async function addListFragments(config2, documents) {
|
|
|
56323
56423
|
return [
|
|
56324
56424
|
{
|
|
56325
56425
|
name: {
|
|
56326
|
-
value: config2.listInsertFragment(
|
|
56426
|
+
value: config2.listInsertFragment(name),
|
|
56327
56427
|
kind: graphql9.Kind.NAME
|
|
56328
56428
|
},
|
|
56329
56429
|
kind: graphql9.Kind.FRAGMENT_DEFINITION,
|
|
@@ -56338,7 +56438,7 @@ async function addListFragments(config2, documents) {
|
|
|
56338
56438
|
},
|
|
56339
56439
|
{
|
|
56340
56440
|
name: {
|
|
56341
|
-
value: config2.listToggleFragment(
|
|
56441
|
+
value: config2.listToggleFragment(name),
|
|
56342
56442
|
kind: graphql9.Kind.NAME
|
|
56343
56443
|
},
|
|
56344
56444
|
kind: graphql9.Kind.FRAGMENT_DEFINITION,
|
|
@@ -56354,7 +56454,7 @@ async function addListFragments(config2, documents) {
|
|
|
56354
56454
|
{
|
|
56355
56455
|
kind: graphql9.Kind.FRAGMENT_DEFINITION,
|
|
56356
56456
|
name: {
|
|
56357
|
-
value: config2.listRemoveFragment(
|
|
56457
|
+
value: config2.listRemoveFragment(name),
|
|
56358
56458
|
kind: graphql9.Kind.NAME
|
|
56359
56459
|
},
|
|
56360
56460
|
selectionSet: {
|
|
@@ -56398,7 +56498,8 @@ async function addListFragments(config2, documents) {
|
|
|
56398
56498
|
document: generatedDoc,
|
|
56399
56499
|
originalDocument: generatedDoc,
|
|
56400
56500
|
filename: "generated::lists",
|
|
56401
|
-
originalString: ""
|
|
56501
|
+
originalString: "",
|
|
56502
|
+
artifact: null
|
|
56402
56503
|
});
|
|
56403
56504
|
}
|
|
56404
56505
|
function connectionSelection(config2, field, type, selection2) {
|
|
@@ -56802,19 +56903,20 @@ function artifactGenerator(stats) {
|
|
|
56802
56903
|
});
|
|
56803
56904
|
}
|
|
56804
56905
|
const listOfArtifacts = [];
|
|
56906
|
+
const hash = config2.plugins?.find((plugin2) => plugin2.hash)?.hash ?? hashDocument;
|
|
56805
56907
|
await Promise.all(
|
|
56806
56908
|
[
|
|
56807
56909
|
writeIndexFile(config2, docs)
|
|
56808
56910
|
].concat(
|
|
56809
56911
|
docs.map(async (doc) => {
|
|
56810
|
-
const { document, name
|
|
56912
|
+
const { document, name, generateArtifact } = doc;
|
|
56811
56913
|
if (!generateArtifact) {
|
|
56812
56914
|
return;
|
|
56813
56915
|
}
|
|
56814
56916
|
const usedVariableNames = /* @__PURE__ */ new Set();
|
|
56815
56917
|
let documentWithoutInternalDirectives = graphql12.visit(document, {
|
|
56816
56918
|
Directive(node) {
|
|
56817
|
-
if (config2.isInternalDirective(node)) {
|
|
56919
|
+
if (config2.isInternalDirective(node.name.value)) {
|
|
56818
56920
|
return null;
|
|
56819
56921
|
}
|
|
56820
56922
|
},
|
|
@@ -56829,8 +56931,8 @@ function artifactGenerator(stats) {
|
|
|
56829
56931
|
documentWithoutInternalDirectives,
|
|
56830
56932
|
{
|
|
56831
56933
|
VariableDefinition(variableDefinitionNode) {
|
|
56832
|
-
const
|
|
56833
|
-
if (!usedVariableNames.has(
|
|
56934
|
+
const name2 = variableDefinitionNode.variable.name.value;
|
|
56935
|
+
if (!usedVariableNames.has(name2)) {
|
|
56834
56936
|
return null;
|
|
56835
56937
|
}
|
|
56836
56938
|
}
|
|
@@ -56864,12 +56966,12 @@ function artifactGenerator(stats) {
|
|
|
56864
56966
|
selectionSet = operation.selectionSet;
|
|
56865
56967
|
} else {
|
|
56866
56968
|
const matchingFragment = fragments.find(
|
|
56867
|
-
(fragment) => fragment.name.value ===
|
|
56969
|
+
(fragment) => fragment.name.value === name
|
|
56868
56970
|
);
|
|
56869
56971
|
if (!matchingFragment) {
|
|
56870
56972
|
throw new HoudiniError({
|
|
56871
56973
|
filepath: doc.filename,
|
|
56872
|
-
message: `Fragment "${
|
|
56974
|
+
message: `Fragment "${name}" doesn't exist in its own document?!`
|
|
56873
56975
|
});
|
|
56874
56976
|
}
|
|
56875
56977
|
rootType = matchingFragment.typeCondition.name.value;
|
|
@@ -56898,10 +57000,10 @@ function artifactGenerator(stats) {
|
|
|
56898
57000
|
ignoreMaskDisable: docKind === "HoudiniQuery",
|
|
56899
57001
|
applyFragments: docKind !== "HoudiniFragment"
|
|
56900
57002
|
});
|
|
56901
|
-
|
|
56902
|
-
name
|
|
57003
|
+
let artifact = {
|
|
57004
|
+
name,
|
|
56903
57005
|
kind: docKind,
|
|
56904
|
-
hash:
|
|
57006
|
+
hash: hash({ config: config2, document: doc }),
|
|
56905
57007
|
refetch: doc.refetch,
|
|
56906
57008
|
raw: rawString,
|
|
56907
57009
|
rootType,
|
|
@@ -56920,27 +57022,27 @@ function artifactGenerator(stats) {
|
|
|
56920
57022
|
document: doc
|
|
56921
57023
|
})
|
|
56922
57024
|
};
|
|
56923
|
-
const
|
|
56924
|
-
(prev,
|
|
56925
|
-
if (!
|
|
57025
|
+
const plugin_data = config2.plugins.reduce(
|
|
57026
|
+
(prev, plugin2) => {
|
|
57027
|
+
if (!plugin2.artifact_data) {
|
|
56926
57028
|
return prev;
|
|
56927
57029
|
}
|
|
56928
57030
|
const result = { ...prev };
|
|
56929
|
-
const dataToAdd =
|
|
57031
|
+
const dataToAdd = plugin2.artifact_data({ config: config2, document: doc }) ?? {};
|
|
56930
57032
|
if (Object.keys(dataToAdd).length > 0) {
|
|
56931
|
-
result[
|
|
57033
|
+
result[plugin2.name] = dataToAdd;
|
|
56932
57034
|
}
|
|
56933
57035
|
return result;
|
|
56934
57036
|
},
|
|
56935
57037
|
{}
|
|
56936
57038
|
);
|
|
56937
|
-
if (Object.keys(
|
|
56938
|
-
artifact.
|
|
57039
|
+
if (Object.keys(plugin_data).length > 0) {
|
|
57040
|
+
artifact.plugin_data = plugin_data;
|
|
56939
57041
|
}
|
|
56940
57042
|
if (inputs && inputs.length > 0) {
|
|
56941
57043
|
artifact.input = inputObject(config2, inputs);
|
|
56942
57044
|
}
|
|
56943
|
-
if (
|
|
57045
|
+
if (artifact.kind === "HoudiniQuery") {
|
|
56944
57046
|
const cacheDirective = operations[0].directives?.find(
|
|
56945
57047
|
(directive2) => directive2.name.value === config2.cacheDirective
|
|
56946
57048
|
);
|
|
@@ -56953,7 +57055,7 @@ function artifactGenerator(stats) {
|
|
|
56953
57055
|
{}
|
|
56954
57056
|
) || {};
|
|
56955
57057
|
const policy = args[config2.cachePolicyArg];
|
|
56956
|
-
if (policy && policy.value.kind === "EnumValue") {
|
|
57058
|
+
if (policy && policy.value.kind === "EnumValue" && policy.value.value) {
|
|
56957
57059
|
artifact.policy = policy.value.value;
|
|
56958
57060
|
} else {
|
|
56959
57061
|
artifact.policy = config2.defaultCachePolicy;
|
|
@@ -56969,10 +57071,17 @@ function artifactGenerator(stats) {
|
|
|
56969
57071
|
artifact.partial = config2.defaultPartial;
|
|
56970
57072
|
}
|
|
56971
57073
|
}
|
|
57074
|
+
doc.artifact = artifact;
|
|
57075
|
+
for (const plugin2 of config2.plugins) {
|
|
57076
|
+
if (!plugin2.artifact_end) {
|
|
57077
|
+
continue;
|
|
57078
|
+
}
|
|
57079
|
+
plugin2.artifact_end({ config: config2, document: doc });
|
|
57080
|
+
}
|
|
56972
57081
|
const file = AST5.program([
|
|
56973
57082
|
moduleExport(config2, "default", serializeValue(artifact)),
|
|
56974
57083
|
AST5.expressionStatement(
|
|
56975
|
-
AST5.stringLiteral(`HoudiniHash=${
|
|
57084
|
+
AST5.stringLiteral(`HoudiniHash=${hash({ config: config2, document: doc })}`)
|
|
56976
57085
|
)
|
|
56977
57086
|
]);
|
|
56978
57087
|
const artifactPath = config2.artifactPath(document);
|
|
@@ -56989,7 +57098,7 @@ function artifactGenerator(stats) {
|
|
|
56989
57098
|
return;
|
|
56990
57099
|
}
|
|
56991
57100
|
const match = existingArtifact && existingArtifact.match(/"HoudiniHash=(\w+)"/);
|
|
56992
|
-
if (match && match[1] !==
|
|
57101
|
+
if (match && match[1] !== hash({ config: config2, document: doc })) {
|
|
56993
57102
|
stats.changed.push(artifact.name);
|
|
56994
57103
|
}
|
|
56995
57104
|
stats.total.push(artifact.name);
|
|
@@ -57008,7 +57117,7 @@ async function generateGraphqlReturnTypes(config2, docs) {
|
|
|
57008
57117
|
const fileContent = await fs_exports.readFile(indexPath) || "";
|
|
57009
57118
|
const contents = await parseJS(fileContent);
|
|
57010
57119
|
const graphql_tag_return = config2.plugins.find(
|
|
57011
|
-
(
|
|
57120
|
+
(plugin2) => plugin2.graphql_tag_return
|
|
57012
57121
|
)?.graphql_tag_return;
|
|
57013
57122
|
if (!graphql_tag_return || !contents) {
|
|
57014
57123
|
return fileContent;
|
|
@@ -57017,7 +57126,7 @@ async function generateGraphqlReturnTypes(config2, docs) {
|
|
|
57017
57126
|
for (const doc of docs) {
|
|
57018
57127
|
const return_value = graphql_tag_return({
|
|
57019
57128
|
config: config2,
|
|
57020
|
-
doc,
|
|
57129
|
+
document: doc,
|
|
57021
57130
|
ensure_import({ identifier, module }) {
|
|
57022
57131
|
ensureImports({
|
|
57023
57132
|
config: config2,
|
|
@@ -57066,19 +57175,19 @@ async function injectPlugins({
|
|
|
57066
57175
|
importStatement,
|
|
57067
57176
|
exportStatement
|
|
57068
57177
|
}) {
|
|
57069
|
-
const client_plugins = config2.plugins.filter((
|
|
57070
|
-
let plugins =
|
|
57178
|
+
const client_plugins = config2.plugins.filter((plugin2) => plugin2.client_plugins).reduce((acc, plugin2) => {
|
|
57179
|
+
let plugins = plugin2.client_plugins;
|
|
57071
57180
|
if (typeof plugins === "function") {
|
|
57072
|
-
plugins = plugins(config2, config2.pluginConfig(
|
|
57181
|
+
plugins = plugins(config2, config2.pluginConfig(plugin2.name));
|
|
57073
57182
|
}
|
|
57074
57183
|
return [...acc, ...Object.entries(plugins)];
|
|
57075
57184
|
}, []);
|
|
57076
57185
|
return client_plugins.length > 0 ? `
|
|
57077
|
-
${client_plugins.map((
|
|
57186
|
+
${client_plugins.map((plugin2, i) => importStatement(plugin2[0], `plugin${i}`))}
|
|
57078
57187
|
|
|
57079
57188
|
const plugins = [
|
|
57080
|
-
${client_plugins.map((
|
|
57081
|
-
const suffix =
|
|
57189
|
+
${client_plugins.map((plugin2, i) => {
|
|
57190
|
+
const suffix = `(${JSON.stringify(plugin2[1])})`;
|
|
57082
57191
|
return `plugin${i}${suffix}`;
|
|
57083
57192
|
}).join(",\n")}
|
|
57084
57193
|
]
|
|
@@ -57121,37 +57230,35 @@ ${exportStatement("config")}
|
|
|
57121
57230
|
},
|
|
57122
57231
|
[path_exports.join(config2.runtimeSource, "client", "plugins", "injectedPlugins.js")]: (content) => injectPlugins({ config: config2, content, importStatement, exportStatement })
|
|
57123
57232
|
}),
|
|
57124
|
-
...config2.plugins.filter((
|
|
57233
|
+
...config2.plugins.filter((plugin2) => plugin2.include_runtime).map((plugin2) => generatePluginRuntime(config2, plugin2)),
|
|
57125
57234
|
generatePluginIndex({ config: config2, exportStatement: exportStar })
|
|
57126
57235
|
]);
|
|
57127
57236
|
await generateGraphqlReturnTypes(config2, docs);
|
|
57128
57237
|
}
|
|
57129
|
-
async function generatePluginRuntime(config2,
|
|
57130
|
-
if (houdini_mode.is_testing) {
|
|
57238
|
+
async function generatePluginRuntime(config2, plugin2) {
|
|
57239
|
+
if (houdini_mode.is_testing || !plugin2.include_runtime) {
|
|
57131
57240
|
return;
|
|
57132
57241
|
}
|
|
57133
|
-
const
|
|
57134
|
-
|
|
57135
|
-
"
|
|
57136
|
-
"runtime-" + (config2.module === "esm" ? "esm" : "cjs")
|
|
57242
|
+
const runtime_path = path_exports.join(
|
|
57243
|
+
path_exports.dirname(plugin2.filepath),
|
|
57244
|
+
typeof plugin2.include_runtime === "string" ? plugin2.include_runtime : plugin2.include_runtime[config2.module]
|
|
57137
57245
|
);
|
|
57138
57246
|
try {
|
|
57139
|
-
await fs_exports.stat(
|
|
57247
|
+
await fs_exports.stat(runtime_path);
|
|
57140
57248
|
} catch {
|
|
57141
57249
|
throw new HoudiniError({
|
|
57142
|
-
message:
|
|
57143
|
-
description: "
|
|
57250
|
+
message: "Cannot find runtime to generate for " + plugin2.name,
|
|
57251
|
+
description: "Maybe it was bundled?"
|
|
57144
57252
|
});
|
|
57145
57253
|
}
|
|
57146
|
-
const
|
|
57147
|
-
const pluginDir = config2.pluginRuntimeDirectory(plugin.name);
|
|
57254
|
+
const pluginDir = config2.pluginRuntimeDirectory(plugin2.name);
|
|
57148
57255
|
await fs_exports.mkdirp(pluginDir);
|
|
57149
57256
|
await fs_exports.recursiveCopy(
|
|
57150
|
-
|
|
57257
|
+
runtime_path,
|
|
57151
57258
|
pluginDir,
|
|
57152
57259
|
Object.fromEntries(
|
|
57153
|
-
Object.entries(
|
|
57154
|
-
path_exports.join(
|
|
57260
|
+
Object.entries(plugin2.transform_runtime ?? {}).map(([key, value]) => [
|
|
57261
|
+
path_exports.join(runtime_path, key),
|
|
57155
57262
|
(content) => value({ config: config2, content })
|
|
57156
57263
|
])
|
|
57157
57264
|
)
|
|
@@ -57552,7 +57659,7 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
57552
57659
|
}
|
|
57553
57660
|
const missingScalars = /* @__PURE__ */ new Set();
|
|
57554
57661
|
await Promise.all(
|
|
57555
|
-
docs.map(async ({ originalDocument, name
|
|
57662
|
+
docs.map(async ({ originalDocument, name, filename, generateArtifact }) => {
|
|
57556
57663
|
if (!generateArtifact) {
|
|
57557
57664
|
return;
|
|
57558
57665
|
}
|
|
@@ -57560,7 +57667,7 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
57560
57667
|
const program = AST11.program([]);
|
|
57561
57668
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
57562
57669
|
let definition = originalDocument.definitions.find(
|
|
57563
|
-
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value ===
|
|
57670
|
+
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value === name
|
|
57564
57671
|
);
|
|
57565
57672
|
const selections = flattenSelections({
|
|
57566
57673
|
config: config2,
|
|
@@ -57614,22 +57721,22 @@ export { default as ${as} } from "${module}"
|
|
|
57614
57721
|
export * from "${module}"
|
|
57615
57722
|
`;
|
|
57616
57723
|
let indexContent = recast11.print(typeIndex).code;
|
|
57617
|
-
for (const
|
|
57618
|
-
if (!
|
|
57724
|
+
for (const plugin2 of config2.plugins) {
|
|
57725
|
+
if (!plugin2.index_file) {
|
|
57619
57726
|
continue;
|
|
57620
57727
|
}
|
|
57621
|
-
indexContent =
|
|
57728
|
+
indexContent = plugin2.index_file({
|
|
57622
57729
|
config: config2,
|
|
57623
57730
|
content: indexContent,
|
|
57624
57731
|
export_default_as,
|
|
57625
57732
|
export_star_from,
|
|
57626
|
-
plugin_root: config2.pluginDirectory(
|
|
57733
|
+
plugin_root: config2.pluginDirectory(plugin2.name),
|
|
57627
57734
|
typedef: true,
|
|
57628
57735
|
documents: docs
|
|
57629
57736
|
});
|
|
57630
|
-
if (
|
|
57737
|
+
if (plugin2.include_runtime) {
|
|
57631
57738
|
indexContent += export_star_from({
|
|
57632
|
-
module: "./" + path_exports.relative(config2.rootDir, config2.pluginRuntimeDirectory(
|
|
57739
|
+
module: "./" + path_exports.relative(config2.rootDir, config2.pluginRuntimeDirectory(plugin2.name))
|
|
57633
57740
|
});
|
|
57634
57741
|
}
|
|
57635
57742
|
}
|
|
@@ -57875,9 +57982,9 @@ var graphql17 = __toESM(require_graphql2(), 1);
|
|
|
57875
57982
|
var recast12 = __toESM(require_main2(), 1);
|
|
57876
57983
|
var AST12 = recast12.types.builders;
|
|
57877
57984
|
async function imperativeCacheTypef(config2, docs) {
|
|
57878
|
-
const returnType = (doc) => config2.plugins.find((
|
|
57985
|
+
const returnType = (doc) => config2.plugins.find((plugin2) => plugin2.graphql_tag_return)?.graphql_tag_return?.({
|
|
57879
57986
|
config: config2,
|
|
57880
|
-
doc,
|
|
57987
|
+
document: doc,
|
|
57881
57988
|
ensure_import({ identifier, module }) {
|
|
57882
57989
|
ensureImports({
|
|
57883
57990
|
config: config2,
|
|
@@ -58222,12 +58329,12 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
58222
58329
|
}, {});
|
|
58223
58330
|
}
|
|
58224
58331
|
var CacheTypeDefName = "CacheTypeDef";
|
|
58225
|
-
function record(
|
|
58332
|
+
function record(name) {
|
|
58226
58333
|
return AST12.tsTypeReference(
|
|
58227
58334
|
AST12.identifier("Record"),
|
|
58228
58335
|
AST12.tsTypeParameterInstantiation([
|
|
58229
58336
|
AST12.tsTypeReference(AST12.identifier(CacheTypeDefName)),
|
|
58230
|
-
AST12.tsLiteralType(AST12.stringLiteral(
|
|
58337
|
+
AST12.tsLiteralType(AST12.stringLiteral(name))
|
|
58231
58338
|
])
|
|
58232
58339
|
);
|
|
58233
58340
|
}
|
|
@@ -58256,7 +58363,7 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
58256
58363
|
let rawString = graphql18.print(
|
|
58257
58364
|
graphql18.visit(document, {
|
|
58258
58365
|
Directive(node) {
|
|
58259
|
-
if (config2.isInternalDirective(node)) {
|
|
58366
|
+
if (config2.isInternalDirective(node.name.value)) {
|
|
58260
58367
|
return null;
|
|
58261
58368
|
}
|
|
58262
58369
|
}
|
|
@@ -58266,7 +58373,7 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
58266
58373
|
({ kind }) => kind === graphql18.Kind.OPERATION_DEFINITION
|
|
58267
58374
|
);
|
|
58268
58375
|
if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
|
|
58269
|
-
acc[hashDocument(rawString)] = rawString;
|
|
58376
|
+
acc[hashDocument({ config: config2, document: rawString })] = rawString;
|
|
58270
58377
|
}
|
|
58271
58378
|
return acc;
|
|
58272
58379
|
}, {});
|
|
@@ -58286,10 +58393,10 @@ async function definitionsGenerator(config2) {
|
|
|
58286
58393
|
const runtimeDefinitions = recast13.print(
|
|
58287
58394
|
AST13.program(
|
|
58288
58395
|
enums.map((defn) => {
|
|
58289
|
-
const
|
|
58396
|
+
const name = defn.name.value;
|
|
58290
58397
|
return moduleExport(
|
|
58291
58398
|
config2,
|
|
58292
|
-
|
|
58399
|
+
name,
|
|
58293
58400
|
AST13.objectExpression(
|
|
58294
58401
|
defn.values?.map((value) => {
|
|
58295
58402
|
const str = value.name.value;
|
|
@@ -58346,24 +58453,24 @@ async function writeIndexFile2(config2, docs) {
|
|
|
58346
58453
|
export_star_from({ module: artifactDir }),
|
|
58347
58454
|
export_star_from({ module: definitionsDir })
|
|
58348
58455
|
].join("");
|
|
58349
|
-
for (const
|
|
58350
|
-
if (
|
|
58351
|
-
body =
|
|
58456
|
+
for (const plugin2 of config2.plugins) {
|
|
58457
|
+
if (plugin2.index_file) {
|
|
58458
|
+
body = plugin2.index_file({
|
|
58352
58459
|
config: config2,
|
|
58353
58460
|
content: body,
|
|
58354
58461
|
export_default_as,
|
|
58355
58462
|
export_star_from,
|
|
58356
|
-
plugin_root: config2.pluginDirectory(
|
|
58463
|
+
plugin_root: config2.pluginDirectory(plugin2.name),
|
|
58357
58464
|
typedef: false,
|
|
58358
58465
|
documents: docs
|
|
58359
58466
|
});
|
|
58360
58467
|
}
|
|
58361
|
-
if (
|
|
58468
|
+
if (plugin2.include_runtime) {
|
|
58362
58469
|
body += export_star_from({
|
|
58363
|
-
module: relative2(config2.pluginRuntimeDirectory(
|
|
58470
|
+
module: relative2(config2.pluginRuntimeDirectory(plugin2.name))
|
|
58364
58471
|
});
|
|
58365
58472
|
}
|
|
58366
|
-
if (!
|
|
58473
|
+
if (!plugin2.index_file) {
|
|
58367
58474
|
continue;
|
|
58368
58475
|
}
|
|
58369
58476
|
}
|
|
@@ -58373,7 +58480,7 @@ async function writeIndexFile2(config2, docs) {
|
|
|
58373
58480
|
// src/codegen/transforms/schema.ts
|
|
58374
58481
|
var graphql20 = __toESM(require_graphql2(), 1);
|
|
58375
58482
|
async function graphqlExtensions(config2, documents) {
|
|
58376
|
-
|
|
58483
|
+
let internalSchema = `
|
|
58377
58484
|
enum CachePolicy {
|
|
58378
58485
|
${"CacheAndNetwork" /* CacheAndNetwork */}
|
|
58379
58486
|
${"CacheOnly" /* CacheOnly */}
|
|
@@ -58414,6 +58521,7 @@ directive @${config2.listAllListsDirective} on FRAGMENT_SPREAD
|
|
|
58414
58521
|
"""
|
|
58415
58522
|
directive @${config2.listParentDirective}(value: ID!) on FRAGMENT_SPREAD
|
|
58416
58523
|
|
|
58524
|
+
|
|
58417
58525
|
"""
|
|
58418
58526
|
@${config2.whenDirective} is used to provide a conditional or in situations where it doesn't make sense (eg when removing or deleting a node.)
|
|
58419
58527
|
"""
|
|
@@ -58429,6 +58537,11 @@ directive @${config2.whenNotDirective} on FRAGMENT_SPREAD
|
|
|
58429
58537
|
"""
|
|
58430
58538
|
directive @${config2.argumentsDirective} on FRAGMENT_DEFINITION
|
|
58431
58539
|
|
|
58540
|
+
"""
|
|
58541
|
+
@${config2.withDirective} is used to provide arguments to fragments that have been marked with @${config2.argumentsDirective}
|
|
58542
|
+
"""
|
|
58543
|
+
directive @${config2.withDirective} on FRAGMENT_SPREAD
|
|
58544
|
+
|
|
58432
58545
|
"""
|
|
58433
58546
|
@${config2.cacheDirective} is used to specify cache rules for a query
|
|
58434
58547
|
"""
|
|
@@ -58449,6 +58562,12 @@ directive @${config2.maskEnableDirective} on FRAGMENT_SPREAD
|
|
|
58449
58562
|
"""
|
|
58450
58563
|
directive @${config2.maskDisableDirective} on FRAGMENT_SPREAD
|
|
58451
58564
|
`;
|
|
58565
|
+
for (const plugin2 of config2.plugins) {
|
|
58566
|
+
if (!plugin2.schema) {
|
|
58567
|
+
continue;
|
|
58568
|
+
}
|
|
58569
|
+
internalSchema += plugin2.schema({ config: config2 });
|
|
58570
|
+
}
|
|
58452
58571
|
let currentSchema = graphql20.printSchema(config2.schema);
|
|
58453
58572
|
if (!currentSchema.includes(`directive @${config2.listDirective}`)) {
|
|
58454
58573
|
currentSchema += internalSchema;
|
|
@@ -58631,7 +58750,7 @@ async function typeCheck(config2, docs) {
|
|
|
58631
58750
|
}
|
|
58632
58751
|
needsParent = needsParent || definition.kind === "FragmentDefinition";
|
|
58633
58752
|
const nameArg = directive.arguments?.find(
|
|
58634
|
-
({ name
|
|
58753
|
+
({ name }) => name.value === config2.listNameArg
|
|
58635
58754
|
);
|
|
58636
58755
|
if (!nameArg) {
|
|
58637
58756
|
if (directive.name.value === config2.listDirective) {
|
|
@@ -58801,14 +58920,14 @@ var validateLists = ({
|
|
|
58801
58920
|
return;
|
|
58802
58921
|
}
|
|
58803
58922
|
let directive = node.directives?.find(
|
|
58804
|
-
({ name
|
|
58923
|
+
({ name }) => name.value === config2.listParentDirective
|
|
58805
58924
|
);
|
|
58806
58925
|
if (directive) {
|
|
58807
58926
|
return;
|
|
58808
58927
|
}
|
|
58809
58928
|
let parentIdFound = false;
|
|
58810
|
-
directive = node.directives?.find(({ name
|
|
58811
|
-
[config2.listPrependDirective, config2.listAppendDirective].includes(
|
|
58929
|
+
directive = node.directives?.find(({ name }) => [
|
|
58930
|
+
[config2.listPrependDirective, config2.listAppendDirective].includes(name.value)
|
|
58812
58931
|
]);
|
|
58813
58932
|
if (directive) {
|
|
58814
58933
|
let parentArg = directive.arguments?.find(
|
|
@@ -58826,7 +58945,7 @@ var validateLists = ({
|
|
|
58826
58945
|
return;
|
|
58827
58946
|
}
|
|
58828
58947
|
const allLists = node.directives?.find(
|
|
58829
|
-
({ name
|
|
58948
|
+
({ name }) => config2.listAllListsDirective === name.value
|
|
58830
58949
|
);
|
|
58831
58950
|
if (allLists || config2.defaultListTarget === "all") {
|
|
58832
58951
|
return;
|
|
@@ -58848,7 +58967,7 @@ var validateLists = ({
|
|
|
58848
58967
|
);
|
|
58849
58968
|
return;
|
|
58850
58969
|
}
|
|
58851
|
-
if (!config2.isInternalDirective(node)) {
|
|
58970
|
+
if (!config2.isInternalDirective(node.name.value)) {
|
|
58852
58971
|
if (!config2.schema.getDirective(directiveName)) {
|
|
58853
58972
|
ctx.reportError(
|
|
58854
58973
|
new graphql23.GraphQLError(
|
|
@@ -58991,9 +59110,9 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
58991
59110
|
);
|
|
58992
59111
|
} else {
|
|
58993
59112
|
const zipped = appliedArgumentNames.map(
|
|
58994
|
-
(
|
|
58995
|
-
appliedArguments[
|
|
58996
|
-
fragmentArguments2[fragmentName].find((arg) => arg.name ===
|
|
59113
|
+
(name) => [
|
|
59114
|
+
appliedArguments[name],
|
|
59115
|
+
fragmentArguments2[fragmentName].find((arg) => arg.name === name).type
|
|
58997
59116
|
]
|
|
58998
59117
|
);
|
|
58999
59118
|
for (const [applied, target] of zipped) {
|
|
@@ -59319,9 +59438,9 @@ For more information, please visit these links:
|
|
|
59319
59438
|
// src/codegen/validators/uniqueNames.ts
|
|
59320
59439
|
async function uniqueDocumentNames(config2, docs) {
|
|
59321
59440
|
const nameMap = docs.reduce(
|
|
59322
|
-
(acc, { name
|
|
59441
|
+
(acc, { name, filename }) => ({
|
|
59323
59442
|
...acc,
|
|
59324
|
-
[
|
|
59443
|
+
[name]: [...acc[name] || [], filename]
|
|
59325
59444
|
}),
|
|
59326
59445
|
{}
|
|
59327
59446
|
);
|
|
@@ -59368,12 +59487,12 @@ async function noIDAlias(config2, docs) {
|
|
|
59368
59487
|
// src/codegen/validators/plugins.ts
|
|
59369
59488
|
async function validatePlugins(config2, documents) {
|
|
59370
59489
|
let errors = [];
|
|
59371
|
-
for (const
|
|
59372
|
-
if (!
|
|
59490
|
+
for (const plugin2 of config2.plugins) {
|
|
59491
|
+
if (!plugin2.validate) {
|
|
59373
59492
|
continue;
|
|
59374
59493
|
}
|
|
59375
59494
|
try {
|
|
59376
|
-
await
|
|
59495
|
+
await plugin2.validate({ config: config2, documents });
|
|
59377
59496
|
} catch (err) {
|
|
59378
59497
|
errors.push(err);
|
|
59379
59498
|
}
|
|
@@ -59398,40 +59517,55 @@ async function runPipeline2(config2, docs) {
|
|
|
59398
59517
|
new: [],
|
|
59399
59518
|
deleted: []
|
|
59400
59519
|
};
|
|
59401
|
-
const generatePlugins = config2.plugins.filter((
|
|
59520
|
+
const generatePlugins = config2.plugins.filter((plugin2) => plugin2.generate);
|
|
59521
|
+
const after_validate = config2.plugins.filter((plugin2) => plugin2.after_validate).map((plugin2) => plugin2.after_validate);
|
|
59522
|
+
const validate2 = config2.plugins.filter((plugin2) => plugin2.validate).map((plugin2) => plugin2.validate);
|
|
59523
|
+
const before_validate = config2.plugins.filter((plugin2) => plugin2.before_validate).map((plugin2) => plugin2.before_validate);
|
|
59524
|
+
const transform_before_generate = config2.plugins.filter((plugin2) => plugin2.transform_before_generate).map((plugin2) => plugin2.transform_before_generate);
|
|
59525
|
+
const wrapHook = (hooks) => hooks.map(
|
|
59526
|
+
(fn) => (config3, docs2) => fn({
|
|
59527
|
+
config: config3,
|
|
59528
|
+
documents: docs2
|
|
59529
|
+
})
|
|
59530
|
+
);
|
|
59402
59531
|
let error = null;
|
|
59403
59532
|
try {
|
|
59404
59533
|
await runPipeline(
|
|
59405
59534
|
config2,
|
|
59406
59535
|
[
|
|
59536
|
+
graphqlExtensions,
|
|
59537
|
+
...wrapHook(before_validate),
|
|
59407
59538
|
typeCheck,
|
|
59408
59539
|
uniqueDocumentNames,
|
|
59409
59540
|
noIDAlias,
|
|
59410
59541
|
validatePlugins,
|
|
59411
|
-
|
|
59542
|
+
...wrapHook(validate2),
|
|
59543
|
+
...wrapHook(after_validate),
|
|
59412
59544
|
addID,
|
|
59413
59545
|
addTypename,
|
|
59414
59546
|
addListFragments,
|
|
59415
59547
|
paginate,
|
|
59416
59548
|
fragmentVariables,
|
|
59417
59549
|
includeFragmentDefinitions,
|
|
59550
|
+
...wrapHook(transform_before_generate),
|
|
59551
|
+
artifactGenerator(artifactStats),
|
|
59418
59552
|
runtimeGenerator,
|
|
59419
59553
|
writeIndexFile2,
|
|
59420
|
-
artifactGenerator(artifactStats),
|
|
59421
59554
|
typescriptGenerator,
|
|
59422
59555
|
persistOutputGenerator,
|
|
59423
59556
|
schemaGenerator,
|
|
59424
59557
|
...generatePlugins.map(
|
|
59425
|
-
(
|
|
59558
|
+
(plugin2) => async (config3, docs2) => await plugin2.generate({
|
|
59426
59559
|
config: config3,
|
|
59427
59560
|
documents: docs2,
|
|
59428
|
-
plugin_root: config3.pluginDirectory(
|
|
59561
|
+
plugin_root: config3.pluginDirectory(plugin2.name)
|
|
59429
59562
|
})
|
|
59430
59563
|
)
|
|
59431
59564
|
],
|
|
59432
59565
|
docs
|
|
59433
59566
|
);
|
|
59434
59567
|
} catch (e) {
|
|
59568
|
+
console.log(e);
|
|
59435
59569
|
error = e;
|
|
59436
59570
|
}
|
|
59437
59571
|
const unchanged = artifactStats.total.length - artifactStats.changed.length - artifactStats.new.length - artifactStats.deleted.length;
|
|
@@ -59480,15 +59614,19 @@ async function collectDocuments(config2) {
|
|
|
59480
59614
|
".js": [],
|
|
59481
59615
|
".ts": []
|
|
59482
59616
|
};
|
|
59483
|
-
for (const
|
|
59484
|
-
if (
|
|
59485
|
-
for (const extension of
|
|
59486
|
-
extractors[extension] = [...extractors[extension] || [],
|
|
59617
|
+
for (const plugin2 of config2.plugins) {
|
|
59618
|
+
if (plugin2.extensions && plugin2.extract_documents) {
|
|
59619
|
+
for (const extension of plugin2.extensions) {
|
|
59620
|
+
extractors[extension] = [...extractors[extension] || [], plugin2.extract_documents];
|
|
59487
59621
|
}
|
|
59488
59622
|
}
|
|
59489
59623
|
}
|
|
59490
|
-
const graphql_extractor = (
|
|
59491
|
-
|
|
59624
|
+
const graphql_extractor = ({
|
|
59625
|
+
content
|
|
59626
|
+
}) => [content];
|
|
59627
|
+
const javascript_extractor = ({
|
|
59628
|
+
content
|
|
59629
|
+
}) => processJSFile(config2, content);
|
|
59492
59630
|
extractors[".ts"].push(javascript_extractor);
|
|
59493
59631
|
extractors[".js"].push(javascript_extractor);
|
|
59494
59632
|
extractors[".graphql"].push(graphql_extractor);
|
|
@@ -59512,8 +59650,8 @@ async function collectDocuments(config2) {
|
|
|
59512
59650
|
if (!extractor) {
|
|
59513
59651
|
continue;
|
|
59514
59652
|
}
|
|
59515
|
-
const found = await extractor(config2, filepath, contents);
|
|
59516
|
-
if (found.length > 0) {
|
|
59653
|
+
const found = await extractor({ config: config2, filepath, content: contents });
|
|
59654
|
+
if (found && found.length > 0) {
|
|
59517
59655
|
documents.push(...found.map((document) => ({ filepath, document })));
|
|
59518
59656
|
}
|
|
59519
59657
|
}
|
|
@@ -59543,12 +59681,7 @@ async function processJSFile(config2, contents) {
|
|
|
59543
59681
|
return documents;
|
|
59544
59682
|
}
|
|
59545
59683
|
async function processGraphQLDocument(config2, filepath, document) {
|
|
59546
|
-
|
|
59547
|
-
var parsedDoc = graphql25.parse(document);
|
|
59548
|
-
} catch (e) {
|
|
59549
|
-
console.log("error parsing!!");
|
|
59550
|
-
throw e;
|
|
59551
|
-
}
|
|
59684
|
+
const parsedDoc = graphql25.parse(document);
|
|
59552
59685
|
const operations = parsedDoc.definitions.filter(
|
|
59553
59686
|
({ kind: kind2 }) => kind2 === graphql25.Kind.OPERATION_DEFINITION
|
|
59554
59687
|
);
|
|
@@ -59586,40 +59719,41 @@ async function processGraphQLDocument(config2, filepath, document) {
|
|
|
59586
59719
|
originalDocument: parsedDoc,
|
|
59587
59720
|
generateArtifact: true,
|
|
59588
59721
|
generateStore: true,
|
|
59589
|
-
originalString: document
|
|
59722
|
+
originalString: document,
|
|
59723
|
+
artifact: null
|
|
59590
59724
|
};
|
|
59591
59725
|
}
|
|
59592
|
-
function logStyled(kind, stat2, logLevel,
|
|
59726
|
+
function logStyled(kind, stat2, logLevel, plugin2) {
|
|
59593
59727
|
if (stat2.length > 0) {
|
|
59594
59728
|
const msg = [];
|
|
59595
|
-
if (
|
|
59729
|
+
if (plugin2) {
|
|
59596
59730
|
msg.push(`\u{1F3A9} `);
|
|
59597
59731
|
}
|
|
59598
59732
|
if (kind === "CREATED") {
|
|
59599
59733
|
msg.push(`\u2728 `);
|
|
59600
|
-
if (!
|
|
59734
|
+
if (!plugin2) {
|
|
59601
59735
|
msg.push(`New: ${stat2.length}`);
|
|
59602
59736
|
}
|
|
59603
59737
|
} else if (kind === "UPDATED") {
|
|
59604
59738
|
msg.push(`\u270F\uFE0F `);
|
|
59605
|
-
if (!
|
|
59739
|
+
if (!plugin2) {
|
|
59606
59740
|
msg.push(`Changed: ${stat2.length}`);
|
|
59607
59741
|
}
|
|
59608
59742
|
} else if (kind === "DELETED") {
|
|
59609
59743
|
msg.push(`\u{1F9F9} `);
|
|
59610
|
-
if (!
|
|
59744
|
+
if (!plugin2) {
|
|
59611
59745
|
msg.push(`Deleted: ${stat2.length}`);
|
|
59612
59746
|
}
|
|
59613
59747
|
}
|
|
59614
59748
|
const nbToDisplay = 5;
|
|
59615
|
-
if (
|
|
59749
|
+
if (plugin2) {
|
|
59616
59750
|
msg.push(`${stat2.slice(0, nbToDisplay).join(", ")}`);
|
|
59617
59751
|
if (stat2.length > 5) {
|
|
59618
59752
|
msg.push(`, ... ${stat2.length - nbToDisplay} more`);
|
|
59619
59753
|
}
|
|
59620
59754
|
}
|
|
59621
59755
|
console.log(msg.join(""));
|
|
59622
|
-
if (!
|
|
59756
|
+
if (!plugin2 && logLevel === "summary" /* Summary */) {
|
|
59623
59757
|
for (const artifact of stat2.slice(0, nbToDisplay)) {
|
|
59624
59758
|
console.log(` ${artifact}`);
|
|
59625
59759
|
}
|