@mastra/deployer-vercel 0.1.0-alpha.40 → 0.1.0-alpha.43

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 CHANGED
@@ -1,5 +1,40 @@
1
1
  # @mastra/deployer-vercel
2
2
 
3
+ ## 0.1.0-alpha.43
4
+
5
+ ### Minor Changes
6
+
7
+ - 4d4f6b6: Update deployer
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [4d4f6b6]
12
+ - @mastra/deployer@0.1.0-alpha.38
13
+ - @mastra/core@0.2.0-alpha.92
14
+
15
+ ## 0.1.0-alpha.42
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [d7d465a]
20
+ - Updated dependencies [d7d465a]
21
+ - Updated dependencies [2017553]
22
+ - Updated dependencies [a10b7a3]
23
+ - Updated dependencies [16e5b04]
24
+ - @mastra/core@0.2.0-alpha.91
25
+ - @mastra/deployer@0.1.0-alpha.37
26
+
27
+ ## 0.1.0-alpha.41
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies [8151f44]
32
+ - Updated dependencies [e897f1c]
33
+ - Updated dependencies [82a6d53]
34
+ - Updated dependencies [3700be1]
35
+ - @mastra/core@0.2.0-alpha.90
36
+ - @mastra/deployer@0.1.0-alpha.36
37
+
3
38
  ## 0.1.0-alpha.40
4
39
 
5
40
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ declare class VercelDeployer extends Deployer {
14
14
  private syncEnv;
15
15
  prepare(outputDirectory: string): Promise<void>;
16
16
  private getEntry;
17
- bundle(mastraDir: string, outputDirectory: string): Promise<void>;
17
+ bundle(entryFile: string, outputDirectory: string): Promise<void>;
18
18
  deploy(outputDirectory: string): Promise<void>;
19
19
  }
20
20
 
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Deployer } from '@mastra/deployer';
2
- import { getBundler } from '@mastra/deployer/build';
3
- import virtual from '@rollup/plugin-virtual';
2
+ import '@mastra/deployer/build';
3
+ import '@rollup/plugin-virtual';
4
4
  import * as child_process from 'child_process';
5
5
  import { writeFileSync, readFileSync } from 'fs';
6
6
  import { join } from 'path';
@@ -19,7 +19,7 @@ var VercelDeployer = class extends Deployer {
19
19
  }
20
20
  writeFiles(outputDirectory) {
21
21
  writeFileSync(
22
- join(outputDirectory, "vercel.json"),
22
+ join(outputDirectory, this.outputDir, "vercel.json"),
23
23
  JSON.stringify(
24
24
  {
25
25
  version: 2,
@@ -108,16 +108,8 @@ export const GET = handle(app);
108
108
  export const POST = handle(app);
109
109
  `;
110
110
  }
111
- async bundle(mastraDir, outputDirectory) {
112
- const bundler = await getBundler({
113
- input: "#entry",
114
- plugins: [virtual({ "#entry": this.getEntry() })]
115
- });
116
- await bundler.write({
117
- inlineDynamicImports: true,
118
- file: `${outputDirectory}/index.mjs`,
119
- format: "es"
120
- });
111
+ async bundle(entryFile, outputDirectory) {
112
+ return this._bundle(this.getEntry(), entryFile, outputDirectory);
121
113
  }
122
114
  async deploy(outputDirectory) {
123
115
  const envVars = await this.loadEnvVars();
@@ -125,7 +117,7 @@ export const POST = handle(app);
125
117
  "--scope",
126
118
  this.teamId,
127
119
  "--cwd",
128
- outputDirectory,
120
+ join(outputDirectory, this.outputDir),
129
121
  "--token",
130
122
  this.token,
131
123
  "deploy",
@@ -133,7 +125,7 @@ export const POST = handle(app);
133
125
  ...this.projectName ? ["--name", this.projectName] : []
134
126
  ];
135
127
  child_process.execSync(`npx vercel ${commandArgs.join(" ")}`, {
136
- cwd: outputDirectory,
128
+ cwd: join(outputDirectory, this.outputDir),
137
129
  env: {
138
130
  // ...this.env,
139
131
  PATH: process.env.PATH
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/deployer-vercel",
3
- "version": "0.1.0-alpha.40",
3
+ "version": "0.1.0-alpha.43",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -18,8 +18,8 @@
18
18
  "dependencies": {
19
19
  "@rollup/plugin-virtual": "^3.0.2",
20
20
  "fs-extra": "^11.2.0",
21
- "@mastra/core": "^0.2.0-alpha.89",
22
- "@mastra/deployer": "^0.1.0-alpha.35"
21
+ "@mastra/core": "^0.2.0-alpha.92",
22
+ "@mastra/deployer": "^0.1.0-alpha.38"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@babel/preset-env": "^7.26.0",
package/src/index.ts CHANGED
@@ -33,7 +33,7 @@ export class VercelDeployer extends Deployer {
33
33
 
34
34
  writeFiles(outputDirectory: string): void {
35
35
  writeFileSync(
36
- join(outputDirectory, 'vercel.json'),
36
+ join(outputDirectory, this.outputDir, 'vercel.json'),
37
37
  JSON.stringify(
38
38
  {
39
39
  version: 2,
@@ -134,17 +134,8 @@ export const POST = handle(app);
134
134
  `;
135
135
  }
136
136
 
137
- async bundle(mastraDir: string, outputDirectory: string): Promise<void> {
138
- const bundler = await getBundler({
139
- input: '#entry',
140
- plugins: [virtual({ '#entry': this.getEntry() })],
141
- });
142
-
143
- await bundler.write({
144
- inlineDynamicImports: true,
145
- file: `${outputDirectory}/index.mjs`,
146
- format: 'es',
147
- });
137
+ async bundle(entryFile: string, outputDirectory: string): Promise<void> {
138
+ return this._bundle(this.getEntry(), entryFile, outputDirectory);
148
139
  }
149
140
 
150
141
  async deploy(outputDirectory: string): Promise<void> {
@@ -155,7 +146,7 @@ export const POST = handle(app);
155
146
  '--scope',
156
147
  this.teamId as string,
157
148
  '--cwd',
158
- outputDirectory,
149
+ join(outputDirectory, this.outputDir),
159
150
  '--token',
160
151
  this.token,
161
152
  'deploy',
@@ -165,7 +156,7 @@ export const POST = handle(app);
165
156
 
166
157
  // Run the Vercel deploy command
167
158
  child_process.execSync(`npx vercel ${commandArgs.join(' ')}`, {
168
- cwd: outputDirectory,
159
+ cwd: join(outputDirectory, this.outputDir),
169
160
  env: {
170
161
  // ...this.env,
171
162
  PATH: process.env.PATH,