@apollo/rover 0.26.0-rc.0 → 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 +3 -1
- package/binary.js +11 -9
- package/package.json +2 -2
package/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Rover
|
2
2
|
|
3
|
-
>
|
3
|
+
>The new CLI for apollo
|
4
4
|
|
5
5
|
[](https://app.circleci.com/pipelines/github/apollographql/rover?branch=main)
|
6
6
|
[](https://github.com/apollographql/rover/releases/latest)
|
@@ -41,6 +41,8 @@ Rover - Your Graph Companion
|
|
41
41
|
Usage: rover [OPTIONS] <COMMAND>
|
42
42
|
|
43
43
|
Commands:
|
44
|
+
cloud
|
45
|
+
Cloud configuration commands
|
44
46
|
config
|
45
47
|
Configuration profile commands
|
46
48
|
contract
|
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
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@apollo/rover",
|
3
|
-
"version": "0.26.0
|
3
|
+
"version": "0.26.0",
|
4
4
|
"description": "The new Apollo CLI",
|
5
5
|
"main": "index.js",
|
6
6
|
"bin": {
|
@@ -47,7 +47,7 @@
|
|
47
47
|
"devDependencies": {
|
48
48
|
"prettier": "3.3.3",
|
49
49
|
"jest": "29.7.0",
|
50
|
-
"axios-mock-adapter": "
|
50
|
+
"axios-mock-adapter": "2.0.0",
|
51
51
|
"jest-junit": "16.0.0"
|
52
52
|
}
|
53
53
|
}
|