Skip to content

Conversation

kiahjh
Copy link
Contributor

@kiahjh kiahjh commented May 19, 2025

No description provided.

@kiahjh kiahjh force-pushed the admin-ts-codegen branch 2 times, most recently from dcbcf7b to 3895b55 Compare May 19, 2025 18:06
@kiahjh kiahjh marked this pull request as ready for review May 19, 2025 18:22
@kiahjh kiahjh marked this pull request as draft May 19, 2025 18:26
@kiahjh kiahjh force-pushed the admin-ts-codegen branch from 3895b55 to fb3593e Compare May 20, 2025 17:54
@kiahjh kiahjh marked this pull request as ready for review May 29, 2025 17:46
Copy link
Contributor

@jaredh159 jaredh159 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see if you can fix the formatting noise, and then, to get rid of the { rawValue: T } stuff, go to the api/Sources/Api/Extend/Tagged.swift and add this code:

extension Tagged: @retroactive TypeScriptAliased {
  public static var typescriptAlias: String {
    switch RawValue.self {
    case is UUID.Type: "UUID"
    case is String.Type: "string"
    case is any Numeric.Type: "number"
    case is Bool.Type: "boolean"
    default: fatalError("Typescript alias not declared for tagged `\(RawValue.self)`")
    }
  }
}

and then go to the very bottom of api/Sources/Api/Routes/DashboardTsCodegen.swift and delete the last 76 lines. that should fix it.


struct AdminQuery: CustomQueryable {
static func query(bindings: [Postgres.Data]) -> SQL.Statement {
.init("""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's some noise in these diffs that i don't understand... can you check that you're on swiftformat --version of exactly 0.55.5? if not, can you get on that version and reformat?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants