@valbuild/shared 0.148.6 → 0.149.7

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.
Files changed (70) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/client/dist/valbuild-shared-client.cjs.dev.js +2 -1
  3. package/client/dist/valbuild-shared-client.cjs.prod.js +2 -1
  4. package/client/dist/valbuild-shared-client.esm.js +2 -1
  5. package/dist/acquireTypes-50960f2c.esm.js +1801 -0
  6. package/dist/acquireTypes-de10005d.cjs.dev.js +1815 -0
  7. package/dist/acquireTypes-e9467a2a.cjs.prod.js +1815 -0
  8. package/dist/createForOfIteratorHelper-3db5d737.esm.js +121 -0
  9. package/dist/createForOfIteratorHelper-90e6a8b6.cjs.prod.js +129 -0
  10. package/dist/createForOfIteratorHelper-d86bb352.cjs.dev.js +129 -0
  11. package/dist/declarations/src/internal/ApiRoutes.d.ts +3 -3
  12. package/dist/declarations/src/internal/index.d.ts +1 -0
  13. package/dist/declarations/src/internal/selfCheck.d.ts +51 -0
  14. package/dist/declarations/src/publish/buildProposal.d.ts +106 -0
  15. package/dist/declarations/src/publish/builder.d.ts +22 -0
  16. package/dist/declarations/src/publish/callJson.d.ts +21 -0
  17. package/dist/declarations/src/publish/index.d.ts +23 -0
  18. package/dist/declarations/src/publish/jobClient.d.ts +96 -0
  19. package/dist/declarations/src/publish/loadedLayer.d.ts +50 -0
  20. package/dist/declarations/src/publish/proposalProject.d.ts +2 -0
  21. package/dist/declarations/src/publish/publishClient.d.ts +95 -0
  22. package/dist/declarations/src/publish/runStudioDeploy.d.ts +244 -0
  23. package/dist/declarations/src/publish/runStudioJob.d.ts +102 -0
  24. package/dist/declarations/src/publish/runStudioPublish.d.ts +80 -0
  25. package/dist/declarations/src/typecheck/acquireTypes.d.ts +109 -0
  26. package/dist/declarations/src/typecheck/adeptSources.d.ts +9 -0
  27. package/dist/declarations/src/typecheck/index.d.ts +20 -0
  28. package/dist/declarations/src/typecheck/linkedFileSystem.d.ts +53 -0
  29. package/dist/declarations/src/typecheck/lockedVersions.d.ts +14 -0
  30. package/dist/declarations/src/typecheck/pnpmLayout.d.ts +95 -0
  31. package/dist/declarations/src/typecheck/pnpmLockfile.d.ts +57 -0
  32. package/dist/declarations/src/typecheck/proposalTypecheck.d.ts +76 -0
  33. package/dist/declarations/src/typecheck/testing/index.d.ts +6 -0
  34. package/dist/declarations/src/typecheck/testing/nodeModulesSources.d.ts +5 -0
  35. package/dist/declarations/src/typecheck/typecheckProject.d.ts +89 -0
  36. package/dist/declarations/src/typecheck/typescriptCompiler.d.ts +52 -0
  37. package/dist/{getSitemapTree-40d76bf8.cjs.prod.js → getSitemapTree-0fa0569c.cjs.dev.js} +5 -131
  38. package/dist/{getSitemapTree-cd006a36.esm.js → getSitemapTree-5afbc3ac.esm.js} +2 -121
  39. package/dist/{getSitemapTree-a7f2cc6d.cjs.dev.js → getSitemapTree-667bcb3c.cjs.prod.js} +5 -131
  40. package/dist/proposalProject-28550146.cjs.prod.js +18 -0
  41. package/dist/proposalProject-a3d3ad76.esm.js +16 -0
  42. package/dist/proposalProject-cdc53711.cjs.dev.js +18 -0
  43. package/dist/protocol-1c13de0d.cjs.prod.js +433 -0
  44. package/dist/protocol-3b9ef786.esm.js +413 -0
  45. package/dist/protocol-d8a6efda.cjs.dev.js +433 -0
  46. package/dist/slicedToArray-62e428df.cjs.dev.js +309 -0
  47. package/dist/slicedToArray-6cd80315.esm.js +299 -0
  48. package/dist/slicedToArray-af50e684.cjs.prod.js +309 -0
  49. package/internal/dist/valbuild-shared-internal.cjs.dev.js +419 -888
  50. package/internal/dist/valbuild-shared-internal.cjs.prod.js +419 -888
  51. package/internal/dist/valbuild-shared-internal.esm.js +236 -707
  52. package/package.json +28 -5
  53. package/publish/dist/valbuild-shared-publish.cjs.d.ts +2 -0
  54. package/publish/dist/valbuild-shared-publish.cjs.dev.js +2466 -0
  55. package/publish/dist/valbuild-shared-publish.cjs.js +7 -0
  56. package/publish/dist/valbuild-shared-publish.cjs.prod.js +2466 -0
  57. package/publish/dist/valbuild-shared-publish.esm.js +2428 -0
  58. package/publish/package.json +4 -0
  59. package/typecheck/dist/valbuild-shared-typecheck.cjs.d.ts +2 -0
  60. package/typecheck/dist/valbuild-shared-typecheck.cjs.dev.js +1173 -0
  61. package/typecheck/dist/valbuild-shared-typecheck.cjs.js +7 -0
  62. package/typecheck/dist/valbuild-shared-typecheck.cjs.prod.js +1173 -0
  63. package/typecheck/dist/valbuild-shared-typecheck.esm.js +1152 -0
  64. package/typecheck/package.json +4 -0
  65. package/typecheck/testing/dist/valbuild-shared-typecheck-testing.cjs.d.ts +2 -0
  66. package/typecheck/testing/dist/valbuild-shared-typecheck-testing.cjs.dev.js +202 -0
  67. package/typecheck/testing/dist/valbuild-shared-typecheck-testing.cjs.js +7 -0
  68. package/typecheck/testing/dist/valbuild-shared-typecheck-testing.cjs.prod.js +202 -0
  69. package/typecheck/testing/dist/valbuild-shared-typecheck-testing.esm.js +177 -0
  70. package/typecheck/testing/package.json +4 -0
