Skip to content
View as Markdown
View as Markdown

@salesforce/b2c-tooling-sdk / discovery / detectWorkspaceType

Function: detectWorkspaceType()

detectWorkspaceType(workspacePath, options?): Promise<DetectionResult>

Defined in: packages/b2c-tooling-sdk/src/discovery/detector.ts:124

Creates a WorkspaceTypeDetector and performs detection in one call.

This is a convenience function for simple detection use cases.

Parameters

workspacePath

string

Path to the workspace directory

options?

DetectOptions

Detection options

Returns

Promise<DetectionResult>

Detection result with all matched project types

Example

typescript
import { detectWorkspaceType } from '@salesforce/b2c-tooling-sdk/discovery';

const result = await detectWorkspaceType(process.cwd());
console.log(`Detected types: ${result.projectTypes.join(', ')}`);
console.log(`Patterns: ${result.matchedPatterns.join(', ')}`);

Released under the Apache-2.0 License.