@mastra/deployer-netlify 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 +1485 -4
- package/LICENSE.md +15 -0
- package/README.md +60 -46
- package/dist/_types/rollup/dist/rollup.d.ts +1225 -0
- package/dist/index.cjs +151 -110
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +126 -103
- package/dist/index.js.map +1 -1
- package/package.json +22 -19
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,14 +5,14 @@ A Netlify deployer for Mastra applications.
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- Deploy Mastra applications to Netlify Functions
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
8
|
+
- Generates Netlify Frameworks API configuration during build
|
|
9
|
+
- Bundles functions with optimized settings for serverless environments
|
|
10
|
+
- Routes all requests through a single API endpoint
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
|
|
15
|
+
npm install @mastra/deployer-netlify
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Usage
|
|
@@ -20,69 +20,83 @@ pnpm add @mastra/deployer-netlify
|
|
|
20
20
|
The Netlify deployer is used as part of the Mastra framework:
|
|
21
21
|
|
|
22
22
|
```typescript
|
|
23
|
-
import { Mastra } from '@mastra/core';
|
|
23
|
+
import { Mastra } from '@mastra/core/mastra';
|
|
24
24
|
import { NetlifyDeployer } from '@mastra/deployer-netlify';
|
|
25
25
|
|
|
26
|
-
const deployer = new NetlifyDeployer({
|
|
27
|
-
scope: 'your-team-id',
|
|
28
|
-
projectName: 'your-project-name',
|
|
29
|
-
token: 'your-netlify-token',
|
|
30
|
-
});
|
|
31
|
-
|
|
32
26
|
const mastra = new Mastra({
|
|
33
|
-
deployer,
|
|
34
|
-
// ... other Mastra configuration options
|
|
27
|
+
deployer: new NetlifyDeployer(),
|
|
35
28
|
});
|
|
36
29
|
```
|
|
37
30
|
|
|
38
|
-
## Configuration
|
|
39
|
-
|
|
40
|
-
### Constructor Options
|
|
41
|
-
|
|
42
|
-
- `scope` (required): Your Netlify team slug or ID
|
|
43
|
-
- `projectName`: Name of your Netlify site (will be created if it doesn't exist)
|
|
44
|
-
- `token`: Your Netlify authentication token
|
|
45
|
-
|
|
46
31
|
## Project Structure
|
|
47
32
|
|
|
48
33
|
The deployer automatically creates the following structure:
|
|
49
34
|
|
|
50
|
-
```
|
|
35
|
+
```bash
|
|
51
36
|
your-project/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
└──
|
|
37
|
+
└── .netlify/
|
|
38
|
+
└── v1/
|
|
39
|
+
├── config.json
|
|
40
|
+
└── functions/
|
|
41
|
+
└── api/
|
|
42
|
+
├── index.js
|
|
43
|
+
├── package.json
|
|
44
|
+
└── node_modules/
|
|
56
45
|
```
|
|
57
46
|
|
|
58
|
-
###
|
|
47
|
+
### Netlify Frameworks API Configuration
|
|
48
|
+
|
|
49
|
+
The deployer uses Netlify's [Frameworks API](https://docs.netlify.com/build/frameworks/frameworks-api/) and generates a `.netlify/v1/config.json` file to configure functions and routing for Netlify.
|
|
50
|
+
|
|
51
|
+
Generated configuration:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"functions": {
|
|
56
|
+
"directory": ".netlify/v1/functions",
|
|
57
|
+
"node_bundler": "none",
|
|
58
|
+
"included_files": [".netlify/v1/functions/**"]
|
|
59
|
+
},
|
|
60
|
+
"redirects": [
|
|
61
|
+
{
|
|
62
|
+
"force": true,
|
|
63
|
+
"from": "/*",
|
|
64
|
+
"to": "/.netlify/functions/api/:splat",
|
|
65
|
+
"status": 200
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
```
|
|
59
70
|
|
|
60
|
-
|
|
71
|
+
This configuration:
|
|
61
72
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
directory = "/netlify/functions"
|
|
73
|
+
- Tells Netlify where to find your functions
|
|
74
|
+
- Disables Netlify's bundling (Mastra pre-bundles for optimization)
|
|
75
|
+
- Routes all requests to your Mastra API function
|
|
66
76
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
77
|
+
## How It Works
|
|
78
|
+
|
|
79
|
+
The Netlify deployer:
|
|
80
|
+
|
|
81
|
+
1. **Bundles your Mastra application** into optimized serverless functions
|
|
82
|
+
2. **Creates the Frameworks API configuration** automatically
|
|
83
|
+
3. **Handles all routing** through a single API endpoint
|
|
84
|
+
4. **Pre-optimizes dependencies** for serverless environments
|
|
73
85
|
|
|
74
86
|
## Environment Variables
|
|
75
87
|
|
|
76
|
-
Environment variables are handled
|
|
88
|
+
Environment variables are handled through:
|
|
77
89
|
|
|
78
90
|
- `.env` files in your project
|
|
79
|
-
-
|
|
80
|
-
-
|
|
91
|
+
- Netlify's environment variable dashboard
|
|
92
|
+
- Runtime environment variable access in your Mastra app
|
|
93
|
+
|
|
94
|
+
## Deployment
|
|
81
95
|
|
|
82
|
-
|
|
96
|
+
Deploy your Mastra application to Netlify by:
|
|
83
97
|
|
|
84
|
-
|
|
98
|
+
1. **Building locally**: Run your build command (the deployer handles bundling)
|
|
99
|
+
2. **Using Netlify CLI**: `netlify deploy --prod`
|
|
100
|
+
3. **Via Git integration**: Connect your repository to Netlify for automatic deployments
|
|
85
101
|
|
|
86
|
-
|
|
87
|
-
2. Configure the site with your environment variables
|
|
88
|
-
3. Deploy your application to Netlify Functions
|
|
102
|
+
The deployer automatically configures everything needed for Netlify Functions.
|