@@ -1,8 +1,11 @@
1
- import { _ as _createForOfIteratorHelper, q as _objectSpread2, r as _arrayLikeToArray, s as _unsupportedIterableToArray, t as _typeof, u as _defineProperty, v as _toPropertyKey } from '../../dist/getSitemapTree-cd006a36.esm.js';
2
- export { D as DEFAULT_CANVAS_SELECTION, e as DEFAULT_CANVAS_SELECTION_SOFT, b as VAL_AI_SESSION_STORAGE_KEY, d as VAL_CANVAS_MESSAGE, c as VAL_CANVAS_PARAM, V as VAL_CONFIG_SESSION_STORAGE_KEY, a as VAL_THEME_SESSION_STORAGE_KEY, h as formatRoutePattern, j as getNextAppRouterSourceFolder, n as getPageRouterSitemapTree, l as getPageRouterSourceFolder, o as getPatternFromModuleFilePath, k as getTanStackRouterSourceFolder, m as isTanStackRoutesFolder, g as isValCanvasFrame, i as isValCanvasPageMessage, f as isValCanvasStudioMessage, p as parseRoutePattern, w as withValCanvasParam } from '../../dist/getSitemapTree-cd006a36.esm.js';
1
+ import { a as _createForOfIteratorHelper, b as _objectSpread2, _ as _typeof, c as _defineProperty } from '../../dist/createForOfIteratorHelper-3db5d737.esm.js';
3
2
  import { Internal, CODE_LANGUAGES, resolveSettingsModule, missingDeclaredKeys, localeOfValue, discriminatedUnionBranchOf, routePatternOf, matchRoutePattern, DEFAULT_COLOR_FORMAT, declaredKeySetOf } from '@valbuild/core';
3
+ import { h as _toConsumableArray, b as _asyncToGenerator, d as _regenerator, g as _slicedToArray, a as _createClass, e as _classCallCheck } from '../../dist/slicedToArray-6cd80315.esm.js';
4
4
  import { z } from 'zod';
5
+ import { _ as _objectWithoutProperties } from '../../dist/protocol-3b9ef786.esm.js';
6
+ export { P as PublishProtocolError, b as parseArtifacts, p as parseBuildTarget, l as parseCancel, a as parseDeclare, m as parseDiscard, j as parseJob, n as parseNewestCiRun, h as parsePress, g as parseProblems, f as parseProjectSource, d as parsePromote, o as parsePublishToken, k as parseRenew, i as parseRequestStatus, e as parseStatus, q as parseUpdateTarget, c as parseVerify } from '../../dist/protocol-3b9ef786.esm.js';
5
7
  import { fromError } from 'zod-validation-error';
8
+ export { D as DEFAULT_CANVAS_SELECTION, e as DEFAULT_CANVAS_SELECTION_SOFT, b as VAL_AI_SESSION_STORAGE_KEY, d as VAL_CANVAS_MESSAGE, c as VAL_CANVAS_PARAM, V as VAL_CONFIG_SESSION_STORAGE_KEY, a as VAL_THEME_SESSION_STORAGE_KEY, h as formatRoutePattern, j as getNextAppRouterSourceFolder, n as getPageRouterSitemapTree, l as getPageRouterSourceFolder, o as getPatternFromModuleFilePath, k as getTanStackRouterSourceFolder, m as isTanStackRoutesFolder, g as isValCanvasFrame, i as isValCanvasPageMessage, f as isValCanvasStudioMessage, p as parseRoutePattern, w as withValCanvasParam } from '../../dist/getSitemapTree-5afbc3ac.esm.js';
6
9
  import FlexSearch from 'flexsearch';
7
10
  import { b as base64DataUrlToUint8Array } from '../../dist/utils-00f3e1df.esm.js';
8
11
 
@@ -382,22 +385,6 @@ var RemirrorJSON = z.object({
382
385
  content: z.array(z.union([RemirrorParagraph, RemirrorHeading, RemirrorBulletList, RemirrorOrderedList]))
383
386
  });
384
387
 
