@@ -4,7 +4,6 @@ import yargs from 'yargs';
44import { welcome } from '@/welcome.js' ;
55import { Auth } from '@/Auth/index.js' ;
66import { initConfiguration } from '@/commands/common/init.js' ;
7- import { CommandSchema } from '@/commands/common/schema.js' ;
87import {
98 Config ,
109 Configuration ,
@@ -17,6 +16,7 @@ import CodeGen from '@/commands/codegen/CLI.js';
1716import Cloud from '@/commands/create/CLI.js' ;
1817import Create from '@/commands/cloud/CLI.js' ;
1918import ExternalCI from '@/commands/externalCi/CLI.js' ;
19+ import Schema from '@/commands/schema/CLI.js' ;
2020import { confOptions , projectOptions } from '@/common/promptOptions.js' ;
2121import { CommandPrune } from '@/commands/common/prune.js' ;
2222import { CommandInspect } from '@/commands/common/inspect.js' ;
@@ -44,77 +44,53 @@ welcome().then(() => {
4444 await initConfiguration (
4545 argv as Pick <
4646 ConfigurationOptions ,
47- 'project' | 'namespace' | 'projectVersion'
47+ 'project' | 'namespace' | 'projectVersion' | 'schemaDir'
4848 > ,
4949 ) ;
5050 } ,
5151 )
5252 . command (
5353 'login' ,
5454 'Login to GraphQL Editor' ,
55- async ( yargs ) => { } ,
55+ async ( yargs ) => { } ,
5656 async ( argv ) => {
5757 await Auth . login ( ) . then ( Config . setTokenOptions ) ;
5858 } ,
5959 )
6060 . command (
6161 'logout' ,
6262 'Logout from GraphQL Editor' ,
63- async ( yargs ) => { } ,
63+ async ( yargs ) => { } ,
6464 ( argv ) => {
6565 Auth . logout ( ) ;
6666 } ,
6767 )
68- . command (
69- 'schema' ,
70- 'Generate GraphQL schema from project at given path' ,
71- async ( yargs ) => {
72- yargs . options (
73- confOptions ( {
74- ...projectOptions ,
75- schemaDir : {
76- describe :
77- 'Path to created schema containing its name and extension' ,
78- type : 'string' ,
79- } ,
80- } ) ,
81- ) ;
82- } ,
83- async ( argv ) => {
84- await Auth . login ( ) . then ( Config . setTokenOptions ) ;
85- await CommandSchema (
86- argv as Pick <
87- ConfigurationOptions ,
88- 'project' | 'namespace' | 'projectVersion' | 'schemaDir'
89- > ,
90- ) ;
91- } ,
92- )
9368 . command (
9469 'prune' ,
9570 'Get information about redundant resolvers that do not exist in schema now.' ,
96- async ( yargs ) => { } ,
71+ async ( yargs ) => { } ,
9772 async ( argv ) => {
9873 await CommandPrune ( ) ;
9974 } ,
10075 )
10176 . command (
10277 'inspect' ,
10378 'Get information about non-scalar resolvers that are not implemented in stucco.json' ,
104- async ( yargs ) => { } ,
79+ async ( yargs ) => { } ,
10580 async ( argv ) => {
10681 await CommandInspect ( ) ;
10782 } ,
10883 )
10984 . command ( Create )
11085 . command ( Cloud )
86+ . command ( Schema )
11187 . command ( ExternalCI )
11288 . command ( CodeGen )
11389 . command ( Gei )
11490 . command (
11591 'dev' ,
11692 'Start Typescript server and stucco server with hot reload.' ,
117- async ( yargs ) => { } ,
93+ async ( yargs ) => { } ,
11894 async ( argv ) => {
11995 CommandDev ( ) ;
12096 } ,
@@ -125,7 +101,7 @@ welcome().then(() => {
125101 . command (
126102 'stucco' ,
127103 'Update your stucco file to cloud for synchronizing resolvers' ,
128- async ( yargs ) => { } ,
104+ async ( yargs ) => { } ,
129105 async ( argv ) => {
130106 await pushStuccoJson (
131107 argv as Pick < ConfigurationOptions , 'project' | 'namespace' > ,
0 commit comments