From 3be3118820429701af2e1f78198313d0a91b862c Mon Sep 17 00:00:00 2001 From: k-j-kim Date: Fri, 8 May 2026 11:10:54 -0700 Subject: [PATCH] fix: use sf template generate ui-bundle command in NUTs The `sf ui-bundle generate` command does not exist; the correct command shipped by @salesforce/plugin-templates is `sf template generate ui-bundle`. Update test helpers and dev.nut.ts to call the correct command. --- test/commands/ui-bundle/dev.nut.ts | 2 +- test/commands/ui-bundle/helpers/uiBundleProjectUtils.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/commands/ui-bundle/dev.nut.ts b/test/commands/ui-bundle/dev.nut.ts index 721d054..c1841f7 100644 --- a/test/commands/ui-bundle/dev.nut.ts +++ b/test/commands/ui-bundle/dev.nut.ts @@ -121,7 +121,7 @@ describe('ui-bundle dev NUTs — Tier 2 CLI validation', () => { // Discovery treats this as ambiguous intent and rejects it. it('should error on --name conflict when inside a different uiBundle', () => { const projectDir = createProjectWithUiBundle(session, 'nameConflict', 'appA'); - execSync('sf ui-bundle generate --name appB', { + execSync('sf template generate ui-bundle --name appB', { cwd: projectDir, stdio: 'pipe', env: { ...process.env, HOME: REAL_HOME, USERPROFILE: REAL_HOME }, diff --git a/test/commands/ui-bundle/helpers/uiBundleProjectUtils.ts b/test/commands/ui-bundle/helpers/uiBundleProjectUtils.ts index 8423f1a..6bfee2d 100644 --- a/test/commands/ui-bundle/helpers/uiBundleProjectUtils.ts +++ b/test/commands/ui-bundle/helpers/uiBundleProjectUtils.ts @@ -23,7 +23,7 @@ import { UI_BUNDLES_FOLDER } from '../../../../src/config/uiBundleDiscovery.js'; /** * Real home directory captured at module load, before TestSession overrides process.env.HOME. - * Used when running `sf ui-bundle generate` so the CLI finds linked plugin-templates + * Used when running `sf template generate ui-bundle` so the CLI finds linked plugin-templates * (TestSession sets HOME to a temp dir, which hides linked plugins). */ export const REAL_HOME = homedir(); @@ -98,12 +98,12 @@ export function createProject(session: TestSession, name: string): string { } /** - * Run `sf project generate` then `sf ui-bundle generate --name ` inside + * Run `sf project generate` then `sf template generate ui-bundle --name ` inside * the project. Returns the absolute path to the generated project root. */ export function createProjectWithUiBundle(session: TestSession, projectName: string, uiBundleName: string): string { const projectDir = createProject(session, projectName); - execSync(`sf ui-bundle generate --name ${uiBundleName}`, { + execSync(`sf template generate ui-bundle --name ${uiBundleName}`, { cwd: projectDir, stdio: 'pipe', env: { ...process.env, HOME: REAL_HOME, USERPROFILE: REAL_HOME }, @@ -122,7 +122,7 @@ export function createProjectWithMultipleUiBundles( ): string { const projectDir = createProject(session, projectName); for (const name of uiBundleNames) { - execSync(`sf ui-bundle generate --name ${name}`, { + execSync(`sf template generate ui-bundle --name ${name}`, { cwd: projectDir, stdio: 'pipe', env: { ...process.env, HOME: REAL_HOME, USERPROFILE: REAL_HOME },