houdini 1.0.0-next.4 → 1.0.0-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cmd-cjs/index.js +1217 -1021
- package/build/cmd-esm/index.js +1217 -1021
- package/build/codegen/generators/artifacts/utils.d.ts +0 -1
- package/build/codegen-cjs/index.js +810 -676
- package/build/codegen-esm/index.js +810 -676
- package/build/lib/config.d.ts +10 -90
- package/build/lib/deepMerge.d.ts +1 -0
- package/build/lib/graphql.d.ts +5 -2
- package/build/lib/index.d.ts +2 -0
- package/build/lib/pipeline.d.ts +1 -1
- package/build/lib/plugin.d.ts +2 -0
- package/build/lib/types.d.ts +250 -2
- package/build/lib-cjs/index.js +351 -162
- package/build/lib-esm/index.js +349 -162
- package/build/runtime/cache/cache.d.ts +20 -3
- package/build/runtime/cache/staleManager.d.ts +30 -0
- package/build/runtime/cache/subscription.d.ts +2 -1
- package/build/runtime/client/plugins/subscription.d.ts +1 -2
- package/build/runtime/lib/config.d.ts +4 -0
- package/build/runtime/lib/index.d.ts +1 -0
- package/build/runtime/lib/key.d.ts +6 -0
- package/build/runtime/lib/types.d.ts +2 -2
- package/build/runtime/public/cache.d.ts +8 -1
- package/build/runtime/public/record.d.ts +11 -1
- package/build/runtime/public/tests/test.d.ts +9 -10
- package/build/runtime-cjs/cache/cache.d.ts +20 -3
- package/build/runtime-cjs/cache/cache.js +65 -6
- package/build/runtime-cjs/cache/gc.js +9 -0
- package/build/runtime-cjs/cache/staleManager.d.ts +30 -0
- package/build/runtime-cjs/cache/staleManager.js +95 -0
- package/build/runtime-cjs/cache/subscription.d.ts +2 -1
- package/build/runtime-cjs/cache/subscription.js +6 -3
- package/build/runtime-cjs/client/documentStore.js +1 -0
- package/build/runtime-cjs/client/plugins/cache.js +5 -3
- package/build/runtime-cjs/client/plugins/fetch.js +1 -0
- package/build/runtime-cjs/client/plugins/query.js +1 -0
- package/build/runtime-cjs/client/plugins/subscription.d.ts +1 -2
- package/build/runtime-cjs/client/plugins/subscription.js +2 -0
- package/build/runtime-cjs/lib/config.d.ts +4 -0
- package/build/runtime-cjs/lib/index.d.ts +1 -0
- package/build/runtime-cjs/lib/index.js +1 -0
- package/build/runtime-cjs/lib/key.d.ts +6 -0
- package/build/runtime-cjs/lib/key.js +41 -0
- package/build/runtime-cjs/lib/types.d.ts +2 -2
- package/build/runtime-cjs/public/cache.d.ts +8 -1
- package/build/runtime-cjs/public/cache.js +3 -0
- package/build/runtime-cjs/public/record.d.ts +11 -1
- package/build/runtime-cjs/public/record.js +8 -1
- package/build/runtime-cjs/public/tests/test.d.ts +9 -10
- package/build/runtime-esm/cache/cache.d.ts +20 -3
- package/build/runtime-esm/cache/cache.js +66 -7
- package/build/runtime-esm/cache/gc.js +9 -0
- package/build/runtime-esm/cache/staleManager.d.ts +30 -0
- package/build/runtime-esm/cache/staleManager.js +71 -0
- package/build/runtime-esm/cache/subscription.d.ts +2 -1
- package/build/runtime-esm/cache/subscription.js +6 -3
- package/build/runtime-esm/client/documentStore.js +1 -0
- package/build/runtime-esm/client/plugins/cache.js +5 -3
- package/build/runtime-esm/client/plugins/fetch.js +1 -0
- package/build/runtime-esm/client/plugins/query.js +1 -0
- package/build/runtime-esm/client/plugins/subscription.d.ts +1 -2
- package/build/runtime-esm/client/plugins/subscription.js +2 -0
- package/build/runtime-esm/lib/config.d.ts +4 -0
- package/build/runtime-esm/lib/index.d.ts +1 -0
- package/build/runtime-esm/lib/index.js +1 -0
- package/build/runtime-esm/lib/key.d.ts +6 -0
- package/build/runtime-esm/lib/key.js +17 -0
- package/build/runtime-esm/lib/types.d.ts +2 -2
- package/build/runtime-esm/public/cache.d.ts +8 -1
- package/build/runtime-esm/public/cache.js +3 -0
- package/build/runtime-esm/public/record.d.ts +11 -1
- package/build/runtime-esm/public/record.js +8 -1
- package/build/runtime-esm/public/tests/test.d.ts +9 -10
- package/build/test-cjs/index.js +893 -747
- package/build/test-esm/index.js +893 -747
- package/build/vite-cjs/index.js +1195 -998
- package/build/vite-esm/index.js +1195 -998
- package/package.json +3 -2
package/build/test-esm/index.js
CHANGED
|
@@ -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];
|
|
@@ -15015,9 +15015,9 @@ var require_errors = __commonJS({
|
|
|
15015
15015
|
E("ERR_HTTP_TRAILER_INVALID", "Trailers are invalid with this transfer encoding");
|
|
15016
15016
|
E("ERR_INDEX_OUT_OF_RANGE", "Index out of range");
|
|
15017
15017
|
E("ERR_INVALID_ARG_TYPE", invalidArgType);
|
|
15018
|
-
E("ERR_INVALID_ARRAY_LENGTH", function(
|
|
15018
|
+
E("ERR_INVALID_ARRAY_LENGTH", function(name, len, actual) {
|
|
15019
15019
|
assert.strictEqual(typeof actual, "number");
|
|
15020
|
-
return 'The array "'.concat(
|
|
15020
|
+
return 'The array "'.concat(name, '" (length ').concat(actual, ") must be of length ").concat(len, ".");
|
|
15021
15021
|
});
|
|
15022
15022
|
E("ERR_INVALID_BUFFER_SIZE", "Buffer size must be a multiple of %s");
|
|
15023
15023
|
E("ERR_INVALID_CALLBACK", "Callback must be a function");
|
|
@@ -15028,8 +15028,8 @@ var require_errors = __commonJS({
|
|
|
15028
15028
|
E("ERR_INVALID_FILE_URL_PATH", "File URL path %s");
|
|
15029
15029
|
E("ERR_INVALID_HANDLE_TYPE", "This handle type cannot be sent");
|
|
15030
15030
|
E("ERR_INVALID_IP_ADDRESS", "Invalid IP address: %s");
|
|
15031
|
-
E("ERR_INVALID_OPT_VALUE", function(
|
|
15032
|
-
return 'The value "'.concat(String(value), '" is invalid for option "').concat(
|
|
15031
|
+
E("ERR_INVALID_OPT_VALUE", function(name, value) {
|
|
15032
|
+
return 'The value "'.concat(String(value), '" is invalid for option "').concat(name, '"');
|
|
15033
15033
|
});
|
|
15034
15034
|
E("ERR_INVALID_OPT_VALUE_ENCODING", function(value) {
|
|
15035
15035
|
return 'The value "'.concat(String(value), '" is invalid for option "encoding"');
|
|
@@ -15077,8 +15077,8 @@ var require_errors = __commonJS({
|
|
|
15077
15077
|
E("ERR_UNKNOWN_STDIN_TYPE", "Unknown stdin file type");
|
|
15078
15078
|
E("ERR_UNKNOWN_STREAM_TYPE", "Unknown stream file type");
|
|
15079
15079
|
E("ERR_V8BREAKITERATOR", "Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl");
|
|
15080
|
-
function invalidArgType(
|
|
15081
|
-
assert(
|
|
15080
|
+
function invalidArgType(name, expected, actual) {
|
|
15081
|
+
assert(name, "name is required");
|
|
15082
15082
|
var determiner;
|
|
15083
15083
|
if (expected.includes("not ")) {
|
|
15084
15084
|
determiner = "must not be";
|
|
@@ -15087,16 +15087,16 @@ var require_errors = __commonJS({
|
|
|
15087
15087
|
determiner = "must be";
|
|
15088
15088
|
}
|
|
15089
15089
|
var msg;
|
|
15090
|
-
if (Array.isArray(
|
|
15091
|
-
var names =
|
|
15090
|
+
if (Array.isArray(name)) {
|
|
15091
|
+
var names = name.map(function(val) {
|
|
15092
15092
|
return '"'.concat(val, '"');
|
|
15093
15093
|
}).join(", ");
|
|
15094
15094
|
msg = "The ".concat(names, " arguments ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
15095
|
-
} else if (
|
|
15096
|
-
msg = "The ".concat(
|
|
15095
|
+
} else if (name.includes(" argument")) {
|
|
15096
|
+
msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
15097
15097
|
} else {
|
|
15098
|
-
var type =
|
|
15099
|
-
msg = 'The "'.concat(
|
|
15098
|
+
var type = name.includes(".") ? "property" : "argument";
|
|
15099
|
+
msg = 'The "'.concat(name, '" ').concat(type, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
15100
15100
|
}
|
|
15101
15101
|
if (arguments.length >= 3) {
|
|
15102
15102
|
msg += ". Received type ".concat(actual !== null ? typeof actual : "null");
|
|
@@ -15148,11 +15148,11 @@ var require_errors = __commonJS({
|
|
|
15148
15148
|
return "of ".concat(thing, " ").concat(String(expected));
|
|
15149
15149
|
}
|
|
15150
15150
|
}
|
|
15151
|
-
function bufferOutOfBounds(
|
|
15151
|
+
function bufferOutOfBounds(name, isWriting) {
|
|
15152
15152
|
if (isWriting) {
|
|
15153
15153
|
return "Attempt to write outside buffer bounds";
|
|
15154
15154
|
} else {
|
|
15155
|
-
return '"'.concat(
|
|
15155
|
+
return '"'.concat(name, '" is outside of buffer bounds');
|
|
15156
15156
|
}
|
|
15157
15157
|
}
|
|
15158
15158
|
}
|
|
@@ -15550,7 +15550,7 @@ var require_node = __commonJS({
|
|
|
15550
15550
|
exports.Node = Node;
|
|
15551
15551
|
var Link = function(_super) {
|
|
15552
15552
|
__extends(Link2, _super);
|
|
15553
|
-
function Link2(vol3, parent,
|
|
15553
|
+
function Link2(vol3, parent, name) {
|
|
15554
15554
|
var _this = _super.call(this) || this;
|
|
15555
15555
|
_this.children = {};
|
|
15556
15556
|
_this._steps = [];
|
|
@@ -15558,7 +15558,7 @@ var require_node = __commonJS({
|
|
|
15558
15558
|
_this.length = 0;
|
|
15559
15559
|
_this.vol = vol3;
|
|
15560
15560
|
_this.parent = parent;
|
|
15561
|
-
_this.name =
|
|
15561
|
+
_this.name = name;
|
|
15562
15562
|
_this.syncSteps();
|
|
15563
15563
|
return _this;
|
|
15564
15564
|
}
|
|
@@ -15583,22 +15583,22 @@ var require_node = __commonJS({
|
|
|
15583
15583
|
Link2.prototype.getNode = function() {
|
|
15584
15584
|
return this.node;
|
|
15585
15585
|
};
|
|
15586
|
-
Link2.prototype.createChild = function(
|
|
15586
|
+
Link2.prototype.createChild = function(name, node) {
|
|
15587
15587
|
if (node === void 0) {
|
|
15588
15588
|
node = this.vol.createNode();
|
|
15589
15589
|
}
|
|
15590
|
-
var link = new Link2(this.vol, this,
|
|
15590
|
+
var link = new Link2(this.vol, this, name);
|
|
15591
15591
|
link.setNode(node);
|
|
15592
15592
|
if (node.isDirectory()) {
|
|
15593
15593
|
}
|
|
15594
|
-
this.setChild(
|
|
15594
|
+
this.setChild(name, link);
|
|
15595
15595
|
return link;
|
|
15596
15596
|
};
|
|
15597
|
-
Link2.prototype.setChild = function(
|
|
15597
|
+
Link2.prototype.setChild = function(name, link) {
|
|
15598
15598
|
if (link === void 0) {
|
|
15599
|
-
link = new Link2(this.vol, this,
|
|
15599
|
+
link = new Link2(this.vol, this, name);
|
|
15600
15600
|
}
|
|
15601
|
-
this.children[
|
|
15601
|
+
this.children[name] = link;
|
|
15602
15602
|
link.parent = this;
|
|
15603
15603
|
this.length++;
|
|
15604
15604
|
this.emit("child:add", link, this);
|
|
@@ -15609,9 +15609,9 @@ var require_node = __commonJS({
|
|
|
15609
15609
|
this.length--;
|
|
15610
15610
|
this.emit("child:delete", link, this);
|
|
15611
15611
|
};
|
|
15612
|
-
Link2.prototype.getChild = function(
|
|
15613
|
-
if (Object.hasOwnProperty.call(this.children,
|
|
15614
|
-
return this.children[
|
|
15612
|
+
Link2.prototype.getChild = function(name) {
|
|
15613
|
+
if (Object.hasOwnProperty.call(this.children, name)) {
|
|
15614
|
+
return this.children[name];
|
|
15615
15615
|
}
|
|
15616
15616
|
};
|
|
15617
15617
|
Link2.prototype.getPath = function() {
|
|
@@ -16500,17 +16500,17 @@ var require_volume = __commonJS({
|
|
|
16500
16500
|
enumerable: false,
|
|
16501
16501
|
configurable: true
|
|
16502
16502
|
});
|
|
16503
|
-
Volume2.prototype.createLink = function(parent,
|
|
16503
|
+
Volume2.prototype.createLink = function(parent, name, isDirectory, perm) {
|
|
16504
16504
|
if (isDirectory === void 0) {
|
|
16505
16505
|
isDirectory = false;
|
|
16506
16506
|
}
|
|
16507
16507
|
if (!parent) {
|
|
16508
16508
|
return new this.props.Link(this, null, "");
|
|
16509
16509
|
}
|
|
16510
|
-
if (!
|
|
16510
|
+
if (!name) {
|
|
16511
16511
|
throw new Error("createLink: name cannot be empty");
|
|
16512
16512
|
}
|
|
16513
|
-
return parent.createChild(
|
|
16513
|
+
return parent.createChild(name, this.createNode(isDirectory, perm));
|
|
16514
16514
|
};
|
|
16515
16515
|
Volume2.prototype.deleteLink = function(link) {
|
|
16516
16516
|
var parent = link.parent;
|
|
@@ -17060,12 +17060,12 @@ var require_volume = __commonJS({
|
|
|
17060
17060
|
var dir2 = this.getLinkParent(steps2);
|
|
17061
17061
|
if (!dir2)
|
|
17062
17062
|
throw createError(ENOENT, "link", filename1, filename2);
|
|
17063
|
-
var
|
|
17064
|
-
if (dir2.getChild(
|
|
17063
|
+
var name = steps2[steps2.length - 1];
|
|
17064
|
+
if (dir2.getChild(name))
|
|
17065
17065
|
throw createError(EEXIST, "link", filename1, filename2);
|
|
17066
17066
|
var node = link1.getNode();
|
|
17067
17067
|
node.nlink++;
|
|
17068
|
-
dir2.createChild(
|
|
17068
|
+
dir2.createChild(name, node);
|
|
17069
17069
|
};
|
|
17070
17070
|
Volume2.prototype.copyFileBase = function(src, dest, flags) {
|
|
17071
17071
|
var buf = this.readFileSync(src);
|
|
@@ -17136,10 +17136,10 @@ var require_volume = __commonJS({
|
|
|
17136
17136
|
var dirLink = this.getLinkParent(pathSteps);
|
|
17137
17137
|
if (!dirLink)
|
|
17138
17138
|
throw createError(ENOENT, "symlink", targetFilename, pathFilename);
|
|
17139
|
-
var
|
|
17140
|
-
if (dirLink.getChild(
|
|
17139
|
+
var name = pathSteps[pathSteps.length - 1];
|
|
17140
|
+
if (dirLink.getChild(name))
|
|
17141
17141
|
throw createError(EEXIST, "symlink", targetFilename, pathFilename);
|
|
17142
|
-
var symlink = dirLink.createChild(
|
|
17142
|
+
var symlink = dirLink.createChild(name);
|
|
17143
17143
|
symlink.getNode().makeSymlink(filenameToSteps(targetFilename));
|
|
17144
17144
|
return symlink;
|
|
17145
17145
|
};
|
|
@@ -17245,9 +17245,9 @@ var require_volume = __commonJS({
|
|
|
17245
17245
|
if (oldLinkParent) {
|
|
17246
17246
|
oldLinkParent.deleteChild(link);
|
|
17247
17247
|
}
|
|
17248
|
-
var
|
|
17249
|
-
link.name =
|
|
17250
|
-
link.steps = __spreadArray(__spreadArray([], newPathDirLink.steps, true), [
|
|
17248
|
+
var name = newPathSteps[newPathSteps.length - 1];
|
|
17249
|
+
link.name = name;
|
|
17250
|
+
link.steps = __spreadArray(__spreadArray([], newPathDirLink.steps, true), [name], false);
|
|
17251
17251
|
newPathDirLink.setChild(link.getName(), link);
|
|
17252
17252
|
};
|
|
17253
17253
|
Volume2.prototype.renameSync = function(oldPath, newPath) {
|
|
@@ -17466,10 +17466,10 @@ var require_volume = __commonJS({
|
|
|
17466
17466
|
throw createError(EEXIST, "mkdir", filename);
|
|
17467
17467
|
}
|
|
17468
17468
|
var dir = this.getLinkParentAsDirOrThrow(filename, "mkdir");
|
|
17469
|
-
var
|
|
17470
|
-
if (dir.getChild(
|
|
17469
|
+
var name = steps[steps.length - 1];
|
|
17470
|
+
if (dir.getChild(name))
|
|
17471
17471
|
throw createError(EEXIST, "mkdir", filename);
|
|
17472
|
-
dir.createChild(
|
|
17472
|
+
dir.createChild(name, this.createNode(true, modeNum));
|
|
17473
17473
|
};
|
|
17474
17474
|
Volume2.prototype.mkdirpBase = function(filename, modeNum) {
|
|
17475
17475
|
var fullPath = resolve2(filename);
|
|
@@ -18980,6 +18980,109 @@ var require_minimatch = __commonJS({
|
|
|
18980
18980
|
}
|
|
18981
18981
|
});
|
|
18982
18982
|
|
|
18983
|
+
// ../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js
|
|
18984
|
+
var require_cjs = __commonJS({
|
|
18985
|
+
"../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module) {
|
|
18986
|
+
"use strict";
|
|
18987
|
+
var isMergeableObject = function isMergeableObject2(value) {
|
|
18988
|
+
return isNonNullObject(value) && !isSpecial(value);
|
|
18989
|
+
};
|
|
18990
|
+
function isNonNullObject(value) {
|
|
18991
|
+
return !!value && typeof value === "object";
|
|
18992
|
+
}
|
|
18993
|
+
function isSpecial(value) {
|
|
18994
|
+
var stringValue = Object.prototype.toString.call(value);
|
|
18995
|
+
return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
|
|
18996
|
+
}
|
|
18997
|
+
var canUseSymbol = typeof Symbol === "function" && Symbol.for;
|
|
18998
|
+
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
|
|
18999
|
+
function isReactElement(value) {
|
|
19000
|
+
return value.$$typeof === REACT_ELEMENT_TYPE;
|
|
19001
|
+
}
|
|
19002
|
+
function emptyTarget(val) {
|
|
19003
|
+
return Array.isArray(val) ? [] : {};
|
|
19004
|
+
}
|
|
19005
|
+
function cloneUnlessOtherwiseSpecified(value, options) {
|
|
19006
|
+
return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
|
|
19007
|
+
}
|
|
19008
|
+
function defaultArrayMerge(target, source, options) {
|
|
19009
|
+
return target.concat(source).map(function(element) {
|
|
19010
|
+
return cloneUnlessOtherwiseSpecified(element, options);
|
|
19011
|
+
});
|
|
19012
|
+
}
|
|
19013
|
+
function getMergeFunction(key, options) {
|
|
19014
|
+
if (!options.customMerge) {
|
|
19015
|
+
return deepmerge;
|
|
19016
|
+
}
|
|
19017
|
+
var customMerge = options.customMerge(key);
|
|
19018
|
+
return typeof customMerge === "function" ? customMerge : deepmerge;
|
|
19019
|
+
}
|
|
19020
|
+
function getEnumerableOwnPropertySymbols(target) {
|
|
19021
|
+
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
|
|
19022
|
+
return target.propertyIsEnumerable(symbol);
|
|
19023
|
+
}) : [];
|
|
19024
|
+
}
|
|
19025
|
+
function getKeys(target) {
|
|
19026
|
+
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
|
|
19027
|
+
}
|
|
19028
|
+
function propertyIsOnObject(object, property) {
|
|
19029
|
+
try {
|
|
19030
|
+
return property in object;
|
|
19031
|
+
} catch (_) {
|
|
19032
|
+
return false;
|
|
19033
|
+
}
|
|
19034
|
+
}
|
|
19035
|
+
function propertyIsUnsafe(target, key) {
|
|
19036
|
+
return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
|
|
19037
|
+
}
|
|
19038
|
+
function mergeObject(target, source, options) {
|
|
19039
|
+
var destination = {};
|
|
19040
|
+
if (options.isMergeableObject(target)) {
|
|
19041
|
+
getKeys(target).forEach(function(key) {
|
|
19042
|
+
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
|
19043
|
+
});
|
|
19044
|
+
}
|
|
19045
|
+
getKeys(source).forEach(function(key) {
|
|
19046
|
+
if (propertyIsUnsafe(target, key)) {
|
|
19047
|
+
return;
|
|
19048
|
+
}
|
|
19049
|
+
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
|
|
19050
|
+
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
|
|
19051
|
+
} else {
|
|
19052
|
+
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
|
|
19053
|
+
}
|
|
19054
|
+
});
|
|
19055
|
+
return destination;
|
|
19056
|
+
}
|
|
19057
|
+
function deepmerge(target, source, options) {
|
|
19058
|
+
options = options || {};
|
|
19059
|
+
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
|
|
19060
|
+
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
|
|
19061
|
+
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
|
19062
|
+
var sourceIsArray = Array.isArray(source);
|
|
19063
|
+
var targetIsArray = Array.isArray(target);
|
|
19064
|
+
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
19065
|
+
if (!sourceAndTargetTypesMatch) {
|
|
19066
|
+
return cloneUnlessOtherwiseSpecified(source, options);
|
|
19067
|
+
} else if (sourceIsArray) {
|
|
19068
|
+
return options.arrayMerge(target, source, options);
|
|
19069
|
+
} else {
|
|
19070
|
+
return mergeObject(target, source, options);
|
|
19071
|
+
}
|
|
19072
|
+
}
|
|
19073
|
+
deepmerge.all = function deepmergeAll(array, options) {
|
|
19074
|
+
if (!Array.isArray(array)) {
|
|
19075
|
+
throw new Error("first argument should be an array");
|
|
19076
|
+
}
|
|
19077
|
+
return array.reduce(function(prev, next) {
|
|
19078
|
+
return deepmerge(prev, next, options);
|
|
19079
|
+
}, {});
|
|
19080
|
+
};
|
|
19081
|
+
var deepmerge_1 = deepmerge;
|
|
19082
|
+
module.exports = deepmerge_1;
|
|
19083
|
+
}
|
|
19084
|
+
});
|
|
19085
|
+
|
|
18983
19086
|
// ../../node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js
|
|
18984
19087
|
var require_universalify = __commonJS({
|
|
18985
19088
|
"../../node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js"(exports) {
|
|
@@ -22524,8 +22627,8 @@ var require_once = __commonJS({
|
|
|
22524
22627
|
f.called = true;
|
|
22525
22628
|
return f.value = fn.apply(this, arguments);
|
|
22526
22629
|
};
|
|
22527
|
-
var
|
|
22528
|
-
f.onceError =
|
|
22630
|
+
var name = fn.name || "Function wrapped with `once`";
|
|
22631
|
+
f.onceError = name + " shouldn't be called more than once";
|
|
22529
22632
|
f.called = false;
|
|
22530
22633
|
return f;
|
|
22531
22634
|
}
|
|
@@ -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(print10, "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(print10, "typeAnnotation"));
|
|
@@ -53990,6 +54093,9 @@ var houdini_mode = {
|
|
|
53990
54093
|
}
|
|
53991
54094
|
};
|
|
53992
54095
|
|
|
54096
|
+
// src/lib/deepMerge.ts
|
|
54097
|
+
var import_deepmerge = __toESM(require_cjs(), 1);
|
|
54098
|
+
|
|
53993
54099
|
// src/lib/error.ts
|
|
53994
54100
|
var HoudiniError = class extends Error {
|
|
53995
54101
|
filepath = null;
|
|
@@ -54009,6 +54115,20 @@ var HoudiniError = class extends Error {
|
|
|
54009
54115
|
}
|
|
54010
54116
|
};
|
|
54011
54117
|
|
|
54118
|
+
// src/lib/deepMerge.ts
|
|
54119
|
+
function deepMerge(filepath, ...targets) {
|
|
54120
|
+
try {
|
|
54121
|
+
if (targets.length === 1) {
|
|
54122
|
+
return targets[0];
|
|
54123
|
+
} else if (targets.length === 2) {
|
|
54124
|
+
return (0, import_deepmerge.default)(targets[0], targets[1]);
|
|
54125
|
+
}
|
|
54126
|
+
return deepMerge(filepath, targets[0], deepMerge(filepath, ...targets.slice(1)));
|
|
54127
|
+
} catch (e) {
|
|
54128
|
+
throw new HoudiniError({ filepath, message: "could not merge: " + targets });
|
|
54129
|
+
}
|
|
54130
|
+
}
|
|
54131
|
+
|
|
54012
54132
|
// src/lib/fs.ts
|
|
54013
54133
|
var fs_exports = {};
|
|
54014
54134
|
__export(fs_exports, {
|
|
@@ -54286,6 +54406,15 @@ async function glob(pattern) {
|
|
|
54286
54406
|
}
|
|
54287
54407
|
glob.hasMagic = import_glob.glob.hasMagic;
|
|
54288
54408
|
|
|
54409
|
+
// src/lib/types.ts
|
|
54410
|
+
var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
54411
|
+
LogLevel2["Full"] = "full";
|
|
54412
|
+
LogLevel2["Summary"] = "summary";
|
|
54413
|
+
LogLevel2["ShortSummary"] = "short-summary";
|
|
54414
|
+
LogLevel2["Quiet"] = "quiet";
|
|
54415
|
+
return LogLevel2;
|
|
54416
|
+
})(LogLevel || {});
|
|
54417
|
+
|
|
54289
54418
|
// src/lib/config.ts
|
|
54290
54419
|
var currentDir = global.__dirname || dirname(fileURLToPath(import.meta.url));
|
|
54291
54420
|
var Config = class {
|
|
@@ -54304,7 +54433,6 @@ var Config = class {
|
|
|
54304
54433
|
internalListPosition;
|
|
54305
54434
|
defaultListTarget = null;
|
|
54306
54435
|
definitionsFolder;
|
|
54307
|
-
newSchema = "";
|
|
54308
54436
|
newDocuments = "";
|
|
54309
54437
|
defaultKeys = ["id"];
|
|
54310
54438
|
typeConfig;
|
|
@@ -54358,7 +54486,7 @@ var Config = class {
|
|
|
54358
54486
|
Object.values(LogLevel)
|
|
54359
54487
|
)}`
|
|
54360
54488
|
);
|
|
54361
|
-
logLevel =
|
|
54489
|
+
logLevel = "summary" /* Summary */;
|
|
54362
54490
|
}
|
|
54363
54491
|
this.schemaPath = schemaPath;
|
|
54364
54492
|
this.filepath = filepath;
|
|
@@ -54374,7 +54502,7 @@ var Config = class {
|
|
|
54374
54502
|
this.internalListPosition = defaultListPosition === "append" ? "last" : "first";
|
|
54375
54503
|
this.defaultListTarget = defaultListTarget;
|
|
54376
54504
|
this.definitionsFolder = definitionsPath;
|
|
54377
|
-
this.logLevel = (logLevel ||
|
|
54505
|
+
this.logLevel = (logLevel || "summary" /* Summary */).toLowerCase();
|
|
54378
54506
|
this.defaultFragmentMasking = defaultFragmentMasking;
|
|
54379
54507
|
this.routesDir = join(this.projectRoot, "src", "routes");
|
|
54380
54508
|
this.schemaPollInterval = watchSchema?.interval ?? 2e3;
|
|
@@ -54403,19 +54531,19 @@ var Config = class {
|
|
|
54403
54531
|
return Array.isArray(this.configFile.include) ? this.configFile.include : [this.configFile.include];
|
|
54404
54532
|
}
|
|
54405
54533
|
const extensions = [".graphql", ".gql", ".ts", ".js"].concat(
|
|
54406
|
-
this.plugins.flatMap((
|
|
54534
|
+
this.plugins.flatMap((plugin2) => plugin2.extensions ?? [])
|
|
54407
54535
|
);
|
|
54408
54536
|
return [`src/**/*{${extensions.join(",")}}`];
|
|
54409
54537
|
}
|
|
54410
|
-
pluginConfig(
|
|
54411
|
-
return this.configFile.plugins?.[
|
|
54538
|
+
pluginConfig(name) {
|
|
54539
|
+
return this.configFile.plugins?.[name] ?? {};
|
|
54412
54540
|
}
|
|
54413
54541
|
async getEnv() {
|
|
54414
54542
|
let env = process.env;
|
|
54415
|
-
for (const
|
|
54416
|
-
if (
|
|
54543
|
+
for (const plugin2 of this.plugins) {
|
|
54544
|
+
if (plugin2.env) {
|
|
54417
54545
|
env = {
|
|
54418
|
-
...await
|
|
54546
|
+
...await plugin2.env({ config: this, env })
|
|
54419
54547
|
};
|
|
54420
54548
|
}
|
|
54421
54549
|
}
|
|
@@ -54465,6 +54593,19 @@ var Config = class {
|
|
|
54465
54593
|
)
|
|
54466
54594
|
];
|
|
54467
54595
|
}
|
|
54596
|
+
#newSchemaInstance = null;
|
|
54597
|
+
#schemaString = "";
|
|
54598
|
+
set newSchema(value) {
|
|
54599
|
+
this.#schemaString = value;
|
|
54600
|
+
if (value) {
|
|
54601
|
+
this.#newSchemaInstance = graphql.buildSchema(value);
|
|
54602
|
+
} else {
|
|
54603
|
+
this.#newSchemaInstance = null;
|
|
54604
|
+
}
|
|
54605
|
+
}
|
|
54606
|
+
get newSchema() {
|
|
54607
|
+
return this.#schemaString;
|
|
54608
|
+
}
|
|
54468
54609
|
get artifactDirectory() {
|
|
54469
54610
|
return join(this.rootDir, this.artifactDirectoryName);
|
|
54470
54611
|
}
|
|
@@ -54501,23 +54642,8 @@ var Config = class {
|
|
|
54501
54642
|
get typeRootFile() {
|
|
54502
54643
|
return "$houdini.d.ts";
|
|
54503
54644
|
}
|
|
54504
|
-
findModule(pkg = "houdini", currentLocation = join(dirname(this.filepath))) {
|
|
54505
|
-
const pathEndingBy = ["node_modules", pkg];
|
|
54506
|
-
let locationFound = join(currentLocation, ...pathEndingBy);
|
|
54507
|
-
let previousLocation = "";
|
|
54508
|
-
const backFolder = [];
|
|
54509
|
-
while (previousLocation !== locationFound && !existsSync(locationFound)) {
|
|
54510
|
-
previousLocation = locationFound;
|
|
54511
|
-
backFolder.push("../");
|
|
54512
|
-
locationFound = join(currentLocation, ...backFolder, ...pathEndingBy);
|
|
54513
|
-
}
|
|
54514
|
-
if (previousLocation === locationFound) {
|
|
54515
|
-
throw new Error("Could not find any node_modules/houdini folder");
|
|
54516
|
-
}
|
|
54517
|
-
return locationFound;
|
|
54518
|
-
}
|
|
54519
54645
|
get runtimeSource() {
|
|
54520
|
-
const relative2 = houdini_mode.is_testing ? join(currentDir, "..", "..") : this.
|
|
54646
|
+
const relative2 = houdini_mode.is_testing ? join(currentDir, "..", "..") : findModule("houdini", join(dirname(this.filepath)));
|
|
54521
54647
|
const which = this.module === "esm" ? "esm" : "cjs";
|
|
54522
54648
|
return resolve(relative2, "build", `runtime-${which}`);
|
|
54523
54649
|
}
|
|
@@ -54527,8 +54653,8 @@ var Config = class {
|
|
|
54527
54653
|
artifactPath(document) {
|
|
54528
54654
|
return join(this.artifactDirectory, this.documentName(document) + ".js");
|
|
54529
54655
|
}
|
|
54530
|
-
artifactImportPath(
|
|
54531
|
-
return `$houdini/${this.artifactDirectoryName}/${
|
|
54656
|
+
artifactImportPath(name) {
|
|
54657
|
+
return `$houdini/${this.artifactDirectoryName}/${name}`;
|
|
54532
54658
|
}
|
|
54533
54659
|
keyFieldsForType(type) {
|
|
54534
54660
|
return keyFieldsForType(this.configFile, type);
|
|
@@ -54572,16 +54698,27 @@ var Config = class {
|
|
|
54572
54698
|
relative(process.cwd(), filepath).replaceAll(sep, "_").replace(".ts", ".js")
|
|
54573
54699
|
);
|
|
54574
54700
|
}
|
|
54701
|
+
excludeFile(filepath) {
|
|
54702
|
+
if (this.exclude.length > 0 && this.exclude.some((pattern) => (0, import_minimatch.default)(filepath, pattern))) {
|
|
54703
|
+
return true;
|
|
54704
|
+
}
|
|
54705
|
+
for (const plugin2 of this.plugins) {
|
|
54706
|
+
if (plugin2?.exclude?.({ config: this, filepath })) {
|
|
54707
|
+
return true;
|
|
54708
|
+
}
|
|
54709
|
+
}
|
|
54710
|
+
return false;
|
|
54711
|
+
}
|
|
54575
54712
|
includeFile(filepath, {
|
|
54576
54713
|
root = this.projectRoot,
|
|
54577
54714
|
ignore_plugins = false
|
|
54578
54715
|
} = {}) {
|
|
54579
54716
|
let included = false;
|
|
54580
|
-
for (const
|
|
54581
|
-
if (!
|
|
54717
|
+
for (const plugin2 of ignore_plugins ? [] : this.plugins) {
|
|
54718
|
+
if (!plugin2.include) {
|
|
54582
54719
|
continue;
|
|
54583
54720
|
}
|
|
54584
|
-
if (
|
|
54721
|
+
if (plugin2.include({ config: this, filepath })) {
|
|
54585
54722
|
included = true;
|
|
54586
54723
|
break;
|
|
54587
54724
|
}
|
|
@@ -54589,16 +54726,16 @@ var Config = class {
|
|
|
54589
54726
|
if (!included && !this.include.some((pattern) => (0, import_minimatch.default)(filepath, join(root, pattern)))) {
|
|
54590
54727
|
return false;
|
|
54591
54728
|
}
|
|
54592
|
-
return !this.
|
|
54729
|
+
return !this.excludeFile(filepath);
|
|
54593
54730
|
}
|
|
54594
|
-
pluginRuntimeDirectory(
|
|
54595
|
-
return join(this.pluginDirectory(
|
|
54731
|
+
pluginRuntimeDirectory(name) {
|
|
54732
|
+
return join(this.pluginDirectory(name), "runtime");
|
|
54596
54733
|
}
|
|
54597
54734
|
get pluginRootDirectory() {
|
|
54598
54735
|
return houdini_mode.is_testing ? "../../../" : join(this.rootDir, "plugins");
|
|
54599
54736
|
}
|
|
54600
|
-
pluginDirectory(
|
|
54601
|
-
return join(this.pluginRootDirectory,
|
|
54737
|
+
pluginDirectory(name) {
|
|
54738
|
+
return join(this.pluginRootDirectory, name);
|
|
54602
54739
|
}
|
|
54603
54740
|
get loadDirective() {
|
|
54604
54741
|
return "load";
|
|
@@ -54675,59 +54812,45 @@ var Config = class {
|
|
|
54675
54812
|
paginationQueryName(documentName) {
|
|
54676
54813
|
return documentName + "_Pagination_Query";
|
|
54677
54814
|
}
|
|
54678
|
-
isDeleteDirective(
|
|
54679
|
-
return
|
|
54815
|
+
isDeleteDirective(name) {
|
|
54816
|
+
return name.endsWith(this.deleteDirectiveSuffix);
|
|
54680
54817
|
}
|
|
54681
|
-
listDeleteDirective(
|
|
54682
|
-
return
|
|
54818
|
+
listDeleteDirective(name) {
|
|
54819
|
+
return name + this.deleteDirectiveSuffix;
|
|
54683
54820
|
}
|
|
54684
|
-
deleteDirectiveType(
|
|
54685
|
-
return
|
|
54821
|
+
deleteDirectiveType(name) {
|
|
54822
|
+
return name.slice(0, name.length - this.deleteDirectiveSuffix.length);
|
|
54686
54823
|
}
|
|
54687
|
-
isInsertFragment(
|
|
54688
|
-
return
|
|
54824
|
+
isInsertFragment(name) {
|
|
54825
|
+
return name.endsWith(this.insertFragmentSuffix);
|
|
54689
54826
|
}
|
|
54690
|
-
listInsertFragment(
|
|
54691
|
-
return
|
|
54827
|
+
listInsertFragment(name) {
|
|
54828
|
+
return name + this.insertFragmentSuffix;
|
|
54692
54829
|
}
|
|
54693
|
-
listToggleFragment(
|
|
54694
|
-
return
|
|
54830
|
+
listToggleFragment(name) {
|
|
54831
|
+
return name + this.toggleFragmentSuffix;
|
|
54695
54832
|
}
|
|
54696
|
-
isRemoveFragment(
|
|
54697
|
-
return
|
|
54833
|
+
isRemoveFragment(name) {
|
|
54834
|
+
return name.endsWith(this.removeFragmentSuffix);
|
|
54698
54835
|
}
|
|
54699
|
-
isToggleFragment(
|
|
54700
|
-
return
|
|
54836
|
+
isToggleFragment(name) {
|
|
54837
|
+
return name.endsWith(this.toggleFragmentSuffix);
|
|
54701
54838
|
}
|
|
54702
|
-
listRemoveFragment(
|
|
54703
|
-
return
|
|
54839
|
+
listRemoveFragment(name) {
|
|
54840
|
+
return name + this.removeFragmentSuffix;
|
|
54704
54841
|
}
|
|
54705
54842
|
isInternalEnum(node) {
|
|
54706
54843
|
return node.name.value === "CachePolicy";
|
|
54707
54844
|
}
|
|
54708
|
-
isInternalDirective(
|
|
54709
|
-
|
|
54710
|
-
|
|
54711
|
-
|
|
54712
|
-
|
|
54713
|
-
|
|
54714
|
-
|
|
54715
|
-
|
|
54716
|
-
|
|
54717
|
-
this.argumentsDirective,
|
|
54718
|
-
this.withDirective,
|
|
54719
|
-
this.paginateDirective,
|
|
54720
|
-
this.cacheDirective,
|
|
54721
|
-
this.loadDirective,
|
|
54722
|
-
this.maskEnableDirective,
|
|
54723
|
-
this.maskDisableDirective
|
|
54724
|
-
].includes(name2.value) || this.isDeleteDirective(name2.value);
|
|
54725
|
-
}
|
|
54726
|
-
isListFragment(name2) {
|
|
54727
|
-
return name2.endsWith(this.insertFragmentSuffix) || name2.endsWith(this.removeFragmentSuffix) || name2.endsWith(this.toggleFragmentSuffix);
|
|
54728
|
-
}
|
|
54729
|
-
isListOperationDirective(name2) {
|
|
54730
|
-
return name2.endsWith(this.deleteDirectiveSuffix);
|
|
54845
|
+
isInternalDirective(name) {
|
|
54846
|
+
const internalDirectives = this.#newSchemaInstance?.getDirectives().map((directive) => directive.name) ?? [];
|
|
54847
|
+
return internalDirectives.includes(name) || this.isDeleteDirective(name);
|
|
54848
|
+
}
|
|
54849
|
+
isListFragment(name) {
|
|
54850
|
+
return name.endsWith(this.insertFragmentSuffix) || name.endsWith(this.removeFragmentSuffix) || name.endsWith(this.toggleFragmentSuffix);
|
|
54851
|
+
}
|
|
54852
|
+
isListOperationDirective(name) {
|
|
54853
|
+
return name.endsWith(this.deleteDirectiveSuffix);
|
|
54731
54854
|
}
|
|
54732
54855
|
isFragmentForList(listName, fragmentName) {
|
|
54733
54856
|
return fragmentName.startsWith(listName);
|
|
@@ -54774,18 +54897,26 @@ var Config = class {
|
|
|
54774
54897
|
}
|
|
54775
54898
|
return definition;
|
|
54776
54899
|
}
|
|
54777
|
-
variableFunctionName(
|
|
54778
|
-
return
|
|
54900
|
+
variableFunctionName(name) {
|
|
54901
|
+
return name + "Variables";
|
|
54779
54902
|
}
|
|
54780
54903
|
};
|
|
54781
54904
|
var DEFAULT_CONFIG_PATH = join(process.cwd(), "houdini.config.js");
|
|
54782
|
-
|
|
54783
|
-
|
|
54784
|
-
|
|
54785
|
-
|
|
54786
|
-
|
|
54787
|
-
|
|
54788
|
-
|
|
54905
|
+
function findModule(pkg = "houdini", currentLocation) {
|
|
54906
|
+
const pathEndingBy = ["node_modules", pkg];
|
|
54907
|
+
let locationFound = join(currentLocation, ...pathEndingBy);
|
|
54908
|
+
let previousLocation = "";
|
|
54909
|
+
const backFolder = [];
|
|
54910
|
+
while (previousLocation !== locationFound && !existsSync(locationFound)) {
|
|
54911
|
+
previousLocation = locationFound;
|
|
54912
|
+
backFolder.push("../");
|
|
54913
|
+
locationFound = join(currentLocation, ...backFolder, ...pathEndingBy);
|
|
54914
|
+
}
|
|
54915
|
+
if (previousLocation === locationFound) {
|
|
54916
|
+
throw new Error("Could not find any node_modules/houdini folder");
|
|
54917
|
+
}
|
|
54918
|
+
return locationFound;
|
|
54919
|
+
}
|
|
54789
54920
|
|
|
54790
54921
|
// src/lib/graphql.ts
|
|
54791
54922
|
var graphql2 = __toESM(require_graphql2(), 1);
|
|
@@ -54799,8 +54930,10 @@ function getRootType(type) {
|
|
|
54799
54930
|
}
|
|
54800
54931
|
return type;
|
|
54801
54932
|
}
|
|
54802
|
-
function hashDocument(
|
|
54803
|
-
|
|
54933
|
+
function hashDocument({
|
|
54934
|
+
document
|
|
54935
|
+
}) {
|
|
54936
|
+
const docString = typeof document === "string" ? document : graphql2.print(document.document);
|
|
54804
54937
|
return crypto.createHash("sha256").update(docString).digest("hex");
|
|
54805
54938
|
}
|
|
54806
54939
|
function parentTypeFromAncestors(schema, filepath, ancestors) {
|
|
@@ -55093,13 +55226,13 @@ var FieldCollection = class {
|
|
|
55093
55226
|
this.fragmentSpreads[selection2.name.value] = selection2;
|
|
55094
55227
|
let includeFragments = this.config.defaultFragmentMasking === "disable";
|
|
55095
55228
|
const maskEnableDirective = selection2.directives?.find(
|
|
55096
|
-
({ name
|
|
55229
|
+
({ name }) => name.value === this.config.maskEnableDirective
|
|
55097
55230
|
);
|
|
55098
55231
|
if (maskEnableDirective) {
|
|
55099
55232
|
includeFragments = false;
|
|
55100
55233
|
}
|
|
55101
55234
|
const maskDisableDirective = selection2.directives?.find(
|
|
55102
|
-
({ name
|
|
55235
|
+
({ name }) => name.value === this.config.maskDisableDirective
|
|
55103
55236
|
);
|
|
55104
55237
|
if (maskDisableDirective) {
|
|
55105
55238
|
includeFragments = true;
|
|
@@ -55254,7 +55387,7 @@ var graphql3 = __toESM(require_graphql2(), 1);
|
|
|
55254
55387
|
var import_graphql = __toESM(require_graphql2(), 1);
|
|
55255
55388
|
async function includeFragmentDefinitions(config2, documents) {
|
|
55256
55389
|
const fragments = collectFragments(config2, documents);
|
|
55257
|
-
for (const [index, { name
|
|
55390
|
+
for (const [index, { name, document, filename }] of documents.entries()) {
|
|
55258
55391
|
const operation = document.definitions.find(
|
|
55259
55392
|
({ kind }) => kind === import_graphql.Kind.OPERATION_DEFINITION
|
|
55260
55393
|
);
|
|
@@ -55368,7 +55501,8 @@ async function fragmentVariables(config2, documents) {
|
|
|
55368
55501
|
generateStore: false,
|
|
55369
55502
|
generateArtifact: false,
|
|
55370
55503
|
filename: "generated::fragmentVariables",
|
|
55371
|
-
originalString: ""
|
|
55504
|
+
originalString: "",
|
|
55505
|
+
artifact: null
|
|
55372
55506
|
});
|
|
55373
55507
|
}
|
|
55374
55508
|
function inlineFragmentArgs({
|
|
@@ -55516,7 +55650,7 @@ function fragmentArguments(config2, filepath, definition) {
|
|
|
55516
55650
|
return [];
|
|
55517
55651
|
}
|
|
55518
55652
|
let type = typeArg.value;
|
|
55519
|
-
let
|
|
55653
|
+
let name = arg.name.value;
|
|
55520
55654
|
let required = false;
|
|
55521
55655
|
let defaultValue = arg.value.fields?.find((arg2) => arg2.name.value === "default")?.value || null;
|
|
55522
55656
|
if (type[type.length - 1] === "!") {
|
|
@@ -55526,7 +55660,7 @@ function fragmentArguments(config2, filepath, definition) {
|
|
|
55526
55660
|
}
|
|
55527
55661
|
return [
|
|
55528
55662
|
{
|
|
55529
|
-
name
|
|
55663
|
+
name,
|
|
55530
55664
|
type,
|
|
55531
55665
|
required,
|
|
55532
55666
|
defaultValue
|
|
@@ -55537,7 +55671,7 @@ function fragmentArguments(config2, filepath, definition) {
|
|
|
55537
55671
|
}
|
|
55538
55672
|
function collectDefaultArgumentValues(config2, filepath, definition) {
|
|
55539
55673
|
let result = {};
|
|
55540
|
-
for (const { name
|
|
55674
|
+
for (const { name, required, defaultValue } of fragmentArguments(
|
|
55541
55675
|
config2,
|
|
55542
55676
|
filepath,
|
|
55543
55677
|
definition
|
|
@@ -55545,7 +55679,7 @@ function collectDefaultArgumentValues(config2, filepath, definition) {
|
|
|
55545
55679
|
if (required || !defaultValue) {
|
|
55546
55680
|
continue;
|
|
55547
55681
|
}
|
|
55548
|
-
result[
|
|
55682
|
+
result[name] = defaultValue;
|
|
55549
55683
|
}
|
|
55550
55684
|
return result;
|
|
55551
55685
|
}
|
|
@@ -55712,30 +55846,6 @@ function serializeValue(value) {
|
|
|
55712
55846
|
}
|
|
55713
55847
|
return AST4.literal(value);
|
|
55714
55848
|
}
|
|
55715
|
-
function deepMerge(filepath, ...targets) {
|
|
55716
|
-
if (typeof targets[0] !== "object") {
|
|
55717
|
-
const matches = targets.filter((val) => val !== targets[0]).length === 0;
|
|
55718
|
-
if (!matches) {
|
|
55719
|
-
throw new HoudiniError({ filepath, message: "could not merge: " + targets });
|
|
55720
|
-
}
|
|
55721
|
-
return targets[0];
|
|
55722
|
-
}
|
|
55723
|
-
if (Array.isArray(targets[0])) {
|
|
55724
|
-
return targets[0].concat(...targets.slice(1));
|
|
55725
|
-
}
|
|
55726
|
-
const fields = {};
|
|
55727
|
-
for (const target of targets) {
|
|
55728
|
-
for (const [key, value] of Object.entries(target)) {
|
|
55729
|
-
if (!fields[key]) {
|
|
55730
|
-
fields[key] = [];
|
|
55731
|
-
}
|
|
55732
|
-
fields[key].push(value);
|
|
55733
|
-
}
|
|
55734
|
-
}
|
|
55735
|
-
return Object.fromEntries(
|
|
55736
|
-
Object.entries(fields).map(([key, value]) => [key, deepMerge(filepath, ...value)])
|
|
55737
|
-
);
|
|
55738
|
-
}
|
|
55739
55849
|
function convertValue(config2, val) {
|
|
55740
55850
|
let value;
|
|
55741
55851
|
let kind;
|
|
@@ -55820,14 +55930,14 @@ function operationObject({
|
|
|
55820
55930
|
let allLists = config2.defaultListTarget ?? void 0;
|
|
55821
55931
|
let operationWhen;
|
|
55822
55932
|
const internalDirectives = selection2.directives?.filter(
|
|
55823
|
-
(directive) => config2.isInternalDirective(directive)
|
|
55933
|
+
(directive) => config2.isInternalDirective(directive.name.value)
|
|
55824
55934
|
);
|
|
55825
55935
|
if (internalDirectives && internalDirectives.length > 0) {
|
|
55826
55936
|
const prepend = internalDirectives.find(
|
|
55827
|
-
({ name
|
|
55937
|
+
({ name }) => name.value === config2.listPrependDirective
|
|
55828
55938
|
);
|
|
55829
55939
|
const append = internalDirectives.find(
|
|
55830
|
-
({ name
|
|
55940
|
+
({ name }) => name.value === config2.listAppendDirective
|
|
55831
55941
|
);
|
|
55832
55942
|
if (append) {
|
|
55833
55943
|
position = "last";
|
|
@@ -55836,14 +55946,14 @@ function operationObject({
|
|
|
55836
55946
|
position = "first";
|
|
55837
55947
|
}
|
|
55838
55948
|
const allListsDirective = internalDirectives.find(
|
|
55839
|
-
({ name
|
|
55949
|
+
({ name }) => name.value === config2.listAllListsDirective
|
|
55840
55950
|
);
|
|
55841
55951
|
let parent = internalDirectives.find(
|
|
55842
|
-
({ name
|
|
55952
|
+
({ name }) => name.value === config2.listParentDirective
|
|
55843
55953
|
);
|
|
55844
55954
|
allLists = allListsDirective ? "all" : void 0;
|
|
55845
|
-
const when = internalDirectives.find(({ name
|
|
55846
|
-
const when_not = internalDirectives.find(({ name
|
|
55955
|
+
const when = internalDirectives.find(({ name }) => name.value === "when");
|
|
55956
|
+
const when_not = internalDirectives.find(({ name }) => name.value === "when_not");
|
|
55847
55957
|
let parentIDArg = parent?.arguments?.find((argument) => argument.name.value === "value");
|
|
55848
55958
|
if (parentIDArg) {
|
|
55849
55959
|
if (parentIDArg.value.kind === "StringValue") {
|
|
@@ -55854,9 +55964,9 @@ function operationObject({
|
|
|
55854
55964
|
parentID = parentIDArg.value.name.value;
|
|
55855
55965
|
}
|
|
55856
55966
|
}
|
|
55857
|
-
const whenArg = (append || prepend)?.arguments?.find(({ name
|
|
55967
|
+
const whenArg = (append || prepend)?.arguments?.find(({ name }) => name.value === "when");
|
|
55858
55968
|
const whenNotArg = (append || prepend)?.arguments?.find(
|
|
55859
|
-
({ name
|
|
55969
|
+
({ name }) => name.value === "when_not"
|
|
55860
55970
|
);
|
|
55861
55971
|
for (const [i, arg] of [whenArg, whenNotArg].entries()) {
|
|
55862
55972
|
if (!arg || arg.value.kind !== "ObjectValue") {
|
|
@@ -56089,7 +56199,7 @@ async function paginate(config2, documents) {
|
|
|
56089
56199
|
Object.keys(operationVariables).concat(Object.keys(newVariables))
|
|
56090
56200
|
);
|
|
56091
56201
|
const finalVariables = [...variableNames].map(
|
|
56092
|
-
(
|
|
56202
|
+
(name) => operationVariables[name] || newVariables[name]
|
|
56093
56203
|
);
|
|
56094
56204
|
return {
|
|
56095
56205
|
...node,
|
|
@@ -56186,7 +56296,7 @@ async function paginate(config2, documents) {
|
|
|
56186
56296
|
value: config2.withDirective
|
|
56187
56297
|
},
|
|
56188
56298
|
["arguments"]: paginationArgs.map(
|
|
56189
|
-
({ name
|
|
56299
|
+
({ name }) => variableAsArgument(name)
|
|
56190
56300
|
)
|
|
56191
56301
|
}
|
|
56192
56302
|
]
|
|
@@ -56314,7 +56424,8 @@ async function paginate(config2, documents) {
|
|
|
56314
56424
|
generateArtifact: true,
|
|
56315
56425
|
generateStore: false,
|
|
56316
56426
|
refetch: doc.refetch,
|
|
56317
|
-
originalString: ""
|
|
56427
|
+
originalString: "",
|
|
56428
|
+
artifact: null
|
|
56318
56429
|
});
|
|
56319
56430
|
}
|
|
56320
56431
|
}
|
|
@@ -56337,32 +56448,32 @@ function replaceArgumentsWithVariables(args, flags) {
|
|
|
56337
56448
|
seenArgs[arg.name.value] = true;
|
|
56338
56449
|
return variableAsArgument(arg.name.value, flags[arg.name.value].variableName);
|
|
56339
56450
|
});
|
|
56340
|
-
for (const
|
|
56341
|
-
const spec = flags[
|
|
56342
|
-
if (flags[
|
|
56451
|
+
for (const name of Object.keys(flags)) {
|
|
56452
|
+
const spec = flags[name];
|
|
56453
|
+
if (flags[name].defaultValue || !spec.enabled || seenArgs[name]) {
|
|
56343
56454
|
continue;
|
|
56344
56455
|
}
|
|
56345
|
-
newArgs.push(variableAsArgument(
|
|
56456
|
+
newArgs.push(variableAsArgument(name));
|
|
56346
56457
|
}
|
|
56347
56458
|
return newArgs;
|
|
56348
56459
|
}
|
|
56349
|
-
function variableAsArgument(
|
|
56460
|
+
function variableAsArgument(name, variable) {
|
|
56350
56461
|
return {
|
|
56351
56462
|
kind: graphql8.Kind.ARGUMENT,
|
|
56352
56463
|
name: {
|
|
56353
56464
|
kind: graphql8.Kind.NAME,
|
|
56354
|
-
value:
|
|
56465
|
+
value: name
|
|
56355
56466
|
},
|
|
56356
56467
|
value: {
|
|
56357
56468
|
kind: graphql8.Kind.VARIABLE,
|
|
56358
56469
|
name: {
|
|
56359
56470
|
kind: graphql8.Kind.NAME,
|
|
56360
|
-
value: variable ??
|
|
56471
|
+
value: variable ?? name
|
|
56361
56472
|
}
|
|
56362
56473
|
}
|
|
56363
56474
|
};
|
|
56364
56475
|
}
|
|
56365
|
-
function staticVariableDefinition(
|
|
56476
|
+
function staticVariableDefinition(name, type, defaultValue, variableName) {
|
|
56366
56477
|
return {
|
|
56367
56478
|
kind: graphql8.Kind.VARIABLE_DEFINITION,
|
|
56368
56479
|
type: {
|
|
@@ -56376,7 +56487,7 @@ function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
|
56376
56487
|
kind: graphql8.Kind.VARIABLE,
|
|
56377
56488
|
name: {
|
|
56378
56489
|
kind: graphql8.Kind.NAME,
|
|
56379
|
-
value: variableName ??
|
|
56490
|
+
value: variableName ?? name
|
|
56380
56491
|
}
|
|
56381
56492
|
},
|
|
56382
56493
|
defaultValue: !defaultValue ? void 0 : {
|
|
@@ -56385,12 +56496,12 @@ function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
|
56385
56496
|
}
|
|
56386
56497
|
};
|
|
56387
56498
|
}
|
|
56388
|
-
function argumentNode(
|
|
56499
|
+
function argumentNode(name, value) {
|
|
56389
56500
|
return {
|
|
56390
56501
|
kind: graphql8.Kind.ARGUMENT,
|
|
56391
56502
|
name: {
|
|
56392
56503
|
kind: graphql8.Kind.NAME,
|
|
56393
|
-
value:
|
|
56504
|
+
value: name
|
|
56394
56505
|
},
|
|
56395
56506
|
value: objectNode(value)
|
|
56396
56507
|
};
|
|
@@ -56636,7 +56747,7 @@ async function addListFragments(config2, documents) {
|
|
|
56636
56747
|
const generatedDoc = {
|
|
56637
56748
|
kind: graphql9.Kind.DOCUMENT,
|
|
56638
56749
|
definitions: Object.entries(lists).flatMap(
|
|
56639
|
-
([
|
|
56750
|
+
([name, { selection: selection2, type }]) => {
|
|
56640
56751
|
const schemaType = config2.schema.getType(type.name);
|
|
56641
56752
|
if (!selection2) {
|
|
56642
56753
|
throw new HoudiniError({ message: "Lists must have a selection" });
|
|
@@ -56656,7 +56767,7 @@ async function addListFragments(config2, documents) {
|
|
|
56656
56767
|
return [
|
|
56657
56768
|
{
|
|
56658
56769
|
name: {
|
|
56659
|
-
value: config2.listInsertFragment(
|
|
56770
|
+
value: config2.listInsertFragment(name),
|
|
56660
56771
|
kind: graphql9.Kind.NAME
|
|
56661
56772
|
},
|
|
56662
56773
|
kind: graphql9.Kind.FRAGMENT_DEFINITION,
|
|
@@ -56671,7 +56782,7 @@ async function addListFragments(config2, documents) {
|
|
|
56671
56782
|
},
|
|
56672
56783
|
{
|
|
56673
56784
|
name: {
|
|
56674
|
-
value: config2.listToggleFragment(
|
|
56785
|
+
value: config2.listToggleFragment(name),
|
|
56675
56786
|
kind: graphql9.Kind.NAME
|
|
56676
56787
|
},
|
|
56677
56788
|
kind: graphql9.Kind.FRAGMENT_DEFINITION,
|
|
@@ -56687,7 +56798,7 @@ async function addListFragments(config2, documents) {
|
|
|
56687
56798
|
{
|
|
56688
56799
|
kind: graphql9.Kind.FRAGMENT_DEFINITION,
|
|
56689
56800
|
name: {
|
|
56690
|
-
value: config2.listRemoveFragment(
|
|
56801
|
+
value: config2.listRemoveFragment(name),
|
|
56691
56802
|
kind: graphql9.Kind.NAME
|
|
56692
56803
|
},
|
|
56693
56804
|
selectionSet: {
|
|
@@ -56731,7 +56842,8 @@ async function addListFragments(config2, documents) {
|
|
|
56731
56842
|
document: generatedDoc,
|
|
56732
56843
|
originalDocument: generatedDoc,
|
|
56733
56844
|
filename: "generated::lists",
|
|
56734
|
-
originalString: ""
|
|
56845
|
+
originalString: "",
|
|
56846
|
+
artifact: null
|
|
56735
56847
|
});
|
|
56736
56848
|
}
|
|
56737
56849
|
function connectionSelection(config2, field, type, selection2) {
|
|
@@ -57135,19 +57247,20 @@ function artifactGenerator(stats) {
|
|
|
57135
57247
|
});
|
|
57136
57248
|
}
|
|
57137
57249
|
const listOfArtifacts = [];
|
|
57250
|
+
const hash = config2.plugins?.find((plugin2) => plugin2.hash)?.hash ?? hashDocument;
|
|
57138
57251
|
await Promise.all(
|
|
57139
57252
|
[
|
|
57140
57253
|
writeIndexFile(config2, docs)
|
|
57141
57254
|
].concat(
|
|
57142
57255
|
docs.map(async (doc) => {
|
|
57143
|
-
const { document, name
|
|
57256
|
+
const { document, name, generateArtifact } = doc;
|
|
57144
57257
|
if (!generateArtifact) {
|
|
57145
57258
|
return;
|
|
57146
57259
|
}
|
|
57147
57260
|
const usedVariableNames = /* @__PURE__ */ new Set();
|
|
57148
57261
|
let documentWithoutInternalDirectives = graphql12.visit(document, {
|
|
57149
57262
|
Directive(node) {
|
|
57150
|
-
if (config2.isInternalDirective(node)) {
|
|
57263
|
+
if (config2.isInternalDirective(node.name.value)) {
|
|
57151
57264
|
return null;
|
|
57152
57265
|
}
|
|
57153
57266
|
},
|
|
@@ -57162,8 +57275,8 @@ function artifactGenerator(stats) {
|
|
|
57162
57275
|
documentWithoutInternalDirectives,
|
|
57163
57276
|
{
|
|
57164
57277
|
VariableDefinition(variableDefinitionNode) {
|
|
57165
|
-
const
|
|
57166
|
-
if (!usedVariableNames.has(
|
|
57278
|
+
const name2 = variableDefinitionNode.variable.name.value;
|
|
57279
|
+
if (!usedVariableNames.has(name2)) {
|
|
57167
57280
|
return null;
|
|
57168
57281
|
}
|
|
57169
57282
|
}
|
|
@@ -57197,12 +57310,12 @@ function artifactGenerator(stats) {
|
|
|
57197
57310
|
selectionSet = operation.selectionSet;
|
|
57198
57311
|
} else {
|
|
57199
57312
|
const matchingFragment = fragments.find(
|
|
57200
|
-
(fragment) => fragment.name.value ===
|
|
57313
|
+
(fragment) => fragment.name.value === name
|
|
57201
57314
|
);
|
|
57202
57315
|
if (!matchingFragment) {
|
|
57203
57316
|
throw new HoudiniError({
|
|
57204
57317
|
filepath: doc.filename,
|
|
57205
|
-
message: `Fragment "${
|
|
57318
|
+
message: `Fragment "${name}" doesn't exist in its own document?!`
|
|
57206
57319
|
});
|
|
57207
57320
|
}
|
|
57208
57321
|
rootType = matchingFragment.typeCondition.name.value;
|
|
@@ -57231,10 +57344,10 @@ function artifactGenerator(stats) {
|
|
|
57231
57344
|
ignoreMaskDisable: docKind === "HoudiniQuery",
|
|
57232
57345
|
applyFragments: docKind !== "HoudiniFragment"
|
|
57233
57346
|
});
|
|
57234
|
-
|
|
57235
|
-
name
|
|
57347
|
+
let artifact = {
|
|
57348
|
+
name,
|
|
57236
57349
|
kind: docKind,
|
|
57237
|
-
hash:
|
|
57350
|
+
hash: hash({ config: config2, document: doc }),
|
|
57238
57351
|
refetch: doc.refetch,
|
|
57239
57352
|
raw: rawString,
|
|
57240
57353
|
rootType,
|
|
@@ -57253,27 +57366,27 @@ function artifactGenerator(stats) {
|
|
|
57253
57366
|
document: doc
|
|
57254
57367
|
})
|
|
57255
57368
|
};
|
|
57256
|
-
const
|
|
57257
|
-
(prev,
|
|
57258
|
-
if (!
|
|
57369
|
+
const plugin_data = config2.plugins.reduce(
|
|
57370
|
+
(prev, plugin2) => {
|
|
57371
|
+
if (!plugin2.artifact_data) {
|
|
57259
57372
|
return prev;
|
|
57260
57373
|
}
|
|
57261
57374
|
const result = { ...prev };
|
|
57262
|
-
const dataToAdd =
|
|
57375
|
+
const dataToAdd = plugin2.artifact_data({ config: config2, document: doc }) ?? {};
|
|
57263
57376
|
if (Object.keys(dataToAdd).length > 0) {
|
|
57264
|
-
result[
|
|
57377
|
+
result[plugin2.name] = dataToAdd;
|
|
57265
57378
|
}
|
|
57266
57379
|
return result;
|
|
57267
57380
|
},
|
|
57268
57381
|
{}
|
|
57269
57382
|
);
|
|
57270
|
-
if (Object.keys(
|
|
57271
|
-
artifact.
|
|
57383
|
+
if (Object.keys(plugin_data).length > 0) {
|
|
57384
|
+
artifact.plugin_data = plugin_data;
|
|
57272
57385
|
}
|
|
57273
57386
|
if (inputs && inputs.length > 0) {
|
|
57274
57387
|
artifact.input = inputObject(config2, inputs);
|
|
57275
57388
|
}
|
|
57276
|
-
if (
|
|
57389
|
+
if (artifact.kind === "HoudiniQuery") {
|
|
57277
57390
|
const cacheDirective = operations[0].directives?.find(
|
|
57278
57391
|
(directive2) => directive2.name.value === config2.cacheDirective
|
|
57279
57392
|
);
|
|
@@ -57286,7 +57399,7 @@ function artifactGenerator(stats) {
|
|
|
57286
57399
|
{}
|
|
57287
57400
|
) || {};
|
|
57288
57401
|
const policy = args[config2.cachePolicyArg];
|
|
57289
|
-
if (policy && policy.value.kind === "EnumValue") {
|
|
57402
|
+
if (policy && policy.value.kind === "EnumValue" && policy.value.value) {
|
|
57290
57403
|
artifact.policy = policy.value.value;
|
|
57291
57404
|
} else {
|
|
57292
57405
|
artifact.policy = config2.defaultCachePolicy;
|
|
@@ -57302,10 +57415,17 @@ function artifactGenerator(stats) {
|
|
|
57302
57415
|
artifact.partial = config2.defaultPartial;
|
|
57303
57416
|
}
|
|
57304
57417
|
}
|
|
57418
|
+
doc.artifact = artifact;
|
|
57419
|
+
for (const plugin2 of config2.plugins) {
|
|
57420
|
+
if (!plugin2.artifact_end) {
|
|
57421
|
+
continue;
|
|
57422
|
+
}
|
|
57423
|
+
plugin2.artifact_end({ config: config2, document: doc });
|
|
57424
|
+
}
|
|
57305
57425
|
const file = AST5.program([
|
|
57306
57426
|
moduleExport(config2, "default", serializeValue(artifact)),
|
|
57307
57427
|
AST5.expressionStatement(
|
|
57308
|
-
AST5.stringLiteral(`HoudiniHash=${
|
|
57428
|
+
AST5.stringLiteral(`HoudiniHash=${hash({ config: config2, document: doc })}`)
|
|
57309
57429
|
)
|
|
57310
57430
|
]);
|
|
57311
57431
|
const artifactPath = config2.artifactPath(document);
|
|
@@ -57322,7 +57442,7 @@ function artifactGenerator(stats) {
|
|
|
57322
57442
|
return;
|
|
57323
57443
|
}
|
|
57324
57444
|
const match = existingArtifact && existingArtifact.match(/"HoudiniHash=(\w+)"/);
|
|
57325
|
-
if (match && match[1] !==
|
|
57445
|
+
if (match && match[1] !== hash({ config: config2, document: doc })) {
|
|
57326
57446
|
stats.changed.push(artifact.name);
|
|
57327
57447
|
}
|
|
57328
57448
|
stats.total.push(artifact.name);
|
|
@@ -57341,7 +57461,7 @@ async function generateGraphqlReturnTypes(config2, docs) {
|
|
|
57341
57461
|
const fileContent = await fs_exports.readFile(indexPath) || "";
|
|
57342
57462
|
const contents = await parseJS(fileContent);
|
|
57343
57463
|
const graphql_tag_return = config2.plugins.find(
|
|
57344
|
-
(
|
|
57464
|
+
(plugin2) => plugin2.graphql_tag_return
|
|
57345
57465
|
)?.graphql_tag_return;
|
|
57346
57466
|
if (!graphql_tag_return || !contents) {
|
|
57347
57467
|
return fileContent;
|
|
@@ -57350,7 +57470,7 @@ async function generateGraphqlReturnTypes(config2, docs) {
|
|
|
57350
57470
|
for (const doc of docs) {
|
|
57351
57471
|
const return_value = graphql_tag_return({
|
|
57352
57472
|
config: config2,
|
|
57353
|
-
doc,
|
|
57473
|
+
document: doc,
|
|
57354
57474
|
ensure_import({ identifier, module }) {
|
|
57355
57475
|
ensureImports({
|
|
57356
57476
|
config: config2,
|
|
@@ -57399,19 +57519,19 @@ async function injectPlugins({
|
|
|
57399
57519
|
importStatement,
|
|
57400
57520
|
exportStatement
|
|
57401
57521
|
}) {
|
|
57402
|
-
const client_plugins = config2.plugins.filter((
|
|
57403
|
-
let plugins =
|
|
57522
|
+
const client_plugins = config2.plugins.filter((plugin2) => plugin2.client_plugins).reduce((acc, plugin2) => {
|
|
57523
|
+
let plugins = plugin2.client_plugins;
|
|
57404
57524
|
if (typeof plugins === "function") {
|
|
57405
|
-
plugins = plugins(config2, config2.pluginConfig(
|
|
57525
|
+
plugins = plugins(config2, config2.pluginConfig(plugin2.name));
|
|
57406
57526
|
}
|
|
57407
57527
|
return [...acc, ...Object.entries(plugins)];
|
|
57408
57528
|
}, []);
|
|
57409
57529
|
return client_plugins.length > 0 ? `
|
|
57410
|
-
${client_plugins.map((
|
|
57530
|
+
${client_plugins.map((plugin2, i) => importStatement(plugin2[0], `plugin${i}`))}
|
|
57411
57531
|
|
|
57412
57532
|
const plugins = [
|
|
57413
|
-
${client_plugins.map((
|
|
57414
|
-
const suffix =
|
|
57533
|
+
${client_plugins.map((plugin2, i) => {
|
|
57534
|
+
const suffix = `(${JSON.stringify(plugin2[1])})`;
|
|
57415
57535
|
return `plugin${i}${suffix}`;
|
|
57416
57536
|
}).join(",\n")}
|
|
57417
57537
|
]
|
|
@@ -57454,37 +57574,35 @@ ${exportStatement("config")}
|
|
|
57454
57574
|
},
|
|
57455
57575
|
[path_exports.join(config2.runtimeSource, "client", "plugins", "injectedPlugins.js")]: (content) => injectPlugins({ config: config2, content, importStatement, exportStatement })
|
|
57456
57576
|
}),
|
|
57457
|
-
...config2.plugins.filter((
|
|
57577
|
+
...config2.plugins.filter((plugin2) => plugin2.include_runtime).map((plugin2) => generatePluginRuntime(config2, plugin2)),
|
|
57458
57578
|
generatePluginIndex({ config: config2, exportStatement: exportStar })
|
|
57459
57579
|
]);
|
|
57460
57580
|
await generateGraphqlReturnTypes(config2, docs);
|
|
57461
57581
|
}
|
|
57462
|
-
async function generatePluginRuntime(config2,
|
|
57463
|
-
if (houdini_mode.is_testing) {
|
|
57582
|
+
async function generatePluginRuntime(config2, plugin2) {
|
|
57583
|
+
if (houdini_mode.is_testing || !plugin2.include_runtime) {
|
|
57464
57584
|
return;
|
|
57465
57585
|
}
|
|
57466
|
-
const
|
|
57467
|
-
|
|
57468
|
-
"
|
|
57469
|
-
"runtime-" + (config2.module === "esm" ? "esm" : "cjs")
|
|
57586
|
+
const runtime_path = path_exports.join(
|
|
57587
|
+
path_exports.dirname(plugin2.filepath),
|
|
57588
|
+
typeof plugin2.include_runtime === "string" ? plugin2.include_runtime : plugin2.include_runtime[config2.module]
|
|
57470
57589
|
);
|
|
57471
57590
|
try {
|
|
57472
|
-
await fs_exports.stat(
|
|
57591
|
+
await fs_exports.stat(runtime_path);
|
|
57473
57592
|
} catch {
|
|
57474
57593
|
throw new HoudiniError({
|
|
57475
|
-
message:
|
|
57476
|
-
description: "
|
|
57594
|
+
message: "Cannot find runtime to generate for " + plugin2.name,
|
|
57595
|
+
description: "Maybe it was bundled?"
|
|
57477
57596
|
});
|
|
57478
57597
|
}
|
|
57479
|
-
const
|
|
57480
|
-
const pluginDir = config2.pluginRuntimeDirectory(plugin.name);
|
|
57598
|
+
const pluginDir = config2.pluginRuntimeDirectory(plugin2.name);
|
|
57481
57599
|
await fs_exports.mkdirp(pluginDir);
|
|
57482
57600
|
await fs_exports.recursiveCopy(
|
|
57483
|
-
|
|
57601
|
+
runtime_path,
|
|
57484
57602
|
pluginDir,
|
|
57485
57603
|
Object.fromEntries(
|
|
57486
|
-
Object.entries(
|
|
57487
|
-
path_exports.join(
|
|
57604
|
+
Object.entries(plugin2.transform_runtime ?? {}).map(([key, value]) => [
|
|
57605
|
+
path_exports.join(runtime_path, key),
|
|
57488
57606
|
(content) => value({ config: config2, content })
|
|
57489
57607
|
])
|
|
57490
57608
|
)
|
|
@@ -57885,7 +58003,7 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
57885
58003
|
}
|
|
57886
58004
|
const missingScalars = /* @__PURE__ */ new Set();
|
|
57887
58005
|
await Promise.all(
|
|
57888
|
-
docs.map(async ({ originalDocument, name
|
|
58006
|
+
docs.map(async ({ originalDocument, name, filename, generateArtifact }) => {
|
|
57889
58007
|
if (!generateArtifact) {
|
|
57890
58008
|
return;
|
|
57891
58009
|
}
|
|
@@ -57893,7 +58011,7 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
57893
58011
|
const program = AST11.program([]);
|
|
57894
58012
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
57895
58013
|
let definition = originalDocument.definitions.find(
|
|
57896
|
-
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value ===
|
|
58014
|
+
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value === name
|
|
57897
58015
|
);
|
|
57898
58016
|
const selections = flattenSelections({
|
|
57899
58017
|
config: config2,
|
|
@@ -57947,22 +58065,22 @@ export { default as ${as} } from "${module}"
|
|
|
57947
58065
|
export * from "${module}"
|
|
57948
58066
|
`;
|
|
57949
58067
|
let indexContent = recast11.print(typeIndex).code;
|
|
57950
|
-
for (const
|
|
57951
|
-
if (!
|
|
58068
|
+
for (const plugin2 of config2.plugins) {
|
|
58069
|
+
if (!plugin2.index_file) {
|
|
57952
58070
|
continue;
|
|
57953
58071
|
}
|
|
57954
|
-
indexContent =
|
|
58072
|
+
indexContent = plugin2.index_file({
|
|
57955
58073
|
config: config2,
|
|
57956
58074
|
content: indexContent,
|
|
57957
58075
|
export_default_as,
|
|
57958
58076
|
export_star_from,
|
|
57959
|
-
plugin_root: config2.pluginDirectory(
|
|
58077
|
+
plugin_root: config2.pluginDirectory(plugin2.name),
|
|
57960
58078
|
typedef: true,
|
|
57961
58079
|
documents: docs
|
|
57962
58080
|
});
|
|
57963
|
-
if (
|
|
58081
|
+
if (plugin2.include_runtime) {
|
|
57964
58082
|
indexContent += export_star_from({
|
|
57965
|
-
module: "./" + path_exports.relative(config2.rootDir, config2.pluginRuntimeDirectory(
|
|
58083
|
+
module: "./" + path_exports.relative(config2.rootDir, config2.pluginRuntimeDirectory(plugin2.name))
|
|
57966
58084
|
});
|
|
57967
58085
|
}
|
|
57968
58086
|
}
|
|
@@ -58208,9 +58326,9 @@ var graphql17 = __toESM(require_graphql2(), 1);
|
|
|
58208
58326
|
var recast12 = __toESM(require_main2(), 1);
|
|
58209
58327
|
var AST12 = recast12.types.builders;
|
|
58210
58328
|
async function imperativeCacheTypef(config2, docs) {
|
|
58211
|
-
const returnType = (doc) => config2.plugins.find((
|
|
58329
|
+
const returnType = (doc) => config2.plugins.find((plugin2) => plugin2.graphql_tag_return)?.graphql_tag_return?.({
|
|
58212
58330
|
config: config2,
|
|
58213
|
-
doc,
|
|
58331
|
+
document: doc,
|
|
58214
58332
|
ensure_import({ identifier, module }) {
|
|
58215
58333
|
ensureImports({
|
|
58216
58334
|
config: config2,
|
|
@@ -58555,12 +58673,12 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
58555
58673
|
}, {});
|
|
58556
58674
|
}
|
|
58557
58675
|
var CacheTypeDefName = "CacheTypeDef";
|
|
58558
|
-
function record(
|
|
58676
|
+
function record(name) {
|
|
58559
58677
|
return AST12.tsTypeReference(
|
|
58560
58678
|
AST12.identifier("Record"),
|
|
58561
58679
|
AST12.tsTypeParameterInstantiation([
|
|
58562
58680
|
AST12.tsTypeReference(AST12.identifier(CacheTypeDefName)),
|
|
58563
|
-
AST12.tsLiteralType(AST12.stringLiteral(
|
|
58681
|
+
AST12.tsLiteralType(AST12.stringLiteral(name))
|
|
58564
58682
|
])
|
|
58565
58683
|
);
|
|
58566
58684
|
}
|
|
@@ -58589,7 +58707,7 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
58589
58707
|
let rawString = graphql18.print(
|
|
58590
58708
|
graphql18.visit(document, {
|
|
58591
58709
|
Directive(node) {
|
|
58592
|
-
if (config2.isInternalDirective(node)) {
|
|
58710
|
+
if (config2.isInternalDirective(node.name.value)) {
|
|
58593
58711
|
return null;
|
|
58594
58712
|
}
|
|
58595
58713
|
}
|
|
@@ -58599,7 +58717,7 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
58599
58717
|
({ kind }) => kind === graphql18.Kind.OPERATION_DEFINITION
|
|
58600
58718
|
);
|
|
58601
58719
|
if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
|
|
58602
|
-
acc[hashDocument(rawString)] = rawString;
|
|
58720
|
+
acc[hashDocument({ config: config2, document: rawString })] = rawString;
|
|
58603
58721
|
}
|
|
58604
58722
|
return acc;
|
|
58605
58723
|
}, {});
|
|
@@ -58619,10 +58737,10 @@ async function definitionsGenerator(config2) {
|
|
|
58619
58737
|
const runtimeDefinitions = recast13.print(
|
|
58620
58738
|
AST13.program(
|
|
58621
58739
|
enums.map((defn) => {
|
|
58622
|
-
const
|
|
58740
|
+
const name = defn.name.value;
|
|
58623
58741
|
return moduleExport(
|
|
58624
58742
|
config2,
|
|
58625
|
-
|
|
58743
|
+
name,
|
|
58626
58744
|
AST13.objectExpression(
|
|
58627
58745
|
defn.values?.map((value) => {
|
|
58628
58746
|
const str = value.name.value;
|
|
@@ -58679,24 +58797,24 @@ async function writeIndexFile2(config2, docs) {
|
|
|
58679
58797
|
export_star_from({ module: artifactDir }),
|
|
58680
58798
|
export_star_from({ module: definitionsDir })
|
|
58681
58799
|
].join("");
|
|
58682
|
-
for (const
|
|
58683
|
-
if (
|
|
58684
|
-
body =
|
|
58800
|
+
for (const plugin2 of config2.plugins) {
|
|
58801
|
+
if (plugin2.index_file) {
|
|
58802
|
+
body = plugin2.index_file({
|
|
58685
58803
|
config: config2,
|
|
58686
58804
|
content: body,
|
|
58687
58805
|
export_default_as,
|
|
58688
58806
|
export_star_from,
|
|
58689
|
-
plugin_root: config2.pluginDirectory(
|
|
58807
|
+
plugin_root: config2.pluginDirectory(plugin2.name),
|
|
58690
58808
|
typedef: false,
|
|
58691
58809
|
documents: docs
|
|
58692
58810
|
});
|
|
58693
58811
|
}
|
|
58694
|
-
if (
|
|
58812
|
+
if (plugin2.include_runtime) {
|
|
58695
58813
|
body += export_star_from({
|
|
58696
|
-
module: relative2(config2.pluginRuntimeDirectory(
|
|
58814
|
+
module: relative2(config2.pluginRuntimeDirectory(plugin2.name))
|
|
58697
58815
|
});
|
|
58698
58816
|
}
|
|
58699
|
-
if (!
|
|
58817
|
+
if (!plugin2.index_file) {
|
|
58700
58818
|
continue;
|
|
58701
58819
|
}
|
|
58702
58820
|
}
|
|
@@ -58706,7 +58824,7 @@ async function writeIndexFile2(config2, docs) {
|
|
|
58706
58824
|
// src/codegen/transforms/schema.ts
|
|
58707
58825
|
var graphql20 = __toESM(require_graphql2(), 1);
|
|
58708
58826
|
async function graphqlExtensions(config2, documents) {
|
|
58709
|
-
|
|
58827
|
+
let internalSchema = `
|
|
58710
58828
|
enum CachePolicy {
|
|
58711
58829
|
${"CacheAndNetwork" /* CacheAndNetwork */}
|
|
58712
58830
|
${"CacheOnly" /* CacheOnly */}
|
|
@@ -58747,6 +58865,7 @@ directive @${config2.listAllListsDirective} on FRAGMENT_SPREAD
|
|
|
58747
58865
|
"""
|
|
58748
58866
|
directive @${config2.listParentDirective}(value: ID!) on FRAGMENT_SPREAD
|
|
58749
58867
|
|
|
58868
|
+
|
|
58750
58869
|
"""
|
|
58751
58870
|
@${config2.whenDirective} is used to provide a conditional or in situations where it doesn't make sense (eg when removing or deleting a node.)
|
|
58752
58871
|
"""
|
|
@@ -58762,6 +58881,11 @@ directive @${config2.whenNotDirective} on FRAGMENT_SPREAD
|
|
|
58762
58881
|
"""
|
|
58763
58882
|
directive @${config2.argumentsDirective} on FRAGMENT_DEFINITION
|
|
58764
58883
|
|
|
58884
|
+
"""
|
|
58885
|
+
@${config2.withDirective} is used to provide arguments to fragments that have been marked with @${config2.argumentsDirective}
|
|
58886
|
+
"""
|
|
58887
|
+
directive @${config2.withDirective} on FRAGMENT_SPREAD
|
|
58888
|
+
|
|
58765
58889
|
"""
|
|
58766
58890
|
@${config2.cacheDirective} is used to specify cache rules for a query
|
|
58767
58891
|
"""
|
|
@@ -58782,6 +58906,12 @@ directive @${config2.maskEnableDirective} on FRAGMENT_SPREAD
|
|
|
58782
58906
|
"""
|
|
58783
58907
|
directive @${config2.maskDisableDirective} on FRAGMENT_SPREAD
|
|
58784
58908
|
`;
|
|
58909
|
+
for (const plugin2 of config2.plugins) {
|
|
58910
|
+
if (!plugin2.schema) {
|
|
58911
|
+
continue;
|
|
58912
|
+
}
|
|
58913
|
+
internalSchema += plugin2.schema({ config: config2 });
|
|
58914
|
+
}
|
|
58785
58915
|
let currentSchema = graphql20.printSchema(config2.schema);
|
|
58786
58916
|
if (!currentSchema.includes(`directive @${config2.listDirective}`)) {
|
|
58787
58917
|
currentSchema += internalSchema;
|
|
@@ -58964,7 +59094,7 @@ async function typeCheck(config2, docs) {
|
|
|
58964
59094
|
}
|
|
58965
59095
|
needsParent = needsParent || definition.kind === "FragmentDefinition";
|
|
58966
59096
|
const nameArg = directive.arguments?.find(
|
|
58967
|
-
({ name
|
|
59097
|
+
({ name }) => name.value === config2.listNameArg
|
|
58968
59098
|
);
|
|
58969
59099
|
if (!nameArg) {
|
|
58970
59100
|
if (directive.name.value === config2.listDirective) {
|
|
@@ -59134,14 +59264,14 @@ var validateLists = ({
|
|
|
59134
59264
|
return;
|
|
59135
59265
|
}
|
|
59136
59266
|
let directive = node.directives?.find(
|
|
59137
|
-
({ name
|
|
59267
|
+
({ name }) => name.value === config2.listParentDirective
|
|
59138
59268
|
);
|
|
59139
59269
|
if (directive) {
|
|
59140
59270
|
return;
|
|
59141
59271
|
}
|
|
59142
59272
|
let parentIdFound = false;
|
|
59143
|
-
directive = node.directives?.find(({ name
|
|
59144
|
-
[config2.listPrependDirective, config2.listAppendDirective].includes(
|
|
59273
|
+
directive = node.directives?.find(({ name }) => [
|
|
59274
|
+
[config2.listPrependDirective, config2.listAppendDirective].includes(name.value)
|
|
59145
59275
|
]);
|
|
59146
59276
|
if (directive) {
|
|
59147
59277
|
let parentArg = directive.arguments?.find(
|
|
@@ -59159,7 +59289,7 @@ var validateLists = ({
|
|
|
59159
59289
|
return;
|
|
59160
59290
|
}
|
|
59161
59291
|
const allLists = node.directives?.find(
|
|
59162
|
-
({ name
|
|
59292
|
+
({ name }) => config2.listAllListsDirective === name.value
|
|
59163
59293
|
);
|
|
59164
59294
|
if (allLists || config2.defaultListTarget === "all") {
|
|
59165
59295
|
return;
|
|
@@ -59181,7 +59311,7 @@ var validateLists = ({
|
|
|
59181
59311
|
);
|
|
59182
59312
|
return;
|
|
59183
59313
|
}
|
|
59184
|
-
if (!config2.isInternalDirective(node)) {
|
|
59314
|
+
if (!config2.isInternalDirective(node.name.value)) {
|
|
59185
59315
|
if (!config2.schema.getDirective(directiveName)) {
|
|
59186
59316
|
ctx.reportError(
|
|
59187
59317
|
new graphql23.GraphQLError(
|
|
@@ -59324,9 +59454,9 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
59324
59454
|
);
|
|
59325
59455
|
} else {
|
|
59326
59456
|
const zipped = appliedArgumentNames.map(
|
|
59327
|
-
(
|
|
59328
|
-
appliedArguments[
|
|
59329
|
-
fragmentArguments2[fragmentName].find((arg) => arg.name ===
|
|
59457
|
+
(name) => [
|
|
59458
|
+
appliedArguments[name],
|
|
59459
|
+
fragmentArguments2[fragmentName].find((arg) => arg.name === name).type
|
|
59330
59460
|
]
|
|
59331
59461
|
);
|
|
59332
59462
|
for (const [applied, target] of zipped) {
|
|
@@ -59652,9 +59782,9 @@ For more information, please visit these links:
|
|
|
59652
59782
|
// src/codegen/validators/uniqueNames.ts
|
|
59653
59783
|
async function uniqueDocumentNames(config2, docs) {
|
|
59654
59784
|
const nameMap = docs.reduce(
|
|
59655
|
-
(acc, { name
|
|
59785
|
+
(acc, { name, filename }) => ({
|
|
59656
59786
|
...acc,
|
|
59657
|
-
[
|
|
59787
|
+
[name]: [...acc[name] || [], filename]
|
|
59658
59788
|
}),
|
|
59659
59789
|
{}
|
|
59660
59790
|
);
|
|
@@ -59701,12 +59831,12 @@ async function noIDAlias(config2, docs) {
|
|
|
59701
59831
|
// src/codegen/validators/plugins.ts
|
|
59702
59832
|
async function validatePlugins(config2, documents) {
|
|
59703
59833
|
let errors = [];
|
|
59704
|
-
for (const
|
|
59705
|
-
if (!
|
|
59834
|
+
for (const plugin2 of config2.plugins) {
|
|
59835
|
+
if (!plugin2.validate) {
|
|
59706
59836
|
continue;
|
|
59707
59837
|
}
|
|
59708
59838
|
try {
|
|
59709
|
-
await
|
|
59839
|
+
await plugin2.validate({ config: config2, documents });
|
|
59710
59840
|
} catch (err) {
|
|
59711
59841
|
errors.push(err);
|
|
59712
59842
|
}
|
|
@@ -59727,40 +59857,55 @@ async function runPipeline2(config2, docs) {
|
|
|
59727
59857
|
new: [],
|
|
59728
59858
|
deleted: []
|
|
59729
59859
|
};
|
|
59730
|
-
const generatePlugins = config2.plugins.filter((
|
|
59860
|
+
const generatePlugins = config2.plugins.filter((plugin2) => plugin2.generate);
|
|
59861
|
+
const after_validate = config2.plugins.filter((plugin2) => plugin2.after_validate).map((plugin2) => plugin2.after_validate);
|
|
59862
|
+
const validate2 = config2.plugins.filter((plugin2) => plugin2.validate).map((plugin2) => plugin2.validate);
|
|
59863
|
+
const before_validate = config2.plugins.filter((plugin2) => plugin2.before_validate).map((plugin2) => plugin2.before_validate);
|
|
59864
|
+
const transform_before_generate = config2.plugins.filter((plugin2) => plugin2.transform_before_generate).map((plugin2) => plugin2.transform_before_generate);
|
|
59865
|
+
const wrapHook = (hooks) => hooks.map(
|
|
59866
|
+
(fn) => (config3, docs2) => fn({
|
|
59867
|
+
config: config3,
|
|
59868
|
+
documents: docs2
|
|
59869
|
+
})
|
|
59870
|
+
);
|
|
59731
59871
|
let error = null;
|
|
59732
59872
|
try {
|
|
59733
59873
|
await runPipeline(
|
|
59734
59874
|
config2,
|
|
59735
59875
|
[
|
|
59876
|
+
graphqlExtensions,
|
|
59877
|
+
...wrapHook(before_validate),
|
|
59736
59878
|
typeCheck,
|
|
59737
59879
|
uniqueDocumentNames,
|
|
59738
59880
|
noIDAlias,
|
|
59739
59881
|
validatePlugins,
|
|
59740
|
-
|
|
59882
|
+
...wrapHook(validate2),
|
|
59883
|
+
...wrapHook(after_validate),
|
|
59741
59884
|
addID,
|
|
59742
59885
|
addTypename,
|
|
59743
59886
|
addListFragments,
|
|
59744
59887
|
paginate,
|
|
59745
59888
|
fragmentVariables,
|
|
59746
59889
|
includeFragmentDefinitions,
|
|
59890
|
+
...wrapHook(transform_before_generate),
|
|
59891
|
+
artifactGenerator(artifactStats),
|
|
59747
59892
|
runtimeGenerator,
|
|
59748
59893
|
writeIndexFile2,
|
|
59749
|
-
artifactGenerator(artifactStats),
|
|
59750
59894
|
typescriptGenerator,
|
|
59751
59895
|
persistOutputGenerator,
|
|
59752
59896
|
schemaGenerator,
|
|
59753
59897
|
...generatePlugins.map(
|
|
59754
|
-
(
|
|
59898
|
+
(plugin2) => async (config3, docs2) => await plugin2.generate({
|
|
59755
59899
|
config: config3,
|
|
59756
59900
|
documents: docs2,
|
|
59757
|
-
plugin_root: config3.pluginDirectory(
|
|
59901
|
+
plugin_root: config3.pluginDirectory(plugin2.name)
|
|
59758
59902
|
})
|
|
59759
59903
|
)
|
|
59760
59904
|
],
|
|
59761
59905
|
docs
|
|
59762
59906
|
);
|
|
59763
59907
|
} catch (e) {
|
|
59908
|
+
console.log(e);
|
|
59764
59909
|
error = e;
|
|
59765
59910
|
}
|
|
59766
59911
|
const unchanged = artifactStats.total.length - artifactStats.changed.length - artifactStats.new.length - artifactStats.deleted.length;
|
|
@@ -59800,37 +59945,37 @@ async function runPipeline2(config2, docs) {
|
|
|
59800
59945
|
}
|
|
59801
59946
|
}
|
|
59802
59947
|
}
|
|
59803
|
-
function logStyled(kind, stat2, logLevel,
|
|
59948
|
+
function logStyled(kind, stat2, logLevel, plugin2) {
|
|
59804
59949
|
if (stat2.length > 0) {
|
|
59805
59950
|
const msg = [];
|
|
59806
|
-
if (
|
|
59951
|
+
if (plugin2) {
|
|
59807
59952
|
msg.push(`\u{1F3A9} `);
|
|
59808
59953
|
}
|
|
59809
59954
|
if (kind === "CREATED") {
|
|
59810
59955
|
msg.push(`\u2728 `);
|
|
59811
|
-
if (!
|
|
59956
|
+
if (!plugin2) {
|
|
59812
59957
|
msg.push(`New: ${stat2.length}`);
|
|
59813
59958
|
}
|
|
59814
59959
|
} else if (kind === "UPDATED") {
|
|
59815
59960
|
msg.push(`\u270F\uFE0F `);
|
|
59816
|
-
if (!
|
|
59961
|
+
if (!plugin2) {
|
|
59817
59962
|
msg.push(`Changed: ${stat2.length}`);
|
|
59818
59963
|
}
|
|
59819
59964
|
} else if (kind === "DELETED") {
|
|
59820
59965
|
msg.push(`\u{1F9F9} `);
|
|
59821
|
-
if (!
|
|
59966
|
+
if (!plugin2) {
|
|
59822
59967
|
msg.push(`Deleted: ${stat2.length}`);
|
|
59823
59968
|
}
|
|
59824
59969
|
}
|
|
59825
59970
|
const nbToDisplay = 5;
|
|
59826
|
-
if (
|
|
59971
|
+
if (plugin2) {
|
|
59827
59972
|
msg.push(`${stat2.slice(0, nbToDisplay).join(", ")}`);
|
|
59828
59973
|
if (stat2.length > 5) {
|
|
59829
59974
|
msg.push(`, ... ${stat2.length - nbToDisplay} more`);
|
|
59830
59975
|
}
|
|
59831
59976
|
}
|
|
59832
59977
|
console.log(msg.join(""));
|
|
59833
|
-
if (!
|
|
59978
|
+
if (!plugin2 && logLevel === "summary" /* Summary */) {
|
|
59834
59979
|
for (const artifact of stat2.slice(0, nbToDisplay)) {
|
|
59835
59980
|
console.log(` ${artifact}`);
|
|
59836
59981
|
}
|
|
@@ -60111,7 +60256,7 @@ function pipelineTest(config2, documents, shouldPass, testBody) {
|
|
|
60111
60256
|
}
|
|
60112
60257
|
function mockCollectedDoc(query) {
|
|
60113
60258
|
const parsed = graphql25.parse(query);
|
|
60114
|
-
const
|
|
60259
|
+
const name = parsed.definitions[0].name.value;
|
|
60115
60260
|
const operations = parsed.definitions;
|
|
60116
60261
|
let kind = "HoudiniFragment" /* Fragment */;
|
|
60117
60262
|
if (operations.length === 1) {
|
|
@@ -60124,14 +60269,15 @@ function mockCollectedDoc(query) {
|
|
|
60124
60269
|
}
|
|
60125
60270
|
}
|
|
60126
60271
|
return {
|
|
60127
|
-
name
|
|
60272
|
+
name,
|
|
60128
60273
|
kind,
|
|
60129
60274
|
document: parsed,
|
|
60130
60275
|
originalDocument: parsed,
|
|
60131
|
-
filename: `${
|
|
60276
|
+
filename: `${name}.ts`,
|
|
60132
60277
|
generateArtifact: true,
|
|
60133
60278
|
generateStore: true,
|
|
60134
|
-
originalString: query
|
|
60279
|
+
originalString: query,
|
|
60280
|
+
artifact: null
|
|
60135
60281
|
};
|
|
60136
60282
|
}
|
|
60137
60283
|
function clearMock() {
|