@mastra/deployer 0.2.6 → 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.
@@ -2,10 +2,10 @@
2
2
 
3
3
  var chunkI3UVE6EH_cjs = require('../chunk-I3UVE6EH.cjs');
4
4
  var chunk2ZPQX6BX_cjs = require('../chunk-2ZPQX6BX.cjs');
5
- var chunkP5SATU7G_cjs = require('../chunk-P5SATU7G.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
 
@@ -25,6 +25,14 @@ 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
38
  get: function () { return chunkP5SATU7G_cjs.analyzeBundle; }
@@ -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
1
  export { createWatcher, getServerOptions, getInputOptions as getWatcherInputOptions } from '../chunk-WB3T6NKI.js';
2
2
  export { writeTelemetryConfig } from '../chunk-4AYFLP6G.js';
3
- export { analyzeBundle } from '../chunk-BDTZS3JM.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 chunkWFC3CUZ3_cjs = require('../chunk-WFC3CUZ3.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 chunkWFC3CUZ3_cjs.Bundler; }
9
+ get: function () { return chunkO5NUMKUF_cjs.Bundler; }
10
10
  });
@@ -1 +1 @@
1
- export { Bundler } from '../chunk-74KZVNKH.js';
1
+ export { Bundler } from '../chunk-VGDSNRYG.js';
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var chunk2ZPQX6BX_cjs = require('./chunk-2ZPQX6BX.cjs');
4
+ var chunkVFZVVUQE_cjs = require('./chunk-VFZVVUQE.cjs');
4
5
  var chunkP5SATU7G_cjs = require('./chunk-P5SATU7G.cjs');
5
6
  var chunkAE4CVAPK_cjs = require('./chunk-AE4CVAPK.cjs');
6
- var chunkVFZVVUQE_cjs = require('./chunk-VFZVVUQE.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-WFC3CUZ3.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) {
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkWFC3CUZ3_cjs = require('./chunk-WFC3CUZ3.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 chunkWFC3CUZ3_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-74KZVNKH.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",
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/server": "^1.0.0",
109
- "@mastra/core": "^0.8.0"
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",
@@ -1,7 +1,7 @@
1
1
  import { writeTelemetryConfig } from './chunk-4AYFLP6G.js';
2
+ import { DepsService } from './chunk-5UBGPRKT.js';
2
3
  import { analyzeBundle } from './chunk-BDTZS3JM.js';
3
4
  import { createBundler, getInputOptions } from './chunk-IKPL4RGG.js';
4
- import { DepsService } from './chunk-5UBGPRKT.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';