@valbuild/next 0.87.2 → 0.87.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.
@@ -1,6 +1,6 @@
1
1
  import 'server-only';
2
2
  import { _ as _objectSpread2, a as _defineProperty } from '../../dist/objectSpread2-c1340c1c.esm.js';
3
- import { _ as _asyncToGenerator, a as _regeneratorRuntime } from '../../dist/asyncToGenerator-5f8c02f3.esm.js';
3
+ import { _ as _asyncToGenerator, a as _regenerator } from '../../dist/asyncToGenerator-500f022f.esm.js';
4
4
  import { SET_RSC, stegaEncode, SET_AUTO_TAG_JSX_ENABLED } from '@valbuild/react/stega';
5
5
  import { Internal } from '@valbuild/core';
6
6
  import { VAL_SESSION_COOKIE } from '@valbuild/shared/internal';
@@ -16,71 +16,71 @@ SET_RSC(true);
16
16
  var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies) {
17
17
  return function (selector) {
18
18
  var exec = /*#__PURE__*/function () {
19
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
20
- var enabled, headers, cookies, host, _cookies, valServer, treeRes, modules;
21
- return _regeneratorRuntime().wrap(function _callee$(_context) {
22
- while (1) switch (_context.prev = _context.next) {
19
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
20
+ var enabled, headers, cookies, host, _cookies, valServer, treeRes, modules, _t, _t2, _t3;
21
+ return _regenerator().w(function (_context) {
22
+ while (1) switch (_context.p = _context.n) {
23
23
  case 0:
24
24
  enabled = false;
25
- _context.prev = 1;
26
- _context.next = 4;
25
+ _context.p = 1;
26
+ _context.n = 2;
27
27
  return isEnabled();
28
- case 4:
29
- enabled = _context.sent;
30
- _context.next = 10;
28
+ case 2:
29
+ enabled = _context.v;
30
+ _context.n = 4;
31
31
  break;
32
- case 7:
33
- _context.prev = 7;
34
- _context.t0 = _context["catch"](1);
35
- console.error("Val: could not check if Val is enabled! This might be due to an error to check draftMode. fetchVal can only be used server-side. Use useVal on clients.", _context.t0);
36
- case 10:
32
+ case 3:
33
+ _context.p = 3;
34
+ _t = _context.v;
35
+ console.error("Val: could not check if Val is enabled! This might be due to an error to check draftMode. fetchVal can only be used server-side. Use useVal on clients.", _t);
36
+ case 4:
37
37
  if (!enabled) {
38
- _context.next = 52;
38
+ _context.n = 17;
39
39
  break;
40
40
  }
41
41
  SET_AUTO_TAG_JSX_ENABLED(true);
42
- _context.prev = 12;
43
- _context.next = 15;
42
+ _context.p = 5;
43
+ _context.n = 6;
44
44
  return getHeaders();
45
- case 15:
46
- headers = _context.sent;
45
+ case 6:
46
+ headers = _context.v;
47
47
  if (!(typeof headers.get !== "function")) {
48
- _context.next = 18;
48
+ _context.n = 7;
49
49
  break;
50
50
  }
51
51
  throw new Error("Invalid headers");
52
- case 18:
53
- _context.next = 24;
52
+ case 7:
53
+ _context.n = 9;
54
54
  break;
55
- case 20:
56
- _context.prev = 20;
57
- _context.t1 = _context["catch"](12);
58
- console.error("Val: could not read headers! fetchVal can only be used server-side. Use useVal on clients.", _context.t1);
55
+ case 8:
56
+ _context.p = 8;
57
+ _t2 = _context.v;
58
+ console.error("Val: could not read headers! fetchVal can only be used server-side. Use useVal on clients.", _t2);
59
59
  headers = null;
60
- case 24:
61
- _context.prev = 24;
62
- _context.next = 27;
60
+ case 9:
61
+ _context.p = 9;
62
+ _context.n = 10;
63
63
  return getCookies();
64
- case 27:
65
- cookies = _context.sent;
66
- _context.next = 34;
64
+ case 10:
65
+ cookies = _context.v;
66
+ _context.n = 12;
67
67
  break;
68
- case 30:
69
- _context.prev = 30;
70
- _context.t2 = _context["catch"](24);
71
- console.error("Val: could not read cookies! fetchVal can only be used server-side. Use useVal on clients.", _context.t2);
68
+ case 11:
69
+ _context.p = 11;
70
+ _t3 = _context.v;
71
+ console.error("Val: could not read cookies! fetchVal can only be used server-side. Use useVal on clients.", _t3);
72
72
  cookies = null;
73
- case 34:
73
+ case 12:
74
74
  host = headers && getHost(headers);
75
75
  if (!(host && cookies)) {
76
- _context.next = 52;
76
+ _context.n = 17;
77
77
  break;
78
78
  }
79
- _context.next = 38;
79
+ _context.n = 13;
80
80
  return valServerPromise;
81
- case 38:
82
- valServer = _context.sent;
83
- _context.next = 41;
81
+ case 13:
82
+ valServer = _context.v;
83
+ _context.n = 14;
84
84
  return valServer["/sources/~"]["PUT"]({
85
85
  path: "/",
86
86
  query: {
@@ -89,14 +89,14 @@ var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valS
89
89
  },
90
90
  cookies: _defineProperty({}, VAL_SESSION_COOKIE, (_cookies = cookies) === null || _cookies === void 0 || (_cookies = _cookies.get(VAL_SESSION_COOKIE)) === null || _cookies === void 0 ? void 0 : _cookies.value)
91
91
  });
92
- case 41:
93
- treeRes = _context.sent;
92
+ case 14:
93
+ treeRes = _context.v;
94
94
  if (!(treeRes.status === 200)) {
95
- _context.next = 47;
95
+ _context.n = 15;
96
96
  break;
97
97
  }
98
98
  modules = treeRes.json.modules;
99
- return _context.abrupt("return", stegaEncode(selector, {
99
+ return _context.a(2, stegaEncode(selector, {
100
100
  disabled: !enabled,
101
101
  getModule: function getModule(path) {
102
102
  var module = modules[path];
@@ -105,25 +105,22 @@ var initFetchValStega = function initFetchValStega(config, valApiEndpoints, valS
105
105
  }
106
106
  }
107
107
  }));
108
- case 47:
108
+ case 15:
109
109
  if (!(treeRes.status === 401)) {
110
- _context.next = 51;
110
+ _context.n = 16;
111
111
  break;
112
112
  }
113
113
  console.warn("Val: authentication error: ", treeRes.json.message);
114
- _context.next = 52;
114
+ _context.n = 17;
115
115
  break;
116
- case 51:
116
+ case 16:
117
117
  throw Error(JSON.stringify(treeRes.json, null, 2));
118
- case 52:
119
- return _context.abrupt("return", stegaEncode(selector, {
118
+ case 17:
119
+ return _context.a(2, stegaEncode(selector, {
120
120
  disabled: !enabled
121
121
  }));
122
- case 53:
123
- case "end":
124
- return _context.stop();
125
122
  }
126
- }, _callee, null, [[1, 7], [12, 20], [24, 30]]);
123
+ }, _callee, null, [[9, 11], [5, 8], [1, 3]]);
127
124
  }));
128
125
  return function exec() {
129
126
  return _ref.apply(this, arguments);
@@ -178,34 +175,31 @@ function getHost(headers) {
178
175
 
179
176
  var initFetchValRouteStega = function initFetchValRouteStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies) {
180
177
  return /*#__PURE__*/function () {
181
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(selector, params) {
182
- var fetchVal, resolvedParams, path, schema, val, route;
183
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
184
- while (1) switch (_context2.prev = _context2.next) {
178
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(selector, params) {
179
+ var fetchVal, resolvedParams, path, schema, val, route, _t4;
180
+ return _regenerator().w(function (_context2) {
181
+ while (1) switch (_context2.n) {
185
182
  case 0:
186
183
  fetchVal = initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies);
187
- _context2.next = 3;
184
+ _context2.n = 1;
188
185
  return Promise.resolve(params);
189
- case 3:
190
- resolvedParams = _context2.sent;
186
+ case 1:
187
+ resolvedParams = _context2.v;
191
188
  path = selector && Internal.getValPath(selector);
192
189
  schema = selector && Internal.getSchema(selector);
193
- _context2.t0 = selector;
194
- if (!_context2.t0) {
195
- _context2.next = 11;
190
+ _t4 = selector;
191
+ if (!_t4) {
192
+ _context2.n = 3;
196
193
  break;
197
194
  }
198
- _context2.next = 10;
195
+ _context2.n = 2;
199
196
  return fetchVal(selector);
200
- case 10:
201
- _context2.t0 = _context2.sent;
202
- case 11:
203
- val = _context2.t0;
197
+ case 2:
198
+ _t4 = _context2.v;
199
+ case 3:
200
+ val = _t4;
204
201
  route = initValRouteFromVal(resolvedParams, "fetchValRoute", path, schema, val);
205
- return _context2.abrupt("return", route);
206
- case 14:
207
- case "end":
208
- return _context2.stop();
202
+ return _context2.a(2, route);
209
203
  }
210
204
  }, _callee2);
211
205
  }));
@@ -216,44 +210,41 @@ var initFetchValRouteStega = function initFetchValRouteStega(config, valApiEndpo
216
210
  };
217
211
  var initFetchValRouteUrl = function initFetchValRouteUrl(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies) {
218
212
  return /*#__PURE__*/function () {
219
- var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(selector, params) {
220
- var fetchVal, resolvedParams, path, schema, val, route;
221
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
222
- while (1) switch (_context3.prev = _context3.next) {
213
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(selector, params) {
214
+ var fetchVal, resolvedParams, path, schema, val, route, _t5, _t6;
215
+ return _regenerator().w(function (_context3) {
216
+ while (1) switch (_context3.n) {
223
217
  case 0:
224
218
  fetchVal = initFetchValStega(config, valApiEndpoints, valServerPromise, isEnabled, getHeaders, getCookies);
225
219
  if (!(params === undefined)) {
226
- _context3.next = 5;
220
+ _context3.n = 1;
227
221
  break;
228
222
  }
229
- _context3.t0 = undefined;
230
- _context3.next = 8;
223
+ _t5 = undefined;
224
+ _context3.n = 3;
231
225
  break;
232
- case 5:
233
- _context3.next = 7;
226
+ case 1:
227
+ _context3.n = 2;
234
228
  return Promise.resolve(params);
235
- case 7:
236
- _context3.t0 = _context3.sent;
237
- case 8:
238
- resolvedParams = _context3.t0;
229
+ case 2:
230
+ _t5 = _context3.v;
231
+ case 3:
232
+ resolvedParams = _t5;
239
233
  path = selector && Internal.getValPath(selector);
240
234
  schema = selector && Internal.getSchema(selector);
241
- _context3.t1 = selector;
242
- if (!_context3.t1) {
243
- _context3.next = 16;
235
+ _t6 = selector;
236
+ if (!_t6) {
237
+ _context3.n = 5;
244
238
  break;
245
239
  }
246
- _context3.next = 15;
240
+ _context3.n = 4;
247
241
  return fetchVal(selector);
248
- case 15:
249
- _context3.t1 = _context3.sent;
250
- case 16:
251
- val = _context3.t1;
242
+ case 4:
243
+ _t6 = _context3.v;
244
+ case 5:
245
+ val = _t6;
252
246
  route = getValRouteUrlFromVal(resolvedParams, "fetchValRouteUrl", path, schema, val);
253
- return _context3.abrupt("return", route);
254
- case 19:
255
- case "end":
256
- return _context3.stop();
247
+ return _context3.a(2, route);
257
248
  }
258
249
  }, _callee3);
259
250
  }));
@@ -280,49 +271,44 @@ function initValRsc(config, valModules, rscNextConfig) {
280
271
  }
281
272
  }, config), config, {
282
273
  isEnabled: function isEnabled() {
283
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
284
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
285
- while (1) switch (_context4.prev = _context4.next) {
274
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
275
+ return _regenerator().w(function (_context4) {
276
+ while (1) switch (_context4.n) {
286
277
  case 0:
287
- _context4.next = 2;
278
+ _context4.n = 1;
288
279
  return rscNextConfig.draftMode();
289
- case 2:
290
- return _context4.abrupt("return", _context4.sent.isEnabled);
291
- case 3:
292
- case "end":
293
- return _context4.stop();
280
+ case 1:
281
+ return _context4.a(2, _context4.v.isEnabled);
294
282
  }
295
283
  }, _callee4);
296
284
  }))();
297
285
  },
298
286
  onEnable: function onEnable() {
299
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
300
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
301
- while (1) switch (_context5.prev = _context5.next) {
287
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
288
+ return _regenerator().w(function (_context5) {
289
+ while (1) switch (_context5.n) {
302
290
  case 0:
303
- _context5.next = 2;
291
+ _context5.n = 1;
304
292
  return rscNextConfig.draftMode();
293
+ case 1:
294
+ _context5.v.enable();
305
295
  case 2:
306
- _context5.sent.enable();
307
- case 3:
308
- case "end":
309
- return _context5.stop();
296
+ return _context5.a(2);
310
297
  }
311
298
  }, _callee5);
312
299
  }))();
313
300
  },
314
301
  onDisable: function onDisable() {
315
- return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
316
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
317
- while (1) switch (_context6.prev = _context6.next) {
302
+ return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
303
+ return _regenerator().w(function (_context6) {
304
+ while (1) switch (_context6.n) {
318
305
  case 0:
319
- _context6.next = 2;
306
+ _context6.n = 1;
320
307
  return rscNextConfig.draftMode();
308
+ case 1:
309
+ _context6.v.disable();
321
310
  case 2:
322
- _context6.sent.disable();
323
- case 3:
324
- case "end":
325
- return _context6.stop();
311
+ return _context6.a(2);
326
312
  }
327
313
  }, _callee6);
328
314
  }))();
@@ -331,125 +317,98 @@ function initValRsc(config, valModules, rscNextConfig) {
331
317
  return {
332
318
  fetchValStega: initFetchValStega(config, valApiEndpoints,
333
319
  // TODO: get from config
334
- valServerPromise, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
335
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
336
- while (1) switch (_context7.prev = _context7.next) {
320
+ valServerPromise, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
321
+ return _regenerator().w(function (_context7) {
322
+ while (1) switch (_context7.n) {
337
323
  case 0:
338
- _context7.next = 2;
324
+ _context7.n = 1;
339
325
  return rscNextConfig.draftMode();
340
- case 2:
341
- return _context7.abrupt("return", _context7.sent.isEnabled);
342
- case 3:
343
- case "end":
344
- return _context7.stop();
326
+ case 1:
327
+ return _context7.a(2, _context7.v.isEnabled);
345
328
  }
346
329
  }, _callee7);
347
- })), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
348
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
349
- while (1) switch (_context8.prev = _context8.next) {
330
+ })), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
331
+ return _regenerator().w(function (_context8) {
332
+ while (1) switch (_context8.n) {
350
333
  case 0:
351
- _context8.next = 2;
334
+ _context8.n = 1;
352
335
  return rscNextConfig.headers();
353
- case 2:
354
- return _context8.abrupt("return", _context8.sent);
355
- case 3:
356
- case "end":
357
- return _context8.stop();
336
+ case 1:
337
+ return _context8.a(2, _context8.v);
358
338
  }
359
339
  }, _callee8);
360
- })), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
361
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
362
- while (1) switch (_context9.prev = _context9.next) {
340
+ })), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
341
+ return _regenerator().w(function (_context9) {
342
+ while (1) switch (_context9.n) {
363
343
  case 0:
364
- _context9.next = 2;
344
+ _context9.n = 1;
365
345
  return rscNextConfig.cookies();
366
- case 2:
367
- return _context9.abrupt("return", _context9.sent);
368
- case 3:
369
- case "end":
370
- return _context9.stop();
346
+ case 1:
347
+ return _context9.a(2, _context9.v);
371
348
  }
372
349
  }, _callee9);
373
350
  }))),
