Skip to content

Commit 66c6809

Browse files
authored
Feat/ts migration (#216)
* feat: convert files to ts * feat: JSONSchema4 oas2json * feat: json2ts options * feat: oas2tson type * fix: processJSON * feat: ts tests * chore: upgrade to tap 18 * feat: build * fix: eslint * fix: new lines * fix: removed try/catch * fix: incomplete coverage
1 parent 6cf769b commit 66c6809

28 files changed

+13646
-10985
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ end_of_line = lf
33
insert_final_newline = true
44
charset = utf-8
55
indent_style = space
6-
indent_size = 2
6+
indent_size = 2

.eslintrc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
{
2-
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
2+
"parser": "@typescript-eslint/parser",
3+
"plugins": [
4+
"@typescript-eslint"
5+
],
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/eslint-recommended",
9+
"plugin:@typescript-eslint/recommended",
10+
"plugin:prettier/recommended"
11+
],
12+
"ignorePatterns": ["test/temp/**/*", "example/**/*", "dist/**/*"],
313
"env": {
414
"node": true,
515
"es2021": true

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ node_modules
1212
# tests
1313
test/temp
1414
.nyc_output
15+
.tap
16+
17+
# build
18+
dist

.taprc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"files": ["test/*.test.js"],
2+
"files": ["test/*.test.ts"],
33
"reporter": "spec"
44
}

example/output/types/Pet.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,9 @@ export interface Pet {
1818
* pet status in the store
1919
*/
2020
status?: 'available' | 'pending' | 'sold';
21+
/**
22+
* example nullable value
23+
*/
24+
nullableValue?: string | null;
2125
[k: string]: unknown;
2226
}

index.js renamed to index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export { runCommand as oas2json } from './src/commands/oas2json.js'
21
export { runCommand as json2ts } from './src/commands/json2ts.js'
2+
export { runCommand as oas2json } from './src/commands/oas2json.js'
33
export { runCommand as oas2ts } from './src/commands/oas2ts.js'
44
export { runCommand as oas2tson } from './src/commands/oas2tson.js'

0 commit comments

Comments
 (0)