@mastra/deployer 1.48.0-alpha.6 → 1.48.0-alpha.7
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/CHANGELOG.md +28 -0
- package/dist/build/fs-routing/codegen.d.ts +21 -0
- package/dist/build/fs-routing/codegen.d.ts.map +1 -0
- package/dist/build/fs-routing/discover.d.ts +68 -0
- package/dist/build/fs-routing/discover.d.ts.map +1 -0
- package/dist/build/fs-routing/mirror.d.ts +16 -0
- package/dist/build/fs-routing/mirror.d.ts.map +1 -0
- package/dist/build/fs-routing/prepare.d.ts +44 -0
- package/dist/build/fs-routing/prepare.d.ts.map +1 -0
- package/dist/build/index.cjs +24 -4
- package/dist/build/index.d.ts +6 -0
- package/dist/build/index.d.ts.map +1 -1
- package/dist/build/index.js +1 -1
- package/dist/chunk-YLUHJBYA.js +486 -0
- package/dist/chunk-YLUHJBYA.js.map +1 -0
- package/dist/chunk-ZZHJNINJ.cjs +518 -0
- package/dist/chunk-ZZHJNINJ.cjs.map +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/package.json +6 -5
- package/dist/chunk-EVWJBGLA.js +0 -98
- package/dist/chunk-EVWJBGLA.js.map +0 -1
- package/dist/chunk-Y476PH5A.cjs +0 -122
- package/dist/chunk-Y476PH5A.cjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/deployer",
|
|
3
|
-
"version": "1.48.0-alpha.
|
|
3
|
+
"version": "1.48.0-alpha.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -103,6 +103,7 @@
|
|
|
103
103
|
"esbuild": "^0.28.0",
|
|
104
104
|
"find-workspaces": "^0.3.1",
|
|
105
105
|
"fs-extra": "^11.3.5",
|
|
106
|
+
"gray-matter": "^4.0.3",
|
|
106
107
|
"hono": "^4.12.8",
|
|
107
108
|
"local-pkg": "^1.1.2",
|
|
108
109
|
"resolve.exports": "^2.0.3",
|
|
@@ -112,7 +113,7 @@
|
|
|
112
113
|
"tinyglobby": "^0.2.17",
|
|
113
114
|
"typescript-paths": "^1.5.2",
|
|
114
115
|
"ws": "^8.20.0",
|
|
115
|
-
"@mastra/server": "1.48.0-alpha.
|
|
116
|
+
"@mastra/server": "1.48.0-alpha.7"
|
|
116
117
|
},
|
|
117
118
|
"devDependencies": {
|
|
118
119
|
"@hono/node-server": "^1.19.11",
|
|
@@ -136,10 +137,10 @@
|
|
|
136
137
|
"@internal/lint": "0.0.109",
|
|
137
138
|
"@internal/types-builder": "0.0.84",
|
|
138
139
|
"@mastra/agent-browser": "0.4.0",
|
|
139
|
-
"@mastra/core": "1.48.0-alpha.
|
|
140
|
-
"@mastra/hono": "1.5.3-alpha.
|
|
140
|
+
"@mastra/core": "1.48.0-alpha.7",
|
|
141
|
+
"@mastra/hono": "1.5.3-alpha.7",
|
|
141
142
|
"@mastra/mcp": "^1.12.1-alpha.0",
|
|
142
|
-
"@mastra/server": "1.48.0-alpha.
|
|
143
|
+
"@mastra/server": "1.48.0-alpha.7"
|
|
143
144
|
},
|
|
144
145
|
"peerDependencies": {
|
|
145
146
|
"@mastra/core": ">=1.47.0-0 <2.0.0-0"
|
package/dist/chunk-EVWJBGLA.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { extractMastraOption } from './chunk-MPEFRVWJ.js';
|
|
2
|
-
import { getWorkspaceInformation, analyzeBundle, aliasHono } from './chunk-FQC6UUHS.js';
|
|
3
|
-
import { getInputOptions, nodeModulesExtensionResolver } from './chunk-2WEUOK6I.js';
|
|
4
|
-
import { tsConfigPaths } from './chunk-ORSNDVAB.js';
|
|
5
|
-
import { slash, getPackageName } from './chunk-V6F2NMS2.js';
|
|
6
|
-
import { dirname, posix } from 'path';
|
|
7
|
-
import { noopLogger } from '@mastra/core/logger';
|
|
8
|
-
import * as pkg from 'empathic/package';
|
|
9
|
-
import { watch } from 'rollup';
|
|
10
|
-
|
|
11
|
-
async function getInputOptions2(entryFile, platform, env, {
|
|
12
|
-
sourcemap = false,
|
|
13
|
-
bundlerOptions = {
|
|
14
|
-
enableSourcemap: false,
|
|
15
|
-
enableEsmShim: true,
|
|
16
|
-
externals: true
|
|
17
|
-
}
|
|
18
|
-
} = {}) {
|
|
19
|
-
const closestPkgJson = pkg.up({ cwd: dirname(entryFile) });
|
|
20
|
-
const projectRoot = closestPkgJson ? dirname(slash(closestPkgJson)) : slash(process.cwd());
|
|
21
|
-
const { workspaceMap, workspaceRoot } = await getWorkspaceInformation({ mastraEntryFile: entryFile });
|
|
22
|
-
const analyzeEntryResult = await analyzeBundle(
|
|
23
|
-
[entryFile],
|
|
24
|
-
entryFile,
|
|
25
|
-
{
|
|
26
|
-
outputDir: posix.join(process.cwd(), ".mastra", ".build"),
|
|
27
|
-
projectRoot: workspaceRoot || process.cwd(),
|
|
28
|
-
platform,
|
|
29
|
-
isDev: true,
|
|
30
|
-
bundlerOptions
|
|
31
|
-
},
|
|
32
|
-
noopLogger
|
|
33
|
-
);
|
|
34
|
-
const deps = /* @__PURE__ */ new Map();
|
|
35
|
-
for (const [dep, metadata] of analyzeEntryResult.dependencies.entries()) {
|
|
36
|
-
const pkgName = getPackageName(dep);
|
|
37
|
-
if (pkgName && workspaceMap.has(pkgName)) {
|
|
38
|
-
deps.set(dep, metadata);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
const inputOptions = await getInputOptions(
|
|
42
|
-
entryFile,
|
|
43
|
-
{
|
|
44
|
-
dependencies: deps,
|
|
45
|
-
externalDependencies: /* @__PURE__ */ new Map(),
|
|
46
|
-
workspaceMap
|
|
47
|
-
},
|
|
48
|
-
platform,
|
|
49
|
-
env,
|
|
50
|
-
{ sourcemap, isDev: true, workspaceRoot, projectRoot, externalsPreset: bundlerOptions?.externals === true }
|
|
51
|
-
);
|
|
52
|
-
if (Array.isArray(inputOptions.plugins)) {
|
|
53
|
-
const plugins = [];
|
|
54
|
-
inputOptions.plugins.forEach((plugin) => {
|
|
55
|
-
if (plugin?.name === "node-resolve") {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (plugin?.name === "tsconfig-paths") {
|
|
59
|
-
plugins.push(
|
|
60
|
-
tsConfigPaths({
|
|
61
|
-
localResolve: true
|
|
62
|
-
})
|
|
63
|
-
);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
plugins.push(plugin);
|
|
67
|
-
});
|
|
68
|
-
inputOptions.plugins = plugins;
|
|
69
|
-
inputOptions.plugins.push(aliasHono());
|
|
70
|
-
inputOptions.plugins.push(nodeModulesExtensionResolver());
|
|
71
|
-
}
|
|
72
|
-
return inputOptions;
|
|
73
|
-
}
|
|
74
|
-
async function createWatcher(inputOptions, outputOptions) {
|
|
75
|
-
const watcher = await watch({
|
|
76
|
-
...inputOptions,
|
|
77
|
-
output: {
|
|
78
|
-
...outputOptions,
|
|
79
|
-
format: "esm",
|
|
80
|
-
entryFileNames: "[name].mjs",
|
|
81
|
-
chunkFileNames: "[name].mjs"
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
return watcher;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// src/build/serverOptions.ts
|
|
88
|
-
async function getServerOptions(entryFile, outputDir, logger) {
|
|
89
|
-
const result = await extractMastraOption("server", entryFile, outputDir, logger);
|
|
90
|
-
if (!result) {
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
return result.getConfig();
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export { createWatcher, getInputOptions2 as getInputOptions, getServerOptions };
|
|
97
|
-
//# sourceMappingURL=chunk-EVWJBGLA.js.map
|
|
98
|
-
//# sourceMappingURL=chunk-EVWJBGLA.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/build/watcher.ts","../src/build/serverOptions.ts"],"names":["getInputOptions"],"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AA,EAAQ,KAAA;AAAA,MACR,cAAA,EAAgB,YAAA;AAAA,MAChB,cAAA,EAAgB;AAAA;AAClB,GACD,CAAA;AAED,EAAA,OAAO,OAAA;AACT;;;AC9FA,eAAsB,gBAAA,CACpB,SAAA,EACA,SAAA,EACA,MAAA,EACkC;AAClC,EAAA,MAAM,SAAS,MAAM,mBAAA,CAAoB,QAAA,EAAU,SAAA,EAAW,WAAW,MAAM,CAAA;AAC/E,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,OAAO,SAAA,EAAU;AAC1B","file":"chunk-EVWJBGLA.js","sourcesContent":["import { dirname, posix } from 'node:path';\nimport { noopLogger } from '@mastra/core/logger';\nimport * as pkg from 'empathic/package';\nimport type { InputOptions, OutputOptions, Plugin } from 'rollup';\nimport { watch } from 'rollup';\nimport { getWorkspaceInformation } from '../bundler/workspaceDependencies';\nimport { analyzeBundle } from './analyze';\nimport { getInputOptions as getBundlerInputOptions } from './bundler';\nimport { aliasHono } from './plugins/hono-alias';\nimport { nodeModulesExtensionResolver } from './plugins/node-modules-extension-resolver';\nimport { tsConfigPaths } from './plugins/tsconfig-paths';\nimport type { BundlerOptions } from './types';\nimport { getPackageName, slash } from './utils';\nimport type { BundlerPlatform } from './utils';\n\nexport async function getInputOptions(\n entryFile: string,\n platform: BundlerPlatform,\n env?: Record<string, string>,\n {\n sourcemap = false,\n bundlerOptions = {\n enableSourcemap: false,\n enableEsmShim: true,\n externals: true,\n },\n }: { sourcemap?: boolean; bundlerOptions?: BundlerOptions } = {},\n) {\n const closestPkgJson = pkg.up({ cwd: dirname(entryFile) });\n const projectRoot = closestPkgJson ? dirname(slash(closestPkgJson)) : slash(process.cwd());\n const { workspaceMap, workspaceRoot } = await getWorkspaceInformation({ mastraEntryFile: entryFile });\n\n const analyzeEntryResult = await analyzeBundle(\n [entryFile],\n entryFile,\n {\n outputDir: posix.join(process.cwd(), '.mastra', '.build'),\n projectRoot: workspaceRoot || process.cwd(),\n platform,\n isDev: true,\n bundlerOptions,\n },\n noopLogger,\n );\n\n const deps = /* @__PURE__ */ new Map();\n for (const [dep, metadata] of analyzeEntryResult.dependencies.entries()) {\n const pkgName = getPackageName(dep);\n if (pkgName && workspaceMap.has(pkgName)) {\n deps.set(dep, metadata);\n }\n }\n\n const inputOptions = await getBundlerInputOptions(\n entryFile,\n {\n dependencies: deps,\n externalDependencies: new Map(),\n workspaceMap,\n },\n platform,\n env,\n { sourcemap, isDev: true, workspaceRoot, projectRoot, externalsPreset: bundlerOptions?.externals === true },\n );\n\n if (Array.isArray(inputOptions.plugins)) {\n // filter out node-resolve plugin so all node_modules are external\n // and tsconfig-paths plugin as we are injection a custom one\n const plugins = [] as Plugin[];\n inputOptions.plugins.forEach(plugin => {\n if ((plugin as Plugin | undefined)?.name === 'node-resolve') {\n return;\n }\n\n if ((plugin as Plugin | undefined)?.name === 'tsconfig-paths') {\n plugins.push(\n tsConfigPaths({\n localResolve: true,\n }),\n );\n return;\n }\n\n plugins.push(plugin as Plugin);\n });\n\n inputOptions.plugins = plugins;\n inputOptions.plugins.push(aliasHono());\n // fixes imports like lodash/fp/get\n inputOptions.plugins.push(nodeModulesExtensionResolver());\n }\n\n return inputOptions;\n}\n\nexport async function createWatcher(inputOptions: InputOptions, outputOptions: OutputOptions) {\n const watcher = await watch({\n ...inputOptions,\n output: {\n ...outputOptions,\n format: 'esm',\n entryFileNames: '[name].mjs',\n chunkFileNames: '[name].mjs',\n },\n });\n\n return watcher;\n}\n","import type { IMastraLogger } from '@mastra/core/logger';\nimport type { Config } from '@mastra/core/mastra';\nimport { extractMastraOption, extractMastraOptionBundler } from './shared/extract-mastra-option';\n\nexport function getServerOptionsBundler(\n entryFile: string,\n result: {\n hasCustomConfig: false;\n },\n) {\n return extractMastraOptionBundler('server', entryFile, result);\n}\n\nexport async function getServerOptions(\n entryFile: string,\n outputDir: string,\n logger?: IMastraLogger,\n): Promise<Config['server'] | null> {\n const result = await extractMastraOption('server', entryFile, outputDir, logger);\n if (!result) {\n return null;\n }\n\n return result.getConfig();\n}\n"]}
|
package/dist/chunk-Y476PH5A.cjs
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkVZYB4EVX_cjs = require('./chunk-VZYB4EVX.cjs');
|
|
4
|
-
var chunk47KJ3RKB_cjs = require('./chunk-47KJ3RKB.cjs');
|
|
5
|
-
var chunkFBL7GBNM_cjs = require('./chunk-FBL7GBNM.cjs');
|
|
6
|
-
var chunkI7TERDMR_cjs = require('./chunk-I7TERDMR.cjs');
|
|
7
|
-
var chunk7PMC7SBC_cjs = require('./chunk-7PMC7SBC.cjs');
|
|
8
|
-
var path = require('path');
|
|
9
|
-
var logger = require('@mastra/core/logger');
|
|
10
|
-
var pkg = require('empathic/package');
|
|
11
|
-
var rollup = require('rollup');
|
|
12
|
-
|
|
13
|
-
function _interopNamespace(e) {
|
|
14
|
-
if (e && e.__esModule) return e;
|
|
15
|
-
var n = Object.create(null);
|
|
16
|
-
if (e) {
|
|
17
|
-
Object.keys(e).forEach(function (k) {
|
|
18
|
-
if (k !== 'default') {
|
|
19
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
20
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function () { return e[k]; }
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
n.default = e;
|
|
28
|
-
return Object.freeze(n);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
var pkg__namespace = /*#__PURE__*/_interopNamespace(pkg);
|
|
32
|
-
|
|
33
|
-
async function getInputOptions2(entryFile, platform, env, {
|
|
34
|
-
sourcemap = false,
|
|
35
|
-
bundlerOptions = {
|
|
36
|
-
enableSourcemap: false,
|
|
37
|
-
enableEsmShim: true,
|
|
38
|
-
externals: true
|
|
39
|
-
}
|
|
40
|
-
} = {}) {
|
|
41
|
-
const closestPkgJson = pkg__namespace.up({ cwd: path.dirname(entryFile) });
|
|
42
|
-
const projectRoot = closestPkgJson ? path.dirname(chunk7PMC7SBC_cjs.slash(closestPkgJson)) : chunk7PMC7SBC_cjs.slash(process.cwd());
|
|
43
|
-
const { workspaceMap, workspaceRoot } = await chunk47KJ3RKB_cjs.getWorkspaceInformation({ mastraEntryFile: entryFile });
|
|
44
|
-
const analyzeEntryResult = await chunk47KJ3RKB_cjs.analyzeBundle(
|
|
45
|
-
[entryFile],
|
|
46
|
-
entryFile,
|
|
47
|
-
{
|
|
48
|
-
outputDir: path.posix.join(process.cwd(), ".mastra", ".build"),
|
|
49
|
-
projectRoot: workspaceRoot || process.cwd(),
|
|
50
|
-
platform,
|
|
51
|
-
isDev: true,
|
|
52
|
-
bundlerOptions
|
|
53
|
-
},
|
|
54
|
-
logger.noopLogger
|
|
55
|
-
);
|
|
56
|
-
const deps = /* @__PURE__ */ new Map();
|
|
57
|
-
for (const [dep, metadata] of analyzeEntryResult.dependencies.entries()) {
|
|
58
|
-
const pkgName = chunk7PMC7SBC_cjs.getPackageName(dep);
|
|
59
|
-
if (pkgName && workspaceMap.has(pkgName)) {
|
|
60
|
-
deps.set(dep, metadata);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
const inputOptions = await chunkFBL7GBNM_cjs.getInputOptions(
|
|
64
|
-
entryFile,
|
|
65
|
-
{
|
|
66
|
-
dependencies: deps,
|
|
67
|
-
externalDependencies: /* @__PURE__ */ new Map(),
|
|
68
|
-
workspaceMap
|
|
69
|
-
},
|
|
70
|
-
platform,
|
|
71
|
-
env,
|
|
72
|
-
{ sourcemap, isDev: true, workspaceRoot, projectRoot, externalsPreset: bundlerOptions?.externals === true }
|
|
73
|
-
);
|
|
74
|
-
if (Array.isArray(inputOptions.plugins)) {
|
|
75
|
-
const plugins = [];
|
|
76
|
-
inputOptions.plugins.forEach((plugin) => {
|
|
77
|
-
if (plugin?.name === "node-resolve") {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
if (plugin?.name === "tsconfig-paths") {
|
|
81
|
-
plugins.push(
|
|
82
|
-
chunkI7TERDMR_cjs.tsConfigPaths({
|
|
83
|
-
localResolve: true
|
|
84
|
-
})
|
|
85
|
-
);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
plugins.push(plugin);
|
|
89
|
-
});
|
|
90
|
-
inputOptions.plugins = plugins;
|
|
91
|
-
inputOptions.plugins.push(chunk47KJ3RKB_cjs.aliasHono());
|
|
92
|
-
inputOptions.plugins.push(chunkFBL7GBNM_cjs.nodeModulesExtensionResolver());
|
|
93
|
-
}
|
|
94
|
-
return inputOptions;
|
|
95
|
-
}
|
|
96
|
-
async function createWatcher(inputOptions, outputOptions) {
|
|
97
|
-
const watcher = await rollup.watch({
|
|
98
|
-
...inputOptions,
|
|
99
|
-
output: {
|
|
100
|
-
...outputOptions,
|
|
101
|
-
format: "esm",
|
|
102
|
-
entryFileNames: "[name].mjs",
|
|
103
|
-
chunkFileNames: "[name].mjs"
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
return watcher;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// src/build/serverOptions.ts
|
|
110
|
-
async function getServerOptions(entryFile, outputDir, logger) {
|
|
111
|
-
const result = await chunkVZYB4EVX_cjs.extractMastraOption("server", entryFile, outputDir, logger);
|
|
112
|
-
if (!result) {
|
|
113
|
-
return null;
|
|
114
|
-
}
|
|
115
|
-
return result.getConfig();
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
exports.createWatcher = createWatcher;
|
|
119
|
-
exports.getInputOptions = getInputOptions2;
|
|
120
|
-
exports.getServerOptions = getServerOptions;
|
|
121
|
-
//# sourceMappingURL=chunk-Y476PH5A.cjs.map
|
|
122
|
-
//# sourceMappingURL=chunk-Y476PH5A.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/build/watcher.ts","../src/build/serverOptions.ts"],"names":["getInputOptions","pkg","dirname","slash","getWorkspaceInformation","analyzeBundle","posix","noopLogger","getPackageName","tsConfigPaths","aliasHono","nodeModulesExtensionResolver","watch","extractMastraOption"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,eAAsBA,gBAAAA,CACpB,SAAA,EACA,QAAA,EACA,GAAA,EACA;AAAA,EACE,SAAA,GAAY,KAAA;AAAA,EACZ,cAAA,GAAiB;AAAA,IACf,eAAA,EAAiB,KAAA;AAAA,IACjB,aAAA,EAAe,IAAA;AAAA,IACf,SAAA,EAAW;AAAA;AAEf,CAAA,GAA8D,EAAC,EAC/D;AACA,EAAA,MAAM,iBAAqBC,cAAA,CAAA,EAAA,CAAG,EAAE,KAAKC,YAAA,CAAQ,SAAS,GAAG,CAAA;AACzD,EAAA,MAAM,WAAA,GAAc,cAAA,GAAiBA,YAAA,CAAQC,uBAAA,CAAM,cAAc,CAAC,CAAA,GAAIA,uBAAA,CAAM,OAAA,CAAQ,GAAA,EAAK,CAAA;AACzF,EAAA,MAAM,EAAE,cAAc,aAAA,EAAc,GAAI,MAAMC,yCAAA,CAAwB,EAAE,eAAA,EAAiB,SAAA,EAAW,CAAA;AAEpG,EAAA,MAAM,qBAAqB,MAAMC,+BAAA;AAAA,IAC/B,CAAC,SAAS,CAAA;AAAA,IACV,SAAA;AAAA,IACA;AAAA,MACE,WAAWC,UAAA,CAAM,IAAA,CAAK,QAAQ,GAAA,EAAI,EAAG,WAAW,QAAQ,CAAA;AAAA,MACxD,WAAA,EAAa,aAAA,IAAiB,OAAA,CAAQ,GAAA,EAAI;AAAA,MAC1C,QAAA;AAAA,MACA,KAAA,EAAO,IAAA;AAAA,MACP;AAAA,KACF;AAAA,IACAC;AAAA,GACF;AAEA,EAAA,MAAM,IAAA,uBAA2B,GAAA,EAAI;AACrC,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,QAAQ,KAAK,kBAAA,CAAmB,YAAA,CAAa,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AAA;AACT;AAEA,eAAsB,aAAA,CAAc,cAA4B,aAAA,EAA8B;AAC5F,EAAA,MAAM,OAAA,GAAU,MAAMC,YAAA,CAAM;AAAA,IAC1B,GAAG,YAAA;AAAA,IACH,MAAA,EAAQ;AAAA,MACN,GAAG,aAAA;AAAA,MACH,MAAA,EAAQ,KAAA;AAAA,MACR,cAAA,EAAgB,YAAA;AAAA,MAChB,cAAA,EAAgB;AAAA;AAClB,GACD,CAAA;AAED,EAAA,OAAO,OAAA;AACT;;;AC9FA,eAAsB,gBAAA,CACpB,SAAA,EACA,SAAA,EACA,MAAA,EACkC;AAClC,EAAA,MAAM,SAAS,MAAMC,qCAAA,CAAoB,QAAA,EAAU,SAAA,EAAW,WAAW,MAAM,CAAA;AAC/E,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,OAAO,SAAA,EAAU;AAC1B","file":"chunk-Y476PH5A.cjs","sourcesContent":["import { dirname, posix } from 'node:path';\nimport { noopLogger } from '@mastra/core/logger';\nimport * as pkg from 'empathic/package';\nimport type { InputOptions, OutputOptions, Plugin } from 'rollup';\nimport { watch } from 'rollup';\nimport { getWorkspaceInformation } from '../bundler/workspaceDependencies';\nimport { analyzeBundle } from './analyze';\nimport { getInputOptions as getBundlerInputOptions } from './bundler';\nimport { aliasHono } from './plugins/hono-alias';\nimport { nodeModulesExtensionResolver } from './plugins/node-modules-extension-resolver';\nimport { tsConfigPaths } from './plugins/tsconfig-paths';\nimport type { BundlerOptions } from './types';\nimport { getPackageName, slash } from './utils';\nimport type { BundlerPlatform } from './utils';\n\nexport async function getInputOptions(\n entryFile: string,\n platform: BundlerPlatform,\n env?: Record<string, string>,\n {\n sourcemap = false,\n bundlerOptions = {\n enableSourcemap: false,\n enableEsmShim: true,\n externals: true,\n },\n }: { sourcemap?: boolean; bundlerOptions?: BundlerOptions } = {},\n) {\n const closestPkgJson = pkg.up({ cwd: dirname(entryFile) });\n const projectRoot = closestPkgJson ? dirname(slash(closestPkgJson)) : slash(process.cwd());\n const { workspaceMap, workspaceRoot } = await getWorkspaceInformation({ mastraEntryFile: entryFile });\n\n const analyzeEntryResult = await analyzeBundle(\n [entryFile],\n entryFile,\n {\n outputDir: posix.join(process.cwd(), '.mastra', '.build'),\n projectRoot: workspaceRoot || process.cwd(),\n platform,\n isDev: true,\n bundlerOptions,\n },\n noopLogger,\n );\n\n const deps = /* @__PURE__ */ new Map();\n for (const [dep, metadata] of analyzeEntryResult.dependencies.entries()) {\n const pkgName = getPackageName(dep);\n if (pkgName && workspaceMap.has(pkgName)) {\n deps.set(dep, metadata);\n }\n }\n\n const inputOptions = await getBundlerInputOptions(\n entryFile,\n {\n dependencies: deps,\n externalDependencies: new Map(),\n workspaceMap,\n },\n platform,\n env,\n { sourcemap, isDev: true, workspaceRoot, projectRoot, externalsPreset: bundlerOptions?.externals === true },\n );\n\n if (Array.isArray(inputOptions.plugins)) {\n // filter out node-resolve plugin so all node_modules are external\n // and tsconfig-paths plugin as we are injection a custom one\n const plugins = [] as Plugin[];\n inputOptions.plugins.forEach(plugin => {\n if ((plugin as Plugin | undefined)?.name === 'node-resolve') {\n return;\n }\n\n if ((plugin as Plugin | undefined)?.name === 'tsconfig-paths') {\n plugins.push(\n tsConfigPaths({\n localResolve: true,\n }),\n );\n return;\n }\n\n plugins.push(plugin as Plugin);\n });\n\n inputOptions.plugins = plugins;\n inputOptions.plugins.push(aliasHono());\n // fixes imports like lodash/fp/get\n inputOptions.plugins.push(nodeModulesExtensionResolver());\n }\n\n return inputOptions;\n}\n\nexport async function createWatcher(inputOptions: InputOptions, outputOptions: OutputOptions) {\n const watcher = await watch({\n ...inputOptions,\n output: {\n ...outputOptions,\n format: 'esm',\n entryFileNames: '[name].mjs',\n chunkFileNames: '[name].mjs',\n },\n });\n\n return watcher;\n}\n","import type { IMastraLogger } from '@mastra/core/logger';\nimport type { Config } from '@mastra/core/mastra';\nimport { extractMastraOption, extractMastraOptionBundler } from './shared/extract-mastra-option';\n\nexport function getServerOptionsBundler(\n entryFile: string,\n result: {\n hasCustomConfig: false;\n },\n) {\n return extractMastraOptionBundler('server', entryFile, result);\n}\n\nexport async function getServerOptions(\n entryFile: string,\n outputDir: string,\n logger?: IMastraLogger,\n): Promise<Config['server'] | null> {\n const result = await extractMastraOption('server', entryFile, outputDir, logger);\n if (!result) {\n return null;\n }\n\n return result.getConfig();\n}\n"]}
|