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

feat: support engines property #152

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
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
19 changes: 19 additions & 0 deletions packages/zeebe-element-templates-json-schema/src/defs/engines.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$id": "#/engines",
"type": "object",
"description": "Defines the compatibility of this element template with different engines. Keys are engine names, values are semantic version ranges.",
"default": {},
"examples": [
{
"camunda": "^8.5"
}
],
"properties": {
nikku marked this conversation as resolved.
Show resolved Hide resolved
"camunda": {
"$id": "#/engines/camunda",
"type": "string",
"description": "A semantic version range that denotes compatible Camunda versions.",
"default": ""
}
}
}
3 changes: 3 additions & 0 deletions packages/zeebe-element-templates-json-schema/src/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"$ref": "#/definitions/properties",
"$id": "#/properties"
},
"engines": {
"$ref": "src/defs/engines.json"
},
"icon": {
"$ref": "src/defs/icon.json"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
export const template = {
'name': 'Engines Invalid Versions',
'id': 'foo',
'appliesTo': [
'bpmn:Task'
],
'engines': {
'camunda': [ '8.5' ],
},
'properties': [],
};

export const errors = [
{
dataPath: '/engines/camunda',
keyword: 'type',
message: 'should be string',
params: {
type: 'string'
},
schemaPath: '#/properties/engines/properties/camunda/type'
},
{
keyword: 'type',
dataPath: '',
schemaPath: '#/oneOf/1/type',
params: {
type: 'array'
},
message: 'should be array'
},
{
keyword: 'oneOf',
dataPath: '',
schemaPath: '#/oneOf',
params: {
passingSchemas: null
},
message: 'should match exactly one schema in oneOf'
}
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
export const template = {
'name': 'Engines Invalid',
'id': 'foo',
'appliesTo': [
'bpmn:Task'
],
'engines': '8.5',
'properties': [],
};

export const errors = [
{
dataPath: '/engines',
keyword: 'type',
message: 'should be object',
params: {
type: 'object'
},
schemaPath: '#/properties/engines/type'
},
{
keyword: 'type',
dataPath: '',
schemaPath: '#/oneOf/1/type',
params: {
type: 'array'
},
message: 'should be array'
},
{
keyword: 'oneOf',
dataPath: '',
schemaPath: '#/oneOf',
params: {
passingSchemas: null
},
message: 'should match exactly one schema in oneOf'
}
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export const template = {
'name': 'Engines Valid',
'id': 'foo',
'appliesTo': [
'bpmn:Task'
],
'engines': {
'other': '^1.3-beta.0'
},
'properties': []
};

export const errors = null;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const template = {
'name': 'Engines Valid',
'id': 'foo',
'appliesTo': [
'bpmn:Task'
],
'engines': {
'camunda': '8.5',
'other': '^1.3-beta.0'
},
'properties': [],
};

export const errors = null;
Loading
Loading