Skip to content

Commit

Permalink
fix: ignore acronyms when doing casing switch to pascal or camelcase
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvanhulle committed Jan 9, 2025
1 parent d186426 commit b678aba
Show file tree
Hide file tree
Showing 44 changed files with 374 additions and 375 deletions.
5 changes: 5 additions & 0 deletions .changeset/hungry-seahorses-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kubb/core": patch
---

ignore acronyms when doing casing switch to pascal or camelcase
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ title: Changelog

# Changelog

## 3.4.6
- [`core`](/plugins/core): ignore acronyms when doing casing switch to pascal or camelcase

## 3.4.5
- [`plugin-client`](/plugins/plugin-client): if client receives no body (no content) then it throws JSON parsing error
- [`plugin-zod`](/plugins/plugin-zod): use of `as ToZod` instead of `satisfies ToZod`
Expand Down
4 changes: 2 additions & 2 deletions examples/advanced/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@tanstack/solid-query": "^5.62.16",
"@tanstack/svelte-query": "^5.62.16",
"@tanstack/vue-query": "^5.62.16",
"@types/react": "^19.0.3",
"@types/react": "^19.0.4",
"axios": "^1.7.9",
"msw": "^2.7.0",
"react": "^19.0.0",
Expand All @@ -56,7 +56,7 @@
"devDependencies": {
"@kubb/config-ts": "workspace:*",
"tsup": "^8.3.5",
"typescript": "^5.7.2"
"typescript": "^5.7.3"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
8 changes: 4 additions & 4 deletions examples/advanced/src/gen/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export type {
} from './models/ts/petController/FindPetsByStatus.ts'
export type {
FindPetsByTagsQueryParams,
FindPetsByTagsHeaderParamsXExampleEnum,
FindPetsByTagsHeaderParamsXEXAMPLEEnum,
FindPetsByTagsHeaderParams,
FindPetsByTags200,
FindPetsByTags400,
Expand Down Expand Up @@ -99,7 +99,7 @@ export type { PetNotFound } from './models/ts/PetNotFound.ts'
export type {
CreatePetsPathParams,
CreatePetsQueryParams,
CreatePetsHeaderParamsXExampleEnum,
CreatePetsHeaderParamsXEXAMPLEEnum,
CreatePetsHeaderParams,
CreatePets201,
CreatePetsError,
Expand Down Expand Up @@ -440,8 +440,8 @@ export {
export { addPetRequestStatusEnum } from './models/ts/AddPetRequest.ts'
export { orderOrderTypeEnum, orderStatusEnum, orderHttpStatusEnum } from './models/ts/Order.ts'
export { petStatusEnum } from './models/ts/Pet.ts'
export { findPetsByTagsHeaderParamsXExampleEnum } from './models/ts/petController/FindPetsByTags.ts'
export { createPetsHeaderParamsXExampleEnum } from './models/ts/petsController/CreatePets.ts'
export { findPetsByTagsHeaderParamsXEXAMPLEEnum } from './models/ts/petController/FindPetsByTags.ts'
export { createPetsHeaderParamsXEXAMPLEEnum } from './models/ts/petsController/CreatePets.ts'
export { handlers } from './msw/handlers.ts'
export { addPetHandler } from './msw/petController/addPetHandler.ts'
export { deletePetHandler } from './msw/petController/deletePetHandler.ts'
Expand Down
8 changes: 4 additions & 4 deletions examples/advanced/src/gen/models/ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type {
} from './petController/FindPetsByStatus.ts'
export type {
FindPetsByTagsQueryParams,
FindPetsByTagsHeaderParamsXExampleEnum,
FindPetsByTagsHeaderParamsXEXAMPLEEnum,
FindPetsByTagsHeaderParams,
FindPetsByTags200,
FindPetsByTags400,
Expand Down Expand Up @@ -53,7 +53,7 @@ export type { PetNotFound } from './PetNotFound.ts'
export type {
CreatePetsPathParams,
CreatePetsQueryParams,
CreatePetsHeaderParamsXExampleEnum,
CreatePetsHeaderParamsXEXAMPLEEnum,
CreatePetsHeaderParams,
CreatePets201,
CreatePetsError,
Expand Down Expand Up @@ -111,5 +111,5 @@ export type {
export { addPetRequestStatusEnum } from './AddPetRequest.ts'
export { orderOrderTypeEnum, orderStatusEnum, orderHttpStatusEnum } from './Order.ts'
export { petStatusEnum } from './Pet.ts'
export { findPetsByTagsHeaderParamsXExampleEnum } from './petController/FindPetsByTags.ts'
export { createPetsHeaderParamsXExampleEnum } from './petsController/CreatePets.ts'
export { findPetsByTagsHeaderParamsXEXAMPLEEnum } from './petController/FindPetsByTags.ts'
export { createPetsHeaderParamsXEXAMPLEEnum } from './petsController/CreatePets.ts'
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ export type FindPetsByTagsQueryParams = {
pageSize?: string
}

export const findPetsByTagsHeaderParamsXExampleEnum = {
export const findPetsByTagsHeaderParamsXEXAMPLEEnum = {
ONE: 'ONE',
TWO: 'TWO',
THREE: 'THREE',
} as const

export type FindPetsByTagsHeaderParamsXExampleEnum = (typeof findPetsByTagsHeaderParamsXExampleEnum)[keyof typeof findPetsByTagsHeaderParamsXExampleEnum]
export type FindPetsByTagsHeaderParamsXEXAMPLEEnum = (typeof findPetsByTagsHeaderParamsXEXAMPLEEnum)[keyof typeof findPetsByTagsHeaderParamsXEXAMPLEEnum]

export type FindPetsByTagsHeaderParams = {
/**
* @description Header parameters
* @type string
*/
'X-EXAMPLE': FindPetsByTagsHeaderParamsXExampleEnum
'X-EXAMPLE': FindPetsByTagsHeaderParamsXEXAMPLEEnum
}

/**
Expand Down
4 changes: 2 additions & 2 deletions examples/advanced/src/gen/models/ts/petController/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type {
} from './FindPetsByStatus.ts'
export type {
FindPetsByTagsQueryParams,
FindPetsByTagsHeaderParamsXExampleEnum,
FindPetsByTagsHeaderParamsXEXAMPLEEnum,
FindPetsByTagsHeaderParams,
FindPetsByTags200,
FindPetsByTags400,
Expand Down Expand Up @@ -42,4 +42,4 @@ export type {
UploadFileMutationResponse,
UploadFileMutation,
} from './UploadFile.ts'
export { findPetsByTagsHeaderParamsXExampleEnum } from './FindPetsByTags.ts'
export { findPetsByTagsHeaderParamsXEXAMPLEEnum } from './FindPetsByTags.ts'
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ export type CreatePetsQueryParams = {
offset?: number
}

export const createPetsHeaderParamsXExampleEnum = {
export const createPetsHeaderParamsXEXAMPLEEnum = {
ONE: 'ONE',
TWO: 'TWO',
THREE: 'THREE',
} as const

export type CreatePetsHeaderParamsXExampleEnum = (typeof createPetsHeaderParamsXExampleEnum)[keyof typeof createPetsHeaderParamsXExampleEnum]
export type CreatePetsHeaderParamsXEXAMPLEEnum = (typeof createPetsHeaderParamsXEXAMPLEEnum)[keyof typeof createPetsHeaderParamsXEXAMPLEEnum]

export type CreatePetsHeaderParams = {
/**
* @description Header parameters
* @type string
*/
'X-EXAMPLE': CreatePetsHeaderParamsXExampleEnum
'X-EXAMPLE': CreatePetsHeaderParamsXEXAMPLEEnum
}

/**
Expand Down
4 changes: 2 additions & 2 deletions examples/advanced/src/gen/models/ts/petsController/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export type {
CreatePetsPathParams,
CreatePetsQueryParams,
CreatePetsHeaderParamsXExampleEnum,
CreatePetsHeaderParamsXEXAMPLEEnum,
CreatePetsHeaderParams,
CreatePets201,
CreatePetsError,
CreatePetsMutationRequest,
CreatePetsMutationResponse,
CreatePetsMutation,
} from './CreatePets.ts'
export { createPetsHeaderParamsXExampleEnum } from './CreatePets.ts'
export { createPetsHeaderParamsXEXAMPLEEnum } from './CreatePets.ts'
4 changes: 2 additions & 2 deletions examples/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
},
"devDependencies": {
"@kubb/config-ts": "workspace:*",
"@types/react": "^19.0.3",
"@types/react": "^19.0.4",
"react": "^19.0.0",
"tsup": "^8.3.5",
"typescript": "^5.7.2"
"typescript": "^5.7.3"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion examples/fetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@kubb/config-ts": "workspace:*",
"react": "^18.3.1",
"tsup": "^8.3.5",
"typescript": "^5.7.2"
"typescript": "^5.7.3"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions examples/generators/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
},
"devDependencies": {
"@kubb/config-ts": "workspace:*",
"@types/react": "^19.0.3",
"@types/react": "^19.0.4",
"react": "^19.0.0",
"tsup": "^8.3.5",
"typescript": "^5.7.2"
"typescript": "^5.7.3"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion examples/react-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@vitejs/plugin-react": "^4.3.4",
"msw": "^1.3.5",
"tsup": "^8.3.5",
"typescript": "^5.7.2",
"typescript": "^5.7.3",
"vite": "^6.0.7"
},
"packageManager": "[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion examples/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@types/react": "^18.3.18",
"react": "^18.3.1",
"tsup": "^8.3.5",
"typescript": "^5.7.2"
"typescript": "^5.7.3"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-single/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"axios": "^1.7.9",
"react": "^18.3.1",
"tsup": "^8.3.5",
"typescript": "^5.7.2",
"typescript": "^5.7.3",
"zod": "^3.24.1"
}
}
30 changes: 15 additions & 15 deletions examples/simple-single/src/gen2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const createMachineRequestSchema = z.object({
/**
* @description Optional parameters
*/
export const createOidcTokenRequestSchema = z
export const createOIDCTokenRequestSchema = z
.object({
aud: z.string().optional(),
})
Expand Down Expand Up @@ -290,7 +290,7 @@ export const flyContainerDependencySchema = z.object({

export const flyContainerDependencyConditionSchema = z.enum(['exited_successfully', 'healthy', 'started'])

export const flyDnsConfigSchema = z.object({
export const flyDNSConfigSchema = z.object({
dns_forward_rules: z.array(z.lazy(() => flyDnsForwardRuleSchema)).optional(),
hostname: z.string().optional(),
hostname_fqdn: z.string().optional(),
Expand Down Expand Up @@ -337,15 +337,15 @@ export const flyFileSchema = z
})
.describe('A file that will be written to the Machine. One of RawValue or SecretName must be set.')

export const flyHttpOptionsSchema = z.object({
export const flyHTTPOptionsSchema = z.object({
compress: z.boolean().optional(),
h2_backend: z.boolean().optional(),
headers_read_timeout: z.number().int().optional(),
idle_timeout: z.number().int().optional(),
response: z.lazy(() => flyHttpResponseOptionsSchema).optional(),
response: z.lazy(() => flyHTTPResponseOptionsSchema).optional(),
})

export const flyHttpResponseOptionsSchema = z.object({
export const flyHTTPResponseOptionsSchema = z.object({
headers: z.object({}).catchall(z.object({})).optional(),
pristine: z.boolean().optional(),
})
Expand All @@ -359,7 +359,7 @@ export const flyMachineCheckSchema = z
.lazy(() => flyDurationSchema)
.describe('The time to wait after a VM starts before checking its health')
.optional(),
headers: z.array(z.lazy(() => flyMachineHttpHeaderSchema)).optional(),
headers: z.array(z.lazy(() => flyMachineHTTPHeaderSchema)).optional(),
interval: z
.lazy(() => flyDurationSchema)
.describe('The time between connectivity checks')
Expand Down Expand Up @@ -390,7 +390,7 @@ export const flyMachineConfigSchema = z.object({
.describe('Containers are a list of containers that will run in the machine. Currently restricted to\nonly specific organizations.')
.optional(),
disable_machine_autostart: z.boolean().describe('Deprecated: use Service.Autostart instead').optional(),
dns: z.lazy(() => flyDnsConfigSchema).optional(),
dns: z.lazy(() => flyDNSConfigSchema).optional(),
env: z.object({}).catchall(z.string()).describe('An object filled with key/value pairs to be set as environment variables').optional(),
files: z.array(z.lazy(() => flyFileSchema)).optional(),
guest: z.lazy(() => flyMachineGuestSchema).optional(),
Expand Down Expand Up @@ -425,7 +425,7 @@ export const flyMachineGuestSchema = z.object({
/**
* @description For http checks, an array of objects with string field Name and array of strings field Values. The key/value pairs specify header and header values that will get passed with the check call.
*/
export const flyMachineHttpHeaderSchema = z
export const flyMachineHTTPHeaderSchema = z
.object({
name: z.string().describe('The header name').optional(),
values: z.array(z.string()).describe('The header value').optional(),
Expand Down Expand Up @@ -464,11 +464,11 @@ export const flyMachinePortSchema = z.object({
end_port: z.number().int().optional(),
force_https: z.boolean().optional(),
handlers: z.array(z.string()).optional(),
http_options: z.lazy(() => flyHttpOptionsSchema).optional(),
http_options: z.lazy(() => flyHTTPOptionsSchema).optional(),
port: z.number().int().optional(),
proxy_proto_options: z.lazy(() => flyProxyProtoOptionsSchema).optional(),
start_port: z.number().int().optional(),
tls_options: z.lazy(() => flyTlsOptionsSchema).optional(),
tls_options: z.lazy(() => flyTLSOptionsSchema).optional(),
})

export const flyMachineProcessSchema = z.object({
Expand Down Expand Up @@ -575,7 +575,7 @@ export const flyStopConfigSchema = z.object({
timeout: z.lazy(() => flyDurationSchema).optional(),
})

export const flyTlsOptionsSchema = z.object({
export const flyTLSOptionsSchema = z.object({
alpn: z.array(z.string()).optional(),
default_self_signed: z.boolean().optional(),
versions: z.array(z.string()).optional(),
Expand Down Expand Up @@ -1237,16 +1237,16 @@ export const tokensRequestKmsMutationResponseSchema = z.lazy(() => tokensRequest
/**
* @description OIDC token
*/
export const tokensRequestOidc200Schema = z.string()
export const tokensRequestOIDC200Schema = z.string()

/**
* @description Bad Request
*/
export const tokensRequestOidc400Schema = z.lazy(() => errorResponseSchema)
export const tokensRequestOIDC400Schema = z.lazy(() => errorResponseSchema)

/**
* @description Optional request body
*/
export const tokensRequestOidcMutationRequestSchema = z.lazy(() => createOidcTokenRequestSchema)
export const tokensRequestOIDCMutationRequestSchema = z.lazy(() => createOIDCTokenRequestSchema)

export const tokensRequestOidcMutationResponseSchema = z.lazy(() => tokensRequestOidc200Schema)
export const tokensRequestOIDCMutationResponseSchema = z.lazy(() => tokensRequestOIDC200Schema)
2 changes: 1 addition & 1 deletion examples/solid-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"devDependencies": {
"tsup": "^8.3.5",
"typescript": "^5.7.2"
"typescript": "^5.7.3"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion examples/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"devDependencies": {
"tsup": "^8.3.5",
"typescript": "^5.7.2"
"typescript": "^5.7.3"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion examples/vue-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@vitejs/plugin-vue": "^5.2.1",
"msw": "^1.3.5",
"tsup": "^8.3.5",
"typescript": "^5.7.2",
"typescript": "^5.7.3",
"vite": "^6.0.7"
},
"packageManager": "[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion examples/zod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@kubb/plugin-zod": "workspace:*",
"react": "^18.3.1",
"tsup": "^8.3.5",
"typescript": "^5.7.2",
"typescript": "^5.7.3",
"zod": "^3.24.1"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit b678aba

Please sign in to comment.