From 2f930bfe80603b6bad073a9fd39037b6a52e38be Mon Sep 17 00:00:00 2001 From: wendrul <53628737+wendrul@users.noreply.github.com> Date: Thu, 25 Apr 2024 16:50:35 +0200 Subject: [PATCH 1/4] Add explicit type for jsr compliance To comply with jsr.io, add an explicit return type. --- packages/client-core/src/cancelablePromise.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client-core/src/cancelablePromise.ts b/packages/client-core/src/cancelablePromise.ts index f002b69e9..d7a92b523 100644 --- a/packages/client-core/src/cancelablePromise.ts +++ b/packages/client-core/src/cancelablePromise.ts @@ -80,7 +80,7 @@ export class CancelablePromise implements Promise { }); } - get [Symbol.toStringTag]() { + get [Symbol.toStringTag]() : string { return 'Cancellable Promise'; } From 0ccb949b441cca108f1163c5dbb9cb9ac7935aff Mon Sep 17 00:00:00 2001 From: wendrul <53628737+wendrul@users.noreply.github.com> Date: Fri, 26 Apr 2024 09:35:01 +0200 Subject: [PATCH 2/4] Format changes --- packages/client-core/src/cancelablePromise.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client-core/src/cancelablePromise.ts b/packages/client-core/src/cancelablePromise.ts index d7a92b523..cc7f31fce 100644 --- a/packages/client-core/src/cancelablePromise.ts +++ b/packages/client-core/src/cancelablePromise.ts @@ -80,7 +80,7 @@ export class CancelablePromise implements Promise { }); } - get [Symbol.toStringTag]() : string { + get [Symbol.toStringTag](): string { return 'Cancellable Promise'; } From 9c2a0e97ed2bf4ca8dbc7d2cf3cc2deda32b8826 Mon Sep 17 00:00:00 2001 From: wendrul Date: Fri, 26 Apr 2024 09:50:02 +0200 Subject: [PATCH 3/4] Add explicit type on CancellablePromise.hbs jsr compliance --- packages/openapi-ts/src/templates/core/CancelablePromise.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/openapi-ts/src/templates/core/CancelablePromise.hbs b/packages/openapi-ts/src/templates/core/CancelablePromise.hbs index 15256dde3..5c10c4ed6 100644 --- a/packages/openapi-ts/src/templates/core/CancelablePromise.hbs +++ b/packages/openapi-ts/src/templates/core/CancelablePromise.hbs @@ -80,7 +80,7 @@ export class CancelablePromise implements Promise { }); } - get [Symbol.toStringTag]() { + get [Symbol.toStringTag](): string { return "Cancellable Promise"; } From e0ddf4c9e392bd06124c6b9eec72330ec134cf1b Mon Sep 17 00:00:00 2001 From: wendrul Date: Fri, 26 Apr 2024 15:25:36 +0200 Subject: [PATCH 4/4] Update tests Update tests to match the new generated code with the type anotated getter. --- .../test/generated/v2/core/CancelablePromise.ts.snap | 4 ++-- .../test/generated/v3/core/CancelablePromise.ts.snap | 4 ++-- .../test/generated/v3_axios/core/CancelablePromise.ts.snap | 4 ++-- .../test/generated/v3_client/core/CancelablePromise.ts.snap | 4 ++-- .../v3_enums_typescript/core/CancelablePromise.ts.snap | 4 ++-- .../v3_legacy_positional_args/core/CancelablePromise.ts.snap | 4 ++-- .../test/generated/v3_node/core/CancelablePromise.ts.snap | 4 ++-- .../test/generated/v3_options/core/CancelablePromise.ts.snap | 4 ++-- .../test/generated/v3_xhr/core/CancelablePromise.ts.snap | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v2/core/CancelablePromise.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v2/core/CancelablePromise.ts.snap index ccc082e8f..5c10c4ed6 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v2/core/CancelablePromise.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v2/core/CancelablePromise.ts.snap @@ -80,7 +80,7 @@ export class CancelablePromise implements Promise { }); } - get [Symbol.toStringTag]() { + get [Symbol.toStringTag](): string { return "Cancellable Promise"; } @@ -123,4 +123,4 @@ export class CancelablePromise implements Promise { public get isCancelled(): boolean { return this._isCancelled; } -} \ No newline at end of file +} diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3/core/CancelablePromise.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3/core/CancelablePromise.ts.snap index ccc082e8f..5c10c4ed6 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3/core/CancelablePromise.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3/core/CancelablePromise.ts.snap @@ -80,7 +80,7 @@ export class CancelablePromise implements Promise { }); } - get [Symbol.toStringTag]() { + get [Symbol.toStringTag](): string { return "Cancellable Promise"; } @@ -123,4 +123,4 @@ export class CancelablePromise implements Promise { public get isCancelled(): boolean { return this._isCancelled; } -} \ No newline at end of file +} diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_axios/core/CancelablePromise.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_axios/core/CancelablePromise.ts.snap index ccc082e8f..5c10c4ed6 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_axios/core/CancelablePromise.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_axios/core/CancelablePromise.ts.snap @@ -80,7 +80,7 @@ export class CancelablePromise implements Promise { }); } - get [Symbol.toStringTag]() { + get [Symbol.toStringTag](): string { return "Cancellable Promise"; } @@ -123,4 +123,4 @@ export class CancelablePromise implements Promise { public get isCancelled(): boolean { return this._isCancelled; } -} \ No newline at end of file +} diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_client/core/CancelablePromise.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_client/core/CancelablePromise.ts.snap index ccc082e8f..5c10c4ed6 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_client/core/CancelablePromise.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_client/core/CancelablePromise.ts.snap @@ -80,7 +80,7 @@ export class CancelablePromise implements Promise { }); } - get [Symbol.toStringTag]() { + get [Symbol.toStringTag](): string { return "Cancellable Promise"; } @@ -123,4 +123,4 @@ export class CancelablePromise implements Promise { public get isCancelled(): boolean { return this._isCancelled; } -} \ No newline at end of file +} diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript/core/CancelablePromise.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript/core/CancelablePromise.ts.snap index ccc082e8f..5c10c4ed6 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript/core/CancelablePromise.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript/core/CancelablePromise.ts.snap @@ -80,7 +80,7 @@ export class CancelablePromise implements Promise { }); } - get [Symbol.toStringTag]() { + get [Symbol.toStringTag](): string { return "Cancellable Promise"; } @@ -123,4 +123,4 @@ export class CancelablePromise implements Promise { public get isCancelled(): boolean { return this._isCancelled; } -} \ No newline at end of file +} diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_legacy_positional_args/core/CancelablePromise.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_legacy_positional_args/core/CancelablePromise.ts.snap index ccc082e8f..5c10c4ed6 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_legacy_positional_args/core/CancelablePromise.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_legacy_positional_args/core/CancelablePromise.ts.snap @@ -80,7 +80,7 @@ export class CancelablePromise implements Promise { }); } - get [Symbol.toStringTag]() { + get [Symbol.toStringTag](): string { return "Cancellable Promise"; } @@ -123,4 +123,4 @@ export class CancelablePromise implements Promise { public get isCancelled(): boolean { return this._isCancelled; } -} \ No newline at end of file +} diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_node/core/CancelablePromise.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_node/core/CancelablePromise.ts.snap index ccc082e8f..5c10c4ed6 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_node/core/CancelablePromise.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_node/core/CancelablePromise.ts.snap @@ -80,7 +80,7 @@ export class CancelablePromise implements Promise { }); } - get [Symbol.toStringTag]() { + get [Symbol.toStringTag](): string { return "Cancellable Promise"; } @@ -123,4 +123,4 @@ export class CancelablePromise implements Promise { public get isCancelled(): boolean { return this._isCancelled; } -} \ No newline at end of file +} diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_options/core/CancelablePromise.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_options/core/CancelablePromise.ts.snap index ccc082e8f..5c10c4ed6 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_options/core/CancelablePromise.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_options/core/CancelablePromise.ts.snap @@ -80,7 +80,7 @@ export class CancelablePromise implements Promise { }); } - get [Symbol.toStringTag]() { + get [Symbol.toStringTag](): string { return "Cancellable Promise"; } @@ -123,4 +123,4 @@ export class CancelablePromise implements Promise { public get isCancelled(): boolean { return this._isCancelled; } -} \ No newline at end of file +} diff --git a/packages/openapi-ts/test/__snapshots__/test/generated/v3_xhr/core/CancelablePromise.ts.snap b/packages/openapi-ts/test/__snapshots__/test/generated/v3_xhr/core/CancelablePromise.ts.snap index ccc082e8f..5c10c4ed6 100644 --- a/packages/openapi-ts/test/__snapshots__/test/generated/v3_xhr/core/CancelablePromise.ts.snap +++ b/packages/openapi-ts/test/__snapshots__/test/generated/v3_xhr/core/CancelablePromise.ts.snap @@ -80,7 +80,7 @@ export class CancelablePromise implements Promise { }); } - get [Symbol.toStringTag]() { + get [Symbol.toStringTag](): string { return "Cancellable Promise"; } @@ -123,4 +123,4 @@ export class CancelablePromise implements Promise { public get isCancelled(): boolean { return this._isCancelled; } -} \ No newline at end of file +}