Skip to content

Commit

Permalink
fix: export types & modules from graphql-language-service explicitly (
Browse files Browse the repository at this point in the history
  • Loading branch information
acao authored Dec 6, 2021
1 parent 45a9075 commit 0f1f90c
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/lazy-plums-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'graphql-language-service': minor
---

Export all modules & types explicitly from `graphql-language-service`
137 changes: 130 additions & 7 deletions packages/graphql-language-service/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,133 @@
* LICENSE file in the root directory of this source tree.
*
*/
export * from './types';
export * from './schemaLoader';
export * from './LanguageService';
export * from 'graphql-language-service-interface';
export * from 'graphql-language-service-parser';
export * from 'graphql-language-service-types';
export * from 'graphql-language-service-utils';

/**
* A simple LanguageService used by `monaco-graphql`'s webworker lives here.
*
* TODO: retire `graphql-language-service-{parser,interface,types,utils}` and merge with this workspace
*/
export type {
SchemaConfig,
BaseSchemaConfig,
SchemaLoader,
} from './schemaLoader';
export { defaultSchemaLoader } from './schemaLoader';

export type { GraphQLLanguageConfig } from './LanguageService';
export { LanguageService } from './LanguageService';

/**
* A whole bunch of the key language services
*/
export {
getAutocompleteSuggestions,
getDefinitionQueryResultForDefinitionNode,
getDefinitionQueryResultForFragmentSpread,
getDefinitionQueryResultForNamedType,
getDefinitionState,
getDiagnostics,
getFieldDef,
getFragmentDefinitions,
getHoverInformation,
getOutline,
getRange,
getTokenAtPosition,
getTypeInfo,
getVariableCompletions,
GraphQLLanguageService,
SEVERITY,
Severity,
SeverityEnum,
DIAGNOSTIC_SEVERITY,
DefinitionQueryResult,
canUseDirective,
SuggestionCommand,
AutocompleteSuggestionOptions,
} from 'graphql-language-service-interface';

/**
* The dependency-less streaming token parser used for getAutocompleteSuggestions, getHover and more
*/
export {
onlineParser,
ParseRules,
CharacterStream,
RuleKinds,
LexRules,
isIgnored,
p,
list,
t,
opt,
} from 'graphql-language-service-parser';

export type {
RuleOrString,
ParserOptions,
ParseRule,
TokenPattern,
State,
CharacterStreamInterface,
RuleKindEnum,
Token,
ContextToken,
ContextTokenForCodeMirror,
ContextTokenUnion,
RuleKind,
} from 'graphql-language-service-parser';

/**
* Types and enums to use across projects
*/
export type {
CompletionItem,
GraphQLProjectConfig,
Maybe,
IPosition,
Diagnostic,
IRange,
Definition,
CachedContent,
GraphQLConfig,
GraphQLFileMetadata,
Uri,
ObjectTypeInfo,
Outline,
OutlineTree,
FragmentInfo,
GraphQLFileInfo,
FileChangeType,
GraphQLCache,
GraphQLExtensionDeclaration,
} from 'graphql-language-service-types';

export {
CompletionItemKind,
FileChangeTypeKind,
} from 'graphql-language-service-types';

/**
* Utilities useful for language services across runtimes
*/
export {
JSONSchema6,
JSONSchema6TypeName,
JSONSchemaOptions,
getASTNodeAtPosition,
getFragmentDependencies,
getFragmentDependenciesForAST,
getOperationASTFacts,
getOperationFacts,
getQueryFacts,
getVariablesJSONSchema,
offsetToPosition,
OperationFacts,
pointToOffset,
Position,
collectVariables,
validateWithCustomRules,
VariableToType,
QueryFacts,
Range,
} from 'graphql-language-service-utils';
2 changes: 0 additions & 2 deletions packages/graphql-language-service/src/types/index.ts

This file was deleted.

2 comments on commit 0f1f90c

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.