Skip to content

Commit

Permalink
fix(payload): modify the xstate logic (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pmejna authored Nov 28, 2024
1 parent cf35b69 commit eb621b3
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/curly-pants-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'stplr': patch
---

fix payload state logic, introduced Vitest and unit tests
5 changes: 5 additions & 0 deletions .changeset/few-panthers-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'stplr-core': patch
---

fix payload state logic
2 changes: 2 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"clean-frogs-poke",
"cuddly-cups-itch",
"curly-ligers-cheat",
"curly-pants-fry",
"famous-donkeys-compete",
"few-panthers-hammer",
"few-parrots-switch",
"five-students-care",
"four-boats-confess",
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# stplr

## 0.1.0-alpha.35

### Patch Changes

- fix payload state logic, introduced Vitest and unit tests

## 0.1.0-alpha.34

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stplr",
"version": "0.1.0-alpha.34",
"version": "0.1.0-alpha.35",
"main": "./dist/index.mjs",
"bin": {
"stplr": "./dist/index.mjs"
Expand Down
6 changes: 6 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# stplr-core

## 0.2.0-alpha.18

### Patch Changes

- fix payload state logic

## 0.2.0-alpha.17

### Minor Changes
Expand Down
14 changes: 12 additions & 2 deletions packages/core/installMachine/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ const createInstallMachine = (initialContext: InstallMachineContext) => {
installSupabase: {
always: [
{
guard: and([isStepCompleted('installSupabase'), 'shouldInstallPayload']),
guard: and([
isStepCompleted('installSupabase'),
not(isStepCompleted('installPayload')),
'shouldInstallPayload',
]),
target: 'installPayload',
},
{
Expand All @@ -128,7 +132,13 @@ const createInstallMachine = (initialContext: InstallMachineContext) => {
invoke: {
input: ({ context }) => context,
src: 'installSupabaseActor',
onDone: [{ guard: 'shouldInstallPayload', target: 'installPayload' }, { target: 'createDocFiles' }],
onDone: [
{
guard: and(['shouldInstallPayload', not(isStepCompleted('installPayload'))]),
target: 'installPayload',
},
{ target: 'createDocFiles' },
],
onError: 'failed',
},
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stplr-core",
"version": "0.2.0-alpha.17",
"version": "0.2.0-alpha.18",
"private": true,
"main": "./dist/index.js",
"scripts": {
Expand Down

0 comments on commit eb621b3

Please sign in to comment.