@mastra/deployer-netlify 0.1.0-alpha.39 → 0.1.0-alpha.41
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 +19 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -19
- package/package.json +3 -3
- package/src/helpers.ts +0 -1
- package/src/index.ts +9 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @mastra/deployer-netlify
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.41
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [b80ea8d]
|
|
8
|
+
- @mastra/deployer@0.1.0-alpha.34
|
|
9
|
+
|
|
10
|
+
## 0.1.0-alpha.40
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- 4d4f6b6: Update deployer
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [4d4f6b6]
|
|
19
|
+
- @mastra/deployer@0.1.0-alpha.38
|
|
20
|
+
- @mastra/core@0.2.0-alpha.92
|
|
21
|
+
|
|
3
22
|
## 0.1.0-alpha.39
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ declare class NetlifyDeployer extends Deployer {
|
|
|
14
14
|
}): void;
|
|
15
15
|
deploy(outputDirectory: string): Promise<void>;
|
|
16
16
|
prepare(outputDirectory: string): Promise<void>;
|
|
17
|
-
bundle(
|
|
17
|
+
bundle(entryFile: string, outputDirectory: string): Promise<void>;
|
|
18
18
|
private getEntry;
|
|
19
19
|
}
|
|
20
20
|
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Deployer } from '@mastra/deployer';
|
|
2
|
-
import { getBundler } from '@mastra/deployer/build';
|
|
3
|
-
import virtual from '@rollup/plugin-virtual';
|
|
4
2
|
import { execa } from 'execa';
|
|
5
3
|
import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
6
4
|
import { join } from 'path';
|
|
@@ -9,7 +7,6 @@ import { join } from 'path';
|
|
|
9
7
|
|
|
10
8
|
// src/helpers.ts
|
|
11
9
|
async function createNetlifySite({ token, name, scope }) {
|
|
12
|
-
console.log(token, name, scope);
|
|
13
10
|
const response = await fetch("https://api.netlify.com/api/v1/sites", {
|
|
14
11
|
method: "POST",
|
|
15
12
|
headers: {
|
|
@@ -107,7 +104,7 @@ to = "/.netlify/functions/api/:splat"
|
|
|
107
104
|
"./netlify/functions"
|
|
108
105
|
],
|
|
109
106
|
{
|
|
110
|
-
cwd: outputDirectory
|
|
107
|
+
cwd: join(outputDirectory, this.outputDir)
|
|
111
108
|
}
|
|
112
109
|
);
|
|
113
110
|
p2.stdout.pipe(process.stdout);
|
|
@@ -115,22 +112,15 @@ to = "/.netlify/functions/api/:splat"
|
|
|
115
112
|
}
|
|
116
113
|
async prepare(outputDirectory) {
|
|
117
114
|
await super.prepare(outputDirectory);
|
|
118
|
-
|
|
119
|
-
mkdirSync(join(outputDirectory, "netlify/functions/api"), { recursive: true });
|
|
120
|
-
}
|
|
121
|
-
this.writeFiles({ dir: outputDirectory });
|
|
115
|
+
this.writeFiles({ dir: join(outputDirectory, this.outputDir) });
|
|
122
116
|
}
|
|
123
|
-
async bundle(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
inlineDynamicImports: true,
|
|
131
|
-
file: join(outputDirectory, "netlify", "functions", "api", "index.mjs"),
|
|
132
|
-
format: "es"
|
|
133
|
-
});
|
|
117
|
+
async bundle(entryFile, outputDirectory) {
|
|
118
|
+
return this._bundle(
|
|
119
|
+
this.getEntry(),
|
|
120
|
+
entryFile,
|
|
121
|
+
outputDirectory,
|
|
122
|
+
join(outputDirectory, this.outputDir, "netlify", "functions", "api")
|
|
123
|
+
);
|
|
134
124
|
}
|
|
135
125
|
getEntry() {
|
|
136
126
|
return `
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/deployer-netlify",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.41",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"execa": "^9.3.1",
|
|
23
23
|
"netlify-cli": "^18.0.1",
|
|
24
24
|
"zod": "^3.24.1",
|
|
25
|
-
"@mastra/core": "^0.2.0-alpha.
|
|
26
|
-
"@mastra/deployer": "^0.1.0-alpha.
|
|
25
|
+
"@mastra/core": "^0.2.0-alpha.92",
|
|
26
|
+
"@mastra/deployer": "^0.1.0-alpha.34"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@babel/preset-env": "^7.26.0",
|
package/src/helpers.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Deployer } from '@mastra/deployer';
|
|
2
|
-
import { getBundler } from '@mastra/deployer/build';
|
|
3
|
-
import virtual from '@rollup/plugin-virtual';
|
|
4
2
|
import { execa } from 'execa';
|
|
5
3
|
import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
6
4
|
import { join } from 'path';
|
|
@@ -59,7 +57,7 @@ to = "/.netlify/functions/api/:splat"
|
|
|
59
57
|
'./netlify/functions',
|
|
60
58
|
],
|
|
61
59
|
{
|
|
62
|
-
cwd: outputDirectory,
|
|
60
|
+
cwd: join(outputDirectory, this.outputDir),
|
|
63
61
|
},
|
|
64
62
|
);
|
|
65
63
|
|
|
@@ -70,25 +68,16 @@ to = "/.netlify/functions/api/:splat"
|
|
|
70
68
|
async prepare(outputDirectory: string): Promise<void> {
|
|
71
69
|
await super.prepare(outputDirectory);
|
|
72
70
|
|
|
73
|
-
|
|
74
|
-
if (!existsSync(join(outputDirectory, 'netlify/functions/api'))) {
|
|
75
|
-
mkdirSync(join(outputDirectory, 'netlify/functions/api'), { recursive: true });
|
|
76
|
-
}
|
|
77
|
-
this.writeFiles({ dir: outputDirectory });
|
|
71
|
+
this.writeFiles({ dir: join(outputDirectory, this.outputDir) });
|
|
78
72
|
}
|
|
79
73
|
|
|
80
|
-
async bundle(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
await bundler.write({
|
|
88
|
-
inlineDynamicImports: true,
|
|
89
|
-
file: join(outputDirectory, 'netlify', 'functions', 'api', 'index.mjs'),
|
|
90
|
-
format: 'es',
|
|
91
|
-
});
|
|
74
|
+
async bundle(entryFile: string, outputDirectory: string): Promise<void> {
|
|
75
|
+
return this._bundle(
|
|
76
|
+
this.getEntry(),
|
|
77
|
+
entryFile,
|
|
78
|
+
outputDirectory,
|
|
79
|
+
join(outputDirectory, this.outputDir, 'netlify', 'functions', 'api'),
|
|
80
|
+
);
|
|
92
81
|
}
|
|
93
82
|
|
|
94
83
|
private getEntry(): string {
|