motia 0.9.5-beta.151 → 0.9.6-beta.152
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/generate-locked-data.js +2 -1
- package/dist/cjs/utils/analytics.d.ts +2 -1
- package/dist/cjs/utils/analytics.js +5 -3
- package/dist/cjs/utils/errors/build.error.d.ts +2 -1
- package/dist/cjs/utils/errors/build.error.js +1 -0
- package/dist/cjs/utils/errors/locked-data-generation.error.d.ts +4 -0
- package/dist/cjs/utils/errors/locked-data-generation.error.js +11 -0
- package/dist/esm/generate-locked-data.js +2 -1
- package/dist/esm/utils/analytics.d.ts +2 -1
- package/dist/esm/utils/analytics.js +5 -3
- package/dist/esm/utils/errors/build.error.d.ts +2 -1
- package/dist/esm/utils/errors/build.error.js +1 -0
- package/dist/esm/utils/errors/locked-data-generation.error.d.ts +4 -0
- package/dist/esm/utils/errors/locked-data-generation.error.js +7 -0
- package/dist/types/utils/analytics.d.ts +2 -1
- package/dist/types/utils/errors/build.error.d.ts +2 -1
- package/dist/types/utils/errors/locked-data-generation.error.d.ts +4 -0
- package/package.json +4 -4
|
@@ -13,6 +13,7 @@ const glob_1 = require("glob");
|
|
|
13
13
|
const path_1 = __importDefault(require("path"));
|
|
14
14
|
const activate_python_env_1 = require("./utils/activate-python-env");
|
|
15
15
|
const compilation_error_1 = require("./utils/errors/compilation.error");
|
|
16
|
+
const locked_data_generation_error_1 = require("./utils/errors/locked-data-generation.error");
|
|
16
17
|
const version = `${(0, crypto_1.randomUUID)()}:${Math.floor(Date.now() / 1000)}`;
|
|
17
18
|
const getStepFilesFromDir = (dir) => {
|
|
18
19
|
if (!(0, fs_1.existsSync)(dir)) {
|
|
@@ -120,7 +121,7 @@ const generateLockedData = async (config) => {
|
|
|
120
121
|
}
|
|
121
122
|
catch (error) {
|
|
122
123
|
console.error(error);
|
|
123
|
-
throw
|
|
124
|
+
throw new locked_data_generation_error_1.LockedDataGenerationError('Failed to parse the project, generating locked data step failed', error);
|
|
124
125
|
}
|
|
125
126
|
};
|
|
126
127
|
exports.generateLockedData = generateLockedData;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { BuildError } from './errors/build.error';
|
|
1
2
|
export declare const enableAnalytics: () => void;
|
|
2
3
|
export declare const disableAnalytics: () => void;
|
|
3
4
|
export declare const identifyUser: () => void;
|
|
4
|
-
export declare const logCliError: (command: string, error:
|
|
5
|
+
export declare const logCliError: (command: string, error: BuildError) => void;
|
|
5
6
|
export declare const wrapAction: <T extends (...args: any[]) => Promise<any>>(action: T) => T;
|
|
@@ -6,6 +6,7 @@ const core_1 = require("@motiadev/core");
|
|
|
6
6
|
const utils_1 = require("@motiadev/core/dist/src/analytics/utils");
|
|
7
7
|
const version_1 = require("../version");
|
|
8
8
|
const enrichment_plugin_1 = require("./amplitude/enrichment-plugin");
|
|
9
|
+
const build_error_1 = require("./errors/build.error");
|
|
9
10
|
(0, analytics_node_1.init)('ab2408031a38aa5cb85587a27ecfc69c', {
|
|
10
11
|
logLevel: analytics_node_1.Types.LogLevel.None,
|
|
11
12
|
});
|
|
@@ -40,9 +41,10 @@ const identifyUser = () => {
|
|
|
40
41
|
exports.identifyUser = identifyUser;
|
|
41
42
|
const logCliError = (command, error) => {
|
|
42
43
|
try {
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
44
|
+
const cause = error.cause instanceof build_error_1.BuildError ? error.cause : error;
|
|
45
|
+
const errorMessage = cause?.message || 'Unknown error';
|
|
46
|
+
const errorType = cause?.constructor?.name || 'Unknown error type';
|
|
47
|
+
const errorStack = cause?.stack ? cause.stack.split('\n').slice(0, 10).join('\n') : undefined;
|
|
46
48
|
const truncatedMessage = errorMessage.length > 500 ? `${errorMessage.substring(0, 500)}...` : errorMessage;
|
|
47
49
|
(0, core_1.trackEvent)('cli_command_error', {
|
|
48
50
|
command,
|
|
@@ -4,6 +4,7 @@ exports.BuildError = exports.BuildErrorType = void 0;
|
|
|
4
4
|
var BuildErrorType;
|
|
5
5
|
(function (BuildErrorType) {
|
|
6
6
|
BuildErrorType["COMPILATION"] = "COMPILATION";
|
|
7
|
+
BuildErrorType["LOCKED_DATA_GENERATION"] = "LOCKED_DATA_GENERATION";
|
|
7
8
|
})(BuildErrorType || (exports.BuildErrorType = BuildErrorType = {}));
|
|
8
9
|
class BuildError extends Error {
|
|
9
10
|
constructor(type, filePath, message, cause) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LockedDataGenerationError = void 0;
|
|
4
|
+
const build_error_1 = require("./build.error");
|
|
5
|
+
class LockedDataGenerationError extends build_error_1.BuildError {
|
|
6
|
+
constructor(message, cause) {
|
|
7
|
+
super(build_error_1.BuildErrorType.LOCKED_DATA_GENERATION, undefined, message, cause);
|
|
8
|
+
this.name = 'LockedDataGenerationError';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.LockedDataGenerationError = LockedDataGenerationError;
|
|
@@ -7,6 +7,7 @@ import { globSync } from 'glob';
|
|
|
7
7
|
import path from 'path';
|
|
8
8
|
import { activatePythonVenv } from './utils/activate-python-env';
|
|
9
9
|
import { CompilationError } from './utils/errors/compilation.error';
|
|
10
|
+
import { LockedDataGenerationError } from './utils/errors/locked-data-generation.error';
|
|
10
11
|
const version = `${randomUUID()}:${Math.floor(Date.now() / 1000)}`;
|
|
11
12
|
const getStepFilesFromDir = (dir) => {
|
|
12
13
|
if (!existsSync(dir)) {
|
|
@@ -111,6 +112,6 @@ export const generateLockedData = async (config) => {
|
|
|
111
112
|
}
|
|
112
113
|
catch (error) {
|
|
113
114
|
console.error(error);
|
|
114
|
-
throw
|
|
115
|
+
throw new LockedDataGenerationError('Failed to parse the project, generating locked data step failed', error);
|
|
115
116
|
}
|
|
116
117
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { BuildError } from './errors/build.error';
|
|
1
2
|
export declare const enableAnalytics: () => void;
|
|
2
3
|
export declare const disableAnalytics: () => void;
|
|
3
4
|
export declare const identifyUser: () => void;
|
|
4
|
-
export declare const logCliError: (command: string, error:
|
|
5
|
+
export declare const logCliError: (command: string, error: BuildError) => void;
|
|
5
6
|
export declare const wrapAction: <T extends (...args: any[]) => Promise<any>>(action: T) => T;
|
|
@@ -3,6 +3,7 @@ import { getUserIdentifier, isAnalyticsEnabled, trackEvent } from '@motiadev/cor
|
|
|
3
3
|
import { getProjectName } from '@motiadev/core/dist/src/analytics/utils';
|
|
4
4
|
import { version } from '../version';
|
|
5
5
|
import { MotiaEnrichmentPlugin } from './amplitude/enrichment-plugin';
|
|
6
|
+
import { BuildError } from './errors/build.error';
|
|
6
7
|
init('ab2408031a38aa5cb85587a27ecfc69c', {
|
|
7
8
|
logLevel: Types.LogLevel.None,
|
|
8
9
|
});
|
|
@@ -34,9 +35,10 @@ export const identifyUser = () => {
|
|
|
34
35
|
};
|
|
35
36
|
export const logCliError = (command, error) => {
|
|
36
37
|
try {
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
38
|
+
const cause = error.cause instanceof BuildError ? error.cause : error;
|
|
39
|
+
const errorMessage = cause?.message || 'Unknown error';
|
|
40
|
+
const errorType = cause?.constructor?.name || 'Unknown error type';
|
|
41
|
+
const errorStack = cause?.stack ? cause.stack.split('\n').slice(0, 10).join('\n') : undefined;
|
|
40
42
|
const truncatedMessage = errorMessage.length > 500 ? `${errorMessage.substring(0, 500)}...` : errorMessage;
|
|
41
43
|
trackEvent('cli_command_error', {
|
|
42
44
|
command,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export var BuildErrorType;
|
|
2
2
|
(function (BuildErrorType) {
|
|
3
3
|
BuildErrorType["COMPILATION"] = "COMPILATION";
|
|
4
|
+
BuildErrorType["LOCKED_DATA_GENERATION"] = "LOCKED_DATA_GENERATION";
|
|
4
5
|
})(BuildErrorType || (BuildErrorType = {}));
|
|
5
6
|
export class BuildError extends Error {
|
|
6
7
|
constructor(type, filePath, message, cause) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BuildError, BuildErrorType } from './build.error';
|
|
2
|
+
export class LockedDataGenerationError extends BuildError {
|
|
3
|
+
constructor(message, cause) {
|
|
4
|
+
super(BuildErrorType.LOCKED_DATA_GENERATION, undefined, message, cause);
|
|
5
|
+
this.name = 'LockedDataGenerationError';
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { BuildError } from './errors/build.error';
|
|
1
2
|
export declare const enableAnalytics: () => void;
|
|
2
3
|
export declare const disableAnalytics: () => void;
|
|
3
4
|
export declare const identifyUser: () => void;
|
|
4
|
-
export declare const logCliError: (command: string, error:
|
|
5
|
+
export declare const logCliError: (command: string, error: BuildError) => void;
|
|
5
6
|
export declare const wrapAction: <T extends (...args: any[]) => Promise<any>>(action: T) => T;
|
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.9.
|
|
4
|
+
"version": "0.9.6-beta.152",
|
|
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.9.
|
|
50
|
-
"@motiadev/stream-client-node": "0.9.
|
|
51
|
-
"@motiadev/workbench": "0.9.
|
|
49
|
+
"@motiadev/core": "0.9.6-beta.152",
|
|
50
|
+
"@motiadev/stream-client-node": "0.9.6-beta.152",
|
|
51
|
+
"@motiadev/workbench": "0.9.6-beta.152"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@amplitude/analytics-types": "^2.9.2",
|