@mastra/deployer 0.2.1 → 0.2.2-alpha.0
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/_tsup-dts-rollup.d.cts +5 -0
- package/dist/_tsup-dts-rollup.d.ts +5 -0
- package/dist/build/analyze.cjs +2 -2
- package/dist/build/analyze.js +1 -1
- package/dist/build/bundler.cjs +3 -3
- package/dist/build/bundler.js +1 -1
- package/dist/build/index.cjs +11 -11
- package/dist/build/index.js +3 -3
- package/dist/bundler/index.cjs +2 -2
- package/dist/bundler/index.js +1 -1
- package/dist/{chunk-JSFQUYK4.cjs → chunk-54KOF3NB.cjs} +43 -5
- package/dist/{chunk-PMHXFDK2.cjs → chunk-FVHOV5SC.cjs} +7 -7
- package/dist/{chunk-HRR4D2GM.js → chunk-IGPSPQAD.js} +2 -2
- package/dist/{chunk-GLTC4BEQ.cjs → chunk-KNO7RCEZ.cjs} +3 -2
- package/dist/{chunk-3H66SAKS.cjs → chunk-OT6UKL2S.cjs} +3 -2
- package/dist/{chunk-JNF4CXZJ.js → chunk-T23IXDLE.js} +2 -1
- package/dist/{chunk-DZ4D3KXZ.js → chunk-UKRVXD63.js} +3 -3
- package/dist/{chunk-JNNKML56.js → chunk-WVBUOQT6.js} +39 -6
- package/dist/{chunk-XO6KJHXC.js → chunk-XEFBJH3T.js} +2 -1
- package/dist/{chunk-HLGZCQQW.cjs → chunk-XZSN3YN6.cjs} +7 -7
- package/dist/index.cjs +5 -5
- package/dist/index.js +3 -3
- package/dist/server/index.cjs +100 -78
- package/dist/server/index.js +100 -78
- package/package.json +2 -1
|
@@ -18,6 +18,7 @@ import { MastraVector } from '@mastra/core/vector';
|
|
|
18
18
|
import { OutputOptions } from 'rollup';
|
|
19
19
|
import { Plugin } from 'rollup';
|
|
20
20
|
import { PluginContext } from 'rollup';
|
|
21
|
+
import type { RegisterOptions } from 'typescript-paths';
|
|
21
22
|
import { RenderedChunk } from 'rollup';
|
|
22
23
|
import type { ResolveHookContext } from 'node:module';
|
|
23
24
|
import { RollupBuild } from 'rollup';
|
|
@@ -350,6 +351,8 @@ export declare function pino(): {
|
|
|
350
351
|
} | undefined;
|
|
351
352
|
};
|
|
352
353
|
|
|
354
|
+
export declare type PluginOptions = Omit<RegisterOptions, 'loggerID'>;
|
|
355
|
+
|
|
353
356
|
export declare function queryVectors(c: Context): Promise<Response>;
|
|
354
357
|
|
|
355
358
|
export declare function removeAllExceptDeployer(): babel_2.PluginObj;
|
|
@@ -389,6 +392,8 @@ export declare function startWorkflowRunHandler(c: Context): Promise<Response>;
|
|
|
389
392
|
|
|
390
393
|
export declare function streamGenerateHandler(c: Context): Promise<Response | undefined>;
|
|
391
394
|
|
|
395
|
+
export declare function tsConfigPaths({ tsConfigPath, respectCoreModule }?: PluginOptions): Plugin;
|
|
396
|
+
|
|
392
397
|
export declare function updateThreadHandler(c: Context): Promise<Response>;
|
|
393
398
|
|
|
394
399
|
export declare function upsertMastraDir({ dir }: {
|
|
@@ -18,6 +18,7 @@ import { MastraVector } from '@mastra/core/vector';
|
|
|
18
18
|
import { OutputOptions } from 'rollup';
|
|
19
19
|
import { Plugin } from 'rollup';
|
|
20
20
|
import { PluginContext } from 'rollup';
|
|
21
|
+
import type { RegisterOptions } from 'typescript-paths';
|
|
21
22
|
import { RenderedChunk } from 'rollup';
|
|
22
23
|
import type { ResolveHookContext } from 'node:module';
|
|
23
24
|
import { RollupBuild } from 'rollup';
|
|
@@ -350,6 +351,8 @@ export declare function pino(): {
|
|
|
350
351
|
} | undefined;
|
|
351
352
|
};
|
|
352
353
|
|
|
354
|
+
export declare type PluginOptions = Omit<RegisterOptions, 'loggerID'>;
|
|
355
|
+
|
|
353
356
|
export declare function queryVectors(c: Context): Promise<Response>;
|
|
354
357
|
|
|
355
358
|
export declare function removeAllExceptDeployer(): babel_2.PluginObj;
|
|
@@ -389,6 +392,8 @@ export declare function startWorkflowRunHandler(c: Context): Promise<Response>;
|
|
|
389
392
|
|
|
390
393
|
export declare function streamGenerateHandler(c: Context): Promise<Response | undefined>;
|
|
391
394
|
|
|
395
|
+
export declare function tsConfigPaths({ tsConfigPath, respectCoreModule }?: PluginOptions): Plugin;
|
|
396
|
+
|
|
392
397
|
export declare function updateThreadHandler(c: Context): Promise<Response>;
|
|
393
398
|
|
|
394
399
|
export declare function upsertMastraDir({ dir }: {
|
package/dist/build/analyze.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkKNO7RCEZ_cjs = require('../chunk-KNO7RCEZ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "analyzeBundle", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkKNO7RCEZ_cjs.analyzeBundle; }
|
|
10
10
|
});
|
package/dist/build/analyze.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { analyzeBundle } from '../chunk-
|
|
1
|
+
export { analyzeBundle } from '../chunk-T23IXDLE.js';
|
package/dist/build/bundler.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkOT6UKL2S_cjs = require('../chunk-OT6UKL2S.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "createBundler", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkOT6UKL2S_cjs.createBundler; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "getInputOptions", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkOT6UKL2S_cjs.getInputOptions; }
|
|
14
14
|
});
|
package/dist/build/bundler.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { createBundler, getInputOptions } from '../chunk-
|
|
1
|
+
export { createBundler, getInputOptions } from '../chunk-XEFBJH3T.js';
|
package/dist/build/index.cjs
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkFVHOV5SC_cjs = require('../chunk-FVHOV5SC.cjs');
|
|
4
4
|
var chunkPRZC7CEM_cjs = require('../chunk-PRZC7CEM.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var chunkKNO7RCEZ_cjs = require('../chunk-KNO7RCEZ.cjs');
|
|
6
|
+
var chunkOT6UKL2S_cjs = require('../chunk-OT6UKL2S.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "FileService", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkFVHOV5SC_cjs.FileService; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "createWatcher", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkFVHOV5SC_cjs.createWatcher; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "getBundler", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkFVHOV5SC_cjs.getBundler; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "getWatcher", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkFVHOV5SC_cjs.getWatcher; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "getWatcherInputOptions", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkFVHOV5SC_cjs.getInputOptions; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "Deps", {
|
|
31
31
|
enumerable: true,
|
|
@@ -37,13 +37,13 @@ Object.defineProperty(exports, "writeTelemetryConfig", {
|
|
|
37
37
|
});
|
|
38
38
|
Object.defineProperty(exports, "analyzeBundle", {
|
|
39
39
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunkKNO7RCEZ_cjs.analyzeBundle; }
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "createBundler", {
|
|
43
43
|
enumerable: true,
|
|
44
|
-
get: function () { return
|
|
44
|
+
get: function () { return chunkOT6UKL2S_cjs.createBundler; }
|
|
45
45
|
});
|
|
46
46
|
Object.defineProperty(exports, "getBundlerInputOptions", {
|
|
47
47
|
enumerable: true,
|
|
48
|
-
get: function () { return
|
|
48
|
+
get: function () { return chunkOT6UKL2S_cjs.getInputOptions; }
|
|
49
49
|
});
|
package/dist/build/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { FileService, createWatcher, getBundler, getWatcher, getInputOptions as getWatcherInputOptions } from '../chunk-
|
|
1
|
+
export { FileService, createWatcher, getBundler, getWatcher, getInputOptions as getWatcherInputOptions } from '../chunk-UKRVXD63.js';
|
|
2
2
|
export { Deps, writeTelemetryConfig } from '../chunk-7XQJJPRM.js';
|
|
3
|
-
export { analyzeBundle } from '../chunk-
|
|
4
|
-
export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-
|
|
3
|
+
export { analyzeBundle } from '../chunk-T23IXDLE.js';
|
|
4
|
+
export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-XEFBJH3T.js';
|
package/dist/bundler/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXZSN3YN6_cjs = require('../chunk-XZSN3YN6.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "Bundler", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkXZSN3YN6_cjs.Bundler; }
|
|
10
10
|
});
|
package/dist/bundler/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Bundler } from '../chunk-
|
|
1
|
+
export { Bundler } from '../chunk-IGPSPQAD.js';
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var babel = require('@babel/core');
|
|
4
|
+
var fs = require('fs');
|
|
5
|
+
var path = require('path');
|
|
6
|
+
var typescriptPaths = require('typescript-paths');
|
|
7
|
+
|
|
8
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
4
9
|
|
|
5
10
|
function _interopNamespace(e) {
|
|
6
11
|
if (e && e.__esModule) return e;
|
|
@@ -21,6 +26,8 @@ function _interopNamespace(e) {
|
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
var babel__namespace = /*#__PURE__*/_interopNamespace(babel);
|
|
29
|
+
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
30
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
24
31
|
|
|
25
32
|
// src/build/plugins/remove-deployer.ts
|
|
26
33
|
function removeDeployer() {
|
|
@@ -28,18 +35,18 @@ function removeDeployer() {
|
|
|
28
35
|
return {
|
|
29
36
|
name: "remove-deployer",
|
|
30
37
|
visitor: {
|
|
31
|
-
NewExpression(
|
|
32
|
-
const varDeclaratorPath =
|
|
38
|
+
NewExpression(path2, state) {
|
|
39
|
+
const varDeclaratorPath = path2.findParent((path3) => t.isVariableDeclarator(path3.node));
|
|
33
40
|
if (!varDeclaratorPath) {
|
|
34
41
|
return;
|
|
35
42
|
}
|
|
36
|
-
const parentNode =
|
|
43
|
+
const parentNode = path2.parentPath.node;
|
|
37
44
|
if (!t.isVariableDeclarator(parentNode) || !t.isIdentifier(parentNode.id) || parentNode.id.name !== "mastra") {
|
|
38
45
|
return;
|
|
39
46
|
}
|
|
40
47
|
if (!state.hasReplaced) {
|
|
41
48
|
state.hasReplaced = true;
|
|
42
|
-
const newMastraObj = t.cloneNode(
|
|
49
|
+
const newMastraObj = t.cloneNode(path2.node);
|
|
43
50
|
if (t.isObjectExpression(newMastraObj.arguments[0]) && newMastraObj.arguments[0].properties?.[0]) {
|
|
44
51
|
const deployer = newMastraObj.arguments[0].properties.find(
|
|
45
52
|
(prop) => t.isObjectProperty(prop) && t.isIdentifier(prop.key) && prop.key.name === "deployer"
|
|
@@ -56,7 +63,7 @@ function removeDeployer() {
|
|
|
56
63
|
deployerBinding?.path?.parentPath?.remove();
|
|
57
64
|
}
|
|
58
65
|
}
|
|
59
|
-
|
|
66
|
+
path2.replaceWith(newMastraObj);
|
|
60
67
|
}
|
|
61
68
|
}
|
|
62
69
|
}
|
|
@@ -95,5 +102,36 @@ function removeDeployer2(mastraEntry) {
|
|
|
95
102
|
}
|
|
96
103
|
};
|
|
97
104
|
}
|
|
105
|
+
var PLUGIN_NAME = "tsconfig-paths";
|
|
106
|
+
function tsConfigPaths({ tsConfigPath, respectCoreModule } = {}) {
|
|
107
|
+
let handler;
|
|
108
|
+
return {
|
|
109
|
+
name: PLUGIN_NAME,
|
|
110
|
+
buildStart() {
|
|
111
|
+
handler = typescriptPaths.createHandler({
|
|
112
|
+
log: () => {
|
|
113
|
+
},
|
|
114
|
+
tsConfigPath,
|
|
115
|
+
respectCoreModule,
|
|
116
|
+
falllback: (moduleName) => fs__default.default.existsSync(moduleName)
|
|
117
|
+
});
|
|
118
|
+
return;
|
|
119
|
+
},
|
|
120
|
+
async resolveId(request, importer, options) {
|
|
121
|
+
if (!importer || request.startsWith("\0")) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
const moduleName = handler?.(request, path.normalize(importer));
|
|
125
|
+
if (!moduleName) {
|
|
126
|
+
return this.resolve(request, importer, { skipSelf: true, ...options });
|
|
127
|
+
}
|
|
128
|
+
if (!path__default.default.extname(moduleName)) {
|
|
129
|
+
return this.resolve(moduleName, importer, { skipSelf: true, ...options });
|
|
130
|
+
}
|
|
131
|
+
return moduleName;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
98
135
|
|
|
99
136
|
exports.removeDeployer = removeDeployer2;
|
|
137
|
+
exports.tsConfigPaths = tsConfigPaths;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkKNO7RCEZ_cjs = require('./chunk-KNO7RCEZ.cjs');
|
|
4
|
+
var chunkOT6UKL2S_cjs = require('./chunk-OT6UKL2S.cjs');
|
|
5
|
+
var chunk54KOF3NB_cjs = require('./chunk-54KOF3NB.cjs');
|
|
6
6
|
var alias = require('@rollup/plugin-alias');
|
|
7
7
|
var commonjs = require('@rollup/plugin-commonjs');
|
|
8
8
|
var json = require('@rollup/plugin-json');
|
|
@@ -116,7 +116,7 @@ var FileService = class {
|
|
|
116
116
|
* @returns
|
|
117
117
|
*/
|
|
118
118
|
async copyStarterFile(inputFile, outputFilePath, replaceIfExists) {
|
|
119
|
-
const __filename = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
119
|
+
const __filename = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-FVHOV5SC.cjs', document.baseURI).href)));
|
|
120
120
|
const __dirname = path__default.default.dirname(__filename);
|
|
121
121
|
const filePath = path__default.default.resolve(__dirname, "..", "starter-files", inputFile);
|
|
122
122
|
const fileString = fs2__namespace.default.readFileSync(filePath, "utf8");
|
|
@@ -227,7 +227,7 @@ function getOptions(inputOptions, platform, root) {
|
|
|
227
227
|
"process.env.NODE_ENV": JSON.stringify("production")
|
|
228
228
|
}
|
|
229
229
|
}),
|
|
230
|
-
|
|
230
|
+
chunk54KOF3NB_cjs.removeDeployer(entry),
|
|
231
231
|
esbuild__default.default({
|
|
232
232
|
include: entry,
|
|
233
233
|
target: "node20",
|
|
@@ -248,7 +248,7 @@ async function getWatcher(inputOptions, args = {}) {
|
|
|
248
248
|
return watcher;
|
|
249
249
|
}
|
|
250
250
|
async function getInputOptions2(entryFile, platform) {
|
|
251
|
-
const inputOptions = await
|
|
251
|
+
const inputOptions = await chunkOT6UKL2S_cjs.getInputOptions(
|
|
252
252
|
entryFile,
|
|
253
253
|
{
|
|
254
254
|
dependencies: /* @__PURE__ */ new Map(),
|
|
@@ -262,7 +262,7 @@ async function getInputOptions2(entryFile, platform) {
|
|
|
262
262
|
// @ts-ignore
|
|
263
263
|
(plugin) => !plugin || !plugin?.name || plugin.name !== "node-resolve"
|
|
264
264
|
);
|
|
265
|
-
inputOptions.plugins.push(
|
|
265
|
+
inputOptions.plugins.push(chunkKNO7RCEZ_cjs.aliasHono());
|
|
266
266
|
}
|
|
267
267
|
return inputOptions;
|
|
268
268
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Deps, writeTelemetryConfig } from './chunk-7XQJJPRM.js';
|
|
2
|
-
import { analyzeBundle } from './chunk-
|
|
3
|
-
import { createBundler, getInputOptions } from './chunk-
|
|
2
|
+
import { analyzeBundle } from './chunk-T23IXDLE.js';
|
|
3
|
+
import { createBundler, getInputOptions } from './chunk-XEFBJH3T.js';
|
|
4
4
|
import { existsSync } from 'node:fs';
|
|
5
5
|
import { writeFile, stat } from 'node:fs/promises';
|
|
6
6
|
import { join, dirname } from 'node:path';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk54KOF3NB_cjs = require('./chunk-54KOF3NB.cjs');
|
|
4
4
|
var commonjs = require('@rollup/plugin-commonjs');
|
|
5
5
|
var json = require('@rollup/plugin-json');
|
|
6
6
|
var nodeResolve = require('@rollup/plugin-node-resolve');
|
|
@@ -88,6 +88,7 @@ async function analyze(entry, mastraEntry, isVirtualFile, platform, logger) {
|
|
|
88
88
|
preserveSymlinks: true,
|
|
89
89
|
plugins: [
|
|
90
90
|
virtualPlugin,
|
|
91
|
+
chunk54KOF3NB_cjs.tsConfigPaths(),
|
|
91
92
|
{
|
|
92
93
|
name: "custom-alias-resolver",
|
|
93
94
|
resolveId(id) {
|
|
@@ -111,7 +112,7 @@ async function analyze(entry, mastraEntry, isVirtualFile, platform, logger) {
|
|
|
111
112
|
transformMixedEsModules: true,
|
|
112
113
|
extensions: [".js", ".ts"]
|
|
113
114
|
}),
|
|
114
|
-
|
|
115
|
+
chunk54KOF3NB_cjs.removeDeployer(normalizedMastraEntry),
|
|
115
116
|
esbuild__default.default({
|
|
116
117
|
target: "node20",
|
|
117
118
|
platform,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk54KOF3NB_cjs = require('./chunk-54KOF3NB.cjs');
|
|
4
4
|
var alias = require('@rollup/plugin-alias');
|
|
5
5
|
var commonjs = require('@rollup/plugin-commonjs');
|
|
6
6
|
var json = require('@rollup/plugin-json');
|
|
@@ -47,6 +47,7 @@ async function getInputOptions(entryFile, analyzedBundleInfo, platform) {
|
|
|
47
47
|
preserveSymlinks: true,
|
|
48
48
|
external: externals,
|
|
49
49
|
plugins: [
|
|
50
|
+
chunk54KOF3NB_cjs.tsConfigPaths(),
|
|
50
51
|
{
|
|
51
52
|
name: "alias-optimized-deps",
|
|
52
53
|
// @ts-ignore
|
|
@@ -107,7 +108,7 @@ async function getInputOptions(entryFile, analyzedBundleInfo, platform) {
|
|
|
107
108
|
// },
|
|
108
109
|
// },
|
|
109
110
|
json__default.default(),
|
|
110
|
-
|
|
111
|
+
chunk54KOF3NB_cjs.removeDeployer(entryFile),
|
|
111
112
|
// treeshake unused imports
|
|
112
113
|
esbuild__default.default({
|
|
113
114
|
include: entryFile,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { removeDeployer } from './chunk-
|
|
1
|
+
import { tsConfigPaths, removeDeployer } from './chunk-WVBUOQT6.js';
|
|
2
2
|
import commonjs from '@rollup/plugin-commonjs';
|
|
3
3
|
import json from '@rollup/plugin-json';
|
|
4
4
|
import nodeResolve from '@rollup/plugin-node-resolve';
|
|
@@ -78,6 +78,7 @@ async function analyze(entry, mastraEntry, isVirtualFile, platform, logger) {
|
|
|
78
78
|
preserveSymlinks: true,
|
|
79
79
|
plugins: [
|
|
80
80
|
virtualPlugin,
|
|
81
|
+
tsConfigPaths(),
|
|
81
82
|
{
|
|
82
83
|
name: "custom-alias-resolver",
|
|
83
84
|
resolveId(id) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { aliasHono } from './chunk-
|
|
2
|
-
import { getInputOptions } from './chunk-
|
|
3
|
-
import { removeDeployer } from './chunk-
|
|
1
|
+
import { aliasHono } from './chunk-T23IXDLE.js';
|
|
2
|
+
import { getInputOptions } from './chunk-XEFBJH3T.js';
|
|
3
|
+
import { removeDeployer } from './chunk-WVBUOQT6.js';
|
|
4
4
|
import alias from '@rollup/plugin-alias';
|
|
5
5
|
import commonjs from '@rollup/plugin-commonjs';
|
|
6
6
|
import json from '@rollup/plugin-json';
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import * as babel from '@babel/core';
|
|
2
2
|
import babel__default from '@babel/core';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import path, { normalize } from 'node:path';
|
|
5
|
+
import { createHandler } from 'typescript-paths';
|
|
3
6
|
|
|
4
7
|
// src/build/plugins/remove-deployer.ts
|
|
5
8
|
function removeDeployer() {
|
|
@@ -7,18 +10,18 @@ function removeDeployer() {
|
|
|
7
10
|
return {
|
|
8
11
|
name: "remove-deployer",
|
|
9
12
|
visitor: {
|
|
10
|
-
NewExpression(
|
|
11
|
-
const varDeclaratorPath =
|
|
13
|
+
NewExpression(path2, state) {
|
|
14
|
+
const varDeclaratorPath = path2.findParent((path3) => t.isVariableDeclarator(path3.node));
|
|
12
15
|
if (!varDeclaratorPath) {
|
|
13
16
|
return;
|
|
14
17
|
}
|
|
15
|
-
const parentNode =
|
|
18
|
+
const parentNode = path2.parentPath.node;
|
|
16
19
|
if (!t.isVariableDeclarator(parentNode) || !t.isIdentifier(parentNode.id) || parentNode.id.name !== "mastra") {
|
|
17
20
|
return;
|
|
18
21
|
}
|
|
19
22
|
if (!state.hasReplaced) {
|
|
20
23
|
state.hasReplaced = true;
|
|
21
|
-
const newMastraObj = t.cloneNode(
|
|
24
|
+
const newMastraObj = t.cloneNode(path2.node);
|
|
22
25
|
if (t.isObjectExpression(newMastraObj.arguments[0]) && newMastraObj.arguments[0].properties?.[0]) {
|
|
23
26
|
const deployer = newMastraObj.arguments[0].properties.find(
|
|
24
27
|
(prop) => t.isObjectProperty(prop) && t.isIdentifier(prop.key) && prop.key.name === "deployer"
|
|
@@ -35,7 +38,7 @@ function removeDeployer() {
|
|
|
35
38
|
deployerBinding?.path?.parentPath?.remove();
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
|
-
|
|
41
|
+
path2.replaceWith(newMastraObj);
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
}
|
|
@@ -74,5 +77,35 @@ function removeDeployer2(mastraEntry) {
|
|
|
74
77
|
}
|
|
75
78
|
};
|
|
76
79
|
}
|
|
80
|
+
var PLUGIN_NAME = "tsconfig-paths";
|
|
81
|
+
function tsConfigPaths({ tsConfigPath, respectCoreModule } = {}) {
|
|
82
|
+
let handler;
|
|
83
|
+
return {
|
|
84
|
+
name: PLUGIN_NAME,
|
|
85
|
+
buildStart() {
|
|
86
|
+
handler = createHandler({
|
|
87
|
+
log: () => {
|
|
88
|
+
},
|
|
89
|
+
tsConfigPath,
|
|
90
|
+
respectCoreModule,
|
|
91
|
+
falllback: (moduleName) => fs.existsSync(moduleName)
|
|
92
|
+
});
|
|
93
|
+
return;
|
|
94
|
+
},
|
|
95
|
+
async resolveId(request, importer, options) {
|
|
96
|
+
if (!importer || request.startsWith("\0")) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
const moduleName = handler?.(request, normalize(importer));
|
|
100
|
+
if (!moduleName) {
|
|
101
|
+
return this.resolve(request, importer, { skipSelf: true, ...options });
|
|
102
|
+
}
|
|
103
|
+
if (!path.extname(moduleName)) {
|
|
104
|
+
return this.resolve(moduleName, importer, { skipSelf: true, ...options });
|
|
105
|
+
}
|
|
106
|
+
return moduleName;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
77
110
|
|
|
78
|
-
export { removeDeployer2 as removeDeployer };
|
|
111
|
+
export { removeDeployer2 as removeDeployer, tsConfigPaths };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { removeDeployer } from './chunk-
|
|
1
|
+
import { tsConfigPaths, removeDeployer } from './chunk-WVBUOQT6.js';
|
|
2
2
|
import alias from '@rollup/plugin-alias';
|
|
3
3
|
import commonjs from '@rollup/plugin-commonjs';
|
|
4
4
|
import json from '@rollup/plugin-json';
|
|
@@ -37,6 +37,7 @@ async function getInputOptions(entryFile, analyzedBundleInfo, platform) {
|
|
|
37
37
|
preserveSymlinks: true,
|
|
38
38
|
external: externals,
|
|
39
39
|
plugins: [
|
|
40
|
+
tsConfigPaths(),
|
|
40
41
|
{
|
|
41
42
|
name: "alias-optimized-deps",
|
|
42
43
|
// @ts-ignore
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkPRZC7CEM_cjs = require('./chunk-PRZC7CEM.cjs');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkKNO7RCEZ_cjs = require('./chunk-KNO7RCEZ.cjs');
|
|
5
|
+
var chunkOT6UKL2S_cjs = require('./chunk-OT6UKL2S.cjs');
|
|
6
6
|
var fs = require('fs');
|
|
7
7
|
var promises = require('fs/promises');
|
|
8
8
|
var path = require('path');
|
|
@@ -31,7 +31,7 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
31
31
|
}
|
|
32
32
|
async writeInstrumentationFile(outputDirectory) {
|
|
33
33
|
const instrumentationFile = path.join(outputDirectory, "instrumentation.mjs");
|
|
34
|
-
const __dirname = path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
34
|
+
const __dirname = path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-XZSN3YN6.cjs', document.baseURI).href))));
|
|
35
35
|
await esm.copy(path.join(__dirname, "templates", "instrumentation-template.js"), instrumentationFile);
|
|
36
36
|
}
|
|
37
37
|
async writePackageJson(outputDirectory, dependencies) {
|
|
@@ -70,10 +70,10 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
createBundler(inputOptions, outputOptions) {
|
|
73
|
-
return
|
|
73
|
+
return chunkOT6UKL2S_cjs.createBundler(inputOptions, outputOptions);
|
|
74
74
|
}
|
|
75
75
|
async analyze(entry, mastraFile, outputDirectory) {
|
|
76
|
-
return await
|
|
76
|
+
return await chunkKNO7RCEZ_cjs.analyzeBundle(entry, mastraFile, path.join(outputDirectory, this.analyzeOutputDir), "node", this.logger);
|
|
77
77
|
}
|
|
78
78
|
async installDependencies(outputDirectory, rootDir = process.cwd()) {
|
|
79
79
|
const deps = new chunkPRZC7CEM_cjs.Deps(rootDir);
|
|
@@ -92,7 +92,7 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
92
92
|
async _bundle(serverFile, mastraEntryFile, outputDirectory, bundleLocation = path.join(outputDirectory, this.outputDir)) {
|
|
93
93
|
this.logger.info("Start bundling Mastra");
|
|
94
94
|
const isVirtual = serverFile.includes("\n") || fs.existsSync(serverFile);
|
|
95
|
-
const analyzedBundleInfo = await
|
|
95
|
+
const analyzedBundleInfo = await chunkKNO7RCEZ_cjs.analyzeBundle(
|
|
96
96
|
serverFile,
|
|
97
97
|
mastraEntryFile,
|
|
98
98
|
path.join(outputDirectory, this.analyzeOutputDir),
|
|
@@ -113,7 +113,7 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
113
113
|
await this.writePackageJson(path.join(outputDirectory, this.outputDir), dependenciesToInstall);
|
|
114
114
|
await this.writeInstrumentationFile(path.join(outputDirectory, this.outputDir));
|
|
115
115
|
this.logger.info("Bundling Mastra application");
|
|
116
|
-
const inputOptions = await
|
|
116
|
+
const inputOptions = await chunkOT6UKL2S_cjs.getInputOptions(mastraEntryFile, analyzedBundleInfo, "node");
|
|
117
117
|
if (isVirtual) {
|
|
118
118
|
inputOptions.input = { index: "#entry" };
|
|
119
119
|
if (Array.isArray(inputOptions.plugins)) {
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkFVHOV5SC_cjs = require('./chunk-FVHOV5SC.cjs');
|
|
4
|
+
var chunkXZSN3YN6_cjs = require('./chunk-XZSN3YN6.cjs');
|
|
5
5
|
var chunkPRZC7CEM_cjs = require('./chunk-PRZC7CEM.cjs');
|
|
6
6
|
var babel = require('@babel/core');
|
|
7
7
|
var rollup = require('rollup');
|
|
@@ -33,7 +33,7 @@ var esbuild__default = /*#__PURE__*/_interopDefault(esbuild);
|
|
|
33
33
|
var commonjs__default = /*#__PURE__*/_interopDefault(commonjs);
|
|
34
34
|
|
|
35
35
|
// src/deploy/base.ts
|
|
36
|
-
var Deployer = class extends
|
|
36
|
+
var Deployer = class extends chunkXZSN3YN6_cjs.Bundler {
|
|
37
37
|
deps = new chunkPRZC7CEM_cjs.Deps();
|
|
38
38
|
constructor(args) {
|
|
39
39
|
super(args.name, "DEPLOYER");
|
|
@@ -42,7 +42,7 @@ var Deployer = class extends chunkHLGZCQQW_cjs.Bundler {
|
|
|
42
42
|
getEnvFiles() {
|
|
43
43
|
const possibleFiles = [".env.production", ".env.local", ".env"];
|
|
44
44
|
try {
|
|
45
|
-
const fileService = new
|
|
45
|
+
const fileService = new chunkFVHOV5SC_cjs.FileService();
|
|
46
46
|
const envFile = fileService.getFirstExistingFile(possibleFiles);
|
|
47
47
|
return Promise.resolve([envFile]);
|
|
48
48
|
} catch {
|
|
@@ -156,7 +156,7 @@ async function getDeployer(entryFile, outputDir) {
|
|
|
156
156
|
|
|
157
157
|
Object.defineProperty(exports, "FileService", {
|
|
158
158
|
enumerable: true,
|
|
159
|
-
get: function () { return
|
|
159
|
+
get: function () { return chunkFVHOV5SC_cjs.FileService; }
|
|
160
160
|
});
|
|
161
161
|
Object.defineProperty(exports, "Deps", {
|
|
162
162
|
enumerable: true,
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FileService } from './chunk-
|
|
2
|
-
export { FileService } from './chunk-
|
|
3
|
-
import { Bundler } from './chunk-
|
|
1
|
+
import { FileService } from './chunk-UKRVXD63.js';
|
|
2
|
+
export { FileService } from './chunk-UKRVXD63.js';
|
|
3
|
+
import { Bundler } from './chunk-IGPSPQAD.js';
|
|
4
4
|
import { Deps } from './chunk-7XQJJPRM.js';
|
|
5
5
|
export { Deps, createChildProcessLogger, createPinoStream } from './chunk-7XQJJPRM.js';
|
|
6
6
|
import * as babel from '@babel/core';
|