houdini 1.0.0-next.3 → 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 +1254 -1062
- package/build/cmd-esm/index.js +1254 -1062
- package/build/codegen/generators/artifacts/selection.d.ts +3 -3
- package/build/codegen/generators/artifacts/utils.d.ts +0 -1
- package/build/codegen-cjs/index.js +847 -717
- package/build/codegen-esm/index.js +847 -717
- 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 +23 -6
- package/build/runtime/cache/staleManager.d.ts +30 -0
- package/build/runtime/cache/subscription.d.ts +2 -1
- package/build/runtime/client/documentStore.d.ts +1 -1
- package/build/runtime/client/plugins/fetchParams.d.ts +1 -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 +4 -5
- 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 +23 -6
- package/build/runtime-cjs/cache/cache.js +95 -21
- package/build/runtime-cjs/cache/gc.js +9 -0
- package/build/runtime-cjs/cache/lists.js +3 -3
- 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.d.ts +1 -1
- 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/fetchParams.d.ts +1 -1
- package/build/runtime-cjs/client/plugins/fetchParams.js +6 -1
- package/build/runtime-cjs/client/plugins/query.js +1 -1
- 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 +4 -5
- 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 +23 -6
- package/build/runtime-esm/cache/cache.js +96 -22
- package/build/runtime-esm/cache/gc.js +9 -0
- package/build/runtime-esm/cache/lists.js +3 -3
- 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.d.ts +1 -1
- 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/fetchParams.d.ts +1 -1
- package/build/runtime-esm/client/plugins/fetchParams.js +6 -1
- package/build/runtime-esm/client/plugins/query.js +1 -1
- 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 +4 -5
- 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 +930 -788
- package/build/test-esm/index.js +930 -788
- package/build/vite-cjs/index.js +1232 -1039
- package/build/vite-esm/index.js +1232 -1039
- package/package.json +3 -2
package/build/test-cjs/index.js
CHANGED
|
@@ -10,8 +10,8 @@ var __commonJS = (cb, mod) => function __require() {
|
|
|
10
10
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
11
|
};
|
|
12
12
|
var __export = (target, all) => {
|
|
13
|
-
for (var
|
|
14
|
-
__defProp(target,
|
|
13
|
+
for (var name in all)
|
|
14
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
15
|
};
|
|
16
16
|
var __copyProps = (to, from, except, desc) => {
|
|
17
17
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -838,9 +838,9 @@ var require_inspect = __commonJS({
|
|
|
838
838
|
function getObjectTag(object) {
|
|
839
839
|
var tag = Object.prototype.toString.call(object).replace(/^\[object /, "").replace(/]$/, "");
|
|
840
840
|
if (tag === "Object" && typeof object.constructor === "function") {
|
|
841
|
-
var
|
|
842
|
-
if (typeof
|
|
843
|
-
return
|
|
841
|
+
var name = object.constructor.name;
|
|
842
|
+
if (typeof name === "string" && name !== "") {
|
|
843
|
+
return name;
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
846
|
return tag;
|
|
@@ -946,14 +946,14 @@ var require_source = __commonJS({
|
|
|
946
946
|
}
|
|
947
947
|
var Source2 = /* @__PURE__ */ function() {
|
|
948
948
|
function Source3(body) {
|
|
949
|
-
var
|
|
949
|
+
var name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "GraphQL request";
|
|
950
950
|
var locationOffset = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
951
951
|
line: 1,
|
|
952
952
|
column: 1
|
|
953
953
|
};
|
|
954
954
|
typeof body === "string" || (0, _devAssert.default)(0, "Body must be a string. Received: ".concat((0, _inspect.default)(body), "."));
|
|
955
955
|
this.body = body;
|
|
956
|
-
this.name =
|
|
956
|
+
this.name = name;
|
|
957
957
|
this.locationOffset = locationOffset;
|
|
958
958
|
this.locationOffset.line > 0 || (0, _devAssert.default)(0, "line in locationOffset is 1-indexed and must be positive.");
|
|
959
959
|
this.locationOffset.column > 0 || (0, _devAssert.default)(0, "column in locationOffset is 1-indexed and must be positive.");
|
|
@@ -1569,14 +1569,14 @@ var require_parser = __commonJS({
|
|
|
1569
1569
|
};
|
|
1570
1570
|
}
|
|
1571
1571
|
var operation = this.parseOperationType();
|
|
1572
|
-
var
|
|
1572
|
+
var name;
|
|
1573
1573
|
if (this.peek(_tokenKind.TokenKind.NAME)) {
|
|
1574
|
-
|
|
1574
|
+
name = this.parseName();
|
|
1575
1575
|
}
|
|
1576
1576
|
return {
|
|
1577
1577
|
kind: _kinds.Kind.OPERATION_DEFINITION,
|
|
1578
1578
|
operation,
|
|
1579
|
-
name
|
|
1579
|
+
name,
|
|
1580
1580
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
1581
1581
|
directives: this.parseDirectives(false),
|
|
1582
1582
|
selectionSet: this.parseSelectionSet(),
|
|
@@ -1633,17 +1633,17 @@ var require_parser = __commonJS({
|
|
|
1633
1633
|
var start = this._lexer.token;
|
|
1634
1634
|
var nameOrAlias = this.parseName();
|
|
1635
1635
|
var alias;
|
|
1636
|
-
var
|
|
1636
|
+
var name;
|
|
1637
1637
|
if (this.expectOptionalToken(_tokenKind.TokenKind.COLON)) {
|
|
1638
1638
|
alias = nameOrAlias;
|
|
1639
|
-
|
|
1639
|
+
name = this.parseName();
|
|
1640
1640
|
} else {
|
|
1641
|
-
|
|
1641
|
+
name = nameOrAlias;
|
|
1642
1642
|
}
|
|
1643
1643
|
return {
|
|
1644
1644
|
kind: _kinds.Kind.FIELD,
|
|
1645
1645
|
alias,
|
|
1646
|
-
name
|
|
1646
|
+
name,
|
|
1647
1647
|
arguments: this.parseArguments(false),
|
|
1648
1648
|
directives: this.parseDirectives(false),
|
|
1649
1649
|
selectionSet: this.peek(_tokenKind.TokenKind.BRACE_L) ? this.parseSelectionSet() : void 0,
|
|
@@ -1656,11 +1656,11 @@ var require_parser = __commonJS({
|
|
|
1656
1656
|
};
|
|
1657
1657
|
_proto.parseArgument = function parseArgument() {
|
|
1658
1658
|
var start = this._lexer.token;
|
|
1659
|
-
var
|
|
1659
|
+
var name = this.parseName();
|
|
1660
1660
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
1661
1661
|
return {
|
|
1662
1662
|
kind: _kinds.Kind.ARGUMENT,
|
|
1663
|
-
name
|
|
1663
|
+
name,
|
|
1664
1664
|
value: this.parseValueLiteral(false),
|
|
1665
1665
|
loc: this.loc(start)
|
|
1666
1666
|
};
|
|
@@ -1819,11 +1819,11 @@ var require_parser = __commonJS({
|
|
|
1819
1819
|
};
|
|
1820
1820
|
_proto.parseObjectField = function parseObjectField(isConst) {
|
|
1821
1821
|
var start = this._lexer.token;
|
|
1822
|
-
var
|
|
1822
|
+
var name = this.parseName();
|
|
1823
1823
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
1824
1824
|
return {
|
|
1825
1825
|
kind: _kinds.Kind.OBJECT_FIELD,
|
|
1826
|
-
name
|
|
1826
|
+
name,
|
|
1827
1827
|
value: this.parseValueLiteral(isConst),
|
|
1828
1828
|
loc: this.loc(start)
|
|
1829
1829
|
};
|
|
@@ -1938,12 +1938,12 @@ var require_parser = __commonJS({
|
|
|
1938
1938
|
var start = this._lexer.token;
|
|
1939
1939
|
var description = this.parseDescription();
|
|
1940
1940
|
this.expectKeyword("scalar");
|
|
1941
|
-
var
|
|
1941
|
+
var name = this.parseName();
|
|
1942
1942
|
var directives = this.parseDirectives(true);
|
|
1943
1943
|
return {
|
|
1944
1944
|
kind: _kinds.Kind.SCALAR_TYPE_DEFINITION,
|
|
1945
1945
|
description,
|
|
1946
|
-
name
|
|
1946
|
+
name,
|
|
1947
1947
|
directives,
|
|
1948
1948
|
loc: this.loc(start)
|
|
1949
1949
|
};
|
|
@@ -1952,14 +1952,14 @@ var require_parser = __commonJS({
|
|
|
1952
1952
|
var start = this._lexer.token;
|
|
1953
1953
|
var description = this.parseDescription();
|
|
1954
1954
|
this.expectKeyword("type");
|
|
1955
|
-
var
|
|
1955
|
+
var name = this.parseName();
|
|
1956
1956
|
var interfaces = this.parseImplementsInterfaces();
|
|
1957
1957
|
var directives = this.parseDirectives(true);
|
|
1958
1958
|
var fields = this.parseFieldsDefinition();
|
|
1959
1959
|
return {
|
|
1960
1960
|
kind: _kinds.Kind.OBJECT_TYPE_DEFINITION,
|
|
1961
1961
|
description,
|
|
1962
|
-
name
|
|
1962
|
+
name,
|
|
1963
1963
|
interfaces,
|
|
1964
1964
|
directives,
|
|
1965
1965
|
fields,
|
|
@@ -1993,7 +1993,7 @@ var require_parser = __commonJS({
|
|
|
1993
1993
|
_proto.parseFieldDefinition = function parseFieldDefinition() {
|
|
1994
1994
|
var start = this._lexer.token;
|
|
1995
1995
|
var description = this.parseDescription();
|
|
1996
|
-
var
|
|
1996
|
+
var name = this.parseName();
|
|
1997
1997
|
var args = this.parseArgumentDefs();
|
|
1998
1998
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
1999
1999
|
var type = this.parseTypeReference();
|
|
@@ -2001,7 +2001,7 @@ var require_parser = __commonJS({
|
|
|
2001
2001
|
return {
|
|
2002
2002
|
kind: _kinds.Kind.FIELD_DEFINITION,
|
|
2003
2003
|
description,
|
|
2004
|
-
name
|
|
2004
|
+
name,
|
|
2005
2005
|
arguments: args,
|
|
2006
2006
|
type,
|
|
2007
2007
|
directives,
|
|
@@ -2014,7 +2014,7 @@ var require_parser = __commonJS({
|
|
|
2014
2014
|
_proto.parseInputValueDef = function parseInputValueDef() {
|
|
2015
2015
|
var start = this._lexer.token;
|
|
2016
2016
|
var description = this.parseDescription();
|
|
2017
|
-
var
|
|
2017
|
+
var name = this.parseName();
|
|
2018
2018
|
this.expectToken(_tokenKind.TokenKind.COLON);
|
|
2019
2019
|
var type = this.parseTypeReference();
|
|
2020
2020
|
var defaultValue;
|
|
@@ -2025,7 +2025,7 @@ var require_parser = __commonJS({
|
|
|
2025
2025
|
return {
|
|
2026
2026
|
kind: _kinds.Kind.INPUT_VALUE_DEFINITION,
|
|
2027
2027
|
description,
|
|
2028
|
-
name
|
|
2028
|
+
name,
|
|
2029
2029
|
type,
|
|
2030
2030
|
defaultValue,
|
|
2031
2031
|
directives,
|
|
@@ -2036,14 +2036,14 @@ var require_parser = __commonJS({
|
|
|
2036
2036
|
var start = this._lexer.token;
|
|
2037
2037
|
var description = this.parseDescription();
|
|
2038
2038
|
this.expectKeyword("interface");
|
|
2039
|
-
var
|
|
2039
|
+
var name = this.parseName();
|
|
2040
2040
|
var interfaces = this.parseImplementsInterfaces();
|
|
2041
2041
|
var directives = this.parseDirectives(true);
|
|
2042
2042
|
var fields = this.parseFieldsDefinition();
|
|
2043
2043
|
return {
|
|
2044
2044
|
kind: _kinds.Kind.INTERFACE_TYPE_DEFINITION,
|
|
2045
2045
|
description,
|
|
2046
|
-
name
|
|
2046
|
+
name,
|
|
2047
2047
|
interfaces,
|
|
2048
2048
|
directives,
|
|
2049
2049
|
fields,
|
|
@@ -2054,13 +2054,13 @@ var require_parser = __commonJS({
|
|
|
2054
2054
|
var start = this._lexer.token;
|
|
2055
2055
|
var description = this.parseDescription();
|
|
2056
2056
|
this.expectKeyword("union");
|
|
2057
|
-
var
|
|
2057
|
+
var name = this.parseName();
|
|
2058
2058
|
var directives = this.parseDirectives(true);
|
|
2059
2059
|
var types14 = this.parseUnionMemberTypes();
|
|
2060
2060
|
return {
|
|
2061
2061
|
kind: _kinds.Kind.UNION_TYPE_DEFINITION,
|
|
2062
2062
|
description,
|
|
2063
|
-
name
|
|
2063
|
+
name,
|
|
2064
2064
|
directives,
|
|
2065
2065
|
types: types14,
|
|
2066
2066
|
loc: this.loc(start)
|
|
@@ -2073,13 +2073,13 @@ var require_parser = __commonJS({
|
|
|
2073
2073
|
var start = this._lexer.token;
|
|
2074
2074
|
var description = this.parseDescription();
|
|
2075
2075
|
this.expectKeyword("enum");
|
|
2076
|
-
var
|
|
2076
|
+
var name = this.parseName();
|
|
2077
2077
|
var directives = this.parseDirectives(true);
|
|
2078
2078
|
var values = this.parseEnumValuesDefinition();
|
|
2079
2079
|
return {
|
|
2080
2080
|
kind: _kinds.Kind.ENUM_TYPE_DEFINITION,
|
|
2081
2081
|
description,
|
|
2082
|
-
name
|
|
2082
|
+
name,
|
|
2083
2083
|
directives,
|
|
2084
2084
|
values,
|
|
2085
2085
|
loc: this.loc(start)
|
|
@@ -2091,12 +2091,12 @@ var require_parser = __commonJS({
|
|
|
2091
2091
|
_proto.parseEnumValueDefinition = function parseEnumValueDefinition() {
|
|
2092
2092
|
var start = this._lexer.token;
|
|
2093
2093
|
var description = this.parseDescription();
|
|
2094
|
-
var
|
|
2094
|
+
var name = this.parseName();
|
|
2095
2095
|
var directives = this.parseDirectives(true);
|
|
2096
2096
|
return {
|
|
2097
2097
|
kind: _kinds.Kind.ENUM_VALUE_DEFINITION,
|
|
2098
2098
|
description,
|
|
2099
|
-
name
|
|
2099
|
+
name,
|
|
2100
2100
|
directives,
|
|
2101
2101
|
loc: this.loc(start)
|
|
2102
2102
|
};
|
|
@@ -2105,13 +2105,13 @@ var require_parser = __commonJS({
|
|
|
2105
2105
|
var start = this._lexer.token;
|
|
2106
2106
|
var description = this.parseDescription();
|
|
2107
2107
|
this.expectKeyword("input");
|
|
2108
|
-
var
|
|
2108
|
+
var name = this.parseName();
|
|
2109
2109
|
var directives = this.parseDirectives(true);
|
|
2110
2110
|
var fields = this.parseInputFieldsDefinition();
|
|
2111
2111
|
return {
|
|
2112
2112
|
kind: _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION,
|
|
2113
2113
|
description,
|
|
2114
|
-
name
|
|
2114
|
+
name,
|
|
2115
2115
|
directives,
|
|
2116
2116
|
fields,
|
|
2117
2117
|
loc: this.loc(start)
|
|
@@ -2162,14 +2162,14 @@ var require_parser = __commonJS({
|
|
|
2162
2162
|
var start = this._lexer.token;
|
|
2163
2163
|
this.expectKeyword("extend");
|
|
2164
2164
|
this.expectKeyword("scalar");
|
|
2165
|
-
var
|
|
2165
|
+
var name = this.parseName();
|
|
2166
2166
|
var directives = this.parseDirectives(true);
|
|
2167
2167
|
if (directives.length === 0) {
|
|
2168
2168
|
throw this.unexpected();
|
|
2169
2169
|
}
|
|
2170
2170
|
return {
|
|
2171
2171
|
kind: _kinds.Kind.SCALAR_TYPE_EXTENSION,
|
|
2172
|
-
name
|
|
2172
|
+
name,
|
|
2173
2173
|
directives,
|
|
2174
2174
|
loc: this.loc(start)
|
|
2175
2175
|
};
|
|
@@ -2178,7 +2178,7 @@ var require_parser = __commonJS({
|
|
|
2178
2178
|
var start = this._lexer.token;
|
|
2179
2179
|
this.expectKeyword("extend");
|
|
2180
2180
|
this.expectKeyword("type");
|
|
2181
|
-
var
|
|
2181
|
+
var name = this.parseName();
|
|
2182
2182
|
var interfaces = this.parseImplementsInterfaces();
|
|
2183
2183
|
var directives = this.parseDirectives(true);
|
|
2184
2184
|
var fields = this.parseFieldsDefinition();
|
|
@@ -2187,7 +2187,7 @@ var require_parser = __commonJS({
|
|
|
2187
2187
|
}
|
|
2188
2188
|
return {
|
|
2189
2189
|
kind: _kinds.Kind.OBJECT_TYPE_EXTENSION,
|
|
2190
|
-
name
|
|
2190
|
+
name,
|
|
2191
2191
|
interfaces,
|
|
2192
2192
|
directives,
|
|
2193
2193
|
fields,
|
|
@@ -2198,7 +2198,7 @@ var require_parser = __commonJS({
|
|
|
2198
2198
|
var start = this._lexer.token;
|
|
2199
2199
|
this.expectKeyword("extend");
|
|
2200
2200
|
this.expectKeyword("interface");
|
|
2201
|
-
var
|
|
2201
|
+
var name = this.parseName();
|
|
2202
2202
|
var interfaces = this.parseImplementsInterfaces();
|
|
2203
2203
|
var directives = this.parseDirectives(true);
|
|
2204
2204
|
var fields = this.parseFieldsDefinition();
|
|
@@ -2207,7 +2207,7 @@ var require_parser = __commonJS({
|
|
|
2207
2207
|
}
|
|
2208
2208
|
return {
|
|
2209
2209
|
kind: _kinds.Kind.INTERFACE_TYPE_EXTENSION,
|
|
2210
|
-
name
|
|
2210
|
+
name,
|
|
2211
2211
|
interfaces,
|
|
2212
2212
|
directives,
|
|
2213
2213
|
fields,
|
|
@@ -2218,7 +2218,7 @@ var require_parser = __commonJS({
|
|
|
2218
2218
|
var start = this._lexer.token;
|
|
2219
2219
|
this.expectKeyword("extend");
|
|
2220
2220
|
this.expectKeyword("union");
|
|
2221
|
-
var
|
|
2221
|
+
var name = this.parseName();
|
|
2222
2222
|
var directives = this.parseDirectives(true);
|
|
2223
2223
|
var types14 = this.parseUnionMemberTypes();
|
|
2224
2224
|
if (directives.length === 0 && types14.length === 0) {
|
|
@@ -2226,7 +2226,7 @@ var require_parser = __commonJS({
|
|
|
2226
2226
|
}
|
|
2227
2227
|
return {
|
|
2228
2228
|
kind: _kinds.Kind.UNION_TYPE_EXTENSION,
|
|
2229
|
-
name
|
|
2229
|
+
name,
|
|
2230
2230
|
directives,
|
|
2231
2231
|
types: types14,
|
|
2232
2232
|
loc: this.loc(start)
|
|
@@ -2236,7 +2236,7 @@ var require_parser = __commonJS({
|
|
|
2236
2236
|
var start = this._lexer.token;
|
|
2237
2237
|
this.expectKeyword("extend");
|
|
2238
2238
|
this.expectKeyword("enum");
|
|
2239
|
-
var
|
|
2239
|
+
var name = this.parseName();
|
|
2240
2240
|
var directives = this.parseDirectives(true);
|
|
2241
2241
|
var values = this.parseEnumValuesDefinition();
|
|
2242
2242
|
if (directives.length === 0 && values.length === 0) {
|
|
@@ -2244,7 +2244,7 @@ var require_parser = __commonJS({
|
|
|
2244
2244
|
}
|
|
2245
2245
|
return {
|
|
2246
2246
|
kind: _kinds.Kind.ENUM_TYPE_EXTENSION,
|
|
2247
|
-
name
|
|
2247
|
+
name,
|
|
2248
2248
|
directives,
|
|
2249
2249
|
values,
|
|
2250
2250
|
loc: this.loc(start)
|
|
@@ -2254,7 +2254,7 @@ var require_parser = __commonJS({
|
|
|
2254
2254
|
var start = this._lexer.token;
|
|
2255
2255
|
this.expectKeyword("extend");
|
|
2256
2256
|
this.expectKeyword("input");
|
|
2257
|
-
var
|
|
2257
|
+
var name = this.parseName();
|
|
2258
2258
|
var directives = this.parseDirectives(true);
|
|
2259
2259
|
var fields = this.parseInputFieldsDefinition();
|
|
2260
2260
|
if (directives.length === 0 && fields.length === 0) {
|
|
@@ -2262,7 +2262,7 @@ var require_parser = __commonJS({
|
|
|
2262
2262
|
}
|
|
2263
2263
|
return {
|
|
2264
2264
|
kind: _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION,
|
|
2265
|
-
name
|
|
2265
|
+
name,
|
|
2266
2266
|
directives,
|
|
2267
2267
|
fields,
|
|
2268
2268
|
loc: this.loc(start)
|
|
@@ -2273,7 +2273,7 @@ var require_parser = __commonJS({
|
|
|
2273
2273
|
var description = this.parseDescription();
|
|
2274
2274
|
this.expectKeyword("directive");
|
|
2275
2275
|
this.expectToken(_tokenKind.TokenKind.AT);
|
|
2276
|
-
var
|
|
2276
|
+
var name = this.parseName();
|
|
2277
2277
|
var args = this.parseArgumentDefs();
|
|
2278
2278
|
var repeatable = this.expectOptionalKeyword("repeatable");
|
|
2279
2279
|
this.expectKeyword("on");
|
|
@@ -2281,7 +2281,7 @@ var require_parser = __commonJS({
|
|
|
2281
2281
|
return {
|
|
2282
2282
|
kind: _kinds.Kind.DIRECTIVE_DEFINITION,
|
|
2283
2283
|
description,
|
|
2284
|
-
name
|
|
2284
|
+
name,
|
|
2285
2285
|
arguments: args,
|
|
2286
2286
|
repeatable,
|
|
2287
2287
|
locations,
|
|
@@ -2293,9 +2293,9 @@ var require_parser = __commonJS({
|
|
|
2293
2293
|
};
|
|
2294
2294
|
_proto.parseDirectiveLocation = function parseDirectiveLocation() {
|
|
2295
2295
|
var start = this._lexer.token;
|
|
2296
|
-
var
|
|
2297
|
-
if (_directiveLocation.DirectiveLocation[
|
|
2298
|
-
return
|
|
2296
|
+
var name = this.parseName();
|
|
2297
|
+
if (_directiveLocation.DirectiveLocation[name.value] !== void 0) {
|
|
2298
|
+
return name;
|
|
2299
2299
|
}
|
|
2300
2300
|
throw this.unexpected(start);
|
|
2301
2301
|
};
|
|
@@ -2734,20 +2734,20 @@ var require_assertValidName = __commonJS({
|
|
|
2734
2734
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
2735
2735
|
}
|
|
2736
2736
|
var NAME_RX = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
|
|
2737
|
-
function assertValidName(
|
|
2738
|
-
var error = isValidNameError(
|
|
2737
|
+
function assertValidName(name) {
|
|
2738
|
+
var error = isValidNameError(name);
|
|
2739
2739
|
if (error) {
|
|
2740
2740
|
throw error;
|
|
2741
2741
|
}
|
|
2742
|
-
return
|
|
2742
|
+
return name;
|
|
2743
2743
|
}
|
|
2744
|
-
function isValidNameError(
|
|
2745
|
-
typeof
|
|
2746
|
-
if (
|
|
2747
|
-
return new _GraphQLError.GraphQLError('Name "'.concat(
|
|
2744
|
+
function isValidNameError(name) {
|
|
2745
|
+
typeof name === "string" || (0, _devAssert.default)(0, "Expected name to be a string.");
|
|
2746
|
+
if (name.length > 1 && name[0] === "_" && name[1] === "_") {
|
|
2747
|
+
return new _GraphQLError.GraphQLError('Name "'.concat(name, '" must not begin with "__", which is reserved by GraphQL introspection.'));
|
|
2748
2748
|
}
|
|
2749
|
-
if (!NAME_RX.test(
|
|
2750
|
-
return new _GraphQLError.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'.concat(
|
|
2749
|
+
if (!NAME_RX.test(name)) {
|
|
2750
|
+
return new _GraphQLError.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'.concat(name, '" does not.'));
|
|
2751
2751
|
}
|
|
2752
2752
|
}
|
|
2753
2753
|
}
|
|
@@ -3087,11 +3087,11 @@ var require_printer = __commonJS({
|
|
|
3087
3087
|
},
|
|
3088
3088
|
OperationDefinition: function OperationDefinition(node) {
|
|
3089
3089
|
var op = node.operation;
|
|
3090
|
-
var
|
|
3090
|
+
var name = node.name;
|
|
3091
3091
|
var varDefs = wrap("(", join2(node.variableDefinitions, ", "), ")");
|
|
3092
3092
|
var directives = join2(node.directives, " ");
|
|
3093
3093
|
var selectionSet = node.selectionSet;
|
|
3094
|
-
return !
|
|
3094
|
+
return !name && !directives && !varDefs && op === "query" ? selectionSet : join2([op, join2([name, varDefs]), directives, selectionSet], " ");
|
|
3095
3095
|
},
|
|
3096
3096
|
VariableDefinition: function VariableDefinition(_ref) {
|
|
3097
3097
|
var variable = _ref.variable, type = _ref.type, defaultValue = _ref.defaultValue, directives = _ref.directives;
|
|
@@ -3102,8 +3102,8 @@ var require_printer = __commonJS({
|
|
|
3102
3102
|
return block(selections);
|
|
3103
3103
|
},
|
|
3104
3104
|
Field: function Field(_ref3) {
|
|
3105
|
-
var alias = _ref3.alias,
|
|
3106
|
-
var prefix = wrap("", alias, ": ") +
|
|
3105
|
+
var alias = _ref3.alias, name = _ref3.name, args = _ref3.arguments, directives = _ref3.directives, selectionSet = _ref3.selectionSet;
|
|
3106
|
+
var prefix = wrap("", alias, ": ") + name;
|
|
3107
3107
|
var argsLine = prefix + wrap("(", join2(args, ", "), ")");
|
|
3108
3108
|
if (argsLine.length > MAX_LINE_LENGTH) {
|
|
3109
3109
|
argsLine = prefix + wrap("(\n", indent(join2(args, "\n")), "\n)");
|
|
@@ -3111,20 +3111,20 @@ var require_printer = __commonJS({
|
|
|
3111
3111
|
return join2([argsLine, join2(directives, " "), selectionSet], " ");
|
|
3112
3112
|
},
|
|
3113
3113
|
Argument: function Argument(_ref4) {
|
|
3114
|
-
var
|
|
3115
|
-
return
|
|
3114
|
+
var name = _ref4.name, value = _ref4.value;
|
|
3115
|
+
return name + ": " + value;
|
|
3116
3116
|
},
|
|
3117
3117
|
FragmentSpread: function FragmentSpread(_ref5) {
|
|
3118
|
-
var
|
|
3119
|
-
return "..." +
|
|
3118
|
+
var name = _ref5.name, directives = _ref5.directives;
|
|
3119
|
+
return "..." + name + wrap(" ", join2(directives, " "));
|
|
3120
3120
|
},
|
|
3121
3121
|
InlineFragment: function InlineFragment(_ref6) {
|
|
3122
3122
|
var typeCondition = _ref6.typeCondition, directives = _ref6.directives, selectionSet = _ref6.selectionSet;
|
|
3123
3123
|
return join2(["...", wrap("on ", typeCondition), join2(directives, " "), selectionSet], " ");
|
|
3124
3124
|
},
|
|
3125
3125
|
FragmentDefinition: function FragmentDefinition(_ref7) {
|
|
3126
|
-
var
|
|
3127
|
-
return "fragment ".concat(
|
|
3126
|
+
var name = _ref7.name, typeCondition = _ref7.typeCondition, variableDefinitions = _ref7.variableDefinitions, directives = _ref7.directives, selectionSet = _ref7.selectionSet;
|
|
3127
|
+
return "fragment ".concat(name).concat(wrap("(", join2(variableDefinitions, ", "), ")"), " ") + "on ".concat(typeCondition, " ").concat(wrap("", join2(directives, " "), " ")) + selectionSet;
|
|
3128
3128
|
},
|
|
3129
3129
|
IntValue: function IntValue(_ref8) {
|
|
3130
3130
|
var value = _ref8.value;
|
|
@@ -3158,16 +3158,16 @@ var require_printer = __commonJS({
|
|
|
3158
3158
|
return "{" + join2(fields, ", ") + "}";
|
|
3159
3159
|
},
|
|
3160
3160
|
ObjectField: function ObjectField(_ref15) {
|
|
3161
|
-
var
|
|
3162
|
-
return
|
|
3161
|
+
var name = _ref15.name, value = _ref15.value;
|
|
3162
|
+
return name + ": " + value;
|
|
3163
3163
|
},
|
|
3164
3164
|
Directive: function Directive(_ref16) {
|
|
3165
|
-
var
|
|
3166
|
-
return "@" +
|
|
3165
|
+
var name = _ref16.name, args = _ref16.arguments;
|
|
3166
|
+
return "@" + name + wrap("(", join2(args, ", "), ")");
|
|
3167
3167
|
},
|
|
3168
3168
|
NamedType: function NamedType(_ref17) {
|
|
3169
|
-
var
|
|
3170
|
-
return
|
|
3169
|
+
var name = _ref17.name;
|
|
3170
|
+
return name;
|
|
3171
3171
|
},
|
|
3172
3172
|
ListType: function ListType(_ref18) {
|
|
3173
3173
|
var type = _ref18.type;
|
|
@@ -3186,72 +3186,72 @@ var require_printer = __commonJS({
|
|
|
3186
3186
|
return operation + ": " + type;
|
|
3187
3187
|
},
|
|
3188
3188
|
ScalarTypeDefinition: addDescription(function(_ref22) {
|
|
3189
|
-
var
|
|
3190
|
-
return join2(["scalar",
|
|
3189
|
+
var name = _ref22.name, directives = _ref22.directives;
|
|
3190
|
+
return join2(["scalar", name, join2(directives, " ")], " ");
|
|
3191
3191
|
}),
|
|
3192
3192
|
ObjectTypeDefinition: addDescription(function(_ref23) {
|
|
3193
|
-
var
|
|
3194
|
-
return join2(["type",
|
|
3193
|
+
var name = _ref23.name, interfaces = _ref23.interfaces, directives = _ref23.directives, fields = _ref23.fields;
|
|
3194
|
+
return join2(["type", name, wrap("implements ", join2(interfaces, " & ")), join2(directives, " "), block(fields)], " ");
|
|
3195
3195
|
}),
|
|
3196
3196
|
FieldDefinition: addDescription(function(_ref24) {
|
|
3197
|
-
var
|
|
3198
|
-
return
|
|
3197
|
+
var name = _ref24.name, args = _ref24.arguments, type = _ref24.type, directives = _ref24.directives;
|
|
3198
|
+
return name + (hasMultilineItems(args) ? wrap("(\n", indent(join2(args, "\n")), "\n)") : wrap("(", join2(args, ", "), ")")) + ": " + type + wrap(" ", join2(directives, " "));
|
|
3199
3199
|
}),
|
|
3200
3200
|
InputValueDefinition: addDescription(function(_ref25) {
|
|
3201
|
-
var
|
|
3202
|
-
return join2([
|
|
3201
|
+
var name = _ref25.name, type = _ref25.type, defaultValue = _ref25.defaultValue, directives = _ref25.directives;
|
|
3202
|
+
return join2([name + ": " + type, wrap("= ", defaultValue), join2(directives, " ")], " ");
|
|
3203
3203
|
}),
|
|
3204
3204
|
InterfaceTypeDefinition: addDescription(function(_ref26) {
|
|
3205
|
-
var
|
|
3206
|
-
return join2(["interface",
|
|
3205
|
+
var name = _ref26.name, interfaces = _ref26.interfaces, directives = _ref26.directives, fields = _ref26.fields;
|
|
3206
|
+
return join2(["interface", name, wrap("implements ", join2(interfaces, " & ")), join2(directives, " "), block(fields)], " ");
|
|
3207
3207
|
}),
|
|
3208
3208
|
UnionTypeDefinition: addDescription(function(_ref27) {
|
|
3209
|
-
var
|
|
3210
|
-
return join2(["union",
|
|
3209
|
+
var name = _ref27.name, directives = _ref27.directives, types14 = _ref27.types;
|
|
3210
|
+
return join2(["union", name, join2(directives, " "), types14 && types14.length !== 0 ? "= " + join2(types14, " | ") : ""], " ");
|
|
3211
3211
|
}),
|
|
3212
3212
|
EnumTypeDefinition: addDescription(function(_ref28) {
|
|
3213
|
-
var
|
|
3214
|
-
return join2(["enum",
|
|
3213
|
+
var name = _ref28.name, directives = _ref28.directives, values = _ref28.values;
|
|
3214
|
+
return join2(["enum", name, join2(directives, " "), block(values)], " ");
|
|
3215
3215
|
}),
|
|
3216
3216
|
EnumValueDefinition: addDescription(function(_ref29) {
|
|
3217
|
-
var
|
|
3218
|
-
return join2([
|
|
3217
|
+
var name = _ref29.name, directives = _ref29.directives;
|
|
3218
|
+
return join2([name, join2(directives, " ")], " ");
|
|
3219
3219
|
}),
|
|
3220
3220
|
InputObjectTypeDefinition: addDescription(function(_ref30) {
|
|
3221
|
-
var
|
|
3222
|
-
return join2(["input",
|
|
3221
|
+
var name = _ref30.name, directives = _ref30.directives, fields = _ref30.fields;
|
|
3222
|
+
return join2(["input", name, join2(directives, " "), block(fields)], " ");
|
|
3223
3223
|
}),
|
|
3224
3224
|
DirectiveDefinition: addDescription(function(_ref31) {
|
|
3225
|
-
var
|
|
3226
|
-
return "directive @" +
|
|
3225
|
+
var name = _ref31.name, args = _ref31.arguments, repeatable = _ref31.repeatable, locations = _ref31.locations;
|
|
3226
|
+
return "directive @" + name + (hasMultilineItems(args) ? wrap("(\n", indent(join2(args, "\n")), "\n)") : wrap("(", join2(args, ", "), ")")) + (repeatable ? " repeatable" : "") + " on " + join2(locations, " | ");
|
|
3227
3227
|
}),
|
|
3228
3228
|
SchemaExtension: function SchemaExtension(_ref32) {
|
|
3229
3229
|
var directives = _ref32.directives, operationTypes = _ref32.operationTypes;
|
|
3230
3230
|
return join2(["extend schema", join2(directives, " "), block(operationTypes)], " ");
|
|
3231
3231
|
},
|
|
3232
3232
|
ScalarTypeExtension: function ScalarTypeExtension(_ref33) {
|
|
3233
|
-
var
|
|
3234
|
-
return join2(["extend scalar",
|
|
3233
|
+
var name = _ref33.name, directives = _ref33.directives;
|
|
3234
|
+
return join2(["extend scalar", name, join2(directives, " ")], " ");
|
|
3235
3235
|
},
|
|
3236
3236
|
ObjectTypeExtension: function ObjectTypeExtension(_ref34) {
|
|
3237
|
-
var
|
|
3238
|
-
return join2(["extend type",
|
|
3237
|
+
var name = _ref34.name, interfaces = _ref34.interfaces, directives = _ref34.directives, fields = _ref34.fields;
|
|
3238
|
+
return join2(["extend type", name, wrap("implements ", join2(interfaces, " & ")), join2(directives, " "), block(fields)], " ");
|
|
3239
3239
|
},
|
|
3240
3240
|
InterfaceTypeExtension: function InterfaceTypeExtension(_ref35) {
|
|
3241
|
-
var
|
|
3242
|
-
return join2(["extend interface",
|
|
3241
|
+
var name = _ref35.name, interfaces = _ref35.interfaces, directives = _ref35.directives, fields = _ref35.fields;
|
|
3242
|
+
return join2(["extend interface", name, wrap("implements ", join2(interfaces, " & ")), join2(directives, " "), block(fields)], " ");
|
|
3243
3243
|
},
|
|
3244
3244
|
UnionTypeExtension: function UnionTypeExtension(_ref36) {
|
|
3245
|
-
var
|
|
3246
|
-
return join2(["extend union",
|
|
3245
|
+
var name = _ref36.name, directives = _ref36.directives, types14 = _ref36.types;
|
|
3246
|
+
return join2(["extend union", name, join2(directives, " "), types14 && types14.length !== 0 ? "= " + join2(types14, " | ") : ""], " ");
|
|
3247
3247
|
},
|
|
3248
3248
|
EnumTypeExtension: function EnumTypeExtension(_ref37) {
|
|
3249
|
-
var
|
|
3250
|
-
return join2(["extend enum",
|
|
3249
|
+
var name = _ref37.name, directives = _ref37.directives, values = _ref37.values;
|
|
3250
|
+
return join2(["extend enum", name, join2(directives, " "), block(values)], " ");
|
|
3251
3251
|
},
|
|
3252
3252
|
InputObjectTypeExtension: function InputObjectTypeExtension(_ref38) {
|
|
3253
|
-
var
|
|
3254
|
-
return join2(["extend input",
|
|
3253
|
+
var name = _ref38.name, directives = _ref38.directives, fields = _ref38.fields;
|
|
3254
|
+
return join2(["extend input", name, join2(directives, " "), block(fields)], " ");
|
|
3255
3255
|
}
|
|
3256
3256
|
};
|
|
3257
3257
|
function addDescription(cb) {
|
|
@@ -3938,8 +3938,8 @@ var require_definition = __commonJS({
|
|
|
3938
3938
|
_proto5.getValues = function getValues() {
|
|
3939
3939
|
return this._values;
|
|
3940
3940
|
};
|
|
3941
|
-
_proto5.getValue = function getValue(
|
|
3942
|
-
return this._nameLookup[
|
|
3941
|
+
_proto5.getValue = function getValue(name) {
|
|
3942
|
+
return this._nameLookup[name];
|
|
3943
3943
|
};
|
|
3944
3944
|
_proto5.serialize = function serialize(outputValue) {
|
|
3945
3945
|
var enumValue = this._valueLookup.get(outputValue);
|
|
@@ -4518,8 +4518,8 @@ var require_scalars = __commonJS({
|
|
|
4518
4518
|
exports.specifiedScalarTypes = specifiedScalarTypes;
|
|
4519
4519
|
function isSpecifiedScalarType(type) {
|
|
4520
4520
|
return specifiedScalarTypes.some(function(_ref) {
|
|
4521
|
-
var
|
|
4522
|
-
return type.name ===
|
|
4521
|
+
var name = _ref.name;
|
|
4522
|
+
return type.name === name;
|
|
4523
4523
|
});
|
|
4524
4524
|
}
|
|
4525
4525
|
}
|
|
@@ -5200,9 +5200,9 @@ var require_introspection = __commonJS({
|
|
|
5200
5200
|
astNode: void 0
|
|
5201
5201
|
}],
|
|
5202
5202
|
resolve: function resolve2(_source, _ref8, _context, _ref9) {
|
|
5203
|
-
var
|
|
5203
|
+
var name = _ref8.name;
|
|
5204
5204
|
var schema = _ref9.schema;
|
|
5205
|
-
return schema.getType(
|
|
5205
|
+
return schema.getType(name);
|
|
5206
5206
|
},
|
|
5207
5207
|
isDeprecated: false,
|
|
5208
5208
|
deprecationReason: void 0,
|
|
@@ -5229,8 +5229,8 @@ var require_introspection = __commonJS({
|
|
|
5229
5229
|
exports.introspectionTypes = introspectionTypes;
|
|
5230
5230
|
function isIntrospectionType(type) {
|
|
5231
5231
|
return introspectionTypes.some(function(_ref11) {
|
|
5232
|
-
var
|
|
5233
|
-
return type.name ===
|
|
5232
|
+
var name = _ref11.name;
|
|
5233
|
+
return type.name === name;
|
|
5234
5234
|
});
|
|
5235
5235
|
}
|
|
5236
5236
|
}
|
|
@@ -5396,8 +5396,8 @@ var require_directives = __commonJS({
|
|
|
5396
5396
|
exports.specifiedDirectives = specifiedDirectives;
|
|
5397
5397
|
function isSpecifiedDirective(directive) {
|
|
5398
5398
|
return specifiedDirectives.some(function(_ref2) {
|
|
5399
|
-
var
|
|
5400
|
-
return
|
|
5399
|
+
var name = _ref2.name;
|
|
5400
|
+
return name === directive.name;
|
|
5401
5401
|
});
|
|
5402
5402
|
}
|
|
5403
5403
|
}
|
|
@@ -5554,8 +5554,8 @@ var require_schema = __commonJS({
|
|
|
5554
5554
|
_proto.getTypeMap = function getTypeMap() {
|
|
5555
5555
|
return this._typeMap;
|
|
5556
5556
|
};
|
|
5557
|
-
_proto.getType = function getType(
|
|
5558
|
-
return this.getTypeMap()[
|
|
5557
|
+
_proto.getType = function getType(name) {
|
|
5558
|
+
return this.getTypeMap()[name];
|
|
5559
5559
|
};
|
|
5560
5560
|
_proto.getPossibleTypes = function getPossibleTypes(abstractType) {
|
|
5561
5561
|
return (0, _definition.isUnionType)(abstractType) ? abstractType.getTypes() : this.getImplementations(abstractType).objects;
|
|
@@ -5597,9 +5597,9 @@ var require_schema = __commonJS({
|
|
|
5597
5597
|
_proto.getDirectives = function getDirectives() {
|
|
5598
5598
|
return this._directives;
|
|
5599
5599
|
};
|
|
5600
|
-
_proto.getDirective = function getDirective(
|
|
5600
|
+
_proto.getDirective = function getDirective(name) {
|
|
5601
5601
|
return (0, _find.default)(this.getDirectives(), function(directive) {
|
|
5602
|
-
return directive.name ===
|
|
5602
|
+
return directive.name === name;
|
|
5603
5603
|
});
|
|
5604
5604
|
};
|
|
5605
5605
|
_proto.toConfig = function toConfig() {
|
|
@@ -6309,18 +6309,18 @@ var require_TypeInfo = __commonJS({
|
|
|
6309
6309
|
}();
|
|
6310
6310
|
exports.TypeInfo = TypeInfo;
|
|
6311
6311
|
function getFieldDef(schema, parentType, fieldNode) {
|
|
6312
|
-
var
|
|
6313
|
-
if (
|
|
6312
|
+
var name = fieldNode.name.value;
|
|
6313
|
+
if (name === _introspection.SchemaMetaFieldDef.name && schema.getQueryType() === parentType) {
|
|
6314
6314
|
return _introspection.SchemaMetaFieldDef;
|
|
6315
6315
|
}
|
|
6316
|
-
if (
|
|
6316
|
+
if (name === _introspection.TypeMetaFieldDef.name && schema.getQueryType() === parentType) {
|
|
6317
6317
|
return _introspection.TypeMetaFieldDef;
|
|
6318
6318
|
}
|
|
6319
|
-
if (
|
|
6319
|
+
if (name === _introspection.TypeNameMetaFieldDef.name && (0, _definition.isCompositeType)(parentType)) {
|
|
6320
6320
|
return _introspection.TypeNameMetaFieldDef;
|
|
6321
6321
|
}
|
|
6322
6322
|
if ((0, _definition.isObjectType)(parentType) || (0, _definition.isInterfaceType)(parentType)) {
|
|
6323
|
-
return parentType.getFields()[
|
|
6323
|
+
return parentType.getFields()[name];
|
|
6324
6324
|
}
|
|
6325
6325
|
}
|
|
6326
6326
|
function visitWithTypeInfo(typeInfo, visitor) {
|
|
@@ -6896,8 +6896,8 @@ var require_PossibleFragmentSpreadsRule = __commonJS({
|
|
|
6896
6896
|
}
|
|
6897
6897
|
};
|
|
6898
6898
|
}
|
|
6899
|
-
function getFragmentType(context,
|
|
6900
|
-
var frag = context.getFragment(
|
|
6899
|
+
function getFragmentType(context, name) {
|
|
6900
|
+
var frag = context.getFragment(name);
|
|
6901
6901
|
if (frag) {
|
|
6902
6902
|
var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), frag.typeCondition);
|
|
6903
6903
|
if ((0, _definition.isCompositeType)(type)) {
|
|
@@ -7100,22 +7100,22 @@ var require_KnownDirectivesRule = __commonJS({
|
|
|
7100
7100
|
for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {
|
|
7101
7101
|
var def = astDefinitions[_i4];
|
|
7102
7102
|
if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) {
|
|
7103
|
-
locationsMap[def.name.value] = def.locations.map(function(
|
|
7104
|
-
return
|
|
7103
|
+
locationsMap[def.name.value] = def.locations.map(function(name) {
|
|
7104
|
+
return name.value;
|
|
7105
7105
|
});
|
|
7106
7106
|
}
|
|
7107
7107
|
}
|
|
7108
7108
|
return {
|
|
7109
7109
|
Directive: function Directive(node, _key, _parent, _path, ancestors) {
|
|
7110
|
-
var
|
|
7111
|
-
var locations = locationsMap[
|
|
7110
|
+
var name = node.name.value;
|
|
7111
|
+
var locations = locationsMap[name];
|
|
7112
7112
|
if (!locations) {
|
|
7113
|
-
context.reportError(new _GraphQLError.GraphQLError('Unknown directive "@'.concat(
|
|
7113
|
+
context.reportError(new _GraphQLError.GraphQLError('Unknown directive "@'.concat(name, '".'), node));
|
|
7114
7114
|
return;
|
|
7115
7115
|
}
|
|
7116
7116
|
var candidateLocation = getDirectiveLocationForASTPath(ancestors);
|
|
7117
7117
|
if (candidateLocation && locations.indexOf(candidateLocation) === -1) {
|
|
7118
|
-
context.reportError(new _GraphQLError.GraphQLError('Directive "@'.concat(
|
|
7118
|
+
context.reportError(new _GraphQLError.GraphQLError('Directive "@'.concat(name, '" may not be used on ').concat(candidateLocation, "."), node));
|
|
7119
7119
|
}
|
|
7120
7120
|
}
|
|
7121
7121
|
};
|
|
@@ -8479,7 +8479,7 @@ var require_ValidationContext = __commonJS({
|
|
|
8479
8479
|
_proto.getDocument = function getDocument() {
|
|
8480
8480
|
return this._ast;
|
|
8481
8481
|
};
|
|
8482
|
-
_proto.getFragment = function getFragment(
|
|
8482
|
+
_proto.getFragment = function getFragment(name) {
|
|
8483
8483
|
var fragments = this._fragments;
|
|
8484
8484
|
if (!fragments) {
|
|
8485
8485
|
this._fragments = fragments = this.getDocument().definitions.reduce(function(frags, statement) {
|
|
@@ -8489,7 +8489,7 @@ var require_ValidationContext = __commonJS({
|
|
|
8489
8489
|
return frags;
|
|
8490
8490
|
}, /* @__PURE__ */ Object.create(null));
|
|
8491
8491
|
}
|
|
8492
|
-
return fragments[
|
|
8492
|
+
return fragments[name];
|
|
8493
8493
|
};
|
|
8494
8494
|
_proto.getFragmentSpreads = function getFragmentSpreads(node) {
|
|
8495
8495
|
var spreads = this._fragmentSpreads.get(node);
|
|
@@ -8786,8 +8786,8 @@ var require_promiseForObject = __commonJS({
|
|
|
8786
8786
|
exports.default = promiseForObject;
|
|
8787
8787
|
function promiseForObject(object) {
|
|
8788
8788
|
var keys = Object.keys(object);
|
|
8789
|
-
var valuesAndPromises = keys.map(function(
|
|
8790
|
-
return object[
|
|
8789
|
+
var valuesAndPromises = keys.map(function(name) {
|
|
8790
|
+
return object[name];
|
|
8791
8791
|
});
|
|
8792
8792
|
return Promise.all(valuesAndPromises).then(function(values) {
|
|
8793
8793
|
return values.reduce(function(resolvedObject, value, i) {
|
|
@@ -9198,14 +9198,14 @@ var require_values = __commonJS({
|
|
|
9198
9198
|
});
|
|
9199
9199
|
for (var _i4 = 0, _def$args2 = def.args; _i4 < _def$args2.length; _i4++) {
|
|
9200
9200
|
var argDef = _def$args2[_i4];
|
|
9201
|
-
var
|
|
9201
|
+
var name = argDef.name;
|
|
9202
9202
|
var argType = argDef.type;
|
|
9203
|
-
var argumentNode2 = argNodeMap[
|
|
9203
|
+
var argumentNode2 = argNodeMap[name];
|
|
9204
9204
|
if (!argumentNode2) {
|
|
9205
9205
|
if (argDef.defaultValue !== void 0) {
|
|
9206
|
-
coercedValues[
|
|
9206
|
+
coercedValues[name] = argDef.defaultValue;
|
|
9207
9207
|
} else if ((0, _definition.isNonNullType)(argType)) {
|
|
9208
|
-
throw new _GraphQLError.GraphQLError('Argument "'.concat(
|
|
9208
|
+
throw new _GraphQLError.GraphQLError('Argument "'.concat(name, '" of required type "').concat((0, _inspect.default)(argType), '" ') + "was not provided.", node);
|
|
9209
9209
|
}
|
|
9210
9210
|
continue;
|
|
9211
9211
|
}
|
|
@@ -9215,22 +9215,22 @@ var require_values = __commonJS({
|
|
|
9215
9215
|
var variableName = valueNode.name.value;
|
|
9216
9216
|
if (variableValues == null || !hasOwnProperty(variableValues, variableName)) {
|
|
9217
9217
|
if (argDef.defaultValue !== void 0) {
|
|
9218
|
-
coercedValues[
|
|
9218
|
+
coercedValues[name] = argDef.defaultValue;
|
|
9219
9219
|
} else if ((0, _definition.isNonNullType)(argType)) {
|
|
9220
|
-
throw new _GraphQLError.GraphQLError('Argument "'.concat(
|
|
9220
|
+
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);
|
|
9221
9221
|
}
|
|
9222
9222
|
continue;
|
|
9223
9223
|
}
|
|
9224
9224
|
isNull = variableValues[variableName] == null;
|
|
9225
9225
|
}
|
|
9226
9226
|
if (isNull && (0, _definition.isNonNullType)(argType)) {
|
|
9227
|
-
throw new _GraphQLError.GraphQLError('Argument "'.concat(
|
|
9227
|
+
throw new _GraphQLError.GraphQLError('Argument "'.concat(name, '" of non-null type "').concat((0, _inspect.default)(argType), '" ') + "must not be null.", valueNode);
|
|
9228
9228
|
}
|
|
9229
9229
|
var coercedValue = (0, _valueFromAST.valueFromAST)(valueNode, argType, variableValues);
|
|
9230
9230
|
if (coercedValue === void 0) {
|
|
9231
|
-
throw new _GraphQLError.GraphQLError('Argument "'.concat(
|
|
9231
|
+
throw new _GraphQLError.GraphQLError('Argument "'.concat(name, '" has invalid value ').concat((0, _printer.print)(valueNode), "."), valueNode);
|
|
9232
9232
|
}
|
|
9233
|
-
coercedValues[
|
|
9233
|
+
coercedValues[name] = coercedValue;
|
|
9234
9234
|
}
|
|
9235
9235
|
return coercedValues;
|
|
9236
9236
|
}
|
|
@@ -9446,11 +9446,11 @@ var require_execute = __commonJS({
|
|
|
9446
9446
|
if (!shouldIncludeNode(exeContext, selection2)) {
|
|
9447
9447
|
continue;
|
|
9448
9448
|
}
|
|
9449
|
-
var
|
|
9450
|
-
if (!fields[
|
|
9451
|
-
fields[
|
|
9449
|
+
var name = getFieldEntryKey(selection2);
|
|
9450
|
+
if (!fields[name]) {
|
|
9451
|
+
fields[name] = [];
|
|
9452
9452
|
}
|
|
9453
|
-
fields[
|
|
9453
|
+
fields[name].push(selection2);
|
|
9454
9454
|
break;
|
|
9455
9455
|
}
|
|
9456
9456
|
case _kinds.Kind.INLINE_FRAGMENT: {
|
|
@@ -11766,8 +11766,8 @@ var require_extendSchema = __commonJS({
|
|
|
11766
11766
|
for (var _i6 = 0; _i6 < typeDefs.length; _i6++) {
|
|
11767
11767
|
var _stdTypeMap$name;
|
|
11768
11768
|
var typeNode = typeDefs[_i6];
|
|
11769
|
-
var
|
|
11770
|
-
typeMap[
|
|
11769
|
+
var name = typeNode.name.value;
|
|
11770
|
+
typeMap[name] = (_stdTypeMap$name = stdTypeMap[name]) !== null && _stdTypeMap$name !== void 0 ? _stdTypeMap$name : buildType(typeNode);
|
|
11771
11771
|
}
|
|
11772
11772
|
var operationTypes = _objectSpread(_objectSpread({
|
|
11773
11773
|
query: schemaConfig.query && replaceNamedType(schemaConfig.query),
|
|
@@ -11930,10 +11930,10 @@ var require_extendSchema = __commonJS({
|
|
|
11930
11930
|
}
|
|
11931
11931
|
function getNamedType2(node) {
|
|
11932
11932
|
var _stdTypeMap$name2;
|
|
11933
|
-
var
|
|
11934
|
-
var type = (_stdTypeMap$name2 = stdTypeMap[
|
|
11933
|
+
var name2 = node.name.value;
|
|
11934
|
+
var type = (_stdTypeMap$name2 = stdTypeMap[name2]) !== null && _stdTypeMap$name2 !== void 0 ? _stdTypeMap$name2 : typeMap[name2];
|
|
11935
11935
|
if (type === void 0) {
|
|
11936
|
-
throw new Error('Unknown type: "'.concat(
|
|
11936
|
+
throw new Error('Unknown type: "'.concat(name2, '".'));
|
|
11937
11937
|
}
|
|
11938
11938
|
return type;
|
|
11939
11939
|
}
|
|
@@ -12060,15 +12060,15 @@ var require_extendSchema = __commonJS({
|
|
|
12060
12060
|
}
|
|
12061
12061
|
function buildType(astNode) {
|
|
12062
12062
|
var _typeExtensionsMap$na;
|
|
12063
|
-
var
|
|
12063
|
+
var name2 = astNode.name.value;
|
|
12064
12064
|
var description = getDescription(astNode, options);
|
|
12065
|
-
var extensionNodes = (_typeExtensionsMap$na = typeExtensionsMap[
|
|
12065
|
+
var extensionNodes = (_typeExtensionsMap$na = typeExtensionsMap[name2]) !== null && _typeExtensionsMap$na !== void 0 ? _typeExtensionsMap$na : [];
|
|
12066
12066
|
switch (astNode.kind) {
|
|
12067
12067
|
case _kinds.Kind.OBJECT_TYPE_DEFINITION: {
|
|
12068
12068
|
var extensionASTNodes = extensionNodes;
|
|
12069
12069
|
var allNodes = [astNode].concat(extensionASTNodes);
|
|
12070
12070
|
return new _definition.GraphQLObjectType({
|
|
12071
|
-
name:
|
|
12071
|
+
name: name2,
|
|
12072
12072
|
description,
|
|
12073
12073
|
interfaces: function interfaces() {
|
|
12074
12074
|
return buildInterfaces(allNodes);
|
|
@@ -12084,7 +12084,7 @@ var require_extendSchema = __commonJS({
|
|
|
12084
12084
|
var _extensionASTNodes = extensionNodes;
|
|
12085
12085
|
var _allNodes = [astNode].concat(_extensionASTNodes);
|
|
12086
12086
|
return new _definition.GraphQLInterfaceType({
|
|
12087
|
-
name:
|
|
12087
|
+
name: name2,
|
|
12088
12088
|
description,
|
|
12089
12089
|
interfaces: function interfaces() {
|
|
12090
12090
|
return buildInterfaces(_allNodes);
|
|
@@ -12100,7 +12100,7 @@ var require_extendSchema = __commonJS({
|
|
|
12100
12100
|
var _extensionASTNodes2 = extensionNodes;
|
|
12101
12101
|
var _allNodes2 = [astNode].concat(_extensionASTNodes2);
|
|
12102
12102
|
return new _definition.GraphQLEnumType({
|
|
12103
|
-
name:
|
|
12103
|
+
name: name2,
|
|
12104
12104
|
description,
|
|
12105
12105
|
values: buildEnumValueMap(_allNodes2),
|
|
12106
12106
|
astNode,
|
|
@@ -12111,7 +12111,7 @@ var require_extendSchema = __commonJS({
|
|
|
12111
12111
|
var _extensionASTNodes3 = extensionNodes;
|
|
12112
12112
|
var _allNodes3 = [astNode].concat(_extensionASTNodes3);
|
|
12113
12113
|
return new _definition.GraphQLUnionType({
|
|
12114
|
-
name:
|
|
12114
|
+
name: name2,
|
|
12115
12115
|
description,
|
|
12116
12116
|
types: function types14() {
|
|
12117
12117
|
return buildUnionTypes(_allNodes3);
|
|
@@ -12123,7 +12123,7 @@ var require_extendSchema = __commonJS({
|
|
|
12123
12123
|
case _kinds.Kind.SCALAR_TYPE_DEFINITION: {
|
|
12124
12124
|
var _extensionASTNodes4 = extensionNodes;
|
|
12125
12125
|
return new _definition.GraphQLScalarType({
|
|
12126
|
-
name:
|
|
12126
|
+
name: name2,
|
|
12127
12127
|
description,
|
|
12128
12128
|
specifiedByUrl: getSpecifiedByUrl(astNode),
|
|
12129
12129
|
astNode,
|
|
@@ -12134,7 +12134,7 @@ var require_extendSchema = __commonJS({
|
|
|
12134
12134
|
var _extensionASTNodes5 = extensionNodes;
|
|
12135
12135
|
var _allNodes4 = [astNode].concat(_extensionASTNodes5);
|
|
12136
12136
|
return new _definition.GraphQLInputObjectType({
|
|
12137
|
-
name:
|
|
12137
|
+
name: name2,
|
|
12138
12138
|
description,
|
|
12139
12139
|
fields: function fields() {
|
|
12140
12140
|
return buildInputFieldMap(_allNodes4);
|
|
@@ -13231,12 +13231,12 @@ var require_findBreakingChanges = __commonJS({
|
|
|
13231
13231
|
var removed = [];
|
|
13232
13232
|
var persisted = [];
|
|
13233
13233
|
var oldMap = (0, _keyMap.default)(oldArray, function(_ref11) {
|
|
13234
|
-
var
|
|
13235
|
-
return
|
|
13234
|
+
var name = _ref11.name;
|
|
13235
|
+
return name;
|
|
13236
13236
|
});
|
|
13237
13237
|
var newMap = (0, _keyMap.default)(newArray, function(_ref12) {
|
|
13238
|
-
var
|
|
13239
|
-
return
|
|
13238
|
+
var name = _ref12.name;
|
|
13239
|
+
return name;
|
|
13240
13240
|
});
|
|
13241
13241
|
for (var _i44 = 0; _i44 < oldArray.length; _i44++) {
|
|
13242
13242
|
var oldItem = oldArray[_i44];
|
|
@@ -15010,9 +15010,9 @@ var require_errors = __commonJS({
|
|
|
15010
15010
|
E("ERR_HTTP_TRAILER_INVALID", "Trailers are invalid with this transfer encoding");
|
|
15011
15011
|
E("ERR_INDEX_OUT_OF_RANGE", "Index out of range");
|
|
15012
15012
|
E("ERR_INVALID_ARG_TYPE", invalidArgType);
|
|
15013
|
-
E("ERR_INVALID_ARRAY_LENGTH", function(
|
|
15013
|
+
E("ERR_INVALID_ARRAY_LENGTH", function(name, len, actual) {
|
|
15014
15014
|
assert.strictEqual(typeof actual, "number");
|
|
15015
|
-
return 'The array "'.concat(
|
|
15015
|
+
return 'The array "'.concat(name, '" (length ').concat(actual, ") must be of length ").concat(len, ".");
|
|
15016
15016
|
});
|
|
15017
15017
|
E("ERR_INVALID_BUFFER_SIZE", "Buffer size must be a multiple of %s");
|
|
15018
15018
|
E("ERR_INVALID_CALLBACK", "Callback must be a function");
|
|
@@ -15023,8 +15023,8 @@ var require_errors = __commonJS({
|
|
|
15023
15023
|
E("ERR_INVALID_FILE_URL_PATH", "File URL path %s");
|
|
15024
15024
|
E("ERR_INVALID_HANDLE_TYPE", "This handle type cannot be sent");
|
|
15025
15025
|
E("ERR_INVALID_IP_ADDRESS", "Invalid IP address: %s");
|
|
15026
|
-
E("ERR_INVALID_OPT_VALUE", function(
|
|
15027
|
-
return 'The value "'.concat(String(value), '" is invalid for option "').concat(
|
|
15026
|
+
E("ERR_INVALID_OPT_VALUE", function(name, value) {
|
|
15027
|
+
return 'The value "'.concat(String(value), '" is invalid for option "').concat(name, '"');
|
|
15028
15028
|
});
|
|
15029
15029
|
E("ERR_INVALID_OPT_VALUE_ENCODING", function(value) {
|
|
15030
15030
|
return 'The value "'.concat(String(value), '" is invalid for option "encoding"');
|
|
@@ -15072,8 +15072,8 @@ var require_errors = __commonJS({
|
|
|
15072
15072
|
E("ERR_UNKNOWN_STDIN_TYPE", "Unknown stdin file type");
|
|
15073
15073
|
E("ERR_UNKNOWN_STREAM_TYPE", "Unknown stream file type");
|
|
15074
15074
|
E("ERR_V8BREAKITERATOR", "Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl");
|
|
15075
|
-
function invalidArgType(
|
|
15076
|
-
assert(
|
|
15075
|
+
function invalidArgType(name, expected, actual) {
|
|
15076
|
+
assert(name, "name is required");
|
|
15077
15077
|
var determiner;
|
|
15078
15078
|
if (expected.includes("not ")) {
|
|
15079
15079
|
determiner = "must not be";
|
|
@@ -15082,16 +15082,16 @@ var require_errors = __commonJS({
|
|
|
15082
15082
|
determiner = "must be";
|
|
15083
15083
|
}
|
|
15084
15084
|
var msg;
|
|
15085
|
-
if (Array.isArray(
|
|
15086
|
-
var names =
|
|
15085
|
+
if (Array.isArray(name)) {
|
|
15086
|
+
var names = name.map(function(val) {
|
|
15087
15087
|
return '"'.concat(val, '"');
|
|
15088
15088
|
}).join(", ");
|
|
15089
15089
|
msg = "The ".concat(names, " arguments ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
15090
|
-
} else if (
|
|
15091
|
-
msg = "The ".concat(
|
|
15090
|
+
} else if (name.includes(" argument")) {
|
|
15091
|
+
msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
15092
15092
|
} else {
|
|
15093
|
-
var type =
|
|
15094
|
-
msg = 'The "'.concat(
|
|
15093
|
+
var type = name.includes(".") ? "property" : "argument";
|
|
15094
|
+
msg = 'The "'.concat(name, '" ').concat(type, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
15095
15095
|
}
|
|
15096
15096
|
if (arguments.length >= 3) {
|
|
15097
15097
|
msg += ". Received type ".concat(actual !== null ? typeof actual : "null");
|
|
@@ -15143,11 +15143,11 @@ var require_errors = __commonJS({
|
|
|
15143
15143
|
return "of ".concat(thing, " ").concat(String(expected));
|
|
15144
15144
|
}
|
|
15145
15145
|
}
|
|
15146
|
-
function bufferOutOfBounds(
|
|
15146
|
+
function bufferOutOfBounds(name, isWriting) {
|
|
15147
15147
|
if (isWriting) {
|
|
15148
15148
|
return "Attempt to write outside buffer bounds";
|
|
15149
15149
|
} else {
|
|
15150
|
-
return '"'.concat(
|
|
15150
|
+
return '"'.concat(name, '" is outside of buffer bounds');
|
|
15151
15151
|
}
|
|
15152
15152
|
}
|
|
15153
15153
|
}
|
|
@@ -15545,7 +15545,7 @@ var require_node = __commonJS({
|
|
|
15545
15545
|
exports.Node = Node;
|
|
15546
15546
|
var Link = function(_super) {
|
|
15547
15547
|
__extends(Link2, _super);
|
|
15548
|
-
function Link2(vol3, parent,
|
|
15548
|
+
function Link2(vol3, parent, name) {
|
|
15549
15549
|
var _this = _super.call(this) || this;
|
|
15550
15550
|
_this.children = {};
|
|
15551
15551
|
_this._steps = [];
|
|
@@ -15553,7 +15553,7 @@ var require_node = __commonJS({
|
|
|
15553
15553
|
_this.length = 0;
|
|
15554
15554
|
_this.vol = vol3;
|
|
15555
15555
|
_this.parent = parent;
|
|
15556
|
-
_this.name =
|
|
15556
|
+
_this.name = name;
|
|
15557
15557
|
_this.syncSteps();
|
|
15558
15558
|
return _this;
|
|
15559
15559
|
}
|
|
@@ -15578,22 +15578,22 @@ var require_node = __commonJS({
|
|
|
15578
15578
|
Link2.prototype.getNode = function() {
|
|
15579
15579
|
return this.node;
|
|
15580
15580
|
};
|
|
15581
|
-
Link2.prototype.createChild = function(
|
|
15581
|
+
Link2.prototype.createChild = function(name, node) {
|
|
15582
15582
|
if (node === void 0) {
|
|
15583
15583
|
node = this.vol.createNode();
|
|
15584
15584
|
}
|
|
15585
|
-
var link = new Link2(this.vol, this,
|
|
15585
|
+
var link = new Link2(this.vol, this, name);
|
|
15586
15586
|
link.setNode(node);
|
|
15587
15587
|
if (node.isDirectory()) {
|
|
15588
15588
|
}
|
|
15589
|
-
this.setChild(
|
|
15589
|
+
this.setChild(name, link);
|
|
15590
15590
|
return link;
|
|
15591
15591
|
};
|
|
15592
|
-
Link2.prototype.setChild = function(
|
|
15592
|
+
Link2.prototype.setChild = function(name, link) {
|
|
15593
15593
|
if (link === void 0) {
|
|
15594
|
-
link = new Link2(this.vol, this,
|
|
15594
|
+
link = new Link2(this.vol, this, name);
|
|
15595
15595
|
}
|
|
15596
|
-
this.children[
|
|
15596
|
+
this.children[name] = link;
|
|
15597
15597
|
link.parent = this;
|
|
15598
15598
|
this.length++;
|
|
15599
15599
|
this.emit("child:add", link, this);
|
|
@@ -15604,9 +15604,9 @@ var require_node = __commonJS({
|
|
|
15604
15604
|
this.length--;
|
|
15605
15605
|
this.emit("child:delete", link, this);
|
|
15606
15606
|
};
|
|
15607
|
-
Link2.prototype.getChild = function(
|
|
15608
|
-
if (Object.hasOwnProperty.call(this.children,
|
|
15609
|
-
return this.children[
|
|
15607
|
+
Link2.prototype.getChild = function(name) {
|
|
15608
|
+
if (Object.hasOwnProperty.call(this.children, name)) {
|
|
15609
|
+
return this.children[name];
|
|
15610
15610
|
}
|
|
15611
15611
|
};
|
|
15612
15612
|
Link2.prototype.getPath = function() {
|
|
@@ -16495,17 +16495,17 @@ var require_volume = __commonJS({
|
|
|
16495
16495
|
enumerable: false,
|
|
16496
16496
|
configurable: true
|
|
16497
16497
|
});
|
|
16498
|
-
Volume2.prototype.createLink = function(parent,
|
|
16498
|
+
Volume2.prototype.createLink = function(parent, name, isDirectory, perm) {
|
|
16499
16499
|
if (isDirectory === void 0) {
|
|
16500
16500
|
isDirectory = false;
|
|
16501
16501
|
}
|
|
16502
16502
|
if (!parent) {
|
|
16503
16503
|
return new this.props.Link(this, null, "");
|
|
16504
16504
|
}
|
|
16505
|
-
if (!
|
|
16505
|
+
if (!name) {
|
|
16506
16506
|
throw new Error("createLink: name cannot be empty");
|
|
16507
16507
|
}
|
|
16508
|
-
return parent.createChild(
|
|
16508
|
+
return parent.createChild(name, this.createNode(isDirectory, perm));
|
|
16509
16509
|
};
|
|
16510
16510
|
Volume2.prototype.deleteLink = function(link) {
|
|
16511
16511
|
var parent = link.parent;
|
|
@@ -17055,12 +17055,12 @@ var require_volume = __commonJS({
|
|
|
17055
17055
|
var dir2 = this.getLinkParent(steps2);
|
|
17056
17056
|
if (!dir2)
|
|
17057
17057
|
throw createError(ENOENT, "link", filename1, filename2);
|
|
17058
|
-
var
|
|
17059
|
-
if (dir2.getChild(
|
|
17058
|
+
var name = steps2[steps2.length - 1];
|
|
17059
|
+
if (dir2.getChild(name))
|
|
17060
17060
|
throw createError(EEXIST, "link", filename1, filename2);
|
|
17061
17061
|
var node = link1.getNode();
|
|
17062
17062
|
node.nlink++;
|
|
17063
|
-
dir2.createChild(
|
|
17063
|
+
dir2.createChild(name, node);
|
|
17064
17064
|
};
|
|
17065
17065
|
Volume2.prototype.copyFileBase = function(src, dest, flags) {
|
|
17066
17066
|
var buf = this.readFileSync(src);
|
|
@@ -17131,10 +17131,10 @@ var require_volume = __commonJS({
|
|
|
17131
17131
|
var dirLink = this.getLinkParent(pathSteps);
|
|
17132
17132
|
if (!dirLink)
|
|
17133
17133
|
throw createError(ENOENT, "symlink", targetFilename, pathFilename);
|
|
17134
|
-
var
|
|
17135
|
-
if (dirLink.getChild(
|
|
17134
|
+
var name = pathSteps[pathSteps.length - 1];
|
|
17135
|
+
if (dirLink.getChild(name))
|
|
17136
17136
|
throw createError(EEXIST, "symlink", targetFilename, pathFilename);
|
|
17137
|
-
var symlink = dirLink.createChild(
|
|
17137
|
+
var symlink = dirLink.createChild(name);
|
|
17138
17138
|
symlink.getNode().makeSymlink(filenameToSteps(targetFilename));
|
|
17139
17139
|
return symlink;
|
|
17140
17140
|
};
|
|
@@ -17240,9 +17240,9 @@ var require_volume = __commonJS({
|
|
|
17240
17240
|
if (oldLinkParent) {
|
|
17241
17241
|
oldLinkParent.deleteChild(link);
|
|
17242
17242
|
}
|
|
17243
|
-
var
|
|
17244
|
-
link.name =
|
|
17245
|
-
link.steps = __spreadArray(__spreadArray([], newPathDirLink.steps, true), [
|
|
17243
|
+
var name = newPathSteps[newPathSteps.length - 1];
|
|
17244
|
+
link.name = name;
|
|
17245
|
+
link.steps = __spreadArray(__spreadArray([], newPathDirLink.steps, true), [name], false);
|
|
17246
17246
|
newPathDirLink.setChild(link.getName(), link);
|
|
17247
17247
|
};
|
|
17248
17248
|
Volume2.prototype.renameSync = function(oldPath, newPath) {
|
|
@@ -17461,10 +17461,10 @@ var require_volume = __commonJS({
|
|
|
17461
17461
|
throw createError(EEXIST, "mkdir", filename);
|
|
17462
17462
|
}
|
|
17463
17463
|
var dir = this.getLinkParentAsDirOrThrow(filename, "mkdir");
|
|
17464
|
-
var
|
|
17465
|
-
if (dir.getChild(
|
|
17464
|
+
var name = steps[steps.length - 1];
|
|
17465
|
+
if (dir.getChild(name))
|
|
17466
17466
|
throw createError(EEXIST, "mkdir", filename);
|
|
17467
|
-
dir.createChild(
|
|
17467
|
+
dir.createChild(name, this.createNode(true, modeNum));
|
|
17468
17468
|
};
|
|
17469
17469
|
Volume2.prototype.mkdirpBase = function(filename, modeNum) {
|
|
17470
17470
|
var fullPath = resolve2(filename);
|
|
@@ -18975,6 +18975,109 @@ var require_minimatch = __commonJS({
|
|
|
18975
18975
|
}
|
|
18976
18976
|
});
|
|
18977
18977
|
|
|
18978
|
+
// ../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js
|
|
18979
|
+
var require_cjs = __commonJS({
|
|
18980
|
+
"../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module2) {
|
|
18981
|
+
"use strict";
|
|
18982
|
+
var isMergeableObject = function isMergeableObject2(value) {
|
|
18983
|
+
return isNonNullObject(value) && !isSpecial(value);
|
|
18984
|
+
};
|
|
18985
|
+
function isNonNullObject(value) {
|
|
18986
|
+
return !!value && typeof value === "object";
|
|
18987
|
+
}
|
|
18988
|
+
function isSpecial(value) {
|
|
18989
|
+
var stringValue = Object.prototype.toString.call(value);
|
|
18990
|
+
return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
|
|
18991
|
+
}
|
|
18992
|
+
var canUseSymbol = typeof Symbol === "function" && Symbol.for;
|
|
18993
|
+
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
|
|
18994
|
+
function isReactElement(value) {
|
|
18995
|
+
return value.$$typeof === REACT_ELEMENT_TYPE;
|
|
18996
|
+
}
|
|
18997
|
+
function emptyTarget(val) {
|
|
18998
|
+
return Array.isArray(val) ? [] : {};
|
|
18999
|
+
}
|
|
19000
|
+
function cloneUnlessOtherwiseSpecified(value, options) {
|
|
19001
|
+
return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
|
|
19002
|
+
}
|
|
19003
|
+
function defaultArrayMerge(target, source, options) {
|
|
19004
|
+
return target.concat(source).map(function(element) {
|
|
19005
|
+
return cloneUnlessOtherwiseSpecified(element, options);
|
|
19006
|
+
});
|
|
19007
|
+
}
|
|
19008
|
+
function getMergeFunction(key, options) {
|
|
19009
|
+
if (!options.customMerge) {
|
|
19010
|
+
return deepmerge;
|
|
19011
|
+
}
|
|
19012
|
+
var customMerge = options.customMerge(key);
|
|
19013
|
+
return typeof customMerge === "function" ? customMerge : deepmerge;
|
|
19014
|
+
}
|
|
19015
|
+
function getEnumerableOwnPropertySymbols(target) {
|
|
19016
|
+
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
|
|
19017
|
+
return target.propertyIsEnumerable(symbol);
|
|
19018
|
+
}) : [];
|
|
19019
|
+
}
|
|
19020
|
+
function getKeys(target) {
|
|
19021
|
+
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
|
|
19022
|
+
}
|
|
19023
|
+
function propertyIsOnObject(object, property) {
|
|
19024
|
+
try {
|
|
19025
|
+
return property in object;
|
|
19026
|
+
} catch (_) {
|
|
19027
|
+
return false;
|
|
19028
|
+
}
|
|
19029
|
+
}
|
|
19030
|
+
function propertyIsUnsafe(target, key) {
|
|
19031
|
+
return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
|
|
19032
|
+
}
|
|
19033
|
+
function mergeObject(target, source, options) {
|
|
19034
|
+
var destination = {};
|
|
19035
|
+
if (options.isMergeableObject(target)) {
|
|
19036
|
+
getKeys(target).forEach(function(key) {
|
|
19037
|
+
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
|
19038
|
+
});
|
|
19039
|
+
}
|
|
19040
|
+
getKeys(source).forEach(function(key) {
|
|
19041
|
+
if (propertyIsUnsafe(target, key)) {
|
|
19042
|
+
return;
|
|
19043
|
+
}
|
|
19044
|
+
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
|
|
19045
|
+
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
|
|
19046
|
+
} else {
|
|
19047
|
+
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
|
|
19048
|
+
}
|
|
19049
|
+
});
|
|
19050
|
+
return destination;
|
|
19051
|
+
}
|
|
19052
|
+
function deepmerge(target, source, options) {
|
|
19053
|
+
options = options || {};
|
|
19054
|
+
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
|
|
19055
|
+
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
|
|
19056
|
+
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
|
19057
|
+
var sourceIsArray = Array.isArray(source);
|
|
19058
|
+
var targetIsArray = Array.isArray(target);
|
|
19059
|
+
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
19060
|
+
if (!sourceAndTargetTypesMatch) {
|
|
19061
|
+
return cloneUnlessOtherwiseSpecified(source, options);
|
|
19062
|
+
} else if (sourceIsArray) {
|
|
19063
|
+
return options.arrayMerge(target, source, options);
|
|
19064
|
+
} else {
|
|
19065
|
+
return mergeObject(target, source, options);
|
|
19066
|
+
}
|
|
19067
|
+
}
|
|
19068
|
+
deepmerge.all = function deepmergeAll(array, options) {
|
|
19069
|
+
if (!Array.isArray(array)) {
|
|
19070
|
+
throw new Error("first argument should be an array");
|
|
19071
|
+
}
|
|
19072
|
+
return array.reduce(function(prev, next) {
|
|
19073
|
+
return deepmerge(prev, next, options);
|
|
19074
|
+
}, {});
|
|
19075
|
+
};
|
|
19076
|
+
var deepmerge_1 = deepmerge;
|
|
19077
|
+
module2.exports = deepmerge_1;
|
|
19078
|
+
}
|
|
19079
|
+
});
|
|
19080
|
+
|
|
18978
19081
|
// ../../node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js
|
|
18979
19082
|
var require_universalify = __commonJS({
|
|
18980
19083
|
"../../node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js"(exports) {
|
|
@@ -22519,8 +22622,8 @@ var require_once = __commonJS({
|
|
|
22519
22622
|
f.called = true;
|
|
22520
22623
|
return f.value = fn.apply(this, arguments);
|
|
22521
22624
|
};
|
|
22522
|
-
var
|
|
22523
|
-
f.onceError =
|
|
22625
|
+
var name = fn.name || "Function wrapped with `once`";
|
|
22626
|
+
f.onceError = name + " shouldn't be called more than once";
|
|
22524
22627
|
f.called = false;
|
|
22525
22628
|
return f;
|
|
22526
22629
|
}
|
|
@@ -23351,10 +23454,10 @@ var require_lib3 = __commonJS({
|
|
|
23351
23454
|
MissingSemicolon: "Missing semicolon.",
|
|
23352
23455
|
MissingPlugin: ({
|
|
23353
23456
|
missingPlugin
|
|
23354
|
-
}) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map((
|
|
23457
|
+
}) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map((name) => JSON.stringify(name)).join(", ")}.`,
|
|
23355
23458
|
MissingOneOfPlugins: ({
|
|
23356
23459
|
missingPlugin
|
|
23357
|
-
}) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map((
|
|
23460
|
+
}) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map((name) => JSON.stringify(name)).join(", ")}.`,
|
|
23358
23461
|
MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.",
|
|
23359
23462
|
MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.",
|
|
23360
23463
|
ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.",
|
|
@@ -23672,10 +23775,10 @@ var require_lib3 = __commonJS({
|
|
|
23672
23775
|
return this.convertPrivateNameToPrivateIdentifier(node);
|
|
23673
23776
|
}
|
|
23674
23777
|
convertPrivateNameToPrivateIdentifier(node) {
|
|
23675
|
-
const
|
|
23778
|
+
const name = super.getPrivateNameSV(node);
|
|
23676
23779
|
node = node;
|
|
23677
23780
|
delete node.id;
|
|
23678
|
-
node.name =
|
|
23781
|
+
node.name = name;
|
|
23679
23782
|
node.type = "PrivateIdentifier";
|
|
23680
23783
|
return node;
|
|
23681
23784
|
}
|
|
@@ -23948,14 +24051,14 @@ var require_lib3 = __commonJS({
|
|
|
23948
24051
|
}
|
|
23949
24052
|
};
|
|
23950
24053
|
var keywords$1 = /* @__PURE__ */ new Map();
|
|
23951
|
-
function createKeyword(
|
|
23952
|
-
options.keyword =
|
|
23953
|
-
const token = createToken(
|
|
23954
|
-
keywords$1.set(
|
|
24054
|
+
function createKeyword(name, options = {}) {
|
|
24055
|
+
options.keyword = name;
|
|
24056
|
+
const token = createToken(name, options);
|
|
24057
|
+
keywords$1.set(name, token);
|
|
23955
24058
|
return token;
|
|
23956
24059
|
}
|
|
23957
|
-
function createBinop(
|
|
23958
|
-
return createToken(
|
|
24060
|
+
function createBinop(name, binop) {
|
|
24061
|
+
return createToken(name, {
|
|
23959
24062
|
beforeExpr,
|
|
23960
24063
|
binop
|
|
23961
24064
|
});
|
|
@@ -23967,22 +24070,22 @@ var require_lib3 = __commonJS({
|
|
|
23967
24070
|
var tokenBeforeExprs = [];
|
|
23968
24071
|
var tokenStartsExprs = [];
|
|
23969
24072
|
var tokenPrefixes = [];
|
|
23970
|
-
function createToken(
|
|
24073
|
+
function createToken(name, options = {}) {
|
|
23971
24074
|
var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix;
|
|
23972
24075
|
++tokenTypeCounter;
|
|
23973
|
-
tokenLabels.push(
|
|
24076
|
+
tokenLabels.push(name);
|
|
23974
24077
|
tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1);
|
|
23975
24078
|
tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false);
|
|
23976
24079
|
tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false);
|
|
23977
24080
|
tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false);
|
|
23978
|
-
tokenTypes.push(new ExportedTokenType(
|
|
24081
|
+
tokenTypes.push(new ExportedTokenType(name, options));
|
|
23979
24082
|
return tokenTypeCounter;
|
|
23980
24083
|
}
|
|
23981
|
-
function createKeywordLike(
|
|
24084
|
+
function createKeywordLike(name, options = {}) {
|
|
23982
24085
|
var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2;
|
|
23983
24086
|
++tokenTypeCounter;
|
|
23984
|
-
keywords$1.set(
|
|
23985
|
-
tokenLabels.push(
|
|
24087
|
+
keywords$1.set(name, tokenTypeCounter);
|
|
24088
|
+
tokenLabels.push(name);
|
|
23986
24089
|
tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1);
|
|
23987
24090
|
tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false);
|
|
23988
24091
|
tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false);
|
|
@@ -24701,63 +24804,63 @@ var require_lib3 = __commonJS({
|
|
|
24701
24804
|
treatFunctionsAsVarInScope(scope) {
|
|
24702
24805
|
return !!(scope.flags & (SCOPE_FUNCTION | SCOPE_STATIC_BLOCK) || !this.parser.inModule && scope.flags & SCOPE_PROGRAM);
|
|
24703
24806
|
}
|
|
24704
|
-
declareName(
|
|
24807
|
+
declareName(name, bindingType, loc) {
|
|
24705
24808
|
let scope = this.currentScope();
|
|
24706
24809
|
if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) {
|
|
24707
|
-
this.checkRedeclarationInScope(scope,
|
|
24810
|
+
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
24708
24811
|
if (bindingType & BIND_SCOPE_FUNCTION) {
|
|
24709
|
-
scope.functions.add(
|
|
24812
|
+
scope.functions.add(name);
|
|
24710
24813
|
} else {
|
|
24711
|
-
scope.lexical.add(
|
|
24814
|
+
scope.lexical.add(name);
|
|
24712
24815
|
}
|
|
24713
24816
|
if (bindingType & BIND_SCOPE_LEXICAL) {
|
|
24714
|
-
this.maybeExportDefined(scope,
|
|
24817
|
+
this.maybeExportDefined(scope, name);
|
|
24715
24818
|
}
|
|
24716
24819
|
} else if (bindingType & BIND_SCOPE_VAR) {
|
|
24717
24820
|
for (let i = this.scopeStack.length - 1; i >= 0; --i) {
|
|
24718
24821
|
scope = this.scopeStack[i];
|
|
24719
|
-
this.checkRedeclarationInScope(scope,
|
|
24720
|
-
scope.var.add(
|
|
24721
|
-
this.maybeExportDefined(scope,
|
|
24822
|
+
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
24823
|
+
scope.var.add(name);
|
|
24824
|
+
this.maybeExportDefined(scope, name);
|
|
24722
24825
|
if (scope.flags & SCOPE_VAR)
|
|
24723
24826
|
break;
|
|
24724
24827
|
}
|
|
24725
24828
|
}
|
|
24726
24829
|
if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) {
|
|
24727
|
-
this.undefinedExports.delete(
|
|
24830
|
+
this.undefinedExports.delete(name);
|
|
24728
24831
|
}
|
|
24729
24832
|
}
|
|
24730
|
-
maybeExportDefined(scope,
|
|
24833
|
+
maybeExportDefined(scope, name) {
|
|
24731
24834
|
if (this.parser.inModule && scope.flags & SCOPE_PROGRAM) {
|
|
24732
|
-
this.undefinedExports.delete(
|
|
24835
|
+
this.undefinedExports.delete(name);
|
|
24733
24836
|
}
|
|
24734
24837
|
}
|
|
24735
|
-
checkRedeclarationInScope(scope,
|
|
24736
|
-
if (this.isRedeclaredInScope(scope,
|
|
24838
|
+
checkRedeclarationInScope(scope, name, bindingType, loc) {
|
|
24839
|
+
if (this.isRedeclaredInScope(scope, name, bindingType)) {
|
|
24737
24840
|
this.parser.raise(Errors.VarRedeclaration, {
|
|
24738
24841
|
at: loc,
|
|
24739
|
-
identifierName:
|
|
24842
|
+
identifierName: name
|
|
24740
24843
|
});
|
|
24741
24844
|
}
|
|
24742
24845
|
}
|
|
24743
|
-
isRedeclaredInScope(scope,
|
|
24846
|
+
isRedeclaredInScope(scope, name, bindingType) {
|
|
24744
24847
|
if (!(bindingType & BIND_KIND_VALUE))
|
|
24745
24848
|
return false;
|
|
24746
24849
|
if (bindingType & BIND_SCOPE_LEXICAL) {
|
|
24747
|
-
return scope.lexical.has(
|
|
24850
|
+
return scope.lexical.has(name) || scope.functions.has(name) || scope.var.has(name);
|
|
24748
24851
|
}
|
|
24749
24852
|
if (bindingType & BIND_SCOPE_FUNCTION) {
|
|
24750
|
-
return scope.lexical.has(
|
|
24853
|
+
return scope.lexical.has(name) || !this.treatFunctionsAsVarInScope(scope) && scope.var.has(name);
|
|
24751
24854
|
}
|
|
24752
|
-
return scope.lexical.has(
|
|
24855
|
+
return scope.lexical.has(name) && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical.values().next().value === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name);
|
|
24753
24856
|
}
|
|
24754
24857
|
checkLocalExport(id) {
|
|
24755
24858
|
const {
|
|
24756
|
-
name
|
|
24859
|
+
name
|
|
24757
24860
|
} = id;
|
|
24758
24861
|
const topLevelScope = this.scopeStack[0];
|
|
24759
|
-
if (!topLevelScope.lexical.has(
|
|
24760
|
-
this.undefinedExports.set(
|
|
24862
|
+
if (!topLevelScope.lexical.has(name) && !topLevelScope.var.has(name) && !topLevelScope.functions.has(name)) {
|
|
24863
|
+
this.undefinedExports.set(name, id.loc.start);
|
|
24761
24864
|
}
|
|
24762
24865
|
}
|
|
24763
24866
|
currentScope() {
|
|
@@ -24794,21 +24897,21 @@ var require_lib3 = __commonJS({
|
|
|
24794
24897
|
createScope(flags) {
|
|
24795
24898
|
return new FlowScope(flags);
|
|
24796
24899
|
}
|
|
24797
|
-
declareName(
|
|
24900
|
+
declareName(name, bindingType, loc) {
|
|
24798
24901
|
const scope = this.currentScope();
|
|
24799
24902
|
if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {
|
|
24800
|
-
this.checkRedeclarationInScope(scope,
|
|
24801
|
-
this.maybeExportDefined(scope,
|
|
24802
|
-
scope.declareFunctions.add(
|
|
24903
|
+
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
24904
|
+
this.maybeExportDefined(scope, name);
|
|
24905
|
+
scope.declareFunctions.add(name);
|
|
24803
24906
|
return;
|
|
24804
24907
|
}
|
|
24805
|
-
super.declareName(
|
|
24908
|
+
super.declareName(name, bindingType, loc);
|
|
24806
24909
|
}
|
|
24807
|
-
isRedeclaredInScope(scope,
|
|
24808
|
-
if (super.isRedeclaredInScope(scope,
|
|
24910
|
+
isRedeclaredInScope(scope, name, bindingType) {
|
|
24911
|
+
if (super.isRedeclaredInScope(scope, name, bindingType))
|
|
24809
24912
|
return true;
|
|
24810
24913
|
if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {
|
|
24811
|
-
return !scope.declareFunctions.has(
|
|
24914
|
+
return !scope.declareFunctions.has(name) && (scope.lexical.has(name) || scope.functions.has(name));
|
|
24812
24915
|
}
|
|
24813
24916
|
return false;
|
|
24814
24917
|
}
|
|
@@ -24840,9 +24943,9 @@ var require_lib3 = __commonJS({
|
|
|
24840
24943
|
return true;
|
|
24841
24944
|
}
|
|
24842
24945
|
}
|
|
24843
|
-
getPluginOption(
|
|
24946
|
+
getPluginOption(plugin2, name) {
|
|
24844
24947
|
var _this$plugins$get;
|
|
24845
|
-
return (_this$plugins$get = this.plugins.get(
|
|
24948
|
+
return (_this$plugins$get = this.plugins.get(plugin2)) == null ? void 0 : _this$plugins$get[name];
|
|
24846
24949
|
}
|
|
24847
24950
|
};
|
|
24848
24951
|
function setTrailingComments(node, comments) {
|
|
@@ -26519,7 +26622,7 @@ var require_lib3 = __commonJS({
|
|
|
26519
26622
|
});
|
|
26520
26623
|
}
|
|
26521
26624
|
expectOnePlugin(pluginNames) {
|
|
26522
|
-
if (!pluginNames.some((
|
|
26625
|
+
if (!pluginNames.some((name) => this.hasPlugin(name))) {
|
|
26523
26626
|
throw this.raise(Errors.MissingOneOfPlugins, {
|
|
26524
26627
|
at: this.state.startLoc,
|
|
26525
26628
|
missingPlugin: pluginNames
|
|
@@ -26557,28 +26660,28 @@ var require_lib3 = __commonJS({
|
|
|
26557
26660
|
exit() {
|
|
26558
26661
|
const oldClassScope = this.stack.pop();
|
|
26559
26662
|
const current = this.current();
|
|
26560
|
-
for (const [
|
|
26663
|
+
for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) {
|
|
26561
26664
|
if (current) {
|
|
26562
|
-
if (!current.undefinedPrivateNames.has(
|
|
26563
|
-
current.undefinedPrivateNames.set(
|
|
26665
|
+
if (!current.undefinedPrivateNames.has(name)) {
|
|
26666
|
+
current.undefinedPrivateNames.set(name, loc);
|
|
26564
26667
|
}
|
|
26565
26668
|
} else {
|
|
26566
26669
|
this.parser.raise(Errors.InvalidPrivateFieldResolution, {
|
|
26567
26670
|
at: loc,
|
|
26568
|
-
identifierName:
|
|
26671
|
+
identifierName: name
|
|
26569
26672
|
});
|
|
26570
26673
|
}
|
|
26571
26674
|
}
|
|
26572
26675
|
}
|
|
26573
|
-
declarePrivateName(
|
|
26676
|
+
declarePrivateName(name, elementType, loc) {
|
|
26574
26677
|
const {
|
|
26575
26678
|
privateNames,
|
|
26576
26679
|
loneAccessors,
|
|
26577
26680
|
undefinedPrivateNames
|
|
26578
26681
|
} = this.current();
|
|
26579
|
-
let redefined = privateNames.has(
|
|
26682
|
+
let redefined = privateNames.has(name);
|
|
26580
26683
|
if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) {
|
|
26581
|
-
const accessor = redefined && loneAccessors.get(
|
|
26684
|
+
const accessor = redefined && loneAccessors.get(name);
|
|
26582
26685
|
if (accessor) {
|
|
26583
26686
|
const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC;
|
|
26584
26687
|
const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC;
|
|
@@ -26586,32 +26689,32 @@ var require_lib3 = __commonJS({
|
|
|
26586
26689
|
const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR;
|
|
26587
26690
|
redefined = oldKind === newKind || oldStatic !== newStatic;
|
|
26588
26691
|
if (!redefined)
|
|
26589
|
-
loneAccessors.delete(
|
|
26692
|
+
loneAccessors.delete(name);
|
|
26590
26693
|
} else if (!redefined) {
|
|
26591
|
-
loneAccessors.set(
|
|
26694
|
+
loneAccessors.set(name, elementType);
|
|
26592
26695
|
}
|
|
26593
26696
|
}
|
|
26594
26697
|
if (redefined) {
|
|
26595
26698
|
this.parser.raise(Errors.PrivateNameRedeclaration, {
|
|
26596
26699
|
at: loc,
|
|
26597
|
-
identifierName:
|
|
26700
|
+
identifierName: name
|
|
26598
26701
|
});
|
|
26599
26702
|
}
|
|
26600
|
-
privateNames.add(
|
|
26601
|
-
undefinedPrivateNames.delete(
|
|
26703
|
+
privateNames.add(name);
|
|
26704
|
+
undefinedPrivateNames.delete(name);
|
|
26602
26705
|
}
|
|
26603
|
-
usePrivateName(
|
|
26706
|
+
usePrivateName(name, loc) {
|
|
26604
26707
|
let classScope;
|
|
26605
26708
|
for (classScope of this.stack) {
|
|
26606
|
-
if (classScope.privateNames.has(
|
|
26709
|
+
if (classScope.privateNames.has(name))
|
|
26607
26710
|
return;
|
|
26608
26711
|
}
|
|
26609
26712
|
if (classScope) {
|
|
26610
|
-
classScope.undefinedPrivateNames.set(
|
|
26713
|
+
classScope.undefinedPrivateNames.set(name, loc);
|
|
26611
26714
|
} else {
|
|
26612
26715
|
this.parser.raise(Errors.InvalidPrivateFieldResolution, {
|
|
26613
26716
|
at: loc,
|
|
26614
|
-
identifierName:
|
|
26717
|
+
identifierName: name
|
|
26615
26718
|
});
|
|
26616
26719
|
}
|
|
26617
26720
|
}
|
|
@@ -26801,17 +26904,17 @@ var require_lib3 = __commonJS({
|
|
|
26801
26904
|
isContextual(token) {
|
|
26802
26905
|
return this.state.type === token && !this.state.containsEsc;
|
|
26803
26906
|
}
|
|
26804
|
-
isUnparsedContextual(nameStart,
|
|
26805
|
-
const nameEnd = nameStart +
|
|
26806
|
-
if (this.input.slice(nameStart, nameEnd) ===
|
|
26907
|
+
isUnparsedContextual(nameStart, name) {
|
|
26908
|
+
const nameEnd = nameStart + name.length;
|
|
26909
|
+
if (this.input.slice(nameStart, nameEnd) === name) {
|
|
26807
26910
|
const nextCh = this.input.charCodeAt(nameEnd);
|
|
26808
26911
|
return !(isIdentifierChar(nextCh) || (nextCh & 64512) === 55296);
|
|
26809
26912
|
}
|
|
26810
26913
|
return false;
|
|
26811
26914
|
}
|
|
26812
|
-
isLookaheadContextual(
|
|
26915
|
+
isLookaheadContextual(name) {
|
|
26813
26916
|
const next = this.nextTokenStart();
|
|
26814
|
-
return this.isUnparsedContextual(next,
|
|
26917
|
+
return this.isUnparsedContextual(next, name);
|
|
26815
26918
|
}
|
|
26816
26919
|
eatContextual(token) {
|
|
26817
26920
|
if (this.isContextual(token)) {
|
|
@@ -27046,7 +27149,7 @@ var require_lib3 = __commonJS({
|
|
|
27046
27149
|
loc,
|
|
27047
27150
|
range,
|
|
27048
27151
|
extra,
|
|
27049
|
-
name
|
|
27152
|
+
name
|
|
27050
27153
|
} = node;
|
|
27051
27154
|
const cloned = Object.create(NodePrototype);
|
|
27052
27155
|
cloned.type = type;
|
|
@@ -27055,7 +27158,7 @@ var require_lib3 = __commonJS({
|
|
|
27055
27158
|
cloned.loc = loc;
|
|
27056
27159
|
cloned.range = range;
|
|
27057
27160
|
cloned.extra = extra;
|
|
27058
|
-
cloned.name =
|
|
27161
|
+
cloned.name = name;
|
|
27059
27162
|
if (type === "Placeholder") {
|
|
27060
27163
|
cloned.expectedNode = node.expectedNode;
|
|
27061
27164
|
}
|
|
@@ -28015,7 +28118,7 @@ var require_lib3 = __commonJS({
|
|
|
28015
28118
|
return this.finishNode(node, "TupleTypeAnnotation");
|
|
28016
28119
|
}
|
|
28017
28120
|
flowParseFunctionTypeParam(first) {
|
|
28018
|
-
let
|
|
28121
|
+
let name = null;
|
|
28019
28122
|
let optional = false;
|
|
28020
28123
|
let typeAnnotation = null;
|
|
28021
28124
|
const node = this.startNode();
|
|
@@ -28027,7 +28130,7 @@ var require_lib3 = __commonJS({
|
|
|
28027
28130
|
at: node
|
|
28028
28131
|
});
|
|
28029
28132
|
}
|
|
28030
|
-
|
|
28133
|
+
name = this.parseIdentifier(isThis);
|
|
28031
28134
|
if (this.eat(17)) {
|
|
28032
28135
|
optional = true;
|
|
28033
28136
|
if (isThis) {
|
|
@@ -28040,7 +28143,7 @@ var require_lib3 = __commonJS({
|
|
|
28040
28143
|
} else {
|
|
28041
28144
|
typeAnnotation = this.flowParseType();
|
|
28042
28145
|
}
|
|
28043
|
-
node.name =
|
|
28146
|
+
node.name = name;
|
|
28044
28147
|
node.optional = optional;
|
|
28045
28148
|
node.typeAnnotation = typeAnnotation;
|
|
28046
28149
|
return this.finishNode(node, "FunctionTypeParam");
|
|
@@ -30052,11 +30155,11 @@ var require_lib3 = __commonJS({
|
|
|
30052
30155
|
}
|
|
30053
30156
|
jsxParseNamespacedName() {
|
|
30054
30157
|
const startLoc = this.state.startLoc;
|
|
30055
|
-
const
|
|
30158
|
+
const name = this.jsxParseIdentifier();
|
|
30056
30159
|
if (!this.eat(14))
|
|
30057
|
-
return
|
|
30160
|
+
return name;
|
|
30058
30161
|
const node = this.startNodeAt(startLoc);
|
|
30059
|
-
node.namespace =
|
|
30162
|
+
node.namespace = name;
|
|
30060
30163
|
node.name = this.jsxParseIdentifier();
|
|
30061
30164
|
return this.finishNode(node, "JSXNamespacedName");
|
|
30062
30165
|
}
|
|
@@ -30340,82 +30443,82 @@ var require_lib3 = __commonJS({
|
|
|
30340
30443
|
}
|
|
30341
30444
|
return flags;
|
|
30342
30445
|
}
|
|
30343
|
-
hasImport(
|
|
30446
|
+
hasImport(name, allowShadow) {
|
|
30344
30447
|
const len = this.importsStack.length;
|
|
30345
|
-
if (this.importsStack[len - 1].has(
|
|
30448
|
+
if (this.importsStack[len - 1].has(name)) {
|
|
30346
30449
|
return true;
|
|
30347
30450
|
}
|
|
30348
30451
|
if (!allowShadow && len > 1) {
|
|
30349
30452
|
for (let i = 0; i < len - 1; i++) {
|
|
30350
|
-
if (this.importsStack[i].has(
|
|
30453
|
+
if (this.importsStack[i].has(name))
|
|
30351
30454
|
return true;
|
|
30352
30455
|
}
|
|
30353
30456
|
}
|
|
30354
30457
|
return false;
|
|
30355
30458
|
}
|
|
30356
|
-
declareName(
|
|
30459
|
+
declareName(name, bindingType, loc) {
|
|
30357
30460
|
if (bindingType & BIND_FLAGS_TS_IMPORT) {
|
|
30358
|
-
if (this.hasImport(
|
|
30461
|
+
if (this.hasImport(name, true)) {
|
|
30359
30462
|
this.parser.raise(Errors.VarRedeclaration, {
|
|
30360
30463
|
at: loc,
|
|
30361
|
-
identifierName:
|
|
30464
|
+
identifierName: name
|
|
30362
30465
|
});
|
|
30363
30466
|
}
|
|
30364
|
-
this.importsStack[this.importsStack.length - 1].add(
|
|
30467
|
+
this.importsStack[this.importsStack.length - 1].add(name);
|
|
30365
30468
|
return;
|
|
30366
30469
|
}
|
|
30367
30470
|
const scope = this.currentScope();
|
|
30368
30471
|
if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) {
|
|
30369
|
-
this.maybeExportDefined(scope,
|
|
30370
|
-
scope.exportOnlyBindings.add(
|
|
30472
|
+
this.maybeExportDefined(scope, name);
|
|
30473
|
+
scope.exportOnlyBindings.add(name);
|
|
30371
30474
|
return;
|
|
30372
30475
|
}
|
|
30373
|
-
super.declareName(
|
|
30476
|
+
super.declareName(name, bindingType, loc);
|
|
30374
30477
|
if (bindingType & BIND_KIND_TYPE) {
|
|
30375
30478
|
if (!(bindingType & BIND_KIND_VALUE)) {
|
|
30376
|
-
this.checkRedeclarationInScope(scope,
|
|
30377
|
-
this.maybeExportDefined(scope,
|
|
30479
|
+
this.checkRedeclarationInScope(scope, name, bindingType, loc);
|
|
30480
|
+
this.maybeExportDefined(scope, name);
|
|
30378
30481
|
}
|
|
30379
|
-
scope.types.add(
|
|
30482
|
+
scope.types.add(name);
|
|
30380
30483
|
}
|
|
30381
30484
|
if (bindingType & BIND_FLAGS_TS_ENUM)
|
|
30382
|
-
scope.enums.add(
|
|
30485
|
+
scope.enums.add(name);
|
|
30383
30486
|
if (bindingType & BIND_FLAGS_TS_CONST_ENUM)
|
|
30384
|
-
scope.constEnums.add(
|
|
30487
|
+
scope.constEnums.add(name);
|
|
30385
30488
|
if (bindingType & BIND_FLAGS_CLASS)
|
|
30386
|
-
scope.classes.add(
|
|
30489
|
+
scope.classes.add(name);
|
|
30387
30490
|
}
|
|
30388
|
-
isRedeclaredInScope(scope,
|
|
30389
|
-
if (scope.enums.has(
|
|
30491
|
+
isRedeclaredInScope(scope, name, bindingType) {
|
|
30492
|
+
if (scope.enums.has(name)) {
|
|
30390
30493
|
if (bindingType & BIND_FLAGS_TS_ENUM) {
|
|
30391
30494
|
const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM);
|
|
30392
|
-
const wasConst = scope.constEnums.has(
|
|
30495
|
+
const wasConst = scope.constEnums.has(name);
|
|
30393
30496
|
return isConst !== wasConst;
|
|
30394
30497
|
}
|
|
30395
30498
|
return true;
|
|
30396
30499
|
}
|
|
30397
|
-
if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(
|
|
30398
|
-
if (scope.lexical.has(
|
|
30500
|
+
if (bindingType & BIND_FLAGS_CLASS && scope.classes.has(name)) {
|
|
30501
|
+
if (scope.lexical.has(name)) {
|
|
30399
30502
|
return !!(bindingType & BIND_KIND_VALUE);
|
|
30400
30503
|
} else {
|
|
30401
30504
|
return false;
|
|
30402
30505
|
}
|
|
30403
30506
|
}
|
|
30404
|
-
if (bindingType & BIND_KIND_TYPE && scope.types.has(
|
|
30507
|
+
if (bindingType & BIND_KIND_TYPE && scope.types.has(name)) {
|
|
30405
30508
|
return true;
|
|
30406
30509
|
}
|
|
30407
|
-
return super.isRedeclaredInScope(scope,
|
|
30510
|
+
return super.isRedeclaredInScope(scope, name, bindingType);
|
|
30408
30511
|
}
|
|
30409
30512
|
checkLocalExport(id) {
|
|
30410
30513
|
const {
|
|
30411
|
-
name
|
|
30514
|
+
name
|
|
30412
30515
|
} = id;
|
|
30413
|
-
if (this.hasImport(
|
|
30516
|
+
if (this.hasImport(name))
|
|
30414
30517
|
return;
|
|
30415
30518
|
const len = this.scopeStack.length;
|
|
30416
30519
|
for (let i = len - 1; i >= 0; i--) {
|
|
30417
30520
|
const scope = this.scopeStack[i];
|
|
30418
|
-
if (scope.types.has(
|
|
30521
|
+
if (scope.types.has(name) || scope.exportOnlyBindings.has(name))
|
|
30419
30522
|
return;
|
|
30420
30523
|
}
|
|
30421
30524
|
super.checkLocalExport(id);
|
|
@@ -33210,8 +33313,8 @@ var require_lib3 = __commonJS({
|
|
|
33210
33313
|
const node = this.startNode();
|
|
33211
33314
|
this.next();
|
|
33212
33315
|
if (tokenIsIdentifier(this.state.type)) {
|
|
33213
|
-
const
|
|
33214
|
-
const identifier = this.createIdentifier(node,
|
|
33316
|
+
const name = this.parseIdentifierName();
|
|
33317
|
+
const identifier = this.createIdentifier(node, name);
|
|
33215
33318
|
identifier.type = "V8IntrinsicIdentifier";
|
|
33216
33319
|
if (this.match(10)) {
|
|
33217
33320
|
return identifier;
|
|
@@ -33245,16 +33348,16 @@ var require_lib3 = __commonJS({
|
|
|
33245
33348
|
}
|
|
33246
33349
|
});
|
|
33247
33350
|
}
|
|
33248
|
-
function getPluginOption(plugins,
|
|
33249
|
-
const
|
|
33250
|
-
if (Array.isArray(
|
|
33251
|
-
return
|
|
33351
|
+
function getPluginOption(plugins, name, option) {
|
|
33352
|
+
const plugin2 = plugins.find((plugin3) => {
|
|
33353
|
+
if (Array.isArray(plugin3)) {
|
|
33354
|
+
return plugin3[0] === name;
|
|
33252
33355
|
} else {
|
|
33253
|
-
return
|
|
33356
|
+
return plugin3 === name;
|
|
33254
33357
|
}
|
|
33255
33358
|
});
|
|
33256
|
-
if (
|
|
33257
|
-
return
|
|
33359
|
+
if (plugin2 && Array.isArray(plugin2) && plugin2.length > 1) {
|
|
33360
|
+
return plugin2[1][option];
|
|
33258
33361
|
}
|
|
33259
33362
|
return null;
|
|
33260
33363
|
}
|
|
@@ -33673,15 +33776,15 @@ var require_lib3 = __commonJS({
|
|
|
33673
33776
|
if (expression.type === "Identifier") {
|
|
33674
33777
|
this.checkIdentifier(expression, binding, strictModeChanged, allowingSloppyLetBinding);
|
|
33675
33778
|
const {
|
|
33676
|
-
name
|
|
33779
|
+
name
|
|
33677
33780
|
} = expression;
|
|
33678
33781
|
if (checkClashes) {
|
|
33679
|
-
if (checkClashes.has(
|
|
33782
|
+
if (checkClashes.has(name)) {
|
|
33680
33783
|
this.raise(Errors.ParamDupe, {
|
|
33681
33784
|
at: expression
|
|
33682
33785
|
});
|
|
33683
33786
|
} else {
|
|
33684
|
-
checkClashes.add(
|
|
33787
|
+
checkClashes.add(name);
|
|
33685
33788
|
}
|
|
33686
33789
|
}
|
|
33687
33790
|
return;
|
|
@@ -33777,8 +33880,8 @@ var require_lib3 = __commonJS({
|
|
|
33777
33880
|
return;
|
|
33778
33881
|
}
|
|
33779
33882
|
const key = prop.key;
|
|
33780
|
-
const
|
|
33781
|
-
if (
|
|
33883
|
+
const name = key.type === "Identifier" ? key.name : key.value;
|
|
33884
|
+
if (name === "__proto__") {
|
|
33782
33885
|
if (isRecord) {
|
|
33783
33886
|
this.raise(Errors.RecordNoProto, {
|
|
33784
33887
|
at: key
|
|
@@ -34629,9 +34732,9 @@ var require_lib3 = __commonJS({
|
|
|
34629
34732
|
const id = this.startNodeAt(
|
|
34630
34733
|
createPositionWithColumnOffset(this.state.startLoc, 1)
|
|
34631
34734
|
);
|
|
34632
|
-
const
|
|
34735
|
+
const name = this.state.value;
|
|
34633
34736
|
this.next();
|
|
34634
|
-
node.id = this.createIdentifier(id,
|
|
34737
|
+
node.id = this.createIdentifier(id, name);
|
|
34635
34738
|
return this.finishNode(node, "PrivateName");
|
|
34636
34739
|
}
|
|
34637
34740
|
parseFunctionOrFunctionSent() {
|
|
@@ -35308,22 +35411,22 @@ var require_lib3 = __commonJS({
|
|
|
35308
35411
|
}
|
|
35309
35412
|
parseIdentifier(liberal) {
|
|
35310
35413
|
const node = this.startNode();
|
|
35311
|
-
const
|
|
35312
|
-
return this.createIdentifier(node,
|
|
35414
|
+
const name = this.parseIdentifierName(liberal);
|
|
35415
|
+
return this.createIdentifier(node, name);
|
|
35313
35416
|
}
|
|
35314
|
-
createIdentifier(node,
|
|
35315
|
-
node.name =
|
|
35316
|
-
node.loc.identifierName =
|
|
35417
|
+
createIdentifier(node, name) {
|
|
35418
|
+
node.name = name;
|
|
35419
|
+
node.loc.identifierName = name;
|
|
35317
35420
|
return this.finishNode(node, "Identifier");
|
|
35318
35421
|
}
|
|
35319
35422
|
parseIdentifierName(liberal) {
|
|
35320
|
-
let
|
|
35423
|
+
let name;
|
|
35321
35424
|
const {
|
|
35322
35425
|
startLoc,
|
|
35323
35426
|
type
|
|
35324
35427
|
} = this.state;
|
|
35325
35428
|
if (tokenIsKeywordOrIdentifier(type)) {
|
|
35326
|
-
|
|
35429
|
+
name = this.state.value;
|
|
35327
35430
|
} else {
|
|
35328
35431
|
throw this.unexpected();
|
|
35329
35432
|
}
|
|
@@ -35333,10 +35436,10 @@ var require_lib3 = __commonJS({
|
|
|
35333
35436
|
this.replaceToken(130);
|
|
35334
35437
|
}
|
|
35335
35438
|
} else {
|
|
35336
|
-
this.checkReservedWord(
|
|
35439
|
+
this.checkReservedWord(name, startLoc, tokenIsKeyword2, false);
|
|
35337
35440
|
}
|
|
35338
35441
|
this.next();
|
|
35339
|
-
return
|
|
35442
|
+
return name;
|
|
35340
35443
|
}
|
|
35341
35444
|
checkReservedWord(word, startLoc, checkKeywords, isBinding) {
|
|
35342
35445
|
if (word.length > 10) {
|
|
@@ -37584,10 +37687,10 @@ var require_lib3 = __commonJS({
|
|
|
37584
37687
|
};
|
|
37585
37688
|
function pluginsMap(plugins) {
|
|
37586
37689
|
const pluginMap = /* @__PURE__ */ new Map();
|
|
37587
|
-
for (const
|
|
37588
|
-
const [
|
|
37589
|
-
if (!pluginMap.has(
|
|
37590
|
-
pluginMap.set(
|
|
37690
|
+
for (const plugin2 of plugins) {
|
|
37691
|
+
const [name, options] = Array.isArray(plugin2) ? plugin2 : [plugin2, {}];
|
|
37692
|
+
if (!pluginMap.has(name))
|
|
37693
|
+
pluginMap.set(name, options || {});
|
|
37591
37694
|
}
|
|
37592
37695
|
return pluginMap;
|
|
37593
37696
|
}
|
|
@@ -37649,13 +37752,13 @@ var require_lib3 = __commonJS({
|
|
|
37649
37752
|
}
|
|
37650
37753
|
var parserClassCache = {};
|
|
37651
37754
|
function getParserClass(pluginsFromOptions) {
|
|
37652
|
-
const pluginList = mixinPluginNames.filter((
|
|
37755
|
+
const pluginList = mixinPluginNames.filter((name) => hasPlugin(pluginsFromOptions, name));
|
|
37653
37756
|
const key = pluginList.join("/");
|
|
37654
37757
|
let cls = parserClassCache[key];
|
|
37655
37758
|
if (!cls) {
|
|
37656
37759
|
cls = Parser;
|
|
37657
|
-
for (const
|
|
37658
|
-
cls = mixinPlugins[
|
|
37760
|
+
for (const plugin2 of pluginList) {
|
|
37761
|
+
cls = mixinPlugins[plugin2](cls);
|
|
37659
37762
|
}
|
|
37660
37763
|
parserClassCache[key] = cls;
|
|
37661
37764
|
}
|
|
@@ -38292,9 +38395,9 @@ var require_types = __commonJS({
|
|
|
38292
38395
|
}(BaseType);
|
|
38293
38396
|
var PredicateType = function(_super) {
|
|
38294
38397
|
tslib_1.__extends(PredicateType2, _super);
|
|
38295
|
-
function PredicateType2(
|
|
38398
|
+
function PredicateType2(name, predicate) {
|
|
38296
38399
|
var _this = _super.call(this) || this;
|
|
38297
|
-
_this.name =
|
|
38400
|
+
_this.name = name;
|
|
38298
38401
|
_this.predicate = predicate;
|
|
38299
38402
|
_this.kind = "PredicateType";
|
|
38300
38403
|
return _this;
|
|
@@ -38340,8 +38443,8 @@ var require_types = __commonJS({
|
|
|
38340
38443
|
if (this.finalized !== true) {
|
|
38341
38444
|
throw new Error("" + this.typeName);
|
|
38342
38445
|
}
|
|
38343
|
-
function checkFieldByName(
|
|
38344
|
-
var field = allFields[
|
|
38446
|
+
function checkFieldByName(name) {
|
|
38447
|
+
var field = allFields[name];
|
|
38345
38448
|
var type = field.type;
|
|
38346
38449
|
var child = field.getValue(value);
|
|
38347
38450
|
return type.check(child, deep);
|
|
@@ -38376,8 +38479,8 @@ var require_types = __commonJS({
|
|
|
38376
38479
|
}();
|
|
38377
38480
|
exports.Def = Def;
|
|
38378
38481
|
var Field = function() {
|
|
38379
|
-
function Field2(
|
|
38380
|
-
this.name =
|
|
38482
|
+
function Field2(name, type, defaultFn, hidden) {
|
|
38483
|
+
this.name = name;
|
|
38381
38484
|
this.type = type;
|
|
38382
38485
|
this.defaultFn = defaultFn;
|
|
38383
38486
|
this.hidden = !!hidden;
|
|
@@ -38419,7 +38522,7 @@ var require_types = __commonJS({
|
|
|
38419
38522
|
return Type.from(type);
|
|
38420
38523
|
}));
|
|
38421
38524
|
},
|
|
38422
|
-
from: function(value,
|
|
38525
|
+
from: function(value, name) {
|
|
38423
38526
|
if (value instanceof ArrayType || value instanceof IdentityType || value instanceof ObjectType || value instanceof OrType || value instanceof PredicateType) {
|
|
38424
38527
|
return value;
|
|
38425
38528
|
}
|
|
@@ -38433,8 +38536,8 @@ var require_types = __commonJS({
|
|
|
38433
38536
|
return new ArrayType(Type.from(value[0]));
|
|
38434
38537
|
}
|
|
38435
38538
|
if (isObject.check(value)) {
|
|
38436
|
-
return new ObjectType(Object.keys(value).map(function(
|
|
38437
|
-
return new Field(
|
|
38539
|
+
return new ObjectType(Object.keys(value).map(function(name2) {
|
|
38540
|
+
return new Field(name2, Type.from(value[name2], name2));
|
|
38438
38541
|
}));
|
|
38439
38542
|
}
|
|
38440
38543
|
if (typeof value === "function") {
|
|
@@ -38442,10 +38545,10 @@ var require_types = __commonJS({
|
|
|
38442
38545
|
if (bicfIndex >= 0) {
|
|
38443
38546
|
return builtInCtorTypes[bicfIndex];
|
|
38444
38547
|
}
|
|
38445
|
-
if (typeof
|
|
38548
|
+
if (typeof name !== "string") {
|
|
38446
38549
|
throw new Error("missing name");
|
|
38447
38550
|
}
|
|
38448
|
-
return new PredicateType(
|
|
38551
|
+
return new PredicateType(name, value);
|
|
38449
38552
|
}
|
|
38450
38553
|
return new IdentityType(value);
|
|
38451
38554
|
},
|
|
@@ -38458,9 +38561,9 @@ var require_types = __commonJS({
|
|
|
38458
38561
|
};
|
|
38459
38562
|
var builtInCtorFns = [];
|
|
38460
38563
|
var builtInCtorTypes = [];
|
|
38461
|
-
function defBuiltInType(
|
|
38564
|
+
function defBuiltInType(name, example) {
|
|
38462
38565
|
var objStr = objToStr.call(example);
|
|
38463
|
-
var type = new PredicateType(
|
|
38566
|
+
var type = new PredicateType(name, function(value) {
|
|
38464
38567
|
return objToStr.call(value) === objStr;
|
|
38465
38568
|
});
|
|
38466
38569
|
if (example && typeof example.constructor === "function") {
|
|
@@ -38571,8 +38674,8 @@ var require_types = __commonJS({
|
|
|
38571
38674
|
} else if (field.defaultFn) {
|
|
38572
38675
|
value = field.defaultFn.call(built);
|
|
38573
38676
|
} else {
|
|
38574
|
-
var message = "no value or default function given for field " + JSON.stringify(param) + " of " + _this.typeName + "(" + _this.buildParams.map(function(
|
|
38575
|
-
return all[
|
|
38677
|
+
var message = "no value or default function given for field " + JSON.stringify(param) + " of " + _this.typeName + "(" + _this.buildParams.map(function(name) {
|
|
38678
|
+
return all[name];
|
|
38576
38679
|
}).join(", ") + ")";
|
|
38577
38680
|
throw new Error(message);
|
|
38578
38681
|
}
|
|
@@ -38629,12 +38732,12 @@ var require_types = __commonJS({
|
|
|
38629
38732
|
});
|
|
38630
38733
|
return this;
|
|
38631
38734
|
};
|
|
38632
|
-
DefImpl2.prototype.field = function(
|
|
38735
|
+
DefImpl2.prototype.field = function(name, type, defaultFn, hidden) {
|
|
38633
38736
|
if (this.finalized) {
|
|
38634
|
-
console.error("Ignoring attempt to redefine field " + JSON.stringify(
|
|
38737
|
+
console.error("Ignoring attempt to redefine field " + JSON.stringify(name) + " of finalized type " + JSON.stringify(this.typeName));
|
|
38635
38738
|
return this;
|
|
38636
38739
|
}
|
|
38637
|
-
this.ownFields[
|
|
38740
|
+
this.ownFields[name] = new Field(name, Type.from(type), defaultFn, hidden);
|
|
38638
38741
|
return this;
|
|
38639
38742
|
};
|
|
38640
38743
|
DefImpl2.prototype.finalize = function() {
|
|
@@ -38642,14 +38745,14 @@ var require_types = __commonJS({
|
|
|
38642
38745
|
if (!this.finalized) {
|
|
38643
38746
|
var allFields = this.allFields;
|
|
38644
38747
|
var allSupertypes = this.allSupertypes;
|
|
38645
|
-
this.baseNames.forEach(function(
|
|
38646
|
-
var def = defCache[
|
|
38748
|
+
this.baseNames.forEach(function(name) {
|
|
38749
|
+
var def = defCache[name];
|
|
38647
38750
|
if (def instanceof Def) {
|
|
38648
38751
|
def.finalize();
|
|
38649
38752
|
extend(allFields, def.allFields);
|
|
38650
38753
|
extend(allSupertypes, def.allSupertypes);
|
|
38651
38754
|
} else {
|
|
38652
|
-
var message = "unknown supertype name " + JSON.stringify(
|
|
38755
|
+
var message = "unknown supertype name " + JSON.stringify(name) + " for subtype " + JSON.stringify(_this.typeName);
|
|
38653
38756
|
throw new Error(message);
|
|
38654
38757
|
}
|
|
38655
38758
|
});
|
|
@@ -38706,13 +38809,13 @@ var require_types = __commonJS({
|
|
|
38706
38809
|
}
|
|
38707
38810
|
var builders = /* @__PURE__ */ Object.create(null);
|
|
38708
38811
|
var nodePrototype = {};
|
|
38709
|
-
function defineMethod(
|
|
38710
|
-
var old = nodePrototype[
|
|
38812
|
+
function defineMethod(name, func) {
|
|
38813
|
+
var old = nodePrototype[name];
|
|
38711
38814
|
if (isUndefined.check(func)) {
|
|
38712
|
-
delete nodePrototype[
|
|
38815
|
+
delete nodePrototype[name];
|
|
38713
38816
|
} else {
|
|
38714
38817
|
isFunction.assert(func);
|
|
38715
|
-
Object.defineProperty(nodePrototype,
|
|
38818
|
+
Object.defineProperty(nodePrototype, name, {
|
|
38716
38819
|
enumerable: true,
|
|
38717
38820
|
configurable: true,
|
|
38718
38821
|
value: func
|
|
@@ -38759,13 +38862,13 @@ var require_types = __commonJS({
|
|
|
38759
38862
|
return object && object[fieldName];
|
|
38760
38863
|
}
|
|
38761
38864
|
function eachField(object, callback, context) {
|
|
38762
|
-
getFieldNames(object).forEach(function(
|
|
38763
|
-
callback.call(this,
|
|
38865
|
+
getFieldNames(object).forEach(function(name) {
|
|
38866
|
+
callback.call(this, name, getFieldValue(object, name));
|
|
38764
38867
|
}, context);
|
|
38765
38868
|
}
|
|
38766
38869
|
function someField(object, callback, context) {
|
|
38767
|
-
return getFieldNames(object).some(function(
|
|
38768
|
-
return callback.call(this,
|
|
38870
|
+
return getFieldNames(object).some(function(name) {
|
|
38871
|
+
return callback.call(this, name, getFieldValue(object, name));
|
|
38769
38872
|
}, context);
|
|
38770
38873
|
}
|
|
38771
38874
|
function wrapExpressionBuilderWithStatement(typeName) {
|
|
@@ -38815,14 +38918,14 @@ var require_types = __commonJS({
|
|
|
38815
38918
|
list.length = to;
|
|
38816
38919
|
}
|
|
38817
38920
|
function extend(into, from) {
|
|
38818
|
-
Object.keys(from).forEach(function(
|
|
38819
|
-
into[
|
|
38921
|
+
Object.keys(from).forEach(function(name) {
|
|
38922
|
+
into[name] = from[name];
|
|
38820
38923
|
});
|
|
38821
38924
|
return into;
|
|
38822
38925
|
}
|
|
38823
38926
|
function finalize() {
|
|
38824
|
-
Object.keys(defCache).forEach(function(
|
|
38825
|
-
defCache[
|
|
38927
|
+
Object.keys(defCache).forEach(function(name) {
|
|
38928
|
+
defCache[name].finalize();
|
|
38826
38929
|
});
|
|
38827
38930
|
}
|
|
38828
38931
|
return {
|
|
@@ -38863,7 +38966,7 @@ var require_path2 = __commonJS({
|
|
|
38863
38966
|
var types14 = fork.use(types_1.default);
|
|
38864
38967
|
var isArray = types14.builtInTypes.array;
|
|
38865
38968
|
var isNumber = types14.builtInTypes.number;
|
|
38866
|
-
var Path = function Path2(value, parentPath,
|
|
38969
|
+
var Path = function Path2(value, parentPath, name) {
|
|
38867
38970
|
if (!(this instanceof Path2)) {
|
|
38868
38971
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
38869
38972
|
}
|
|
@@ -38873,28 +38976,28 @@ var require_path2 = __commonJS({
|
|
|
38873
38976
|
}
|
|
38874
38977
|
} else {
|
|
38875
38978
|
parentPath = null;
|
|
38876
|
-
|
|
38979
|
+
name = null;
|
|
38877
38980
|
}
|
|
38878
38981
|
this.value = value;
|
|
38879
38982
|
this.parentPath = parentPath;
|
|
38880
|
-
this.name =
|
|
38983
|
+
this.name = name;
|
|
38881
38984
|
this.__childCache = null;
|
|
38882
38985
|
};
|
|
38883
38986
|
var Pp = Path.prototype;
|
|
38884
38987
|
function getChildCache(path2) {
|
|
38885
38988
|
return path2.__childCache || (path2.__childCache = /* @__PURE__ */ Object.create(null));
|
|
38886
38989
|
}
|
|
38887
|
-
function getChildPath(path2,
|
|
38990
|
+
function getChildPath(path2, name) {
|
|
38888
38991
|
var cache = getChildCache(path2);
|
|
38889
|
-
var actualChildValue = path2.getValueProperty(
|
|
38890
|
-
var childPath = cache[
|
|
38891
|
-
if (!hasOwn.call(cache,
|
|
38892
|
-
childPath = cache[
|
|
38992
|
+
var actualChildValue = path2.getValueProperty(name);
|
|
38993
|
+
var childPath = cache[name];
|
|
38994
|
+
if (!hasOwn.call(cache, name) || childPath.value !== actualChildValue) {
|
|
38995
|
+
childPath = cache[name] = new path2.constructor(actualChildValue, path2, name);
|
|
38893
38996
|
}
|
|
38894
38997
|
return childPath;
|
|
38895
38998
|
}
|
|
38896
|
-
Pp.getValueProperty = function getValueProperty(
|
|
38897
|
-
return this.value[
|
|
38999
|
+
Pp.getValueProperty = function getValueProperty(name) {
|
|
39000
|
+
return this.value[name];
|
|
38898
39001
|
};
|
|
38899
39002
|
Pp.get = function get() {
|
|
38900
39003
|
var names = [];
|
|
@@ -39210,13 +39313,13 @@ var require_scope = __commonJS({
|
|
|
39210
39313
|
};
|
|
39211
39314
|
var Sp = Scope.prototype;
|
|
39212
39315
|
Sp.didScan = false;
|
|
39213
|
-
Sp.declares = function(
|
|
39316
|
+
Sp.declares = function(name) {
|
|
39214
39317
|
this.scan();
|
|
39215
|
-
return hasOwn.call(this.bindings,
|
|
39318
|
+
return hasOwn.call(this.bindings, name);
|
|
39216
39319
|
};
|
|
39217
|
-
Sp.declaresType = function(
|
|
39320
|
+
Sp.declaresType = function(name) {
|
|
39218
39321
|
this.scan();
|
|
39219
|
-
return hasOwn.call(this.types,
|
|
39322
|
+
return hasOwn.call(this.types, name);
|
|
39220
39323
|
};
|
|
39221
39324
|
Sp.declareTemporary = function(prefix) {
|
|
39222
39325
|
if (prefix) {
|
|
@@ -39232,8 +39335,8 @@ var require_scope = __commonJS({
|
|
|
39232
39335
|
while (this.declares(prefix + index)) {
|
|
39233
39336
|
++index;
|
|
39234
39337
|
}
|
|
39235
|
-
var
|
|
39236
|
-
return this.bindings[
|
|
39338
|
+
var name = prefix + index;
|
|
39339
|
+
return this.bindings[name] = types14.builders.identifier(name);
|
|
39237
39340
|
};
|
|
39238
39341
|
Sp.injectTemporary = function(identifier, init) {
|
|
39239
39342
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -39246,11 +39349,11 @@ var require_scope = __commonJS({
|
|
|
39246
39349
|
};
|
|
39247
39350
|
Sp.scan = function(force) {
|
|
39248
39351
|
if (force || !this.didScan) {
|
|
39249
|
-
for (var
|
|
39250
|
-
delete this.bindings[
|
|
39352
|
+
for (var name in this.bindings) {
|
|
39353
|
+
delete this.bindings[name];
|
|
39251
39354
|
}
|
|
39252
|
-
for (var
|
|
39253
|
-
delete this.types[
|
|
39355
|
+
for (var name in this.types) {
|
|
39356
|
+
delete this.types[name];
|
|
39254
39357
|
}
|
|
39255
39358
|
scanScope(this.path, this.bindings, this.types);
|
|
39256
39359
|
this.didScan = true;
|
|
@@ -39309,8 +39412,8 @@ var require_scope = __commonJS({
|
|
|
39309
39412
|
bindings
|
|
39310
39413
|
);
|
|
39311
39414
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
39312
|
-
types14.eachField(node, function(
|
|
39313
|
-
var childPath = path2.get(
|
|
39415
|
+
types14.eachField(node, function(name, child) {
|
|
39416
|
+
var childPath = path2.get(name);
|
|
39314
39417
|
if (!pathHasValue(childPath, child)) {
|
|
39315
39418
|
throw new Error("");
|
|
39316
39419
|
}
|
|
@@ -39407,15 +39510,15 @@ var require_scope = __commonJS({
|
|
|
39407
39510
|
types15[parameter.name] = [parameterPath];
|
|
39408
39511
|
}
|
|
39409
39512
|
}
|
|
39410
|
-
Sp.lookup = function(
|
|
39513
|
+
Sp.lookup = function(name) {
|
|
39411
39514
|
for (var scope = this; scope; scope = scope.parent)
|
|
39412
|
-
if (scope.declares(
|
|
39515
|
+
if (scope.declares(name))
|
|
39413
39516
|
break;
|
|
39414
39517
|
return scope;
|
|
39415
39518
|
};
|
|
39416
|
-
Sp.lookupType = function(
|
|
39519
|
+
Sp.lookupType = function(name) {
|
|
39417
39520
|
for (var scope = this; scope; scope = scope.parent)
|
|
39418
|
-
if (scope.declaresType(
|
|
39521
|
+
if (scope.declaresType(name))
|
|
39419
39522
|
break;
|
|
39420
39523
|
return scope;
|
|
39421
39524
|
};
|
|
@@ -39452,11 +39555,11 @@ var require_node_path = __commonJS({
|
|
|
39452
39555
|
var isArray = types14.builtInTypes.array;
|
|
39453
39556
|
var Path = fork.use(path_1.default);
|
|
39454
39557
|
var Scope = fork.use(scope_1.default);
|
|
39455
|
-
var NodePath = function NodePath2(value, parentPath,
|
|
39558
|
+
var NodePath = function NodePath2(value, parentPath, name) {
|
|
39456
39559
|
if (!(this instanceof NodePath2)) {
|
|
39457
39560
|
throw new Error("NodePath constructor cannot be invoked without 'new'");
|
|
39458
39561
|
}
|
|
39459
|
-
Path.call(this, value, parentPath,
|
|
39562
|
+
Path.call(this, value, parentPath, name);
|
|
39460
39563
|
};
|
|
39461
39564
|
var NPp = NodePath.prototype = Object.create(Path.prototype, {
|
|
39462
39565
|
constructor: {
|
|
@@ -39539,8 +39642,8 @@ var require_node_path = __commonJS({
|
|
|
39539
39642
|
}
|
|
39540
39643
|
return scope || null;
|
|
39541
39644
|
};
|
|
39542
|
-
NPp.getValueProperty = function(
|
|
39543
|
-
return types14.getFieldValue(this.value,
|
|
39645
|
+
NPp.getValueProperty = function(name) {
|
|
39646
|
+
return types14.getFieldValue(this.value, name);
|
|
39544
39647
|
};
|
|
39545
39648
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
39546
39649
|
var pp = this.parentPath;
|
|
@@ -40195,18 +40298,18 @@ var require_equiv = __commonJS({
|
|
|
40195
40298
|
var bNameCount = bNames.length;
|
|
40196
40299
|
if (aNameCount === bNameCount) {
|
|
40197
40300
|
for (var i = 0; i < aNameCount; ++i) {
|
|
40198
|
-
var
|
|
40199
|
-
var aChild = getFieldValue(a,
|
|
40200
|
-
var bChild = getFieldValue(b,
|
|
40301
|
+
var name = aNames[i];
|
|
40302
|
+
var aChild = getFieldValue(a, name);
|
|
40303
|
+
var bChild = getFieldValue(b, name);
|
|
40201
40304
|
if (problemPath) {
|
|
40202
|
-
problemPath.push(
|
|
40305
|
+
problemPath.push(name);
|
|
40203
40306
|
}
|
|
40204
40307
|
if (!areEquivalent(aChild, bChild, problemPath)) {
|
|
40205
40308
|
return false;
|
|
40206
40309
|
}
|
|
40207
40310
|
if (problemPath) {
|
|
40208
40311
|
var problemPathTail = problemPath.pop();
|
|
40209
|
-
if (problemPathTail !==
|
|
40312
|
+
if (problemPathTail !== name) {
|
|
40210
40313
|
throw new Error("" + problemPathTail);
|
|
40211
40314
|
}
|
|
40212
40315
|
}
|
|
@@ -40221,15 +40324,15 @@ var require_equiv = __commonJS({
|
|
|
40221
40324
|
seenNames[aNames[i]] = true;
|
|
40222
40325
|
}
|
|
40223
40326
|
for (i = 0; i < bNameCount; ++i) {
|
|
40224
|
-
|
|
40225
|
-
if (!hasOwn.call(seenNames,
|
|
40226
|
-
problemPath.push(
|
|
40327
|
+
name = bNames[i];
|
|
40328
|
+
if (!hasOwn.call(seenNames, name)) {
|
|
40329
|
+
problemPath.push(name);
|
|
40227
40330
|
return false;
|
|
40228
40331
|
}
|
|
40229
|
-
delete seenNames[
|
|
40332
|
+
delete seenNames[name];
|
|
40230
40333
|
}
|
|
40231
|
-
for (
|
|
40232
|
-
problemPath.push(
|
|
40334
|
+
for (name in seenNames) {
|
|
40335
|
+
problemPath.push(name);
|
|
40233
40336
|
break;
|
|
40234
40337
|
}
|
|
40235
40338
|
return false;
|
|
@@ -40286,12 +40389,12 @@ var require_fork = __commonJS({
|
|
|
40286
40389
|
function createFork() {
|
|
40287
40390
|
var used = [];
|
|
40288
40391
|
var usedResult = [];
|
|
40289
|
-
function use(
|
|
40290
|
-
var idx = used.indexOf(
|
|
40392
|
+
function use(plugin2) {
|
|
40393
|
+
var idx = used.indexOf(plugin2);
|
|
40291
40394
|
if (idx === -1) {
|
|
40292
40395
|
idx = used.length;
|
|
40293
|
-
used.push(
|
|
40294
|
-
usedResult[idx] =
|
|
40396
|
+
used.push(plugin2);
|
|
40397
|
+
usedResult[idx] = plugin2(fork);
|
|
40295
40398
|
}
|
|
40296
40399
|
return usedResult[idx];
|
|
40297
40400
|
}
|
|
@@ -42047,9 +42150,9 @@ var require_source_map_generator = __commonJS({
|
|
|
42047
42150
|
var generated = util.getArg(aArgs, "generated");
|
|
42048
42151
|
var original = util.getArg(aArgs, "original", null);
|
|
42049
42152
|
var source = util.getArg(aArgs, "source", null);
|
|
42050
|
-
var
|
|
42153
|
+
var name = util.getArg(aArgs, "name", null);
|
|
42051
42154
|
if (!this._skipValidation) {
|
|
42052
|
-
this._validateMapping(generated, original, source,
|
|
42155
|
+
this._validateMapping(generated, original, source, name);
|
|
42053
42156
|
}
|
|
42054
42157
|
if (source != null) {
|
|
42055
42158
|
source = String(source);
|
|
@@ -42057,10 +42160,10 @@ var require_source_map_generator = __commonJS({
|
|
|
42057
42160
|
this._sources.add(source);
|
|
42058
42161
|
}
|
|
42059
42162
|
}
|
|
42060
|
-
if (
|
|
42061
|
-
|
|
42062
|
-
if (!this._names.has(
|
|
42063
|
-
this._names.add(
|
|
42163
|
+
if (name != null) {
|
|
42164
|
+
name = String(name);
|
|
42165
|
+
if (!this._names.has(name)) {
|
|
42166
|
+
this._names.add(name);
|
|
42064
42167
|
}
|
|
42065
42168
|
}
|
|
42066
42169
|
this._mappings.add({
|
|
@@ -42069,7 +42172,7 @@ var require_source_map_generator = __commonJS({
|
|
|
42069
42172
|
originalLine: original != null && original.line,
|
|
42070
42173
|
originalColumn: original != null && original.column,
|
|
42071
42174
|
source,
|
|
42072
|
-
name
|
|
42175
|
+
name
|
|
42073
42176
|
});
|
|
42074
42177
|
};
|
|
42075
42178
|
SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
|
|
@@ -42130,9 +42233,9 @@ var require_source_map_generator = __commonJS({
|
|
|
42130
42233
|
if (source != null && !newSources.has(source)) {
|
|
42131
42234
|
newSources.add(source);
|
|
42132
42235
|
}
|
|
42133
|
-
var
|
|
42134
|
-
if (
|
|
42135
|
-
newNames.add(
|
|
42236
|
+
var name = mapping.name;
|
|
42237
|
+
if (name != null && !newNames.has(name)) {
|
|
42238
|
+
newNames.add(name);
|
|
42136
42239
|
}
|
|
42137
42240
|
}, this);
|
|
42138
42241
|
this._sources = newSources;
|
|
@@ -42692,15 +42795,15 @@ var require_source_map_consumer = __commonJS({
|
|
|
42692
42795
|
source = this._sources.at(source);
|
|
42693
42796
|
source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
|
|
42694
42797
|
}
|
|
42695
|
-
var
|
|
42696
|
-
if (
|
|
42697
|
-
|
|
42798
|
+
var name = util.getArg(mapping, "name", null);
|
|
42799
|
+
if (name !== null) {
|
|
42800
|
+
name = this._names.at(name);
|
|
42698
42801
|
}
|
|
42699
42802
|
return {
|
|
42700
42803
|
source,
|
|
42701
42804
|
line: util.getArg(mapping, "originalLine", null),
|
|
42702
42805
|
column: util.getArg(mapping, "originalColumn", null),
|
|
42703
|
-
name
|
|
42806
|
+
name
|
|
42704
42807
|
};
|
|
42705
42808
|
}
|
|
42706
42809
|
}
|
|
@@ -42919,11 +43022,11 @@ var require_source_map_consumer = __commonJS({
|
|
|
42919
43022
|
source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
|
|
42920
43023
|
this._sources.add(source);
|
|
42921
43024
|
source = this._sources.indexOf(source);
|
|
42922
|
-
var
|
|
43025
|
+
var name = null;
|
|
42923
43026
|
if (mapping.name) {
|
|
42924
|
-
|
|
42925
|
-
this._names.add(
|
|
42926
|
-
|
|
43027
|
+
name = section.consumer._names.at(mapping.name);
|
|
43028
|
+
this._names.add(name);
|
|
43029
|
+
name = this._names.indexOf(name);
|
|
42927
43030
|
}
|
|
42928
43031
|
var adjustedMapping = {
|
|
42929
43032
|
source,
|
|
@@ -42931,7 +43034,7 @@ var require_source_map_consumer = __commonJS({
|
|
|
42931
43034
|
generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
|
|
42932
43035
|
originalLine: mapping.originalLine,
|
|
42933
43036
|
originalColumn: mapping.originalColumn,
|
|
42934
|
-
name
|
|
43037
|
+
name
|
|
42935
43038
|
};
|
|
42936
43039
|
this.__generatedMappings.push(adjustedMapping);
|
|
42937
43040
|
if (typeof adjustedMapping.originalLine === "number") {
|
|
@@ -44194,13 +44297,13 @@ var require_esprima2 = __commonJS({
|
|
|
44194
44297
|
};
|
|
44195
44298
|
JSXParser2.prototype.parseJSXNameValueAttribute = function() {
|
|
44196
44299
|
var node = this.createJSXNode();
|
|
44197
|
-
var
|
|
44300
|
+
var name = this.parseJSXAttributeName();
|
|
44198
44301
|
var value = null;
|
|
44199
44302
|
if (this.matchJSX("=")) {
|
|
44200
44303
|
this.expectJSX("=");
|
|
44201
44304
|
value = this.parseJSXAttributeValue();
|
|
44202
44305
|
}
|
|
44203
|
-
return this.finalize(node, new JSXNode.JSXAttribute(
|
|
44306
|
+
return this.finalize(node, new JSXNode.JSXAttribute(name, value));
|
|
44204
44307
|
};
|
|
44205
44308
|
JSXParser2.prototype.parseJSXSpreadAttribute = function() {
|
|
44206
44309
|
var node = this.createJSXNode();
|
|
@@ -44222,14 +44325,14 @@ var require_esprima2 = __commonJS({
|
|
|
44222
44325
|
JSXParser2.prototype.parseJSXOpeningElement = function() {
|
|
44223
44326
|
var node = this.createJSXNode();
|
|
44224
44327
|
this.expectJSX("<");
|
|
44225
|
-
var
|
|
44328
|
+
var name = this.parseJSXElementName();
|
|
44226
44329
|
var attributes = this.parseJSXAttributes();
|
|
44227
44330
|
var selfClosing = this.matchJSX("/");
|
|
44228
44331
|
if (selfClosing) {
|
|
44229
44332
|
this.expectJSX("/");
|
|
44230
44333
|
}
|
|
44231
44334
|
this.expectJSX(">");
|
|
44232
|
-
return this.finalize(node, new JSXNode.JSXOpeningElement(
|
|
44335
|
+
return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
|
|
44233
44336
|
};
|
|
44234
44337
|
JSXParser2.prototype.parseJSXBoundaryElement = function() {
|
|
44235
44338
|
var node = this.createJSXNode();
|
|
@@ -44240,14 +44343,14 @@ var require_esprima2 = __commonJS({
|
|
|
44240
44343
|
this.expectJSX(">");
|
|
44241
44344
|
return this.finalize(node, new JSXNode.JSXClosingElement(name_3));
|
|
44242
44345
|
}
|
|
44243
|
-
var
|
|
44346
|
+
var name = this.parseJSXElementName();
|
|
44244
44347
|
var attributes = this.parseJSXAttributes();
|
|
44245
44348
|
var selfClosing = this.matchJSX("/");
|
|
44246
44349
|
if (selfClosing) {
|
|
44247
44350
|
this.expectJSX("/");
|
|
44248
44351
|
}
|
|
44249
44352
|
this.expectJSX(">");
|
|
44250
|
-
return this.finalize(node, new JSXNode.JSXOpeningElement(
|
|
44353
|
+
return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
|
|
44251
44354
|
};
|
|
44252
44355
|
JSXParser2.prototype.parseJSXEmptyExpression = function() {
|
|
44253
44356
|
var node = this.createJSXChildNode();
|
|
@@ -44392,9 +44495,9 @@ var require_esprima2 = __commonJS({
|
|
|
44392
44495
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
44393
44496
|
var jsx_syntax_1 = __webpack_require__(6);
|
|
44394
44497
|
var JSXClosingElement = function() {
|
|
44395
|
-
function JSXClosingElement2(
|
|
44498
|
+
function JSXClosingElement2(name) {
|
|
44396
44499
|
this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement;
|
|
44397
|
-
this.name =
|
|
44500
|
+
this.name = name;
|
|
44398
44501
|
}
|
|
44399
44502
|
return JSXClosingElement2;
|
|
44400
44503
|
}();
|
|
@@ -44425,9 +44528,9 @@ var require_esprima2 = __commonJS({
|
|
|
44425
44528
|
}();
|
|
44426
44529
|
exports2.JSXExpressionContainer = JSXExpressionContainer;
|
|
44427
44530
|
var JSXIdentifier = function() {
|
|
44428
|
-
function JSXIdentifier2(
|
|
44531
|
+
function JSXIdentifier2(name) {
|
|
44429
44532
|
this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier;
|
|
44430
|
-
this.name =
|
|
44533
|
+
this.name = name;
|
|
44431
44534
|
}
|
|
44432
44535
|
return JSXIdentifier2;
|
|
44433
44536
|
}();
|
|
@@ -44442,27 +44545,27 @@ var require_esprima2 = __commonJS({
|
|
|
44442
44545
|
}();
|
|
44443
44546
|
exports2.JSXMemberExpression = JSXMemberExpression;
|
|
44444
44547
|
var JSXAttribute = function() {
|
|
44445
|
-
function JSXAttribute2(
|
|
44548
|
+
function JSXAttribute2(name, value) {
|
|
44446
44549
|
this.type = jsx_syntax_1.JSXSyntax.JSXAttribute;
|
|
44447
|
-
this.name =
|
|
44550
|
+
this.name = name;
|
|
44448
44551
|
this.value = value;
|
|
44449
44552
|
}
|
|
44450
44553
|
return JSXAttribute2;
|
|
44451
44554
|
}();
|
|
44452
44555
|
exports2.JSXAttribute = JSXAttribute;
|
|
44453
44556
|
var JSXNamespacedName = function() {
|
|
44454
|
-
function JSXNamespacedName2(namespace,
|
|
44557
|
+
function JSXNamespacedName2(namespace, name) {
|
|
44455
44558
|
this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName;
|
|
44456
44559
|
this.namespace = namespace;
|
|
44457
|
-
this.name =
|
|
44560
|
+
this.name = name;
|
|
44458
44561
|
}
|
|
44459
44562
|
return JSXNamespacedName2;
|
|
44460
44563
|
}();
|
|
44461
44564
|
exports2.JSXNamespacedName = JSXNamespacedName;
|
|
44462
44565
|
var JSXOpeningElement = function() {
|
|
44463
|
-
function JSXOpeningElement2(
|
|
44566
|
+
function JSXOpeningElement2(name, selfClosing, attributes) {
|
|
44464
44567
|
this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement;
|
|
44465
|
-
this.name =
|
|
44568
|
+
this.name = name;
|
|
44466
44569
|
this.selfClosing = selfClosing;
|
|
44467
44570
|
this.attributes = attributes;
|
|
44468
44571
|
}
|
|
@@ -44838,9 +44941,9 @@ var require_esprima2 = __commonJS({
|
|
|
44838
44941
|
}();
|
|
44839
44942
|
exports2.FunctionExpression = FunctionExpression;
|
|
44840
44943
|
var Identifier = function() {
|
|
44841
|
-
function Identifier2(
|
|
44944
|
+
function Identifier2(name) {
|
|
44842
44945
|
this.type = syntax_1.Syntax.Identifier;
|
|
44843
|
-
this.name =
|
|
44946
|
+
this.name = name;
|
|
44844
44947
|
}
|
|
44845
44948
|
return Identifier2;
|
|
44846
44949
|
}();
|
|
@@ -47347,10 +47450,10 @@ var require_esprima2 = __commonJS({
|
|
|
47347
47450
|
this.context.inFunctionBody = previousInFunctionBody;
|
|
47348
47451
|
return this.finalize(node, new Node.BlockStatement(body));
|
|
47349
47452
|
};
|
|
47350
|
-
Parser2.prototype.validateParam = function(options, param,
|
|
47351
|
-
var key = "$" +
|
|
47453
|
+
Parser2.prototype.validateParam = function(options, param, name) {
|
|
47454
|
+
var key = "$" + name;
|
|
47352
47455
|
if (this.context.strict) {
|
|
47353
|
-
if (this.scanner.isRestrictedWord(
|
|
47456
|
+
if (this.scanner.isRestrictedWord(name)) {
|
|
47354
47457
|
options.stricted = param;
|
|
47355
47458
|
options.message = messages_1.Messages.StrictParamName;
|
|
47356
47459
|
}
|
|
@@ -47359,10 +47462,10 @@ var require_esprima2 = __commonJS({
|
|
|
47359
47462
|
options.message = messages_1.Messages.StrictParamDupe;
|
|
47360
47463
|
}
|
|
47361
47464
|
} else if (!options.firstRestricted) {
|
|
47362
|
-
if (this.scanner.isRestrictedWord(
|
|
47465
|
+
if (this.scanner.isRestrictedWord(name)) {
|
|
47363
47466
|
options.firstRestricted = param;
|
|
47364
47467
|
options.message = messages_1.Messages.StrictParamName;
|
|
47365
|
-
} else if (this.scanner.isStrictModeReservedWord(
|
|
47468
|
+
} else if (this.scanner.isStrictModeReservedWord(name)) {
|
|
47366
47469
|
options.firstRestricted = param;
|
|
47367
47470
|
options.message = messages_1.Messages.StrictReservedWord;
|
|
47368
47471
|
} else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
|
|
@@ -49765,14 +49868,14 @@ var require_mapping = __commonJS({
|
|
|
49765
49868
|
var sourceLines = this.sourceLines;
|
|
49766
49869
|
var sourceLoc = this.sourceLoc;
|
|
49767
49870
|
var targetLoc = this.targetLoc;
|
|
49768
|
-
function skip(
|
|
49769
|
-
var sourceFromPos = sourceLoc[
|
|
49770
|
-
var targetFromPos = targetLoc[
|
|
49871
|
+
function skip(name) {
|
|
49872
|
+
var sourceFromPos = sourceLoc[name];
|
|
49873
|
+
var targetFromPos = targetLoc[name];
|
|
49771
49874
|
var targetToPos = start;
|
|
49772
|
-
if (
|
|
49875
|
+
if (name === "end") {
|
|
49773
49876
|
targetToPos = end;
|
|
49774
49877
|
} else {
|
|
49775
|
-
assert_1.default.strictEqual(
|
|
49878
|
+
assert_1.default.strictEqual(name, "start");
|
|
49776
49879
|
}
|
|
49777
49880
|
return skipChars(sourceLines, sourceFromPos, lines, targetFromPos, targetToPos);
|
|
49778
49881
|
}
|
|
@@ -51080,9 +51183,9 @@ var require_fast_path = __commonJS({
|
|
|
51080
51183
|
var value = s[origLen - 1];
|
|
51081
51184
|
var argc = arguments.length;
|
|
51082
51185
|
for (var i = 1; i < argc; ++i) {
|
|
51083
|
-
var
|
|
51084
|
-
value = value[
|
|
51085
|
-
s.push(
|
|
51186
|
+
var name = arguments[i];
|
|
51187
|
+
value = value[name];
|
|
51188
|
+
s.push(name, value);
|
|
51086
51189
|
}
|
|
51087
51190
|
var result = callback(this);
|
|
51088
51191
|
s.length = origLen;
|
|
@@ -51094,9 +51197,9 @@ var require_fast_path = __commonJS({
|
|
|
51094
51197
|
var value = s[origLen - 1];
|
|
51095
51198
|
var argc = arguments.length;
|
|
51096
51199
|
for (var i = 1; i < argc; ++i) {
|
|
51097
|
-
var
|
|
51098
|
-
value = value[
|
|
51099
|
-
s.push(
|
|
51200
|
+
var name = arguments[i];
|
|
51201
|
+
value = value[name];
|
|
51202
|
+
s.push(name, value);
|
|
51100
51203
|
}
|
|
51101
51204
|
for (var i = 0; i < value.length; ++i) {
|
|
51102
51205
|
if (i in value) {
|
|
@@ -51113,9 +51216,9 @@ var require_fast_path = __commonJS({
|
|
|
51113
51216
|
var value = s[origLen - 1];
|
|
51114
51217
|
var argc = arguments.length;
|
|
51115
51218
|
for (var i = 1; i < argc; ++i) {
|
|
51116
|
-
var
|
|
51117
|
-
value = value[
|
|
51118
|
-
s.push(
|
|
51219
|
+
var name = arguments[i];
|
|
51220
|
+
value = value[name];
|
|
51221
|
+
s.push(name, value);
|
|
51119
51222
|
}
|
|
51120
51223
|
var result = new Array(value.length);
|
|
51121
51224
|
for (var i = 0; i < value.length; ++i) {
|
|
@@ -51185,7 +51288,7 @@ var require_fast_path = __commonJS({
|
|
|
51185
51288
|
return true;
|
|
51186
51289
|
}
|
|
51187
51290
|
var parent = this.getParentNode();
|
|
51188
|
-
var
|
|
51291
|
+
var name = this.getName();
|
|
51189
51292
|
if (this.getValue() !== node) {
|
|
51190
51293
|
return false;
|
|
51191
51294
|
}
|
|
@@ -51207,18 +51310,18 @@ var require_fast_path = __commonJS({
|
|
|
51207
51310
|
case "UnaryExpression":
|
|
51208
51311
|
case "SpreadElement":
|
|
51209
51312
|
case "SpreadProperty":
|
|
51210
|
-
return parent.type === "MemberExpression" &&
|
|
51313
|
+
return parent.type === "MemberExpression" && name === "object" && parent.object === node;
|
|
51211
51314
|
case "BinaryExpression":
|
|
51212
51315
|
case "LogicalExpression":
|
|
51213
51316
|
switch (parent.type) {
|
|
51214
51317
|
case "CallExpression":
|
|
51215
|
-
return
|
|
51318
|
+
return name === "callee" && parent.callee === node;
|
|
51216
51319
|
case "UnaryExpression":
|
|
51217
51320
|
case "SpreadElement":
|
|
51218
51321
|
case "SpreadProperty":
|
|
51219
51322
|
return true;
|
|
51220
51323
|
case "MemberExpression":
|
|
51221
|
-
return
|
|
51324
|
+
return name === "object" && parent.object === node;
|
|
51222
51325
|
case "BinaryExpression":
|
|
51223
51326
|
case "LogicalExpression": {
|
|
51224
51327
|
var po = parent.operator;
|
|
@@ -51228,7 +51331,7 @@ var require_fast_path = __commonJS({
|
|
|
51228
51331
|
if (pp > np) {
|
|
51229
51332
|
return true;
|
|
51230
51333
|
}
|
|
51231
|
-
if (pp === np &&
|
|
51334
|
+
if (pp === np && name === "right") {
|
|
51232
51335
|
assert_1.default.strictEqual(parent.right, node);
|
|
51233
51336
|
return true;
|
|
51234
51337
|
}
|
|
@@ -51245,7 +51348,7 @@ var require_fast_path = __commonJS({
|
|
|
51245
51348
|
case "ForStatement":
|
|
51246
51349
|
return false;
|
|
51247
51350
|
case "ExpressionStatement":
|
|
51248
|
-
return
|
|
51351
|
+
return name !== "expression";
|
|
51249
51352
|
default:
|
|
51250
51353
|
return true;
|
|
51251
51354
|
}
|
|
@@ -51255,9 +51358,9 @@ var require_fast_path = __commonJS({
|
|
|
51255
51358
|
case "UnionTypeAnnotation":
|
|
51256
51359
|
return parent.type === "NullableTypeAnnotation";
|
|
51257
51360
|
case "Literal":
|
|
51258
|
-
return parent.type === "MemberExpression" && isNumber.check(node.value) &&
|
|
51361
|
+
return parent.type === "MemberExpression" && isNumber.check(node.value) && name === "object" && parent.object === node;
|
|
51259
51362
|
case "NumericLiteral":
|
|
51260
|
-
return parent.type === "MemberExpression" &&
|
|
51363
|
+
return parent.type === "MemberExpression" && name === "object" && parent.object === node;
|
|
51261
51364
|
case "YieldExpression":
|
|
51262
51365
|
case "AwaitExpression":
|
|
51263
51366
|
case "AssignmentExpression":
|
|
@@ -51271,41 +51374,41 @@ var require_fast_path = __commonJS({
|
|
|
51271
51374
|
return true;
|
|
51272
51375
|
case "CallExpression":
|
|
51273
51376
|
case "NewExpression":
|
|
51274
|
-
return
|
|
51377
|
+
return name === "callee" && parent.callee === node;
|
|
51275
51378
|
case "ConditionalExpression":
|
|
51276
|
-
return
|
|
51379
|
+
return name === "test" && parent.test === node;
|
|
51277
51380
|
case "MemberExpression":
|
|
51278
|
-
return
|
|
51381
|
+
return name === "object" && parent.object === node;
|
|
51279
51382
|
default:
|
|
51280
51383
|
return false;
|
|
51281
51384
|
}
|
|
51282
51385
|
case "ArrowFunctionExpression":
|
|
51283
|
-
if (n.CallExpression.check(parent) &&
|
|
51386
|
+
if (n.CallExpression.check(parent) && name === "callee" && parent.callee === node) {
|
|
51284
51387
|
return true;
|
|
51285
51388
|
}
|
|
51286
|
-
if (n.MemberExpression.check(parent) &&
|
|
51389
|
+
if (n.MemberExpression.check(parent) && name === "object" && parent.object === node) {
|
|
51287
51390
|
return true;
|
|
51288
51391
|
}
|
|
51289
|
-
if (n.TSAsExpression && n.TSAsExpression.check(parent) &&
|
|
51392
|
+
if (n.TSAsExpression && n.TSAsExpression.check(parent) && name === "expression" && parent.expression === node) {
|
|
51290
51393
|
return true;
|
|
51291
51394
|
}
|
|
51292
51395
|
return isBinary(parent);
|
|
51293
51396
|
case "ObjectExpression":
|
|
51294
|
-
if (parent.type === "ArrowFunctionExpression" &&
|
|
51397
|
+
if (parent.type === "ArrowFunctionExpression" && name === "body" && parent.body === node) {
|
|
51295
51398
|
return true;
|
|
51296
51399
|
}
|
|
51297
51400
|
break;
|
|
51298
51401
|
case "TSAsExpression":
|
|
51299
|
-
if (parent.type === "ArrowFunctionExpression" &&
|
|
51402
|
+
if (parent.type === "ArrowFunctionExpression" && name === "body" && parent.body === node && node.expression.type === "ObjectExpression") {
|
|
51300
51403
|
return true;
|
|
51301
51404
|
}
|
|
51302
51405
|
break;
|
|
51303
51406
|
case "CallExpression":
|
|
51304
|
-
if (
|
|
51407
|
+
if (name === "declaration" && n.ExportDefaultDeclaration.check(parent) && n.FunctionExpression.check(node.callee)) {
|
|
51305
51408
|
return true;
|
|
51306
51409
|
}
|
|
51307
51410
|
}
|
|
51308
|
-
if (parent.type === "NewExpression" &&
|
|
51411
|
+
if (parent.type === "NewExpression" && name === "callee" && parent.callee === node) {
|
|
51309
51412
|
return containsCallExpression(node);
|
|
51310
51413
|
}
|
|
51311
51414
|
if (assumeExpressionContext !== true && !this.canBeFirstInStatement() && this.firstInStatement()) {
|
|
@@ -52943,12 +53046,12 @@ var require_printer2 = __commonJS({
|
|
|
52943
53046
|
return (0, lines_1.concat)(parts);
|
|
52944
53047
|
}
|
|
52945
53048
|
case "FunctionTypeParam": {
|
|
52946
|
-
var
|
|
52947
|
-
parts.push(
|
|
53049
|
+
var name = path2.call(print10, "name");
|
|
53050
|
+
parts.push(name);
|
|
52948
53051
|
if (n.optional) {
|
|
52949
53052
|
parts.push("?");
|
|
52950
53053
|
}
|
|
52951
|
-
if (
|
|
53054
|
+
if (name.infos[0].line) {
|
|
52952
53055
|
parts.push(": ");
|
|
52953
53056
|
}
|
|
52954
53057
|
parts.push(path2.call(print10, "typeAnnotation"));
|
|
@@ -53994,6 +54097,9 @@ var houdini_mode = {
|
|
|
53994
54097
|
}
|
|
53995
54098
|
};
|
|
53996
54099
|
|
|
54100
|
+
// src/lib/deepMerge.ts
|
|
54101
|
+
var import_deepmerge = __toESM(require_cjs(), 1);
|
|
54102
|
+
|
|
53997
54103
|
// src/lib/error.ts
|
|
53998
54104
|
var HoudiniError = class extends Error {
|
|
53999
54105
|
filepath = null;
|
|
@@ -54013,6 +54119,20 @@ var HoudiniError = class extends Error {
|
|
|
54013
54119
|
}
|
|
54014
54120
|
};
|
|
54015
54121
|
|
|
54122
|
+
// src/lib/deepMerge.ts
|
|
54123
|
+
function deepMerge(filepath, ...targets) {
|
|
54124
|
+
try {
|
|
54125
|
+
if (targets.length === 1) {
|
|
54126
|
+
return targets[0];
|
|
54127
|
+
} else if (targets.length === 2) {
|
|
54128
|
+
return (0, import_deepmerge.default)(targets[0], targets[1]);
|
|
54129
|
+
}
|
|
54130
|
+
return deepMerge(filepath, targets[0], deepMerge(filepath, ...targets.slice(1)));
|
|
54131
|
+
} catch (e) {
|
|
54132
|
+
throw new HoudiniError({ filepath, message: "could not merge: " + targets });
|
|
54133
|
+
}
|
|
54134
|
+
}
|
|
54135
|
+
|
|
54016
54136
|
// src/lib/fs.ts
|
|
54017
54137
|
var fs_exports = {};
|
|
54018
54138
|
__export(fs_exports, {
|
|
@@ -54290,6 +54410,15 @@ async function glob(pattern) {
|
|
|
54290
54410
|
}
|
|
54291
54411
|
glob.hasMagic = import_glob.glob.hasMagic;
|
|
54292
54412
|
|
|
54413
|
+
// src/lib/types.ts
|
|
54414
|
+
var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
54415
|
+
LogLevel2["Full"] = "full";
|
|
54416
|
+
LogLevel2["Summary"] = "summary";
|
|
54417
|
+
LogLevel2["ShortSummary"] = "short-summary";
|
|
54418
|
+
LogLevel2["Quiet"] = "quiet";
|
|
54419
|
+
return LogLevel2;
|
|
54420
|
+
})(LogLevel || {});
|
|
54421
|
+
|
|
54293
54422
|
// src/lib/config.ts
|
|
54294
54423
|
var import_meta = {};
|
|
54295
54424
|
var currentDir = global.__dirname || dirname((0, import_url.fileURLToPath)(import_meta.url));
|
|
@@ -54309,7 +54438,6 @@ var Config = class {
|
|
|
54309
54438
|
internalListPosition;
|
|
54310
54439
|
defaultListTarget = null;
|
|
54311
54440
|
definitionsFolder;
|
|
54312
|
-
newSchema = "";
|
|
54313
54441
|
newDocuments = "";
|
|
54314
54442
|
defaultKeys = ["id"];
|
|
54315
54443
|
typeConfig;
|
|
@@ -54363,7 +54491,7 @@ var Config = class {
|
|
|
54363
54491
|
Object.values(LogLevel)
|
|
54364
54492
|
)}`
|
|
54365
54493
|
);
|
|
54366
|
-
logLevel =
|
|
54494
|
+
logLevel = "summary" /* Summary */;
|
|
54367
54495
|
}
|
|
54368
54496
|
this.schemaPath = schemaPath;
|
|
54369
54497
|
this.filepath = filepath;
|
|
@@ -54379,7 +54507,7 @@ var Config = class {
|
|
|
54379
54507
|
this.internalListPosition = defaultListPosition === "append" ? "last" : "first";
|
|
54380
54508
|
this.defaultListTarget = defaultListTarget;
|
|
54381
54509
|
this.definitionsFolder = definitionsPath;
|
|
54382
|
-
this.logLevel = (logLevel ||
|
|
54510
|
+
this.logLevel = (logLevel || "summary" /* Summary */).toLowerCase();
|
|
54383
54511
|
this.defaultFragmentMasking = defaultFragmentMasking;
|
|
54384
54512
|
this.routesDir = join(this.projectRoot, "src", "routes");
|
|
54385
54513
|
this.schemaPollInterval = watchSchema?.interval ?? 2e3;
|
|
@@ -54408,19 +54536,19 @@ var Config = class {
|
|
|
54408
54536
|
return Array.isArray(this.configFile.include) ? this.configFile.include : [this.configFile.include];
|
|
54409
54537
|
}
|
|
54410
54538
|
const extensions = [".graphql", ".gql", ".ts", ".js"].concat(
|
|
54411
|
-
this.plugins.flatMap((
|
|
54539
|
+
this.plugins.flatMap((plugin2) => plugin2.extensions ?? [])
|
|
54412
54540
|
);
|
|
54413
54541
|
return [`src/**/*{${extensions.join(",")}}`];
|
|
54414
54542
|
}
|
|
54415
|
-
pluginConfig(
|
|
54416
|
-
return this.configFile.plugins?.[
|
|
54543
|
+
pluginConfig(name) {
|
|
54544
|
+
return this.configFile.plugins?.[name] ?? {};
|
|
54417
54545
|
}
|
|
54418
54546
|
async getEnv() {
|
|
54419
54547
|
let env = process.env;
|
|
54420
|
-
for (const
|
|
54421
|
-
if (
|
|
54548
|
+
for (const plugin2 of this.plugins) {
|
|
54549
|
+
if (plugin2.env) {
|
|
54422
54550
|
env = {
|
|
54423
|
-
...await
|
|
54551
|
+
...await plugin2.env({ config: this, env })
|
|
54424
54552
|
};
|
|
54425
54553
|
}
|
|
54426
54554
|
}
|
|
@@ -54470,6 +54598,19 @@ var Config = class {
|
|
|
54470
54598
|
)
|
|
54471
54599
|
];
|
|
54472
54600
|
}
|
|
54601
|
+
#newSchemaInstance = null;
|
|
54602
|
+
#schemaString = "";
|
|
54603
|
+
set newSchema(value) {
|
|
54604
|
+
this.#schemaString = value;
|
|
54605
|
+
if (value) {
|
|
54606
|
+
this.#newSchemaInstance = graphql.buildSchema(value);
|
|
54607
|
+
} else {
|
|
54608
|
+
this.#newSchemaInstance = null;
|
|
54609
|
+
}
|
|
54610
|
+
}
|
|
54611
|
+
get newSchema() {
|
|
54612
|
+
return this.#schemaString;
|
|
54613
|
+
}
|
|
54473
54614
|
get artifactDirectory() {
|
|
54474
54615
|
return join(this.rootDir, this.artifactDirectoryName);
|
|
54475
54616
|
}
|
|
@@ -54506,23 +54647,8 @@ var Config = class {
|
|
|
54506
54647
|
get typeRootFile() {
|
|
54507
54648
|
return "$houdini.d.ts";
|
|
54508
54649
|
}
|
|
54509
|
-
findModule(pkg = "houdini", currentLocation = join(dirname(this.filepath))) {
|
|
54510
|
-
const pathEndingBy = ["node_modules", pkg];
|
|
54511
|
-
let locationFound = join(currentLocation, ...pathEndingBy);
|
|
54512
|
-
let previousLocation = "";
|
|
54513
|
-
const backFolder = [];
|
|
54514
|
-
while (previousLocation !== locationFound && !existsSync(locationFound)) {
|
|
54515
|
-
previousLocation = locationFound;
|
|
54516
|
-
backFolder.push("../");
|
|
54517
|
-
locationFound = join(currentLocation, ...backFolder, ...pathEndingBy);
|
|
54518
|
-
}
|
|
54519
|
-
if (previousLocation === locationFound) {
|
|
54520
|
-
throw new Error("Could not find any node_modules/houdini folder");
|
|
54521
|
-
}
|
|
54522
|
-
return locationFound;
|
|
54523
|
-
}
|
|
54524
54650
|
get runtimeSource() {
|
|
54525
|
-
const relative2 = houdini_mode.is_testing ? join(currentDir, "..", "..") : this.
|
|
54651
|
+
const relative2 = houdini_mode.is_testing ? join(currentDir, "..", "..") : findModule("houdini", join(dirname(this.filepath)));
|
|
54526
54652
|
const which = this.module === "esm" ? "esm" : "cjs";
|
|
54527
54653
|
return resolve(relative2, "build", `runtime-${which}`);
|
|
54528
54654
|
}
|
|
@@ -54532,8 +54658,8 @@ var Config = class {
|
|
|
54532
54658
|
artifactPath(document) {
|
|
54533
54659
|
return join(this.artifactDirectory, this.documentName(document) + ".js");
|
|
54534
54660
|
}
|
|
54535
|
-
artifactImportPath(
|
|
54536
|
-
return `$houdini/${this.artifactDirectoryName}/${
|
|
54661
|
+
artifactImportPath(name) {
|
|
54662
|
+
return `$houdini/${this.artifactDirectoryName}/${name}`;
|
|
54537
54663
|
}
|
|
54538
54664
|
keyFieldsForType(type) {
|
|
54539
54665
|
return keyFieldsForType(this.configFile, type);
|
|
@@ -54577,16 +54703,27 @@ var Config = class {
|
|
|
54577
54703
|
relative(process.cwd(), filepath).replaceAll(sep, "_").replace(".ts", ".js")
|
|
54578
54704
|
);
|
|
54579
54705
|
}
|
|
54706
|
+
excludeFile(filepath) {
|
|
54707
|
+
if (this.exclude.length > 0 && this.exclude.some((pattern) => (0, import_minimatch.default)(filepath, pattern))) {
|
|
54708
|
+
return true;
|
|
54709
|
+
}
|
|
54710
|
+
for (const plugin2 of this.plugins) {
|
|
54711
|
+
if (plugin2?.exclude?.({ config: this, filepath })) {
|
|
54712
|
+
return true;
|
|
54713
|
+
}
|
|
54714
|
+
}
|
|
54715
|
+
return false;
|
|
54716
|
+
}
|
|
54580
54717
|
includeFile(filepath, {
|
|
54581
54718
|
root = this.projectRoot,
|
|
54582
54719
|
ignore_plugins = false
|
|
54583
54720
|
} = {}) {
|
|
54584
54721
|
let included = false;
|
|
54585
|
-
for (const
|
|
54586
|
-
if (!
|
|
54722
|
+
for (const plugin2 of ignore_plugins ? [] : this.plugins) {
|
|
54723
|
+
if (!plugin2.include) {
|
|
54587
54724
|
continue;
|
|
54588
54725
|
}
|
|
54589
|
-
if (
|
|
54726
|
+
if (plugin2.include({ config: this, filepath })) {
|
|
54590
54727
|
included = true;
|
|
54591
54728
|
break;
|
|
54592
54729
|
}
|
|
@@ -54594,16 +54731,16 @@ var Config = class {
|
|
|
54594
54731
|
if (!included && !this.include.some((pattern) => (0, import_minimatch.default)(filepath, join(root, pattern)))) {
|
|
54595
54732
|
return false;
|
|
54596
54733
|
}
|
|
54597
|
-
return !this.
|
|
54734
|
+
return !this.excludeFile(filepath);
|
|
54598
54735
|
}
|
|
54599
|
-
pluginRuntimeDirectory(
|
|
54600
|
-
return join(this.pluginDirectory(
|
|
54736
|
+
pluginRuntimeDirectory(name) {
|
|
54737
|
+
return join(this.pluginDirectory(name), "runtime");
|
|
54601
54738
|
}
|
|
54602
54739
|
get pluginRootDirectory() {
|
|
54603
54740
|
return houdini_mode.is_testing ? "../../../" : join(this.rootDir, "plugins");
|
|
54604
54741
|
}
|
|
54605
|
-
pluginDirectory(
|
|
54606
|
-
return join(this.pluginRootDirectory,
|
|
54742
|
+
pluginDirectory(name) {
|
|
54743
|
+
return join(this.pluginRootDirectory, name);
|
|
54607
54744
|
}
|
|
54608
54745
|
get loadDirective() {
|
|
54609
54746
|
return "load";
|
|
@@ -54680,59 +54817,45 @@ var Config = class {
|
|
|
54680
54817
|
paginationQueryName(documentName) {
|
|
54681
54818
|
return documentName + "_Pagination_Query";
|
|
54682
54819
|
}
|
|
54683
|
-
isDeleteDirective(
|
|
54684
|
-
return
|
|
54820
|
+
isDeleteDirective(name) {
|
|
54821
|
+
return name.endsWith(this.deleteDirectiveSuffix);
|
|
54685
54822
|
}
|
|
54686
|
-
listDeleteDirective(
|
|
54687
|
-
return
|
|
54823
|
+
listDeleteDirective(name) {
|
|
54824
|
+
return name + this.deleteDirectiveSuffix;
|
|
54688
54825
|
}
|
|
54689
|
-
deleteDirectiveType(
|
|
54690
|
-
return
|
|
54826
|
+
deleteDirectiveType(name) {
|
|
54827
|
+
return name.slice(0, name.length - this.deleteDirectiveSuffix.length);
|
|
54691
54828
|
}
|
|
54692
|
-
isInsertFragment(
|
|
54693
|
-
return
|
|
54829
|
+
isInsertFragment(name) {
|
|
54830
|
+
return name.endsWith(this.insertFragmentSuffix);
|
|
54694
54831
|
}
|
|
54695
|
-
listInsertFragment(
|
|
54696
|
-
return
|
|
54832
|
+
listInsertFragment(name) {
|
|
54833
|
+
return name + this.insertFragmentSuffix;
|
|
54697
54834
|
}
|
|
54698
|
-
listToggleFragment(
|
|
54699
|
-
return
|
|
54835
|
+
listToggleFragment(name) {
|
|
54836
|
+
return name + this.toggleFragmentSuffix;
|
|
54700
54837
|
}
|
|
54701
|
-
isRemoveFragment(
|
|
54702
|
-
return
|
|
54838
|
+
isRemoveFragment(name) {
|
|
54839
|
+
return name.endsWith(this.removeFragmentSuffix);
|
|
54703
54840
|
}
|
|
54704
|
-
isToggleFragment(
|
|
54705
|
-
return
|
|
54841
|
+
isToggleFragment(name) {
|
|
54842
|
+
return name.endsWith(this.toggleFragmentSuffix);
|
|
54706
54843
|
}
|
|
54707
|
-
listRemoveFragment(
|
|
54708
|
-
return
|
|
54844
|
+
listRemoveFragment(name) {
|
|
54845
|
+
return name + this.removeFragmentSuffix;
|
|
54709
54846
|
}
|
|
54710
54847
|
isInternalEnum(node) {
|
|
54711
54848
|
return node.name.value === "CachePolicy";
|
|
54712
54849
|
}
|
|
54713
|
-
isInternalDirective(
|
|
54714
|
-
|
|
54715
|
-
|
|
54716
|
-
|
|
54717
|
-
|
|
54718
|
-
|
|
54719
|
-
|
|
54720
|
-
|
|
54721
|
-
|
|
54722
|
-
this.argumentsDirective,
|
|
54723
|
-
this.withDirective,
|
|
54724
|
-
this.paginateDirective,
|
|
54725
|
-
this.cacheDirective,
|
|
54726
|
-
this.loadDirective,
|
|
54727
|
-
this.maskEnableDirective,
|
|
54728
|
-
this.maskDisableDirective
|
|
54729
|
-
].includes(name2.value) || this.isDeleteDirective(name2.value);
|
|
54730
|
-
}
|
|
54731
|
-
isListFragment(name2) {
|
|
54732
|
-
return name2.endsWith(this.insertFragmentSuffix) || name2.endsWith(this.removeFragmentSuffix) || name2.endsWith(this.toggleFragmentSuffix);
|
|
54733
|
-
}
|
|
54734
|
-
isListOperationDirective(name2) {
|
|
54735
|
-
return name2.endsWith(this.deleteDirectiveSuffix);
|
|
54850
|
+
isInternalDirective(name) {
|
|
54851
|
+
const internalDirectives = this.#newSchemaInstance?.getDirectives().map((directive) => directive.name) ?? [];
|
|
54852
|
+
return internalDirectives.includes(name) || this.isDeleteDirective(name);
|
|
54853
|
+
}
|
|
54854
|
+
isListFragment(name) {
|
|
54855
|
+
return name.endsWith(this.insertFragmentSuffix) || name.endsWith(this.removeFragmentSuffix) || name.endsWith(this.toggleFragmentSuffix);
|
|
54856
|
+
}
|
|
54857
|
+
isListOperationDirective(name) {
|
|
54858
|
+
return name.endsWith(this.deleteDirectiveSuffix);
|
|
54736
54859
|
}
|
|
54737
54860
|
isFragmentForList(listName, fragmentName) {
|
|
54738
54861
|
return fragmentName.startsWith(listName);
|
|
@@ -54779,18 +54902,26 @@ var Config = class {
|
|
|
54779
54902
|
}
|
|
54780
54903
|
return definition;
|
|
54781
54904
|
}
|
|
54782
|
-
variableFunctionName(
|
|
54783
|
-
return
|
|
54905
|
+
variableFunctionName(name) {
|
|
54906
|
+
return name + "Variables";
|
|
54784
54907
|
}
|
|
54785
54908
|
};
|
|
54786
54909
|
var DEFAULT_CONFIG_PATH = join(process.cwd(), "houdini.config.js");
|
|
54787
|
-
|
|
54788
|
-
|
|
54789
|
-
|
|
54790
|
-
|
|
54791
|
-
|
|
54792
|
-
|
|
54793
|
-
|
|
54910
|
+
function findModule(pkg = "houdini", currentLocation) {
|
|
54911
|
+
const pathEndingBy = ["node_modules", pkg];
|
|
54912
|
+
let locationFound = join(currentLocation, ...pathEndingBy);
|
|
54913
|
+
let previousLocation = "";
|
|
54914
|
+
const backFolder = [];
|
|
54915
|
+
while (previousLocation !== locationFound && !existsSync(locationFound)) {
|
|
54916
|
+
previousLocation = locationFound;
|
|
54917
|
+
backFolder.push("../");
|
|
54918
|
+
locationFound = join(currentLocation, ...backFolder, ...pathEndingBy);
|
|
54919
|
+
}
|
|
54920
|
+
if (previousLocation === locationFound) {
|
|
54921
|
+
throw new Error("Could not find any node_modules/houdini folder");
|
|
54922
|
+
}
|
|
54923
|
+
return locationFound;
|
|
54924
|
+
}
|
|
54794
54925
|
|
|
54795
54926
|
// src/lib/graphql.ts
|
|
54796
54927
|
var import_crypto = __toESM(require("crypto"), 1);
|
|
@@ -54804,8 +54935,10 @@ function getRootType(type) {
|
|
|
54804
54935
|
}
|
|
54805
54936
|
return type;
|
|
54806
54937
|
}
|
|
54807
|
-
function hashDocument(
|
|
54808
|
-
|
|
54938
|
+
function hashDocument({
|
|
54939
|
+
document
|
|
54940
|
+
}) {
|
|
54941
|
+
const docString = typeof document === "string" ? document : graphql2.print(document.document);
|
|
54809
54942
|
return import_crypto.default.createHash("sha256").update(docString).digest("hex");
|
|
54810
54943
|
}
|
|
54811
54944
|
function parentTypeFromAncestors(schema, filepath, ancestors) {
|
|
@@ -55098,13 +55231,13 @@ var FieldCollection = class {
|
|
|
55098
55231
|
this.fragmentSpreads[selection2.name.value] = selection2;
|
|
55099
55232
|
let includeFragments = this.config.defaultFragmentMasking === "disable";
|
|
55100
55233
|
const maskEnableDirective = selection2.directives?.find(
|
|
55101
|
-
({ name
|
|
55234
|
+
({ name }) => name.value === this.config.maskEnableDirective
|
|
55102
55235
|
);
|
|
55103
55236
|
if (maskEnableDirective) {
|
|
55104
55237
|
includeFragments = false;
|
|
55105
55238
|
}
|
|
55106
55239
|
const maskDisableDirective = selection2.directives?.find(
|
|
55107
|
-
({ name
|
|
55240
|
+
({ name }) => name.value === this.config.maskDisableDirective
|
|
55108
55241
|
);
|
|
55109
55242
|
if (maskDisableDirective) {
|
|
55110
55243
|
includeFragments = true;
|
|
@@ -55259,7 +55392,7 @@ var graphql3 = __toESM(require_graphql2(), 1);
|
|
|
55259
55392
|
var import_graphql = __toESM(require_graphql2(), 1);
|
|
55260
55393
|
async function includeFragmentDefinitions(config2, documents) {
|
|
55261
55394
|
const fragments = collectFragments(config2, documents);
|
|
55262
|
-
for (const [index, { name
|
|
55395
|
+
for (const [index, { name, document, filename }] of documents.entries()) {
|
|
55263
55396
|
const operation = document.definitions.find(
|
|
55264
55397
|
({ kind }) => kind === import_graphql.Kind.OPERATION_DEFINITION
|
|
55265
55398
|
);
|
|
@@ -55373,7 +55506,8 @@ async function fragmentVariables(config2, documents) {
|
|
|
55373
55506
|
generateStore: false,
|
|
55374
55507
|
generateArtifact: false,
|
|
55375
55508
|
filename: "generated::fragmentVariables",
|
|
55376
|
-
originalString: ""
|
|
55509
|
+
originalString: "",
|
|
55510
|
+
artifact: null
|
|
55377
55511
|
});
|
|
55378
55512
|
}
|
|
55379
55513
|
function inlineFragmentArgs({
|
|
@@ -55521,7 +55655,7 @@ function fragmentArguments(config2, filepath, definition) {
|
|
|
55521
55655
|
return [];
|
|
55522
55656
|
}
|
|
55523
55657
|
let type = typeArg.value;
|
|
55524
|
-
let
|
|
55658
|
+
let name = arg.name.value;
|
|
55525
55659
|
let required = false;
|
|
55526
55660
|
let defaultValue = arg.value.fields?.find((arg2) => arg2.name.value === "default")?.value || null;
|
|
55527
55661
|
if (type[type.length - 1] === "!") {
|
|
@@ -55531,7 +55665,7 @@ function fragmentArguments(config2, filepath, definition) {
|
|
|
55531
55665
|
}
|
|
55532
55666
|
return [
|
|
55533
55667
|
{
|
|
55534
|
-
name
|
|
55668
|
+
name,
|
|
55535
55669
|
type,
|
|
55536
55670
|
required,
|
|
55537
55671
|
defaultValue
|
|
@@ -55542,7 +55676,7 @@ function fragmentArguments(config2, filepath, definition) {
|
|
|
55542
55676
|
}
|
|
55543
55677
|
function collectDefaultArgumentValues(config2, filepath, definition) {
|
|
55544
55678
|
let result = {};
|
|
55545
|
-
for (const { name
|
|
55679
|
+
for (const { name, required, defaultValue } of fragmentArguments(
|
|
55546
55680
|
config2,
|
|
55547
55681
|
filepath,
|
|
55548
55682
|
definition
|
|
@@ -55550,7 +55684,7 @@ function collectDefaultArgumentValues(config2, filepath, definition) {
|
|
|
55550
55684
|
if (required || !defaultValue) {
|
|
55551
55685
|
continue;
|
|
55552
55686
|
}
|
|
55553
|
-
result[
|
|
55687
|
+
result[name] = defaultValue;
|
|
55554
55688
|
}
|
|
55555
55689
|
return result;
|
|
55556
55690
|
}
|
|
@@ -55717,30 +55851,6 @@ function serializeValue(value) {
|
|
|
55717
55851
|
}
|
|
55718
55852
|
return AST4.literal(value);
|
|
55719
55853
|
}
|
|
55720
|
-
function deepMerge(filepath, ...targets) {
|
|
55721
|
-
if (typeof targets[0] !== "object") {
|
|
55722
|
-
const matches = targets.filter((val) => val !== targets[0]).length === 0;
|
|
55723
|
-
if (!matches) {
|
|
55724
|
-
throw new HoudiniError({ filepath, message: "could not merge: " + targets });
|
|
55725
|
-
}
|
|
55726
|
-
return targets[0];
|
|
55727
|
-
}
|
|
55728
|
-
if (Array.isArray(targets[0])) {
|
|
55729
|
-
return targets[0].concat(...targets.slice(1));
|
|
55730
|
-
}
|
|
55731
|
-
const fields = {};
|
|
55732
|
-
for (const target of targets) {
|
|
55733
|
-
for (const [key, value] of Object.entries(target)) {
|
|
55734
|
-
if (!fields[key]) {
|
|
55735
|
-
fields[key] = [];
|
|
55736
|
-
}
|
|
55737
|
-
fields[key].push(value);
|
|
55738
|
-
}
|
|
55739
|
-
}
|
|
55740
|
-
return Object.fromEntries(
|
|
55741
|
-
Object.entries(fields).map(([key, value]) => [key, deepMerge(filepath, ...value)])
|
|
55742
|
-
);
|
|
55743
|
-
}
|
|
55744
55854
|
function convertValue(config2, val) {
|
|
55745
55855
|
let value;
|
|
55746
55856
|
let kind;
|
|
@@ -55825,14 +55935,14 @@ function operationObject({
|
|
|
55825
55935
|
let allLists = config2.defaultListTarget ?? void 0;
|
|
55826
55936
|
let operationWhen;
|
|
55827
55937
|
const internalDirectives = selection2.directives?.filter(
|
|
55828
|
-
(directive) => config2.isInternalDirective(directive)
|
|
55938
|
+
(directive) => config2.isInternalDirective(directive.name.value)
|
|
55829
55939
|
);
|
|
55830
55940
|
if (internalDirectives && internalDirectives.length > 0) {
|
|
55831
55941
|
const prepend = internalDirectives.find(
|
|
55832
|
-
({ name
|
|
55942
|
+
({ name }) => name.value === config2.listPrependDirective
|
|
55833
55943
|
);
|
|
55834
55944
|
const append = internalDirectives.find(
|
|
55835
|
-
({ name
|
|
55945
|
+
({ name }) => name.value === config2.listAppendDirective
|
|
55836
55946
|
);
|
|
55837
55947
|
if (append) {
|
|
55838
55948
|
position = "last";
|
|
@@ -55841,14 +55951,14 @@ function operationObject({
|
|
|
55841
55951
|
position = "first";
|
|
55842
55952
|
}
|
|
55843
55953
|
const allListsDirective = internalDirectives.find(
|
|
55844
|
-
({ name
|
|
55954
|
+
({ name }) => name.value === config2.listAllListsDirective
|
|
55845
55955
|
);
|
|
55846
55956
|
let parent = internalDirectives.find(
|
|
55847
|
-
({ name
|
|
55957
|
+
({ name }) => name.value === config2.listParentDirective
|
|
55848
55958
|
);
|
|
55849
55959
|
allLists = allListsDirective ? "all" : void 0;
|
|
55850
|
-
const when = internalDirectives.find(({ name
|
|
55851
|
-
const when_not = internalDirectives.find(({ name
|
|
55960
|
+
const when = internalDirectives.find(({ name }) => name.value === "when");
|
|
55961
|
+
const when_not = internalDirectives.find(({ name }) => name.value === "when_not");
|
|
55852
55962
|
let parentIDArg = parent?.arguments?.find((argument) => argument.name.value === "value");
|
|
55853
55963
|
if (parentIDArg) {
|
|
55854
55964
|
if (parentIDArg.value.kind === "StringValue") {
|
|
@@ -55859,9 +55969,9 @@ function operationObject({
|
|
|
55859
55969
|
parentID = parentIDArg.value.name.value;
|
|
55860
55970
|
}
|
|
55861
55971
|
}
|
|
55862
|
-
const whenArg = (append || prepend)?.arguments?.find(({ name
|
|
55972
|
+
const whenArg = (append || prepend)?.arguments?.find(({ name }) => name.value === "when");
|
|
55863
55973
|
const whenNotArg = (append || prepend)?.arguments?.find(
|
|
55864
|
-
({ name
|
|
55974
|
+
({ name }) => name.value === "when_not"
|
|
55865
55975
|
);
|
|
55866
55976
|
for (const [i, arg] of [whenArg, whenNotArg].entries()) {
|
|
55867
55977
|
if (!arg || arg.value.kind !== "ObjectValue") {
|
|
@@ -56029,19 +56139,18 @@ async function paginate(config2, documents) {
|
|
|
56029
56139
|
paginated = true;
|
|
56030
56140
|
const fieldTypeFields = parentTypeFromAncestors(config2.schema, doc.filename, ancestors).getFields()[node.name.value];
|
|
56031
56141
|
const args = new Set(fieldTypeFields.args.map((arg) => arg.name));
|
|
56032
|
-
const passedArgs = new Set(node.arguments?.map((arg) => arg.name.value));
|
|
56033
|
-
const specifiedForwards = passedArgs.has("first");
|
|
56034
|
-
const specifiedBackwards = passedArgs.has("last");
|
|
56035
56142
|
cursorType = fieldTypeFields.args?.find((arg) => ["before", "after"].includes(arg.name))?.type?.name || "String";
|
|
56036
56143
|
flags.after.type = cursorType;
|
|
56037
56144
|
flags.before.type = cursorType;
|
|
56038
|
-
const
|
|
56039
|
-
const
|
|
56040
|
-
const
|
|
56041
|
-
|
|
56042
|
-
|
|
56043
|
-
flags.
|
|
56044
|
-
flags.
|
|
56145
|
+
const passedArgs = new Set(node.arguments?.map((arg) => arg.name.value));
|
|
56146
|
+
const forwards = args.has("first") && args.has("after");
|
|
56147
|
+
const backwards = args.has("last") && args.has("after");
|
|
56148
|
+
const cursorPagination = passedArgs.has("last") || passedArgs.has("first");
|
|
56149
|
+
const offsetPagination = !cursorPagination && args.has("offset") && args.has("limit");
|
|
56150
|
+
flags.first.enabled = forwards;
|
|
56151
|
+
flags.after.enabled = forwards;
|
|
56152
|
+
flags.last.enabled = backwards;
|
|
56153
|
+
flags.before.enabled = backwards;
|
|
56045
56154
|
flags.offset.enabled = offsetPagination;
|
|
56046
56155
|
flags.limit.enabled = offsetPagination;
|
|
56047
56156
|
paginationPath = ancestors.filter(
|
|
@@ -56061,10 +56170,6 @@ async function paginate(config2, documents) {
|
|
|
56061
56170
|
let fragmentName = "";
|
|
56062
56171
|
let refetchQueryName = "";
|
|
56063
56172
|
let nodeQuery = false;
|
|
56064
|
-
let refetchUpdate = "append" /* append */;
|
|
56065
|
-
if (flags.last.enabled) {
|
|
56066
|
-
refetchUpdate = "prepend" /* prepend */;
|
|
56067
|
-
}
|
|
56068
56173
|
let fragment = "";
|
|
56069
56174
|
doc.document = graphql8.visit(doc.document, {
|
|
56070
56175
|
OperationDefinition(node) {
|
|
@@ -56099,7 +56204,7 @@ async function paginate(config2, documents) {
|
|
|
56099
56204
|
Object.keys(operationVariables).concat(Object.keys(newVariables))
|
|
56100
56205
|
);
|
|
56101
56206
|
const finalVariables = [...variableNames].map(
|
|
56102
|
-
(
|
|
56207
|
+
(name) => operationVariables[name] || newVariables[name]
|
|
56103
56208
|
);
|
|
56104
56209
|
return {
|
|
56105
56210
|
...node,
|
|
@@ -56159,26 +56264,24 @@ async function paginate(config2, documents) {
|
|
|
56159
56264
|
targetType = fragment;
|
|
56160
56265
|
}
|
|
56161
56266
|
}
|
|
56267
|
+
const pageSize = flags.first.defaultValue ?? flags.last.defaultValue ?? flags.limit.defaultValue;
|
|
56268
|
+
const start = flags.after.defaultValue ?? flags.before.defaultValue ?? flags.offset.defaultValue;
|
|
56269
|
+
let direction = "forward";
|
|
56270
|
+
if (flags.before.enabled && flags.after.enabled) {
|
|
56271
|
+
direction = "both";
|
|
56272
|
+
} else if (flags.before.enabled) {
|
|
56273
|
+
direction = "backward";
|
|
56274
|
+
}
|
|
56162
56275
|
doc.refetch = {
|
|
56163
|
-
update: refetchUpdate,
|
|
56164
56276
|
path: paginationPath,
|
|
56165
56277
|
method: flags.first.enabled || flags.last.enabled ? "cursor" : "offset",
|
|
56166
|
-
pageSize
|
|
56278
|
+
pageSize,
|
|
56167
56279
|
embedded: nodeQuery,
|
|
56168
56280
|
targetType,
|
|
56169
56281
|
paginated: true,
|
|
56170
|
-
direction
|
|
56171
|
-
|
|
56172
|
-
|
|
56173
|
-
doc.refetch.pageSize = flags.first.defaultValue;
|
|
56174
|
-
doc.refetch.start = flags.after.defaultValue;
|
|
56175
|
-
} else if (flags.last.enabled) {
|
|
56176
|
-
doc.refetch.pageSize = flags.last.defaultValue;
|
|
56177
|
-
doc.refetch.start = flags.before.defaultValue;
|
|
56178
|
-
} else if (flags.limit.enabled) {
|
|
56179
|
-
doc.refetch.pageSize = flags.limit.defaultValue;
|
|
56180
|
-
doc.refetch.start = flags.offset.defaultValue;
|
|
56181
|
-
}
|
|
56282
|
+
direction,
|
|
56283
|
+
start
|
|
56284
|
+
};
|
|
56182
56285
|
if (!fragment) {
|
|
56183
56286
|
continue;
|
|
56184
56287
|
}
|
|
@@ -56198,7 +56301,7 @@ async function paginate(config2, documents) {
|
|
|
56198
56301
|
value: config2.withDirective
|
|
56199
56302
|
},
|
|
56200
56303
|
["arguments"]: paginationArgs.map(
|
|
56201
|
-
({ name
|
|
56304
|
+
({ name }) => variableAsArgument(name)
|
|
56202
56305
|
)
|
|
56203
56306
|
}
|
|
56204
56307
|
]
|
|
@@ -56326,7 +56429,8 @@ async function paginate(config2, documents) {
|
|
|
56326
56429
|
generateArtifact: true,
|
|
56327
56430
|
generateStore: false,
|
|
56328
56431
|
refetch: doc.refetch,
|
|
56329
|
-
originalString: ""
|
|
56432
|
+
originalString: "",
|
|
56433
|
+
artifact: null
|
|
56330
56434
|
});
|
|
56331
56435
|
}
|
|
56332
56436
|
}
|
|
@@ -56349,38 +56453,32 @@ function replaceArgumentsWithVariables(args, flags) {
|
|
|
56349
56453
|
seenArgs[arg.name.value] = true;
|
|
56350
56454
|
return variableAsArgument(arg.name.value, flags[arg.name.value].variableName);
|
|
56351
56455
|
});
|
|
56352
|
-
for (const
|
|
56353
|
-
const spec = flags[
|
|
56354
|
-
if (flags[
|
|
56355
|
-
continue;
|
|
56356
|
-
}
|
|
56357
|
-
if (["first", "after"].includes(name2) && flags["before"].enabled) {
|
|
56456
|
+
for (const name of Object.keys(flags)) {
|
|
56457
|
+
const spec = flags[name];
|
|
56458
|
+
if (flags[name].defaultValue || !spec.enabled || seenArgs[name]) {
|
|
56358
56459
|
continue;
|
|
56359
56460
|
}
|
|
56360
|
-
|
|
56361
|
-
continue;
|
|
56362
|
-
}
|
|
56363
|
-
newArgs.push(variableAsArgument(name2));
|
|
56461
|
+
newArgs.push(variableAsArgument(name));
|
|
56364
56462
|
}
|
|
56365
56463
|
return newArgs;
|
|
56366
56464
|
}
|
|
56367
|
-
function variableAsArgument(
|
|
56465
|
+
function variableAsArgument(name, variable) {
|
|
56368
56466
|
return {
|
|
56369
56467
|
kind: graphql8.Kind.ARGUMENT,
|
|
56370
56468
|
name: {
|
|
56371
56469
|
kind: graphql8.Kind.NAME,
|
|
56372
|
-
value:
|
|
56470
|
+
value: name
|
|
56373
56471
|
},
|
|
56374
56472
|
value: {
|
|
56375
56473
|
kind: graphql8.Kind.VARIABLE,
|
|
56376
56474
|
name: {
|
|
56377
56475
|
kind: graphql8.Kind.NAME,
|
|
56378
|
-
value: variable ??
|
|
56476
|
+
value: variable ?? name
|
|
56379
56477
|
}
|
|
56380
56478
|
}
|
|
56381
56479
|
};
|
|
56382
56480
|
}
|
|
56383
|
-
function staticVariableDefinition(
|
|
56481
|
+
function staticVariableDefinition(name, type, defaultValue, variableName) {
|
|
56384
56482
|
return {
|
|
56385
56483
|
kind: graphql8.Kind.VARIABLE_DEFINITION,
|
|
56386
56484
|
type: {
|
|
@@ -56394,7 +56492,7 @@ function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
|
56394
56492
|
kind: graphql8.Kind.VARIABLE,
|
|
56395
56493
|
name: {
|
|
56396
56494
|
kind: graphql8.Kind.NAME,
|
|
56397
|
-
value: variableName ??
|
|
56495
|
+
value: variableName ?? name
|
|
56398
56496
|
}
|
|
56399
56497
|
},
|
|
56400
56498
|
defaultValue: !defaultValue ? void 0 : {
|
|
@@ -56403,12 +56501,12 @@ function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
|
56403
56501
|
}
|
|
56404
56502
|
};
|
|
56405
56503
|
}
|
|
56406
|
-
function argumentNode(
|
|
56504
|
+
function argumentNode(name, value) {
|
|
56407
56505
|
return {
|
|
56408
56506
|
kind: graphql8.Kind.ARGUMENT,
|
|
56409
56507
|
name: {
|
|
56410
56508
|
kind: graphql8.Kind.NAME,
|
|
56411
|
-
value:
|
|
56509
|
+
value: name
|
|
56412
56510
|
},
|
|
56413
56511
|
value: objectNode(value)
|
|
56414
56512
|
};
|
|
@@ -56654,7 +56752,7 @@ async function addListFragments(config2, documents) {
|
|
|
56654
56752
|
const generatedDoc = {
|
|
56655
56753
|
kind: graphql9.Kind.DOCUMENT,
|
|
56656
56754
|
definitions: Object.entries(lists).flatMap(
|
|
56657
|
-
([
|
|
56755
|
+
([name, { selection: selection2, type }]) => {
|
|
56658
56756
|
const schemaType = config2.schema.getType(type.name);
|
|
56659
56757
|
if (!selection2) {
|
|
56660
56758
|
throw new HoudiniError({ message: "Lists must have a selection" });
|
|
@@ -56674,7 +56772,7 @@ async function addListFragments(config2, documents) {
|
|
|
56674
56772
|
return [
|
|
56675
56773
|
{
|
|
56676
56774
|
name: {
|
|
56677
|
-
value: config2.listInsertFragment(
|
|
56775
|
+
value: config2.listInsertFragment(name),
|
|
56678
56776
|
kind: graphql9.Kind.NAME
|
|
56679
56777
|
},
|
|
56680
56778
|
kind: graphql9.Kind.FRAGMENT_DEFINITION,
|
|
@@ -56689,7 +56787,7 @@ async function addListFragments(config2, documents) {
|
|
|
56689
56787
|
},
|
|
56690
56788
|
{
|
|
56691
56789
|
name: {
|
|
56692
|
-
value: config2.listToggleFragment(
|
|
56790
|
+
value: config2.listToggleFragment(name),
|
|
56693
56791
|
kind: graphql9.Kind.NAME
|
|
56694
56792
|
},
|
|
56695
56793
|
kind: graphql9.Kind.FRAGMENT_DEFINITION,
|
|
@@ -56705,7 +56803,7 @@ async function addListFragments(config2, documents) {
|
|
|
56705
56803
|
{
|
|
56706
56804
|
kind: graphql9.Kind.FRAGMENT_DEFINITION,
|
|
56707
56805
|
name: {
|
|
56708
|
-
value: config2.listRemoveFragment(
|
|
56806
|
+
value: config2.listRemoveFragment(name),
|
|
56709
56807
|
kind: graphql9.Kind.NAME
|
|
56710
56808
|
},
|
|
56711
56809
|
selectionSet: {
|
|
@@ -56749,7 +56847,8 @@ async function addListFragments(config2, documents) {
|
|
|
56749
56847
|
document: generatedDoc,
|
|
56750
56848
|
originalDocument: generatedDoc,
|
|
56751
56849
|
filename: "generated::lists",
|
|
56752
|
-
originalString: ""
|
|
56850
|
+
originalString: "",
|
|
56851
|
+
artifact: null
|
|
56753
56852
|
});
|
|
56754
56853
|
}
|
|
56755
56854
|
function connectionSelection(config2, field, type, selection2) {
|
|
@@ -56867,7 +56966,7 @@ function selection({
|
|
|
56867
56966
|
path: path2 = [],
|
|
56868
56967
|
includeFragments,
|
|
56869
56968
|
document,
|
|
56870
|
-
|
|
56969
|
+
inConnection
|
|
56871
56970
|
}) {
|
|
56872
56971
|
let object = {};
|
|
56873
56972
|
const typeMap = {};
|
|
@@ -57009,14 +57108,23 @@ function selection({
|
|
|
57009
57108
|
(directive) => directive.name.value === config2.paginateDirective
|
|
57010
57109
|
);
|
|
57011
57110
|
if (paginated && document.refetch && document.refetch.method === "offset") {
|
|
57012
|
-
fieldObj.
|
|
57111
|
+
fieldObj.updates = ["append" /* append */];
|
|
57013
57112
|
}
|
|
57014
|
-
|
|
57015
|
-
|
|
57016
|
-
|
|
57113
|
+
let continueConnection = inConnection;
|
|
57114
|
+
if ([
|
|
57115
|
+
"edges",
|
|
57116
|
+
"endCursor",
|
|
57117
|
+
"startCursor",
|
|
57118
|
+
"hasNextPage",
|
|
57119
|
+
"hasPreviousPage"
|
|
57120
|
+
].includes(attributeName) && inConnection && document.refetch) {
|
|
57121
|
+
fieldObj.updates = ["append" /* append */, "prepend" /* prepend */];
|
|
57122
|
+
}
|
|
57123
|
+
if (attributeName === "node" && inConnection) {
|
|
57124
|
+
continueConnection = false;
|
|
57017
57125
|
}
|
|
57018
57126
|
if (field.selectionSet) {
|
|
57019
|
-
const
|
|
57127
|
+
const connectionState = paginated && document.refetch?.method === "cursor" || continueConnection;
|
|
57020
57128
|
fieldObj.selection = selection({
|
|
57021
57129
|
config: config2,
|
|
57022
57130
|
filepath,
|
|
@@ -57026,7 +57134,7 @@ function selection({
|
|
|
57026
57134
|
path: pathSoFar,
|
|
57027
57135
|
includeFragments,
|
|
57028
57136
|
document,
|
|
57029
|
-
|
|
57137
|
+
inConnection: connectionState
|
|
57030
57138
|
});
|
|
57031
57139
|
}
|
|
57032
57140
|
if (field.arguments?.length && fieldObj.list) {
|
|
@@ -57144,19 +57252,20 @@ function artifactGenerator(stats) {
|
|
|
57144
57252
|
});
|
|
57145
57253
|
}
|
|
57146
57254
|
const listOfArtifacts = [];
|
|
57255
|
+
const hash = config2.plugins?.find((plugin2) => plugin2.hash)?.hash ?? hashDocument;
|
|
57147
57256
|
await Promise.all(
|
|
57148
57257
|
[
|
|
57149
57258
|
writeIndexFile(config2, docs)
|
|
57150
57259
|
].concat(
|
|
57151
57260
|
docs.map(async (doc) => {
|
|
57152
|
-
const { document, name
|
|
57261
|
+
const { document, name, generateArtifact } = doc;
|
|
57153
57262
|
if (!generateArtifact) {
|
|
57154
57263
|
return;
|
|
57155
57264
|
}
|
|
57156
57265
|
const usedVariableNames = /* @__PURE__ */ new Set();
|
|
57157
57266
|
let documentWithoutInternalDirectives = graphql12.visit(document, {
|
|
57158
57267
|
Directive(node) {
|
|
57159
|
-
if (config2.isInternalDirective(node)) {
|
|
57268
|
+
if (config2.isInternalDirective(node.name.value)) {
|
|
57160
57269
|
return null;
|
|
57161
57270
|
}
|
|
57162
57271
|
},
|
|
@@ -57171,8 +57280,8 @@ function artifactGenerator(stats) {
|
|
|
57171
57280
|
documentWithoutInternalDirectives,
|
|
57172
57281
|
{
|
|
57173
57282
|
VariableDefinition(variableDefinitionNode) {
|
|
57174
|
-
const
|
|
57175
|
-
if (!usedVariableNames.has(
|
|
57283
|
+
const name2 = variableDefinitionNode.variable.name.value;
|
|
57284
|
+
if (!usedVariableNames.has(name2)) {
|
|
57176
57285
|
return null;
|
|
57177
57286
|
}
|
|
57178
57287
|
}
|
|
@@ -57206,12 +57315,12 @@ function artifactGenerator(stats) {
|
|
|
57206
57315
|
selectionSet = operation.selectionSet;
|
|
57207
57316
|
} else {
|
|
57208
57317
|
const matchingFragment = fragments.find(
|
|
57209
|
-
(fragment) => fragment.name.value ===
|
|
57318
|
+
(fragment) => fragment.name.value === name
|
|
57210
57319
|
);
|
|
57211
57320
|
if (!matchingFragment) {
|
|
57212
57321
|
throw new HoudiniError({
|
|
57213
57322
|
filepath: doc.filename,
|
|
57214
|
-
message: `Fragment "${
|
|
57323
|
+
message: `Fragment "${name}" doesn't exist in its own document?!`
|
|
57215
57324
|
});
|
|
57216
57325
|
}
|
|
57217
57326
|
rootType = matchingFragment.typeCondition.name.value;
|
|
@@ -57240,10 +57349,10 @@ function artifactGenerator(stats) {
|
|
|
57240
57349
|
ignoreMaskDisable: docKind === "HoudiniQuery",
|
|
57241
57350
|
applyFragments: docKind !== "HoudiniFragment"
|
|
57242
57351
|
});
|
|
57243
|
-
|
|
57244
|
-
name
|
|
57352
|
+
let artifact = {
|
|
57353
|
+
name,
|
|
57245
57354
|
kind: docKind,
|
|
57246
|
-
hash:
|
|
57355
|
+
hash: hash({ config: config2, document: doc }),
|
|
57247
57356
|
refetch: doc.refetch,
|
|
57248
57357
|
raw: rawString,
|
|
57249
57358
|
rootType,
|
|
@@ -57262,27 +57371,27 @@ function artifactGenerator(stats) {
|
|
|
57262
57371
|
document: doc
|
|
57263
57372
|
})
|
|
57264
57373
|
};
|
|
57265
|
-
const
|
|
57266
|
-
(prev,
|
|
57267
|
-
if (!
|
|
57374
|
+
const plugin_data = config2.plugins.reduce(
|
|
57375
|
+
(prev, plugin2) => {
|
|
57376
|
+
if (!plugin2.artifact_data) {
|
|
57268
57377
|
return prev;
|
|
57269
57378
|
}
|
|
57270
57379
|
const result = { ...prev };
|
|
57271
|
-
const dataToAdd =
|
|
57380
|
+
const dataToAdd = plugin2.artifact_data({ config: config2, document: doc }) ?? {};
|
|
57272
57381
|
if (Object.keys(dataToAdd).length > 0) {
|
|
57273
|
-
result[
|
|
57382
|
+
result[plugin2.name] = dataToAdd;
|
|
57274
57383
|
}
|
|
57275
57384
|
return result;
|
|
57276
57385
|
},
|
|
57277
57386
|
{}
|
|
57278
57387
|
);
|
|
57279
|
-
if (Object.keys(
|
|
57280
|
-
artifact.
|
|
57388
|
+
if (Object.keys(plugin_data).length > 0) {
|
|
57389
|
+
artifact.plugin_data = plugin_data;
|
|
57281
57390
|
}
|
|
57282
57391
|
if (inputs && inputs.length > 0) {
|
|
57283
57392
|
artifact.input = inputObject(config2, inputs);
|
|
57284
57393
|
}
|
|
57285
|
-
if (
|
|
57394
|
+
if (artifact.kind === "HoudiniQuery") {
|
|
57286
57395
|
const cacheDirective = operations[0].directives?.find(
|
|
57287
57396
|
(directive2) => directive2.name.value === config2.cacheDirective
|
|
57288
57397
|
);
|
|
@@ -57295,7 +57404,7 @@ function artifactGenerator(stats) {
|
|
|
57295
57404
|
{}
|
|
57296
57405
|
) || {};
|
|
57297
57406
|
const policy = args[config2.cachePolicyArg];
|
|
57298
|
-
if (policy && policy.value.kind === "EnumValue") {
|
|
57407
|
+
if (policy && policy.value.kind === "EnumValue" && policy.value.value) {
|
|
57299
57408
|
artifact.policy = policy.value.value;
|
|
57300
57409
|
} else {
|
|
57301
57410
|
artifact.policy = config2.defaultCachePolicy;
|
|
@@ -57311,10 +57420,17 @@ function artifactGenerator(stats) {
|
|
|
57311
57420
|
artifact.partial = config2.defaultPartial;
|
|
57312
57421
|
}
|
|
57313
57422
|
}
|
|
57423
|
+
doc.artifact = artifact;
|
|
57424
|
+
for (const plugin2 of config2.plugins) {
|
|
57425
|
+
if (!plugin2.artifact_end) {
|
|
57426
|
+
continue;
|
|
57427
|
+
}
|
|
57428
|
+
plugin2.artifact_end({ config: config2, document: doc });
|
|
57429
|
+
}
|
|
57314
57430
|
const file = AST5.program([
|
|
57315
57431
|
moduleExport(config2, "default", serializeValue(artifact)),
|
|
57316
57432
|
AST5.expressionStatement(
|
|
57317
|
-
AST5.stringLiteral(`HoudiniHash=${
|
|
57433
|
+
AST5.stringLiteral(`HoudiniHash=${hash({ config: config2, document: doc })}`)
|
|
57318
57434
|
)
|
|
57319
57435
|
]);
|
|
57320
57436
|
const artifactPath = config2.artifactPath(document);
|
|
@@ -57331,7 +57447,7 @@ function artifactGenerator(stats) {
|
|
|
57331
57447
|
return;
|
|
57332
57448
|
}
|
|
57333
57449
|
const match = existingArtifact && existingArtifact.match(/"HoudiniHash=(\w+)"/);
|
|
57334
|
-
if (match && match[1] !==
|
|
57450
|
+
if (match && match[1] !== hash({ config: config2, document: doc })) {
|
|
57335
57451
|
stats.changed.push(artifact.name);
|
|
57336
57452
|
}
|
|
57337
57453
|
stats.total.push(artifact.name);
|
|
@@ -57350,7 +57466,7 @@ async function generateGraphqlReturnTypes(config2, docs) {
|
|
|
57350
57466
|
const fileContent = await fs_exports.readFile(indexPath) || "";
|
|
57351
57467
|
const contents = await parseJS(fileContent);
|
|
57352
57468
|
const graphql_tag_return = config2.plugins.find(
|
|
57353
|
-
(
|
|
57469
|
+
(plugin2) => plugin2.graphql_tag_return
|
|
57354
57470
|
)?.graphql_tag_return;
|
|
57355
57471
|
if (!graphql_tag_return || !contents) {
|
|
57356
57472
|
return fileContent;
|
|
@@ -57359,7 +57475,7 @@ async function generateGraphqlReturnTypes(config2, docs) {
|
|
|
57359
57475
|
for (const doc of docs) {
|
|
57360
57476
|
const return_value = graphql_tag_return({
|
|
57361
57477
|
config: config2,
|
|
57362
|
-
doc,
|
|
57478
|
+
document: doc,
|
|
57363
57479
|
ensure_import({ identifier, module: module2 }) {
|
|
57364
57480
|
ensureImports({
|
|
57365
57481
|
config: config2,
|
|
@@ -57408,19 +57524,19 @@ async function injectPlugins({
|
|
|
57408
57524
|
importStatement,
|
|
57409
57525
|
exportStatement
|
|
57410
57526
|
}) {
|
|
57411
|
-
const client_plugins = config2.plugins.filter((
|
|
57412
|
-
let plugins =
|
|
57527
|
+
const client_plugins = config2.plugins.filter((plugin2) => plugin2.client_plugins).reduce((acc, plugin2) => {
|
|
57528
|
+
let plugins = plugin2.client_plugins;
|
|
57413
57529
|
if (typeof plugins === "function") {
|
|
57414
|
-
plugins = plugins(config2, config2.pluginConfig(
|
|
57530
|
+
plugins = plugins(config2, config2.pluginConfig(plugin2.name));
|
|
57415
57531
|
}
|
|
57416
57532
|
return [...acc, ...Object.entries(plugins)];
|
|
57417
57533
|
}, []);
|
|
57418
57534
|
return client_plugins.length > 0 ? `
|
|
57419
|
-
${client_plugins.map((
|
|
57535
|
+
${client_plugins.map((plugin2, i) => importStatement(plugin2[0], `plugin${i}`))}
|
|
57420
57536
|
|
|
57421
57537
|
const plugins = [
|
|
57422
|
-
${client_plugins.map((
|
|
57423
|
-
const suffix =
|
|
57538
|
+
${client_plugins.map((plugin2, i) => {
|
|
57539
|
+
const suffix = `(${JSON.stringify(plugin2[1])})`;
|
|
57424
57540
|
return `plugin${i}${suffix}`;
|
|
57425
57541
|
}).join(",\n")}
|
|
57426
57542
|
]
|
|
@@ -57463,37 +57579,35 @@ ${exportStatement("config")}
|
|
|
57463
57579
|
},
|
|
57464
57580
|
[path_exports.join(config2.runtimeSource, "client", "plugins", "injectedPlugins.js")]: (content) => injectPlugins({ config: config2, content, importStatement, exportStatement })
|
|
57465
57581
|
}),
|
|
57466
|
-
...config2.plugins.filter((
|
|
57582
|
+
...config2.plugins.filter((plugin2) => plugin2.include_runtime).map((plugin2) => generatePluginRuntime(config2, plugin2)),
|
|
57467
57583
|
generatePluginIndex({ config: config2, exportStatement: exportStar })
|
|
57468
57584
|
]);
|
|
57469
57585
|
await generateGraphqlReturnTypes(config2, docs);
|
|
57470
57586
|
}
|
|
57471
|
-
async function generatePluginRuntime(config2,
|
|
57472
|
-
if (houdini_mode.is_testing) {
|
|
57587
|
+
async function generatePluginRuntime(config2, plugin2) {
|
|
57588
|
+
if (houdini_mode.is_testing || !plugin2.include_runtime) {
|
|
57473
57589
|
return;
|
|
57474
57590
|
}
|
|
57475
|
-
const
|
|
57476
|
-
|
|
57477
|
-
"
|
|
57478
|
-
"runtime-" + (config2.module === "esm" ? "esm" : "cjs")
|
|
57591
|
+
const runtime_path = path_exports.join(
|
|
57592
|
+
path_exports.dirname(plugin2.filepath),
|
|
57593
|
+
typeof plugin2.include_runtime === "string" ? plugin2.include_runtime : plugin2.include_runtime[config2.module]
|
|
57479
57594
|
);
|
|
57480
57595
|
try {
|
|
57481
|
-
await fs_exports.stat(
|
|
57596
|
+
await fs_exports.stat(runtime_path);
|
|
57482
57597
|
} catch {
|
|
57483
57598
|
throw new HoudiniError({
|
|
57484
|
-
message:
|
|
57485
|
-
description: "
|
|
57599
|
+
message: "Cannot find runtime to generate for " + plugin2.name,
|
|
57600
|
+
description: "Maybe it was bundled?"
|
|
57486
57601
|
});
|
|
57487
57602
|
}
|
|
57488
|
-
const
|
|
57489
|
-
const pluginDir = config2.pluginRuntimeDirectory(plugin.name);
|
|
57603
|
+
const pluginDir = config2.pluginRuntimeDirectory(plugin2.name);
|
|
57490
57604
|
await fs_exports.mkdirp(pluginDir);
|
|
57491
57605
|
await fs_exports.recursiveCopy(
|
|
57492
|
-
|
|
57606
|
+
runtime_path,
|
|
57493
57607
|
pluginDir,
|
|
57494
57608
|
Object.fromEntries(
|
|
57495
|
-
Object.entries(
|
|
57496
|
-
path_exports.join(
|
|
57609
|
+
Object.entries(plugin2.transform_runtime ?? {}).map(([key, value]) => [
|
|
57610
|
+
path_exports.join(runtime_path, key),
|
|
57497
57611
|
(content) => value({ config: config2, content })
|
|
57498
57612
|
])
|
|
57499
57613
|
)
|
|
@@ -57894,7 +58008,7 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
57894
58008
|
}
|
|
57895
58009
|
const missingScalars = /* @__PURE__ */ new Set();
|
|
57896
58010
|
await Promise.all(
|
|
57897
|
-
docs.map(async ({ originalDocument, name
|
|
58011
|
+
docs.map(async ({ originalDocument, name, filename, generateArtifact }) => {
|
|
57898
58012
|
if (!generateArtifact) {
|
|
57899
58013
|
return;
|
|
57900
58014
|
}
|
|
@@ -57902,7 +58016,7 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
57902
58016
|
const program = AST11.program([]);
|
|
57903
58017
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
57904
58018
|
let definition = originalDocument.definitions.find(
|
|
57905
|
-
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value ===
|
|
58019
|
+
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value === name
|
|
57906
58020
|
);
|
|
57907
58021
|
const selections = flattenSelections({
|
|
57908
58022
|
config: config2,
|
|
@@ -57956,22 +58070,22 @@ export { default as ${as} } from "${module2}"
|
|
|
57956
58070
|
export * from "${module2}"
|
|
57957
58071
|
`;
|
|
57958
58072
|
let indexContent = recast11.print(typeIndex).code;
|
|
57959
|
-
for (const
|
|
57960
|
-
if (!
|
|
58073
|
+
for (const plugin2 of config2.plugins) {
|
|
58074
|
+
if (!plugin2.index_file) {
|
|
57961
58075
|
continue;
|
|
57962
58076
|
}
|
|
57963
|
-
indexContent =
|
|
58077
|
+
indexContent = plugin2.index_file({
|
|
57964
58078
|
config: config2,
|
|
57965
58079
|
content: indexContent,
|
|
57966
58080
|
export_default_as,
|
|
57967
58081
|
export_star_from,
|
|
57968
|
-
plugin_root: config2.pluginDirectory(
|
|
58082
|
+
plugin_root: config2.pluginDirectory(plugin2.name),
|
|
57969
58083
|
typedef: true,
|
|
57970
58084
|
documents: docs
|
|
57971
58085
|
});
|
|
57972
|
-
if (
|
|
58086
|
+
if (plugin2.include_runtime) {
|
|
57973
58087
|
indexContent += export_star_from({
|
|
57974
|
-
module: "./" + path_exports.relative(config2.rootDir, config2.pluginRuntimeDirectory(
|
|
58088
|
+
module: "./" + path_exports.relative(config2.rootDir, config2.pluginRuntimeDirectory(plugin2.name))
|
|
57975
58089
|
});
|
|
57976
58090
|
}
|
|
57977
58091
|
}
|
|
@@ -58217,9 +58331,9 @@ var graphql17 = __toESM(require_graphql2(), 1);
|
|
|
58217
58331
|
var recast12 = __toESM(require_main2(), 1);
|
|
58218
58332
|
var AST12 = recast12.types.builders;
|
|
58219
58333
|
async function imperativeCacheTypef(config2, docs) {
|
|
58220
|
-
const returnType = (doc) => config2.plugins.find((
|
|
58334
|
+
const returnType = (doc) => config2.plugins.find((plugin2) => plugin2.graphql_tag_return)?.graphql_tag_return?.({
|
|
58221
58335
|
config: config2,
|
|
58222
|
-
doc,
|
|
58336
|
+
document: doc,
|
|
58223
58337
|
ensure_import({ identifier, module: module2 }) {
|
|
58224
58338
|
ensureImports({
|
|
58225
58339
|
config: config2,
|
|
@@ -58564,12 +58678,12 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
58564
58678
|
}, {});
|
|
58565
58679
|
}
|
|
58566
58680
|
var CacheTypeDefName = "CacheTypeDef";
|
|
58567
|
-
function record(
|
|
58681
|
+
function record(name) {
|
|
58568
58682
|
return AST12.tsTypeReference(
|
|
58569
58683
|
AST12.identifier("Record"),
|
|
58570
58684
|
AST12.tsTypeParameterInstantiation([
|
|
58571
58685
|
AST12.tsTypeReference(AST12.identifier(CacheTypeDefName)),
|
|
58572
|
-
AST12.tsLiteralType(AST12.stringLiteral(
|
|
58686
|
+
AST12.tsLiteralType(AST12.stringLiteral(name))
|
|
58573
58687
|
])
|
|
58574
58688
|
);
|
|
58575
58689
|
}
|
|
@@ -58598,7 +58712,7 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
58598
58712
|
let rawString = graphql18.print(
|
|
58599
58713
|
graphql18.visit(document, {
|
|
58600
58714
|
Directive(node) {
|
|
58601
|
-
if (config2.isInternalDirective(node)) {
|
|
58715
|
+
if (config2.isInternalDirective(node.name.value)) {
|
|
58602
58716
|
return null;
|
|
58603
58717
|
}
|
|
58604
58718
|
}
|
|
@@ -58608,7 +58722,7 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
58608
58722
|
({ kind }) => kind === graphql18.Kind.OPERATION_DEFINITION
|
|
58609
58723
|
);
|
|
58610
58724
|
if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
|
|
58611
|
-
acc[hashDocument(rawString)] = rawString;
|
|
58725
|
+
acc[hashDocument({ config: config2, document: rawString })] = rawString;
|
|
58612
58726
|
}
|
|
58613
58727
|
return acc;
|
|
58614
58728
|
}, {});
|
|
@@ -58628,10 +58742,10 @@ async function definitionsGenerator(config2) {
|
|
|
58628
58742
|
const runtimeDefinitions = recast13.print(
|
|
58629
58743
|
AST13.program(
|
|
58630
58744
|
enums.map((defn) => {
|
|
58631
|
-
const
|
|
58745
|
+
const name = defn.name.value;
|
|
58632
58746
|
return moduleExport(
|
|
58633
58747
|
config2,
|
|
58634
|
-
|
|
58748
|
+
name,
|
|
58635
58749
|
AST13.objectExpression(
|
|
58636
58750
|
defn.values?.map((value) => {
|
|
58637
58751
|
const str = value.name.value;
|
|
@@ -58688,24 +58802,24 @@ async function writeIndexFile2(config2, docs) {
|
|
|
58688
58802
|
export_star_from({ module: artifactDir }),
|
|
58689
58803
|
export_star_from({ module: definitionsDir })
|
|
58690
58804
|
].join("");
|
|
58691
|
-
for (const
|
|
58692
|
-
if (
|
|
58693
|
-
body =
|
|
58805
|
+
for (const plugin2 of config2.plugins) {
|
|
58806
|
+
if (plugin2.index_file) {
|
|
58807
|
+
body = plugin2.index_file({
|
|
58694
58808
|
config: config2,
|
|
58695
58809
|
content: body,
|
|
58696
58810
|
export_default_as,
|
|
58697
58811
|
export_star_from,
|
|
58698
|
-
plugin_root: config2.pluginDirectory(
|
|
58812
|
+
plugin_root: config2.pluginDirectory(plugin2.name),
|
|
58699
58813
|
typedef: false,
|
|
58700
58814
|
documents: docs
|
|
58701
58815
|
});
|
|
58702
58816
|
}
|
|
58703
|
-
if (
|
|
58817
|
+
if (plugin2.include_runtime) {
|
|
58704
58818
|
body += export_star_from({
|
|
58705
|
-
module: relative2(config2.pluginRuntimeDirectory(
|
|
58819
|
+
module: relative2(config2.pluginRuntimeDirectory(plugin2.name))
|
|
58706
58820
|
});
|
|
58707
58821
|
}
|
|
58708
|
-
if (!
|
|
58822
|
+
if (!plugin2.index_file) {
|
|
58709
58823
|
continue;
|
|
58710
58824
|
}
|
|
58711
58825
|
}
|
|
@@ -58715,7 +58829,7 @@ async function writeIndexFile2(config2, docs) {
|
|
|
58715
58829
|
// src/codegen/transforms/schema.ts
|
|
58716
58830
|
var graphql20 = __toESM(require_graphql2(), 1);
|
|
58717
58831
|
async function graphqlExtensions(config2, documents) {
|
|
58718
|
-
|
|
58832
|
+
let internalSchema = `
|
|
58719
58833
|
enum CachePolicy {
|
|
58720
58834
|
${"CacheAndNetwork" /* CacheAndNetwork */}
|
|
58721
58835
|
${"CacheOnly" /* CacheOnly */}
|
|
@@ -58756,6 +58870,7 @@ directive @${config2.listAllListsDirective} on FRAGMENT_SPREAD
|
|
|
58756
58870
|
"""
|
|
58757
58871
|
directive @${config2.listParentDirective}(value: ID!) on FRAGMENT_SPREAD
|
|
58758
58872
|
|
|
58873
|
+
|
|
58759
58874
|
"""
|
|
58760
58875
|
@${config2.whenDirective} is used to provide a conditional or in situations where it doesn't make sense (eg when removing or deleting a node.)
|
|
58761
58876
|
"""
|
|
@@ -58771,6 +58886,11 @@ directive @${config2.whenNotDirective} on FRAGMENT_SPREAD
|
|
|
58771
58886
|
"""
|
|
58772
58887
|
directive @${config2.argumentsDirective} on FRAGMENT_DEFINITION
|
|
58773
58888
|
|
|
58889
|
+
"""
|
|
58890
|
+
@${config2.withDirective} is used to provide arguments to fragments that have been marked with @${config2.argumentsDirective}
|
|
58891
|
+
"""
|
|
58892
|
+
directive @${config2.withDirective} on FRAGMENT_SPREAD
|
|
58893
|
+
|
|
58774
58894
|
"""
|
|
58775
58895
|
@${config2.cacheDirective} is used to specify cache rules for a query
|
|
58776
58896
|
"""
|
|
@@ -58791,6 +58911,12 @@ directive @${config2.maskEnableDirective} on FRAGMENT_SPREAD
|
|
|
58791
58911
|
"""
|
|
58792
58912
|
directive @${config2.maskDisableDirective} on FRAGMENT_SPREAD
|
|
58793
58913
|
`;
|
|
58914
|
+
for (const plugin2 of config2.plugins) {
|
|
58915
|
+
if (!plugin2.schema) {
|
|
58916
|
+
continue;
|
|
58917
|
+
}
|
|
58918
|
+
internalSchema += plugin2.schema({ config: config2 });
|
|
58919
|
+
}
|
|
58794
58920
|
let currentSchema = graphql20.printSchema(config2.schema);
|
|
58795
58921
|
if (!currentSchema.includes(`directive @${config2.listDirective}`)) {
|
|
58796
58922
|
currentSchema += internalSchema;
|
|
@@ -58973,7 +59099,7 @@ async function typeCheck(config2, docs) {
|
|
|
58973
59099
|
}
|
|
58974
59100
|
needsParent = needsParent || definition.kind === "FragmentDefinition";
|
|
58975
59101
|
const nameArg = directive.arguments?.find(
|
|
58976
|
-
({ name
|
|
59102
|
+
({ name }) => name.value === config2.listNameArg
|
|
58977
59103
|
);
|
|
58978
59104
|
if (!nameArg) {
|
|
58979
59105
|
if (directive.name.value === config2.listDirective) {
|
|
@@ -59143,14 +59269,14 @@ var validateLists = ({
|
|
|
59143
59269
|
return;
|
|
59144
59270
|
}
|
|
59145
59271
|
let directive = node.directives?.find(
|
|
59146
|
-
({ name
|
|
59272
|
+
({ name }) => name.value === config2.listParentDirective
|
|
59147
59273
|
);
|
|
59148
59274
|
if (directive) {
|
|
59149
59275
|
return;
|
|
59150
59276
|
}
|
|
59151
59277
|
let parentIdFound = false;
|
|
59152
|
-
directive = node.directives?.find(({ name
|
|
59153
|
-
[config2.listPrependDirective, config2.listAppendDirective].includes(
|
|
59278
|
+
directive = node.directives?.find(({ name }) => [
|
|
59279
|
+
[config2.listPrependDirective, config2.listAppendDirective].includes(name.value)
|
|
59154
59280
|
]);
|
|
59155
59281
|
if (directive) {
|
|
59156
59282
|
let parentArg = directive.arguments?.find(
|
|
@@ -59168,7 +59294,7 @@ var validateLists = ({
|
|
|
59168
59294
|
return;
|
|
59169
59295
|
}
|
|
59170
59296
|
const allLists = node.directives?.find(
|
|
59171
|
-
({ name
|
|
59297
|
+
({ name }) => config2.listAllListsDirective === name.value
|
|
59172
59298
|
);
|
|
59173
59299
|
if (allLists || config2.defaultListTarget === "all") {
|
|
59174
59300
|
return;
|
|
@@ -59190,7 +59316,7 @@ var validateLists = ({
|
|
|
59190
59316
|
);
|
|
59191
59317
|
return;
|
|
59192
59318
|
}
|
|
59193
|
-
if (!config2.isInternalDirective(node)) {
|
|
59319
|
+
if (!config2.isInternalDirective(node.name.value)) {
|
|
59194
59320
|
if (!config2.schema.getDirective(directiveName)) {
|
|
59195
59321
|
ctx.reportError(
|
|
59196
59322
|
new graphql23.GraphQLError(
|
|
@@ -59333,9 +59459,9 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
59333
59459
|
);
|
|
59334
59460
|
} else {
|
|
59335
59461
|
const zipped = appliedArgumentNames.map(
|
|
59336
|
-
(
|
|
59337
|
-
appliedArguments[
|
|
59338
|
-
fragmentArguments2[fragmentName].find((arg) => arg.name ===
|
|
59462
|
+
(name) => [
|
|
59463
|
+
appliedArguments[name],
|
|
59464
|
+
fragmentArguments2[fragmentName].find((arg) => arg.name === name).type
|
|
59339
59465
|
]
|
|
59340
59466
|
);
|
|
59341
59467
|
for (const [applied, target] of zipped) {
|
|
@@ -59661,9 +59787,9 @@ For more information, please visit these links:
|
|
|
59661
59787
|
// src/codegen/validators/uniqueNames.ts
|
|
59662
59788
|
async function uniqueDocumentNames(config2, docs) {
|
|
59663
59789
|
const nameMap = docs.reduce(
|
|
59664
|
-
(acc, { name
|
|
59790
|
+
(acc, { name, filename }) => ({
|
|
59665
59791
|
...acc,
|
|
59666
|
-
[
|
|
59792
|
+
[name]: [...acc[name] || [], filename]
|
|
59667
59793
|
}),
|
|
59668
59794
|
{}
|
|
59669
59795
|
);
|
|
@@ -59710,12 +59836,12 @@ async function noIDAlias(config2, docs) {
|
|
|
59710
59836
|
// src/codegen/validators/plugins.ts
|
|
59711
59837
|
async function validatePlugins(config2, documents) {
|
|
59712
59838
|
let errors = [];
|
|
59713
|
-
for (const
|
|
59714
|
-
if (!
|
|
59839
|
+
for (const plugin2 of config2.plugins) {
|
|
59840
|
+
if (!plugin2.validate) {
|
|
59715
59841
|
continue;
|
|
59716
59842
|
}
|
|
59717
59843
|
try {
|
|
59718
|
-
await
|
|
59844
|
+
await plugin2.validate({ config: config2, documents });
|
|
59719
59845
|
} catch (err) {
|
|
59720
59846
|
errors.push(err);
|
|
59721
59847
|
}
|
|
@@ -59736,40 +59862,55 @@ async function runPipeline2(config2, docs) {
|
|
|
59736
59862
|
new: [],
|
|
59737
59863
|
deleted: []
|
|
59738
59864
|
};
|
|
59739
|
-
const generatePlugins = config2.plugins.filter((
|
|
59865
|
+
const generatePlugins = config2.plugins.filter((plugin2) => plugin2.generate);
|
|
59866
|
+
const after_validate = config2.plugins.filter((plugin2) => plugin2.after_validate).map((plugin2) => plugin2.after_validate);
|
|
59867
|
+
const validate2 = config2.plugins.filter((plugin2) => plugin2.validate).map((plugin2) => plugin2.validate);
|
|
59868
|
+
const before_validate = config2.plugins.filter((plugin2) => plugin2.before_validate).map((plugin2) => plugin2.before_validate);
|
|
59869
|
+
const transform_before_generate = config2.plugins.filter((plugin2) => plugin2.transform_before_generate).map((plugin2) => plugin2.transform_before_generate);
|
|
59870
|
+
const wrapHook = (hooks) => hooks.map(
|
|
59871
|
+
(fn) => (config3, docs2) => fn({
|
|
59872
|
+
config: config3,
|
|
59873
|
+
documents: docs2
|
|
59874
|
+
})
|
|
59875
|
+
);
|
|
59740
59876
|
let error = null;
|
|
59741
59877
|
try {
|
|
59742
59878
|
await runPipeline(
|
|
59743
59879
|
config2,
|
|
59744
59880
|
[
|
|
59881
|
+
graphqlExtensions,
|
|
59882
|
+
...wrapHook(before_validate),
|
|
59745
59883
|
typeCheck,
|
|
59746
59884
|
uniqueDocumentNames,
|
|
59747
59885
|
noIDAlias,
|
|
59748
59886
|
validatePlugins,
|
|
59749
|
-
|
|
59887
|
+
...wrapHook(validate2),
|
|
59888
|
+
...wrapHook(after_validate),
|
|
59750
59889
|
addID,
|
|
59751
59890
|
addTypename,
|
|
59752
59891
|
addListFragments,
|
|
59753
59892
|
paginate,
|
|
59754
59893
|
fragmentVariables,
|
|
59755
59894
|
includeFragmentDefinitions,
|
|
59895
|
+
...wrapHook(transform_before_generate),
|
|
59896
|
+
artifactGenerator(artifactStats),
|
|
59756
59897
|
runtimeGenerator,
|
|
59757
59898
|
writeIndexFile2,
|
|
59758
|
-
artifactGenerator(artifactStats),
|
|
59759
59899
|
typescriptGenerator,
|
|
59760
59900
|
persistOutputGenerator,
|
|
59761
59901
|
schemaGenerator,
|
|
59762
59902
|
...generatePlugins.map(
|
|
59763
|
-
(
|
|
59903
|
+
(plugin2) => async (config3, docs2) => await plugin2.generate({
|
|
59764
59904
|
config: config3,
|
|
59765
59905
|
documents: docs2,
|
|
59766
|
-
plugin_root: config3.pluginDirectory(
|
|
59906
|
+
plugin_root: config3.pluginDirectory(plugin2.name)
|
|
59767
59907
|
})
|
|
59768
59908
|
)
|
|
59769
59909
|
],
|
|
59770
59910
|
docs
|
|
59771
59911
|
);
|
|
59772
59912
|
} catch (e) {
|
|
59913
|
+
console.log(e);
|
|
59773
59914
|
error = e;
|
|
59774
59915
|
}
|
|
59775
59916
|
const unchanged = artifactStats.total.length - artifactStats.changed.length - artifactStats.new.length - artifactStats.deleted.length;
|
|
@@ -59809,37 +59950,37 @@ async function runPipeline2(config2, docs) {
|
|
|
59809
59950
|
}
|
|
59810
59951
|
}
|
|
59811
59952
|
}
|
|
59812
|
-
function logStyled(kind, stat2, logLevel,
|
|
59953
|
+
function logStyled(kind, stat2, logLevel, plugin2) {
|
|
59813
59954
|
if (stat2.length > 0) {
|
|
59814
59955
|
const msg = [];
|
|
59815
|
-
if (
|
|
59956
|
+
if (plugin2) {
|
|
59816
59957
|
msg.push(`\u{1F3A9} `);
|
|
59817
59958
|
}
|
|
59818
59959
|
if (kind === "CREATED") {
|
|
59819
59960
|
msg.push(`\u2728 `);
|
|
59820
|
-
if (!
|
|
59961
|
+
if (!plugin2) {
|
|
59821
59962
|
msg.push(`New: ${stat2.length}`);
|
|
59822
59963
|
}
|
|
59823
59964
|
} else if (kind === "UPDATED") {
|
|
59824
59965
|
msg.push(`\u270F\uFE0F `);
|
|
59825
|
-
if (!
|
|
59966
|
+
if (!plugin2) {
|
|
59826
59967
|
msg.push(`Changed: ${stat2.length}`);
|
|
59827
59968
|
}
|
|
59828
59969
|
} else if (kind === "DELETED") {
|
|
59829
59970
|
msg.push(`\u{1F9F9} `);
|
|
59830
|
-
if (!
|
|
59971
|
+
if (!plugin2) {
|
|
59831
59972
|
msg.push(`Deleted: ${stat2.length}`);
|
|
59832
59973
|
}
|
|
59833
59974
|
}
|
|
59834
59975
|
const nbToDisplay = 5;
|
|
59835
|
-
if (
|
|
59976
|
+
if (plugin2) {
|
|
59836
59977
|
msg.push(`${stat2.slice(0, nbToDisplay).join(", ")}`);
|
|
59837
59978
|
if (stat2.length > 5) {
|
|
59838
59979
|
msg.push(`, ... ${stat2.length - nbToDisplay} more`);
|
|
59839
59980
|
}
|
|
59840
59981
|
}
|
|
59841
59982
|
console.log(msg.join(""));
|
|
59842
|
-
if (!
|
|
59983
|
+
if (!plugin2 && logLevel === "summary" /* Summary */) {
|
|
59843
59984
|
for (const artifact of stat2.slice(0, nbToDisplay)) {
|
|
59844
59985
|
console.log(` ${artifact}`);
|
|
59845
59986
|
}
|
|
@@ -60120,7 +60261,7 @@ function pipelineTest(config2, documents, shouldPass, testBody) {
|
|
|
60120
60261
|
}
|
|
60121
60262
|
function mockCollectedDoc(query) {
|
|
60122
60263
|
const parsed = graphql25.parse(query);
|
|
60123
|
-
const
|
|
60264
|
+
const name = parsed.definitions[0].name.value;
|
|
60124
60265
|
const operations = parsed.definitions;
|
|
60125
60266
|
let kind = "HoudiniFragment" /* Fragment */;
|
|
60126
60267
|
if (operations.length === 1) {
|
|
@@ -60133,14 +60274,15 @@ function mockCollectedDoc(query) {
|
|
|
60133
60274
|
}
|
|
60134
60275
|
}
|
|
60135
60276
|
return {
|
|
60136
|
-
name
|
|
60277
|
+
name,
|
|
60137
60278
|
kind,
|
|
60138
60279
|
document: parsed,
|
|
60139
60280
|
originalDocument: parsed,
|
|
60140
|
-
filename: `${
|
|
60281
|
+
filename: `${name}.ts`,
|
|
60141
60282
|
generateArtifact: true,
|
|
60142
60283
|
generateStore: true,
|
|
60143
|
-
originalString: query
|
|
60284
|
+
originalString: query,
|
|
60285
|
+
artifact: null
|
|
60144
60286
|
};
|
|
60145
60287
|
}
|
|
60146
60288
|
function clearMock() {
|