@valbuild/next 0.87.3 → 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.
- package/dist/{ValNextProvider-49b788b8.cjs.dev.js → ValNextProvider-579b1e3d.cjs.dev.js} +9 -8
- package/dist/{ValNextProvider-5657aa89.esm.js → ValNextProvider-abf09691.esm.js} +9 -8
- package/dist/ValNextProvider-af07de36.cjs.js +7 -0
- package/dist/{ValNextProvider-9ce953f7.cjs.prod.js → ValNextProvider-af07de36.cjs.prod.js} +9 -8
- package/dist/asyncToGenerator-500f022f.esm.js +137 -0
- package/dist/asyncToGenerator-8e5c36c8.cjs.prod.js +140 -0
- package/dist/asyncToGenerator-c3823d62.cjs.dev.js +140 -0
- package/dist/valbuild-next.cjs.dev.js +4 -4
- package/dist/valbuild-next.cjs.prod.js +4 -4
- package/dist/valbuild-next.esm.js +4 -4
- package/package.json +10 -6
- package/rsc/dist/valbuild-next-rsc.cjs.dev.js +172 -213
- package/rsc/dist/valbuild-next-rsc.cjs.prod.js +172 -213
- package/rsc/dist/valbuild-next-rsc.esm.js +172 -213
- package/server/dist/valbuild-next-server.cjs.dev.js +21 -26
- package/server/dist/valbuild-next-server.cjs.prod.js +21 -26
- package/server/dist/valbuild-next-server.esm.js +21 -26
- package/dist/ValNextProvider-9ce953f7.cjs.js +0 -7
- package/dist/asyncToGenerator-5f8c02f3.esm.js +0 -329
- package/dist/asyncToGenerator-67a5ff70.cjs.prod.js +0 -332
- package/dist/asyncToGenerator-6ba61221.cjs.dev.js +0 -332
|
@@ -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
|
|
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__*/
|
|
20
|
-
var enabled, headers, cookies, host, _cookies, valServer, treeRes, modules;
|
|
21
|
-
return
|
|
22
|
-
while (1) switch (_context.
|
|
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.
|
|
26
|
-
_context.
|
|
25
|
+
_context.p = 1;
|
|
26
|
+
_context.n = 2;
|
|
27
27
|
return isEnabled();
|
|
28
|
-
case
|
|
29
|
-
enabled = _context.
|
|
30
|
-
_context.
|
|
28
|
+
case 2:
|
|
29
|
+
enabled = _context.v;
|
|
30
|
+
_context.n = 4;
|
|
31
31
|
break;
|
|
32
|
-
case
|
|
33
|
-
_context.
|
|
34
|
-
|
|
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.",
|
|
36
|
-
case
|
|
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.
|
|
38
|
+
_context.n = 17;
|
|
39
39
|
break;
|
|
40
40
|
}
|
|
41
41
|
SET_AUTO_TAG_JSX_ENABLED(true);
|
|
42
|
-
_context.
|
|
43
|
-
_context.
|
|
42
|
+
_context.p = 5;
|
|
43
|
+
_context.n = 6;
|
|
44
44
|
return getHeaders();
|
|
45
|
-
case
|
|
46
|
-
headers = _context.
|
|
45
|
+
case 6:
|
|
46
|
+
headers = _context.v;
|
|
47
47
|
if (!(typeof headers.get !== "function")) {
|
|
48
|
-
_context.
|
|
48
|
+
_context.n = 7;
|
|
49
49
|
break;
|
|
50
50
|
}
|
|
51
51
|
throw new Error("Invalid headers");
|
|
52
|
-
case
|
|
53
|
-
_context.
|
|
52
|
+
case 7:
|
|
53
|
+
_context.n = 9;
|
|
54
54
|
break;
|
|
55
|
-
case
|
|
56
|
-
_context.
|
|
57
|
-
|
|
58
|
-
console.error("Val: could not read headers! fetchVal can only be used server-side. Use useVal on clients.",
|
|
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
|
|
61
|
-
_context.
|
|
62
|
-
_context.
|
|
60
|
+
case 9:
|
|
61
|
+
_context.p = 9;
|
|
62
|
+
_context.n = 10;
|
|
63
63
|
return getCookies();
|
|
64
|
-
case
|
|
65
|
-
cookies = _context.
|
|
66
|
-
_context.
|
|
64
|
+
case 10:
|
|
65
|
+
cookies = _context.v;
|
|
66
|
+
_context.n = 12;
|
|
67
67
|
break;
|
|
68
|
-
case
|
|
69
|
-
_context.
|
|
70
|
-
|
|
71
|
-
console.error("Val: could not read cookies! fetchVal can only be used server-side. Use useVal on clients.",
|
|
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
|
|
73
|
+
case 12:
|
|
74
74
|
host = headers && getHost(headers);
|
|
75
75
|
if (!(host && cookies)) {
|
|
76
|
-
_context.
|
|
76
|
+
_context.n = 17;
|
|
77
77
|
break;
|
|
78
78
|
}
|
|
79
|
-
_context.
|
|
79
|
+
_context.n = 13;
|
|
80
80
|
return valServerPromise;
|
|
81
|
-
case
|
|
82
|
-
valServer = _context.
|
|
83
|
-
_context.
|
|
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
|
|
93
|
-
treeRes = _context.
|
|
92
|
+
case 14:
|
|
93
|
+
treeRes = _context.v;
|
|
94
94
|
if (!(treeRes.status === 200)) {
|
|
95
|
-
_context.
|
|
95
|
+
_context.n = 15;
|
|
96
96
|
break;
|
|
97
97
|
}
|
|
98
98
|
modules = treeRes.json.modules;
|
|
99
|
-
return _context.
|
|
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
|
|
108
|
+
case 15:
|
|
109
109
|
if (!(treeRes.status === 401)) {
|
|
110
|
-
_context.
|
|
110
|
+
_context.n = 16;
|
|
111
111
|
break;
|
|
112
112
|
}
|
|
113
113
|
console.warn("Val: authentication error: ", treeRes.json.message);
|
|
114
|
-
_context.
|
|
114
|
+
_context.n = 17;
|
|
115
115
|
break;
|
|
116
|
-
case
|
|
116
|
+
case 16:
|
|
117
117
|
throw Error(JSON.stringify(treeRes.json, null, 2));
|
|
118
|
-
case
|
|
119
|
-
return _context.
|
|
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, [[
|
|
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__*/
|
|
182
|
-
var fetchVal, resolvedParams, path, schema, val, route;
|
|
183
|
-
return
|
|
184
|
-
while (1) switch (_context2.
|
|
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.
|
|
184
|
+
_context2.n = 1;
|
|
188
185
|
return Promise.resolve(params);
|
|
189
|
-
case
|
|
190
|
-
resolvedParams = _context2.
|
|
186
|
+
case 1:
|
|
187
|
+
resolvedParams = _context2.v;
|
|
191
188
|
path = selector && Internal.getValPath(selector);
|
|
192
189
|
schema = selector && Internal.getSchema(selector);
|
|
193
|
-
|
|
194
|
-
if (!
|
|
195
|
-
_context2.
|
|
190
|
+
_t4 = selector;
|
|
191
|
+
if (!_t4) {
|
|
192
|
+
_context2.n = 3;
|
|
196
193
|
break;
|
|
197
194
|
}
|
|
198
|
-
_context2.
|
|
195
|
+
_context2.n = 2;
|
|
199
196
|
return fetchVal(selector);
|
|
200
|
-
case
|
|
201
|
-
|
|
202
|
-
case
|
|
203
|
-
val =
|
|
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.
|
|
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__*/
|
|
220
|
-
var fetchVal, resolvedParams, path, schema, val, route;
|
|
221
|
-
return
|
|
222
|
-
while (1) switch (_context3.
|
|
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.
|
|
220
|
+
_context3.n = 1;
|
|
227
221
|
break;
|
|
228
222
|
}
|
|
229
|
-
|
|
230
|
-
_context3.
|
|
223
|
+
_t5 = undefined;
|
|
224
|
+
_context3.n = 3;
|
|
231
225
|
break;
|
|
232
|
-
case
|
|
233
|
-
_context3.
|
|
226
|
+
case 1:
|
|
227
|
+
_context3.n = 2;
|
|
234
228
|
return Promise.resolve(params);
|
|
235
|
-
case
|
|
236
|
-
|
|
237
|
-
case
|
|
238
|
-
resolvedParams =
|
|
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
|
-
|
|
242
|
-
if (!
|
|
243
|
-
_context3.
|
|
235
|
+
_t6 = selector;
|
|
236
|
+
if (!_t6) {
|
|
237
|
+
_context3.n = 5;
|
|
244
238
|
break;
|
|
245
239
|
}
|
|
246
|
-
_context3.
|
|
240
|
+
_context3.n = 4;
|
|
247
241
|
return fetchVal(selector);
|
|
248
|
-
case
|
|
249
|
-
|
|
250
|
-
case
|
|
251
|
-
val =
|
|
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.
|
|
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__*/
|
|
284
|
-
return
|
|
285
|
-
while (1) switch (_context4.
|
|
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.
|
|
278
|
+
_context4.n = 1;
|
|
288
279
|
return rscNextConfig.draftMode();
|
|
289
|
-
case
|
|
290
|
-
return _context4.
|
|
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__*/
|
|
300
|
-
return
|
|
301
|
-
while (1) switch (_context5.
|
|
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.
|
|
291
|
+
_context5.n = 1;
|
|
304
292
|
return rscNextConfig.draftMode();
|
|
293
|
+
case 1:
|
|
294
|
+
_context5.v.enable();
|
|
305
295
|
case 2:
|
|
306
|
-
_context5.
|
|
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__*/
|
|
316
|
-
return
|
|
317
|
-
while (1) switch (_context6.
|
|
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.
|
|
306
|
+
_context6.n = 1;
|
|
320
307
|
return rscNextConfig.draftMode();
|
|
308
|
+
case 1:
|
|
309
|
+
_context6.v.disable();
|
|
321
310
|
case 2:
|
|
322
|
-
_context6.
|
|
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__*/
|
|
335
|
-
return
|
|
336
|
-
while (1) switch (_context7.
|
|
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.
|
|
324
|
+
_context7.n = 1;
|
|
339
325
|
return rscNextConfig.draftMode();
|
|
340
|
-
case
|
|
341
|
-
return _context7.
|
|
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__*/
|
|
348
|
-
return
|
|
349
|
-
while (1) switch (_context8.
|
|
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.
|
|
334
|
+
_context8.n = 1;
|
|
352
335
|
return rscNextConfig.headers();
|
|
353
|
-
case
|
|
354
|
-
return _context8.
|
|
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__*/
|
|
361
|
-
return
|
|
362
|
-
while (1) switch (_context9.
|
|
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.
|
|
344
|
+
_context9.n = 1;
|
|
365
345
|
return rscNextConfig.cookies();
|
|
366
|
-
case
|
|
367
|
-
return _context9.
|
|
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__*/
|
|
375
|
-
return
|
|
376
|
-
while (1) switch (
|
|
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
|
-
|
|
355
|
+
_context0.n = 1;
|
|
379
356
|
return rscNextConfig.draftMode();
|
|
380
|
-
case
|
|
381
|
-
return
|
|
382
|
-
case 3:
|
|
383
|
-
case "end":
|
|
384
|
-
return _context10.stop();
|
|
357
|
+
case 1:
|
|
358
|
+
return _context0.a(2, _context0.v.isEnabled);
|
|
385
359
|
}
|
|
386
|
-
},
|
|
387
|
-
})), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
388
|
-
return
|
|
389
|
-
while (1) switch (
|
|
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
|
-
|
|
365
|
+
_context1.n = 1;
|
|
392
366
|
return rscNextConfig.headers();
|
|
393
|
-
case
|
|
394
|
-
return
|
|
395
|
-
case 3:
|
|
396
|
-
case "end":
|
|
397
|
-
return _context11.stop();
|
|
367
|
+
case 1:
|
|
368
|
+
return _context1.a(2, _context1.v);
|
|
398
369
|
}
|
|
399
|
-
},
|
|
400
|
-
})), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
401
|
-
return
|
|
402
|
-
while (1) switch (
|
|
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
|
-
|
|
375
|
+
_context10.n = 1;
|
|
405
376
|
return rscNextConfig.cookies();
|
|
406
|
-
case
|
|
407
|
-
return
|
|
408
|
-
case 3:
|
|
409
|
-
case "end":
|
|
410
|
-
return _context12.stop();
|
|
377
|
+
case 1:
|
|
378
|
+
return _context10.a(2, _context10.v);
|
|
411
379
|
}
|
|
412
|
-
},
|
|
380
|
+
}, _callee10);
|
|
413
381
|
}))),
|
|
414
|
-
fetchValRouteUrl: initFetchValRouteUrl(config, valApiEndpoints, valServerPromise, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
415
|
-
return
|
|
416
|
-
while (1) switch (
|
|
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
|
-
|
|
386
|
+
_context11.n = 1;
|
|
419
387
|
return rscNextConfig.draftMode();
|
|
420
|
-
case
|
|
421
|
-
return
|
|
422
|
-
case 3:
|
|
423
|
-
case "end":
|
|
424
|
-
return _context13.stop();
|
|
388
|
+
case 1:
|
|
389
|
+
return _context11.a(2, _context11.v.isEnabled);
|
|
425
390
|
}
|
|
426
|
-
},
|
|
427
|
-
})), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
428
|
-
return
|
|
429
|
-
while (1) switch (
|
|
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
|
-
|
|
396
|
+
_context12.n = 1;
|
|
432
397
|
return rscNextConfig.headers();
|
|
433
|
-
case
|
|
434
|
-
return
|
|
435
|
-
case 3:
|
|
436
|
-
case "end":
|
|
437
|
-
return _context14.stop();
|
|
398
|
+
case 1:
|
|
399
|
+
return _context12.a(2, _context12.v);
|
|
438
400
|
}
|
|
439
|
-
},
|
|
440
|
-
})), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
441
|
-
return
|
|
442
|
-
while (1) switch (
|
|
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
|
-
|
|
406
|
+
_context13.n = 1;
|
|
445
407
|
return rscNextConfig.cookies();
|
|
446
|
-
case
|
|
447
|
-
return
|
|
448
|
-
case 3:
|
|
449
|
-
case "end":
|
|
450
|
-
return _context15.stop();
|
|
408
|
+
case 1:
|
|
409
|
+
return _context13.a(2, _context13.v);
|
|
451
410
|
}
|
|
452
|
-
},
|
|
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-
|
|
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.
|
|
33
|
-
return asyncToGenerator.
|
|
34
|
-
while (1) switch (_context.
|
|
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.
|
|
36
|
+
_context.n = 1;
|
|
37
37
|
return nextConfig.draftMode();
|
|
38
|
-
case
|
|
39
|
-
return _context.
|
|
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.
|
|
49
|
-
return asyncToGenerator.
|
|
50
|
-
while (1) switch (_context2.
|
|
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.
|
|
49
|
+
_context2.n = 1;
|
|
53
50
|
return nextConfig.draftMode();
|
|
51
|
+
case 1:
|
|
52
|
+
_context2.v.enable();
|
|
54
53
|
case 2:
|
|
55
|
-
_context2.
|
|
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.
|
|
65
|
-
return asyncToGenerator.
|
|
66
|
-
while (1) switch (_context3.
|
|
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.
|
|
64
|
+
_context3.n = 1;
|
|
69
65
|
return nextConfig.draftMode();
|
|
66
|
+
case 1:
|
|
67
|
+
_context3.v.disable();
|
|
70
68
|
case 2:
|
|
71
|
-
_context3.
|
|
72
|
-
case 3:
|
|
73
|
-
case "end":
|
|
74
|
-
return _context3.stop();
|
|
69
|
+
return _context3.a(2);
|
|
75
70
|
}
|
|
76
71
|
}, _callee3);
|
|
77
72
|
}))();
|