@mastra/deployer 0.24.9-alpha.1 → 0.24.10-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/CHANGELOG.md +24 -0
- package/dist/build/analyze/bundleExternals.d.ts +4 -5
- package/dist/build/analyze/bundleExternals.d.ts.map +1 -1
- package/dist/build/analyze.cjs +2 -2
- package/dist/build/analyze.d.ts +2 -2
- package/dist/build/analyze.d.ts.map +1 -1
- package/dist/build/analyze.js +1 -1
- package/dist/build/bundler.cjs +3 -3
- package/dist/build/bundler.d.ts +2 -1
- package/dist/build/bundler.d.ts.map +1 -1
- package/dist/build/bundler.js +1 -1
- package/dist/build/index.cjs +12 -12
- package/dist/build/index.js +4 -4
- package/dist/build/plugins/node-modules-extension-resolver.d.ts +7 -0
- package/dist/build/plugins/node-modules-extension-resolver.d.ts.map +1 -1
- package/dist/build/utils.d.ts +6 -0
- package/dist/build/utils.d.ts.map +1 -1
- package/dist/build/watcher.d.ts.map +1 -1
- package/dist/bundler/index.cjs +2 -2
- package/dist/bundler/index.d.ts +5 -5
- package/dist/bundler/index.d.ts.map +1 -1
- package/dist/bundler/index.js +1 -1
- package/dist/{chunk-3GJSIS6L.cjs → chunk-24QKSIF4.cjs} +8 -3
- package/dist/chunk-24QKSIF4.cjs.map +1 -0
- package/dist/{chunk-BYJ5P75V.cjs → chunk-37AZSKLD.cjs} +31 -27
- package/dist/chunk-37AZSKLD.cjs.map +1 -0
- package/dist/{chunk-NEGQTTJS.js → chunk-AI2IXYON.js} +8 -4
- package/dist/chunk-AI2IXYON.js.map +1 -0
- package/dist/{chunk-IN6YCLG2.js → chunk-EL7U6UCA.js} +3 -3
- package/dist/{chunk-IN6YCLG2.js.map → chunk-EL7U6UCA.js.map} +1 -1
- package/dist/{chunk-4BZNZFZN.cjs → chunk-I343PEBO.cjs} +5 -5
- package/dist/{chunk-4BZNZFZN.cjs.map → chunk-I343PEBO.cjs.map} +1 -1
- package/dist/chunk-JESLK2Y3.js +249 -0
- package/dist/chunk-JESLK2Y3.js.map +1 -0
- package/dist/{chunk-IMZH6M7G.cjs → chunk-JZYQOKB4.cjs} +109 -57
- package/dist/chunk-JZYQOKB4.cjs.map +1 -0
- package/dist/chunk-MTB7RTAH.cjs +123 -0
- package/dist/chunk-MTB7RTAH.cjs.map +1 -0
- package/dist/{chunk-FIVDPLGU.js → chunk-NWWMYMSL.js} +20 -16
- package/dist/chunk-NWWMYMSL.js.map +1 -0
- package/dist/{chunk-E5MVIUAD.js → chunk-PEMRXQDH.js} +6 -76
- package/dist/chunk-PEMRXQDH.js.map +1 -0
- package/dist/{chunk-C3343ELD.js → chunk-Z7PGONL4.js} +89 -37
- package/dist/chunk-Z7PGONL4.js.map +1 -0
- package/dist/chunk-ZYA3ZCCR.cjs +261 -0
- package/dist/chunk-ZYA3ZCCR.cjs.map +1 -0
- package/dist/index.cjs +5 -5
- package/dist/index.js +2 -2
- package/dist/server/handlers/prompt.d.ts.map +1 -1
- package/dist/server/handlers/routes/agents/handlers.d.ts +6 -0
- package/dist/server/handlers/routes/agents/handlers.d.ts.map +1 -1
- package/dist/server/handlers/routes/scores/handlers.d.ts +30 -30
- package/dist/server/index.cjs +3 -2
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +3 -2
- package/dist/server/index.js.map +1 -1
- package/dist/validator/custom-resolver.cjs +2 -2
- package/dist/validator/custom-resolver.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-3GJSIS6L.cjs.map +0 -1
- package/dist/chunk-62BMSTRF.cjs +0 -196
- package/dist/chunk-62BMSTRF.cjs.map +0 -1
- package/dist/chunk-BYJ5P75V.cjs.map +0 -1
- package/dist/chunk-C3343ELD.js.map +0 -1
- package/dist/chunk-E5MVIUAD.js.map +0 -1
- package/dist/chunk-FIVDPLGU.js.map +0 -1
- package/dist/chunk-IMZH6M7G.cjs.map +0 -1
- package/dist/chunk-NEGQTTJS.js.map +0 -1
- package/dist/chunk-QPQ6DGHM.js +0 -147
- package/dist/chunk-QPQ6DGHM.js.map +0 -1
- package/dist/chunk-UHRSJYRY.cjs +0 -157
- package/dist/chunk-UHRSJYRY.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @mastra/deployer
|
|
2
2
|
|
|
3
|
+
## 0.24.10-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Allow for `bundler.externals: true` to be set. ([#11300](https://github.com/mastra-ai/mastra/pull/11300))
|
|
8
|
+
|
|
9
|
+
With this configuration during `mastra build` all dependencies (except workspace dependencies) will be treated as "external" and not bundled. Instead they will be added to the `.mastra/output/package.json` file.
|
|
10
|
+
|
|
11
|
+
- Fix generate system prompt by updating deprecated function call. ([#11075](https://github.com/mastra-ai/mastra/pull/11075))
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`b5581fb`](https://github.com/mastra-ai/mastra/commit/b5581fbcead57443c885f5397d651bf5df20b14a), [`fe5ea7d`](https://github.com/mastra-ai/mastra/commit/fe5ea7d06d56a3ebd3283a25fb45f94aea12d844), [`0ebadd2`](https://github.com/mastra-ai/mastra/commit/0ebadd21d449bd743e5839e875a745afff9f8b0a)]:
|
|
14
|
+
- @mastra/core@0.24.10-alpha.0
|
|
15
|
+
- @mastra/server@0.24.10-alpha.0
|
|
16
|
+
|
|
17
|
+
## 0.24.9
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Update prompt handler to use new scoring system instead of deprecated evals. ([#11274](https://github.com/mastra-ai/mastra/pull/11274))
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [[`c56f64b`](https://github.com/mastra-ai/mastra/commit/c56f64b0d7365d744cfe99f54369795917c057b7), [`60d99c0`](https://github.com/mastra-ai/mastra/commit/60d99c0addeed9d759c1b9fe4924d830ec93ac84)]:
|
|
24
|
+
- @mastra/core@0.24.9
|
|
25
|
+
- @mastra/server@0.24.9
|
|
26
|
+
|
|
3
27
|
## 0.24.9-alpha.1
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Config } from '@mastra/core/mastra';
|
|
1
2
|
import { type OutputChunk, type OutputAsset } from 'rollup';
|
|
2
3
|
import { type WorkspacePackageInfo } from '../../bundler/workspaceDependencies.js';
|
|
3
4
|
import type { DependencyMetadata } from '../types.js';
|
|
@@ -14,6 +15,7 @@ export declare function createVirtualDependencies(depsToOptimize: Map<string, De
|
|
|
14
15
|
outputDir: string;
|
|
15
16
|
bundlerOptions?: {
|
|
16
17
|
isDev?: boolean;
|
|
18
|
+
externalsPreset?: boolean;
|
|
17
19
|
};
|
|
18
20
|
}): {
|
|
19
21
|
optimizedDependencyEntries: Map<string, VirtualDependency>;
|
|
@@ -29,12 +31,9 @@ export declare function createVirtualDependencies(depsToOptimize: Map<string, De
|
|
|
29
31
|
* @returns Object containing bundle output and reference map for validation
|
|
30
32
|
*/
|
|
31
33
|
export declare function bundleExternals(depsToOptimize: Map<string, DependencyMetadata>, outputDir: string, options: {
|
|
32
|
-
bundlerOptions?: {
|
|
33
|
-
externals?: string[];
|
|
34
|
-
transpilePackages?: string[];
|
|
34
|
+
bundlerOptions?: ({
|
|
35
35
|
isDev?: boolean;
|
|
36
|
-
|
|
37
|
-
} | null;
|
|
36
|
+
} & Config['bundler']) | null;
|
|
38
37
|
projectRoot?: string;
|
|
39
38
|
workspaceRoot?: string;
|
|
40
39
|
workspaceMap?: Map<string, WorkspacePackageInfo>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundleExternals.d.ts","sourceRoot":"","sources":["../../../src/build/analyze/bundleExternals.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bundleExternals.d.ts","sourceRoot":"","sources":["../../../src/build/analyze/bundleExternals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;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dist/build/analyze.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkJZYQOKB4_cjs = require('../chunk-JZYQOKB4.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 chunkJZYQOKB4_cjs.analyzeBundle; }
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=analyze.cjs.map
|
|
12
12
|
//# sourceMappingURL=analyze.cjs.map
|
package/dist/build/analyze.d.ts
CHANGED
|
@@ -8,13 +8,13 @@ import { type WorkspacePackageInfo } from '../bundler/workspaceDependencies.js';
|
|
|
8
8
|
*
|
|
9
9
|
* This helps identify which dependencies need to be externalized vs bundled.
|
|
10
10
|
*/
|
|
11
|
-
export declare function analyzeBundle(entries: string[], mastraEntry: string, { outputDir, projectRoot, isDev, bundlerOptions:
|
|
11
|
+
export declare function analyzeBundle(entries: string[], mastraEntry: string, { outputDir, projectRoot, isDev, bundlerOptions: internalBundlerOptions, }: {
|
|
12
12
|
outputDir: string;
|
|
13
13
|
projectRoot: string;
|
|
14
14
|
platform: 'node' | 'browser';
|
|
15
15
|
isDev?: boolean;
|
|
16
16
|
bundlerOptions?: {
|
|
17
|
-
|
|
17
|
+
externals?: boolean | string[];
|
|
18
18
|
} | null;
|
|
19
19
|
}, logger: IMastraLogger): Promise<{
|
|
20
20
|
externalDependencies: Set<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/build/analyze.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AASzD,OAAO,EAA2B,KAAK,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAmQtG;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EAAE,EACjB,WAAW,EAAE,MAAM,EACnB,EACE,SAAS,EACT,WAAW,EACX,KAAa,EACb,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/build/analyze.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AASzD,OAAO,EAA2B,KAAK,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAmQtG;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EAAE,EACjB,WAAW,EAAE,MAAM,EACnB,EACE,SAAS,EACT,WAAW,EACX,KAAa,EACb,cAAc,EAAE,sBAAsB,GACvC,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE;QACf,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;KAChC,GAAG,IAAI,CAAC;CACV,EACD,MAAM,EAAE,aAAa;;;;GAuJtB"}
|
package/dist/build/analyze.js
CHANGED
package/dist/build/bundler.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkZYA3ZCCR_cjs = require('../chunk-ZYA3ZCCR.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 chunkZYA3ZCCR_cjs.createBundler; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "getInputOptions", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkZYA3ZCCR_cjs.getInputOptions; }
|
|
14
14
|
});
|
|
15
15
|
//# sourceMappingURL=bundler.cjs.map
|
|
16
16
|
//# sourceMappingURL=bundler.cjs.map
|
package/dist/build/bundler.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { type InputOptions, type OutputOptions } from 'rollup';
|
|
2
2
|
import { analyzeBundle } from './analyze/index.js';
|
|
3
|
-
export declare function getInputOptions(entryFile: string, analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>, platform: 'node' | 'browser', env: Record<string, string> | undefined, { sourcemap, isDev, projectRoot, workspaceRoot, enableEsmShim, }: {
|
|
3
|
+
export declare function getInputOptions(entryFile: string, analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>, platform: 'node' | 'browser', env: Record<string, string> | undefined, { sourcemap, isDev, projectRoot, workspaceRoot, enableEsmShim, externalsPreset, }: {
|
|
4
4
|
sourcemap?: boolean;
|
|
5
5
|
isDev?: boolean;
|
|
6
6
|
workspaceRoot?: string;
|
|
7
7
|
projectRoot: string;
|
|
8
8
|
enableEsmShim?: boolean;
|
|
9
|
+
externalsPreset?: boolean;
|
|
9
10
|
}): Promise<InputOptions>;
|
|
10
11
|
export declare function createBundler(inputOptions: InputOptions, outputOptions: Partial<OutputOptions> & {
|
|
11
12
|
dir: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../src/build/bundler.ts"],"names":[],"mappings":"AAMA,OAAO,EAAU,KAAK,YAAY,EAAE,KAAK,aAAa,EAAe,MAAM,QAAQ,CAAC;AAGpF,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../src/build/bundler.ts"],"names":[],"mappings":"AAMA,OAAO,EAAU,KAAK,YAAY,EAAE,KAAK,aAAa,EAAe,MAAM,QAAQ,CAAC;AAGpF,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAQ1C,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,kBAAkB,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,EAC7D,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,YAA2D,EACtF,EACE,SAAiB,EACjB,KAAa,EACb,WAAW,EACX,aAAyB,EACzB,aAAoB,EACpB,eAAuB,GACxB,EAAE;IACD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GACA,OAAO,CAAC,YAAY,CAAC,CAuHvB;AAED,wBAAsB,aAAa,CACjC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE;;;GAiBxD"}
|
package/dist/build/bundler.js
CHANGED
package/dist/build/index.cjs
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunkMTB7RTAH_cjs = require('../chunk-MTB7RTAH.cjs');
|
|
4
|
+
var chunkI343PEBO_cjs = require('../chunk-I343PEBO.cjs');
|
|
5
|
+
var chunkZYA3ZCCR_cjs = require('../chunk-ZYA3ZCCR.cjs');
|
|
6
|
+
var chunkJZYQOKB4_cjs = require('../chunk-JZYQOKB4.cjs');
|
|
7
7
|
var chunk3JYRSECU_cjs = require('../chunk-3JYRSECU.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "createWatcher", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkMTB7RTAH_cjs.createWatcher; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "getServerOptions", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkMTB7RTAH_cjs.getServerOptions; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "getWatcherInputOptions", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkMTB7RTAH_cjs.getInputOptions; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "writeTelemetryConfig", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkI343PEBO_cjs.writeTelemetryConfig; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "createBundler", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkZYA3ZCCR_cjs.createBundler; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "getBundlerInputOptions", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkZYA3ZCCR_cjs.getInputOptions; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "analyzeBundle", {
|
|
36
36
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunkJZYQOKB4_cjs.analyzeBundle; }
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "getBundlerOptions", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunkJZYQOKB4_cjs.getBundlerOptions; }
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "Deps", {
|
|
44
44
|
enumerable: true,
|
package/dist/build/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-
|
|
2
|
-
export { writeTelemetryConfig } from '../chunk-
|
|
3
|
-
export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-
|
|
4
|
-
export { analyzeBundle, getBundlerOptions } from '../chunk-
|
|
1
|
+
export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-PEMRXQDH.js';
|
|
2
|
+
export { writeTelemetryConfig } from '../chunk-EL7U6UCA.js';
|
|
3
|
+
export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-JESLK2Y3.js';
|
|
4
|
+
export { analyzeBundle, getBundlerOptions } from '../chunk-Z7PGONL4.js';
|
|
5
5
|
export { Deps, FileService } from '../chunk-5QFG6SCM.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import type { Plugin } from 'rollup';
|
|
2
|
+
/**
|
|
3
|
+
* Rollup plugin that resolves module extensions for external dependencies.
|
|
4
|
+
*
|
|
5
|
+
* This plugin handles ESM compatibility for external imports when node-resolve is not used:
|
|
6
|
+
* - Packages WITH exports field (e.g., hono, date-fns): Keep imports as-is or strip redundant extensions
|
|
7
|
+
* - Packages WITHOUT exports field (e.g., lodash): Add .js extension for direct file imports
|
|
8
|
+
*/
|
|
2
9
|
export declare function nodeModulesExtensionResolver(): Plugin;
|
|
3
10
|
//# sourceMappingURL=node-modules-extension-resolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-modules-extension-resolver.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/node-modules-extension-resolver.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"node-modules-extension-resolver.d.ts","sourceRoot":"","sources":["../../../src/build/plugins/node-modules-extension-resolver.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAqDrC;;;;;;GAMG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,CAwFrD"}
|
package/dist/build/utils.d.ts
CHANGED
|
@@ -43,4 +43,10 @@ export declare function rollupSafeName(name: string, rootDir: string): string;
|
|
|
43
43
|
* findNativePackageModule(moduleIds); // Returns '/path/node_modules/bcrypt/bcrypt.js'
|
|
44
44
|
*/
|
|
45
45
|
export declare function findNativePackageModule(moduleIds: string[]): string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Check if a module is a Node.js builtin module
|
|
48
|
+
* @param specifier - Module specifier
|
|
49
|
+
* @returns True if it's a builtin module
|
|
50
|
+
*/
|
|
51
|
+
export declare function isBuiltinModule(specifier: string): boolean;
|
|
46
52
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/build/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/build/utils.ts"],"names":[],"mappings":"AAOA,wBAAgB,eAAe,CAAC,EAAE,GAAmB,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,QAOxE;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,WAMzE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,sBAQxC;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAsBzG;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAE5E;AAED;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,UAQjC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAU3D;AAcD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAqB/E;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAM1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../../src/build/watcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAU,MAAM,QAAQ,CAAC;AAalE,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,EAAE,SAAiB,EAAE,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,
|
|
1
|
+
{"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../../src/build/watcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAU,MAAM,QAAQ,CAAC;AAalE,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,EAAE,SAAiB,EAAE,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,yBAkEpD;AAED,wBAAsB,aAAa,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,2CAY3F"}
|
package/dist/bundler/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk37AZSKLD_cjs = require('../chunk-37AZSKLD.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 chunk37AZSKLD_cjs.Bundler; }
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=index.cjs.map
|
|
12
12
|
//# sourceMappingURL=index.cjs.map
|
package/dist/bundler/index.d.ts
CHANGED
|
@@ -14,9 +14,7 @@ export declare abstract class Bundler extends MastraBundler {
|
|
|
14
14
|
write: () => Promise<import("rollup").RollupOutput>;
|
|
15
15
|
close: () => Promise<void>;
|
|
16
16
|
}>;
|
|
17
|
-
protected analyze(entry: string | string[], mastraFile: string, outputDirectory: string
|
|
18
|
-
enableEsmShim?: boolean;
|
|
19
|
-
}): Promise<{
|
|
17
|
+
protected analyze(entry: string | string[], mastraFile: string, outputDirectory: string): Promise<{
|
|
20
18
|
externalDependencies: Set<string>;
|
|
21
19
|
dependencies: Map<string, string>;
|
|
22
20
|
workspaceMap: Map<string, import("./workspaceDependencies").WorkspacePackageInfo>;
|
|
@@ -27,16 +25,18 @@ export declare abstract class Bundler extends MastraBundler {
|
|
|
27
25
|
rootDir?: string;
|
|
28
26
|
outputDirectory: string;
|
|
29
27
|
}): Promise<void>;
|
|
30
|
-
protected getBundlerOptions(serverFile: string, mastraEntryFile: string, analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>, toolsPaths: (string | string[])[], { enableSourcemap, enableEsmShim }?: {
|
|
28
|
+
protected getBundlerOptions(serverFile: string, mastraEntryFile: string, analyzedBundleInfo: Awaited<ReturnType<typeof analyzeBundle>>, toolsPaths: (string | string[])[], { enableSourcemap, enableEsmShim, externalsPreset, }?: {
|
|
31
29
|
enableSourcemap?: boolean;
|
|
32
30
|
enableEsmShim?: boolean;
|
|
31
|
+
externalsPreset?: boolean;
|
|
33
32
|
}): Promise<InputOptions>;
|
|
34
33
|
getAllToolPaths(mastraDir: string, toolsPaths?: (string | string[])[]): (string | string[])[];
|
|
35
34
|
getToolsInputOptions(toolsPaths: (string | string[])[]): Promise<Record<string, string>>;
|
|
36
|
-
protected _bundle(serverFile: string, mastraEntryFile: string, { projectRoot, outputDirectory, enableEsmShim, }: {
|
|
35
|
+
protected _bundle(serverFile: string, mastraEntryFile: string, { projectRoot, outputDirectory, enableEsmShim, externals, }: {
|
|
37
36
|
projectRoot: string;
|
|
38
37
|
outputDirectory: string;
|
|
39
38
|
enableEsmShim?: boolean;
|
|
39
|
+
externals?: boolean | string[];
|
|
40
40
|
}, toolsPaths?: (string | string[])[], bundleLocation?: string): Promise<void>;
|
|
41
41
|
lint(_entryFile: string, _outputDirectory: string, toolsPaths: (string | string[])[]): Promise<void>;
|
|
42
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAKrD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAUjD,8BAAsB,OAAQ,SAAQ,aAAa;IACjD,SAAS,CAAC,gBAAgB,SAAY;IACtC,SAAS,CAAC,SAAS,SAAY;gBAEnB,IAAI,EAAE,MAAM,EAAE,SAAS,GAAE,SAAS,GAAG,UAAsB;IAIjE,OAAO,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ/C,wBAAwB,CAAC,eAAe,EAAE,MAAM,EAAE,yBAAyB,CAAC,EAAE,MAAM;IAWpF,gBAAgB,CACpB,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC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AM,EAAE,UAAU,EAAE,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAO3G"}
|
package/dist/bundler/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var path = require('path');
|
|
4
3
|
var localPkg = require('local-pkg');
|
|
5
4
|
var url = require('url');
|
|
5
|
+
var path = require('path');
|
|
6
|
+
var module$1 = require('module');
|
|
6
7
|
|
|
7
8
|
// src/build/utils.ts
|
|
8
9
|
function isDependencyPartOfPackage(dep, packageName) {
|
|
@@ -58,12 +59,16 @@ function rollupSafeName(name, rootDir) {
|
|
|
58
59
|
}
|
|
59
60
|
return entry;
|
|
60
61
|
}
|
|
62
|
+
function isBuiltinModule(specifier) {
|
|
63
|
+
return module$1.builtinModules.includes(specifier) || specifier.startsWith("node:") || module$1.builtinModules.includes(specifier.replace(/^node:/, ""));
|
|
64
|
+
}
|
|
61
65
|
|
|
62
66
|
exports.getCompiledDepCachePath = getCompiledDepCachePath;
|
|
63
67
|
exports.getPackageName = getPackageName;
|
|
64
68
|
exports.getPackageRootPath = getPackageRootPath;
|
|
69
|
+
exports.isBuiltinModule = isBuiltinModule;
|
|
65
70
|
exports.isDependencyPartOfPackage = isDependencyPartOfPackage;
|
|
66
71
|
exports.rollupSafeName = rollupSafeName;
|
|
67
72
|
exports.slash = slash;
|
|
68
|
-
//# sourceMappingURL=chunk-
|
|
69
|
-
//# sourceMappingURL=chunk-
|
|
73
|
+
//# sourceMappingURL=chunk-24QKSIF4.cjs.map
|
|
74
|
+
//# sourceMappingURL=chunk-24QKSIF4.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/build/utils.ts"],"names":["pathToFileURL","getPackageInfo","join","relative","basename","builtinModules"],"mappings":";;;;;;;;AAgBO,SAAS,yBAAA,CAA0B,KAAa,WAAA,EAAqB;AAC1E,EAAA,IAAI,QAAQ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,oBAAA,GAAuB,IAAA,CAAK,UAAA,CAAW,SAAS,CAAA;AAEtD,EAAA,IAAI,oBAAA,EAAsB;AACxB,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,IAAA,CAAK,UAAA,CAAW,IAAA,EAAM,GAAG,CAAA;AAClC;AAKO,SAAS,cAAA,CAAe,MAAc,OAAA,EAAiB;AAC5D,EAAA,MAAM,GAAA,GAAMC,aAAA,CAAS,OAAA,EAAS,IAAI,CAAA;AAClC,EAAA,IAAI,KAAA,GAAQ,MAAM,GAAG,CAAA;AACrB,EAAA,KAAA,GAAQ,KAAA,CAAM,OAAA,CAAQ,YAAA,EAAc,EAAE,CAAA;AACtC,EAAA,KAAA,GAAQ,KAAA,CAAM,OAAA,CAAQ,MAAA,EAAQ,EAAE,CAAA;AAChC,EAAA,KAAA,GAAQ,KAAA,CAAM,OAAA,CAAQ,cAAA,EAAgB,EAAE,CAAA;AACxC,EAAA,IAAI,CAAC,KAAA,EAAO;AACV,IAAA,KAAA,GAAQ,KAAA,CAAMC,aAAA,CAAS,IAAI,CAAC,CAAA;AAAA,EAC9B;AACA,EAAA,OAAO,KAAA;AACT;AAwDO,SAAS,gBAAgB,SAAA,EAA4B;AAC1D,EAAA,OACEC,uBAAA,CAAe,QAAA,CAAS,SAAS,CAAA,IACjC,UAAU,UAAA,CAAW,OAAO,CAAA,IAC5BA,uBAAA,CAAe,QAAA,CAAS,SAAA,CAAU,OAAA,CAAQ,QAAA,EAAU,EAAE,CAAC,CAAA;AAE3D","file":"chunk-24QKSIF4.cjs","sourcesContent":["import { getPackageInfo } from 'local-pkg';\nimport { pathToFileURL } from 'url';\nimport { execSync } from 'node:child_process';\nimport { existsSync, mkdirSync } from 'node:fs';\nimport { basename, join, relative } from 'node:path';\nimport { builtinModules } from 'node:module';\n\nexport function upsertMastraDir({ dir = process.cwd() }: { dir?: string }) {\n const dirPath = join(dir, '.mastra');\n\n if (!existsSync(dirPath)) {\n mkdirSync(dirPath, { recursive: true });\n execSync(`echo \".mastra\" >> .gitignore`);\n }\n}\n\nexport function isDependencyPartOfPackage(dep: string, packageName: string) {\n if (dep === packageName) {\n return true;\n }\n\n return dep.startsWith(`${packageName}/`);\n}\n\n/**\n * Get the package name from a module ID\n */\nexport function getPackageName(id: string) {\n const parts = id.split('/');\n\n if (id.startsWith('@')) {\n return parts.slice(0, 2).join('/');\n }\n\n return parts[0];\n}\n\n/**\n * Get package root path\n */\nexport async function getPackageRootPath(packageName: string, parentPath?: string): Promise<string | null> {\n let rootPath: string | null;\n\n try {\n let options: { paths?: string[] } | undefined = undefined;\n if (parentPath) {\n if (!parentPath.startsWith('file://')) {\n parentPath = pathToFileURL(parentPath).href;\n }\n\n options = {\n paths: [parentPath],\n };\n }\n\n const pkg = await getPackageInfo(packageName, options);\n rootPath = pkg?.rootPath ?? null;\n } catch (e) {\n rootPath = null;\n }\n\n return rootPath;\n}\n\n/**\n * During `mastra dev` we are compiling TS files to JS (inside workspaces) so that users can just their workspace packages.\n * We store these compiled files inside `node_modules/.cache` for each workspace package.\n */\nexport function getCompiledDepCachePath(rootPath: string, packageName: string) {\n return slash(join(rootPath, 'node_modules', '.cache', packageName));\n}\n\n/**\n * Convert windows backslashes to posix slashes\n *\n * @example\n * ```ts\n * slash('C:\\\\Users\\\\user\\\\code\\\\mastra') // 'C:/Users/user/code/mastra'\n * ```\n */\nexport function slash(path: string) {\n const isExtendedLengthPath = path.startsWith('\\\\\\\\?\\\\');\n\n if (isExtendedLengthPath) {\n return path;\n }\n\n return path.replaceAll('\\\\', '/');\n}\n\n/**\n * Make a Rollup-safe name: pathless, POSIX, and without parent/absolute segments\n */\nexport function rollupSafeName(name: string, rootDir: string) {\n const rel = relative(rootDir, name);\n let entry = slash(rel);\n entry = entry.replace(/^(\\.\\.\\/)+/, '');\n entry = entry.replace(/^\\/+/, '');\n entry = entry.replace(/^[A-Za-z]:\\//, '');\n if (!entry) {\n entry = slash(basename(name));\n }\n return entry;\n}\n\n/**\n * Native binding loaders and infrastructure packages that should be ignored when identifying the actual package that requires native bindings\n */\nconst NATIVE_BINDING_LOADERS = [\n 'node-gyp-build',\n 'prebuild-install',\n 'bindings',\n 'node-addon-api',\n 'node-pre-gyp',\n 'nan', // Native Abstractions for Node.js\n] as const;\n\n/**\n * Finds the first real package from node_modules that likely contains native bindings, filtering out virtual modules and native binding loader infrastructure.\n *\n * @param moduleIds - Array of module IDs from a Rollup chunk\n * @returns The module ID of the actual native package, or undefined if not found\n *\n * @example\n * const moduleIds = [\n * '\\x00/path/node_modules/bcrypt/bcrypt.js?commonjs-module',\n * '/path/node_modules/node-gyp-build/index.js',\n * '/path/node_modules/bcrypt/bcrypt.js',\n * ];\n * findNativePackageModule(moduleIds); // Returns '/path/node_modules/bcrypt/bcrypt.js'\n */\nexport function findNativePackageModule(moduleIds: string[]): string | undefined {\n return moduleIds.find(id => {\n // Skip virtual modules (Rollup plugin-generated)\n if (id.startsWith('\\x00')) {\n return false;\n }\n\n // Must be from node_modules\n if (!id.includes('/node_modules/')) {\n return false;\n }\n\n // Skip native binding loader infrastructure\n for (const loader of NATIVE_BINDING_LOADERS) {\n if (id.includes(`/${loader}/`) || id.includes(`/${loader}@`)) {\n return false;\n }\n }\n\n return true;\n });\n}\n\n/**\n * Check if a module is a Node.js builtin module\n * @param specifier - Module specifier\n * @returns True if it's a builtin module\n */\nexport function isBuiltinModule(specifier: string): boolean {\n return (\n builtinModules.includes(specifier) ||\n specifier.startsWith('node:') ||\n builtinModules.includes(specifier.replace(/^node:/, ''))\n );\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkI343PEBO_cjs = require('./chunk-I343PEBO.cjs');
|
|
4
|
+
var chunkZYA3ZCCR_cjs = require('./chunk-ZYA3ZCCR.cjs');
|
|
5
|
+
var chunkJZYQOKB4_cjs = require('./chunk-JZYQOKB4.cjs');
|
|
6
6
|
var chunk3JYRSECU_cjs = require('./chunk-3JYRSECU.cjs');
|
|
7
|
-
var
|
|
7
|
+
var chunk24QKSIF4_cjs = require('./chunk-24QKSIF4.cjs');
|
|
8
8
|
var fs = require('fs');
|
|
9
9
|
var promises = require('fs/promises');
|
|
10
10
|
var path = require('path');
|
|
@@ -53,7 +53,7 @@ function getCustomInstrumentationBundler(entryFile, result) {
|
|
|
53
53
|
treeshake: false,
|
|
54
54
|
plugins: [
|
|
55
55
|
// transpile typescript to something we understand
|
|
56
|
-
|
|
56
|
+
chunkJZYQOKB4_cjs.esbuild(),
|
|
57
57
|
commonjs__default.default({
|
|
58
58
|
extensions: [".js", ".ts"],
|
|
59
59
|
strictRequires: "strict",
|
|
@@ -92,7 +92,7 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
92
92
|
}
|
|
93
93
|
async writeInstrumentationFile(outputDirectory, customInstrumentationFile) {
|
|
94
94
|
const instrumentationFile = path.join(outputDirectory, "instrumentation.mjs");
|
|
95
|
-
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-
|
|
95
|
+
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-37AZSKLD.cjs', document.baseURI).href))));
|
|
96
96
|
if (customInstrumentationFile) {
|
|
97
97
|
await fsExtra.copy(customInstrumentationFile, instrumentationFile);
|
|
98
98
|
} else {
|
|
@@ -149,19 +149,16 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
149
149
|
);
|
|
150
150
|
}
|
|
151
151
|
createBundler(inputOptions, outputOptions) {
|
|
152
|
-
return
|
|
152
|
+
return chunkZYA3ZCCR_cjs.createBundler(inputOptions, outputOptions);
|
|
153
153
|
}
|
|
154
|
-
async analyze(entry, mastraFile, outputDirectory
|
|
155
|
-
return await
|
|
154
|
+
async analyze(entry, mastraFile, outputDirectory) {
|
|
155
|
+
return await chunkJZYQOKB4_cjs.analyzeBundle(
|
|
156
156
|
[].concat(entry),
|
|
157
157
|
mastraFile,
|
|
158
158
|
{
|
|
159
159
|
outputDir: path.join(outputDirectory, this.analyzeOutputDir),
|
|
160
160
|
projectRoot: outputDirectory,
|
|
161
|
-
platform: "node"
|
|
162
|
-
bundlerOptions: {
|
|
163
|
-
enableEsmShim
|
|
164
|
-
}
|
|
161
|
+
platform: "node"
|
|
165
162
|
},
|
|
166
163
|
this.logger
|
|
167
164
|
);
|
|
@@ -193,18 +190,22 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
193
190
|
return;
|
|
194
191
|
}
|
|
195
192
|
}
|
|
196
|
-
async getBundlerOptions(serverFile, mastraEntryFile, analyzedBundleInfo, toolsPaths, {
|
|
197
|
-
|
|
193
|
+
async getBundlerOptions(serverFile, mastraEntryFile, analyzedBundleInfo, toolsPaths, {
|
|
194
|
+
enableSourcemap = false,
|
|
195
|
+
enableEsmShim = true,
|
|
196
|
+
externalsPreset = false
|
|
197
|
+
} = {}) {
|
|
198
|
+
const { workspaceRoot } = await chunkJZYQOKB4_cjs.getWorkspaceInformation({ mastraEntryFile });
|
|
198
199
|
const closestPkgJson = pkg__namespace.up({ cwd: path.dirname(mastraEntryFile) });
|
|
199
200
|
const projectRoot = closestPkgJson ? path.dirname(closestPkgJson) : process.cwd();
|
|
200
|
-
const inputOptions = await
|
|
201
|
+
const inputOptions = await chunkZYA3ZCCR_cjs.getInputOptions(
|
|
201
202
|
mastraEntryFile,
|
|
202
203
|
analyzedBundleInfo,
|
|
203
204
|
"node",
|
|
204
205
|
{
|
|
205
206
|
"process.env.NODE_ENV": JSON.stringify("production")
|
|
206
207
|
},
|
|
207
|
-
{ sourcemap: enableSourcemap, workspaceRoot, projectRoot, enableEsmShim }
|
|
208
|
+
{ sourcemap: enableSourcemap, workspaceRoot, projectRoot, enableEsmShim, externalsPreset }
|
|
208
209
|
);
|
|
209
210
|
const isVirtual = serverFile.includes("\n") || fs.existsSync(serverFile);
|
|
210
211
|
const toolsInputOptions = await this.getToolsInputOptions(toolsPaths);
|
|
@@ -221,7 +222,7 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
221
222
|
return inputOptions;
|
|
222
223
|
}
|
|
223
224
|
getAllToolPaths(mastraDir, toolsPaths = []) {
|
|
224
|
-
const normalizedMastraDir =
|
|
225
|
+
const normalizedMastraDir = chunk24QKSIF4_cjs.slash(mastraDir);
|
|
225
226
|
const defaultToolsPath = path.posix.join(normalizedMastraDir, "tools/**/*.{js,ts}");
|
|
226
227
|
const defaultToolsIgnorePaths = [
|
|
227
228
|
`!${path.posix.join(normalizedMastraDir, "tools/**/*.{test,spec}.{js,ts}")}`,
|
|
@@ -266,20 +267,23 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
266
267
|
async _bundle(serverFile, mastraEntryFile, {
|
|
267
268
|
projectRoot,
|
|
268
269
|
outputDirectory,
|
|
269
|
-
enableEsmShim = true
|
|
270
|
+
enableEsmShim = true,
|
|
271
|
+
externals = []
|
|
270
272
|
}, toolsPaths = [], bundleLocation = path.join(outputDirectory, this.outputDir)) {
|
|
271
273
|
const analyzeDir = path.join(outputDirectory, this.analyzeOutputDir);
|
|
272
274
|
let sourcemap = false;
|
|
275
|
+
let externalsPreset = false;
|
|
273
276
|
try {
|
|
274
|
-
const bundlerOptions = await
|
|
277
|
+
const bundlerOptions = await chunkJZYQOKB4_cjs.getBundlerOptions(mastraEntryFile, analyzeDir);
|
|
275
278
|
sourcemap = !!bundlerOptions?.sourcemap;
|
|
279
|
+
externalsPreset = bundlerOptions?.externals === true;
|
|
276
280
|
} catch (error) {
|
|
277
281
|
this.logger.debug("Failed to get bundler options, sourcemap will be disabled", { error });
|
|
278
282
|
}
|
|
279
283
|
let analyzedBundleInfo;
|
|
280
284
|
try {
|
|
281
285
|
const resolvedToolsPaths = await this.getToolsInputOptions(toolsPaths);
|
|
282
|
-
analyzedBundleInfo = await
|
|
286
|
+
analyzedBundleInfo = await chunkJZYQOKB4_cjs.analyzeBundle(
|
|
283
287
|
[serverFile, ...Object.values(resolvedToolsPaths)],
|
|
284
288
|
mastraEntryFile,
|
|
285
289
|
{
|
|
@@ -287,7 +291,7 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
287
291
|
projectRoot,
|
|
288
292
|
platform: "node",
|
|
289
293
|
bundlerOptions: {
|
|
290
|
-
|
|
294
|
+
externals
|
|
291
295
|
}
|
|
292
296
|
},
|
|
293
297
|
this.logger
|
|
@@ -309,7 +313,7 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
309
313
|
}
|
|
310
314
|
let externalDependencies;
|
|
311
315
|
try {
|
|
312
|
-
const result = await
|
|
316
|
+
const result = await chunkI343PEBO_cjs.writeTelemetryConfig(mastraEntryFile, path.join(outputDirectory, this.outputDir));
|
|
313
317
|
externalDependencies = result?.externalDependencies ?? [];
|
|
314
318
|
} catch (error$1) {
|
|
315
319
|
const message = error$1 instanceof Error ? error$1.message : String(error$1);
|
|
@@ -361,7 +365,7 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
361
365
|
if (analyzedBundleInfo.workspaceMap.has(dep)) {
|
|
362
366
|
continue;
|
|
363
367
|
}
|
|
364
|
-
const rootPath = await
|
|
368
|
+
const rootPath = await chunk24QKSIF4_cjs.getPackageRootPath(dep);
|
|
365
369
|
const pkg2 = await fsExtra.readJSON(`${rootPath}/package.json`);
|
|
366
370
|
dependenciesToInstall.set(dep, pkg2.version || "latest");
|
|
367
371
|
} catch {
|
|
@@ -376,7 +380,7 @@ var Bundler = class extends bundler.MastraBundler {
|
|
|
376
380
|
mastraEntryFile,
|
|
377
381
|
analyzedBundleInfo,
|
|
378
382
|
toolsPaths,
|
|
379
|
-
{ enableSourcemap: sourcemap, enableEsmShim }
|
|
383
|
+
{ enableSourcemap: sourcemap, enableEsmShim, externalsPreset }
|
|
380
384
|
);
|
|
381
385
|
const bundler = await this.createBundler(
|
|
382
386
|
{
|
|
@@ -447,5 +451,5 @@ export const tools = [${toolsExports.join(", ")}]`
|
|
|
447
451
|
};
|
|
448
452
|
|
|
449
453
|
exports.Bundler = Bundler;
|
|
450
|
-
//# sourceMappingURL=chunk-
|
|
451
|
-
//# sourceMappingURL=chunk-
|
|
454
|
+
//# sourceMappingURL=chunk-37AZSKLD.cjs.map
|
|
455
|
+
//# sourceMappingURL=chunk-37AZSKLD.cjs.map
|