-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove problematic file resolution module from webpack sco… (#1489)
* remove problematic file resolution module from webpack scope * resolve webpack dev build issue * moves parser types around in a way that prevents graphql-config modules from resolving in a funky way during webpack dev builds?
- Loading branch information
Showing
18 changed files
with
176 additions
and
452 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
import { Kind } from 'graphql'; | ||
import { _Kind } from 'graphql/language/kinds'; | ||
import { Maybe } from 'graphql-language-service-types'; | ||
import CharacterStream from './CharacterStream'; | ||
|
||
export type ContextToken = { | ||
start: number; | ||
end: number; | ||
string: string; | ||
state: State; | ||
style: string; | ||
}; | ||
|
||
export type ContextTokenForCodeMirror = { | ||
start: number; | ||
end: number; | ||
string: string; | ||
type: string | null; | ||
state: State; | ||
}; | ||
|
||
export type ContextTokenUnion = ContextToken | ContextTokenForCodeMirror; | ||
|
||
export type RuleOrString = Rule | string; | ||
|
||
export type ParseRule = | ||
| RuleOrString[] | ||
| ((token: Token, stream: CharacterStream) => string | null | void); | ||
|
||
export type Token = { | ||
kind: string; | ||
value: string; | ||
}; | ||
|
||
export type Rule = { | ||
style?: string; | ||
match?: (token: Token) => boolean; | ||
update?: (state: State, token: Token) => void; | ||
separator?: string | Rule; | ||
isList?: boolean; | ||
ofRule?: Rule | string; | ||
}; | ||
|
||
export type State = { | ||
level: number; | ||
levels?: number[]; | ||
prevState: Maybe<State>; | ||
rule: Maybe<ParseRule>; | ||
kind: Maybe<RuleKind>; | ||
name: Maybe<string>; | ||
type: Maybe<string>; | ||
step: number; | ||
needsSeperator: boolean; | ||
needsAdvance?: boolean; | ||
indentLevel?: number; | ||
}; | ||
|
||
export const AdditionalRuleKinds: _AdditionalRuleKinds = { | ||
ALIASED_FIELD: 'AliasedField', | ||
ARGUMENTS: 'Arguments', | ||
SHORT_QUERY: 'ShortQuery', | ||
QUERY: 'Query', | ||
MUTATION: 'Mutation', | ||
SUBSCRIPTION: 'Subscription', | ||
TYPE_CONDITION: 'TypeCondition', | ||
INVALID: 'Invalid', | ||
COMMENT: 'Comment', | ||
SCHEMA_DEF: 'SchemaDef', | ||
SCALAR_DEF: 'ScalarDef', | ||
OBJECT_TYPE_DEF: 'ObjectTypeDef', | ||
INTERFACE_DEF: 'InterfaceDef', | ||
UNION_DEF: 'UnionDef', | ||
ENUM_DEF: 'EnumDef', | ||
FIELD_DEF: 'FieldDef', | ||
INPUT_DEF: 'InputDef', | ||
INPUT_VALUE_DEF: 'InputValueDef', | ||
ARGUMENTS_DEF: 'ArgumentsDef', | ||
EXTEND_DEF: 'ExtendDef', | ||
DIRECTIVE_DEF: 'DirectiveDef', | ||
}; | ||
|
||
export type _AdditionalRuleKinds = { | ||
ALIASED_FIELD: 'AliasedField'; | ||
ARGUMENTS: 'Arguments'; | ||
SHORT_QUERY: 'ShortQuery'; | ||
QUERY: 'Query'; | ||
MUTATION: 'Mutation'; | ||
SUBSCRIPTION: 'Subscription'; | ||
TYPE_CONDITION: 'TypeCondition'; | ||
INVALID: 'Invalid'; | ||
COMMENT: 'Comment'; | ||
SCHEMA_DEF: 'SchemaDef'; | ||
SCALAR_DEF: 'ScalarDef'; | ||
OBJECT_TYPE_DEF: 'ObjectTypeDef'; | ||
INTERFACE_DEF: 'InterfaceDef'; | ||
UNION_DEF: 'UnionDef'; | ||
ENUM_DEF: 'EnumDef'; | ||
FIELD_DEF: 'FieldDef'; | ||
INPUT_DEF: 'InputDef'; | ||
INPUT_VALUE_DEF: 'InputValueDef'; | ||
ARGUMENTS_DEF: 'ArgumentsDef'; | ||
EXTEND_DEF: 'ExtendDef'; | ||
DIRECTIVE_DEF: 'DirectiveDef'; | ||
}; | ||
|
||
export const RuleKinds = { | ||
...Kind, | ||
...AdditionalRuleKinds, | ||
}; | ||
|
||
export type _RuleKinds = _Kind & typeof AdditionalRuleKinds; | ||
|
||
export type RuleKind = _RuleKinds[keyof _RuleKinds]; | ||
export type RuleKindEnum = RuleKind; | ||
export type TokenPattern = string | ((char: string) => boolean) | RegExp; | ||
|
||
export interface CharacterStreamInterface { | ||
getStartOfToken: () => number; | ||
getCurrentPosition: () => number; | ||
eol: () => boolean; | ||
sol: () => boolean; | ||
peek: () => string | null; | ||
next: () => string; | ||
eat: (pattern: TokenPattern) => string | undefined; | ||
eatWhile: (match: TokenPattern) => boolean; | ||
eatSpace: () => boolean; | ||
skipToEnd: () => void; | ||
skipTo: (position: number) => void; | ||
match: ( | ||
pattern: TokenPattern, | ||
consume?: Maybe<boolean>, | ||
caseFold?: Maybe<boolean>, | ||
) => string[] | boolean; | ||
backUp: (num: number) => void; | ||
column: () => number; | ||
indentation: () => number; | ||
current: () => string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.