StaticBLOCKLISTjson properties that are uppercase, or allow uppercase keys inside them
Determines if the config file is read/write accessible. Returns true if the user has capabilities specified
by perm.
Optionalperm: number
The permission.
See https://nodejs.org/dist/latest/docs/api/fs.html#fs_fs_access_path_mode_callback
Determines if the config file is read/write accessible. Returns true if the user has capabilities specified
by perm.
Optionalperm: number
The permission.
See https://nodejs.org/dist/latest/docs/api/fs.html#fs_fs_access_path_mode_callback
Add a package alias to the project. If the alias already exists, it will be overwritten.
Add a bundle entry to the project. If the bundle entry already exists, the new entry properties will be merged with the existing properties.
Add a bundle alias to the project. If the bundle alias already exists, it will be overwritten.
The alias name
The bundle ID
Add a package directory to the project. If the package directory already exists, the new directory properties will be merged with the existing properties.
Removes all key/value pairs from the config object.
Returns an array of ConfigEntry for each element in the config.
Check to see if the config file exists. Returns true if the config file exists and has access, false otherwise.
Check to see if the config file exists. Returns true if the config file exists and has access, false otherwise.
Invokes actionFn once for each key-value pair present in the config object.
The function (key: string, value: ConfigValue) => void to be called for each element.
Returns the value associated to the key, or undefined if there is none.
The key (object property)
Optionaldecrypt: boolean
If it is an encrypted key, decrypt the value. If the value is an object, a clone will be returned.
Returns the value associated to the key, or undefined if there is none.
The key (object property)
Optionaldecrypt: boolean
If it is an encrypted key, decrypt the value. If the value is an object, a clone will be returned.
Returns the entire config contents.
NOTE: Data will still be encrypted unless decrypt is passed in. A clone of the data will be returned to prevent storing un-encrypted data in memory and potentially saving to the file system.
Optionaloptions: ConfigFile.OptionsReturns the list of keys that contain a value.
The value to filter keys on.
Get package aliases defined in the project.
Get package bundle aliases defined in the project.
Returns the packageDirectories within sfdx-project.json, first reading
and validating the file if necessary.
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 absolute path to the config file.
The first time getPath is called, the path is resolved and becomes immutable. This allows implementers to override options properties, like filePath, on the init method for async creation. If that is required for creation, the config files can not be synchronously created.
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.
Returns a boolean asserting whether a value has been associated to the key in the config object or not.
Has multiple package bundles defined in the project.
Has multiple package directories (MPD) defined in the project.
Has at least one package alias defined in the project.
Has at least one package bundle alias defined in the project.
Has package directories defined in the project.
Returns true if this config is using the global path, false otherwise.
Returns an array that contains the keys for each element in the config object.
Read the config file and set the config contents. Returns the config contents of the config file. As an
optimization, files are only read once per process and updated in memory and via write(). To force
a read from the filesystem pass force=true.
Throws SfError{ name: 'UnexpectedJsonFileFormat' } There was a problem reading or parsing the file.
Read the config file and set the config contents. Returns the config contents of the config file. As an
optimization, files are only read once per process and updated in memory and via write(). To force
a read from the filesystem pass force=true.
Throws SfError{ name: 'UnexpectedJsonFileFormat' } There was a problem reading or parsing the file.
force a reread of the project contents if you know they may have been modified
Validates sfdx-project.json against the schema.
Set the SFDX_PROJECT_JSON_VALIDATION environment variable to true to throw an error when schema validation fails.
A warning is emitted by default when the file is invalid.
See [sfdx-project.schema.json] ((https://github.com/forcedotcom/schemas/blob/main/sfdx-project.schema.json)
Validates sfdx-project.json against the schema.
Set the SFDX_PROJECT_JSON_VALIDATION environment variable to true to throw an error when schema validation fails.
A warning is emitted by default when the file is invalid.
See [sfdx-project.schema.json] ((https://github.com/forcedotcom/schemas/blob/main/sfdx-project.schema.json)
Sets the value for the key in the config object. This will override the existing value. To do a partial update, use BaseConfigStore.update.
The key.
The value.
Convert an object to a ConfigContents and set it as the config contents.
The object.
Get the stats of the file. Returns the stats of the file.
fs.stat
Get the stats of the file. Returns the stats of the file.
fs.stat
Convert the config object to a JSON object. Returns the config contents. Same as calling ConfigStore.getContents
Delete the config file if it exists.
Throws Error{ name: 'TargetFileNotFound' } If the ConfigFile.getFilename file is not found.
fs.unlink
Delete the config file if it exists.
Throws Error{ name: 'TargetFileNotFound' } If the ConfigFile.getFilename file is not found.
fs.unlink
Returns true if an element in the config object existed and has been removed, or false if the element does not
exist. BaseConfigStore.has will return false afterwards.
The key
Returns true if all elements in the config object existed and have been removed, or false if all the elements
do not exist (some may have been removed). BaseConfigStore.has(key) will return false afterwards.
The keys
Returns an array that contains the values for each element in the config object.
Write the config file with new contents. If no new contents are provided it will write the existing config contents that were set from ConfigFile.read, or an empty file if ConfigFile.read was not called.
Write the config file with new contents. If no new contents are provided it will write the existing config contents that were set from ConfigFile.read, or an empty file if ConfigFile.read was not called.
StaticgetReturns the default options for the config file.
If the file should be stored globally or locally.
StaticgetReturns the config's filename.
StaticresolveHelper used to determine what the local and global folder point to. Returns the file path of the root folder.
True if the config should be global. False for local.
StaticresolveHelper used to determine what the local and global folder point to. Returns the file path of the root folder.
True if the config should be global. False for local.
The sfdx-project.json config object. This file determines if a folder is a valid sfdx project.
Note: Any non-standard (not owned by Salesforce) properties stored in sfdx-project.json should be in a top level property that represents your project. Plugins should store their configuration
See
Example: reading a standard property
See force:project:create