@mastra/deployer-netlify 0.0.0-fix-message-embedding-20250506021742 → 0.0.0-fix-generate-title-20250616171351
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/dist/_tsup-dts-rollup.d.cts +1 -18
- package/dist/_tsup-dts-rollup.d.ts +1 -18
- package/dist/index.cjs +3 -84
- package/dist/index.js +3 -84
- package/package.json +15 -13
|
@@ -1,22 +1,5 @@
|
|
|
1
1
|
import { Deployer } from '@mastra/deployer';
|
|
2
2
|
|
|
3
|
-
export declare function getOrCreateSite({ token, name, scope }: {
|
|
4
|
-
token: string;
|
|
5
|
-
name: string;
|
|
6
|
-
scope: string;
|
|
7
|
-
}): Promise<{
|
|
8
|
-
id: string | undefined;
|
|
9
|
-
name: string | undefined;
|
|
10
|
-
url: string | undefined;
|
|
11
|
-
adminUrl: string | undefined;
|
|
12
|
-
} | {
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
ssl_url: string;
|
|
16
|
-
url: string;
|
|
17
|
-
admin_url: string;
|
|
18
|
-
}>;
|
|
19
|
-
|
|
20
3
|
export declare class NetlifyDeployer extends Deployer {
|
|
21
4
|
protected scope: string;
|
|
22
5
|
protected projectName: string;
|
|
@@ -30,7 +13,7 @@ export declare class NetlifyDeployer extends Deployer {
|
|
|
30
13
|
dir: string;
|
|
31
14
|
}): void;
|
|
32
15
|
protected installDependencies(outputDirectory: string, rootDir?: string): Promise<void>;
|
|
33
|
-
deploy(
|
|
16
|
+
deploy(): Promise<void>;
|
|
34
17
|
prepare(outputDirectory: string): Promise<void>;
|
|
35
18
|
bundle(entryFile: string, outputDirectory: string, toolsPaths: string[]): Promise<void>;
|
|
36
19
|
private getEntry;
|
|
@@ -1,22 +1,5 @@
|
|
|
1
1
|
import { Deployer } from '@mastra/deployer';
|
|
2
2
|
|
|
3
|
-
export declare function getOrCreateSite({ token, name, scope }: {
|
|
4
|
-
token: string;
|
|
5
|
-
name: string;
|
|
6
|
-
scope: string;
|
|
7
|
-
}): Promise<{
|
|
8
|
-
id: string | undefined;
|
|
9
|
-
name: string | undefined;
|
|
10
|
-
url: string | undefined;
|
|
11
|
-
adminUrl: string | undefined;
|
|
12
|
-
} | {
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
ssl_url: string;
|
|
16
|
-
url: string;
|
|
17
|
-
admin_url: string;
|
|
18
|
-
}>;
|
|
19
|
-
|
|
20
3
|
export declare class NetlifyDeployer extends Deployer {
|
|
21
4
|
protected scope: string;
|
|
22
5
|
protected projectName: string;
|
|
@@ -30,7 +13,7 @@ export declare class NetlifyDeployer extends Deployer {
|
|
|
30
13
|
dir: string;
|
|
31
14
|
}): void;
|
|
32
15
|
protected installDependencies(outputDirectory: string, rootDir?: string): Promise<void>;
|
|
33
|
-
deploy(
|
|
16
|
+
deploy(): Promise<void>;
|
|
34
17
|
prepare(outputDirectory: string): Promise<void>;
|
|
35
18
|
bundle(entryFile: string, outputDirectory: string, toolsPaths: string[]): Promise<void>;
|
|
36
19
|
private getEntry;
|
package/dist/index.cjs
CHANGED
|
@@ -4,62 +4,6 @@ var fs = require('fs');
|
|
|
4
4
|
var path = require('path');
|
|
5
5
|
var deployer = require('@mastra/deployer');
|
|
6
6
|
var services = require('@mastra/deployer/services');
|
|
7
|
-
var execa = require('execa');
|
|
8
|
-
|
|
9
|
-
// src/index.ts
|
|
10
|
-
|
|
11
|
-
// src/helpers.ts
|
|
12
|
-
async function createNetlifySite({ token, name, scope }) {
|
|
13
|
-
const response = await fetch("https://api.netlify.com/api/v1/sites", {
|
|
14
|
-
method: "POST",
|
|
15
|
-
headers: {
|
|
16
|
-
Authorization: `Bearer ${token}`,
|
|
17
|
-
"Content-Type": "application/json"
|
|
18
|
-
},
|
|
19
|
-
body: JSON.stringify({
|
|
20
|
-
name,
|
|
21
|
-
account_slug: scope,
|
|
22
|
-
// Optional - if not provided, creates in user's default account
|
|
23
|
-
force_ssl: true
|
|
24
|
-
// Enable HTTPS
|
|
25
|
-
})
|
|
26
|
-
});
|
|
27
|
-
const data = await response.json();
|
|
28
|
-
if (!response.ok) {
|
|
29
|
-
console.error(JSON.stringify(data));
|
|
30
|
-
throw new Error(`Failed to create site: ${data.message || "Unknown error"}`);
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
id: data.id,
|
|
34
|
-
name: data.name,
|
|
35
|
-
url: data.ssl_url || data.url,
|
|
36
|
-
adminUrl: data.admin_url
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
async function findNetlifySite({ token, name, scope }) {
|
|
40
|
-
const response = await fetch(`https://api.netlify.com/api/v1/${scope}/sites?filter=all&name=${name}`, {
|
|
41
|
-
headers: {
|
|
42
|
-
Authorization: `Bearer ${token}`,
|
|
43
|
-
"Content-Type": "application/json"
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
const data = await response.json();
|
|
47
|
-
if (!response.ok || !Array.isArray(data)) {
|
|
48
|
-
throw new Error(`Failed to search sites: ${data.message || "Unknown error"}`);
|
|
49
|
-
}
|
|
50
|
-
return data.find((site) => site.name === name);
|
|
51
|
-
}
|
|
52
|
-
async function getOrCreateSite({ token, name, scope }) {
|
|
53
|
-
let existingSite;
|
|
54
|
-
try {
|
|
55
|
-
existingSite = await findNetlifySite({ token, name, scope });
|
|
56
|
-
} catch {
|
|
57
|
-
}
|
|
58
|
-
if (existingSite) {
|
|
59
|
-
return existingSite;
|
|
60
|
-
}
|
|
61
|
-
return createNetlifySite({ token, name, scope });
|
|
62
|
-
}
|
|
63
7
|
|
|
64
8
|
// src/index.ts
|
|
65
9
|
var NetlifyDeployer = class extends deployer.Deployer {
|
|
@@ -102,28 +46,8 @@ to = "/.netlify/functions/api/:splat"
|
|
|
102
46
|
}
|
|
103
47
|
});
|
|
104
48
|
}
|
|
105
|
-
async deploy(
|
|
106
|
-
|
|
107
|
-
const p2 = execa.execa(
|
|
108
|
-
"npx",
|
|
109
|
-
[
|
|
110
|
-
"netlify-cli",
|
|
111
|
-
"deploy",
|
|
112
|
-
"--site",
|
|
113
|
-
site.id,
|
|
114
|
-
"--auth",
|
|
115
|
-
this.token,
|
|
116
|
-
"--dir",
|
|
117
|
-
".",
|
|
118
|
-
"--functions",
|
|
119
|
-
"./netlify/functions"
|
|
120
|
-
],
|
|
121
|
-
{
|
|
122
|
-
cwd: path.join(outputDirectory, this.outputDir)
|
|
123
|
-
}
|
|
124
|
-
);
|
|
125
|
-
p2.stdout.pipe(process.stdout);
|
|
126
|
-
await p2;
|
|
49
|
+
async deploy() {
|
|
50
|
+
this.logger?.info("Deploying to Netlify failed. Please use the Netlify dashboard to deploy.");
|
|
127
51
|
}
|
|
128
52
|
async prepare(outputDirectory) {
|
|
129
53
|
await super.prepare(outputDirectory);
|
|
@@ -160,16 +84,11 @@ to = "/.netlify/functions/api/:splat"
|
|
|
160
84
|
});
|
|
161
85
|
});
|
|
162
86
|
|
|
163
|
-
if (mastra.getStorage()) {
|
|
164
|
-
// start storage init in the background
|
|
165
|
-
mastra.getStorage().init();
|
|
166
|
-
}
|
|
167
|
-
|
|
168
87
|
registerHook(AvailableHooks.ON_EVALUATION, async traceObject => {
|
|
169
88
|
const storage = mastra.getStorage();
|
|
170
89
|
if (storage) {
|
|
171
90
|
// Check for required fields
|
|
172
|
-
const logger = mastra
|
|
91
|
+
const logger = mastra.getLogger();
|
|
173
92
|
const areFieldsValid = checkEvalStorageFields(traceObject, logger);
|
|
174
93
|
if (!areFieldsValid) return;
|
|
175
94
|
|
package/dist/index.js
CHANGED
|
@@ -2,62 +2,6 @@ import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
|
2
2
|
import { join } from 'path';
|
|
3
3
|
import { Deployer } from '@mastra/deployer';
|
|
4
4
|
import { DepsService } from '@mastra/deployer/services';
|
|
5
|
-
import { execa } from 'execa';
|
|
6
|
-
|
|
7
|
-
// src/index.ts
|
|
8
|
-
|
|
9
|
-
// src/helpers.ts
|
|
10
|
-
async function createNetlifySite({ token, name, scope }) {
|
|
11
|
-
const response = await fetch("https://api.netlify.com/api/v1/sites", {
|
|
12
|
-
method: "POST",
|
|
13
|
-
headers: {
|
|
14
|
-
Authorization: `Bearer ${token}`,
|
|
15
|
-
"Content-Type": "application/json"
|
|
16
|
-
},
|
|
17
|
-
body: JSON.stringify({
|
|
18
|
-
name,
|
|
19
|
-
account_slug: scope,
|
|
20
|
-
// Optional - if not provided, creates in user's default account
|
|
21
|
-
force_ssl: true
|
|
22
|
-
// Enable HTTPS
|
|
23
|
-
})
|
|
24
|
-
});
|
|
25
|
-
const data = await response.json();
|
|
26
|
-
if (!response.ok) {
|
|
27
|
-
console.error(JSON.stringify(data));
|
|
28
|
-
throw new Error(`Failed to create site: ${data.message || "Unknown error"}`);
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
id: data.id,
|
|
32
|
-
name: data.name,
|
|
33
|
-
url: data.ssl_url || data.url,
|
|
34
|
-
adminUrl: data.admin_url
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
async function findNetlifySite({ token, name, scope }) {
|
|
38
|
-
const response = await fetch(`https://api.netlify.com/api/v1/${scope}/sites?filter=all&name=${name}`, {
|
|
39
|
-
headers: {
|
|
40
|
-
Authorization: `Bearer ${token}`,
|
|
41
|
-
"Content-Type": "application/json"
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
const data = await response.json();
|
|
45
|
-
if (!response.ok || !Array.isArray(data)) {
|
|
46
|
-
throw new Error(`Failed to search sites: ${data.message || "Unknown error"}`);
|
|
47
|
-
}
|
|
48
|
-
return data.find((site) => site.name === name);
|
|
49
|
-
}
|
|
50
|
-
async function getOrCreateSite({ token, name, scope }) {
|
|
51
|
-
let existingSite;
|
|
52
|
-
try {
|
|
53
|
-
existingSite = await findNetlifySite({ token, name, scope });
|
|
54
|
-
} catch {
|
|
55
|
-
}
|
|
56
|
-
if (existingSite) {
|
|
57
|
-
return existingSite;
|
|
58
|
-
}
|
|
59
|
-
return createNetlifySite({ token, name, scope });
|
|
60
|
-
}
|
|
61
5
|
|
|
62
6
|
// src/index.ts
|
|
63
7
|
var NetlifyDeployer = class extends Deployer {
|
|
@@ -100,28 +44,8 @@ to = "/.netlify/functions/api/:splat"
|
|
|
100
44
|
}
|
|
101
45
|
});
|
|
102
46
|
}
|
|
103
|
-
async deploy(
|
|
104
|
-
|
|
105
|
-
const p2 = execa(
|
|
106
|
-
"npx",
|
|
107
|
-
[
|
|
108
|
-
"netlify-cli",
|
|
109
|
-
"deploy",
|
|
110
|
-
"--site",
|
|
111
|
-
site.id,
|
|
112
|
-
"--auth",
|
|
113
|
-
this.token,
|
|
114
|
-
"--dir",
|
|
115
|
-
".",
|
|
116
|
-
"--functions",
|
|
117
|
-
"./netlify/functions"
|
|
118
|
-
],
|
|
119
|
-
{
|
|
120
|
-
cwd: join(outputDirectory, this.outputDir)
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
p2.stdout.pipe(process.stdout);
|
|
124
|
-
await p2;
|
|
47
|
+
async deploy() {
|
|
48
|
+
this.logger?.info("Deploying to Netlify failed. Please use the Netlify dashboard to deploy.");
|
|
125
49
|
}
|
|
126
50
|
async prepare(outputDirectory) {
|
|
127
51
|
await super.prepare(outputDirectory);
|
|
@@ -158,16 +82,11 @@ to = "/.netlify/functions/api/:splat"
|
|
|
158
82
|
});
|
|
159
83
|
});
|
|
160
84
|
|
|
161
|
-
if (mastra.getStorage()) {
|
|
162
|
-
// start storage init in the background
|
|
163
|
-
mastra.getStorage().init();
|
|
164
|
-
}
|
|
165
|
-
|
|
166
85
|
registerHook(AvailableHooks.ON_EVALUATION, async traceObject => {
|
|
167
86
|
const storage = mastra.getStorage();
|
|
168
87
|
if (storage) {
|
|
169
88
|
// Check for required fields
|
|
170
|
-
const logger = mastra
|
|
89
|
+
const logger = mastra.getLogger();
|
|
171
90
|
const areFieldsValid = checkEvalStorageFields(traceObject, logger);
|
|
172
91
|
if (!areFieldsValid) return;
|
|
173
92
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/deployer-netlify",
|
|
3
|
-
"version": "0.0.0-fix-
|
|
3
|
+
"version": "0.0.0-fix-generate-title-20250616171351",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -27,20 +27,22 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@rollup/plugin-virtual": "^3.0.2",
|
|
29
29
|
"date-fns": "^4.1.0",
|
|
30
|
-
"execa": "^9.
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"@mastra/core": "0.0.0-fix-message-embedding-20250506021742",
|
|
34
|
-
"@mastra/deployer": "0.0.0-fix-message-embedding-20250506021742"
|
|
30
|
+
"execa": "^9.6.0",
|
|
31
|
+
"zod": "^3.25.57",
|
|
32
|
+
"@mastra/deployer": "0.0.0-fix-generate-title-20250616171351"
|
|
35
33
|
},
|
|
36
34
|
"devDependencies": {
|
|
37
|
-
"@microsoft/api-extractor": "^7.52.
|
|
38
|
-
"@types/node": "^20.
|
|
39
|
-
"eslint": "^9.
|
|
40
|
-
"tsup": "^8.
|
|
41
|
-
"typescript": "^5.8.
|
|
42
|
-
"vitest": "^3.
|
|
43
|
-
"@
|
|
35
|
+
"@microsoft/api-extractor": "^7.52.8",
|
|
36
|
+
"@types/node": "^20.19.0",
|
|
37
|
+
"eslint": "^9.28.0",
|
|
38
|
+
"tsup": "^8.5.0",
|
|
39
|
+
"typescript": "^5.8.3",
|
|
40
|
+
"vitest": "^3.2.3",
|
|
41
|
+
"@mastra/core": "0.0.0-fix-generate-title-20250616171351",
|
|
42
|
+
"@internal/lint": "0.0.0-fix-generate-title-20250616171351"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"@mastra/core": "0.0.0-fix-generate-title-20250616171351"
|
|
44
46
|
},
|
|
45
47
|
"scripts": {
|
|
46
48
|
"build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
|