Skip to content
This repository has been archived by the owner on Sep 2, 2020. It is now read-only.

Commit

Permalink
Depend on graphql-language-service-types
Browse files Browse the repository at this point in the history
Depend on the extracted package, instead of the local copies of the
files. To develop against the local copy you have to use `npm link` or
`yarn link` for now, but I'll try out Lerna in a bit which will smooth
over some of the rough edges with the multi-package development process.
  • Loading branch information
wincent committed Feb 16, 2017
1 parent 4dca3ea commit 08de394
Show file tree
Hide file tree
Showing 21 changed files with 52 additions and 281 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -34,6 +34,7 @@
"dependencies": {
"fb-watchman": "^1.9.0",
"graphql": "0.9.1",
"graphql-language-service-types": "^0.0.6",
"nullthrows": "^1.0.0",
"yargs": "^6.5.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/__schema__/customRules.js
Expand Up @@ -10,8 +10,8 @@

import type {ASTNode} from 'graphql/language';
import type {ValidationContext} from 'graphql/validation';
import type {CustomValidationRule} from 'graphql-language-service-types';
import type {GraphQLConfig} from '../../config/GraphQLConfig';
import type {CustomValidationRule} from '../../types/Types';

import {GraphQLError} from 'graphql/error';

Expand Down
2 changes: 1 addition & 1 deletion src/config/GraphQLConfig.js
Expand Up @@ -8,7 +8,7 @@
* @flow
*/

import type {Uri} from '../types/Types';
import type {Uri} from 'graphql-language-service-types';

import path from 'path';
import fs from 'fs';
Expand Down
6 changes: 3 additions & 3 deletions src/interfaces/GraphQLLanguageService.js
Expand Up @@ -9,14 +9,14 @@
*/

import type {ASTNode} from 'graphql/language';
import type {GraphQLCache} from '../server/GraphQLCache';
import type {GraphQLRC, GraphQLConfig} from '../config/GraphQLConfig';
import type {
CompletionItem,
DefinitionQueryResult,
Diagnostic,
Uri,
} from '../types/Types';
} from 'graphql-language-service-types';
import type {GraphQLCache} from '../server/GraphQLCache';
import type {GraphQLRC, GraphQLConfig} from '../config/GraphQLConfig';
import type {Position} from '../utils/Range';

import {
Expand Down
Expand Up @@ -8,7 +8,7 @@
* @flow
*/

import type {CompletionItem} from '../../types/Types';
import type {CompletionItem} from 'graphql-language-service-types';

import {expect} from 'chai';
import {beforeEach, describe, it} from 'mocha';
Expand Down
13 changes: 6 additions & 7 deletions src/interfaces/autocompleteUtils.js
Expand Up @@ -13,19 +13,18 @@ import type {
GraphQLSchema,
GraphQLType,
} from 'graphql/type/definition';
import type {
CompletionItem,
ContextToken,
State,
TypeInfo,
} from '../types/Types';

import {isCompositeType} from 'graphql';
import {
SchemaMetaFieldDef,
TypeMetaFieldDef,
TypeNameMetaFieldDef,
} from 'graphql/type/introspection';
import type {
CompletionItem,
ContextToken,
State,
TypeInfo,
} from 'graphql-language-service-types';

// Utility for returning the state representing the Definition this token state
// is within, if any.
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/getAutocompleteSuggestions.js
Expand Up @@ -18,7 +18,7 @@ import type {
ContextToken,
State,
TypeInfo,
} from '../types/Types';
} from 'graphql-language-service-types';
import type {Position} from '../utils/Range';

import {
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/getDefinition.js
Expand Up @@ -17,7 +17,7 @@ import type {
DefinitionQueryResult,
FragmentInfo,
Uri,
} from '../types/Types';
} from 'graphql-language-service-types';

import {offsetToPosition, locToRange} from '../utils/Range';

Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/getDiagnostics.js
Expand Up @@ -10,7 +10,7 @@

import type {GraphQLErrorLocation, GraphQLError} from 'graphql/error';
import type {ASTNode} from 'graphql/language';
import type {Diagnostic, CustomValidationRule} from '../types/Types';
import type {Diagnostic, CustomValidationRule} from 'graphql-language-service-types';

import invariant from 'assert';
import {parse} from 'graphql';
Expand Down
6 changes: 5 additions & 1 deletion src/interfaces/getOutline.js
Expand Up @@ -8,7 +8,11 @@
* @flow
*/

import type {Outline, TextToken, TokenKind} from '../types/Types';
import type {
Outline,
TextToken,
TokenKind,
} from 'graphql-language-service-types';

import {parse, visit} from 'graphql';
import {INLINE_FRAGMENT} from 'graphql/language/kinds';
Expand Down
2 changes: 1 addition & 1 deletion src/parser/CharacterStream.js
Expand Up @@ -22,7 +22,7 @@
import type {
TokenPattern,
CharacterStream as CharacterStreamInterface,
} from '../types/Types';
} from 'graphql-language-service-types';

export default class CharacterStream implements CharacterStreamInterface {
_start: number;
Expand Down
2 changes: 1 addition & 1 deletion src/parser/RuleHelpers.js
Expand Up @@ -10,7 +10,7 @@

// These functions help build matching rules for ParseRules.

import type {Rule, Token} from '../types/Types';
import type {Rule, Token} from 'graphql-language-service-types';

// An optional rule.
export function opt(ofRule: Rule | string): Rule {
Expand Down
9 changes: 7 additions & 2 deletions src/parser/Rules.js
Expand Up @@ -8,8 +8,13 @@
* @flow
*/

import type {CharacterStream} from '../types/Types';
import type {State, Token, Rule, ParseRule} from '../types/Types';
import type {
CharacterStream,
State,
Token,
Rule,
ParseRule,
} from 'graphql-language-service-types';
import {opt, list, butNot, t, p} from './RuleHelpers';

/**
Expand Down
7 changes: 5 additions & 2 deletions src/parser/onlineParser.js
Expand Up @@ -28,12 +28,15 @@
*
*/

import type {CharacterStream} from '../types/Types';
import typeof {
LexRules as LexRulesType,
ParseRules as ParseRulesType,
} from './Rules';
import type {State, Token} from '../types/Types';
import type {
CharacterStream,
State,
Token,
} from 'graphql-language-service-types';

import {LexRules, ParseRules, isIgnored} from './Rules';

Expand Down
2 changes: 1 addition & 1 deletion src/server/GraphQLCache.js
Expand Up @@ -14,7 +14,7 @@ import type {
GraphQLFileInfo,
FragmentInfo,
Uri,
} from '../types/Types';
} from 'graphql-language-service-types';

import fs from 'fs';
import path from 'path';
Expand Down
2 changes: 1 addition & 1 deletion src/server/GraphQLWatchman.js
Expand Up @@ -8,7 +8,7 @@
* @flow
*/

import type {Uri} from '../types/Types';
import type {Uri} from 'graphql-language-service-types';

import watchman from 'fb-watchman';

Expand Down
2 changes: 1 addition & 1 deletion src/server/MessageProcessor.js
Expand Up @@ -8,7 +8,7 @@
* @flow
*/

import type {Diagnostic, Uri} from '../types/Types';
import type {Diagnostic, Uri} from 'graphql-language-service-types';

import path from 'path';

Expand Down
200 changes: 0 additions & 200 deletions src/types/Types.js

This file was deleted.

0 comments on commit 08de394

Please sign in to comment.