Skip to content

Commit cf22aa1

Browse files
needimfabien0102
authored andcommitted
feat: bump typescript & lerna versions (#89)
* chore: bump typescript & lerna versions * chore: bump example project's versions * revert: test casting * chore: optional chaining for Object is possibly 'null' * revert: testing error wrapper * chore: typescript version bump for example/frontend * fix: typanion enum
1 parent 8235278 commit cf22aa1

22 files changed

+17724
-12210
lines changed

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"swagger2openapi": "^7.0.8",
5353
"tslib": "^2.3.1",
5454
"typanion": "^3.7.1",
55-
"typescript": "^4.6.2"
55+
"typescript": "4.8.2"
5656
},
5757
"devDependencies": {
5858
"@graphql-codegen/cli": "^2.6.2",

cli/src/commands/GenerateCommand.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class GenerateCommand extends Command {
4545
method = Option.String("--method", {
4646
description: "[source=url] HTTP Method",
4747
env: "OPENAPI_CODEGEN_URL_METHOD",
48-
validator: t.isEnum(["get", "post"]),
48+
validator: t.isEnum(["get", "post"] as const),
4949
});
5050

5151
// source=github options
@@ -197,6 +197,9 @@ export class GenerateCommand extends Command {
197197
specPath: this.specPath,
198198
};
199199
}
200+
201+
default:
202+
throw new UsageError("--source argument is invalid");
200203
}
201204
}
202205

cli/src/core/generateConfigProperty.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export function generateConfigProperty({
6161
undefined,
6262
[
6363
factory.createParameterDeclaration(
64-
undefined,
6564
undefined,
6665
undefined,
6766
factory.createIdentifier("context"),

cli/src/core/updateConfig.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ export function updateConfig({
7070
});
7171

7272
return f.createImportDeclaration(
73-
node.decorators,
7473
node.modifiers,
7574
f.createImportClause(
7675
false,
@@ -153,7 +152,6 @@ function createImportStatements(imports: Map<string, string[]>) {
153152
const statements = Array.from(imports.entries()).map(
154153
([module, namedImports]) =>
155154
f.createImportDeclaration(
156-
undefined,
157155
undefined,
158156
f.createImportClause(
159157
false,

examples/frontend/package-lock.json

Lines changed: 1384 additions & 1437 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/frontend/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
"react-dom": "^18.0.0"
1515
},
1616
"devDependencies": {
17-
"@openapi-codegen/cli": "^1.5.0",
18-
"@openapi-codegen/typescript": "^3.0.1",
17+
"@openapi-codegen/cli": "^1.5.2",
18+
"@openapi-codegen/typescript": "^5.1.0",
1919
"@types/react": "^18.0.0",
2020
"@types/react-dom": "^18.0.0",
2121
"@vitejs/plugin-react": "^1.3.0",
22-
"typescript": "^4.6.3",
22+
"typescript": "4.8.2",
2323
"vite": "^2.9.5"
2424
}
2525
}

examples/frontend/src/App.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ function Users() {
2929
if (error) {
3030
return (
3131
<div>
32-
<p>{error.message}</p>
33-
<a href={error.documentation_url}>Documentation</a>
32+
<pre>{JSON.stringify(error, null, 2)}</pre>
3433
</div>
3534
);
3635
}

0 commit comments

Comments
 (0)