Use names for Pages CMS collections#1475
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughChangesCMS collection schemas and generated Pages CMS definitions now require CMS configuration
Precommit environment filtering
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/customise-cms/fields.js`:
- Around line 199-201: Update the reference field configuration containing value
"{path}" and label "{fields.name}" so its search property is an array containing
the fields.name reference, rather than a string. Preserve the existing value and
label settings.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: d140f1e9-5e84-4506-8414-75ed24542d15
📒 Files selected for processing (18)
.pages.ymlscripts/customise-cms/blocks.jsscripts/customise-cms/collection-config.jsscripts/customise-cms/config.jsscripts/customise-cms/field-builders.jsscripts/customise-cms/fields.jsscripts/customise-cms/generator.jsscripts/customise-cms/item-builders.jssrc/snippets/footer-content.mdsrc/snippets/right-content.mdtest/precommit/runner.jstest/unit/code-quality/pages-yml-reference-names.test.jstest/unit/precommit.test.jstest/unit/scripts/customise-cms/blocks.test.jstest/unit/scripts/customise-cms/config.test.jstest/unit/scripts/customise-cms/fields.test.jstest/unit/scripts/customise-cms/generator.test.jstest/unit/utils/pages-yml-helpers.js
💤 Files with no reviewable changes (1)
- scripts/customise-cms/config.js
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6124e12938
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94623aed9b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| */ | ||
| const loadSnippet = (name, baseDir = process.cwd()) => { | ||
| const snippetPath = path.join(baseDir, "src/snippets", `${name}.md`); | ||
| const snippetName = path.basename(name, path.extname(name)); |
There was a problem hiding this comment.
Preserve dots in snippet slugs
When a snippet is referenced by its slug and that slug contains a dot, path.extname(name) treats the suffix as an extension, so render_snippet, snippet_data, and snippet_blocks now look for the wrong file (for example release.v1 becomes src/snippets/release.md instead of src/snippets/release.v1.md). The Pages CMS path case only needs to strip a trailing .md after taking the basename; otherwise existing dotted snippet filenames stop rendering.
Useful? React with 👍 / 👎.
Summary
namefields and display reference labels from{fields.name}name, and has named content while fixing snippet and stale location referencesTesting
bun run precommitbun test test/unit/precommit.test.js test/unit/code-quality/pages-yml-reference-names.test.js test/unit/scripts/customise-cms/generator.test.jsSummary by CodeRabbit
{name}and all supported collections require anamefield.README.md, and snippet markdown now includes standardized front-matter (including new footer/right-content names).