Skip to content

Commit 71617f9

Browse files
committed
refactor: rename uibundle.json to ui-bundle.json and update references
Rename manifest filename from uibundle.json to ui-bundle.json (with hyphen) across source, messages, and tests for consistency with the ui-bundle naming convention.
1 parent d3c1baa commit 71617f9

9 files changed

Lines changed: 45 additions & 45 deletions

File tree

messages/ui-bundle.dev.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ Name of the UI bundle to preview.
1818

1919
# flags.name.description
2020

21-
The unique name of the UI bundle, as defined by the "name" property in the uibundle.json runtime configuration file. The uibundle.json file is located in the "uiBundles" metadata directory of your DX project, such as force-app/main/default/uiBundles/MyApp/uibundle.json.
21+
The unique name of the UI bundle, as defined by the "name" property in the ui-bundle.json runtime configuration file. The ui-bundle.json file is located in the "uiBundles" metadata directory of your DX project, such as force-app/main/default/uiBundles/MyApp/ui-bundle.json.
2222

23-
If you don't specify this flag, the command automatically discovers the uibundle.json files in the current directory and subdirectories. If the command finds only one uibundle.json, it automatically uses it. If it finds multiple files, the command prompts you to select one.
23+
If you don't specify this flag, the command automatically discovers the ui-bundle.json files in the current directory and subdirectories. If the command finds only one ui-bundle.json, it automatically uses it. If it finds multiple files, the command prompts you to select one.
2424

2525
# flags.url.summary
2626

2727
URL where your developer server runs, such as https://localhost:5173. All UI, static, and hot deployment requests are forwarded to this URL.
2828

2929
# flags.url.description
3030

31-
You must specify this flag if the UI bundle's uibundle.json file doesn't contain a value for either the "dev.command" or "dev.url" configuration properties. All non-Salesforce API requests are forwarded to this URL.
31+
You must specify this flag if the UI bundle's ui-bundle.json file doesn't contain a value for either the "dev.command" or "dev.url" configuration properties. All non-Salesforce API requests are forwarded to this URL.
3232

33-
If you specify this flag, it overrides the value in the uibundle.json file.
33+
If you specify this flag, it overrides the value in the ui-bundle.json file.
3434

3535
This is the order of precedence that the dev server uses for the URL: --url flag > manifest dev.url > URL from the dev server process (which was started using either manifest dev.command or default npm run dev).
3636

@@ -52,7 +52,7 @@ This flag saves you from manually copying and pasting the URL. The browser opens
5252

5353
# examples
5454

55-
- Start the local development (dev) server by automatically discovering the UI bundle's uibundle.json file; use the org with alias "myorg":
55+
- Start the local development (dev) server by automatically discovering the UI bundle's ui-bundle.json file; use the org with alias "myorg":
5656

5757
<%= config.bin %> <%= command.id %> --target-org myorg
5858

@@ -182,7 +182,7 @@ Failed to watch manifest: %s.
182182
# error.dev-url-unreachable
183183

184184
Dev server unreachable at %s.
185-
Start your dev server manually at that URL, or add dev.command to uibundle.json to start it automatically.
185+
Start your dev server manually at that URL, or add dev.command to ui-bundle.json to start it automatically.
186186

187187
# error.dev-url-unreachable-with-flag
188188

@@ -219,13 +219,13 @@ Select the UI bundle to run:
219219

220220
# info.no-manifest-defaults
221221

222-
No uibundle.json found. Using defaults: dev command=%s, proxy port=%s.
222+
No ui-bundle.json found. Using defaults: dev command=%s, proxy port=%s.
223223

224224
Tip: See "sf ui-bundle dev --help" for configuration options.
225225

226226
# warning.empty-manifest
227227

228-
No dev configuration in uibundle.json - using defaults (command: %s).
228+
No dev configuration in ui-bundle.json - using defaults (command: %s).
229229

230230
Tip: See "sf ui-bundle dev --help" for configuration options.
231231

