Skip to content

Commit

Permalink
chore: extra checks for e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvanhulle committed Mar 13, 2024
1 parent 8a75dd4 commit e493210
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 22 deletions.
2 changes: 1 addition & 1 deletion examples/python/templates/client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const templates = {
</>
)
},
editor({ children }: React.ComponentProps<typeof Client.templates.editor>) {
root({ children }: React.ComponentProps<typeof Client.templates.root>) {
const filePython = useOperationFile({ extName: '.py' })

return (
Expand Down
39 changes: 25 additions & 14 deletions packages/parser/src/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,14 @@ export function createEnumDeclaration({
value ? factory.createTrue() : factory.createFalse(),
)
}
if (value) {
return factory.createLiteralTypeNode(
factory.createStringLiteral(value.toString()),
)
}

return factory.createLiteralTypeNode(
factory.createStringLiteral(value?.toString()),
)
}),
return undefined

Check warning on line 450 in packages/parser/src/factory.ts

View check run for this annotation

Codecov / codecov/patch

packages/parser/src/factory.ts#L450

Added line #L450 was not covered by tests
}).filter(Boolean),
),
),
]
Expand Down Expand Up @@ -480,11 +483,15 @@ export function createEnumDeclaration({
)
}

return factory.createEnumMember(
factory.createStringLiteral(`${key}`),
initializer,
)
}),
if (key) {
return factory.createEnumMember(
factory.createStringLiteral(`${key}`),
initializer,
)
}

return undefined

Check warning on line 493 in packages/parser/src/factory.ts

View check run for this annotation

Codecov / codecov/patch

packages/parser/src/factory.ts#L492-L493

Added lines #L492 - L493 were not covered by tests
}).filter(Boolean),
),
]
}
Expand Down Expand Up @@ -517,11 +524,15 @@ export function createEnumDeclaration({
: factory.createFalse()
}

return factory.createPropertyAssignment(
factory.createStringLiteral(`${key}`),
initializer,
)
}),
if (key) {
return factory.createPropertyAssignment(
factory.createStringLiteral(`${key}`),
initializer,
)
}

return undefined

Check warning on line 534 in packages/parser/src/factory.ts

View check run for this annotation

Codecov / codecov/patch

packages/parser/src/factory.ts#L533-L534

Added lines #L533 - L534 were not covered by tests
}).filter(Boolean),
true,
),
factory.createTypeReferenceNode(
Expand Down
14 changes: 7 additions & 7 deletions packages/parser/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { optionsCJS, optionsESM } from "@kubb/tsup-config";
import { optionsCJS, optionsESM } from '@kubb/tsup-config'

import { defineConfig } from "tsup";
import { defineConfig } from 'tsup'

export default defineConfig([
{
...optionsCJS,
entry: {
index: "src/index.ts",
factory: "src/factory.ts",
index: 'src/index.ts',
factory: 'src/factory.ts',
},
noExternal: [/lodash.tonumber/],
},
{
...optionsESM,
entry: {
index: "src/index.ts",
factory: "src/factory.ts",
index: 'src/index.ts',
factory: 'src/factory.ts',
},
noExternal: [/lodash.tonumber/],
},
]);
])

0 comments on commit e493210

Please sign in to comment.