@mastra/deployer 1.61.0 → 1.62.0-alpha.12

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 (37) hide show
  1. package/CHANGELOG.md +108 -0
  2. package/dist/_types/@mastra_hono/dist/index.d.ts +1 -0
  3. package/dist/{analyze-CMkpXdKQ.cjs → analyze-IM-jyN5x.cjs} +2 -2
  4. package/dist/{analyze-CMkpXdKQ.cjs.map → analyze-IM-jyN5x.cjs.map} +1 -1
  5. package/dist/{analyze-BoU8nN8Q.js → analyze-z37DoML5.js} +2 -2
  6. package/dist/{analyze-BoU8nN8Q.js.map → analyze-z37DoML5.js.map} +1 -1
  7. package/dist/build/analyze.cjs +1 -1
  8. package/dist/build/analyze.js +1 -1
  9. package/dist/build/index.cjs +3 -3
  10. package/dist/build/index.js +3 -3
  11. package/dist/{build-D1AcigJC.cjs → build-BWiNAkNf.cjs} +3 -3
  12. package/dist/{build-D1AcigJC.cjs.map → build-BWiNAkNf.cjs.map} +1 -1
  13. package/dist/{build-DyfOm0B6.js → build-DlFYW3J7.js} +3 -3
  14. package/dist/{build-DyfOm0B6.js.map → build-DlFYW3J7.js.map} +1 -1
  15. package/dist/bundler/index.cjs +2 -2
  16. package/dist/bundler/index.js +2 -2
  17. package/dist/deploy/base.d.ts.map +1 -1
  18. package/dist/docs/SKILL.md +1 -1
  19. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  20. package/dist/docs/references/docs-deployment-mastra-server.md +19 -0
  21. package/dist/index.cjs +6 -11
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.js +6 -11
  24. package/dist/index.js.map +1 -1
  25. package/dist/server/index.cjs +13 -0
  26. package/dist/server/index.cjs.map +1 -1
  27. package/dist/server/index.js +13 -0
  28. package/dist/server/index.js.map +1 -1
  29. package/dist/services/fs.d.ts +6 -0
  30. package/dist/services/fs.d.ts.map +1 -1
  31. package/dist/services/index.cjs +1 -1
  32. package/dist/services/index.js +1 -1
  33. package/dist/{services-DWdPwTiP.js → services-B9KRKBT-.js} +9 -1
  34. package/dist/{services-DWdPwTiP.js.map → services-B9KRKBT-.js.map} +1 -1
  35. package/dist/{services-DrT0fgoG.cjs → services-BLvNG7v7.cjs} +9 -1
  36. package/dist/{services-DrT0fgoG.cjs.map → services-BLvNG7v7.cjs.map} +1 -1
  37. package/package.json +7 -7
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/deploy/base.ts","../src/build/deployer.ts"],"sourcesContent":["import type { IDeployer } from '@mastra/core/deployer';\n\nimport { Bundler } from '../bundler';\nimport { DepsService } from '../services/deps.js';\nimport { FileService } from '../services/fs.js';\n\nexport abstract class Deployer extends Bundler implements IDeployer {\n deps: DepsService = new DepsService();\n\n constructor(args: { name: string }) {\n super(args.name, 'DEPLOYER');\n\n this.deps.__setLogger(this.logger);\n }\n\n getEnvFiles(): Promise<string[]> {\n const possibleFiles = ['.env.production', '.env.local', '.env'];\n\n try {\n const fileService = new FileService();\n const envFile = fileService.getFirstExistingFile(possibleFiles);\n\n return Promise.resolve([envFile]);\n } catch {}\n\n return Promise.resolve([]);\n }\n\n abstract deploy(outputDirectory: string): Promise<void>;\n}\n","import type { IMastraLogger } from '@mastra/core/logger';\nimport type { Config } from '@mastra/core/mastra';\nimport { extractMastraOption, extractMastraOptionBundler } from './shared/extract-mastra-option';\n\nexport function getDeployerBundler(\n entryFile: string,\n result: {\n hasCustomConfig: false;\n },\n) {\n return extractMastraOptionBundler('deployer', entryFile, result);\n}\n\nexport async function getDeployer(\n entryFile: string,\n outputDir: string,\n logger?: IMastraLogger,\n): Promise<Config['deployer'] | null> {\n const result = await extractMastraOption('deployer', entryFile, outputDir, logger);\n if (!result) {\n return null;\n }\n\n return result.getConfig();\n}\n"],"mappings":";;;;;AAMA,IAAsB,WAAtB,cAAuC,QAA6B;CAClE,OAAoB,IAAI,YAAY;CAEpC,YAAY,MAAwB;EAClC,MAAM,KAAK,MAAM,UAAU;EAE3B,KAAK,KAAK,YAAY,KAAK,MAAM;CACnC;CAEA,cAAiC;EAC/B,MAAM,gBAAgB;GAAC;GAAmB;GAAc;EAAM;EAE9D,IAAI;GAEF,MAAM,UAAU,IADQ,YACE,CAAC,CAAC,qBAAqB,aAAa;GAE9D,OAAO,QAAQ,QAAQ,CAAC,OAAO,CAAC;EAClC,QAAQ,CAAC;EAET,OAAO,QAAQ,QAAQ,CAAC,CAAC;CAC3B;AAGF;;;AChBA,eAAsB,YACpB,WACA,WACA,QACoC;CACpC,MAAM,SAAS,MAAM,oBAAoB,YAAY,WAAW,WAAW,MAAM;CACjF,IAAI,CAAC,QACH,OAAO;CAGT,OAAO,OAAO,UAAU;AAC1B"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/deploy/base.ts","../src/build/deployer.ts"],"sourcesContent":["import type { IDeployer } from '@mastra/core/deployer';\n\nimport { Bundler } from '../bundler';\nimport { DepsService } from '../services/deps.js';\nimport { FileService } from '../services/fs.js';\n\nexport abstract class Deployer extends Bundler implements IDeployer {\n deps: DepsService = new DepsService();\n\n constructor(args: { name: string }) {\n super(args.name, 'DEPLOYER');\n\n this.deps.__setLogger(this.logger);\n }\n\n getEnvFiles(): Promise<string[]> {\n return Promise.resolve(new FileService().getExistingFiles(['.env', '.env.local', '.env.production']));\n }\n\n abstract deploy(outputDirectory: string): Promise<void>;\n}\n","import type { IMastraLogger } from '@mastra/core/logger';\nimport type { Config } from '@mastra/core/mastra';\nimport { extractMastraOption, extractMastraOptionBundler } from './shared/extract-mastra-option';\n\nexport function getDeployerBundler(\n entryFile: string,\n result: {\n hasCustomConfig: false;\n },\n) {\n return extractMastraOptionBundler('deployer', entryFile, result);\n}\n\nexport async function getDeployer(\n entryFile: string,\n outputDir: string,\n logger?: IMastraLogger,\n): Promise<Config['deployer'] | null> {\n const result = await extractMastraOption('deployer', entryFile, outputDir, logger);\n if (!result) {\n return null;\n }\n\n return result.getConfig();\n}\n"],"mappings":";;;;;AAMA,IAAsB,WAAtB,cAAuC,QAA6B;CAClE,OAAoB,IAAI,YAAY;CAEpC,YAAY,MAAwB;EAClC,MAAM,KAAK,MAAM,UAAU;EAE3B,KAAK,KAAK,YAAY,KAAK,MAAM;CACnC;CAEA,cAAiC;EAC/B,OAAO,QAAQ,QAAQ,IAAI,YAAY,CAAC,CAAC,iBAAiB;GAAC;GAAQ;GAAc;EAAiB,CAAC,CAAC;CACtG;AAGF;;;ACPA,eAAsB,YACpB,WACA,WACA,QACoC;CACpC,MAAM,SAAS,MAAM,oBAAoB,YAAY,WAAW,WAAW,MAAM;CACjF,IAAI,CAAC,QACH,OAAO;CAGT,OAAO,OAAO,UAAU;AAC1B"}
@@ -3658,6 +3658,19 @@ var MastraServer = class extends _mastra_server_server_adapter.MastraServer {
3658
3658
  });
3659
3659
  }
3660
3660
  registerAuthMiddleware() {}
3661
+ registerUserMiddleware() {
3662
+ for (const m of this.mastra.getServerMiddleware?.() ?? []) this.app.use(m.path, skipIfFrameworkPublic(m.handler));
3663
+ const configMiddleware = this.mastra.getServer()?.middleware;
3664
+ if (!configMiddleware) return;
3665
+ const normalizedMiddlewares = Array.isArray(configMiddleware) ? configMiddleware : [configMiddleware];
3666
+ for (const middleware of normalizedMiddlewares) {
3667
+ const { path, handler } = typeof middleware === "function" ? {
3668
+ path: "*",
3669
+ handler: middleware
3670
+ } : middleware;
3671
+ this.app.use(path, skipIfFrameworkPublic(handler));
3672
+ }
3673
+ }
3661
3674
  registerHttpLoggingMiddleware() {
3662
3675
  if (!this.httpLoggingConfig?.enabled) return;
3663
3676
  this.app.use("*", async (c, next) => {