{"name":"relay-compiler","version":"0.0.0-main-e7bcc36d","keywords":["graphql","relay"],"license":"MIT","_id":"relay-compiler@0.0.0-main-e7bcc36d","maintainers":[{"name":"alunyov","email":"alunyov@fb.com"},{"name":"rbalicki","email":"robert.balicki@gmail.com"},{"name":"sugarpirate","email":"arr@sugarpirate.com"},{"name":"fb","email":"opensource+npm@fb.com"},{"name":"yuzhi","email":"yuzhi.z@gmail.com"},{"name":"kassens","email":"jkassens@fb.com"},{"name":"xiaobu","email":"yaotianyu0512@gmail.com"},{"name":"lunaruan","email":"lunaris.ruan@gmail.com"},{"name":"relay-bot","email":"jkassens+relay@fb.com"},{"name":"kacieb","email":"kaciebawiec@gmail.com"}],"homepage":"https://relay.dev","bugs":{"url":"https://github.com/facebook/relay/issues"},"bin":{"relay-compiler":"cli.js"},"dist":{"shasum":"1a537ef0ee9fce5b834a45cb046d6759ddbb708e","tarball":"http://registry-npm.ywwl.com/relay-compiler/download/relay-compiler-0.0.0-main-e7bcc36d.tgz","fileCount":9,"integrity":"sha512-Cir082vVaU6HFOnU0uUge3ZTh64YUEsIDGm4i3iduiU2oLZ66YyuMJGEMGuRRQjSGql4hfPb3z02/iJb2xDuwQ==","signatures":[{"sig":"MEUCIA7FsTZGXM6nl1mAz/FDUhnyE4BqUynERO4Zsx0DktIqAiEAykFLZoR4p81U+lqioYfPDaRJuBtv5GMEGTeoDBY0iPc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":55454951,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiL/sUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqCeg/9FSzS8BelHl8/wYe+FTi+c3Azo8+E/q89Qkg4dGejXU2x+7QJ\r\ndXE7bAEDLU0ZyLp649fdcOByaJRbzu33OjWbnvfh+aUIxwglzs5dPIxqhlnh\r\nhqAMsEL63HFzsHvSOwxL5NbjioEmVZX0liSi4lz6ylvCJ1CrahrgTDJerDdX\r\nCtdK/YvWYxmv4CU09D7S8T8/y7wAFRZ05/+vV1V2CxDxTlBk3sTlxUZFKzSG\r\nVy7o4RcuSWlU1+j1CZN4O7GPiRVTgV2vBm8YajYmkKxFj4ASvtEG4vZ8iJXb\r\n2xGeT0zBI2V9c6dbSmkagXS0wk2y2/BUX0d9VqX5XR5bM0FP2vNd7ePjCgLt\r\nA3wgNP4JQSvaGCq6lS8o7c3yYhe4EU40JqSgAJqAtI4YRoL09OWcIF0IL2FZ\r\nvSSHlBNIBR0a53AQBGbvWf7yuQ3iK0YhaSP8VtFe2ZxMAJZ8wgzyqLc3fEEF\r\nXjLlz3eqavFQytfLzF7dCTwjw6L2BClTZv0JhzI4KNIAeXcGpZ4idvVoyNMT\r\n+4XIMFO55qihD9Iy/+IY1X3xLRhL8OuOto6ZmPFzm9fI6zcQ8I5k20fHAijT\r\nIbJoGBn0ADdV4CpXJCVVOWRf2u7Ag5XClNSzFvs4Q/w3Ery5yrP3v9ZadkXb\r\nq6BbpkfBY8/DZ2FbQ5IFpkO7dADYdBtqAg4=\r\n=aXAY\r\n-----END PGP SIGNATURE-----\r\n","size":19725442,"noattachment":false,"key":"/relay-compiler/-/relay-compiler-0.0.0-main-e7bcc36d.tgz"},"main":"index.js","readme":"# Relay Compiler\n\nRelay-Compiler is a code-generation toolkit for GraphQL. It contains the core\nfunctionalities of GraphQL code-gen, including file parsing, validation, syntax\ntree parsing and transformation.\n\n## Configuration in package.json\n\nThe simplest way to configure relay is to add a new `relay` section to your\n`package.json` that contains the relay config.\n\nAt minimum, the relay config must specify where to find source files (i.e. files\ncontaining `graphql` literals) and the GraphQL schema for the project.\n\n```\n// adding new section to package json\n{\n  ...\n \"scripts\": {\n    \"relay\": \"relay-compiler\"\n },\n ...\n // relay configuration\n \"relay\": {\n    \"src\": \"./src\",\n    \"schema\": \"./src/schema/app_schema.graphql\"\n  }\n}\n```\n\nRelay Compiler will automatically discover the config if:\n\n- There is a `relay.config.json`, `relay.config.js` file at the root of the\n  project (i.e. in the same folder as the `package.json` file).\n- The `package.json` file contains a `\"relay\"` key.\n\nAdditionally, this config file can be specified with the CLI argument `--config`\nas follows:\n\n```shell\nnpm run relay --config ./relay.json\n```\n\nor with yarn\n\n```shell\nyarn relay --config ./relay.json\n```\n\nPlease note, that if you pass configuration options via --cli arguments, you'll\nneed to provide a separate configuration for the\n[babel plugin](https://www.npmjs.com/package/babel-plugin-relay).\n\n## File Finder\n\nRelay compiler uses [`watchman`](https://facebook.github.io/watchman/) to find\nfile sources, and \"listen\" to the file changes in the \"watch\" mode. If\n`watchman` is not available, the compiler will use\n[glob](https://docs.rs/glob/latest/glob/) to query the filesystem for files.\n\n## Configuration\n\n### Supported compiler configuration options\n\n- `src` Root directory of application code. [string] [required]\n- `schema` Relative path to the file with GraphQL SDL file. [string] [required]\n- `schemaConfig`\n  - `nodeInterfaceIdField` Configure the name of the globally unique ID field on\n    the Node interface. Useful if you can't use the default `id` field name.\n    [string][default: \"id\"]\n- `artifactDirectory` A specific directory to output all artifacts to. When\n  enabling this the babel plugin needs `artifactDirectory` to be set as well.\n  [string]\n- `language` The name of the language used for input files and generated\n  artifacts. [\"flow\" | \"typescript\"] [default: \"flow\"]\n- `excludes` Directories to ignore under `src`. [array] [default:\n  [\"**/node_modules/**\", \"**/__mocks__/**\", \"**/__generated__/**\"]]\n- `schemaExtensions` List of directories with schema extensions. [array]\n- `noFutureProofEnums` For `flow` only. This option controls whether or not a\n  catch-all entry is added to enum type definitions values that may be added in\n  the future. Enabling this means you will have to update your application\n  whenever the GraphQL server schema adds new enum values to prevent it from\n  breaking. [boolean][default: false]\n- `customScalars` Mappings from custom scalars in your schema to built-in\n  GraphQL types, for type emission purposes. [object]\n- `eagerEsModules` This option enables emitting ES modules artifacts.\n  [boolean][default: false]\n- `persistConfig` Relay supports two versions of the config:\n- - **Remote Persisting:**\n\n  - `url` String, URL to send a POST request to to persist. This field is\n    required in `persistConfig` [string]\n  - `params` The document will be in a `POST` parameter `text`. This map can\n    contain additional parameters to send. [object]\n  - `concurrency` The maximum number concurrent requests that will be made to\n    `url`. Use a value greater than 0. [number]\n\n- - **Local Persisting:**\n  - `file` Path for the JSON file that will contain operations map. Compiler\n    will write queries in the format: { \"md5(queryText) => \"queryText\", ...}.\n    [string]\n\n- `codegenCommand` Command name that for relay compiler. [string]\n\n- `isDevVariableName` Name of the global variable for dev mode (`__DEV__`).\n  [string]\n- `jsModuleFormat` Formatting style for generated files. `commonjs` or `haste`.\n  Default is `commonjs`. [string]\n- `typegenPhase` - `Final` or `Compat`. Use `Compat` for exposing old\n  `<module>QueryVariables` and `<module>QueryResponse` types in the generated\n  artifacts. But we do recommend migrating to the `Final` mode, where the naming\n  of the exposed types are unified with `<module>$data` and `<module>$variables`\n  suffixes.\n\n### CLI configuration\n\nWe also support a limited set of CLI arguments that should cover the most cases\nwhen you need to run the compiler.\n\n- `--src` Relative path to the source code.\n- `--schema` Relative path to schema file.\n- `--artifactDirectory` Compiler output directory.\n- `--repersist` Run the persister even if the query has not changed.\n- `--watch` Run compiler in `watch` mode. Requires\n  [`watchman`](https://facebook.github.io/watchman/) to be installed.\n- `--output` Output format of the compiler. Supported options: `debug` |\n  `verbose` | `quiet` | `quietWithErrors`. The default value is `verbose`.\n- `--validate` Looks for pending changes and exits with non-zero code instead of\n  writing to disk.\n","_npmUser":{"name":"relay-bot","email":"jkassens+relay@fb.com"},"repository":{"url":"git+https://github.com/facebook/relay.git","type":"git","directory":"packages/relay-compiler"},"_npmVersion":"6.14.16","description":"A compiler tool for building GraphQL-driven applications.","directories":{},"_nodeVersion":"14.19.0","_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/relay-compiler_0.0.0-main-e7bcc36d_1647311636040_0.1474434743623938","host":"s3://npm-registry-packages"},"publish_time":1647311636494,"_cnpm_publish_time":1647311636494,"dist-tags":{"dev":"13.0.0-rc.2","latest":"21.0.1","main":"0.0.0-main-b9e1c520"}}