relay-compiler 13.0.0-rc.2 → 13.0.3
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +1 -1
- package/README.md +61 -45
- package/linux-x64/relay +0 -0
- package/macos-arm64/relay +0 -0
- package/macos-x64/relay +0 -0
- package/package.json +6 -2
- package/win-x64/relay.exe +0 -0
package/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
MIT License
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) Meta Platforms, Inc. and affiliates.
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
@@ -27,10 +27,11 @@ containing `graphql` literals) and the GraphQL schema for the project.
|
|
27
27
|
}
|
28
28
|
}
|
29
29
|
```
|
30
|
+
|
30
31
|
Relay Compiler will automatically discover the config if:
|
31
32
|
|
32
33
|
- There is a `relay.config.json`, `relay.config.js` file at the root of the
|
33
|
-
project (i.e. in the same folder as the `package.json` file).
|
34
|
+
project (i.e. in the same folder as the `package.json` file).
|
34
35
|
- The `package.json` file contains a `"relay"` key.
|
35
36
|
|
36
37
|
Additionally, this config file can be specified with the CLI argument `--config`
|
@@ -47,62 +48,77 @@ yarn relay --config ./relay.json
|
|
47
48
|
```
|
48
49
|
|
49
50
|
Please note, that if you pass configuration options via --cli arguments, you'll
|
50
|
-
need to provide a separate configuration for the
|
51
|
+
need to provide a separate configuration for the
|
52
|
+
[babel plugin](https://www.npmjs.com/package/babel-plugin-relay).
|
51
53
|
|
52
54
|
## File Finder
|
55
|
+
|
53
56
|
Relay compiler uses [`watchman`](https://facebook.github.io/watchman/) to find
|
54
|
-
file sources, and "listen" to the file
|
55
|
-
|
56
|
-
|
57
|
+
file sources, and "listen" to the file changes in the "watch" mode. If
|
58
|
+
`watchman` is not available, the compiler will use
|
59
|
+
[glob](https://docs.rs/glob/latest/glob/) to query the filesystem for files.
|
57
60
|
|
58
61
|
## Configuration
|
59
62
|
|
60
63
|
### Supported compiler configuration options
|
61
64
|
|
62
|
-
- `src`
|
63
|
-
- `schema`
|
64
|
-
|
65
|
-
- `
|
66
|
-
|
67
|
-
|
68
|
-
- `
|
69
|
-
|
70
|
-
|
71
|
-
- `
|
72
|
-
|
73
|
-
- `
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
- `
|
91
|
-
|
92
|
-
- `
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
65
|
+
- `src` Root directory of application code. [string] [required]
|
66
|
+
- `schema` Relative path to the file with GraphQL SDL file. [string] [required]
|
67
|
+
- `schemaConfig`
|
68
|
+
- `nodeInterfaceIdField` Configure the name of the globally unique ID field on
|
69
|
+
the Node interface. Useful if you can't use the default `id` field name.
|
70
|
+
[string][default: "id"]
|
71
|
+
- `artifactDirectory` A specific directory to output all artifacts to. When
|
72
|
+
enabling this the babel plugin needs `artifactDirectory` to be set as well.
|
73
|
+
[string]
|
74
|
+
- `language` The name of the language used for input files and generated
|
75
|
+
artifacts. ["flow" | "typescript"] [default: "flow"]
|
76
|
+
- `excludes` Directories to ignore under `src`. [array] [default:
|
77
|
+
["**/node_modules/**", "**/__mocks__/**", "**/__generated__/**"]]
|
78
|
+
- `schemaExtensions` List of directories with schema extensions. [array]
|
79
|
+
- `noFutureProofEnums` For `flow` only. This option controls whether or not a
|
80
|
+
catch-all entry is added to enum type definitions values that may be added in
|
81
|
+
the future. Enabling this means you will have to update your application
|
82
|
+
whenever the GraphQL server schema adds new enum values to prevent it from
|
83
|
+
breaking. [boolean][default: false]
|
84
|
+
- `customScalars` Mappings from custom scalars in your schema to built-in
|
85
|
+
GraphQL types, for type emission purposes. [object]
|
86
|
+
- `eagerEsModules` This option enables emitting ES modules artifacts.
|
87
|
+
[boolean][default: false]
|
88
|
+
- `persistConfig` Relay supports two versions of the config:
|
89
|
+
- - **Remote Persisting:**
|
90
|
+
|
91
|
+
- `url` String, URL to send a POST request to to persist. This field is
|
92
|
+
required in `persistConfig` [string]
|
93
|
+
- `params` The document will be in a `POST` parameter `text`. This map can
|
94
|
+
contain additional parameters to send. [object]
|
95
|
+
- `concurrency` The maximum number concurrent requests that will be made to
|
96
|
+
`url`. Use a value greater than 0. [number]
|
97
|
+
|
98
|
+
- - **Local Persisting:**
|
99
|
+
- `file` Path for the JSON file that will contain operations map. Compiler
|
100
|
+
will write queries in the format: { "md5(queryText) => "queryText", ...}.
|
101
|
+
[string]
|
102
|
+
|
103
|
+
- `codegenCommand` Command name that for relay compiler. [string]
|
104
|
+
|
105
|
+
- `isDevVariableName` Name of the global variable for dev mode (`__DEV__`).
|
106
|
+
[string]
|
107
|
+
- `jsModuleFormat` Formatting style for generated files. `commonjs` or `haste`.
|
108
|
+
Default is `commonjs`. [string]
|
98
109
|
|
99
110
|
### CLI configuration
|
100
111
|
|
101
112
|
We also support a limited set of CLI arguments that should cover the most cases
|
102
113
|
when you need to run the compiler.
|
103
114
|
|
104
|
-
- `--src`
|
105
|
-
- `--schema`
|
115
|
+
- `--src` Relative path to the source code.
|
116
|
+
- `--schema` Relative path to schema file.
|
106
117
|
- `--artifactDirectory` Compiler output directory.
|
107
|
-
- `--
|
108
|
-
|
118
|
+
- `--repersist` Run the persister even if the query has not changed.
|
119
|
+
- `--watch` Run compiler in `watch` mode. Requires
|
120
|
+
[`watchman`](https://facebook.github.io/watchman/) to be installed.
|
121
|
+
- `--output` Output format of the compiler. Supported options: `debug` |
|
122
|
+
`verbose` | `quiet` | `quietWithErrors`. The default value is `verbose`.
|
123
|
+
- `--validate` Looks for pending changes and exits with non-zero code instead of
|
124
|
+
writing to disk.
|
package/linux-x64/relay
CHANGED
Binary file
|
package/macos-arm64/relay
CHANGED
Binary file
|
package/macos-x64/relay
CHANGED
Binary file
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "relay-compiler",
|
3
3
|
"description": "A compiler tool for building GraphQL-driven applications.",
|
4
|
-
"version": "13.0.
|
4
|
+
"version": "13.0.3",
|
5
5
|
"keywords": [
|
6
6
|
"graphql",
|
7
7
|
"relay"
|
@@ -9,7 +9,11 @@
|
|
9
9
|
"license": "MIT",
|
10
10
|
"homepage": "https://relay.dev",
|
11
11
|
"bugs": "https://github.com/facebook/relay/issues",
|
12
|
-
"repository":
|
12
|
+
"repository": {
|
13
|
+
"type": "git",
|
14
|
+
"url": "https://github.com/facebook/relay.git",
|
15
|
+
"directory": "packages/relay-compiler"
|
16
|
+
},
|
13
17
|
"main": "index.js",
|
14
18
|
"bin": "cli.js"
|
15
19
|
}
|
package/win-x64/relay.exe
CHANGED
Binary file
|