@mastra/deployer-cloudflare 0.0.1-alpha.33 → 0.0.1-alpha.4

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 CHANGED
@@ -1,249 +1,5 @@
1
1
  # @mastra/deployer-cloudflare
2
2
 
3
- ## 0.0.1-alpha.33
4
-
5
- ### Patch Changes
6
-
7
- - e27fe69: Add dir to deployer
8
- - Updated dependencies [e27fe69]
9
- - @mastra/deployer@0.0.1-alpha.30
10
-
11
- ## 0.0.1-alpha.32
12
-
13
- ### Patch Changes
14
-
15
- - 38b7f66: Update deployer logic
16
- - Updated dependencies [2f17a5f]
17
- - Updated dependencies [0696eeb]
18
- - Updated dependencies [cb290ee]
19
- - Updated dependencies [b4d7416]
20
- - Updated dependencies [38b7f66]
21
- - @mastra/core@0.2.0-alpha.84
22
- - @mastra/deployer@0.0.1-alpha.29
23
-
24
- ## 0.0.1-alpha.31
25
-
26
- ### Patch Changes
27
-
28
- - 9625602: Use mastra core splitted bundles in other packages
29
- - Updated dependencies [2ab57d6]
30
- - Updated dependencies [30322ce]
31
- - Updated dependencies [78eec7c]
32
- - Updated dependencies [9625602]
33
- - Updated dependencies [8769a62]
34
- - @mastra/deployer@0.0.1-alpha.28
35
- - @mastra/core@0.2.0-alpha.83
36
-
37
- ## 0.0.1-alpha.30
38
-
39
- ### Patch Changes
40
-
41
- - Updated dependencies [73d112c]
42
- - Updated dependencies [ac8c61a]
43
- - @mastra/deployer@0.0.1-alpha.27
44
- - @mastra/core@0.1.27-alpha.82
45
-
46
- ## 0.0.1-alpha.29
47
-
48
- ### Patch Changes
49
-
50
- - Updated dependencies [9fb3039]
51
- - @mastra/core@0.1.27-alpha.81
52
- - @mastra/deployer@0.0.1-alpha.26
53
-
54
- ## 0.0.1-alpha.28
55
-
56
- ### Patch Changes
57
-
58
- - Updated dependencies [327ece7]
59
- - @mastra/core@0.1.27-alpha.80
60
- - @mastra/deployer@0.0.1-alpha.25
61
-
62
- ## 0.0.1-alpha.27
63
-
64
- ### Patch Changes
65
-
66
- - Updated dependencies [21fe536]
67
- - @mastra/core@0.1.27-alpha.79
68
- - @mastra/deployer@0.0.1-alpha.24
69
-
70
- ## 0.0.1-alpha.26
71
-
72
- ### Patch Changes
73
-
74
- - Updated dependencies [88f18d7]
75
- - @mastra/deployer@0.0.1-alpha.23
76
-
77
- ## 0.0.1-alpha.25
78
-
79
- ### Patch Changes
80
-
81
- - 44c7c26: Rebuild
82
-
83
- ## 0.0.1-alpha.24
84
-
85
- ### Patch Changes
86
-
87
- - Updated dependencies [685108a]
88
- - Updated dependencies [685108a]
89
- - @mastra/deployer@0.0.1-alpha.22
90
- - @mastra/core@0.1.27-alpha.78
91
-
92
- ## 0.0.1-alpha.23
93
-
94
- ### Patch Changes
95
-
96
- - 2b75edf: mastra deployers tsup bundling
97
- - Updated dependencies [8105fae]
98
- - Updated dependencies [cfb966f]
99
- - @mastra/core@0.1.27-alpha.77
100
- - @mastra/deployer@0.0.1-alpha.21
101
-
102
- ## 0.0.1-alpha.22
103
-
104
- ### Patch Changes
105
-
106
- - Updated dependencies [ae7bf94]
107
- - Updated dependencies [ae7bf94]
108
- - @mastra/deployer@0.0.1-alpha.20
109
- - @mastra/core@0.1.27-alpha.76
110
-
111
- ## 0.0.1-alpha.21
112
-
113
- ### Patch Changes
114
-
115
- - Updated dependencies [23dcb23]
116
- - Updated dependencies [7064554]
117
- - @mastra/core@0.1.27-alpha.75
118
- - @mastra/deployer@0.0.1-alpha.19
119
-
120
- ## 0.0.1-alpha.20
121
-
122
- ### Patch Changes
123
-
124
- - Updated dependencies [7b87567]
125
- - @mastra/core@0.1.27-alpha.74
126
- - @mastra/deployer@0.0.1-alpha.18
127
-
128
- ## 0.0.1-alpha.19
129
-
130
- ### Patch Changes
131
-
132
- - Updated dependencies [3427b95]
133
- - @mastra/core@0.1.27-alpha.73
134
- - @mastra/deployer@0.0.1-alpha.17
135
-
136
- ## 0.0.1-alpha.18
137
-
138
- ### Patch Changes
139
-
140
- - Updated dependencies [e4d4ede]
141
- - Updated dependencies [06b2c0a]
142
- - @mastra/core@0.1.27-alpha.72
143
- - @mastra/deployer@0.0.1-alpha.16
144
-
145
- ## 0.0.1-alpha.17
146
-
147
- ### Patch Changes
148
-
149
- - Updated dependencies [d9c8dd0]
150
- - @mastra/deployer@0.0.1-alpha.15
151
- - @mastra/core@0.1.27-alpha.71
152
-
153
- ## 0.0.1-alpha.16
154
-
155
- ### Patch Changes
156
-
157
- - Updated dependencies [ad2cd74]
158
- - @mastra/deployer@0.0.1-alpha.14
159
-
160
- ## 0.0.1-alpha.15
161
-
162
- ### Patch Changes
163
-
164
- - Updated dependencies [a1774e7]
165
- - @mastra/deployer@0.0.1-alpha.13
166
-
167
- ## 0.0.1-alpha.14
168
-
169
- ### Patch Changes
170
-
171
- - Updated dependencies [28dceab]
172
- - @mastra/deployer@0.0.1-alpha.12
173
-
174
- ## 0.0.1-alpha.13
175
-
176
- ### Patch Changes
177
-
178
- - bdaf834: publish packages
179
- - Updated dependencies [bdaf834]
180
- - @mastra/deployer@0.0.1-alpha.11
181
-
182
- ## 0.0.1-alpha.12
183
-
184
- ### Patch Changes
185
-
186
- - Updated dependencies [dd6d87f]
187
- - Updated dependencies [04434b6]
188
- - @mastra/core@0.1.27-alpha.70
189
- - @mastra/deployer@0.0.1-alpha.10
190
-
191
- ## 0.0.1-alpha.11
192
-
193
- ### Patch Changes
194
-
195
- - 9066f95: CF deployer fixes
196
- - Updated dependencies [9066f95]
197
- - @mastra/deployer@0.0.1-alpha.9
198
-
199
- ## 0.0.1-alpha.10
200
-
201
- ### Patch Changes
202
-
203
- - 0d5a03d: Vector store modules
204
-
205
- ## 0.0.1-alpha.9
206
-
207
- ### Patch Changes
208
-
209
- - Updated dependencies [b425845]
210
- - @mastra/deployer@0.0.1-alpha.8
211
-
212
- ## 0.0.1-alpha.8
213
-
214
- ### Patch Changes
215
-
216
- - 1944807: Unified logger and major step in better logs
217
- - c7abf8e: Optional CF worker tagging
218
- - Updated dependencies [1944807]
219
- - Updated dependencies [9ade36e]
220
- - @mastra/deployer@0.0.1-alpha.7
221
- - @mastra/core@0.1.27-alpha.69
222
-
223
- ## 0.0.1-alpha.7
224
-
225
- ### Patch Changes
226
-
227
- - Updated dependencies [291fe57]
228
- - Updated dependencies [1a41fbf]
229
- - @mastra/deployer@0.0.1-alpha.6
230
-
231
- ## 0.0.1-alpha.6
232
-
233
- ### Patch Changes
234
-
235
- - Updated dependencies [0be7181]
236
- - Updated dependencies [0be7181]
237
- - @mastra/core@0.1.27-alpha.68
238
- - @mastra/deployer@0.0.1-alpha.5
239
-
240
- ## 0.0.1-alpha.5
241
-
242
- ### Patch Changes
243
-
244
- - Updated dependencies [7babd5c]
245
- - @mastra/deployer@0.0.1-alpha.4
246
-
247
3
  ## 0.0.1-alpha.4
