Static
BLOCKLISTjson 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.
Optional
perm: numberThe 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.
Optional
perm: numberThe permission.
See https://nodejs.org/dist/latest/docs/api/fs.html#fs_fs_access_path_mode_callback
Returns an array of ConfigEntry for each element in the config.
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)
Optional
decrypt: booleanIf it is an encrypted key, decrypt the value. If the value is an object, a clone will be returned.
Optional
decrypt: booleanReturns 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.
Optional
options: ConfigFile.OptionsReturns 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.
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 logged 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 logged 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.
Convert the config object to a JSON object. Returns the config contents. Same as calling ConfigStore.getContents
Updates the value for the key in the config object. If the value is an object, it will be merged with the existing object.
The key.
The value.
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.
Static
getReturns the default options for the config file.
If the file should be stored globally or locally.
Static
getStatic
resolveStatic
resolve
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