@@ -22,7 +22,7 @@ import type { WebAppManifest } from './manifest.js';
2222const logger = Logger . childFromRoot ( 'WebappDiscovery' ) ;
2323
2424/**
25- * Default command to run when no webapplication .json manifest is found
25+ * Default command to run when no uibundle .json manifest is found
2626 */
2727export const DEFAULT_DEV_COMMAND = 'npm run dev' ;
2828
@@ -35,7 +35,7 @@ const WEBAPPLICATIONS_RELATIVE_PATH = 'main/default/uiBundles';
3535/**
3636 * Pattern to match webapplication metadata XML files
3737 */
38- const WEBAPP_META_XML_PATTERN = / ^ ( .+ ) \. w e b a p p l i c a t i o n - m e t a \. x m l $ / ;
38+ const WEBAPP_META_XML_PATTERN = / ^ ( .+ ) \. u i b u n d l e - m e t a \. x m l $ / ;
3939
4040/**
4141 * Discovered webapp with its directory path and optional manifest
@@ -45,15 +45,15 @@ 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 webapplication .json found) */
48+ /** Parsed manifest content (null if no uibundle .json found) */
4949 manifest : WebAppManifest | null ;
50- /** Webapp name (from .webapplication -meta.xml or folder name) */
50+ /** Webapp name (from .uibundle -meta.xml or folder name) */
5151 name : string ;
52- /** Whether this webapp has a webapplication .json manifest file */
52+ /** Whether this webapp has a uibundle .json manifest file */
5353 hasManifest : boolean ;
5454 /** Path to the manifest file (null if no manifest) */
5555 manifestPath : string | null ;
56- /** Whether this webapp has a .webapplication -meta.xml file (valid SFDX webapp) */
56+ /** Whether this webapp has a .uibundle -meta.xml file (valid SFDX webapp) */
5757 hasMetaXml : boolean ;
5858} ;
5959
@@ -81,7 +81,7 @@ function isWebapplicationsFolder(folderName: string): boolean {
8181}
8282
8383/**
84- * Check if a directory contains a {name}.webapplication -meta.xml file
84+ * Check if a directory contains a {name}.uibundle -meta.xml file
8585 * Returns the webapp name extracted from the filename, or null if not found.
8686 * Logs a warning if multiple metadata files are found (uses first match).
8787 */
@@ -103,7 +103,7 @@ async function findWebappMetaXml(dirPath: string): Promise<string | null> {
103103
104104 if ( matches . length > 1 ) {
105105 logger . warn (
106- `Multiple .webapplication -meta.xml files found in ${ dirPath } : ${ matches . join ( ', ' ) } . Using "${ matches [ 0 ] } ".`
106+ `Multiple .uibundle -meta.xml files found in ${ dirPath } : ${ matches . join ( ', ' ) } . Using "${ matches [ 0 ] } ".`
107107 ) ;
108108 }
109109
@@ -126,7 +126,7 @@ async function pathExists(path: string): Promise<boolean> {
126126}
127127
128128/**
129- * Try to parse a webapplication .json file.
129+ * Try to parse a uibundle .json file.
130130 * Accepts any valid JSON object - missing fields will use defaults.
131131 */
132132async function tryParseWebappManifest ( filePath : string ) : Promise < WebAppManifest | null > {
@@ -150,7 +150,7 @@ async function tryParseWebappManifest(filePath: string): Promise<WebAppManifest
150150 * Manifest does not have a name property - do not depend on it.
151151 *
152152 * @param folderName - The folder name (fallback)
153- * @param metaXmlName - Name extracted from .webapplication -meta.xml (or null)
153+ * @param metaXmlName - Name extracted from .uibundle -meta.xml (or null)
154154 * @returns The resolved webapp name
155155 */
156156function resolveWebappName ( folderName : string , metaXmlName : string | null ) : string {
@@ -266,12 +266,12 @@ function findWebapplicationsFolderUpward(
266266
267267/**
268268 * Discover all webapps inside the uiBundles folder.
269- * Only directories containing a {name}.webapplication -meta.xml file are considered valid webapps.
270- * If a webapplication .json exists, use it for dev configuration.
269+ * Only directories containing a {name}.uibundle -meta.xml file are considered valid webapps.
270+ * If a uibundle .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
274- * @returns Array of discovered webapps (only those with .webapplication -meta.xml)
274+ * @returns Array of discovered webapps (only those with .uibundle -meta.xml)
275275 */
276276async function discoverWebappsInFolder ( webappsFolderPath : string , cwd : string ) : Promise < DiscoveredWebapp [ ] > {
277277 try {
@@ -284,15 +284,15 @@ async function discoverWebappsInFolder(webappsFolderPath: string, cwd: string):
284284 const webappPromises = webappDirs . map ( async ( entry ) : Promise < DiscoveredWebapp | null > => {
285285 const webappPath = join ( webappsFolderPath , entry . name ) ;
286286
287- // Check for .webapplication -meta.xml file - this identifies valid webapps
287+ // Check for .uibundle -meta.xml file - this identifies valid webapps
288288 const metaXmlName = await findWebappMetaXml ( webappPath ) ;
289289
290- // Only include directories that have a .webapplication -meta.xml file
290+ // Only include directories that have a .uibundle -meta.xml file
291291 if ( ! metaXmlName ) {
292292 return null ;
293293 }
294294
295- const manifestFilePath = join ( webappPath , 'webapplication .json' ) ;
295+ const manifestFilePath = join ( webappPath , 'uibundle .json' ) ;
296296
297297 // Try to load manifest for dev configuration
298298 const manifest = await tryParseWebappManifest ( manifestFilePath ) ;
@@ -310,7 +310,7 @@ async function discoverWebappsInFolder(webappsFolderPath: string, cwd: string):
310310
311311 const results = await Promise . all ( webappPromises ) ;
312312
313- // Filter out null results (directories without .webapplication -meta.xml)
313+ // Filter out null results (directories without .uibundle -meta.xml)
314314 return results . filter ( ( webapp ) : webapp is DiscoveredWebapp => webapp !== null ) ;
315315 } catch {
316316 // Permission denied or other read error
@@ -338,7 +338,7 @@ type FindAllWebappsResult = {
338338 * Discovery strategy (in order):
339339 * 1. Check if inside a uiBundles/<webapp> directory (upward search)
340340 * 2. Check for SFDX project and search uiBundles in all package directories
341- * 3. If neither, check if current directory is a webapp (has .webapplication -meta.xml)
341+ * 3. If neither, check if current directory is a webapp (has .uibundle -meta.xml)
342342 *
343343 * @param cwd - Directory to search from (defaults to process.cwd())
344344 * @returns Object with discovered webapps and context information
@@ -379,12 +379,12 @@ async function findAllWebapps(cwd: string = process.cwd()): Promise<FindAllWebap
379379 }
380380
381381 // Step 3: If no uiBundles folder found, check if current directory IS a webapp
382- // (has a .webapplication -meta.xml file) - for running outside SFDX project context
382+ // (has a .uibundle -meta.xml file) - for running outside SFDX project context
383383 if ( ! webappsFolder ) {
384384 const metaXmlName = await findWebappMetaXml ( cwd ) ;
385385 if ( metaXmlName ) {
386386 // Current directory is a standalone webapp
387- const manifestFilePath = join ( cwd , 'webapplication .json' ) ;
387+ const manifestFilePath = join ( cwd , 'uibundle .json' ) ;
388388 const manifest = await tryParseWebappManifest ( manifestFilePath ) ;
389389 const webappName = resolveWebappName ( basename ( cwd ) , metaXmlName ) ;
390390
@@ -444,14 +444,14 @@ export type DiscoverWebappResult = {
444444 *
445445 * Discovery use cases:
446446 * 1. SFDX Project Root: Search uiBundles in all package directories
447- * - Webapps identified by {name}.webapplication -meta.xml
447+ * - Webapps identified by {name}.uibundle -meta.xml
448448 * - Always prompt for selection (even if only 1 webapp)
449449 *
450450 * 2. Inside uiBundles/<webapp> directory:
451451 * - Auto-select current webapp
452452 * - Error if --name conflicts with current directory
453453 *
454- * 3. Outside SFDX project with .webapplication -meta.xml in current dir:
454+ * 3. Outside SFDX project with .uibundle -meta.xml in current dir:
455455 * - Use current directory as standalone webapp
456456 *
457457 * @param name - Optional webapp name to search for (--name flag)
@@ -468,15 +468,15 @@ export async function discoverWebapp(
468468 // No webapps found
469469 if ( allWebapps . length === 0 ) {
470470 if ( webappsFolderFound ) {
471- // Folder exists but no valid webapps (no .webapplication -meta.xml files)
471+ // Folder exists but no valid webapps (no .uibundle -meta.xml files)
472472 throw new SfError (
473473 'Found "uiBundles" folder but no valid webapps inside it.\n' +
474- 'Each webapp must have a {name}.webapplication -meta.xml file.\n\n' +
474+ 'Each webapp must have a {name}.uibundle -meta.xml file.\n\n' +
475475 'Expected structure:\n' +
476476 ' uiBundles/\n' +
477477 ' └── my-app/\n' +
478- ' ├── my-app.webapplication -meta.xml (required)\n' +
479- ' └── webapplication .json (optional, for dev config)' ,
478+ ' ├── my-app.uibundle -meta.xml (required)\n' +
479+ ' └── uibundle .json (optional, for dev config)' ,
480480 'WebappNotFoundError'
481481 ) ;
482482 } else if ( inSfdxProject ) {
@@ -486,8 +486,8 @@ export async function discoverWebapp(
486486 'Create the folder structure in any package directory (e.g. force-app, packages/my-pkg):\n' +
487487 ' <package-path>/main/default/uiBundles/\n' +
488488 ' └── my-app/\n' +
489- ' ├── my-app.webapplication -meta.xml (required)\n' +
490- ' └── webapplication .json (optional, for dev config)' ,
489+ ' ├── my-app.uibundle -meta.xml (required)\n' +
490+ ' └── uibundle .json (optional, for dev config)' ,
491491 'WebappNotFoundError'
492492 ) ;
493493 } else {
@@ -497,7 +497,7 @@ export async function discoverWebapp(
497497 'To use this command, either:\n' +
498498 '1. Run from an SFDX project with webapps in <package>/main/default/uiBundles/\n' +
499499 '2. Run from inside a uiBundles/<webapp>/ directory\n' +
500- '3. Run from a directory containing a {name}.webapplication -meta.xml file' ,
500+ '3. Run from a directory containing a {name}.uibundle -meta.xml file' ,
501501 'WebappNotFoundError'
502502 ) ;
503503 }
0 commit comments