mastra 0.2.0-alpha.138 → 0.2.0-alpha.140

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -6
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -183,13 +183,14 @@ var DevBundler = class extends MastraBundler {
183
183
  fileURLToPath(import.meta.url);
184
184
  var currentServerProcess;
185
185
  var isRestarting = false;
186
- var startServer = async (dotMastraPath, port) => {
186
+ var startServer = async (dotMastraPath, port, env) => {
187
187
  try {
188
188
  logger.info("[Mastra Dev] - Starting server...");
189
189
  currentServerProcess = execa("node", ["index.mjs"], {
190
190
  cwd: dotMastraPath,
191
191
  env: {
192
- PORT: port.toString() || "4111"
192
+ PORT: port.toString() || "4111",
193
+ ...Object.fromEntries(env)
193
194
  },
194
195
  stdio: "inherit",
195
196
  reject: false
@@ -230,7 +231,7 @@ var startServer = async (dotMastraPath, port) => {
230
231
  if (execaError.stdout) logger.debug("Server output:", { stdout: execaError.stdout });
231
232
  }
232
233
  };
233
- async function rebundleAndRestart(dotMastraPath, port) {
234
+ async function rebundleAndRestart(dotMastraPath, port, bundler) {
234
235
  if (isRestarting) {
235
236
  return;
236
237
  }
@@ -241,7 +242,8 @@ async function rebundleAndRestart(dotMastraPath, port) {
241
242
  currentServerProcess.kill();
242
243
  await new Promise((resolve) => setTimeout(resolve, 1e3));
243
244
  }
244
- await startServer(dotMastraPath, port);
245
+ const env = await bundler.loadEnvVars();
246
+ await startServer(dotMastraPath, port, env);
245
247
  } finally {
246
248
  isRestarting = false;
247
249
  }
@@ -251,14 +253,15 @@ async function dev({ port, dir, root }) {
251
253
  join$1(rootDir, dir || "src/mastra");
252
254
  const dotMastraPath = join$1(rootDir, ".mastra");
253
255
  const bundler = new DevBundler();
256
+ const env = await bundler.loadEnvVars();
254
257
  await bundler.prepare(dotMastraPath);
255
258
  writeFileSync(join$1(dotMastraPath, "evals.json"), ``);
256
259
  const watcher = await bundler.watch(dotMastraPath);
257
- await startServer(dotMastraPath, port);
260
+ await startServer(dotMastraPath, port, env);
258
261
  watcher.on("event", (event) => {
259
262
  if (event.code === "BUNDLE_END") {
260
263
  logger.info("[Mastra Dev] - Bundling finished, restarting server...");
261
- rebundleAndRestart(dotMastraPath, port);
264
+ rebundleAndRestart(dotMastraPath, port, bundler);
262
265
  }
263
266
  });
264
267
  process.on("SIGINT", () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mastra",
3
- "version": "0.2.0-alpha.138",
3
+ "version": "0.2.0-alpha.140",
4
4
  "license": "MIT",
5
5
  "description": "cli for mastra",
6
6
  "type": "module",
@@ -56,8 +56,8 @@
56
56
  "yocto-spinner": "^0.1.1",
57
57
  "zod": "^3.24.1",
58
58
  "zod-to-json-schema": "^3.24.1",
59
- "@mastra/core": "^0.2.0-alpha.86",
60
- "@mastra/deployer": "^0.1.0-alpha.32"
59
+ "@mastra/deployer": "^0.1.0-alpha.33",
60
+ "@mastra/core": "^0.2.0-alpha.87"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/express": "^5.0.0",