@mastra/deployer 0.2.6-alpha.9 → 0.2.7-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.
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunkNWERLYTR_cjs = require('../chunk-NWERLYTR.cjs');
3
+ var chunkP5SATU7G_cjs = require('../chunk-P5SATU7G.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "analyzeBundle", {
8
8
  enumerable: true,
9
- get: function () { return chunkNWERLYTR_cjs.analyzeBundle; }
9
+ get: function () { return chunkP5SATU7G_cjs.analyzeBundle; }
10
10
  });
@@ -1 +1 @@
1
- export { analyzeBundle } from '../chunk-UTZ3434D.js';
1
+ export { analyzeBundle } from '../chunk-BDTZS3JM.js';
@@ -1,33 +1,41 @@
1
1
  'use strict';
2
2
 
3
- var chunkUV237CUO_cjs = require('../chunk-UV237CUO.cjs');
3
+ var chunkI3UVE6EH_cjs = require('../chunk-I3UVE6EH.cjs');
4
4
  var chunk2ZPQX6BX_cjs = require('../chunk-2ZPQX6BX.cjs');
5
- var chunkNWERLYTR_cjs = require('../chunk-NWERLYTR.cjs');
6
- var chunkAE4CVAPK_cjs = require('../chunk-AE4CVAPK.cjs');
7
5
  var chunkNCROGJGB_cjs = require('../chunk-NCROGJGB.cjs');
8
6
  var chunkVFZVVUQE_cjs = require('../chunk-VFZVVUQE.cjs');
7
+ var chunkP5SATU7G_cjs = require('../chunk-P5SATU7G.cjs');
8
+ var chunkAE4CVAPK_cjs = require('../chunk-AE4CVAPK.cjs');
9
9
 
10
10
 
11
11
 
12
12
  Object.defineProperty(exports, "createWatcher", {
13
13
  enumerable: true,
14
- get: function () { return chunkUV237CUO_cjs.createWatcher; }
14
+ get: function () { return chunkI3UVE6EH_cjs.createWatcher; }
15
15
  });
16
16
  Object.defineProperty(exports, "getServerOptions", {
17
17
  enumerable: true,
18
- get: function () { return chunkUV237CUO_cjs.getServerOptions; }
18
+ get: function () { return chunkI3UVE6EH_cjs.getServerOptions; }
19
19
  });
20
20
  Object.defineProperty(exports, "getWatcherInputOptions", {
21
21
  enumerable: true,
22
- get: function () { return chunkUV237CUO_cjs.getInputOptions; }
22
+ get: function () { return chunkI3UVE6EH_cjs.getInputOptions; }
23
23
  });
24
24
  Object.defineProperty(exports, "writeTelemetryConfig", {
25
25
  enumerable: true,
26
26
  get: function () { return chunk2ZPQX6BX_cjs.writeTelemetryConfig; }
27
27
  });
28
+ Object.defineProperty(exports, "FileService", {
29
+ enumerable: true,
30
+ get: function () { return chunkNCROGJGB_cjs.FileService; }
31
+ });
32
+ Object.defineProperty(exports, "Deps", {
33
+ enumerable: true,
34
+ get: function () { return chunkVFZVVUQE_cjs.Deps; }
35
+ });
28
36
  Object.defineProperty(exports, "analyzeBundle", {
29
37
  enumerable: true,
30
- get: function () { return chunkNWERLYTR_cjs.analyzeBundle; }
38
+ get: function () { return chunkP5SATU7G_cjs.analyzeBundle; }
31
39
  });
