motia 0.14.0-beta.165-076789 → 0.14.0-beta.165-634707
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/create/templates/hello_multilang/steps/hello/process_greeting_step.py.txt +2 -2
- package/dist/create/templates/hello_python/steps/hello/hello_api_step.py.txt +2 -2
- package/dist/create/templates/hello_python/steps/hello/process_greeting_step.py.txt +2 -2
- package/dist/create/templates/plugin/README.md.txt +57 -12
- package/dist/create/templates/plugin/package.json.txt +32 -24
- package/dist/create/templates/plugin/src/components/example-page.tsx.txt +1 -2
- package/dist/create/templates/plugin/src/index.ts.txt +0 -2
- package/dist/create/templates/plugin/tsdown.config.ts.txt +53 -0
- package/dist/create/templates/python/steps/petstore/process_food_order_step.py.txt +2 -2
- package/dist/cursor-rules/dot-files/.aider.conf.yml +32 -0
- package/dist/docker/setup.mjs +8 -2
- package/dist/docker/setup.mjs.map +1 -1
- package/package.json +8 -9
- package/dist/create/templates/plugin/vite.config.ts.txt +0 -30
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from datetime import datetime
|
|
1
|
+
from datetime import datetime, timezone
|
|
2
2
|
|
|
3
3
|
# Optional: Using Pydantic for validation (remove if not using Pydantic)
|
|
4
4
|
try:
|
|
@@ -53,7 +53,7 @@ async def handler(input_data, context):
|
|
|
53
53
|
# Note: The state.set method takes (groupId, key, value)
|
|
54
54
|
await context.state.set("greetings", request_id, {
|
|
55
55
|
"greeting": greeting,
|
|
56
|
-
"processedAt": datetime.
|
|
56
|
+
"processedAt": datetime.now(timezone.utc).isoformat(),
|
|
57
57
|
"originalTimestamp": timestamp,
|
|
58
58
|
"processedBy": "python"
|
|
59
59
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import random
|
|
3
3
|
import string
|
|
4
|
-
from datetime import datetime
|
|
4
|
+
from datetime import datetime, timezone
|
|
5
5
|
|
|
6
6
|
# Optional: Using Pydantic for validation (remove if not using Pydantic)
|
|
7
7
|
try:
|
|
@@ -43,7 +43,7 @@ config = {
|
|
|
43
43
|
|
|
44
44
|
async def handler(req, context):
|
|
45
45
|
app_name = os.environ.get("APP_NAME", "Motia App")
|
|
46
|
-
timestamp = datetime.
|
|
46
|
+
timestamp = datetime.now(timezone.utc).isoformat()
|
|
47
47
|
|
|
48
48
|
context.logger.info("Hello API endpoint called", {
|
|
49
49
|
"app_name": app_name,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
-
from datetime import datetime
|
|
2
|
+
from datetime import datetime, timezone
|
|
3
3
|
|
|
4
4
|
# Optional: Using Pydantic for validation (remove if not using Pydantic)
|
|
5
5
|
try:
|
|
@@ -54,7 +54,7 @@ async def handler(input_data, context):
|
|
|
54
54
|
# Note: The state.set method takes (groupId, key, value)
|
|
55
55
|
await context.state.set("greetings", request_id, {
|
|
56
56
|
"greeting": greeting,
|
|
57
|
-
"processedAt": datetime.
|
|
57
|
+
"processedAt": datetime.now(timezone.utc).isoformat(),
|
|
58
58
|
"originalTimestamp": timestamp
|
|
59
59
|
})
|
|
60
60
|
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @motiadev/plugin-example
|
|
2
2
|
|
|
3
|
-
A minimal plugin demonstrating the Motia plugin system.
|
|
3
|
+
A minimal example plugin demonstrating the Motia plugin system.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
7
|
This plugin serves as a reference implementation showing how to create custom workbench plugins for Motia. It demonstrates:
|
|
8
8
|
|
|
9
9
|
- Basic plugin structure and configuration
|
|
10
|
-
- Creating custom workbench tabs
|
|
11
|
-
- Using Motia's UI component library
|
|
12
|
-
- Building with
|
|
10
|
+
- Creating custom workbench tabs with position control
|
|
11
|
+
- Using Motia's UI component library (`@motiadev/ui`)
|
|
12
|
+
- Building with tsdown and TypeScript
|
|
13
|
+
- Tailwind CSS v4 styling with PostCSS
|
|
14
|
+
- React Compiler optimization via Babel
|
|
13
15
|
|
|
14
16
|
## Installation
|
|
15
17
|
|
|
@@ -35,30 +37,73 @@ pnpm run clean
|
|
|
35
37
|
To use this plugin in your Motia project, import it in your `motia.config.ts`:
|
|
36
38
|
|
|
37
39
|
```typescript
|
|
38
|
-
import examplePlugin from '
|
|
40
|
+
import examplePlugin from '@motiadev/plugin-example/plugin'
|
|
39
41
|
|
|
40
42
|
export default {
|
|
41
43
|
plugins: [examplePlugin],
|
|
42
44
|
}
|
|
43
45
|
```
|
|
44
46
|
|
|
47
|
+
## Plugin Configuration
|
|
48
|
+
|
|
49
|
+
The plugin exports a function that receives the `MotiaPluginContext` and returns a `MotiaPlugin` object:
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import type { MotiaPlugin, MotiaPluginContext } from '@motiadev/core'
|
|
53
|
+
|
|
54
|
+
export default function plugin(_motia: MotiaPluginContext): MotiaPlugin {
|
|
55
|
+
return {
|
|
56
|
+
workbench: [
|
|
57
|
+
{
|
|
58
|
+
packageName: '@motiadev/plugin-example',
|
|
59
|
+
cssImports: ['@motiadev/plugin-example/dist/index.css'],
|
|
60
|
+
label: 'Example',
|
|
61
|
+
position: 'bottom',
|
|
62
|
+
componentName: 'ExamplePage',
|
|
63
|
+
labelIcon: 'sparkles',
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Workbench Options
|
|
71
|
+
|
|
72
|
+
| Option | Description |
|
|
73
|
+
| --------------- | ------------------------------------------ |
|
|
74
|
+
| `packageName` | The npm package name for dynamic imports |
|
|
75
|
+
| `cssImports` | Array of CSS files to load with the plugin |
|
|
76
|
+
| `label` | Display name shown in the workbench tab |
|
|
77
|
+
| `position` | Tab position: `'top'` or `'bottom'` |
|
|
78
|
+
| `componentName` | Name of the exported React component |
|
|
79
|
+
| `labelIcon` | Lucide icon name for the tab |
|
|
80
|
+
|
|
45
81
|
## Structure
|
|
46
82
|
|
|
47
83
|
```
|
|
48
|
-
|
|
84
|
+
plugin-example/
|
|
49
85
|
├── src/
|
|
50
86
|
│ ├── components/
|
|
51
87
|
│ │ └── example-page.tsx # Main UI component
|
|
52
|
-
│ ├── index.ts # Package entry point
|
|
88
|
+
│ ├── index.ts # Package entry point (exports components)
|
|
53
89
|
│ ├── plugin.ts # Plugin definition
|
|
54
|
-
│ └── styles.css # Tailwind styles
|
|
90
|
+
│ └── styles.css # Tailwind CSS styles
|
|
91
|
+
├── dist/ # Build output
|
|
55
92
|
├── package.json
|
|
56
93
|
├── tsconfig.json
|
|
57
|
-
├──
|
|
94
|
+
├── tsdown.config.ts # Build configuration
|
|
95
|
+
├── postcss.config.js # PostCSS/Tailwind config
|
|
58
96
|
└── README.md
|
|
59
97
|
```
|
|
60
98
|
|
|
61
|
-
##
|
|
99
|
+
## Features Demonstrated
|
|
62
100
|
|
|
63
|
-
|
|
101
|
+
- **Custom Workbench Tab**: Adds an "Example" tab to the bottom panel
|
|
102
|
+
- **UI Components**: Uses `Badge` and `Button` from `@motiadev/ui`
|
|
103
|
+
- **Icons**: Integrates Lucide React icons
|
|
104
|
+
- **Responsive Layout**: Grid-based responsive design with Tailwind CSS
|
|
105
|
+
- **Type Safety**: Full TypeScript support with proper type declarations
|
|
106
|
+
|
|
107
|
+
## Learn More
|
|
64
108
|
|
|
109
|
+
For detailed documentation on creating plugins, see the [Plugins Guide](../../packages/docs/content/docs/development-guide/plugins.mdx).
|
|
@@ -1,47 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "{{PROJECT_NAME}}",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.14.0-beta.164",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"require": "./dist/index.cjs"
|
|
9
|
+
"development": "./src/index.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
12
11
|
},
|
|
13
12
|
"./plugin": {
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"require": "./dist/plugin.cjs"
|
|
13
|
+
"development": "./src/plugin.ts",
|
|
14
|
+
"default": "./dist/plugin.js"
|
|
17
15
|
},
|
|
18
|
-
"./
|
|
16
|
+
"./package.json": "./package.json"
|
|
19
17
|
},
|
|
20
18
|
"files": [
|
|
21
19
|
"dist"
|
|
22
20
|
],
|
|
23
21
|
"scripts": {
|
|
24
|
-
"build": "
|
|
25
|
-
"dev": "
|
|
22
|
+
"build": "tsdown",
|
|
23
|
+
"dev": "tsdown --watch",
|
|
26
24
|
"clean": "rm -rf dist"
|
|
27
25
|
},
|
|
28
26
|
"dependencies": {
|
|
29
|
-
"lucide-react": "^0.
|
|
27
|
+
"lucide-react": "^0.555.0",
|
|
28
|
+
"react": "^19.2.0"
|
|
30
29
|
},
|
|
31
|
-
"
|
|
30
|
+
"peerDependencies": {
|
|
32
31
|
"@motiadev/core": "latest",
|
|
33
|
-
"@motiadev/ui": "latest"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"react": "^19.2.
|
|
41
|
-
"
|
|
32
|
+
"@motiadev/ui": "latest"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@rollup/plugin-babel": "^6.1.0",
|
|
36
|
+
"@tailwindcss/postcss": "^4.1.17",
|
|
37
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
38
|
+
"@types/node": "^24.10.1",
|
|
39
|
+
"@types/react": "^19.2.7",
|
|
40
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
41
|
+
"publint": "^0.3.15",
|
|
42
|
+
"tailwindcss": "^4.1.17",
|
|
43
|
+
"tsdown": "^0.16.8",
|
|
42
44
|
"typescript": "^5.9.3",
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
+
"unplugin-unused": "^0.5.6"
|
|
46
|
+
},
|
|
47
|
+
"module": "./dist/index.js",
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"exports": {
|
|
50
|
+
".": "./dist/index.js",
|
|
51
|
+
"./plugin": "./dist/plugin.js",
|
|
52
|
+
"./package.json": "./package.json"
|
|
53
|
+
}
|
|
45
54
|
}
|
|
46
55
|
}
|
|
47
|
-
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import pluginBabel from '@rollup/plugin-babel'
|
|
2
|
+
import postcss from 'rollup-plugin-postcss'
|
|
3
|
+
import { defineConfig } from 'tsdown'
|
|
4
|
+
|
|
5
|
+
export default defineConfig([
|
|
6
|
+
// Main JavaScript/TypeScript build
|
|
7
|
+
{
|
|
8
|
+
entry: {
|
|
9
|
+
index: './src/index.ts',
|
|
10
|
+
plugin: './src/plugin.ts',
|
|
11
|
+
},
|
|
12
|
+
format: 'esm',
|
|
13
|
+
platform: 'browser',
|
|
14
|
+
external: [/^react($|\/)/, 'react/jsx-runtime'],
|
|
15
|
+
dts: {
|
|
16
|
+
build: true,
|
|
17
|
+
},
|
|
18
|
+
exports: {
|
|
19
|
+
devExports: 'development',
|
|
20
|
+
},
|
|
21
|
+
clean: true,
|
|
22
|
+
publint: true,
|
|
23
|
+
unused: true,
|
|
24
|
+
outDir: 'dist',
|
|
25
|
+
plugins: [
|
|
26
|
+
pluginBabel({
|
|
27
|
+
babelHelpers: 'bundled',
|
|
28
|
+
parserOpts: {
|
|
29
|
+
sourceType: 'module',
|
|
30
|
+
plugins: ['jsx', 'typescript'],
|
|
31
|
+
},
|
|
32
|
+
plugins: ['babel-plugin-react-compiler'],
|
|
33
|
+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
// Separate CSS build
|
|
38
|
+
{
|
|
39
|
+
entry: {
|
|
40
|
+
index: './src/styles.css',
|
|
41
|
+
},
|
|
42
|
+
format: 'esm',
|
|
43
|
+
platform: 'browser',
|
|
44
|
+
outDir: 'dist',
|
|
45
|
+
clean: false,
|
|
46
|
+
plugins: [
|
|
47
|
+
postcss({
|
|
48
|
+
extract: true,
|
|
49
|
+
minimize: process.env.NODE_ENV === 'prod',
|
|
50
|
+
}),
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
])
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from pydantic import BaseModel
|
|
2
|
-
from datetime import datetime
|
|
2
|
+
from datetime import datetime, timezone
|
|
3
3
|
from src.services.pet_store import pet_store_service
|
|
4
4
|
|
|
5
5
|
class InputSchema(BaseModel):
|
|
@@ -24,7 +24,7 @@ async def handler(input_data, context):
|
|
|
24
24
|
"quantity": input_data.get("quantity"),
|
|
25
25
|
"pet_id": input_data.get("pet_id"),
|
|
26
26
|
"email": input_data.get("email"),
|
|
27
|
-
"ship_date": datetime.now().isoformat(),
|
|
27
|
+
"ship_date": datetime.now(timezone.utc).isoformat(),
|
|
28
28
|
"status": "placed",
|
|
29
29
|
})
|
|
30
30
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Aider Configuration for Motia Projects
|
|
2
|
+
# https://aider.chat/docs/config.html
|
|
3
|
+
|
|
4
|
+
# Read AGENTS.md for project overview and guide references
|
|
5
|
+
read:
|
|
6
|
+
- AGENTS.md
|
|
7
|
+
# Uncomment specific guides as needed for more context:
|
|
8
|
+
# - .cursor/rules/motia/api-steps.mdc
|
|
9
|
+
# - .cursor/rules/motia/event-steps.mdc
|
|
10
|
+
# - .cursor/rules/motia/cron-steps.mdc
|
|
11
|
+
# - .cursor/rules/motia/state-management.mdc
|
|
12
|
+
# - .cursor/rules/motia/middlewares.mdc
|
|
13
|
+
# - .cursor/rules/motia/realtime-streaming.mdc
|
|
14
|
+
# - .cursor/rules/motia/virtual-steps.mdc
|
|
15
|
+
# - .cursor/rules/motia/ui-steps.mdc
|
|
16
|
+
# - .cursor/architecture/architecture.mdc
|
|
17
|
+
# - .cursor/architecture/error-handling.mdc
|
|
18
|
+
|
|
19
|
+
# Note: AGENTS.md references all detailed guides in .cursor/rules/
|
|
20
|
+
# The AI will read those guides when needed based on AGENTS.md instructions
|
|
21
|
+
|
|
22
|
+
# Auto-commit changes (optional, uncomment to enable)
|
|
23
|
+
# auto-commits: true
|
|
24
|
+
|
|
25
|
+
# Model selection (uncomment your preferred model)
|
|
26
|
+
# model: gpt-4
|
|
27
|
+
# model: claude-3-5-sonnet-20241022
|
|
28
|
+
|
|
29
|
+
# Additional context files (optional)
|
|
30
|
+
# read:
|
|
31
|
+
# - config.yml
|
|
32
|
+
# - package.json
|
package/dist/docker/setup.mjs
CHANGED
|
@@ -8,6 +8,12 @@ import * as readline$1 from "readline";
|
|
|
8
8
|
|
|
9
9
|
//#region src/docker/setup.ts
|
|
10
10
|
const __dirname = path$1.dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
const resolveTemplatesDir = () => {
|
|
12
|
+
const localTemplates = path$1.join(__dirname, "./templates");
|
|
13
|
+
if (fs$1.existsSync(localTemplates)) return localTemplates;
|
|
14
|
+
return path$1.join(__dirname, "../../../docker/templates");
|
|
15
|
+
};
|
|
16
|
+
const templatesDir = resolveTemplatesDir();
|
|
11
17
|
const updatePackageJson = () => {
|
|
12
18
|
const packageJsonPath = path$1.join(process.cwd(), "package.json");
|
|
13
19
|
if (fs$1.existsSync(packageJsonPath)) {
|
|
@@ -36,7 +42,7 @@ const createDockerfile = async () => {
|
|
|
36
42
|
return;
|
|
37
43
|
}
|
|
38
44
|
}
|
|
39
|
-
const dockerfileContent = fs$1.readFileSync(path$1.join(
|
|
45
|
+
const dockerfileContent = fs$1.readFileSync(path$1.join(templatesDir, "MotiaDockerSample"), "utf-8");
|
|
40
46
|
try {
|
|
41
47
|
fs$1.writeFileSync(dockerfilePath, dockerfileContent);
|
|
42
48
|
console.log("Dockerfile generated successfully!");
|
|
@@ -48,7 +54,7 @@ const createDockerfile = async () => {
|
|
|
48
54
|
const createDockerignore = async () => {
|
|
49
55
|
identifyUser();
|
|
50
56
|
trackEvent("docker_setup_command", { project_name: getProjectIdentifier(process.cwd()) });
|
|
51
|
-
const dockerignoreContent = fs$1.readFileSync(path$1.join(
|
|
57
|
+
const dockerignoreContent = fs$1.readFileSync(path$1.join(templatesDir, ".dockerignore.sample"), "utf-8");
|
|
52
58
|
const dockerignorePath = path$1.join(process.cwd(), ".dockerignore");
|
|
53
59
|
if (fs$1.existsSync(dockerignorePath)) {
|
|
54
60
|
console.log(".dockerignore already exists");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.mjs","names":["path","fs","readline"],"sources":["../../src/docker/setup.ts"],"sourcesContent":["import { getProjectIdentifier, trackEvent } from '@motiadev/core'\nimport * as fs from 'fs'\nimport * as path from 'path'\nimport * as readline from 'readline'\nimport { fileURLToPath } from 'url'\nimport { identifyUser } from '../utils/analytics'\nimport { printMotiaDockerIntro } from './utils/print-intro'\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url))\n\nconst updatePackageJson = (): void => {\n const packageJsonPath = path.join(process.cwd(), 'package.json')\n if (fs.existsSync(packageJsonPath)) {\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'))\n if (!packageJson.scripts) {\n packageJson.scripts = {}\n }\n packageJson.scripts.start = 'motia start'\n fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2))\n console.log('Updated package.json with start script')\n }\n}\n\nconst createDockerfile = async () => {\n const dockerfilePath = path.join(process.cwd(), 'Dockerfile')\n\n if (fs.existsSync(dockerfilePath)) {\n console.log('Dockerfile already exists')\n\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n })\n\n const shouldOverride = await new Promise<boolean>((resolve) => {\n rl.question('Do you want to override the existing Dockerfile? (y/N): ', (answer) => {\n rl.close()\n resolve(answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes')\n })\n })\n\n if (!shouldOverride) {\n console.log('Dockerfile generation cancelled')\n return\n }\n }\n\n const dockerfileContent = fs.readFileSync(path.join(
|
|
1
|
+
{"version":3,"file":"setup.mjs","names":["path","fs","readline"],"sources":["../../src/docker/setup.ts"],"sourcesContent":["import { getProjectIdentifier, trackEvent } from '@motiadev/core'\nimport * as fs from 'fs'\nimport * as path from 'path'\nimport * as readline from 'readline'\nimport { fileURLToPath } from 'url'\nimport { identifyUser } from '../utils/analytics'\nimport { printMotiaDockerIntro } from './utils/print-intro'\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url))\n\nconst resolveTemplatesDir = (): string => {\n const localTemplates = path.join(__dirname, './templates')\n if (fs.existsSync(localTemplates)) {\n return localTemplates\n }\n // Fallback for development: resolve to packages/docker/templates\n return path.join(__dirname, '../../../docker/templates')\n}\n\nconst templatesDir = resolveTemplatesDir()\n\nconst updatePackageJson = (): void => {\n const packageJsonPath = path.join(process.cwd(), 'package.json')\n if (fs.existsSync(packageJsonPath)) {\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'))\n if (!packageJson.scripts) {\n packageJson.scripts = {}\n }\n packageJson.scripts.start = 'motia start'\n fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2))\n console.log('Updated package.json with start script')\n }\n}\n\nconst createDockerfile = async () => {\n const dockerfilePath = path.join(process.cwd(), 'Dockerfile')\n\n if (fs.existsSync(dockerfilePath)) {\n console.log('Dockerfile already exists')\n\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n })\n\n const shouldOverride = await new Promise<boolean>((resolve) => {\n rl.question('Do you want to override the existing Dockerfile? (y/N): ', (answer) => {\n rl.close()\n resolve(answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes')\n })\n })\n\n if (!shouldOverride) {\n console.log('Dockerfile generation cancelled')\n return\n }\n }\n\n const dockerfileContent = fs.readFileSync(path.join(templatesDir, 'MotiaDockerSample'), 'utf-8')\n\n try {\n fs.writeFileSync(dockerfilePath, dockerfileContent)\n console.log('Dockerfile generated successfully!')\n } catch (error) {\n console.error('Error generating Dockerfile:', (error as Error).message)\n throw error\n }\n}\n\nconst createDockerignore = async () => {\n identifyUser()\n\n trackEvent('docker_setup_command', {\n project_name: getProjectIdentifier(process.cwd()),\n })\n\n const dockerignoreContent = fs.readFileSync(path.join(templatesDir, '.dockerignore.sample'), 'utf-8')\n\n const dockerignorePath = path.join(process.cwd(), '.dockerignore')\n\n if (fs.existsSync(dockerignorePath)) {\n console.log('.dockerignore already exists')\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n })\n\n const shouldOverride = await new Promise<boolean>((resolve) => {\n rl.question('Do you want to override the existing .dockerignore? (y/N): ', (answer) => {\n rl.close()\n resolve(answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes')\n })\n })\n\n if (!shouldOverride) {\n console.log('.dockerignore generation cancelled')\n return\n }\n }\n\n try {\n fs.writeFileSync(dockerignorePath, dockerignoreContent)\n console.log('.dockerignore generated successfully!')\n } catch (error) {\n console.error('Error generating .dockerignore:', (error as Error).message)\n throw error\n }\n}\n\nexport const setup = async (): Promise<void> => {\n printMotiaDockerIntro()\n\n await createDockerfile()\n await createDockerignore()\n updatePackageJson()\n}\n"],"mappings":";;;;;;;;;AAQA,MAAM,YAAYA,OAAK,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;AAE9D,MAAM,4BAAoC;CACxC,MAAM,iBAAiBA,OAAK,KAAK,WAAW,cAAc;AAC1D,KAAIC,KAAG,WAAW,eAAe,CAC/B,QAAO;AAGT,QAAOD,OAAK,KAAK,WAAW,4BAA4B;;AAG1D,MAAM,eAAe,qBAAqB;AAE1C,MAAM,0BAAgC;CACpC,MAAM,kBAAkBA,OAAK,KAAK,QAAQ,KAAK,EAAE,eAAe;AAChE,KAAIC,KAAG,WAAW,gBAAgB,EAAE;EAClC,MAAM,cAAc,KAAK,MAAMA,KAAG,aAAa,iBAAiB,QAAQ,CAAC;AACzE,MAAI,CAAC,YAAY,QACf,aAAY,UAAU,EAAE;AAE1B,cAAY,QAAQ,QAAQ;AAC5B,OAAG,cAAc,iBAAiB,KAAK,UAAU,aAAa,MAAM,EAAE,CAAC;AACvE,UAAQ,IAAI,yCAAyC;;;AAIzD,MAAM,mBAAmB,YAAY;CACnC,MAAM,iBAAiBD,OAAK,KAAK,QAAQ,KAAK,EAAE,aAAa;AAE7D,KAAIC,KAAG,WAAW,eAAe,EAAE;AACjC,UAAQ,IAAI,4BAA4B;EAExC,MAAM,KAAKC,WAAS,gBAAgB;GAClC,OAAO,QAAQ;GACf,QAAQ,QAAQ;GACjB,CAAC;AASF,MAAI,CAPmB,MAAM,IAAI,SAAkB,YAAY;AAC7D,MAAG,SAAS,6DAA6D,WAAW;AAClF,OAAG,OAAO;AACV,YAAQ,OAAO,aAAa,KAAK,OAAO,OAAO,aAAa,KAAK,MAAM;KACvE;IACF,EAEmB;AACnB,WAAQ,IAAI,kCAAkC;AAC9C;;;CAIJ,MAAM,oBAAoBD,KAAG,aAAaD,OAAK,KAAK,cAAc,oBAAoB,EAAE,QAAQ;AAEhG,KAAI;AACF,OAAG,cAAc,gBAAgB,kBAAkB;AACnD,UAAQ,IAAI,qCAAqC;UAC1C,OAAO;AACd,UAAQ,MAAM,gCAAiC,MAAgB,QAAQ;AACvE,QAAM;;;AAIV,MAAM,qBAAqB,YAAY;AACrC,eAAc;AAEd,YAAW,wBAAwB,EACjC,cAAc,qBAAqB,QAAQ,KAAK,CAAC,EAClD,CAAC;CAEF,MAAM,sBAAsBC,KAAG,aAAaD,OAAK,KAAK,cAAc,uBAAuB,EAAE,QAAQ;CAErG,MAAM,mBAAmBA,OAAK,KAAK,QAAQ,KAAK,EAAE,gBAAgB;AAElE,KAAIC,KAAG,WAAW,iBAAiB,EAAE;AACnC,UAAQ,IAAI,+BAA+B;EAC3C,MAAM,KAAKC,WAAS,gBAAgB;GAClC,OAAO,QAAQ;GACf,QAAQ,QAAQ;GACjB,CAAC;AASF,MAAI,CAPmB,MAAM,IAAI,SAAkB,YAAY;AAC7D,MAAG,SAAS,gEAAgE,WAAW;AACrF,OAAG,OAAO;AACV,YAAQ,OAAO,aAAa,KAAK,OAAO,OAAO,aAAa,KAAK,MAAM;KACvE;IACF,EAEmB;AACnB,WAAQ,IAAI,qCAAqC;AACjD;;;AAIJ,KAAI;AACF,OAAG,cAAc,kBAAkB,oBAAoB;AACvD,UAAQ,IAAI,wCAAwC;UAC7C,OAAO;AACd,UAAQ,MAAM,mCAAoC,MAAgB,QAAQ;AAC1E,QAAM;;;AAIV,MAAa,QAAQ,YAA2B;AAC9C,wBAAuB;AAEvB,OAAM,kBAAkB;AACxB,OAAM,oBAAoB;AAC1B,oBAAmB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "motia",
|
|
3
3
|
"description": "Build production-grade backends with a single primitive. APIs, background jobs, Queues, Workflows, and AI agents - unified in one system with built-in State management, Streaming, and Observability.",
|
|
4
|
-
"version": "0.14.0-beta.165-
|
|
4
|
+
"version": "0.14.0-beta.165-634707",
|
|
5
5
|
"license": "Elastic-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"table": "^6.9.0",
|
|
47
47
|
"ts-node": "^10.9.2",
|
|
48
48
|
"zod": "^4.1.12",
|
|
49
|
-
"@motiadev/adapter-bullmq-events": "0.14.0-beta.165-
|
|
50
|
-
"@motiadev/adapter-redis-streams": "0.14.0-beta.165-
|
|
51
|
-
"@motiadev/adapter-redis-
|
|
52
|
-
"@motiadev/
|
|
53
|
-
"@motiadev/adapter-redis-
|
|
54
|
-
"@motiadev/
|
|
55
|
-
"@motiadev/
|
|
49
|
+
"@motiadev/adapter-bullmq-events": "0.14.0-beta.165-634707",
|
|
50
|
+
"@motiadev/adapter-redis-streams": "0.14.0-beta.165-634707",
|
|
51
|
+
"@motiadev/adapter-redis-cron": "0.14.0-beta.165-634707",
|
|
52
|
+
"@motiadev/core": "0.14.0-beta.165-634707",
|
|
53
|
+
"@motiadev/adapter-redis-state": "0.14.0-beta.165-634707",
|
|
54
|
+
"@motiadev/stream-client-node": "0.14.0-beta.165-634707",
|
|
55
|
+
"@motiadev/workbench": "0.14.0-beta.165-634707"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@amplitude/analytics-types": "^2.9.2",
|
|
@@ -74,7 +74,6 @@
|
|
|
74
74
|
"move:python": "sh scripts/move-python.sh",
|
|
75
75
|
"move:dot-files": "sh scripts/move-dot-files.sh",
|
|
76
76
|
"build": "tsdown",
|
|
77
|
-
"postbuild": "sh scripts/post-build.sh",
|
|
78
77
|
"test": "NODE_OPTIONS='--experimental-vm-modules' jest",
|
|
79
78
|
"lint": "biome check .",
|
|
80
79
|
"lint:plugins": "eslint --config ../../eslint.config.js"
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import tailwindcss from '@tailwindcss/vite'
|
|
2
|
-
import react from '@vitejs/plugin-react'
|
|
3
|
-
import { resolve } from 'path'
|
|
4
|
-
import { defineConfig } from 'vite'
|
|
5
|
-
import dts from 'vite-plugin-dts'
|
|
6
|
-
|
|
7
|
-
export default defineConfig({
|
|
8
|
-
plugins: [react(), tailwindcss(), dts({ insertTypesEntry: true })],
|
|
9
|
-
build: {
|
|
10
|
-
lib: {
|
|
11
|
-
entry: {
|
|
12
|
-
index: resolve(__dirname, 'src/index.ts'),
|
|
13
|
-
plugin: resolve(__dirname, 'src/plugin.ts'),
|
|
14
|
-
},
|
|
15
|
-
name: '{{PLUGIN_NAME}}',
|
|
16
|
-
formats: ['es', 'cjs'],
|
|
17
|
-
fileName: (format, entryName) => `${entryName}.${format === 'es' ? 'js' : 'cjs'}`,
|
|
18
|
-
},
|
|
19
|
-
rollupOptions: {
|
|
20
|
-
external: ['react', 'react-dom', '@motiadev/core', '@motiadev/ui'],
|
|
21
|
-
},
|
|
22
|
-
cssCodeSplit: false,
|
|
23
|
-
},
|
|
24
|
-
resolve: {
|
|
25
|
-
alias: {
|
|
26
|
-
'@': resolve(__dirname, 'src'),
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
})
|
|
30
|
-
|