Skip to content

feat(lightning-out): @W-24812375@ --site and --access for CLWR apps - #1093

Draft
akashdhake wants to merge 10 commits into
salesforcecli:mainfrom
akashdhake:feat/lo-clwr-site-access
Draft

akashdhake wants to merge 10 commits into
salesforcecli:mainfrom
akashdhake:feat/lo-clwr-site-access

Conversation

@akashdhake

@akashdhake akashdhake commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Draft. Blocked on the generator release. This PR needs the @salesforce/templates change from forcedotcom/salesforcedx-templates (forcedotcom/salesforcedx-templates#949) released as 66.20.0+. After that release, a commit here bumps the dependency (currently ^66.19.0) and yarn.lock. Until then, CI fails because the published generator has no site/access support.

Adds --site and --access to sf template generate lightning-out for CLWR (Experience Cloud site) apps. Both can also be set in --definition-file.

  • --site "<site name>" links the app to an Experience Cloud site. It's written as <sites> in the LightningOutApp file.
  • --access guest generates only the LightningOutApp file. --access authenticated (the default) generates the full set.
  • LWR_CORE behaviour is unchanged, and --site/--access are rejected for it.

Safety rule: a CLWR app without a site is an error unless the project's sourceApiVersion is known to be below 69.0. At API 69.0+, deploying a CLWR app file without <sites> removes the app's existing site link (verified in an org).

  • The version is read from the project that contains --output-dir.
  • If the current directory is a different project, sf project deploy start would use that project's version, so it must also be below 69.0.
  • Unknown or unparsable versions fail closed.

The command also:

  • warns when --site is used with a project below 69.0, because the deploy fails;
  • drops the --api-version hint, because it doesn't change the deployed metadata version (verified in an org);
  • updates help and messages: site eligibility (Lightning Out (LWR) / Build Your Own (LWR) templates, active site), host-domain behaviour for CLWR, and that a deploy replaces the app's components and host domains.

Verification:

  • 134 unit tests and 33 NUTs pass, run against the local generator.
  • Lint is clean and snapshot:compare shows no changes.
  • Tested end to end with the real CLI against a 266 org: guest and authenticated generate → deploy → publish.

Release note (behaviour change)

sf template generate lightning-out --runtime CLWR now requires --site (or site in the definition file) when the project's sourceApiVersion is 69.0 or later, or can't be determined. To keep generating CLWR apps without a site link, use a project whose sourceApiVersion is below 69.0, and link the site in Setup.

What issues does this PR fix or reference?

Lightning Out 2.0: scaffold CLWR apps linked to an Experience Cloud site (guest and authenticated access). Depends on forcedotcom/salesforcedx-templates#949.

GUS: W-24812375 (depends on generator W-24812373)

- --site/--access flags and site/access definition-file keys (flag > file, per key)
- CLWR without a site is an error at sourceApiVersion >= 69.0 or with no DX project;
  allowed below 69.0 with the Setup site-link guidance
- 69.0 warnings for --site below 69.0 / without a project
- guest: no org-settings warning or ECA notes; warns on ignored eca inputs and
  on authenticated-only files left in the output dir
- unknown definition-file keys (now incl. nested eca.*) get a did-you-mean
- CLWR guidance: site linked on deploy, finish setup in Experience Builder
- --site pins --api-version 69.0
- unknown eca keys warned separately
- no-project and stale-files wording
- D3 site-required respects below-69 projects
- print the guest public-page line whether or not --site is given
- normalize null site/access to undefined in the merge
- stale-file scan is advisory: ignore fs errors and non-metadata files
- tests for the 68.0/69.0 pin boundaries and the stale-files negatives
- Org E2E: --api-version does not change the deployed manifest version
- --site on a 68.0 project fails with "Property 'sites' not valid in version 68.0" even pinned
- A 66.0 project fails "Not available for deploy for this API version" even with --api-version 68.0
- Drop the pin from the next-step command; warnings say to raise sourceApiVersion
…ersions strictly

Read sourceApiVersion from the project that contains --output-dir instead of the cwd.
Parse versions strictly so values such as 0x40 or 1e1 are unknown and CLWR fails closed.
Say that a site below 69.0 fails the deploy, warn that a later 69.0 redeploy without a site unlinks,
fix the CLWR host-domains help, list eligible site templates, and note that deploys replace lists.
… at 69.0+

Coerce a numeric sourceApiVersion (68) to a string instead of crashing.
Require a site for CLWR when the cwd project, which sets the deploy version, is at 69.0+ or unknown.
Warn when --site is given with an unrecognized sourceApiVersion.
…iVersion

Tell a non-project cwd apart from a cwd project without sourceApiVersion.
The latter deploys at the org default, so CLWR without a site now errors with a cwd message.
Also warn when a different cwd project is below the API version the app needs.
@akashdhake akashdhake changed the title feat(lightning-out): --site and --access for CLWR apps feat(lightning-out): @W-24812375@ --site and --access for CLWR apps Nov 6, 2026
Unrecognized definition-file keys now get the plain warning.

Exact key names are expected.
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