374
- fetchValRouteStega: initFetchValRouteStega(config, valApiEndpoints, valServerPromise, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
375
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
376
- while (1) switch (_context10.prev = _context10.next) {
351
+ fetchValRouteStega: initFetchValRouteStega(config, valApiEndpoints, valServerPromise, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
352
+ return _regenerator().w(function (_context0) {
353
+ while (1) switch (_context0.n) {
377
354
  case 0:
378
- _context10.next = 2;
355
+ _context0.n = 1;
379
356
  return rscNextConfig.draftMode();
380
- case 2:
381
- return _context10.abrupt("return", _context10.sent.isEnabled);
382
- case 3:
383
- case "end":
384
- return _context10.stop();
357
+ case 1:
358
+ return _context0.a(2, _context0.v.isEnabled);
385
359
  }
386
- }, _callee10);
387
- })), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
388
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
389
- while (1) switch (_context11.prev = _context11.next) {
360
+ }, _callee0);
361
+ })), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
362
+ return _regenerator().w(function (_context1) {
363
+ while (1) switch (_context1.n) {
390
364
  case 0:
391
- _context11.next = 2;
365
+ _context1.n = 1;
392
366
  return rscNextConfig.headers();
393
- case 2:
394
- return _context11.abrupt("return", _context11.sent);
395
- case 3:
396
- case "end":
397
- return _context11.stop();
367
+ case 1:
368
+ return _context1.a(2, _context1.v);
398
369
  }
399
- }, _callee11);
400
- })), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
401
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
402
- while (1) switch (_context12.prev = _context12.next) {
370
+ }, _callee1);
371
+ })), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
372
+ return _regenerator().w(function (_context10) {
373
+ while (1) switch (_context10.n) {
403
374
  case 0:
404
- _context12.next = 2;
375
+ _context10.n = 1;
405
376
  return rscNextConfig.cookies();
406
- case 2:
407
- return _context12.abrupt("return", _context12.sent);
408
- case 3:
409
- case "end":
410
- return _context12.stop();
377
+ case 1:
378
+ return _context10.a(2, _context10.v);
411
379
  }
412
- }, _callee12);
380
+ }, _callee10);
413
381
  }))),
