Skip to content

feat(cartridges): add cartridge/*.properties fallback for pwa-kit / storefront-next repos - #694

Open
bendvc wants to merge 1 commit into
developfrom
feat/cartridge-properties-fallback-discovery
Open

bendvc wants to merge 1 commit into
developfrom
feat/cartridge-properties-fallback-discovery

Conversation

@bendvc

@bendvc bendvc commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • findCartridges() now falls back to **/cartridge/*.properties when no .project files are found, enabling b2c code deploy to work out-of-the-box with pwa-kit and storefront-next repos
  • .project discovery (existing behavior) is unchanged and takes full priority — the fallback is skipped entirely when any .project files exist under the search root
  • maxDepth is automatically adjusted (+1) for the properties glob so both markers honor the same logical cartridge-nesting depth bound
  • Updated docs/cli/code.md Cartridge Discovery section to document both markers
  • Added 7 targeted unit tests

Background

b2c code deploy discovered 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 .project but always include cartridge/<name>.properties, so running the deploy command from those repos returned No cartridges found with no actionable hint. Charles Lavery (PMTS, tool author) confirmed the .project requirement is historical and welcomed a PR adding the properties heuristic.

Files changed

File Change
packages/b2c-tooling-sdk/src/operations/code/cartridges.ts Add toCartridgeFromProperties, fallback glob, propertiesGlobOptions (maxDepth +1), update JSDoc
packages/b2c-tooling-sdk/src/discovery/patterns/cartridges.ts Update module/class JSDoc
packages/b2c-tooling-sdk/test/operations/code/cartridges.test.ts 7 new tests in cartridge/*.properties fallback describe block
docs/cli/code.md Updated Cartridge Discovery section to document both markers
.changeset/cartridge-properties-fallback-discovery.md Changeset (minor SDK, patch CLI)

Test plan

  • All 17 cartridges unit tests pass (pnpm --filter @salesforce/b2c-tooling-sdk exec mocha "test/operations/code/cartridges.test.ts")
  • Run b2c code deploy from a pwa-kit package root (has cartridge/<name>.properties, no .project) — cartridges should be discovered
  • Run b2c code deploy from an SFRA repo (has .project) — existing behavior unchanged
  • Run b2c code deploy from a mixed repo with both markers — only .project cartridges discovered

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.
@bendvc
bendvc requested a review from clavery as a code owner September 17, 2026 20:42
@bendvc
bendvc deployed to b2c-docs-preview September 17, 2026 20:42 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

📘 Docs preview

Your documentation changes are published at:

https://d3uhw92m2zac57.cloudfront.net/pr-694/

Commit 1d26e4f · ✅ Published

This preview updates on every push and is removed when the PR is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant