@valbuild/core 0.139.0 → 0.139.1
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 +6 -0
- package/dist/declarations/src/extractValModules.d.ts +14 -0
- package/dist/declarations/src/index.d.ts +1 -1
- package/dist/{index-8920ba3f.cjs.prod.js → index-7d334094.cjs.prod.js} +57 -28
- package/dist/{index-e13b725c.cjs.dev.js → index-90000f7a.cjs.dev.js} +57 -28
- package/dist/{index-d949d13b.esm.js → index-eb9f6480.esm.js} +57 -29
- package/dist/valbuild-core.cjs.dev.js +2 -1
- package/dist/valbuild-core.cjs.prod.js +2 -1
- package/dist/valbuild-core.esm.js +1 -1
- package/package.json +1 -1
- package/patch/dist/valbuild-core-patch.cjs.dev.js +1 -1
- package/patch/dist/valbuild-core-patch.cjs.prod.js +1 -1
- package/patch/dist/valbuild-core-patch.esm.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @valbuild/core
|
|
2
2
|
|
|
3
|
+
## 0.139.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#780](https://github.com/valbuild/val/pull/780) [`db13bed`](https://github.com/valbuild/val/commit/db13bed902f9f9147feb5be07ce47fe8b5b143f9) Thanks [@freekh](https://github.com/freekh)! - When a new version of your site with a changed schema is deployed while Val Studio is open, the Studio now asks you to reload before you keep editing, instead of carrying on with the old schema.
|
|
8
|
+
|
|
3
9
|
## 0.139.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -85,6 +85,20 @@ export declare function computeSourcesSha(entries: readonly {
|
|
|
85
85
|
path: string;
|
|
86
86
|
source: unknown;
|
|
87
87
|
}[]): string;
|
|
88
|
+
/**
|
|
89
|
+
* The `schemaSha` fold on its own: path and serialized schema, in `val.modules`
|
|
90
|
+
* order.
|
|
91
|
+
*
|
|
92
|
+
* Separate for the same reason as {@link computeSourcesSha}: the Studio folds
|
|
93
|
+
* the schemas of the bundle it is running and compares the answer with the
|
|
94
|
+
* `schemaSha` on `/stat`, which is how it learns that a new schema has been
|
|
95
|
+
* deployed under it. One implementation, so that comparison is between two
|
|
96
|
+
* runs of the same code.
|
|
97
|
+
*/
|
|
98
|
+
export declare function computeSchemaSha(entries: readonly {
|
|
99
|
+
path: string;
|
|
100
|
+
serializedSchema: unknown;
|
|
101
|
+
}[]): string;
|
|
88
102
|
export declare function computeValModuleShas(config: ValModules["config"], entries: readonly ValModuleShaEntry[], moduleErrors: readonly ExtractedModuleError[]): ValModuleShas;
|
|
89
103
|
/**
|
|
90
104
|
* Extracts schemas and sources from a ValModules registry and computes the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { initVal, type ConfigDirectory } from "./initVal.js";
|
|
2
2
|
export { modules, type ValModules } from "./modules.js";
|
|
3
|
-
export { extractValModules, computeValModuleShas, computeSourcesSha, type ExtractedValModules, type ValModuleShaEntry, type ValModuleShas, type ExtractedModuleError, } from "./extractValModules.js";
|
|
3
|
+
export { extractValModules, computeValModuleShas, computeSourcesSha, computeSchemaSha, type ExtractedValModules, type ValModuleShaEntry, type ValModuleShas, type ExtractedModuleError, } from "./extractValModules.js";
|
|
4
4
|
export type { InitVal, ValConfig, ValConstructor, ContentConstructor, } from "./initVal.js";
|
|
5
5
|
export { Schema, type SerializedSchema, type SelectorOfSchema } from "./schema/index.js";
|
|
6
6
|
export { hasRemoteFileSchema, hasMediaSchema, } from "./schema/hasRemoteFileSchema.js";
|
|
@@ -12359,6 +12359,43 @@ function computeSourcesSha(entries) {
|
|
|
12359
12359
|
}
|
|
12360
12360
|
return sourcesSha;
|
|
12361
12361
|
}
|
|
12362
|
+
|
|
12363
|
+
/**
|
|
12364
|
+
* The `schemaSha` fold on its own: path and serialized schema, in `val.modules`
|
|
12365
|
+
* order.
|
|
12366
|
+
*
|
|
12367
|
+
* Separate for the same reason as {@link computeSourcesSha}: the Studio folds
|
|
12368
|
+
* the schemas of the bundle it is running and compares the answer with the
|
|
12369
|
+
* `schemaSha` on `/stat`, which is how it learns that a new schema has been
|
|
12370
|
+
* deployed under it. One implementation, so that comparison is between two
|
|
12371
|
+
* runs of the same code.
|
|
12372
|
+
*/
|
|
12373
|
+
function computeSchemaSha(entries) {
|
|
12374
|
+
var schemaSha = "";
|
|
12375
|
+
var _iterator2 = result._createForOfIteratorHelper(entries),
|
|
12376
|
+
_step2;
|
|
12377
|
+
try {
|
|
12378
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
12379
|
+
var _step2$value = _step2.value,
|
|
12380
|
+
path = _step2$value.path,
|
|
12381
|
+
serializedSchema = _step2$value.serializedSchema;
|
|
12382
|
+
// The PATH is part of the schema set, not just the schema: renaming a
|
|
12383
|
+
// module while leaving its schema byte-identical still changes which paths
|
|
12384
|
+
// exist, and an open client keyed its schema cache by the old path. Hashing
|
|
12385
|
+
// the schema alone left this SHA unchanged, so with no commitSha to fall
|
|
12386
|
+
// back on the client never refetched /schema.
|
|
12387
|
+
schemaSha = hash(schemaSha + JSON.stringify({
|
|
12388
|
+
path: path,
|
|
12389
|
+
schema: serializedSchema
|
|
12390
|
+
}));
|
|
12391
|
+
}
|
|
12392
|
+
} catch (err) {
|
|
12393
|
+
_iterator2.e(err);
|
|
12394
|
+
} finally {
|
|
12395
|
+
_iterator2.f();
|
|
12396
|
+
}
|
|
12397
|
+
return schemaSha;
|
|
12398
|
+
}
|
|
12362
12399
|
function computeValModuleShas(config, entries, moduleErrors) {
|
|
12363
12400
|
var configSha = hash(JSON.stringify(config));
|
|
12364
12401
|
var sourcesSha = computeSourcesSha(entries);
|
|
@@ -12371,12 +12408,12 @@ function computeValModuleShas(config, entries, moduleErrors) {
|
|
|
12371
12408
|
// `gitCommit: process.env.VERCEL_GIT_COMMIT_SHA` / `gitBranch`, which are
|
|
12372
12409
|
// server-only env vars and therefore `undefined` in the browser. Seeding with
|
|
12373
12410
|
// them made the two sides disagree on every production load.
|
|
12374
|
-
var schemaSha =
|
|
12375
|
-
var
|
|
12376
|
-
|
|
12411
|
+
var schemaSha = computeSchemaSha(entries);
|
|
12412
|
+
var _iterator3 = result._createForOfIteratorHelper(entries),
|
|
12413
|
+
_step3;
|
|
12377
12414
|
try {
|
|
12378
|
-
for (
|
|
12379
|
-
var entry =
|
|
12415
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
12416
|
+
var entry = _step3.value;
|
|
12380
12417
|
var path = entry.path,
|
|
12381
12418
|
source = entry.source,
|
|
12382
12419
|
serializedSchema = entry.serializedSchema;
|
|
@@ -12386,20 +12423,11 @@ function computeValModuleShas(config, entries, moduleErrors) {
|
|
|
12386
12423
|
source: source,
|
|
12387
12424
|
modulesErrors: moduleErrors.slice(0, entry.moduleErrorsAt)
|
|
12388
12425
|
}));
|
|
12389
|
-
// The PATH is part of the schema set, not just the schema: renaming a
|
|
12390
|
-
// module while leaving its schema byte-identical still changes which paths
|
|
12391
|
-
// exist, and an open client keyed its schema cache by the old path. Hashing
|
|
12392
|
-
// the schema alone left this SHA unchanged, so with no commitSha to fall
|
|
12393
|
-
// back on the client never refetched /schema.
|
|
12394
|
-
schemaSha = hash(schemaSha + JSON.stringify({
|
|
12395
|
-
path: path,
|
|
12396
|
-
schema: serializedSchema
|
|
12397
|
-
}));
|
|
12398
12426
|
}
|
|
12399
12427
|
} catch (err) {
|
|
12400
|
-
|
|
12428
|
+
_iterator3.e(err);
|
|
12401
12429
|
} finally {
|
|
12402
|
-
|
|
12430
|
+
_iterator3.f();
|
|
12403
12431
|
}
|
|
12404
12432
|
return {
|
|
12405
12433
|
baseSha: baseSha,
|
|
@@ -12421,7 +12449,7 @@ function extractValModules(_x) {
|
|
|
12421
12449
|
}
|
|
12422
12450
|
function _extractValModules() {
|
|
12423
12451
|
_extractValModules = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(valModules) {
|
|
12424
|
-
var moduleErrors, addModuleError, sources, schemas, serializedSchemas, shaEntries, moduleIdx, module, at, value, path, schema, source, serializedSchema, pathM,
|
|
12452
|
+
var moduleErrors, addModuleError, sources, schemas, serializedSchemas, shaEntries, moduleIdx, module, at, value, path, schema, source, serializedSchema, pathM, _iterator4, _step4, error, _iterator5, _step5, _error, _t, _t2;
|
|
12425
12453
|
return _regenerator().w(function (_context) {
|
|
12426
12454
|
while (1) switch (_context.p = _context.n) {
|
|
12427
12455
|
case 0:
|
|
@@ -12568,10 +12596,10 @@ function _extractValModules() {
|
|
|
12568
12596
|
// Appended AFTER the loop on purpose: each entry's `moduleErrorsAt` is the
|
|
12569
12597
|
// error count at the time it was folded in, so the SHAs stay a function of
|
|
12570
12598
|
// the modules themselves.
|
|
12571
|
-
|
|
12599
|
+
_iterator4 = result._createForOfIteratorHelper(resolveSettingsModule(serializedSchemas).errors);
|
|
12572
12600
|
try {
|
|
12573
|
-
for (
|
|
12574
|
-
error =
|
|
12601
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
12602
|
+
error = _step4.value;
|
|
12575
12603
|
moduleErrors.push(error);
|
|
12576
12604
|
}
|
|
12577
12605
|
// Same kind of rule, same reason it is here: a view cycle is a property of the
|
|
@@ -12579,20 +12607,20 @@ function _extractValModules() {
|
|
|
12579
12607
|
// catches it either — a view stores a pointer, not content, so there is no
|
|
12580
12608
|
// data cycle for a source walk to trip over.
|
|
12581
12609
|
} catch (err) {
|
|
12582
|
-
|
|
12610
|
+
_iterator4.e(err);
|
|
12583
12611
|
} finally {
|
|
12584
|
-
|
|
12612
|
+
_iterator4.f();
|
|
12585
12613
|
}
|
|
12586
|
-
|
|
12614
|
+
_iterator5 = result._createForOfIteratorHelper(viewCycleErrors(serializedSchemas));
|
|
12587
12615
|
try {
|
|
12588
|
-
for (
|
|
12589
|
-
_error =
|
|
12616
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
12617
|
+
_error = _step5.value;
|
|
12590
12618
|
moduleErrors.push(_error);
|
|
12591
12619
|
}
|
|
12592
12620
|
} catch (err) {
|
|
12593
|
-
|
|
12621
|
+
_iterator5.e(err);
|
|
12594
12622
|
} finally {
|
|
12595
|
-
|
|
12623
|
+
_iterator5.f();
|
|
12596
12624
|
}
|
|
12597
12625
|
return _context.a(2, _objectSpread2(_objectSpread2({
|
|
12598
12626
|
sources: sources,
|
|
@@ -14090,7 +14118,7 @@ function isPageRouter(routerId) {
|
|
|
14090
14118
|
|
|
14091
14119
|
var corePackageJson = {
|
|
14092
14120
|
name: "@valbuild/core",
|
|
14093
|
-
version: "0.139.
|
|
14121
|
+
version: "0.139.1",
|
|
14094
14122
|
"private": false,
|
|
14095
14123
|
description: "Val - supercharged hard-coded content",
|
|
14096
14124
|
repository: {
|
|
@@ -14344,6 +14372,7 @@ exports._slicedToArray = _slicedToArray;
|
|
|
14344
14372
|
exports._toConsumableArray = _toConsumableArray;
|
|
14345
14373
|
exports._typeof = _typeof;
|
|
14346
14374
|
exports.assistantAvailability = assistantAvailability;
|
|
14375
|
+
exports.computeSchemaSha = computeSchemaSha;
|
|
14347
14376
|
exports.computeSourcesSha = computeSourcesSha;
|
|
14348
14377
|
exports.computeValModuleShas = computeValModuleShas;
|
|
14349
14378
|
exports.declaredKeySetOf = declaredKeySetOf;
|
|
@@ -12359,6 +12359,43 @@ function computeSourcesSha(entries) {
|
|
|
12359
12359
|
}
|
|
12360
12360
|
return sourcesSha;
|
|
12361
12361
|
}
|
|
12362
|
+
|
|
12363
|
+
/**
|
|
12364
|
+
* The `schemaSha` fold on its own: path and serialized schema, in `val.modules`
|
|
12365
|
+
* order.
|
|
12366
|
+
*
|
|
12367
|
+
* Separate for the same reason as {@link computeSourcesSha}: the Studio folds
|
|
12368
|
+
* the schemas of the bundle it is running and compares the answer with the
|
|
12369
|
+
* `schemaSha` on `/stat`, which is how it learns that a new schema has been
|
|
12370
|
+
* deployed under it. One implementation, so that comparison is between two
|
|
12371
|
+
* runs of the same code.
|
|
12372
|
+
*/
|
|
12373
|
+
function computeSchemaSha(entries) {
|
|
12374
|
+
var schemaSha = "";
|
|
12375
|
+
var _iterator2 = result._createForOfIteratorHelper(entries),
|
|
12376
|
+
_step2;
|
|
12377
|
+
try {
|
|
12378
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
12379
|
+
var _step2$value = _step2.value,
|
|
12380
|
+
path = _step2$value.path,
|
|
12381
|
+
serializedSchema = _step2$value.serializedSchema;
|
|
12382
|
+
// The PATH is part of the schema set, not just the schema: renaming a
|
|
12383
|
+
// module while leaving its schema byte-identical still changes which paths
|
|
12384
|
+
// exist, and an open client keyed its schema cache by the old path. Hashing
|
|
12385
|
+
// the schema alone left this SHA unchanged, so with no commitSha to fall
|
|
12386
|
+
// back on the client never refetched /schema.
|
|
12387
|
+
schemaSha = hash(schemaSha + JSON.stringify({
|
|
12388
|
+
path: path,
|
|
12389
|
+
schema: serializedSchema
|
|
12390
|
+
}));
|
|
12391
|
+
}
|
|
12392
|
+
} catch (err) {
|
|
12393
|
+
_iterator2.e(err);
|
|
12394
|
+
} finally {
|
|
12395
|
+
_iterator2.f();
|
|
12396
|
+
}
|
|
12397
|
+
return schemaSha;
|
|
12398
|
+
}
|
|
12362
12399
|
function computeValModuleShas(config, entries, moduleErrors) {
|
|
12363
12400
|
var configSha = hash(JSON.stringify(config));
|
|
12364
12401
|
var sourcesSha = computeSourcesSha(entries);
|
|
@@ -12371,12 +12408,12 @@ function computeValModuleShas(config, entries, moduleErrors) {
|
|
|
12371
12408
|
// `gitCommit: process.env.VERCEL_GIT_COMMIT_SHA` / `gitBranch`, which are
|
|
12372
12409
|
// server-only env vars and therefore `undefined` in the browser. Seeding with
|
|
12373
12410
|
// them made the two sides disagree on every production load.
|
|
12374
|
-
var schemaSha =
|
|
12375
|
-
var
|
|
12376
|
-
|
|
12411
|
+
var schemaSha = computeSchemaSha(entries);
|
|
12412
|
+
var _iterator3 = result._createForOfIteratorHelper(entries),
|
|
12413
|
+
_step3;
|
|
12377
12414
|
try {
|
|
12378
|
-
for (
|
|
12379
|
-
var entry =
|
|
12415
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
12416
|
+
var entry = _step3.value;
|
|
12380
12417
|
var path = entry.path,
|
|
12381
12418
|
source = entry.source,
|
|
12382
12419
|
serializedSchema = entry.serializedSchema;
|
|
@@ -12386,20 +12423,11 @@ function computeValModuleShas(config, entries, moduleErrors) {
|
|
|
12386
12423
|
source: source,
|
|
12387
12424
|
modulesErrors: moduleErrors.slice(0, entry.moduleErrorsAt)
|
|
12388
12425
|
}));
|
|
12389
|
-
// The PATH is part of the schema set, not just the schema: renaming a
|
|
12390
|
-
// module while leaving its schema byte-identical still changes which paths
|
|
12391
|
-
// exist, and an open client keyed its schema cache by the old path. Hashing
|
|
12392
|
-
// the schema alone left this SHA unchanged, so with no commitSha to fall
|
|
12393
|
-
// back on the client never refetched /schema.
|
|
12394
|
-
schemaSha = hash(schemaSha + JSON.stringify({
|
|
12395
|
-
path: path,
|
|
12396
|
-
schema: serializedSchema
|
|
12397
|
-
}));
|
|
12398
12426
|
}
|
|
12399
12427
|
} catch (err) {
|
|
12400
|
-
|
|
12428
|
+
_iterator3.e(err);
|
|
12401
12429
|
} finally {
|
|
12402
|
-
|
|
12430
|
+
_iterator3.f();
|
|
12403
12431
|
}
|
|
12404
12432
|
return {
|
|
12405
12433
|
baseSha: baseSha,
|
|
@@ -12421,7 +12449,7 @@ function extractValModules(_x) {
|
|
|
12421
12449
|
}
|
|
12422
12450
|
function _extractValModules() {
|
|
12423
12451
|
_extractValModules = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(valModules) {
|
|
12424
|
-
var moduleErrors, addModuleError, sources, schemas, serializedSchemas, shaEntries, moduleIdx, module, at, value, path, schema, source, serializedSchema, pathM,
|
|
12452
|
+
var moduleErrors, addModuleError, sources, schemas, serializedSchemas, shaEntries, moduleIdx, module, at, value, path, schema, source, serializedSchema, pathM, _iterator4, _step4, error, _iterator5, _step5, _error, _t, _t2;
|
|
12425
12453
|
return _regenerator().w(function (_context) {
|
|
12426
12454
|
while (1) switch (_context.p = _context.n) {
|
|
12427
12455
|
case 0:
|
|
@@ -12568,10 +12596,10 @@ function _extractValModules() {
|
|
|
12568
12596
|
// Appended AFTER the loop on purpose: each entry's `moduleErrorsAt` is the
|
|
12569
12597
|
// error count at the time it was folded in, so the SHAs stay a function of
|
|
12570
12598
|
// the modules themselves.
|
|
12571
|
-
|
|
12599
|
+
_iterator4 = result._createForOfIteratorHelper(resolveSettingsModule(serializedSchemas).errors);
|
|
12572
12600
|
try {
|
|
12573
|
-
for (
|
|
12574
|
-
error =
|
|
12601
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
12602
|
+
error = _step4.value;
|
|
12575
12603
|
moduleErrors.push(error);
|
|
12576
12604
|
}
|
|
12577
12605
|
// Same kind of rule, same reason it is here: a view cycle is a property of the
|
|
@@ -12579,20 +12607,20 @@ function _extractValModules() {
|
|
|
12579
12607
|
// catches it either — a view stores a pointer, not content, so there is no
|
|
12580
12608
|
// data cycle for a source walk to trip over.
|
|
12581
12609
|
} catch (err) {
|
|
12582
|
-
|
|
12610
|
+
_iterator4.e(err);
|
|
12583
12611
|
} finally {
|
|
12584
|
-
|
|
12612
|
+
_iterator4.f();
|
|
12585
12613
|
}
|
|
12586
|
-
|
|
12614
|
+
_iterator5 = result._createForOfIteratorHelper(viewCycleErrors(serializedSchemas));
|
|
12587
12615
|
try {
|
|
12588
|
-
for (
|
|
12589
|
-
_error =
|
|
12616
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
12617
|
+
_error = _step5.value;
|
|
12590
12618
|
moduleErrors.push(_error);
|
|
12591
12619
|
}
|
|
12592
12620
|
} catch (err) {
|
|
12593
|
-
|
|
12621
|
+
_iterator5.e(err);
|
|
12594
12622
|
} finally {
|
|
12595
|
-
|
|
12623
|
+
_iterator5.f();
|
|
12596
12624
|
}
|
|
12597
12625
|
return _context.a(2, _objectSpread2(_objectSpread2({
|
|
12598
12626
|
sources: sources,
|
|
@@ -14090,7 +14118,7 @@ function isPageRouter(routerId) {
|
|
|
14090
14118
|
|
|
14091
14119
|
var corePackageJson = {
|
|
14092
14120
|
name: "@valbuild/core",
|
|
14093
|
-
version: "0.139.
|
|
14121
|
+
version: "0.139.1",
|
|
14094
14122
|
"private": false,
|
|
14095
14123
|
description: "Val - supercharged hard-coded content",
|
|
14096
14124
|
repository: {
|
|
@@ -14344,6 +14372,7 @@ exports._slicedToArray = _slicedToArray;
|
|
|
14344
14372
|
exports._toConsumableArray = _toConsumableArray;
|
|
14345
14373
|
exports._typeof = _typeof;
|
|
14346
14374
|
exports.assistantAvailability = assistantAvailability;
|
|
14375
|
+
exports.computeSchemaSha = computeSchemaSha;
|
|
14347
14376
|
exports.computeSourcesSha = computeSourcesSha;
|
|
14348
14377
|
exports.computeValModuleShas = computeValModuleShas;
|
|
14349
14378
|
exports.declaredKeySetOf = declaredKeySetOf;
|
|
@@ -12357,6 +12357,43 @@ function computeSourcesSha(entries) {
|
|
|
12357
12357
|
}
|
|
12358
12358
|
return sourcesSha;
|
|
12359
12359
|
}
|
|
12360
|
+
|
|
12361
|
+
/**
|
|
12362
|
+
* The `schemaSha` fold on its own: path and serialized schema, in `val.modules`
|
|
12363
|
+
* order.
|
|
12364
|
+
*
|
|
12365
|
+
* Separate for the same reason as {@link computeSourcesSha}: the Studio folds
|
|
12366
|
+
* the schemas of the bundle it is running and compares the answer with the
|
|
12367
|
+
* `schemaSha` on `/stat`, which is how it learns that a new schema has been
|
|
12368
|
+
* deployed under it. One implementation, so that comparison is between two
|
|
12369
|
+
* runs of the same code.
|
|
12370
|
+
*/
|
|
12371
|
+
function computeSchemaSha(entries) {
|
|
12372
|
+
var schemaSha = "";
|
|
12373
|
+
var _iterator2 = _createForOfIteratorHelper(entries),
|
|
12374
|
+
_step2;
|
|
12375
|
+
try {
|
|
12376
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
12377
|
+
var _step2$value = _step2.value,
|
|
12378
|
+
path = _step2$value.path,
|
|
12379
|
+
serializedSchema = _step2$value.serializedSchema;
|
|
12380
|
+
// The PATH is part of the schema set, not just the schema: renaming a
|
|
12381
|
+
// module while leaving its schema byte-identical still changes which paths
|
|
12382
|
+
// exist, and an open client keyed its schema cache by the old path. Hashing
|
|
12383
|
+
// the schema alone left this SHA unchanged, so with no commitSha to fall
|
|
12384
|
+
// back on the client never refetched /schema.
|
|
12385
|
+
schemaSha = hash(schemaSha + JSON.stringify({
|
|
12386
|
+
path: path,
|
|
12387
|
+
schema: serializedSchema
|
|
12388
|
+
}));
|
|
12389
|
+
}
|
|
12390
|
+
} catch (err) {
|
|
12391
|
+
_iterator2.e(err);
|
|
12392
|
+
} finally {
|
|
12393
|
+
_iterator2.f();
|
|
12394
|
+
}
|
|
12395
|
+
return schemaSha;
|
|
12396
|
+
}
|
|
12360
12397
|
function computeValModuleShas(config, entries, moduleErrors) {
|
|
12361
12398
|
var configSha = hash(JSON.stringify(config));
|
|
12362
12399
|
var sourcesSha = computeSourcesSha(entries);
|
|
@@ -12369,12 +12406,12 @@ function computeValModuleShas(config, entries, moduleErrors) {
|
|
|
12369
12406
|
// `gitCommit: process.env.VERCEL_GIT_COMMIT_SHA` / `gitBranch`, which are
|
|
12370
12407
|
// server-only env vars and therefore `undefined` in the browser. Seeding with
|
|
12371
12408
|
// them made the two sides disagree on every production load.
|
|
12372
|
-
var schemaSha =
|
|
12373
|
-
var
|
|
12374
|
-
|
|
12409
|
+
var schemaSha = computeSchemaSha(entries);
|
|
12410
|
+
var _iterator3 = _createForOfIteratorHelper(entries),
|
|
12411
|
+
_step3;
|
|
12375
12412
|
try {
|
|
12376
|
-
for (
|
|
12377
|
-
var entry =
|
|
12413
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
12414
|
+
var entry = _step3.value;
|
|
12378
12415
|
var path = entry.path,
|
|
12379
12416
|
source = entry.source,
|
|
12380
12417
|
serializedSchema = entry.serializedSchema;
|
|
@@ -12384,20 +12421,11 @@ function computeValModuleShas(config, entries, moduleErrors) {
|
|
|
12384
12421
|
source: source,
|
|
12385
12422
|
modulesErrors: moduleErrors.slice(0, entry.moduleErrorsAt)
|
|
12386
12423
|
}));
|
|
12387
|
-
// The PATH is part of the schema set, not just the schema: renaming a
|
|
12388
|
-
// module while leaving its schema byte-identical still changes which paths
|
|
12389
|
-
// exist, and an open client keyed its schema cache by the old path. Hashing
|
|
12390
|
-
// the schema alone left this SHA unchanged, so with no commitSha to fall
|
|
12391
|
-
// back on the client never refetched /schema.
|
|
12392
|
-
schemaSha = hash(schemaSha + JSON.stringify({
|
|
12393
|
-
path: path,
|
|
12394
|
-
schema: serializedSchema
|
|
12395
|
-
}));
|
|
12396
12424
|
}
|
|
12397
12425
|
} catch (err) {
|
|
12398
|
-
|
|
12426
|
+
_iterator3.e(err);
|
|
12399
12427
|
} finally {
|
|
12400
|
-
|
|
12428
|
+
_iterator3.f();
|
|
12401
12429
|
}
|
|
12402
12430
|
return {
|
|
12403
12431
|
baseSha: baseSha,
|
|
@@ -12419,7 +12447,7 @@ function extractValModules(_x) {
|
|
|
12419
12447
|
}
|
|
12420
12448
|
function _extractValModules() {
|
|
12421
12449
|
_extractValModules = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(valModules) {
|
|
12422
|
-
var moduleErrors, addModuleError, sources, schemas, serializedSchemas, shaEntries, moduleIdx, module, at, value, path, schema, source, serializedSchema, pathM,
|
|
12450
|
+
var moduleErrors, addModuleError, sources, schemas, serializedSchemas, shaEntries, moduleIdx, module, at, value, path, schema, source, serializedSchema, pathM, _iterator4, _step4, error, _iterator5, _step5, _error, _t, _t2;
|
|
12423
12451
|
return _regenerator().w(function (_context) {
|
|
12424
12452
|
while (1) switch (_context.p = _context.n) {
|
|
12425
12453
|
case 0:
|
|
@@ -12566,10 +12594,10 @@ function _extractValModules() {
|
|
|
12566
12594
|
// Appended AFTER the loop on purpose: each entry's `moduleErrorsAt` is the
|
|
12567
12595
|
// error count at the time it was folded in, so the SHAs stay a function of
|
|
12568
12596
|
// the modules themselves.
|
|
12569
|
-
|
|
12597
|
+
_iterator4 = _createForOfIteratorHelper(resolveSettingsModule(serializedSchemas).errors);
|
|
12570
12598
|
try {
|
|
12571
|
-
for (
|
|
12572
|
-
error =
|
|
12599
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
12600
|
+
error = _step4.value;
|
|
12573
12601
|
moduleErrors.push(error);
|
|
12574
12602
|
}
|
|
12575
12603
|
// Same kind of rule, same reason it is here: a view cycle is a property of the
|
|
@@ -12577,20 +12605,20 @@ function _extractValModules() {
|
|
|
12577
12605
|
// catches it either — a view stores a pointer, not content, so there is no
|
|
12578
12606
|
// data cycle for a source walk to trip over.
|
|
12579
12607
|
} catch (err) {
|
|
12580
|
-
|
|
12608
|
+
_iterator4.e(err);
|
|
12581
12609
|
} finally {
|
|
12582
|
-
|
|
12610
|
+
_iterator4.f();
|
|
12583
12611
|
}
|
|
12584
|
-
|
|
12612
|
+
_iterator5 = _createForOfIteratorHelper(viewCycleErrors(serializedSchemas));
|
|
12585
12613
|
try {
|
|
12586
|
-
for (
|
|
12587
|
-
_error =
|
|
12614
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
12615
|
+
_error = _step5.value;
|
|
12588
12616
|
moduleErrors.push(_error);
|
|
12589
12617
|
}
|
|
12590
12618
|
} catch (err) {
|
|
12591
|
-
|
|
12619
|
+
_iterator5.e(err);
|
|
12592
12620
|
} finally {
|
|
12593
|
-
|
|
12621
|
+
_iterator5.f();
|
|
12594
12622
|
}
|
|
12595
12623
|
return _context.a(2, _objectSpread2(_objectSpread2({
|
|
12596
12624
|
sources: sources,
|
|
@@ -14088,7 +14116,7 @@ function isPageRouter(routerId) {
|
|
|
14088
14116
|
|
|
14089
14117
|
var corePackageJson = {
|
|
14090
14118
|
name: "@valbuild/core",
|
|
14091
|
-
version: "0.139.
|
|
14119
|
+
version: "0.139.1",
|
|
14092
14120
|
"private": false,
|
|
14093
14121
|
description: "Val - supercharged hard-coded content",
|
|
14094
14122
|
repository: {
|
|
@@ -14295,4 +14323,4 @@ function tryJsonParse(str) {
|
|
|
14295
14323
|
}
|
|
14296
14324
|
}
|
|
14297
14325
|
|
|
14298
|
-
export {
|
|
14326
|
+
export { COLOR_FORMATS as $, ArraySchema as A, BooleanSchema as B, SETTINGS_MODULE_CONVENTION as C, DEFAULT_CONTENT_HOST as D, isRootModuleFilePath as E, FATAL_ERROR_TYPES as F, GenericSelector as G, resolveSettingsModule as H, Internal as I, localeTagError as J, localeOfValue as K, LocaleSchema as L, ModuleFilePathSep as M, NumberSchema as N, ObjectSchema as O, PatchError as P, declaredKeySetOf as Q, RecordSchema as R, Schema as S, THEME_LOGO_DIRECTORY as T, missingDeclaredKeys as U, VAL_EXTENSION as V, discriminatedUnionBranchOf as W, ColorSchema as X, CodeSchema as Y, CODE_LANGUAGES as Z, _typeof as _, _slicedToArray as a, DEFAULT_COLOR_FORMAT as a0, DateTimeSchema as a1, KeyOfSchema as a2, ValViewSchema as a3, isValViewSource as a4, RouteSchema as a5, RichTextSchema as a6, DiscriminatedUnionSchema as a7, EnumSchema as a8, LiteralSchema as a9, deserializeSchema as aa, previewScope as ab, isInlineRender as ac, parseNextJsRoutePattern as ad, parseTanStackRoutePattern as ae, tanStackSegmentsOfRoutePath as af, validateUrlAgainstPattern as ag, getSourcePathFromRoute as ah, isPageRouter as ai, describeSchemeRejection as aj, isCheckableScheme as ak, rejectScheme as al, schemeOf as am, UNSAFE_URL_SCHEMES as an, _createClass as b, _classCallCheck as c, _toConsumableArray as d, DEFAULT_APP_HOST as e, DEFAULT_STATIC_HOST as f, extractValModules as g, computeValModuleShas as h, initVal as i, computeSourcesSha as j, computeSchemaSha as k, hasRemoteFileSchema as l, modules as m, hasMediaSchema as n, DEFAULT_VAL_REMOTE_HOST as o, derefPatch as p, StringSchema as q, ImageSchema as r, splitModuleFilePathAndModulePath as s, FileSchema as t, DateSchema as u, SettingsSchema as v, ASSISTANT_SETTINGS_MAX_LENGTH as w, THEME_RADIUS_STEPS as x, THEME_RADIUS_LENGTHS as y, assistantAvailability as z };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var dist_valbuildCore = require('./index-
|
|
5
|
+
var dist_valbuildCore = require('./index-90000f7a.cjs.dev.js');
|
|
6
6
|
require('./result-bb1f436e.cjs.dev.js');
|
|
7
7
|
|
|
8
8
|
|
|
@@ -48,6 +48,7 @@ exports.UNSAFE_URL_SCHEMES = dist_valbuildCore.UNSAFE_URL_SCHEMES;
|
|
|
48
48
|
exports.VAL_EXTENSION = dist_valbuildCore.VAL_EXTENSION;
|
|
49
49
|
exports.ValViewSchema = dist_valbuildCore.ValViewSchema;
|
|
50
50
|
exports.assistantAvailability = dist_valbuildCore.assistantAvailability;
|
|
51
|
+
exports.computeSchemaSha = dist_valbuildCore.computeSchemaSha;
|
|
51
52
|
exports.computeSourcesSha = dist_valbuildCore.computeSourcesSha;
|
|
52
53
|
exports.computeValModuleShas = dist_valbuildCore.computeValModuleShas;
|
|
53
54
|
exports.declaredKeySetOf = dist_valbuildCore.declaredKeySetOf;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var dist_valbuildCore = require('./index-
|
|
5
|
+
var dist_valbuildCore = require('./index-7d334094.cjs.prod.js');
|
|
6
6
|
require('./result-787e35f6.cjs.prod.js');
|
|
7
7
|
|
|
8
8
|
|
|
@@ -48,6 +48,7 @@ exports.UNSAFE_URL_SCHEMES = dist_valbuildCore.UNSAFE_URL_SCHEMES;
|
|
|
48
48
|
exports.VAL_EXTENSION = dist_valbuildCore.VAL_EXTENSION;
|
|
49
49
|
exports.ValViewSchema = dist_valbuildCore.ValViewSchema;
|
|
50
50
|
exports.assistantAvailability = dist_valbuildCore.assistantAvailability;
|
|
51
|
+
exports.computeSchemaSha = dist_valbuildCore.computeSchemaSha;
|
|
51
52
|
exports.computeSourcesSha = dist_valbuildCore.computeSourcesSha;
|
|
52
53
|
exports.computeValModuleShas = dist_valbuildCore.computeValModuleShas;
|
|
53
54
|
exports.declaredKeySetOf = dist_valbuildCore.declaredKeySetOf;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { w as ASSISTANT_SETTINGS_MAX_LENGTH, A as ArraySchema, B as BooleanSchema, Z as CODE_LANGUAGES, $ as COLOR_FORMATS, Y as CodeSchema, X as ColorSchema, e as DEFAULT_APP_HOST, a0 as DEFAULT_COLOR_FORMAT, D as DEFAULT_CONTENT_HOST, f as DEFAULT_STATIC_HOST, o as DEFAULT_VAL_REMOTE_HOST, u as DateSchema, a1 as DateTimeSchema, a7 as DiscriminatedUnionSchema, a8 as EnumSchema, F as FATAL_ERROR_TYPES, t as FileSchema, G as GenericSelector, r as ImageSchema, I as Internal, a2 as KeyOfSchema, a9 as LiteralSchema, L as LocaleSchema, M as ModuleFilePathSep, N as NumberSchema, O as ObjectSchema, R as RecordSchema, a6 as RichTextSchema, a5 as RouteSchema, C as SETTINGS_MODULE_CONVENTION, S as Schema, v as SettingsSchema, q as StringSchema, T as THEME_LOGO_DIRECTORY, y as THEME_RADIUS_LENGTHS, x as THEME_RADIUS_STEPS, an as UNSAFE_URL_SCHEMES, V as VAL_EXTENSION, a3 as ValViewSchema, z as assistantAvailability, k as computeSchemaSha, j as computeSourcesSha, h as computeValModuleShas, Q as declaredKeySetOf, p as derefPatch, aj as describeSchemeRejection, aa as deserializeSchema, W as discriminatedUnionBranchOf, g as extractValModules, ah as getSourcePathFromRoute, n as hasMediaSchema, l as hasRemoteFileSchema, i as initVal, ak as isCheckableScheme, ac as isInlineRender, ai as isPageRouter, E as isRootModuleFilePath, a4 as isValViewSource, K as localeOfValue, J as localeTagError, U as missingDeclaredKeys, m as modules, ad as parseNextJsRoutePattern, ae as parseTanStackRoutePattern, ab as previewScope, al as rejectScheme, H as resolveSettingsModule, am as schemeOf, af as tanStackSegmentsOfRoutePath, ag as validateUrlAgainstPattern } from './index-eb9f6480.esm.js';
|
|
2
2
|
import './result-daff1cae.esm.js';
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var dist_valbuildCore = require('../../dist/index-
|
|
5
|
+
var dist_valbuildCore = require('../../dist/index-90000f7a.cjs.dev.js');
|
|
6
6
|
var result = require('../../dist/result-bb1f436e.cjs.dev.js');
|
|
7
7
|
var util = require('../../dist/util-b213092b.cjs.dev.js');
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var dist_valbuildCore = require('../../dist/index-
|
|
5
|
+
var dist_valbuildCore = require('../../dist/index-7d334094.cjs.prod.js');
|
|
6
6
|
var result = require('../../dist/result-787e35f6.cjs.prod.js');
|
|
7
7
|
var util = require('../../dist/util-030d8a1f.cjs.prod.js');
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as _typeof, a as _slicedToArray, P as PatchError, s as splitModuleFilePathAndModulePath, b as _createClass, c as _classCallCheck, d as _toConsumableArray } from '../../dist/index-
|
|
2
|
-
export { P as PatchError } from '../../dist/index-
|
|
1
|
+
import { _ as _typeof, a as _slicedToArray, P as PatchError, s as splitModuleFilePathAndModulePath, b as _createClass, c as _classCallCheck, d as _toConsumableArray } from '../../dist/index-eb9f6480.esm.js';
|
|
2
|
+
export { P as PatchError } from '../../dist/index-eb9f6480.esm.js';
|
|
3
3
|
import { f as isNonEmpty, e as err, o as ok, m as map, g as flatMap, i as isErr, h as flatMapReduce, j as filterOrElse, k as mapErr, l as map$1, n as all, p as flatten, q as allT } from '../../dist/result-daff1cae.esm.js';
|
|
4
4
|
import { p as pipe } from '../../dist/util-18613e99.esm.js';
|
|
5
5
|
|