motia 0.8.2-beta.140-709523 → 0.8.2-beta.140-504654

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/dev.js CHANGED
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.dev = void 0;
7
+ // packages/snap/src/dev.ts
7
8
  const analytics_node_1 = require("@amplitude/analytics-node");
8
9
  const core_1 = require("@motiadev/core");
9
10
  const path_1 = __importDefault(require("path"));
@@ -12,7 +13,6 @@ const constants_1 = require("./constants");
12
13
  const dev_watchers_1 = require("./dev-watchers");
13
14
  const generate_locked_data_1 = require("./generate-locked-data");
14
15
  const generate_plugins_1 = require("./generate-plugins");
15
- const load_motia_config_1 = require("./load-motia-config");
16
16
  const activate_python_env_1 = require("./utils/activate-python-env");
17
17
  const analytics_1 = require("./utils/analytics");
18
18
  const version_1 = require("./version");
@@ -41,19 +41,14 @@ const dev = async (port, hostname, disableVerbose, enableMermaid, motiaFileStora
41
41
  }
42
42
  const motiaFileStoragePath = motiaFileStorageDir || '.motia';
43
43
  const lockedData = await (0, generate_locked_data_1.generateLockedData)({ projectDir: baseDir, motiaFileStoragePath });
44
- const appConfig = await (0, load_motia_config_1.loadMotiaConfig)(baseDir);
45
- const state = appConfig.adapters?.state ||
46
- (0, core_1.createStateAdapter)({
47
- adapter: 'default',
48
- filePath: path_1.default.join(baseDir, motiaFileStoragePath),
49
- });
44
+ const queueManager = new core_1.QueueManager();
45
+ const eventManager = (0, core_1.createEventManager)(queueManager);
46
+ const state = (0, core_1.createStateAdapter)({
47
+ adapter: 'default',
48
+ filePath: path_1.default.join(baseDir, motiaFileStoragePath),
49
+ });
50
50
  const config = { isVerbose };
51
- const adapters = {
52
- eventAdapter: appConfig.adapters?.events || new core_1.DefaultQueueEventAdapter(),
53
- cronAdapter: appConfig.adapters?.cron || new core_1.DefaultCronAdapter(),
54
- streamAdapterFactory: appConfig.adapters?.streams ? () => appConfig.adapters.streams : undefined,
55
- };
56
- const motiaServer = (0, core_1.createServer)(lockedData, state, config, adapters);
51
+ const motiaServer = (0, core_1.createServer)(lockedData, eventManager, state, config, queueManager);
57
52
  const watcher = (0, dev_watchers_1.createDevWatchers)(lockedData, motiaServer, motiaServer.motiaEventManager, motiaServer.cronManager);
58
53
  const plugins = await (0, generate_plugins_1.processPlugins)(motiaServer);
59
54
  // Initialize mermaid generator
@@ -42,17 +42,17 @@ const node_fs_1 = __importDefault(require("node:fs"));
42
42
  const node_path_1 = __importDefault(require("node:path"));
43
43
  const core_1 = require("@motiadev/core");
44
44
  const glob_1 = require("glob");
45
- const collectPluginSteps = async (dirname, stepPatterns, projectRoot) => {
45
+ const collectPluginSteps = async (dirname, stepPatterns, projectRoot, printer) => {
46
46
  const pluginSteps = [];
47
47
  if (!node_fs_1.default.existsSync(dirname)) {
48
- console.warn(`[Plugin] Directory not found: ${dirname}`);
48
+ printer.printPluginWarn(`Directory not found: ${dirname}`);
49
49
  return pluginSteps;
50
50
  }
51
51
  for (const pattern of stepPatterns) {
52
52
  try {
53
53
  const stepFiles = (0, glob_1.globSync)(pattern, { absolute: true, cwd: dirname });
54
54
  if (stepFiles.length === 0) {
55
- console.log(`[Plugin] No files found matching pattern: ${pattern} in ${dirname}`);
55
+ printer.printPluginLog(`No files found matching pattern: ${pattern} in ${dirname}`);
56
56
  continue;
57
57
  }
58
58
  for (const filePath of stepFiles) {
@@ -62,35 +62,36 @@ const collectPluginSteps = async (dirname, stepPatterns, projectRoot) => {
62
62
  pluginSteps.push({ filePath, config });
63
63
  }
64
64
  else {
65
- console.warn(`[Plugin] No config found in step ${filePath}, step skipped`);
65
+ printer.printPluginWarn(`No config found in step ${filePath}, step skipped`);
66
66
  }
67
67
  }
68
68
  catch (error) {
69
- console.error(`[Plugin] Error loading step ${filePath}:`, error);
69
+ printer.printPluginError(`Error loading step ${filePath}:`, error);
70
70
  }
71
71
  }
72
72
  }
73
73
  catch (error) {
74
- console.error(`[Plugin] Error processing pattern ${pattern}:`, error);
74
+ printer.printPluginError(`Error processing pattern ${pattern}:`, error);
75
75
  }
76
76
  }
77
77
  return pluginSteps;
78
78
  };
