diff --git a/.browserslistrc b/.browserslistrc index 137cb1d2cf..7871455921 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -1,4 +1,4 @@ -node 6 +node 8 ie 9 ios 9 last 2 chrome versions diff --git a/.eslintrc.yml b/.eslintrc.base.yml similarity index 80% rename from .eslintrc.yml rename to .eslintrc.base.yml index b22d39627b..2ce2e198a5 100644 --- a/.eslintrc.yml +++ b/.eslintrc.base.yml @@ -1,59 +1,11 @@ -parser: babel-eslint -parserOptions: - sourceType: module env: es6: true node: true -plugins: - - flowtype - +parserOptions: + sourceType: module rules: - # `eslint-plugin-flowtype` rule list based on `v3.12.x` - # https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype - - flowtype/array-style-complex-type: [error, verbose] - flowtype/array-style-simple-type: [error, verbose] - flowtype/define-flow-type: error - flowtype/newline-after-flow-annotation: [error, always] - flowtype/no-dupe-keys: error - flowtype/no-existential-type: off # checked by Flow - flowtype/no-flow-fix-me-comments: off # TODO - flowtype/no-mixed: off - flowtype/no-mutable-array: off - flowtype/no-primitive-constructor-types: error - flowtype/no-types-missing-file-annotation: error - flowtype/no-unused-expressions: off - flowtype/no-weak-types: [error, { any: false }] - flowtype/require-compound-type-alias: off - flowtype/require-exact-type: off # TODO - flowtype/require-inexact-type: off # checked by Flow - flowtype/require-parameter-type: off - flowtype/require-readonly-react-props: off - flowtype/require-return-type: off - flowtype/require-types-at-top: off - flowtype/require-valid-file-annotation: - [error, always, { annotationStyle: line, strict: true }] - flowtype/require-variable-type: off - flowtype/sort-keys: off - flowtype/spread-exact-type: off - flowtype/type-id-match: [error, '^[A-Z]'] - flowtype/type-import-style: [error, identifier, { ignoreTypeDefault: true }] - flowtype/use-flow-type: error - - # Bellow rules are disabled because coflicts with Prettier, see: - # https://github.com/prettier/eslint-config-prettier/blob/master/flowtype.js - flowtype/boolean-style: off - flowtype/delimiter-dangle: off - flowtype/generic-spacing: off - flowtype/object-type-delimiter: off - flowtype/semi: off - flowtype/space-after-type-colon: off - flowtype/space-before-generic-bracket: off - flowtype/space-before-type-colon: off - flowtype/union-intersection-spacing: off - ################################################## - # ESLint builtin rules list based on `v5.16.x` + # ESLint builtin rules list based on `v6.1.x` ################################################## # Possible Errors diff --git a/.eslintrc.flow.yml b/.eslintrc.flow.yml new file mode 100644 index 0000000000..be525b32a4 --- /dev/null +++ b/.eslintrc.flow.yml @@ -0,0 +1,49 @@ +extends: .eslintrc.base.yml +parser: babel-eslint +plugins: + - flowtype +rules: + # `eslint-plugin-flowtype` rule list based on `v4.2.x` + # https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype + + flowtype/array-style-complex-type: [error, verbose] + flowtype/array-style-simple-type: [error, verbose] + flowtype/define-flow-type: error + flowtype/newline-after-flow-annotation: [error, always] + flowtype/no-dupe-keys: error + flowtype/no-existential-type: off # checked by Flow + flowtype/no-flow-fix-me-comments: off # TODO + flowtype/no-mixed: off + flowtype/no-mutable-array: off + flowtype/no-primitive-constructor-types: error + flowtype/no-types-missing-file-annotation: error + flowtype/no-unused-expressions: off + flowtype/no-weak-types: [error, { any: false }] + flowtype/require-compound-type-alias: off + flowtype/require-exact-type: off # TODO + flowtype/require-indexer-name: error + flowtype/require-inexact-type: off # checked by Flow + flowtype/require-parameter-type: off + flowtype/require-readonly-react-props: off + flowtype/require-return-type: off + flowtype/require-types-at-top: off + flowtype/require-valid-file-annotation: + [error, always, { annotationStyle: line, strict: true }] + flowtype/require-variable-type: off + flowtype/sort-keys: off + flowtype/spread-exact-type: off + flowtype/type-id-match: [error, '^[A-Z]'] + flowtype/type-import-style: [error, identifier, { ignoreTypeDefault: true }] + flowtype/use-flow-type: error + + # Bellow rules are disabled because coflicts with Prettier, see: + # https://github.com/prettier/eslint-config-prettier/blob/master/flowtype.js + flowtype/boolean-style: off + flowtype/delimiter-dangle: off + flowtype/generic-spacing: off + flowtype/object-type-delimiter: off + flowtype/semi: off + flowtype/space-after-type-colon: off + flowtype/space-before-generic-bracket: off + flowtype/space-before-type-colon: off + flowtype/union-intersection-spacing: off diff --git a/.eslintrc.ts.yml b/.eslintrc.ts.yml new file mode 100644 index 0000000000..7af99a8ac1 --- /dev/null +++ b/.eslintrc.ts.yml @@ -0,0 +1,20 @@ +extends: + [ + .eslintrc.base.yml, + plugin:@typescript-eslint/eslint-recommended, + plugin:@typescript-eslint/recommended, + plugin:@typescript-eslint/recommended-requiring-type-checking, + ] +parser: '@typescript-eslint/parser' +parserOptions: + 'project': './tsconfig.json' +plugins: ['@typescript-eslint'] +rules: + 'no-useless-constructor': 'off' + '@typescript-eslint/no-useless-constructor': 'error' + '@typescript-eslint/no-explicit-any': 'off' + +overrides: + - files: '**/*.d.ts' + rules: + '@typescript-eslint/no-unused-vars': 'off' diff --git a/.gitignore b/.gitignore index 4186835d32..ab55c7ff01 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ coverage dist benchmarkDist npm +ts-build diff --git a/.mocharc.yml b/.mocharc.yml index 36e79c2322..528f46d83f 100644 --- a/.mocharc.yml +++ b/.mocharc.yml @@ -3,3 +3,4 @@ check-leaks: true require: - '@babel/register' - '@babel/polyfill' + - 'ts-node/register' diff --git a/.nycrc.yml b/.nycrc.yml index f6ead2c2e3..6937ad5c41 100644 --- a/.nycrc.yml +++ b/.nycrc.yml @@ -3,6 +3,7 @@ include: exclude: - 'src/polyfills' clean: true +extends: '@istanbuljs/nyc-config-typescript' temp-directory: 'coverage/tests' report-dir: 'coverage/tests' skip-full: true diff --git a/.travis.yml b/.travis.yml index d0de783f5f..df1df6c8f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,6 @@ node_js: - '12' - '10' - '8' - - '6' script: | if [[ "$(node -pe process.version)" == v10.* ]]; then # Is latest LTS? diff --git a/README.md b/README.md index 66f1a8af5c..7d095bc739 100644 --- a/README.md +++ b/README.md @@ -138,3 +138,28 @@ Changes are tracked as [GitHub releases](https://github.com/graphql/graphql-js/r ### License GraphQL.js is [MIT-licensed](https://github.com/graphql/graphql-js/blob/master/LICENSE). + +## TypeScript definition files + +We used `*.d.ts` files from [DefinetlyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/54712a7e28090c5b1253b746d1878003c954f3ff/types/graphql) as the basis for our TypeScript conversion in `v15.0.0`. Big thanks to: + +- TonyYang https://github.com/TonyPythoneer +- Caleb Meredith https://github.com/calebmer +- Dominic Watson https://github.com/intellix +- Firede https://github.com/firede +- Kepennar https://github.com/kepennar +- Mikhail Novikov https://github.com/freiksenet +- Ivan Goncharov https://github.com/IvanGoncharov +- Hagai Cohen https://github.com/DxCx +- Ricardo Portugal https://github.com/rportugal +- Tim Griesser https://github.com/tgriesser +- Dylan Stewart https://github.com/dyst5422 +- Alessio Dionisi https://github.com/adnsio +- Divyendu Singh https://github.com/divyenduz +- Brad Zacher https://github.com/bradzacher +- Curtis Layne https://github.com/clayne11 +- Jonathan Cardoso https://github.com/JCMais +- Pavel Lang https://github.com/langpavel +- Mark Caudill https://github.com/mc0 +- Martijn Walraven https://github.com/martijnwalraven +- Jed Mao https://github.com/jedmao diff --git a/package.json b/package.json index c173a4b629..5f040617a9 100644 --- a/package.json +++ b/package.json @@ -21,21 +21,25 @@ "graphql-js" ], "engines": { - "node": ">= 6.x" + "node": ">= 8.x" }, "scripts": { - "test": "npm run prettier:check && npm run lint && npm run check && npm run testonly && npm run check:ts", - "test:ci": "yarn check --integrity && npm run prettier:check && npm run lint -- --no-cache && npm run check && npm run testonly:cover && npm run check:ts && npm run build", - "testonly": "mocha --full-trace src/**/__tests__/**/*-test.js", + "test": "npm run prettier:check && npm run lint && npm run check && npm run testonly", + "test:ci": "yarn check --integrity && npm run prettier:check && npm run lint -- --no-cache && npm run check && npm run testonly:cover && npm run build", + "testonly": "mocha --full-trace src/**/__tests__/**/*-test.{ts,js}", "testonly:cover": "nyc npm run testonly", - "lint": "eslint --cache --report-unused-disable-directives src resources", + "lint": "npm run lint:flow && npm run lint:ts", + "lint:flow": "eslint -c .eslintrc.flow.yml --cache --report-unused-disable-directives src resources", + "lint:ts": "eslint -c .eslintrc.ts.yml --cache --report-unused-disable-directives src --ext .ts", "benchmark": "node --noconcurrent_sweeping --expose-gc --predictable ./resources/benchmark.js", - "prettier": "prettier --ignore-path .gitignore --write --list-different \"**/*.{js,ts,md,json,yml}\"", - "prettier:check": "prettier --ignore-path .gitignore --check \"**/*.{js,ts,md,json,yml}\"", - "check": "flow check", - "check:ts": "dtslint tstypes", + "prettier": "prettier --ignore-path .gitignore --write --list-different \"**/*.{js,ts,md,json,yml,flow}\"", + "prettier:check": "prettier --ignore-path .gitignore --check \"**/*.{js,ts,md,json,yml,flow}\"", + "check": "npm run check:flow && npm run check:ts && npm run check:dts", + "check:flow": "flow check", + "check:ts": "tsc", + "check:dts": "dtslint src", "check:cover": "node resources/check-cover.js && nyc report --nycrc-path .nycflowrc.yml", - "build": "node resources/build.js", + "build": "tsc -b tsconfig.build.json && node resources/build.js", "changelog": "node resources/gen-changelog.js", "preversion": ". ./resources/checkgit.sh", "version": "node resources/gen-version.js && npm test && git add src/version.js", @@ -50,14 +54,24 @@ "@babel/polyfill": "7.4.4", "@babel/preset-env": "7.5.5", "@babel/register": "7.5.5", + "@istanbuljs/nyc-config-typescript": "^0.1.3", + "@types/chai": "^4.2.0", + "@types/mocha": "^5.2.7", + "@types/node": "^12.7.2", + "@typescript-eslint/eslint-plugin": "^2.0.0", + "@typescript-eslint/parser": "^2.0.0", "babel-eslint": "10.0.2", "chai": "4.2.0", "dtslint": "^0.9.2", - "eslint": "5.16.0", - "eslint-plugin-flowtype": "3.12.1", - "flow-bin": "0.106.0", + "eslint": "6.1.0", + "eslint-plugin-flowtype": "4.2.0", + "eslint-plugin-typescript": "^0.14.0", + "flow-bin": "0.106.1", "mocha": "6.2.0", "nyc": "14.1.1", - "prettier": "1.18.2" + "prettier": "1.18.2", + "source-map-support": "^0.5.13", + "ts-node": "^8.3.0", + "typescript": "^3.5.3" } } diff --git a/resources/build.js b/resources/build.js index f7711c0c57..49eee88afd 100644 --- a/resources/build.js +++ b/resources/build.js @@ -22,19 +22,25 @@ if (require.main === module) { copyFile('./LICENSE', './dist/LICENSE'); copyFile('./README.md', './dist/README.md'); - const srcFiles = readdirRecursive('./src', { ignoreDir: /^__.*__$/ }); - for (const filepath of srcFiles) { + const tsArtifacts = readdirRecursive('./ts-build', { ignoreDir: /^__.*__$/ }); + for (const filepath of tsArtifacts) { if (filepath.endsWith('.js')) { - buildJSFile(filepath); + buildTSEmittedJSFile(filepath); + } else if (filepath.endsWith('.d.ts')) { + const srcPath = path.join('./ts-build', filepath); + const destPath = path.join('./dist', filepath); + copyFile(srcPath, destPath); } } + rmdirRecursive('./ts-build'); - const tsFiles = readdirRecursive('./tstypes', { ignoreDir: /^__.*__$/ }); - for (const filepath of tsFiles) { - if (filepath.endsWith('.d.ts')) { - const srcPath = path.join('./tstypes', filepath); + const srcFiles = readdirRecursive('./src', { ignoreDir: /^__.*__$/ }); + for (const filepath of srcFiles) { + if (filepath.endsWith('.js')) { + buildFlowFile(filepath); + } else if (filepath.endsWith('.js.flow') || filepath.endsWith('.d.ts')) { + const srcPath = path.join('./src', filepath); const destPath = path.join('./dist', filepath); - copyFile(srcPath, destPath); } } @@ -99,7 +105,7 @@ function babelBuild(srcPath, envName) { return babel.transformFileSync(srcPath, { envName }).code + '\n'; } -function buildJSFile(filepath) { +function buildFlowFile(filepath) { const srcPath = path.join('./src', filepath); const destPath = path.join('./dist', filepath); @@ -108,6 +114,14 @@ function buildJSFile(filepath) { writeFile(destPath.replace(/\.js$/, '.mjs'), babelBuild(srcPath, 'mjs')); } +function buildTSEmittedJSFile(filepath) { + const srcPath = path.join('./ts-build', filepath); + const destPath = path.join('./dist', filepath); + + writeFile(destPath, babelBuild(srcPath, 'cjs')); + writeFile(destPath.replace(/\.js$/, '.mjs'), babelBuild(srcPath, 'mjs')); +} + function buildPackageJSON() { const packageJSON = require('../package.json'); delete packageJSON.private; diff --git a/tstypes/error/GraphQLError.d.ts b/src/error/GraphQLError.d.ts similarity index 100% rename from tstypes/error/GraphQLError.d.ts rename to src/error/GraphQLError.d.ts diff --git a/tstypes/error/formatError.d.ts b/src/error/formatError.d.ts similarity index 100% rename from tstypes/error/formatError.d.ts rename to src/error/formatError.d.ts diff --git a/tstypes/error/index.d.ts b/src/error/index.d.ts similarity index 100% rename from tstypes/error/index.d.ts rename to src/error/index.d.ts diff --git a/tstypes/error/locatedError.d.ts b/src/error/locatedError.d.ts similarity index 100% rename from tstypes/error/locatedError.d.ts rename to src/error/locatedError.d.ts diff --git a/tstypes/error/syntaxError.d.ts b/src/error/syntaxError.d.ts similarity index 100% rename from tstypes/error/syntaxError.d.ts rename to src/error/syntaxError.d.ts diff --git a/tstypes/execution/execute.d.ts b/src/execution/execute.d.ts similarity index 100% rename from tstypes/execution/execute.d.ts rename to src/execution/execute.d.ts diff --git a/tstypes/execution/index.d.ts b/src/execution/index.d.ts similarity index 100% rename from tstypes/execution/index.d.ts rename to src/execution/index.d.ts diff --git a/tstypes/execution/values.d.ts b/src/execution/values.d.ts similarity index 100% rename from tstypes/execution/values.d.ts rename to src/execution/values.d.ts diff --git a/tstypes/graphql.d.ts b/src/graphql.d.ts similarity index 100% rename from tstypes/graphql.d.ts rename to src/graphql.d.ts diff --git a/tstypes/index.d.ts b/src/index.d.ts similarity index 95% rename from tstypes/index.d.ts rename to src/index.d.ts index 942cc2e918..86cd446880 100644 --- a/tstypes/index.d.ts +++ b/src/index.d.ts @@ -124,7 +124,7 @@ export { // Validate GraphQL schema. validateSchema, assertValidSchema, -} from './type'; +} from './type/index'; export { GraphQLType, @@ -167,7 +167,7 @@ export { GraphQLScalarSerializer, GraphQLScalarValueParser, GraphQLScalarLiteralParser, -} from './type'; +} from './type/index'; // Parse and operate on GraphQL language source files. export { @@ -203,7 +203,7 @@ export { isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode, -} from './language'; +} from './language/index'; export { Lexer, @@ -276,7 +276,7 @@ export { UnionTypeExtensionNode, EnumTypeExtensionNode, InputObjectTypeExtensionNode, -} from './language'; +} from './language/index'; // Execute GraphQL queries. export { @@ -287,13 +287,13 @@ export { getDirectiveValues, ExecutionArgs, ExecutionResult, -} from './execution'; +} from './execution/index'; export { subscribe, createSourceEventStream, SubscriptionArgs, -} from './subscription'; +} from './subscription/index'; // Validate GraphQL documents. export { @@ -328,7 +328,7 @@ export { VariablesAreInputTypesRule, VariablesInAllowedPositionRule, ValidationRule, -} from './validation'; +} from './validation/index'; // Create, format, and print GraphQL errors. export { @@ -338,15 +338,13 @@ export { printError, formatError, GraphQLFormattedError, -} from './error'; +} from './error/index'; // Utilities for operating on GraphQL type schema and parsed sources. export { // Produce the GraphQL query recommended for a full schema introspection. // Accepts optional IntrospectionOptions. getIntrospectionQuery, - // @deprecated: use getIntrospectionQuery - will be removed in v15. - introspectionQuery, // Gets the target Operation from a Document. getOperationAST, // Gets the Type for the target Operation AST. @@ -387,12 +385,6 @@ export { TypeInfo, // Coerces a JavaScript value to a GraphQL type, or produces errors. coerceInputValue, - // @deprecated use coerceInputValue - will be removed in v15 - coerceValue, - // @deprecated use coerceInputValue - will be removed in v15 - isValidJSValue, - // @deprecated use validation - will be removed in v15 - isValidLiteralValue, // Concatenates multiple AST together. concatAST, // Separates an AST into an AST per Operation. @@ -415,7 +407,7 @@ export { findDangerousChanges, // Report all deprecated usage within a GraphQL document. findDeprecatedUsages, -} from './utilities'; +} from './utilities/index'; export { IntrospectionOptions, @@ -443,4 +435,4 @@ export { BuildSchemaOptions, BreakingChange, DangerousChange, -} from './utilities'; +} from './utilities/index'; diff --git a/src/index.js b/src/index.js index 614a048cef..46133b23db 100644 --- a/src/index.js +++ b/src/index.js @@ -345,8 +345,6 @@ export { // Produce the GraphQL query recommended for a full schema introspection. // Accepts optional IntrospectionOptions. getIntrospectionQuery, - // @deprecated: use getIntrospectionQuery - will be removed in v15. - introspectionQuery, // Gets the target Operation from a Document. getOperationAST, // Gets the Type for the target Operation AST. @@ -387,12 +385,6 @@ export { TypeInfo, // Coerces a JavaScript value to a GraphQL type, or produces errors. coerceInputValue, - // @deprecated use coerceInputValue - will be removed in v15 - coerceValue, - // @deprecated use coerceInputValue - will be removed in v15 - isValidJSValue, - // @deprecated use validation - will be removed in v15 - isValidLiteralValue, // Concatenates multiple AST together. concatAST, // Separates an AST into an AST per Operation. diff --git a/tstypes/jsutils/Path.d.ts b/src/jsutils/Path.d.ts similarity index 100% rename from tstypes/jsutils/Path.d.ts rename to src/jsutils/Path.d.ts diff --git a/tstypes/jsutils/PromiseOrValue.d.ts b/src/jsutils/PromiseOrValue.d.ts similarity index 100% rename from tstypes/jsutils/PromiseOrValue.d.ts rename to src/jsutils/PromiseOrValue.d.ts diff --git a/src/jsutils/__tests__/dedent-test.js b/src/jsutils/__tests__/dedent-test.ts similarity index 100% rename from src/jsutils/__tests__/dedent-test.js rename to src/jsutils/__tests__/dedent-test.ts diff --git a/src/jsutils/dedent.js.flow b/src/jsutils/dedent.js.flow new file mode 100644 index 0000000000..8d4171fde5 --- /dev/null +++ b/src/jsutils/dedent.js.flow @@ -0,0 +1,18 @@ +// @flow strict + +/** + * An ES6 string tag that fixes indentation. Also removes leading newlines + * and trailing spaces and tabs, but keeps trailing newlines. + * + * Example usage: + * const str = dedent` + * { + * test + * } + * `; + * str === "{\n test\n}\n"; + */ +declare export default function dedent( + strings: $ReadOnlyArray, + ...values: $ReadOnlyArray +): string; diff --git a/src/jsutils/dedent.js b/src/jsutils/dedent.ts similarity index 91% rename from src/jsutils/dedent.js rename to src/jsutils/dedent.ts index d7270f8c56..5e2ef8ecfb 100644 --- a/src/jsutils/dedent.js +++ b/src/jsutils/dedent.ts @@ -1,5 +1,3 @@ -// @flow strict - /** * An ES6 string tag that fixes indentation. Also removes leading newlines * and trailing spaces and tabs, but keeps trailing newlines. @@ -13,8 +11,8 @@ * str === "{\n test\n}\n"; */ export default function dedent( - strings: $ReadOnlyArray, - ...values: $ReadOnlyArray + strings: ReadonlyArray, + ...values: ReadonlyArray ): string { let str = ''; diff --git a/tstypes/language/ast.d.ts b/src/language/ast.d.ts similarity index 100% rename from tstypes/language/ast.d.ts rename to src/language/ast.d.ts diff --git a/tstypes/language/blockString.d.ts b/src/language/blockString.d.ts similarity index 100% rename from tstypes/language/blockString.d.ts rename to src/language/blockString.d.ts diff --git a/tstypes/language/directiveLocation.d.ts b/src/language/directiveLocation.d.ts similarity index 100% rename from tstypes/language/directiveLocation.d.ts rename to src/language/directiveLocation.d.ts diff --git a/tstypes/language/index.d.ts b/src/language/index.d.ts similarity index 100% rename from tstypes/language/index.d.ts rename to src/language/index.d.ts diff --git a/tstypes/language/kinds.d.ts b/src/language/kinds.d.ts similarity index 100% rename from tstypes/language/kinds.d.ts rename to src/language/kinds.d.ts diff --git a/tstypes/language/lexer.d.ts b/src/language/lexer.d.ts similarity index 96% rename from tstypes/language/lexer.d.ts rename to src/language/lexer.d.ts index f5c1f85563..2de2d9320a 100644 --- a/tstypes/language/lexer.d.ts +++ b/src/language/lexer.d.ts @@ -1,4 +1,4 @@ -import { syntaxError } from '../error'; +import { syntaxError } from '../error/syntaxError'; import { Token } from './ast'; import { Source } from './source'; diff --git a/tstypes/language/location.d.ts b/src/language/location.d.ts similarity index 100% rename from tstypes/language/location.d.ts rename to src/language/location.d.ts diff --git a/tstypes/language/parser.d.ts b/src/language/parser.d.ts similarity index 100% rename from tstypes/language/parser.d.ts rename to src/language/parser.d.ts diff --git a/tstypes/language/predicates.d.ts b/src/language/predicates.d.ts similarity index 100% rename from tstypes/language/predicates.d.ts rename to src/language/predicates.d.ts diff --git a/tstypes/language/printLocation.d.ts b/src/language/printLocation.d.ts similarity index 100% rename from tstypes/language/printLocation.d.ts rename to src/language/printLocation.d.ts diff --git a/tstypes/language/printer.d.ts b/src/language/printer.d.ts similarity index 100% rename from tstypes/language/printer.d.ts rename to src/language/printer.d.ts diff --git a/tstypes/language/source.d.ts b/src/language/source.d.ts similarity index 100% rename from tstypes/language/source.d.ts rename to src/language/source.d.ts diff --git a/tstypes/language/tokenKind.d.ts b/src/language/tokenKind.d.ts similarity index 100% rename from tstypes/language/tokenKind.d.ts rename to src/language/tokenKind.d.ts diff --git a/tstypes/language/visitor.d.ts b/src/language/visitor.d.ts similarity index 100% rename from tstypes/language/visitor.d.ts rename to src/language/visitor.d.ts diff --git a/tstypes/subscription/asyncIteratorReject.d.ts b/src/subscription/asyncIteratorReject.d.ts similarity index 100% rename from tstypes/subscription/asyncIteratorReject.d.ts rename to src/subscription/asyncIteratorReject.d.ts diff --git a/tstypes/subscription/index.d.ts b/src/subscription/index.d.ts similarity index 100% rename from tstypes/subscription/index.d.ts rename to src/subscription/index.d.ts diff --git a/tstypes/subscription/mapAsyncIterator.d.ts b/src/subscription/mapAsyncIterator.d.ts similarity index 100% rename from tstypes/subscription/mapAsyncIterator.d.ts rename to src/subscription/mapAsyncIterator.d.ts diff --git a/tstypes/subscription/subscribe.d.ts b/src/subscription/subscribe.d.ts similarity index 100% rename from tstypes/subscription/subscribe.d.ts rename to src/subscription/subscribe.d.ts diff --git a/tstypes/tsconfig.json b/src/tsconfig.json similarity index 100% rename from tstypes/tsconfig.json rename to src/tsconfig.json diff --git a/tstypes/tslint.json b/src/tslint.json similarity index 95% rename from tstypes/tslint.json rename to src/tslint.json index 8c08a13eb3..871b99c514 100644 --- a/tstypes/tslint.json +++ b/src/tslint.json @@ -9,6 +9,7 @@ "no-consecutive-blank-lines": false, "no-duplicate-imports": false, "no-empty-interface": false, + "no-misused-new": false, "no-redundant-undefined": false, "no-unnecessary-generics": false, "semicolon": false, diff --git a/tstypes/tsutils/Maybe.d.ts b/src/tsutils/Maybe.d.ts similarity index 100% rename from tstypes/tsutils/Maybe.d.ts rename to src/tsutils/Maybe.d.ts diff --git a/src/type/__tests__/definition-test.js b/src/type/__tests__/definition-test.js index 77cee03a0f..f66ca60b87 100644 --- a/src/type/__tests__/definition-test.js +++ b/src/type/__tests__/definition-test.js @@ -243,7 +243,7 @@ describe('Type System: Objects', () => { args: [ { name: 'arg', - description: null, + description: undefined, type: ScalarType, defaultValue: undefined, extensions: undefined, diff --git a/src/type/__tests__/directive-test.js b/src/type/__tests__/directive-test.js index 640b236613..38bbe852a9 100644 --- a/src/type/__tests__/directive-test.js +++ b/src/type/__tests__/directive-test.js @@ -36,7 +36,7 @@ describe('Type System: Directive', () => { args: [ { name: 'foo', - description: null, + description: undefined, type: GraphQLString, defaultValue: undefined, extensions: undefined, @@ -44,7 +44,7 @@ describe('Type System: Directive', () => { }, { name: 'bar', - description: null, + description: undefined, type: GraphQLInt, defaultValue: undefined, extensions: undefined, diff --git a/src/type/__tests__/introspection-test.js b/src/type/__tests__/introspection-test.js index fd5473a65d..2c7b35a850 100644 --- a/src/type/__tests__/introspection-test.js +++ b/src/type/__tests__/introspection-test.js @@ -8,7 +8,7 @@ import invariant from '../../jsutils/invariant'; import { missingFieldArgMessage } from '../../validation/rules/ProvidedRequiredArguments'; import { graphqlSync } from '../../graphql'; -import { getIntrospectionQuery } from '../../utilities/introspectionQuery'; +import { getIntrospectionQuery } from '../../utilities/getIntrospectionQuery'; import { GraphQLSchema } from '../schema'; import { GraphQLString } from '../scalars'; diff --git a/src/type/__tests__/schema-test.js b/src/type/__tests__/schema-test.js index 3174624937..8c5dd6733c 100644 --- a/src/type/__tests__/schema-test.js +++ b/src/type/__tests__/schema-test.js @@ -269,14 +269,6 @@ describe('Type System: Schema', () => { ).to.equal(undefined); }); - it('configures the schema for allowed legacy names', () => { - expect( - new GraphQLSchema({ - allowedLegacyNames: ['__badName'], - }).__allowedLegacyNames, - ).to.deep.equal(['__badName']); - }); - it('checks the configuration for mistakes', () => { // $DisableFlowOnNegativeTest expect(() => new GraphQLSchema(() => null)).to.throw(); @@ -284,8 +276,6 @@ describe('Type System: Schema', () => { expect(() => new GraphQLSchema({ types: {} })).to.throw(); // $DisableFlowOnNegativeTest expect(() => new GraphQLSchema({ directives: {} })).to.throw(); - // $DisableFlowOnNegativeTest - expect(() => new GraphQLSchema({ allowedLegacyNames: {} })).to.throw(); }); }); @@ -342,15 +332,6 @@ describe('Type System: Schema', () => { ).to.deep.equal([]); }); - it('still configures the schema for allowed legacy names', () => { - expect( - new GraphQLSchema({ - assumeValid: true, - allowedLegacyNames: ['__badName'], - }).__allowedLegacyNames, - ).to.deep.equal(['__badName']); - }); - it('does not check the configuration for mistakes', () => { const config = () => null; config.assumeValid = true; @@ -364,7 +345,6 @@ describe('Type System: Schema', () => { assumeValid: true, types: {}, directives: { reduce: () => [] }, - allowedLegacyNames: {}, }), ).to.not.throw(); }); diff --git a/src/type/__tests__/validation-test.js b/src/type/__tests__/validation-test.js index 10dcd8453e..903b374dba 100644 --- a/src/type/__tests__/validation-test.js +++ b/src/type/__tests__/validation-test.js @@ -463,43 +463,6 @@ describe('Type System: Objects must have fields', () => { }, ]); }); - - it('accepts an Object type with explicitly allowed legacy named fields', () => { - const schemaBad = new GraphQLSchema({ - query: new GraphQLObjectType({ - name: 'Query', - fields: { __badName: { type: GraphQLString } }, - }), - }); - const schemaOk = new GraphQLSchema({ - query: new GraphQLObjectType({ - name: 'Query', - fields: { __badName: { type: GraphQLString } }, - }), - allowedLegacyNames: ['__badName'], - }); - expect(validateSchema(schemaBad)).to.deep.equal([ - { - message: - 'Name "__badName" must not begin with "__", which is reserved by GraphQL introspection.', - }, - ]); - expect(validateSchema(schemaOk)).to.deep.equal([]); - }); - - it('throws with bad value for explicitly allowed legacy names', () => { - expect( - () => - new GraphQLSchema({ - query: new GraphQLObjectType({ - name: 'Query', - fields: { __badName: { type: GraphQLString } }, - }), - // $DisableFlowOnNegativeTest - allowedLegacyNames: true, - }), - ).to.throw('"allowedLegacyNames" must be Array if provided but got: true.'); - }); }); describe('Type System: Fields args must be properly named', () => { diff --git a/tstypes/type/definition.d.ts b/src/type/definition.d.ts similarity index 98% rename from tstypes/type/definition.d.ts rename to src/type/definition.d.ts index b468797748..db1e716cfb 100644 --- a/tstypes/type/definition.d.ts +++ b/src/type/definition.d.ts @@ -172,12 +172,13 @@ interface GraphQLList { inspect(): string; } -interface _GraphQLList { +interface GraphQLList { (type: T): GraphQLList; + // eslint-disable-next-line @typescript-eslint/no-misused-new new (type: T): GraphQLList; } -export const GraphQLList: _GraphQLList; +export const GraphQLList: GraphQLList; /** * Non-Null Modifier @@ -206,12 +207,13 @@ interface GraphQLNonNull { inspect(): string; } -interface _GraphQLNonNull { +interface GraphQLNonNull { (type: T): GraphQLNonNull; + // eslint-disable-next-line @typescript-eslint/no-misused-new new (type: T): GraphQLNonNull; } -export const GraphQLNonNull: _GraphQLNonNull; +export const GraphQLNonNull: GraphQLNonNull; export type GraphQLWrappingType = GraphQLList | GraphQLNonNull; diff --git a/src/type/definition.js b/src/type/definition.js index 3fe9920246..82b7b0bbd8 100644 --- a/src/type/definition.js +++ b/src/type/definition.js @@ -783,7 +783,7 @@ function defineFieldMap( const args = objectEntries(argsConfig).map(([argName, arg]) => ({ name: argName, - description: arg.description === undefined ? null : arg.description, + description: arg.description, type: arg.type, defaultValue: arg.defaultValue, extensions: arg.extensions && toObjMap(arg.extensions), @@ -791,7 +791,6 @@ function defineFieldMap( })); return { - ...fieldConfig, name: fieldName, description: fieldConfig.description, type: fieldConfig.type, @@ -1424,7 +1423,6 @@ function defineInputFieldMap( ); return { - ...fieldConfig, name: fieldName, description: fieldConfig.description, type: fieldConfig.type, diff --git a/tstypes/type/directives.d.ts b/src/type/directives.d.ts similarity index 100% rename from tstypes/type/directives.d.ts rename to src/type/directives.d.ts diff --git a/src/type/directives.js b/src/type/directives.js index 0d2071d5a1..2a8a119b52 100644 --- a/src/type/directives.js +++ b/src/type/directives.js @@ -83,7 +83,7 @@ export class GraphQLDirective { this.args = objectEntries(args).map(([argName, arg]) => ({ name: argName, - description: arg.description === undefined ? null : arg.description, + description: arg.description, type: arg.type, defaultValue: arg.defaultValue, extensions: arg.extensions && toObjMap(arg.extensions), diff --git a/tstypes/type/index.d.ts b/src/type/index.d.ts similarity index 100% rename from tstypes/type/index.d.ts rename to src/type/index.d.ts diff --git a/tstypes/type/introspection.d.ts b/src/type/introspection.d.ts similarity index 100% rename from tstypes/type/introspection.d.ts rename to src/type/introspection.d.ts diff --git a/tstypes/type/scalars.d.ts b/src/type/scalars.d.ts similarity index 100% rename from tstypes/type/scalars.d.ts rename to src/type/scalars.d.ts diff --git a/tstypes/type/schema.d.ts b/src/type/schema.d.ts similarity index 89% rename from tstypes/type/schema.d.ts rename to src/type/schema.d.ts index 5cbddaed60..468d227584 100644 --- a/tstypes/type/schema.d.ts +++ b/src/type/schema.d.ts @@ -70,7 +70,6 @@ export class GraphQLSchema { extensions: Maybe>>; extensionASTNodes: ReadonlyArray; assumeValid: boolean; - allowedLegacyNames: ReadonlyArray; }; } @@ -85,15 +84,6 @@ export interface GraphQLSchemaValidationOptions { * Default: false */ assumeValid?: boolean; - - /** - * If provided, the schema will consider fields or types with names included - * in this list valid, even if they do not adhere to the specification's - * schema validation rules. - * - * This option is provided to ease adoption and will be removed in v15. - */ - allowedLegacyNames?: Maybe>; } export interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions { diff --git a/src/type/schema.js b/src/type/schema.js index d357288743..1338708665 100644 --- a/src/type/schema.js +++ b/src/type/schema.js @@ -133,8 +133,6 @@ export class GraphQLSchema { _possibleTypeMap: ObjMap>; // Used as a cache for validateSchema(). __validationErrors: ?$ReadOnlyArray; - // Referenced by validateSchema(). - __allowedLegacyNames: $ReadOnlyArray; constructor(config: GraphQLSchemaConfig): void { // If this schema was built from a source known to be valid, then it may be @@ -156,18 +154,12 @@ export class GraphQLSchema { '"directives" must be Array if provided but got: ' + `${inspect(config.directives)}.`, ); - devAssert( - !config.allowedLegacyNames || Array.isArray(config.allowedLegacyNames), - '"allowedLegacyNames" must be Array if provided but got: ' + - `${inspect(config.allowedLegacyNames)}.`, - ); } this.extensions = config.extensions && toObjMap(config.extensions); this.astNode = config.astNode; this.extensionASTNodes = config.extensionASTNodes; - this.__allowedLegacyNames = config.allowedLegacyNames || []; this._queryType = config.query; this._mutationType = config.mutation; this._subscriptionType = config.subscription; @@ -273,7 +265,6 @@ export class GraphQLSchema { extensions: ?ReadOnlyObjMap, extensionASTNodes: $ReadOnlyArray, assumeValid: boolean, - allowedLegacyNames: $ReadOnlyArray, |} { return { query: this.getQueryType(), @@ -285,7 +276,6 @@ export class GraphQLSchema { astNode: this.astNode, extensionASTNodes: this.extensionASTNodes || [], assumeValid: this.__validationErrors !== undefined, - allowedLegacyNames: this.__allowedLegacyNames, }; } } @@ -304,15 +294,6 @@ export type GraphQLSchemaValidationOptions = {| * Default: false */ assumeValid?: boolean, - - /** - * If provided, the schema will consider fields or types with names included - * in this list valid, even if they do not adhere to the specification's - * schema validation rules. - * - * This option is provided to ease adoption and will be removed in v15. - */ - allowedLegacyNames?: ?$ReadOnlyArray, |}; export type GraphQLSchemaConfig = {| diff --git a/tstypes/type/validate.d.ts b/src/type/validate.d.ts similarity index 100% rename from tstypes/type/validate.d.ts rename to src/type/validate.d.ts diff --git a/src/type/validate.js b/src/type/validate.js index c4e9b0dc6f..6d8ac5c91d 100644 --- a/src/type/validate.js +++ b/src/type/validate.js @@ -204,11 +204,6 @@ function validateName( context: SchemaValidationContext, node: { +name: string, +astNode: ?ASTNode, ... }, ): void { - // If a schema explicitly allows some legacy name which is no longer valid, - // allow it to be assumed valid. - if (context.schema.__allowedLegacyNames.indexOf(node.name) !== -1) { - return; - } // Ensure names are valid, however introspection types opt out. const error = isValidNameError(node.name, node.astNode || undefined); if (error) { diff --git a/tstypes/utilities/TypeInfo.d.ts b/src/utilities/TypeInfo.d.ts similarity index 100% rename from tstypes/utilities/TypeInfo.d.ts rename to src/utilities/TypeInfo.d.ts diff --git a/src/utilities/__tests__/buildASTSchema-test.js b/src/utilities/__tests__/buildASTSchema-test.js index abcbd91063..8fc68ef3d6 100644 --- a/src/utilities/__tests__/buildASTSchema-test.js +++ b/src/utilities/__tests__/buildASTSchema-test.js @@ -814,17 +814,6 @@ describe('Schema Builder', () => { expect(errors).to.have.lengthOf.above(0); }); - it('Accepts legacy names', () => { - const sdl = ` - type Query { - __badName: String - } - `; - const schema = buildSchema(sdl, { allowedLegacyNames: ['__badName'] }); - const errors = validateSchema(schema); - expect(errors).to.have.lengthOf(0); - }); - it('Rejects invalid SDL', () => { const sdl = ` type Query { diff --git a/src/utilities/__tests__/buildClientSchema-test.js b/src/utilities/__tests__/buildClientSchema-test.js index 33e5b21fca..ce3ad739c9 100644 --- a/src/utilities/__tests__/buildClientSchema-test.js +++ b/src/utilities/__tests__/buildClientSchema-test.js @@ -480,24 +480,6 @@ describe('Type System: build schema from introspection', () => { expect(printSchema(clientSchema)).to.equal(sdl); }); - it('builds a schema with legacy names', () => { - const sdl = dedent` - type Query { - __badName: String - } - `; - const allowedLegacyNames = ['__badName']; - const schema = buildSchema(sdl, { allowedLegacyNames }); - - const introspection = introspectionFromSchema(schema); - const clientSchema = buildClientSchema(introspection, { - allowedLegacyNames, - }); - - expect(schema.__allowedLegacyNames).to.deep.equal(['__badName']); - expect(printSchema(clientSchema)).to.equal(sdl); - }); - it('builds a schema aware of deprecation', () => { const sdl = dedent` enum Color { diff --git a/src/utilities/__tests__/extendSchema-test.js b/src/utilities/__tests__/extendSchema-test.js index 5e115cbe13..e76be144cb 100644 --- a/src/utilities/__tests__/extendSchema-test.js +++ b/src/utilities/__tests__/extendSchema-test.js @@ -1087,48 +1087,6 @@ describe('extendSchema', () => { ); }); - it('maintains configuration of the original schema object', () => { - const testSchemaWithLegacyNames = new GraphQLSchema({ - query: new GraphQLObjectType({ - name: 'Query', - fields: () => ({ - id: { type: GraphQLID }, - }), - }), - allowedLegacyNames: ['__badName'], - }); - const ast = parse(` - extend type Query { - __badName: String - } - `); - const schema = extendSchema(testSchemaWithLegacyNames, ast); - expect(schema).to.deep.include({ __allowedLegacyNames: ['__badName'] }); - }); - - it('adds to the configuration of the original schema object', () => { - const testSchemaWithLegacyNames = new GraphQLSchema({ - query: new GraphQLObjectType({ - name: 'Query', - fields: () => ({ - __badName: { type: GraphQLString }, - }), - }), - allowedLegacyNames: ['__badName'], - }); - const ast = parse(` - extend type Query { - __anotherBadName: String - } - `); - const schema = extendSchema(testSchemaWithLegacyNames, ast, { - allowedLegacyNames: ['__anotherBadName'], - }); - expect(schema).to.deep.include({ - __allowedLegacyNames: ['__badName', '__anotherBadName'], - }); - }); - describe('can add additional root operation types', () => { it('does not automatically include common root type names', () => { const schema = extendTestSchema(` diff --git a/src/utilities/__tests__/introspectionFromSchema-benchmark.js b/src/utilities/__tests__/introspectionFromSchema-benchmark.js index 8aa33d9a60..f591b8a889 100644 --- a/src/utilities/__tests__/introspectionFromSchema-benchmark.js +++ b/src/utilities/__tests__/introspectionFromSchema-benchmark.js @@ -4,7 +4,7 @@ import { parse } from '../../language/parser'; import { execute } from '../../execution/execute'; import { buildSchema } from '../buildASTSchema'; -import { getIntrospectionQuery } from '../introspectionQuery'; +import { getIntrospectionQuery } from '../getIntrospectionQuery'; import { bigSchemaSDL } from '../../__fixtures__'; diff --git a/src/utilities/__tests__/isValidLiteralValue-test.js b/src/utilities/__tests__/isValidLiteralValue-test.js deleted file mode 100644 index 2447fb1fb9..0000000000 --- a/src/utilities/__tests__/isValidLiteralValue-test.js +++ /dev/null @@ -1,26 +0,0 @@ -// @flow strict - -import { expect } from 'chai'; -import { describe, it } from 'mocha'; - -import { parseValue } from '../../language/parser'; -import { GraphQLInt } from '../../type/scalars'; - -import { isValidLiteralValue } from '../isValidLiteralValue'; - -describe('isValidLiteralValue', () => { - it('Returns no errors for a valid value', () => { - expect(isValidLiteralValue(GraphQLInt, parseValue('123'))).to.deep.equal( - [], - ); - }); - - it('Returns errors for an invalid value', () => { - expect(isValidLiteralValue(GraphQLInt, parseValue('"abc"'))).to.deep.equal([ - { - message: 'Expected type Int, found "abc".', - locations: [{ line: 1, column: 1 }], - }, - ]); - }); -}); diff --git a/tstypes/utilities/assertValidName.d.ts b/src/utilities/assertValidName.d.ts similarity index 100% rename from tstypes/utilities/assertValidName.d.ts rename to src/utilities/assertValidName.d.ts diff --git a/tstypes/utilities/astFromValue.d.ts b/src/utilities/astFromValue.d.ts similarity index 100% rename from tstypes/utilities/astFromValue.d.ts rename to src/utilities/astFromValue.d.ts diff --git a/tstypes/utilities/buildASTSchema.d.ts b/src/utilities/buildASTSchema.d.ts similarity index 100% rename from tstypes/utilities/buildASTSchema.d.ts rename to src/utilities/buildASTSchema.d.ts diff --git a/src/utilities/buildASTSchema.js b/src/utilities/buildASTSchema.js index c3d4b350d8..3f0ed0d7ff 100644 --- a/src/utilities/buildASTSchema.js +++ b/src/utilities/buildASTSchema.js @@ -187,7 +187,6 @@ export function buildASTSchema( directives, astNode: schemaDef, assumeValid: options && options.assumeValid, - allowedLegacyNames: options && options.allowedLegacyNames, }); function getOperationTypes(schema: SchemaDefinitionNode) { diff --git a/tstypes/utilities/buildClientSchema.d.ts b/src/utilities/buildClientSchema.d.ts similarity index 86% rename from tstypes/utilities/buildClientSchema.d.ts rename to src/utilities/buildClientSchema.d.ts index 42bd106cf1..a35c7cc9be 100644 --- a/tstypes/utilities/buildClientSchema.d.ts +++ b/src/utilities/buildClientSchema.d.ts @@ -1,6 +1,7 @@ -import { IntrospectionQuery } from './introspectionQuery'; +import { IntrospectionQuery } from './getIntrospectionQuery'; import { GraphQLSchema, GraphQLSchemaValidationOptions } from '../type/schema'; +// eslint-disable-next-line @typescript-eslint/no-empty-interface interface Options extends GraphQLSchemaValidationOptions {} /** diff --git a/src/utilities/buildClientSchema.js b/src/utilities/buildClientSchema.js index 6796f8ffd2..366da69625 100644 --- a/src/utilities/buildClientSchema.js +++ b/src/utilities/buildClientSchema.js @@ -50,7 +50,7 @@ import { type IntrospectionInputTypeRef, type IntrospectionOutputTypeRef, type IntrospectionNamedTypeRef, -} from './introspectionQuery'; +} from './getIntrospectionQuery'; type Options = {| ...GraphQLSchemaValidationOptions, @@ -121,7 +121,6 @@ export function buildClientSchema( types: objectValues(typeMap), directives, assumeValid: options && options.assumeValid, - allowedLegacyNames: options && options.allowedLegacyNames, }); // Given a type reference in introspection, return the GraphQLType instance. diff --git a/tstypes/utilities/coerceInputValue.d.ts b/src/utilities/coerceInputValue.d.ts similarity index 100% rename from tstypes/utilities/coerceInputValue.d.ts rename to src/utilities/coerceInputValue.d.ts diff --git a/src/utilities/coerceValue.js b/src/utilities/coerceValue.js deleted file mode 100644 index e0ba4a9862..0000000000 --- a/src/utilities/coerceValue.js +++ /dev/null @@ -1,56 +0,0 @@ -// @flow strict - -/* istanbul ignore file */ -import inspect from '../jsutils/inspect'; -import printPathArray from '../jsutils/printPathArray'; -import { type Path, pathToArray } from '../jsutils/Path'; - -import { GraphQLError } from '../error/GraphQLError'; -import { type ASTNode } from '../language/ast'; -import { type GraphQLInputType } from '../type/definition'; - -import { coerceInputValue } from './coerceInputValue'; - -type CoercedValue = {| - +errors: $ReadOnlyArray | void, - +value: mixed, -|}; - -/** - * Deprecated. Use coerceInputValue() directly for richer information. - * - * This function will be removed in v15 - */ -export function coerceValue( - inputValue: mixed, - type: GraphQLInputType, - blameNode?: ASTNode, - path?: Path, -): CoercedValue { - const errors = []; - const value = coerceInputValue( - inputValue, - type, - (errorPath, invalidValue, error) => { - let errorPrefix = 'Invalid value ' + inspect(invalidValue); - const pathArray = [...pathToArray(path), ...errorPath]; - if (pathArray.length > 0) { - errorPrefix += ` at "value${printPathArray(pathArray)}"`; - } - errors.push( - new GraphQLError( - errorPrefix + ': ' + error.message, - blameNode, - undefined, - undefined, - undefined, - error.originalError, - ), - ); - }, - ); - - return errors.length > 0 - ? { errors, value: undefined } - : { errors: undefined, value }; -} diff --git a/tstypes/utilities/concatAST.d.ts b/src/utilities/concatAST.d.ts similarity index 100% rename from tstypes/utilities/concatAST.d.ts rename to src/utilities/concatAST.d.ts diff --git a/tstypes/utilities/extendSchema.d.ts b/src/utilities/extendSchema.d.ts similarity index 100% rename from tstypes/utilities/extendSchema.d.ts rename to src/utilities/extendSchema.d.ts diff --git a/src/utilities/extendSchema.js b/src/utilities/extendSchema.js index 4d1778e87c..35bc1067ad 100644 --- a/src/utilities/extendSchema.js +++ b/src/utilities/extendSchema.js @@ -190,11 +190,6 @@ export function extendSchema( } } - // Support both original legacy names and extended legacy names. - const allowedLegacyNames = schemaConfig.allowedLegacyNames.concat( - (options && options.allowedLegacyNames) || [], - ); - // Then produce and return a Schema with these types. return new GraphQLSchema({ // Note: While this could make early assertions to get the correctly @@ -208,7 +203,6 @@ export function extendSchema( directives: getMergedDirectives(), astNode: schemaDef || schemaConfig.astNode, extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExts), - allowedLegacyNames, }); // Below are functions used for producing this schema that have closed over diff --git a/tstypes/utilities/findBreakingChanges.d.ts b/src/utilities/findBreakingChanges.d.ts similarity index 100% rename from tstypes/utilities/findBreakingChanges.d.ts rename to src/utilities/findBreakingChanges.d.ts diff --git a/tstypes/utilities/findDeprecatedUsages.d.ts b/src/utilities/findDeprecatedUsages.d.ts similarity index 100% rename from tstypes/utilities/findDeprecatedUsages.d.ts rename to src/utilities/findDeprecatedUsages.d.ts diff --git a/tstypes/utilities/introspectionQuery.d.ts b/src/utilities/getIntrospectionQuery.d.ts similarity index 97% rename from tstypes/utilities/introspectionQuery.d.ts rename to src/utilities/getIntrospectionQuery.d.ts index 714beacfed..2e5a601c9c 100644 --- a/tstypes/utilities/introspectionQuery.d.ts +++ b/src/utilities/getIntrospectionQuery.d.ts @@ -9,13 +9,6 @@ export interface IntrospectionOptions { export function getIntrospectionQuery(options?: IntrospectionOptions): string; -/** - * Deprecated, call getIntrospectionQuery directly. - * - * This function will be removed in v15 - */ -export const introspectionQuery: string; - export interface IntrospectionQuery { readonly __schema: IntrospectionSchema; } diff --git a/src/utilities/introspectionQuery.js b/src/utilities/getIntrospectionQuery.js similarity index 97% rename from src/utilities/introspectionQuery.js rename to src/utilities/getIntrospectionQuery.js index ca55e8a1f1..5044afa743 100644 --- a/src/utilities/introspectionQuery.js +++ b/src/utilities/getIntrospectionQuery.js @@ -105,13 +105,6 @@ export function getIntrospectionQuery(options?: IntrospectionOptions): string { `; } -/** - * Deprecated, call getIntrospectionQuery directly. - * - * This function will be removed in v15 - */ -export const introspectionQuery = getIntrospectionQuery(); - export type IntrospectionQuery = {| +__schema: IntrospectionSchema, |}; diff --git a/tstypes/utilities/getOperationAST.d.ts b/src/utilities/getOperationAST.d.ts similarity index 100% rename from tstypes/utilities/getOperationAST.d.ts rename to src/utilities/getOperationAST.d.ts diff --git a/tstypes/utilities/getOperationRootType.d.ts b/src/utilities/getOperationRootType.d.ts similarity index 100% rename from tstypes/utilities/getOperationRootType.d.ts rename to src/utilities/getOperationRootType.d.ts diff --git a/tstypes/utilities/index.d.ts b/src/utilities/index.d.ts similarity index 85% rename from tstypes/utilities/index.d.ts rename to src/utilities/index.d.ts index f3d82f01ec..8480b8541a 100644 --- a/tstypes/utilities/index.d.ts +++ b/src/utilities/index.d.ts @@ -1,11 +1,7 @@ -// The GraphQL query recommended for a full schema introspection. export { + // Produce the GraphQL query recommended for a full schema introspection. + // Accepts optional IntrospectionOptions. getIntrospectionQuery, - // @deprecated, use getIntrospectionQuery() - will be removed in v15 - introspectionQuery, -} from './introspectionQuery'; - -export { IntrospectionOptions, IntrospectionQuery, IntrospectionSchema, @@ -28,7 +24,7 @@ export { IntrospectionInputValue, IntrospectionEnumValue, IntrospectionDirective, -} from './introspectionQuery'; +} from './getIntrospectionQuery'; // Gets the target Operation from a Document export { getOperationAST } from './getOperationAST'; @@ -84,15 +80,6 @@ export { TypeInfo } from './TypeInfo'; // Coerces a JavaScript value to a GraphQL type, or produces errors. export { coerceInputValue } from './coerceInputValue'; -// Coerces a JavaScript value to a GraphQL type, or produces errors. -export { coerceValue } from './coerceValue'; - -// @deprecated use coerceValue - will be removed in v15 -export { isValidJSValue } from './isValidJSValue'; - -// @deprecated use validation - will be removed in v15 -export { isValidLiteralValue } from './isValidLiteralValue'; - // Concatenates multiple AST together. export { concatAST } from './concatAST'; diff --git a/src/utilities/index.js b/src/utilities/index.js index 50e7f94172..02bc9382bc 100644 --- a/src/utilities/index.js +++ b/src/utilities/index.js @@ -1,13 +1,8 @@ // @flow strict -// The GraphQL query recommended for a full schema introspection. -export { - // Produce the GraphQL query recommended for a full schema introspection. - // Accepts optional IntrospectionOptions. - getIntrospectionQuery, - // @deprecated, use getIntrospectionQuery() - will be removed in v15. - introspectionQuery, -} from './introspectionQuery'; +// Produce the GraphQL query recommended for a full schema introspection. +// Accepts optional IntrospectionOptions. +export { getIntrospectionQuery } from './getIntrospectionQuery'; export type { IntrospectionOptions, @@ -32,7 +27,7 @@ export type { IntrospectionInputValue, IntrospectionEnumValue, IntrospectionDirective, -} from './introspectionQuery'; +} from './getIntrospectionQuery'; // Gets the target Operation from a Document. export { getOperationAST } from './getOperationAST'; @@ -88,15 +83,6 @@ export { TypeInfo } from './TypeInfo'; // Coerces a JavaScript value to a GraphQL type, or produces errors. export { coerceInputValue } from './coerceInputValue'; -// @deprecated use coerceInputValue - will be removed in v15. -export { coerceValue } from './coerceValue'; - -// @deprecated use coerceInputValue - will be removed in v15. -export { isValidJSValue } from './isValidJSValue'; - -// @deprecated use validation - will be removed in v15 -export { isValidLiteralValue } from './isValidLiteralValue'; - // Concatenates multiple AST together. export { concatAST } from './concatAST'; diff --git a/tstypes/utilities/introspectionFromSchema.d.ts b/src/utilities/introspectionFromSchema.d.ts similarity index 85% rename from tstypes/utilities/introspectionFromSchema.d.ts rename to src/utilities/introspectionFromSchema.d.ts index e0dcd63348..b03a79871f 100644 --- a/tstypes/utilities/introspectionFromSchema.d.ts +++ b/src/utilities/introspectionFromSchema.d.ts @@ -1,5 +1,8 @@ import { GraphQLSchema } from '../type/schema'; -import { IntrospectionQuery, IntrospectionOptions } from './introspectionQuery'; +import { + IntrospectionQuery, + IntrospectionOptions, +} from './getIntrospectionQuery'; /** * Build an IntrospectionQuery from a GraphQLSchema diff --git a/src/utilities/introspectionFromSchema.js b/src/utilities/introspectionFromSchema.js index 48b39819ba..67fb28e39d 100644 --- a/src/utilities/introspectionFromSchema.js +++ b/src/utilities/introspectionFromSchema.js @@ -11,7 +11,7 @@ import { type IntrospectionQuery, type IntrospectionOptions, getIntrospectionQuery, -} from './introspectionQuery'; +} from './getIntrospectionQuery'; /** * Build an IntrospectionQuery from a GraphQLSchema diff --git a/src/utilities/isValidJSValue.js b/src/utilities/isValidJSValue.js deleted file mode 100644 index af2fe40d6e..0000000000 --- a/src/utilities/isValidJSValue.js +++ /dev/null @@ -1,19 +0,0 @@ -// @flow strict - -/* istanbul ignore file */ -import { type GraphQLInputType } from '../type/definition'; - -import { coerceValue } from './coerceValue'; - -/** - * Deprecated. Use coerceInputValue() directly for richer information. - * - * This function will be removed in v15 - */ -export function isValidJSValue( - value: mixed, - type: GraphQLInputType, -): Array { - const errors = coerceValue(value, type).errors; - return errors ? errors.map(error => error.message) : []; -} diff --git a/src/utilities/isValidLiteralValue.js b/src/utilities/isValidLiteralValue.js deleted file mode 100644 index d0d13d3d90..0000000000 --- a/src/utilities/isValidLiteralValue.js +++ /dev/null @@ -1,35 +0,0 @@ -// @flow strict - -import { type GraphQLError } from '../error/GraphQLError'; - -import { Kind } from '../language/kinds'; -import { type ValueNode } from '../language/ast'; -import { visit, visitWithTypeInfo } from '../language/visitor'; - -import { ValuesOfCorrectType } from '../validation/rules/ValuesOfCorrectType'; -import { ValidationContext } from '../validation/ValidationContext'; - -import { type GraphQLInputType } from '../type/definition'; -import { GraphQLSchema } from '../type/schema'; - -import { TypeInfo } from './TypeInfo'; - -/** - * Utility which determines if a value literal node is valid for an input type. - * - * Deprecated. Rely on validation for documents containing literal values. - * - * This function will be removed in v15 - */ -export function isValidLiteralValue( - type: GraphQLInputType, - valueNode: ValueNode, -): $ReadOnlyArray { - const emptySchema = new GraphQLSchema({}); - const emptyDoc = { kind: Kind.DOCUMENT, definitions: [] }; - const typeInfo = new TypeInfo(emptySchema, undefined, type); - const context = new ValidationContext(emptySchema, emptyDoc, typeInfo); - const visitor = ValuesOfCorrectType(context); - visit(valueNode, visitWithTypeInfo(typeInfo, visitor)); - return context.getErrors(); -} diff --git a/tstypes/utilities/lexicographicSortSchema.d.ts b/src/utilities/lexicographicSortSchema.d.ts similarity index 100% rename from tstypes/utilities/lexicographicSortSchema.d.ts rename to src/utilities/lexicographicSortSchema.d.ts diff --git a/tstypes/utilities/schemaPrinter.d.ts b/src/utilities/schemaPrinter.d.ts similarity index 100% rename from tstypes/utilities/schemaPrinter.d.ts rename to src/utilities/schemaPrinter.d.ts diff --git a/tstypes/utilities/separateOperations.d.ts b/src/utilities/separateOperations.d.ts similarity index 100% rename from tstypes/utilities/separateOperations.d.ts rename to src/utilities/separateOperations.d.ts diff --git a/tstypes/utilities/stripIgnoredCharacters.d.ts b/src/utilities/stripIgnoredCharacters.d.ts similarity index 100% rename from tstypes/utilities/stripIgnoredCharacters.d.ts rename to src/utilities/stripIgnoredCharacters.d.ts diff --git a/tstypes/utilities/typeComparators.d.ts b/src/utilities/typeComparators.d.ts similarity index 100% rename from tstypes/utilities/typeComparators.d.ts rename to src/utilities/typeComparators.d.ts diff --git a/tstypes/utilities/typeFromAST.d.ts b/src/utilities/typeFromAST.d.ts similarity index 100% rename from tstypes/utilities/typeFromAST.d.ts rename to src/utilities/typeFromAST.d.ts diff --git a/tstypes/utilities/valueFromAST.d.ts b/src/utilities/valueFromAST.d.ts similarity index 100% rename from tstypes/utilities/valueFromAST.d.ts rename to src/utilities/valueFromAST.d.ts diff --git a/tstypes/utilities/valueFromASTUntyped.d.ts b/src/utilities/valueFromASTUntyped.d.ts similarity index 100% rename from tstypes/utilities/valueFromASTUntyped.d.ts rename to src/utilities/valueFromASTUntyped.d.ts diff --git a/tstypes/validation/ValidationContext.d.ts b/src/validation/ValidationContext.d.ts similarity index 93% rename from tstypes/validation/ValidationContext.d.ts rename to src/validation/ValidationContext.d.ts index 1a0dcf104a..1591a468b2 100644 --- a/tstypes/validation/ValidationContext.d.ts +++ b/src/validation/ValidationContext.d.ts @@ -33,12 +33,10 @@ type VariableUsage = { * validation rule. */ export class ASTValidationContext { - constructor(ast: DocumentNode); + constructor(ast: DocumentNode, onError: (err: GraphQLError) => void); reportError(error: GraphQLError): undefined; - getErrors(): ReadonlyArray; - getDocument(): DocumentNode; getFragment(name: string): Maybe; @@ -54,7 +52,7 @@ export class SDLValidationContext extends ASTValidationContext { constructor( ast: DocumentNode, schema: Maybe, - onError?: (err: GraphQLError) => void, + onError: (err: GraphQLError) => void, ); getSchema(): Maybe; @@ -67,7 +65,7 @@ export class ValidationContext extends ASTValidationContext { schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo, - onError?: (err: GraphQLError) => void, + onError: (err: GraphQLError) => void, ); getSchema(): GraphQLSchema; diff --git a/src/validation/ValidationContext.js b/src/validation/ValidationContext.js index a3a7bd0f08..abd1c979cb 100644 --- a/src/validation/ValidationContext.js +++ b/src/validation/ValidationContext.js @@ -41,8 +41,7 @@ type VariableUsage = {| */ export class ASTValidationContext { _ast: DocumentNode; - _onError: ?(err: GraphQLError) => void; - _errors: Array; + _onError: (err: GraphQLError) => void; _fragments: ?ObjMap; _fragmentSpreads: Map>; _recursivelyReferencedFragments: Map< @@ -50,9 +49,8 @@ export class ASTValidationContext { $ReadOnlyArray, >; - constructor(ast: DocumentNode, onError?: (err: GraphQLError) => void): void { + constructor(ast: DocumentNode, onError: (err: GraphQLError) => void): void { this._ast = ast; - this._errors = []; this._fragments = undefined; this._fragmentSpreads = new Map(); this._recursivelyReferencedFragments = new Map(); @@ -60,15 +58,7 @@ export class ASTValidationContext { } reportError(error: GraphQLError): void { - this._errors.push(error); - if (this._onError) { - this._onError(error); - } - } - - // @deprecated: use onError callback instead - will be removed in v15. - getErrors(): $ReadOnlyArray { - return this._errors; + this._onError(error); } getDocument(): DocumentNode { @@ -175,7 +165,7 @@ export class ValidationContext extends ASTValidationContext { schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo, - onError?: (err: GraphQLError) => void, + onError: (err: GraphQLError) => void, ): void { super(ast, onError); this._schema = schema; diff --git a/src/validation/__tests__/validateGQL-benchmark.js b/src/validation/__tests__/validateGQL-benchmark.js index fce3b0f2e9..509fd7cdc9 100644 --- a/src/validation/__tests__/validateGQL-benchmark.js +++ b/src/validation/__tests__/validateGQL-benchmark.js @@ -2,7 +2,7 @@ import { parse } from '../../language/parser'; import { buildSchema } from '../../utilities/buildASTSchema'; -import { getIntrospectionQuery } from '../../utilities/introspectionQuery'; +import { getIntrospectionQuery } from '../../utilities/getIntrospectionQuery'; import { validate } from '../validate'; diff --git a/tstypes/validation/index.d.ts b/src/validation/index.d.ts similarity index 100% rename from tstypes/validation/index.d.ts rename to src/validation/index.d.ts diff --git a/tstypes/validation/rules/ExecutableDefinitions.d.ts b/src/validation/rules/ExecutableDefinitions.d.ts similarity index 100% rename from tstypes/validation/rules/ExecutableDefinitions.d.ts rename to src/validation/rules/ExecutableDefinitions.d.ts diff --git a/tstypes/validation/rules/FieldsOnCorrectType.d.ts b/src/validation/rules/FieldsOnCorrectType.d.ts similarity index 100% rename from tstypes/validation/rules/FieldsOnCorrectType.d.ts rename to src/validation/rules/FieldsOnCorrectType.d.ts diff --git a/tstypes/validation/rules/FragmentsOnCompositeTypes.d.ts b/src/validation/rules/FragmentsOnCompositeTypes.d.ts similarity index 100% rename from tstypes/validation/rules/FragmentsOnCompositeTypes.d.ts rename to src/validation/rules/FragmentsOnCompositeTypes.d.ts diff --git a/tstypes/validation/rules/KnownArgumentNames.d.ts b/src/validation/rules/KnownArgumentNames.d.ts similarity index 100% rename from tstypes/validation/rules/KnownArgumentNames.d.ts rename to src/validation/rules/KnownArgumentNames.d.ts diff --git a/tstypes/validation/rules/KnownDirectives.d.ts b/src/validation/rules/KnownDirectives.d.ts similarity index 100% rename from tstypes/validation/rules/KnownDirectives.d.ts rename to src/validation/rules/KnownDirectives.d.ts diff --git a/tstypes/validation/rules/KnownFragmentNames.d.ts b/src/validation/rules/KnownFragmentNames.d.ts similarity index 100% rename from tstypes/validation/rules/KnownFragmentNames.d.ts rename to src/validation/rules/KnownFragmentNames.d.ts diff --git a/tstypes/validation/rules/KnownTypeNames.d.ts b/src/validation/rules/KnownTypeNames.d.ts similarity index 100% rename from tstypes/validation/rules/KnownTypeNames.d.ts rename to src/validation/rules/KnownTypeNames.d.ts diff --git a/tstypes/validation/rules/LoneAnonymousOperation.d.ts b/src/validation/rules/LoneAnonymousOperation.d.ts similarity index 100% rename from tstypes/validation/rules/LoneAnonymousOperation.d.ts rename to src/validation/rules/LoneAnonymousOperation.d.ts diff --git a/tstypes/validation/rules/LoneSchemaDefinition.d.ts b/src/validation/rules/LoneSchemaDefinition.d.ts similarity index 100% rename from tstypes/validation/rules/LoneSchemaDefinition.d.ts rename to src/validation/rules/LoneSchemaDefinition.d.ts diff --git a/tstypes/validation/rules/NoFragmentCycles.d.ts b/src/validation/rules/NoFragmentCycles.d.ts similarity index 100% rename from tstypes/validation/rules/NoFragmentCycles.d.ts rename to src/validation/rules/NoFragmentCycles.d.ts diff --git a/tstypes/validation/rules/NoUndefinedVariables.d.ts b/src/validation/rules/NoUndefinedVariables.d.ts similarity index 100% rename from tstypes/validation/rules/NoUndefinedVariables.d.ts rename to src/validation/rules/NoUndefinedVariables.d.ts diff --git a/tstypes/validation/rules/NoUnusedFragments.d.ts b/src/validation/rules/NoUnusedFragments.d.ts similarity index 100% rename from tstypes/validation/rules/NoUnusedFragments.d.ts rename to src/validation/rules/NoUnusedFragments.d.ts diff --git a/tstypes/validation/rules/NoUnusedVariables.d.ts b/src/validation/rules/NoUnusedVariables.d.ts similarity index 100% rename from tstypes/validation/rules/NoUnusedVariables.d.ts rename to src/validation/rules/NoUnusedVariables.d.ts diff --git a/tstypes/validation/rules/OverlappingFieldsCanBeMerged.d.ts b/src/validation/rules/OverlappingFieldsCanBeMerged.d.ts similarity index 100% rename from tstypes/validation/rules/OverlappingFieldsCanBeMerged.d.ts rename to src/validation/rules/OverlappingFieldsCanBeMerged.d.ts diff --git a/tstypes/validation/rules/PossibleFragmentSpreads.d.ts b/src/validation/rules/PossibleFragmentSpreads.d.ts similarity index 100% rename from tstypes/validation/rules/PossibleFragmentSpreads.d.ts rename to src/validation/rules/PossibleFragmentSpreads.d.ts diff --git a/tstypes/validation/rules/PossibleTypeExtensions.d.ts b/src/validation/rules/PossibleTypeExtensions.d.ts similarity index 100% rename from tstypes/validation/rules/PossibleTypeExtensions.d.ts rename to src/validation/rules/PossibleTypeExtensions.d.ts diff --git a/tstypes/validation/rules/ProvidedRequiredArguments.d.ts b/src/validation/rules/ProvidedRequiredArguments.d.ts similarity index 100% rename from tstypes/validation/rules/ProvidedRequiredArguments.d.ts rename to src/validation/rules/ProvidedRequiredArguments.d.ts diff --git a/tstypes/validation/rules/ScalarLeafs.d.ts b/src/validation/rules/ScalarLeafs.d.ts similarity index 100% rename from tstypes/validation/rules/ScalarLeafs.d.ts rename to src/validation/rules/ScalarLeafs.d.ts diff --git a/tstypes/validation/rules/SingleFieldSubscriptions.d.ts b/src/validation/rules/SingleFieldSubscriptions.d.ts similarity index 100% rename from tstypes/validation/rules/SingleFieldSubscriptions.d.ts rename to src/validation/rules/SingleFieldSubscriptions.d.ts diff --git a/tstypes/validation/rules/UniqueArgumentNames.d.ts b/src/validation/rules/UniqueArgumentNames.d.ts similarity index 100% rename from tstypes/validation/rules/UniqueArgumentNames.d.ts rename to src/validation/rules/UniqueArgumentNames.d.ts diff --git a/tstypes/validation/rules/UniqueDirectiveNames.d.ts b/src/validation/rules/UniqueDirectiveNames.d.ts similarity index 100% rename from tstypes/validation/rules/UniqueDirectiveNames.d.ts rename to src/validation/rules/UniqueDirectiveNames.d.ts diff --git a/tstypes/validation/rules/UniqueDirectivesPerLocation.d.ts b/src/validation/rules/UniqueDirectivesPerLocation.d.ts similarity index 100% rename from tstypes/validation/rules/UniqueDirectivesPerLocation.d.ts rename to src/validation/rules/UniqueDirectivesPerLocation.d.ts diff --git a/tstypes/validation/rules/UniqueEnumValueNames.d.ts b/src/validation/rules/UniqueEnumValueNames.d.ts similarity index 100% rename from tstypes/validation/rules/UniqueEnumValueNames.d.ts rename to src/validation/rules/UniqueEnumValueNames.d.ts diff --git a/tstypes/validation/rules/UniqueFieldDefinitionNames.d.ts b/src/validation/rules/UniqueFieldDefinitionNames.d.ts similarity index 100% rename from tstypes/validation/rules/UniqueFieldDefinitionNames.d.ts rename to src/validation/rules/UniqueFieldDefinitionNames.d.ts diff --git a/tstypes/validation/rules/UniqueFragmentNames.d.ts b/src/validation/rules/UniqueFragmentNames.d.ts similarity index 100% rename from tstypes/validation/rules/UniqueFragmentNames.d.ts rename to src/validation/rules/UniqueFragmentNames.d.ts diff --git a/tstypes/validation/rules/UniqueInputFieldNames.d.ts b/src/validation/rules/UniqueInputFieldNames.d.ts similarity index 100% rename from tstypes/validation/rules/UniqueInputFieldNames.d.ts rename to src/validation/rules/UniqueInputFieldNames.d.ts diff --git a/tstypes/validation/rules/UniqueOperationNames.d.ts b/src/validation/rules/UniqueOperationNames.d.ts similarity index 100% rename from tstypes/validation/rules/UniqueOperationNames.d.ts rename to src/validation/rules/UniqueOperationNames.d.ts diff --git a/tstypes/validation/rules/UniqueOperationTypes.d.ts b/src/validation/rules/UniqueOperationTypes.d.ts similarity index 100% rename from tstypes/validation/rules/UniqueOperationTypes.d.ts rename to src/validation/rules/UniqueOperationTypes.d.ts diff --git a/tstypes/validation/rules/UniqueTypeNames.d.ts b/src/validation/rules/UniqueTypeNames.d.ts similarity index 100% rename from tstypes/validation/rules/UniqueTypeNames.d.ts rename to src/validation/rules/UniqueTypeNames.d.ts diff --git a/tstypes/validation/rules/UniqueVariableNames.d.ts b/src/validation/rules/UniqueVariableNames.d.ts similarity index 100% rename from tstypes/validation/rules/UniqueVariableNames.d.ts rename to src/validation/rules/UniqueVariableNames.d.ts diff --git a/tstypes/validation/rules/ValuesOfCorrectType.d.ts b/src/validation/rules/ValuesOfCorrectType.d.ts similarity index 100% rename from tstypes/validation/rules/ValuesOfCorrectType.d.ts rename to src/validation/rules/ValuesOfCorrectType.d.ts diff --git a/tstypes/validation/rules/VariablesAreInputTypes.d.ts b/src/validation/rules/VariablesAreInputTypes.d.ts similarity index 100% rename from tstypes/validation/rules/VariablesAreInputTypes.d.ts rename to src/validation/rules/VariablesAreInputTypes.d.ts diff --git a/tstypes/validation/rules/VariablesInAllowedPosition.d.ts b/src/validation/rules/VariablesInAllowedPosition.d.ts similarity index 100% rename from tstypes/validation/rules/VariablesInAllowedPosition.d.ts rename to src/validation/rules/VariablesInAllowedPosition.d.ts diff --git a/tstypes/validation/specifiedRules.d.ts b/src/validation/specifiedRules.d.ts similarity index 100% rename from tstypes/validation/specifiedRules.d.ts rename to src/validation/specifiedRules.d.ts diff --git a/tstypes/validation/validate.d.ts b/src/validation/validate.d.ts similarity index 100% rename from tstypes/validation/validate.d.ts rename to src/validation/validate.d.ts diff --git a/tstypes/version.d.ts b/src/version.d.ts similarity index 100% rename from tstypes/version.d.ts rename to src/version.d.ts diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 0000000000..0926dd36d0 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "declaration": true, + "module": "es6", + "outDir": "./ts-build", + "rootDir": "./src" + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000000..e4a9a1d928 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "strict": true, + "target": "esnext", + "lib": ["es6", "es2018.asynciterable"], + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "include": ["src"] +} diff --git a/tstypes/README.md b/tstypes/README.md deleted file mode 100644 index 33e0f20517..0000000000 --- a/tstypes/README.md +++ /dev/null @@ -1,30 +0,0 @@ -## TypeScript definition files - -This module includes a [TypeScript](https://www.typescriptlang.org/) -declaration file to enable auto complete in compatible editors and type -information for TypeScript projects. - -### Credits - -The `*.d.ts` files in this folder are based on [DefinetlyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/54712a7e28090c5b1253b746d1878003c954f3ff/types/graphql) definitions written by: - -- TonyYang https://github.com/TonyPythoneer -- Caleb Meredith https://github.com/calebmer -- Dominic Watson https://github.com/intellix -- Firede https://github.com/firede -- Kepennar https://github.com/kepennar -- Mikhail Novikov https://github.com/freiksenet -- Ivan Goncharov https://github.com/IvanGoncharov -- Hagai Cohen https://github.com/DxCx -- Ricardo Portugal https://github.com/rportugal -- Tim Griesser https://github.com/tgriesser -- Dylan Stewart https://github.com/dyst5422 -- Alessio Dionisi https://github.com/adnsio -- Divyendu Singh https://github.com/divyenduz -- Brad Zacher https://github.com/bradzacher -- Curtis Layne https://github.com/clayne11 -- Jonathan Cardoso https://github.com/JCMais -- Pavel Lang https://github.com/langpavel -- Mark Caudill https://github.com/mc0 -- Martijn Walraven https://github.com/martijnwalraven -- Jed Mao https://github.com/jedmao diff --git a/tstypes/utilities/coerceValue.d.ts b/tstypes/utilities/coerceValue.d.ts deleted file mode 100644 index f79389eac5..0000000000 --- a/tstypes/utilities/coerceValue.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Path } from '../jsutils/Path'; -import { GraphQLError } from '../error/GraphQLError'; -import { ASTNode } from '../language/ast'; -import { GraphQLInputType } from '../type/definition'; - -interface CoercedValue { - readonly errors: ReadonlyArray | undefined; - readonly value: any; -} - -/** - * Coerces a JavaScript value given a GraphQL Type. - * - * Returns either a value which is valid for the provided type or a list of - * encountered coercion errors. - * - */ -export function coerceValue( - inputValue: any, - type: GraphQLInputType, - blameNode?: ASTNode, - path?: Path, -): CoercedValue; diff --git a/tstypes/utilities/isValidJSValue.d.ts b/tstypes/utilities/isValidJSValue.d.ts deleted file mode 100644 index 36d24efbac..0000000000 --- a/tstypes/utilities/isValidJSValue.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { GraphQLInputType } from '../type/definition'; - -/** - * Deprecated. Use coerceValue() directly for richer information. - * - * This function will be removed in v15 - */ -export function isValidJSValue(value: any, type: GraphQLInputType): string[]; diff --git a/tstypes/utilities/isValidLiteralValue.d.ts b/tstypes/utilities/isValidLiteralValue.d.ts deleted file mode 100644 index c0c4eb4cfb..0000000000 --- a/tstypes/utilities/isValidLiteralValue.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { GraphQLError } from '../error/GraphQLError'; -import { ValueNode } from '../language/ast'; -import { GraphQLInputType } from '../type/definition'; - -/** - * Utility which determines if a value literal node is valid for an input type. - * - * Deprecated. Rely on validation for documents containing literal values. - * - * This function will be removed in v15 - */ -export function isValidLiteralValue( - type: GraphQLInputType, - valueNode: ValueNode, -): ReadonlyArray; diff --git a/yarn.lock b/yarn.lock index a92cefbf93..cc478e844c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -673,22 +673,90 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@istanbuljs/nyc-config-typescript@^0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@istanbuljs/nyc-config-typescript/-/nyc-config-typescript-0.1.3.tgz#944d15b3ebdb71f963a628daffaa25ade981bb86" + integrity sha512-EzRFg92bRSD1W/zeuNkeGwph0nkWf+pP2l/lYW4/5hav7RjKKBN5kV1Ix7Tvi0CMu3pC4Wi/U7rNisiJMR3ORg== + +"@types/chai@^4.2.0": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.0.tgz#2478260021408dec32c123a7cad3414beb811a07" + integrity sha512-zw8UvoBEImn392tLjxoavuonblX/4Yb9ha4KBU10FirCfwgzhKO0dvyJSF9ByxV1xK1r2AgnAi/tvQaLgxQqxA== + +"@types/eslint-visitor-keys@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" + integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== + +"@types/json-schema@^7.0.3": + version "7.0.3" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.3.tgz#bdfd69d61e464dcc81b25159c270d75a73c1a636" + integrity sha512-Il2DtDVRGDcqjDtE+rF8iqg1CArehSK84HZJCT7AMITlyXRBpuPhqGLDQMowraqqu1coEaimg4ZOqggt6L6L+A== + +"@types/mocha@^5.2.7": + version "5.2.7" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.7.tgz#315d570ccb56c53452ff8638738df60726d5b6ea" + integrity sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ== + +"@types/node@^12.7.2": + version "12.7.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.7.2.tgz#c4e63af5e8823ce9cc3f0b34f7b998c2171f0c44" + integrity sha512-dyYO+f6ihZEtNPDcWNR1fkoTDf3zAK3lAABDze3mz6POyIercH0lEUawUFXlG8xaQZmm1yEBON/4TsYv/laDYg== + "@types/parsimmon@^1.3.0": version "1.10.0" resolved "https://registry.yarnpkg.com/@types/parsimmon/-/parsimmon-1.10.0.tgz#ffb81cb023ff435a41d4710a29ab23c561dc9fdf" integrity sha512-bsTIJFVQv7jnvNiC42ld2pQW2KRI+pAG243L+iATvqzy3X6+NH1obz2itRKDZZ8VVhN3wjwYax/VBGCcXzgTqQ== -acorn-jsx@^5.0.0: +"@typescript-eslint/eslint-plugin@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.0.0.tgz#609a5d7b00ce21a6f94d7ef282eba9da57ca1e42" + integrity sha512-Mo45nxTTELODdl7CgpZKJISvLb+Fu64OOO2ZFc2x8sYSnUpFrBUW3H+H/ZGYmEkfnL6VkdtOSxgdt+Av79j0sA== + dependencies: + "@typescript-eslint/experimental-utils" "2.0.0" + eslint-utils "^1.4.0" + functional-red-black-tree "^1.0.1" + regexpp "^2.0.1" + tsutils "^3.14.0" + +"@typescript-eslint/experimental-utils@2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.0.0.tgz#f3d298bb411357f35c4184e24280b256b6321949" + integrity sha512-XGJG6GNBXIEx/mN4eTRypN/EUmsd0VhVGQ1AG+WTgdvjHl0G8vHhVBHrd/5oI6RRYBRnedNymSYWW1HAdivtmg== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/typescript-estree" "2.0.0" + eslint-scope "^4.0.0" + +"@typescript-eslint/parser@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.0.0.tgz#4273bb19d03489daf8372cdaccbc8042e098178f" + integrity sha512-ibyMBMr0383ZKserIsp67+WnNVoM402HKkxqXGlxEZsXtnGGurbnY90pBO3e0nBUM7chEEOcxUhgw9aPq7fEBA== + dependencies: + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "2.0.0" + "@typescript-eslint/typescript-estree" "2.0.0" + eslint-visitor-keys "^1.0.0" + +"@typescript-eslint/typescript-estree@2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.0.0.tgz#c9f6c0efd1b11475540d6a55dc973cc5b9a67e77" + integrity sha512-NXbmzA3vWrSgavymlzMWNecgNOuiMMp62MO3kI7awZRLRcsA1QrYWo6q08m++uuAGVbXH/prZi2y1AWuhSu63w== + dependencies: + lodash.unescape "4.0.1" + semver "^6.2.0" + +acorn-jsx@^5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.2.tgz#84b68ea44b373c4f8686023a551f61a21b7c4a4f" integrity sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw== -acorn@^6.0.7: - version "6.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.3.0.tgz#0087509119ffa4fc0a0041d1e93a417e68cb856e" - integrity sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA== +acorn@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.0.0.tgz#26b8d1cd9a9b700350b71c0905546f64d1284e7a" + integrity sha512-PaF/MduxijYYt7unVGRuds1vBC9bFxbNf+VWqhOClfdgy7RlVkQqt610ig1/yxTgsDIfW1cWDel5EBbOy3jdtQ== -ajv@^6.10.2, ajv@^6.5.5, ajv@^6.9.1: +ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.5: version "6.10.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== @@ -747,6 +815,11 @@ archy@^1.0.0: resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= +arg@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.1.tgz#485f8e7c390ce4c5f78257dbea80d4be11feda4c" + integrity sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -1134,6 +1207,11 @@ diff@3.5.0, diff@^3.2.0: resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== +diff@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.1.tgz#0c667cb467ebbb5cea7f14f135cc2dba7780a8ff" + integrity sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q== + doctrine@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" @@ -1178,9 +1256,9 @@ ecc-jsbn@~0.1.1: safer-buffer "^2.1.0" electron-to-chromium@^1.3.191: - version "1.3.237" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.237.tgz#39c5d1da59d6fd16ff705b97e772bb3b5dfda7e4" - integrity sha512-SPAFjDr/7iiVK2kgTluwxela6eaWjjFkS9rO/iYpB/KGXgccUom5YC7OIf19c8m8GGptWxLU0Em8xM64A/N7Fg== + version "1.3.240" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.240.tgz#8e278c4d2b3a96fa865725589277c05c8a1e9584" + integrity sha512-cMlX5lQpTzLZI0CsC4Mt2sl6z3jz1RvN/8rIqqwqWy3LYCnu8TUf5o8sqST44nP6zIEdjZb0opXq6qswE9o9pA== emoji-regex@^7.0.1: version "7.0.3" @@ -1232,12 +1310,19 @@ escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1 resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -eslint-plugin-flowtype@3.12.1: - version "3.12.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.12.1.tgz#b673c716b578c9aa66887feef3bc146f8cbe1c21" - integrity sha512-NZqf5iRgsfHOC31HQdtX2pvzCi0n/j9pB+L7Cf9QtuYxpx0i2wObT+R3rPKhQK4KtEDzGuzPYVf75j4eg+s9ZQ== +eslint-plugin-flowtype@4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-4.2.0.tgz#a89ac991eef6753226eb8871261e266645aca4b9" + integrity sha512-mqf6AbQCP6N8Bk+ryXYwxt6sj3RT7i3kt8JOOx7WOQNlZtsLxqvnkXRRrToFHcN52E5W9c/p3UfNxCMsfENIJA== dependencies: - lodash "^4.17.11" + lodash "^4.17.15" + +eslint-plugin-typescript@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-typescript/-/eslint-plugin-typescript-0.14.0.tgz#068549c3f4c7f3f85d88d398c29fa96bf500884c" + integrity sha512-2u1WnnDF2mkWWgU1lFQ2RjypUlmRoBEvQN02y9u+IL12mjWlkKFGEBnVsjs9Y8190bfPQCvWly1c2rYYUSOxWw== + dependencies: + requireindex "~1.1.0" eslint-scope@3.7.1: version "3.7.1" @@ -1247,7 +1332,7 @@ eslint-scope@3.7.1: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-scope@^4.0.3: +eslint-scope@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== @@ -1255,68 +1340,77 @@ eslint-scope@^4.0.3: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-utils@^1.3.1: +eslint-scope@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9" + integrity sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-utils@^1.3.1, eslint-utils@^1.4.0: version "1.4.2" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.2.tgz#166a5180ef6ab7eb462f162fd0e6f2463d7309ab" integrity sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q== dependencies: eslint-visitor-keys "^1.0.0" -eslint-visitor-keys@^1.0.0: +eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== -eslint@5.16.0: - version "5.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" - integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== +eslint@6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.1.0.tgz#06438a4a278b1d84fb107d24eaaa35471986e646" + integrity sha512-QhrbdRD7ofuV09IuE2ySWBz0FyXCq0rriLTZXZqaWSI79CVtHVRdkFuFTViiqzZhkCgfOh9USpriuGN2gIpZDQ== dependencies: "@babel/code-frame" "^7.0.0" - ajv "^6.9.1" + ajv "^6.10.0" chalk "^2.1.0" cross-spawn "^6.0.5" debug "^4.0.1" doctrine "^3.0.0" - eslint-scope "^4.0.3" + eslint-scope "^5.0.0" eslint-utils "^1.3.1" eslint-visitor-keys "^1.0.0" - espree "^5.0.1" + espree "^6.0.0" esquery "^1.0.1" esutils "^2.0.2" file-entry-cache "^5.0.1" functional-red-black-tree "^1.0.1" - glob "^7.1.2" + glob-parent "^5.0.0" globals "^11.7.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^6.2.2" - js-yaml "^3.13.0" + inquirer "^6.4.1" + is-glob "^4.0.0" + js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" - lodash "^4.17.11" + lodash "^4.17.14" minimatch "^3.0.4" mkdirp "^0.5.1" natural-compare "^1.4.0" optionator "^0.8.2" - path-is-inside "^1.0.2" progress "^2.0.0" regexpp "^2.0.1" - semver "^5.5.1" - strip-ansi "^4.0.0" - strip-json-comments "^2.0.1" + semver "^6.1.2" + strip-ansi "^5.2.0" + strip-json-comments "^3.0.1" table "^5.2.3" text-table "^0.2.0" + v8-compile-cache "^2.0.3" -espree@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" - integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== +espree@^6.0.0: + version "6.1.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-6.1.1.tgz#7f80e5f7257fc47db450022d723e356daeb1e5de" + integrity sha512-EYbr8XZUhWbYCqQRW0duU5LxzL5bETN6AjKBGy1302qqzPaCH10QbRg3Wvco79Z8x9WbiE8HYB4e75xl6qUYvQ== dependencies: - acorn "^6.0.7" - acorn-jsx "^5.0.0" - eslint-visitor-keys "^1.0.0" + acorn "^7.0.0" + acorn-jsx "^5.0.2" + eslint-visitor-keys "^1.1.0" esprima@^4.0.0: version "4.0.1" @@ -1450,10 +1544,10 @@ flatted@^2.0.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== -flow-bin@0.106.0: - version "0.106.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.106.0.tgz#55aab8c154df2bd78abfe6acfe120cf5638a0352" - integrity sha512-sV8lNBLTTfieUBNvQZFc1K1wXjC8I+O7ltv6G/nd3hdGyq2Jymyy01zAPhJ7MRw8yZ0X2dBSHFZx5DPreBqhAg== +flow-bin@0.106.1: + version "0.106.1" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.106.1.tgz#78765c5fd7f23121cf58d4236ac7cb63befaf6ba" + integrity sha512-UqAbzDZsxNgZ+pv3/OwZEpo/Dt4ZCiMgiyJ5cAPC9bHq8/wti8ZhLWuIVBgDFpV7OPflmQXQNXqbvB8/5BvEDQ== foreground-child@^1.5.6: version "1.5.6" @@ -1530,6 +1624,13 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" +glob-parent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.0.0.tgz#1dc99f0f39b006d3e92c2c284068382f0c20e954" + integrity sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg== + dependencies: + is-glob "^4.0.1" + glob@7.1.3: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" @@ -1542,7 +1643,7 @@ glob@7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: +glob@^7.1.1, glob@^7.1.3: version "7.1.4" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== @@ -1681,7 +1782,7 @@ inherits@2: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inquirer@^6.2.2: +inquirer@^6.4.1: version "6.5.2" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== @@ -1732,6 +1833,11 @@ is-date-object@^1.0.1: resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" @@ -1744,6 +1850,13 @@ is-fullwidth-code-point@^2.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= +is-glob@^4.0.0, is-glob@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" @@ -1855,7 +1968,7 @@ js-tokens@^3.0.2: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= -js-yaml@3.13.1, js-yaml@^3.13.0, js-yaml@^3.13.1, js-yaml@^3.7.0: +js-yaml@3.13.1, js-yaml@^3.13.1, js-yaml@^3.7.0: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== @@ -1965,7 +2078,12 @@ lodash.flattendeep@^4.4.0: resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= -lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14: +lodash.unescape@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" + integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw= + +lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== @@ -2000,6 +2118,11 @@ make-dir@^2.0.0, make-dir@^2.1.0: pify "^4.0.1" semver "^5.6.0" +make-error@^1.1.1: + version "1.3.5" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" + integrity sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g== + map-age-cleaner@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" @@ -2366,11 +2489,6 @@ path-is-absolute@^1.0.0: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-is-inside@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= - path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" @@ -2598,6 +2716,11 @@ require-main-filename@^2.0.0: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== +requireindex@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.1.0.tgz#e5404b81557ef75db6e49c5a72004893fe03e162" + integrity sha1-5UBLgVV+91225JxacgBIk/4D4WI= + resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -2661,12 +2784,12 @@ safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0: +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: +semver@^6.0.0, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== @@ -2702,7 +2825,7 @@ slice-ansi@^2.1.0: astral-regex "^1.0.0" is-fullwidth-code-point "^2.0.0" -source-map-support@^0.5.9: +source-map-support@^0.5.13, source-map-support@^0.5.6, source-map-support@^0.5.9: version "0.5.13" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== @@ -2721,9 +2844,9 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== spawn-wrap@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.4.2.tgz#cff58e73a8224617b6561abdc32586ea0c82248c" - integrity sha512-vMwR3OmmDhnxCVxM8M+xO/FtIp6Ju/mNaDfCMMW7FDcLRTPFWUswec4LXJHTJE2hwTI9O0YBfygu4DalFl7Ylg== + version "1.4.3" + resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.4.3.tgz#81b7670e170cca247d80bf5faf0cfb713bdcf848" + integrity sha512-IgB8md0QW/+tWqcavuFgKYR/qIRvJkRLPJDFaoXtLLUaVcCDK0+HeFTkmQHj3eprcYhc+gOl0aEA1w7qZlYezw== dependencies: foreground-child "^1.5.6" mkdirp "^0.5.0" @@ -2840,6 +2963,11 @@ strip-json-comments@2.0.1, strip-json-comments@^2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= +strip-json-comments@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7" + integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw== + supports-color@6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" @@ -2921,6 +3049,17 @@ trim-right@^1.0.1: resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= +ts-node@^8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.3.0.tgz#e4059618411371924a1fb5f3b125915f324efb57" + integrity sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ== + dependencies: + arg "^4.1.0" + diff "^4.0.1" + make-error "^1.1.1" + source-map-support "^0.5.6" + yn "^3.0.0" + tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0: version "1.10.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" @@ -2952,6 +3091,13 @@ tsutils@^2.29.0: dependencies: tslib "^1.8.1" +tsutils@^3.14.0: + version "3.17.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" + integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g== + dependencies: + tslib "^1.8.1" + tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -2976,10 +3122,15 @@ type-detect@^4.0.0, type-detect@^4.0.5: resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== +typescript@^3.5.3: + version "3.5.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977" + integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g== + typescript@next: - version "3.7.0-dev.20190823" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.0-dev.20190823.tgz#2d3345dea6fc8c5f72b6eef7c8012ee90cdb2231" - integrity sha512-JT3Mib3htRiTu+Tf4NYPaAg9tCozwKdFoqkE/HqnmDpEp+xmn9jRxeRzUESkP4PjV+h2CosEVsvTTMY+Jw9jYQ== + version "3.7.0-dev.20190824" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.0-dev.20190824.tgz#8c64e1c70f37c035d29e336602a402d758243d6b" + integrity sha512-6aundhR7oRuWSjxEXEKTtnYvxInzGnnlSqXmdLZDxDnWX786Fcval5OfYu15K/Wj8iGkNyPKWigTCqozK5D8Iw== uglify-js@^3.1.4: version "3.6.0" @@ -3029,6 +3180,11 @@ uuid@^3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866" integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ== +v8-compile-cache@^2.0.3: + version "2.1.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" + integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g== + validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -3206,3 +3362,8 @@ yargs@^13.2.2: which-module "^2.0.0" y18n "^4.0.0" yargs-parser "^13.1.1" + +yn@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==