@valbuild/next 0.154.0 → 0.154.2
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 +78 -0
- package/dist/{ValCanvasBridge-9b2df334.cjs.dev.js → ValCanvasBridge-194bfcc3.cjs.dev.js} +21 -2
- package/dist/{ValCanvasBridge-719e6efe.esm.js → ValCanvasBridge-aa626997.esm.js} +22 -3
- package/dist/ValCanvasBridge-cefe83f7.cjs.js +7 -0
- package/dist/{ValCanvasBridge-063ad333.cjs.prod.js → ValCanvasBridge-cefe83f7.cjs.prod.js} +21 -2
- package/dist/ValNextProvider-27242758.esm.js +1 -1
- package/dist/ValNextProvider-4838fed0.cjs.dev.js +1 -1
- package/dist/ValNextProvider-9343dc1e.cjs.prod.js +1 -1
- package/dist/ValPreviewBridge-2d09c5a9.cjs.dev.js +38 -0
- package/dist/ValPreviewBridge-81f717c7.cjs.js +7 -0
- package/dist/ValPreviewBridge-81f717c7.cjs.prod.js +38 -0
- package/dist/ValPreviewBridge-c635208d.esm.js +34 -0
- package/dist/ValPreviewError-137b27f8.cjs.dev.js +59 -0
- package/dist/ValPreviewError-37a42fdf.esm.js +55 -0
- package/dist/ValPreviewError-cc0aef49.cjs.js +7 -0
- package/dist/ValPreviewError-cc0aef49.cjs.prod.js +59 -0
- package/dist/declarations/src/ValComponentPreview.d.ts +58 -0
- package/dist/declarations/src/ValPreviewBridge.d.ts +21 -0
- package/dist/declarations/src/ValPreviewError.d.ts +25 -0
- package/dist/declarations/src/external_exempt_from_val_quickjs.d.ts +4 -0
- package/dist/declarations/src/rsc/initValRsc.d.ts +4 -4
- package/dist/valbuild-next.cjs.dev.js +96 -1
- package/dist/valbuild-next.cjs.prod.js +96 -1
- package/dist/valbuild-next.esm.js +86 -3
- package/dist/{version-9adeab58.esm.js → version-281feaf7.esm.js} +1 -1
- package/dist/{version-4d44d9cd.cjs.prod.js → version-c40f4d2d.cjs.prod.js} +1 -1
- package/dist/{version-93ae5f54.cjs.dev.js → version-f62ea496.cjs.dev.js} +1 -1
- package/package.json +8 -8
- package/rsc/dist/valbuild-next-rsc.cjs.dev.js +30 -21
- package/rsc/dist/valbuild-next-rsc.cjs.prod.js +30 -21
- package/rsc/dist/valbuild-next-rsc.esm.js +20 -11
- package/server/dist/valbuild-next-server.cjs.dev.js +1 -1
- package/server/dist/valbuild-next-server.cjs.prod.js +1 -1
- package/server/dist/valbuild-next-server.esm.js +1 -1
- package/dist/ValCanvasBridge-063ad333.cjs.js +0 -7
|
@@ -6,11 +6,11 @@ require('server-only');
|
|
|
6
6
|
var asyncToGenerator = require('../../dist/asyncToGenerator-8e5c36c8.cjs.prod.js');
|
|
7
7
|
var objectSpread2 = require('../../dist/objectSpread2-469273e9.cjs.prod.js');
|
|
8
8
|
var stega = require('@valbuild/react/stega');
|
|
9
|
-
var internal
|
|
9
|
+
var internal = require('@valbuild/react/internal');
|
|
10
10
|
var core = require('@valbuild/core');
|
|
11
11
|
var internal$2 = require('@valbuild/shared/internal');
|
|
12
|
-
var internal = require('@valbuild/server/internal');
|
|
13
|
-
var version = require('../../dist/version-
|
|
12
|
+
var internal$1 = require('@valbuild/server/internal');
|
|
13
|
+
var version = require('../../dist/version-c40f4d2d.cjs.prod.js');
|
|
14
14
|
var routeFromVal = require('../../dist/routeFromVal-c4dace91.cjs.prod.js');
|
|
15
15
|
require('../../dist/createForOfIteratorHelper-8459fbc7.cjs.prod.js');
|
|
16
16
|
require('../../dist/unsupportedIterableToArray-1aadf9fb.cjs.prod.js');
|
|
@@ -30,7 +30,8 @@ stega.SET_RSC(true);
|
|
|
30
30
|
/**
|
|
31
31
|
* What the readers read: this process's runtime for the app's `val.modules`
|
|
32
32
|
* (`createValRuntime`), the same one the API route's server is built on.
|
|
33
|
-
* Its head is the draft, read with the request's session.
|
|
33
|
+
* Its head is the draft, read with the request's session. Asked for by the
|
|
34
|
+
* first draft read, never by a visitor's.
|
|
34
35
|
*/
|
|
35
36
|
|
|
36
37
|
/** What a misuse of a reader is told, beside what went wrong. */
|
|
@@ -63,7 +64,7 @@ function fetchValWithReads(deps) {
|
|
|
63
64
|
while (1) switch (_context.n) {
|
|
64
65
|
case 0:
|
|
65
66
|
_context.n = 1;
|
|
66
|
-
return internal.draftForRequest({
|
|
67
|
+
return internal$1.draftForRequest({
|
|
67
68
|
runtime: deps.runtime,
|
|
68
69
|
isEnabled: deps.isEnabled,
|
|
69
70
|
getCookies: deps.getCookies,
|
|
@@ -77,8 +78,8 @@ function fetchValWithReads(deps) {
|
|
|
77
78
|
enabled = _yield$draftForReques.enabled;
|
|
78
79
|
draft = _yield$draftForReques.draft;
|
|
79
80
|
env = requestEnv(enabled, draft);
|
|
80
|
-
return _context.a(2, internal
|
|
81
|
-
return internal
|
|
81
|
+
return _context.a(2, internal.awaitResolved(function (settled) {
|
|
82
|
+
return internal.resolveVal(selector, env, objectSpread2._objectSpread2({
|
|
82
83
|
settled: settled
|
|
83
84
|
}, opts));
|
|
84
85
|
}));
|
|
@@ -91,7 +92,7 @@ function fetchValWithReads(deps) {
|
|
|
91
92
|
}();
|
|
92
93
|
}
|
|
93
94
|
var initFetchValStega = function initFetchValStega(deps) {
|
|
94
|
-
return internal
|
|
95
|
+
return internal.fetchValFrom(fetchValWithReads(deps));
|
|
95
96
|
};
|
|
96
97
|
var initFetchValRouteStega = function initFetchValRouteStega(deps) {
|
|
97
98
|
var fetchVal = fetchValWithReads(deps);
|
|
@@ -112,7 +113,7 @@ var initFetchValRouteStega = function initFetchValRouteStega(deps) {
|
|
|
112
113
|
path = valModule && core.Internal.getValPath(valModule);
|
|
113
114
|
schema = valModule && core.Internal.getSchema(valModule); // `.jsonValues()` router: map params → the entry key and load ONLY that
|
|
114
115
|
// entry, instead of the whole record.
|
|
115
|
-
if (!internal
|
|
116
|
+
if (!internal.isJsonValuesRecordSchema(schema)) {
|
|
116
117
|
_context2.n = 4;
|
|
117
118
|
break;
|
|
118
119
|
}
|
|
@@ -169,7 +170,7 @@ var initFetchValKeyStega = function initFetchValKeyStega(deps) {
|
|
|
169
170
|
while (1) switch (_context3.n) {
|
|
170
171
|
case 0:
|
|
171
172
|
_context3.n = 1;
|
|
172
|
-
return internal.draftForRequest({
|
|
173
|
+
return internal$1.draftForRequest({
|
|
173
174
|
runtime: deps.runtime,
|
|
174
175
|
isEnabled: deps.isEnabled,
|
|
175
176
|
getCookies: deps.getCookies
|
|
@@ -180,8 +181,8 @@ var initFetchValKeyStega = function initFetchValKeyStega(deps) {
|
|
|
180
181
|
draft = _yield$draftForReques2.draft;
|
|
181
182
|
env = requestEnv(enabled, draft);
|
|
182
183
|
_context3.n = 2;
|
|
183
|
-
return internal
|
|
184
|
-
return internal
|
|
184
|
+
return internal.awaitResolved(function (settled) {
|
|
185
|
+
return internal.resolveValEntry(selector, key, env, {
|
|
185
186
|
settled: settled
|
|
186
187
|
});
|
|
187
188
|
});
|
|
@@ -268,7 +269,7 @@ var initFetchValDraft = function initFetchValDraft(deps) {
|
|
|
268
269
|
while (1) switch (_context5.n) {
|
|
269
270
|
case 0:
|
|
270
271
|
_context5.n = 1;
|
|
271
|
-
return internal.readDraftChanges(deps);
|
|
272
|
+
return internal$1.readDraftChanges(deps);
|
|
272
273
|
case 1:
|
|
273
274
|
changes = _context5.v;
|
|
274
275
|
return _context5.a(2, changes === null ? null : {
|
|
@@ -289,14 +290,22 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
289
290
|
throw new Error("Could not get @valbuild/next package version");
|
|
290
291
|
}
|
|
291
292
|
// One runtime per process for these modules: the API route's server is
|
|
292
|
-
// built on the same one, so a save through it moves what these read.
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
293
|
+
// built on the same one, so a save through it moves what these read. Built
|
|
294
|
+
// by the first draft read and not before: building it evaluates the data
|
|
295
|
+
// layer (TypeScript, the Studio's assets), which a visitor never needs.
|
|
296
|
+
var started = null;
|
|
297
|
+
var runtime = function runtime() {
|
|
298
|
+
return started !== null && started !== void 0 ? started : started = startRuntime();
|
|
299
|
+
};
|
|
300
|
+
var startRuntime = function startRuntime() {
|
|
301
|
+
return internal$1.createValRuntime(valModules, "/api/val", objectSpread2._objectSpread2({
|
|
302
|
+
versions: {
|
|
303
|
+
next: nextVersion,
|
|
304
|
+
core: coreVersion,
|
|
305
|
+
framework: "next"
|
|
306
|
+
}
|
|
307
|
+
}, config), config);
|
|
308
|
+
};
|
|
300
309
|
var deps = {
|
|
301
310
|
runtime: runtime,
|
|
302
311
|
isEnabled: function () {
|
|
@@ -5,8 +5,8 @@ import { SET_RSC, SET_AUTO_TAG_JSX_ENABLED } from '@valbuild/react/stega';
|
|
|
5
5
|
import { fetchValFrom, isJsonValuesRecordSchema, awaitResolved, resolveValEntry, resolveVal } from '@valbuild/react/internal';
|
|
6
6
|
import { Internal } from '@valbuild/core';
|
|
7
7
|
import { readerSchemaVersion } from '@valbuild/shared/internal';
|
|
8
|
-
import {
|
|
9
|
-
import { V as VERSION } from '../../dist/version-
|
|
8
|
+
import { readDraftChanges, draftForRequest, createValRuntime } from '@valbuild/server/internal';
|
|
9
|
+
import { V as VERSION } from '../../dist/version-281feaf7.esm.js';
|
|
10
10
|
import { i as initValRouteFromVal, g as getValRouteUrlFromVal } from '../../dist/routeFromVal-80976677.esm.js';
|
|
11
11
|
import '../../dist/createForOfIteratorHelper-9209e9dd.esm.js';
|
|
12
12
|
import '../../dist/unsupportedIterableToArray-f57eb659.esm.js';
|
|
@@ -26,7 +26,8 @@ SET_RSC(true);
|
|
|
26
26
|
/**
|
|
27
27
|
* What the readers read: this process's runtime for the app's `val.modules`
|
|
28
28
|
* (`createValRuntime`), the same one the API route's server is built on.
|
|
29
|
-
* Its head is the draft, read with the request's session.
|
|
29
|
+
* Its head is the draft, read with the request's session. Asked for by the
|
|
30
|
+
* first draft read, never by a visitor's.
|
|
30
31
|
*/
|
|
31
32
|
|
|
32
33
|
/** What a misuse of a reader is told, beside what went wrong. */
|
|
@@ -285,14 +286,22 @@ function initValRsc(config, valModules, rscNextConfig) {
|
|
|
285
286
|
throw new Error("Could not get @valbuild/next package version");
|
|
286
287
|
}
|
|
287
288
|
// One runtime per process for these modules: the API route's server is
|
|
288
|
-
// built on the same one, so a save through it moves what these read.
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
289
|
+
// built on the same one, so a save through it moves what these read. Built
|
|
290
|
+
// by the first draft read and not before: building it evaluates the data
|
|
291
|
+
// layer (TypeScript, the Studio's assets), which a visitor never needs.
|
|
292
|
+
var started = null;
|
|
293
|
+
var runtime = function runtime() {
|
|
294
|
+
return started !== null && started !== void 0 ? started : started = startRuntime();
|
|
295
|
+
};
|
|
296
|
+
var startRuntime = function startRuntime() {
|
|
297
|
+
return createValRuntime(valModules, "/api/val", _objectSpread2({
|
|
298
|
+
versions: {
|
|
299
|
+
next: nextVersion,
|
|
300
|
+
core: coreVersion,
|
|
301
|
+
framework: "next"
|
|
302
|
+
}
|
|
303
|
+
}, config), config);
|
|
304
|
+
};
|
|
296
305
|
var deps = {
|
|
297
306
|
runtime: runtime,
|
|
298
307
|
isEnabled: function () {
|
|
@@ -9,7 +9,7 @@ var objectSpread2 = require('../../dist/objectSpread2-58726b14.cjs.dev.js');
|
|
|
9
9
|
var core = require('@valbuild/core');
|
|
10
10
|
var server = require('@valbuild/server');
|
|
11
11
|
var server$1 = require('next/server');
|
|
12
|
-
var version = require('../../dist/version-
|
|
12
|
+
var version = require('../../dist/version-f62ea496.cjs.dev.js');
|
|
13
13
|
var mcp = require('@valbuild/mcp');
|
|
14
14
|
require('../../dist/unsupportedIterableToArray-20a9209f.cjs.dev.js');
|
|
15
15
|
|
|
@@ -9,7 +9,7 @@ var objectSpread2 = require('../../dist/objectSpread2-469273e9.cjs.prod.js');
|
|
|
9
9
|
var core = require('@valbuild/core');
|
|
10
10
|
var server = require('@valbuild/server');
|
|
11
11
|
var server$1 = require('next/server');
|
|
12
|
-
var version = require('../../dist/version-
|
|
12
|
+
var version = require('../../dist/version-c40f4d2d.cjs.prod.js');
|
|
13
13
|
var mcp = require('@valbuild/mcp');
|
|
14
14
|
require('../../dist/unsupportedIterableToArray-1aadf9fb.cjs.prod.js');
|
|
15
15
|
|
|
@@ -6,7 +6,7 @@ import { Internal } from '@valbuild/core';
|
|
|
6
6
|
import { createValApiRouter, createValServer } from '@valbuild/server';
|
|
7
7
|
export { createPrettierFormatter } from '@valbuild/server';
|
|
8
8
|
import { NextResponse } from 'next/server';
|
|
9
|
-
import { V as VERSION } from '../../dist/version-
|
|
9
|
+
import { V as VERSION } from '../../dist/version-281feaf7.esm.js';
|
|
10
10
|
import { initValMcp as initValMcp$1 } from '@valbuild/mcp';
|
|
11
11
|
import '../../dist/unsupportedIterableToArray-f57eb659.esm.js';
|
|
12
12
|
|