385
- function _arrayWithoutHoles(r) {
386
- if (Array.isArray(r)) return _arrayLikeToArray(r);
387
- }
388
-
389
- function _iterableToArray(r) {
390
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
391
- }
392
-
393
- function _nonIterableSpread() {
394
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
395
- }
396
-
397
- function _toConsumableArray(r) {
398
- return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
399
- }
400
-
401
388
  function richTextToRemirror(richtext) {
402
389
  return {
403
390
  type: "doc",
@@ -811,142 +798,6 @@ function memoizePerRequest(box, key, compute) {
811
798
  return promise;
812
799
  }
813
800
 
814
- function _regeneratorDefine(e, r, n, t) {
815
- var i = Object.defineProperty;
816
- try {
817
- i({}, "", {});
818
- } catch (e) {
819
- i = 0;
820
- }
821
- _regeneratorDefine = function (e, r, n, t) {
822
- function o(r, n) {
823
- _regeneratorDefine(e, r, function (e) {
824
- return this._invoke(r, n, e);
825
- });
826
- }
827
- r ? i ? i(e, r, {
828
- value: n,
829
- enumerable: !t,
830
- configurable: !t,
831
- writable: !t
832
- }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
833
- }, _regeneratorDefine(e, r, n, t);
834
- }
835
-
836
- function _regenerator() {
837
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
838
- var e,
839
- t,
840
- r = "function" == typeof Symbol ? Symbol : {},
841
- n = r.iterator || "@@iterator",
842
- o = r.toStringTag || "@@toStringTag";
843
- function i(r, n, o, i) {
844
- var c = n && n.prototype instanceof Generator ? n : Generator,
845
- u = Object.create(c.prototype);
846
- return _regeneratorDefine(u, "_invoke", function (r, n, o) {
847
- var i,
848
- c,
849
- u,
850
- f = 0,
851
- p = o || [],
852
- y = !1,
853
- G = {
854
- p: 0,
855
- n: 0,
856
- v: e,
857
- a: d,
858
- f: d.bind(e, 4),
859
- d: function (t, r) {
860
- return i = t, c = 0, u = e, G.n = r, a;
861
- }
862
- };
863
- function d(r, n) {
864
- for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
865
- var o,
866
- i = p[t],
867
- d = G.p,
868
- l = i[2];
869
- r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
870
- }
871
- if (o || r > 1) return a;
872
- throw y = !0, n;
873
- }
874
- return function (o, p, l) {
875
- if (f > 1) throw TypeError("Generator is already running");
876
- for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
877
- i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
878
- try {
879
- if (f = 2, i) {
880
- if (c || (o = "next"), t = i[o]) {
881
- if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
882
- if (!t.done) return t;
883
- u = t.value, c < 2 && (c = 0);
884
- } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
885
- i = e;
886
- } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
887
- } catch (t) {
888
- i = e, c = 1, u = t;
889
- } finally {
890
- f = 1;
891
- }
892
- }
893
- return {
894
- value: t,
895
- done: y
896
- };
897
- };
898
- }(r, o, i), !0), u;
899
- }
900
- var a = {};
901
- function Generator() {}
902
- function GeneratorFunction() {}
903
- function GeneratorFunctionPrototype() {}
904
- t = Object.getPrototypeOf;
905
- var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
906
- return this;
907
- }), t),
908
- u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
909
- function f(e) {
910
- return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
911
- }
912
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
913
- return this;
914
- }), _regeneratorDefine(u, "toString", function () {
915
- return "[object Generator]";
916
- }), (_regenerator = function () {
917
- return {
918
- w: i,
919
- m: f
920
- };
921
- })();
922
- }
923
-
924
- function asyncGeneratorStep(n, t, e, r, o, a, c) {
925
- try {
926
- var i = n[a](c),
927
- u = i.value;
928
- } catch (n) {
929
- return void e(n);
930
- }
931
- i.done ? t(u) : Promise.resolve(u).then(r, o);
932
- }
933
- function _asyncToGenerator(n) {
934
- return function () {
935
- var t = this,
936
- e = arguments;
937
- return new Promise(function (r, o) {
938
- var a = n.apply(t, e);
939
- function _next(n) {
940
- asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
941
- }
942
- function _throw(n) {
943
- asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
944
- }
945
- _next(void 0);
946
- });
947
- };
948
- }
949
-
950
801
  /**
951
802
  * JSON, recursively — the shape of a Source over the wire.
952
803
  *
@@ -1051,28 +902,6 @@ var SourcePath = z.string().transform(function (path) {
1051
902
  return path;
1052
903
  });
1053
904
 
1054
- function _objectWithoutPropertiesLoose(r, e) {
1055
- if (null == r) return {};
1056
- var t = {};
1057
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
1058
- if (-1 !== e.indexOf(n)) continue;
1059
- t[n] = r[n];
1060
- }
1061
- return t;
1062
- }
1063
-
1064
- function _objectWithoutProperties(e, t) {
1065
- if (null == e) return {};
1066
- var o,
1067
- r,
1068
- i = _objectWithoutPropertiesLoose(e, t);
1069
- if (Object.getOwnPropertySymbols) {
1070
- var n = Object.getOwnPropertySymbols(e);
1071
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
1072
- }
1073
- return i;
1074
- }
1075
-
1076
905
  var ModuleFilePath$1 = z.string().transform(function (path) {
1077
906
  return path;
1078
907
  });
@@ -4213,46 +4042,6 @@ function getValDemo() {
4213
4042
  return (_globalThis$__VAL_DEM = globalThis.__VAL_DEMO__) !== null && _globalThis$__VAL_DEM !== void 0 ? _globalThis$__VAL_DEM : null;
4214
4043
  }
4215
4044
 
4216
- function _arrayWithHoles(r) {
4217
- if (Array.isArray(r)) return r;
4218
- }
4219
-
4220
- function _iterableToArrayLimit(r, l) {
4221
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
4222
- if (null != t) {
4223
- var e,
4224
- n,
4225
- i,
4226
- u,
4227
- a = [],
4228
- f = !0,
4229
- o = !1;
4230
- try {
4231
- if (i = (t = t.call(r)).next, 0 === l) {
4232
- if (Object(t) !== t) return;
4233
- f = !1;
4234
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
4235
- } catch (r) {
4236
- o = !0, n = r;
4237
- } finally {
4238
- try {
4239
- if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
4240
- } finally {
4241
- if (o) throw n;
4242
- }
4243
- }
4244
- return a;
4245
- }
4246
- }
4247
-
4248
- function _nonIterableRest() {
4249
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4250
- }
4251
-
4252
- function _slicedToArray(r, e) {
4253
- return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
4254
- }
4255
-
4256
4045
  var urlOf = function urlOf() {
4257
4046
  var route = arguments.length <= 0 ? undefined : arguments[0];
4258
4047
  var query = arguments.length <= 1 ? undefined : arguments[1];
@@ -7909,496 +7698,6 @@ function resolvePairGround(ground, ramp) {
7909
7698
  return typeof ground === "number" ? ramp[ground] : ground;
7910
7699
  }
7911
7700
 
7912
- function _defineProperties(e, r) {
7913
- for (var t = 0; t < r.length; t++) {
7914
- var o = r[t];
7915
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
7916
- }
7917
- }
7918
- function _createClass(e, r, t) {
7919
- return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
7920
- writable: !1
7921
- }), e;
7922
- }
7923
-
7924
- function _classCallCheck(a, n) {
7925
- if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
7926
- }
7927
-
7928
- function _getPrototypeOf(t) {
7929
- return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
7930
- return t.__proto__ || Object.getPrototypeOf(t);
7931
- }, _getPrototypeOf(t);
7932
- }
7933
-
7934
- function _isNativeReflectConstruct() {
7935
- try {
7936
- var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
7937
- } catch (t) {}
7938
- return (_isNativeReflectConstruct = function () {
7939
- return !!t;
7940
- })();
7941
- }
7942
-
7943
- function _assertThisInitialized(e) {
7944
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
7945
- return e;
7946
- }
7947
-
7948
- function _possibleConstructorReturn(t, e) {
7949
- if (e && ("object" == typeof e || "function" == typeof e)) return e;
7950
- if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
7951
- return _assertThisInitialized(t);
7952
- }
7953
-
7954
- function _callSuper(t, o, e) {
7955
- return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
7956
- }
7957
-
7958
- function _setPrototypeOf(t, e) {
7959
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
7960
- return t.__proto__ = e, t;
7961
- }, _setPrototypeOf(t, e);
7962
- }
7963
-
7964
- function _inherits(t, e) {
7965
- if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
7966
- t.prototype = Object.create(e && e.prototype, {
7967
- constructor: {
7968
- value: t,
7969
- writable: !0,
7970
- configurable: !0
7971
- }
7972
- }), Object.defineProperty(t, "prototype", {
7973
- writable: !1
7974
- }), e && _setPrototypeOf(t, e);
7975
- }
7976
-
7977
- function _isNativeFunction(t) {
7978
- try {
7979
- return -1 !== Function.toString.call(t).indexOf("[native code]");
7980
- } catch (n) {
7981
- return "function" == typeof t;
7982
- }
7983
- }
7984
-
7985
- function _construct(t, e, r) {
7986
- if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
7987
- var o = [null];
7988
- o.push.apply(o, e);
7989
- var p = new (t.bind.apply(t, o))();
7990
- return r && _setPrototypeOf(p, r.prototype), p;
7991
- }
7992
-
7993
- function _wrapNativeSuper(t) {
7994
- var r = "function" == typeof Map ? new Map() : void 0;
7995
- return _wrapNativeSuper = function (t) {
7996
- if (null === t || !_isNativeFunction(t)) return t;
7997
- if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
7998
- if (void 0 !== r) {
7999
- if (r.has(t)) return r.get(t);
8000
- r.set(t, Wrapper);
8001
- }
8002
- function Wrapper() {
8003
- return _construct(t, arguments, _getPrototypeOf(this).constructor);
8004
- }
8005
- return Wrapper.prototype = Object.create(t.prototype, {
8006
- constructor: {
8007
- value: Wrapper,
8008
- enumerable: !1,
8009
- writable: !0,
8010
- configurable: !0
8011
- }
8012
- }), _setPrototypeOf(Wrapper, t);
8013
- }, _wrapNativeSuper(t);
8014
- }
8015
-
8016
- /**
8017
- * Reading what content answers.
8018
- *
8019
- * Every type here comes from `contentApi.ts`, which is a copy of the
8020
- * service's own `Api.ts` - so the shapes are not re-derived from what this end
8021
- * wishes it received, and a copy brought up to date fails to compile wherever
8022
- * this CLI has not caught up.
8023
- *
8024
- * The schemas are the runtime half, and they are needed as well as the types:
8025
- * what arrives is JSON over HTTP from a service that versions separately, so a
8026
- * type alone asserts a shape rather than checking one. Each schema is
8027
- * annotated with the copied type it must produce (`z.ZodType<DeclareResponse>`
8028
- * and so on), which is what ties the two halves together - a schema that drifts
8029
- * from the copy does not compile, and an answer that drifts from the schema
8030
- * does not parse. `ValOpsHttp` in `@valbuild/server` reads every other content
8031
- * route the same way.
8032
- *
8033
- * Nothing here is laxer than the copy. An optional field is optional because
8034
- * the service says so; making a required one optional here would hide exactly
8035
- * the drift this file exists to catch.
8036
- */
8037
-
8038
- /** An artifact, as it is declared: by key, by hash, by size. */
8039
-
8040
- /** Permission to write one artifact's bytes to object storage. */
8041
-
8042
- var publishState = z["enum"](["awaiting-artifacts", "ready", "verified", "live", "failed", "expired"]);
8043
- var publishProblem = z.object({
8044
- code: z.string(),
8045
- message: z.string(),
8046
- hint: z.string().optional(),
8047
- keys: z.array(z.string()).optional()
8048
- });
8049
- var uploadSlot = z.object({
8050
- key: z.string(),
8051
- url: z.string(),
8052
- method: z.literal("PUT"),
8053
- headers: z.record(z.string(), z.string()),
8054
- expiresAt: z.string()
8055
- });
8056
- var declareResponse = z.object({
8057
- publishId: z.string(),
8058
- state: publishState,
8059
- project: z.object({
8060
- publicProjectId: z.string(),
8061
- siteUrl: z.string().nullable()
8062
- }),
8063
- uploads: z.array(uploadSlot),
8064
- have: z.array(z.string())
8065
- });
8066
- var artifactsResponse = z.object({
8067
- state: publishState,
8068
- problems: z.array(publishProblem)
8069
- });
8070
- var verifyResponse = z.object({
8071
- state: publishState,
8072
- ok: z["boolean"](),
8073
- previewUrl: z.string().nullable(),
8074
- problems: z.array(publishProblem)
8075
- });
8076
- var promoteResponse = z.object({
8077
- state: publishState,
8078
- url: z.string().nullable(),
8079
- commit: z.string().nullable()
8080
- });
8081
- var statusResponse = z.object({
8082
- publishId: z.string(),
8083
- state: publishState,
8084
- buildHash: z.string(),
8085
- missing: z.array(z.string()),
8086
- problems: z.array(publishProblem)
8087
- });
8088
- var publishTokenResponse = z.object({
8089
- token: z.string(),
8090
- expiresAt: z.string().nullable(),
8091
- publicProjectId: z.string(),
8092
- productionUrl: z.string().nullable()
8093
- });
8094
-
8095
- /**
8096
- * Content answered, and the answer was not one this CLI can act on.
8097
- *
8098
- * Separate from a refusal, which is content saying no in a sentence meant for
8099
- * a person. This is two programs disagreeing - the copy in `contentApi.ts` and
8100
- * the service that has moved on from it - and the two want opposite things
8101
- * said about them.
8102
- */
8103
- var PublishProtocolError = /*#__PURE__*/function (_Error) {
8104
- function PublishProtocolError(message) {
8105
- var _this;
8106
- _classCallCheck(this, PublishProtocolError);
8107
- _this = _callSuper(this, PublishProtocolError, [message]);
8108
- _this.name = "PublishProtocolError";
8109
- return _this;
8110
- }
8111
- _inherits(PublishProtocolError, _Error);
8112
- return _createClass(PublishProtocolError);
8113
- }(/*#__PURE__*/_wrapNativeSuper(Error));
8114
- var parseDeclare = function parseDeclare(body) {
8115
- return parse(declareResponse, body, "POST /v1/publish");
8116
- };
8117
- var parseArtifacts = function parseArtifacts(body) {
8118
- return parse(artifactsResponse, body, "POST /v1/publish/{id}/artifacts");
8119
- };
8120
- var parseVerify = function parseVerify(body) {
8121
- return parse(verifyResponse, body, "POST /v1/publish/{id}/verify");
8122
- };
8123
- var parsePromote = function parsePromote(body) {
8124
- return parse(promoteResponse, body, "POST /v1/publish/{id}/promote");
8125
- };
8126
- var parseStatus = function parseStatus(body) {
8127
- return parse(statusResponse, body, "GET /v1/publish/{id}");
8128
- };
8129
- var parsePublishToken = function parsePublishToken(body, call) {
8130
- return parse(publishTokenResponse, body, call);
8131
- };
8132
-
8133
- /**
8134
- * What a build targets, and the project's files, as the Studio asks for them.
8135
- *
8136
- * Both are read through `/publish-api` rather than fetched from the loader,
8137
- * because a browser has neither the loader's address nor a credential it would
8138
- * accept. `fetchBuildTarget` in `@valbuild/tanstack-build` is the other half --
8139
- * same shape, a different caller, and it CASTS where this parses.
8140
- *
8141
- * Parsed rather than cast here because of what sits in between: a proxy, a
8142
- * gateway and a service boundary. An HTML error page cast to `BuildTarget`
8143
- * fails several layers down inside rolldown with a message about a module
8144
- * specifier, and the publish that follows would label a build against a layer
8145
- * that was never there.
8146
- *
8147
- * The TYPE is inferred from this schema instead of imported. `BuildTarget` is
8148
- * declared in `@valbuild/tanstack-build`, which has no zod and deliberately
8149
- * almost no dependencies -- it goes into a browser bundle -- and this package
8150
- * is imported by everything. The declarations are kept honest at the one place
8151
- * the value is used: it is passed straight into `buildUserApp({ target })`, so
8152
- * a drift between them is a compile error at that call rather than a runtime
8153
- * surprise.
8154
- */
8155
- var buildTargetResponse = z.object({
8156
- base: z.object({
8157
- rev: z.string(),
8158
- shellRev: z.string(),
8159
- rscShellRev: z.string(),
8160
- modules: z.record(z.string(), z.string()),
8161
- rscModules: z.record(z.string(), z.string()),
8162
- paths: z.object({
8163
- baseFromProject: z.string(),
8164
- projectVendorDir: z.string(),
8165
- rscVendorBase: z.string(),
8166
- rscRuntimeSpecifier: z.string(),
8167
- rscRuntimePath: z.string(),
8168
- flightServer: z.string(),
8169
- serverFnBase: z.string()
8170
- }),
8171
- /*
8172
- * What the base layer is built from and what its chunks export, which
8173
- * `val publish` checks a project's layer against (`BuildTarget.base` in
8174
- * @valbuild/tanstack-build). Declared, because `z.object` DROPS a key it
8175
- * does not name: left out, they never reached the build, and every
8176
- * publish skipped both checks while saying the platform had not sent them.
8177
- * Optional, for a platform that predates them.
8178
- */
8179
- pins: z.record(z.string(), z.string()).optional(),
8180
- exports: z.object({
8181
- worker: z.record(z.string(), z.array(z.string())),
8182
- browser: z.record(z.string(), z.array(z.string()))
8183
- }).optional()
8184
- }),
8185
- project: z.object({
8186
- rev: z.string().nullable(),
8187
- rsc: z["boolean"](),
8188
- modules: z.record(z.string(), z.string()),
8189
- css: z.record(z.string(), z.string()),
8190
- workerOnly: z.array(z.string())
8191
- }),
8192
- /**
8193
- * The project's branch: what a build is wired at, so its Val saves where
8194
- * publishes commit. Optional, for a content service that predates it.
8195
- */
8196
- branch: z.string().optional()
8197
- });
8198
- /**
8199
- * `null` files is a real answer: a project that has never published.
8200
- *
8201
- * Distinguished from an empty record, which would be a project that published
8202
- * nothing -- and which a build would take as "no entry point" rather than as
8203
- * "there is nothing here yet".
8204
- */
8205
- var projectSourceResponse = z.object({
8206
- files: z.record(z.string(), z.string()).nullable(),
8207
- /**
8208
- * The live build's `public/*` artifacts, by hash -- what a publisher with no
8209
- * checkout carries into its build so the site keeps its favicon and images.
8210
- *
8211
- * The loader stores public files PER BUILD, so a build that names none
8212
- * serves none. A publisher with a checkout has them on disk; the Studio has
8213
- * this. Re-declaring one costs nothing: content holds the bytes for the
8214
- * project already and asks for no upload.
8215
- *
8216
- * `null` when content cannot say -- the live build was not published through
8217
- * it -- and absent from a content service that predates it. A publisher
8218
- * must treat both as "unknown", never as "none": publishing on that guess
8219
- * deletes every public file the site has.
8220
- */
8221
- publicFiles: z.array(z.object({
8222
- key: z.string(),
8223
- sha256: z.string(),
8224
- bytes: z.number()["int"]().nonnegative()
8225
- })).nullable().optional(),
8226
- /**
8227
- * The URL paths the live build serves from `public/`, as the loader has
8228
- * them -- without the bytes' hashes.
8229
- *
8230
- * The fallback for when `publicFiles` is `null`: a build content has no
8231
- * record of, which is every project cloned from a template seed. A publisher
8232
- * running on the site's own origin can fetch these and build with them;
8233
- * after that publish content holds their hashes and `publicFiles` answers.
8234
- * `null` when the loader serves no build or does not say.
8235
- */
8236
- publicPaths: z.array(z.string()).nullable().optional()
8237
- });
8238
- /**
8239
- * Whether a managed project can be updated onto its template's current seed,
8240
- * and -- when it is asked with `POST`, the press -- what to build against.
8241
- *
8242
- * An update rebuilds the site as it is on newer dependencies. The loader
8243
- * decides whether there is one; content adds whether the project is managed at
8244
- * all, and the branch head the rebuild is wired at, because an update
8245
- * publishes no content of its own.
8246
- *
8247
- * `target` is a `/build-target` answer whose project half is the SEED's
8248
- * dependency layer, already copied into the project so a publish can name it.
8249
- * Only a `POST` carries it.
8250
- */
8251
- var dependencyChange = z.object({
8252
- name: z.string(),
8253
- section: z["enum"](["dependencies", "devDependencies"]),
8254
- /** `null` for a dependency the template added. */
8255
- from: z.string().nullable(),
8256
- /** `null` for a dependency the template dropped: it leaves `package.json`. */
8257
- to: z.string().nullable()
8258
- });
8259
- var updateTargetResponse = z.discriminatedUnion("status", [z.object({
8260
- status: z.literal("current"),
8261
- template: z.string(),
8262
- layerRev: z.string()
8263
- }), z.object({
8264
- status: z.literal("available"),
8265
- template: z.string(),
8266
- /** Empty when only the dependency layer moved, and no version did. */
8267
- changes: z.array(dependencyChange),
8268
- layerRev: z.object({
8269
- from: z.string().nullable(),
8270
- to: z.string()
8271
- }),
8272
- /** The project's `package.json`, rewritten to the seed's versions. */
8273
- packageJson: z.string(),
8274
- /** The branch head to build at; `null` for a project with no commits. */
8275
- commit: z.string().nullable(),
8276
- branch: z.string(),
8277
- target: buildTargetResponse.optional()
8278
- }), z.object({
8279
- status: z.literal("unavailable"),
8280
- reason: z.string(),
8281
- message: z.string()
8282
- })]);
8283
- var parseUpdateTarget = function parseUpdateTarget(body) {
8284
- return parse(updateTargetResponse, body, "/v1/update-target");
8285
- };
8286
- var parseBuildTarget = function parseBuildTarget(body) {
8287
- return parse(buildTargetResponse, body, "GET /v1/build-target");
8288
- };
8289
- var parseProjectSource = function parseProjectSource(body) {
8290
- return parse(projectSourceResponse, body, "GET /v1/project-source");
8291
- };
8292
-
8293
- // ------------------------------------------------------ publish jobs
8294
-
8295
- /*
8296
- * Publishing as a queued job (valbuild/home docs/app-mode.md, "Publishing is a
8297
- * queued job"): a press is a request, the tab builds and uploads the job it is
8298
- * given, and content runs verify and the seal. Each parser is typed against
8299
- * the copy in `contentApi.ts`, so a copy brought up to date fails to compile
8300
- * here until these follow it.
8301
- */
8302
-
8303
- var requestStatus = z.union([z.object({
8304
- kind: z.literal("queued")
8305
- }), z.object({
8306
- kind: z.literal("publishing")
8307
- }), z.object({
8308
- kind: z.literal("live"),
8309
- commit: z.string()
8310
- }), z.object({
8311
- kind: z.literal("failed"),
8312
- message: z.string(),
8313
- actions: z.array(z["enum"](["try-again", "discard", "re-run-build"])),
8314
- job: z.string(),
8315
- movedTo: z.object({
8316
- proposal: z.string(),
8317
- displayName: z.string(),
8318
- changes: z.number()
8319
- }).optional()
8320
- }), z.object({
8321
- kind: z.literal("cancelled")
8322
- }), z.object({
8323
- kind: z.literal("nothing-to-publish")
8324
- })]);
8325
- var tabJob = z.object({
8326
- id: z.string(),
8327
- step: z["enum"](["prepare", "build", "upload"]).nullable(),
8328
- base: z.string().nullable(),
8329
- patches: z.array(z.string()),
8330
- contentOnly: z.literal(true).optional()
8331
- });
8332
- var pressResponse = z.object({
8333
- request: requestStatus,
8334
- job: tabJob.nullable()
8335
- });
8336
- var requestStatusResponse = z.object({
8337
- request: requestStatus
8338
- });
8339
- // `/next`, `/prepare` and `/steps` all answer with the job as it now is.
8340
- var jobResponse = z.object({
8341
- job: tabJob.nullable()
8342
- });
8343
- var renewResponse = z.object({
8344
- renewed: z["boolean"]()
8345
- });
8346
- var cancelResponse = z.object({
8347
- cancelled: z["boolean"]()
8348
- });
8349
- var discardResponse = z.object({
8350
- stillHeld: z.array(z.string())
8351
- });
8352
- var parsePress = function parsePress(body, call) {
8353
- return parse(pressResponse, body, call);
8354
- };
8355
- var parseRequestStatus = function parseRequestStatus(body) {
8356
- return parse(requestStatusResponse, body, "GET /v1/publish-requests/{id}");
8357
- };
8358
- var parseJob = function parseJob(body, call) {
8359
- return parse(jobResponse, body, call);
8360
- };
8361
- var parseRenew = function parseRenew(body) {
8362
- return parse(renewResponse, body, "POST /v1/publish-jobs/{id}/renew");
8363
- };
8364
- var parseCancel = function parseCancel(body) {
8365
- return parse(cancelResponse, body, "POST /v1/publish-jobs/{id}/cancel");
8366
- };
8367
- var parseDiscard = function parseDiscard(body) {
8368
- return parse(discardResponse, body, "POST /v1/publish-jobs/{id}/discard");
8369
- };
8370
- var newestCiRunResponse = z.object({
8371
- run: z.object({
8372
- commit: z.string(),
8373
- status: z["enum"](["failed", "succeeded"]),
8374
- url: z.string().nullable()
8375
- }).nullable()
8376
- });
8377
- var parseNewestCiRun = function parseNewestCiRun(body) {
8378
- return parse(newestCiRunResponse, body, "GET /v1/ci-runs/newest");
8379
- };
8380
-
8381
- /**
8382
- * The `details` of a refusal, when it carries a list of problems.
8383
- *
8384
- * Every non-2xx is `{ statusCode, message, details? }`, and the publish routes
8385
- * put `PublishProblem[]` in `details` - a declaration is answered with EVERY
8386
- * problem rather than the first, because finding them one round trip at a time
8387
- * is how a publish takes six attempts. Anything else in there is somebody
8388
- * else's `details` and is left to the caller's own message.
8389
- */
8390
- function parseProblems(details) {
8391
- var parsed = z.array(publishProblem).safeParse(details);
8392
- return parsed.success ? parsed.data : [];
8393
- }
8394
- function parse(schema, body, call) {
8395
- var parsed = schema.safeParse(body);
8396
- if (!parsed.success) {
8397
- throw new PublishProtocolError("".concat(call, " answered with something this publisher cannot read: ").concat(fromError(parsed.error).toString()));
8398
- }
8399
- return parsed.data;
8400
- }
8401
-
8402
7701
  /**
8403
7702
  * This functions returns all the possible schema types of a given module path.
8404
7703
  */
