glutinum-org / cli

https://glutinum.net/
59 stars 6 forks source link

String enum containing a dot should be escaped #83

Closed MangelMaxime closed 5 months ago

MangelMaxime commented 7 months ago

Issue created from Glutinum Tool

Glutinum version - 0.4.0

TypeScript

type FirebaseSignInProvider =
    | 'apple.com';

FSharp

module rec Glutinum

open Fable.Core
open Fable.Core.JsInterop
open System

[<RequireQualifiedAccess>]
[<StringEnum(CaseRules.None)>]
type FirebaseSignInProvider =
    | apple.com

Problem description

The generated code is invalid in F#.

It seems like we can't use the double tick trick when there is . in the name, so we will need to transform into a CompiledName


[<RequireQualifiedAccess>]
[<StringEnum(CaseRules.None)>]
type FirebaseSignInProvider =
    | [<CompiledName("apple.com")>] apple_com