Skip to content

Commit

Permalink
Bump @oclif/core and update CLI installation script (#292)
Browse files Browse the repository at this point in the history
* Bump @oclif/core

* Update CLI installation script
  • Loading branch information
kamilkisiela authored Aug 16, 2022
1 parent 5b7e079 commit efb03e1
Show file tree
Hide file tree
Showing 7 changed files with 189 additions and 31 deletions.
5 changes: 5 additions & 0 deletions .changeset/new-ears-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-hive/cli': patch
---

Bump @oclif/core dependency range to ^1.13.10
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ __generated__/
# test fixtures
integration-tests/fixtures/init-invalid-schema.graphql
/target
tmp
20 changes: 19 additions & 1 deletion packages/libraries/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $ npm install -g @graphql-hive/cli
$ hive COMMAND
running command...
$ hive (--version)
@graphql-hive/cli/0.14.0 darwin-arm64 node-v16.15.0
@graphql-hive/cli/0.18.1 darwin-arm64 node-v16.15.0
$ hive --help [COMMAND]
USAGE
$ hive COMMAND
Expand Down Expand Up @@ -63,6 +63,8 @@ DESCRIPTION
deletes specific cli configuration
```

_See code: [dist/commands/config/delete.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.18.1/dist/commands/config/delete.js)_

## `hive config:get KEY`

prints specific cli configuration
Expand All @@ -78,6 +80,8 @@ DESCRIPTION
prints specific cli configuration
```

_See code: [dist/commands/config/get.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.18.1/dist/commands/config/get.js)_

## `hive config:reset`

resets local cli configuration
Expand All @@ -90,6 +94,8 @@ DESCRIPTION
resets local cli configuration
```

_See code: [dist/commands/config/reset.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.18.1/dist/commands/config/reset.js)_

## `hive config:set KEY VALUE`

updates specific cli configuration
Expand All @@ -106,6 +112,8 @@ DESCRIPTION
updates specific cli configuration
```

_See code: [dist/commands/config/set.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.18.1/dist/commands/config/set.js)_

## `hive help [COMMAND]`

Display help for hive.
Expand Down Expand Up @@ -146,6 +154,8 @@ DESCRIPTION
checks operations against a published schema
```

_See code: [dist/commands/operations/check.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.18.1/dist/commands/operations/check.js)_

## `hive operations:publish FILE`

saves operations to the store
Expand All @@ -167,6 +177,8 @@ DESCRIPTION
saves operations to the store
```

_See code: [dist/commands/operations/publish.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.18.1/dist/commands/operations/publish.js)_

## `hive schema:check FILE`

checks schema
Expand All @@ -192,6 +204,8 @@ DESCRIPTION
checks schema
```

_See code: [dist/commands/schema/check.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.18.1/dist/commands/schema/check.js)_

## `hive schema:publish FILE`

publishes schema
Expand Down Expand Up @@ -222,6 +236,8 @@ DESCRIPTION
publishes schema
```

_See code: [dist/commands/schema/publish.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.18.1/dist/commands/schema/publish.js)_

## `hive update [CHANNEL]`

update the hive CLI
Expand Down Expand Up @@ -275,6 +291,8 @@ DESCRIPTION
checks schema
```

_See code: [dist/commands/whoami.js](https://github.com/kamilkisiela/graphql-hive/blob/v0.18.1/dist/commands/whoami.js)_

<!-- commandsstop -->

<!-- config -->
Expand Down
4 changes: 2 additions & 2 deletions packages/libraries/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@graphql-tools/url-loader": "~7.9.15",
"@graphql-tools/load": "~7.5.10",
"@graphql-tools/utils": "8.2.4",
"@oclif/core": "^1.7.0",
"@oclif/core": "^1.13.10",
"@oclif/plugin-help": "5.1.12",
"@oclif/plugin-update": "3.0.0",
"colors": "1.4.0",
Expand All @@ -61,7 +61,7 @@
"ts-node": "10.7.0"
},
"devDependencies": {
"oclif": "^3.0.1",
"oclif": "^3.1.2",
"@types/env-ci": "3.1.1",
"@types/git-parse": "2.1.2",
"@types/mkdirp": "1.0.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/libraries/client/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = '0.18.1';
export const version = '0.18.2';
33 changes: 24 additions & 9 deletions packages/web/landing-page/public/install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
#!/bin/bash
{
set -e
bash << SCRIPT
SUDO=''
if [ "$(id -u)" != "0" ]; then
SUDO='sudo'
echo "This script requires superuser access."
echo "You will be prompted for your password by sudo."
# clear any previous sudo permission
sudo -k
fi

# run inside sudo
$SUDO bash << SCRIPT
set -e
echoerr() { echo "\$@" 1>&2; }
Expand Down Expand Up @@ -33,26 +43,31 @@
mkdir -p /usr/local/lib
cd /usr/local/lib
rm -rf hive
rm -rf ~/.local/share/hive
URL=https://graphql-hive-cli.s3.us-east-2.amazonaws.com/channels/stable/hive-\$OS-\$ARCH.tar.gz
TAR_ARGS="xz"
rm -rf ~/.local/share/hive/client
if [ \$(command -v xz) ]; then
URL=https://graphql-hive-cli.s3.us-east-2.amazonaws.com/channels/stable/hive-\$OS-\$ARCH.tar.gz
TAR_ARGS="xJ"
else
URL=https://graphql-hive-cli.s3.us-east-2.amazonaws.com/channels/stable/hive-\$OS-\$ARCH.tar.gz
TAR_ARGS="xz"
fi
echo "Installing CLI from \$URL"
if [ \$(command -v curl) ]; then
curl "\$URL" | tar "\$TAR_ARGS"
else
wget -O- "\$URL" | tar "\$TAR_ARGS"
fi
# delete old hive bin if exists
rm -f \$(command -v hive) || true
rm -f /usr/local/bin/hive
ln -s /usr/local/lib/hive/bin/hive /usr/local/bin/hive
# on alpine (and maybe others) the basic node binary does not work
# remove our node binary and fall back to whatever node is on the PATH
/usr/local/lib/hive/bin/node -v || rm /usr/local/lib/hive/bin/node
SCRIPT
LOCATION=$(command -v hive)
echo "GraphQL Hive installed to $LOCATION"
echo "GraphQL Hive CLI installed to $LOCATION"
hive --version
}
Loading

0 comments on commit efb03e1

Please sign in to comment.