diff --git a/compiler/Cargo.lock b/compiler/Cargo.lock index 609c159f9760d..0954036ecd57c 100644 --- a/compiler/Cargo.lock +++ b/compiler/Cargo.lock @@ -12,6 +12,17 @@ dependencies = [ "regex", ] +[[package]] +name = "ahash" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + [[package]] name = "aho-corasick" version = "0.7.18" @@ -205,7 +216,7 @@ version = "0.0.0" dependencies = [ "colored", "indexmap", - "interner", + "intern", "log", "lsp-types", "md-5", @@ -328,7 +339,7 @@ dependencies = [ "fnv", "graphql-ir", "graphql-syntax", - "interner", + "intern", "relay-test-schema", "relay-transforms", "schema", @@ -587,7 +598,7 @@ dependencies = [ "graphql-cli", "graphql-syntax", "indexmap", - "interner", + "intern", "lazy_static", "once_cell", "relay-test-schema", @@ -603,7 +614,7 @@ dependencies = [ "common", "fixture-tests", "graphql-cli", - "interner", + "intern", "logos", "lsp-types", "serde", @@ -632,7 +643,7 @@ dependencies = [ "fnv", "graphql-ir", "graphql-syntax", - "interner", + "intern", "relay-test-schema", "schema", ] @@ -671,6 +682,10 @@ name = "hashbrown" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash", + "serde", +] [[package]] name = "heck" @@ -807,6 +822,23 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "intern" +version = "0.0.0" +dependencies = [ + "bincode", + "fnv", + "hashbrown", + "indexmap", + "once_cell", + "parking_lot 0.10.2", + "rand", + "serde", + "serde_bytes", + "serde_derive", + "smallvec", +] + [[package]] name = "interner" version = "0.0.0" @@ -1376,7 +1408,7 @@ dependencies = [ "graphql-test-helpers", "hex", "indexmap", - "interner", + "intern", "lazy_static", "md-5", "relay-test-schema", @@ -1409,7 +1441,7 @@ dependencies = [ "graphql-watchman", "hex", "indexmap", - "interner", + "intern", "js-config-loader", "lazy_static", "log", @@ -1450,7 +1482,7 @@ dependencies = [ "graphql-syntax", "graphql-text-printer", "graphql-watchman", - "interner", + "intern", "log", "lsp-server", "lsp-types", @@ -1473,7 +1505,7 @@ name = "relay-schema" version = "0.0.0" dependencies = [ "common", - "interner", + "intern", "schema", ] @@ -1502,7 +1534,7 @@ dependencies = [ "graphql-test-helpers", "graphql-text-printer", "indexmap", - "interner", + "intern", "itertools", "lazy_static", "once_cell", @@ -1524,7 +1556,7 @@ dependencies = [ "graphql-ir", "graphql-syntax", "indexmap", - "interner", + "intern", "itertools", "lazy_static", "relay-codegen", @@ -1570,7 +1602,7 @@ dependencies = [ "fnv", "graphql-cli", "graphql-syntax", - "interner", + "intern", "lazy_static", "ouroboros", "schema-flatbuffer", @@ -1584,7 +1616,7 @@ dependencies = [ "common", "fnv", "graphql-syntax", - "interner", + "intern", "lazy_static", "schema", ] @@ -1593,7 +1625,7 @@ dependencies = [ name = "schema-documentation" version = "0.0.0" dependencies = [ - "interner", + "intern", "schema", ] @@ -1610,7 +1642,7 @@ version = "0.0.0" dependencies = [ "fixture-tests", "fnv", - "interner", + "intern", "itertools", "schema", ] @@ -1622,7 +1654,7 @@ dependencies = [ "common", "fixture-tests", "fnv", - "interner", + "intern", "lazy_static", "rayon", "regex", @@ -1683,6 +1715,15 @@ dependencies = [ "thiserror", ] +[[package]] +name = "serde_bytes" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +dependencies = [ + "serde", +] + [[package]] name = "serde_derive" version = "1.0.126" @@ -1758,6 +1799,9 @@ name = "smallvec" version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +dependencies = [ + "serde", +] [[package]] name = "socket2" @@ -1822,6 +1866,12 @@ dependencies = [ "syn", ] +[[package]] +name = "sval" +version = "1.0.0-alpha.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45f6ee7c7b87caf59549e9fe45d6a69c75c8019e79e212a835c5da0e92f0ba08" + [[package]] name = "syn" version = "1.0.63" @@ -2058,6 +2108,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b676010e055c99033117c2343b33a40a30b91fecd6c49055ac9cd2d6c305ab1" dependencies = [ "ctor", + "sval", ] [[package]] diff --git a/gulpfile.js b/gulpfile.js index aca49821f845a..ac0aa5ba0e5f6 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -51,7 +51,6 @@ const VERSION = RELEASE_COMMIT_SHA ? `0.0.0-main-${RELEASE_COMMIT_SHA.substr(0, 8)}` : process.env.npm_package_version; -const SCRIPT_HASHBANG = '#!/usr/bin/env node\n'; const DEVELOPMENT_HEADER = `/** * Relay v${VERSION} */ @@ -196,21 +195,6 @@ const builds = [ }, ], }, - { - package: 'relay-config', - exports: { - index: 'index.js', - }, - bundles: [ - { - entry: 'index.js', - output: 'relay-config', - libraryName: 'RelayConfig', - target: 'node', - noMinify: true, // Note: uglify can't yet handle modern JS - }, - ], - }, { package: 'relay-test-utils-internal', exports: { diff --git a/package.json b/package.json index 0e16a0009652a..9009771b1e77a 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,6 @@ "babel-plugin-tester": "^6.0.1", "babel-preset-fbjs": "^3.4.0", "chalk": "^4.0.0", - "cosmiconfig": "^5.0.5", "cross-env": "^7.0.2", "del": "6.0.0", "eslint": "5.4.0", diff --git a/packages/relay-config/README.md b/packages/relay-config/README.md deleted file mode 100644 index ea1a8de43b83f..0000000000000 --- a/packages/relay-config/README.md +++ /dev/null @@ -1,66 +0,0 @@ -## Relay Config - -**Only works with Relay 12 and below, Relay 13 does not use this format** - -Handles the config which would traditionally be passed into the relay-compiler via the CLI command-line, or inside the babel plugin config. - -To use this package, first install it: `yarn add relay-config`, then create a `relay.config.js` which includes fields the relay-compiler CLI describes: - -```js -// relay.config.js -module.exports = { - // ... - // Configuration options accepted by the `relay-compiler` command-line tool and `babel-plugin-relay`. - src: "./src", - schema: "./data/schema.graphql", - exclude: ["**/node_modules/**", "**/__mocks__/**", "**/__generated__/**"], -} -``` - -Here's the full CLI input reference (as of Relay v12) - -``` -relay-compiler --schema --src [--watch] - -Options: - --schema Path to schema.graphql or schema.json[string] [required] - --src Root directory of application code [string] [required] - --include Directories to include under src - [array] [default: ["**"]] - --exclude Directories to ignore under src [array] [default: - ["**/node_modules/**","**/__mocks__/**","**/__generated__/**"]] - --extensions File extensions to compile (defaults to extensions - provided by the language plugin) [array] - --verbose More verbose logging [boolean] [default: false] - --quiet No output to stdout [boolean] [default: false] - --watchman Use watchman when not in watch mode - [boolean] [default: true] - --watch If specified, watches files and regenerates on changes - [boolean] [default: false] - --validate Looks for pending changes and exits with non-zero code - instead of writing to disk [boolean] [default: false] - --persistFunction An async function (or path to a module exporting this - function) which will persist the query text and return - the id. [string] - --persistOutput A path to a .json file where persisted query metadata - should be saved. Will use the default implementation - (md5 hash) if `persistFunction` is not passed. [string] - --repersist Run the persist function even if the query has not - changed. [boolean] [default: false] - --noFutureProofEnums This option controls whether or not a catch-all entry is - added to enum type definitions for values that may be - added in the future. Enabling this means you will have - to update your application whenever the GraphQL server - schema adds new enum values to prevent it from breaking. - [boolean] [default: false] - --language The name of the language plugin used for input files and - artifacts [string] [default: "javascript"] - --artifactDirectory A specific directory to output all artifacts to. When - enabling this the babel plugin needs `artifactDirectory` - set as well. [string] - --customScalars Mappings from custom scalars in your schema to built-in - GraphQL types, for type emission purposes. (Uses yargs - dot-notation, e.g. --customScalars.URL=String) - --eagerESModules This option enables emitting es modules artifacts. - [boolean] [default: false] -``` diff --git a/packages/relay-config/index.js b/packages/relay-config/index.js deleted file mode 100644 index cfe6f2859f37a..0000000000000 --- a/packages/relay-config/index.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow - * @format - */ - -// flowlint ambiguous-object-type:error - -'use strict'; - -const cosmiconfig = require('cosmiconfig'); - -const explorer = cosmiconfig('relay', { - searchPlaces: ['relay.config.js', 'relay.config.json', 'package.json'], - - loaders: { - '.json': cosmiconfig.loadJson, - '.yaml': cosmiconfig.loadYaml, - '.yml': cosmiconfig.loadYaml, - '.js': cosmiconfig.loadJs, - '.es6': cosmiconfig.loadJs, - noExt: cosmiconfig.loadYaml, - }, -}); - -function loadConfig(): $FlowFixMe { - const result = explorer.searchSync(); - if (result) { - return result.config; - } -} - -module.exports = {loadConfig}; diff --git a/packages/relay-config/package.json b/packages/relay-config/package.json deleted file mode 100644 index 3f2dad6fa0487..0000000000000 --- a/packages/relay-config/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "relay-config", - "description": "Config parser for Relay applications.", - "version": "13.0.0-rc.0", - "keywords": [ - "graphql", - "relay" - ], - "license": "MIT", - "homepage": "https://facebook.github.io/relay/", - "bugs": "https://github.com/facebook/relay/issues", - "repository": "facebook/relay", - "main": "index.js", - "dependencies": { - "cosmiconfig": "^5.0.5" - } -} diff --git a/yarn.lock b/yarn.lock index 347142f601800..af1362969a52e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1885,13 +1885,6 @@ call-bind@^1.0.0: function-bind "^1.1.1" get-intrinsic "^1.0.0" -caller-callsite@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" - integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ= - dependencies: - callsites "^2.0.0" - caller-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" @@ -1899,23 +1892,11 @@ caller-path@^0.1.0: dependencies: callsites "^0.2.0" -caller-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" - integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ= - dependencies: - caller-callsite "^2.0.0" - callsites@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" integrity sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo= -callsites@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" - integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= - callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -2301,16 +2282,6 @@ core-util-is@1.0.2, core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= -cosmiconfig@^5.0.5: - version "5.2.1" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" - integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== - dependencies: - import-fresh "^2.0.0" - is-directory "^0.3.1" - js-yaml "^3.13.1" - parse-json "^4.0.0" - cosmiconfig@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-6.0.0.tgz#da4fee853c52f6b1e6935f41c1a2fc50bd4a9982" @@ -3905,14 +3876,6 @@ immutable@~3.7.6: resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.7.6.tgz#13b4d3cb12befa15482a26fe1b2ebae640071e4b" integrity sha1-E7TTyxK++hVIKib+Gy665kAHHks= -import-fresh@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" - integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY= - dependencies: - caller-path "^2.0.0" - resolve-from "^3.0.0" - import-fresh@^3.1.0: version "3.2.2" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.2.tgz#fc129c160c5d68235507f4331a6baad186bdbc3e" @@ -4124,11 +4087,6 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: is-data-descriptor "^1.0.0" kind-of "^6.0.2" -is-directory@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" - integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= - is-docker@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.1.1.tgz#4125a88e44e450d384e09047ede71adc2d144156" @@ -4827,7 +4785,7 @@ jsesc@^2.5.1: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: +json-parse-better-errors@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== @@ -5854,14 +5812,6 @@ parse-json@^2.2.0: dependencies: error-ex "^1.2.0" -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - parse-json@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.1.0.tgz#f96088cdf24a8faa9aea9a009f2d9d942c999646" @@ -6521,11 +6471,6 @@ resolve-from@^1.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" integrity sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY= -resolve-from@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" - integrity sha1-six699nWiBvItuZTM17rywoYh0g= - resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"