Repository navigation
fix(schema): seletor de RequestURLParam e sem "Select from saved" em arrays comuns (#644) - #659
Merged
Conversation
…bject arrays Two places where the CMS schema of a TanStack site diverged from what deco-cx/deco emitted, independent of the sections' code (measured on oficina-tanstack against production; #644): - RequestURLParam had no schema and there was no `functions` block. A section typed `slug?: RequestURLParam` lost the "Get params from request parameters" option in the admin, although the runtime still resolves saved `website/functions/requestToParam.ts` values. apps-website now exports the type, the generator points such props at a `…@RequestURLParam` definition, and composeMeta bakes the function block, its props and the type. - wrapResolvableProperties wrapped every array of objects with more than three fields in `anyOf [Resolvable, inline]`, adding a "Select from saved" mode the CMS user never had. It now only wraps arrays with matching loaders (product arrays), which keep their picker. Closes #644
# Conflicts: # CHANGELOG.md
|
🎉 This PR is included in version 7.77.11 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
tlgimenes
added a commit
that referenced
this pull request
Oct 12, 2026
The v8 line never edited CHANGELOG.md, so the squash onto main would have dropped the two entries main added after the branch point. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #644.
O que muda
1.
RequestURLParamvolta a ter o seletor do deco-cx/deco@decocms/apps-website/functions/requestToParamexportatype RequestURLParam = stringeProps { param }.generate-schema: prop anotada comoRequestURLParam(opcional ou não) vira{ $ref: "#/definitions/<b64(website/functions/requestToParam.ts)>@RequestURLParam", title }, como a Fresh emitia.composeMetapassa a incluir:definitions[<b64>]— o bloco "Get params from request parameters";definitions[<b64>@Props]—param: string(defaultslug);definitions[<b64>@RequestURLParam]—anyOf [ "Force param" (string), bloco ];manifest.blocks.functions["website/functions/requestToParam.ts"]eschema.root.functions(cominputSchema, como na Fresh).O runtime já resolvia valores salvos (
WELL_KNOWN_TYPES.REQUEST_TO_PARAM); só o admin perdia a opção. A chave da definição do bloco é a mesma da Fresh (d2Vic2l0ZS9mdW5jdGlvbnMvcmVxdWVzdFRvUGFyYW0udHM=).Diferença intencional: na Fresh
paramusavaformat: dynamic-optionscomwebsite/loaders/options/urlParams.ts, que não existe aqui; fica texto simples (defaultslug) para o campo não virar um seletor vazio.2.
wrapResolvablePropertiessó embrulha arrays que um loader pode preencherAntes, todo array de objetos com mais de 3 campos virava
anyOf [Resolvable, inline], criando um modo "Select from saved" que o deco-cx/deco nunca ofereceu (na prod do oficina, 0 props comResolvable). Agora só arrays de produto (com loaders compatíveis) são embrulhados, e mantêm o seletor de loaders. Referências já salvas continuam resolvendo em runtime; muda só o formulário do admin.Testes
schema.test.ts: blocofunctions,@Propse@RequestURLParampresentes; array comum de objetos fica inline.generate-schema.test.ts:slug?: RequestURLParam→$refpara a definição;stringcomum inalterado.blockseapps-website: mesmas falhas damain(80 linhas idênticas, de ambiente/timeouts), nenhuma nova.generate-schema*.test.tspassam com--testTimeout=180000.blocks-clitypecheck: os mesmos 6 erros pré-existentes damain(testes de migração). Biome: diagnósticos idênticos àmainnos arquivos tocados.🤖 Generated with Claude Code
Summary by cubic
Restores the deco-cx "Get params from request parameters" selector for
RequestURLParamprops and stops offering a "Select from saved" mode for plain object arrays.@decocms/apps-website/functions/requestToParamnow exportsRequestURLParamand itsProps;generate-schemapoints such props at#/definitions/<b64>@RequestURLParamandcomposeMetabakes the function block, prop schema, andfunctionsentries into schema and manifest.paramstays plain text (defaultslug) because the decourlParamsoptions loader has no port here.wrapResolvablePropertiesonly wraps arrays a loader can fill (product arrays); plain arrays of objects with more than 3 fields stay inline, matching deco-cx behavior.requestToParamreferences is unchanged; only the admin form differs. Sites that typed such props asstringcan switch back toRequestURLParamto get the picker.Written for commit 509c79c. Summary will update on new commits.