@mastra/deployer-netlify 0.10.7-alpha.2 → 0.11.0-alpha.3
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 -11
- package/dist/_tsup-dts-rollup.d.ts +1 -11
- package/dist/index.cjs +25 -30
- package/dist/index.js +20 -29
- package/package.json +5 -3
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import { Deployer } from '@mastra/deployer';
|
|
2
2
|
|
|
3
3
|
export declare class NetlifyDeployer extends Deployer {
|
|
4
|
-
|
|
5
|
-
protected projectName: string;
|
|
6
|
-
protected token: string;
|
|
7
|
-
constructor({ scope, projectName, token }: {
|
|
8
|
-
scope: string;
|
|
9
|
-
projectName: string;
|
|
10
|
-
token: string;
|
|
11
|
-
});
|
|
12
|
-
writeFiles({ dir }: {
|
|
13
|
-
dir: string;
|
|
14
|
-
}): void;
|
|
4
|
+
constructor();
|
|
15
5
|
protected installDependencies(outputDirectory: string, rootDir?: string): Promise<void>;
|
|
16
6
|
deploy(): Promise<void>;
|
|
17
7
|
prepare(outputDirectory: string): Promise<void>;
|
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import { Deployer } from '@mastra/deployer';
|
|
2
2
|
|
|
3
3
|
export declare class NetlifyDeployer extends Deployer {
|
|
4
|
-
|
|
5
|
-
protected projectName: string;
|
|
6
|
-
protected token: string;
|
|
7
|
-
constructor({ scope, projectName, token }: {
|
|
8
|
-
scope: string;
|
|
9
|
-
projectName: string;
|
|
10
|
-
token: string;
|
|
11
|
-
});
|
|
12
|
-
writeFiles({ dir }: {
|
|
13
|
-
dir: string;
|
|
14
|
-
}): void;
|
|
4
|
+
constructor();
|
|
15
5
|
protected installDependencies(outputDirectory: string, rootDir?: string): Promise<void>;
|
|
16
6
|
deploy(): Promise<void>;
|
|
17
7
|
prepare(outputDirectory: string): Promise<void>;
|
package/dist/index.cjs
CHANGED
|
@@ -1,40 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var fs = require('fs');
|
|
4
3
|
var path = require('path');
|
|
4
|
+
var process = require('process');
|
|
5
5
|
var deployer = require('@mastra/deployer');
|
|
6
6
|
var services = require('@mastra/deployer/services');
|
|
7
|
+
var esm = require('fs-extra/esm');
|
|
8
|
+
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var process__default = /*#__PURE__*/_interopDefault(process);
|
|
7
12
|
|
|
8
13
|
// src/index.ts
|
|
9
14
|
var NetlifyDeployer = class extends deployer.Deployer {
|
|
10
|
-
|
|
11
|
-
projectName;
|
|
12
|
-
token;
|
|
13
|
-
constructor({ scope, projectName, token }) {
|
|
15
|
+
constructor() {
|
|
14
16
|
super({ name: "NETLIFY" });
|
|
15
|
-
this.
|
|
16
|
-
this.projectName = projectName;
|
|
17
|
-
this.token = token;
|
|
17
|
+
this.outputDir = path.join(".netlify", "v1", "functions", "api");
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
if (!fs.existsSync(path.join(dir, "netlify/functions/api"))) {
|
|
21
|
-
fs.mkdirSync(path.join(dir, "netlify/functions/api"), { recursive: true });
|
|
22
|
-
}
|
|
23
|
-
fs.writeFileSync(
|
|
24
|
-
path.join(dir, "netlify.toml"),
|
|
25
|
-
`[functions]
|
|
26
|
-
node_bundler = "esbuild"
|
|
27
|
-
directory = "netlify/functions"
|
|
28
|
-
|
|
29
|
-
[[redirects]]
|
|
30
|
-
force = true
|
|
31
|
-
from = "/*"
|
|
32
|
-
status = 200
|
|
33
|
-
to = "/.netlify/functions/api/:splat"
|
|
34
|
-
`
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
async installDependencies(outputDirectory, rootDir = process.cwd()) {
|
|
19
|
+
async installDependencies(outputDirectory, rootDir = process__default.default.cwd()) {
|
|
38
20
|
const deps = new services.DepsService(rootDir);
|
|
39
21
|
deps.__setLogger(this.logger);
|
|
40
22
|
await deps.install({
|
|
@@ -51,16 +33,29 @@ to = "/.netlify/functions/api/:splat"
|
|
|
51
33
|
}
|
|
52
34
|
async prepare(outputDirectory) {
|
|
53
35
|
await super.prepare(outputDirectory);
|
|
54
|
-
this.writeFiles({ dir: path.join(outputDirectory, this.outputDir) });
|
|
55
36
|
}
|
|
56
37
|
async bundle(entryFile, outputDirectory, toolsPaths) {
|
|
57
|
-
|
|
38
|
+
const result = await this._bundle(
|
|
58
39
|
this.getEntry(),
|
|
59
40
|
entryFile,
|
|
60
41
|
outputDirectory,
|
|
61
42
|
toolsPaths,
|
|
62
|
-
path.join(outputDirectory, this.outputDir
|
|
43
|
+
path.join(outputDirectory, this.outputDir)
|
|
63
44
|
);
|
|
45
|
+
await esm.writeJson(path.join(outputDirectory, ".netlify", "v1", "config.json"), {
|
|
46
|
+
redirects: [
|
|
47
|
+
{
|
|
48
|
+
force: true,
|
|
49
|
+
from: "/*",
|
|
50
|
+
to: "/.netlify/functions/api/:splat",
|
|
51
|
+
status: 200
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
await esm.move(path.join(outputDirectory, ".netlify", "v1"), path.join(process__default.default.cwd(), ".netlify", "v1"), {
|
|
56
|
+
overwrite: true
|
|
57
|
+
});
|
|
58
|
+
return result;
|
|
64
59
|
}
|
|
65
60
|
getEntry() {
|
|
66
61
|
return `
|
package/dist/index.js
CHANGED
|
@@ -1,36 +1,14 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
2
1
|
import { join } from 'path';
|
|
2
|
+
import process from 'process';
|
|
3
3
|
import { Deployer } from '@mastra/deployer';
|
|
4
4
|
import { DepsService } from '@mastra/deployer/services';
|
|
5
|
+
import { writeJson, move } from 'fs-extra/esm';
|
|
5
6
|
|
|
6
7
|
// src/index.ts
|
|
7
8
|
var NetlifyDeployer = class extends Deployer {
|
|
8
|
-
|
|
9
|
-
projectName;
|
|
10
|
-
token;
|
|
11
|
-
constructor({ scope, projectName, token }) {
|
|
9
|
+
constructor() {
|
|
12
10
|
super({ name: "NETLIFY" });
|
|
13
|
-
this.
|
|
14
|
-
this.projectName = projectName;
|
|
15
|
-
this.token = token;
|
|
16
|
-
}
|
|
17
|
-
writeFiles({ dir }) {
|
|
18
|
-
if (!existsSync(join(dir, "netlify/functions/api"))) {
|
|
19
|
-
mkdirSync(join(dir, "netlify/functions/api"), { recursive: true });
|
|
20
|
-
}
|
|
21
|
-
writeFileSync(
|
|
22
|
-
join(dir, "netlify.toml"),
|
|
23
|
-
`[functions]
|
|
24
|
-
node_bundler = "esbuild"
|
|
25
|
-
directory = "netlify/functions"
|
|
26
|
-
|
|
27
|
-
[[redirects]]
|
|
28
|
-
force = true
|
|
29
|
-
from = "/*"
|
|
30
|
-
status = 200
|
|
31
|
-
to = "/.netlify/functions/api/:splat"
|
|
32
|
-
`
|
|
33
|
-
);
|
|
11
|
+
this.outputDir = join(".netlify", "v1", "functions", "api");
|
|
34
12
|
}
|
|
35
13
|
async installDependencies(outputDirectory, rootDir = process.cwd()) {
|
|
36
14
|
const deps = new DepsService(rootDir);
|
|
@@ -49,16 +27,29 @@ to = "/.netlify/functions/api/:splat"
|
|
|
49
27
|
}
|
|
50
28
|
async prepare(outputDirectory) {
|
|
51
29
|
await super.prepare(outputDirectory);
|
|
52
|
-
this.writeFiles({ dir: join(outputDirectory, this.outputDir) });
|
|
53
30
|
}
|
|
54
31
|
async bundle(entryFile, outputDirectory, toolsPaths) {
|
|
55
|
-
|
|
32
|
+
const result = await this._bundle(
|
|
56
33
|
this.getEntry(),
|
|
57
34
|
entryFile,
|
|
58
35
|
outputDirectory,
|
|
59
36
|
toolsPaths,
|
|
60
|
-
join(outputDirectory, this.outputDir
|
|
37
|
+
join(outputDirectory, this.outputDir)
|
|
61
38
|
);
|
|
39
|
+
await writeJson(join(outputDirectory, ".netlify", "v1", "config.json"), {
|
|
40
|
+
redirects: [
|
|
41
|
+
{
|
|
42
|
+
force: true,
|
|
43
|
+
from: "/*",
|
|
44
|
+
to: "/.netlify/functions/api/:splat",
|
|
45
|
+
status: 200
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
await move(join(outputDirectory, ".netlify", "v1"), join(process.cwd(), ".netlify", "v1"), {
|
|
50
|
+
overwrite: true
|
|
51
|
+
});
|
|
52
|
+
return result;
|
|
62
53
|
}
|
|
63
54
|
getEntry() {
|
|
64
55
|
return `
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/deployer-netlify",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0-alpha.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -28,17 +28,19 @@
|
|
|
28
28
|
"@rollup/plugin-virtual": "^3.0.2",
|
|
29
29
|
"date-fns": "^4.1.0",
|
|
30
30
|
"execa": "^9.6.0",
|
|
31
|
+
"fs-extra": "^11.3.0",
|
|
31
32
|
"zod": "^3.25.67",
|
|
32
|
-
"@mastra/deployer": "^0.10.7-alpha.
|
|
33
|
+
"@mastra/deployer": "^0.10.7-alpha.3"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
36
|
"@microsoft/api-extractor": "^7.52.8",
|
|
37
|
+
"@types/fs-extra": "^11.0.4",
|
|
36
38
|
"@types/node": "^20.19.0",
|
|
37
39
|
"eslint": "^9.29.0",
|
|
38
40
|
"tsup": "^8.5.0",
|
|
39
41
|
"typescript": "^5.8.3",
|
|
40
42
|
"vitest": "^3.2.3",
|
|
41
|
-
"@mastra/core": "0.10.7-alpha.
|
|
43
|
+
"@mastra/core": "0.10.7-alpha.3",
|
|
42
44
|
"@internal/lint": "0.0.13"
|
|
43
45
|
},
|
|
44
46
|
"peerDependencies": {
|