32
40
  Object.defineProperty(exports, "createBundler", {
33
41
  enumerable: true,
@@ -37,11 +45,3 @@ Object.defineProperty(exports, "getBundlerInputOptions", {
37
45
  enumerable: true,
38
46
  get: function () { return chunkAE4CVAPK_cjs.getInputOptions; }
39
47
  });
40
- Object.defineProperty(exports, "FileService", {
41
- enumerable: true,
42
- get: function () { return chunkNCROGJGB_cjs.FileService; }
43
- });
44
- Object.defineProperty(exports, "Deps", {
45
- enumerable: true,
46
- get: function () { return chunkVFZVVUQE_cjs.Deps; }
47
- });
@@ -1,6 +1,6 @@
1
- export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-VNNMBMKJ.js';
1
+ export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-WB3T6NKI.js';
2
2
  export { writeTelemetryConfig } from '../chunk-4AYFLP6G.js';
3
- export { analyzeBundle } from '../chunk-UTZ3434D.js';
4
- export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-IKPL4RGG.js';
5
3
  export { FileService } from '../chunk-DYQ225MJ.js';
6
4
  export { Deps } from '../chunk-5UBGPRKT.js';
5
+ export { analyzeBundle } from '../chunk-BDTZS3JM.js';
6
+ export { createBundler, getInputOptions as getBundlerInputOptions } from '../chunk-IKPL4RGG.js';
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunkXBEPXRKN_cjs = require('../chunk-XBEPXRKN.cjs');
3
+ var chunkO5NUMKUF_cjs = require('../chunk-O5NUMKUF.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "Bundler", {
8
8
  enumerable: true,
9
- get: function () { return chunkXBEPXRKN_cjs.Bundler; }
9
+ get: function () { return chunkO5NUMKUF_cjs.Bundler; }
10
10
  });
@@ -1 +1 @@
1
- export { Bundler } from '../chunk-SQP5ULJ5.js';
1
+ export { Bundler } from '../chunk-VGDSNRYG.js';
@@ -115,6 +115,9 @@ async function analyze(entry, mastraEntry, isVirtualFile, platform, logger) {
115
115
  if (id === "#mastra") {
116
116
  return normalizedMastraEntry;
117
117
  }
118
+ if (id.startsWith("@mastra/server")) {
119
+ return fileURLToPath(import.meta.resolve(id));
120
+ }
118
121
  }
119
122
  },
120
123
  json(),
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunk2ZPQX6BX_cjs = require('./chunk-2ZPQX6BX.cjs');
4
- var chunkNWERLYTR_cjs = require('./chunk-NWERLYTR.cjs');
4
+ var chunkP5SATU7G_cjs = require('./chunk-P5SATU7G.cjs');
5
5
  var chunkAE4CVAPK_cjs = require('./chunk-AE4CVAPK.cjs');
6
6
  var rollup = require('rollup');
7
7
  var babel = require('@babel/core');
@@ -47,7 +47,7 @@ async function getInputOptions2(entryFile, platform) {
47
47
  // @ts-ignore
48
48
  (plugin) => !plugin || !plugin?.name || plugin.name !== "node-resolve"
49
49
  );
50
- inputOptions.plugins.push(chunkNWERLYTR_cjs.aliasHono());
50
+ inputOptions.plugins.push(chunkP5SATU7G_cjs.aliasHono());
51
51
  }
52
52
  return inputOptions;
53
53
  }
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var chunk2ZPQX6BX_cjs = require('./chunk-2ZPQX6BX.cjs');
4
- var chunkNWERLYTR_cjs = require('./chunk-NWERLYTR.cjs');
5
- var chunkAE4CVAPK_cjs = require('./chunk-AE4CVAPK.cjs');
6
4
  var chunkVFZVVUQE_cjs = require('./chunk-VFZVVUQE.cjs');
5
+ var chunkP5SATU7G_cjs = require('./chunk-P5SATU7G.cjs');
6
+ var chunkAE4CVAPK_cjs = require('./chunk-AE4CVAPK.cjs');
7
7
  var fs = require('fs');
8
8
  var promises = require('fs/promises');
9
9
  var path = require('path');
@@ -32,7 +32,7 @@ var Bundler = class extends bundler.MastraBundler {
32
32
  }
33
33
  async writeInstrumentationFile(outputDirectory) {
34
34
  const instrumentationFile = path.join(outputDirectory, "instrumentation.mjs");
35
- 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-XBEPXRKN.cjs', document.baseURI).href))));
35
+ 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-O5NUMKUF.cjs', document.baseURI).href))));
36
36
  await esm.copy(path.join(__dirname, "templates", "instrumentation-template.js"), instrumentationFile);
37
37
  }