@@ -9030,4 +8329,234 @@ function schemaErrorsOf(schema, moduleFilePath, source) {
9030
8329
  return errors;
9031
8330
  }
9032
8331
 
9033
- export { AA_LARGE, AA_TEXT, AnalyticsBeacon, Api, BRAND_CONTRAST_PAIRS, BinaryFileRef, CodeOptions, ColorOptions, DEFAULT_ERROR_MESSAGE, DateOptions, ENCODE_DEFAULTS, ENCODE_MIME_TYPE_OF, FileOptions, HistoricalCommit, HistoricalModule, HistoricalPatchSet, HistoryError, ImageEncodeOption, ImageOptions, JSONValue, JSON_ENTRIES_BATCH_MAX, ModuleComparison, NEVER_ENCODED, ParentRef$1 as ParentRef, Patch, PatchBlock, PatchId, PatchJSON, PatchSets, PlanRefusalError, PublishProtocolError, RAMP_STEPS, RemirrorBr, RemirrorBulletList, RemirrorHeading, RemirrorImage, RemirrorJSON, RemirrorLinkMark, RemirrorListItem, RemirrorOrderedList, RemirrorParagraph, RemirrorText, RemirrorTextMark, RestoreVerdict, RichTextOptions, SCHEMA_SOURCE_FIXES, STUDIO_FIXES, SerializedArraySchema, SerializedBooleanSchema, SerializedCodeSchema, SerializedColorSchema, SerializedDateSchema, SerializedDateTimeSchema, SerializedDiscriminatedUnionSchema, SerializedEnumSchema, SerializedFileSchema, SerializedImageSchema, SerializedKeyOfSchema, SerializedLiteralSchema, SerializedLocaleSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedRecordSchema, SerializedRichTextSchema, SerializedRouteSchema, SerializedSchema, SerializedSettingsSchema, SerializedStringSchema, SerializedValViewSchema, SerializedVideoSchema, SharedValConfig, VAL_ENABLE_COOKIE_NAME, VAL_GREEN_RAMP, VAL_SESSION_COOKIE, VAL_STATE_COOKIE, VAL_STUDIO_HEADER, ValCommit, ValDeployment, VideoOptions, VideoStreamOption, WASM_ENCODED_MIME_TYPES, accentRamp, buildDuplicatePatch, buildEmptyAtPathPatch, buildFileRefValue, buildImageGalleryPatch, buildRemoveImageGalleryEntryPatch, buildSearchIndex, chainHeadOf, checkCompatibility, chooseEncoded, concatModulePath, contrastRatio, createRegExpFromPattern, createSearchIndex, createValClient, declaredLocales, describeContainerAtPath, emptyOf, enumLocaleTag, explainIncompatible, fallbackMimeType, filterBlockingValidationErrors, filterRoutesByPatterns, findSimilar, fitWithin, flattenRichText, forEachRichTextImage, getErrorMessageFromUnknownJson, getFilenameFromRef, getInlineImgInfo, getKeyOfRecordAt, getRefParts, getRoutesOf, getRoutesWithModulePaths, getSourceAt, getValDemo, indexModule, isInsidePatchSetPath, isLocaleSchema, isMimeTypeAccepted, isRemoteSchema, isRepairedOnSave, isSchemaSourceFixError, isSkippedSource, isStudioFix, joinSharedChanges, keyOfRecordPath, levenshtein, localeAt, localeMeantBy, memoizePerRequest, newestCommitSha, parseArtifacts, parseBuildTarget, parseCancel, parseDeclare, parseDiscard, parseJob, parseNewestCiRun, parsePress, parseProblems, parseProjectSource, parsePromote, parsePublishToken, parseRenew, parseRequestStatus, parseStatus, parseUpdateTarget, parseVerify, partitionValidationErrors, performSearch, relativeLuminance, remirrorToRichTextSource, removeModule, resolveEncodeSettings, resolvePairGround, resolveSchemaSourceFixForError, resolveSchemaSourceFixes, resolveSerializedSchemaAtPath, richTextImageSchema, richTextToRemirror, safeParsePatch, schemaErrorsOf, schemaTypesOfPath, selectionClosure, shouldEncodeWithWasm, sideFiles, sideSource, sourcePathOfChild, themeCustomProperties, toolNames, traverseSchemaSource, urlOf, validateRoutePatterns, withExtension };
8332
+ /**
8333
+ * A Val checking a site with ITS OWN rules: the platform's upgrade page
8334
+ * (valbuild/home `docs/plans/upgrades-v2.md`, piece E) calls this on the
8335
+ * version an upgrade moves to, because only that version knows what it
8336
+ * requires of the site's content.
8337
+ *
8338
+ * The page is home's and runs no Val code of its own. It finds this as
8339
+ * `Internal.selfCheck` on the framework package in the site's own vendor
8340
+ * layer -- the copy that made the site's schemas, since `val.config.ts`
8341
+ * imports `initVal` from it -- and hands it the default export of the
8342
+ * site's `val.modules.ts`, bundled. A Val from before this has no
8343
+ * `selfCheck`, and the page says validation was not available.
8344
+ *
8345
+ * The answer is data the page shows and nothing else, so its shape is the
8346
+ * contract: {@link SELF_CHECK_VERSION} names it, and an answer the page
8347
+ * cannot read counts as a failed check there. Change the shape and the
8348
+ * version goes up.
8349
+ */
8350
+ var SELF_CHECK_VERSION = 1;
8351
+
8352
+ /** Content the site's schemas do not allow, or a module that would not load. */
8353
+
8354
+ function selfCheck(_x) {
8355
+ return _selfCheck.apply(this, arguments);
8356
+ }
8357
+ function _selfCheck() {
8358
+ _selfCheck = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(valModules) {
8359
+ var options,
8360
+ errors,
8361
+ found,
8362
+ schemas,
8363
+ sources,
8364
+ _iterator,
8365
+ _step,
8366
+ _step$value,
8367
+ index,
8368
+ entry,
8369
+ module,
8370
+ _path,
8371
+ schema,
8372
+ _moduleFilePath,
8373
+ source,
8374
+ _options$sourceOf,
8375
+ _options$sourceOf2,
8376
+ result,
8377
+ _i2,
8378
+ _Object$entries2,
8379
+ _found,
8380
+ _ref,
8381
+ _found$_ref,
8382
+ _Object$entries2$_i,
8383
+ _sourcePath,
8384
+ _list,
8385
+ _partitionValidationE,
8386
+ surfaced,
8387
+ skipped,
8388
+ _i,
8389
+ _Object$entries,
8390
+ _Object$entries$_i,
8391
+ sourcePath,
8392
+ list,
8393
+ _Internal$splitModule,
8394
+ _Internal$splitModule2,
8395
+ moduleFilePath,
8396
+ modulePath,
8397
+ path,
8398
+ _iterator2,
8399
+ _step2,
8400
+ error,
8401
+ _args = arguments,
8402
+ _t,
8403
+ _t2,
8404
+ _t3,
8405
+ _t4;
8406
+ return _regenerator().w(function (_context) {
8407
+ while (1) switch (_context.p = _context.n) {
8408
+ case 0:
8409
+ options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
8410
+ errors = [];
8411
+ found = {};
8412
+ schemas = {};
8413
+ sources = {};
8414
+ _iterator = _createForOfIteratorHelper(valModules.modules.entries());
8415
+ _context.p = 1;
8416
+ _iterator.s();
8417
+ case 2:
8418
+ if ((_step = _iterator.n()).done) {
8419
+ _context.n = 17;
8420
+ break;
8421
+ }
8422
+ _step$value = _slicedToArray(_step.value, 2), index = _step$value[0], entry = _step$value[1];
8423
+ module = void 0;
8424
+ _context.p = 3;
8425
+ _context.n = 4;
8426
+ return entry.def();
8427
+ case 4:
8428
+ module = _context.v["default"];
8429
+ _context.n = 6;
8430
+ break;
8431
+ case 5:
8432
+ _context.p = 5;
8433
+ _t = _context.v;
8434
+ errors.push({
8435
+ moduleFilePath: null,
8436
+ path: [],
8437
+ message: "Entry ".concat(index + 1, " of val.modules.ts could not be loaded: ").concat(messageOf(_t))
8438
+ });
8439
+ return _context.a(3, 16);
8440
+ case 6:
8441
+ if (Internal.isValModule(module)) {
8442
+ _context.n = 7;
8443
+ break;
8444
+ }
8445
+ errors.push({
8446
+ moduleFilePath: null,
8447
+ path: [],
8448
+ message: "Entry ".concat(index + 1, " of val.modules.ts does not export c.define(...) as its default.")
8449
+ });
8450
+ return _context.a(3, 16);
8451
+ case 7:
8452
+ _path = Internal.getValPath(module);
8453
+ schema = Internal.getSchema(module);
8454
+ if (!(_path === undefined || schema === undefined)) {
8455
+ _context.n = 8;
8456
+ break;
8457
+ }
8458
+ return _context.a(3, 16);
8459
+ case 8:
8460
+ _moduleFilePath = _path;
8461
+ source = void 0;
8462
+ _context.p = 9;
8463
+ if (!((_options$sourceOf = (_options$sourceOf2 = options.sourceOf) === null || _options$sourceOf2 === void 0 ? void 0 : _options$sourceOf2.call(options, _moduleFilePath)) !== null && _options$sourceOf !== void 0)) {
8464
+ _context.n = 10;
8465
+ break;
8466
+ }
8467
+ _t2 = _options$sourceOf;
8468
+ _context.n = 12;
8469
+ break;
8470
+ case 10:
8471
+ _context.n = 11;
8472
+ return Internal.resolveJsonValues(Internal.getSource(module));
8473
+ case 11:
8474
+ _t2 = _context.v;
8475
+ case 12:
8476
+ source = _t2;
8477
+ _context.n = 14;
8478
+ break;
8479
+ case 13:
8480
+ _context.p = 13;
8481
+ _t3 = _context.v;
8482
+ errors.push({
8483
+ moduleFilePath: _moduleFilePath,
8484
+ path: [],
8485
+ message: "Its content could not be read: ".concat(messageOf(_t3))
8486
+ });
8487
+ return _context.a(3, 16);
8488
+ case 14:
8489
+ schemas[_moduleFilePath] = schema["executeSerialize"]();
8490
+ sources[_moduleFilePath] = source;
8491
+ result = schema["executeValidate"](_path, source);
8492
+ if (!(result === false)) {
8493
+ _context.n = 15;
8494
+ break;
8495
+ }
8496
+ return _context.a(3, 16);
8497
+ case 15:
8498
+ for (_i2 = 0, _Object$entries2 = Object.entries(result); _i2 < _Object$entries2.length; _i2++) {
8499
+ _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2), _sourcePath = _Object$entries2$_i[0], _list = _Object$entries2$_i[1];
8500
+ (_found = (_found$_ref = found[_ref = _sourcePath]) !== null && _found$_ref !== void 0 ? _found$_ref : found[_ref] = []).push.apply(_found, _toConsumableArray(_list));
8501
+ }
8502
+ case 16:
8503
+ _context.n = 2;
8504
+ break;
8505
+ case 17:
8506
+ _context.n = 19;
8507
+ break;
8508
+ case 18:
8509
+ _context.p = 18;
8510
+ _t4 = _context.v;
8511
+ _iterator.e(_t4);
8512
+ case 19:
8513
+ _context.p = 19;
8514
+ _iterator.f();
8515
+ return _context.f(19);
8516
+ case 20:
8517
+ // The markers only the whole project can answer (a keyOf's keys, a route,
8518
+ // a gallery's entries) are answered here, as a publish answers them, and
8519
+ // what Val repairs on save is left out: the same gate the Studio applies.
8520
+ _partitionValidationE = partitionValidationErrors(resolveSchemaSourceFixes(found, {
8521
+ schemas: schemas,
8522
+ sources: sources
8523
+ })), surfaced = _partitionValidationE.surfaced, skipped = _partitionValidationE.skipped;
8524
+ for (_i = 0, _Object$entries = Object.entries(surfaced); _i < _Object$entries.length; _i++) {
8525
+ _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2), sourcePath = _Object$entries$_i[0], list = _Object$entries$_i[1];
8526
+ _Internal$splitModule = Internal.splitModuleFilePathAndModulePath(sourcePath), _Internal$splitModule2 = _slicedToArray(_Internal$splitModule, 2), moduleFilePath = _Internal$splitModule2[0], modulePath = _Internal$splitModule2[1];
8527
+ path = modulePath ? Internal.createPatchPath(modulePath) : [];
8528
+ _iterator2 = _createForOfIteratorHelper(list);
8529
+ try {
8530
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
8531
+ error = _step2.value;
8532
+ errors.push({
8533
+ moduleFilePath: moduleFilePath,
8534
+ path: path,
8535
+ message: error.message
8536
+ });
8537
+ }
8538
+ } catch (err) {
8539
+ _iterator2.e(err);
8540
+ } finally {
8541
+ _iterator2.f();
8542
+ }
8543
+ }
8544
+ return _context.a(2, {
8545
+ version: SELF_CHECK_VERSION,
8546
+ valVersion: Internal.VERSION.core,
8547
+ modules: valModules.modules.length,
8548
+ errors: errors,
8549
+ repairedOnSave: Object.values(skipped).reduce(function (count, list) {
8550
+ return count + list.length;
8551
+ }, 0)
8552
+ });
8553
+ }
8554
+ }, _callee, null, [[9, 13], [3, 5], [1, 18, 19, 20]]);
8555
+ }));
8556
+ return _selfCheck.apply(this, arguments);
8557
+ }
8558
+ var messageOf = function messageOf(error) {
8559
+ return error instanceof Error ? error.message : String(error);
8560
+ };
8561
+
8562
+ export { AA_LARGE, AA_TEXT, AnalyticsBeacon, Api, BRAND_CONTRAST_PAIRS, BinaryFileRef, CodeOptions, ColorOptions, DEFAULT_ERROR_MESSAGE, DateOptions, ENCODE_DEFAULTS, ENCODE_MIME_TYPE_OF, FileOptions, HistoricalCommit, HistoricalModule, HistoricalPatchSet, HistoryError, ImageEncodeOption, ImageOptions, JSONValue, JSON_ENTRIES_BATCH_MAX, ModuleComparison, NEVER_ENCODED, ParentRef$1 as ParentRef, Patch, PatchBlock, PatchId, PatchJSON, PatchSets, PlanRefusalError, RAMP_STEPS, RemirrorBr, RemirrorBulletList, RemirrorHeading, RemirrorImage, RemirrorJSON, RemirrorLinkMark, RemirrorListItem, RemirrorOrderedList, RemirrorParagraph, RemirrorText, RemirrorTextMark, RestoreVerdict, RichTextOptions, SCHEMA_SOURCE_FIXES, SELF_CHECK_VERSION, STUDIO_FIXES, SerializedArraySchema, SerializedBooleanSchema, SerializedCodeSchema, SerializedColorSchema, SerializedDateSchema, SerializedDateTimeSchema, SerializedDiscriminatedUnionSchema, SerializedEnumSchema, SerializedFileSchema, SerializedImageSchema, SerializedKeyOfSchema, SerializedLiteralSchema, SerializedLocaleSchema, SerializedNumberSchema, SerializedObjectSchema, SerializedRecordSchema, SerializedRichTextSchema, SerializedRouteSchema, SerializedSchema, SerializedSettingsSchema, SerializedStringSchema, SerializedValViewSchema, SerializedVideoSchema, SharedValConfig, VAL_ENABLE_COOKIE_NAME, VAL_GREEN_RAMP, VAL_SESSION_COOKIE, VAL_STATE_COOKIE, VAL_STUDIO_HEADER, ValCommit, ValDeployment, VideoOptions, VideoStreamOption, WASM_ENCODED_MIME_TYPES, accentRamp, buildDuplicatePatch, buildEmptyAtPathPatch, buildFileRefValue, buildImageGalleryPatch, buildRemoveImageGalleryEntryPatch, buildSearchIndex, chainHeadOf, checkCompatibility, chooseEncoded, concatModulePath, contrastRatio, createRegExpFromPattern, createSearchIndex, createValClient, declaredLocales, describeContainerAtPath, emptyOf, enumLocaleTag, explainIncompatible, fallbackMimeType, filterBlockingValidationErrors, filterRoutesByPatterns, findSimilar, fitWithin, flattenRichText, forEachRichTextImage, getErrorMessageFromUnknownJson, getFilenameFromRef, getInlineImgInfo, getKeyOfRecordAt, getRefParts, getRoutesOf, getRoutesWithModulePaths, getSourceAt, getValDemo, indexModule, isInsidePatchSetPath, isLocaleSchema, isMimeTypeAccepted, isRemoteSchema, isRepairedOnSave, isSchemaSourceFixError, isSkippedSource, isStudioFix, joinSharedChanges, keyOfRecordPath, levenshtein, localeAt, localeMeantBy, memoizePerRequest, newestCommitSha, partitionValidationErrors, performSearch, relativeLuminance, remirrorToRichTextSource, removeModule, resolveEncodeSettings, resolvePairGround, resolveSchemaSourceFixForError, resolveSchemaSourceFixes, resolveSerializedSchemaAtPath, richTextImageSchema, richTextToRemirror, safeParsePatch, schemaErrorsOf, schemaTypesOfPath, selectionClosure, selfCheck, shouldEncodeWithWasm, sideFiles, sideSource, sourcePathOfChild, themeCustomProperties, toolNames, traverseSchemaSource, urlOf, validateRoutePatterns, withExtension };