@mastra/deployer-vercel 0.0.0-taofeeqInngest-20250603090617 → 0.0.0-testing-cloud-studios-20260114234039
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 +4003 -0
- package/LICENSE.md +11 -42
- package/README.md +10 -7
- package/dist/index.cjs +52 -189
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +16 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +53 -171
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +13 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +33 -19
- package/dist/_tsup-dts-rollup.d.cts +0 -23
- package/dist/_tsup-dts-rollup.d.ts +0 -23
- package/dist/index.d.cts +0 -1
package/dist/index.js
CHANGED
|
@@ -1,213 +1,93 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { readFileSync, writeFileSync, readdirSync } from 'fs';
|
|
1
|
+
import { writeFileSync } from 'fs';
|
|
3
2
|
import { join } from 'path';
|
|
4
3
|
import process from 'process';
|
|
5
4
|
import { Deployer } from '@mastra/deployer';
|
|
5
|
+
import { move } from 'fs-extra/esm';
|
|
6
6
|
|
|
7
7
|
// src/index.ts
|
|
8
8
|
var VercelDeployer = class extends Deployer {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
token;
|
|
12
|
-
constructor({ teamSlug, projectName, token }) {
|
|
9
|
+
vcConfigOverrides = {};
|
|
10
|
+
constructor(options = {}) {
|
|
13
11
|
super({ name: "VERCEL" });
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
16
|
-
this.token = token;
|
|
17
|
-
}
|
|
18
|
-
getProjectId({ dir }) {
|
|
19
|
-
const projectJsonPath = join(dir, "output", ".vercel", "project.json");
|
|
20
|
-
try {
|
|
21
|
-
const projectJson = JSON.parse(readFileSync(projectJsonPath, "utf-8"));
|
|
22
|
-
return projectJson.projectId;
|
|
23
|
-
} catch {
|
|
24
|
-
throw new Error("Could not find project ID. Make sure the project has been deployed first.");
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
async getTeamId() {
|
|
28
|
-
const response = await fetch(`https://api.vercel.com/v2/teams`, {
|
|
29
|
-
headers: {
|
|
30
|
-
Authorization: `Bearer ${this.token}`
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
const res = await response.json();
|
|
34
|
-
const teams = res.teams;
|
|
35
|
-
return teams.find((team) => team.slug === this.teamSlug)?.id;
|
|
36
|
-
}
|
|
37
|
-
async syncEnv(envVars, { outputDirectory }) {
|
|
38
|
-
console.log("Syncing environment variables...");
|
|
39
|
-
const vercelEnvVars = Array.from(envVars.entries()).map(([key, value]) => {
|
|
40
|
-
if (!key || !value) {
|
|
41
|
-
throw new Error(`Invalid environment variable format: ${key || value}`);
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
key,
|
|
45
|
-
value,
|
|
46
|
-
target: ["production", "preview", "development"],
|
|
47
|
-
type: "plain"
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
try {
|
|
51
|
-
const projectId = this.getProjectId({ dir: outputDirectory });
|
|
52
|
-
const teamId = await this.getTeamId();
|
|
53
|
-
const response = await fetch(
|
|
54
|
-
`https://api.vercel.com/v10/projects/${projectId}/env?teamId=${teamId}&upsert=true`,
|
|
55
|
-
{
|
|
56
|
-
method: "POST",
|
|
57
|
-
headers: {
|
|
58
|
-
Authorization: `Bearer ${this.token}`,
|
|
59
|
-
"Content-Type": "application/json"
|
|
60
|
-
},
|
|
61
|
-
body: JSON.stringify(vercelEnvVars)
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
if (!response.ok) {
|
|
65
|
-
const error = await response.json();
|
|
66
|
-
throw new Error(`Failed to sync environment variables: ${error.message}`);
|
|
67
|
-
}
|
|
68
|
-
console.log("\u2713 Successfully synced environment variables");
|
|
69
|
-
} catch (error) {
|
|
70
|
-
if (error instanceof Error) {
|
|
71
|
-
console.error("Failed to sync environment variables:", error.message);
|
|
72
|
-
} else {
|
|
73
|
-
console.error("Failed to sync environment variables:", error);
|
|
74
|
-
}
|
|
75
|
-
throw error;
|
|
76
|
-
}
|
|
12
|
+
this.outputDir = join(".vercel", "output", "functions", "index.func");
|
|
13
|
+
this.vcConfigOverrides = { ...options };
|
|
77
14
|
}
|
|
78
15
|
async prepare(outputDirectory) {
|
|
79
16
|
await super.prepare(outputDirectory);
|
|
17
|
+
this.writeVercelJSON(join(outputDirectory, this.outputDir, "..", ".."));
|
|
80
18
|
}
|
|
81
19
|
getEntry() {
|
|
82
20
|
return `
|
|
83
21
|
import { handle } from 'hono/vercel'
|
|
84
22
|
import { mastra } from '#mastra';
|
|
85
|
-
import { createHonoServer } from '#server';
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import { TABLE_EVALS } from '@mastra/core/storage';
|
|
89
|
-
import { checkEvalStorageFields } from '@mastra/core/utils';
|
|
23
|
+
import { createHonoServer, getToolExports } from '#server';
|
|
24
|
+
import { tools } from '#tools';
|
|
25
|
+
import { scoreTracesWorkflow } from '@mastra/core/evals/scoreTraces';
|
|
90
26
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
input,
|
|
95
|
-
metric,
|
|
96
|
-
output,
|
|
97
|
-
runId,
|
|
98
|
-
globalRunId: runId,
|
|
99
|
-
instructions,
|
|
100
|
-
});
|
|
101
|
-
});
|
|
27
|
+
if (mastra.getStorage()) {
|
|
28
|
+
mastra.__registerInternalWorkflow(scoreTracesWorkflow);
|
|
29
|
+
}
|
|
102
30
|
|
|
103
|
-
|
|
104
|
-
const storage = mastra.getStorage();
|
|
105
|
-
if (storage) {
|
|
106
|
-
// Check for required fields
|
|
107
|
-
const logger = mastra?.getLogger();
|
|
108
|
-
const areFieldsValid = checkEvalStorageFields(traceObject, logger);
|
|
109
|
-
if (!areFieldsValid) return;
|
|
110
|
-
|
|
111
|
-
await storage.insert({
|
|
112
|
-
tableName: TABLE_EVALS,
|
|
113
|
-
record: {
|
|
114
|
-
input: traceObject.input,
|
|
115
|
-
output: traceObject.output,
|
|
116
|
-
result: JSON.stringify(traceObject.result || {}),
|
|
117
|
-
agent_name: traceObject.agentName,
|
|
118
|
-
metric_name: traceObject.metricName,
|
|
119
|
-
instructions: traceObject.instructions,
|
|
120
|
-
test_info: null,
|
|
121
|
-
global_run_id: traceObject.globalRunId,
|
|
122
|
-
run_id: traceObject.runId,
|
|
123
|
-
created_at: new Date().toISOString(),
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
const app = await createHonoServer(mastra);
|
|
31
|
+
const app = await createHonoServer(mastra, { tools: getToolExports(tools) });
|
|
130
32
|
|
|
131
33
|
export const GET = handle(app);
|
|
132
34
|
export const POST = handle(app);
|
|
133
35
|
export const PUT = handle(app);
|
|
134
36
|
export const DELETE = handle(app);
|
|
37
|
+
export const PATCH = handle(app);
|
|
135
38
|
export const OPTIONS = handle(app);
|
|
136
39
|
export const HEAD = handle(app);
|
|
137
40
|
`;
|
|
138
41
|
}
|
|
139
|
-
writeVercelJSON(outputDirectory
|
|
42
|
+
writeVercelJSON(outputDirectory) {
|
|
140
43
|
writeFileSync(
|
|
141
|
-
join(outputDirectory,
|
|
142
|
-
JSON.stringify(
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
],
|
|
153
|
-
routes: [
|
|
154
|
-
{
|
|
155
|
-
src: "/(.*)",
|
|
156
|
-
dest: "index.mjs"
|
|
157
|
-
}
|
|
158
|
-
]
|
|
159
|
-
},
|
|
160
|
-
null,
|
|
161
|
-
2
|
|
162
|
-
)
|
|
44
|
+
join(outputDirectory, "config.json"),
|
|
45
|
+
JSON.stringify({
|
|
46
|
+
version: 3,
|
|
47
|
+
routes: [
|
|
48
|
+
{
|
|
49
|
+
src: "/(.*)",
|
|
50
|
+
dest: "/"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
})
|
|
163
54
|
);
|
|
164
55
|
}
|
|
165
|
-
async bundle(entryFile, outputDirectory, toolsPaths) {
|
|
166
|
-
const result = await this._bundle(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
(
|
|
56
|
+
async bundle(entryFile, outputDirectory, { toolsPaths, projectRoot }) {
|
|
57
|
+
const result = await this._bundle(
|
|
58
|
+
this.getEntry(),
|
|
59
|
+
entryFile,
|
|
60
|
+
{ outputDirectory, projectRoot },
|
|
61
|
+
toolsPaths,
|
|
62
|
+
join(outputDirectory, this.outputDir)
|
|
172
63
|
);
|
|
173
|
-
|
|
64
|
+
const nodeVersion = process.version?.split(".")?.[0]?.replace("v", "") ?? "22";
|
|
65
|
+
const vcConfig = {
|
|
66
|
+
handler: "index.mjs",
|
|
67
|
+
launcherType: "Nodejs",
|
|
68
|
+
runtime: `nodejs${nodeVersion}.x`,
|
|
69
|
+
shouldAddHelpers: true
|
|
70
|
+
};
|
|
71
|
+
const { maxDuration, memory, regions } = this.vcConfigOverrides;
|
|
72
|
+
if (typeof maxDuration === "number") vcConfig.maxDuration = maxDuration;
|
|
73
|
+
if (typeof memory === "number") vcConfig.memory = memory;
|
|
74
|
+
if (Array.isArray(regions) && regions.length > 0) vcConfig.regions = regions;
|
|
75
|
+
writeFileSync(join(outputDirectory, this.outputDir, ".vc-config.json"), JSON.stringify(vcConfig, null, 2));
|
|
76
|
+
await move(join(outputDirectory, ".vercel", "output"), join(process.cwd(), ".vercel", "output"), {
|
|
77
|
+
overwrite: true
|
|
78
|
+
});
|
|
174
79
|
return result;
|
|
175
80
|
}
|
|
176
|
-
async deploy(
|
|
177
|
-
|
|
178
|
-
const commandArgs = [
|
|
179
|
-
"--scope",
|
|
180
|
-
this.teamSlug,
|
|
181
|
-
"--cwd",
|
|
182
|
-
join(outputDirectory, this.outputDir),
|
|
183
|
-
"--token",
|
|
184
|
-
this.token,
|
|
185
|
-
"deploy",
|
|
186
|
-
"--yes",
|
|
187
|
-
...this.projectName ? ["--name", this.projectName] : []
|
|
188
|
-
];
|
|
189
|
-
child_process.execSync(`npx vercel ${commandArgs.join(" ")}`, {
|
|
190
|
-
cwd: join(outputDirectory, this.outputDir),
|
|
191
|
-
env: {
|
|
192
|
-
PATH: process.env.PATH
|
|
193
|
-
},
|
|
194
|
-
stdio: "inherit"
|
|
195
|
-
});
|
|
196
|
-
this.logger.info("Deployment started on Vercel. You can wait for it to finish or exit this command.");
|
|
197
|
-
if (envVars.size > 0) {
|
|
198
|
-
await this.syncEnv(envVars, { outputDirectory });
|
|
199
|
-
} else {
|
|
200
|
-
this.logger.info("\nAdd your ENV vars to .env or your vercel dashboard.\n");
|
|
201
|
-
}
|
|
81
|
+
async deploy() {
|
|
82
|
+
this.logger?.info("Deploying to Vercel is deprecated. Please use the Vercel dashboard to deploy.");
|
|
202
83
|
}
|
|
203
84
|
async lint(entryFile, outputDirectory, toolsPaths) {
|
|
204
|
-
await super.lint(entryFile, outputDirectory, toolsPaths);
|
|
205
85
|
await super.lint(entryFile, outputDirectory, toolsPaths);
|
|
206
86
|
const hasLibsql = await this.deps.checkDependencies(["@mastra/libsql"]) === `ok`;
|
|
207
87
|
if (hasLibsql) {
|
|
208
88
|
this.logger.error(
|
|
209
89
|
`Vercel Deployer does not support @libsql/client(which may have been installed by @mastra/libsql) as a dependency.
|
|
210
|
-
|
|
90
|
+
Use other Mastra Storage options instead e.g @mastra/pg`
|
|
211
91
|
);
|
|
212
92
|
process.exit(1);
|
|
213
93
|
}
|
|
@@ -215,3 +95,5 @@ export const HEAD = handle(app);
|
|
|
215
95
|
};
|
|
216
96
|
|
|
217
97
|
export { VercelDeployer };
|
|
98
|
+
//# sourceMappingURL=index.js.map
|
|
99
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mapp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EAAQ,KAAK,+EAA+E,CAAA;AAAA,EACnG;AAAA,EAEA,MAAM,IAAA,CAAK,SAAA,EAAmB,eAAA,EAAyB,UAAA,EAAkD;AACvG,IAAA,MAAM,KAAA,CAAM,IAAA,CAAK,SAAA,EAAW,eAAA,EAAiB,UAAU,CAAA;AAEvD,IAAA,MAAM,SAAA,GAAa,MAAM,IAAA,CAAK,IAAA,CAAK,kBAAkB,CAAC,gBAAgB,CAAC,CAAA,KAAO,CAAA,EAAA,CAAA;AAE9E,IAAA,IAAI,SAAA,EAAW;AACb,MAAA,IAAA,CAAK,MAAA,CAAO,KAAA;AAAA,QACV,CAAA;AAAA,2DAAA;AAAA,OAEF;AACA,MAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,IAChB;AAAA,EACF;AACF","file":"index.js","sourcesContent":["import { writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport process from 'node:process';\nimport { Deployer } from '@mastra/deployer';\nimport { move } from 'fs-extra/esm';\nimport type { VcConfig, VcConfigOverrides, VercelDeployerOptions } from './types';\n\nexport class VercelDeployer extends Deployer {\n private vcConfigOverrides: VcConfigOverrides = {};\n\n constructor(options: VercelDeployerOptions = {}) {\n super({ name: 'VERCEL' });\n this.outputDir = join('.vercel', 'output', 'functions', 'index.func');\n\n // Store all overrides centrally\n this.vcConfigOverrides = { ...options };\n }\n\n async prepare(outputDirectory: string): Promise<void> {\n await super.prepare(outputDirectory);\n\n this.writeVercelJSON(join(outputDirectory, this.outputDir, '..', '..'));\n }\n\n private getEntry(): string {\n return `\nimport { handle } from 'hono/vercel'\nimport { mastra } from '#mastra';\nimport { createHonoServer, getToolExports } from '#server';\nimport { tools } from '#tools';\nimport { scoreTracesWorkflow } from '@mastra/core/evals/scoreTraces';\n\nif (mastra.getStorage()) {\n mastra.__registerInternalWorkflow(scoreTracesWorkflow);\n}\n\nconst app = await createHonoServer(mastra, { tools: getToolExports(tools) });\n\nexport const GET = handle(app);\nexport const POST = handle(app);\nexport const PUT = handle(app);\nexport const DELETE = handle(app);\nexport const PATCH = handle(app);\nexport const OPTIONS = handle(app);\nexport const HEAD = handle(app);\n`;\n }\n\n private writeVercelJSON(outputDirectory: string) {\n writeFileSync(\n join(outputDirectory, 'config.json'),\n JSON.stringify({\n version: 3,\n routes: [\n {\n src: '/(.*)',\n dest: '/',\n },\n ],\n }),\n );\n }\n\n async bundle(\n entryFile: string,\n outputDirectory: string,\n { toolsPaths, projectRoot }: { toolsPaths: (string | string[])[]; projectRoot: string },\n ): Promise<void> {\n const result = await this._bundle(\n this.getEntry(),\n entryFile,\n { outputDirectory, projectRoot },\n toolsPaths,\n join(outputDirectory, this.outputDir),\n );\n\n const nodeVersion = process.version?.split('.')?.[0]?.replace('v', '') ?? '22';\n\n const vcConfig: VcConfig = {\n handler: 'index.mjs',\n launcherType: 'Nodejs',\n runtime: `nodejs${nodeVersion}.x`,\n shouldAddHelpers: true,\n };\n\n // Merge supported overrides\n const { maxDuration, memory, regions } = this.vcConfigOverrides;\n if (typeof maxDuration === 'number') vcConfig.maxDuration = maxDuration;\n if (typeof memory === 'number') vcConfig.memory = memory;\n if (Array.isArray(regions) && regions.length > 0) vcConfig.regions = regions;\n\n writeFileSync(join(outputDirectory, this.outputDir, '.vc-config.json'), JSON.stringify(vcConfig, null, 2));\n\n await move(join(outputDirectory, '.vercel', 'output'), join(process.cwd(), '.vercel', 'output'), {\n overwrite: true,\n });\n\n return result;\n }\n\n async deploy(): Promise<void> {\n this.logger?.info('Deploying to Vercel is deprecated. Please use the Vercel dashboard to deploy.');\n }\n\n async lint(entryFile: string, outputDirectory: string, toolsPaths: (string | string[])[]): Promise<void> {\n await super.lint(entryFile, outputDirectory, toolsPaths);\n\n const hasLibsql = (await this.deps.checkDependencies(['@mastra/libsql'])) === `ok`;\n\n if (hasLibsql) {\n this.logger.error(\n `Vercel Deployer does not support @libsql/client(which may have been installed by @mastra/libsql) as a dependency. \n\t\t\t\tUse other Mastra Storage options instead e.g @mastra/pg`,\n );\n process.exit(1);\n }\n }\n}\n"]}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type VcConfig = {
|
|
2
|
+
handler: string;
|
|
3
|
+
launcherType: 'Nodejs';
|
|
4
|
+
runtime: string;
|
|
5
|
+
shouldAddHelpers: boolean;
|
|
6
|
+
maxDuration?: number;
|
|
7
|
+
memory?: number;
|
|
8
|
+
regions?: string[];
|
|
9
|
+
};
|
|
10
|
+
export type VcConfigOverrides = Pick<VcConfig, 'maxDuration' | 'memory' | 'regions'>;
|
|
11
|
+
export interface VercelDeployerOptions extends VcConfigOverrides {
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,QAAQ,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,QAAQ,EAAE,aAAa,GAAG,QAAQ,GAAG,SAAS,CAAC,CAAC;AAErF,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;CAAG"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/deployer-vercel",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-testing-cloud-studios-20260114234039",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
|
-
"dist"
|
|
7
|
+
"dist",
|
|
8
|
+
"CHANGELOG.md"
|
|
8
9
|
],
|
|
9
10
|
"main": "dist/index.js",
|
|
10
11
|
"types": "dist/index.d.ts",
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
"default": "./dist/index.js"
|
|
16
17
|
},
|
|
17
18
|
"require": {
|
|
18
|
-
"types": "./dist/index.d.
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
19
20
|
"default": "./dist/index.cjs"
|
|
20
21
|
}
|
|
21
22
|
},
|
|
@@ -23,29 +24,42 @@
|
|
|
23
24
|
},
|
|
24
25
|
"keywords": [],
|
|
25
26
|
"author": "",
|
|
26
|
-
"license": "
|
|
27
|
+
"license": "Apache-2.0",
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"@mastra/deployer": "0.0.0-taofeeqInngest-20250603090617"
|
|
29
|
+
"fs-extra": "^11.3.3",
|
|
30
|
+
"@mastra/deployer": "0.0.0-testing-cloud-studios-20260114234039"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@
|
|
34
|
-
"@types/node": "
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"@internal/lint": "0.0.0-
|
|
33
|
+
"@types/fs-extra": "^11.0.4",
|
|
34
|
+
"@types/node": "22.13.17",
|
|
35
|
+
"@vitest/coverage-v8": "4.0.12",
|
|
36
|
+
"@vitest/ui": "4.0.12",
|
|
37
|
+
"eslint": "^9.37.0",
|
|
38
|
+
"tsup": "^8.5.0",
|
|
39
|
+
"typescript": "^5.9.3",
|
|
40
|
+
"vitest": "4.0.16",
|
|
41
|
+
"@internal/lint": "0.0.0-testing-cloud-studios-20260114234039",
|
|
42
|
+
"@internal/types-builder": "0.0.0-testing-cloud-studios-20260114234039",
|
|
43
|
+
"@mastra/core": "0.0.0-testing-cloud-studios-20260114234039"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://mastra.ai",
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "git+https://github.com/mastra-ai/mastra.git",
|
|
49
|
+
"directory": "deployers/vercel"
|
|
50
|
+
},
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/mastra-ai/mastra/issues"
|
|
42
53
|
},
|
|
43
54
|
"peerDependencies": {
|
|
44
|
-
"@mastra/core": "
|
|
55
|
+
"@mastra/core": "0.0.0-testing-cloud-studios-20260114234039"
|
|
56
|
+
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=22.13.0"
|
|
45
59
|
},
|
|
46
60
|
"scripts": {
|
|
47
|
-
"build": "tsup
|
|
48
|
-
"build:watch": "
|
|
61
|
+
"build": "tsup --silent --config tsup.config.ts",
|
|
62
|
+
"build:watch": "tsup --watch --silent --config tsup.config.ts",
|
|
49
63
|
"test": "vitest run",
|
|
50
64
|
"lint": "eslint ."
|
|
51
65
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Deployer } from '@mastra/deployer';
|
|
2
|
-
|
|
3
|
-
export declare class VercelDeployer extends Deployer {
|
|
4
|
-
private teamSlug;
|
|
5
|
-
private projectName;
|
|
6
|
-
private token;
|
|
7
|
-
constructor({ teamSlug, projectName, token }: {
|
|
8
|
-
teamSlug: string;
|
|
9
|
-
projectName: string;
|
|
10
|
-
token: string;
|
|
11
|
-
});
|
|
12
|
-
private getProjectId;
|
|
13
|
-
private getTeamId;
|
|
14
|
-
private syncEnv;
|
|
15
|
-
prepare(outputDirectory: string): Promise<void>;
|
|
16
|
-
private getEntry;
|
|
17
|
-
private writeVercelJSON;
|
|
18
|
-
bundle(entryFile: string, outputDirectory: string, toolsPaths: string[]): Promise<void>;
|
|
19
|
-
deploy(outputDirectory: string): Promise<void>;
|
|
20
|
-
lint(entryFile: string, outputDirectory: string, toolsPaths: string[]): Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { }
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Deployer } from '@mastra/deployer';
|
|
2
|
-
|
|
3
|
-
export declare class VercelDeployer extends Deployer {
|
|
4
|
-
private teamSlug;
|
|
5
|
-
private projectName;
|
|
6
|
-
private token;
|
|
7
|
-
constructor({ teamSlug, projectName, token }: {
|
|
8
|
-
teamSlug: string;
|
|
9
|
-
projectName: string;
|
|
10
|
-
token: string;
|
|
11
|
-
});
|
|
12
|
-
private getProjectId;
|
|
13
|
-
private getTeamId;
|
|
14
|
-
private syncEnv;
|
|
15
|
-
prepare(outputDirectory: string): Promise<void>;
|
|
16
|
-
private getEntry;
|
|
17
|
-
private writeVercelJSON;
|
|
18
|
-
bundle(entryFile: string, outputDirectory: string, toolsPaths: string[]): Promise<void>;
|
|
19
|
-
deploy(outputDirectory: string): Promise<void>;
|
|
20
|
-
lint(entryFile: string, outputDirectory: string, toolsPaths: string[]): Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { }
|
package/dist/index.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { VercelDeployer } from './_tsup-dts-rollup.cjs';
|