@motiadev/core 0.4.0-beta.90 → 0.4.1-beta.92
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,5 @@
|
|
|
1
1
|
export declare const getProjectName: (baseDir: string) => string;
|
|
2
2
|
export declare const getUserIdentifier: () => string;
|
|
3
3
|
export declare const getProjectIdentifier: (baseDir: string) => string;
|
|
4
|
-
export declare const getMotiaVersion: (baseDir: string) => string;
|
|
5
4
|
export declare const isAnalyticsEnabled: () => boolean;
|
|
6
5
|
export declare const trackEvent: (eventName: string, properties?: Record<string, any>) => void;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.trackEvent = exports.isAnalyticsEnabled = exports.
|
|
6
|
+
exports.trackEvent = exports.isAnalyticsEnabled = exports.getProjectIdentifier = exports.getUserIdentifier = exports.getProjectName = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const os_1 = __importDefault(require("os"));
|
|
@@ -32,20 +32,6 @@ const getProjectIdentifier = (baseDir) => {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
exports.getProjectIdentifier = getProjectIdentifier;
|
|
35
|
-
const getMotiaVersion = (baseDir) => {
|
|
36
|
-
try {
|
|
37
|
-
const packageJsonPath = path_1.default.join(baseDir, 'package.json');
|
|
38
|
-
if (fs_1.default.existsSync(packageJsonPath)) {
|
|
39
|
-
const packageJson = JSON.parse(fs_1.default.readFileSync(packageJsonPath, 'utf8'));
|
|
40
|
-
return packageJson.name || path_1.default.basename(baseDir);
|
|
41
|
-
}
|
|
42
|
-
return 'unknown';
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
return 'unknown';
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
exports.getMotiaVersion = getMotiaVersion;
|
|
49
35
|
const isAnalyticsEnabled = () => {
|
|
50
36
|
return process.env.MOTIA_ANALYTICS_DISABLED !== 'true';
|
|
51
37
|
};
|
package/dist/src/locked-data.js
CHANGED
|
@@ -8,9 +8,8 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const guards_1 = require("./guards");
|
|
10
10
|
const step_validator_1 = require("./step-validator");
|
|
11
|
-
const file_stream_adapter_1 = require("./streams/adapters/file-stream-adapter");
|
|
12
|
-
const memory_stream_adapter_1 = require("./streams/adapters/memory-stream-adapter");
|
|
13
11
|
const generate_types_1 = require("./types/generate-types");
|
|
12
|
+
const trace_stream_adapter_1 = require("./observability/trace-stream-adapter");
|
|
14
13
|
class LockedData {
|
|
15
14
|
constructor(baseDir, streamAdapter = 'file', printer) {
|
|
16
15
|
this.baseDir = baseDir;
|
|
@@ -265,10 +264,7 @@ class LockedData {
|
|
|
265
264
|
return validationResult.success;
|
|
266
265
|
}
|
|
267
266
|
createStreamAdapter(streamName) {
|
|
268
|
-
|
|
269
|
-
return new file_stream_adapter_1.FileStreamAdapter(this.baseDir, streamName);
|
|
270
|
-
}
|
|
271
|
-
return new memory_stream_adapter_1.MemoryStreamAdapter();
|
|
267
|
+
return new trace_stream_adapter_1.TraceStreamAdapter(this.baseDir, streamName, this.streamAdapter);
|
|
272
268
|
}
|
|
273
269
|
}
|
|
274
270
|
exports.LockedData = LockedData;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@motiadev/core",
|
|
3
3
|
"description": "Core functionality for the Motia framework, providing the foundation for building event-driven workflows.",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
|
-
"version": "0.4.
|
|
5
|
+
"version": "0.4.1-beta.92",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@amplitude/analytics-node": "^1.3.8",
|
|
8
8
|
"body-parser": "^1.20.3",
|