Skip to content

Commit 44b80b2

Browse files
authored
Upgrade to Oclif v3 (#4807)
1 parent 3d339e6 commit 44b80b2

15 files changed

+1110
-2504
lines changed

.changeset/config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"access": "restricted",
77
"baseBranch": "main",
88
"updateInternalDependencies": "patch",
9-
"ignore": ["@hive/*", "integration-tests"],
9+
"ignore": ["@hive/*", "integration-tests", "eslint-plugin-hive"],
1010
"snapshot": {
1111
"useCalculatedVersion": true,
1212
"prereleaseTemplate": "{tag}-{datetime}-{commit}"

.changeset/eighty-shrimps-scream.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-hive/cli": minor
3+
---
4+
5+
Upgrade to Oclif v3

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,16 @@
116116
"patchedDependencies": {
117117
"@theguild/[email protected]": "patches/@[email protected]",
118118
119-
120119
"@apollo/[email protected]": "patches/@[email protected]",
121120
"@theguild/[email protected]": "patches/@[email protected]",
122121
123-
"@oclif/[email protected]": "patches/@[email protected]",
124122
"@graphql-eslint/[email protected]": "patches/@[email protected]",
125123
126124
"@graphiql/[email protected]": "patches/@[email protected]",
127125
128-
126+
127+
"@oclif/[email protected]": "patches/@[email protected]",
128+
129129
}
130130
}
131131
}

packages/libraries/cli/README.md

+31-26
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ curl -sSL https://graphql-hive.com/install.sh | sh
4040
- [`hive config:reset`](#hive-configreset)
4141
- [`hive config:set KEY VALUE`](#hive-configset-key-value)
4242
- [`hive dev`](#hive-dev)
43-
- [`hive help [COMMANDS]`](#hive-help-commands)
43+
- [`hive help [COMMAND]`](#hive-help-command)
4444
- [`hive introspect LOCATION`](#hive-introspect-location)
4545
- [`hive operations:check FILE`](#hive-operationscheck-file)
4646
- [`hive schema:check FILE`](#hive-schemacheck-file)
@@ -71,7 +71,7 @@ DESCRIPTION
7171
```
7272

7373
_See code:
74-
[dist/commands/artifact/fetch.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.34.1/dist/commands/artifact/fetch.js)_
74+
[dist/commands/artifact/fetch.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.37.0/dist/commands/artifact/fetch.js)_
7575

7676
## `hive config:delete KEY`
7777

@@ -89,7 +89,7 @@ DESCRIPTION
8989
```
9090

9191
_See code:
92-
[dist/commands/config/delete.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.34.1/dist/commands/config/delete.js)_
92+
[dist/commands/config/delete.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.37.0/dist/commands/config/delete.js)_
9393

9494
## `hive config:get KEY`
9595

@@ -107,7 +107,7 @@ DESCRIPTION
107107
```
108108

109109
_See code:
110-
[dist/commands/config/get.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.34.1/dist/commands/config/get.js)_
110+
[dist/commands/config/get.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.37.0/dist/commands/config/get.js)_
111111

112112
## `hive config:reset`
113113

@@ -122,7 +122,7 @@ DESCRIPTION
122122
```
123123

124124
_See code:
125-
[dist/commands/config/reset.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.34.1/dist/commands/config/reset.js)_
125+
[dist/commands/config/reset.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.37.0/dist/commands/config/reset.js)_
126126

127127
## `hive config:set KEY VALUE`
128128

@@ -141,44 +141,49 @@ DESCRIPTION
141141
```
142142

143143
_See code:
144-
[dist/commands/config/set.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.34.1/dist/commands/config/set.js)_
144+
[dist/commands/config/set.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.37.0/dist/commands/config/set.js)_
145145

146146
## `hive dev`
147147

148-
develop and compose Supergraph with service substitution (only available for Federation projects)
148+
Develop and compose Supergraph with service substitution
149149

150150
```
151151
USAGE
152-
$ hive dev (--url <value> --service <value>) [--registry.endpoint <value>] [--registry.accessToken
153-
<value>] [--schema <value> ] [--watch] [--watchInterval <value>] [--write <value>]
152+
$ hive dev (--url <value> --service <value>) [--registry.endpoint <value>] [--registry <value>]
153+
[--registry.accessToken <value>] [--token <value>] [--schema <value> ] [--watch] [--watchInterval <value>] [--write
154+
<value>]
154155
155156
FLAGS
157+
--registry=<value> registry address
156158
--registry.accessToken=<value> registry access token
157159
--registry.endpoint=<value> registry endpoint
158160
--schema=<filepath>... Service sdl. If not provided, will be introspected from the service
159161
--service=<string>... (required) Service name
162+
--token=<value> api token
160163
--url=<address>... (required) Service url
161164
--watch Watch mode
162165
--watchInterval=<value> [default: 1000] Watch interval in milliseconds
163166
--write=<value> [default: supergraph.graphql] Where to save the supergraph schema file
164167
165168
DESCRIPTION
166-
develop and compose Supergraph with service substitution (only available for Federation projects)
169+
Develop and compose Supergraph with service substitution
170+
Only available for Federation projects.
171+
Work in Progress: Please note that this command is still under development and may undergo changes in future releases
167172
```
168173

169174
_See code:
170-
[dist/commands/dev.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.34.1/dist/commands/dev.js)_
175+
[dist/commands/dev.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.37.0/dist/commands/dev.js)_
171176

172-
## `hive help [COMMANDS]`
177+
## `hive help [COMMAND]`
173178

174179
Display help for hive.
175180

176181
```
177182
USAGE
178-
$ hive help [COMMANDS] [-n]
183+
$ hive help [COMMAND...] [-n]
179184
180185
ARGUMENTS
181-
COMMANDS Command to show help for.
186+
COMMAND... Command to show help for.
182187
183188
FLAGS
184189
-n, --nested-commands Include all nested commands in the output.
@@ -188,7 +193,7 @@ DESCRIPTION
188193
```
189194

190195
_See code:
191-
[@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.20/src/commands/help.ts)_
196+
[@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.0.22/src/commands/help.ts)_
192197

193198
## `hive introspect LOCATION`
194199

@@ -210,7 +215,7 @@ DESCRIPTION
210215
```
211216

212217
_See code:
213-
[dist/commands/introspect.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.34.1/dist/commands/introspect.js)_
218+
[dist/commands/introspect.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.37.0/dist/commands/introspect.js)_
214219

215220
## `hive operations:check FILE`
216221

@@ -260,7 +265,7 @@ DESCRIPTION
260265
```
261266

262267
_See code:
263-
[dist/commands/operations/check.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.34.1/dist/commands/operations/check.js)_
268+
[dist/commands/operations/check.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.37.0/dist/commands/operations/check.js)_
264269

265270
## `hive schema:check FILE`
266271

@@ -294,7 +299,7 @@ DESCRIPTION
294299
```
295300

296301
_See code:
297-
[dist/commands/schema/check.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.34.1/dist/commands/schema/check.js)_
302+
[dist/commands/schema/check.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.37.0/dist/commands/schema/check.js)_
298303

299304
## `hive schema:delete SERVICE`
300305

@@ -321,7 +326,7 @@ DESCRIPTION
321326
```
322327

323328
_See code:
324-
[dist/commands/schema/delete.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.34.1/dist/commands/schema/delete.js)_
329+
[dist/commands/schema/delete.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.37.0/dist/commands/schema/delete.js)_
325330

326331
## `hive schema:fetch ACTIONID`
327332

@@ -349,7 +354,7 @@ DESCRIPTION
349354
```
350355

351356
_See code:
352-
[dist/commands/schema/fetch.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.34.1/dist/commands/schema/fetch.js)_
357+
[dist/commands/schema/fetch.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.37.0/dist/commands/schema/fetch.js)_
353358

354359
## `hive schema:publish FILE`
355360

@@ -387,21 +392,21 @@ DESCRIPTION
387392
```
388393

389394
_See code:
390-
[dist/commands/schema/publish.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.34.1/dist/commands/schema/publish.js)_
395+
[dist/commands/schema/publish.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.37.0/dist/commands/schema/publish.js)_
391396

392397
## `hive update [CHANNEL]`
393398

394399
update the hive CLI
395400

396401
```
397402
USAGE
398-
$ hive update [CHANNEL] [-a] [-v <value> | -i] [--force]
403+
$ hive update [CHANNEL] [-a] [--force] [-i | -v <value>]
399404
400405
FLAGS
401-
-a, --available Install a specific version.
406+
-a, --available See available versions.
402407
-i, --interactive Interactively select version to install. This is ignored if a channel is provided.
403408
-v, --version=<value> Install a specific version.
404-
--force Force a re-download of the requested version.
409+
--force Force a re-download of the requested version.
405410
406411
DESCRIPTION
407412
update the hive CLI
@@ -425,7 +430,7 @@ EXAMPLES
425430
```
426431

427432
_See code:
428-
[@oclif/plugin-update](https://github.com/oclif/plugin-update/blob/v3.2.4/src/commands/update.ts)_
433+
[@oclif/plugin-update](https://github.com/oclif/plugin-update/blob/v4.2.13/src/commands/update.ts)_
429434

430435
## `hive whoami`
431436

@@ -447,7 +452,7 @@ DESCRIPTION
447452
```
448453

449454
_See code:
450-
[dist/commands/whoami.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.34.1/dist/commands/whoami.js)_
455+
[dist/commands/whoami.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.37.0/dist/commands/whoami.js)_
451456

452457
<!-- commandsstop -->
453458

packages/libraries/cli/bin/dev

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
#!/usr/bin/env node
1+
#!/usr/bin/env tsx
22

33
const oclif = require('@oclif/core');
44

5-
const path = require('path');
6-
const project = path.join(__dirname, '..', 'tsconfig.json');
7-
85
// In dev mode -> use ts-node and dev plugins
96
process.env.NODE_ENV = 'development';
107

11-
require('ts-node').register({ project });
12-
138
// In dev mode, always show stack traces
149
oclif.settings.debug = true;
1510

1611
// Start the CLI
17-
oclif.run().then(oclif.flush).catch(oclif.Errors.handle);
12+
oclif
13+
.execute({ development: true, dir: __dirname })
14+
.catch(e => {
15+
throw e;
16+
})
17+
.then(() => {});

packages/libraries/cli/bin/run

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/usr/bin/env node
22

3-
require('@oclif/core')
4-
.run()
5-
.then(require('@oclif/core/flush'))
6-
.catch(require('@oclif/core/handle'));
3+
const oclif = require('@oclif/core');
4+
5+
oclif
6+
.execute({ dir: __dirname })
7+
.catch(e => {
8+
throw e;
9+
})
10+
.then(() => {});

packages/libraries/cli/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
"@graphql-tools/url-loader": "~8.0.0",
5555
"@graphql-tools/utils": "10.2.0",
5656
"@graphql-typed-document-node/core": "3.2.0",
57-
"@oclif/core": "^2.8.5",
58-
"@oclif/plugin-help": "5.2.20",
59-
"@oclif/plugin-update": "3.2.4",
57+
"@oclif/core": "^3.26.6",
58+
"@oclif/plugin-help": "6.0.22",
59+
"@oclif/plugin-update": "4.2.13",
6060
"@whatwg-node/fetch": "0.9.17",
6161
"colors": "1.4.0",
6262
"env-ci": "7.3.0",
@@ -70,9 +70,9 @@
7070
"@types/env-ci": "3.1.4",
7171
"@types/mkdirp": "2.0.0",
7272
"graphql": "16.8.1",
73-
"oclif": "3.17.2",
73+
"oclif": "4.11.0",
7474
"rimraf": "4.4.1",
75-
"ts-node": "10.9.2"
75+
"tsx": "4.10.5"
7676
},
7777
"publishConfig": {
7878
"registry": "https://registry.npmjs.org",

0 commit comments

Comments
 (0)