Package Exports
- @salesforce/schemas
- @salesforce/schemas/index.js
- @salesforce/schemas/sfdx-project.schema.json
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@salesforce/schemas) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Salesforce DX Schemas
JSON Schemas help with validation and code completion of json files. Below are the schemas that are available in this repository.
- Schema: project-scratch-def.json
- Schema: sfdx-project.json
Using the Schemas
If you are using the Salesforce Extensions for Visual Studio Code these schemas are already included for you.
For most other editors, you can use the schemas by adding the $schema
property to the top of your JSON file with the link to the schema document as shown below.
{
"$schema": "https://raw.githubusercontent.com/forcedotcom/schemas/main/sfdx-project.schema.json"
//...
}
You can also use these schemas programatially. For example, Salesforce CLI uses these schema to do certain validation.
const schemas = require('@salesforce/schemas');
const projectJsonSchema = require(schemas['sfdx-project']);
// OR
const projectJsonSchema = require('@salesforce/schema/sfdx-project-schema.json']);
Updating project-scratch-def.schema.json
Run the update-scratch-def-*.js
scripts on every major release and open a PR with the new changes against the main
branch to keep the schema files up to date.
Bugs and Feedback
To report issues or feedback with the schemas, open a bug on GitHub.