houdini 1.0.0-next.4 → 1.0.0-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cmd-cjs/index.js +1217 -1021
- package/build/cmd-esm/index.js +1217 -1021
- package/build/codegen/generators/artifacts/utils.d.ts +0 -1
- package/build/codegen-cjs/index.js +810 -676
- package/build/codegen-esm/index.js +810 -676
- package/build/lib/config.d.ts +10 -90
- package/build/lib/deepMerge.d.ts +1 -0
- package/build/lib/graphql.d.ts +5 -2
- package/build/lib/index.d.ts +2 -0
- package/build/lib/pipeline.d.ts +1 -1
- package/build/lib/plugin.d.ts +2 -0
- package/build/lib/types.d.ts +250 -2
- package/build/lib-cjs/index.js +351 -162
- package/build/lib-esm/index.js +349 -162
- package/build/runtime/cache/cache.d.ts +20 -3
- package/build/runtime/cache/staleManager.d.ts +30 -0
- package/build/runtime/cache/subscription.d.ts +2 -1
- package/build/runtime/client/plugins/subscription.d.ts +1 -2
- package/build/runtime/lib/config.d.ts +4 -0
- package/build/runtime/lib/index.d.ts +1 -0
- package/build/runtime/lib/key.d.ts +6 -0
- package/build/runtime/lib/types.d.ts +2 -2
- package/build/runtime/public/cache.d.ts +8 -1
- package/build/runtime/public/record.d.ts +11 -1
- package/build/runtime/public/tests/test.d.ts +9 -10
- package/build/runtime-cjs/cache/cache.d.ts +20 -3
- package/build/runtime-cjs/cache/cache.js +65 -6
- package/build/runtime-cjs/cache/gc.js +9 -0
- package/build/runtime-cjs/cache/staleManager.d.ts +30 -0
- package/build/runtime-cjs/cache/staleManager.js +95 -0
- package/build/runtime-cjs/cache/subscription.d.ts +2 -1
- package/build/runtime-cjs/cache/subscription.js +6 -3
- package/build/runtime-cjs/client/documentStore.js +1 -0
- package/build/runtime-cjs/client/plugins/cache.js +5 -3
- package/build/runtime-cjs/client/plugins/fetch.js +1 -0
- package/build/runtime-cjs/client/plugins/query.js +1 -0
- package/build/runtime-cjs/client/plugins/subscription.d.ts +1 -2
- package/build/runtime-cjs/client/plugins/subscription.js +2 -0
- package/build/runtime-cjs/lib/config.d.ts +4 -0
- package/build/runtime-cjs/lib/index.d.ts +1 -0
- package/build/runtime-cjs/lib/index.js +1 -0
- package/build/runtime-cjs/lib/key.d.ts +6 -0
- package/build/runtime-cjs/lib/key.js +41 -0
- package/build/runtime-cjs/lib/types.d.ts +2 -2
- package/build/runtime-cjs/public/cache.d.ts +8 -1
- package/build/runtime-cjs/public/cache.js +3 -0
- package/build/runtime-cjs/public/record.d.ts +11 -1
- package/build/runtime-cjs/public/record.js +8 -1
- package/build/runtime-cjs/public/tests/test.d.ts +9 -10
- package/build/runtime-esm/cache/cache.d.ts +20 -3
- package/build/runtime-esm/cache/cache.js +66 -7
- package/build/runtime-esm/cache/gc.js +9 -0
- package/build/runtime-esm/cache/staleManager.d.ts +30 -0
- package/build/runtime-esm/cache/staleManager.js +71 -0
- package/build/runtime-esm/cache/subscription.d.ts +2 -1
- package/build/runtime-esm/cache/subscription.js +6 -3
- package/build/runtime-esm/client/documentStore.js +1 -0
- package/build/runtime-esm/client/plugins/cache.js +5 -3
- package/build/runtime-esm/client/plugins/fetch.js +1 -0
- package/build/runtime-esm/client/plugins/query.js +1 -0
- package/build/runtime-esm/client/plugins/subscription.d.ts +1 -2
- package/build/runtime-esm/client/plugins/subscription.js +2 -0
- package/build/runtime-esm/lib/config.d.ts +4 -0
- package/build/runtime-esm/lib/index.d.ts +1 -0
- package/build/runtime-esm/lib/index.js +1 -0
- package/build/runtime-esm/lib/key.d.ts +6 -0
- package/build/runtime-esm/lib/key.js +17 -0
- package/build/runtime-esm/lib/types.d.ts +2 -2
- package/build/runtime-esm/public/cache.d.ts +8 -1
- package/build/runtime-esm/public/cache.js +3 -0
- package/build/runtime-esm/public/record.d.ts +11 -1
- package/build/runtime-esm/public/record.js +8 -1
- package/build/runtime-esm/public/tests/test.d.ts +9 -10
- package/build/test-cjs/index.js +893 -747
- package/build/test-esm/index.js +893 -747
- package/build/vite-cjs/index.js +1195 -998
- package/build/vite-esm/index.js +1195 -998
- package/package.json +3 -2
|
@@ -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];
|
|
@@ -15472,6 +15472,109 @@ var require_minimatch = __commonJS({
|
|
|
15472
15472
|
}
|
|
15473
15473
|
});
|
|
15474
15474
|
|
|
15475
|
+
// ../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js
|
|
15476
|
+
var require_cjs = __commonJS({
|
|
15477
|
+
"../../node_modules/.pnpm/deepmerge@4.2.2/node_modules/deepmerge/dist/cjs.js"(exports, module2) {
|
|
15478
|
+
"use strict";
|
|
15479
|
+
var isMergeableObject = function isMergeableObject2(value) {
|
|
15480
|
+
return isNonNullObject(value) && !isSpecial(value);
|
|
15481
|
+
};
|
|
15482
|
+
function isNonNullObject(value) {
|
|
15483
|
+
return !!value && typeof value === "object";
|
|
15484
|
+
}
|
|
15485
|
+
function isSpecial(value) {
|
|
15486
|
+
var stringValue = Object.prototype.toString.call(value);
|
|
15487
|
+
return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
|
|
15488
|
+
}
|
|
15489
|
+
var canUseSymbol = typeof Symbol === "function" && Symbol.for;
|
|
15490
|
+
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
|
|
15491
|
+
function isReactElement(value) {
|
|
15492
|
+
return value.$$typeof === REACT_ELEMENT_TYPE;
|
|
15493
|
+
}
|
|
15494
|
+
function emptyTarget(val) {
|
|
15495
|
+
return Array.isArray(val) ? [] : {};
|
|
15496
|
+
}
|
|
15497
|
+
function cloneUnlessOtherwiseSpecified(value, options) {
|
|
15498
|
+
return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
|
|
15499
|
+
}
|
|
15500
|
+
function defaultArrayMerge(target, source, options) {
|
|
15501
|
+
return target.concat(source).map(function(element) {
|
|
15502
|
+
return cloneUnlessOtherwiseSpecified(element, options);
|
|
15503
|
+
});
|
|
15504
|
+
}
|
|
15505
|
+
function getMergeFunction(key, options) {
|
|
15506
|
+
if (!options.customMerge) {
|
|
15507
|
+
return deepmerge;
|
|
15508
|
+
}
|
|
15509
|
+
var customMerge = options.customMerge(key);
|
|
15510
|
+
return typeof customMerge === "function" ? customMerge : deepmerge;
|
|
15511
|
+
}
|
|
15512
|
+
function getEnumerableOwnPropertySymbols(target) {
|
|
15513
|
+
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
|
|
15514
|
+
return target.propertyIsEnumerable(symbol);
|
|
15515
|
+
}) : [];
|
|
15516
|
+
}
|
|
15517
|
+
function getKeys(target) {
|
|
15518
|
+
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
|
|
15519
|
+
}
|
|
15520
|
+
function propertyIsOnObject(object, property) {
|
|
15521
|
+
try {
|
|
15522
|
+
return property in object;
|
|
15523
|
+
} catch (_) {
|
|
15524
|
+
return false;
|
|
15525
|
+
}
|
|
15526
|
+
}
|
|
15527
|
+
function propertyIsUnsafe(target, key) {
|
|
15528
|
+
return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
|
|
15529
|
+
}
|
|
15530
|
+
function mergeObject(target, source, options) {
|
|
15531
|
+
var destination = {};
|
|
15532
|
+
if (options.isMergeableObject(target)) {
|
|
15533
|
+
getKeys(target).forEach(function(key) {
|
|
15534
|
+
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
|
15535
|
+
});
|
|
15536
|
+
}
|
|
15537
|
+
getKeys(source).forEach(function(key) {
|
|
15538
|
+
if (propertyIsUnsafe(target, key)) {
|
|
15539
|
+
return;
|
|
15540
|
+
}
|
|
15541
|
+
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
|
|
15542
|
+
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
|
|
15543
|
+
} else {
|
|
15544
|
+
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
|
|
15545
|
+
}
|
|
15546
|
+
});
|
|
15547
|
+
return destination;
|
|
15548
|
+
}
|
|
15549
|
+
function deepmerge(target, source, options) {
|
|
15550
|
+
options = options || {};
|
|
15551
|
+
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
|
|
15552
|
+
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
|
|
15553
|
+
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
|
15554
|
+
var sourceIsArray = Array.isArray(source);
|
|
15555
|
+
var targetIsArray = Array.isArray(target);
|
|
15556
|
+
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
15557
|
+
if (!sourceAndTargetTypesMatch) {
|
|
15558
|
+
return cloneUnlessOtherwiseSpecified(source, options);
|
|
15559
|
+
} else if (sourceIsArray) {
|
|
15560
|
+
return options.arrayMerge(target, source, options);
|
|
15561
|
+
} else {
|
|
15562
|
+
return mergeObject(target, source, options);
|
|
15563
|
+
}
|
|
15564
|
+
}
|
|
15565
|
+
deepmerge.all = function deepmergeAll(array, options) {
|
|
15566
|
+
if (!Array.isArray(array)) {
|
|
15567
|
+
throw new Error("first argument should be an array");
|
|
15568
|
+
}
|
|
15569
|
+
return array.reduce(function(prev, next) {
|
|
15570
|
+
return deepmerge(prev, next, options);
|
|
15571
|
+
}, {});
|
|
15572
|
+
};
|
|
15573
|
+
var deepmerge_1 = deepmerge;
|
|
15574
|
+
module2.exports = deepmerge_1;
|
|
15575
|
+
}
|
|
15576
|
+
});
|
|
15577
|
+
|
|
15475
15578
|
// ../../node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js
|
|
15476
15579
|
var require_universalify = __commonJS({
|
|
15477
15580
|
"../../node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js"(exports) {
|
|
@@ -19016,8 +19119,8 @@ var require_once = __commonJS({
|
|
|
19016
19119
|
f.called = true;
|
|
19017
19120
|
return f.value = fn.apply(this, arguments);
|
|
19018
19121
|
};
|
|
19019
|
-
var
|
|
19020
|
-
f.onceError =
|
|
19122
|
+
var name = fn.name || "Function wrapped with `once`";
|
|
19123
|
+
f.onceError = name + " shouldn't be called more than once";
|
|
19021
19124
|
f.called = false;
|
|
19022
19125
|
return f;
|
|
19023
19126
|
}
|
|
@@ -19927,9 +20030,9 @@ var require_errors = __commonJS({
|
|
|
19927
20030
|
E("ERR_HTTP_TRAILER_INVALID", "Trailers are invalid with this transfer encoding");
|
|
19928
20031
|
E("ERR_INDEX_OUT_OF_RANGE", "Index out of range");
|
|
19929
20032
|
E("ERR_INVALID_ARG_TYPE", invalidArgType);
|
|
19930
|
-
E("ERR_INVALID_ARRAY_LENGTH", function(
|
|
20033
|
+
E("ERR_INVALID_ARRAY_LENGTH", function(name, len, actual) {
|
|
19931
20034
|
assert.strictEqual(typeof actual, "number");
|
|
19932
|
-
return 'The array "'.concat(
|
|
20035
|
+
return 'The array "'.concat(name, '" (length ').concat(actual, ") must be of length ").concat(len, ".");
|
|
19933
20036
|
});
|
|
19934
20037
|
E("ERR_INVALID_BUFFER_SIZE", "Buffer size must be a multiple of %s");
|
|
19935
20038
|
E("ERR_INVALID_CALLBACK", "Callback must be a function");
|
|
@@ -19940,8 +20043,8 @@ var require_errors = __commonJS({
|
|
|
19940
20043
|
E("ERR_INVALID_FILE_URL_PATH", "File URL path %s");
|
|
19941
20044
|
E("ERR_INVALID_HANDLE_TYPE", "This handle type cannot be sent");
|
|
19942
20045
|
E("ERR_INVALID_IP_ADDRESS", "Invalid IP address: %s");
|
|
19943
|
-
E("ERR_INVALID_OPT_VALUE", function(
|
|
19944
|
-
return 'The value "'.concat(String(value), '" is invalid for option "').concat(
|
|
20046
|
+
E("ERR_INVALID_OPT_VALUE", function(name, value) {
|
|
20047
|
+
return 'The value "'.concat(String(value), '" is invalid for option "').concat(name, '"');
|
|
19945
20048
|
});
|
|
19946
20049
|
E("ERR_INVALID_OPT_VALUE_ENCODING", function(value) {
|
|
19947
20050
|
return 'The value "'.concat(String(value), '" is invalid for option "encoding"');
|
|
@@ -19989,8 +20092,8 @@ var require_errors = __commonJS({
|
|
|
19989
20092
|
E("ERR_UNKNOWN_STDIN_TYPE", "Unknown stdin file type");
|
|
19990
20093
|
E("ERR_UNKNOWN_STREAM_TYPE", "Unknown stream file type");
|
|
19991
20094
|
E("ERR_V8BREAKITERATOR", "Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl");
|
|
19992
|
-
function invalidArgType(
|
|
19993
|
-
assert(
|
|
20095
|
+
function invalidArgType(name, expected, actual) {
|
|
20096
|
+
assert(name, "name is required");
|
|
19994
20097
|
var determiner;
|
|
19995
20098
|
if (expected.includes("not ")) {
|
|
19996
20099
|
determiner = "must not be";
|
|
@@ -19999,16 +20102,16 @@ var require_errors = __commonJS({
|
|
|
19999
20102
|
determiner = "must be";
|
|
20000
20103
|
}
|
|
20001
20104
|
var msg;
|
|
20002
|
-
if (Array.isArray(
|
|
20003
|
-
var names =
|
|
20105
|
+
if (Array.isArray(name)) {
|
|
20106
|
+
var names = name.map(function(val) {
|
|
20004
20107
|
return '"'.concat(val, '"');
|
|
20005
20108
|
}).join(", ");
|
|
20006
20109
|
msg = "The ".concat(names, " arguments ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
20007
|
-
} else if (
|
|
20008
|
-
msg = "The ".concat(
|
|
20110
|
+
} else if (name.includes(" argument")) {
|
|
20111
|
+
msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
20009
20112
|
} else {
|
|
20010
|
-
var type =
|
|
20011
|
-
msg = 'The "'.concat(
|
|
20113
|
+
var type = name.includes(".") ? "property" : "argument";
|
|
20114
|
+
msg = 'The "'.concat(name, '" ').concat(type, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
|
|
20012
20115
|
}
|
|
20013
20116
|
if (arguments.length >= 3) {
|
|
20014
20117
|
msg += ". Received type ".concat(actual !== null ? typeof actual : "null");
|
|
@@ -20060,11 +20163,11 @@ var require_errors = __commonJS({
|
|
|
20060
20163
|
return "of ".concat(thing, " ").concat(String(expected));
|
|
20061
20164
|
}
|
|
20062
20165
|
}
|
|
20063
|
-
function bufferOutOfBounds(
|
|
20166
|
+
function bufferOutOfBounds(name, isWriting) {
|
|
20064
20167
|
if (isWriting) {
|
|
20065
20168
|
return "Attempt to write outside buffer bounds";
|
|
20066
20169
|
} else {
|
|
20067
|
-
return '"'.concat(
|
|
20170
|
+
return '"'.concat(name, '" is outside of buffer bounds');
|
|
20068
20171
|
}
|
|
20069
20172
|
}
|
|
20070
20173
|
}
|
|
@@ -20462,7 +20565,7 @@ var require_node = __commonJS({
|
|
|
20462
20565
|
exports.Node = Node;
|
|
20463
20566
|
var Link = function(_super) {
|
|
20464
20567
|
__extends(Link2, _super);
|
|
20465
|
-
function Link2(vol2, parent,
|
|
20568
|
+
function Link2(vol2, parent, name) {
|
|
20466
20569
|
var _this = _super.call(this) || this;
|
|
20467
20570
|
_this.children = {};
|
|
20468
20571
|
_this._steps = [];
|
|
@@ -20470,7 +20573,7 @@ var require_node = __commonJS({
|
|
|
20470
20573
|
_this.length = 0;
|
|
20471
20574
|
_this.vol = vol2;
|
|
20472
20575
|
_this.parent = parent;
|
|
20473
|
-
_this.name =
|
|
20576
|
+
_this.name = name;
|
|
20474
20577
|
_this.syncSteps();
|
|
20475
20578
|
return _this;
|
|
20476
20579
|
}
|
|
@@ -20495,22 +20598,22 @@ var require_node = __commonJS({
|
|
|
20495
20598
|
Link2.prototype.getNode = function() {
|
|
20496
20599
|
return this.node;
|
|
20497
20600
|
};
|
|
20498
|
-
Link2.prototype.createChild = function(
|
|
20601
|
+
Link2.prototype.createChild = function(name, node) {
|
|
20499
20602
|
if (node === void 0) {
|
|
20500
20603
|
node = this.vol.createNode();
|
|
20501
20604
|
}
|
|
20502
|
-
var link = new Link2(this.vol, this,
|
|
20605
|
+
var link = new Link2(this.vol, this, name);
|
|
20503
20606
|
link.setNode(node);
|
|
20504
20607
|
if (node.isDirectory()) {
|
|
20505
20608
|
}
|
|
20506
|
-
this.setChild(
|
|
20609
|
+
this.setChild(name, link);
|
|
20507
20610
|
return link;
|
|
20508
20611
|
};
|
|
20509
|
-
Link2.prototype.setChild = function(
|
|
20612
|
+
Link2.prototype.setChild = function(name, link) {
|
|
20510
20613
|
if (link === void 0) {
|
|
20511
|
-
link = new Link2(this.vol, this,
|
|
20614
|
+
link = new Link2(this.vol, this, name);
|
|
20512
20615
|
}
|
|
20513
|
-
this.children[
|
|
20616
|
+
this.children[name] = link;
|
|
20514
20617
|
link.parent = this;
|
|
20515
20618
|
this.length++;
|
|
20516
20619
|
this.emit("child:add", link, this);
|
|
@@ -20521,9 +20624,9 @@ var require_node = __commonJS({
|
|
|
20521
20624
|
this.length--;
|
|
20522
20625
|
this.emit("child:delete", link, this);
|
|
20523
20626
|
};
|
|
20524
|
-
Link2.prototype.getChild = function(
|
|
20525
|
-
if (Object.hasOwnProperty.call(this.children,
|
|
20526
|
-
return this.children[
|
|
20627
|
+
Link2.prototype.getChild = function(name) {
|
|
20628
|
+
if (Object.hasOwnProperty.call(this.children, name)) {
|
|
20629
|
+
return this.children[name];
|
|
20527
20630
|
}
|
|
20528
20631
|
};
|
|
20529
20632
|
Link2.prototype.getPath = function() {
|
|
@@ -21412,17 +21515,17 @@ var require_volume = __commonJS({
|
|
|
21412
21515
|
enumerable: false,
|
|
21413
21516
|
configurable: true
|
|
21414
21517
|
});
|
|
21415
|
-
Volume2.prototype.createLink = function(parent,
|
|
21518
|
+
Volume2.prototype.createLink = function(parent, name, isDirectory, perm) {
|
|
21416
21519
|
if (isDirectory === void 0) {
|
|
21417
21520
|
isDirectory = false;
|
|
21418
21521
|
}
|
|
21419
21522
|
if (!parent) {
|
|
21420
21523
|
return new this.props.Link(this, null, "");
|
|
21421
21524
|
}
|
|
21422
|
-
if (!
|
|
21525
|
+
if (!name) {
|
|
21423
21526
|
throw new Error("createLink: name cannot be empty");
|
|
21424
21527
|
}
|
|
21425
|
-
return parent.createChild(
|
|
21528
|
+
return parent.createChild(name, this.createNode(isDirectory, perm));
|
|
21426
21529
|
};
|
|
21427
21530
|
Volume2.prototype.deleteLink = function(link) {
|
|
21428
21531
|
var parent = link.parent;
|
|
@@ -21972,12 +22075,12 @@ var require_volume = __commonJS({
|
|
|
21972
22075
|
var dir2 = this.getLinkParent(steps2);
|
|
21973
22076
|
if (!dir2)
|
|
21974
22077
|
throw createError(ENOENT, "link", filename1, filename2);
|
|
21975
|
-
var
|
|
21976
|
-
if (dir2.getChild(
|
|
22078
|
+
var name = steps2[steps2.length - 1];
|
|
22079
|
+
if (dir2.getChild(name))
|
|
21977
22080
|
throw createError(EEXIST, "link", filename1, filename2);
|
|
21978
22081
|
var node = link1.getNode();
|
|
21979
22082
|
node.nlink++;
|
|
21980
|
-
dir2.createChild(
|
|
22083
|
+
dir2.createChild(name, node);
|
|
21981
22084
|
};
|
|
21982
22085
|
Volume2.prototype.copyFileBase = function(src, dest, flags) {
|
|
21983
22086
|
var buf = this.readFileSync(src);
|
|
@@ -22048,10 +22151,10 @@ var require_volume = __commonJS({
|
|
|
22048
22151
|
var dirLink = this.getLinkParent(pathSteps);
|
|
22049
22152
|
if (!dirLink)
|
|
22050
22153
|
throw createError(ENOENT, "symlink", targetFilename, pathFilename);
|
|
22051
|
-
var
|
|
22052
|
-
if (dirLink.getChild(
|
|
22154
|
+
var name = pathSteps[pathSteps.length - 1];
|
|
22155
|
+
if (dirLink.getChild(name))
|
|
22053
22156
|
throw createError(EEXIST, "symlink", targetFilename, pathFilename);
|
|
22054
|
-
var symlink = dirLink.createChild(
|
|
22157
|
+
var symlink = dirLink.createChild(name);
|
|
22055
22158
|
symlink.getNode().makeSymlink(filenameToSteps(targetFilename));
|
|
22056
22159
|
return symlink;
|
|
22057
22160
|
};
|
|
@@ -22157,9 +22260,9 @@ var require_volume = __commonJS({
|
|
|
22157
22260
|
if (oldLinkParent) {
|
|
22158
22261
|
oldLinkParent.deleteChild(link);
|
|
22159
22262
|
}
|
|
22160
|
-
var
|
|
22161
|
-
link.name =
|
|
22162
|
-
link.steps = __spreadArray(__spreadArray([], newPathDirLink.steps, true), [
|
|
22263
|
+
var name = newPathSteps[newPathSteps.length - 1];
|
|
22264
|
+
link.name = name;
|
|
22265
|
+
link.steps = __spreadArray(__spreadArray([], newPathDirLink.steps, true), [name], false);
|
|
22163
22266
|
newPathDirLink.setChild(link.getName(), link);
|
|
22164
22267
|
};
|
|
22165
22268
|
Volume2.prototype.renameSync = function(oldPath, newPath) {
|
|
@@ -22378,10 +22481,10 @@ var require_volume = __commonJS({
|
|
|
22378
22481
|
throw createError(EEXIST, "mkdir", filename);
|
|
22379
22482
|
}
|
|
22380
22483
|
var dir = this.getLinkParentAsDirOrThrow(filename, "mkdir");
|
|
22381
|
-
var
|
|
22382
|
-
if (dir.getChild(
|
|
22484
|
+
var name = steps[steps.length - 1];
|
|
22485
|
+
if (dir.getChild(name))
|
|
22383
22486
|
throw createError(EEXIST, "mkdir", filename);
|
|
22384
|
-
dir.createChild(
|
|
22487
|
+
dir.createChild(name, this.createNode(true, modeNum));
|
|
22385
22488
|
};
|
|
22386
22489
|
Volume2.prototype.mkdirpBase = function(filename, modeNum) {
|
|
22387
22490
|
var fullPath = resolve2(filename);
|
|
@@ -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(print9, "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(print9, "typeAnnotation"));
|
|
@@ -53971,6 +54074,9 @@ var houdini_mode = {
|
|
|
53971
54074
|
}
|
|
53972
54075
|
};
|
|
53973
54076
|
|
|
54077
|
+
// src/lib/deepMerge.ts
|
|
54078
|
+
var import_deepmerge = __toESM(require_cjs(), 1);
|
|
54079
|
+
|
|
53974
54080
|
// src/lib/error.ts
|
|
53975
54081
|
var HoudiniError = class extends Error {
|
|
53976
54082
|
filepath = null;
|
|
@@ -53990,6 +54096,20 @@ var HoudiniError = class extends Error {
|
|
|
53990
54096
|
}
|
|
53991
54097
|
};
|
|
53992
54098
|
|
|
54099
|
+
// src/lib/deepMerge.ts
|
|
54100
|
+
function deepMerge(filepath, ...targets) {
|
|
54101
|
+
try {
|
|
54102
|
+
if (targets.length === 1) {
|
|
54103
|
+
return targets[0];
|
|
54104
|
+
} else if (targets.length === 2) {
|
|
54105
|
+
return (0, import_deepmerge.default)(targets[0], targets[1]);
|
|
54106
|
+
}
|
|
54107
|
+
return deepMerge(filepath, targets[0], deepMerge(filepath, ...targets.slice(1)));
|
|
54108
|
+
} catch (e) {
|
|
54109
|
+
throw new HoudiniError({ filepath, message: "could not merge: " + targets });
|
|
54110
|
+
}
|
|
54111
|
+
}
|
|
54112
|
+
|
|
53993
54113
|
// src/lib/fs.ts
|
|
53994
54114
|
var fs_exports = {};
|
|
53995
54115
|
__export(fs_exports, {
|
|
@@ -54284,8 +54404,10 @@ function getRootType(type) {
|
|
|
54284
54404
|
}
|
|
54285
54405
|
return type;
|
|
54286
54406
|
}
|
|
54287
|
-
function hashDocument(
|
|
54288
|
-
|
|
54407
|
+
function hashDocument({
|
|
54408
|
+
document
|
|
54409
|
+
}) {
|
|
54410
|
+
const docString = typeof document === "string" ? document : graphql.print(document.document);
|
|
54289
54411
|
return import_crypto.default.createHash("sha256").update(docString).digest("hex");
|
|
54290
54412
|
}
|
|
54291
54413
|
function parentTypeFromAncestors(schema, filepath, ancestors) {
|
|
@@ -54621,8 +54743,8 @@ async function find_graphql(config2, parsedScript, walker) {
|
|
|
54621
54743
|
return;
|
|
54622
54744
|
}
|
|
54623
54745
|
const definition = config2.extractDefinition(parsedTag);
|
|
54624
|
-
const
|
|
54625
|
-
if (!
|
|
54746
|
+
const name = definition.name?.value;
|
|
54747
|
+
if (!name) {
|
|
54626
54748
|
throw new Error("Could not find definition name");
|
|
54627
54749
|
}
|
|
54628
54750
|
let kind;
|
|
@@ -54647,7 +54769,7 @@ async function find_graphql(config2, parsedScript, walker) {
|
|
|
54647
54769
|
replaceWith: this.replace
|
|
54648
54770
|
},
|
|
54649
54771
|
artifact: {
|
|
54650
|
-
name
|
|
54772
|
+
name,
|
|
54651
54773
|
kind
|
|
54652
54774
|
},
|
|
54653
54775
|
parent,
|
|
@@ -54762,13 +54884,13 @@ var FieldCollection = class {
|
|
|
54762
54884
|
this.fragmentSpreads[selection2.name.value] = selection2;
|
|
54763
54885
|
let includeFragments = this.config.defaultFragmentMasking === "disable";
|
|
54764
54886
|
const maskEnableDirective = selection2.directives?.find(
|
|
54765
|
-
({ name
|
|
54887
|
+
({ name }) => name.value === this.config.maskEnableDirective
|
|
54766
54888
|
);
|
|
54767
54889
|
if (maskEnableDirective) {
|
|
54768
54890
|
includeFragments = false;
|
|
54769
54891
|
}
|
|
54770
54892
|
const maskDisableDirective = selection2.directives?.find(
|
|
54771
|
-
({ name
|
|
54893
|
+
({ name }) => name.value === this.config.maskDisableDirective
|
|
54772
54894
|
);
|
|
54773
54895
|
if (maskDisableDirective) {
|
|
54774
54896
|
includeFragments = true;
|
|
@@ -54923,7 +55045,7 @@ var graphql3 = __toESM(require_graphql2(), 1);
|
|
|
54923
55045
|
var import_graphql = __toESM(require_graphql2(), 1);
|
|
54924
55046
|
async function includeFragmentDefinitions(config2, documents) {
|
|
54925
55047
|
const fragments = collectFragments(config2, documents);
|
|
54926
|
-
for (const [index, { name
|
|
55048
|
+
for (const [index, { name, document, filename }] of documents.entries()) {
|
|
54927
55049
|
const operation = document.definitions.find(
|
|
54928
55050
|
({ kind }) => kind === import_graphql.Kind.OPERATION_DEFINITION
|
|
54929
55051
|
);
|
|
@@ -55037,7 +55159,8 @@ async function fragmentVariables(config2, documents) {
|
|
|
55037
55159
|
generateStore: false,
|
|
55038
55160
|
generateArtifact: false,
|
|
55039
55161
|
filename: "generated::fragmentVariables",
|
|
55040
|
-
originalString: ""
|
|
55162
|
+
originalString: "",
|
|
55163
|
+
artifact: null
|
|
55041
55164
|
});
|
|
55042
55165
|
}
|
|
55043
55166
|
function inlineFragmentArgs({
|
|
@@ -55185,7 +55308,7 @@ function fragmentArguments(config2, filepath, definition) {
|
|
|
55185
55308
|
return [];
|
|
55186
55309
|
}
|
|
55187
55310
|
let type = typeArg.value;
|
|
55188
|
-
let
|
|
55311
|
+
let name = arg.name.value;
|
|
55189
55312
|
let required = false;
|
|
55190
55313
|
let defaultValue = arg.value.fields?.find((arg2) => arg2.name.value === "default")?.value || null;
|
|
55191
55314
|
if (type[type.length - 1] === "!") {
|
|
@@ -55195,7 +55318,7 @@ function fragmentArguments(config2, filepath, definition) {
|
|
|
55195
55318
|
}
|
|
55196
55319
|
return [
|
|
55197
55320
|
{
|
|
55198
|
-
name
|
|
55321
|
+
name,
|
|
55199
55322
|
type,
|
|
55200
55323
|
required,
|
|
55201
55324
|
defaultValue
|
|
@@ -55206,7 +55329,7 @@ function fragmentArguments(config2, filepath, definition) {
|
|
|
55206
55329
|
}
|
|
55207
55330
|
function collectDefaultArgumentValues(config2, filepath, definition) {
|
|
55208
55331
|
let result = {};
|
|
55209
|
-
for (const { name
|
|
55332
|
+
for (const { name, required, defaultValue } of fragmentArguments(
|
|
55210
55333
|
config2,
|
|
55211
55334
|
filepath,
|
|
55212
55335
|
definition
|
|
@@ -55214,7 +55337,7 @@ function collectDefaultArgumentValues(config2, filepath, definition) {
|
|
|
55214
55337
|
if (required || !defaultValue) {
|
|
55215
55338
|
continue;
|
|
55216
55339
|
}
|
|
55217
|
-
result[
|
|
55340
|
+
result[name] = defaultValue;
|
|
55218
55341
|
}
|
|
55219
55342
|
return result;
|
|
55220
55343
|
}
|
|
@@ -55381,30 +55504,6 @@ function serializeValue(value) {
|
|
|
55381
55504
|
}
|
|
55382
55505
|
return AST4.literal(value);
|
|
55383
55506
|
}
|
|
55384
|
-
function deepMerge(filepath, ...targets) {
|
|
55385
|
-
if (typeof targets[0] !== "object") {
|
|
55386
|
-
const matches = targets.filter((val) => val !== targets[0]).length === 0;
|
|
55387
|
-
if (!matches) {
|
|
55388
|
-
throw new HoudiniError({ filepath, message: "could not merge: " + targets });
|
|
55389
|
-
}
|
|
55390
|
-
return targets[0];
|
|
55391
|
-
}
|
|
55392
|
-
if (Array.isArray(targets[0])) {
|
|
55393
|
-
return targets[0].concat(...targets.slice(1));
|
|
55394
|
-
}
|
|
55395
|
-
const fields = {};
|
|
55396
|
-
for (const target of targets) {
|
|
55397
|
-
for (const [key, value] of Object.entries(target)) {
|
|
55398
|
-
if (!fields[key]) {
|
|
55399
|
-
fields[key] = [];
|
|
55400
|
-
}
|
|
55401
|
-
fields[key].push(value);
|
|
55402
|
-
}
|
|
55403
|
-
}
|
|
55404
|
-
return Object.fromEntries(
|
|
55405
|
-
Object.entries(fields).map(([key, value]) => [key, deepMerge(filepath, ...value)])
|
|
55406
|
-
);
|
|
55407
|
-
}
|
|
55408
55507
|
function convertValue(config2, val) {
|
|
55409
55508
|
let value;
|
|
55410
55509
|
let kind;
|
|
@@ -55489,14 +55588,14 @@ function operationObject({
|
|
|
55489
55588
|
let allLists = config2.defaultListTarget ?? void 0;
|
|
55490
55589
|
let operationWhen;
|
|
55491
55590
|
const internalDirectives = selection2.directives?.filter(
|
|
55492
|
-
(directive) => config2.isInternalDirective(directive)
|
|
55591
|
+
(directive) => config2.isInternalDirective(directive.name.value)
|
|
55493
55592
|
);
|
|
55494
55593
|
if (internalDirectives && internalDirectives.length > 0) {
|
|
55495
55594
|
const prepend = internalDirectives.find(
|
|
55496
|
-
({ name
|
|
55595
|
+
({ name }) => name.value === config2.listPrependDirective
|
|
55497
55596
|
);
|
|
55498
55597
|
const append = internalDirectives.find(
|
|
55499
|
-
({ name
|
|
55598
|
+
({ name }) => name.value === config2.listAppendDirective
|
|
55500
55599
|
);
|
|
55501
55600
|
if (append) {
|
|
55502
55601
|
position = "last";
|
|
@@ -55505,14 +55604,14 @@ function operationObject({
|
|
|
55505
55604
|
position = "first";
|
|
55506
55605
|
}
|
|
55507
55606
|
const allListsDirective = internalDirectives.find(
|
|
55508
|
-
({ name
|
|
55607
|
+
({ name }) => name.value === config2.listAllListsDirective
|
|
55509
55608
|
);
|
|
55510
55609
|
let parent = internalDirectives.find(
|
|
55511
|
-
({ name
|
|
55610
|
+
({ name }) => name.value === config2.listParentDirective
|
|
55512
55611
|
);
|
|
55513
55612
|
allLists = allListsDirective ? "all" : void 0;
|
|
55514
|
-
const when = internalDirectives.find(({ name
|
|
55515
|
-
const when_not = internalDirectives.find(({ name
|
|
55613
|
+
const when = internalDirectives.find(({ name }) => name.value === "when");
|
|
55614
|
+
const when_not = internalDirectives.find(({ name }) => name.value === "when_not");
|
|
55516
55615
|
let parentIDArg = parent?.arguments?.find((argument) => argument.name.value === "value");
|
|
55517
55616
|
if (parentIDArg) {
|
|
55518
55617
|
if (parentIDArg.value.kind === "StringValue") {
|
|
@@ -55523,9 +55622,9 @@ function operationObject({
|
|
|
55523
55622
|
parentID = parentIDArg.value.name.value;
|
|
55524
55623
|
}
|
|
55525
55624
|
}
|
|
55526
|
-
const whenArg = (append || prepend)?.arguments?.find(({ name
|
|
55625
|
+
const whenArg = (append || prepend)?.arguments?.find(({ name }) => name.value === "when");
|
|
55527
55626
|
const whenNotArg = (append || prepend)?.arguments?.find(
|
|
55528
|
-
({ name
|
|
55627
|
+
({ name }) => name.value === "when_not"
|
|
55529
55628
|
);
|
|
55530
55629
|
for (const [i, arg] of [whenArg, whenNotArg].entries()) {
|
|
55531
55630
|
if (!arg || arg.value.kind !== "ObjectValue") {
|
|
@@ -55758,7 +55857,7 @@ async function paginate(config2, documents) {
|
|
|
55758
55857
|
Object.keys(operationVariables).concat(Object.keys(newVariables))
|
|
55759
55858
|
);
|
|
55760
55859
|
const finalVariables = [...variableNames].map(
|
|
55761
|
-
(
|
|
55860
|
+
(name) => operationVariables[name] || newVariables[name]
|
|
55762
55861
|
);
|
|
55763
55862
|
return {
|
|
55764
55863
|
...node,
|
|
@@ -55855,7 +55954,7 @@ async function paginate(config2, documents) {
|
|
|
55855
55954
|
value: config2.withDirective
|
|
55856
55955
|
},
|
|
55857
55956
|
["arguments"]: paginationArgs.map(
|
|
55858
|
-
({ name
|
|
55957
|
+
({ name }) => variableAsArgument(name)
|
|
55859
55958
|
)
|
|
55860
55959
|
}
|
|
55861
55960
|
]
|
|
@@ -55983,7 +56082,8 @@ async function paginate(config2, documents) {
|
|
|
55983
56082
|
generateArtifact: true,
|
|
55984
56083
|
generateStore: false,
|
|
55985
56084
|
refetch: doc.refetch,
|
|
55986
|
-
originalString: ""
|
|
56085
|
+
originalString: "",
|
|
56086
|
+
artifact: null
|
|
55987
56087
|
});
|
|
55988
56088
|
}
|
|
55989
56089
|
}
|
|
@@ -56006,32 +56106,32 @@ function replaceArgumentsWithVariables(args, flags) {
|
|
|
56006
56106
|
seenArgs[arg.name.value] = true;
|
|
56007
56107
|
return variableAsArgument(arg.name.value, flags[arg.name.value].variableName);
|
|
56008
56108
|
});
|
|
56009
|
-
for (const
|
|
56010
|
-
const spec = flags[
|
|
56011
|
-
if (flags[
|
|
56109
|
+
for (const name of Object.keys(flags)) {
|
|
56110
|
+
const spec = flags[name];
|
|
56111
|
+
if (flags[name].defaultValue || !spec.enabled || seenArgs[name]) {
|
|
56012
56112
|
continue;
|
|
56013
56113
|
}
|
|
56014
|
-
newArgs.push(variableAsArgument(
|
|
56114
|
+
newArgs.push(variableAsArgument(name));
|
|
56015
56115
|
}
|
|
56016
56116
|
return newArgs;
|
|
56017
56117
|
}
|
|
56018
|
-
function variableAsArgument(
|
|
56118
|
+
function variableAsArgument(name, variable) {
|
|
56019
56119
|
return {
|
|
56020
56120
|
kind: graphql8.Kind.ARGUMENT,
|
|
56021
56121
|
name: {
|
|
56022
56122
|
kind: graphql8.Kind.NAME,
|
|
56023
|
-
value:
|
|
56123
|
+
value: name
|
|
56024
56124
|
},
|
|
56025
56125
|
value: {
|
|
56026
56126
|
kind: graphql8.Kind.VARIABLE,
|
|
56027
56127
|
name: {
|
|
56028
56128
|
kind: graphql8.Kind.NAME,
|
|
56029
|
-
value: variable ??
|
|
56129
|
+
value: variable ?? name
|
|
56030
56130
|
}
|
|
56031
56131
|
}
|
|
56032
56132
|
};
|
|
56033
56133
|
}
|
|
56034
|
-
function staticVariableDefinition(
|
|
56134
|
+
function staticVariableDefinition(name, type, defaultValue, variableName) {
|
|
56035
56135
|
return {
|
|
56036
56136
|
kind: graphql8.Kind.VARIABLE_DEFINITION,
|
|
56037
56137
|
type: {
|
|
@@ -56045,7 +56145,7 @@ function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
|
56045
56145
|
kind: graphql8.Kind.VARIABLE,
|
|
56046
56146
|
name: {
|
|
56047
56147
|
kind: graphql8.Kind.NAME,
|
|
56048
|
-
value: variableName ??
|
|
56148
|
+
value: variableName ?? name
|
|
56049
56149
|
}
|
|
56050
56150
|
},
|
|
56051
56151
|
defaultValue: !defaultValue ? void 0 : {
|
|
@@ -56054,12 +56154,12 @@ function staticVariableDefinition(name2, type, defaultValue, variableName) {
|
|
|
56054
56154
|
}
|
|
56055
56155
|
};
|
|
56056
56156
|
}
|
|
56057
|
-
function argumentNode(
|
|
56157
|
+
function argumentNode(name, value) {
|
|
56058
56158
|
return {
|
|
56059
56159
|
kind: graphql8.Kind.ARGUMENT,
|
|
56060
56160
|
name: {
|
|
56061
56161
|
kind: graphql8.Kind.NAME,
|
|
56062
|
-
value:
|
|
56162
|
+
value: name
|
|
56063
56163
|
},
|
|
56064
56164
|
value: objectNode(value)
|
|
56065
56165
|
};
|
|
@@ -56305,7 +56405,7 @@ async function addListFragments(config2, documents) {
|
|
|
56305
56405
|
const generatedDoc = {
|
|
56306
56406
|
kind: graphql9.Kind.DOCUMENT,
|
|
56307
56407
|
definitions: Object.entries(lists).flatMap(
|
|
56308
|
-
([
|
|
56408
|
+
([name, { selection: selection2, type }]) => {
|
|
56309
56409
|
const schemaType = config2.schema.getType(type.name);
|
|
56310
56410
|
if (!selection2) {
|
|
56311
56411
|
throw new HoudiniError({ message: "Lists must have a selection" });
|
|
@@ -56325,7 +56425,7 @@ async function addListFragments(config2, documents) {
|
|
|
56325
56425
|
return [
|
|
56326
56426
|
{
|
|
56327
56427
|
name: {
|
|
56328
|
-
value: config2.listInsertFragment(
|
|
56428
|
+
value: config2.listInsertFragment(name),
|
|
56329
56429
|
kind: graphql9.Kind.NAME
|
|
56330
56430
|
},
|
|
56331
56431
|
kind: graphql9.Kind.FRAGMENT_DEFINITION,
|
|
@@ -56340,7 +56440,7 @@ async function addListFragments(config2, documents) {
|
|
|
56340
56440
|
},
|
|
56341
56441
|
{
|
|
56342
56442
|
name: {
|
|
56343
|
-
value: config2.listToggleFragment(
|
|
56443
|
+
value: config2.listToggleFragment(name),
|
|
56344
56444
|
kind: graphql9.Kind.NAME
|
|
56345
56445
|
},
|
|
56346
56446
|
kind: graphql9.Kind.FRAGMENT_DEFINITION,
|
|
@@ -56356,7 +56456,7 @@ async function addListFragments(config2, documents) {
|
|
|
56356
56456
|
{
|
|
56357
56457
|
kind: graphql9.Kind.FRAGMENT_DEFINITION,
|
|
56358
56458
|
name: {
|
|
56359
|
-
value: config2.listRemoveFragment(
|
|
56459
|
+
value: config2.listRemoveFragment(name),
|
|
56360
56460
|
kind: graphql9.Kind.NAME
|
|
56361
56461
|
},
|
|
56362
56462
|
selectionSet: {
|
|
@@ -56400,7 +56500,8 @@ async function addListFragments(config2, documents) {
|
|
|
56400
56500
|
document: generatedDoc,
|
|
56401
56501
|
originalDocument: generatedDoc,
|
|
56402
56502
|
filename: "generated::lists",
|
|
56403
|
-
originalString: ""
|
|
56503
|
+
originalString: "",
|
|
56504
|
+
artifact: null
|
|
56404
56505
|
});
|
|
56405
56506
|
}
|
|
56406
56507
|
function connectionSelection(config2, field, type, selection2) {
|
|
@@ -56804,19 +56905,20 @@ function artifactGenerator(stats) {
|
|
|
56804
56905
|
});
|
|
56805
56906
|
}
|
|
56806
56907
|
const listOfArtifacts = [];
|
|
56908
|
+
const hash = config2.plugins?.find((plugin2) => plugin2.hash)?.hash ?? hashDocument;
|
|
56807
56909
|
await Promise.all(
|
|
56808
56910
|
[
|
|
56809
56911
|
writeIndexFile(config2, docs)
|
|
56810
56912
|
].concat(
|
|
56811
56913
|
docs.map(async (doc) => {
|
|
56812
|
-
const { document, name
|
|
56914
|
+
const { document, name, generateArtifact } = doc;
|
|
56813
56915
|
if (!generateArtifact) {
|
|
56814
56916
|
return;
|
|
56815
56917
|
}
|
|
56816
56918
|
const usedVariableNames = /* @__PURE__ */ new Set();
|
|
56817
56919
|
let documentWithoutInternalDirectives = graphql12.visit(document, {
|
|
56818
56920
|
Directive(node) {
|
|
56819
|
-
if (config2.isInternalDirective(node)) {
|
|
56921
|
+
if (config2.isInternalDirective(node.name.value)) {
|
|
56820
56922
|
return null;
|
|
56821
56923
|
}
|
|
56822
56924
|
},
|
|
@@ -56831,8 +56933,8 @@ function artifactGenerator(stats) {
|
|
|
56831
56933
|
documentWithoutInternalDirectives,
|
|
56832
56934
|
{
|
|
56833
56935
|
VariableDefinition(variableDefinitionNode) {
|
|
56834
|
-
const
|
|
56835
|
-
if (!usedVariableNames.has(
|
|
56936
|
+
const name2 = variableDefinitionNode.variable.name.value;
|
|
56937
|
+
if (!usedVariableNames.has(name2)) {
|
|
56836
56938
|
return null;
|
|
56837
56939
|
}
|
|
56838
56940
|
}
|
|
@@ -56866,12 +56968,12 @@ function artifactGenerator(stats) {
|
|
|
56866
56968
|
selectionSet = operation.selectionSet;
|
|
56867
56969
|
} else {
|
|
56868
56970
|
const matchingFragment = fragments.find(
|
|
56869
|
-
(fragment) => fragment.name.value ===
|
|
56971
|
+
(fragment) => fragment.name.value === name
|
|
56870
56972
|
);
|
|
56871
56973
|
if (!matchingFragment) {
|
|
56872
56974
|
throw new HoudiniError({
|
|
56873
56975
|
filepath: doc.filename,
|
|
56874
|
-
message: `Fragment "${
|
|
56976
|
+
message: `Fragment "${name}" doesn't exist in its own document?!`
|
|
56875
56977
|
});
|
|
56876
56978
|
}
|
|
56877
56979
|
rootType = matchingFragment.typeCondition.name.value;
|
|
@@ -56900,10 +57002,10 @@ function artifactGenerator(stats) {
|
|
|
56900
57002
|
ignoreMaskDisable: docKind === "HoudiniQuery",
|
|
56901
57003
|
applyFragments: docKind !== "HoudiniFragment"
|
|
56902
57004
|
});
|
|
56903
|
-
|
|
56904
|
-
name
|
|
57005
|
+
let artifact = {
|
|
57006
|
+
name,
|
|
56905
57007
|
kind: docKind,
|
|
56906
|
-
hash:
|
|
57008
|
+
hash: hash({ config: config2, document: doc }),
|
|
56907
57009
|
refetch: doc.refetch,
|
|
56908
57010
|
raw: rawString,
|
|
56909
57011
|
rootType,
|
|
@@ -56922,27 +57024,27 @@ function artifactGenerator(stats) {
|
|
|
56922
57024
|
document: doc
|
|
56923
57025
|
})
|
|
56924
57026
|
};
|
|
56925
|
-
const
|
|
56926
|
-
(prev,
|
|
56927
|
-
if (!
|
|
57027
|
+
const plugin_data = config2.plugins.reduce(
|
|
57028
|
+
(prev, plugin2) => {
|
|
57029
|
+
if (!plugin2.artifact_data) {
|
|
56928
57030
|
return prev;
|
|
56929
57031
|
}
|
|
56930
57032
|
const result = { ...prev };
|
|
56931
|
-
const dataToAdd =
|
|
57033
|
+
const dataToAdd = plugin2.artifact_data({ config: config2, document: doc }) ?? {};
|
|
56932
57034
|
if (Object.keys(dataToAdd).length > 0) {
|
|
56933
|
-
result[
|
|
57035
|
+
result[plugin2.name] = dataToAdd;
|
|
56934
57036
|
}
|
|
56935
57037
|
return result;
|
|
56936
57038
|
},
|
|
56937
57039
|
{}
|
|
56938
57040
|
);
|
|
56939
|
-
if (Object.keys(
|
|
56940
|
-
artifact.
|
|
57041
|
+
if (Object.keys(plugin_data).length > 0) {
|
|
57042
|
+
artifact.plugin_data = plugin_data;
|
|
56941
57043
|
}
|
|
56942
57044
|
if (inputs && inputs.length > 0) {
|
|
56943
57045
|
artifact.input = inputObject(config2, inputs);
|
|
56944
57046
|
}
|
|
56945
|
-
if (
|
|
57047
|
+
if (artifact.kind === "HoudiniQuery") {
|
|
56946
57048
|
const cacheDirective = operations[0].directives?.find(
|
|
56947
57049
|
(directive2) => directive2.name.value === config2.cacheDirective
|
|
56948
57050
|
);
|
|
@@ -56955,7 +57057,7 @@ function artifactGenerator(stats) {
|
|
|
56955
57057
|
{}
|
|
56956
57058
|
) || {};
|
|
56957
57059
|
const policy = args[config2.cachePolicyArg];
|
|
56958
|
-
if (policy && policy.value.kind === "EnumValue") {
|
|
57060
|
+
if (policy && policy.value.kind === "EnumValue" && policy.value.value) {
|
|
56959
57061
|
artifact.policy = policy.value.value;
|
|
56960
57062
|
} else {
|
|
56961
57063
|
artifact.policy = config2.defaultCachePolicy;
|
|
@@ -56971,10 +57073,17 @@ function artifactGenerator(stats) {
|
|
|
56971
57073
|
artifact.partial = config2.defaultPartial;
|
|
56972
57074
|
}
|
|
56973
57075
|
}
|
|
57076
|
+
doc.artifact = artifact;
|
|
57077
|
+
for (const plugin2 of config2.plugins) {
|
|
57078
|
+
if (!plugin2.artifact_end) {
|
|
57079
|
+
continue;
|
|
57080
|
+
}
|
|
57081
|
+
plugin2.artifact_end({ config: config2, document: doc });
|
|
57082
|
+
}
|
|
56974
57083
|
const file = AST5.program([
|
|
56975
57084
|
moduleExport(config2, "default", serializeValue(artifact)),
|
|
56976
57085
|
AST5.expressionStatement(
|
|
56977
|
-
AST5.stringLiteral(`HoudiniHash=${
|
|
57086
|
+
AST5.stringLiteral(`HoudiniHash=${hash({ config: config2, document: doc })}`)
|
|
56978
57087
|
)
|
|
56979
57088
|
]);
|
|
56980
57089
|
const artifactPath = config2.artifactPath(document);
|
|
@@ -56991,7 +57100,7 @@ function artifactGenerator(stats) {
|
|
|
56991
57100
|
return;
|
|
56992
57101
|
}
|
|
56993
57102
|
const match = existingArtifact && existingArtifact.match(/"HoudiniHash=(\w+)"/);
|
|
56994
|
-
if (match && match[1] !==
|
|
57103
|
+
if (match && match[1] !== hash({ config: config2, document: doc })) {
|
|
56995
57104
|
stats.changed.push(artifact.name);
|
|
56996
57105
|
}
|
|
56997
57106
|
stats.total.push(artifact.name);
|
|
@@ -57010,7 +57119,7 @@ async function generateGraphqlReturnTypes(config2, docs) {
|
|
|
57010
57119
|
const fileContent = await fs_exports.readFile(indexPath) || "";
|
|
57011
57120
|
const contents = await parseJS(fileContent);
|
|
57012
57121
|
const graphql_tag_return = config2.plugins.find(
|
|
57013
|
-
(
|
|
57122
|
+
(plugin2) => plugin2.graphql_tag_return
|
|
57014
57123
|
)?.graphql_tag_return;
|
|
57015
57124
|
if (!graphql_tag_return || !contents) {
|
|
57016
57125
|
return fileContent;
|
|
@@ -57019,7 +57128,7 @@ async function generateGraphqlReturnTypes(config2, docs) {
|
|
|
57019
57128
|
for (const doc of docs) {
|
|
57020
57129
|
const return_value = graphql_tag_return({
|
|
57021
57130
|
config: config2,
|
|
57022
|
-
doc,
|
|
57131
|
+
document: doc,
|
|
57023
57132
|
ensure_import({ identifier, module: module2 }) {
|
|
57024
57133
|
ensureImports({
|
|
57025
57134
|
config: config2,
|
|
@@ -57068,19 +57177,19 @@ async function injectPlugins({
|
|
|
57068
57177
|
importStatement,
|
|
57069
57178
|
exportStatement
|
|
57070
57179
|
}) {
|
|
57071
|
-
const client_plugins = config2.plugins.filter((
|
|
57072
|
-
let plugins =
|
|
57180
|
+
const client_plugins = config2.plugins.filter((plugin2) => plugin2.client_plugins).reduce((acc, plugin2) => {
|
|
57181
|
+
let plugins = plugin2.client_plugins;
|
|
57073
57182
|
if (typeof plugins === "function") {
|
|
57074
|
-
plugins = plugins(config2, config2.pluginConfig(
|
|
57183
|
+
plugins = plugins(config2, config2.pluginConfig(plugin2.name));
|
|
57075
57184
|
}
|
|
57076
57185
|
return [...acc, ...Object.entries(plugins)];
|
|
57077
57186
|
}, []);
|
|
57078
57187
|
return client_plugins.length > 0 ? `
|
|
57079
|
-
${client_plugins.map((
|
|
57188
|
+
${client_plugins.map((plugin2, i) => importStatement(plugin2[0], `plugin${i}`))}
|
|
57080
57189
|
|
|
57081
57190
|
const plugins = [
|
|
57082
|
-
${client_plugins.map((
|
|
57083
|
-
const suffix =
|
|
57191
|
+
${client_plugins.map((plugin2, i) => {
|
|
57192
|
+
const suffix = `(${JSON.stringify(plugin2[1])})`;
|
|
57084
57193
|
return `plugin${i}${suffix}`;
|
|
57085
57194
|
}).join(",\n")}
|
|
57086
57195
|
]
|
|
@@ -57123,37 +57232,35 @@ ${exportStatement("config")}
|
|
|
57123
57232
|
},
|
|
57124
57233
|
[path_exports.join(config2.runtimeSource, "client", "plugins", "injectedPlugins.js")]: (content) => injectPlugins({ config: config2, content, importStatement, exportStatement })
|
|
57125
57234
|
}),
|
|
57126
|
-
...config2.plugins.filter((
|
|
57235
|
+
...config2.plugins.filter((plugin2) => plugin2.include_runtime).map((plugin2) => generatePluginRuntime(config2, plugin2)),
|
|
57127
57236
|
generatePluginIndex({ config: config2, exportStatement: exportStar })
|
|
57128
57237
|
]);
|
|
57129
57238
|
await generateGraphqlReturnTypes(config2, docs);
|
|
57130
57239
|
}
|
|
57131
|
-
async function generatePluginRuntime(config2,
|
|
57132
|
-
if (houdini_mode.is_testing) {
|
|
57240
|
+
async function generatePluginRuntime(config2, plugin2) {
|
|
57241
|
+
if (houdini_mode.is_testing || !plugin2.include_runtime) {
|
|
57133
57242
|
return;
|
|
57134
57243
|
}
|
|
57135
|
-
const
|
|
57136
|
-
|
|
57137
|
-
"
|
|
57138
|
-
"runtime-" + (config2.module === "esm" ? "esm" : "cjs")
|
|
57244
|
+
const runtime_path = path_exports.join(
|
|
57245
|
+
path_exports.dirname(plugin2.filepath),
|
|
57246
|
+
typeof plugin2.include_runtime === "string" ? plugin2.include_runtime : plugin2.include_runtime[config2.module]
|
|
57139
57247
|
);
|
|
57140
57248
|
try {
|
|
57141
|
-
await fs_exports.stat(
|
|
57249
|
+
await fs_exports.stat(runtime_path);
|
|
57142
57250
|
} catch {
|
|
57143
57251
|
throw new HoudiniError({
|
|
57144
|
-
message:
|
|
57145
|
-
description: "
|
|
57252
|
+
message: "Cannot find runtime to generate for " + plugin2.name,
|
|
57253
|
+
description: "Maybe it was bundled?"
|
|
57146
57254
|
});
|
|
57147
57255
|
}
|
|
57148
|
-
const
|
|
57149
|
-
const pluginDir = config2.pluginRuntimeDirectory(plugin.name);
|
|
57256
|
+
const pluginDir = config2.pluginRuntimeDirectory(plugin2.name);
|
|
57150
57257
|
await fs_exports.mkdirp(pluginDir);
|
|
57151
57258
|
await fs_exports.recursiveCopy(
|
|
57152
|
-
|
|
57259
|
+
runtime_path,
|
|
57153
57260
|
pluginDir,
|
|
57154
57261
|
Object.fromEntries(
|
|
57155
|
-
Object.entries(
|
|
57156
|
-
path_exports.join(
|
|
57262
|
+
Object.entries(plugin2.transform_runtime ?? {}).map(([key, value]) => [
|
|
57263
|
+
path_exports.join(runtime_path, key),
|
|
57157
57264
|
(content) => value({ config: config2, content })
|
|
57158
57265
|
])
|
|
57159
57266
|
)
|
|
@@ -57554,7 +57661,7 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
57554
57661
|
}
|
|
57555
57662
|
const missingScalars = /* @__PURE__ */ new Set();
|
|
57556
57663
|
await Promise.all(
|
|
57557
|
-
docs.map(async ({ originalDocument, name
|
|
57664
|
+
docs.map(async ({ originalDocument, name, filename, generateArtifact }) => {
|
|
57558
57665
|
if (!generateArtifact) {
|
|
57559
57666
|
return;
|
|
57560
57667
|
}
|
|
@@ -57562,7 +57669,7 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
57562
57669
|
const program = AST11.program([]);
|
|
57563
57670
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
57564
57671
|
let definition = originalDocument.definitions.find(
|
|
57565
|
-
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value ===
|
|
57672
|
+
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value === name
|
|
57566
57673
|
);
|
|
57567
57674
|
const selections = flattenSelections({
|
|
57568
57675
|
config: config2,
|
|
@@ -57616,22 +57723,22 @@ export { default as ${as} } from "${module2}"
|
|
|
57616
57723
|
export * from "${module2}"
|
|
57617
57724
|
`;
|
|
57618
57725
|
let indexContent = recast11.print(typeIndex).code;
|
|
57619
|
-
for (const
|
|
57620
|
-
if (!
|
|
57726
|
+
for (const plugin2 of config2.plugins) {
|
|
57727
|
+
if (!plugin2.index_file) {
|
|
57621
57728
|
continue;
|
|
57622
57729
|
}
|
|
57623
|
-
indexContent =
|
|
57730
|
+
indexContent = plugin2.index_file({
|
|
57624
57731
|
config: config2,
|
|
57625
57732
|
content: indexContent,
|
|
57626
57733
|
export_default_as,
|
|
57627
57734
|
export_star_from,
|
|
57628
|
-
plugin_root: config2.pluginDirectory(
|
|
57735
|
+
plugin_root: config2.pluginDirectory(plugin2.name),
|
|
57629
57736
|
typedef: true,
|
|
57630
57737
|
documents: docs
|
|
57631
57738
|
});
|
|
57632
|
-
if (
|
|
57739
|
+
if (plugin2.include_runtime) {
|
|
57633
57740
|
indexContent += export_star_from({
|
|
57634
|
-
module: "./" + path_exports.relative(config2.rootDir, config2.pluginRuntimeDirectory(
|
|
57741
|
+
module: "./" + path_exports.relative(config2.rootDir, config2.pluginRuntimeDirectory(plugin2.name))
|
|
57635
57742
|
});
|
|
57636
57743
|
}
|
|
57637
57744
|
}
|
|
@@ -57877,9 +57984,9 @@ var graphql17 = __toESM(require_graphql2(), 1);
|
|
|
57877
57984
|
var recast12 = __toESM(require_main2(), 1);
|
|
57878
57985
|
var AST12 = recast12.types.builders;
|
|
57879
57986
|
async function imperativeCacheTypef(config2, docs) {
|
|
57880
|
-
const returnType = (doc) => config2.plugins.find((
|
|
57987
|
+
const returnType = (doc) => config2.plugins.find((plugin2) => plugin2.graphql_tag_return)?.graphql_tag_return?.({
|
|
57881
57988
|
config: config2,
|
|
57882
|
-
doc,
|
|
57989
|
+
document: doc,
|
|
57883
57990
|
ensure_import({ identifier, module: module2 }) {
|
|
57884
57991
|
ensureImports({
|
|
57885
57992
|
config: config2,
|
|
@@ -58224,12 +58331,12 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
58224
58331
|
}, {});
|
|
58225
58332
|
}
|
|
58226
58333
|
var CacheTypeDefName = "CacheTypeDef";
|
|
58227
|
-
function record(
|
|
58334
|
+
function record(name) {
|
|
58228
58335
|
return AST12.tsTypeReference(
|
|
58229
58336
|
AST12.identifier("Record"),
|
|
58230
58337
|
AST12.tsTypeParameterInstantiation([
|
|
58231
58338
|
AST12.tsTypeReference(AST12.identifier(CacheTypeDefName)),
|
|
58232
|
-
AST12.tsLiteralType(AST12.stringLiteral(
|
|
58339
|
+
AST12.tsLiteralType(AST12.stringLiteral(name))
|
|
58233
58340
|
])
|
|
58234
58341
|
);
|
|
58235
58342
|
}
|
|
@@ -58258,7 +58365,7 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
58258
58365
|
let rawString = graphql18.print(
|
|
58259
58366
|
graphql18.visit(document, {
|
|
58260
58367
|
Directive(node) {
|
|
58261
|
-
if (config2.isInternalDirective(node)) {
|
|
58368
|
+
if (config2.isInternalDirective(node.name.value)) {
|
|
58262
58369
|
return null;
|
|
58263
58370
|
}
|
|
58264
58371
|
}
|
|
@@ -58268,7 +58375,7 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
58268
58375
|
({ kind }) => kind === graphql18.Kind.OPERATION_DEFINITION
|
|
58269
58376
|
);
|
|
58270
58377
|
if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
|
|
58271
|
-
acc[hashDocument(rawString)] = rawString;
|
|
58378
|
+
acc[hashDocument({ config: config2, document: rawString })] = rawString;
|
|
58272
58379
|
}
|
|
58273
58380
|
return acc;
|
|
58274
58381
|
}, {});
|
|
@@ -58288,10 +58395,10 @@ async function definitionsGenerator(config2) {
|
|
|
58288
58395
|
const runtimeDefinitions = recast13.print(
|
|
58289
58396
|
AST13.program(
|
|
58290
58397
|
enums.map((defn) => {
|
|
58291
|
-
const
|
|
58398
|
+
const name = defn.name.value;
|
|
58292
58399
|
return moduleExport(
|
|
58293
58400
|
config2,
|
|
58294
|
-
|
|
58401
|
+
name,
|
|
58295
58402
|
AST13.objectExpression(
|
|
58296
58403
|
defn.values?.map((value) => {
|
|
58297
58404
|
const str = value.name.value;
|
|
@@ -58348,24 +58455,24 @@ async function writeIndexFile2(config2, docs) {
|
|
|
58348
58455
|
export_star_from({ module: artifactDir }),
|
|
58349
58456
|
export_star_from({ module: definitionsDir })
|
|
58350
58457
|
].join("");
|
|
58351
|
-
for (const
|
|
58352
|
-
if (
|
|
58353
|
-
body =
|
|
58458
|
+
for (const plugin2 of config2.plugins) {
|
|
58459
|
+
if (plugin2.index_file) {
|
|
58460
|
+
body = plugin2.index_file({
|
|
58354
58461
|
config: config2,
|
|
58355
58462
|
content: body,
|
|
58356
58463
|
export_default_as,
|
|
58357
58464
|
export_star_from,
|
|
58358
|
-
plugin_root: config2.pluginDirectory(
|
|
58465
|
+
plugin_root: config2.pluginDirectory(plugin2.name),
|
|
58359
58466
|
typedef: false,
|
|
58360
58467
|
documents: docs
|
|
58361
58468
|
});
|
|
58362
58469
|
}
|
|
58363
|
-
if (
|
|
58470
|
+
if (plugin2.include_runtime) {
|
|
58364
58471
|
body += export_star_from({
|
|
58365
|
-
module: relative2(config2.pluginRuntimeDirectory(
|
|
58472
|
+
module: relative2(config2.pluginRuntimeDirectory(plugin2.name))
|
|
58366
58473
|
});
|
|
58367
58474
|
}
|
|
58368
|
-
if (!
|
|
58475
|
+
if (!plugin2.index_file) {
|
|
58369
58476
|
continue;
|
|
58370
58477
|
}
|
|
58371
58478
|
}
|
|
@@ -58375,7 +58482,7 @@ async function writeIndexFile2(config2, docs) {
|
|
|
58375
58482
|
// src/codegen/transforms/schema.ts
|
|
58376
58483
|
var graphql20 = __toESM(require_graphql2(), 1);
|
|
58377
58484
|
async function graphqlExtensions(config2, documents) {
|
|
58378
|
-
|
|
58485
|
+
let internalSchema = `
|
|
58379
58486
|
enum CachePolicy {
|
|
58380
58487
|
${"CacheAndNetwork" /* CacheAndNetwork */}
|
|
58381
58488
|
${"CacheOnly" /* CacheOnly */}
|
|
@@ -58416,6 +58523,7 @@ directive @${config2.listAllListsDirective} on FRAGMENT_SPREAD
|
|
|
58416
58523
|
"""
|
|
58417
58524
|
directive @${config2.listParentDirective}(value: ID!) on FRAGMENT_SPREAD
|
|
58418
58525
|
|
|
58526
|
+
|
|
58419
58527
|
"""
|
|
58420
58528
|
@${config2.whenDirective} is used to provide a conditional or in situations where it doesn't make sense (eg when removing or deleting a node.)
|
|
58421
58529
|
"""
|
|
@@ -58431,6 +58539,11 @@ directive @${config2.whenNotDirective} on FRAGMENT_SPREAD
|
|
|
58431
58539
|
"""
|
|
58432
58540
|
directive @${config2.argumentsDirective} on FRAGMENT_DEFINITION
|
|
58433
58541
|
|
|
58542
|
+
"""
|
|
58543
|
+
@${config2.withDirective} is used to provide arguments to fragments that have been marked with @${config2.argumentsDirective}
|
|
58544
|
+
"""
|
|
58545
|
+
directive @${config2.withDirective} on FRAGMENT_SPREAD
|
|
58546
|
+
|
|
58434
58547
|
"""
|
|
58435
58548
|
@${config2.cacheDirective} is used to specify cache rules for a query
|
|
58436
58549
|
"""
|
|
@@ -58451,6 +58564,12 @@ directive @${config2.maskEnableDirective} on FRAGMENT_SPREAD
|
|
|
58451
58564
|
"""
|
|
58452
58565
|
directive @${config2.maskDisableDirective} on FRAGMENT_SPREAD
|
|
58453
58566
|
`;
|
|
58567
|
+
for (const plugin2 of config2.plugins) {
|
|
58568
|
+
if (!plugin2.schema) {
|
|
58569
|
+
continue;
|
|
58570
|
+
}
|
|
58571
|
+
internalSchema += plugin2.schema({ config: config2 });
|
|
58572
|
+
}
|
|
58454
58573
|
let currentSchema = graphql20.printSchema(config2.schema);
|
|
58455
58574
|
if (!currentSchema.includes(`directive @${config2.listDirective}`)) {
|
|
58456
58575
|
currentSchema += internalSchema;
|
|
@@ -58633,7 +58752,7 @@ async function typeCheck(config2, docs) {
|
|
|
58633
58752
|
}
|
|
58634
58753
|
needsParent = needsParent || definition.kind === "FragmentDefinition";
|
|
58635
58754
|
const nameArg = directive.arguments?.find(
|
|
58636
|
-
({ name
|
|
58755
|
+
({ name }) => name.value === config2.listNameArg
|
|
58637
58756
|
);
|
|
58638
58757
|
if (!nameArg) {
|
|
58639
58758
|
if (directive.name.value === config2.listDirective) {
|
|
@@ -58803,14 +58922,14 @@ var validateLists = ({
|
|
|
58803
58922
|
return;
|
|
58804
58923
|
}
|
|
58805
58924
|
let directive = node.directives?.find(
|
|
58806
|
-
({ name
|
|
58925
|
+
({ name }) => name.value === config2.listParentDirective
|
|
58807
58926
|
);
|
|
58808
58927
|
if (directive) {
|
|
58809
58928
|
return;
|
|
58810
58929
|
}
|
|
58811
58930
|
let parentIdFound = false;
|
|
58812
|
-
directive = node.directives?.find(({ name
|
|
58813
|
-
[config2.listPrependDirective, config2.listAppendDirective].includes(
|
|
58931
|
+
directive = node.directives?.find(({ name }) => [
|
|
58932
|
+
[config2.listPrependDirective, config2.listAppendDirective].includes(name.value)
|
|
58814
58933
|
]);
|
|
58815
58934
|
if (directive) {
|
|
58816
58935
|
let parentArg = directive.arguments?.find(
|
|
@@ -58828,7 +58947,7 @@ var validateLists = ({
|
|
|
58828
58947
|
return;
|
|
58829
58948
|
}
|
|
58830
58949
|
const allLists = node.directives?.find(
|
|
58831
|
-
({ name
|
|
58950
|
+
({ name }) => config2.listAllListsDirective === name.value
|
|
58832
58951
|
);
|
|
58833
58952
|
if (allLists || config2.defaultListTarget === "all") {
|
|
58834
58953
|
return;
|
|
@@ -58850,7 +58969,7 @@ var validateLists = ({
|
|
|
58850
58969
|
);
|
|
58851
58970
|
return;
|
|
58852
58971
|
}
|
|
58853
|
-
if (!config2.isInternalDirective(node)) {
|
|
58972
|
+
if (!config2.isInternalDirective(node.name.value)) {
|
|
58854
58973
|
if (!config2.schema.getDirective(directiveName)) {
|
|
58855
58974
|
ctx.reportError(
|
|
58856
58975
|
new graphql23.GraphQLError(
|
|
@@ -58993,9 +59112,9 @@ function validateFragmentArguments(config2, filepath, fragments) {
|
|
|
58993
59112
|
);
|
|
58994
59113
|
} else {
|
|
58995
59114
|
const zipped = appliedArgumentNames.map(
|
|
58996
|
-
(
|
|
58997
|
-
appliedArguments[
|
|
58998
|
-
fragmentArguments2[fragmentName].find((arg) => arg.name ===
|
|
59115
|
+
(name) => [
|
|
59116
|
+
appliedArguments[name],
|
|
59117
|
+
fragmentArguments2[fragmentName].find((arg) => arg.name === name).type
|
|
58999
59118
|
]
|
|
59000
59119
|
);
|
|
59001
59120
|
for (const [applied, target] of zipped) {
|
|
@@ -59321,9 +59440,9 @@ For more information, please visit these links:
|
|
|
59321
59440
|
// src/codegen/validators/uniqueNames.ts
|
|
59322
59441
|
async function uniqueDocumentNames(config2, docs) {
|
|
59323
59442
|
const nameMap = docs.reduce(
|
|
59324
|
-
(acc, { name
|
|
59443
|
+
(acc, { name, filename }) => ({
|
|
59325
59444
|
...acc,
|
|
59326
|
-
[
|
|
59445
|
+
[name]: [...acc[name] || [], filename]
|
|
59327
59446
|
}),
|
|
59328
59447
|
{}
|
|
59329
59448
|
);
|
|
@@ -59370,12 +59489,12 @@ async function noIDAlias(config2, docs) {
|
|
|
59370
59489
|
// src/codegen/validators/plugins.ts
|
|
59371
59490
|
async function validatePlugins(config2, documents) {
|
|
59372
59491
|
let errors = [];
|
|
59373
|
-
for (const
|
|
59374
|
-
if (!
|
|
59492
|
+
for (const plugin2 of config2.plugins) {
|
|
59493
|
+
if (!plugin2.validate) {
|
|
59375
59494
|
continue;
|
|
59376
59495
|
}
|
|
59377
59496
|
try {
|
|
59378
|
-
await
|
|
59497
|
+
await plugin2.validate({ config: config2, documents });
|
|
59379
59498
|
} catch (err) {
|
|
59380
59499
|
errors.push(err);
|
|
59381
59500
|
}
|
|
@@ -59400,40 +59519,55 @@ async function runPipeline2(config2, docs) {
|
|
|
59400
59519
|
new: [],
|
|
59401
59520
|
deleted: []
|
|
59402
59521
|
};
|
|
59403
|
-
const generatePlugins = config2.plugins.filter((
|
|
59522
|
+
const generatePlugins = config2.plugins.filter((plugin2) => plugin2.generate);
|
|
59523
|
+
const after_validate = config2.plugins.filter((plugin2) => plugin2.after_validate).map((plugin2) => plugin2.after_validate);
|
|
59524
|
+
const validate2 = config2.plugins.filter((plugin2) => plugin2.validate).map((plugin2) => plugin2.validate);
|
|
59525
|
+
const before_validate = config2.plugins.filter((plugin2) => plugin2.before_validate).map((plugin2) => plugin2.before_validate);
|
|
59526
|
+
const transform_before_generate = config2.plugins.filter((plugin2) => plugin2.transform_before_generate).map((plugin2) => plugin2.transform_before_generate);
|
|
59527
|
+
const wrapHook = (hooks) => hooks.map(
|
|
59528
|
+
(fn) => (config3, docs2) => fn({
|
|
59529
|
+
config: config3,
|
|
59530
|
+
documents: docs2
|
|
59531
|
+
})
|
|
59532
|
+
);
|
|
59404
59533
|
let error = null;
|
|
59405
59534
|
try {
|
|
59406
59535
|
await runPipeline(
|
|
59407
59536
|
config2,
|
|
59408
59537
|
[
|
|
59538
|
+
graphqlExtensions,
|
|
59539
|
+
...wrapHook(before_validate),
|
|
59409
59540
|
typeCheck,
|
|
59410
59541
|
uniqueDocumentNames,
|
|
59411
59542
|
noIDAlias,
|
|
59412
59543
|
validatePlugins,
|
|
59413
|
-
|
|
59544
|
+
...wrapHook(validate2),
|
|
59545
|
+
...wrapHook(after_validate),
|
|
59414
59546
|
addID,
|
|
59415
59547
|
addTypename,
|
|
59416
59548
|
addListFragments,
|
|
59417
59549
|
paginate,
|
|
59418
59550
|
fragmentVariables,
|
|
59419
59551
|
includeFragmentDefinitions,
|
|
59552
|
+
...wrapHook(transform_before_generate),
|
|
59553
|
+
artifactGenerator(artifactStats),
|
|
59420
59554
|
runtimeGenerator,
|
|
59421
59555
|
writeIndexFile2,
|
|
59422
|
-
artifactGenerator(artifactStats),
|
|
59423
59556
|
typescriptGenerator,
|
|
59424
59557
|
persistOutputGenerator,
|
|
59425
59558
|
schemaGenerator,
|
|
59426
59559
|
...generatePlugins.map(
|
|
59427
|
-
(
|
|
59560
|
+
(plugin2) => async (config3, docs2) => await plugin2.generate({
|
|
59428
59561
|
config: config3,
|
|
59429
59562
|
documents: docs2,
|
|
59430
|
-
plugin_root: config3.pluginDirectory(
|
|
59563
|
+
plugin_root: config3.pluginDirectory(plugin2.name)
|
|
59431
59564
|
})
|
|
59432
59565
|
)
|
|
59433
59566
|
],
|
|
59434
59567
|
docs
|
|
59435
59568
|
);
|
|
59436
59569
|
} catch (e) {
|
|
59570
|
+
console.log(e);
|
|
59437
59571
|
error = e;
|
|
59438
59572
|
}
|
|
59439
59573
|
const unchanged = artifactStats.total.length - artifactStats.changed.length - artifactStats.new.length - artifactStats.deleted.length;
|
|
@@ -59482,15 +59616,19 @@ async function collectDocuments(config2) {
|
|
|
59482
59616
|
".js": [],
|
|
59483
59617
|
".ts": []
|
|
59484
59618
|
};
|
|
59485
|
-
for (const
|
|
59486
|
-
if (
|
|
59487
|
-
for (const extension of
|
|
59488
|
-
extractors[extension] = [...extractors[extension] || [],
|
|
59619
|
+
for (const plugin2 of config2.plugins) {
|
|
59620
|
+
if (plugin2.extensions && plugin2.extract_documents) {
|
|
59621
|
+
for (const extension of plugin2.extensions) {
|
|
59622
|
+
extractors[extension] = [...extractors[extension] || [], plugin2.extract_documents];
|
|
59489
59623
|
}
|
|
59490
59624
|
}
|
|
59491
59625
|
}
|
|
59492
|
-
const graphql_extractor = (
|
|
59493
|
-
|
|
59626
|
+
const graphql_extractor = ({
|
|
59627
|
+
content
|
|
59628
|
+
}) => [content];
|
|
59629
|
+
const javascript_extractor = ({
|
|
59630
|
+
content
|
|
59631
|
+
}) => processJSFile(config2, content);
|
|
59494
59632
|
extractors[".ts"].push(javascript_extractor);
|
|
59495
59633
|
extractors[".js"].push(javascript_extractor);
|
|
59496
59634
|
extractors[".graphql"].push(graphql_extractor);
|
|
@@ -59514,8 +59652,8 @@ async function collectDocuments(config2) {
|
|
|
59514
59652
|
if (!extractor) {
|
|
59515
59653
|
continue;
|
|
59516
59654
|
}
|
|
59517
|
-
const found = await extractor(config2, filepath, contents);
|
|
59518
|
-
if (found.length > 0) {
|
|
59655
|
+
const found = await extractor({ config: config2, filepath, content: contents });
|
|
59656
|
+
if (found && found.length > 0) {
|
|
59519
59657
|
documents.push(...found.map((document) => ({ filepath, document })));
|
|
59520
59658
|
}
|
|
59521
59659
|
}
|
|
@@ -59545,12 +59683,7 @@ async function processJSFile(config2, contents) {
|
|
|
59545
59683
|
return documents;
|
|
59546
59684
|
}
|
|
59547
59685
|
async function processGraphQLDocument(config2, filepath, document) {
|
|
59548
|
-
|
|
59549
|
-
var parsedDoc = graphql25.parse(document);
|
|
59550
|
-
} catch (e) {
|
|
59551
|
-
console.log("error parsing!!");
|
|
59552
|
-
throw e;
|
|
59553
|
-
}
|
|
59686
|
+
const parsedDoc = graphql25.parse(document);
|
|
59554
59687
|
const operations = parsedDoc.definitions.filter(
|
|
59555
59688
|
({ kind: kind2 }) => kind2 === graphql25.Kind.OPERATION_DEFINITION
|
|
59556
59689
|
);
|
|
@@ -59588,40 +59721,41 @@ async function processGraphQLDocument(config2, filepath, document) {
|
|
|
59588
59721
|
originalDocument: parsedDoc,
|
|
59589
59722
|
generateArtifact: true,
|
|
59590
59723
|
generateStore: true,
|
|
59591
|
-
originalString: document
|
|
59724
|
+
originalString: document,
|
|
59725
|
+
artifact: null
|
|
59592
59726
|
};
|
|
59593
59727
|
}
|
|
59594
|
-
function logStyled(kind, stat2, logLevel,
|
|
59728
|
+
function logStyled(kind, stat2, logLevel, plugin2) {
|
|
59595
59729
|
if (stat2.length > 0) {
|
|
59596
59730
|
const msg = [];
|
|
59597
|
-
if (
|
|
59731
|
+
if (plugin2) {
|
|
59598
59732
|
msg.push(`\u{1F3A9} `);
|
|
59599
59733
|
}
|
|
59600
59734
|
if (kind === "CREATED") {
|
|
59601
59735
|
msg.push(`\u2728 `);
|
|
59602
|
-
if (!
|
|
59736
|
+
if (!plugin2) {
|
|
59603
59737
|
msg.push(`New: ${stat2.length}`);
|
|
59604
59738
|
}
|
|
59605
59739
|
} else if (kind === "UPDATED") {
|
|
59606
59740
|
msg.push(`\u270F\uFE0F `);
|
|
59607
|
-
if (!
|
|
59741
|
+
if (!plugin2) {
|
|
59608
59742
|
msg.push(`Changed: ${stat2.length}`);
|
|
59609
59743
|
}
|
|
59610
59744
|
} else if (kind === "DELETED") {
|
|
59611
59745
|
msg.push(`\u{1F9F9} `);
|
|
59612
|
-
if (!
|
|
59746
|
+
if (!plugin2) {
|
|
59613
59747
|
msg.push(`Deleted: ${stat2.length}`);
|
|
59614
59748
|
}
|
|
59615
59749
|
}
|
|
59616
59750
|
const nbToDisplay = 5;
|
|
59617
|
-
if (
|
|
59751
|
+
if (plugin2) {
|
|
59618
59752
|
msg.push(`${stat2.slice(0, nbToDisplay).join(", ")}`);
|
|
59619
59753
|
if (stat2.length > 5) {
|
|
59620
59754
|
msg.push(`, ... ${stat2.length - nbToDisplay} more`);
|
|
59621
59755
|
}
|
|
59622
59756
|
}
|
|
59623
59757
|
console.log(msg.join(""));
|
|
59624
|
-
if (!
|
|
59758
|
+
if (!plugin2 && logLevel === "summary" /* Summary */) {
|
|
59625
59759
|
for (const artifact of stat2.slice(0, nbToDisplay)) {
|
|
59626
59760
|
console.log(` ${artifact}`);
|
|
59627
59761
|
}
|