Conversation
b2c code deploy relied exclusively on .project (Eclipse marker) to find cartridges. pwa-kit and storefront-next omit .project but always include cartridge/<name>.properties, so those repos returned "No cartridges found" with no actionable hint. findCartridges() now falls back to **/cartridge/*.properties when no .project files are found. The existing .project path is unchanged; the fallback is skipped entirely when .project files exist anywhere under the search root (even if they are all excluded by filters), preserving the original mode-selection semantics. The maxDepth bound is automatically adjusted (+1) for the properties glob so both markers honour the same logical cartridge-nesting depth. Adds 7 targeted tests covering: discovery via properties, .project priority, no-fallback-when-filtered, include/exclude filters, firstMatchOnly, and maxDepth on the properties glob.
Contributor
📘 Docs previewYour documentation changes are published at: https://d3uhw92m2zac57.cloudfront.net/pr-694/ Commit This preview updates on every push and is removed when the PR is closed. |
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
findCartridges()now falls back to**/cartridge/*.propertieswhen no.projectfiles are found, enablingb2c code deployto work out-of-the-box with pwa-kit and storefront-next repos.projectdiscovery (existing behavior) is unchanged and takes full priority — the fallback is skipped entirely when any.projectfiles exist under the search rootmaxDepthis automatically adjusted (+1) for the properties glob so both markers honor the same logical cartridge-nesting depth bounddocs/cli/code.mdCartridge Discovery section to document both markersBackground
b2c code deploydiscovered cartridges exclusively via.project(Eclipse/UX Studio marker). pwa-kit (packages/template-retail-react-app/cartridges/app_pwakit_base/cartridge/app_pwakit_base.properties) and storefront-next omit.projectbut always includecartridge/<name>.properties, so running the deploy command from those repos returnedNo cartridges foundwith no actionable hint. Charles Lavery (PMTS, tool author) confirmed the.projectrequirement is historical and welcomed a PR adding the properties heuristic.Files changed
packages/b2c-tooling-sdk/src/operations/code/cartridges.tstoCartridgeFromProperties, fallback glob,propertiesGlobOptions(maxDepth +1), update JSDocpackages/b2c-tooling-sdk/src/discovery/patterns/cartridges.tspackages/b2c-tooling-sdk/test/operations/code/cartridges.test.tscartridge/*.properties fallbackdescribe blockdocs/cli/code.md.changeset/cartridge-properties-fallback-discovery.mdTest plan
pnpm --filter @salesforce/b2c-tooling-sdk exec mocha "test/operations/code/cartridges.test.ts")b2c code deployfrom a pwa-kit package root (hascartridge/<name>.properties, no.project) — cartridges should be discoveredb2c code deployfrom an SFRA repo (has.project) — existing behavior unchangedb2c code deployfrom a mixed repo with both markers — only.projectcartridges discovered