@mastra/deployer 1.13.3-alpha.0 → 1.14.0-alpha.2
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 +24 -0
- package/dist/build/analyze.cjs +2 -2
- package/dist/build/analyze.js +1 -1
- package/dist/build/bundler.cjs +3 -3
- package/dist/build/bundler.js +1 -1
- package/dist/build/index.cjs +15 -15
- package/dist/build/index.js +5 -5
- package/dist/build/utils.d.ts +2 -0
- package/dist/build/utils.d.ts.map +1 -1
- package/dist/bundler/index.cjs +3 -3
- package/dist/bundler/index.js +1 -1
- package/dist/{chunk-HXQ27JQX.js → chunk-4OVBCW4T.js} +3 -3
- package/dist/{chunk-HXQ27JQX.js.map → chunk-4OVBCW4T.js.map} +1 -1
- package/dist/{chunk-IY4RBV63.js → chunk-CKCUMDQY.js} +4 -4
- package/dist/{chunk-IY4RBV63.js.map → chunk-CKCUMDQY.js.map} +1 -1
- package/dist/{chunk-YKTV7TY3.cjs → chunk-FMHCK2VO.cjs} +41 -41
- package/dist/{chunk-YKTV7TY3.cjs.map → chunk-FMHCK2VO.cjs.map} +1 -1
- package/dist/{chunk-MPZSAF6V.js → chunk-GMDZEJJ4.js} +3 -3
- package/dist/{chunk-MPZSAF6V.js.map → chunk-GMDZEJJ4.js.map} +1 -1
- package/dist/{chunk-GSO2J4MT.js → chunk-H57LFQ6F.js} +4 -4
- package/dist/{chunk-GSO2J4MT.js.map → chunk-H57LFQ6F.js.map} +1 -1
- package/dist/{chunk-PM35TGRT.cjs → chunk-HA2RK6ES.cjs} +16 -16
- package/dist/{chunk-PM35TGRT.cjs.map → chunk-HA2RK6ES.cjs.map} +1 -1
- package/dist/{chunk-37PC7CXR.cjs → chunk-HRFQEG5Y.cjs} +16 -16
- package/dist/{chunk-37PC7CXR.cjs.map → chunk-HRFQEG5Y.cjs.map} +1 -1
- package/dist/{chunk-GRC4HK7K.js → chunk-J2HRFC3X.js} +7 -7
- package/dist/{chunk-GRC4HK7K.js.map → chunk-J2HRFC3X.js.map} +1 -1
- package/dist/{chunk-JNJDIOG2.js → chunk-K4SOPFMG.js} +7 -7
- package/dist/{chunk-JNJDIOG2.js.map → chunk-K4SOPFMG.js.map} +1 -1
- package/dist/{chunk-XN3FKMO6.js → chunk-KVARA33X.js} +4 -2
- package/dist/chunk-KVARA33X.js.map +1 -0
- package/dist/{chunk-4O7AWOLQ.cjs → chunk-LPMM6HII.cjs} +17 -17
- package/dist/{chunk-4O7AWOLQ.cjs.map → chunk-LPMM6HII.cjs.map} +1 -1
- package/dist/{chunk-3Y3N6DCM.cjs → chunk-OY3LBAOC.cjs} +7 -7
- package/dist/{chunk-3Y3N6DCM.cjs.map → chunk-OY3LBAOC.cjs.map} +1 -1
- package/dist/{chunk-G7R456H2.cjs → chunk-Q57SABM6.cjs} +4 -2
- package/dist/chunk-Q57SABM6.cjs.map +1 -0
- package/dist/{chunk-V245ALKI.cjs → chunk-UUMAFVGW.cjs} +4 -4
- package/dist/{chunk-V245ALKI.cjs.map → chunk-UUMAFVGW.cjs.map} +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +17 -10
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +14 -7
- package/dist/server/index.js.map +1 -1
- package/dist/validator/custom-resolver.cjs +3 -3
- package/dist/validator/custom-resolver.js +1 -1
- package/package.json +8 -8
- package/dist/chunk-G7R456H2.cjs.map +0 -1
- package/dist/chunk-XN3FKMO6.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/build/utils.ts"],"names":["join","relative","basename","builtinModules"],"mappings":";;;;;;AA0BO,SAAS,sBAAsB,QAAA,EAAqD;AACzF,EAAA,IAAI,aAAa,SAAA,EAAW;AAC1B,IAAA,OAAO;AAAA,MACL,c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A,CAAK,OAAA,CAAQ,CAAA,yBAAA,CAAA,EAA6B,MAAA,CAAO,WAAW,CAAA;AACnE,EAAA,IAAI,OAAO,aAAA,EAAe;AACxB,IAAA,IAAA,GAAO,IAAA,CAAK,OAAA,CAAQ,CAAA,4BAAA,CAAA,EAAgC,MAAA,CAAO,aAAa,CAAA;AAAA,EAC1E;AACA,EAAA,IAAA,GAAO,IAAA,CAAK,UAAA,CAAW,6BAAA,EAA+B,MAAA,CAAO,QAAQ,CAAA;AAErE,EAAA,OAAO,IAAA;AACT;AAOO,SAAS,gBAAgB,SAAA,EAA4B;AAC1D,EAAA,OACEC,uBAAA,CAAe,QAAA,CAAS,SAAS,CAAA,IACjC,UAAU,UAAA,CAAW,OAAO,CAAA,IAC5BA,uBAAA,CAAe,QAAA,CAAS,SAAA,CAAU,OAAA,CAAQ,QAAA,EAAU,EAAE,CAAC,CAAA;AAE3D","file":"chunk-Q57SABM6.cjs","sourcesContent":["import { execSync } from 'node:child_process';\nimport { existsSync, mkdirSync } from 'node:fs';\nimport { builtinModules } from 'node:module';\nimport { basename, join, relative } from 'node:path';\nimport type { RollupNodeResolveOptions } from '@rollup/plugin-node-resolve';\n\n/** The detected JavaScript runtime environment */\nexport type RuntimePlatform = 'node' | 'bun';\n\n/**\n * The esbuild/bundler platform setting.\n * - 'node': Assumes Node.js environment, externalizes built-in modules\n * - 'browser': Assumes browser environment, polyfills Node APIs\n * - 'neutral': Runtime-agnostic, preserves all globals as-is (used for Bun)\n */\nexport type BundlerPlatform = 'node' | 'browser' | 'neutral';\n\n/**\n * Get nodeResolve plugin options based on the target platform.\n *\n * For 'browser' platform (e.g., Cloudflare Workers), uses browser-compatible\n * export conditions so packages like the Cloudflare SDK resolve to their\n * web runtime instead of Node.js-specific code.\n *\n * For 'node' and 'neutral' (Bun) platforms, uses Node.js module resolution.\n */\nexport function getNodeResolveOptions(platform: BundlerPlatform): RollupNodeResolveOptions {\n if (platform === 'browser') {\n return {\n preferBuiltins: false,\n browser: true,\n exportConditions: ['browser', 'worker', 'default'],\n };\n }\n return {\n preferBuiltins: true,\n exportConditions: ['node'],\n };\n}\n\n/**\n * Detect the current JavaScript runtime environment.\n *\n * This is used by the bundler to determine the appropriate esbuild platform\n * setting. When running under Bun, we need to use 'neutral' platform to\n * preserve Bun-specific globals (like Bun.s3).\n */\nexport function detectRuntime(): RuntimePlatform {\n if (process.versions?.bun) {\n return 'bun';\n }\n return 'node';\n}\n\nexport function upsertMastraDir({ dir = process.cwd() }: { dir?: string }) {\n const dirPath = join(dir, '.mastra');\n\n if (!existsSync(dirPath)) {\n mkdirSync(dirPath, { recursive: true });\n execSync(`echo \".mastra\" >> .gitignore`);\n }\n}\n\nexport function isDependencyPartOfPackage(dep: string, packageName: string) {\n if (dep === packageName) {\n return true;\n }\n\n return dep.startsWith(`${packageName}/`);\n}\n\n/**\n * Get the package name from a module ID\n */\nexport function getPackageName(id: string) {\n const parts = id.split('/');\n\n if (id.startsWith('@')) {\n return parts.slice(0, 2).join('/');\n }\n\n return parts[0];\n}\n\n/**\n * During `mastra dev` we are compiling TS files to JS (inside workspaces) so that users can just their workspace packages.\n * We store these compiled files inside `node_modules/.cache` for each workspace package.\n */\nexport function getCompiledDepCachePath(rootPath: string, packageName: string) {\n return slash(join(rootPath, 'node_modules', '.cache', packageName));\n}\n\n/**\n * Convert windows backslashes to posix slashes\n *\n * @example\n * ```ts\n * slash('C:\\\\Users\\\\user\\\\code\\\\mastra') // 'C:/Users/user/code/mastra'\n * ```\n */\nexport function slash(path: string) {\n const isExtendedLengthPath = path.startsWith('\\\\\\\\?\\\\');\n\n if (isExtendedLengthPath) {\n return path;\n }\n\n return path.replaceAll('\\\\', '/');\n}\n\n/**\n * Make a Rollup-safe name: pathless, POSIX, and without parent/absolute segments\n */\nexport function rollupSafeName(name: string, rootDir: string) {\n const rel = relative(rootDir, name);\n let entry = slash(rel);\n entry = entry.replace(/^(\\.\\.\\/)+/, '');\n entry = entry.replace(/^\\/+/, '');\n entry = entry.replace(/^[A-Za-z]:\\//, '');\n if (!entry) {\n entry = slash(basename(name));\n }\n return entry;\n}\n\n/**\n * Native binding loaders and infrastructure packages that should be ignored when identifying the actual package that requires native bindings\n */\nconst NATIVE_BINDING_LOADERS = [\n 'node-gyp-build',\n 'prebuild-install',\n 'bindings',\n 'node-addon-api',\n 'node-pre-gyp',\n 'nan', // Native Abstractions for Node.js\n] as const;\n\n/**\n * Finds the first real package from node_modules that likely contains native bindings, filtering out virtual modules and native binding loader infrastructure.\n *\n * @param moduleIds - Array of module IDs from a Rollup chunk\n * @returns The module ID of the actual native package, or undefined if not found\n *\n * @example\n * const moduleIds = [\n * '\\x00/path/node_modules/bcrypt/bcrypt.js?commonjs-module',\n * '/path/node_modules/node-gyp-build/index.js',\n * '/path/node_modules/bcrypt/bcrypt.js',\n * ];\n * findNativePackageModule(moduleIds); // Returns '/path/node_modules/bcrypt/bcrypt.js'\n */\nexport function findNativePackageModule(moduleIds: string[]): string | undefined {\n return moduleIds.find(id => {\n // Skip virtual modules (Rollup plugin-generated)\n if (id.startsWith('\\x00')) {\n return false;\n }\n\n // Must be from node_modules\n if (!id.includes('/node_modules/')) {\n return false;\n }\n\n // Skip native binding loader infrastructure\n for (const loader of NATIVE_BINDING_LOADERS) {\n if (id.includes(`/${loader}/`) || id.includes(`/${loader}@`)) {\n return false;\n }\n }\n\n return true;\n });\n}\n\n/**\n * Ensures that server.studioBase is normalized:\n * - Adds leading slash if missing (e.g., 'admin' → '/admin')\n * - Removes trailing slashes (e.g., '/admin/' → '/admin')\n * - Normalizes multiple slashes to single slash (e.g., '//api' → '/api')\n * - Returns empty string for root paths ('/' or '')\n *\n * @param studioBase - The studioBase path to normalize\n * @returns Normalized studioBase path string\n * @throws Error if path contains invalid characters ('..', '?', '#')\n */\nexport function normalizeStudioBase(studioBase: string): string {\n studioBase = studioBase.trim();\n\n // Validate: no path traversal, no query params, no special chars\n if (studioBase.includes('..') || studioBase.includes('?') || studioBase.includes('#')) {\n throw new Error(`Invalid base path: \"${studioBase}\". Base path cannot contain '..', '?', or '#'`);\n }\n\n // Normalize multiple slashes to single slash\n studioBase = studioBase.replace(/\\/+/g, '/');\n\n // Handle default value cases\n if (studioBase === '/' || studioBase === '') {\n return '';\n }\n\n // Remove trailing slash\n if (studioBase.endsWith('/')) {\n studioBase = studioBase.slice(0, -1);\n }\n\n // Add leading slash if missing\n if (!studioBase.startsWith('/')) {\n studioBase = `/${studioBase}`;\n }\n\n return studioBase;\n}\n\n/**\n * Configuration values for Studio's index.html placeholder injection.\n *\n * Each value is the **exact JavaScript expression** that replaces the\n * corresponding `'%%PLACEHOLDER%%'` token (including surrounding quotes).\n *\n * For literal strings pass `\"'value'\"` (quoted).\n * For runtime expressions pass the raw JS, e.g. `\"window.location.hostname\"`.\n */\nexport interface StudioInjectionConfig {\n host: string;\n port: string;\n protocol: string;\n apiPrefix: string;\n basePath: string;\n hideCloudCta: string;\n cloudApiEndpoint: string;\n experimentalFeatures: string;\n templates: string;\n telemetryDisabled: string;\n requestContextPresets: string;\n themeToggle: string;\n autoDetectUrl?: string;\n}\n\n/**\n * Replace all `%%MASTRA_*%%` placeholders in the Studio `index.html` with the\n * supplied configuration values.\n *\n * The `<base href>` tag and the `window.MASTRA_STUDIO_BASE_PATH` assignment\n * use `basePath` as a plain string (no surrounding quotes), while all other\n * placeholders replace `'%%TOKEN%%'` (with surrounding single-quotes in the\n * source HTML) with the provided expression verbatim.\n */\nexport function injectStudioHtmlConfig(html: string, config: StudioInjectionConfig): string {\n html = html.replace(`'%%MASTRA_SERVER_HOST%%'`, config.host);\n html = html.replace(`'%%MASTRA_SERVER_PORT%%'`, config.port);\n html = html.replace(`'%%MASTRA_SERVER_PROTOCOL%%'`, config.protocol);\n html = html.replace(`'%%MASTRA_API_PREFIX%%'`, config.apiPrefix);\n html = html.replace(`'%%MASTRA_HIDE_CLOUD_CTA%%'`, config.hideCloudCta);\n html = html.replace(`'%%MASTRA_CLOUD_API_ENDPOINT%%'`, config.cloudApiEndpoint);\n html = html.replace(`'%%MASTRA_EXPERIMENTAL_FEATURES%%'`, config.experimentalFeatures);\n html = html.replace(`'%%MASTRA_TEMPLATES%%'`, config.templates);\n html = html.replace(`'%%MASTRA_TELEMETRY_DISABLED%%'`, config.telemetryDisabled);\n html = html.replace(`'%%MASTRA_REQUEST_CONTEXT_PRESETS%%'`, config.requestContextPresets);\n html = html.replace(`'%%MASTRA_THEME_TOGGLE%%'`, config.themeToggle);\n if (config.autoDetectUrl) {\n html = html.replace(`'%%MASTRA_AUTO_DETECT_URL%%'`, config.autoDetectUrl);\n }\n html = html.replaceAll('%%MASTRA_STUDIO_BASE_PATH%%', config.basePath);\n\n return html;\n}\n\n/**\n * Check if a module is a Node.js builtin module\n * @param specifier - Module specifier\n * @returns True if it's a builtin module\n */\nexport function isBuiltinModule(specifier: string): boolean {\n return (\n builtinModules.includes(specifier) ||\n specifier.startsWith('node:') ||\n builtinModules.includes(specifier.replace(/^node:/, ''))\n );\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkQ57SABM6_cjs = require('./chunk-Q57SABM6.cjs');
|
|
4
4
|
var url = require('url');
|
|
5
5
|
var localPkg = require('local-pkg');
|
|
6
6
|
var originalEsbuild = require('rollup-plugin-esbuild');
|
|
@@ -348,7 +348,7 @@ function subpathExternalsResolver(externals) {
|
|
|
348
348
|
if (id.startsWith(".") || id.startsWith("/")) {
|
|
349
349
|
return null;
|
|
350
350
|
}
|
|
351
|
-
const isPartOfExternals = externals.some((external) =>
|
|
351
|
+
const isPartOfExternals = externals.some((external) => chunkQ57SABM6_cjs.isDependencyPartOfPackage(id, external));
|
|
352
352
|
if (isPartOfExternals) {
|
|
353
353
|
return {
|
|
354
354
|
id,
|
|
@@ -365,5 +365,5 @@ exports.getPackageRootPath = getPackageRootPath;
|
|
|
365
365
|
exports.removeDeployer = removeDeployer2;
|
|
366
366
|
exports.subpathExternalsResolver = subpathExternalsResolver;
|
|
367
367
|
exports.tsConfigPaths = tsConfigPaths;
|
|
368
|
-
//# sourceMappingURL=chunk-
|
|
369
|
-
//# sourceMappingURL=chunk-
|
|
368
|
+
//# sourceMappingURL=chunk-UUMAFVGW.cjs.map
|
|
369
|
+
//# sourceMappingURL=chunk-UUMAFVGW.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/build/package-info.ts","../src/build/plugins/esbuild.ts","../src/build/babel/remove-deployer.ts","../src/build/plugins/remove-deployer.ts","../src/build/plugins/tsconfig-paths.ts","../src/build/plugins/esm-shim.ts","../src/build/plugins/subpath-externals-resolver.ts"],"names":["pathToFileURL","getPackageInfo","originalEsbuild","babel","path","removeDeployer","babel2","fs","stripJsonComments","tsConfigPath","createHandler","normalize","resolved","originalEsmShim","isDependencyPartOfPackage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,eAAsB,kBAAA,CAAmB,aAAqB,UAAA,EAA6C;AACzG,EAAA,IAAI,QAAA;AAEJ,EAAA,IAAI;AACF,IAAA,IAAI,OAAA,GAA4C,MAAA;AAChD,IAAA,IAAI,UAAA,EAAY;AACd,MAAA,IAAI,CAAC,UAAA,CAAW,UAAA,CAAW,SAAS,CAAA,EAAG;AACrC,QAAA,UAAA,GAAaA,iBAAA,CAAc,UAAU,CAAA,CAAE,IAAA;AAAA,MACzC;AAEA,MAAA,OAAA,GAAU;AAAA,QACR,KAAA,EAAO,CAAC,UAAU;AAAA,OACpB;AAAA,IACF;AAEA,IAAA,MAAM,GAAA,GAAM,MAAMC,uBAAA,CAAe,WAAA,EAAa,OAAO,CAAA;AACrD,IAAA,QAAA,GAAW,KAAK,QAAA,IAAY,IAAA;AAAA,EAC9B,CAAA,CAAA,MAAQ;AACN,IAAA,QAAA,GAAW,IAAA;AAAA,EACb;AAEA,EAAA,OAAO,QAAA;AACT;AC/BO,SAAS,OAAA,CAAQ,OAAA,GAAiD,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ACF;AAAA,GACF;AACF","file":"chunk-V245ALKI.cjs","sourcesContent":["/**\n * Note: This function depends on local-pkg and should only be used at build-time.\n * It is in a separate file to avoid including local-pkg in runtime code.\n */\n\nimport { pathToFileURL } from 'node:url';\nimport { getPackageInfo } from 'local-pkg';\n\n/**\n * Get package root path\n */\nexport async function getPackageRootPath(packageName: string, parentPath?: string): Promise<string | null> {\n let rootPath: string | null;\n\n try {\n let options: { paths?: string[] } | undefined = undefined;\n if (parentPath) {\n if (!parentPath.startsWith('file://')) {\n parentPath = pathToFileURL(parentPath).href;\n }\n\n options = {\n paths: [parentPath],\n };\n }\n\n const pkg = await getPackageInfo(packageName, options);\n rootPath = pkg?.rootPath ?? null;\n } catch {\n rootPath = null;\n }\n\n return rootPath;\n}\n","import originalEsbuild from 'rollup-plugin-esbuild';\n\nexport function esbuild(options: Parameters<typeof originalEsbuild>[0] = {}) {\n return originalEsbuild({\n target: 'node20',\n platform: 'node',\n minify: false,\n ...options,\n });\n}\n","import babel from '@babel/core';\n\nexport function removeDeployer() {\n const t = babel.types;\n\n // Helper to remove deployer property from an object and clean up its binding\n function removeDeployerFromObject(\n objectExpr: babel.types.ObjectExpression,\n scope: { getBinding: (name: string) => { path?: babel.NodePath } | undefined },\n ): babel.types.ObjectProperty | undefined {\n const deployerProp = objectExpr.properties.find(\n prop => t.isObjectProperty(prop) && t.isIdentifier(prop.key) && prop.key.name === 'deployer',\n ) as babel.types.ObjectProperty | undefined;\n\n if (deployerProp) {\n objectExpr.properties = objectExpr.properties.filter(prop => prop !== deployerProp);\n\n // Clean up the deployer binding if it's a reference\n if (t.isIdentifier(deployerProp.value)) {\n const deployerBinding = scope.getBinding(deployerProp.value.name);\n if (deployerBinding) {\n deployerBinding.path?.parentPath?.remove();\n }\n }\n }\n\n return deployerProp;\n }\n\n return {\n name: 'remove-deployer',\n visitor: {\n NewExpression(path, state) {\n // is a variable declaration\n const varDeclaratorPath = path.findParent(path => t.isVariableDeclarator(path.node));\n if (!varDeclaratorPath) {\n return;\n }\n\n const parentNode = path.parentPath.node;\n // check if it's a const of mastra\n if (!t.isVariableDeclarator(parentNode) || !t.isIdentifier(parentNode.id) || parentNode.id.name !== 'mastra') {\n return;\n }\n\n if (!state.hasReplaced) {\n state.hasReplaced = true;\n const newMastraObj = t.cloneNode(path.node);\n if (t.isObjectExpression(newMastraObj.arguments[0]) && newMastraObj.arguments[0].properties?.length) {\n const objectArg = newMastraObj.arguments[0];\n let foundDeployer = false;\n\n // First, check for direct deployer property\n const directDeployer = removeDeployerFromObject(objectArg, state.file.scope);\n if (directDeployer) {\n foundDeployer = true;\n }\n\n // Then, check spread elements for deployer properties\n for (const prop of objectArg.properties) {\n if (t.isSpreadElement(prop) && t.isIdentifier(prop.argument)) {\n const spreadBinding = state.file.scope.getBinding(prop.argument.name);\n if (spreadBinding?.path && t.isVariableDeclarator(spreadBinding.path.node)) {\n const init = spreadBinding.path.node.init;\n if (t.isObjectExpression(init)) {\n const spreadDeployer = removeDeployerFromObject(init, state.file.scope);\n if (spreadDeployer) {\n foundDeployer = true;\n }\n }\n }\n }\n }\n\n if (foundDeployer) {\n path.replaceWith(newMastraObj);\n }\n }\n }\n },\n },\n } as babel.PluginObj;\n}\n","import * as babel from '@babel/core';\nimport type { Plugin } from 'rollup';\n\nimport { removeDeployer as removeDeployerBabelPlugin } from '../babel/remove-deployer';\n\nexport function removeDeployer(mastraEntry: string, options?: { sourcemap?: boolean }): Plugin {\n return {\n name: 'remove-deployer',\n transform(code, id) {\n if (id !== mastraEntry) {\n return;\n }\n\n return new Promise((resolve, reject) => {\n babel.transform(\n code,\n {\n babelrc: false,\n configFile: false,\n filename: id,\n plugins: [removeDeployerBabelPlugin],\n sourceMaps: options?.sourcemap,\n },\n (err, result) => {\n if (err) {\n return reject(err);\n }\n\n resolve({\n code: result!.code!,\n map: result!.map!,\n });\n },\n );\n });\n },\n } satisfies Plugin;\n}\n","import fs from 'node:fs';\nimport path, { normalize } from 'node:path';\nimport type { Plugin } from 'rollup';\nimport stripJsonComments from 'strip-json-comments';\nimport type { RegisterOptions } from 'typescript-paths';\nimport { createHandler } from 'typescript-paths';\n\nconst PLUGIN_NAME = 'tsconfig-paths';\nconst JS_IMPORT_SOURCE_EXTENSIONS = ['.ts', '.tsx', '.js', '.jsx'];\n\nexport type PluginOptions = Omit<RegisterOptions, 'loggerID'> & { localResolve?: boolean };\n\n/**\n * Check if a tsconfig file has path mappings configured.\n * Exported for testing purposes.\n *\n * @param tsConfigPath - Path to the tsconfig.json file\n * @returns true if the tsconfig has paths configured or extends another config, false otherwise\n */\nexport function hasPaths(tsConfigPath: string): boolean {\n try {\n const content = fs.readFileSync(tsConfigPath, 'utf8');\n const config = JSON.parse(stripJsonComments(content));\n return !!(\n (config.compilerOptions?.paths && Object.keys(config.compilerOptions.paths).length > 0) ||\n (typeof config.extends === 'string' && config.extends.length > 0) ||\n (Array.isArray(config.extends) && config.extends.length > 0)\n );\n } catch {\n return false;\n }\n}\n\nexport function tsConfigPaths({ tsConfigPath, respectCoreModule, localResolve }: PluginOptions = {}): Plugin {\n const handlerCache = new Map<string, ReturnType<typeof createHandler>>();\n\n function resolveJsImportToSourceFile(moduleName: string): string {\n if (fs.existsSync(moduleName)) {\n return moduleName;\n }\n\n const parsed = path.parse(moduleName);\n if (parsed.ext !== '.js') {\n return moduleName;\n }\n\n for (const extension of JS_IMPORT_SOURCE_EXTENSIONS) {\n const candidate = path.join(parsed.dir, `${parsed.name}${extension}`);\n if (fs.existsSync(candidate)) {\n return candidate;\n }\n }\n\n return moduleName;\n }\n\n // Find tsconfig.json file starting from a directory and walking up\n function findTsConfigForFile(filePath: string): string | null {\n let currentDir = path.dirname(filePath);\n const root = path.parse(currentDir).root;\n\n while (currentDir !== root) {\n const tsConfigPath = path.join(currentDir, 'tsconfig.json');\n\n if (fs.existsSync(tsConfigPath)) {\n // Check if this tsconfig has path mappings\n if (hasPaths(tsConfigPath)) {\n return tsConfigPath;\n }\n }\n\n // Also check for tsconfig.base.json (common in NX)\n const tsConfigBasePath = path.join(currentDir, 'tsconfig.base.json');\n if (fs.existsSync(tsConfigBasePath)) {\n if (hasPaths(tsConfigBasePath)) {\n return tsConfigBasePath;\n }\n }\n\n currentDir = path.dirname(currentDir);\n }\n\n return null;\n }\n\n // Get or create handler for a specific tsconfig file\n function getHandlerForFile(filePath: string): ReturnType<typeof createHandler> | null {\n // If a specific tsConfigPath was provided, use it\n if (tsConfigPath && typeof tsConfigPath === 'string') {\n if (!handlerCache.has(tsConfigPath)) {\n handlerCache.set(\n tsConfigPath,\n createHandler({\n log: () => {},\n tsConfigPath,\n respectCoreModule,\n falllback: moduleName => fs.existsSync(moduleName),\n }),\n );\n }\n return handlerCache.get(tsConfigPath)!;\n }\n\n // Find appropriate tsconfig for this file\n const configPath = findTsConfigForFile(filePath);\n if (!configPath) {\n return null;\n }\n\n // Cache handlers to avoid recreation\n if (!handlerCache.has(configPath)) {\n handlerCache.set(\n configPath,\n createHandler({\n log: () => {},\n tsConfigPath: configPath,\n respectCoreModule,\n falllback: moduleName => fs.existsSync(moduleName),\n }),\n );\n }\n\n return handlerCache.get(configPath)!;\n }\n\n // Simple alias resolution using dynamic handler\n function resolveAlias(request: string, importer: string): string | null | undefined {\n // Get the appropriate handler for this file\n const dynamicHandler = getHandlerForFile(importer);\n if (!dynamicHandler) {\n return null;\n }\n\n const resolved = dynamicHandler(request, normalize(importer));\n return resolved;\n }\n\n return {\n name: PLUGIN_NAME,\n resolveId: {\n order: 'pre',\n async handler(request, importer, options) {\n if (!importer || request.startsWith('\\0') || importer.charCodeAt(0) === 0) {\n return null;\n }\n\n // Convert relative paths to absolute to ensure proper tsconfig path resolution\n // This allows path aliases to work regardless of how the importer path is provided\n if (!path.isAbsolute(importer)) {\n importer = path.resolve(process.cwd(), importer);\n }\n\n const moduleName = resolveAlias(request, importer);\n // No tsconfig alias found, so we need to resolve it normally\n if (!moduleName) {\n const resolved = await this.resolve(request, importer, { skipSelf: true, ...options });\n if (!resolved) {\n return null;\n }\n\n // If localResolve is true, we need to check if the importer has been resolved by the tsconfig-paths plugin\n // if so, we need to resolve the request from the importer instead of the root and mark it as external\n if (localResolve) {\n const importerInfo = this.getModuleInfo(importer);\n const importerPluginMeta = importerInfo?.meta?.[PLUGIN_NAME];\n\n if (!request.startsWith('./') && !request.startsWith('../') && importerPluginMeta?.resolved) {\n return {\n ...resolved,\n external: !request.startsWith('hono/') && request !== 'hono',\n };\n }\n }\n\n return {\n ...resolved,\n meta: {\n ...(resolved.meta || {}),\n },\n };\n }\n\n const resolvedModuleName = resolveJsImportToSourceFile(moduleName);\n\n // When a module does not have an extension, we need to resolve it to a file\n if (!path.extname(resolvedModuleName)) {\n const resolved = await this.resolve(resolvedModuleName, importer, { skipSelf: true, ...options });\n\n if (!resolved) {\n return null;\n }\n\n return {\n ...resolved,\n meta: {\n ...resolved.meta,\n [PLUGIN_NAME]: {\n resolved: true,\n },\n },\n };\n }\n\n // Always pass through bundler's resolution to ensure proper path normalization\n const resolved = await this.resolve(resolvedModuleName, importer, { skipSelf: true, ...options });\n\n if (!resolved) {\n return null;\n }\n\n return {\n ...resolved,\n meta: {\n ...resolved.meta,\n [PLUGIN_NAME]: {\n resolved: true,\n },\n },\n };\n },\n },\n } satisfies Plugin;\n}\n","import originalEsmShim from '@rollup/plugin-esm-shim';\nimport type { Plugin } from 'rollup';\n\n// Regex to detect DECLARATIONS of __filename, __dirname\n// Using non-capturing group (?:) for slightly better performance\nconst FilenameDeclarationRegex = /(?:const|let|var)\\s+__filename/;\nconst DirnameDeclarationRegex = /(?:const|let|var)\\s+__dirname/;\n\n/**\n * Custom ESM shim plugin wrapper that respects user-declared __filename/__dirname variables.\n *\n * The original @rollup/plugin-esm-shim would inject shims even when users had already declared\n * their own __filename/__dirname, causing \"Identifier '__filename' has already been declared\" errors.\n *\n * This wrapper checks if the user has already declared these variables and skips the shim injection\n * if so. If either variable is declared, we skip the shim entirely since the original plugin injects\n * both together and we assume users who declare one will also handle the other if needed.\n */\nexport function esmShim(): Plugin {\n const original = originalEsmShim();\n\n return {\n name: 'esm-shim',\n renderChunk(code, chunk, opts, meta) {\n // Fast path: use includes() first to avoid regex if identifiers aren't present\n const hasFilename = code.includes('__filename');\n const hasDirname = code.includes('__dirname');\n\n // If user declared either __filename or __dirname, skip shim injection entirely\n // since the original plugin injects both together\n const userDeclaredFilename = hasFilename && FilenameDeclarationRegex.test(code);\n const userDeclaredDirname = hasDirname && DirnameDeclarationRegex.test(code);\n\n if (userDeclaredFilename || userDeclaredDirname) {\n return null;\n }\n\n // Otherwise, delegate to the original plugin\n if (typeof original.renderChunk === 'function') {\n return original.renderChunk.call(this, code, chunk, opts, meta);\n }\n\n return null;\n },\n };\n}\n\nexport default esmShim;\n","import type { Plugin } from 'rollup';\nimport { isDependencyPartOfPackage } from '../utils';\n\nexport function subpathExternalsResolver(externals: string[]): Plugin {\n return {\n name: 'subpath-externals-resolver',\n resolveId(id) {\n if (id.startsWith('.') || id.startsWith('/')) {\n return null;\n }\n\n const isPartOfExternals = externals.some(external => isDependencyPartOfPackage(id, external));\n if (isPartOfExternals) {\n return {\n id,\n external: true,\n };\n }\n },\n } satisfies Plugin;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/build/package-info.ts","../src/build/plugins/esbuild.ts","../src/build/babel/remove-deployer.ts","../src/build/plugins/remove-deployer.ts","../src/build/plugins/tsconfig-paths.ts","../src/build/plugins/esm-shim.ts","../src/build/plugins/subpath-externals-resolver.ts"],"names":["pathToFileURL","getPackageInfo","originalEsbuild","babel","path","removeDeployer","babel2","fs","stripJsonComments","tsConfigPath","createHandler","normalize","resolved","originalEsmShim","isDependencyPartOfPackage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,eAAsB,kBAAA,CAAmB,aAAqB,UAAA,EAA6C;AACzG,EAAA,IAAI,QAAA;AAEJ,EAAA,IAAI;AACF,IAAA,IAAI,OAAA,GAA4C,MAAA;AAChD,IAAA,IAAI,UAAA,EAAY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IACT;AAAA,GACF;AACF;;;AC1CO,SAAS,yBAAyB,SAAA,EAA6B;AACpE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,4BAAA;AAAA,IACN,UAAU,EAAA,EAAI;AACZ,MAAA,IAAI,GAAG,UAAA,CAAW,GAAG,KAAK,EAAA,CAAG,UAAA,CAAW,GAAG,CAAA,EAAG;AAC5C,QAAA,OAAO,IAAA;AAAA,MACT;AAEA,MAAA,MAAM,oBAAoB,SAAA,CAAU,IAAA,CAAK,cAAYC,2CAAA,CAA0B,EAAA,EAAI,QAAQ,CAAC,CAAA;AAC5F,MAAA,IAAI,iBAAA,EAAmB;AACrB,QAAA,OAAO;AAAA,UACL,EAAA;AAAA,UACA,QAAA,EAAU;AAAA,SACZ;AAAA,MACF;AAAA,IACF;AAAA,GACF;AACF","file":"chunk-UUMAFVGW.cjs","sourcesContent":["/**\n * Note: This function depends on local-pkg and should only be used at build-time.\n * It is in a separate file to avoid including local-pkg in runtime code.\n */\n\nimport { pathToFileURL } from 'node:url';\nimport { getPackageInfo } from 'local-pkg';\n\n/**\n * Get package root path\n */\nexport async function getPackageRootPath(packageName: string, parentPath?: string): Promise<string | null> {\n let rootPath: string | null;\n\n try {\n let options: { paths?: string[] } | undefined = undefined;\n if (parentPath) {\n if (!parentPath.startsWith('file://')) {\n parentPath = pathToFileURL(parentPath).href;\n }\n\n options = {\n paths: [parentPath],\n };\n }\n\n const pkg = await getPackageInfo(packageName, options);\n rootPath = pkg?.rootPath ?? null;\n } catch {\n rootPath = null;\n }\n\n return rootPath;\n}\n","import originalEsbuild from 'rollup-plugin-esbuild';\n\nexport function esbuild(options: Parameters<typeof originalEsbuild>[0] = {}) {\n return originalEsbuild({\n target: 'node20',\n platform: 'node',\n minify: false,\n ...options,\n });\n}\n","import babel from '@babel/core';\n\nexport function removeDeployer() {\n const t = babel.types;\n\n // Helper to remove deployer property from an object and clean up its binding\n function removeDeployerFromObject(\n objectExpr: babel.types.ObjectExpression,\n scope: { getBinding: (name: string) => { path?: babel.NodePath } | undefined },\n ): babel.types.ObjectProperty | undefined {\n const deployerProp = objectExpr.properties.find(\n prop => t.isObjectProperty(prop) && t.isIdentifier(prop.key) && prop.key.name === 'deployer',\n ) as babel.types.ObjectProperty | undefined;\n\n if (deployerProp) {\n objectExpr.properties = objectExpr.properties.filter(prop => prop !== deployerProp);\n\n // Clean up the deployer binding if it's a reference\n if (t.isIdentifier(deployerProp.value)) {\n const deployerBinding = scope.getBinding(deployerProp.value.name);\n if (deployerBinding) {\n deployerBinding.path?.parentPath?.remove();\n }\n }\n }\n\n return deployerProp;\n }\n\n return {\n name: 'remove-deployer',\n visitor: {\n NewExpression(path, state) {\n // is a variable declaration\n const varDeclaratorPath = path.findParent(path => t.isVariableDeclarator(path.node));\n if (!varDeclaratorPath) {\n return;\n }\n\n const parentNode = path.parentPath.node;\n // check if it's a const of mastra\n if (!t.isVariableDeclarator(parentNode) || !t.isIdentifier(parentNode.id) || parentNode.id.name !== 'mastra') {\n return;\n }\n\n if (!state.hasReplaced) {\n state.hasReplaced = true;\n const newMastraObj = t.cloneNode(path.node);\n if (t.isObjectExpression(newMastraObj.arguments[0]) && newMastraObj.arguments[0].properties?.length) {\n const objectArg = newMastraObj.arguments[0];\n let foundDeployer = false;\n\n // First, check for direct deployer property\n const directDeployer = removeDeployerFromObject(objectArg, state.file.scope);\n if (directDeployer) {\n foundDeployer = true;\n }\n\n // Then, check spread elements for deployer properties\n for (const prop of objectArg.properties) {\n if (t.isSpreadElement(prop) && t.isIdentifier(prop.argument)) {\n const spreadBinding = state.file.scope.getBinding(prop.argument.name);\n if (spreadBinding?.path && t.isVariableDeclarator(spreadBinding.path.node)) {\n const init = spreadBinding.path.node.init;\n if (t.isObjectExpression(init)) {\n const spreadDeployer = removeDeployerFromObject(init, state.file.scope);\n if (spreadDeployer) {\n foundDeployer = true;\n }\n }\n }\n }\n }\n\n if (foundDeployer) {\n path.replaceWith(newMastraObj);\n }\n }\n }\n },\n },\n } as babel.PluginObj;\n}\n","import * as babel from '@babel/core';\nimport type { Plugin } from 'rollup';\n\nimport { removeDeployer as removeDeployerBabelPlugin } from '../babel/remove-deployer';\n\nexport function removeDeployer(mastraEntry: string, options?: { sourcemap?: boolean }): Plugin {\n return {\n name: 'remove-deployer',\n transform(code, id) {\n if (id !== mastraEntry) {\n return;\n }\n\n return new Promise((resolve, reject) => {\n babel.transform(\n code,\n {\n babelrc: false,\n configFile: false,\n filename: id,\n plugins: [removeDeployerBabelPlugin],\n sourceMaps: options?.sourcemap,\n },\n (err, result) => {\n if (err) {\n return reject(err);\n }\n\n resolve({\n code: result!.code!,\n map: result!.map!,\n });\n },\n );\n });\n },\n } satisfies Plugin;\n}\n","import fs from 'node:fs';\nimport path, { normalize } from 'node:path';\nimport type { Plugin } from 'rollup';\nimport stripJsonComments from 'strip-json-comments';\nimport type { RegisterOptions } from 'typescript-paths';\nimport { createHandler } from 'typescript-paths';\n\nconst PLUGIN_NAME = 'tsconfig-paths';\nconst JS_IMPORT_SOURCE_EXTENSIONS = ['.ts', '.tsx', '.js', '.jsx'];\n\nexport type PluginOptions = Omit<RegisterOptions, 'loggerID'> & { localResolve?: boolean };\n\n/**\n * Check if a tsconfig file has path mappings configured.\n * Exported for testing purposes.\n *\n * @param tsConfigPath - Path to the tsconfig.json file\n * @returns true if the tsconfig has paths configured or extends another config, false otherwise\n */\nexport function hasPaths(tsConfigPath: string): boolean {\n try {\n const content = fs.readFileSync(tsConfigPath, 'utf8');\n const config = JSON.parse(stripJsonComments(content));\n return !!(\n (config.compilerOptions?.paths && Object.keys(config.compilerOptions.paths).length > 0) ||\n (typeof config.extends === 'string' && config.extends.length > 0) ||\n (Array.isArray(config.extends) && config.extends.length > 0)\n );\n } catch {\n return false;\n }\n}\n\nexport function tsConfigPaths({ tsConfigPath, respectCoreModule, localResolve }: PluginOptions = {}): Plugin {\n const handlerCache = new Map<string, ReturnType<typeof createHandler>>();\n\n function resolveJsImportToSourceFile(moduleName: string): string {\n if (fs.existsSync(moduleName)) {\n return moduleName;\n }\n\n const parsed = path.parse(moduleName);\n if (parsed.ext !== '.js') {\n return moduleName;\n }\n\n for (const extension of JS_IMPORT_SOURCE_EXTENSIONS) {\n const candidate = path.join(parsed.dir, `${parsed.name}${extension}`);\n if (fs.existsSync(candidate)) {\n return candidate;\n }\n }\n\n return moduleName;\n }\n\n // Find tsconfig.json file starting from a directory and walking up\n function findTsConfigForFile(filePath: string): string | null {\n let currentDir = path.dirname(filePath);\n const root = path.parse(currentDir).root;\n\n while (currentDir !== root) {\n const tsConfigPath = path.join(currentDir, 'tsconfig.json');\n\n if (fs.existsSync(tsConfigPath)) {\n // Check if this tsconfig has path mappings\n if (hasPaths(tsConfigPath)) {\n return tsConfigPath;\n }\n }\n\n // Also check for tsconfig.base.json (common in NX)\n const tsConfigBasePath = path.join(currentDir, 'tsconfig.base.json');\n if (fs.existsSync(tsConfigBasePath)) {\n if (hasPaths(tsConfigBasePath)) {\n return tsConfigBasePath;\n }\n }\n\n currentDir = path.dirname(currentDir);\n }\n\n return null;\n }\n\n // Get or create handler for a specific tsconfig file\n function getHandlerForFile(filePath: string): ReturnType<typeof createHandler> | null {\n // If a specific tsConfigPath was provided, use it\n if (tsConfigPath && typeof tsConfigPath === 'string') {\n if (!handlerCache.has(tsConfigPath)) {\n handlerCache.set(\n tsConfigPath,\n createHandler({\n log: () => {},\n tsConfigPath,\n respectCoreModule,\n falllback: moduleName => fs.existsSync(moduleName),\n }),\n );\n }\n return handlerCache.get(tsConfigPath)!;\n }\n\n // Find appropriate tsconfig for this file\n const configPath = findTsConfigForFile(filePath);\n if (!configPath) {\n return null;\n }\n\n // Cache handlers to avoid recreation\n if (!handlerCache.has(configPath)) {\n handlerCache.set(\n configPath,\n createHandler({\n log: () => {},\n tsConfigPath: configPath,\n respectCoreModule,\n falllback: moduleName => fs.existsSync(moduleName),\n }),\n );\n }\n\n return handlerCache.get(configPath)!;\n }\n\n // Simple alias resolution using dynamic handler\n function resolveAlias(request: string, importer: string): string | null | undefined {\n // Get the appropriate handler for this file\n const dynamicHandler = getHandlerForFile(importer);\n if (!dynamicHandler) {\n return null;\n }\n\n const resolved = dynamicHandler(request, normalize(importer));\n return resolved;\n }\n\n return {\n name: PLUGIN_NAME,\n resolveId: {\n order: 'pre',\n async handler(request, importer, options) {\n if (!importer || request.startsWith('\\0') || importer.charCodeAt(0) === 0) {\n return null;\n }\n\n // Convert relative paths to absolute to ensure proper tsconfig path resolution\n // This allows path aliases to work regardless of how the importer path is provided\n if (!path.isAbsolute(importer)) {\n importer = path.resolve(process.cwd(), importer);\n }\n\n const moduleName = resolveAlias(request, importer);\n // No tsconfig alias found, so we need to resolve it normally\n if (!moduleName) {\n const resolved = await this.resolve(request, importer, { skipSelf: true, ...options });\n if (!resolved) {\n return null;\n }\n\n // If localResolve is true, we need to check if the importer has been resolved by the tsconfig-paths plugin\n // if so, we need to resolve the request from the importer instead of the root and mark it as external\n if (localResolve) {\n const importerInfo = this.getModuleInfo(importer);\n const importerPluginMeta = importerInfo?.meta?.[PLUGIN_NAME];\n\n if (!request.startsWith('./') && !request.startsWith('../') && importerPluginMeta?.resolved) {\n return {\n ...resolved,\n external: !request.startsWith('hono/') && request !== 'hono',\n };\n }\n }\n\n return {\n ...resolved,\n meta: {\n ...(resolved.meta || {}),\n },\n };\n }\n\n const resolvedModuleName = resolveJsImportToSourceFile(moduleName);\n\n // When a module does not have an extension, we need to resolve it to a file\n if (!path.extname(resolvedModuleName)) {\n const resolved = await this.resolve(resolvedModuleName, importer, { skipSelf: true, ...options });\n\n if (!resolved) {\n return null;\n }\n\n return {\n ...resolved,\n meta: {\n ...resolved.meta,\n [PLUGIN_NAME]: {\n resolved: true,\n },\n },\n };\n }\n\n // Always pass through bundler's resolution to ensure proper path normalization\n const resolved = await this.resolve(resolvedModuleName, importer, { skipSelf: true, ...options });\n\n if (!resolved) {\n return null;\n }\n\n return {\n ...resolved,\n meta: {\n ...resolved.meta,\n [PLUGIN_NAME]: {\n resolved: true,\n },\n },\n };\n },\n },\n } satisfies Plugin;\n}\n","import originalEsmShim from '@rollup/plugin-esm-shim';\nimport type { Plugin } from 'rollup';\n\n// Regex to detect DECLARATIONS of __filename, __dirname\n// Using non-capturing group (?:) for slightly better performance\nconst FilenameDeclarationRegex = /(?:const|let|var)\\s+__filename/;\nconst DirnameDeclarationRegex = /(?:const|let|var)\\s+__dirname/;\n\n/**\n * Custom ESM shim plugin wrapper that respects user-declared __filename/__dirname variables.\n *\n * The original @rollup/plugin-esm-shim would inject shims even when users had already declared\n * their own __filename/__dirname, causing \"Identifier '__filename' has already been declared\" errors.\n *\n * This wrapper checks if the user has already declared these variables and skips the shim injection\n * if so. If either variable is declared, we skip the shim entirely since the original plugin injects\n * both together and we assume users who declare one will also handle the other if needed.\n */\nexport function esmShim(): Plugin {\n const original = originalEsmShim();\n\n return {\n name: 'esm-shim',\n renderChunk(code, chunk, opts, meta) {\n // Fast path: use includes() first to avoid regex if identifiers aren't present\n const hasFilename = code.includes('__filename');\n const hasDirname = code.includes('__dirname');\n\n // If user declared either __filename or __dirname, skip shim injection entirely\n // since the original plugin injects both together\n const userDeclaredFilename = hasFilename && FilenameDeclarationRegex.test(code);\n const userDeclaredDirname = hasDirname && DirnameDeclarationRegex.test(code);\n\n if (userDeclaredFilename || userDeclaredDirname) {\n return null;\n }\n\n // Otherwise, delegate to the original plugin\n if (typeof original.renderChunk === 'function') {\n return original.renderChunk.call(this, code, chunk, opts, meta);\n }\n\n return null;\n },\n };\n}\n\nexport default esmShim;\n","import type { Plugin } from 'rollup';\nimport { isDependencyPartOfPackage } from '../utils';\n\nexport function subpathExternalsResolver(externals: string[]): Plugin {\n return {\n name: 'subpath-externals-resolver',\n resolveId(id) {\n if (id.startsWith('.') || id.startsWith('/')) {\n return null;\n }\n\n const isPartOfExternals = externals.some(external => isDependencyPartOfPackage(id, external));\n if (isPartOfExternals) {\n return {\n id,\n external: true,\n };\n }\n },\n } satisfies Plugin;\n}\n"]}
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-deployer
|
|
|
3
3
|
description: Documentation for @mastra/deployer. Use when working with @mastra/deployer APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/deployer"
|
|
6
|
-
version: "1.
|
|
6
|
+
version: "1.14.0-alpha.2"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkHA2RK6ES_cjs = require('./chunk-HA2RK6ES.cjs');
|
|
4
|
+
var chunkOY3LBAOC_cjs = require('./chunk-OY3LBAOC.cjs');
|
|
5
5
|
var chunkJVBCN3RH_cjs = require('./chunk-JVBCN3RH.cjs');
|
|
6
6
|
|
|
7
7
|
// src/deploy/base.ts
|
|
8
|
-
var Deployer = class extends
|
|
8
|
+
var Deployer = class extends chunkHA2RK6ES_cjs.Bundler {
|
|
9
9
|
deps = new chunkJVBCN3RH_cjs.DepsService();
|
|
10
10
|
constructor(args) {
|
|
11
11
|
super(args.name, "DEPLOYER");
|
|
@@ -25,7 +25,7 @@ var Deployer = class extends chunkPM35TGRT_cjs.Bundler {
|
|
|
25
25
|
|
|
26
26
|
// src/build/deployer.ts
|
|
27
27
|
async function getDeployer(entryFile, outputDir, logger) {
|
|
28
|
-
const result = await
|
|
28
|
+
const result = await chunkOY3LBAOC_cjs.extractMastraOption("deployer", entryFile, outputDir, logger);
|
|
29
29
|
if (!result) {
|
|
30
30
|
return null;
|
|
31
31
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Bundler } from './chunk-
|
|
2
|
-
import { extractMastraOption } from './chunk-
|
|
1
|
+
import { Bundler } from './chunk-J2HRFC3X.js';
|
|
2
|
+
import { extractMastraOption } from './chunk-4OVBCW4T.js';
|
|
3
3
|
import { DepsService, FileService } from './chunk-DPDWM7HQ.js';
|
|
4
4
|
export { Deps, FileService, createChildProcessLogger, createPinoStream } from './chunk-DPDWM7HQ.js';
|
|
5
5
|
|
package/dist/server/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkQ57SABM6_cjs = require('../chunk-Q57SABM6.cjs');
|
|
4
4
|
var promises = require('fs/promises');
|
|
5
5
|
var https = require('https');
|
|
6
6
|
var path = require('path');
|
|
@@ -3961,6 +3961,7 @@ async function createHonoServer(mastra, options = {
|
|
|
3961
3961
|
}
|
|
3962
3962
|
const app = new hono.Hono();
|
|
3963
3963
|
const server = mastra.getServer();
|
|
3964
|
+
const apiPrefix = server?.apiPrefix ?? "/api";
|
|
3964
3965
|
const a2aTaskStore = new store.InMemoryTaskStore();
|
|
3965
3966
|
const routes = server?.apiRoutes;
|
|
3966
3967
|
const processedRoutes = routes?.map((route) => {
|
|
@@ -3998,7 +3999,8 @@ async function createHonoServer(mastra, options = {
|
|
|
3998
3999
|
bodyLimitOptions,
|
|
3999
4000
|
openapiPath: options?.isDev || server?.build?.openAPIDocs ? "/openapi.json" : void 0,
|
|
4000
4001
|
customRouteAuthConfig,
|
|
4001
|
-
customApiRoutes: processedRoutes
|
|
4002
|
+
customApiRoutes: processedRoutes,
|
|
4003
|
+
prefix: apiPrefix
|
|
4002
4004
|
});
|
|
4003
4005
|
honoServerAdapter.registerContextMiddleware();
|
|
4004
4006
|
const serverMiddleware = mastra.getServerMiddleware?.();
|
|
@@ -4052,7 +4054,7 @@ async function createHonoServer(mastra, options = {
|
|
|
4052
4054
|
);
|
|
4053
4055
|
if (options?.isDev || server?.build?.swaggerUI) {
|
|
4054
4056
|
app.get(
|
|
4055
|
-
|
|
4057
|
+
apiPrefix,
|
|
4056
4058
|
describeRoute({
|
|
4057
4059
|
description: "API Welcome Page",
|
|
4058
4060
|
tags: ["system"],
|
|
@@ -4099,7 +4101,7 @@ async function createHonoServer(mastra, options = {
|
|
|
4099
4101
|
describeRoute({
|
|
4100
4102
|
hide: true
|
|
4101
4103
|
}),
|
|
4102
|
-
middleware({ url:
|
|
4104
|
+
middleware({ url: `${apiPrefix}/openapi.json` })
|
|
4103
4105
|
);
|
|
4104
4106
|
}
|
|
4105
4107
|
if (options?.isDev) {
|
|
@@ -4112,7 +4114,7 @@ async function createHonoServer(mastra, options = {
|
|
|
4112
4114
|
);
|
|
4113
4115
|
}
|
|
4114
4116
|
const serverOptions = mastra.getServer();
|
|
4115
|
-
const studioBasePath =
|
|
4117
|
+
const studioBasePath = chunkQ57SABM6_cjs.normalizeStudioBase(serverOptions?.studioBase ?? "/");
|
|
4116
4118
|
if (options?.studio) {
|
|
4117
4119
|
app.get(
|
|
4118
4120
|
`${studioBasePath}/refresh-events`,
|
|
@@ -4161,7 +4163,7 @@ async function createHonoServer(mastra, options = {
|
|
|
4161
4163
|
}
|
|
4162
4164
|
app.get("*", async (c, next) => {
|
|
4163
4165
|
const requestPath = c.req.path;
|
|
4164
|
-
if (requestPath ===
|
|
4166
|
+
if (requestPath === apiPrefix || requestPath.startsWith(`${apiPrefix}/`) || requestPath.startsWith("/swagger-ui") || requestPath.startsWith("/openapi.json")) {
|
|
4165
4167
|
return await next();
|
|
4166
4168
|
}
|
|
4167
4169
|
if (requestPath.includes(".") && !requestPath.endsWith(".html")) {
|
|
@@ -4179,22 +4181,26 @@ async function createHonoServer(mastra, options = {
|
|
|
4179
4181
|
const protocol = key && cert ? "https" : "http";
|
|
4180
4182
|
const cloudApiEndpoint = process.env.MASTRA_CLOUD_API_ENDPOINT || "";
|
|
4181
4183
|
const experimentalFeatures = process.env.EXPERIMENTAL_FEATURES === "true" ? "true" : "false";
|
|
4184
|
+
const templatesEnabled = process.env.MASTRA_TEMPLATES === "true" ? "true" : "false";
|
|
4182
4185
|
const requestContextPresets = process.env.MASTRA_REQUEST_CONTEXT_PRESETS || "";
|
|
4186
|
+
const themeToggle = process.env.MASTRA_THEME_TOGGLE === "true" ? "true" : "false";
|
|
4183
4187
|
const escapeForHtml = (json) => {
|
|
4184
4188
|
return json.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
4185
4189
|
};
|
|
4186
4190
|
const autoDetectUrl = process.env.MASTRA_AUTO_DETECT_URL === "true";
|
|
4187
|
-
indexHtml =
|
|
4191
|
+
indexHtml = chunkQ57SABM6_cjs.injectStudioHtmlConfig(indexHtml, {
|
|
4188
4192
|
host: `'${host}'`,
|
|
4189
4193
|
port: `'${port}'`,
|
|
4190
4194
|
protocol: `'${protocol}'`,
|
|
4191
|
-
apiPrefix: `'${
|
|
4195
|
+
apiPrefix: `'${apiPrefix}'`,
|
|
4192
4196
|
basePath: studioBasePath,
|
|
4193
4197
|
hideCloudCta: `'${hideCloudCta}'`,
|
|
4194
4198
|
cloudApiEndpoint: `'${cloudApiEndpoint}'`,
|
|
4195
4199
|
experimentalFeatures: `'${experimentalFeatures}'`,
|
|
4200
|
+
templates: `'${templatesEnabled}'`,
|
|
4196
4201
|
telemetryDisabled: `''`,
|
|
4197
4202
|
requestContextPresets: `'${escapeForHtml(requestContextPresets)}'`,
|
|
4203
|
+
themeToggle: `'${themeToggle}'`,
|
|
4198
4204
|
autoDetectUrl: `'${autoDetectUrl}'`
|
|
4199
4205
|
});
|
|
4200
4206
|
return c.newResponse(indexHtml, 200, { "Content-Type": "text/html" });
|
|
@@ -4222,6 +4228,7 @@ async function createHonoServer(mastra, options = {
|
|
|
4222
4228
|
async function createNodeServer(mastra, options = { tools: {} }) {
|
|
4223
4229
|
const app = await createHonoServer(mastra, options);
|
|
4224
4230
|
const serverOptions = mastra.getServer();
|
|
4231
|
+
const apiPrefix = serverOptions?.apiPrefix ?? "/api";
|
|
4225
4232
|
const key = serverOptions?.https?.key ?? (process.env.MASTRA_HTTPS_KEY ? Buffer.from(process.env.MASTRA_HTTPS_KEY, "base64") : void 0);
|
|
4226
4233
|
const cert = serverOptions?.https?.cert ?? (process.env.MASTRA_HTTPS_CERT ? Buffer.from(process.env.MASTRA_HTTPS_CERT, "base64") : void 0);
|
|
4227
4234
|
const isHttpsEnabled = Boolean(key && cert);
|
|
@@ -4243,9 +4250,9 @@ async function createNodeServer(mastra, options = { tools: {} }) {
|
|
|
4243
4250
|
},
|
|
4244
4251
|
() => {
|
|
4245
4252
|
const logger2 = mastra.getLogger();
|
|
4246
|
-
logger2.info(` Mastra API running on ${protocol}://${host}:${port}
|
|
4253
|
+
logger2.info(` Mastra API running on ${protocol}://${host}:${port}${apiPrefix}`);
|
|
4247
4254
|
if (options?.studio) {
|
|
4248
|
-
const studioBasePath =
|
|
4255
|
+
const studioBasePath = chunkQ57SABM6_cjs.normalizeStudioBase(serverOptions?.studioBase ?? "/");
|
|
4249
4256
|
const studioUrl = `${protocol}://${host}:${port}${studioBasePath}`;
|
|
4250
4257
|
logger2.info(`\u{1F468}\u200D\u{1F4BB} Studio available at ${studioUrl}`);
|
|
4251
4258
|
}
|