@mastra/deployer 1.76.0-alpha.1 → 1.76.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.
@@ -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.76.0-alpha.1"
6
+ version: "1.76.0-alpha.2"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.76.0-alpha.1",
2
+ "version": "1.76.0-alpha.2",
3
3
  "package": "@mastra/deployer",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -44,7 +44,7 @@ class CustomDeployer extends Deployer {
44
44
 
45
45
  ## Methods
46
46
 
47
- **getEnvFiles** (`() => Promise<string[]>`): Returns a list of environment files to be used during deployment. By default, it looks for '.env.production' and '.env' files.
47
+ **getEnvFiles** (`() => Promise<string[]>`): Returns the environment files to be used during deployment. By default, it returns every existing file among '.env', '.env.local', and '.env.production', in that order (lowest to highest precedence).
48
48
 
49
49
  **deploy** (`(outputDirectory: string) => Promise<void>`): Abstract method that must be implemented by subclasses. Handles the deployment process to the specified output directory.
50
50
 
@@ -65,7 +65,7 @@ The Deployer class inherits the following key methods from the Bundler class:
65
65
  The Deployer abstract class implements a structured deployment lifecycle:
66
66
 
67
67
  1. **Initialization**: The deployer is initialized with a name and creates a Deps instance for dependency management.
68
- 2. **Environment Setup**: The `getEnvFiles` method identifies environment files (.env.production, .env) to be used during deployment.
68
+ 2. **Environment Setup**: The `getEnvFiles` method identifies the environment files (`.env`, `.env.local`, `.env.production`) to be used during deployment.
69
69
  3. **Preparation**: The `prepare` method (inherited from Bundler) cleans the output directory and creates necessary subdirectories.
70
70
  4. **Bundling**: The `_bundle` method (inherited from Bundler) packages the application code and its dependencies.
71
71
  5. **Deployment**: The abstract `deploy` method is implemented by subclasses to handle the actual deployment process.
@@ -74,23 +74,16 @@ The Deployer abstract class implements a structured deployment lifecycle:
74
74
 
75
75
  The Deployer class includes built-in support for environment file management through the `getEnvFiles` method. This method:
76
76
 
77
- - Looks for environment files in a predefined order (.env.production, .env)
78
- - Uses the FileService to find the first existing file
79
- - Returns an array of found environment files
77
+ - Looks for environment files in a predefined order, from lowest to highest precedence: `.env`, `.env.local`, `.env.production`
78
+ - Returns every file that exists, in that order, so values in later files override earlier ones
80
79
  - Returns an empty array if no environment files are found
81
80
 
82
81
  ```typescript
83
82
  getEnvFiles(): Promise<string[]> {
84
- const possibleFiles = ['.env.production', '.env.local', '.env'];
83
+ const possibleFiles = ['.env', '.env.local', '.env.production'];
84
+ const fileService = new FileService();
85
85
 
86
- try {
87
- const fileService = new FileService();
88
- const envFile = fileService.getFirstExistingFile(possibleFiles);
89
-
90
- return Promise.resolve([envFile]);
91
- } catch {}
92
-
93
- return Promise.resolve([]);
86
+ return Promise.resolve(fileService.getExistingFiles(possibleFiles));
94
87
  }
95
88
  ```
96
89
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/deployer",
3
- "version": "1.76.0-alpha.1",
3
+ "version": "1.76.0-alpha.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "files": [
@@ -113,7 +113,7 @@
113
113
  "typescript-paths": "^1.5.2",
114
114
  "ws": "^8.21.3",
115
115
  "yaml": "^2.9.0",
116
- "@mastra/server": "1.76.0-alpha.1"
116
+ "@mastra/server": "1.76.0-alpha.2"
117
117
  },
118
118
  "devDependencies": {
119
119
  "@hono/node-server": "^2.0.0",
@@ -133,13 +133,13 @@
133
133
  "typescript": "^6.0.3",
134
134
  "vitest": "4.1.11",
135
135
  "zod": "^4.6.4",
136
- "@internal/types-builder": "0.0.116",
137
- "@mastra/agent-browser": "0.5.3",
138
136
  "@internal/lint": "0.0.141",
139
- "@mastra/core": "1.76.0-alpha.1",
137
+ "@internal/types-builder": "0.0.116",
138
+ "@mastra/hono": "1.7.18-alpha.2",
139
+ "@mastra/core": "1.76.0-alpha.2",
140
140
  "@mastra/mcp": "^2.2.1-alpha.0",
141
- "@mastra/server": "1.76.0-alpha.1",
142
- "@mastra/hono": "1.7.18-alpha.1"
141
+ "@mastra/server": "1.76.0-alpha.2",
142
+ "@mastra/agent-browser": "0.5.3"
143
143
  },
144
144
  "peerDependencies": {
145
145
  "@mastra/core": ">=1.58.0-0 <2.0.0-0"