@mastra/deployer-netlify 0.0.1-alpha.3 → 0.0.1-alpha.30
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 +220 -0
- package/README.md +86 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +116 -5
- package/package.json +9 -18
- package/src/index.ts +1 -1
- package/tsconfig.json +1 -6
- package/vitest.config.ts +1 -1
- package/dist/deployer-netlify.cjs.development.js +0 -551
- package/dist/deployer-netlify.cjs.development.js.map +0 -1
- package/dist/deployer-netlify.cjs.production.min.js +0 -2
- package/dist/deployer-netlify.cjs.production.min.js.map +0 -1
- package/dist/deployer-netlify.esm.js +0 -547
- package/dist/deployer-netlify.esm.js.map +0 -1
- package/dist/helpers.d.ts +0 -6
- package/dist/helpers.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,225 @@
|
|
|
1
1
|
# @mastra/deployer-netlify
|
|
2
2
|
|
|
3
|
+
## 0.0.1-alpha.30
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9625602: Use mastra core splitted bundles in other packages
|
|
8
|
+
- Updated dependencies [2ab57d6]
|
|
9
|
+
- Updated dependencies [30322ce]
|
|
10
|
+
- Updated dependencies [78eec7c]
|
|
11
|
+
- Updated dependencies [9625602]
|
|
12
|
+
- Updated dependencies [8769a62]
|
|
13
|
+
- @mastra/deployer@0.0.1-alpha.28
|
|
14
|
+
- @mastra/core@0.2.0-alpha.83
|
|
15
|
+
|
|
16
|
+
## 0.0.1-alpha.29
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [73d112c]
|
|
21
|
+
- Updated dependencies [ac8c61a]
|
|
22
|
+
- @mastra/deployer@0.0.1-alpha.27
|
|
23
|
+
- @mastra/core@0.1.27-alpha.82
|
|
24
|
+
|
|
25
|
+
## 0.0.1-alpha.28
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- Updated dependencies [9fb3039]
|
|
30
|
+
- @mastra/core@0.1.27-alpha.81
|
|
31
|
+
- @mastra/deployer@0.0.1-alpha.26
|
|
32
|
+
|
|
33
|
+
## 0.0.1-alpha.27
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Updated dependencies [327ece7]
|
|
38
|
+
- @mastra/core@0.1.27-alpha.80
|
|
39
|
+
- @mastra/deployer@0.0.1-alpha.25
|
|
40
|
+
|
|
41
|
+
## 0.0.1-alpha.26
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- Updated dependencies [21fe536]
|
|
46
|
+
- @mastra/core@0.1.27-alpha.79
|
|
47
|
+
- @mastra/deployer@0.0.1-alpha.24
|
|
48
|
+
|
|
49
|
+
## 0.0.1-alpha.25
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- Updated dependencies [88f18d7]
|
|
54
|
+
- @mastra/deployer@0.0.1-alpha.23
|
|
55
|
+
|
|
56
|
+
## 0.0.1-alpha.24
|
|
57
|
+
|
|
58
|
+
### Patch Changes
|
|
59
|
+
|
|
60
|
+
- 44c7c26: Rebuild
|
|
61
|
+
|
|
62
|
+
## 0.0.1-alpha.23
|
|
63
|
+
|
|
64
|
+
### Patch Changes
|
|
65
|
+
|
|
66
|
+
- Updated dependencies [685108a]
|
|
67
|
+
- Updated dependencies [685108a]
|
|
68
|
+
- @mastra/deployer@0.0.1-alpha.22
|
|
69
|
+
- @mastra/core@0.1.27-alpha.78
|
|
70
|
+
|
|
71
|
+
## 0.0.1-alpha.22
|
|
72
|
+
|
|
73
|
+
### Patch Changes
|
|
74
|
+
|
|
75
|
+
- 2b75edf: mastra deployers tsup bundling
|
|
76
|
+
- Updated dependencies [8105fae]
|
|
77
|
+
- Updated dependencies [cfb966f]
|
|
78
|
+
- @mastra/core@0.1.27-alpha.77
|
|
79
|
+
- @mastra/deployer@0.0.1-alpha.21
|
|
80
|
+
|
|
81
|
+
## 0.0.1-alpha.21
|
|
82
|
+
|
|
83
|
+
### Patch Changes
|
|
84
|
+
|
|
85
|
+
- Updated dependencies [ae7bf94]
|
|
86
|
+
- Updated dependencies [ae7bf94]
|
|
87
|
+
- @mastra/deployer@0.0.1-alpha.20
|
|
88
|
+
- @mastra/core@0.1.27-alpha.76
|
|
89
|
+
|
|
90
|
+
## 0.0.1-alpha.20
|
|
91
|
+
|
|
92
|
+
### Patch Changes
|
|
93
|
+
|
|
94
|
+
- Updated dependencies [23dcb23]
|
|
95
|
+
- Updated dependencies [7064554]
|
|
96
|
+
- @mastra/core@0.1.27-alpha.75
|
|
97
|
+
- @mastra/deployer@0.0.1-alpha.19
|
|
98
|
+
|
|
99
|
+
## 0.0.1-alpha.19
|
|
100
|
+
|
|
101
|
+
### Patch Changes
|
|
102
|
+
|
|
103
|
+
- Updated dependencies [7b87567]
|
|
104
|
+
- @mastra/core@0.1.27-alpha.74
|
|
105
|
+
- @mastra/deployer@0.0.1-alpha.18
|
|
106
|
+
|
|
107
|
+
## 0.0.1-alpha.18
|
|
108
|
+
|
|
109
|
+
### Patch Changes
|
|
110
|
+
|
|
111
|
+
- Updated dependencies [3427b95]
|
|
112
|
+
- @mastra/core@0.1.27-alpha.73
|
|
113
|
+
- @mastra/deployer@0.0.1-alpha.17
|
|
114
|
+
|
|
115
|
+
## 0.0.1-alpha.17
|
|
116
|
+
|
|
117
|
+
### Patch Changes
|
|
118
|
+
|
|
119
|
+
- Updated dependencies [e4d4ede]
|
|
120
|
+
- Updated dependencies [06b2c0a]
|
|
121
|
+
- @mastra/core@0.1.27-alpha.72
|
|
122
|
+
- @mastra/deployer@0.0.1-alpha.16
|
|
123
|
+
|
|
124
|
+
## 0.0.1-alpha.16
|
|
125
|
+
|
|
126
|
+
### Patch Changes
|
|
127
|
+
|
|
128
|
+
- Updated dependencies [d9c8dd0]
|
|
129
|
+
- @mastra/deployer@0.0.1-alpha.15
|
|
130
|
+
- @mastra/core@0.1.27-alpha.71
|
|
131
|
+
|
|
132
|
+
## 0.0.1-alpha.15
|
|
133
|
+
|
|
134
|
+
### Patch Changes
|
|
135
|
+
|
|
136
|
+
- Updated dependencies [ad2cd74]
|
|
137
|
+
- @mastra/deployer@0.0.1-alpha.14
|
|
138
|
+
|
|
139
|
+
## 0.0.1-alpha.14
|
|
140
|
+
|
|
141
|
+
### Patch Changes
|
|
142
|
+
|
|
143
|
+
- Updated dependencies [a1774e7]
|
|
144
|
+
- @mastra/deployer@0.0.1-alpha.13
|
|
145
|
+
|
|
146
|
+
## 0.0.1-alpha.13
|
|
147
|
+
|
|
148
|
+
### Patch Changes
|
|
149
|
+
|
|
150
|
+
- Updated dependencies [28dceab]
|
|
151
|
+
- @mastra/deployer@0.0.1-alpha.12
|
|
152
|
+
|
|
153
|
+
## 0.0.1-alpha.12
|
|
154
|
+
|
|
155
|
+
### Patch Changes
|
|
156
|
+
|
|
157
|
+
- bdaf834: publish packages
|
|
158
|
+
- Updated dependencies [bdaf834]
|
|
159
|
+
- @mastra/deployer@0.0.1-alpha.11
|
|
160
|
+
|
|
161
|
+
## 0.0.1-alpha.11
|
|
162
|
+
|
|
163
|
+
### Patch Changes
|
|
164
|
+
|
|
165
|
+
- Updated dependencies [dd6d87f]
|
|
166
|
+
- Updated dependencies [04434b6]
|
|
167
|
+
- @mastra/core@0.1.27-alpha.70
|
|
168
|
+
- @mastra/deployer@0.0.1-alpha.10
|
|
169
|
+
|
|
170
|
+
## 0.0.1-alpha.10
|
|
171
|
+
|
|
172
|
+
### Patch Changes
|
|
173
|
+
|
|
174
|
+
- Updated dependencies [9066f95]
|
|
175
|
+
- @mastra/deployer@0.0.1-alpha.9
|
|
176
|
+
|
|
177
|
+
## 0.0.1-alpha.9
|
|
178
|
+
|
|
179
|
+
### Patch Changes
|
|
180
|
+
|
|
181
|
+
- 0d5a03d: Vector store modules
|
|
182
|
+
|
|
183
|
+
## 0.0.1-alpha.8
|
|
184
|
+
|
|
185
|
+
### Patch Changes
|
|
186
|
+
|
|
187
|
+
- Updated dependencies [b425845]
|
|
188
|
+
- @mastra/deployer@0.0.1-alpha.8
|
|
189
|
+
|
|
190
|
+
## 0.0.1-alpha.7
|
|
191
|
+
|
|
192
|
+
### Patch Changes
|
|
193
|
+
|
|
194
|
+
- Updated dependencies [1944807]
|
|
195
|
+
- Updated dependencies [9ade36e]
|
|
196
|
+
- @mastra/deployer@0.0.1-alpha.7
|
|
197
|
+
- @mastra/core@0.1.27-alpha.69
|
|
198
|
+
|
|
199
|
+
## 0.0.1-alpha.6
|
|
200
|
+
|
|
201
|
+
### Patch Changes
|
|
202
|
+
|
|
203
|
+
- Updated dependencies [291fe57]
|
|
204
|
+
- Updated dependencies [1a41fbf]
|
|
205
|
+
- @mastra/deployer@0.0.1-alpha.6
|
|
206
|
+
|
|
207
|
+
## 0.0.1-alpha.5
|
|
208
|
+
|
|
209
|
+
### Patch Changes
|
|
210
|
+
|
|
211
|
+
- Updated dependencies [0be7181]
|
|
212
|
+
- Updated dependencies [0be7181]
|
|
213
|
+
- @mastra/core@0.1.27-alpha.68
|
|
214
|
+
- @mastra/deployer@0.0.1-alpha.5
|
|
215
|
+
|
|
216
|
+
## 0.0.1-alpha.4
|
|
217
|
+
|
|
218
|
+
### Patch Changes
|
|
219
|
+
|
|
220
|
+
- Updated dependencies [7babd5c]
|
|
221
|
+
- @mastra/deployer@0.0.1-alpha.4
|
|
222
|
+
|
|
3
223
|
## 0.0.1-alpha.3
|
|
4
224
|
|
|
5
225
|
### Patch Changes
|
package/README.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# @mastra/deployer-netlify
|
|
2
|
+
|
|
3
|
+
A Netlify deployer for Mastra applications.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Deploy Mastra applications to Netlify Functions
|
|
8
|
+
- Automatic site creation and configuration
|
|
9
|
+
- Serverless function support with Edge Functions
|
|
10
|
+
- Zero-configuration deployments
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm add @mastra/deployer-netlify
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
The Netlify deployer is used as part of the Mastra framework:
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { Mastra } from '@mastra/core';
|
|
24
|
+
import { NetlifyDeployer } from '@mastra/deployer-netlify';
|
|
25
|
+
|
|
26
|
+
const deployer = new NetlifyDeployer({
|
|
27
|
+
scope: 'your-team-id',
|
|
28
|
+
projectName: 'your-project-name',
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const mastra = new Mastra({
|
|
32
|
+
deployer,
|
|
33
|
+
// ... other Mastra configuration options
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Configuration
|
|
38
|
+
|
|
39
|
+
### Constructor Options
|
|
40
|
+
|
|
41
|
+
- `scope` (required): Your Netlify team ID
|
|
42
|
+
- `projectName`: Name of your Netlify site (will be created if it doesn't exist)
|
|
43
|
+
|
|
44
|
+
## Project Structure
|
|
45
|
+
|
|
46
|
+
The deployer automatically creates the following structure:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
your-project/
|
|
50
|
+
├── netlify/
|
|
51
|
+
│ └── functions/
|
|
52
|
+
│ └── api/
|
|
53
|
+
└── netlify.toml
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### netlify.toml Configuration
|
|
57
|
+
|
|
58
|
+
The deployer creates a `netlify.toml` with the following defaults:
|
|
59
|
+
|
|
60
|
+
```toml
|
|
61
|
+
[functions]
|
|
62
|
+
node_bundler = "esbuild"
|
|
63
|
+
directory = "/netlify/functions"
|
|
64
|
+
|
|
65
|
+
[[redirects]]
|
|
66
|
+
force = true
|
|
67
|
+
from = "/*"
|
|
68
|
+
status = 200
|
|
69
|
+
to = "/.netlify/functions/api/:splat"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Environment Variables
|
|
73
|
+
|
|
74
|
+
Environment variables are handled automatically through:
|
|
75
|
+
|
|
76
|
+
- `.env` files in your project
|
|
77
|
+
- Environment variables passed through the Mastra configuration
|
|
78
|
+
- Netlify's environment variable UI
|
|
79
|
+
|
|
80
|
+
## Deployment Process
|
|
81
|
+
|
|
82
|
+
The deployer will:
|
|
83
|
+
|
|
84
|
+
1. Create a new site if it doesn't exist
|
|
85
|
+
2. Configure the site with your environment variables
|
|
86
|
+
3. Deploy your application to Netlify Functions
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { MastraDeployer } from '@mastra/core';
|
|
2
|
-
|
|
1
|
+
import { MastraDeployer } from '@mastra/core/deployer';
|
|
2
|
+
|
|
3
|
+
declare class NetlifyDeployer extends MastraDeployer {
|
|
3
4
|
constructor({ scope, env, projectName }: {
|
|
4
5
|
projectName: string;
|
|
5
6
|
env?: Record<string, any>;
|
|
@@ -16,4 +17,5 @@ export declare class NetlifyDeployer extends MastraDeployer {
|
|
|
16
17
|
dir: string;
|
|
17
18
|
}): void;
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
+
|
|
21
|
+
export { NetlifyDeployer };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,119 @@
|
|
|
1
|
+
import { MastraDeployer } from '@mastra/core/deployer';
|
|
2
|
+
import { execa } from 'execa';
|
|
3
|
+
import { existsSync, mkdirSync, writeFileSync, renameSync } from 'fs';
|
|
4
|
+
import { join } from 'path';
|
|
1
5
|
|
|
2
|
-
|
|
6
|
+
// src/index.ts
|
|
3
7
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
// src/helpers.ts
|
|
9
|
+
async function createNetlifySite({ token, name, scope }) {
|
|
10
|
+
console.log(token, name, scope);
|
|
11
|
+
const response = await fetch("https://api.netlify.com/api/v1/sites", {
|
|
12
|
+
method: "POST",
|
|
13
|
+
headers: {
|
|
14
|
+
Authorization: `Bearer ${token}`,
|
|
15
|
+
"Content-Type": "application/json"
|
|
16
|
+
},
|
|
17
|
+
body: JSON.stringify({
|
|
18
|
+
name,
|
|
19
|
+
account_slug: scope,
|
|
20
|
+
// Optional - if not provided, creates in user's default account
|
|
21
|
+
force_ssl: true
|
|
22
|
+
// Enable HTTPS
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
const data = await response.json();
|
|
26
|
+
if (!response.ok) {
|
|
27
|
+
console.error(JSON.stringify(data));
|
|
28
|
+
throw new Error(`Failed to create site: ${data.message || "Unknown error"}`);
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
id: data.id,
|
|
32
|
+
name: data.name,
|
|
33
|
+
url: data.ssl_url || data.url,
|
|
34
|
+
adminUrl: data.admin_url
|
|
35
|
+
};
|
|
8
36
|
}
|
|
37
|
+
async function findNetlifySite({ token, name, scope }) {
|
|
38
|
+
const response = await fetch(`https://api.netlify.com/api/v1/${scope}/sites?filter=all&name=${name}`, {
|
|
39
|
+
headers: {
|
|
40
|
+
Authorization: `Bearer ${token}`,
|
|
41
|
+
"Content-Type": "application/json"
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const data = await response.json();
|
|
45
|
+
if (!response.ok) {
|
|
46
|
+
throw new Error(`Failed to search sites: ${data.message || "Unknown error"}`);
|
|
47
|
+
}
|
|
48
|
+
return data.find((site) => site.name === name);
|
|
49
|
+
}
|
|
50
|
+
async function getOrCreateSite({ token, name, scope }) {
|
|
51
|
+
let existingSite;
|
|
52
|
+
try {
|
|
53
|
+
existingSite = await findNetlifySite({ token, name, scope });
|
|
54
|
+
} catch (e) {
|
|
55
|
+
}
|
|
56
|
+
if (existingSite) {
|
|
57
|
+
return existingSite;
|
|
58
|
+
}
|
|
59
|
+
return createNetlifySite({ token, name, scope });
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// src/index.ts
|
|
63
|
+
var NetlifyDeployer = class extends MastraDeployer {
|
|
64
|
+
constructor({ scope, env, projectName }) {
|
|
65
|
+
super({ scope, env, projectName });
|
|
66
|
+
}
|
|
67
|
+
writeFiles({ dir }) {
|
|
68
|
+
if (!existsSync(join(dir, "netlify/functions/api"))) {
|
|
69
|
+
mkdirSync(join(dir, "netlify/functions/api"), { recursive: true });
|
|
70
|
+
}
|
|
71
|
+
writeFileSync(
|
|
72
|
+
join(dir, "netlify.toml"),
|
|
73
|
+
`
|
|
74
|
+
[functions]
|
|
75
|
+
node_bundler = "esbuild"
|
|
76
|
+
directory = "/netlify/functions"
|
|
77
|
+
|
|
78
|
+
[[redirects]]
|
|
79
|
+
force = true
|
|
80
|
+
from = "/*"
|
|
81
|
+
status = 200
|
|
82
|
+
to = "/.netlify/functions/api/:splat"
|
|
83
|
+
`
|
|
84
|
+
);
|
|
85
|
+
this.writeIndex({ dir });
|
|
86
|
+
}
|
|
87
|
+
async deploy({ dir, token }) {
|
|
88
|
+
const site = await getOrCreateSite({ token, name: this.projectName || `mastra`, scope: this.scope });
|
|
89
|
+
const p2 = execa(
|
|
90
|
+
"netlify",
|
|
91
|
+
["deploy", "--site", site.id, "--auth", token, "--dir", ".", "--functions", "./netlify/functions"],
|
|
92
|
+
{
|
|
93
|
+
cwd: dir
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
p2.stdout.pipe(process.stdout);
|
|
97
|
+
await p2;
|
|
98
|
+
}
|
|
99
|
+
writeIndex({ dir }) {
|
|
100
|
+
["mastra.mjs", "hono.mjs", "server.mjs"].forEach((file) => {
|
|
101
|
+
renameSync(join(dir, file), join(dir, `netlify/functions/api/${file}`));
|
|
102
|
+
});
|
|
103
|
+
writeFileSync(
|
|
104
|
+
join(dir, "netlify/functions/api/api.mts"),
|
|
105
|
+
`
|
|
106
|
+
export default async (req, context) => {
|
|
107
|
+
const { app } = await import('./hono.mjs');
|
|
108
|
+
// Pass the request directly to Hono
|
|
109
|
+
return app.fetch(req, {
|
|
110
|
+
// Optional context passing if needed
|
|
111
|
+
env: { context }
|
|
112
|
+
})
|
|
113
|
+
}
|
|
114
|
+
`
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export { NetlifyDeployer };
|
package/package.json
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/deployer-netlify",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.30",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
|
-
"module": "dist/deployer-netlify.esm.js",
|
|
8
7
|
"types": "dist/index.d.ts",
|
|
9
8
|
"exports": {
|
|
10
9
|
".": {
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"default": "./dist/deployer-netlify.esm.js"
|
|
14
|
-
},
|
|
15
|
-
"require": {
|
|
16
|
-
"types": "./dist/index.d.ts",
|
|
17
|
-
"default": "./dist/index.js"
|
|
18
|
-
}
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
19
12
|
},
|
|
20
13
|
"./package.json": "./package.json"
|
|
21
14
|
},
|
|
@@ -28,22 +21,20 @@
|
|
|
28
21
|
"execa": "^9.3.1",
|
|
29
22
|
"netlify-cli": "^18.0.1",
|
|
30
23
|
"zod": "^3.24.1",
|
|
31
|
-
"@mastra/core": "0.
|
|
32
|
-
"@mastra/deployer": "0.0.1-alpha.
|
|
24
|
+
"@mastra/core": "0.2.0-alpha.83",
|
|
25
|
+
"@mastra/deployer": "0.0.1-alpha.28"
|
|
33
26
|
},
|
|
34
27
|
"devDependencies": {
|
|
35
28
|
"@babel/preset-env": "^7.26.0",
|
|
36
29
|
"@babel/preset-typescript": "^7.26.0",
|
|
37
30
|
"@tsconfig/recommended": "^1.0.7",
|
|
38
|
-
"@types/jsdom": "^21.1.7",
|
|
39
31
|
"@types/node": "^22.9.0",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"vitest": "^2.1.8"
|
|
32
|
+
"tsup": "^8.0.1",
|
|
33
|
+
"vitest": "^3.0.4"
|
|
43
34
|
},
|
|
44
35
|
"scripts": {
|
|
45
|
-
"build": "dts
|
|
46
|
-
"
|
|
36
|
+
"build": "tsup-node src/index.ts --format esm --dts --clean --treeshake",
|
|
37
|
+
"dev": "tsup-node src/index.ts --format esm --dts --clean --treeshake --watch",
|
|
47
38
|
"test": "vitest run"
|
|
48
39
|
}
|
|
49
40
|
}
|
package/src/index.ts
CHANGED
package/tsconfig.json
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "../../tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"moduleResolution": "bundler",
|
|
5
|
-
"outDir": "./dist",
|
|
6
|
-
"rootDir": "./src"
|
|
7
|
-
},
|
|
2
|
+
"extends": "../../tsconfig.node.json",
|
|
8
3
|
"include": ["src/**/*"],
|
|
9
4
|
"exclude": ["node_modules", "**/*.test.ts"]
|
|
10
5
|
}
|