@@ -96,7 +96,7 @@ export interface LoadDwJsonOptions {
9696 /** Explicit path to dw.json (skips searching if provided) */
9797 path ?: string ;
9898 /** Starting directory for search (defaults to cwd) */
99- startDir ?: string ;
99+ workingDirectory ?: string ;
100100}
101101
102102/**
@@ -112,7 +112,7 @@ export interface LoadDwJsonResult {
112112/**
113113 * Finds dw.json by searching upward from the starting directory.
114114 *
115- * @param startDir - Directory to start searching from (defaults to cwd)
115+ * @param workingDirectory - Directory to start searching from (defaults to cwd)
116116 * @returns Path to dw.json if found, undefined otherwise
117117 *
118118 * @example
@@ -121,8 +121,8 @@ export interface LoadDwJsonResult {
121121 * console.log(`Found dw.json at ${dwPath}`);
122122 * }
123123 */
124- export function findDwJson ( startDir : string = process . cwd ( ) ) : string | undefined {
125- let dir = startDir ;
124+ export function findDwJson ( workingDirectory : string = process . cwd ( ) ) : string | undefined {
125+ let dir = workingDirectory ;
126126 const root = path . parse ( dir ) . root ;
127127
128128 while ( dir !== root ) {
@@ -209,7 +209,7 @@ function selectConfig(json: DwJsonMultiConfig, instanceName?: string): DwJsonCon
209209 */
210210export function loadFullDwJson ( options : LoadDwJsonOptions = { } ) : { config : DwJsonMultiConfig ; path : string } | undefined {
211211 const logger = getLogger ( ) ;
212- const dwJsonPath = options . path ?? path . join ( options . startDir || process . cwd ( ) , 'dw.json' ) ;
212+ const dwJsonPath = options . path ?? path . join ( options . workingDirectory || process . cwd ( ) , 'dw.json' ) ;
213213
214214 logger . trace ( { path : dwJsonPath } , '[DwJsonSource] Checking for config file' ) ;
215215
@@ -247,7 +247,7 @@ export interface AddInstanceOptions {
247247 /** Path to dw.json (defaults to ./dw.json) */
248248 path ?: string ;
249249 /** Starting directory for search */
250- startDir ?: string ;
250+ workingDirectory ?: string ;
251251 /** Whether to set as active instance */
252252 setActive ?: boolean ;
253253}
@@ -263,7 +263,7 @@ export interface AddInstanceOptions {
263263 * @throws Error if instance with same name already exists
264264 */
265265export function addInstance ( instance : DwJsonConfig , options : AddInstanceOptions = { } ) : void {
266- const dwJsonPath = options . path ?? path . join ( options . startDir || process . cwd ( ) , 'dw.json' ) ;
266+ const dwJsonPath = options . path ?? path . join ( options . workingDirectory || process . cwd ( ) , 'dw.json' ) ;
267267
268268 let existing : DwJsonMultiConfig = { } ;
269269 if ( fs . existsSync ( dwJsonPath ) ) {
@@ -322,7 +322,7 @@ export interface RemoveInstanceOptions {
322322 /** Path to dw.json */
323323 path ?: string ;
324324 /** Starting directory for search */
325- startDir ?: string ;
325+ workingDirectory ?: string ;
326326}
327327
328328/**
@@ -333,7 +333,7 @@ export interface RemoveInstanceOptions {
333333 * @throws Error if instance not found or dw.json doesn't exist
334334 */
335335export function removeInstance ( name : string , options : RemoveInstanceOptions = { } ) : void {
336- const dwJsonPath = options . path ?? path . join ( options . startDir || process . cwd ( ) , 'dw.json' ) ;
336+ const dwJsonPath = options . path ?? path . join ( options . workingDirectory || process . cwd ( ) , 'dw.json' ) ;
337337
338338 if ( ! fs . existsSync ( dwJsonPath ) ) {
339339 throw new Error ( 'No dw.json file found' ) ;
@@ -364,7 +364,7 @@ export interface SetActiveInstanceOptions {
364364 /** Path to dw.json */
365365 path ?: string ;
366366 /** Starting directory for search */
367- startDir ?: string ;
367+ workingDirectory ?: string ;
368368}
369369
370370/**
@@ -375,7 +375,7 @@ export interface SetActiveInstanceOptions {
375375 * @throws Error if instance not found or dw.json doesn't exist
376376 */
377377export function setActiveInstance ( name : string , options : SetActiveInstanceOptions = { } ) : void {
378- const dwJsonPath = options . path ?? path . join ( options . startDir || process . cwd ( ) , 'dw.json' ) ;
378+ const dwJsonPath = options . path ?? path . join ( options . workingDirectory || process . cwd ( ) , 'dw.json' ) ;
379379
380380 if ( ! fs . existsSync ( dwJsonPath ) ) {
381381 throw new Error ( 'No dw.json file found' ) ;
@@ -418,7 +418,7 @@ export function setActiveInstance(name: string, options: SetActiveInstanceOption
418418 * Loads configuration from a dw.json file.
419419 *
420420 * If an explicit path is provided, uses that file. Otherwise, looks for dw.json
421- * in the startDir (or cwd). Does NOT search parent directories.
421+ * in the workingDirectory (or cwd). Does NOT search parent directories.
422422 *
423423 * Use `findDwJson()` if you need to search upward through parent directories.
424424 *
@@ -434,7 +434,7 @@ export function setActiveInstance(name: string, options: SetActiveInstanceOption
434434 * }
435435 *
436436 * // Load from specific directory
437- * const result = loadDwJson({ startDir : '/path/to/project' });
437+ * const result = loadDwJson({ workingDirectory : '/path/to/project' });
438438 *
439439 * // Use named instance
440440 * const result = loadDwJson({ instance: 'staging' });
@@ -446,7 +446,7 @@ export function loadDwJson(options: LoadDwJsonOptions = {}): LoadDwJsonResult |
446446 const logger = getLogger ( ) ;
447447
448448 // If explicit path provided, use it. Otherwise default to ./dw.json (no upward search)
449- const dwJsonPath = options . path ?? path . join ( options . startDir || process . cwd ( ) , 'dw.json' ) ;
449+ const dwJsonPath = options . path ?? path . join ( options . workingDirectory || process . cwd ( ) , 'dw.json' ) ;
450450
451451 logger . trace ( { path : dwJsonPath } , '[DwJsonSource] Checking for config file' ) ;
452452
0 commit comments