@mastra/deployer-cloudflare 0.0.0-error-handler-fix-20251020202607 → 0.0.0-esbuild-bundle-worker-20260807182016
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 +1550 -4
- package/LICENSE.md +15 -0
- package/README.md +6 -44
- package/dist/babel/mastra-instance-wrapper.d.ts +3 -3
- package/dist/babel/mastra-instance-wrapper.d.ts.map +1 -1
- package/dist/babel/postgres-store-instance-checker.d.ts +3 -3
- package/dist/babel/postgres-store-instance-checker.d.ts.map +1 -1
- package/dist/index.cjs +342 -269
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +16 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +319 -246
- package/dist/index.js.map +1 -1
- package/dist/plugins/mastra-instance-wrapper.d.ts.map +1 -1
- package/dist/plugins/postgres-store-instance-checker.d.ts.map +1 -1
- package/dist/secrets-manager/index.cjs +67 -87
- package/dist/secrets-manager/index.cjs.map +1 -1
- package/dist/secrets-manager/index.js +66 -85
- package/dist/secrets-manager/index.js.map +1 -1
- package/package.json +31 -20
- package/dist/plugins/__fixtures__/basic.d.ts +0 -5
- package/dist/plugins/__fixtures__/basic.d.ts.map +0 -1
- package/dist/plugins/__fixtures__/empty-mastra.d.ts +0 -3
- package/dist/plugins/__fixtures__/empty-mastra.d.ts.map +0 -1
- package/dist/plugins/__fixtures__/multiple-postgres-stores.d.ts +0 -6
- package/dist/plugins/__fixtures__/multiple-postgres-stores.d.ts.map +0 -1
package/LICENSE.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
Portions of this software are licensed as follows:
|
|
2
|
+
|
|
3
|
+
- All content that resides under any directory named "ee/" within this
|
|
4
|
+
repository, including but not limited to:
|
|
5
|
+
- `packages/core/src/auth/ee/`
|
|
6
|
+
- `packages/server/src/server/auth/ee/`
|
|
7
|
+
is licensed under the license defined in `ee/LICENSE`.
|
|
8
|
+
|
|
9
|
+
- All third-party components incorporated into the Mastra Software are
|
|
10
|
+
licensed under the original license provided by the owner of the
|
|
11
|
+
applicable component.
|
|
12
|
+
|
|
13
|
+
- Content outside of the above-mentioned directories or restrictions is
|
|
14
|
+
available under the "Apache License 2.0" as defined below.
|
|
15
|
+
|
|
1
16
|
# Apache License 2.0
|
|
2
17
|
|
|
3
18
|
Copyright (c) 2025 Kepler Software, Inc.
|
package/README.md
CHANGED
|
@@ -5,8 +5,6 @@ A Cloudflare Workers deployer for Mastra applications.
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- Deploy Mastra applications to Cloudflare Workers
|
|
8
|
-
- Configure custom domains and routes
|
|
9
|
-
- Support for worker namespaces
|
|
10
8
|
- Automatic environment variable configuration
|
|
11
9
|
|
|
12
10
|
## Installation
|
|
@@ -20,12 +18,11 @@ pnpm add @mastra/deployer-cloudflare
|
|
|
20
18
|
The Cloudflare deployer is used as part of the Mastra framework:
|
|
21
19
|
|
|
22
20
|
```typescript
|
|
23
|
-
import { Mastra } from '@mastra/core';
|
|
21
|
+
import { Mastra } from '@mastra/core/mastra';
|
|
24
22
|
import { CloudflareDeployer } from '@mastra/deployer-cloudflare';
|
|
25
23
|
|
|
26
24
|
const deployer = new CloudflareDeployer({
|
|
27
|
-
|
|
28
|
-
projectName: 'your-project-name',
|
|
25
|
+
name: 'your-project-name',
|
|
29
26
|
routes: [
|
|
30
27
|
{
|
|
31
28
|
pattern: 'example.com/*',
|
|
@@ -33,10 +30,8 @@ const deployer = new CloudflareDeployer({
|
|
|
33
30
|
custom_domain: true,
|
|
34
31
|
},
|
|
35
32
|
],
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
apiToken: 'your-api-token',
|
|
39
|
-
apiEmail: 'your-email',
|
|
33
|
+
assets: {
|
|
34
|
+
directory: './assets/',
|
|
40
35
|
},
|
|
41
36
|
});
|
|
42
37
|
|
|
@@ -48,18 +43,9 @@ const mastra = new Mastra({
|
|
|
48
43
|
|
|
49
44
|
## Configuration
|
|
50
45
|
|
|
51
|
-
|
|
46
|
+
The `CloudflareDeployer` constructor accepts the same configuration options as `wrangler.json`. See the [Wrangler configuration documentation](https://developers.cloudflare.com/workers/wrangler/configuration/) for all available options.
|
|
52
47
|
|
|
53
|
-
|
|
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
|
|
48
|
+
**Deprecated fields:** If migrating from an earlier version, note that `projectName`, `d1Databases`, `kvNamespaces`, and `workerNamespace` are deprecated. Use the standard `wrangler.json` property names instead (`name`, `d1_databases`, `kv_namespaces`).
|
|
63
49
|
|
|
64
50
|
## Environment Variables
|
|
65
51
|
|
|
@@ -68,30 +54,6 @@ The deployer will automatically load environment variables from:
|
|
|
68
54
|
- `.env` files in your project
|
|
69
55
|
- Environment variables passed through the Mastra configuration
|
|
70
56
|
|
|
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
57
|
## Requirements
|
|
96
58
|
|
|
97
59
|
- Cloudflare account with Workers enabled
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PluginObject } from '@babel/core';
|
|
2
2
|
/**
|
|
3
3
|
* Babel plugin that transforms Mastra exports for Cloudflare Workers compatibility.
|
|
4
4
|
*
|
|
@@ -11,7 +11,7 @@ import type { PluginObj } from '@babel/core';
|
|
|
11
11
|
* The transformation ensures the Mastra instance is properly scoped and initialized
|
|
12
12
|
* for each request in the Cloudflare Workers environment.
|
|
13
13
|
*
|
|
14
|
-
* @returns {
|
|
14
|
+
* @returns {PluginObject} A Babel plugin object with a visitor that performs the transformation
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* // Before transformation:
|
|
@@ -20,5 +20,5 @@ import type { PluginObj } from '@babel/core';
|
|
|
20
20
|
* // After transformation:
|
|
21
21
|
* export const mastra = () => new Mastra();
|
|
22
22
|
*/
|
|
23
|
-
export declare function mastraInstanceWrapper():
|
|
23
|
+
export declare function mastraInstanceWrapper(): PluginObject;
|
|
24
24
|
//# sourceMappingURL=mastra-instance-wrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mastra-instance-wrapper.d.ts","sourceRoot":"","sources":["../../src/babel/mastra-instance-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"mastra-instance-wrapper.d.ts","sourceRoot":"","sources":["../../src/babel/mastra-instance-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,IAAI,YAAY,CAyBpD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PluginObject } from '@babel/core';
|
|
2
2
|
/**
|
|
3
3
|
* Babel plugin that enforces singleton PostgresStore instances in Cloudflare Workers.
|
|
4
4
|
*
|
|
@@ -10,12 +10,12 @@ import type { PluginObj } from '@babel/core';
|
|
|
10
10
|
* Cloudflare Workers should only create one PostgresStore instance to avoid connection
|
|
11
11
|
* pool exhaustion and ensure proper resource management.
|
|
12
12
|
*
|
|
13
|
-
* @returns {
|
|
13
|
+
* @returns {PluginObject} A Babel plugin object that validates PostgresStore usage
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* // Throws error if multiple instances found:
|
|
17
17
|
* const store1 = new PostgresStore();
|
|
18
18
|
* const store2 = new PostgresStore(); // Error thrown here
|
|
19
19
|
*/
|
|
20
|
-
export declare function postgresStoreInstanceChecker():
|
|
20
|
+
export declare function postgresStoreInstanceChecker(): PluginObject;
|
|
21
21
|
//# sourceMappingURL=postgres-store-instance-checker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres-store-instance-checker.d.ts","sourceRoot":"","sources":["../../src/babel/postgres-store-instance-checker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,
|
|
1
|
+
{"version":3,"file":"postgres-store-instance-checker.d.ts","sourceRoot":"","sources":["../../src/babel/postgres-store-instance-checker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,YAAY,EAAE,MAAM,aAAa,CAAC;AAI1D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,4BAA4B,IAAI,YAAY,CAkC3D"}
|