Validate a composed env against every config layer's validation surface
(#96): packaged, project public, and project local each contribute
independently, instead of one layer shadowing the others.
If the layer declares a JS/TS schema, run schema.safeParse(finalEnv)
and collect its issues; every layer with a schema is checked (a project
schema no longer shadows the packaged layer's schema).
Else if the layer declares requiredKeys, its keys join a union checked
once against finalEnv after all layers are visited (base layer order
first, de-duplicated).
A config set that uses a single layer behaves exactly as before: that
layer's own schema (if present) is checked in place of its own
requiredKeys, matching the single-config precedent this validation
always followed.
Validate a composed env against every config layer's validation surface (#96): packaged, project public, and project local each contribute independently, instead of one layer shadowing the others.
Behavior, per layer (lowest precedence first: packaged, project public, project local):
schema, runschema.safeParse(finalEnv)and collect its issues; every layer with a schema is checked (a project schema no longer shadows the packaged layer's schema).requiredKeys, its keys join a union checked once againstfinalEnvafter all layers are visited (base layer order first, de-duplicated).A config set that uses a single layer behaves exactly as before: that layer's own
schema(if present) is checked in place of its ownrequiredKeys, matching the single-config precedent this validation always followed.