motia 0.7.1-beta.132 → 0.7.2-beta.133
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.
- package/dist/cjs/constants.d.ts +2 -0
- package/dist/cjs/constants.js +12 -0
- package/dist/cjs/create/templates/nodejs/tutorial.tsx.txt +23 -13
- package/dist/cjs/create/templates/python/tutorial.tsx.txt +25 -15
- package/dist/cjs/cursor-rules/dot-files/.cursor/rules/ui-steps.mdc +406 -67
- package/dist/cjs/dev/state-endpoints.js +2 -2
- package/dist/cjs/dev.js +18 -5
- package/dist/cjs/start.js +5 -4
- package/dist/cjs/watcher.js +6 -2
- package/dist/esm/constants.d.ts +2 -0
- package/dist/esm/constants.js +9 -0
- package/dist/esm/create/templates/nodejs/tutorial.tsx.txt +23 -13
- package/dist/esm/create/templates/python/tutorial.tsx.txt +25 -15
- package/dist/esm/cursor-rules/dot-files/.cursor/rules/ui-steps.mdc +406 -67
- package/dist/esm/dev/state-endpoints.js +2 -2
- package/dist/esm/dev.js +18 -5
- package/dist/esm/start.js +5 -4
- package/dist/esm/watcher.js +6 -2
- package/dist/types/constants.d.ts +2 -0
- package/package.json +4 -4
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTutorialDisabled = exports.workbenchBase = void 0;
|
|
4
|
+
function getWorkbenchBase() {
|
|
5
|
+
const basePath = process.env.MOTIA_WORKBENCH_BASE;
|
|
6
|
+
if (basePath === '/') {
|
|
7
|
+
return '';
|
|
8
|
+
}
|
|
9
|
+
return basePath && basePath[0] !== '/' ? `/${basePath}` : basePath || '';
|
|
10
|
+
}
|
|
11
|
+
exports.workbenchBase = getWorkbenchBase();
|
|
12
|
+
exports.isTutorialDisabled = process.env.MOTIA_TUTORIAL_DISABLED === 'true';
|
|
@@ -63,12 +63,13 @@ export const steps: TutorialStep[] = [
|
|
|
63
63
|
<br />
|
|
64
64
|
<br />
|
|
65
65
|
Let's start with the configuration, the common config attributes are
|
|
66
|
-
<i>type, name, description, and flows</i
|
|
66
|
+
<i> type, name, description, and flows</i>.
|
|
67
|
+
<br />
|
|
67
68
|
<br />
|
|
68
69
|
</p>
|
|
69
70
|
<ul>
|
|
70
71
|
<li>
|
|
71
|
-
The <b>type</b> attribute is important since it declares the type of Step
|
|
72
|
+
The <b>type</b> attribute is important since it declares the type of Step
|
|
72
73
|
</li>
|
|
73
74
|
<li>
|
|
74
75
|
The <b>flows</b> attribute will associate your Step with a given flow or set of flows.
|
|
@@ -90,9 +91,10 @@ export const steps: TutorialStep[] = [
|
|
|
90
91
|
title: 'API Step Configuration',
|
|
91
92
|
description: () => (
|
|
92
93
|
<p>
|
|
93
|
-
There are specific configuration attributes for an API Step
|
|
94
|
+
There are specific configuration attributes for an API Step. Let's start with the <b>method</b> attribute. This
|
|
94
95
|
will declare the type of HTTP method used to talk to your API Step.
|
|
95
96
|
<br />
|
|
97
|
+
<br />
|
|
96
98
|
Through the <b>path</b> attribute you'll declare the url path used to trigger your API Step
|
|
97
99
|
</p>
|
|
98
100
|
),
|
|
@@ -154,6 +156,7 @@ export const steps: TutorialStep[] = [
|
|
|
154
156
|
object as the first argument, followed by a second argument that provides access to the <b>logger</b>,{' '}
|
|
155
157
|
<b>event emitter</b>, <b>state manager</b>, and <b>trace id</b>.<br />
|
|
156
158
|
<br />
|
|
159
|
+
<br />
|
|
157
160
|
💡 We will cover these in depth further down the tutorial.
|
|
158
161
|
</p>
|
|
159
162
|
),
|
|
@@ -185,7 +188,9 @@ export const steps: TutorialStep[] = [
|
|
|
185
188
|
<p>
|
|
186
189
|
Now let's wrap our API Step and return a response.
|
|
187
190
|
<br />
|
|
188
|
-
<br />
|
|
191
|
+
<br />
|
|
192
|
+
<br />
|
|
193
|
+
You simply need to return an object that complies with one of the <b>responseSchema</b> definitions
|
|
189
194
|
declared in your Step configuration.
|
|
190
195
|
</p>
|
|
191
196
|
),
|
|
@@ -202,10 +207,15 @@ export const steps: TutorialStep[] = [
|
|
|
202
207
|
<p>
|
|
203
208
|
Now that we have an entry point in our flow, let's focus on subscribing to a <b>topic</b> and performing a
|
|
204
209
|
specific task.
|
|
205
|
-
<br />
|
|
206
|
-
<
|
|
210
|
+
<br />
|
|
211
|
+
<br />
|
|
212
|
+
For this we will look at the <b>Event</b> Step.
|
|
213
|
+
<br />
|
|
214
|
+
<br />
|
|
215
|
+
<b> Event</b> Steps are essential for Motia's event driven architecture. Let's dive deeper into the
|
|
207
216
|
anatomy of an Event Step by taking a look at the code visualization tool.
|
|
208
217
|
<br />
|
|
218
|
+
<br />
|
|
209
219
|
💡 <b>Event</b> Steps can only be triggered internally, through topic subscriptions.
|
|
210
220
|
</p>
|
|
211
221
|
),
|
|
@@ -222,7 +232,7 @@ export const steps: TutorialStep[] = [
|
|
|
222
232
|
<br /> <br />
|
|
223
233
|
For this we will look at the <b>Event</b> Step.
|
|
224
234
|
<br /> <br />
|
|
225
|
-
<b>Event</b> Steps are
|
|
235
|
+
<b> Event</b> Steps are essential for Motia's event driven architecture. Let's dive deeper into the
|
|
226
236
|
anatomy of an Event Step by taking a look at the code visualization tool.
|
|
227
237
|
<br /> <br />
|
|
228
238
|
💡 <b>Event</b> Steps can only be triggered internally, through topic subscriptions.
|
|
@@ -238,7 +248,7 @@ export const steps: TutorialStep[] = [
|
|
|
238
248
|
title: 'Event Step Input',
|
|
239
249
|
description: () => (
|
|
240
250
|
<p>
|
|
241
|
-
<b>Event</b> Steps like other
|
|
251
|
+
<b>Event</b> Steps, like other Steps types, are composed of a configuration and a handler.
|
|
242
252
|
<br />
|
|
243
253
|
<br />
|
|
244
254
|
<b>Event</b> Steps have a specific attribute from their config, the <b>input</b> attribute, which declares the
|
|
@@ -261,7 +271,7 @@ export const steps: TutorialStep[] = [
|
|
|
261
271
|
Let's take a look at the <b>Event</b> Step Handler.
|
|
262
272
|
<br />
|
|
263
273
|
<br />
|
|
264
|
-
The handler will seem familiar other
|
|
274
|
+
The handler will seem familiar to other Step handlers, but notice that the first argument holds the data
|
|
265
275
|
provided for the topic or topics your Step subscribes to.
|
|
266
276
|
<br />
|
|
267
277
|
<br />
|
|
@@ -294,11 +304,11 @@ export const steps: TutorialStep[] = [
|
|
|
294
304
|
link: 'https://www.motia.dev/docs/concepts/steps/cron',
|
|
295
305
|
description: () => (
|
|
296
306
|
<p>
|
|
297
|
-
Let's do a recap of what you've learned, thus far you've become familiar with
|
|
307
|
+
Let's do a recap of what you've learned, thus far you've become familiar with two Step types <b>API</b>{' '}
|
|
298
308
|
and <b>Event</b> Steps.
|
|
299
309
|
<br />
|
|
300
310
|
<br />
|
|
301
|
-
You've also started to learn how to navigate around Workbench. Let's wrap up Motia's
|
|
311
|
+
You've also started to learn how to navigate around Workbench. Let's wrap up Motia's Step types with the last
|
|
302
312
|
one the <b>CRON</b> Step. Let's take a deeper look at its definition.
|
|
303
313
|
</p>
|
|
304
314
|
),
|
|
@@ -310,7 +320,7 @@ export const steps: TutorialStep[] = [
|
|
|
310
320
|
link: 'https://www.motia.dev/docs/concepts/steps/cron',
|
|
311
321
|
description: () => (
|
|
312
322
|
<p>
|
|
313
|
-
<b>CRON</b> Steps are similar to the other
|
|
323
|
+
<b>CRON</b> Steps are similar to the other Step types, they are composed by a configuration and a handler.
|
|
314
324
|
<br />
|
|
315
325
|
<br />
|
|
316
326
|
The <b>CRON</b> Step config has a distinct attribute, the <b>cron</b> attribute, through this attribute you will
|
|
@@ -606,7 +616,7 @@ export const steps: TutorialStep[] = [
|
|
|
606
616
|
You've completed our Motia basics tutorial!
|
|
607
617
|
<br />
|
|
608
618
|
<br />
|
|
609
|
-
You've learned about Motia's
|
|
619
|
+
You've learned about Motia's Step types, how to navigate around Workbench, and how to use core features from the
|
|
610
620
|
Motia Framework (State Management, Logging, and Tracing).
|
|
611
621
|
<br />
|
|
612
622
|
<br />
|
|
@@ -63,12 +63,13 @@ export const steps: TutorialStep[] = [
|
|
|
63
63
|
<br />
|
|
64
64
|
<br />
|
|
65
65
|
Let's start with the configuration, the common config attributes are
|
|
66
|
-
<i>type, name, description, and flows</i
|
|
66
|
+
<i> type, name, description, and flows</i>.
|
|
67
|
+
<br />
|
|
67
68
|
<br />
|
|
68
69
|
</p>
|
|
69
70
|
<ul>
|
|
70
71
|
<li>
|
|
71
|
-
The <b>type</b> attribute is important since it declares the type of Step
|
|
72
|
+
The <b>type</b> attribute is important since it declares the type of Step
|
|
72
73
|
</li>
|
|
73
74
|
<li>
|
|
74
75
|
The <b>flows</b> attribute will associate your Step with a given flow or set of flows.
|
|
@@ -90,9 +91,10 @@ export const steps: TutorialStep[] = [
|
|
|
90
91
|
title: 'API Step Configuration',
|
|
91
92
|
description: () => (
|
|
92
93
|
<p>
|
|
93
|
-
There are specific configuration attributes for an API Step
|
|
94
|
+
There are specific configuration attributes for an API Step. Let's start with the <b>method</b> attribute. This
|
|
94
95
|
will declare the type of HTTP method used to talk to your API Step.
|
|
95
96
|
<br />
|
|
97
|
+
<br />
|
|
96
98
|
Through the <b>path</b> attribute you'll declare the url path used to trigger your API Step
|
|
97
99
|
</p>
|
|
98
100
|
),
|
|
@@ -154,6 +156,7 @@ export const steps: TutorialStep[] = [
|
|
|
154
156
|
object as the first argument, followed by a second argument that provides access to the <b>logger</b>,{' '}
|
|
155
157
|
<b>event emitter</b>, <b>state manager</b>, and <b>trace id</b>.<br />
|
|
156
158
|
<br />
|
|
159
|
+
<br />
|
|
157
160
|
💡 We will cover these in depth further down the tutorial.
|
|
158
161
|
</p>
|
|
159
162
|
),
|
|
@@ -185,7 +188,9 @@ export const steps: TutorialStep[] = [
|
|
|
185
188
|
<p>
|
|
186
189
|
Now let's wrap our API Step and return a response.
|
|
187
190
|
<br />
|
|
188
|
-
<br />
|
|
191
|
+
<br />
|
|
192
|
+
<br />
|
|
193
|
+
You simply need to return an object that complies with one of the <b>responseSchema</b> definitions
|
|
189
194
|
declared in your Step configuration.
|
|
190
195
|
</p>
|
|
191
196
|
),
|
|
@@ -202,10 +207,15 @@ export const steps: TutorialStep[] = [
|
|
|
202
207
|
<p>
|
|
203
208
|
Now that we have an entry point in our flow, let's focus on subscribing to a <b>topic</b> and performing a
|
|
204
209
|
specific task.
|
|
205
|
-
<br />
|
|
206
|
-
<
|
|
210
|
+
<br />
|
|
211
|
+
<br />
|
|
212
|
+
For this we will look at the <b>Event</b> Step.
|
|
213
|
+
<br />
|
|
214
|
+
<br />
|
|
215
|
+
<b> Event</b> Steps are essential for Motia's event driven architecture. Let's dive deeper into the
|
|
207
216
|
anatomy of an Event Step by taking a look at the code visualization tool.
|
|
208
217
|
<br />
|
|
218
|
+
<br />
|
|
209
219
|
💡 <b>Event</b> Steps can only be triggered internally, through topic subscriptions.
|
|
210
220
|
</p>
|
|
211
221
|
),
|
|
@@ -222,7 +232,7 @@ export const steps: TutorialStep[] = [
|
|
|
222
232
|
<br /> <br />
|
|
223
233
|
For this we will look at the <b>Event</b> Step.
|
|
224
234
|
<br /> <br />
|
|
225
|
-
<b>Event</b> Steps are
|
|
235
|
+
<b> Event</b> Steps are essential for Motia's event driven architecture. Let's dive deeper into the
|
|
226
236
|
anatomy of an Event Step by taking a look at the code visualization tool.
|
|
227
237
|
<br /> <br />
|
|
228
238
|
💡 <b>Event</b> Steps can only be triggered internally, through topic subscriptions.
|
|
@@ -238,7 +248,7 @@ export const steps: TutorialStep[] = [
|
|
|
238
248
|
title: 'Event Step Input',
|
|
239
249
|
description: () => (
|
|
240
250
|
<p>
|
|
241
|
-
<b>Event</b> Steps like other
|
|
251
|
+
<b> Event</b> Steps, like other Step types, are composed of a configuration and a handler.
|
|
242
252
|
<br />
|
|
243
253
|
<br />
|
|
244
254
|
<b>Event</b> Steps have a specific attribute from their config, the <b>input</b> attribute, which declares the
|
|
@@ -261,7 +271,7 @@ export const steps: TutorialStep[] = [
|
|
|
261
271
|
Let's take a look at the <b>Event</b> Step Handler.
|
|
262
272
|
<br />
|
|
263
273
|
<br />
|
|
264
|
-
The handler will seem familiar other
|
|
274
|
+
The handler will seem familiar to other Step handlers, but notice that the first argument holds the data
|
|
265
275
|
provided for the topic or topics your Step subscribes to.
|
|
266
276
|
<br />
|
|
267
277
|
<br />
|
|
@@ -294,12 +304,12 @@ export const steps: TutorialStep[] = [
|
|
|
294
304
|
link: 'https://www.motia.dev/docs/concepts/steps/cron',
|
|
295
305
|
description: () => (
|
|
296
306
|
<p>
|
|
297
|
-
Let's do a recap of what you've learned
|
|
307
|
+
Let's do a recap of what you've learned. Thus far, you've become familiar with two Step types: <b>API</b>{' '}
|
|
298
308
|
and <b>Event</b> Steps.
|
|
299
309
|
<br />
|
|
300
310
|
<br />
|
|
301
|
-
You've also started to learn how to navigate around Workbench. Let's wrap up Motia's
|
|
302
|
-
one the <b>CRON</b> Step. Let's take a deeper look at its definition.
|
|
311
|
+
You've also started to learn how to navigate around Workbench. Let's wrap up Motia's Step types with the last
|
|
312
|
+
one: the <b>CRON</b> Step. Let's take a deeper look at its definition.
|
|
303
313
|
</p>
|
|
304
314
|
),
|
|
305
315
|
before: [{ type: 'click', selector: workbenchXPath.closePanelButton }],
|
|
@@ -310,7 +320,7 @@ export const steps: TutorialStep[] = [
|
|
|
310
320
|
link: 'https://www.motia.dev/docs/concepts/steps/cron',
|
|
311
321
|
description: () => (
|
|
312
322
|
<p>
|
|
313
|
-
<b>CRON</b> Steps are similar to the other
|
|
323
|
+
<b>CRON</b> Steps are similar to the other Step types, they are composed by a configuration and a handler.
|
|
314
324
|
<br />
|
|
315
325
|
<br />
|
|
316
326
|
The <b>CRON</b> Step config has a distinct attribute, the <b>cron</b> attribute, through this attribute you will
|
|
@@ -350,7 +360,7 @@ export const steps: TutorialStep[] = [
|
|
|
350
360
|
title: 'Endpoints',
|
|
351
361
|
description: () => (
|
|
352
362
|
<p>
|
|
353
|
-
Now that we've looked at Motia
|
|
363
|
+
Now that we've looked at Motia's Step types, let's trigger the API Step from the <b>endpoints</b> section in
|
|
354
364
|
Workbench.
|
|
355
365
|
<br />
|
|
356
366
|
<br />
|
|
@@ -606,7 +616,7 @@ export const steps: TutorialStep[] = [
|
|
|
606
616
|
You've completed our Motia basics tutorial!
|
|
607
617
|
<br />
|
|
608
618
|
<br />
|
|
609
|
-
You've learned about Motia's
|
|
619
|
+
You've learned about Motia's Step types, how to navigate around Workbench, and how to use core features from the
|
|
610
620
|
Motia Framework (State Management, Logging, and Tracing).
|
|
611
621
|
<br />
|
|
612
622
|
<br />
|