Skip to content

Commit

Permalink
Remove *.tsbuildinfo from dist
Browse files Browse the repository at this point in the history
  • Loading branch information
jkmartindale committed May 24, 2022
1 parent f915306 commit 18da3a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gqlschema",
"version": "0.1.0",
"version": "1.0.0",
"description": "CLI tool to pull the GraphQL schema (as GraphQL SDL or JSON) from a given endpoint with introspection enabled",
"keywords": [
"cli",
Expand All @@ -12,7 +12,7 @@
"author": "James Martindale (https://twitter.com/jkmartindale)",
"files": [
"dist/**/*",
"!*.tsbuildinfo"
"!dist/*.tsbuildinfo"
],
"main": "dist/index.js",
"bin": {
Expand Down
5 changes: 2 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#!/usr/bin/env node

// Chose argparse over meow because of automatic help generation and over yargs because the help messages for positional arguments are more helpful
import * as fs from 'fs'
import got from 'got'
import { buildClientSchema, getIntrospectionQuery, IntrospectionQuery, printSchema } from 'graphql'
import { URL } from 'url'
import { parser } from './parser.js'

let args = parser.parse_args()

async function getQueryData(endpoint: string, query: string, headers?: any): Promise<IntrospectionQuery> {
try {
new URL(endpoint)
Expand Down Expand Up @@ -39,6 +36,8 @@ async function outputResult(data: string, file: fs.PathLike | fs.promises.FileHa
}
}

let args = parser.parse_args()

// Grab the JSON first (needed to generate SDL) and write it out if requested
const introspectionData = await getQueryData(args.endpoint, getIntrospectionQuery(args), args.headers)
if (args.json) {
Expand Down
1 change: 1 addition & 0 deletions src/parser.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Chose argparse over meow because of automatic help generation and over yargs because the help messages for positional arguments are more helpful
import { Action, ArgumentParser, HelpFormatter, Namespace } from 'argparse'
import * as path from 'path'

Expand Down

0 comments on commit 18da3a9

Please sign in to comment.