@valbuild/core 0.97.7 → 0.99.0

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,2 +1,2 @@
1
- export declare const ValidationFix: readonly ["image:add-metadata", "image:check-metadata", "image:upload-remote", "image:download-remote", "image:check-remote", "images:check-remote", "file:add-metadata", "file:check-metadata", "file:upload-remote", "file:download-remote", "file:check-remote", "files:check-remote", "keyof:check-keys", "router:check-route", "images:check-unique-folder", "files:check-unique-folder", "images:check-all-files", "files:check-all-files"];
1
+ export declare const ValidationFix: readonly ["image:add-metadata", "image:check-metadata", "image:upload-remote", "image:download-remote", "image:check-remote", "images:check-remote", "images:upload-remote", "file:add-metadata", "file:check-metadata", "file:upload-remote", "file:download-remote", "file:check-remote", "files:check-remote", "files:upload-remote", "keyof:check-keys", "router:check-route", "images:check-unique-folder", "files:check-unique-folder", "images:check-all-files", "files:check-all-files"];
2
2
  export type ValidationFix = (typeof ValidationFix)[number];
@@ -3154,6 +3154,13 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
3154
3154
  value: key
3155
3155
  }]);
3156
3156
  }
3157
+ // Local path in a remote gallery: needs to be uploaded to remote.
3158
+ var uploadRemoteFix = type === "images" ? "images:upload-remote" : "files:upload-remote";
3159
+ return _defineProperty({}, path, [{
3160
+ message: "Expected a remote ".concat(type === "images" ? "image" : "file", ", but got a local path. Use Val tooling (CLI --fix, VS Code extension, or Val Studio) to upload it. Got: ").concat(key),
3161
+ value: key,
3162
+ fixes: [uploadRemoteFix]
3163
+ }]);
3157
3164
  } else {
3158
3165
  // When remote is disabled, only accept local paths
3159
3166
  if (isRemoteUrl) {
@@ -3447,10 +3454,10 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
3447
3454
  data: {
3448
3455
  layout: "list",
3449
3456
  parent: "record",
3450
- items: Object.entries(src).map(function (_ref13) {
3451
- var _ref14 = _slicedToArray(_ref13, 2),
3452
- key = _ref14[0],
3453
- val = _ref14[1];
3457
+ items: Object.entries(src).map(function (_ref14) {
3458
+ var _ref15 = _slicedToArray(_ref14, 2),
3459
+ key = _ref15[0],
3460
+ val = _ref15[1];
3454
3461
  // NB NB: display is actually defined by the user
3455
3462
  var _prepare = prepare({
3456
3463
  key: key,
@@ -5642,10 +5649,11 @@ var getSHA256Hash = function getSHA256Hash(bits) {
5642
5649
  return createHash().update(bits).digest("hex");
5643
5650
  };
5644
5651
 
5645
- // Lazily constructed: this module is also evaluated inside the QuickJS
5646
- // sandbox (when user val modules import @valbuild/core), and that sandbox
5647
- // has no `TextEncoder` global. `hash()` is never called from inside the
5648
- // sandbox, so deferring construction avoids a ReferenceError at import time.
5652
+ // Lazily constructed: this module is also evaluated inside the `vm` sandbox
5653
+ // used by loadValModules (when user val modules import @valbuild/core), and
5654
+ // that sandbox has no `TextEncoder` global. `hash()` is never called from
5655
+ // inside the sandbox, so deferring construction avoids a ReferenceError at
5656
+ // import time.
5649
5657
  var textEncoder;
5650
5658
  function getTextEncoder() {
5651
5659
  if (!textEncoder) {
@@ -3154,6 +3154,13 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
3154
3154
  value: key
3155
3155
  }]);
3156
3156
  }
3157
+ // Local path in a remote gallery: needs to be uploaded to remote.
3158
+ var uploadRemoteFix = type === "images" ? "images:upload-remote" : "files:upload-remote";
3159
+ return _defineProperty({}, path, [{
3160
+ message: "Expected a remote ".concat(type === "images" ? "image" : "file", ", but got a local path. Use Val tooling (CLI --fix, VS Code extension, or Val Studio) to upload it. Got: ").concat(key),
3161
+ value: key,
3162
+ fixes: [uploadRemoteFix]
3163
+ }]);
3157
3164
  } else {
3158
3165
  // When remote is disabled, only accept local paths
3159
3166
  if (isRemoteUrl) {
@@ -3447,10 +3454,10 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
3447
3454
  data: {
3448
3455
  layout: "list",
3449
3456
  parent: "record",
3450
- items: Object.entries(src).map(function (_ref13) {
3451
- var _ref14 = _slicedToArray(_ref13, 2),
3452
- key = _ref14[0],
3453
- val = _ref14[1];
3457
+ items: Object.entries(src).map(function (_ref14) {
3458
+ var _ref15 = _slicedToArray(_ref14, 2),
3459
+ key = _ref15[0],
3460
+ val = _ref15[1];
3454
3461
  // NB NB: display is actually defined by the user
3455
3462
  var _prepare = prepare({
3456
3463
  key: key,
@@ -5642,10 +5649,11 @@ var getSHA256Hash = function getSHA256Hash(bits) {
5642
5649
  return createHash().update(bits).digest("hex");
5643
5650
  };
5644
5651
 
5645
- // Lazily constructed: this module is also evaluated inside the QuickJS
5646
- // sandbox (when user val modules import @valbuild/core), and that sandbox
5647
- // has no `TextEncoder` global. `hash()` is never called from inside the
5648
- // sandbox, so deferring construction avoids a ReferenceError at import time.
5652
+ // Lazily constructed: this module is also evaluated inside the `vm` sandbox
5653
+ // used by loadValModules (when user val modules import @valbuild/core), and
5654
+ // that sandbox has no `TextEncoder` global. `hash()` is never called from
5655
+ // inside the sandbox, so deferring construction avoids a ReferenceError at
5656
+ // import time.
5649
5657
  var textEncoder;
5650
5658
  function getTextEncoder() {
5651
5659
  if (!textEncoder) {
@@ -3152,6 +3152,13 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
3152
3152
  value: key
3153
3153
  }]);
3154
3154
  }
3155
+ // Local path in a remote gallery: needs to be uploaded to remote.
3156
+ var uploadRemoteFix = type === "images" ? "images:upload-remote" : "files:upload-remote";
3157
+ return _defineProperty({}, path, [{
3158
+ message: "Expected a remote ".concat(type === "images" ? "image" : "file", ", but got a local path. Use Val tooling (CLI --fix, VS Code extension, or Val Studio) to upload it. Got: ").concat(key),
3159
+ value: key,
3160
+ fixes: [uploadRemoteFix]
3161
+ }]);
3155
3162
  } else {
3156
3163
  // When remote is disabled, only accept local paths
3157
3164
  if (isRemoteUrl) {
@@ -3445,10 +3452,10 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
3445
3452
  data: {
3446
3453
  layout: "list",
3447
3454
  parent: "record",
3448
- items: Object.entries(src).map(function (_ref13) {
3449
- var _ref14 = _slicedToArray(_ref13, 2),
3450
- key = _ref14[0],
3451
- val = _ref14[1];
3455
+ items: Object.entries(src).map(function (_ref14) {
3456
+ var _ref15 = _slicedToArray(_ref14, 2),
3457
+ key = _ref15[0],
3458
+ val = _ref15[1];
3452
3459
  // NB NB: display is actually defined by the user
3453
3460
  var _prepare = prepare({
3454
3461
  key: key,
@@ -5640,10 +5647,11 @@ var getSHA256Hash = function getSHA256Hash(bits) {
5640
5647
  return createHash().update(bits).digest("hex");
5641
5648
  };
5642
5649
 
5643
- // Lazily constructed: this module is also evaluated inside the QuickJS
5644
- // sandbox (when user val modules import @valbuild/core), and that sandbox
5645
- // has no `TextEncoder` global. `hash()` is never called from inside the
5646
- // sandbox, so deferring construction avoids a ReferenceError at import time.
5650
+ // Lazily constructed: this module is also evaluated inside the `vm` sandbox
5651
+ // used by loadValModules (when user val modules import @valbuild/core), and
5652
+ // that sandbox has no `TextEncoder` global. `hash()` is never called from
5653
+ // inside the sandbox, so deferring construction avoids a ReferenceError at
5654
+ // import time.
5647
5655
  var textEncoder;
5648
5656
  function getTextEncoder() {
5649
5657
  if (!textEncoder) {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var dist_valbuildCore = require('./index-24fcc47f.cjs.dev.js');
5
+ var dist_valbuildCore = require('./index-233a49d6.cjs.dev.js');
6
6
  require('./result-bb1f436e.cjs.dev.js');
7
7
 
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var dist_valbuildCore = require('./index-139e0a7d.cjs.prod.js');
5
+ var dist_valbuildCore = require('./index-11f47a61.cjs.prod.js');
6
6
  require('./result-787e35f6.cjs.prod.js');
7
7
 
8
8
 
@@ -1,2 +1,2 @@
1
- export { A as ArraySchema, B as BooleanSchema, e as DEFAULT_APP_HOST, D as DEFAULT_CONTENT_HOST, g as DEFAULT_VAL_REMOTE_HOST, p as DateSchema, q as DateTimeSchema, F as FATAL_ERROR_TYPES, h as FILE_REF_PROP, j as FILE_REF_SUBTYPE_TAG, o as FileSchema, G as GenericSelector, n as ImageSchema, I as Internal, K as KeyOfSchema, L as LiteralSchema, M as ModuleFilePathSep, N as NumberSchema, O as ObjectSchema, R as RecordSchema, t as RichTextSchema, r as RouteSchema, S as Schema, l as StringSchema, U as UnionSchema, V as VAL_EXTENSION, k as derefPatch, u as deserializeSchema, f as extractValModules, v as getSourcePathFromRoute, i as initVal, m as modules } from './index-802570f7.esm.js';
1
+ export { A as ArraySchema, B as BooleanSchema, e as DEFAULT_APP_HOST, D as DEFAULT_CONTENT_HOST, g as DEFAULT_VAL_REMOTE_HOST, p as DateSchema, q as DateTimeSchema, F as FATAL_ERROR_TYPES, h as FILE_REF_PROP, j as FILE_REF_SUBTYPE_TAG, o as FileSchema, G as GenericSelector, n as ImageSchema, I as Internal, K as KeyOfSchema, L as LiteralSchema, M as ModuleFilePathSep, N as NumberSchema, O as ObjectSchema, R as RecordSchema, t as RichTextSchema, r as RouteSchema, S as Schema, l as StringSchema, U as UnionSchema, V as VAL_EXTENSION, k as derefPatch, u as deserializeSchema, f as extractValModules, v as getSourcePathFromRoute, i as initVal, m as modules } from './index-d152e3e2.esm.js';
2
2
  import './result-4bd63123.esm.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valbuild/core",
3
- "version": "0.97.7",
3
+ "version": "0.99.0",
4
4
  "private": false,
5
5
  "description": "Val - supercharged hard-coded content",
6
6
  "repository": {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var dist_valbuildCore = require('../../dist/index-24fcc47f.cjs.dev.js');
5
+ var dist_valbuildCore = require('../../dist/index-233a49d6.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-139e0a7d.cjs.prod.js');
5
+ var dist_valbuildCore = require('../../dist/index-11f47a61.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-802570f7.esm.js';
2
- export { P as PatchError } from '../../dist/index-802570f7.esm.js';
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-d152e3e2.esm.js';
2
+ export { P as PatchError } from '../../dist/index-d152e3e2.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-4bd63123.esm.js';
4
4
  import { p as pipe } from '../../dist/util-18613e99.esm.js';
5
5