refactor(vtex): move inline-loaders to CMS key paths#82
Merged
Conversation
4 tasks
guitavano
added a commit
to decocms/blocks
that referenced
this pull request
Jun 23, 2026
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>
guitavano
added a commit
to decocms/blocks
that referenced
this pull request
Jun 23, 2026
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>
guitavano
added a commit
to decocms/blocks
that referenced
this pull request
Jun 23, 2026
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>
Move vtex/inline-loaders/ into vtex/loaders/ subdirectories that match CMS keys (e.g. intelligentSearch/productList.ts, legacy/*, workflow/*). This enables filesystem-based auto-discovery in the schema generator instead of a hardcoded mapping. Re-export files preserve backward compat for alias CMS keys. package.json exports keep old inline-loaders paths pointing to new locations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5006cad to
d89dae1
Compare
aka-sacci-ccr
approved these changes
Jun 23, 2026
|
🎉 This PR is included in version 5.2.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
guitavano
added a commit
to decocms/blocks
that referenced
this pull request
Jun 23, 2026
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>
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
vtex/inline-loaders/intovtex/loaders/subdirectories matching CMS keys (intelligentSearch/,legacy/,workflow/)legacy/productList.ts→intelligentSearch/productList)inline-loaders/*entries inpackage.jsonexports pointing to new pathsTest plan
npx tsc --noEmitpasses (no new errors)vitesttests pass (moved test file)@decocms/apps/vtex/inline-loaders/*imports still resolve via package.json exports🤖 Generated with Claude Code
Summary by cubic
Refactored VTEX loaders to match CMS key paths and enable filesystem auto‑discovery in the schema generator. Backward compatible via
package.jsonexports.Refactors
vtex/inline-loaders/*tovtex/loaders/intelligentSearch/*,legacy/*, andworkflow/*, and addedvtex/loaders/Product{DetailsPage,ListingPage,List}.tsre-exports for discovery.package.jsonexports to redirect oldinline-loaders/*to new paths, includingproductList→productListFull,productListShelf→intelligentSearch/productList,relatedProducts→legacy/relatedProductsLoader,workflowProducts→workflow/products, andminicart.vtex/commerceLoaders.ts) and renamed tests to the new locations.knip.jsonglobs for the new directories.Migration
@decocms/apps/vtex/inline-loaders/*imports keep working via exports. Prefer@decocms/apps/vtex/loaders/...for new code.Written for commit d89dae1. Summary will update on new commits.