Skip to content

Commit 31bbf34

Browse files
committed
chore: update package version and fix workflow example formatting
Update package version from 1.1.0 to 1.3.0 and reformat the example workflow in README.md to use consistent JSON formatting and correct workflow structure
1 parent 25c98eb commit 31bbf34

File tree

2 files changed

+54
-40
lines changed

2 files changed

+54
-40
lines changed

src/lib/README.md

Lines changed: 53 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -442,49 +442,63 @@ function WorkflowEditor() {
442442
```jsx
443443
// Sample Serverless Workflow JSON
444444
const sampleWorkflow = {
445-
id: 'greeting',
446-
version: '1.0',
447-
specVersion: '0.8',
448-
name: 'Greeting workflow',
449-
description: 'JSON based greeting workflow',
450-
start: 'ChooseOnLanguage',
451-
states: [
452-
{
453-
name: 'ChooseOnLanguage',
454-
type: 'switch',
455-
dataConditions: [
445+
"id": "greeting",
446+
"version": "1.0",
447+
"specVersion": "0.8",
448+
"name": "Greeting workflow",
449+
"description": "JSON based greeting workflow",
450+
"start": "ChooseOnLanguage",
451+
"states": [
452+
{
453+
"name": "ChooseOnLanguage",
454+
"type": "switch",
455+
"dataConditions": [
456+
{
457+
"name": "English",
458+
"condition": "${ .language == \"English\" }",
459+
"transition": "GreetInEnglish"
460+
},
461+
{
462+
"name": "Spanish",
463+
"condition": "${ .language == \"Spanish\" }",
464+
"transition": "GreetInSpanish"
465+
}
466+
],
467+
"defaultCondition": {
468+
"transition": "GreetInEnglish"
469+
}
470+
},
456471
{
457-
name: "English",
458-
condition: '${ .language == "English" }',
459-
transition: 'GreetInEnglish'
472+
"name": "GreetInEnglish",
473+
"type": "operation",
474+
"actions": [
475+
{
476+
"functionRef": {
477+
"refName": "Greet",
478+
"arguments": {
479+
"message": "${ \"Hello\" + .name }"
480+
}
481+
}
482+
}
483+
],
484+
"end": true
460485
},
461486
{
462-
name: "Spanish",
463-
condition: '${ .language == "Spanish" }',
464-
transition: 'GreetInSpanish'
487+
"name": "GreetInSpanish",
488+
"type": "operation",
489+
"actions": [
490+
{
491+
"functionRef": {
492+
"refName": "Greet",
493+
"arguments": {
494+
"message": "${ \"Hola\" + .name }"
495+
}
496+
}
497+
}
498+
],
499+
"end": true
465500
}
466-
],
467-
defaultCondition: {
468-
transition: 'GreetInEnglish'
469-
}
470-
},
471-
{
472-
name: 'GreetInEnglish',
473-
type: 'inject',
474-
data: {
475-
greeting: 'Hello from JSON Workflow, '
476-
},
477-
transition: 'GreetPerson'
478-
},
479-
{
480-
name: 'GreetPerson',
481-
type: 'inject',
482-
data: {
483-
greetingMessage: '${ .greeting + .name }'
484-
},
485-
end: true
486-
}
487-
]
501+
]
488502
};
489503

490504
// Load the workflow

src/lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "serverless-workflow-builder-lib",
3-
"version": "1.1.0",
3+
"version": "1.3.0",
44
"description": "A reusable library for building serverless workflow editors with React Flow",
55
"main": "index.js",
66
"keywords": [

0 commit comments

Comments
 (0)