38
38
  async writePackageJson(outputDirectory, dependencies) {
@@ -74,7 +74,7 @@ var Bundler = class extends bundler.MastraBundler {
74
74
  return chunkAE4CVAPK_cjs.createBundler(inputOptions, outputOptions);
75
75
  }
76
76
  async analyze(entry, mastraFile, outputDirectory) {
77
- return await chunkNWERLYTR_cjs.analyzeBundle(entry, mastraFile, path.join(outputDirectory, this.analyzeOutputDir), "node", this.logger);
77
+ return await chunkP5SATU7G_cjs.analyzeBundle(entry, mastraFile, path.join(outputDirectory, this.analyzeOutputDir), "node", this.logger);
78
78
  }
79
79
  async installDependencies(outputDirectory, rootDir = process.cwd()) {
80
80
  const deps = new chunkVFZVVUQE_cjs.DepsService(rootDir);
@@ -107,7 +107,7 @@ var Bundler = class extends bundler.MastraBundler {
107
107
  }
108
108
  async _bundle(serverFile, mastraEntryFile, outputDirectory, bundleLocation = path.join(outputDirectory, this.outputDir)) {
109
109
  this.logger.info("Start bundling Mastra");
110
- const analyzedBundleInfo = await chunkNWERLYTR_cjs.analyzeBundle(
110
+ const analyzedBundleInfo = await chunkP5SATU7G_cjs.analyzeBundle(
111
111
  serverFile,
112
112
  mastraEntryFile,
113
113
  path.join(outputDirectory, this.analyzeOutputDir),
@@ -125,6 +125,9 @@ async function analyze(entry, mastraEntry, isVirtualFile, platform, logger) {
125
125
  if (id === "#mastra") {
126
126
  return normalizedMastraEntry;
127
127
  }
128
+ if (id.startsWith("@mastra/server")) {
129
+ return url.fileURLToPath(undefined(id));
130
+ }
128
131
  }
129
132
  },
130
133
  json__default.default(),
@@ -1,7 +1,7 @@
1
1
  import { writeTelemetryConfig } from './chunk-4AYFLP6G.js';
2
- import { analyzeBundle } from './chunk-UTZ3434D.js';
3
- import { createBundler, getInputOptions } from './chunk-IKPL4RGG.js';
4
2
  import { DepsService } from './chunk-5UBGPRKT.js';
3
+ import { analyzeBundle } from './chunk-BDTZS3JM.js';
4
+ import { createBundler, getInputOptions } from './chunk-IKPL4RGG.js';
5
5
  import { existsSync } from 'node:fs';
6
6
  import { writeFile, stat } from 'node:fs/promises';
7
7
  import { join, dirname } from 'node:path';
@@ -1,5 +1,5 @@
1
1
  import { recursiveRemoveNonReferencedNodes, removeAllOptionsFromMastraExcept } from './chunk-4AYFLP6G.js';
2
- import { aliasHono } from './chunk-UTZ3434D.js';
2
+ import { aliasHono } from './chunk-BDTZS3JM.js';
3
3
  import { getInputOptions } from './chunk-IKPL4RGG.js';
4
4
  import { watch, rollup } from 'rollup';
5
5
  import * as babel from '@babel/core';
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkXBEPXRKN_cjs = require('./chunk-XBEPXRKN.cjs');
3
+ var chunkO5NUMKUF_cjs = require('./chunk-O5NUMKUF.cjs');
4
4
  var chunk2ZPQX6BX_cjs = require('./chunk-2ZPQX6BX.cjs');
5
5
  var chunkNCROGJGB_cjs = require('./chunk-NCROGJGB.cjs');
6
6
  var chunkVFZVVUQE_cjs = require('./chunk-VFZVVUQE.cjs');
@@ -34,7 +34,7 @@ var esbuild__default = /*#__PURE__*/_interopDefault(esbuild);
34
34
  var commonjs__default = /*#__PURE__*/_interopDefault(commonjs);
35
35
 
36
36
  // src/deploy/base.ts
37
- var Deployer = class extends chunkXBEPXRKN_cjs.Bundler {
37
+ var Deployer = class extends chunkO5NUMKUF_cjs.Bundler {
38
38
  deps = new chunkVFZVVUQE_cjs.DepsService();
39
39
  constructor(args) {
40
40
  super(args.name, "DEPLOYER");
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Bundler } from './chunk-SQP5ULJ5.js';
1
+ import { Bundler } from './chunk-VGDSNRYG.js';
2
2
  import { recursiveRemoveNonReferencedNodes } from './chunk-4AYFLP6G.js';
3
3
  import { FileService } from './chunk-DYQ225MJ.js';
4
4
  export { FileService } from './chunk-DYQ225MJ.js';
@@ -1840,18 +1840,6 @@ async function createHonoServer(mastra, options = {}) {
1840
1840
  });
1841
1841
  return acc;
1842
1842
  }, {});
1843
- app.use(
1844
- "*",
1845
- timeout.timeout(server?.timeout ?? 1e3 * 30),
1846
- cors.cors({
1847
- origin: "*",
1848
- allowMethods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
1849
- allowHeaders: ["Content-Type", "Authorization", "x-mastra-client-type"],
1850
- exposeHeaders: ["Content-Length", "X-Requested-With"],
1851
- credentials: false,
1852
- maxAge: 3600
1853
- })
1854
- );
1855
1843
  if (options.apiReqLogs) {
1856
1844
  app.use(logger.logger());
1857
1845
  }
@@ -1862,6 +1850,19 @@ async function createHonoServer(mastra, options = {}) {
1862
1850
  app.use(m2.path, m2.handler);
1863
1851
  }
1864
1852
  }
1853
+ if (server?.cors === false) {
1854
+ app.use("*", timeout.timeout(server?.timeout ?? 1e3 * 30));
1855
+ } else {
1856
+ const corsConfig = {
1857
+ origin: server?.cors?.origin ?? "*",
1858
+ allowMethods: server?.cors?.allowMethods ?? ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
1859
+ credentials: server?.cors?.credentials ?? false,
1860
+ maxAge: server?.cors?.maxAge ?? 3600,
1861
+ allowHeaders: ["Content-Type", "Authorization", "x-mastra-client-type", ...server?.cors?.allowHeaders ?? []],
1862
+ exposeHeaders: ["Content-Length", "X-Requested-With", ...server?.cors?.exposeHeaders ?? []]
1863
+ };
1864
+ app.use("*", timeout.timeout(server?.timeout ?? 1e3 * 30), cors.cors(corsConfig));
1865
+ }
1865
1866
  app.use("*", async (c2, next) => {
1866
1867
  c2.set("mastra", mastra);
1867
1868
  c2.set("tools", tools);
@@ -1834,18 +1834,6 @@ async function createHonoServer(mastra, options = {}) {
1834
1834
  });
1835
1835
  return acc;
1836
1836
  }, {});
1837
- app.use(
1838
- "*",
1839
- timeout(server?.timeout ?? 1e3 * 30),
1840
- cors({
1841
- origin: "*",
1842
- allowMethods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
1843
- allowHeaders: ["Content-Type", "Authorization", "x-mastra-client-type"],
1844
- exposeHeaders: ["Content-Length", "X-Requested-With"],
1845
- credentials: false,
1846
- maxAge: 3600
1847
- })
1848
- );
1849
1837
  if (options.apiReqLogs) {
1850
1838
  app.use(logger());
1851
1839
  }
@@ -1856,6 +1844,19 @@ async function createHonoServer(mastra, options = {}) {
1856
1844
  app.use(m2.path, m2.handler);
1857
1845
  }
1858
1846
  }
