@mastra/deployer 0.1.0-alpha.39 → 0.1.0-alpha.41
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 +12 -0
- package/dist/build/analyze.js +1 -1
- package/dist/build/bundler.js +1 -1
- package/dist/build/index.js +3 -3
- package/dist/bundler/index.js +3 -3
- package/dist/{chunk-E3NXSEZQ.js → chunk-EDV35Q7R.js} +2 -2
- package/dist/{chunk-DKKDXWES.js → chunk-JG3X44WH.js} +2 -2
- package/dist/{chunk-ODEOQDHZ.js → chunk-RCYKCEGL.js} +1 -1
- package/dist/{chunk-L2SCZHP4.js → chunk-WXH2HMQ2.js} +18 -17
- package/dist/index.js +5 -5
- package/package.json +1 -1
- package/src/build/analyze.ts +2 -4
- package/src/build/bundler.ts +1 -1
- package/src/build/plugins/pino.ts +16 -14
package/CHANGELOG.md
CHANGED
package/dist/build/analyze.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { analyzeBundle } from '../chunk-
|
|
1
|
+
export { analyzeBundle } from '../chunk-WXH2HMQ2.js';
|
|
2
2
|
import '../chunk-YNXJO2XU.js';
|
package/dist/build/bundler.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createBundler, getInputOptions } from '../chunk-
|
|
1
|
+
export { createBundler, getInputOptions } from '../chunk-RCYKCEGL.js';
|
|
2
2
|
import '../chunk-YNXJO2XU.js';
|
package/dist/build/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { FileService, createWatcher, getBundler, getWatcher, getInputOptions as getWatcherInputOptions } from '../chunk-
|
|
1
|
+
export { FileService, createWatcher, getBundler, getWatcher, getInputOptions as getWatcherInputOptions } from '../chunk-JG3X44WH.js';
|
|
2
2
|
export { Deps } from '../chunk-Q3WKR6OZ.js';
|
|
3
|
-
export { analyzeBundle } from '../chunk-
|
|
4
|
-
export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-
|
|
3
|
+
export { analyzeBundle } from '../chunk-WXH2HMQ2.js';
|
|
4
|
+
export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-RCYKCEGL.js';
|
|
5
5
|
import '../chunk-YNXJO2XU.js';
|
package/dist/bundler/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { Bundler } from '../chunk-
|
|
1
|
+
export { Bundler } from '../chunk-EDV35Q7R.js';
|
|
2
2
|
import '../chunk-Q3WKR6OZ.js';
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-WXH2HMQ2.js';
|
|
4
|
+
import '../chunk-RCYKCEGL.js';
|
|
5
5
|
import '../chunk-YNXJO2XU.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Deps } from './chunk-Q3WKR6OZ.js';
|
|
2
|
-
import { analyzeBundle } from './chunk-
|
|
3
|
-
import { createBundler, getInputOptions } from './chunk-
|
|
2
|
+
import { analyzeBundle } from './chunk-WXH2HMQ2.js';
|
|
3
|
+
import { createBundler, getInputOptions } from './chunk-RCYKCEGL.js';
|
|
4
4
|
import { MastraBundler } from '@mastra/core/bundler';
|
|
5
5
|
import virtual from '@rollup/plugin-virtual';
|
|
6
6
|
import { ensureDir } from 'fs-extra';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { aliasHono } from './chunk-
|
|
2
|
-
import { getInputOptions, telemetryFix, libSqlFix } from './chunk-
|
|
1
|
+
import { aliasHono } from './chunk-WXH2HMQ2.js';
|
|
2
|
+
import { getInputOptions, telemetryFix, libSqlFix } from './chunk-RCYKCEGL.js';
|
|
3
3
|
import { removeDeployer } from './chunk-YNXJO2XU.js';
|
|
4
4
|
import alias from '@rollup/plugin-alias';
|
|
5
5
|
import commonjs from '@rollup/plugin-commonjs';
|
|
@@ -160,7 +160,7 @@ async function getInputOptions(entryFile, analyzedBundleInfo, platform2) {
|
|
|
160
160
|
browser: true
|
|
161
161
|
});
|
|
162
162
|
return {
|
|
163
|
-
logLevel: "silent",
|
|
163
|
+
logLevel: process.env.MASTRA_BUNDLER_DEBUG === "true" ? "debug" : "silent",
|
|
164
164
|
treeshake: true,
|
|
165
165
|
preserveSymlinks: true,
|
|
166
166
|
external: Array.from(analyzedBundleInfo.externalDependencies),
|
|
@@ -52,20 +52,22 @@ function pino() {
|
|
|
52
52
|
async resolveId(id, importee) {
|
|
53
53
|
if (id === "pino") {
|
|
54
54
|
const resolvedPino = await this.resolve(id, importee);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
if (resolvedPino) {
|
|
56
|
+
await Promise.all(
|
|
57
|
+
workerFiles.map(async (file) => {
|
|
58
|
+
const resolvedEntry = await this.resolve(file.id, resolvedPino.id);
|
|
59
|
+
if (!resolvedEntry) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
const reference = this.emitFile({
|
|
63
|
+
type: "chunk",
|
|
64
|
+
id: resolvedEntry.id,
|
|
65
|
+
name: `${file.file}`
|
|
66
|
+
});
|
|
67
|
+
fileReferences.set(file.id, reference);
|
|
68
|
+
})
|
|
69
|
+
);
|
|
70
|
+
}
|
|
69
71
|
}
|
|
70
72
|
},
|
|
71
73
|
renderChunk(code, chunk) {
|
|
@@ -108,7 +110,7 @@ async function analyze(entry, mastraEntry, isVirtualFile, platform, logger) {
|
|
|
108
110
|
entry = "#entry";
|
|
109
111
|
}
|
|
110
112
|
const optimizerBundler = await rollup({
|
|
111
|
-
logLevel: "silent",
|
|
113
|
+
logLevel: process.env.MASTRA_BUNDLER_DEBUG === "true" ? "debug" : "silent",
|
|
112
114
|
input: isVirtualFile ? "#entry" : entry,
|
|
113
115
|
treeshake: true,
|
|
114
116
|
preserveSymlinks: true,
|
|
@@ -150,7 +152,6 @@ async function analyze(entry, mastraEntry, isVirtualFile, platform, logger) {
|
|
|
150
152
|
depsToOptimize.delete(dep);
|
|
151
153
|
}
|
|
152
154
|
}
|
|
153
|
-
depsToOptimize.set("@hono/node-server", ["serve"]);
|
|
154
155
|
return depsToOptimize;
|
|
155
156
|
}
|
|
156
157
|
async function bundleExternals(depsToOptimize, outputDir, logger) {
|
|
@@ -169,7 +170,7 @@ async function bundleExternals(depsToOptimize, outputDir, logger) {
|
|
|
169
170
|
});
|
|
170
171
|
}
|
|
171
172
|
const bundler = await rollup({
|
|
172
|
-
logLevel: "silent",
|
|
173
|
+
logLevel: process.env.MASTRA_BUNDLER_DEBUG === "true" ? "debug" : "silent",
|
|
173
174
|
input: Array.from(virtualDependencies.entries()).reduce(
|
|
174
175
|
(acc, [dep, virtualDep]) => {
|
|
175
176
|
acc[virtualDep.name] = `#virtual-${dep}`;
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { FileService } from './chunk-
|
|
2
|
-
export { FileService, getBundler, getWatcher } from './chunk-
|
|
3
|
-
import { Bundler } from './chunk-
|
|
1
|
+
import { FileService } from './chunk-JG3X44WH.js';
|
|
2
|
+
export { FileService, getBundler, getWatcher } from './chunk-JG3X44WH.js';
|
|
3
|
+
import { Bundler } from './chunk-EDV35Q7R.js';
|
|
4
4
|
import { Deps } from './chunk-Q3WKR6OZ.js';
|
|
5
5
|
export { Deps, createChildProcessLogger, createPinoStream } from './chunk-Q3WKR6OZ.js';
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
6
|
+
import './chunk-WXH2HMQ2.js';
|
|
7
|
+
import './chunk-RCYKCEGL.js';
|
|
8
8
|
import './chunk-YNXJO2XU.js';
|
|
9
9
|
import '@mastra/core/deployer';
|
|
10
10
|
import * as babel from '@babel/core';
|
package/package.json
CHANGED
package/src/build/analyze.ts
CHANGED
|
@@ -41,7 +41,7 @@ async function analyze(
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
const optimizerBundler = await rollup({
|
|
44
|
-
logLevel: 'silent',
|
|
44
|
+
logLevel: process.env.MASTRA_BUNDLER_DEBUG === 'true' ? 'debug' : 'silent',
|
|
45
45
|
input: isVirtualFile ? '#entry' : entry,
|
|
46
46
|
treeshake: true,
|
|
47
47
|
preserveSymlinks: true,
|
|
@@ -87,8 +87,6 @@ async function analyze(
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
// todo fix, coulds should add it itself but somehow doesnt
|
|
91
|
-
depsToOptimize.set('@hono/node-server', ['serve']);
|
|
92
90
|
return depsToOptimize;
|
|
93
91
|
}
|
|
94
92
|
|
|
@@ -121,7 +119,7 @@ async function bundleExternals(depsToOptimize: Map<string, string[]>, outputDir:
|
|
|
121
119
|
}
|
|
122
120
|
|
|
123
121
|
const bundler = await rollup({
|
|
124
|
-
logLevel: 'silent',
|
|
122
|
+
logLevel: process.env.MASTRA_BUNDLER_DEBUG === 'true' ? 'debug' : 'silent',
|
|
125
123
|
input: Array.from(virtualDependencies.entries()).reduce(
|
|
126
124
|
(acc, [dep, virtualDep]) => {
|
|
127
125
|
acc[virtualDep.name] = `#virtual-${dep}`;
|
package/src/build/bundler.ts
CHANGED
|
@@ -30,7 +30,7 @@ export async function getInputOptions(
|
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
return {
|
|
33
|
-
logLevel: 'silent',
|
|
33
|
+
logLevel: process.env.MASTRA_BUNDLER_DEBUG === 'true' ? 'debug' : 'silent',
|
|
34
34
|
treeshake: true,
|
|
35
35
|
preserveSymlinks: true,
|
|
36
36
|
external: Array.from(analyzedBundleInfo.externalDependencies),
|
|
@@ -32,23 +32,25 @@ export function pino() {
|
|
|
32
32
|
// resolve pino first
|
|
33
33
|
const resolvedPino = await this.resolve(id, importee);
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
if (resolvedPino) {
|
|
36
|
+
await Promise.all(
|
|
37
|
+
workerFiles.map(async file => {
|
|
38
|
+
const resolvedEntry = await this.resolve(file.id, resolvedPino.id);
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
if (!resolvedEntry) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
const reference = this.emitFile({
|
|
45
|
+
type: 'chunk',
|
|
46
|
+
id: resolvedEntry.id,
|
|
47
|
+
name: `${file.file}`,
|
|
48
|
+
});
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
fileReferences.set(file.id, reference);
|
|
51
|
+
}),
|
|
52
|
+
);
|
|
53
|
+
}
|
|
52
54
|
}
|
|
53
55
|
},
|
|
54
56
|
renderChunk(code, chunk) {
|