Skip to content

update dependencies #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node_modules
.directory
dist
lib
out
.idea
Empty file added .npmignore
Empty file.
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,16 +262,6 @@ the call to `ng-openapi-gen`, like:

## Developing and contributing

The generator itself is written in TypeScript. When building, the code is transpiled to JavaScript in the `dist` folder. And the `dist` folder is the one that gets published to NPM. Even to prevent publishing from the wrong path, the `package.json` file has `"private": true`, which gets replaced by `false` in the build process.
The generator itself is written in TypeScript. When building, the code from `src` is transpiled to JavaScript and placed in the `lib` folder.

On the other hand, for developing / running tests, `jasmine-ts` is used, so the tests run directly from TypeScript. There's even a committed VisualStudio Code debug configuration for tests.

After developing the changes, to `link` the module and test it with other node projects, run the following:

```bash
npm run build
cd dist
npm link
```

At that point, the globally available ng-openapi-gen will be the one compiled to the `dist` folder.
During developing and testing, `jasmine-ts` is used, so the tests run directly from TypeScript. There's even a committed VisualStudio Code debug configuration for tests.
3 changes: 1 addition & 2 deletions lib/index.ts → bin/ng-openapi-gen.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/usr/bin/env node

import { runNgOpenApiGen } from './ng-openapi-gen';
const { runNgOpenApiGen } = require('../lib/ng-openapi-gen');

// Run the main function
runNgOpenApiGen()
.catch(err => console.error(`Error on API generation: ${err}`));

22 changes: 19 additions & 3 deletions ng-openapi-gen-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,13 @@
]
},
"enumStyle": {
"description": "Determines how root enums will be generated. Possible values are:\n\n- `alias`: just generate a type alias with the possible values;\n- `upper` for an enum with UPPER_CASE names, and;\n- `pascal` for enum PascalCase names. Defaults to 'pascal'.",
"description": "Determines how root enums will be generated. Possible values are:\n\n- `alias`: just generate a type alias with the possible values;\n- `upper` for an enum with UPPER_CASE names;\n- `pascal` for enum PascalCase names;\n- `unmodified` to use the value as the name after basic character parsing; Defaults to 'pascal'.",
"default": "pascal",
"enum": [
"alias",
"upper",
"pascal"
"pascal",
"unmodified"
]
},
"templates": {
Expand All @@ -142,6 +143,21 @@
"items": {
"type": "string"
}
},
"indexFile": {
"description": "When set to true, a index.ts file will be generated that exports all generated files.",
"default": "false",
"type": "boolean"
},
"silent": {
"description": "When set to true, no verbose output will be displayed.",
"default": "false",
"type": "boolean"
},
"customApiConfiguration": {
"description": "When set, the ApiConfiguration file not be generated and only a custom import will be used",
"default": "",
"type": "string"
}
}
}
}
Loading