Bug report 🐞
Issue and steps to reproduce.
typewriter.yml file contains a parameter access-level, which allows users to specify which access level generated code should have. However, the generated file segment does not observe the provided access level - it always applies the internal access level.
This is problematic in cases where generated code is contained in a separate Package, as consumers are unable to access any of the generated functions on the extension of Analytics, since the access control cannot be made public.
Repro steps
- Set the
access-level: public in typewriter.yml:
client:
language: swift
sdk: swift
languageOptions:
access-level: public
- Run the codegen using
npx typewriter
- Observe that the file
segment does not observe the specified public access level
Expected
In the generated file segment, extension Analytics should have the access level specified in typewriter.yml (in this case, public):
public extension Analytics {
// generated event functions
}
Actual
In the generated file segment, extension Analytics has an internal access level:
extension Analytics {
// generated event functions
}
Versions. (Typewriter, OS, language, etc.)
- Typewriter version:
typewriter/9.1.0 darwin-arm64 node-v19.5.0
- Language: Swift
Bug report 🐞
Issue and steps to reproduce.
typewriter.ymlfile contains a parameteraccess-level, which allows users to specify which access level generated code should have. However, the generated filesegmentdoes not observe the provided access level - it always applies theinternalaccess level.This is problematic in cases where generated code is contained in a separate Package, as consumers are unable to access any of the generated functions on the extension of
Analytics, since the access control cannot be madepublic.Repro steps
access-level: publicintypewriter.yml:npx typewritersegmentdoes not observe the specifiedpublicaccess levelExpected
In the generated file
segment,extension Analyticsshould have the access level specified intypewriter.yml(in this case,public):Actual
In the generated file
segment,extension Analyticshas aninternalaccess level:Versions. (Typewriter, OS, language, etc.)
typewriter/9.1.0 darwin-arm64 node-v19.5.0