79
- const loadConfig = async (baseDir) => {
79
+ const loadConfig = async (baseDir, printer) => {
80
80
  const configFiles = (0, glob_1.globSync)('motia.config.{ts,js}', { absolute: true, cwd: baseDir });
81
81
  if (configFiles.length === 0) {
82
82
  const templatePath = node_path_1.default.join(__dirname, 'create/templates/nodejs/motia.config.ts.txt');
83
83
  const templateContent = node_fs_1.default.readFileSync(templatePath, 'utf-8');
84
84
  const configPath = node_path_1.default.join(baseDir, 'motia.config.ts');
85
85
  node_fs_1.default.writeFileSync(configPath, templateContent);
86
- console.log('Created motia.config.ts with default plugins');
86
+ printer.printPluginLog('Created motia.config.ts');
87
87
  return (await Promise.resolve(`${configPath}`).then(s => __importStar(require(s)))).default;
88
88
  }
89
89
  return (await Promise.resolve(`${configFiles[0]}`).then(s => __importStar(require(s)))).default;
90
90
  };
91
91
  const createPluginContext = (motiaServer) => {
92
- const { motia, addRoute, removeRoute } = motiaServer;
92
+ const { motia, addRoute, removeRoute, printer } = motiaServer;
93
93
  return {
94
+ printer,
94
95
  tracerFactory: motia.tracerFactory,
95
96
  state: motia.stateAdapter,
96
97
  lockedData: motia.lockedData,
@@ -117,12 +118,12 @@ const createPluginContext = (motiaServer) => {
117
118
  };
118
119
  };
119
120
  const processSteps = async (motiaServer, plugins, baseDir) => {
120
- const { motia, addRoute } = motiaServer;
121
+ const { motia, addRoute, printer } = motiaServer;
121
122
  for (const plugin of plugins) {
122
123
  if (plugin.dirname && plugin.steps) {
123
- console.log(`[Plugin] Loading steps from ${plugin.dirname}`);
124
+ printer.printPluginLog(`Loading steps from ${plugin.dirname}`);
124
125
  try {
125
- const pluginSteps = await collectPluginSteps(plugin.dirname, plugin.steps, baseDir);
126
+ const pluginSteps = await collectPluginSteps(plugin.dirname, plugin.steps, baseDir, printer);
126
127
  const version = `plugin_${(0, node_crypto_1.randomUUID)()}:${Math.floor(Date.now() / 1000)}`;
127
128
  for (const { filePath, config } of pluginSteps) {
128
129
  try {
@@ -134,26 +135,27 @@ const processSteps = async (motiaServer, plugins, baseDir) => {
134
135
  }
135
136
  }
136
137
  else {
137
- console.warn(`[Plugin] Failed to register step: ${config.name} from ${filePath}`);
138
+ printer.printPluginWarn(`Failed to register step: ${config.name} from ${filePath}`);
138
139
  }
139
140
  }
140
141
  catch (error) {
141
- console.error(`[Plugin] Error registering step ${filePath}:`, error);
142
+ printer.printPluginError(`Error registering step ${filePath}:`, error);
142
143
  }
143
144
  }
144
145
  }
145
146
  catch (error) {
146
- console.error(`[Plugin] Error loading steps from ${plugin.dirname}:`, error);
147
+ printer.printPluginError(`Error loading steps from ${plugin.dirname}:`, error);
147
148
  }
148
149
  }
149
150
  }
150
151
  };
151
152
  const processPlugins = async (motiaServer) => {
152
- const baseDir = motiaServer.motia.lockedData.baseDir;
153
+ const { printer, motia } = motiaServer;
154
+ const baseDir = motia.lockedData.baseDir;
153
155
  const context = createPluginContext(motiaServer);
154
- const appConfig = await loadConfig(baseDir);
156
+ const appConfig = await loadConfig(baseDir, printer);
155
157
  if (!appConfig?.plugins) {
156
- console.warn('No plugins found in motia.config.ts');
158
+ printer.printPluginError('No plugins found in motia.config.ts');
157
159
  return [];
158
160
  }
159
161
  const plugins = appConfig.plugins?.flatMap((item) => item(context)) || [];
package/dist/cjs/start.js CHANGED
@@ -9,7 +9,6 @@ const path_1 = __importDefault(require("path"));
9
9
  const constants_1 = require("./constants");
10
10
  const generate_locked_data_1 = require("./generate-locked-data");
11
11
  const generate_plugins_1 = require("./generate-plugins");
12
- const load_motia_config_1 = require("./load-motia-config");
13
12
  const activate_python_env_1 = require("./utils/activate-python-env");
14
13
  const version_1 = require("./version");
15
14
  require('ts-node').register({
@@ -28,16 +27,11 @@ const start = async (port, hostname, disableVerbose, motiaFileStorageDir) => {
28
27
  const motiaFileStoragePath = motiaFileStorageDir || '.motia';
29
28
  const dotMotia = path_1.default.join(baseDir, motiaFileStoragePath);
30
29
  const lockedData = await (0, generate_locked_data_1.generateLockedData)({ projectDir: baseDir, motiaFileStoragePath });
31
- const appConfig = await (0, load_motia_config_1.loadMotiaConfig)(baseDir);
32
- const state = appConfig.adapters?.state || (0, core_1.createStateAdapter)({ adapter: 'default', filePath: dotMotia });
33
- const eventAdapter = appConfig.adapters?.events || new core_1.DefaultQueueEventAdapter();
30
+ const queueManager = new core_1.QueueManager();
31
+ const eventManager = (0, core_1.createEventManager)(queueManager);
32
+ const state = (0, core_1.createStateAdapter)({ adapter: 'default', filePath: dotMotia });
34
33
  const config = { isVerbose, isDev: false, version: version_1.version };
35
- const adapters = {
36
- eventAdapter,
37
- cronAdapter: appConfig.adapters?.cron || new core_1.DefaultCronAdapter(),
38
- streamAdapterFactory: appConfig.adapters?.streams ? () => appConfig.adapters.streams : undefined,
39
- };
40
- const motiaServer = (0, core_1.createServer)(lockedData, state, config, adapters);
34
+ const motiaServer = (0, core_1.createServer)(lockedData, eventManager, state, config, queueManager);
41
35
  const plugins = await (0, generate_plugins_1.processPlugins)(motiaServer);
42
36
  if (!process.env.MOTIA_DOCKER_DISABLE_WORKBENCH) {
43
37
  const { applyMiddleware } = require('@motiadev/workbench/dist/middleware');
package/dist/esm/dev.js CHANGED
@@ -1,12 +1,12 @@
1
+ // packages/snap/src/dev.ts
1
2
  import { flush } from '@amplitude/analytics-node';
2
- import { createMermaidGenerator, createServer, createStateAdapter, DefaultCronAdapter, DefaultQueueEventAdapter, getProjectIdentifier, trackEvent, } from '@motiadev/core';
3
+ import { createEventManager, createMermaidGenerator, createServer, createStateAdapter, getProjectIdentifier, QueueManager, trackEvent, } from '@motiadev/core';
3
4
  import path from 'path';
4
5
  import { deployEndpoints } from './cloud/endpoints';
5
6
  import { isTutorialDisabled, workbenchBase } from './constants';
6
7
  import { createDevWatchers } from './dev-watchers';
7
8
  import { generateLockedData, getStepFiles } from './generate-locked-data';
8
9
  import { processPlugins } from './generate-plugins';
9
- import { loadMotiaConfig } from './load-motia-config';
10
10
  import { activatePythonVenv } from './utils/activate-python-env';
11
11
  import { identifyUser } from './utils/analytics';
12
12
  import { version } from './version';
@@ -35,19 +35,14 @@ export const dev = async (port, hostname, disableVerbose, enableMermaid, motiaFi
35
35
  }
36
36
  const motiaFileStoragePath = motiaFileStorageDir || '.motia';
37
37
  const lockedData = await generateLockedData({ projectDir: baseDir, motiaFileStoragePath });
38
- const appConfig = await loadMotiaConfig(baseDir);
39
- const state = appConfig.adapters?.state ||
40
- createStateAdapter({
41
- adapter: 'default',
42
- filePath: path.join(baseDir, motiaFileStoragePath),
43
- });
38
+ const queueManager = new QueueManager();
39
+ const eventManager = createEventManager(queueManager);
40
+ const state = createStateAdapter({
41
+ adapter: 'default',
42
+ filePath: path.join(baseDir, motiaFileStoragePath),
43
+ });
44
44
  const config = { isVerbose };
45
- const adapters = {
46
- eventAdapter: appConfig.adapters?.events || new DefaultQueueEventAdapter(),
47
- cronAdapter: appConfig.adapters?.cron || new DefaultCronAdapter(),
48
- streamAdapterFactory: appConfig.adapters?.streams ? () => appConfig.adapters.streams : undefined,
49
- };
50
- const motiaServer = createServer(lockedData, state, config, adapters);
45
+ const motiaServer = createServer(lockedData, eventManager, state, config, queueManager);
51
46
  const watcher = createDevWatchers(lockedData, motiaServer, motiaServer.motiaEventManager, motiaServer.cronManager);
52
47
  const plugins = await processPlugins(motiaServer);
53
48
  // Initialize mermaid generator
@@ -3,17 +3,17 @@ import fs from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { getStepConfig, PLUGIN_FLOW_ID, } from '@motiadev/core';
5
5
  import { globSync } from 'glob';
6
- const collectPluginSteps = async (dirname, stepPatterns, projectRoot) => {
6
+ const collectPluginSteps = async (dirname, stepPatterns, projectRoot, printer) => {
7
7
  const pluginSteps = [];
8
8
  if (!fs.existsSync(dirname)) {
9
- console.warn(`[Plugin] Directory not found: ${dirname}`);
9
+ printer.printPluginWarn(`Directory not found: ${dirname}`);
10
10
  return pluginSteps;
11
11
  }
12
12
  for (const pattern of stepPatterns) {
13
13
  try {
14
14
  const stepFiles = globSync(pattern, { absolute: true, cwd: dirname });
15
15
  if (stepFiles.length === 0) {
16
- console.log(`[Plugin] No files found matching pattern: ${pattern} in ${dirname}`);
16
+ printer.printPluginLog(`No files found matching pattern: ${pattern} in ${dirname}`);
17
17
  continue;
18
18
  }
19
19
  for (const filePath of stepFiles) {
@@ -23,35 +23,36 @@ const collectPluginSteps = async (dirname, stepPatterns, projectRoot) => {
23
23
  pluginSteps.push({ filePath, config });
24
24
  }
25
25
  else {
26
- console.warn(`[Plugin] No config found in step ${filePath}, step skipped`);
26
+ printer.printPluginWarn(`No config found in step ${filePath}, step skipped`);
27
27
  }
28
28
  }
29
29
  catch (error) {
30
- console.error(`[Plugin] Error loading step ${filePath}:`, error);
30
+ printer.printPluginError(`Error loading step ${filePath}:`, error);
31
31
  }
32
32
  }
33
33
  }
34
34
  catch (error) {
35
- console.error(`[Plugin] Error processing pattern ${pattern}:`, error);
35
+ printer.printPluginError(`Error processing pattern ${pattern}:`, error);
36
36
  }
37
37
  }
38
38
  return pluginSteps;
39
39
  };
40
- const loadConfig = async (baseDir) => {
40
+ const loadConfig = async (baseDir, printer) => {
41
41
  const configFiles = globSync('motia.config.{ts,js}', { absolute: true, cwd: baseDir });
42
42
  if (configFiles.length === 0) {
43
43
  const templatePath = path.join(__dirname, 'create/templates/nodejs/motia.config.ts.txt');
44
44
  const templateContent = fs.readFileSync(templatePath, 'utf-8');
45
45
  const configPath = path.join(baseDir, 'motia.config.ts');
46
46
  fs.writeFileSync(configPath, templateContent);
47
- console.log('Created motia.config.ts with default plugins');
47
+ printer.printPluginLog('Created motia.config.ts');
48
48
  return (await import(configPath)).default;
49
49
  }
50
50
  return (await import(configFiles[0])).default;
51
51
  };
52
52
  const createPluginContext = (motiaServer) => {
53
- const { motia, addRoute, removeRoute } = motiaServer;
53
+ const { motia, addRoute, removeRoute, printer } = motiaServer;
54
54
  return {
55
+ printer,
55
56
  tracerFactory: motia.tracerFactory,
56
57
  state: motia.stateAdapter,
57
58
  lockedData: motia.lockedData,
@@ -78,12 +79,12 @@ const createPluginContext = (motiaServer) => {
78
79
  };
79
80
  };
80
81
  const processSteps = async (motiaServer, plugins, baseDir) => {
81
- const { motia, addRoute } = motiaServer;
82
+ const { motia, addRoute, printer } = motiaServer;
82
83
  for (const plugin of plugins) {
83
84
  if (plugin.dirname && plugin.steps) {
84
- console.log(`[Plugin] Loading steps from ${plugin.dirname}`);
85
+ printer.printPluginLog(`Loading steps from ${plugin.dirname}`);
85
86
  try {
86
- const pluginSteps = await collectPluginSteps(plugin.dirname, plugin.steps, baseDir);
87
+ const pluginSteps = await collectPluginSteps(plugin.dirname, plugin.steps, baseDir, printer);
87
88
  const version = `plugin_${randomUUID()}:${Math.floor(Date.now() / 1000)}`;
88
89
  for (const { filePath, config } of pluginSteps) {
89
90
  try {
@@ -95,26 +96,27 @@ const processSteps = async (motiaServer, plugins, baseDir) => {
95
96
  }
96
97
  }
97
98
  else {
98
- console.warn(`[Plugin] Failed to register step: ${config.name} from ${filePath}`);
99
+ printer.printPluginWarn(`Failed to register step: ${config.name} from ${filePath}`);
99
100
  }
100
101
  }
101
102
  catch (error) {
102
- console.error(`[Plugin] Error registering step ${filePath}:`, error);
103
+ printer.printPluginError(`Error registering step ${filePath}:`, error);
103
104
  }
104
105
  }
105
106
  }
106
107
  catch (error) {
107
- console.error(`[Plugin] Error loading steps from ${plugin.dirname}:`, error);
108
+ printer.printPluginError(`Error loading steps from ${plugin.dirname}:`, error);
108
109
  }
109
110
  }
110
111
  }
111
112
  };
112
113
  export const processPlugins = async (motiaServer) => {
113
- const baseDir = motiaServer.motia.lockedData.baseDir;
114
+ const { printer, motia } = motiaServer;
115
+ const baseDir = motia.lockedData.baseDir;
114
116
  const context = createPluginContext(motiaServer);
115
- const appConfig = await loadConfig(baseDir);
117
+ const appConfig = await loadConfig(baseDir, printer);
116
118
  if (!appConfig?.plugins) {
117
- console.warn('No plugins found in motia.config.ts');
119
+ printer.printPluginError('No plugins found in motia.config.ts');
118
120
  return [];
119
121
  }
120
122
  const plugins = appConfig.plugins?.flatMap((item) => item(context)) || [];
package/dist/esm/start.js CHANGED
@@ -1,9 +1,8 @@
1
- import { createServer, createStateAdapter, DefaultCronAdapter, DefaultQueueEventAdapter, } from '@motiadev/core';
1
+ import { createEventManager, createServer, createStateAdapter, QueueManager } from '@motiadev/core';
2
2
  import path from 'path';
3
3
  import { workbenchBase } from './constants';
4
4
  import { generateLockedData, getStepFiles } from './generate-locked-data';
5
5
  import { processPlugins } from './generate-plugins';
6
- import { loadMotiaConfig } from './load-motia-config';
7
6
  import { activatePythonVenv } from './utils/activate-python-env';
8
7
  import { version } from './version';
9
8
  require('ts-node').register({
@@ -22,16 +21,11 @@ export const start = async (port, hostname, disableVerbose, motiaFileStorageDir)
22
21
  const motiaFileStoragePath = motiaFileStorageDir || '.motia';
23
22
  const dotMotia = path.join(baseDir, motiaFileStoragePath);
24
23
  const lockedData = await generateLockedData({ projectDir: baseDir, motiaFileStoragePath });
25
- const appConfig = await loadMotiaConfig(baseDir);
26
- const state = appConfig.adapters?.state || createStateAdapter({ adapter: 'default', filePath: dotMotia });
27
- const eventAdapter = appConfig.adapters?.events || new DefaultQueueEventAdapter();
24
+ const queueManager = new QueueManager();
25
+ const eventManager = createEventManager(queueManager);
26
+ const state = createStateAdapter({ adapter: 'default', filePath: dotMotia });
28
27
  const config = { isVerbose, isDev: false, version };
29
- const adapters = {
30
- eventAdapter,
31
- cronAdapter: appConfig.adapters?.cron || new DefaultCronAdapter(),
32
- streamAdapterFactory: appConfig.adapters?.streams ? () => appConfig.adapters.streams : undefined,
33
- };
34
- const motiaServer = createServer(lockedData, state, config, adapters);
28
+ const motiaServer = createServer(lockedData, eventManager, state, config, queueManager);
35
29
  const plugins = await processPlugins(motiaServer);
36
30
  if (!process.env.MOTIA_DOCKER_DISABLE_WORKBENCH) {
37
31
  const { applyMiddleware } = require('@motiadev/workbench/dist/middleware');
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.8.2-beta.140-709523",
4
+ "version": "0.8.2-beta.140-504654",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -46,9 +46,9 @@
46
46
  "python-ast": "^0.1.0",
47
47
  "table": "^6.9.0",
48
48
  "ts-node": "^10.9.2",
49
- "@motiadev/core": "0.8.2-beta.140-709523",
50
- "@motiadev/workbench": "0.8.2-beta.140-709523",
51
- "@motiadev/stream-client-node": "0.8.2-beta.140-709523"
49
+ "@motiadev/stream-client-node": "0.8.2-beta.140-504654",
50
+ "@motiadev/workbench": "0.8.2-beta.140-504654",
51
+ "@motiadev/core": "0.8.2-beta.140-504654"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@amplitude/analytics-types": "^2.9.2",
@@ -1,2 +0,0 @@
1
- import type { Config } from '@motiadev/core';
2
- export declare const loadMotiaConfig: (baseDir: string) => Promise<Config>;
@@ -1,52 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.loadMotiaConfig = void 0;
37
- const glob_1 = require("glob");
38
- const loadMotiaConfig = async (baseDir) => {
39
- const configFiles = (0, glob_1.globSync)('motia.config.{ts,js}', { absolute: true, cwd: baseDir });
40
- if (configFiles.length === 0) {
41
- return {};
42
- }
43
- try {
44
- const appConfig = (await Promise.resolve(`${configFiles[0]}`).then(s => __importStar(require(s)))).default;
45
- return appConfig || {};
46
- }
47
- catch (error) {
48
- console.warn('Failed to load motia.config.ts:', error);
49
- return {};
50
- }
51
- };
52
- exports.loadMotiaConfig = loadMotiaConfig;
@@ -1,2 +0,0 @@
1
- import type { Config } from '@motiadev/core';
2
- export declare const loadMotiaConfig: (baseDir: string) => Promise<Config>;
@@ -1,15 +0,0 @@
1
- import { globSync } from 'glob';
2
- export const loadMotiaConfig = async (baseDir) => {
3
- const configFiles = globSync('motia.config.{ts,js}', { absolute: true, cwd: baseDir });
4
- if (configFiles.length === 0) {
5
- return {};
6
- }
7
- try {
8
- const appConfig = (await import(configFiles[0])).default;
9
- return appConfig || {};
10
- }
11
- catch (error) {
12
- console.warn('Failed to load motia.config.ts:', error);
13
- return {};
14
- }
15
- };
@@ -1,2 +0,0 @@
1
- import type { Config } from '@motiadev/core';
2
- export declare const loadMotiaConfig: (baseDir: string) => Promise<Config>;