Skip to content

Commit 5002c40

Browse files
Copilotmrlubos
andcommitted
Migrate to TypeScript Native preview (tsgo)
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
1 parent 6b6f868 commit 5002c40

11 files changed

Lines changed: 24 additions & 15 deletions

File tree

packages/codegen-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"check-exports": "attw --pack . --profile esm-only --ignore-rules cjs-resolves-to-esm",
4545
"dev": "tsdown --watch",
4646
"prepublishOnly": "pnpm build",
47-
"typecheck": "tsc --noEmit"
47+
"typecheck": "tsgo --noEmit"
4848
},
4949
"dependencies": {
5050
"@hey-api/types": "workspace:*",

packages/json-schema-ref-parser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"check-exports": "attw --pack . --profile esm-only --ignore-rules cjs-resolves-to-esm",
4848
"dev": "tsdown --watch",
4949
"prepublishOnly": "pnpm build",
50-
"typecheck": "tsc --noEmit"
50+
"typecheck": "tsgo --noEmit"
5151
},
5252
"dependencies": {
5353
"@jsdevtools/ono": "7.1.3",

packages/openapi-python/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"check-exports": "attw --pack . --profile esm-only --ignore-rules cjs-resolves-to-esm",
5757
"dev": "tsdown --watch",
5858
"prepublishOnly": "pnpm build",
59-
"typecheck": "tsc --noEmit",
59+
"typecheck": "tsgo --noEmit",
6060
"typecheck:next": "tsc --noEmit && uv run mypy src/ts-python/__snapshots__"
6161
},
6262
"dependencies": {

packages/openapi-ts-tests/main/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"typecheck": "tsc --noEmit"
7+
"typecheck": "tsgo --noEmit"
88
},
99
"devDependencies": {
1010
"@angular-devkit/build-angular": "21.1.2",

packages/openapi-ts-tests/sdks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"typecheck": "tsc --noEmit"
7+
"typecheck": "tsgo --noEmit"
88
},
99
"devDependencies": {
1010
"@hey-api/openapi-ts": "workspace:*",

packages/openapi-ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"check-exports": "attw --pack . --profile esm-only --ignore-rules cjs-resolves-to-esm",
6767
"dev": "tsdown --watch",
6868
"prepublishOnly": "pnpm build",
69-
"typecheck": "tsc --noEmit"
69+
"typecheck": "tsgo --noEmit"
7070
},
7171
"dependencies": {
7272
"@hey-api/codegen-core": "workspace:*",

packages/shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"check-exports": "attw --pack . --profile esm-only --ignore-rules cjs-resolves-to-esm",
3838
"dev": "tsdown --watch",
3939
"prepublishOnly": "pnpm build",
40-
"typecheck": "tsc --noEmit"
40+
"typecheck": "tsgo --noEmit"
4141
},
4242
"dependencies": {
4343
"@hey-api/codegen-core": "workspace:*",

packages/shared/src/index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,15 @@ export type {
6767
export { createSchemaProcessor } from './ir/schema-processor';
6868
export type { SchemaVisitor, SchemaVisitorContext, Walker } from './ir/schema-walker';
6969
export { childContext, createSchemaWalker } from './ir/schema-walker';
70-
export type { IR } from './ir/types';
70+
export type {
71+
IR,
72+
IRModel,
73+
IROperationObject,
74+
IRParameterObject,
75+
IRParametersObject,
76+
IRSchemaObject,
77+
IRServerObject,
78+
} from './ir/types';
7179
export { addItemsToSchema } from './ir/utils';
7280
export { parseOpenApiSpec } from './openApi';
7381
export type { OpenApiV2_0_X, OpenApiV2_0_XTypes } from './openApi/2.0.x';

packages/shared/src/ir/types.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ export interface IROperationObject extends SpecificationExtensions {
5252
tags?: ReadonlyArray<string>;
5353
}
5454

55-
interface IRParametersObject {
55+
export interface IRParametersObject {
5656
cookie?: Record<string, IRParameterObject>;
5757
header?: Record<string, IRParameterObject>;
5858
path?: Record<string, IRParameterObject>;
5959
query?: Record<string, IRParameterObject>;
6060
}
6161

62-
interface IRParameterObject
62+
export interface IRParameterObject
6363
extends Pick<JsonSchemaDraft2020_12, 'deprecated' | 'description'>, SpecificationExtensions {
6464
/**
6565
* Determines whether the parameter value SHOULD allow reserved characters, as defined by RFC3986 `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. The default value is `false`. This property SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded` or `multipart/form-data`. If a value is explicitly defined, then the value of `contentType` (implicit or explicit) SHALL be ignored.
@@ -124,7 +124,7 @@ interface IRResponseObject {
124124
schema: IRSchemaObject;
125125
}
126126

127-
interface IRSchemaObject
127+
export interface IRSchemaObject
128128
extends
129129
Pick<
130130
JsonSchemaDraft2020_12,
@@ -221,11 +221,12 @@ interface IRSchemaObject
221221

222222
type IRSecurityObject = SecuritySchemeObject;
223223

224-
type IRServerObject = ServerObject;
224+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- Interface rather than type alias avoids TS4023 errors when bundled dist is consumed by tsgo/TypeScript 7
225+
export interface IRServerObject extends ServerObject {}
225226

226227
type IRWebhookObject = IRPathItemObject;
227228

228-
interface IRModel {
229+
export interface IRModel {
229230
components?: IRComponentsObject;
230231
paths?: IRPathsObject;
231232
servers?: ReadonlyArray<IRServerObject>;

packages/shared/src/openApi/3.1.x/parser/operation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { contentToSchema, mediaTypeObjects } from './mediaType';
1414
import { paginationField } from './pagination';
1515
import { parseExtensions, schemaToIrSchema } from './schema';
1616

17-
interface Operation
17+
export interface Operation
1818
extends Omit<OperationObject, 'parameters'>, Pick<IR.OperationObject, 'parameters'> {}
1919

2020
const parseOperationJsDoc = ({

0 commit comments

Comments
 (0)