@typeonce/effect-machine-devtools 0.38.0 → 0.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <meta name="description" content="Interactive statechart visualization for Effect Machine" />
7
7
  <title>Effect Machine · Statechart</title>
8
- <script type="module" crossorigin src="./assets/index-De9zZEnz.js"></script>
8
+ <script type="module" crossorigin src="./assets/index-azZg5fx9.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="./assets/index-DkC3PbTy.css">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typeonce/effect-machine-devtools",
3
- "version": "0.38.0",
3
+ "version": "0.39.0",
4
4
  "description": "Local development tools for Effect Machine",
5
5
  "author": "Sandro Maglione",
6
6
  "repository": {
@@ -27,21 +27,21 @@
27
27
  "./internal/*": null
28
28
  },
29
29
  "dependencies": {
30
- "@effect/platform-browser": "4.0.0-rc.116",
31
- "@effect/platform-node": "4.0.0-rc.116",
32
- "@effect/platform-node-shared": "4.0.0-rc.116",
30
+ "@effect/platform-browser": "4.0.0-rc.117",
31
+ "@effect/platform-node": "4.0.0-rc.117",
32
+ "@effect/platform-node-shared": "4.0.0-rc.117",
33
33
  "chokidar": "4.0.3",
34
34
  "elkjs": "0.12.0",
35
35
  "typescript": "6.0.3",
36
36
  "vite": "8.1.5",
37
- "@typeonce/effect-machine": "^0.38.0"
37
+ "@typeonce/effect-machine": "^0.39.0"
38
38
  },
39
39
  "peerDependencies": {
40
- "effect": "4.0.0-rc.116"
40
+ "effect": "4.0.0-rc.117"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "25.7.0",
44
- "effect": "4.0.0-rc.116",
44
+ "effect": "4.0.0-rc.117",
45
45
  "tsx": "4.21.0"
46
46
  },
