Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mnovikov/supermassive ast tools for v3 #358

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Update dependency to use new major of supermassive-ast package",
"packageName": "@graphitation/apollo-react-relay-duct-tape-compiler",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "Config fixes",
"packageName": "@graphitation/embedded-document-artefact-loader",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Update dependency to use new major version of supermassive-ast package",
"packageName": "@graphitation/graphql-codegen-supermassive-typed-document-node-plugin",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Update dependency to use new major version of supermassive-ast package",
"packageName": "@graphitation/graphql-codegen-typescript-operations",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Move tools and schema stuff to a separate package",
"packageName": "@graphitation/supermassive",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "major",
"comment": "Move tools and schema stuff to a separate package",
"packageName": "@graphitation/supermassive-ast",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "major",
"comment": {
"title": "",
"value": ""
},
"packageName": "@graphitation/supermassive-common",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Move tools and schema stuff to a separate package",
"packageName": "@graphitation/ts-codegen",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ export async function formatModuleFactory(

let addTypesToRequestDocument:
| undefined
| typeof import("@graphitation/supermassive-ast").addTypesToRequestDocument;
| typeof import("@graphitation/supermassive-ast").addLegacyTypesToRequestDocument;
if (options.emitSupermassiveDocuments) {
({ addTypesToRequestDocument } = await import(
"@graphitation/supermassive-ast"
));
({ addLegacyTypesToRequestDocument: addTypesToRequestDocument } =
await import("@graphitation/supermassive-ast"));
}

function generateExports(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"baseUrl": ".",
"compilerOptions": {
"isolatedModules": false
},
"files": ["fixture.ts"]
}
3 changes: 2 additions & 1 deletion packages/embedded-document-artefact-loader/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"composite": true,
"tsBuildInfoFile": ".tsbuildinfo",
"rootDir": "src",
"outDir": "lib"
"outDir": "lib",
"isolatedModules": false
},
"include": ["src"],
"references": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
Kind,
OperationDefinitionNode,
} from "graphql";
import { addTypesToRequestDocument } from "@graphitation/supermassive-ast";
import { addLegacyTypesToRequestDocument as addTypesToRequestDocument } from "@graphitation/supermassive-ast";
import { optimizeDocumentNode } from "@graphql-tools/optimize";
import gqlTag from "graphql-tag";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from "@graphql-codegen/visitor-plugin-common";
import { TypeScriptDocumentsPluginConfig } from "./config";

export { TypeScriptDocumentsPluginConfig } from "./config";
export type { TypeScriptDocumentsPluginConfig } from "./config";

export const plugin: PluginFunction<
TypeScriptDocumentsPluginConfig,
Expand Down
4 changes: 3 additions & 1 deletion packages/supermassive-ast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"types": "monorepo-scripts types",
"just": "monorepo-scripts"
},
"dependencies": {},
"dependencies": {
"@graphitation/supermassive-common": "^0.1.0"
},
"peerDependencies": {
"graphql": "^15.0.0 || ^16.0.0 || ^17.0.0"
},
Expand Down
17 changes: 0 additions & 17 deletions packages/supermassive-ast/src/annotateDocumentGraphQLTransform.ts

This file was deleted.

131 changes: 126 additions & 5 deletions packages/supermassive-ast/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export type {
ASTNode,
NameNode,
DocumentNode,
OperationDefinitionNode,
Expand Down Expand Up @@ -42,8 +43,128 @@ export type {
UnionTypeExtensionNode,
EnumTypeExtensionNode,
InputObjectTypeExtensionNode,
SelectionNode,
TypeNode,
} from "./TypedAST";
export { addTypesToRequestDocument } from "./addTypesToRequestDocument";
export { annotateDocumentGraphQLTransform } from "./annotateDocumentGraphQLTransform";
} from "./legacyAST/LegacyTypedAST";
export { addLegacySupermassiveTypesToRequestDocument as addLegacyTypesToRequestDocument } from "./legacyAST/addLegacySupermassiveTypesToRequestDocument";
export { annotateDocumentWithLegacySupermassiveASTTransform } from "./legacyAST/annotateDocumentWithLegacySupermassiveASTTransform";

