这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
271 commits
Select commit Hold shift + click to select a range
1577f7d
handle type removal elegantly
Oct 30, 2019
02d32f5
handle type removal elegantly in modify
Oct 30, 2019
a0acec0
fix modify overlapping types bug
Nov 1, 2019
82d4f20
handle cloning enums from Hasura
Nov 4, 2019
7c7d972
action rels v1
rikinsk Nov 8, 2019
e070893
create actions and types through SDL
Nov 8, 2019
a7cd206
minor restructure
Nov 8, 2019
0c3f60f
modify action using sdl
Nov 8, 2019
4d4d1b5
merge with wawhal:console-actions
Nov 8, 2019
0837ff3
clone type functionality
Nov 11, 2019
6918160
type management init
Nov 11, 2019
b0d93b0
add a reset button to types editor
Nov 11, 2019
3b984be
show actions types; show warning if a type is being modified
Nov 12, 2019
241e0df
fix a bug where relationships got deleted on modifyin types
Nov 13, 2019
5712082
Merge branch 'master' of github.com:hasura/graphql-engine into consol…
Nov 13, 2019
149c527
maintain relationships while modifying types
Nov 14, 2019
280e55e
remove unwanted script from localdev html
Nov 14, 2019
d05a075
fix accessing relationships for new types
Nov 15, 2019
4c1e7af
set timer and ast in redux state
Nov 19, 2019
8cf97ba
Merge branch 'master' of github.com:hasura/graphql-engine into consol…
Dec 11, 2019
9bdd042
add UI for actions permissions (#8)
wawhal Dec 11, 2019
17eebb7
Add scaffolder CLI to graphql engine repo
Dec 16, 2019
0dc6edb
update to SDL API to accept a list of actions, custom types and derive
Dec 24, 2019
86790a8
update the from-SDL api to accept a single SDL and return types and l…
Dec 24, 2019
f316361
update tests, compare values
Dec 24, 2019
79b6d9f
WIP: cli
arvi3411301 Dec 25, 2019
1026829
update templaters in community repo
Dec 25, 2019
1fcfd95
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
Dec 25, 2019
64aa528
fix declaration bug in typescript-express scaffold
Dec 25, 2019
da1f248
WIP
arvi3411301 Dec 25, 2019
37a0562
update scaffolds API
Dec 25, 2019
272f878
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
Dec 25, 2019
f2d0f11
WIP
arvi3411301 Dec 25, 2019
a51071a
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
arvi3411301 Dec 25, 2019
c087a4c
fix remote scaffolder path
Dec 25, 2019
c8bb2f0
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
Dec 25, 2019
d6f1fd3
fix a bug in templater, add tmptests to gitignore
Dec 25, 2019
6398e39
send derive payload with scaffold query; add scaffolder config in con…
Dec 25, 2019
4124f29
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
Dec 25, 2019
6195aa2
add scaffolder for typescript-zeit
Dec 25, 2019
7127670
fix a bug where derive mutation was forced
Dec 25, 2019
de2d3de
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
Dec 25, 2019
b46a416
allow multiple fields in mutation root
Dec 27, 2019
0e023c9
type Mutation -> extend type Mutation
Dec 27, 2019
a55ce87
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
Dec 27, 2019
62c6348
make scaffold handlers async
Dec 27, 2019
cb3d816
webhook -> handler; preserve description in SDL transformations
Dec 27, 2019
e71d57f
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
Dec 27, 2019
ec16a27
implement the update action API in console
Dec 27, 2019
770e5a7
add webhook error examples to scaffold
Dec 27, 2019
44ad6e9
WIP
arvi3411301 Dec 27, 2019
2cd02a4
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
arvi3411301 Dec 27, 2019
b9d5e1f
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
Jan 3, 2020
b0eeac4
add version command and version utils
Jan 3, 2020
6143825
scaffold -> actinos-codegen
Jan 8, 2020
f0f9e44
conform to the new config format
Jan 8, 2020
8d0c907
scaffolder-cli -> extension-cli
Jan 8, 2020
f112650
log output to a file
Jan 9, 2020
258f921
WIP: cli plugins
arvi3411301 Jan 9, 2020
363148d
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
arvi3411301 Jan 9, 2020
ce2b499
fix plugin search function
arvi3411301 Jan 9, 2020
d5093f0
added plugin handler to root command
arvi3411301 Jan 9, 2020
228a142
fix plugins list command
arvi3411301 Jan 9, 2020
64d8532
conform to new codegen API, new config.yaml format
Jan 9, 2020
d17d1cb
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
Jan 9, 2020
40b77f3
WIP
arvi3411301 Jan 9, 2020
42a1dad
add hidden field for plugins
arvi3411301 Jan 9, 2020
b8844ff
move cli-ext plugin check to console and action create commands
arvi3411301 Jan 9, 2020
02dcd47
WIP
arvi3411301 Jan 9, 2020
df4bf05
WIP
arvi3411301 Jan 9, 2020
2990df1
fix codegen config bugs; import templater dependencies
Jan 10, 2020
415536b
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
Jan 10, 2020
2296e49
send codegen config appropriately
Jan 10, 2020
ab6c9aa
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
Jan 10, 2020
b722bc9
added plugins git
arvi3411301 Jan 10, 2020
15376e1
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
arvi3411301 Jan 10, 2020
c14c631
add actions codegen command
Jan 13, 2020
6cc6463
refactor cli config
arvi3411301 Jan 13, 2020
30b1462
added template flag to init command
arvi3411301 Jan 13, 2020
0570caa
allow codegen for multiple actions
Jan 13, 2020
be66e4a
merge with remote
Jan 13, 2020
064cf30
treat custom type kinds as nullable in the server response
Jan 14, 2020
f4b0a02
fix a bug where function def got printed
Jan 14, 2020
c2e6e6e
action use codegen command wip
Jan 14, 2020
cdfca34
add confirmation for codegen
Jan 14, 2020
5a732fa
added update script command
arvi3411301 Jan 14, 2020
b527cec
change template to install-manifest flag in init command
arvi3411301 Jan 15, 2020
672d49f
create metadata files on init command
arvi3411301 Jan 15, 2020
1841fd4
hasura actions use-codegen
Jan 15, 2020
e1a8b7e
merge with remote
Jan 15, 2020
7f29696
fix indentation
Jan 15, 2020
bd8e770
refactor
arvi3411301 Jan 15, 2020
311f83a
fix conflicts
arvi3411301 Jan 15, 2020
d7c3816
remove Gopkg.*
arvi3411301 Jan 15, 2020
59a4d60
write errors to stdout
Jan 15, 2020
3d8e56d
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
Jan 15, 2020
aa9d4e5
send codegen uri to cli-ext; handle enum types
Jan 15, 2020
635983e
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
Jan 15, 2020
91c20e5
add spinners for async actions
Jan 15, 2020
22f82a3
fix a stuck spinner bug
Jan 15, 2020
f5caa8a
add version check on actions metadata plugin for export
arvi3411301 Jan 15, 2020
c3f973b
show warning message in case action files exists
arvi3411301 Jan 15, 2020
4fb77ae
move cli-ext plugin check to actions plugin
arvi3411301 Jan 15, 2020
818dd7e
update error message for metadata apply and export
arvi3411301 Jan 15, 2020
92c0617
prepare plugins index on cobra init
Jan 16, 2020
8599bbb
Merge branch 'master' of github.com:hasura/graphql-engine into action…
Jan 16, 2020
9cdb397
handle empty sdl value
Jan 17, 2020
e2a64f2
fix init copy method
arvi3411301 Jan 17, 2020
f927376
implement derive mutation; fix basic tests
Jan 17, 2020
b370515
throw error if the given mutation does not have variables
Jan 20, 2020
d1be3dc
handle unhandled custom scalars while deriving output type
Jan 21, 2020
4bf5b28
Merge branch 'master' into actions-scaffolder-cli
arvi3411301 Jan 22, 2020
2251251
move dependencies outside codegen
Jan 23, 2020
bbd2a77
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
Jan 23, 2020
e4cc86e
setup cli-ext job
arvi3411301 Jan 23, 2020
20635db
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
arvi3411301 Jan 23, 2020
61cb1ff
change derive-from-mutation flag to derive-from
arvi3411301 Jan 24, 2020
2eddb4d
refactor use_codegen
arvi3411301 Jan 24, 2020
8867d5b
add pkg to dev dependencies
Jan 24, 2020
57bbf19
add input-file flag to cli-ext call
arvi3411301 Jan 24, 2020
b0a4dcd
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
Jan 27, 2020
469f727
read CLI input from a file
Jan 27, 2020
140de8f
refactor plugins
arvi3411301 Jan 27, 2020
bb9bad9
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
arvi3411301 Jan 27, 2020
f30f196
remove pkg from dev dependencies
Jan 27, 2020
eb26f05
fix typo
Jan 27, 2020
6dab179
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
arvi3411301 Jan 27, 2020
298cef6
create action files only in create method
arvi3411301 Jan 27, 2020
befc339
add kind and webhook flag in actions create command
arvi3411301 Jan 27, 2020
2ac1edb
make migrations directory configurable in config
arvi3411301 Jan 27, 2020
eeb5941
rollback on update script
arvi3411301 Jan 27, 2020
f77f636
fix actions create logic
arvi3411301 Jan 27, 2020
dd4e547
throw error if action already exists
arvi3411301 Jan 27, 2020
e7d5a0e
allow manifest-file flag in plugin install command
arvi3411301 Jan 28, 2020
5371d91
display version in plugin list
arvi3411301 Jan 28, 2020
dbdf553
create metadata files after export method
arvi3411301 Jan 28, 2020
2b12574
preserve metadata export order
arvi3411301 Jan 28, 2020
3eca8d3
remove default metadata directory from viper
arvi3411301 Jan 28, 2020
a0aba7e
add logrus hook to stop and start spinner on logging
arvi3411301 Jan 29, 2020
c4c36fc
update spinner
arvi3411301 Jan 29, 2020
c22c440
change derive payload
Jan 29, 2020
bad3829
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
Jan 29, 2020
37ae9b9
change derive type
arvi3411301 Jan 29, 2020
068232a
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
arvi3411301 Jan 29, 2020
a062521
bug fixes
arvi3411301 Jan 29, 2020
31894a7
add debug logs for cli-ext stdout
arvi3411301 Jan 30, 2020
96ddfec
add default editor and shell in actions editor
arvi3411301 Feb 2, 2020
31500b7
fix actions debug logs
arvi3411301 Feb 2, 2020
f0ec10a
fix ordering of config.yam,l
arvi3411301 Feb 3, 2020
1297411
update codegen repo; read from frameworks.json in actions-use-codegen
Feb 4, 2020
783044a
pull console code from wawhal/console-actions-build
Feb 4, 2020
f49812b
share derive mutation logic with console
Feb 4, 2020
b32b6e9
update metadata diff to scan metadata directory
arvi3411301 Feb 5, 2020
5e62ce4
Merge branch 'actions-scaffolder-cli' of github.com:hasura/graphql-en…
arvi3411301 Feb 5, 2020
568bb71
fix action field ordering
arvi3411301 Feb 6, 2020
f1ae629
add derive-from flag in codegen command
arvi3411301 Feb 6, 2020
5d7f49e
remove empty array in metadata diff
arvi3411301 Feb 6, 2020
6755dae
merge with remote
Feb 7, 2020
f637a5a
merge with remote
Feb 7, 2020
e7c84d3
do not send type/field description if undefined
Feb 7, 2020
be0133a
fix merge conflicts
arvi3411301 Feb 7, 2020
40dd14d
fix merge conflicts
arvi3411301 Feb 7, 2020
20e0af3
add integration test
arvi3411301 Feb 12, 2020
344f8af
remove migrate test
arvi3411301 Feb 13, 2020
6af9ece
add basic migrate test
arvi3411301 Feb 13, 2020
e3d1056
remove migrate file source benchmark
arvi3411301 Feb 13, 2020
cf50572
update workflow
arvi3411301 Feb 13, 2020
59dc20f
update console builder
arvi3411301 Feb 13, 2020
a6273e0
update bucket url for dev
arvi3411301 Feb 13, 2020
c6d8e27
remove spce
arvi3411301 Feb 13, 2020
66841e6
update cliext cache
arvi3411301 Feb 13, 2020
7ca3bd7
remove reset method in migrate
arvi3411301 Feb 13, 2020
70f2721
update cli tests
arvi3411301 Feb 13, 2020
decedbe
move plugin install after validate test
arvi3411301 Feb 13, 2020
f9aca69
fix test
arvi3411301 Feb 13, 2020
9af7745
fix plugins install test
arvi3411301 Feb 13, 2020
4ae9209
fix cli test
arvi3411301 Feb 13, 2020
9968e6d
fix latest release test
arvi3411301 Feb 13, 2020
cd355e6
add TEST_TAGS to last_release test
arvi3411301 Feb 13, 2020
d78bdd5
fix v2 config test
arvi3411301 Feb 13, 2020
87ed5a2
Merge branch 'master' into actions-scaffolder-cli
arvi3411301 Feb 13, 2020
5c2da8a
fix cli console test
arvi3411301 Feb 13, 2020
ea0739c
fix cli console test
arvi3411301 Feb 13, 2020
581ae31
fix metadata test
arvi3411301 Feb 14, 2020
1b69610
fix test
arvi3411301 Feb 14, 2020
e16d38a
fix makefile
arvi3411301 Feb 14, 2020
cf04b8d
change derive-from-mutation -> derive-from-operation
Feb 14, 2020
ff2bee3
Merge branch 'actions-scaffolder-cli' of github.com:arvi3411301/graph…
Feb 14, 2020
250d4e3
move ensureCLIExtension in actions config
arvi3411301 Feb 14, 2020
a3549d8
fix merge conflicts
arvi3411301 Feb 14, 2020
516dc07
update index on plugins install command
arvi3411301 Feb 14, 2020
710fc58
review comments fixes
arvi3411301 Feb 17, 2020
c8b3254
fix review comments
arvi3411301 Feb 18, 2020
64f0347
remove plugin update cmd and add a flag to update index in list command
arvi3411301 Feb 18, 2020
8be48a3
hide dev flag in plugins install command
arvi3411301 Feb 18, 2020
635b8c4
change single file metadata package name to singleFileMetadata
arvi3411301 Feb 18, 2020
53fa2ff
rename setmetadataplugins function
arvi3411301 Feb 18, 2020
a29e2a6
update info msg
arvi3411301 Feb 18, 2020
9c59173
refactor actions codegen command
arvi3411301 Feb 18, 2020
79ba649
refactor actions create command
arvi3411301 Feb 18, 2020
c3d3507
remove override options from actions create and use bindflag
arvi3411301 Feb 18, 2020
3021a29
fix actions create
arvi3411301 Feb 18, 2020
114becb
dont log when null logger is set
arvi3411301 Feb 18, 2020
f81bf98
refactor actions
arvi3411301 Feb 18, 2020
8d57840
update help for commands and flags
arvi3411301 Feb 18, 2020
1afe94b
use ioutil discard instead of fake writer
arvi3411301 Feb 18, 2020
42176a9
move cli extension interaction to another package
arvi3411301 Feb 18, 2020
a3bcf53
use global viper
arvi3411301 Feb 18, 2020
5eb72df
use iota for config version
arvi3411301 Feb 18, 2020
a72a11d
Merge branch 'master' into actions-scaffolder-cli
arvi3411301 Feb 18, 2020
e03ec56
fix actions version check
arvi3411301 Feb 19, 2020
86581db
use master console
arvi3411301 Feb 19, 2020
7858fd2
fix merge conflict
arvi3411301 Feb 19, 2020
88c8419
handle migrations in update script
arvi3411301 Feb 19, 2020
fa89465
fix test
arvi3411301 Feb 19, 2020
6f2b9ae
handle only sql in migrate v2
arvi3411301 Feb 19, 2020
e1d386b
Use global viper in `actions` subcommands (#6)
scriptonist Feb 19, 2020
089b06c
refactor
arvi3411301 Feb 19, 2020
543d5a9
remove println
arvi3411301 Feb 19, 2020
ee72e41
fix test
arvi3411301 Feb 19, 2020
113d909
add k8s copyright
arvi3411301 Feb 19, 2020
a9efeb0
add k8s copyright
arvi3411301 Feb 19, 2020
d441aa9
Merge branch 'master' into actions-scaffolder-cli
ecthiender Feb 19, 2020
b22c63a
add missing items in the donwgradeShortcuts mapping
ecthiender Feb 19, 2020
8e44999
Merge branch 'actions-scaffolder-cli' of github.com:arvi3411301/graph…
ecthiender Feb 19, 2020
ef3ace3
fix wrong repo variable
arvi3411301 Feb 20, 2020
8df13a6
Merge branch 'actions-scaffolder-cli' of github.com:arvi3411301/graph…
arvi3411301 Feb 20, 2020
46a23cf
clean error before throwing; update test payload
Feb 20, 2020
75356c6
respect migrations_directory in config
arvi3411301 Feb 20, 2020
23e7cdc
update example in actions create command
arvi3411301 Feb 20, 2020
3238eef
update example of actions create command
arvi3411301 Feb 20, 2020
02a08cf
update cli-ext dockerfile
arvi3411301 Feb 20, 2020
ba9f9e4
stop spinner
arvi3411301 Feb 20, 2020
c4fe749
handle version 1 in migrate api
arvi3411301 Feb 20, 2020
2a99583
add fix (#8)
scriptonist Feb 20, 2020
004d446
revert console changes
rikinsk Feb 21, 2020
597c6d8
Merge branch 'master' into actions-scaffolder-cli
shahidhk Feb 24, 2020
42dbb67
rename extension-cli to cli-ext
arvi3411301 Feb 24, 2020
f24c2de
change help text etc
shahidhk Feb 24, 2020
ea5e8fe
Merge branch 'actions-scaffolder-cli' of github.com:arvi3411301/graph…
shahidhk Feb 24, 2020
4ac6b8c
case change
shahidhk Feb 24, 2020
bb35a61
change actions version
shahidhk Feb 24, 2020
69f16c3
update cli plugins repo
arvi3411301 Feb 24, 2020
ef37813
Merge branch 'actions-scaffolder-cli' of github.com:arvi3411301/graph…
arvi3411301 Feb 24, 2020
4b6eda2
Delete .gitattributes
shahidhk Feb 24, 2020
863a766
revert init.hs
shahidhk Feb 24, 2020
176e13c
Merge branch 'actions-scaffolder-cli' of github.com:arvi3411301/graph…
shahidhk Feb 24, 2020
d936d1f
git export
shahidhk Feb 24, 2020
915ed74
reset init.hs
shahidhk Feb 24, 2020
19435b0
Merge branch 'master' into actions-scaffolder-cli
shahidhk Feb 24, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 49 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,45 @@ jobs:
root: /build
paths:
- _cli_output

test_and_build_cli_ext:
docker:
- image: hasura/graphql-engine-extension-cli-builder:20200220
working_directory: ~/graphql-engine
steps:
- attach_workspace:
at: /build
- *skip_job_on_ciignore
- checkout
- restore_cache:
key:
cli-ext-npm-cache-v1-{{ checksum "cli-ext/package.json" }}-{{ checksum "cli-ext/package-lock.json" }}
- run:
name: install dependencies
working_directory: cli-ext
command: make ci-deps
- save_cache:
key:
cli-ext-npm-cache-v1-{{ checksum "cli-ext/package.json" }}-{{ checksum "cli-ext/package-lock.json" }}
paths:
- cli-ext/node_modules
- ~/.npm
- ~/.cache
- run:
name: build extension cli
working_directory: cli-ext
command: |
npm install -g pkg
npm run build
make deploy
make ci-copy-assets
- store_artifacts:
path: /build/_cli_ext_output
destination: cli_ext
- persist_to_workspace:
root: /build
paths:
- _cli_ext_output

# build console assets
build_console:
Expand Down Expand Up @@ -493,6 +532,10 @@ workflows:
workflow_v20200120:
jobs:
- check_build_worthiness: *filter_only_vtags
- test_and_build_cli_ext:
<<: *filter_only_vtags
requires:
- check_build_worthiness
- build_console:
<<: *filter_only_vtags
requires:
Expand All @@ -501,6 +544,11 @@ workflows:
<<: *filter_only_vtags
requires:
- check_build_worthiness
- test_cli_with_last_release:
<<: *filter_only_vtags
requires:
- test_and_build_cli_ext
- check_build_worthiness
- build_image:
<<: *filter_only_vtags
requires:
Expand Down Expand Up @@ -544,13 +592,10 @@ workflows:
- test_server_pg_9.5
- server_unit_tests
- test_server_upgrade
- test_cli_with_last_release:
<<: *filter_only_vtags
requires:
- check_build_worthiness
- test_and_build_cli:
<<: *filter_only_vtags
requires:
- test_and_build_cli_ext
- build_server
- test_console:
<<: *filter_only_vtags
Expand Down
2 changes: 1 addition & 1 deletion .circleci/console-builder.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ RUN apt-get update && apt-get install -y \
&& rm -rf /usr/share/man/ \
&& rm -rf /usr/share/locale/

ENV PATH "/usr/local/google-cloud-sdk/bin:$PATH"
ENV PATH "/usr/local/google-cloud-sdk/bin:$PATH"
24 changes: 23 additions & 1 deletion .circleci/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ draft_github_release() {
-r "$CIRCLE_PROJECT_REPONAME" \
-b "${RELEASE_BODY}" \
-draft \
"$CIRCLE_TAG" /build/_cli_output/binaries/
"$CIRCLE_TAG" /build/_cli_output/binaries/ /build/_cli_ext_output/*.tar.gz /build/_cli_ext_output/*.zip
}

configure_git() {
Expand Down Expand Up @@ -95,6 +95,27 @@ deploy_console() {
unset DIST_PATH
}

deploy_cli_ext() {
echo "deploying extension cli"

cd "$ROOT/cli-ext"
export VERSION=$(../scripts/get-version.sh)
export DIST_PATH="/build/_cli_ext_output"

configure_git
git clone https://github.com/hasura/cli-plugins-index.git ~/plugins-index
cd ~/plugins-index
git checkout -b cli-ext-${LATEST_TAG}
cp ${DIST_PATH}/manifest.yaml ./plugins/cli-ext.yaml
git add .
git commit -m "update cli-ext manifest to ${LATEST_TAG}"
git push -q https://${GITHUB_TOKEN}@github.com/hasura/plugins-index.git cli-ext-${LATEST_TAG}
hub pull-request -F- <<<"Update cli-ext manifest to ${LATEST_TAG}" -r ${REVIEWERS} -a ${REVIEWERS}

unset VERSION
unset DIST_PATH
}

# build and push container for auto-migrations
build_and_push_cli_migrations_image() {
IMAGE_TAG="hasura/graphql-engine:${CIRCLE_TAG}.cli-migrations"
Expand Down Expand Up @@ -167,6 +188,7 @@ deploy_console
deploy_server
if [[ ! -z "$CIRCLE_TAG" ]]; then
build_and_push_cli_migrations_image
deploy_cli_ext

# if this is a stable release, update all latest assets
if [ $IS_STABLE_RELEASE = true ]; then
Expand Down
27 changes: 27 additions & 0 deletions .circleci/extension-cli-builder.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM node:12

ARG gcloud_version="207.0.0"

# install dependencies
RUN apt-get update && apt-get install -y \
netcat \
libpq5 \
libgtk2.0-0 \
libnotify-dev \
libgconf-2-4 \
libnss3 \
libxss1 \
libasound2 \
zip \
xvfb \
&& curl -Lo /tmp/gcloud-${gcloud_version}.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${gcloud_version}-linux-x86_64.tar.gz \
&& tar -xzf /tmp/gcloud-${gcloud_version}.tar.gz -C /usr/local \
&& /usr/local/google-cloud-sdk/install.sh \
&& apt-get -y auto-remove \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /usr/share/doc/ \
&& rm -rf /usr/share/man/ \
&& rm -rf /usr/share/locale/

ENV PATH "/usr/local/google-cloud-sdk/bin:$PATH"
4 changes: 2 additions & 2 deletions .circleci/test-cli-with-last-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ PID=$!
wait_for_port 8080

# test cli
HASURA_GRAPHQL_TEST_ENDPOINT="http://localhost:8080" make test
HASURA_GRAPHQL_TEST_ENDPOINT="http://localhost:8080" TEST_TAGS="latest_release" make test

# kill the running server
kill -s INT $PID
Expand All @@ -47,5 +47,5 @@ PID=$!
wait_for_port 8080

# test cli
HASURA_GRAPHQL_TEST_ENDPOINT="http://localhost:8080" HASURA_GRAPHQL_TEST_ADMIN_SECRET="abcd" make test
HASURA_GRAPHQL_TEST_ENDPOINT="http://localhost:8080" HASURA_GRAPHQL_TEST_ADMIN_SECRET="abcd" TEST_TAGS="latest_release" make test
kill -s INT $PID
2 changes: 1 addition & 1 deletion .circleci/test-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ PID=$!
wait_for_port 8080

# test cli
HASURA_GRAPHQL_TEST_ENDPOINT="http://localhost:8080" make test
HASURA_GRAPHQL_TEST_ENDPOINT="http://localhost:8080" TEST_TAGS="test_plugins" make test
kill -s INT $PID

# start graphql-engine with admin secret
Expand Down
4 changes: 4 additions & 0 deletions cli-ext/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
presets: ["@babel/preset-env"],
plugins: ["@babel/plugin-transform-async-to-generator"]
}
6 changes: 6 additions & 0 deletions cli-ext/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bin
build
src/shared
_tmptests
node_modules
version.json
37 changes: 37 additions & 0 deletions cli-ext/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
BUILDDIR := bin
ASSETS := $(BUILDDIR)/command-macos.tar.gz $(BUILDDIR)/command-linux.tar.gz $(BUILDDIR)/command-win.zip
CHECKSUMS := $(patsubst %,%.sha256,$(ASSETS))

COMPRESS := gzip --best -k -c

ci-deps:
if [ ! -d "node_modules" ]; then npm ci; fi

ci-copy-assets:
mkdir -p /build/_cli_ext_output
cp $(BUILDDIR)/* /build/_cli_ext_output/

.PRECIOUS: %.zip
%.zip: %.exe
cd $(BUILDDIR) && \
zip $(patsubst $(BUILDDIR)/%, %, $@) $(patsubst $(BUILDDIR)/%, %, $<)

.PRECIOUS: %.gz
%.gz: %
$(COMPRESS) "$<" > "$@"

%.tar: %
tar cf "$@" -C $(BUILDDIR) $(patsubst $(BUILDDIR)/%,%,$^)

%.sha256: %
shasum -a 256 $< > $@

.PHONY: deploy
deploy: $(CHECKSUMS)
./scripts/generate-manifest.sh && \
$(RM) $(BUILDDIR)/tmp.yaml

.PHONY: clean
clean:
$(RM) -r $(BUILDDIR)

45 changes: 45 additions & 0 deletions cli-ext/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## Building the binaries


```
npm install
npm run package
```

The binaries will be placed in the `bin` directory at root. Copy the binary to your PATH as `cli-ext`.

## API


```
scaffolder sdl to '{ "types": { "enums": [], "scalars": [], "input_objects": [ { "name": "UserInput", "fields": [ { "name": "username", "type": "String", "description": "lalz" }, { "name": "password", "type": "String!", "description": "pass" } ] } ], "objects": [ { "name": "UserInfo", "fields": [ { "name": "accessToken", "type": "String", "description": "lolz" } ] } ] } }'

```

```
scaffolder sdl from '{ "sdl": { "action": "type Mutation { actionName (arg1: SampleInput!): SampleOutput }", "types": "type SampleOutput { accessToken: String! } input SampleInput { username: String! password: String! }" }, "types": { "scalars": [], "enums": [], "input_objects": [], "objects": [] } }'
```

```
scaffolder scaffold '{ "action": { "action_name": "validatedUserInsert", "action_defn": { "kind": "synchronous", "webhook": "http://192.168.0.107:5000/actions", "arguments": [{ "name": "user", "type": "_user_insert_input!", "description": null }], "output_type": "UserInfo" } }, "types": { "enums": [{ "name": "_user_constraint", "values": [{ "value": "user_pkey", "description": null, "is_deprecated": null }], "description": null }, { "name": "_user_update_column", "values": [{ "value": "email", "description": null, "is_deprecated": null }, { "value": "id", "description": null, "is_deprecated": null }, { "value": "username", "description": null, "is_deprecated": null }], "description": null }, { "name": "_article_constraint", "values": [{ "value": "article_pkey", "description": null, "is_deprecated": null }], "description": null }, { "name": "_article_update_column", "values": [{ "value": "author_id", "description": null, "is_deprecated": null }, { "value": "content", "description": null, "is_deprecated": null }, { "value": "id", "description": null, "is_deprecated": null }, { "value": "title", "description": null, "is_deprecated": null }], "description": null }], "objects": [{ "name": "UserInfo", "fields": [{ "name": "userId", "type": "Int", "arguments": null, "description": null }, { "name": "accessToken", "type": "String", "arguments": null, "description": null }], "description": null, "relationships": [{ "name": "user", "remote_table": "user", "field_mapping": { "userId": "id" } }, { "name": "anotherrel", "remote_table": "article", "field_mapping": { "userId": "id" } }] }, { "name": "SMSInfo", "fields": [{ "name": "sms_id", "type": "String!", "arguments": null, "description": null }], "description": null, "relationships": null }], "scalars": [], "input_objects": [{ "name": "_user_insert_input", "fields": [{ "name": "articles", "type": "_article_arr_rel_insert_input", "description": null }, { "name": "email", "type": "String", "description": null }, { "name": "id", "type": "Int", "description": null }, { "name": "username", "type": "String", "description": null }], "description": null }, { "name": "_article_arr_rel_insert_input", "fields": [{ "name": "data", "type": "[_article_insert_input!]!", "description": null }, { "name": "on_conflict", "type": "_article_on_conflict", "description": null }], "description": null }, { "name": "_article_insert_input", "fields": [{ "name": "author_id", "type": "Int", "description": null }, { "name": "content", "type": "String", "description": null }, { "name": "id", "type": "Int", "description": null }, { "name": "title", "type": "String", "description": null }, { "name": "user", "type": "_user_obj_rel_insert_input", "description": null }], "description": null }, { "name": "_user_obj_rel_insert_input", "fields": [{ "name": "data", "type": "_user_insert_input!", "description": null }, { "name": "on_conflict", "type": "_user_on_conflict", "description": null }], "description": null }, { "name": "_user_on_conflict", "fields": [{ "name": "constraint", "type": "_user_constraint!", "description": null }, { "name": "update_columns", "type": "[_user_update_column!]!", "description": null }, { "name": "where", "type": "_user_bool_exp", "description": null }], "description": null }, { "name": "_user_bool_exp", "fields": [{ "name": "_and", "type": "[_user_bool_exp]", "description": null }, { "name": "_not", "type": "_user_bool_exp", "description": null }, { "name": "_or", "type": "[_user_bool_exp]", "description": null }, { "name": "articles", "type": "_article_bool_exp", "description": null }, { "name": "email", "type": "_String_comparison_exp", "description": null }, { "name": "id", "type": "_Int_comparison_exp", "description": null }, { "name": "username", "type": "_String_comparison_exp", "description": null }], "description": null }, { "name": "_article_bool_exp", "fields": [{ "name": "_and", "type": "[_article_bool_exp]", "description": null }, { "name": "_not", "type": "_article_bool_exp", "description": null }, { "name": "_or", "type": "[_article_bool_exp]", "description": null }, { "name": "author_id", "type": "_Int_comparison_exp", "description": null }, { "name": "content", "type": "_String_comparison_exp", "description": null }, { "name": "id", "type": "_Int_comparison_exp", "description": null }, { "name": "title", "type": "_String_comparison_exp", "description": null }, { "name": "user", "type": "_user_bool_exp", "description": null }], "description": null }, { "name": "_Int_comparison_exp", "fields": [{ "name": "_eq", "type": "Int", "description": null }, { "name": "_gt", "type": "Int", "description": null }, { "name": "_gte", "type": "Int", "description": null }, { "name": "_in", "type": "[Int!]", "description": null }, { "name": "_is_null", "type": "Boolean", "description": null }, { "name": "_lt", "type": "Int", "description": null }, { "name": "_lte", "type": "Int", "description": null }, { "name": "_neq", "type": "Int", "description": null }, { "name": "_nin", "type": "[Int!]", "description": null }], "description": null }, { "name": "_String_comparison_exp", "fields": [{ "name": "_eq", "type": "String", "description": null }, { "name": "_gt", "type": "String", "description": null }, { "name": "_gte", "type": "String", "description": null }, { "name": "_ilike", "type": "String", "description": null }, { "name": "_in", "type": "[String!]", "description": null }, { "name": "_is_null", "type": "Boolean", "description": null }, { "name": "_like", "type": "String", "description": null }, { "name": "_lt", "type": "String", "description": null }, { "name": "_lte", "type": "String", "description": null }, { "name": "_neq", "type": "String", "description": null }, { "name": "_nilike", "type": "String", "description": null }, { "name": "_nin", "type": "[String!]", "description": null }, { "name": "_nlike", "type": "String", "description": null }, { "name": "_nsimilar", "type": "String", "description": null }, { "name": "_similar", "type": "String", "description": null }], "description": null }, { "name": "_article_on_conflict", "fields": [{ "name": "constraint", "type": "_article_constraint!", "description": null }, { "name": "update_columns", "type": "[_article_update_column!]!", "description": null }, { "name": "where", "type": "_article_bool_exp", "description": null }], "description": null }, { "name": "SMSInput", "fields": [{ "name": "sms", "type": "String", "description": null }, { "name": "is_international", "type": "Boolean", "description": null }, { "name": "price", "type": "[Price]", "description": null }], "description": null }, { "name": "Price", "fields": [{ "name": "value", "type": "String", "description": null }], "description": null }] }, "framework": "typescript-express" }'
```

## Templaters

The templaters are present in the `src/templaters` directory. You can modify the templaters and build.
Each templater function must return an array of file objects. Something like:

```
[
{
"name": "filename1.js",
"content": "filename1 content"
},
{
"name": "filename2.js",
"content": "filename2 content"
}
]
```

These files will be generated in the PWD of execution.
Loading