248
4
 
249
5
  ### Patch Changes
@@ -0,0 +1,458 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var core = require('@mastra/core');
6
+ var child_process = require('child_process');
7
+ var fs = require('fs');
8
+ var path = require('path');
9
+
10
+ function _interopNamespaceDefault(e) {
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n.default = e;
24
+ return n;
25
+ }
26
+
27
+ var child_process__namespace = /*#__PURE__*/_interopNamespaceDefault(child_process);
28
+
29
+ function asyncGeneratorStep(n, t, e, r, o, a, c) {
30
+ try {
31
+ var i = n[a](c),
32
+ u = i.value;
33
+ } catch (n) {
34
+ return void e(n);
35
+ }
36
+ i.done ? t(u) : Promise.resolve(u).then(r, o);
37
+ }
38
+ function _asyncToGenerator(n) {
39
+ return function () {
40
+ var t = this,
41
+ e = arguments;
42
+ return new Promise(function (r, o) {
43
+ var a = n.apply(t, e);
44
+ function _next(n) {
45
+ asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
46
+ }
47
+ function _throw(n) {
48
+ asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
49
+ }
50
+ _next(void 0);
51
+ });
52
+ };
53
+ }
54
+ function _extends() {
55
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
56
+ for (var e = 1; e < arguments.length; e++) {
57
+ var t = arguments[e];
58
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
59
+ }
60
+ return n;
61
+ }, _extends.apply(null, arguments);
62
+ }
63
+ function _inheritsLoose(t, o) {
64
+ t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
65
+ }
66
+ function _regeneratorRuntime() {
67
+ _regeneratorRuntime = function () {
68
+ return e;
69
+ };
70
+ var t,
71
+ e = {},
72
+ r = Object.prototype,
73
+ n = r.hasOwnProperty,
74
+ o = Object.defineProperty || function (t, e, r) {
75
+ t[e] = r.value;
76
+ },
77
+ i = "function" == typeof Symbol ? Symbol : {},
78
+ a = i.iterator || "@@iterator",
79
+ c = i.asyncIterator || "@@asyncIterator",
80
+ u = i.toStringTag || "@@toStringTag";
81
+ function define(t, e, r) {
82
+ return Object.defineProperty(t, e, {
83
+ value: r,
84
+ enumerable: !0,
85
+ configurable: !0,
86
+ writable: !0
87
+ }), t[e];
88
+ }
89
+ try {
90
+ define({}, "");
91
+ } catch (t) {
92
+ define = function (t, e, r) {
93
+ return t[e] = r;
94
+ };
95
+ }
96
+ function wrap(t, e, r, n) {
97
+ var i = e && e.prototype instanceof Generator ? e : Generator,
98
+ a = Object.create(i.prototype),
99
+ c = new Context(n || []);
100
+ return o(a, "_invoke", {
101
+ value: makeInvokeMethod(t, r, c)
102
+ }), a;
103
+ }
104
+ function tryCatch(t, e, r) {
105
+ try {
106
+ return {
107
+ type: "normal",
108
+ arg: t.call(e, r)
109
+ };
110
+ } catch (t) {
111
+ return {
112
+ type: "throw",
113
+ arg: t
114
+ };
115
+ }
116
+ }
117
+ e.wrap = wrap;
118
+ var h = "suspendedStart",
119
+ l = "suspendedYield",
120
+ f = "executing",
121
+ s = "completed",
122
+ y = {};
123
+ function Generator() {}
124
+ function GeneratorFunction() {}
125
+ function GeneratorFunctionPrototype() {}
126
+ var p = {};
127
+ define(p, a, function () {
128
+ return this;
129
+ });
130
+ var d = Object.getPrototypeOf,
131
+ v = d && d(d(values([])));
132
+ v && v !== r && n.call(v, a) && (p = v);
133
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
134
+ function defineIteratorMethods(t) {
135
+ ["next", "throw", "return"].forEach(function (e) {
136
+ define(t, e, function (t) {
137
+ return this._invoke(e, t);
138
+ });
139
+ });
140
+ }
141
+ function AsyncIterator(t, e) {
142
+ function invoke(r, o, i, a) {
143
+ var c = tryCatch(t[r], t, o);
144
+ if ("throw" !== c.type) {
145
+ var u = c.arg,
146
+ h = u.value;
147
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
148
+ invoke("next", t, i, a);
149
+ }, function (t) {
150
+ invoke("throw", t, i, a);
151
+ }) : e.resolve(h).then(function (t) {
152
+ u.value = t, i(u);
153
+ }, function (t) {
154
+ return invoke("throw", t, i, a);
155
+ });
156
+ }
157
+ a(c.arg);
158
+ }
159
+ var r;
160
+ o(this, "_invoke", {
161
+ value: function (t, n) {
162
+ function callInvokeWithMethodAndArg() {
163
+ return new e(function (e, r) {
164
+ invoke(t, n, e, r);
165
+ });
166
+ }
167
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
168
+ }
169
+ });
170
+ }
171
+ function makeInvokeMethod(e, r, n) {
172
+ var o = h;
173
+ return function (i, a) {
174
+ if (o === f) throw Error("Generator is already running");
175
+ if (o === s) {
176
+ if ("throw" === i) throw a;
177
+ return {
178
+ value: t,
179
+ done: !0
180
+ };
181
+ }
182
+ for (n.method = i, n.arg = a;;) {
183
+ var c = n.delegate;
184
+ if (c) {
185
+ var u = maybeInvokeDelegate(c, n);
186
+ if (u) {
187
+ if (u === y) continue;
188
+ return u;
189
+ }
190
+ }
191
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
192
+ if (o === h) throw o = s, n.arg;
193
+ n.dispatchException(n.arg);
194
+ } else "return" === n.method && n.abrupt("return", n.arg);
195
+ o = f;
196
+ var p = tryCatch(e, r, n);
197
+ if ("normal" === p.type) {
198
+ if (o = n.done ? s : l, p.arg === y) continue;
199
+ return {
200
+ value: p.arg,
201
+ done: n.done
202
+ };
203
+ }
204
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
205
+ }
206
+ };
207
+ }
208
+ function maybeInvokeDelegate(e, r) {
209
+ var n = r.method,
210
+ o = e.iterator[n];
211
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
212
+ var i = tryCatch(o, e.iterator, r.arg);
213
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
214
+ var a = i.arg;
215
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
216
+ }
217
+ function pushTryEntry(t) {
218
+ var e = {
219
+ tryLoc: t[0]
220
+ };
221
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
222
+ }
223
+ function resetTryEntry(t) {
224
+ var e = t.completion || {};
225
+ e.type = "normal", delete e.arg, t.completion = e;
226
+ }
227
+ function Context(t) {
228
+ this.tryEntries = [{
229
+ tryLoc: "root"
230
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
231
+ }
232
+ function values(e) {
233
+ if (e || "" === e) {
234
+ var r = e[a];
235
+ if (r) return r.call(e);
236
+ if ("function" == typeof e.next) return e;
237
+ if (!isNaN(e.length)) {
238
+ var o = -1,
239
+ i = function next() {
240
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
241
+ return next.value = t, next.done = !0, next;
242
+ };
243
+ return i.next = i;
244
+ }
245
+ }
246
+ throw new TypeError(typeof e + " is not iterable");
247
+ }
248
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
249
+ value: GeneratorFunctionPrototype,
250
+ configurable: !0
251
+ }), o(GeneratorFunctionPrototype, "constructor", {
252
+ value: GeneratorFunction,
253
+ configurable: !0
254
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
255
+ var e = "function" == typeof t && t.constructor;
256
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
257
+ }, e.mark = function (t) {
258
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
259
+ }, e.awrap = function (t) {
260
+ return {
261
+ __await: t
262
+ };
263
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
264
+ return this;
265
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
266
+ void 0 === i && (i = Promise);
267
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
268
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
269
+ return t.done ? t.value : a.next();
270
+ });
271
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
272
+ return this;
273
+ }), define(g, "toString", function () {
274
+ return "[object Generator]";
275
+ }), e.keys = function (t) {
276
+ var e = Object(t),
277
+ r = [];
278
+ for (var n in e) r.push(n);
279
+ return r.reverse(), function next() {
280
+ for (; r.length;) {
281
+ var t = r.pop();
282
+ if (t in e) return next.value = t, next.done = !1, next;
283
+ }
284
+ return next.done = !0, next;
285
+ };
286
+ }, e.values = values, Context.prototype = {
287
+ constructor: Context,
288
+ reset: function (e) {
289
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
290
+ },
291
+ stop: function () {
292
+ this.done = !0;
293
+ var t = this.tryEntries[0].completion;
294
+ if ("throw" === t.type) throw t.arg;
295
+ return this.rval;
296
+ },
297
+ dispatchException: function (e) {
298
+ if (this.done) throw e;
299
+ var r = this;
300
+ function handle(n, o) {
301
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
302
+ }
303
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
304
+ var i = this.tryEntries[o],
305
+ a = i.completion;
306
+ if ("root" === i.tryLoc) return handle("end");
307
+ if (i.tryLoc <= this.prev) {
308
+ var c = n.call(i, "catchLoc"),
309
+ u = n.call(i, "finallyLoc");
310
+ if (c && u) {
311
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
312
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
313
+ } else if (c) {
314
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
315
+ } else {
316
+ if (!u) throw Error("try statement without catch or finally");
317
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
318
+ }
319
+ }
320
+ }
321
+ },
322
+ abrupt: function (t, e) {
323
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
324
+ var o = this.tryEntries[r];
325
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
326
+ var i = o;
327
+ break;
328
+ }
329
+ }
330
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
331
+ var a = i ? i.completion : {};
332
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
333
+ },
334
+ complete: function (t, e) {
335
+ if ("throw" === t.type) throw t.arg;
336
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
337
+ },
338
+ finish: function (t) {
339
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
340
+ var r = this.tryEntries[e];
341
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
342
+ }
343
+ },
344
+ catch: function (t) {
345
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
346
+ var r = this.tryEntries[e];
347
+ if (r.tryLoc === t) {
348
+ var n = r.completion;
349
+ if ("throw" === n.type) {
350
+ var o = n.arg;
351
+ resetTryEntry(r);
352
+ }
353
+ return o;
354
+ }
355
+ }
356
+ throw Error("illegal catch attempt");
357
+ },
358
+ delegateYield: function (e, r, n) {
359
+ return this.delegate = {
360
+ iterator: values(e),
361
+ resultName: r,
362
+ nextLoc: n
363
+ }, "next" === this.method && (this.arg = t), y;
364
+ }
365
+ }, e;
366
+ }
367
+ function _setPrototypeOf(t, e) {
368
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
369
+ return t.__proto__ = e, t;
370
+ }, _setPrototypeOf(t, e);
371
+ }
372
+
373
+ var CloudflareDeployer = /*#__PURE__*/function (_MastraDeployer) {
374
+ function CloudflareDeployer(_ref) {
375
+ var _this;
376
+ var scope = _ref.scope,
377
+ env = _ref.env,
378
+ projectName = _ref.projectName,
379
+ routes = _ref.routes,
380
+ workerNamespace = _ref.workerNamespace;
381
+ _this = _MastraDeployer.call(this, {
382
+ scope: scope,
383
+ env: env,
384
+ projectName: projectName
385
+ }) || this;
386
+ _this.routes = [];
387
+ _this.workerNamespace = void 0;
388
+ _this.routes = routes;
389
+ _this.workerNamespace = workerNamespace;
390
+ return _this;
391
+ }
392
+ _inheritsLoose(CloudflareDeployer, _MastraDeployer);
393
+ var _proto = CloudflareDeployer.prototype;
394
+ _proto.writeFiles = function writeFiles(_ref2) {
395
+ var dir = _ref2.dir;
396
+ this.loadEnvVars();
397
+ this.writeIndex({
398
+ dir: dir
399
+ });
400
+ var cfWorkerName = this.projectName || 'mastra';
401
+ var wranglerConfig = {
402
+ name: cfWorkerName,
403
+ main: 'index.mjs',
404
+ compatibility_date: '2024-12-02',
405
+ compatibility_flags: ['nodejs_compat'],
406
+ build: {
407
+ command: 'npm install'
408
+ },
409
+ observability: {
410
+ logs: {
411
+ enabled: true
412
+ }
413
+ },
414
+ vars: this.env
415
+ };
416
+ if (!this.workerNamespace && this.routes) {
417
+ wranglerConfig.routes = this.routes;
418
+ }
419
+ fs.writeFileSync(path.join(dir, 'wrangler.json'), JSON.stringify(wranglerConfig));
420
+ };
421
+ _proto.writeIndex = function writeIndex(_ref3) {
422
+ var dir = _ref3.dir;
423
+ fs.writeFileSync(path.join(dir, './index.mjs'), "\n export default {\n fetch: async (request, env, context) => {\n Object.keys(env).forEach(key => {\n process.env[key] = env[key]\n })\n const { app } = await import('./hono.mjs');\n return app.fetch(request, env, context);\n }\n }\n ");
424
+ };
425
+ _proto.deploy = /*#__PURE__*/function () {
426
+ var _deploy = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref4) {
427
+ var dir, token, cmd;
428
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
429
+ while (1) switch (_context.prev = _context.next) {
430
+ case 0:
431
+ dir = _ref4.dir, token = _ref4.token;
432
+ cmd = this.workerNamespace ? "npm exec -- wrangler deploy --dispatch-namespace " + this.workerNamespace : 'npm exec -- wrangler deploy';
433
+ child_process__namespace.execSync(cmd, {
434
+ cwd: dir,
435
+ stdio: 'inherit',
436
+ env: _extends({
437
+ CLOUDFLARE_API_TOKEN: token,
438
+ CLOUDFLARE_ACCOUNT_ID: this.scope
439
+ }, this.env, {
440
+ PATH: process.env.PATH
441
+ })
442
+ });
443
+ case 3:
444
+ case "end":
445
+ return _context.stop();
446
+ }
447
+ }, _callee, this);
448
+ }));
449
+ function deploy(_x) {
450
+ return _deploy.apply(this, arguments);
451
+ }
452
+ return deploy;
453
+ }();
454
+ return CloudflareDeployer;
455
+ }(core.MastraDeployer);
456
+
457
+ exports.CloudflareDeployer = CloudflareDeployer;
458
+ //# sourceMappingURL=deployer-cloudflare.cjs.development.js.map