@apollo/rover 0.26.0-rc.1 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/binary.js +11 -9
- package/package.json +1 -1
package/README.md
CHANGED
@@ -78,6 +78,7 @@ Options:
|
|
78
78
|
|
79
79
|
--format <FORMAT_KIND>
|
80
80
|
Specify Rover's format type
|
81
|
+
|
81
82
|
[default: plain]
|
82
83
|
[possible values: plain, json]
|
83
84
|
|
@@ -86,21 +87,21 @@ Options:
|
|
86
87
|
|
87
88
|
--insecure-accept-invalid-certs
|
88
89
|
Accept invalid certificates when performing HTTPS requests.
|
90
|
+
|
89
91
|
You should think very carefully before using this flag.
|
90
|
-
|
91
|
-
If invalid certificates are trusted, any certificate for any site will be trusted for use.
|
92
|
-
his includes expired certificates. This introduces significant vulnerabilities, and should only be use
|
93
|
-
d as a last resort.
|
92
|
+
|
93
|
+
If invalid certificates are trusted, any certificate for any site will be trusted for use. This includes expired certificates. This introduces significant vulnerabilities, and should only be used as a last resort.
|
94
94
|
|
95
95
|
--insecure-accept-invalid-hostnames
|
96
96
|
Accept invalid hostnames when performing HTTPS requests.
|
97
|
+
|
97
98
|
You should think very carefully before using this flag.
|
98
|
-
|
99
|
-
If hostname verification is not used, any valid certificate for any site will be trusted for
|
100
|
-
use from any other. This introduces a significant vulnerability to man-in-the-middle attacks.
|
99
|
+
|
100
|
+
If hostname verification is not used, any valid certificate for any site will be trusted for use from any other. This introduces a significant vulnerability to man-in-the-middle attacks.
|
101
101
|
|
102
102
|
--client-timeout <CLIENT_TIMEOUT>
|
103
103
|
Configure the timeout length (in seconds) when performing HTTP(S) requests
|
104
|
+
|
104
105
|
[default: 30]
|
105
106
|
|
106
107
|
--skip-update-check
|
@@ -126,8 +127,7 @@ This will prompt you for an API Key that can be generated in Apollo Studio.
|
|
126
127
|
The most common commands from there are:
|
127
128
|
|
128
129
|
- rover graph fetch: Fetch a graph schema from the Apollo graph registry
|
129
|
-
- rover graph check: Check for breaking changes in a local graph schema against a graph schema in
|
130
|
-
the Apollo graph
|
130
|
+
- rover graph check: Check for breaking changes in a local graph schema against a graph schema in the Apollo graph
|
131
131
|
registry
|
132
132
|
- rover graph publish: Publish an updated graph schema to the Apollo graph registry
|
133
133
|
|
package/binary.js
CHANGED
@@ -25,37 +25,39 @@ const supportedPlatforms = [
|
|
25
25
|
ARCHITECTURE: "x64",
|
26
26
|
RUST_TARGET: "x86_64-pc-windows-msvc",
|
27
27
|
BINARY_NAME: `${name}-${version}.exe`,
|
28
|
+
RAW_NAME: `${name}.exe`
|
28
29
|
},
|
29
30
|
{
|
30
31
|
TYPE: "Linux",
|
31
32
|
ARCHITECTURE: "x64",
|
32
33
|
RUST_TARGET: "x86_64-unknown-linux-gnu",
|
33
34
|
BINARY_NAME: `${name}-${version}`,
|
35
|
+
RAW_NAME: `${name}`
|
34
36
|
},
|
35
37
|
{
|
36
38
|
TYPE: "Linux",
|
37
39
|
ARCHITECTURE: "arm64",
|
38
40
|
RUST_TARGET: "aarch64-unknown-linux-gnu",
|
39
41
|
BINARY_NAME: `${name}-${version}`,
|
42
|
+
RAW_NAME: `${name}`
|
40
43
|
},
|
41
44
|
{
|
42
45
|
TYPE: "Darwin",
|
43
46
|
ARCHITECTURE: "x64",
|
44
47
|
RUST_TARGET: "x86_64-apple-darwin",
|
45
48
|
BINARY_NAME: `${name}-${version}`,
|
49
|
+
RAW_NAME: `${name}`
|
46
50
|
},
|
47
51
|
{
|
48
52
|
TYPE: "Darwin",
|
49
53
|
ARCHITECTURE: "arm64",
|
50
54
|
RUST_TARGET: "aarch64-apple-darwin",
|
51
55
|
BINARY_NAME: `${name}-${version}`,
|
56
|
+
RAW_NAME: `${name}`
|
52
57
|
},
|
53
58
|
];
|
54
59
|
|
55
|
-
const getPlatform = () => {
|
56
|
-
const type = os.type();
|
57
|
-
const architecture = os.arch();
|
58
|
-
|
60
|
+
const getPlatform = (type = os.type(), architecture = os.arch()) => {
|
59
61
|
for (let supportedPlatform of supportedPlatforms) {
|
60
62
|
if (
|
61
63
|
type === supportedPlatform.TYPE &&
|
@@ -102,7 +104,7 @@ const getPlatform = () => {
|
|
102
104
|
|
103
105
|
/*! Copyright (c) 2019 Avery Harnish - MIT License */
|
104
106
|
class Binary {
|
105
|
-
constructor(name, url, installDirectory) {
|
107
|
+
constructor(name, raw_name, url, installDirectory) {
|
106
108
|
let errors = [];
|
107
109
|
if (typeof url !== "string") {
|
108
110
|
errors.push("url must be a string");
|
@@ -132,6 +134,7 @@ class Binary {
|
|
132
134
|
}
|
133
135
|
this.url = url;
|
134
136
|
this.name = name;
|
137
|
+
this.raw_name = raw_name;
|
135
138
|
this.installDirectory = installDirectory;
|
136
139
|
|
137
140
|
if (!existsSync(this.installDirectory)) {
|
@@ -176,7 +179,7 @@ class Binary {
|
|
176
179
|
});
|
177
180
|
})
|
178
181
|
.then(() => {
|
179
|
-
fs.renameSync(join(this.installDirectory,
|
182
|
+
fs.renameSync(join(this.installDirectory, this.raw_name), this.binaryPath);
|
180
183
|
if (!suppressLogs) {
|
181
184
|
console.error(`${this.name} has been installed!`);
|
182
185
|
}
|
@@ -212,8 +215,7 @@ class Binary {
|
|
212
215
|
}
|
213
216
|
}
|
214
217
|
|
215
|
-
const getBinary = (overrideInstallDirectory) => {
|
216
|
-
const platform = getPlatform();
|
218
|
+
const getBinary = (overrideInstallDirectory, platform = getPlatform()) => {
|
217
219
|
const download_host = process.env.npm_config_apollo_rover_download_host || process.env.APOLLO_ROVER_DOWNLOAD_HOST || 'https://rover.apollo.dev'
|
218
220
|
// the url for this binary is constructed from values in `package.json`
|
219
221
|
// https://rover.apollo.dev/tar/rover/x86_64-unknown-linux-gnu/v0.4.8
|
@@ -224,7 +226,7 @@ const getBinary = (overrideInstallDirectory) => {
|
|
224
226
|
if (overrideInstallDirectory != null && overrideInstallDirectory !== "") {
|
225
227
|
installDirectory = overrideInstallDirectory
|
226
228
|
}
|
227
|
-
let binary = new Binary(platform.BINARY_NAME, url, installDirectory);
|
229
|
+
let binary = new Binary(platform.BINARY_NAME, platform.RAW_NAME, url, installDirectory);
|
228
230
|
|
229
231
|
// setting this allows us to extract supergraph plugins to the proper directory
|
230
232
|
// the variable itself is read in Rust code
|