1847
+ if (server?.cors === false) {
1848
+ app.use("*", timeout(server?.timeout ?? 1e3 * 30));
1849
+ } else {
1850
+ const corsConfig = {
1851
+ origin: server?.cors?.origin ?? "*",
1852
+ allowMethods: server?.cors?.allowMethods ?? ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
1853
+ credentials: server?.cors?.credentials ?? false,
1854
+ maxAge: server?.cors?.maxAge ?? 3600,
1855
+ allowHeaders: ["Content-Type", "Authorization", "x-mastra-client-type", ...server?.cors?.allowHeaders ?? []],
1856
+ exposeHeaders: ["Content-Length", "X-Requested-With", ...server?.cors?.exposeHeaders ?? []]
1857
+ };
1858
+ app.use("*", timeout(server?.timeout ?? 1e3 * 30), cors(corsConfig));
1859
+ }
1859
1860
  app.use("*", async (c2, next) => {
1860
1861
  c2.set("mastra", mastra);
1861
1862
  c2.set("tools", tools);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/deployer",
3
- "version": "0.2.6-alpha.9",
3
+ "version": "0.2.7-alpha.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "files": [
@@ -105,8 +105,8 @@
105
105
  "rollup-plugin-node-externals": "^8.0.0",
106
106
  "typescript-paths": "^1.5.1",
107
107
  "zod": "^3.24.2",
108
- "@mastra/core": "^0.8.0-alpha.7",
109
- "@mastra/server": "^0.0.1-alpha.5"
108
+ "@mastra/core": "^0.8.1-alpha.0",
109
+ "@mastra/server": "^1.0.1-alpha.0"
110
110
  },
111
111
  "devDependencies": {
112
112
  "@hono/node-server": "^1.13.8",