Skip to content

Commit f7cc9a2

Browse files
Alan-ChaErikWittern
authored andcommitted
Code improvements
Signed-off-by: Alan Cha <[email protected]>
1 parent f44205a commit f7cc9a2

17 files changed

+40
-34
lines changed

packages/openapi-to-graphql-cli/lib/openapi-to-graphql.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openapi-to-graphql-cli/lib/openapi-to-graphql.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openapi-to-graphql-cli/src/openapi-to-graphql.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ import * as request from 'request'
88
import * as fs from 'fs'
99
import * as yaml from 'js-yaml'
1010
import { printSchema } from 'graphql'
11+
import { Command } from 'commander'
1112

1213
import { createGraphQlSchema } from 'openapi-to-graphql'
1314
import { Oas2 } from 'openapi-to-graphql/lib/types/oas2'
1415
import { Oas3 } from 'openapi-to-graphql/lib/types/oas3'
1516
import { Options } from 'openapi-to-graphql/lib/types/options'
1617

1718
const app = express()
18-
let program = require('commander')
1919

20+
const program = new Command()
2021
program
2122
.version(require('../package.json').version)
2223
.usage('<OAS JSON file path(s) and/or remote url(s)> [options]')

packages/openapi-to-graphql/lib/auth_builder.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { GraphQLObjectType as GQObjectType } from 'graphql';
22
import { Args, ResolveFunction } from './types/graphql';
3-
import { PreprocessingData } from './types/preprocessing_data.js';
3+
import { PreprocessingData } from './types/preprocessing_data';
44
declare type Viewer = {
55
type: GQObjectType;
66
resolve: ResolveFunction;

packages/openapi-to-graphql/lib/oas_3_tools.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
import { Oas2 } from './types/oas2';
55
import { Operation } from './types/operation';
6-
import { Oas3, ServerObject, ParameterObject, SchemaObject, OperationObject, ReferenceObject, LinkObject, SecuritySchemeObject } from './types/oas3.js';
6+
import { Oas3, ServerObject, ParameterObject, SchemaObject, OperationObject, ReferenceObject, LinkObject, SecuritySchemeObject } from './types/oas3';
77
import { PreprocessingData, ProcessedSecurityScheme } from './types/preprocessing_data';
88
import { InternalOptions } from './types/options';
99
export declare type SchemaNames = {

packages/openapi-to-graphql/src/auth_builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { Args, ResolveFunction } from './types/graphql'
2121
import {
2222
PreprocessingData,
2323
ProcessedSecurityScheme
24-
} from './types/preprocessing_data.js'
24+
} from './types/preprocessing_data'
2525

2626
// Imports:
2727
import { getGraphQLType } from './schema_builder'

packages/openapi-to-graphql/src/oas_3_tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
MediaTypesObject,
2727
SecuritySchemeObject,
2828
SecurityRequirementObject
29-
} from './types/oas3.js'
29+
} from './types/oas3'
3030
import {
3131
PreprocessingData,
3232
ProcessedSecurityScheme

packages/openapi-to-graphql/test/authentication.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77

88
/* globals beforeAll, test, expect */
99

10-
import * as openapiToGraphql from '../lib/index.js'
1110
import { graphql } from 'graphql'
1211

12+
import * as openapiToGraphql from '../lib/index'
13+
import { startServer, stopServer } from './example_api_server'
14+
1315
const oas = require('./fixtures/example_oas.json')
1416
const PORT = 3003
1517
// update PORT for this test case:
1618
oas.servers[0].variables.port.default = String(PORT)
17-
const { startServer, stopServer } = require('./example_api_server')
1819

1920
let createdSchema
2021

packages/openapi-to-graphql/test/cloudfunction_oas.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
/* globals beforeAll, test, expect */
99

10-
import * as openapiToGraphql from '../lib/index.js'
10+
import * as openapiToGraphql from '../lib/index'
1111
const { parse, validate } = require('graphql')
1212

1313
const oas = require('./fixtures/cloudfunction_oas.json')

packages/openapi-to-graphql/test/docusign.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
/* globals test, expect */
99

10-
import * as openapiToGraphql from '../lib/index.js'
11-
import { Options } from '../lib/types/options.js'
10+
import * as openapiToGraphql from '../lib/index'
11+
import { Options } from '../lib/types/options'
1212

1313
const oas = require('./fixtures/docusign_oas.json')
1414

0 commit comments

Comments
 (0)