export {
addInterfaceImplementation,
createEnumTypeDefinition,
createInputObjectTypeDefinition,
createInterfaceTypeDefinition,
createObjectTypeDefinition,
createScalarTypeDefinition,
createUnionTypeDefinition,
decodeDirectiveLocation,
encodeDirectiveLocation,
findObjectType,
getDefinitionArguments,
getDirectiveDefinitionArgs,
getDirectiveLocations,
getDirectiveName,
getEnumValues,
getField,
getFieldArgs,
getFieldTypeReference,
getFields,
getInputDefaultValue,
getInputObjectFields,
getInputObjectType,
getInputValueTypeReference,
getInterfaceType,
getInterfaceTypeInterfaces,
getLeafType,
getObjectFields,
getObjectTypeInterfaces,
getUnionType,
getUnionTypeMembers,
isAbstractType,
isDefined,
isEnumTypeDefinition,
isInputObjectTypeDefinition,
isInputType,
isInterfaceTypeDefinition,
isObjectType,
isObjectTypeDefinition,
isScalarTypeDefinition,
isSubType,
isUnionTypeDefinition,
setDirectiveDefinitionArgs,
setFieldArgs,
} from "./schema/definition";
export type {
CompositeTypeTuple,
DirectiveDefinitionTuple,
DirectiveName,
DirectiveTuple,
EnumTypeDefinitionTuple,
FieldDefinition,
FieldDefinitionRecord,
FieldDefinitionTuple,
InputObjectTypeDefinitionTuple,
InputValueDefinition,
InputValueDefinitionRecord,
InputValueDefinitionTuple,
InterfaceImplementationsRecord,
InterfaceTypeDefinitionTuple,
ObjectTypeDefinitionTuple,
OperationTypes,
ScalarTypeDefinitionTuple,
SchemaDefinitions,
TypeDefinitionTuple,
TypeDefinitionsRecord,
UnionTypeDefinitionTuple,
} from "./schema/definition";
export * as Definitions from "./schema/definition";

export {
inspectTypeReference,
isListType,
isNonNullType,
isWrapperType,
typeNameFromReference,
typeReferenceFromName,
typeReferenceFromNode,
unwrap,
unwrapAll,
} from "./schema/reference";
export type {
SpecTypeIndex,
TypeName,
TypeReference,
} from "./schema/reference";

export {
DEFAULT_DEPRECATION_REASON,
GraphQLDeferDirective,
GraphQLDeprecatedDirective,
GraphQLIncludeDirective,
GraphQLSkipDirective,
GraphQLSpecifiedByDirective,
GraphQLStreamDirective,
SUPERMASSIVE_SCHEMA_DIRECTIVE_DEFINITIONS_ARGUMENT_NAME,
SUPERMASSIVE_SCHEMA_DIRECTIVE_NAME,
SupermassiveSchemaDirective,
isKnownDirective,
isSpecifiedDirective,
specifiedDirectives,
} from "./schema/directives";

export {
isSpecifiedScalarType,
specifiedScalarResolvers,
} from "./schema/scalars";

export {
addMinimalViableSchemaToRequestDocument,
type AddMinimalViableSchemaToRequestDocumentOptions,
type ExecutableDefinitionNodeWithInlinedSchema,
} from "./schema/addMinimalViableSchemaToRequestDocument";
export {
extractMinimalViableSchemaForRequestDocument,
type ExtractMinimalViableSchemaResult,
} from "./schema/extractMinimalViableSchemaForRequestDocument";
export { annotateDocumentWithMininimalViableSchemaGraphQLTransform } from "./schema/annotateDocumentWithMininimalViableSchemaGraphQLTransform";

export { decodeASTSchema } from "./schema/decodeASTSchema";
export { encodeASTSchema } from "./schema/encodeASTSchema";
Loading
Loading