pdevito3 / craftsman

A .NET scaffolding tool to help you stop worrying about boilerplate and focus on your business logic 🚀
https://wrapt.dev
MIT License
1.12k stars 65 forks source link

Using some characters in ProjectName breaks generated code #111

Closed NoTuxNoBux closed 12 months ago

NoTuxNoBux commented 1 year ago

It's a nitpick and not blocking or anything, but using characters such as dots in ProjectName in the YAML files breaks the generated code in places such as ConnectionStringOptions because it causes code to be generated that may not contain dots, such as variables.

These should probably just be blocked from being used in the CLI tool.

Steps to reproduce

Example YAML:

DomainName: API
BoundedContexts:
    - ProjectName: Some.API
      DbContext:
          ContextName: APIDatabaseContext
          DatabaseName: Main
          Provider: postgres
      Entities:
          - Name: User
            Features:
                - Type: AddRecord
                - Type: GetRecord
                - Type: GetList
                - Type: UpdateRecord
                - Type: DeleteRecord
            Properties:
                - Name: Firstname
                  Type: string
                  CanFilter: true
                  CanSort: true

Then run:

craftsman new domain testfile.yaml

Further technical details

Craftsman version (dotnet tool list -g): 0.20.0