Skip to content

Say why source mode wants an exports list - #4

Closed
pathscale wants to merge 1 commit into
masterfrom
fix/name-the-source-mode-manifest
Closed

Say why source mode wants an exports list#4
pathscale wants to merge 1 commit into
masterfrom
fix/name-the-source-mode-manifest

Conversation

@pathscale

Copy link
Copy Markdown
Owner

One error message. No behaviour change.

emitSourceManifest threw must declare its public Layout exports, which reads as a missing required field and sends you off to write the list. The question worth asking first is whether you wanted mode: "source" at all, because convention-based discovery needs no such list and docs/getting-started.md says exactly that: "No authored component manifest is required."

It also said nothing about what keeping the list costs. Nothing compares it to the barrel, so a rename that misses it leaves the manifest naming components that no longer exist while rejecting the ones that do, silently and with no diagnostic anywhere.

That is how this was found. A library on source mode renamed eleven components across its source, its recipes and its barrel, rebuilt from a wiped dist, and the manifest still said Callout. Everything typechecked, the build was green, and the application compiler would have rejected <Alert> while accepting a name that no longer existed. The same list had also never heard of two components added that morning.

The new message names the trade and points at both exits:

layouts.library.json: source mode needs an "exports" array naming this package's public components.

Only `mode: "source"` needs one. Convention-based discovery derives the manifest from
every `*.layout.tsx` it finds, and emits richer entries the application compiler can
verify; source mode generates alongside a package whose public surface it cannot see,
so the list is how it learns the names.

If this package does not need adjacent generation, delete the config and let discovery
do it. If it does, the list has to be kept in step with the barrel by hand: nothing
compares them, and a rename that misses it leaves the manifest naming components that
no longer exist while rejecting the ones that do.

Suites unchanged and passing: library 7, application 14.

The message was "must declare its public Layout exports", which reads as a
missing required field. It sends you to write the list, when the question worth
asking is whether you wanted source mode at all: convention-based discovery
needs no such list, and the documentation says so in as many words.

It also said nothing about the cost of keeping one. Nothing compares the list to
the barrel, so a rename that misses it leaves the manifest naming components
that no longer exist while rejecting the ones that do, with no diagnostic
anywhere. That is worth knowing before you choose the mode, not after.

The message now names the trade and points at both ways out.
@pathscale

Copy link
Copy Markdown
Owner Author

#5 is stacked on this branch. Merging this one first keeps that diff clean.

@pathscale

Copy link
Copy Markdown
Owner Author

Folded into #5, which contains this commit plus the Solid 2 work. One PR instead of two.

@pathscale pathscale closed this Aug 15, 2026
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.

1 participant