Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Urigo/graphql-cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.17.0
Choose a base ref
...
head repository: Urigo/graphql-cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.0.0
Choose a head ref
  • 5 commits
  • 14 files changed
  • 2 contributors

Commits on Nov 16, 2018

  1. perf(graphql): Fix GraphQL version

    BREAKING CHANGE: This commit changes GraphQL version from 0.13.x to 14.x.x.
    
    - Added Prettier and husky to prevent any styling changes accross commits.
    
    - Added missing inquirer type definitions.
    maticzav committed Nov 16, 2018
    Copy the full SHA
    baa691a View commit details

Commits on Dec 11, 2018

  1. fix(pkg): Config

    maticzav committed Dec 11, 2018
    Copy the full SHA
    b455ce0 View commit details
  2. fix(pkg): Config

    maticzav committed Dec 11, 2018
    Copy the full SHA
    82535b5 View commit details

Commits on Dec 14, 2018

  1. Update boilerplates.ts

    nikolasburk authored Dec 14, 2018
    Copy the full SHA
    bfe7eea View commit details
  2. Copy the full SHA
    e8f2fac View commit details
Showing with 1,677 additions and 636 deletions.
  1. +1 −1 .circleci/config.yml
  2. +5 −0 .huskyrc
  3. +42 −38 package.json
  4. +5 −0 prettier.config.js
  5. +1 −1 src/cmds/add-endpoint.ts
  6. +26 −16 src/cmds/add-project.ts
  7. +0 −6 src/cmds/create/boilerplates.ts
  8. +2 −2 src/cmds/create/index.ts
  9. +32 −23 src/cmds/init.ts
  10. +3 −2 src/cmds/playground.ts
  11. +14 −6 src/cmds/query.ts
  12. +3 −1 src/index.ts
  13. +2 −10 tslint.json
  14. +1,541 −530 yarn.lock
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/node:8
- image: 'circleci/node:11.3.0'
steps:
- checkout
- run: sudo yarn global add semantic-release@15.1.1
5 changes: 5 additions & 0 deletions .huskyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"hooks": {
"pre-commit": "pretty-quick --staged"
}
}
80 changes: 42 additions & 38 deletions package.json
Original file line number Diff line number Diff line change
@@ -35,10 +35,10 @@
"pkg": {
"scripts": "dist/**/*.js",
"targets": [
"node9-alpine-x64",
"node9-linux-x64",
"node9-macos-x64",
"node9-win-x64"
"node10-alpine-x64",
"node10-linux-x64",
"node10-macos-x64",
"node10-win-x64"
]
},
"release": {
@@ -51,56 +51,60 @@
]
},
"devDependencies": {
"@types/express": "4.11.1",
"@types/graphql": "0.13.1",
"@types/inquirer": "0.0.36",
"@types/lodash": "4.14.104",
"@types/node": "9.4.6",
"@types/node-fetch": "1.6.9",
"@types/ora": "1.3.1",
"@types/request": "2.47.0",
"@types/express": "4.16.0",
"@types/graphql": "14.0.3",
"@types/inquirer": "0.0.43",
"@types/lodash": "4.14.118",
"@types/node": "10.12.9",
"@types/node-fetch": "2.1.3",
"@types/ora": "1.3.4",
"@types/request": "2.48.1",
"@types/rimraf": "2.0.2",
"@types/yargs": "11.0.0",
"@types/yargs": "12.0.1",
"ava": "0.25.0",
"pkg": "4.3.0",
"ts-node": "5.0.0",
"tslint": "5.9.1",
"tslint-config-standard": "7.0.0",
"typescript": "2.7.2"
"husky": "^1.1.4",
"pkg": "4.3.4",
"prettier": "^1.15.2",
"pretty-quick": "^1.8.0",
"ts-node": "7.0.1",
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.16.0",
"tslint-config-standard": "^8.0.1",
"typescript": "3.1.6"
},
"dependencies": {
"adm-zip": "0.4.7",
"apollo-codegen": "^0.19.1",
"chalk": "^2.3.1",
"command-exists": "^1.2.2",
"adm-zip": "0.4.13",
"apollo-codegen": "^0.20.2",
"chalk": "^2.4.1",
"command-exists": "^1.2.8",
"cross-spawn": "^6.0.5",
"disparity": "^2.0.0",
"dotenv": "^5.0.0",
"express": "^4.16.2",
"express-request-proxy": "^2.0.0",
"graphql": "^0.11.0 || ^0.12.0 || ^0.13.0",
"dotenv": "^6.1.0",
"express": "^4.16.4",
"express-request-proxy": "^2.2.2",
"graphql": "^14.0.2",
"graphql-cli-prepare": "1.4.19",
"graphql-config": "2.2.1",
"graphql-config-extension-graphcool": "1.0.11",
"graphql-config-extension-prisma": "0.2.5",
"graphql-playground-middleware-express": "1.7.6",
"graphql-schema-linter": "0.1.1",
"inquirer": "5.1.0",
"graphql-playground-middleware-express": "1.7.7",
"graphql-schema-linter": "0.1.6",
"inquirer": "6.2.0",
"is-url-superb": "2.0.0",
"js-yaml": "^3.10.0",
"lodash": "^4.17.5",
"js-yaml": "^3.12.0",
"lodash": "^4.17.11",
"mkdirp": "^0.5.1",
"node-fetch": "^2.0.0",
"node-fetch": "^2.3.0",
"npm-paths": "^1.0.0",
"npm-run": "4.1.2",
"opn": "^5.2.0",
"ora": "^1.4.0",
"opn": "^5.4.0",
"ora": "^3.0.0",
"parse-github-url": "^1.0.2",
"request": "^2.83.0",
"request": "^2.88.0",
"rimraf": "2.6.2",
"source-map-support": "^0.5.3",
"source-map-support": "^0.5.9",
"tmp-graphql-config-extension-openapi": "^1.0.7",
"update-notifier": "^2.3.0",
"yargs": "11.0.0"
"update-notifier": "^2.5.0",
"yargs": "12.0.2"
}
}
5 changes: 5 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
semi: false,
singleQuote: true,
trailingComma: 'all',
}
2 changes: 1 addition & 1 deletion src/cmds/add-endpoint.ts
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ export async function handler(context: Context) {
chalk.blue(newEndpoints.join(', ')),
)

