Skip to content

Question: should Cratis.Stage.Rendering.Cratis depend on Cratis publicly? #18

Description

@woksin

Compiling rendered output inside a spec — the thing that caught 1,438 compile errors nobody knew about — required Cratis and Cratis.Arc.MongoDB as references on Rendering.Cratis. Because this repo keeps specs in the project they test, those are normal references, so the published Cratis.Stage.Rendering.Cratis package now takes a dependency on Cratis.

PrivateAssets="All" was tried and is strictly worse: it wins version unification and hides Cratis.Fundamentals from consumers, breaking them at startup.

Three ways out, none obviously right:

  1. Leave it. A renderer that emits Cratis code arguably should depend on Cratis, and the alternative below deviates from the repo's layout. Cost: every consumer of the rendering package pulls Cratis and MongoDB whether or not it wants them.
  2. A separate Rendering.Cratis.Specs project. Clean — the package stays dependency-free and the spec project takes what it needs. Cost: deviates from this repo's in-project spec convention, which every other project follows.
  3. Compile against reference assemblies instead of the real ones. Keeps the spec and the layout, but the compilation is then less faithful than the one that found the bugs.

Worth deciding before the package is more widely consumed, since it is a public dependency either way.

Related: the same spec needed ExcludeAssets="analyzers", because Cratis' type-discovery source generator otherwise bakes a runtime binding into what is fundamentally a text generator.


@einari — your call. Option 1 is the status quo and is defensible; option 2 is cleaner but breaks this repo's in-project spec convention.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions