motia 0.5.11-beta.120-110250 → 0.5.11-beta.120-685453

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.
Files changed (23) hide show
  1. package/dist/cjs/create/index.js +1 -13
  2. package/dist/cjs/create/templates/default/motia-workbench.json +4 -4
  3. package/dist/cjs/create/templates/generate.js +2 -4
  4. package/dist/cjs/create/templates/generate.ts +2 -6
  5. package/dist/cjs/create/templates/index.js +0 -1
  6. package/dist/cjs/create/templates/index.ts +0 -1
  7. package/dist/esm/create/index.js +1 -13
  8. package/dist/esm/create/templates/default/motia-workbench.json +4 -4
  9. package/dist/esm/create/templates/generate.js +2 -4
  10. package/dist/esm/create/templates/generate.ts +2 -6
  11. package/dist/esm/create/templates/index.js +0 -1
  12. package/dist/esm/create/templates/index.ts +0 -1
  13. package/package.json +4 -4
  14. /package/dist/cjs/create/templates/python/{00_noop_step.py.txt → steps/00_noop_step.py.txt} +0 -0
  15. /package/dist/cjs/create/templates/python/{00_noop_step.tsx.txt → steps/00_noop_step.tsx.txt} +0 -0
  16. /package/dist/cjs/create/templates/python/{01_api_step.py.txt → steps/01_api_step.py.txt} +0 -0
  17. /package/dist/cjs/create/templates/python/{02_test_state_step.py.txt → steps/02_test_state_step.py.txt} +0 -0
  18. /package/dist/cjs/create/templates/python/{03_check_state_change_step.py.txt → steps/03_check_state_change_step.py.txt} +0 -0
  19. /package/dist/esm/create/templates/python/{00_noop_step.py.txt → steps/00_noop_step.py.txt} +0 -0
  20. /package/dist/esm/create/templates/python/{00_noop_step.tsx.txt → steps/00_noop_step.tsx.txt} +0 -0
  21. /package/dist/esm/create/templates/python/{01_api_step.py.txt → steps/01_api_step.py.txt} +0 -0
  22. /package/dist/esm/create/templates/python/{02_test_state_step.py.txt → steps/02_test_state_step.py.txt} +0 -0
  23. /package/dist/esm/create/templates/python/{03_check_state_change_step.py.txt → steps/03_check_state_change_step.py.txt} +0 -0
@@ -177,20 +177,8 @@ const create = async ({ projectName, template, cursorEnabled, context }) => {
177
177
  fs_1.default.cpSync(cursorTemplateDir, cursorTargetDir, { recursive: true });
178
178
  context.log('cursor-folder-created', (message) => message.tag('success').append('Folder').append('.cursor', 'cyan').append('has been created.'));
179
179
  }
180
- const stepsDir = path_1.default.join(rootDir, 'steps');
181
- if (!(0, utils_1.checkIfDirectoryExists)(stepsDir)) {
182
- fs_1.default.mkdirSync(stepsDir);
183
- context.log('steps-directory-created', (message) => message.tag('success').append('Folder').append('steps', 'cyan').append('has been created.'));
184
- }
185
- if (!(0, utils_1.checkIfDirectoryExists)(path_1.default.join(stepsDir, 'basic-tutorial'))) {
186
- fs_1.default.mkdirSync(path_1.default.join(stepsDir, 'basic-tutorial'));
187
- }
188
- await (0, setup_template_1.setupTemplate)('basic-tutorial', stepsDir, context);
189
180
  if (template) {
190
- if (!(0, utils_1.checkIfDirectoryExists)(path_1.default.join(stepsDir, template))) {
191
- fs_1.default.mkdirSync(path_1.default.join(stepsDir, template));
192
- }
193
- await (0, setup_template_1.setupTemplate)(template, stepsDir, context);
181
+ await (0, setup_template_1.setupTemplate)(template, rootDir, context);
194
182
  }
195
183
  const packageManager = await installNodeDependencies(rootDir, context);
196
184
  if (template === 'python') {
@@ -2,24 +2,24 @@
2
2
  {
3
3
  "id": "basic-tutorial",
4
4
  "config": {
5
- "steps/basic-tutorial/03-state-audit-cron.step.ts": {
5
+ "steps/03-state-audit-cron.step.ts": {
6
6
  "x": -165,
7
7
  "y": 217,
8
8
  "sourceHandlePosition": "right"
9
9
  },
10
- "steps/basic-tutorial/02-process-food-order.step.ts": {
10
+ "steps/02-process-food-order.step.ts": {
11
11
  "x": 211,
12
12
  "y": 17,
13
13
  "sourceHandlePosition": "bottom",
14
14
  "targetHandlePosition": "left"
15
15
  },
16
- "steps/basic-tutorial/01-api.step.ts": {
16
+ "steps/01-api.step.ts": {
17
17
  "x": -100,
18
18
  "y": 3,
19
19
  "sourceHandlePosition": "right",
20
20
  "targetHandlePosition": "left"
21
21
  },
22
- "steps/basic-tutorial/04-notification.step.ts": {
22
+ "steps/04-notification.step.ts": {
23
23
  "x": 300,
24
24
  "y": 264
25
25
  }
@@ -46,14 +46,12 @@ const generateTemplateSteps = (templateFolder) => {
46
46
  const filePath = path.join(templatePath, fileName);
47
47
  if ((0, fs_1.statSync)(filePath).isDirectory()) {
48
48
  const folderPath = path.basename(filePath);
49
- (0, fs_1.mkdirSync)(path.join(rootDir, templateFolder, folderPath));
49
+ (0, fs_1.mkdirSync)(path.join(rootDir, folderPath));
50
50
  continue;
51
51
  }
52
52
  const sanitizedFileName = fileName.replace('.txt', '');
53
53
  const isWorkbenchConfig = fileName.match('motia-workbench.json');
54
- const generateFilePath = path.join(...(isWorkbenchConfig
55
- ? [rootDir.match(/steps/) ? path.join(rootDir, '..') : rootDir, sanitizedFileName]
56
- : [rootDir, templateFolder, sanitizedFileName]));
54
+ const generateFilePath = path.join(rootDir, sanitizedFileName);
57
55
  let content = await fs_1.promises.readFile(filePath, 'utf8');
58
56
  // Make sure statSync doesn't break the execution if the file doesn't exist
59
57
  try {
@@ -16,17 +16,13 @@ export const generateTemplateSteps = (templateFolder: string): Generator => {
16
16
 
17
17
  if (statSync(filePath).isDirectory()) {
18
18
  const folderPath = path.basename(filePath)
19
- mkdirSync(path.join(rootDir, templateFolder, folderPath))
19
+ mkdirSync(path.join(rootDir, folderPath))
20
20
  continue
21
21
  }
22
22
 
23
23
  const sanitizedFileName = fileName.replace('.txt', '')
24
24
  const isWorkbenchConfig = fileName.match('motia-workbench.json')
25
- const generateFilePath = path.join(
26
- ...(isWorkbenchConfig
27
- ? [rootDir.match(/steps/) ? path.join(rootDir, '..') : rootDir, sanitizedFileName]
28
- : [rootDir, templateFolder, sanitizedFileName]),
29
- )
25
+ const generateFilePath = path.join(rootDir, sanitizedFileName)
30
26
  let content = await fs.readFile(filePath, 'utf8')
31
27
 
32
28
  // Make sure statSync doesn't break the execution if the file doesn't exist
@@ -5,5 +5,4 @@ const generate_1 = require("./generate");
5
5
  exports.templates = {
6
6
  default: (0, generate_1.generateTemplateSteps)('default'),
7
7
  python: (0, generate_1.generateTemplateSteps)('python'),
8
- 'basic-tutorial': (0, generate_1.generateTemplateSteps)('basic-tutorial'),
9
8
  };
@@ -3,5 +3,4 @@ import { generateTemplateSteps, Generator } from './generate'
3
3
  export const templates: Record<string, Generator> = {
4
4
  default: generateTemplateSteps('default'),
5
5
  python: generateTemplateSteps('python'),
6
- 'basic-tutorial': generateTemplateSteps('basic-tutorial'),
7
6
  }
@@ -171,20 +171,8 @@ export const create = async ({ projectName, template, cursorEnabled, context })
171
171
  fs.cpSync(cursorTemplateDir, cursorTargetDir, { recursive: true });
172
172
  context.log('cursor-folder-created', (message) => message.tag('success').append('Folder').append('.cursor', 'cyan').append('has been created.'));
173
173
  }
174
- const stepsDir = path.join(rootDir, 'steps');
175
- if (!checkIfDirectoryExists(stepsDir)) {
176
- fs.mkdirSync(stepsDir);
177
- context.log('steps-directory-created', (message) => message.tag('success').append('Folder').append('steps', 'cyan').append('has been created.'));
178
- }
179
- if (!checkIfDirectoryExists(path.join(stepsDir, 'basic-tutorial'))) {
180
- fs.mkdirSync(path.join(stepsDir, 'basic-tutorial'));
181
- }
182
- await setupTemplate('basic-tutorial', stepsDir, context);
183
174
  if (template) {
184
- if (!checkIfDirectoryExists(path.join(stepsDir, template))) {
185
- fs.mkdirSync(path.join(stepsDir, template));
186
- }
187
- await setupTemplate(template, stepsDir, context);
175
+ await setupTemplate(template, rootDir, context);
188
176
  }
189
177
  const packageManager = await installNodeDependencies(rootDir, context);
190
178
  if (template === 'python') {
@@ -2,24 +2,24 @@
2
2
  {
3
3
  "id": "basic-tutorial",
4
4
  "config": {
5
- "steps/basic-tutorial/03-state-audit-cron.step.ts": {
5
+ "steps/03-state-audit-cron.step.ts": {
6
6
  "x": -165,
7
7
  "y": 217,
8
8
  "sourceHandlePosition": "right"
9
9
  },
10
- "steps/basic-tutorial/02-process-food-order.step.ts": {
10
+ "steps/02-process-food-order.step.ts": {
11
11
  "x": 211,
12
12
  "y": 17,
13
13
  "sourceHandlePosition": "bottom",
14
14
  "targetHandlePosition": "left"
15
15
  },
16
- "steps/basic-tutorial/01-api.step.ts": {
16
+ "steps/01-api.step.ts": {
17
17
  "x": -100,
18
18
  "y": 3,
19
19
  "sourceHandlePosition": "right",
20
20
  "targetHandlePosition": "left"
21
21
  },
22
- "steps/basic-tutorial/04-notification.step.ts": {
22
+ "steps/04-notification.step.ts": {
23
23
  "x": 300,
24
24
  "y": 264
25
25
  }
@@ -10,14 +10,12 @@ export const generateTemplateSteps = (templateFolder) => {
10
10
  const filePath = path.join(templatePath, fileName);
11
11
  if (statSync(filePath).isDirectory()) {
12
12
  const folderPath = path.basename(filePath);
13
- mkdirSync(path.join(rootDir, templateFolder, folderPath));
13
+ mkdirSync(path.join(rootDir, folderPath));
14
14
  continue;
15
15
  }
16
16
  const sanitizedFileName = fileName.replace('.txt', '');
17
17
  const isWorkbenchConfig = fileName.match('motia-workbench.json');
18
- const generateFilePath = path.join(...(isWorkbenchConfig
19
- ? [rootDir.match(/steps/) ? path.join(rootDir, '..') : rootDir, sanitizedFileName]
20
- : [rootDir, templateFolder, sanitizedFileName]));
18
+ const generateFilePath = path.join(rootDir, sanitizedFileName);
21
19
  let content = await fs.readFile(filePath, 'utf8');
22
20
  // Make sure statSync doesn't break the execution if the file doesn't exist
23
21
  try {
@@ -16,17 +16,13 @@ export const generateTemplateSteps = (templateFolder: string): Generator => {
16
16
 
17
17
  if (statSync(filePath).isDirectory()) {
18
18
  const folderPath = path.basename(filePath)
19
- mkdirSync(path.join(rootDir, templateFolder, folderPath))
19
+ mkdirSync(path.join(rootDir, folderPath))
20
20
  continue
21
21
  }
22
22
 
23
23
  const sanitizedFileName = fileName.replace('.txt', '')
24
24
  const isWorkbenchConfig = fileName.match('motia-workbench.json')
25
- const generateFilePath = path.join(
26
- ...(isWorkbenchConfig
27
- ? [rootDir.match(/steps/) ? path.join(rootDir, '..') : rootDir, sanitizedFileName]
28
- : [rootDir, templateFolder, sanitizedFileName]),
29
- )
25
+ const generateFilePath = path.join(rootDir, sanitizedFileName)
30
26
  let content = await fs.readFile(filePath, 'utf8')
31
27
 
32
28
  // Make sure statSync doesn't break the execution if the file doesn't exist
@@ -2,5 +2,4 @@ import { generateTemplateSteps } from './generate';
2
2
  export const templates = {
3
3
  default: generateTemplateSteps('default'),
4
4
  python: generateTemplateSteps('python'),
5
- 'basic-tutorial': generateTemplateSteps('basic-tutorial'),
6
5
  };
@@ -3,5 +3,4 @@ import { generateTemplateSteps, Generator } from './generate'
3
3
  export const templates: Record<string, Generator> = {
4
4
  default: generateTemplateSteps('default'),
5
5
  python: generateTemplateSteps('python'),
6
- 'basic-tutorial': generateTemplateSteps('basic-tutorial'),
7
6
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "motia",
3
3
  "description": "A Modern Unified Backend Framework for APIs, Events and Agents",
4
- "version": "0.5.11-beta.120-110250",
4
+ "version": "0.5.11-beta.120-685453",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -43,9 +43,9 @@
43
43
  "inquirer": "^8.2.5",
44
44
  "table": "^6.9.0",
45
45
  "ts-node": "^10.9.2",
46
- "@motiadev/core": "0.5.11-beta.120-110250",
47
- "@motiadev/stream-client-node": "0.5.11-beta.120-110250",
48
- "@motiadev/workbench": "0.5.11-beta.120-110250"
46
+ "@motiadev/workbench": "0.5.11-beta.120-685453",
47
+ "@motiadev/core": "0.5.11-beta.120-685453",
48
+ "@motiadev/stream-client-node": "0.5.11-beta.120-685453"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@amplitude/analytics-types": "^2.9.2",