414
- fetchValRouteUrl: initFetchValRouteUrl(config, valApiEndpoints, valServerPromise, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
415
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
416
- while (1) switch (_context13.prev = _context13.next) {
382
+ fetchValRouteUrl: initFetchValRouteUrl(config, valApiEndpoints, valServerPromise, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
383
+ return _regenerator().w(function (_context11) {
384
+ while (1) switch (_context11.n) {
417
385
  case 0:
418
- _context13.next = 2;
386
+ _context11.n = 1;
419
387
  return rscNextConfig.draftMode();
420
- case 2:
421
- return _context13.abrupt("return", _context13.sent.isEnabled);
422
- case 3:
423
- case "end":
424
- return _context13.stop();
388
+ case 1:
389
+ return _context11.a(2, _context11.v.isEnabled);
425
390
  }
426
- }, _callee13);
427
- })), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
428
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
429
- while (1) switch (_context14.prev = _context14.next) {
391
+ }, _callee11);
392
+ })), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12() {
393
+ return _regenerator().w(function (_context12) {
394
+ while (1) switch (_context12.n) {
430
395
  case 0:
431
- _context14.next = 2;
396
+ _context12.n = 1;
432
397
  return rscNextConfig.headers();
433
- case 2:
434
- return _context14.abrupt("return", _context14.sent);
435
- case 3:
436
- case "end":
437
- return _context14.stop();
398
+ case 1:
399
+ return _context12.a(2, _context12.v);
438
400
  }
439
- }, _callee14);
440
- })), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
441
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
442
- while (1) switch (_context15.prev = _context15.next) {
401
+ }, _callee12);
402
+ })), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
403
+ return _regenerator().w(function (_context13) {
404
+ while (1) switch (_context13.n) {
443
405
  case 0:
444
- _context15.next = 2;
406
+ _context13.n = 1;
445
407
  return rscNextConfig.cookies();
446
- case 2:
447
- return _context15.abrupt("return", _context15.sent);
448
- case 3:
449
- case "end":
450
- return _context15.stop();
408
+ case 1:
409
+ return _context13.a(2, _context13.v);
451
410
  }
452
- }, _callee15);
411
+ }, _callee13);
453
412
  })))
