Skip to content

Instantly share code, notes, and snippets.

@jclark-dot-org
Created November 15, 2021 20:32
Show Gist options
  • Save jclark-dot-org/119c8e5ce7a2e74711551f603752d4c5 to your computer and use it in GitHub Desktop.
Save jclark-dot-org/119c8e5ce7a2e74711551f603752d4c5 to your computer and use it in GitHub Desktop.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://schemas.salesforce.com/sfdx-project.json",
"title": "Salesforce DX Project File",
"description": "The properties and shape of the SFDX project",
"type": "object",
"additionalProperties": false,
"required": ["packageDirectories"],
"properties": {
"packageDirectories": {
"title": "Package Directories",
"type": "array",
"description": "Package directories indicate which directories to target when syncing source to and from the scratch org. These directories can contain source from your managed package, unmanaged package, or unpackaged source, for example, ant tool or change set.",
"$comment": "The properties ancestorId & ancestorVersion cannot be included together, but this schema optimizes for VS Code code completion rather than pure validation.",
"minItems": 1,
"additionalItems": false,
"items": {
"type": "object",
"dependencies": {
"ancestorId": ["package", "versionNumber"],
"ancestorVersion": ["package", "versionNumber"],
"definitionFile": ["package", "versionNumber"],
"dependencies": ["package", "versionNumber"],
"package": ["versionNumber"],
"postInstallScript": ["package", "versionNumber"],
"postInstallUrl": ["package", "versionNumber"],
"releaseNotesUrl": ["package", "versionNumber"],
"uninstallScript": ["package", "versionNumber"],
"unpackagedMetadata": ["package", "versionNumber"],
"versionDescription": ["package", "versionNumber"],
"versionName": ["package", "versionNumber"],
"versionNumber": ["package"]
},
"required": ["path"],
"additionalProperties": false,
"properties": {
"ancestorId": {
"$ref": "#/definitions/packageDirectory.ancestorId"
},
"ancestorVersion": {
"$ref": "#/definitions/packageDirectory.ancestorVersion"
},
"default": {
"$ref": "#/definitions/packageDirectory.default"
},
"definitionFile": {
"$ref": "#/definitions/packageDirectory.definitionFile"
},
"dependencies": {
"$ref": "#/definitions/packageDirectory.dependencies"
},
"includeProfileUserLicenses": {
"$ref": "#/definitions/packageDirectory.includeProfileUserLicenses"
},
"package": {
"$ref": "#/definitions/packageDirectory.package"
},
"path": {
"$ref": "#/definitions/packageDirectory.path"
},
"postInstallScript": {
"$ref": "#/definitions/packageDirectory.postInstallScript"
},
"postInstallUrl": {
"$ref": "#/definitions/packageDirectory.postInstallUrl"
},
"releaseNotesUrl": {
"$ref": "#/definitions/packageDirectory.releaseNotesUrl"
},
"uninstallScript": {
"$ref": "#/definitions/packageDirectory.uninstallScript"
},
"unpackagedMetadata": {
"$ref": "#/definitions/packageDirectory.unpackagedMetadata"
},
"versionDescription": {
"$ref": "#/definitions/packageDirectory.versionDescription"
},
"versionName": {
"$ref": "#/definitions/packageDirectory.versionName"
},
"versionNumber": {
"$ref": "#/definitions/packageDirectory.versionNumber"
}
}
}
},
"name": {
"title": "name",
"type": "string",
"description": "The name of your Salesforce project."
},
"namespace": {
"title": "Namespace",
"type": "string",
"description": "The global namespace that is used with a package. The namespace must be registered with an org that is associated with your Dev Hub org. This namespace is assigned to scratch orgs created with the org:create command. If you’re creating an unlocked package, you have the option to create a package with no namespace."
},
"sourceApiVersion": {
"title": "Source API Version",
"type": "string",
"description": "The API version that the source is compatible with. The default is the same version as the Salesforce CLI.",
"default": "48.0"
},
"sfdcLoginUrl": {
"title": "SFDC Login URL",
"type": "string",
"description": "The login URL that the force:auth commands use. If not specified, the default is login.salesforce.com. Override the default value if you want users to authorize to a specific Salesforce instance. For example, if you want to authorize into a sandbox org, set this parameter to test.salesforce.com.",
"default": "https://login.salesforce.com"
},
"signupTargetLoginUrl": {
"type": "string",
"description": "The url that is used when creating new scratch orgs. This is typically only used for testing prerelease environments."
},
"oauthLocalPort": {
"type": "number",
"description": "By default, the OAuth port is 1717. However, change this port if this port is already in use, and you plan to create a connected app in your Dev Hub org to support JWT-based authorization."
},
"plugins": {
"title": "CLI Plugins custom settings",
"type": "object",
"description": "Salesforce CLI plugin configurations used with this project.",
"additionalProperties": true
},
"packageAliases": {
"title": "Aliases for packaging ids",
"type": "object",
"description": "The Salesforce CLI updates this file with the aliases when you create a package or package version. You can also manually update this section for existing packages or package versions. You can use the alias instead of the cryptic package ID when running CLI force:package commands.",
"patternProperties": {
"^[ -~]+$": {
"type": "string",
"pattern": "^(0Ho|033|05i|04t)([a-zA-Z0-9]{15}|[a-zA-Z0-9]{12})$"
}
}
}
},
"definitions": {
"packageDirectory.path": {
"title": "Path",
"type": "string",
"description": "If you don’t specify a path, the Salesforce CLI uses a placeholder when you create a package."
},
"packageDirectory.default": {
"title": "Default",
"type": "boolean",
"description": "If you have specified more than one path, include this parameter for the default path to indicate which is the default package directory.",
"default": true
},
"packageDirectory.package": {
"title": "Package Identifier",
"type": "string",
"description": "The package name you specified when creating the package."
},
"packageDirectory.versionName": {
"title": "Version Name",
"type": "string",
"description": "If not specified, the CLI uses versionNumber as the version name."
},
"packageDirectory.versionDescription": {
"title": "Version Description",
"type": "string",
"description": "Human readable version information, format not specified."
},
"packageDirectory.versionNumber": {
"title": "Version Number",
"type": "string",
"description": "Version numbers are formatted as major.minor.patch.build. For example, 1.2.1.8."
},
"packageDirectory.definitionFile": {
"title": "Definition File",
"type": "string",
"description": "Reference an external .json file to specify the features and org preferences required for the metadata of your package, such as the scratch org definition."
},
"packageDirectory.dependencies": {
"type": "array",
"description": "To specify dependencies for 2GP within the same Dev Hub, use either the package version alias or a combination of the package name and the version number.",
"items": {
"type": "object",
"required": ["package"],
"properties": {
"package": {
"type": "string"
},
"versionNumber": {
"type": "string"
}
}
}
},
"packageDirectory.ancestorId": {
"title": "Ancestor ID",
"type": "string",
"description": "The ancestor that’s the immediate parent of the version that you’re creating. The package version ID to supply starts with '05i'."
},
"packageDirectory.ancestorVersion": {
"title": "Ancestor Version",
"type": "string",
"description": "The ancestor that’s the immediate parent of the version that you’re creating. The ancestor version uses the format major.minor.patch.build."
},
"packageDirectory.releaseNotesUrl": {
"type": "string",
"title": "Release Notes Url",
"description": "The release notes url."
},
"packageDirectory.postInstallUrl": {
"type": "string",
"title": "Post Install Url",
"description": "The post install url."
},
"packageDirectory.postInstallScript": {
"type": "string",
"title": "Post Install Script",
"description": "The post install script."
},
"packageDirectory.uninstallScript": {
"type": "string",
"title": "Uninstall Script",
"description": "The uninstall script."
},
"packageDirectory.unpackagedMetadata": {
"type": "object",
"title": "Unpackaged Metadata",
"description": "Metadata not meant to be packaged, but deployed when testing packaged metadata",
"required": ["path"],
"properties": {
"path": {
"type": "string",
"title": "Path",
"description": "The path name of the package directory containing the unpackaged metadata"
}
}
},
"packageDirectory.includeProfileUserLicenses": {
"type": "boolean",
"title": "Include Profile User Licenses",
"description": "Whether to include <userLicense> elements in profile metadata "
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment