Returns the package directory.
Get the currently activated package on the project. This has no implication on sfdx-project.json but is useful for keeping track of package and source specific options in a process.
Get the project's default package directory defined in sfdx-project.json using first 'default: true' found. The first entry is returned if no default is specified.
Returns the package directory.
Name of the package directory. E.g., 'force-app'
Returns a read-only list of packageDirectories
within sfdx-project.json, first reading
and validating the file if necessary. i.e. modifying this array will not affect the
sfdx-project.json file.
Returns the package from a file path.
A file path. E.g. /Users/jsmith/projects/ebikes-lwc/force-app/apex/my-cls.cls
retrieve the configuration for a named plugin from sfdx-project.json.plugins.pluginName
const project = await SfProject.resolve();
const pluginConfig = await project.getPluginConfiguration('myPlugin');
optionally pass a type parameter for your plugin configuration's schema
Get the sfdx-project.json config. The global sfdx-project.json is used for user defaults that are not checked in to the project specific file.
Note: When reading values from SfProjectJson, it is recommended to use SfProject.resolveProjectConfig instead.
This is the sync method of SfProject.resolveSfProjectJson
True to get the global project file, otherwise the local project config.
Returns a read-only list of packageDirectories
within sfdx-project.json, first reading
and validating the file if necessary. i.e. modifying this array will not affect the
sfdx-project.json file.
There can be multiple packages in packageDirectories that point to the same directory. This method only returns one packageDirectory entry per unique directory path. This is useful when doing source operations based on directories but probably not as useful for packaging operations that want to do something for each package entry.
Get a list of the unique package names from within sfdx-project.json. Use SfProject.getUniquePackageDirectories for data other than the names.
The project config is resolved from local and global SfProjectJson, ConfigAggregator, and a set of defaults. It is recommended to use this when reading values from SfProjectJson.
The global SfProjectJson is used to allow the user to provide default values they may not want checked into their project's source.
A resolved config object that contains a bunch of different properties, including some 3rd party custom properties.
Get the sfdx-project.json config. The global sfdx-project.json is used for user defaults that are not checked in to the project specific file.
Note: When reading values from SfProjectJson, it is recommended to use SfProject.resolveProjectConfig instead.
True to get the global project file, otherwise the local project config.
Set the currently activated package on the project. This has no implication on sfdx-project.json but is useful for keeping track of package and source specific options in a process.
The package name to activate. E.g. 'force-app'
set the configuration for a named plugin from sfdx-project.json.plugins.pluginName, overwriting existing configuration
const project = await SfProject.resolve();
const pluginConfig = await project.setPluginConfiguration('myPlugin', {foo: 'bar', myLimit: 25});
optionally pass a type parameter for your plugin configuration's schema
Static
clearStatic
getStatic
resolveStatic
resolvePerforms an upward directory search for an sfdx project file. Returns the absolute path to the project.
Optional
dir: stringThe directory path to start traversing from.
Throws SfError{ name: 'InvalidProjectWorkspaceError' } If the current folder is not located in a workspace.
See traverseForFile
See process.cwd()
Static
resolvePerforms a synchronous upward directory search for an sfdx project file. Returns the absolute path to the project.
Optional
dir: stringThe directory path to start traversing from.
Throws SfError{ name: 'InvalidProjectWorkspaceError' } If the current folder is not located in a workspace.
See traverseForFileSync
See process.cwd()
Represents an SFDX project directory. This directory contains a SfProjectJson config file as well as a hidden .sfdx folder that contains all the other local project config files.