feat(schema): auto-discover app loaders via filesystem walk#273
Merged
Conversation
fb601b0 to
24459d7
Compare
Replace the hardcoded APP_LOADERS array with a walk of
node_modules/@decocms/apps/*/loaders/**/*.ts. CMS keys are derived
from file paths, matching the Deno framework's convention.
Only scans apps installed in src/apps/ — detects namespaces from
bridge files that import from @decocms/apps/{namespace}/mod.
Skips index files, tests, and files without a default export.
Uses realpathSync to de-duplicate re-export alias files.
Depends on: decocms/apps-start#82
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
24459d7 to
98356ef
Compare
aka-sacci-ccr
approved these changes
Jun 23, 2026
|
🎉 This PR is included in version 6.16.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
Summary
APP_LOADERSarray ingenerate-schema.tswith a filesystem walk ofnode_modules/@decocms/apps/*/loaders/**/*.tsvtex/loaders/intelligentSearch/productList.ts), matching the Deno framework conventionrealpathSyncto de-duplicate re-export alias files (same Props/output type)Dependencies
Test plan
npx tsx scripts/generate-schema.ts --site casaevideogenerates correct schemaProductShelf.productsanyOf includes vtex loadersdatafield🤖 Generated with Claude Code
Summary by cubic
Auto-discovers app loaders by walking
node_modules/@decocms/apps/*/loaders/**/*.ts(x)and replaces the hardcodedAPP_LOADERS. Scans only apps installed viasrc/appsbridges to keep the schema in sync.New Features
src/appsfiles that re-export@decocms/apps/{namespace}/mod; scans only those apps.namespaceand adds__resolveTypeto each schema; sorts results for stable output._files and modules without a default export; de-dupes re-exports viarealpathSync; builds JSON Schemas fromPropsor the default export and registers output types.Dependencies
decocms/apps-start#82.Written for commit 98356ef. Summary will update on new commits.