Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a JSON schema for composer.json #736

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 149 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.altis-dxp.com/schema.json",
"title": "Altis Core schema for composer.json",
"type": "object",
"definitions": {
"altis-modules": {
"title": "Configuration for Altis modules",
"description": "https://docs.altis-dxp.com/getting-started/configuration/",
"type": "object",
"properties": {
"analytics": {
"title": "Analytics module for Altis",
"description": "https://docs.altis-dxp.com/analytics/",
"type": "object",
"properties": {
"enabled": {
"description": "Whether this module is enabled",
"type": "boolean",
"default": true
},
"native": {
"description": "Whether to use native analytics",
"type": "boolean",
"default": true
}
}
},
"cms": {
"title": "CMS module for Altis",
"description": "https://docs.altis-dxp.com/cms/",
"type": "object",
"properties": {
"enabled": {
"description": "Whether this module is enabled",
"type": "boolean",
"default": true
},
"xmlrpc": {
"description": "Whether the XML-RPC API is enabled",
"type": "boolean",
"default": true
},
"shared-blocks": {
"description": "Whether shared blocks are enabled",
"type": "boolean",
"default": true
},
"favicon": {
"title": "Custom Favicon",
"description": "A project root relative path to an image file, or boolean false to disable the custom favicon",
"type": [
"string",
"boolean"
]
}
}
},
"dev-tools": {
"title": "Dev tools module for Altis",
"description": "https://docs.altis-dxp.com/dev-tools/",
"type": "object",
"properties": {
"enabled": {
"description": "Whether this module is enabled",
"type": "boolean",
"default": true
},
"phpunit": {
"title": "PHPUnit configuration parameters",
"type": "object"
}
}
}
}
}
},
"allOf": [
{
"type": "object",
"properties": {
"extra": {
"type": "object",
"properties": {
"altis": {
"type": "object",
"description": "Altis configuration",
"properties": {
"modules": {
"$ref": "#/definitions/altis-modules"
},
"environments": {
"description": "Configuration for local and Altis Cloud environments",
"type": "object",
"properties": {
"local": {
"description": "Local server environment",
"properties": {
"modules": {
"$ref": "#/definitions/altis-modules"
}
}
},
"ci": {
"description": "CI environment",
"properties": {
"modules": {
"$ref": "#/definitions/altis-modules"
}
}
},
"development": {
"description": "Development server cloud environment",
"properties": {
"modules": {
"$ref": "#/definitions/altis-modules"
}
}
},
"staging": {
"description": "Staging server cloud environment",
"properties": {
"modules": {
"$ref": "#/definitions/altis-modules"
}
}
},
"production": {
"description": "Production server cloud environment",
"properties": {
"modules": {
"$ref": "#/definitions/altis-modules"
}
}
}
},
"additionalProperties": false
}
}
}
}
}
}
},
{
"$ref": "https://getcomposer.org/schema.json"
}
]
}