Skip to content

Commit

Permalink
Fixes on the build process
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Fernando Planella Gonzalez committed Feb 5, 2019
1 parent be08452 commit 7a97664
Show file tree
Hide file tree
Showing 8 changed files with 281 additions and 41 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
.directory
ng-openapi-gen.json
dist
out
6 changes: 1 addition & 5 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
node_modules
out
test
.directory
package-lock.json
test
6 changes: 0 additions & 6 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#!/usr/bin/env node
"use strict";
const tsNode = require('ts-node');
tsNode.register({
project: `${__dirname}/../tsconfig.json`,
transpileOnly: true
});

// Run the main function
const runNgOpenApiGen = require('./ng-openapi-gen').runNgOpenApiGen;
runNgOpenApiGen()
Expand Down
34 changes: 18 additions & 16 deletions lib/ng-openapi-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,6 @@ import { Templates } from './templates';
import { parseOptions } from './cmd-args';
import $RefParser from 'json-schema-ref-parser';

/**
* Parses the command-line arguments, reads the configuration file and run the generation
*/
export async function runNgOpenApiGen() {
const options = parseOptions();
const refParser = new $RefParser();
const input = options.input;
try {
const openApi = await refParser.bundle(input, { dereference: { circular: false } }) as OpenAPIObject;
const gen = new NgOpenApiGen(openApi, options);
gen.generate();
} catch (err) {
console.error(`Error on API generation from ${input}: ${err}`);
}
}

/**
* Main generator class
*/
Expand Down Expand Up @@ -250,3 +234,21 @@ export class NgOpenApiGen {
return result;
}
}

///////////////////////////////////////////////////////////////////////////

/**
* Parses the command-line arguments, reads the configuration file and run the generation
*/
export async function runNgOpenApiGen() {
const options = parseOptions();
const refParser = new $RefParser();
const input = options.input;
try {
const openApi = await refParser.bundle(input, { dereference: { circular: false } }) as OpenAPIObject;
const gen = new NgOpenApiGen(openApi, options);
gen.generate();
} catch (err) {
console.error(`Error on API generation from ${input}: ${err}`);
}
}
3 changes: 0 additions & 3 deletions lib/x.ts

This file was deleted.

247 changes: 246 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7a97664

Please sign in to comment.