const { save } = await prompt({
const { save } = await prompt<{ save: boolean }>({
type: 'confirm',
name: 'save',
message: `Is this ok?`,
42 changes: 26 additions & 16 deletions src/cmds/add-project.ts
Original file line number Diff line number Diff line change
@@ -17,20 +17,24 @@ export async function handler(context: Context) {
const config = await getConfig()
if (config.config.schemaPath && !config.config.projects) {
console.log(chalk.yellow('Your existing config does not use projects.'))
const { existingProjectName }: {[key: string]: string} = await prompt({
type: 'input',
name: 'existingProjectName',
message: 'Enter project name for existing configuration:'
})
const { existingProjectName }: { [key: string]: string } = await prompt<{}>(
{
type: 'input',
name: 'existingProjectName',
message: 'Enter project name for existing configuration:',
},
)

newConfig = { projects: {
[existingProjectName]: config.config }
newConfig = {
projects: {
[existingProjectName]: config.config,
},
}
} else {
newConfig = config.config
}

const { projectName }: {[key: string]: string} = await prompt({
const { projectName }: { [key: string]: string } = await prompt<{}>({
type: 'input',
name: 'projectName',
message: 'Enter project name for new project:',
@@ -42,17 +46,17 @@ export async function handler(context: Context) {
return true
}
return false
}
},
})

merge(newConfig, { projects: { [projectName]: {} } })

let projectConfig: GraphQLResolvedConfigData = await prompt({
let projectConfig: GraphQLResolvedConfigData = (await prompt({
type: 'input',
name: 'schemaPath',
message: `Local schema file path:`,
default: 'schema.graphql',
validate (schemaPath) {
validate(schemaPath) {
const parentDir = dirname(schemaPath)
if (!existsSync(parentDir)) {
return `Parent dir doesn't exists: ${parentDir}`
@@ -62,7 +66,7 @@ export async function handler(context: Context) {
}
return true
},
}) as GraphQLResolvedConfigData
})) as GraphQLResolvedConfigData

newConfig.projects[projectName] = projectConfig

@@ -78,18 +82,24 @@ export async function handler(context: Context) {
}

let configData: string
if (config.configPath.endsWith('.yaml') || config.configPath.endsWith('.yml')) {
if (
config.configPath.endsWith('.yaml') ||
config.configPath.endsWith('.yml')
) {
configData = yaml.safeDump(newConfig)
} else {
configData = JSON.stringify(newConfig, null, 2)
}

console.log(
`\nAbout to write new configuration to ${chalk.blue(config.configPath)}:\n\n` +
chalk.yellow(configData) + '\n',
`\nAbout to write new configuration to ${chalk.blue(
config.configPath,
)}:\n\n` +
chalk.yellow(configData) +
'\n',
)

const { save } = await prompt({
const { save } = await prompt<{ save: boolean }>({
type: 'confirm',
name: 'save',
message: `Is this ok?`,
6 changes: 0 additions & 6 deletions src/cmds/create/boilerplates.ts
Original file line number Diff line number Diff line change
@@ -55,12 +55,6 @@ export const defaultBoilerplates: Boilerplate[] = [
repo:
'https://github.com/graphql-boilerplates/react-fullstack-graphql/tree/master/basic',
},
{
name: 'react-fullstack-advanced',
description: 'React app + GraphQL server (incl. database & authentication)',
repo:
'https://github.com/graphql-boilerplates/react-fullstack-graphql/tree/master/advanced',
},
{
name: 'vue-fullstack-minimal',
description: '"Hello World" fullstack app with Vue & GraphQL',
4 changes: 2 additions & 2 deletions src/cmds/create/index.ts
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ export async function handler(
}

if (!directory) {
const { newDir } = await context.prompt({
const { newDir } = await context.prompt<{ newDir: string }>({
type: 'input',
name: 'newDir',
default: '.',
@@ -112,7 +112,7 @@ export async function handler(
const choices = defaultBoilerplates.map(
bp => `${padEnd(bp.name, maxNameLength + 2)} ${bp.description}`,
)
const { choice } = await context.prompt({
const { choice } = await context.prompt<{ choice: string }>({
type: 'list',
name: 'choice',
message: `Choose GraphQL boilerplate project:`,
Loading