src/commands/ui-bundle/dev.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export default class UiBundleDev extends SfCommand<WebAppDevResult> {
182182

183183
try {
184184
// Step 1: Discover and select webapp
185-
this.logger.debug('Discovering uibundle.json manifest(s)...');
185+
this.logger.debug('Discovering ui-bundle.json manifest(s)...');
186186

187187
const { webapp: discoveredWebapp, allWebapps, autoSelected } = await discoverWebapp(flags.name);
188188

@@ -277,7 +277,7 @@ export default class UiBundleDev extends SfCommand<WebAppDevResult> {
277277
const resolvedUrl = flags.url ?? manifest?.dev?.url ?? (hasDevCommand ? 'http://localhost:5173' : null);
278278
if (!resolvedUrl) {
279279
throw new SfError(
280-
'❌ Unable to determine dev server URL. Specify --url or configure dev.url or dev.command in uibundle.json.',
280+
'❌ Unable to determine dev server URL. Specify --url or configure dev.url or dev.command in ui-bundle.json.',
281281
'DevServerUrlError'
282282
);
283283
}
@@ -303,7 +303,7 @@ export default class UiBundleDev extends SfCommand<WebAppDevResult> {
303303
// dev.url in manifest but no dev.command - don't start (we can't control the port)
304304
throw new SfError(messages.getMessage('error.dev-url-unreachable', [resolvedUrl]), 'DevServerUrlError', [
305305
`Ensure your dev server is running at ${resolvedUrl}`,
306-
'Or add dev.command to uibundle.json to start it automatically',
306+
'Or add dev.command to ui-bundle.json to start it automatically',
307307
]);
308308
} else {
309309
// URL not reachable - we have dev.command (or defaults) to start
@@ -372,7 +372,7 @@ export default class UiBundleDev extends SfCommand<WebAppDevResult> {
372372

373373
const suggestions: string[] = [
374374
'The dev server may be taking longer than expected to start',
375-
'Check if the dev server command is correct in uibundle.json',
375+
'Check if the dev server command is correct in ui-bundle.json',
376376
`Try running the command manually to see the error: ${devCommand}`,
377377
];
378378
const devError =
@@ -403,7 +403,7 @@ export default class UiBundleDev extends SfCommand<WebAppDevResult> {
403403
// Ensure devServerUrl is set (should always be set by step 3)
404404
if (!devServerUrl) {
405405
throw new SfError(
406-
'❌ Unable to determine dev server URL. Please specify --url or configure dev.url in uibundle.json.',
406+
'❌ Unable to determine dev server URL. Please specify --url or configure dev.url in ui-bundle.json.',
407407
'DevServerUrlError'
408408
);
409409
}

src/config/ManifestWatcher.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ export type ManifestChangeEvent = {
3838
*/
3939
type ManifestWatcherOptions = {
4040
/**
41-
* Path to the uibundle.json manifest file
42-
* Defaults to uibundle.json in the current working directory
41+
* Path to the ui-bundle.json manifest file
42+
* Defaults to ui-bundle.json in the current working directory
4343
*/
4444
manifestPath?: string;
4545

@@ -66,10 +66,10 @@ type ManifestWatcherEvents = {
6666
};
6767

6868
/**
69-
* ManifestWatcher loads and monitors the uibundle.json manifest file
69+
* ManifestWatcher loads and monitors the ui-bundle.json manifest file
7070
*
7171
* Features:
72-
* - Loads uibundle.json from project root
72+
* - Loads ui-bundle.json from project root
7373
* - Watches for file changes and emits events
7474
* - Provides helpful error messages
7575
* - Supports hot-reload without restarting the proxy
@@ -87,7 +87,7 @@ export class ManifestWatcher extends EventEmitter {
8787
super();
8888

8989
this.options = {
90-
manifestPath: options.manifestPath ?? join(process.cwd(), 'uibundle.json'),
90+
manifestPath: options.manifestPath ?? join(process.cwd(), 'ui-bundle.json'),
9191
watch: options.watch ?? true,
9292
debounceMs: options.debounceMs ?? 300,
9393
};
@@ -175,8 +175,8 @@ export class ManifestWatcher extends EventEmitter {
175175
});
176176
this.emit(
177177
'error',
178-
new SfError('uibundle.json was deleted', 'ManifestRemovedError', [
179-
'Recreate the uibundle.json file to continue',
178+
new SfError('ui-bundle.json was deleted', 'ManifestRemovedError', [
179+
'Recreate the ui-bundle.json file to continue',
180180
])
181181
);
182182
} else {
@@ -208,10 +208,10 @@ export class ManifestWatcher extends EventEmitter {
208208
private loadManifest(): void {
209209
// Check if file exists
210210
if (!existsSync(this.options.manifestPath)) {
211-
throw new SfError(`uibundle.json not found at ${this.options.manifestPath}`, 'ManifestNotFoundError', [
211+
throw new SfError(`ui-bundle.json not found at ${this.options.manifestPath}`, 'ManifestNotFoundError', [
212212
'Make sure you are in the correct directory',
213-
'Create a uibundle.json file in your project root',
214-
'Check that the file is named exactly "uibundle.json"',
213+
'Create a ui-bundle.json file in your project root',
214+
'Check that the file is named exactly "ui-bundle.json"',
215215
]);
216216
}
217217

@@ -221,7 +221,7 @@ export class ManifestWatcher extends EventEmitter {
221221
rawContent = readFileSync(this.options.manifestPath, 'utf-8');
222222
} catch (error) {
223223
throw new SfError(
224-
`Failed to read uibundle.json: ${error instanceof Error ? error.message : String(error)}`,
224+
`Failed to read ui-bundle.json: ${error instanceof Error ? error.message : String(error)}`,
225225
'ManifestReadError',
226226
['Check file permissions', 'Ensure the file is not locked by another process']
227227
);
@@ -232,7 +232,7 @@ export class ManifestWatcher extends EventEmitter {
232232
try {
233233
parsed = JSON.parse(rawContent) as WebAppManifest;
234234
} catch (error) {
235-
throw new SfError(`Invalid JSON in uibundle.json: ${(error as Error).message}`, 'ManifestParseError', [
235+
throw new SfError(`Invalid JSON in ui-bundle.json: ${(error as Error).message}`, 'ManifestParseError', [
236236
'Check for missing commas or brackets',
237237
'Validate JSON syntax using a JSON validator',
238238
'Common issues: trailing commas, unquoted keys, single quotes instead of double quotes',
@@ -272,7 +272,7 @@ export class ManifestWatcher extends EventEmitter {
272272
this.emit(
273273
'error',
274274
new SfError(`File watcher error: ${error.message}`, 'ManifestWatcherError', [
275-
'The uibundle.json file watcher encountered an error',
275+
'The ui-bundle.json file watcher encountered an error',
276276
'You may need to restart the command',
277277
])
278278
);

src/config/manifest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export type DevConfig = {
3939
};
4040

4141
/**
42-
* WebApp manifest configuration - defines the structure of uibundle.json file
42+
* WebApp manifest configuration - defines the structure of ui-bundle.json file
4343
* Extended from @salesforce/webapp-experimental with plugin-specific fields
4444
*/
4545
export type WebAppManifest = BaseWebAppManifest & {

src/config/webappDiscovery.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import type { WebAppManifest } from './manifest.js';
2222
const logger = Logger.childFromRoot('WebappDiscovery');
2323

2424
/**
25-
* Default command to run when no uibundle.json manifest is found
25+
* Default command to run when no ui-bundle.json manifest is found
2626
*/
2727
export const DEFAULT_DEV_COMMAND = 'npm run dev';
2828

@@ -45,11 +45,11 @@ export type DiscoveredWebapp = {
4545
path: string;
4646
/** Relative path from cwd to the webapp directory */
4747
relativePath: string;
48-
/** Parsed manifest content (null if no uibundle.json found) */
48+
/** Parsed manifest content (null if no ui-bundle.json found) */
4949
manifest: WebAppManifest | null;
5050
/** Webapp name (from .uibundle-meta.xml or folder name) */
5151
name: string;
52-
/** Whether this webapp has a uibundle.json manifest file */
52+
/** Whether this webapp has a ui-bundle.json manifest file */
5353
hasManifest: boolean;
5454
/** Path to the manifest file (null if no manifest) */
5555
manifestPath: string | null;
@@ -126,7 +126,7 @@ async function pathExists(path: string): Promise<boolean> {
126126
}
127127

128128
/**
129-
* Try to parse a uibundle.json file.
129+
* Try to parse a ui-bundle.json file.
130130
* Accepts any valid JSON object - missing fields will use defaults.
131131
*/
132132
async function tryParseWebappManifest(filePath: string): Promise<WebAppManifest | null> {
@@ -267,7 +267,7 @@ function findWebapplicationsFolderUpward(
267267
/**
268268
* Discover all webapps inside the uiBundles folder.
269269
* Only directories containing a {name}.uibundle-meta.xml file are considered valid webapps.
270-
* If a uibundle.json exists, use it for dev configuration.
270+
* If a ui-bundle.json exists, use it for dev configuration.
271271
*
272272
* @param webappsFolderPath - Absolute path to the uiBundles folder
273273
* @param cwd - Original working directory for relative path calculation
@@ -292,7 +292,7 @@ async function discoverWebappsInFolder(webappsFolderPath: string, cwd: string):
292292
return null;
293293
}
294294

295-
const manifestFilePath = join(webappPath, 'uibundle.json');
295+
const manifestFilePath = join(webappPath, 'ui-bundle.json');
296296

297297
// Try to load manifest for dev configuration
298298
const manifest = await tryParseWebappManifest(manifestFilePath);
@@ -384,7 +384,7 @@ async function findAllWebapps(cwd: string = process.cwd()): Promise<FindAllWebap
384384
const metaXmlName = await findWebappMetaXml(cwd);
385385
if (metaXmlName) {
386386
// Current directory is a standalone webapp
387-
const manifestFilePath = join(cwd, 'uibundle.json');
387+
const manifestFilePath = join(cwd, 'ui-bundle.json');
388388
const manifest = await tryParseWebappManifest(manifestFilePath);
389389
const webappName = resolveWebappName(basename(cwd), metaXmlName);
390390

@@ -476,7 +476,7 @@ export async function discoverWebapp(
476476
' uiBundles/\n' +
477477
' └── my-app/\n' +
478478
' ├── my-app.uibundle-meta.xml (required)\n' +
479-
' └── uibundle.json (optional, for dev config)',
479+
' └── ui-bundle.json (optional, for dev config)',
480480
'UIBundleNotFoundError'
481481
);
482482
} else if (inSfdxProject) {
@@ -487,7 +487,7 @@ export async function discoverWebapp(
487487
' <package-path>/main/default/uiBundles/\n' +
488488
' └── my-app/\n' +
489489
' ├── my-app.uibundle-meta.xml (required)\n' +
490-
' └── uibundle.json (optional, for dev config)',
490+
' └── ui-bundle.json (optional, for dev config)',
491491
'UIBundleNotFoundError'
492492
);
493493
} else {

src/server/DevServerManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ export class DevServerManager extends EventEmitter {
359359
this.logger.error(`Dev server process error: ${error.message}`);
360360

361361
const sfError = new SfError(`❌ Dev server process error: ${error.message}`, 'DevServerProcessError', [
362-
'Check that the command is correct in uibundle.json',
362+
'Check that the command is correct in ui-bundle.json',
363363
'Verify all dependencies are installed',
364364
'Try running the command manually to see the error',
365365
]);

test/commands/ui-bundle/helpers/webappProjectUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ export function createWebappDirWithoutMeta(projectDir: string, name: string): vo
148148
}
149149

150150
/**
151-
* Overwrite the `uibundle.json` manifest for a given UI bundle.
151+
* Overwrite the `ui-bundle.json` manifest for a given UI bundle.
152152
*/
153153
export function writeManifest(projectDir: string, webAppName: string, manifest: Record<string, unknown>): void {
154-
writeFileSync(join(webappPath(projectDir, webAppName), 'uibundle.json'), JSON.stringify(manifest, null, 2));
154+
writeFileSync(join(webappPath(projectDir, webAppName), 'ui-bundle.json'), JSON.stringify(manifest, null, 2));
155155
}
156156

157157
/**

test/config/ManifestWatcher.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import type { WebAppManifest, ManifestChangeEvent } from '../../src/config/types
2525
describe('ManifestWatcher', () => {
2626
const $$ = new TestContext();
2727
const testDir = join(process.cwd(), '.test-manifests');
28-
const testManifestPath = join(testDir, 'uibundle.json');
28+
const testManifestPath = join(testDir, 'ui-bundle.json');
2929

3030
const validManifest: WebAppManifest = {
3131
name: 'testApp',
@@ -90,7 +90,7 @@ describe('ManifestWatcher', () => {
9090
} catch (error) {
9191
expect(error).to.be.instanceOf(SfError);
9292
expect((error as SfError).name).to.equal('ManifestNotFoundError');
93-
expect((error as SfError).message).to.include('uibundle.json not found');
93+
expect((error as SfError).message).to.include('ui-bundle.json not found');
9494
expect((error as SfError).actions).to.exist;
9595
}
9696

@@ -125,7 +125,7 @@ describe('ManifestWatcher', () => {
125125

126126
it('should handle read permission errors', async () => {
127127
// Create a file path that doesn't exist to simulate read error
128-
const invalidPath = join(testDir, 'nonexistent', 'uibundle.json');
128+
const invalidPath = join(testDir, 'nonexistent', 'ui-bundle.json');
129129

130130
const watcher = new ManifestWatcher({ manifestPath: invalidPath, watch: false });
131131

@@ -431,8 +431,8 @@ describe('ManifestWatcher', () => {
431431
});
432432

433433
describe('Default Options', () => {
434-
it('should use uibundle.json in current directory by default', async () => {
435-
const defaultPath = join(process.cwd(), 'uibundle.json');
434+
it('should use ui-bundle.json in current directory by default', async () => {
435+
const defaultPath = join(process.cwd(), 'ui-bundle.json');
436436

437437
// Create manifest in current directory
438438
writeFileSync(defaultPath, JSON.stringify(validManifest, null, 2));

test/config/webappDiscovery.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('webappDiscovery', () => {
3838
// Create required .uibundle-meta.xml file
3939
writeFileSync(join(appPath, `${name}.uibundle-meta.xml`), '<WebApplication/>');
4040
if (manifest) {
41-
writeFileSync(join(appPath, 'uibundle.json'), JSON.stringify(manifest));
41+
writeFileSync(join(appPath, 'ui-bundle.json'), JSON.stringify(manifest));
4242
}
4343
return appPath;
4444
}

0 commit comments

Comments
 (0)