454
413
  };
455
414
  }
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('server-only');
6
6
  var slicedToArray = require('../../dist/slicedToArray-44036a76.cjs.dev.js');
7
- var asyncToGenerator = require('../../dist/asyncToGenerator-6ba61221.cjs.dev.js');
7
+ var asyncToGenerator = require('../../dist/asyncToGenerator-c3823d62.cjs.dev.js');
8
8
  var objectSpread2 = require('../../dist/objectSpread2-792eb2c2.cjs.dev.js');
9
9
  var core = require('@valbuild/core');
10
10
  var server = require('@valbuild/server');
@@ -29,49 +29,44 @@ var initValNextAppRouter = function initValNextAppRouter(valModules, config, nex
29
29
  }
30
30
  }, config), config, {
31
31
  isEnabled: function isEnabled() {
32
- return asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regeneratorRuntime().mark(function _callee() {
33
- return asyncToGenerator._regeneratorRuntime().wrap(function _callee$(_context) {
34
- while (1) switch (_context.prev = _context.next) {
32
+ return asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee() {
33
+ return asyncToGenerator._regenerator().w(function (_context) {
34
+ while (1) switch (_context.n) {
35
35
  case 0:
36
- _context.next = 2;
36
+ _context.n = 1;
37
37
  return nextConfig.draftMode();
38
- case 2:
39
- return _context.abrupt("return", _context.sent.isEnabled);
40
- case 3:
41
- case "end":
42
- return _context.stop();
38
+ case 1:
39
+ return _context.a(2, _context.v.isEnabled);
43
40
  }
44
41
  }, _callee);
45
42
  }))();
46
43
  },
47
44
  onEnable: function onEnable() {
48
- return asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regeneratorRuntime().mark(function _callee2() {
49
- return asyncToGenerator._regeneratorRuntime().wrap(function _callee2$(_context2) {
50
- while (1) switch (_context2.prev = _context2.next) {
45
+ return asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee2() {
46
+ return asyncToGenerator._regenerator().w(function (_context2) {
47
+ while (1) switch (_context2.n) {
51
48
  case 0:
52
- _context2.next = 2;
49
+ _context2.n = 1;
53
50
  return nextConfig.draftMode();
51
+ case 1:
52
+ _context2.v.enable();
54
53
  case 2:
55
- _context2.sent.enable();
56
- case 3:
57
- case "end":
58
- return _context2.stop();
54
+ return _context2.a(2);
59
55
  }
60
56
  }, _callee2);
61
57
  }))();
62
58
  },
63
59
  onDisable: function onDisable() {
64
- return asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regeneratorRuntime().mark(function _callee3() {
65
- return asyncToGenerator._regeneratorRuntime().wrap(function _callee3$(_context3) {
66
- while (1) switch (_context3.prev = _context3.next) {
60
+ return asyncToGenerator._asyncToGenerator(/*#__PURE__*/asyncToGenerator._regenerator().m(function _callee3() {
61
+ return asyncToGenerator._regenerator().w(function (_context3) {
62
+ while (1) switch (_context3.n) {
67
63
  case 0:
68
- _context3.next = 2;
64
+ _context3.n = 1;
69
65
  return nextConfig.draftMode();
66
+ case 1:
67
+ _context3.v.disable();
70
68
  case 2:
71
- _context3.sent.disable();
72
- case 3:
73
- case "end":
74
- return _context3.stop();
69
+ return _context3.a(2);
75
70
  }
76
71
  }, _callee3);
77
72
  }))();