@shopify/create-app
Version:
A CLI tool to create a new Shopify app.
1,305 lines (1,286 loc) • 1.44 MB
JavaScript
import {
FormData,
fetch_blob_default,
formDataToBlob
} from "./chunk-25IMI7TH.js";
import {
getPackageManager,
getSession,
packageManagerFromUserAgent,
removeSession,
setSession
} from "./chunk-RYX6V56V.js";
import {
AbortError,
BugError,
Environment,
FatalError,
addPublicMetadata,
addSensitiveMetadata,
ciPlatform,
cloudEnvironment,
currentProcessIsGlobal,
environmentVariables,
firstPartyDev,
import_ts_error,
isCI,
isCloudEnvironment,
isSpin,
isTTY,
isTruthy,
isWsl,
keypress,
macAddress,
openURL,
outputCompleted,
outputContent,
outputDebug,
outputInfo,
outputToken,
platformAndArch,
runWithTimer,
serviceEnvironment,
sessionConstants,
sleep,
spinFqdn,
systemEnvironmentVariables,
themeToken
} from "./chunk-WQCCLXI7.js";
import {
cwd,
sniffForJson
} from "./chunk-Y2JP6WFP.js";
import {
__commonJS,
__require,
__toESM,
init_cjs_shims
} from "./chunk-PKR7KJ6P.js";
// ../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/version.js
var require_version = __commonJS({
"../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/version.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", {
value: !0
});
exports.versionInfo = exports.version = void 0;
var version = "16.10.0";
exports.version = version;
var versionInfo = Object.freeze({
major: 16,
minor: 10,
patch: 0,
preReleaseTag: null
});
exports.versionInfo = versionInfo;
}
});
// ../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/jsutils/devAssert.js
var require_devAssert = __commonJS({
"../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/jsutils/devAssert.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", {
value: !0
});
exports.devAssert = devAssert;
function devAssert(condition, message) {
if (!!!condition)
throw new Error(message);
}
}
});
// ../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/jsutils/isPromise.js
var require_isPromise = __commonJS({
"../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/jsutils/isPromise.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", {
value: !0
});
exports.isPromise = isPromise;
function isPromise(value) {
return typeof value?.then == "function";
}
}
});
// ../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/jsutils/isObjectLike.js
var require_isObjectLike = __commonJS({
"../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/jsutils/isObjectLike.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", {
value: !0
});
exports.isObjectLike = isObjectLike2;
function isObjectLike2(value) {
return typeof value == "object" && value !== null;
}
}
});
// ../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/jsutils/invariant.js
var require_invariant = __commonJS({
"../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/jsutils/invariant.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", {
value: !0
});
exports.invariant = invariant;
function invariant(condition, message) {
if (!!!condition)
throw new Error(
message ?? "Unexpected invariant triggered."
);
}
}
});
// ../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/language/location.js
var require_location = __commonJS({
"../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/language/location.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", {
value: !0
});
exports.getLocation = getLocation;
var _invariant = require_invariant(), LineRegExp = /\r\n|[\n\r]/g;
function getLocation(source, position) {
let lastLineStart = 0, line = 1;
for (let match of source.body.matchAll(LineRegExp)) {
if (typeof match.index == "number" || (0, _invariant.invariant)(!1), match.index >= position)
break;
lastLineStart = match.index + match[0].length, line += 1;
}
return {
line,
column: position + 1 - lastLineStart
};
}
}
});
// ../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/language/printLocation.js
var require_printLocation = __commonJS({
"../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/language/printLocation.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", {
value: !0
});
exports.printLocation = printLocation;
exports.printSourceLocation = printSourceLocation;
var _location = require_location();
function printLocation(location) {
return printSourceLocation(
location.source,
(0, _location.getLocation)(location.source, location.start)
);
}
function printSourceLocation(source, sourceLocation) {
let firstLineColumnOffset = source.locationOffset.column - 1, body = "".padStart(firstLineColumnOffset) + source.body, lineIndex = sourceLocation.line - 1, lineOffset = source.locationOffset.line - 1, lineNum = sourceLocation.line + lineOffset, columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0, columnNum = sourceLocation.column + columnOffset, locationStr = `${source.name}:${lineNum}:${columnNum}
`, lines = body.split(/\r\n|[\n\r]/g), locationLine = lines[lineIndex];
if (locationLine.length > 120) {
let subLineIndex = Math.floor(columnNum / 80), subLineColumnNum = columnNum % 80, subLines = [];
for (let i = 0; i < locationLine.length; i += 80)
subLines.push(locationLine.slice(i, i + 80));
return locationStr + printPrefixedLines([
[`${lineNum} |`, subLines[0]],
...subLines.slice(1, subLineIndex + 1).map((subLine) => ["|", subLine]),
["|", "^".padStart(subLineColumnNum)],
["|", subLines[subLineIndex + 1]]
]);
}
return locationStr + printPrefixedLines([
// Lines specified like this: ["prefix", "string"],
[`${lineNum - 1} |`, lines[lineIndex - 1]],
[`${lineNum} |`, locationLine],
["|", "^".padStart(columnNum)],
[`${lineNum + 1} |`, lines[lineIndex + 1]]
]);
}
function printPrefixedLines(lines) {
let existingLines = lines.filter(([_, line]) => line !== void 0), padLen = Math.max(...existingLines.map(([prefix]) => prefix.length));
return existingLines.map(([prefix, line]) => prefix.padStart(padLen) + (line ? " " + line : "")).join(`
`);
}
}
});
// ../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/error/GraphQLError.js
var require_GraphQLError = __commonJS({
"../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/error/GraphQLError.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", {
value: !0
});
exports.GraphQLError = void 0;
exports.formatError = formatError;
exports.printError = printError;
var _isObjectLike = require_isObjectLike(), _location = require_location(), _printLocation = require_printLocation();
function toNormalizedOptions(args) {
let firstArg = args[0];
return firstArg == null || "kind" in firstArg || "length" in firstArg ? {
nodes: firstArg,
source: args[1],
positions: args[2],
path: args[3],
originalError: args[4],
extensions: args[5]
} : firstArg;
}
var GraphQLError = class _GraphQLError extends Error {
/**
* An array of `{ line, column }` locations within the source GraphQL document
* which correspond to this error.
*
* Errors during validation often contain multiple locations, for example to
* point out two things with the same name. Errors during execution include a
* single location, the field which produced the error.
*
* Enumerable, and appears in the result of JSON.stringify().
*/
/**
* An array describing the JSON-path into the execution response which
* corresponds to this error. Only included for errors during execution.
*
* Enumerable, and appears in the result of JSON.stringify().
*/
/**
* An array of GraphQL AST Nodes corresponding to this error.
*/
/**
* The source GraphQL document for the first location of this error.
*
* Note that if this Error represents more than one node, the source may not
* represent nodes after the first node.
*/
/**
* An array of character offsets within the source GraphQL document
* which correspond to this error.
*/
/**
* The original error thrown from a field resolver during execution.
*/
/**
* Extension fields to add to the formatted error.
*/
/**
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
*/
constructor(message, ...rawArgs) {
var _this$nodes, _nodeLocations$, _ref;
let { nodes, source, positions, path, originalError, extensions } = toNormalizedOptions(rawArgs);
super(message), this.name = "GraphQLError", this.path = path ?? void 0, this.originalError = originalError ?? void 0, this.nodes = undefinedIfEmpty(
Array.isArray(nodes) ? nodes : nodes ? [nodes] : void 0
);
let nodeLocations = undefinedIfEmpty(
(_this$nodes = this.nodes) === null || _this$nodes === void 0 ? void 0 : _this$nodes.map((node) => node.loc).filter((loc) => loc != null)
);
this.source = source ?? (nodeLocations == null || (_nodeLocations$ = nodeLocations[0]) === null || _nodeLocations$ === void 0 ? void 0 : _nodeLocations$.source), this.positions = positions ?? nodeLocations?.map((loc) => loc.start), this.locations = positions && source ? positions.map((pos) => (0, _location.getLocation)(source, pos)) : nodeLocations?.map(
(loc) => (0, _location.getLocation)(loc.source, loc.start)
);
let originalExtensions = (0, _isObjectLike.isObjectLike)(
originalError?.extensions
) ? originalError?.extensions : void 0;
this.extensions = (_ref = extensions ?? originalExtensions) !== null && _ref !== void 0 ? _ref : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
message: {
writable: !0,
enumerable: !0
},
name: {
enumerable: !1
},
nodes: {
enumerable: !1
},
source: {
enumerable: !1
},
positions: {
enumerable: !1
},
originalError: {
enumerable: !1
}
}), originalError != null && originalError.stack ? Object.defineProperty(this, "stack", {
value: originalError.stack,
writable: !0,
configurable: !0
}) : Error.captureStackTrace ? Error.captureStackTrace(this, _GraphQLError) : Object.defineProperty(this, "stack", {
value: Error().stack,
writable: !0,
configurable: !0
});
}
get [Symbol.toStringTag]() {
return "GraphQLError";
}
toString() {
let output = this.message;
if (this.nodes)
for (let node of this.nodes)
node.loc && (output += `
` + (0, _printLocation.printLocation)(node.loc));
else if (this.source && this.locations)
for (let location of this.locations)
output += `
` + (0, _printLocation.printSourceLocation)(this.source, location);
return output;
}
toJSON() {
let formattedError = {
message: this.message
};
return this.locations != null && (formattedError.locations = this.locations), this.path != null && (formattedError.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (formattedError.extensions = this.extensions), formattedError;
}
};
exports.GraphQLError = GraphQLError;
function undefinedIfEmpty(array) {
return array === void 0 || array.length === 0 ? void 0 : array;
}
function printError(error) {
return error.toString();
}
function formatError(error) {
return error.toJSON();
}
}
});
// ../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/error/syntaxError.js
var require_syntaxError = __commonJS({
"../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/error/syntaxError.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", {
value: !0
});
exports.syntaxError = syntaxError;
var _GraphQLError = require_GraphQLError();
function syntaxError(source, position, description) {
return new _GraphQLError.GraphQLError(`Syntax Error: ${description}`, {
source,
positions: [position]
});
}
}
});
// ../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/language/ast.js
var require_ast = __commonJS({
"../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/language/ast.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", {
value: !0
});
exports.Token = exports.QueryDocumentKeys = exports.OperationTypeNode = exports.Location = void 0;
exports.isNode = isNode;
var Location = class {
/**
* The character offset at which this Node begins.
*/
/**
* The character offset at which this Node ends.
*/
/**
* The Token at which this Node begins.
*/
/**
* The Token at which this Node ends.
*/
/**
* The Source document the AST represents.
*/
constructor(startToken, endToken, source) {
this.start = startToken.start, this.end = endToken.end, this.startToken = startToken, this.endToken = endToken, this.source = source;
}
get [Symbol.toStringTag]() {
return "Location";
}
toJSON() {
return {
start: this.start,
end: this.end
};
}
};
exports.Location = Location;
var Token = class {
/**
* The kind of Token.
*/
/**
* The character offset at which this Node begins.
*/
/**
* The character offset at which this Node ends.
*/
/**
* The 1-indexed line number on which this Token appears.
*/
/**
* The 1-indexed column number at which this Token begins.
*/
/**
* For non-punctuation tokens, represents the interpreted value of the token.
*
* Note: is undefined for punctuation tokens, but typed as string for
* convenience in the parser.
*/
/**
* Tokens exist as nodes in a double-linked-list amongst all tokens
* including ignored tokens. <SOF> is always the first node and <EOF>
* the last.
*/
constructor(kind, start, end, line, column, value) {
this.kind = kind, this.start = start, this.end = end, this.line = line, this.column = column, this.value = value, this.prev = null, this.next = null;
}
get [Symbol.toStringTag]() {
return "Token";
}
toJSON() {
return {
kind: this.kind,
value: this.value,
line: this.line,
column: this.column
};
}
};
exports.Token = Token;
var QueryDocumentKeys = {
Name: [],
Document: ["definitions"],
OperationDefinition: [
"name",
"variableDefinitions",
"directives",
"selectionSet"
],
VariableDefinition: ["variable", "type", "defaultValue", "directives"],
Variable: ["name"],
SelectionSet: ["selections"],
Field: ["alias", "name", "arguments", "directives", "selectionSet"],
Argument: ["name", "value"],
FragmentSpread: ["name", "directives"],
InlineFragment: ["typeCondition", "directives", "selectionSet"],
FragmentDefinition: [
"name",
// Note: fragment variable definitions are deprecated and will removed in v17.0.0
"variableDefinitions",
"typeCondition",
"directives",
"selectionSet"
],
IntValue: [],
FloatValue: [],
StringValue: [],
BooleanValue: [],
NullValue: [],
EnumValue: [],
ListValue: ["values"],
ObjectValue: ["fields"],
ObjectField: ["name", "value"],
Directive: ["name", "arguments"],
NamedType: ["name"],
ListType: ["type"],
NonNullType: ["type"],
SchemaDefinition: ["description", "directives", "operationTypes"],
OperationTypeDefinition: ["type"],
ScalarTypeDefinition: ["description", "name", "directives"],
ObjectTypeDefinition: [
"description",
"name",
"interfaces",
"directives",
"fields"
],
FieldDefinition: ["description", "name", "arguments", "type", "directives"],
InputValueDefinition: [
"description",
"name",
"type",
"defaultValue",
"directives"
],
InterfaceTypeDefinition: [
"description",
"name",
"interfaces",
"directives",
"fields"
],
UnionTypeDefinition: ["description", "name", "directives", "types"],
EnumTypeDefinition: ["description", "name", "directives", "values"],
EnumValueDefinition: ["description", "name", "directives"],
InputObjectTypeDefinition: ["description", "name", "directives", "fields"],
DirectiveDefinition: ["description", "name", "arguments", "locations"],
SchemaExtension: ["directives", "operationTypes"],
ScalarTypeExtension: ["name", "directives"],
ObjectTypeExtension: ["name", "interfaces", "directives", "fields"],
InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"],
UnionTypeExtension: ["name", "directives", "types"],
EnumTypeExtension: ["name", "directives", "values"],
InputObjectTypeExtension: ["name", "directives", "fields"]
};
exports.QueryDocumentKeys = QueryDocumentKeys;
var kindValues = new Set(Object.keys(QueryDocumentKeys));
function isNode(maybeNode) {
let maybeKind = maybeNode?.kind;
return typeof maybeKind == "string" && kindValues.has(maybeKind);
}
var OperationTypeNode;
exports.OperationTypeNode = OperationTypeNode;
(function(OperationTypeNode2) {
OperationTypeNode2.QUERY = "query", OperationTypeNode2.MUTATION = "mutation", OperationTypeNode2.SUBSCRIPTION = "subscription";
})(OperationTypeNode || (exports.OperationTypeNode = OperationTypeNode = {}));
}
});
// ../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/language/directiveLocation.js
var require_directiveLocation = __commonJS({
"../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/language/directiveLocation.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", {
value: !0
});
exports.DirectiveLocation = void 0;
var DirectiveLocation;
exports.DirectiveLocation = DirectiveLocation;
(function(DirectiveLocation2) {
DirectiveLocation2.QUERY = "QUERY", DirectiveLocation2.MUTATION = "MUTATION", DirectiveLocation2.SUBSCRIPTION = "SUBSCRIPTION", DirectiveLocation2.FIELD = "FIELD", DirectiveLocation2.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", DirectiveLocation2.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", DirectiveLocation2.INLINE_FRAGMENT = "INLINE_FRAGMENT", DirectiveLocation2.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", DirectiveLocation2.SCHEMA = "SCHEMA", DirectiveLocation2.SCALAR = "SCALAR", DirectiveLocation2.OBJECT = "OBJECT", DirectiveLocation2.FIELD_DEFINITION = "FIELD_DEFINITION", DirectiveLocation2.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", DirectiveLocation2.INTERFACE = "INTERFACE", DirectiveLocation2.UNION = "UNION", DirectiveLocation2.ENUM = "ENUM", DirectiveLocation2.ENUM_VALUE = "ENUM_VALUE", DirectiveLocation2.INPUT_OBJECT = "INPUT_OBJECT", DirectiveLocation2.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
})(DirectiveLocation || (exports.DirectiveLocation = DirectiveLocation = {}));
}
});
// ../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/language/kinds.js
var require_kinds = __commonJS({
"../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/language/kinds.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", {
value: !0
});
exports.Kind = void 0;
var Kind;
exports.Kind = Kind;
(function(Kind2) {
Kind2.NAME = "Name", Kind2.DOCUMENT = "Document", Kind2.OPERATION_DEFINITION = "OperationDefinition", Kind2.VARIABLE_DEFINITION = "VariableDefinition", Kind2.SELECTION_SET = "SelectionSet", Kind2.FIELD = "Field", Kind2.ARGUMENT = "Argument", Kind2.FRAGMENT_SPREAD = "FragmentSpread", Kind2.INLINE_FRAGMENT = "InlineFragment", Kind2.FRAGMENT_DEFINITION = "FragmentDefinition", Kind2.VARIABLE = "Variable", Kind2.INT = "IntValue", Kind2.FLOAT = "FloatValue", Kind2.STRING = "StringValue", Kind2.BOOLEAN = "BooleanValue", Kind2.NULL = "NullValue", Kind2.ENUM = "EnumValue", Kind2.LIST = "ListValue", Kind2.OBJECT = "ObjectValue", Kind2.OBJECT_FIELD = "ObjectField", Kind2.DIRECTIVE = "Directive", Kind2.NAMED_TYPE = "NamedType", Kind2.LIST_TYPE = "ListType", Kind2.NON_NULL_TYPE = "NonNullType", Kind2.SCHEMA_DEFINITION = "SchemaDefinition", Kind2.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", Kind2.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", Kind2.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", Kind2.FIELD_DEFINITION = "FieldDefinition", Kind2.INPUT_VALUE_DEFINITION = "InputValueDefinition", Kind2.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", Kind2.UNION_TYPE_DEFINITION = "UnionTypeDefinition", Kind2.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", Kind2.ENUM_VALUE_DEFINITION = "EnumValueDefinition", Kind2.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", Kind2.DIRECTIVE_DEFINITION = "DirectiveDefinition", Kind2.SCHEMA_EXTENSION = "SchemaExtension", Kind2.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", Kind2.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", Kind2.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", Kind2.UNION_TYPE_EXTENSION = "UnionTypeExtension", Kind2.ENUM_TYPE_EXTENSION = "EnumTypeExtension", Kind2.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
})(Kind || (exports.Kind = Kind = {}));
}
});
// ../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/language/characterClasses.js
var require_characterClasses = __commonJS({
"../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/language/characterClasses.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", {
value: !0
});
exports.isDigit = isDigit;
exports.isLetter = isLetter;
exports.isNameContinue = isNameContinue;
exports.isNameStart = isNameStart;
exports.isWhiteSpace = isWhiteSpace;
function isWhiteSpace(code) {
return code === 9 || code === 32;
}
function isDigit(code) {
return code >= 48 && code <= 57;
}
function isLetter(code) {
return code >= 97 && code <= 122 || // A-Z
code >= 65 && code <= 90;
}
function isNameStart(code) {
return isLetter(code) || code === 95;
}
function isNameContinue(code) {
return isLetter(code) || isDigit(code) || code === 95;
}
}
});
// ../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/language/blockString.js
var require_blockString = __commonJS({
"../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/language/blockString.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", {
value: !0
});
exports.dedentBlockStringLines = dedentBlockStringLines;
exports.isPrintableAsBlockString = isPrintableAsBlockString;
exports.printBlockString = printBlockString;
var _characterClasses = require_characterClasses();
function dedentBlockStringLines(lines) {
var _firstNonEmptyLine2;
let commonIndent = Number.MAX_SAFE_INTEGER, firstNonEmptyLine = null, lastNonEmptyLine = -1;
for (let i = 0; i < lines.length; ++i) {
var _firstNonEmptyLine;
let line = lines[i], indent = leadingWhitespace(line);
indent !== line.length && (firstNonEmptyLine = (_firstNonEmptyLine = firstNonEmptyLine) !== null && _firstNonEmptyLine !== void 0 ? _firstNonEmptyLine : i, lastNonEmptyLine = i, i !== 0 && indent < commonIndent && (commonIndent = indent));
}
return lines.map((line, i) => i === 0 ? line : line.slice(commonIndent)).slice(
(_firstNonEmptyLine2 = firstNonEmptyLine) !== null && _firstNonEmptyLine2 !== void 0 ? _firstNonEmptyLine2 : 0,
lastNonEmptyLine + 1
);
}
function leadingWhitespace(str) {
let i = 0;
for (; i < str.length && (0, _characterClasses.isWhiteSpace)(str.charCodeAt(i)); )
++i;
return i;
}
function isPrintableAsBlockString(value) {
if (value === "")
return !0;
let isEmptyLine = !0, hasIndent = !1, hasCommonIndent = !0, seenNonEmptyLine = !1;
for (let i = 0; i < value.length; ++i)
switch (value.codePointAt(i)) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 11:
case 12:
case 14:
case 15:
return !1;
// Has non-printable characters
case 13:
return !1;
// Has \r or \r\n which will be replaced as \n
case 10:
if (isEmptyLine && !seenNonEmptyLine)
return !1;
seenNonEmptyLine = !0, isEmptyLine = !0, hasIndent = !1;
break;
case 9:
// \t
case 32:
hasIndent || (hasIndent = isEmptyLine);
break;
default:
hasCommonIndent && (hasCommonIndent = hasIndent), isEmptyLine = !1;
}
return !(isEmptyLine || hasCommonIndent && seenNonEmptyLine);
}
function printBlockString(value, options) {
let escapedValue = value.replace(/"""/g, '\\"""'), lines = escapedValue.split(/\r\n|[\n\r]/g), isSingleLine = lines.length === 1, forceLeadingNewLine = lines.length > 1 && lines.slice(1).every(
(line) => line.length === 0 || (0, _characterClasses.isWhiteSpace)(line.charCodeAt(0))
), hasTrailingTripleQuotes = escapedValue.endsWith('\\"""'), hasTrailingQuote = value.endsWith('"') && !hasTrailingTripleQuotes, hasTrailingSlash = value.endsWith("\\"), forceTrailingNewline = hasTrailingQuote || hasTrailingSlash, printAsMultipleLines = !(options != null && options.minimize) && // add leading and trailing new lines only if it improves readability
(!isSingleLine || value.length > 70 || forceTrailingNewline || forceLeadingNewLine || hasTrailingTripleQuotes), result = "", skipLeadingNewLine = isSingleLine && (0, _characterClasses.isWhiteSpace)(value.charCodeAt(0));
return (printAsMultipleLines && !skipLeadingNewLine || forceLeadingNewLine) && (result += `
`), result += escapedValue, (printAsMultipleLines || forceTrailingNewline) && (result += `
`), '"""' + result + '"""';
}
}
});
// ../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/language/tokenKind.js
var require_tokenKind = __commonJS({
"../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/language/tokenKind.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", {
value: !0
});
exports.TokenKind = void 0;
var TokenKind;
exports.TokenKind = TokenKind;
(function(TokenKind2) {
TokenKind2.SOF = "<SOF>", TokenKind2.EOF = "<EOF>", TokenKind2.BANG = "!", TokenKind2.DOLLAR = "$", TokenKind2.AMP = "&", TokenKind2.PAREN_L = "(", TokenKind2.PAREN_R = ")", TokenKind2.SPREAD = "...", TokenKind2.COLON = ":", TokenKind2.EQUALS = "=", TokenKind2.AT = "@", TokenKind2.BRACKET_L = "[", TokenKind2.BRACKET_R = "]", TokenKind2.BRACE_L = "{", TokenKind2.PIPE = "|", TokenKind2.BRACE_R = "}", TokenKind2.NAME = "Name", TokenKind2.INT = "Int", TokenKind2.FLOAT = "Float", TokenKind2.STRING = "String", TokenKind2.BLOCK_STRING = "BlockString", TokenKind2.COMMENT = "Comment";
})(TokenKind || (exports.TokenKind = TokenKind = {}));
}
});
// ../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/language/lexer.js
var require_lexer = __commonJS({
"../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/language/lexer.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", {
value: !0
});
exports.Lexer = void 0;
exports.isPunctuatorTokenKind = isPunctuatorTokenKind;
var _syntaxError = require_syntaxError(), _ast = require_ast(), _blockString = require_blockString(), _characterClasses = require_characterClasses(), _tokenKind = require_tokenKind(), Lexer = class {
/**
* The previously focused non-ignored token.
*/
/**
* The currently focused non-ignored token.
*/
/**
* The (1-indexed) line containing the current token.
*/
/**
* The character offset at which the current line begins.
*/
constructor(source) {
let startOfFileToken = new _ast.Token(
_tokenKind.TokenKind.SOF,
0,
0,
0,
0
);
this.source = source, this.lastToken = startOfFileToken, this.token = startOfFileToken, this.line = 1, this.lineStart = 0;
}
get [Symbol.toStringTag]() {
return "Lexer";
}
/**
* Advances the token stream to the next non-ignored token.
*/
advance() {
return this.lastToken = this.token, this.token = this.lookahead();
}
/**
* Looks ahead and returns the next non-ignored token, but does not change
* the state of Lexer.
*/
lookahead() {
let token = this.token;
if (token.kind !== _tokenKind.TokenKind.EOF)
do
if (token.next)
token = token.next;
else {
let nextToken = readNextToken(this, token.end);
token.next = nextToken, nextToken.prev = token, token = nextToken;
}
while (token.kind === _tokenKind.TokenKind.COMMENT);
return token;
}
};
exports.Lexer = Lexer;
function isPunctuatorTokenKind(kind) {
return kind === _tokenKind.TokenKind.BANG || kind === _tokenKind.TokenKind.DOLLAR || kind === _tokenKind.TokenKind.AMP || kind === _tokenKind.TokenKind.PAREN_L || kind === _tokenKind.TokenKind.PAREN_R || kind === _tokenKind.TokenKind.SPREAD || kind === _tokenKind.TokenKind.COLON || kind === _tokenKind.TokenKind.EQUALS || kind === _tokenKind.TokenKind.AT || kind === _tokenKind.TokenKind.BRACKET_L || kind === _tokenKind.TokenKind.BRACKET_R || kind === _tokenKind.TokenKind.BRACE_L || kind === _tokenKind.TokenKind.PIPE || kind === _tokenKind.TokenKind.BRACE_R;
}
function isUnicodeScalarValue(code) {
return code >= 0 && code <= 55295 || code >= 57344 && code <= 1114111;
}
function isSupplementaryCodePoint(body, location) {
return isLeadingSurrogate(body.charCodeAt(location)) && isTrailingSurrogate(body.charCodeAt(location + 1));
}
function isLeadingSurrogate(code) {
return code >= 55296 && code <= 56319;
}
function isTrailingSurrogate(code) {
return code >= 56320 && code <= 57343;
}
function printCodePointAt(lexer, location) {
let code = lexer.source.body.codePointAt(location);
if (code === void 0)
return _tokenKind.TokenKind.EOF;
if (code >= 32 && code <= 126) {
let char = String.fromCodePoint(code);
return char === '"' ? `'"'` : `"${char}"`;
}
return "U+" + code.toString(16).toUpperCase().padStart(4, "0");
}
function createToken(lexer, kind, start, end, value) {
let line = lexer.line, col = 1 + start - lexer.lineStart;
return new _ast.Token(kind, start, end, line, col, value);
}
function readNextToken(lexer, start) {
let body = lexer.source.body, bodyLength = body.length, position = start;
for (; position < bodyLength; ) {
let code = body.charCodeAt(position);
switch (code) {
// Ignored ::
// - UnicodeBOM
// - WhiteSpace
// - LineTerminator
// - Comment
// - Comma
//
// UnicodeBOM :: "Byte Order Mark (U+FEFF)"
//
// WhiteSpace ::
// - "Horizontal Tab (U+0009)"
// - "Space (U+0020)"
//
// Comma :: ,
case 65279:
// <BOM>
case 9:
// \t
case 32:
// <space>
case 44:
++position;
continue;
// LineTerminator ::
// - "New Line (U+000A)"
// - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"]
// - "Carriage Return (U+000D)" "New Line (U+000A)"
case 10:
++position, ++lexer.line, lexer.lineStart = position;
continue;
case 13:
body.charCodeAt(position + 1) === 10 ? position += 2 : ++position, ++lexer.line, lexer.lineStart = position;
continue;
// Comment
case 35:
return readComment(lexer, position);
// Token ::
// - Punctuator
// - Name
// - IntValue
// - FloatValue
// - StringValue
//
// Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
case 33:
return createToken(
lexer,
_tokenKind.TokenKind.BANG,
position,
position + 1
);
case 36:
return createToken(
lexer,
_tokenKind.TokenKind.DOLLAR,
position,
position + 1
);
case 38:
return createToken(
lexer,
_tokenKind.TokenKind.AMP,
position,
position + 1
);
case 40:
return createToken(
lexer,
_tokenKind.TokenKind.PAREN_L,
position,
position + 1
);
case 41:
return createToken(
lexer,
_tokenKind.TokenKind.PAREN_R,
position,
position + 1
);
case 46:
if (body.charCodeAt(position + 1) === 46 && body.charCodeAt(position + 2) === 46)
return createToken(
lexer,
_tokenKind.TokenKind.SPREAD,
position,
position + 3
);
break;
case 58:
return createToken(
lexer,
_tokenKind.TokenKind.COLON,
position,
position + 1
);
case 61:
return createToken(
lexer,
_tokenKind.TokenKind.EQUALS,
position,
position + 1
);
case 64:
return createToken(
lexer,
_tokenKind.TokenKind.AT,
position,
position + 1
);
case 91:
return createToken(
lexer,
_tokenKind.TokenKind.BRACKET_L,
position,
position + 1
);
case 93:
return createToken(
lexer,
_tokenKind.TokenKind.BRACKET_R,
position,
position + 1
);
case 123:
return createToken(
lexer,
_tokenKind.TokenKind.BRACE_L,
position,
position + 1
);
case 124:
return createToken(
lexer,
_tokenKind.TokenKind.PIPE,
position,
position + 1
);
case 125:
return createToken(
lexer,
_tokenKind.TokenKind.BRACE_R,
position,
position + 1
);
// StringValue
case 34:
return body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 ? readBlockString(lexer, position) : readString(lexer, position);
}
if ((0, _characterClasses.isDigit)(code) || code === 45)
return readNumber(lexer, position, code);
if ((0, _characterClasses.isNameStart)(code))
return readName(lexer, position);
throw (0, _syntaxError.syntaxError)(
lexer.source,
position,
code === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : isUnicodeScalarValue(code) || isSupplementaryCodePoint(body, position) ? `Unexpected character: ${printCodePointAt(lexer, position)}.` : `Invalid character: ${printCodePointAt(lexer, position)}.`
);
}
return createToken(lexer, _tokenKind.TokenKind.EOF, bodyLength, bodyLength);
}
function readComment(lexer, start) {
let body = lexer.source.body, bodyLength = body.length, position = start + 1;
for (; position < bodyLength; ) {
let code = body.charCodeAt(position);
if (code === 10 || code === 13)
break;
if (isUnicodeScalarValue(code))
++position;
else if (isSupplementaryCodePoint(body, position))
position += 2;
else
break;
}
return createToken(
lexer,
_tokenKind.TokenKind.COMMENT,
start,
position,
body.slice(start + 1, position)
);
}
function readNumber(lexer, start, firstCode) {
let body = lexer.source.body, position = start, code = firstCode, isFloat = !1;
if (code === 45 && (code = body.charCodeAt(++position)), code === 48) {
if (code = body.charCodeAt(++position), (0, _characterClasses.isDigit)(code))
throw (0, _syntaxError.syntaxError)(
lexer.source,
position,
`Invalid number, unexpected digit after 0: ${printCodePointAt(
lexer,
position
)}.`
);
} else
position = readDigits(lexer, position, code), code = body.charCodeAt(position);
if (code === 46 && (isFloat = !0, code = body.charCodeAt(++position), position = readDigits(lexer, position, code), code = body.charCodeAt(position)), (code === 69 || code === 101) && (isFloat = !0, code = body.charCodeAt(++position), (code === 43 || code === 45) && (code = body.charCodeAt(++position)), position = readDigits(lexer, position, code), code = body.charCodeAt(position)), code === 46 || (0, _characterClasses.isNameStart)(code))
throw (0, _syntaxError.syntaxError)(
lexer.source,
position,
`Invalid number, expected digit but got: ${printCodePointAt(
lexer,
position
)}.`
);
return createToken(
lexer,
isFloat ? _tokenKind.TokenKind.FLOAT : _tokenKind.TokenKind.INT,
start,
position,
body.slice(start, position)
);
}
function readDigits(lexer, start, firstCode) {
if (!(0, _characterClasses.isDigit)(firstCode))
throw (0, _syntaxError.syntaxError)(
lexer.source,
start,
`Invalid number, expected digit but got: ${printCodePointAt(
lexer,
start
)}.`
);
let body = lexer.source.body, position = start + 1;
for (; (0, _characterClasses.isDigit)(body.charCodeAt(position)); )
++position;
return position;
}
function readString(lexer, start) {
let body = lexer.source.body, bodyLength = body.length, position = start + 1, chunkStart = position, value = "";
for (; position < bodyLength; ) {
let code = body.charCodeAt(position);
if (code === 34)
return value += body.slice(chunkStart, position), createToken(
lexer,
_tokenKind.TokenKind.STRING,
start,
position + 1,
value
);
if (code === 92) {
value += body.slice(chunkStart, position);
let escape = body.charCodeAt(position + 1) === 117 ? body.charCodeAt(position + 2) === 123 ? readEscapedUnicodeVariableWidth(lexer, position) : readEscapedUnicodeFixedWidth(lexer, position) : readEscapedCharacter(lexer, position);
value += escape.value, position += escape.size, chunkStart = position;
continue;
}
if (code === 10 || code === 13)
break;
if (isUnicodeScalarValue(code))
++position;
else if (isSupplementaryCodePoint(body, position))
position += 2;
else
throw (0, _syntaxError.syntaxError)(
lexer.source,
position,
`Invalid character within String: ${printCodePointAt(
lexer,
position
)}.`
);
}
throw (0, _syntaxError.syntaxError)(
lexer.source,
position,
"Unterminated string."
);
}
function readEscapedUnicodeVariableWidth(lexer, position) {
let body = lexer.source.body, point = 0, size = 3;
for (; size < 12; ) {
let code = body.charCodeAt(position + size++);
if (code === 125) {
if (size < 5 || !isUnicodeScalarValue(point))
break;
return {
value: String.fromCodePoint(point),
size
};
}
if (point = point << 4 | readHexDigit(code), point < 0)
break;
}
throw (0, _syntaxError.syntaxError)(
lexer.source,
position,
`Invalid Unicode escape sequence: "${body.slice(
position,
position + size
)}".`
);
}
function readEscapedUnicodeFixedWidth(lexer, position) {
let body = lexer.source.body, code = read16BitHexCode(body, position + 2);
if (isUnicodeScalarValue(code))
return {
value: String.fromCodePoint(code),
size: 6
};
if (isLeadingSurrogate(code) && body.charCodeAt(position + 6) === 92 && body.charCodeAt(position + 7) === 117) {
let trailingCode = read16BitHexCode(body, position + 8);
if (isTrailingSurrogate(trailingCode))
return {
value: String.fromCodePoint(code, trailingCode),
size: 12
};
}
throw (0, _syntaxError.syntaxError)(
lexer.source,
position,
`Invalid Unicode escape sequence: "${body.slice(position, position + 6)}".`
);
}
function read16BitHexCode(body, position) {
return readHexDigit(body.charCodeAt(position)) << 12 | readHexDigit(body.charCodeAt(position + 1)) << 8 | readHexDigit(body.charCodeAt(position + 2)) << 4 | readHexDigit(body.charCodeAt(position + 3));
}
function readHexDigit(code) {
return code >= 48 && code <= 57 ? code - 48 : code >= 65 && code <= 70 ? code - 55 : code >= 97 && code <= 102 ? code - 87 : -1;
}
function readEscapedCharacter(lexer, position) {
let body = lexer.source.body;
switch (body.charCodeAt(position + 1)) {
case 34:
return {
value: '"',
size: 2
};
case 92:
return {
value: "\\",
size: 2
};
case 47:
return {
value: "/",
size: 2
};
case 98:
return {
value: "\b",
size: 2
};
case 102:
return {
value: "\f",
size: 2
};
case 110:
return {
value: `
`,
size: 2
};
case 114:
return {
value: "\r",
size: 2
};
case 116:
return {
value: " ",
size: 2
};
}
throw (0, _syntaxError.syntaxError)(
lexer.source,
position,
`Invalid character escape sequence: "${body.slice(
position,
position + 2
)}".`
);
}
function readBlockString(lexer, start) {
let body = lexer.source.body, bodyLength = body.length, lineStart = lexer.lineStart, position = start + 3, chunkStart = position, currentLine = "", blockLines = [];
for (; position < bodyLength; ) {
let code = body.charCodeAt(position);
if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) {
currentLine += body.slice(chunkStart, position), blockLines.push(currentLine);
let token = createToken(
lexer,
_tokenKind.TokenKind.BLOCK_STRING,
start,
position + 3,
// Return a string of the lines joined with U+000A.
(0, _blockString.dedentBlockStringLines)(blockLines).join(`
`)
);
return lexer.line += blockLines.length - 1, lexer.lineStart = lineStart, token;
}
if (code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) {
currentLine += body.slice(chunkStart, position), chunkStart = position + 1, position += 4;
continue;
}
if (code === 10 || code === 13) {
currentLine += body.slice(chunkStart, position), blockLines.push(currentLine), code === 13 && body.charCodeAt(position + 1) === 10 ? position += 2 : ++position, currentLine = "", chunkStart = position, lineStart = position;
continue;
}
if (isUnicodeScalarValue(code))
++position;
else if (isSupplementaryCodePoint(body, position))
position += 2;
else
throw (0, _syntaxError.syntaxError)(
lexer.source,
position,
`Invalid character within String: ${printCodePointAt(
lexer,
position
)}.`
);
}
throw (0, _syntaxError.syntaxError)(
lexer.source,
position,
"Unterminated string."
);
}
function readName(lexer, start) {
let body = lexer.source.body, bodyLength = body.length, position = start + 1;
for (; position < bodyLength; ) {
let code = body.charCodeAt(position);
if ((0, _characterClasses.isNameContinue)(code))
++position;
else
break;
}
return createToken(
lexer,
_tokenKind.TokenKind.NAME,
start,
position,
body.slice(start, position)
);
}
}
});
// ../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/jsutils/inspect.js
var require_inspect = __commonJS({
"../../node_modules/.pnpm/graphql@16.10.0/node_modules/graphql/jsutils/inspect.js"(exports) {
"use strict";
init_cjs_shims();
Object.defineProperty(exports, "__esModule", {
value: !0
});
exports.inspect = inspect;
var MAX_ARRAY_LENGTH = 10, MAX_RECURSIVE_DEPTH = 2;
function inspect(value) {
return formatValue(value, []);
}
function formatValue(value, seenValues) {
switch (typeof value) {
case "string":
return JSON.stringify(value);
case "function":
return value.name ? `[function ${value.name}]` : "[function]";
case "object":
return formatObjectValue(value, seenValues);
default:
return String(value);
}
}
function formatObjectValue(value, previouslySeenValues) {
if (value === null)
return "null";
if (previouslySeenValues.includes(value))
return "[Circular]";
let seenValues = [...previouslySeenValues, value];
if (isJSONable(value)) {
let jsonValue = value.toJSON();
if (jsonValue !== value)
return typeof jsonValue == "string" ? jsonValue : formatValue(jsonValue, seenValues);
} else if (Array.isArray(value))
return formatArray(value, seenValues);
return formatObject(value, seenValues);
}
function isJSONable(value) {
return typeof value.toJSON == "function";
}
function formatObject(object, seenValues) {
let entries = Object.entries(object);
return entries.length === 0 ? "{}" : seenValues.length > MAX_RECURSIVE_DEPTH ? "[" + getObjectTag(object) + "]" : "{ " + entries.map(
([key, value]) => key + ": " + formatValue(value, seenValues)
).join(", ") + " }";
}
function formatArray(array, seenValues) {
if (array.length === 0)
return "[]";
if (seenValues.length > MAX_RECURSIVE_DEPTH)
return "[Array]";
let len = Math.min(MAX_ARRAY_LENGTH, array.length), remaining = array.length - len, items = [];
for (let i = 0; i < len; ++i)
items.push(formatValue(array[i], seenValues));
return remaining === 1 ? items.push("... 1 more item") : remaining > 1 && items.push(`... ${re