core-types-graphql
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -1,4 +0,4 @@ | ||
export type { CoreTypesToGraphqlOptions, GraphqlToCoreTypesOptions, NameGeneratorFunction, } from './lib/types'; | ||
export { convertCoreTypesToGraphql, convertCoreTypesToGraphqlAst, } from './lib/core-types-to-graphql'; | ||
export { convertGraphqlToCoreTypes, getGraphqlAst, } from './lib/graphql-to-core-types'; | ||
export { getBreakingChanges, getDangerousChanges, } from './lib/schema'; | ||
export type { CoreTypesToGraphqlOptions, GraphqlToCoreTypesOptions, NameGeneratorFunction, } from './lib/types.js'; | ||
export { convertCoreTypesToGraphql, convertCoreTypesToGraphqlAst, } from './lib/core-types-to-graphql.js'; | ||
export { convertGraphqlToCoreTypes, getGraphqlAst, } from './lib/graphql-to-core-types.js'; | ||
export { getBreakingChanges, getDangerousChanges, } from './lib/schema.js'; |
@@ -1,14 +0,3 @@ | ||
"use strict"; | ||
var _a; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getDangerousChanges = exports.getBreakingChanges = exports.getGraphqlAst = exports.convertGraphqlToCoreTypes = exports.convertCoreTypesToGraphqlAst = exports.convertCoreTypesToGraphql = void 0; | ||
(_a = Object.fromEntries) !== null && _a !== void 0 ? _a : (Object.fromEntries = require('fromentries')); | ||
var core_types_to_graphql_1 = require("./lib/core-types-to-graphql"); | ||
Object.defineProperty(exports, "convertCoreTypesToGraphql", { enumerable: true, get: function () { return core_types_to_graphql_1.convertCoreTypesToGraphql; } }); | ||
Object.defineProperty(exports, "convertCoreTypesToGraphqlAst", { enumerable: true, get: function () { return core_types_to_graphql_1.convertCoreTypesToGraphqlAst; } }); | ||
var graphql_to_core_types_1 = require("./lib/graphql-to-core-types"); | ||
Object.defineProperty(exports, "convertGraphqlToCoreTypes", { enumerable: true, get: function () { return graphql_to_core_types_1.convertGraphqlToCoreTypes; } }); | ||
Object.defineProperty(exports, "getGraphqlAst", { enumerable: true, get: function () { return graphql_to_core_types_1.getGraphqlAst; } }); | ||
var schema_1 = require("./lib/schema"); | ||
Object.defineProperty(exports, "getBreakingChanges", { enumerable: true, get: function () { return schema_1.getBreakingChanges; } }); | ||
Object.defineProperty(exports, "getDangerousChanges", { enumerable: true, get: function () { return schema_1.getDangerousChanges; } }); | ||
export { convertCoreTypesToGraphql, convertCoreTypesToGraphqlAst, } from './lib/core-types-to-graphql.js'; | ||
export { convertGraphqlToCoreTypes, getGraphqlAst, } from './lib/graphql-to-core-types.js'; | ||
export { getBreakingChanges, getDangerousChanges, } from './lib/schema.js'; |
@@ -1,4 +0,4 @@ | ||
import { CoreTypeAnnotations } from "core-types"; | ||
import { type CoreTypeAnnotations } from "core-types"; | ||
import { StringValueNode } from "graphql"; | ||
import { Context } from "./types"; | ||
import { Context } from "./types.js"; | ||
/** | ||
@@ -5,0 +5,0 @@ * Turns annotations into Markdown comments, which is the standard GraphQL |
@@ -1,5 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parseString = exports.unindentEqual = exports.parseDescription = exports.stringifyAnnotations = void 0; | ||
const core_types_1 = require("core-types"); | ||
import { ensureArray } from "core-types"; | ||
/** | ||
@@ -9,5 +6,5 @@ * Turns annotations into Markdown comments, which is the standard GraphQL | ||
*/ | ||
function stringifyAnnotations(node, ctx) { | ||
export function stringifyAnnotations(node, ctx) { | ||
const { description, examples, default: _default, comment } = node; | ||
const exampleArray = (0, core_types_1.ensureArray)(examples); | ||
const exampleArray = ensureArray(examples); | ||
const fullComment = [ | ||
@@ -28,3 +25,2 @@ description, | ||
} | ||
exports.stringifyAnnotations = stringifyAnnotations; | ||
function enquoteCode(code, ctx) { | ||
@@ -53,3 +49,3 @@ if (code.includes("`")) | ||
} | ||
function parseDescription(descriptionText) { | ||
export function parseDescription(descriptionText) { | ||
descriptionText = | ||
@@ -100,7 +96,6 @@ (descriptionText && typeof descriptionText === 'object') | ||
} | ||
exports.parseDescription = parseDescription; | ||
function joinUnindentedBlock(lines) { | ||
return unindentEqual(lines).join("\n"); | ||
} | ||
function unindentEqual(lines) { | ||
export function unindentEqual(lines) { | ||
if (lines.length === 0 || lines[0].length === 0) | ||
@@ -121,6 +116,4 @@ return lines; | ||
} | ||
exports.unindentEqual = unindentEqual; | ||
function parseString(str) { | ||
return str === null || str === void 0 ? void 0 : str.value; | ||
export function parseString(str) { | ||
return str?.value; | ||
} | ||
exports.parseString = parseString; |
@@ -1,5 +0,5 @@ | ||
import { NodeDocument, ConversionResult } from 'core-types'; | ||
import { DocumentNode } from 'graphql'; | ||
import type { CoreTypesToGraphqlOptions } from './types'; | ||
import { type ConversionResult, type NodeDocument } from 'core-types'; | ||
import { type DocumentNode } from 'graphql'; | ||
import type { CoreTypesToGraphqlOptions } from './types.js'; | ||
export declare function convertCoreTypesToGraphqlAst(doc: NodeDocument, options?: CoreTypesToGraphqlOptions): ConversionResult<DocumentNode>; | ||
export declare function convertCoreTypesToGraphql(doc: NodeDocument, options?: CoreTypesToGraphqlOptions): ConversionResult; |
@@ -1,8 +0,5 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.convertCoreTypesToGraphql = exports.convertCoreTypesToGraphqlAst = void 0; | ||
const core_types_1 = require("core-types"); | ||
const graphql_1 = require("graphql"); | ||
const gql_utils_1 = require("./gql-utils"); | ||
const annotation_1 = require("./annotation"); | ||
import { extractAnnotations, isNonNullable, throwUnsupportedError, UnsupportedError, } from 'core-types'; | ||
import { Kind, print, } from 'graphql'; | ||
import { gqlListTypeNode, gqlMaybeRequiredNode, gqlNamedTypeNode, gqlNameNode, gqlUnionType, } from './gql-utils.js'; | ||
import { stringifyAnnotations } from './annotation.js'; | ||
function defaultNameGenerator(baseName, nameHint, test) { | ||
@@ -37,5 +34,5 @@ let name = `${baseName}_${nameHint}`; | ||
} | ||
function convertCoreTypesToGraphqlAst(doc, options = {}) { | ||
export function convertCoreTypesToGraphqlAst(doc, options = {}) { | ||
if (doc.version !== 1) | ||
throw new core_types_1.UnsupportedError(`core-types version ${doc.version} is not supported`); | ||
throw new UnsupportedError(`core-types version ${doc.version} is not supported`); | ||
const { types } = doc; | ||
@@ -68,3 +65,3 @@ const { warn = (message) => console.warn(message), nullTypeName = null, nameGenerator = defaultNameGenerator, unsupported = 'warn', includeComment = false, } = options; | ||
name: node.name, | ||
...(0, core_types_1.extractAnnotations)(node), | ||
...extractAnnotations(node), | ||
type: 'or', | ||
@@ -75,3 +72,3 @@ or: [node], | ||
if (nullTypeName) | ||
return gqlUnionTypeOfTypes(node, [(0, gql_utils_1.gqlNamedTypeNode)(nullTypeName)], ctx); | ||
return gqlUnionTypeOfTypes(node, [gqlNamedTypeNode(nullTypeName)], ctx); | ||
return handleUnsupported(ctx, node, [index]); | ||
@@ -91,7 +88,7 @@ } | ||
}) | ||
.filter(core_types_1.isNonNullable); | ||
.filter(isNonNullable); | ||
return { | ||
data: { | ||
definitions, | ||
kind: graphql_1.Kind.DOCUMENT, | ||
kind: Kind.DOCUMENT, | ||
}, | ||
@@ -102,3 +99,2 @@ convertedTypes, | ||
} | ||
exports.convertCoreTypesToGraphqlAst = convertCoreTypesToGraphqlAst; | ||
function handleUnsupported(ctx, node, path) { | ||
@@ -109,3 +105,3 @@ if (ctx.options.unsupported === 'ignore') | ||
try { | ||
(0, core_types_1.throwUnsupportedError)(message, node, path); | ||
throwUnsupportedError(message, node, path); | ||
} | ||
@@ -123,10 +119,9 @@ catch (err) { | ||
} | ||
function convertCoreTypesToGraphql(doc, options = {}) { | ||
var _a; | ||
export function convertCoreTypesToGraphql(doc, options = {}) { | ||
const { data: ast, convertedTypes, notConvertedTypes, } = convertCoreTypesToGraphqlAst(doc, options); | ||
const header = ((_a = options.includeComment) !== null && _a !== void 0 ? _a : true) | ||
const header = (options.includeComment ?? true) | ||
? makeHeader(options.filename, options.sourceFilename, options.userPackage, options.userPackageUrl) | ||
: undefined; | ||
return { | ||
data: ensureEndingNewLine((header ? `${header}\n\n` : '') + (0, graphql_1.print)(ast)), | ||
data: ensureEndingNewLine((header ? `${header}\n\n` : '') + print(ast)), | ||
convertedTypes, | ||
@@ -136,5 +131,4 @@ notConvertedTypes, | ||
} | ||
exports.convertCoreTypesToGraphql = convertCoreTypesToGraphql; | ||
function gqlUnionTypeOfTypes(node, types, ctx) { | ||
return (0, gql_utils_1.gqlUnionType)({ ...makeCommonTypeProperties(node, ctx), types }); | ||
return gqlUnionType({ ...makeCommonTypeProperties(node, ctx), types }); | ||
} | ||
@@ -144,3 +138,3 @@ function makeUnionType(node, ctx) { | ||
.map((or, index) => nodeToNamedType(or, node.name, `T${index}`, ctx)) | ||
.filter(core_types_1.isNonNullable); | ||
.filter(isNonNullable); | ||
if (types.length === 0) | ||
@@ -152,3 +146,3 @@ return undefined; | ||
return { | ||
name: (0, gql_utils_1.gqlNameNode)(node.name), | ||
name: gqlNameNode(node.name), | ||
...makeCommonTypePropertiesWithoutName(node, ctx), | ||
@@ -166,3 +160,3 @@ }; | ||
...makeCommonTypeProperties(node, ctx), | ||
kind: graphql_1.Kind.OBJECT_TYPE_DEFINITION, | ||
kind: Kind.OBJECT_TYPE_DEFINITION, | ||
fields: Object.entries(node.properties) | ||
@@ -174,9 +168,9 @@ .map(([name, { node: child, required }]) => { | ||
return { | ||
kind: graphql_1.Kind.FIELD_DEFINITION, | ||
kind: Kind.FIELD_DEFINITION, | ||
...makeCommonTypePropertiesWithoutName(child, ctx), | ||
name: (0, gql_utils_1.gqlNameNode)(name), | ||
type: (0, gql_utils_1.gqlMaybeRequiredNode)(typeNode, required), | ||
name: gqlNameNode(name), | ||
type: gqlMaybeRequiredNode(typeNode, required), | ||
}; | ||
}) | ||
.filter(core_types_1.isNonNullable), | ||
.filter(isNonNullable), | ||
}; | ||
@@ -198,3 +192,3 @@ } | ||
return namedType; | ||
return (0, gql_utils_1.gqlListTypeNode)((0, gql_utils_1.gqlMaybeRequiredNode)(namedType, true)); | ||
return gqlListTypeNode(gqlMaybeRequiredNode(namedType, true)); | ||
} | ||
@@ -216,3 +210,3 @@ else | ||
: makeNamedType(node, baseName, nameHint, ctx); | ||
return typeName === undefined ? typeName : (0, gql_utils_1.gqlNamedTypeNode)(typeName); | ||
return typeName === undefined ? typeName : gqlNamedTypeNode(typeName); | ||
} | ||
@@ -228,7 +222,7 @@ function makeNamedType(node, baseName, nameHint, ctx) { | ||
function annotationToComment(node, ctx) { | ||
const comment = (0, annotation_1.stringifyAnnotations)(node, ctx); | ||
const comment = stringifyAnnotations(node, ctx); | ||
if (!comment) | ||
return undefined; | ||
return { | ||
kind: graphql_1.Kind.STRING, | ||
kind: Kind.STRING, | ||
value: comment, | ||
@@ -235,0 +229,0 @@ block: comment.includes("\n"), |
@@ -1,2 +0,2 @@ | ||
import { TypeNode, ListTypeNode, NamedTypeNode, NameNode, NonNullTypeNode, StringValueNode, UnionTypeDefinitionNode } from 'graphql'; | ||
import { type ListTypeNode, type NamedTypeNode, type NameNode, type NonNullTypeNode, type StringValueNode, type TypeNode, type UnionTypeDefinitionNode } from 'graphql'; | ||
export declare function gqlNameNode(name: string): NameNode; | ||
@@ -3,0 +3,0 @@ export interface UnionTypeOptions { |
@@ -1,12 +0,8 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isRequired = exports.gqlStripRequired = exports.gqlMaybeRequiredNode = exports.gqlListTypeNode = exports.gqlNamedTypeNode = exports.gqlUnionType = exports.gqlNameNode = void 0; | ||
const graphql_1 = require("graphql"); | ||
function gqlNameNode(name) { | ||
return { kind: graphql_1.Kind.NAME, value: name }; | ||
import { Kind, } from 'graphql'; | ||
export function gqlNameNode(name) { | ||
return { kind: Kind.NAME, value: name }; | ||
} | ||
exports.gqlNameNode = gqlNameNode; | ||
function gqlUnionType({ name, description, types }) { | ||
export function gqlUnionType({ name, description, types }) { | ||
return { | ||
kind: graphql_1.Kind.UNION_TYPE_DEFINITION, | ||
kind: Kind.UNION_TYPE_DEFINITION, | ||
name, | ||
@@ -17,22 +13,16 @@ ...(description ? { description } : {}), | ||
} | ||
exports.gqlUnionType = gqlUnionType; | ||
function gqlNamedTypeNode(name) { | ||
return { kind: graphql_1.Kind.NAMED_TYPE, name: gqlNameNode(name) }; | ||
export function gqlNamedTypeNode(name) { | ||
return { kind: Kind.NAMED_TYPE, name: gqlNameNode(name) }; | ||
} | ||
exports.gqlNamedTypeNode = gqlNamedTypeNode; | ||
function gqlListTypeNode(type) { | ||
return { kind: graphql_1.Kind.LIST_TYPE, type }; | ||
export function gqlListTypeNode(type) { | ||
return { kind: Kind.LIST_TYPE, type }; | ||
} | ||
exports.gqlListTypeNode = gqlListTypeNode; | ||
function gqlMaybeRequiredNode(type, required) { | ||
return !required ? type : { kind: graphql_1.Kind.NON_NULL_TYPE, type }; | ||
export function gqlMaybeRequiredNode(type, required) { | ||
return !required ? type : { kind: Kind.NON_NULL_TYPE, type }; | ||
} | ||
exports.gqlMaybeRequiredNode = gqlMaybeRequiredNode; | ||
function gqlStripRequired(type) { | ||
export function gqlStripRequired(type) { | ||
return isRequired(type) ? type.type : type; | ||
} | ||
exports.gqlStripRequired = gqlStripRequired; | ||
function isRequired(type) { | ||
return type.kind === graphql_1.Kind.NON_NULL_TYPE; | ||
export function isRequired(type) { | ||
return type.kind === Kind.NON_NULL_TYPE; | ||
} | ||
exports.isRequired = isRequired; |
@@ -1,5 +0,5 @@ | ||
import { NodeDocument, ConversionResult } from 'core-types'; | ||
import { DocumentNode } from 'graphql'; | ||
import { GraphqlToCoreTypesOptions } from './types'; | ||
import { type ConversionResult, type NodeDocument } from 'core-types'; | ||
import { type DocumentNode } from 'graphql'; | ||
import { GraphqlToCoreTypesOptions } from './types.js'; | ||
export declare function getGraphqlAst(source: string): DocumentNode; | ||
export declare function convertGraphqlToCoreTypes(source: string, options?: GraphqlToCoreTypesOptions): ConversionResult<NodeDocument>; |
@@ -1,16 +0,11 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.convertGraphqlToCoreTypes = exports.getGraphqlAst = void 0; | ||
const core_types_1 = require("core-types"); | ||
const graphql_1 = require("graphql"); | ||
const annotation_1 = require("./annotation"); | ||
const gql_utils_1 = require("./gql-utils"); | ||
const utils_1 = require("./utils"); | ||
function getGraphqlAst(source) { | ||
return (0, graphql_1.parse)(source); | ||
import { throwRelatedError, UnsupportedError, } from 'core-types'; | ||
import { GraphQLError, Kind, parse, } from 'graphql'; | ||
import { parseDescription } from './annotation.js'; | ||
import { gqlStripRequired, isRequired } from './gql-utils.js'; | ||
import { gqlLocationsToCoreTypesLocation } from './utils.js'; | ||
export function getGraphqlAst(source) { | ||
return parse(source); | ||
} | ||
exports.getGraphqlAst = getGraphqlAst; | ||
function convertGraphqlToCoreTypes(source, options) { | ||
var _a; | ||
const { warn = (message) => console.warn(message), unsupported = 'ignore', } = options !== null && options !== void 0 ? options : {}; | ||
export function convertGraphqlToCoreTypes(source, options) { | ||
const { warn = (message) => console.warn(message), unsupported = 'ignore', } = options ?? {}; | ||
let document; | ||
@@ -21,11 +16,11 @@ try { | ||
catch (err) { | ||
if (err instanceof graphql_1.GraphQLError) | ||
(0, core_types_1.throwRelatedError)(err, { | ||
if (err instanceof GraphQLError) | ||
throwRelatedError(err, { | ||
source, | ||
loc: (0, utils_1.gqlLocationsToCoreTypesLocation)(source, (_a = err.locations) !== null && _a !== void 0 ? _a : []) | ||
loc: gqlLocationsToCoreTypesLocation(source, err.locations ?? []) | ||
}); | ||
throw err; | ||
} | ||
if (document.kind !== graphql_1.Kind.DOCUMENT) | ||
throw new core_types_1.UnsupportedError(`Invalid document type "${document.kind}"`, { | ||
if (document.kind !== Kind.DOCUMENT) | ||
throw new UnsupportedError(`Invalid document type "${document.kind}"`, { | ||
blob: document, | ||
@@ -38,5 +33,4 @@ path: [], | ||
.map((definition) => { | ||
var _a, _b, _c, _d; | ||
if (definition.kind === graphql_1.Kind.UNION_TYPE_DEFINITION) { | ||
if (!((_a = definition.types) === null || _a === void 0 ? void 0 : _a.length)) { | ||
if (definition.kind === Kind.UNION_TYPE_DEFINITION) { | ||
if (!definition.types?.length) { | ||
notConvertedTypes.push(definition.name.value); | ||
@@ -58,4 +52,4 @@ return; | ||
} | ||
else if (definition.kind === graphql_1.Kind.OBJECT_TYPE_DEFINITION) { | ||
const fields = (_b = definition.fields) !== null && _b !== void 0 ? _b : []; | ||
else if (definition.kind === Kind.OBJECT_TYPE_DEFINITION) { | ||
const fields = definition.fields ?? []; | ||
return { | ||
@@ -68,4 +62,4 @@ ...parseCommonFields(definition), | ||
} | ||
else if (definition.kind === graphql_1.Kind.ENUM_TYPE_DEFINITION) { | ||
const fields = (_c = definition.values) !== null && _c !== void 0 ? _c : []; | ||
else if (definition.kind === Kind.ENUM_TYPE_DEFINITION) { | ||
const fields = definition.values ?? []; | ||
return { | ||
@@ -79,3 +73,3 @@ ...parseCommonFields(definition), | ||
if (unsupported === 'ignore') { | ||
const name = (_d = definition === null || definition === void 0 ? void 0 : definition.name) === null || _d === void 0 ? void 0 : _d.value; | ||
const name = definition?.name?.value; | ||
if (name) | ||
@@ -94,3 +88,3 @@ notConvertedTypes.push(name); | ||
else | ||
throw new core_types_1.UnsupportedError(message, meta); | ||
throw new UnsupportedError(message, meta); | ||
} | ||
@@ -105,3 +99,2 @@ }) | ||
} | ||
exports.convertGraphqlToCoreTypes = convertGraphqlToCoreTypes; | ||
function parseCommonFields(type, parent) { | ||
@@ -115,3 +108,3 @@ return { | ||
return { | ||
...(0, annotation_1.parseDescription)(type.description), | ||
...parseDescription(type.description), | ||
title: parseTitle(type.name, parent), | ||
@@ -125,3 +118,3 @@ ...(type.loc ? { loc: type.loc } : {}), | ||
function parseTitle(name, parent) { | ||
if (parent === null || parent === void 0 ? void 0 : parent.name) | ||
if (parent?.name) | ||
return `${parent.name.value}.${name.value}`; | ||
@@ -131,6 +124,6 @@ return name.value; | ||
function parseFieldType(field, parent) { | ||
if (field.kind === graphql_1.Kind.LIST_TYPE) | ||
if (field.kind === Kind.LIST_TYPE) | ||
return { | ||
type: 'array', | ||
elementType: (0, gql_utils_1.isRequired)(field.type) | ||
elementType: isRequired(field.type) | ||
? parseFieldType(field.type.type, parent) | ||
@@ -146,3 +139,3 @@ : { | ||
...field, | ||
name: { kind: graphql_1.Kind.NAME, value: '[]' }, | ||
name: { kind: Kind.NAME, value: '[]' }, | ||
}, parent), | ||
@@ -158,6 +151,6 @@ }; | ||
node: { | ||
...parseFieldType((0, gql_utils_1.gqlStripRequired)(field.type), parent), | ||
...parseFieldType(gqlStripRequired(field.type), parent), | ||
...parseCommonFieldsWithoutName(field, parent), | ||
}, | ||
required: (0, gql_utils_1.isRequired)(field.type), | ||
required: isRequired(field.type), | ||
} | ||
@@ -164,0 +157,0 @@ ]; |
@@ -1,12 +0,7 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getDangerousChanges = exports.getBreakingChanges = void 0; | ||
const graphql_1 = require("graphql"); | ||
function getBreakingChanges(from, to) { | ||
return (0, graphql_1.findBreakingChanges)((0, graphql_1.buildSchema)(from), (0, graphql_1.buildSchema)(to)); | ||
import { findBreakingChanges, findDangerousChanges, buildSchema, } from 'graphql'; | ||
export function getBreakingChanges(from, to) { | ||
return findBreakingChanges(buildSchema(from), buildSchema(to)); | ||
} | ||
exports.getBreakingChanges = getBreakingChanges; | ||
function getDangerousChanges(from, to) { | ||
return (0, graphql_1.findDangerousChanges)((0, graphql_1.buildSchema)(from), (0, graphql_1.buildSchema)(to)); | ||
export function getDangerousChanges(from, to) { | ||
return findDangerousChanges(buildSchema(from), buildSchema(to)); | ||
} | ||
exports.getDangerousChanges = getDangerousChanges; |
@@ -1,3 +0,3 @@ | ||
import { NodeType, WarnFunction } from 'core-types'; | ||
import { TypeDefinitionNode } from 'graphql'; | ||
import type { NodeType, WarnFunction } from 'core-types'; | ||
import type { TypeDefinitionNode } from 'graphql'; | ||
export type NameGeneratorTestFunction = (name: string) => boolean; | ||
@@ -4,0 +4,0 @@ export type NameGeneratorFunction = (baseName: string, nameHint: string, test: NameGeneratorTestFunction) => string; |
@@ -1,2 +0,1 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { LocationWithLineColumn } from 'core-types'; | ||
import type { LocationWithLineColumn } from 'core-types'; | ||
export interface GqlLocation { | ||
@@ -3,0 +3,0 @@ line: number; |
@@ -1,5 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.gqlLocationsToCoreTypesLocation = void 0; | ||
function gqlLocationsToCoreTypesLocation(source, loc) { | ||
export function gqlLocationsToCoreTypesLocation(source, loc) { | ||
if (loc.length === 0) | ||
@@ -23,2 +20,1 @@ return {}; | ||
} | ||
exports.gqlLocationsToCoreTypesLocation = gqlLocationsToCoreTypesLocation; |
{ | ||
"name": "core-types-graphql", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "core-types ⬌ GraphQL conversion", | ||
@@ -14,4 +14,6 @@ "author": "Gustaf Räntilä", | ||
"directories": {}, | ||
"type": "module", | ||
"sideEffects": false, | ||
"engines": { | ||
"node": ">=14" | ||
"node": ">=14.13.1 || >=16.0.0" | ||
}, | ||
@@ -23,3 +25,3 @@ "files": [ | ||
"build": "rimraf dist && tsc -p tsconfig.prod.json", | ||
"test": "jest", | ||
"test": "NODE_OPTIONS=--experimental-vm-modules jest --coverage", | ||
"cz": "git-cz" | ||
@@ -39,13 +41,15 @@ }, | ||
"dependencies": { | ||
"core-types": "^2.0.1", | ||
"core-types": "^3.0.0", | ||
"graphql": "^16.6.0" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^29.4.0", | ||
"@babel/preset-env": "^7.20.2", | ||
"@babel/preset-typescript": "^7.21.0", | ||
"@types/jest": "^29.5.0", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"jest": "^29.4.1", | ||
"rimraf": "^4.1.2", | ||
"ts-jest": "^29.0.5", | ||
"jest": "^29.5.0", | ||
"rimraf": "^4.4.0", | ||
"ts-jest-resolver": "^2.0.0", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.9.5" | ||
"typescript": "^5.0.2" | ||
}, | ||
@@ -57,3 +61,22 @@ "config": { | ||
}, | ||
"jest": { | ||
"resolver": "ts-jest-resolver", | ||
"extensionsToTreatAsEsm": [ | ||
".ts" | ||
], | ||
"testEnvironment": "node", | ||
"coverageReporters": [ | ||
"lcov", | ||
"text", | ||
"html" | ||
], | ||
"collectCoverageFrom": [ | ||
"<rootDir>/lib/**" | ||
], | ||
"coveragePathIgnorePatterns": [ | ||
"/node_modules/", | ||
"/__snapshots__/" | ||
] | ||
}, | ||
"packageManager": "yarn@3.2.4" | ||
} |
@@ -19,8 +19,16 @@ [![npm version][npm-image]][npm-url] | ||
# Versions | ||
Since 3.0, this package is pure ESM and requires Node 14.13.1 or later. | ||
# Contents | ||
* [Usage](#usage) | ||
* [core-types to GraphQL](#core-types-to-graphql) | ||
* [GraphQL to core-types](#graphql-to-core-types) | ||
* [Utilities](#utilities) | ||
- [core-types-graphql](#core-types-graphql) | ||
- [Versions](#versions) | ||
- [Contents](#contents) | ||
- [Usage](#usage) | ||
- [core-types to GraphQL](#core-types-to-graphql) | ||
- [GraphQL to core-types](#graphql-to-core-types) | ||
- [Utilities](#utilities) | ||
@@ -133,4 +141,2 @@ | ||
[coverage-url]: https://coveralls.io/github/grantila/core-types-graphql?branch=master | ||
[lgtm-image]: https://img.shields.io/lgtm/grade/javascript/g/grantila/core-types-graphql.svg?logo=lgtm&logoWidth=18 | ||
[lgtm-url]: https://lgtm.com/projects/g/grantila/core-types-graphql/context:javascript | ||
[node-version]: https://img.shields.io/node/v/core-types-graphql | ||
@@ -137,0 +143,0 @@ [node-url]: https://nodejs.org/en/ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
148
Yes
32951
9
658
+ Addedcore-types@3.1.0(transitive)
- Removedcore-types@2.0.1(transitive)
Updatedcore-types@^3.0.0