motia 0.14.0-beta.165-254259 → 0.14.0-beta.165-616219
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.
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { globSync } from "glob";
|
|
2
|
+
import { createJiti } from "jiti";
|
|
2
3
|
|
|
3
4
|
//#region src/load-motia-config.ts
|
|
5
|
+
const jiti = createJiti(import.meta.url);
|
|
4
6
|
const loadMotiaConfig = async (baseDir) => {
|
|
5
7
|
const configFiles = globSync("motia.config.{ts,js}", {
|
|
6
8
|
absolute: true,
|
|
@@ -8,7 +10,7 @@ const loadMotiaConfig = async (baseDir) => {
|
|
|
8
10
|
});
|
|
9
11
|
if (configFiles.length === 0) return {};
|
|
10
12
|
try {
|
|
11
|
-
return (await import(configFiles[0])).default || {};
|
|
13
|
+
return (await jiti.import(configFiles[0])).default || {};
|
|
12
14
|
} catch (error) {
|
|
13
15
|
console.warn("Failed to load motia.config.ts:", error);
|
|
14
16
|
return {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-motia-config.mjs","names":[],"sources":["../src/load-motia-config.ts"],"sourcesContent":["import type { Config } from '@motiadev/core'\nimport { globSync } from 'glob'\n\nexport type LoadedMotiaConfig = Config\n\nexport const loadMotiaConfig = async (baseDir: string): Promise<LoadedMotiaConfig> => {\n const configFiles = globSync('motia.config.{ts,js}', { absolute: true, cwd: baseDir })\n\n if (configFiles.length === 0) {\n return {}\n }\n\n try {\n const appConfig: Config = (await import(configFiles[0])).default\n return appConfig || {}\n } catch (error) {\n console.warn('Failed to load motia.config.ts:', error)\n return {}\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"load-motia-config.mjs","names":[],"sources":["../src/load-motia-config.ts"],"sourcesContent":["import type { Config } from '@motiadev/core'\nimport { globSync } from 'glob'\nimport { createJiti } from 'jiti'\n\nexport type LoadedMotiaConfig = Config\n\nconst jiti = createJiti(import.meta.url)\n\nexport const loadMotiaConfig = async (baseDir: string): Promise<LoadedMotiaConfig> => {\n const configFiles = globSync('motia.config.{ts,js}', { absolute: true, cwd: baseDir })\n\n if (configFiles.length === 0) {\n return {}\n }\n\n try {\n const appConfig: Config = (await jiti.import(configFiles[0])).default\n return appConfig || {}\n } catch (error) {\n console.warn('Failed to load motia.config.ts:', error)\n return {}\n }\n}\n"],"mappings":";;;;AAMA,MAAM,OAAO,WAAW,OAAO,KAAK,IAAI;AAExC,MAAa,kBAAkB,OAAO,YAAgD;CACpF,MAAM,cAAc,SAAS,wBAAwB;EAAE,UAAU;EAAM,KAAK;EAAS,CAAC;AAEtF,KAAI,YAAY,WAAW,EACzB,QAAO,EAAE;AAGX,KAAI;AAEF,UAD2B,MAAM,KAAK,OAAO,YAAY,GAAG,EAAE,WAC1C,EAAE;UACf,OAAO;AACd,UAAQ,KAAK,mCAAmC,MAAM;AACtD,SAAO,EAAE"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { installPluginDependencies } from "./install-plugin-dependencies.mjs";
|
|
2
2
|
import { globSync } from "glob";
|
|
3
|
+
import { createJiti } from "jiti";
|
|
3
4
|
import fs from "node:fs";
|
|
4
5
|
import path from "node:path";
|
|
5
6
|
import { fileURLToPath } from "node:url";
|
|
6
7
|
|
|
7
8
|
//#region src/plugins/load-config.ts
|
|
8
9
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const jiti = createJiti(import.meta.url);
|
|
9
11
|
const loadConfig = async (baseDir, printer) => {
|
|
10
12
|
const configFiles = globSync("motia.config.{ts,js}", {
|
|
11
13
|
absolute: true,
|
|
@@ -18,9 +20,9 @@ const loadConfig = async (baseDir, printer) => {
|
|
|
18
20
|
fs.writeFileSync(configPath, templateContent);
|
|
19
21
|
printer.printPluginLog("Created motia.config.ts");
|
|
20
22
|
await installPluginDependencies(baseDir, printer);
|
|
21
|
-
return (await import(configPath)).default;
|
|
23
|
+
return (await jiti.import(configPath)).default;
|
|
22
24
|
}
|
|
23
|
-
return (await import(configFiles[0])).default;
|
|
25
|
+
return (await jiti.import(configFiles[0])).default;
|
|
24
26
|
};
|
|
25
27
|
|
|
26
28
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-config.mjs","names":[],"sources":["../../src/plugins/load-config.ts"],"sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport type { Config, Printer } from '@motiadev/core'\nimport { globSync } from 'glob'\nimport { installPluginDependencies } from './install-plugin-dependencies'\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url))\n\nexport const loadConfig = async (baseDir: string, printer: Printer): Promise<Config> => {\n const configFiles = globSync('motia.config.{ts,js}', { absolute: true, cwd: baseDir })\n if (configFiles.length === 0) {\n const templatePath = path.join(__dirname, '../create/templates/nodejs/motia.config.ts.txt')\n const templateContent = fs.readFileSync(templatePath, 'utf-8')\n const configPath = path.join(baseDir, 'motia.config.ts')\n fs.writeFileSync(configPath, templateContent)\n printer.printPluginLog('Created motia.config.ts')\n\n await installPluginDependencies(baseDir, printer)\n\n return (await import(configPath)).default\n }\n\n return (await import(configFiles[0])).default\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"load-config.mjs","names":[],"sources":["../../src/plugins/load-config.ts"],"sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport type { Config, Printer } from '@motiadev/core'\nimport { globSync } from 'glob'\nimport { createJiti } from 'jiti'\nimport { installPluginDependencies } from './install-plugin-dependencies'\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url))\nconst jiti = createJiti(import.meta.url)\n\nexport const loadConfig = async (baseDir: string, printer: Printer): Promise<Config> => {\n const configFiles = globSync('motia.config.{ts,js}', { absolute: true, cwd: baseDir })\n if (configFiles.length === 0) {\n const templatePath = path.join(__dirname, '../create/templates/nodejs/motia.config.ts.txt')\n const templateContent = fs.readFileSync(templatePath, 'utf-8')\n const configPath = path.join(baseDir, 'motia.config.ts')\n fs.writeFileSync(configPath, templateContent)\n printer.printPluginLog('Created motia.config.ts')\n\n await installPluginDependencies(baseDir, printer)\n\n return (await jiti.import(configPath)).default\n }\n\n return (await jiti.import(configFiles[0])).default\n}\n"],"mappings":";;;;;;;;AAQA,MAAM,YAAY,KAAK,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;AAC9D,MAAM,OAAO,WAAW,OAAO,KAAK,IAAI;AAExC,MAAa,aAAa,OAAO,SAAiB,YAAsC;CACtF,MAAM,cAAc,SAAS,wBAAwB;EAAE,UAAU;EAAM,KAAK;EAAS,CAAC;AACtF,KAAI,YAAY,WAAW,GAAG;EAC5B,MAAM,eAAe,KAAK,KAAK,WAAW,iDAAiD;EAC3F,MAAM,kBAAkB,GAAG,aAAa,cAAc,QAAQ;EAC9D,MAAM,aAAa,KAAK,KAAK,SAAS,kBAAkB;AACxD,KAAG,cAAc,YAAY,gBAAgB;AAC7C,UAAQ,eAAe,0BAA0B;AAEjD,QAAM,0BAA0B,SAAS,QAAQ;AAEjD,UAAQ,MAAM,KAAK,OAAO,WAAW,EAAE;;AAGzC,SAAQ,MAAM,KAAK,OAAO,YAAY,GAAG,EAAE"}
|
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-616219",
|
|
5
5
|
"license": "Elastic-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"express": "^4.21.2",
|
|
38
38
|
"tsx": "^4.19.0",
|
|
39
39
|
"glob": "^11.0.1",
|
|
40
|
+
"jiti": "^2.4.2",
|
|
40
41
|
"inquirer": "^8.2.5",
|
|
41
42
|
"node-cron": "^3.0.3",
|
|
42
43
|
"python-ast": "^0.1.0",
|
|
@@ -45,13 +46,13 @@
|
|
|
45
46
|
"table": "^6.9.0",
|
|
46
47
|
"ts-node": "^10.9.2",
|
|
47
48
|
"zod": "^4.1.12",
|
|
48
|
-
"@motiadev/adapter-
|
|
49
|
-
"@motiadev/adapter-redis-state": "0.14.0-beta.165-
|
|
50
|
-
"@motiadev/adapter-
|
|
51
|
-
"@motiadev/adapter-redis-streams": "0.14.0-beta.165-
|
|
52
|
-
"@motiadev/
|
|
53
|
-
"@motiadev/
|
|
54
|
-
"@motiadev/core": "0.14.0-beta.165-
|
|
49
|
+
"@motiadev/adapter-bullmq-events": "0.14.0-beta.165-616219",
|
|
50
|
+
"@motiadev/adapter-redis-state": "0.14.0-beta.165-616219",
|
|
51
|
+
"@motiadev/adapter-redis-cron": "0.14.0-beta.165-616219",
|
|
52
|
+
"@motiadev/adapter-redis-streams": "0.14.0-beta.165-616219",
|
|
53
|
+
"@motiadev/stream-client-node": "0.14.0-beta.165-616219",
|
|
54
|
+
"@motiadev/workbench": "0.14.0-beta.165-616219",
|
|
55
|
+
"@motiadev/core": "0.14.0-beta.165-616219"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
58
|
"@amplitude/analytics-types": "^2.9.2",
|