Skip to content

Commit

Permalink
explicitly export everything from lang service
Browse files Browse the repository at this point in the history
  • Loading branch information
acao committed Dec 6, 2021
1 parent 6bf1073 commit 3acfdb1
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.

0 comments on commit 3acfdb1

Please sign in to comment.