47
47
  "files": [
@@ -95,11 +95,10 @@ export const snapshot = {
95
95
  const initialWorkflow = (): Machine.Machine.CompleteSnapshotContaining<{
96
96
  readonly "": typeof States.node
97
97
  }, "application.workflow"> => snapshot
98
- const targets1 = Machine.targets(States)
99
98
  export const machine = Machine.make({
100
99
  branches: {
101
100
  transition1: {
102
- destination: { target: targets1.root.application.workflow.running, update: targets1.root.application.workflow }
101
+ destination: { target: "application.workflow.running", update: "application.workflow" }
103
102
  }
104
103
  },
105
104
  id: "inspection-example",
@@ -107,7 +106,7 @@ export const machine = Machine.make({
107
106
  events: Machine.eventsFromSchemas(Start, Finish, Disconnect, Refresh)
108
107
  }).handle({
109
108
  initial: {
110
- target: Machine.targets(States).root.application,
109
+ target: "application",
111
110
  decoded: true,
112
111
  data: new Application({ workspace: "effect-machine", revision: 7 })
113
112
  },
@@ -126,7 +125,7 @@ export const machine = Machine.make({
126
125
  states: {
127
126
  workflow: {
128
127
  initial: {
129
- target: Machine.targets(States).root.application.workflow.idle,
128
+ target: "application.workflow.idle",
130
129
  decoded: true,
131
130
  data: new Idle({})
132
131
  },
@@ -149,7 +148,7 @@ export const machine = Machine.make({
149
148
  })
150
149
  },
151
150
  Refresh: {
152
- update: targets1.root.application.workflow,
151
+ update: "application.workflow",
153
152
  decoded: true,
154
153
  data: () => (new Workflow({ document: "Machine.ts", unsavedChanges: 0 }))
155
154
  }
@@ -157,7 +156,7 @@ export const machine = Machine.make({
157
156
  },
158
157
  running: {
159
158
  initial: {
160
- target: Machine.targets(States).root.application.workflow.running.editing,
159
+ target: "application.workflow.running.editing",
161
160
  decoded: true,
162
161
  data: ({}) => new Editing({})
163
162
  },
@@ -165,7 +164,7 @@ export const machine = Machine.make({
165
164
  editing: {
166
165
  on: {
167
166
  Finish: {
168
- target: targets1.root.application.workflow.running.complete,
167
+ target: "application.workflow.running.complete",
169
168
  decoded: true,
170
169
  data: () => (new Complete({}))
171
170
  }
@@ -178,7 +177,7 @@ export const machine = Machine.make({
178
177
  },
179
178
  connection: {
180
179
  initial: {
181
- target: Machine.targets(States).root.application.connection.online,
180
+ target: "application.connection.online",
182
181
  decoded: true,
183
182
  data: new Online({})
184
183
  },
@@ -186,7 +185,7 @@ export const machine = Machine.make({
186
185
  online: {
187
186
  on: {
188
187
  Disconnect: {
189
- target: targets1.root.application.connection.offline,
188
+ target: "application.connection.offline",
190
189
  decoded: true,
191
190
  data: () => (new Offline({}))
192
191
  }
@@ -28,12 +28,11 @@ const ReviewEvents = Machine.eventsFromSchemas(Schema.TaggedUnion({
28
28
  }))
29
29
  const saveReview: Effect.Effect<string, string> = Effect.succeed("deterministic-chart")
30
30
  const publishReview = Effect.succeed("deterministic-chart")
31
- const targets1 = Machine.targets(ReviewStates)
32
31
  export const hierarchyRoutingMachine = Machine.make({
33
32
  branches: {
34
33
  transition1: {
35
- save: { target: targets1.root.Workflow.Saving, title: "Save the review" },
36
- invalid: { target: targets1.root.Workflow.Review.Failed, title: "Show validation failure" }
34
+ save: { target: "Workflow.Saving", title: "Save the review" },
35
+ invalid: { target: "Workflow.Review.Failed", title: "Show validation failure" }
37
36
  }
38
37
  },
39
38
  effects: { source1: Effect.suspend(() => saveReview), source2: Effect.suspend(() => publishReview) },
@@ -42,18 +41,18 @@ export const hierarchyRoutingMachine = Machine.make({
42
41
  events: ReviewEvents
43
42
  }).handle({
44
43
  initial: {
45
- target: Machine.targets(ReviewStates).root.Workflow
44
+ target: "Workflow"
46
45
  },
47
46
  states: {
48
47
  Workflow: {
49
48
  initial: {
50
- target: Machine.targets(ReviewStates).root.Workflow.Review,
49
+ target: "Workflow.Review",
51
50
  data: { title: "A deterministic chart" }
52
51
  },
53
52
  states: {
54
53
  Review: {
55
54
  initial: {
56
- target: Machine.targets(ReviewStates).root.Workflow.Review.Form
55
+ target: "Workflow.Review.Form"
57
56
  },
58
57
  on: {
59
58
  Submit: {
@@ -73,9 +72,9 @@ export const hierarchyRoutingMachine = Machine.make({
73
72
  invoke: {
74
73
  src: "source1",
75
74
  id: "save-review",
76
- onDone: { target: targets1.root.Workflow.Publishing },
75
+ onDone: { target: "Workflow.Publishing" },
77
76
  onFailure: {
78
- target: targets1.root.Workflow.Review.Failed,
77
+ target: "Workflow.Review.Failed",
79
78
  data: () => ({ message: "The review could not be saved." })
80
79
  }
81
80
  }
@@ -84,7 +83,7 @@ export const hierarchyRoutingMachine = Machine.make({
84
83
  invoke: {
85
84
  src: "source2",
86
85
  id: "publish-review",
87
- onDone: { target: targets1.root.Workflow.Complete, data: ({ output }) => ({ slug: output }) }
86
+ onDone: { target: "Workflow.Complete", data: ({ output }) => ({ slug: output }) }
88
87
  }
89
88
  },
90
89
  Complete: {}
@@ -16,14 +16,13 @@ const ChildStates = Machine.state({
16
16
  Done: { schema: ChildDone, type: "final", output: Schema.String }
17
17
  }
18
18
  })
19
- const targets1 = Machine.targets(ChildStates)
20
19
  export const invokeGalleryChildMachine = Machine.make({
21
20
  id: "invoke-gallery-child",
22
21
  root: ChildStates,
23
22
  events: Machine.eventsFromSchemas(FinishChild)
24
23
  }).handle({
25
24
  initial: {
26
- target: Machine.targets(ChildStates).root.Working,
25
+ target: "Working",
27
26
  decoded: true,
28
27
  data: new ChildWorking({ task: "render-preview" })
29
28
  },
@@ -31,7 +30,7 @@ export const invokeGalleryChildMachine = Machine.make({
31
30
  Working: {
32
31
  on: {
33
32
  FinishChild: {
34
- target: targets1.root.Done,
33
+ target: "Done",
35
34
  decoded: true,
36
35
  data: ({ state }) => (new ChildDone({ result: `${state.task}:complete` }))
37
36
  }
@@ -122,11 +121,10 @@ const GalleryStates = Machine.state({
122
121
  Failed
123
122
  }
124
123
  })
125
- const targets2 = Machine.targets(GalleryStates)
126
124
  export const invokeOutcomesMachine = Machine.make({
127
125
  branches: {
128
126
  transition13: {
129
- ready: { target: targets2.root.Completed, title: "Worker reports ready" },
127
+ ready: { target: "Completed", title: "Worker reports ready" },
130
128
  waiting: { none: true, title: "Worker is still starting" }
131
129
  }
132
130
  },
@@ -149,44 +147,44 @@ export const invokeOutcomesMachine = Machine.make({
149
147
  internalEvents: GalleryInternalEvents
150
148
  }).handle({
151
149
  initial: {
152
- target: Machine.targets(GalleryStates).root.Gallery,
150
+ target: "Gallery",
153
151
  decoded: true,
154
152
  data: new Gallery({ selectedDemo: null })
155
153
  },
156
154
  states: {
157
155
  Gallery: {
158
156
  initial: {
159
- target: Machine.targets(GalleryStates).root.Gallery.Choose,
157
+ target: "Gallery.Choose",
160
158
  decoded: true,
161
159
  data: ({}) => new Choose({})
162
160
  },
163
161
  on: {
164
- Reset: { target: targets2.root.Gallery.Choose, decoded: true, data: () => (new Choose({})) }
162
+ Reset: { target: "Gallery.Choose", decoded: true, data: () => (new Choose({})) }
165
163
  },
166
164
  states: {
167
165
  Choose: {
168
166
  on: {
169
167
  RunEffect: {
170
- target: targets2.root.Gallery.LoadingDocument,
168
+ target: "Gallery.LoadingDocument",
171
169
  decoded: true,
172
170
  data: ({ event }) => (new LoadingDocument({ request: event.request }))
173
171
  },
174
172
  RunStream: {
175
- target: targets2.root.Gallery.StreamingUpdates,
173
+ target: "Gallery.StreamingUpdates",
176
174
  decoded: true,
177
175
  data: () => (new StreamingUpdates({ values: [] }))
178
176
  },
179
177
  RunTimer: {
180
- target: targets2.root.Gallery.WaitingForTimeout,
178
+ target: "Gallery.WaitingForTimeout",
181
179
  decoded: true,
182
180
  data: () => (new WaitingForTimeout({ delay: "2 seconds" }))
183
181
  },
184
182
  RunProcess: {
185
- target: targets2.root.Gallery.WatchingProcess,
183
+ target: "Gallery.WatchingProcess",
186
184
  decoded: true,
187
185
  data: () => (new WatchingProcess({ revision: 1 }))
188
186
  },
189
- RunChild: { target: targets2.root.Gallery.RunningChild, decoded: true, data: () => (new RunningChild({})) }
187
+ RunChild: { target: "Gallery.RunningChild", decoded: true, data: () => (new RunningChild({})) }
190
188
  }
191
189
  },
192
190
  LoadingDocument: {
@@ -195,12 +193,12 @@ export const invokeOutcomesMachine = Machine.make({
195
193
  id: "load-document",
196
194
  input: (context) => context,
197
195
  onDone: {
198
- target: targets2.root.Completed,
196
+ target: "Completed",
199
197
  decoded: true,
200
198
  data: ({ output }) => (new Completed({ source: "effect", result: output }))
201
199
  },
202
200
  onFailure: {
203
- target: targets2.root.Failed,
201
+ target: "Failed",
204
202
  decoded: true,
205
203
  data: ({ error }) => (new Failed({ source: "effect", message: error }))
206
204
  }
@@ -217,19 +215,19 @@ export const invokeOutcomesMachine = Machine.make({
217
215
  }
218
216
  },
219
217
  onDone: {
220
- target: targets2.root.Completed,
218
+ target: "Completed",
221
219
  decoded: true,
222
220
  data: ({ state }) => (new Completed({ source: "stream", result: state.values.join(", ") }))
223
221
  },
224
222
  onFailure: {
225
- target: targets2.root.Failed,
223
+ target: "Failed",
226
224
  decoded: true,
227
225
  data: ({ error }) => (new Failed({ source: "stream", message: error }))
228
226
  }
229
227
  },
230
228
  on: {
231
229
  StreamValue: {
232
- target: targets2.root.Gallery.StreamingUpdates,
230
+ target: "Gallery.StreamingUpdates",
233
231
  decoded: true,
234
232
  data: ({ event, state }) => (new StreamingUpdates({ values: [...state.values, event.value] }))
235
233
  }
@@ -240,7 +238,7 @@ export const invokeOutcomesMachine = Machine.make({
240
238
  src: "source3",
241
239
  id: "request-timeout",
242
240
  onDone: {
243
- target: targets2.root.Completed,
241
+ target: "Completed",
244
242
  decoded: true,
245
243
  data: () => (new Completed({ source: "timer", result: "timeout elapsed" }))
246
244
  }
@@ -252,7 +250,7 @@ export const invokeOutcomesMachine = Machine.make({
252
250
  id: "status-worker",
253
251
  address: Machine.childAddress("status-worker"),
254
252
  onFailure: {
255
- target: targets2.root.Failed,
253
+ target: "Failed",
256
254
  decoded: true,
257
255
  data: ({ error }) => (new Failed({ source: "process", message: String(error) }))
258
256
  },
@@ -269,7 +267,7 @@ export const invokeOutcomesMachine = Machine.make({
269
267
  invoke: {
270
268
  src: "source5",
271
269
  onDone: {
272
- target: targets2.root.Completed,
270
+ target: "Completed",
273
271
  decoded: true,
274
272
  data: ({ output }) => (new Completed({ source: "child machine", result: output }))
275
273
  }
@@ -279,12 +277,12 @@ export const invokeOutcomesMachine = Machine.make({
279
277
  },
280
278
  Completed: {
281
279
  on: {
282
- Reset: { target: targets2.root.Gallery, decoded: true, data: () => (new Gallery({ selectedDemo: null })) }
280
+ Reset: { target: "Gallery", decoded: true, data: () => (new Gallery({ selectedDemo: null })) }
283
281
  }
284
282
  },
285
283
  Failed: {
286
284
  on: {
287
- Reset: { target: targets2.root.Gallery, decoded: true, data: () => (new Gallery({ selectedDemo: null })) }
285
+ Reset: { target: "Gallery", decoded: true, data: () => (new Gallery({ selectedDemo: null })) }
288
286
  }
289
287
  }
290
288
  }
@@ -47,16 +47,15 @@ const AuthEvents = Machine.eventsFromSchemas(Schema.TaggedUnion({
47
47
  PasswordChanged: { value: Schema.String },
48
48
  Submit: { route: Schema.Literals(["verification", "login", "invalid"]) }
49
49
  }))
50
- const targets1 = Machine.targets(AuthStates)
51
50
  export const layoutResilienceMachine = Machine.make({
52
51
  branches: {
53
52
  transition4: {
54
53
  requestVerification: {
55
- target: targets1.root.Editing.RequestingVerification,
54
+ target: "Editing.RequestingVerification",
56
55
  title: "Request a verification code"
57
56
  },
58
- login: { target: targets1.root.Editing.SubmittingLogin, title: "Submit password login" },
59
- invalid: { target: targets1.root.Editing.Form.Failed, title: "Show validation failure" }
57
+ login: { target: "Editing.SubmittingLogin", title: "Submit password login" },
58
+ invalid: { target: "Editing.Form.Failed", title: "Show validation failure" }
60
59
  }
61
60
  },
62
61
  effects: {
@@ -82,7 +81,7 @@ export const layoutResilienceMachine = Machine.make({
82
81
  events: AuthEvents
83
82
  }).handle({
84
83
  initial: {
85
- target: Machine.targets(AuthStates).root.Editing,
84
+ target: "Editing",
86
85
  data: {
87
86
  mode: "login",
88
87
  email: "",
@@ -93,24 +92,24 @@ export const layoutResilienceMachine = Machine.make({
93
92
  states: {
94
93
  Editing: {
95
94
  initial: {
96
- target: Machine.targets(AuthStates).root.Editing.Form
95
+ target: "Editing.Form"
97
96
  },
98
97
  states: {
99
98
  Form: {
100
99
  initial: {
101
- target: Machine.targets(AuthStates).root.Editing.Form.Ready
100
+ target: "Editing.Form.Ready"
102
101
  },
103
102
  on: {
104
103
  EmailChanged: {
105
- update: targets1.root.Editing,
104
+ update: "Editing",
106
105
  data: ({ ancestors: { "Editing": current }, event }) => ({ ...current, email: event.value })
107
106
  },
108
107
  LoginMethodChanged: {
109
- update: targets1.root.Editing,
108
+ update: "Editing",
110
109
  data: ({ ancestors: { "Editing": current }, event }) => ({ ...current, loginMethod: event.value })
111
110
  },
112
111
  PasswordChanged: {
113
- update: targets1.root.Editing,
112
+ update: "Editing",
114
113
  data: ({ ancestors: { "Editing": current }, event }) => ({ ...current, password: event.value })
115
114
  },
116
115
  Submit: {
@@ -136,9 +135,9 @@ export const layoutResilienceMachine = Machine.make({
136
135
  src: "source1",
137
136
  id: "submit-login",
138
137
  input: (context) => context,
139
- onDone: { target: targets1.root.Navigating, data: ({ output }) => ({ href: output }) },
138
+ onDone: { target: "Navigating", data: ({ output }) => ({ href: output }) },
140
139
  onFailure: {
141
- target: targets1.root.Editing.Form.Failed,
140
+ target: "Editing.Form.Failed",
142
141
  data: () => ({ message: "Email or password is incorrect." })
143
142
  }
144
143
  }
@@ -149,7 +148,7 @@ export const layoutResilienceMachine = Machine.make({
149
148
  id: "request-verification",
150
149
  input: (context) => context,
151
150
  onDone: {
152
- target: targets1.root.Verification,
151
+ target: "Verification",
153
152
  data: ({ containingState }) => ({
154
153
  mode: containingState.mode,
155
154
  email: containingState.email,
@@ -157,7 +156,7 @@ export const layoutResilienceMachine = Machine.make({
157
156
  })
158
157
  },
159
158
  onFailure: {
160
- target: targets1.root.Editing.Form.Failed,
159
+ target: "Editing.Form.Failed",
161
160
  data: () => ({ message: "The verification code could not be sent." })
162
161
  }
163
162
  }
@@ -166,7 +165,7 @@ export const layoutResilienceMachine = Machine.make({
166
165
  },
167
166
  Verification: {
168
167
  initial: {
169
- target: Machine.targets(AuthStates).root.Verification.CodeEntry
168
+ target: "Verification.CodeEntry"
170
169
  },
171
170
  states: {
172
171
  CodeEntry: {}
@@ -104,7 +104,6 @@ const ParallelStates = Machine.state({
104
104
  Cancelled: OrderCancelled
105
105
  }
106
106
  })
107
- const targets1 = Machine.targets(ParallelStates)
108
107
  export const parallelCompletionMachine = Machine.make({
109
108
  timers: { source1: "5 seconds" },
110
109
  id: "parallel-completion",
@@ -122,7 +121,7 @@ export const parallelCompletionMachine = Machine.make({
122
121
  internalEvents: ParallelInternalEvents
123
122
  }).handle({
124
123
  initial: {
125
- target: Machine.targets(ParallelStates).root.Cart,
124
+ target: "Cart",
126
125
  decoded: true,
127
126
  data: new Cart({ items: 2 })
128
127
  },
@@ -130,7 +129,7 @@ export const parallelCompletionMachine = Machine.make({
130
129
  Cart: {
131
130
  on: {
132
131
  Checkout: {
133
- target: targets1.root.Order,
132
+ target: "Order",
134
133
  decoded: true,
135
134
  data: ({ event }) => (new Order({ orderId: event.orderId, total: event.total }))
136
135
  }
@@ -140,36 +139,36 @@ export const parallelCompletionMachine = Machine.make({
140
139
  initial: { payment: ({}) => ({ attempts: 0 }), fulfillment: ({}) => ({ warehouse: "north" }) },
141
140
  on: {
142
141
  CancelOrder: {
143
- target: targets1.root.Cancelled,
142
+ target: "Cancelled",
144
143
  decoded: true,
145
144
  data: ({ event }) => (new OrderCancelled({ reason: event.reason }))
146
145
  }
147
146
  },
148
147
  onDone: {
149
- target: targets1.root.Complete,
148
+ target: "Complete",
150
149
  decoded: true,
151
150
  data: () => (new OrderComplete({ orderId: "completed-order" }))
152
151
  },
153
152
  states: {
154
153
  payment: {
155
154
  initial: {
156
- target: Machine.targets(ParallelStates).root.Order.payment.AwaitingAuthorization
155
+ target: "Order.payment.AwaitingAuthorization"
157
156
  },
158
157
  states: {
159
158
  AwaitingAuthorization: {
160
159
  on: {
161
160
  Authorize: {
162
- target: targets1.root.Order.payment.Authorized,
161
+ target: "Order.payment.Authorized",
163
162
  decoded: true,
164
163
  data: ({ event }) => (new Authorized({ authorizationId: event.authorizationId }))
165
164
  },
166
165
  CompleteAll: {
167
- target: targets1.root.Order.payment.Authorized,
166
+ target: "Order.payment.Authorized",
168
167
  decoded: true,
169
168
  data: ({ event }) => (new Authorized({ authorizationId: event.authorizationId }))
170
169
  },
171
170
  DeclinePayment: {
172
- target: targets1.root.Cancelled,
171
+ target: "Cancelled",
173
172
  decoded: true,
174
173
  data: ({ event }) => (new OrderCancelled({ reason: event.reason }))
175
174
  }
@@ -180,23 +179,23 @@ export const parallelCompletionMachine = Machine.make({
180
179
  },
181
180
  fulfillment: {
182
181
  initial: {
183
- target: Machine.targets(ParallelStates).root.Order.fulfillment.WaitingForPayment
182
+ target: "Order.fulfillment.WaitingForPayment"
184
183
  },
185
184
  states: {
186
185
  WaitingForPayment: {
187
186
  on: {
188
187
  Authorize: {
189
- target: targets1.root.Order.fulfillment.Packing,
188
+ target: "Order.fulfillment.Packing",
190
189
  decoded: true,
191
190
  data: () => (new Packing({ packageCount: 1 }))
192
191
  },
193
192
  Pack: {
194
- target: targets1.root.Order.fulfillment.Packing,
193
+ target: "Order.fulfillment.Packing",
195
194
  decoded: true,
196
195
  data: ({ event }) => (new Packing({ packageCount: event.packages }))
197
196
  },
198
197
  CompleteAll: {
199
- target: targets1.root.Order.fulfillment.Shipped,
198
+ target: "Order.fulfillment.Shipped",
200
199
  decoded: true,
201
200
  data: ({ event }) => (new Shipped({ trackingCode: event.trackingCode }))
202
201
  }
@@ -215,17 +214,17 @@ export const parallelCompletionMachine = Machine.make({
215
214
  },
216
215
  on: {
217
216
  AutoShip: {
218
- target: targets1.root.Order.fulfillment.Shipped,
217
+ target: "Order.fulfillment.Shipped",
219
218
  decoded: true,
220
219
  data: () => (new Shipped({ trackingCode: "automatic" }))
221
220
  },
222
221
  Ship: {
223
- target: targets1.root.Order.fulfillment.Shipped,
222
+ target: "Order.fulfillment.Shipped",
224
223
  decoded: true,
225
224
  data: ({ event }) => (new Shipped({ trackingCode: event.trackingCode }))
226
225
  },
227
226
  CompleteAll: {
228
- target: targets1.root.Order.fulfillment.Shipped,
227
+ target: "Order.fulfillment.Shipped",
229
228
  decoded: true,
230
229
  data: ({ event }) => (new Shipped({ trackingCode: event.trackingCode }))
231
230
  }
@@ -242,7 +241,7 @@ export const parallelCompletionMachine = Machine.make({
242
241
  Cancelled: {
243
242
  on: {
244
243
  RetryOrder: {
245
- target: targets1.root.Order,
244
+ target: "Order",
246
245
  decoded: true,
247
246
  data: () => (new Order({ orderId: "retry", total: 0 }))
248
247
  }
@@ -51,7 +51,7 @@ export const parallelOwnerRoutingChildMachine = Machine.make({
51
51
  parent: Machine.parent(ChildParentEvents)
52
52
  }).handle({
53
53
  initial: {
54
- target: Machine.targets(ParallelOwnerChildStates).root.Idle,
54
+ target: "Idle",
55
55
  decoded: true,
56
56
  data: new ChildIdle({})
57
57
  },
@@ -91,7 +91,6 @@ const ParallelOwnerStates = Machine.state({
91
91
  }
92
92
  }
93
93
  })
94
- const targets2 = Machine.targets(ParallelOwnerStates)
95
94
  export const parallelOwnerRoutingMachine = Machine.make({
96
95
  children: { source1: ParallelOwnerChild },
97
96
  id: "parallel-owner-routing",
@@ -99,7 +98,7 @@ export const parallelOwnerRoutingMachine = Machine.make({
99
98
  events: Machine.eventsFromSchemas(PrintRequested, ChildParentEvents)
100
99
  }).handle({
101
100
  initial: {
102
- target: Machine.targets(ParallelOwnerStates).root.Print,
101
+ target: "Print",
103
102
  decoded: true,
104
103
  data: new Print({})
105
104
  },
@@ -108,11 +107,11 @@ export const parallelOwnerRoutingMachine = Machine.make({
108
107
  initial: { Options: ({}) => ({}), Operation: ({}) => ({}) },
109
108
  invoke: {
110
109
  src: "source1",
111
- onFailure: { target: targets2.root.Print.Operation.Active, decoded: true, data: () => (new Active({})) }
110
+ onFailure: { target: "Print.Operation.Active", decoded: true, data: () => (new Active({})) }
112
111
  },
113
112
  on: {
114
113
  PrintRequested: {
115
- target: targets2.root.Print.Operation.Printing,
114
+ target: "Print.Operation.Printing",
116
115
  decoded: true,
117
116
  data: () => (new Printing({}))
118
117
  }
@@ -120,7 +119,7 @@ export const parallelOwnerRoutingMachine = Machine.make({
120
119
  states: {
121
120
  Options: {
122
121
  initial: {
123
- target: Machine.targets(ParallelOwnerStates).root.Print.Options.Ready,
122
+ target: "Print.Options.Ready",
124
123
  data: ({}) => ({})
125
124
  },
126
125
  states: {
@@ -129,7 +128,7 @@ export const parallelOwnerRoutingMachine = Machine.make({
129
128
  },
130
129
  Operation: {
131
130
  initial: {
132
- target: Machine.targets(ParallelOwnerStates).root.Print.Operation.Active,
131
+ target: "Print.Operation.Active",
133
132
  data: ({}) => ({})
134
133
  },
135
134
  states: {
@@ -109,12 +109,11 @@ const States = Machine.state({
109
109
  Finished: { schema: Finished, type: "final", output: Schema.String }
110
110
  }
111
111
  })
112
- const targets1 = Machine.targets(States)
113
112
  export const plannerMachine = Machine.make({
114
113
  branches: {
115
114
  transition1: {
116
- urgent: { target: targets1.root.Working, title: "Finish immediately" },
117
- normal: { target: targets1.root.Working, title: "Wait in working" }
115
+ urgent: { target: "Working", title: "Finish immediately" },
116
+ normal: { target: "Working", title: "Wait in working" }
118
117
  }
119
118
  },
120
119
  effects: { source1: Effect.suspend(() => Effect.never) },
@@ -155,7 +154,7 @@ export const plannerMachine = Machine.make({
155
154
  })
156
155
  }).handle({
157
156
  initial: {
158
- target: Machine.targets(States).root.Idle,
157
+ target: "Idle",
159
158
  decoded: true,
160
159
  data: ({ root: { input: input } }) => new Idle({ owner: input.owner })
161
160
  },
@@ -183,12 +182,12 @@ export const plannerMachine = Machine.make({
183
182
  invoke: { src: "source1", id: "monitor-job" },
184
183
  on: {
185
184
  AutoFinish: {
186
- target: targets1.root.Finished,
185
+ target: "Finished",
187
186
  decoded: true,
188
187
  data: ({ state }) => (new Finished({ job: state.job }))
189
188
  },
190
189
  Cancel: {
191
- target: targets1.root.Idle,
190
+ target: "Idle",
192
191
  decoded: true,
193
192
  data: ({ event, state }) => (new Idle({ owner: `${state.owner} · ${event.reason}` }))
194
193
  }