@mastra/deployer-cloudflare 0.0.1-alpha.25 → 0.0.1-alpha.29
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 +31 -0
- package/README.md +99 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @mastra/deployer-cloudflare
|
|
2
2
|
|
|
3
|
+
## 0.0.1-alpha.29
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [9fb3039]
|
|
8
|
+
- @mastra/core@0.1.27-alpha.81
|
|
9
|
+
- @mastra/deployer@0.0.1-alpha.26
|
|
10
|
+
|
|
11
|
+
## 0.0.1-alpha.28
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [327ece7]
|
|
16
|
+
- @mastra/core@0.1.27-alpha.80
|
|
17
|
+
- @mastra/deployer@0.0.1-alpha.25
|
|
18
|
+
|
|
19
|
+
## 0.0.1-alpha.27
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [21fe536]
|
|
24
|
+
- @mastra/core@0.1.27-alpha.79
|
|
25
|
+
- @mastra/deployer@0.0.1-alpha.24
|
|
26
|
+
|
|
27
|
+
## 0.0.1-alpha.26
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [88f18d7]
|
|
32
|
+
- @mastra/deployer@0.0.1-alpha.23
|
|
33
|
+
|
|
3
34
|
## 0.0.1-alpha.25
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
package/README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# @mastra/deployer-cloudflare
|
|
2
|
+
|
|
3
|
+
A Cloudflare Workers deployer for Mastra applications.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Deploy Mastra applications to Cloudflare Workers
|
|
8
|
+
- Configure custom domains and routes
|
|
9
|
+
- Support for worker namespaces
|
|
10
|
+
- Automatic environment variable configuration
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm add @mastra/deployer-cloudflare
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
The Cloudflare deployer is used as part of the Mastra framework:
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { Mastra } from '@mastra/core';
|
|
24
|
+
import { CloudflareDeployer } from '@mastra/deployer-cloudflare';
|
|
25
|
+
|
|
26
|
+
const deployer = new CloudflareDeployer({
|
|
27
|
+
scope: 'your-account-id',
|
|
28
|
+
projectName: 'your-project-name',
|
|
29
|
+
routes: [
|
|
30
|
+
{
|
|
31
|
+
pattern: 'example.com/*',
|
|
32
|
+
zone_name: 'example.com',
|
|
33
|
+
custom_domain: true,
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
workerNamespace: 'your-namespace',
|
|
37
|
+
auth: {
|
|
38
|
+
apiToken: 'your-api-token',
|
|
39
|
+
apiEmail: 'your-email',
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const mastra = new Mastra({
|
|
44
|
+
deployer,
|
|
45
|
+
// ... other Mastra configuration options
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Configuration
|
|
50
|
+
|
|
51
|
+
### Constructor Options
|
|
52
|
+
|
|
53
|
+
- `scope` (required): Your Cloudflare account ID
|
|
54
|
+
- `projectName`: Name of your worker project
|
|
55
|
+
- `routes`: Array of route configurations for your worker
|
|
56
|
+
- `pattern`: URL pattern to match
|
|
57
|
+
- `zone_name`: Domain zone name
|
|
58
|
+
- `custom_domain`: Whether to use a custom domain
|
|
59
|
+
- `workerNamespace`: Namespace for your worker
|
|
60
|
+
- `auth`: Cloudflare authentication details
|
|
61
|
+
- `apiToken`: Your Cloudflare API token
|
|
62
|
+
- `apiEmail`: Your Cloudflare account email
|
|
63
|
+
|
|
64
|
+
## Environment Variables
|
|
65
|
+
|
|
66
|
+
The deployer will automatically load environment variables from:
|
|
67
|
+
|
|
68
|
+
- `.env` files in your project
|
|
69
|
+
- Environment variables passed through the Mastra configuration
|
|
70
|
+
|
|
71
|
+
## Routes
|
|
72
|
+
|
|
73
|
+
Routes can be configured to direct traffic to your worker based on URL patterns and domains:
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
const routes = [
|
|
77
|
+
{
|
|
78
|
+
pattern: 'api.example.com/*',
|
|
79
|
+
zone_name: 'example.com',
|
|
80
|
+
custom_domain: true,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
pattern: 'example.com/api/*',
|
|
84
|
+
zone_name: 'example.com',
|
|
85
|
+
},
|
|
86
|
+
];
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Each route requires:
|
|
90
|
+
|
|
91
|
+
- `pattern`: URL pattern to match
|
|
92
|
+
- `zone_name`: Domain zone name
|
|
93
|
+
- `custom_domain`: (optional) Set to true to use a custom domain
|
|
94
|
+
|
|
95
|
+
## Requirements
|
|
96
|
+
|
|
97
|
+
- Cloudflare account with Workers enabled
|
|
98
|
+
- API token with appropriate permissions
|
|
99
|
+
- Domain(s) configured in Cloudflare (for custom domains)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/deployer-cloudflare",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.29",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"execa": "^9.3.1",
|
|
27
27
|
"wrangler": "^3.103.2",
|
|
28
28
|
"zod": "^3.24.1",
|
|
29
|
-
"@mastra/core": "0.1.27-alpha.
|
|
30
|
-
"@mastra/deployer": "0.0.1-alpha.
|
|
29
|
+
"@mastra/core": "0.1.27-alpha.81",
|
|
30
|
+
"@mastra/deployer": "0.0.1-alpha.26"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@babel/preset-env": "^7.26.0",
|