@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
@@ -0,0 +1,121 @@
1
+ function _typeof(o) {
2
+ "@babel/helpers - typeof";
3
+
4
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
5
+ return typeof o;
6
+ } : function (o) {
7
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
8
+ }, _typeof(o);
9
+ }
10
+
11
+ function _toPrimitive(t, r) {
12
+ if ("object" != typeof t || !t) return t;
13
+ var e = t[Symbol.toPrimitive];
14
+ if (void 0 !== e) {
15
+ var i = e.call(t, r || "default");
16
+ if ("object" != typeof i) return i;
17
+ throw new TypeError("@@toPrimitive must return a primitive value.");
18
+ }
19
+ return ("string" === r ? String : Number)(t);
20
+ }
21
+
22
+ function _toPropertyKey(t) {
23
+ var i = _toPrimitive(t, "string");
24
+ return "symbol" == typeof i ? i : i + "";
25
+ }
26
+
27
+ function _defineProperty(e, r, t) {
28
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
29
+ value: t,
30
+ enumerable: !0,
31
+ configurable: !0,
32
+ writable: !0
33
+ }) : e[r] = t, e;
34
+ }
35
+
36
+ function ownKeys(e, r) {
37
+ var t = Object.keys(e);
38
+ if (Object.getOwnPropertySymbols) {
39
+ var o = Object.getOwnPropertySymbols(e);
40
+ r && (o = o.filter(function (r) {
41
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
42
+ })), t.push.apply(t, o);
43
+ }
44
+ return t;
45
+ }
46
+ function _objectSpread2(e) {
47
+ for (var r = 1; r < arguments.length; r++) {
48
+ var t = null != arguments[r] ? arguments[r] : {};
49
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
50
+ _defineProperty(e, r, t[r]);
51
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
52
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
53
+ });
54
+ }
55
+ return e;
56
+ }
57
+
58
+ function _arrayLikeToArray(r, a) {
59
+ (null == a || a > r.length) && (a = r.length);
60
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
61
+ return n;
62
+ }
63
+
64
+ function _unsupportedIterableToArray(r, a) {
65
+ if (r) {
66
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
67
+ var t = {}.toString.call(r).slice(8, -1);
68
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
69
+ }
70
+ }
71
+
72
+ function _createForOfIteratorHelper(r, e) {
73
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
74
+ if (!t) {
75
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
76
+ t && (r = t);
77
+ var n = 0,
78
+ F = function () {};
79
+ return {
80
+ s: F,
81
+ n: function () {
82
+ return n >= r.length ? {
83
+ done: !0
84
+ } : {
85
+ done: !1,
86
+ value: r[n++]
87
+ };
88
+ },
89
+ e: function (r) {
90
+ throw r;
91
+ },
92
+ f: F
93
+ };
94
+ }
95
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
96
+ }
97
+ var o,
98
+ a = !0,
99
+ u = !1;
100
+ return {
101
+ s: function () {
102
+ t = t.call(r);
103
+ },
104
+ n: function () {
105
+ var r = t.next();
106
+ return a = r.done, r;
107
+ },
108
+ e: function (r) {
109
+ u = !0, o = r;
110
+ },
111
+ f: function () {
112
+ try {
113
+ a || null == t.return || t.return();
114
+ } finally {
115
+ if (u) throw o;
116
+ }
117
+ }
118
+ };
119
+ }
120
+
121
+ export { _typeof as _, _createForOfIteratorHelper as a, _objectSpread2 as b, _defineProperty as c, _toPropertyKey as d, _arrayLikeToArray as e, _unsupportedIterableToArray as f };
@@ -0,0 +1,129 @@
1
+ 'use strict';
2
+
3
+ function _typeof(o) {
4
+ "@babel/helpers - typeof";
5
+
6
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
7
+ return typeof o;
8
+ } : function (o) {
9
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
10
+ }, _typeof(o);
11
+ }
12
+
13
+ function _toPrimitive(t, r) {
14
+ if ("object" != typeof t || !t) return t;
15
+ var e = t[Symbol.toPrimitive];
16
+ if (void 0 !== e) {
17
+ var i = e.call(t, r || "default");
18
+ if ("object" != typeof i) return i;
19
+ throw new TypeError("@@toPrimitive must return a primitive value.");
20
+ }
21
+ return ("string" === r ? String : Number)(t);
22
+ }
23
+
24
+ function _toPropertyKey(t) {
25
+ var i = _toPrimitive(t, "string");
26
+ return "symbol" == typeof i ? i : i + "";
27
+ }
28
+
29
+ function _defineProperty(e, r, t) {
30
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
31
+ value: t,
32
+ enumerable: !0,
33
+ configurable: !0,
34
+ writable: !0
35
+ }) : e[r] = t, e;
36
+ }
37
+
38
+ function ownKeys(e, r) {
39
+ var t = Object.keys(e);
40
+ if (Object.getOwnPropertySymbols) {
41
+ var o = Object.getOwnPropertySymbols(e);
42
+ r && (o = o.filter(function (r) {
43
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
44
+ })), t.push.apply(t, o);
45
+ }
46
+ return t;
47
+ }
48
+ function _objectSpread2(e) {
49
+ for (var r = 1; r < arguments.length; r++) {
50
+ var t = null != arguments[r] ? arguments[r] : {};
51
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
52
+ _defineProperty(e, r, t[r]);
53
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
54
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
55
+ });
56
+ }
57
+ return e;
58
+ }
59
+
60
+ function _arrayLikeToArray(r, a) {
61
+ (null == a || a > r.length) && (a = r.length);
62
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
63
+ return n;
64
+ }
65
+
66
+ function _unsupportedIterableToArray(r, a) {
67
+ if (r) {
68
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
69
+ var t = {}.toString.call(r).slice(8, -1);
70
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
71
+ }
72
+ }
73
+
74
+ function _createForOfIteratorHelper(r, e) {
75
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
76
+ if (!t) {
77
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
78
+ t && (r = t);
79
+ var n = 0,
80
+ F = function () {};
81
+ return {
82
+ s: F,
83
+ n: function () {
84
+ return n >= r.length ? {
85
+ done: !0
86
+ } : {
87
+ done: !1,
88
+ value: r[n++]
89
+ };
90
+ },
91
+ e: function (r) {
92
+ throw r;
93
+ },
94
+ f: F
95
+ };
96
+ }
97
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
98
+ }
99
+ var o,
100
+ a = !0,
101
+ u = !1;
102
+ return {
103
+ s: function () {
104
+ t = t.call(r);
105
+ },
106
+ n: function () {
107
+ var r = t.next();
108
+ return a = r.done, r;
109
+ },
110
+ e: function (r) {
111
+ u = !0, o = r;
112
+ },
113
+ f: function () {
114
+ try {
115
+ a || null == t.return || t.return();
116
+ } finally {
117
+ if (u) throw o;
118
+ }
119
+ }
120
+ };
121
+ }
122
+
123
+ exports._arrayLikeToArray = _arrayLikeToArray;
124
+ exports._createForOfIteratorHelper = _createForOfIteratorHelper;
125
+ exports._defineProperty = _defineProperty;
126
+ exports._objectSpread2 = _objectSpread2;
127
+ exports._toPropertyKey = _toPropertyKey;
128
+ exports._typeof = _typeof;
129
+ exports._unsupportedIterableToArray = _unsupportedIterableToArray;
@@ -0,0 +1,129 @@
1
+ 'use strict';
2
+
3
+ function _typeof(o) {
4
+ "@babel/helpers - typeof";
5
+
6
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
7
+ return typeof o;
8
+ } : function (o) {
9
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
10
+ }, _typeof(o);
11
+ }
12
+
13
+ function _toPrimitive(t, r) {
14
+ if ("object" != typeof t || !t) return t;
15
+ var e = t[Symbol.toPrimitive];
16
+ if (void 0 !== e) {
17
+ var i = e.call(t, r || "default");
18
+ if ("object" != typeof i) return i;
19
+ throw new TypeError("@@toPrimitive must return a primitive value.");
20
+ }
21
+ return ("string" === r ? String : Number)(t);
22
+ }
23
+
24
+ function _toPropertyKey(t) {
25
+ var i = _toPrimitive(t, "string");
26
+ return "symbol" == typeof i ? i : i + "";
27
+ }
28
+
29
+ function _defineProperty(e, r, t) {
30
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
31
+ value: t,
32
+ enumerable: !0,
33
+ configurable: !0,
34
+ writable: !0
35
+ }) : e[r] = t, e;
36
+ }
37
+
38
+ function ownKeys(e, r) {
39
+ var t = Object.keys(e);
40
+ if (Object.getOwnPropertySymbols) {
41
+ var o = Object.getOwnPropertySymbols(e);
42
+ r && (o = o.filter(function (r) {
43
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
44
+ })), t.push.apply(t, o);
45
+ }
46
+ return t;
47
+ }
48
+ function _objectSpread2(e) {
49
+ for (var r = 1; r < arguments.length; r++) {
50
+ var t = null != arguments[r] ? arguments[r] : {};
51
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
52
+ _defineProperty(e, r, t[r]);
53
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
54
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
55
+ });
56
+ }
57
+ return e;
58
+ }
59
+
60
+ function _arrayLikeToArray(r, a) {
61
+ (null == a || a > r.length) && (a = r.length);
62
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
63
+ return n;
64
+ }
65
+
66
+ function _unsupportedIterableToArray(r, a) {
67
+ if (r) {
68
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
69
+ var t = {}.toString.call(r).slice(8, -1);
70
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
71
+ }
72
+ }
73
+
74
+ function _createForOfIteratorHelper(r, e) {
75
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
76
+ if (!t) {
77
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
78
+ t && (r = t);
79
+ var n = 0,
80
+ F = function () {};
81
+ return {
82
+ s: F,
83
+ n: function () {
84
+ return n >= r.length ? {
85
+ done: !0
86
+ } : {
87
+ done: !1,
88
+ value: r[n++]
89
+ };
90
+ },
91
+ e: function (r) {
92
+ throw r;
93
+ },
94
+ f: F
95
+ };
96
+ }
97
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
98
+ }
99
+ var o,
100
+ a = !0,
101
+ u = !1;
102
+ return {
103
+ s: function () {
104
+ t = t.call(r);
105
+ },
106
+ n: function () {
107
+ var r = t.next();
108
+ return a = r.done, r;
109
+ },
110
+ e: function (r) {
111
+ u = !0, o = r;
112
+ },
113
+ f: function () {
114
+ try {
115
+ a || null == t.return || t.return();
116
+ } finally {
117
+ if (u) throw o;
118
+ }
119
+ }
120
+ };
121
+ }
122
+
123
+ exports._arrayLikeToArray = _arrayLikeToArray;
124
+ exports._createForOfIteratorHelper = _createForOfIteratorHelper;
125
+ exports._defineProperty = _defineProperty;
126
+ exports._objectSpread2 = _objectSpread2;
127
+ exports._toPropertyKey = _toPropertyKey;
128
+ exports._typeof = _typeof;
129
+ exports._unsupportedIterableToArray = _unsupportedIterableToArray;
@@ -1846,7 +1846,7 @@ export declare const Api: {
1846
1846
  }, z.core.$strip>;
1847
1847
  }, z.core.$strip>, z.ZodObject<{
1848
1848
  status: z.ZodLiteral<200>;
1849
- body: z.ZodCustom<import("node:stream/web").ReadableStream<unknown>, import("node:stream/web").ReadableStream<unknown>>;
1849
+ body: z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>;
1850
1850
  }, z.core.$strip>]>;
1851
1851
  };
1852
1852
  };
@@ -1874,10 +1874,10 @@ export declare const Api: {
1874
1874
  }, z.core.$strip>;
1875
1875
  }, z.core.$strip>, z.ZodObject<{
1876
1876
  status: z.ZodLiteral<200>;
1877
- body: z.ZodCustom<import("node:stream/web").ReadableStream<unknown>, import("node:stream/web").ReadableStream<unknown>>;
1877
+ body: z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>;
1878
1878
  }, z.core.$strip>, z.ZodObject<{
1879
1879
  status: z.ZodLiteral<206>;
1880
- body: z.ZodCustom<import("node:stream/web").ReadableStream<unknown>, import("node:stream/web").ReadableStream<unknown>>;
1880
+ body: z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>;
1881
1881
  }, z.core.$strip>, z.ZodObject<{
1882
1882
  status: z.ZodLiteral<416>;
1883
1883
  json: z.ZodObject<{
@@ -43,3 +43,4 @@ export * from "./patchSets/PatchSets.js";
43
43
  export * from "./patchSets/selectionClosure.js";
44
44
  export * from "./patchSets/schemaTypesOfPath.js";
45
45
  export * from "./proposalMerge/trees.js";
46
+ export * from "./selfCheck.js";
@@ -0,0 +1,51 @@
1
+ import { type Json, type ModuleFilePath, type ValModules } from "@valbuild/core";
2
+ /**
3
+ * A Val checking a site with ITS OWN rules: the platform's upgrade page
4
+ * (valbuild/home `docs/plans/upgrades-v2.md`, piece E) calls this on the
5
+ * version an upgrade moves to, because only that version knows what it
6
+ * requires of the site's content.
7
+ *
8
+ * The page is home's and runs no Val code of its own. It finds this as
9
+ * `Internal.selfCheck` on the framework package in the site's own vendor
10
+ * layer -- the copy that made the site's schemas, since `val.config.ts`
11
+ * imports `initVal` from it -- and hands it the default export of the
12
+ * site's `val.modules.ts`, bundled. A Val from before this has no
13
+ * `selfCheck`, and the page says validation was not available.
14
+ *
15
+ * The answer is data the page shows and nothing else, so its shape is the
16
+ * contract: {@link SELF_CHECK_VERSION} names it, and an answer the page
17
+ * cannot read counts as a failed check there. Change the shape and the
18
+ * version goes up.
19
+ */
20
+ export declare const SELF_CHECK_VERSION = 1;
21
+ /** Content the site's schemas do not allow, or a module that would not load. */
22
+ export type SelfCheckError = {
23
+ /** The module, or `null` for an entry of `val.modules.ts` that did not load. */
24
+ moduleFilePath: string | null;
25
+ /** Where in the module, as keys and indices; `[]` for the module itself. */
26
+ path: string[];
27
+ message: string;
28
+ };
29
+ export type SelfCheckResult = {
30
+ version: typeof SELF_CHECK_VERSION;
31
+ /** The `@valbuild/core` that checked. */
32
+ valVersion: string;
33
+ /** How many modules `val.modules.ts` names. */
34
+ modules: number;
35
+ /** What holds a publish back: the errors the Studio would show. */
36
+ errors: SelfCheckError[];
37
+ /**
38
+ * Errors Val repairs itself when the content is saved (an image's
39
+ * metadata, say), which hold nothing back. Counted, so the page can say so.
40
+ */
41
+ repairedOnSave: number;
42
+ };
43
+ export type SelfCheckOptions = {
44
+ /**
45
+ * The site's content for a module: what it holds now, with every published
46
+ * edit, rather than what its file's text held when the build was made.
47
+ * `null` or `undefined` checks the file's own content.
48
+ */
49
+ sourceOf?: (moduleFilePath: ModuleFilePath) => Json | null | undefined;
50
+ };
51
+ export declare function selfCheck(valModules: ValModules, options?: SelfCheckOptions): Promise<SelfCheckResult>;
@@ -0,0 +1,106 @@
1
+ import type { BuildTargetResponse } from "../internal/index.js";
2
+ import type { StudioDeployResult } from "./runStudioDeploy.js";
3
+ /** A proposal as content answers it, as far as a build reads it. */
4
+ export type BuiltProposal = {
5
+ staged?: {
6
+ inputs: string | null;
7
+ buildRequired: boolean;
8
+ } | null;
9
+ built?: {
10
+ hash: string;
11
+ inputs?: string | null;
12
+ } | null;
13
+ };
14
+ /** The calls a build of a proposal makes. An error carries content's `status`. */
15
+ export type ProposalBuildClient<P extends BuiltProposal> = {
16
+ /** Its files, and what is staged. */
17
+ files(name: string): Promise<{
18
+ files: Record<string, string | null>;
19
+ staged: {
20
+ inputs: string | null;
21
+ buildRequired: boolean;
22
+ };
23
+ }>;
24
+ /** What it builds on: its own layer, or the site's. */
25
+ buildTarget(name: string): Promise<{
26
+ target: BuildTargetResponse;
27
+ layer: "site" | "own";
28
+ }>;
29
+ serveBuild(name: string, build: {
30
+ publishId: string;
31
+ inputs: string;
32
+ }): Promise<P>;
33
+ get(name: string): Promise<P>;
34
+ };
35
+ /** What a build of the proposal came to. */
36
+ export type ProposalBuildOutcome<P> = {
37
+ status: "built";
38
+ hash: string | null;
39
+ proposal: P;
40
+ } | {
41
+ status: "nothing-staged";
42
+ } | {
43
+ status: "already-built";
44
+ hash: string | null;
45
+ } | {
46
+ status: "failed";
47
+ message: string;
48
+ };
49
+ /**
50
+ * Where a build of the proposal is, around the deploy: the deploy's own steps
51
+ * are the Studio's deploy state (`useStudioDeployState`), and these are the
52
+ * parts before and after it.
53
+ *
54
+ * - `reading`: the proposal's files and the target to build them on.
55
+ * - `deploying`: the deploy is running; its state says which step.
56
+ * - `serving`: content is putting the build up at the proposal's address.
57
+ * - `waiting`: that request did not come back -- a gateway gave up on it --
58
+ * and content is asked until it says the proposal is built.
59
+ */
60
+ export type ProposalBuildStep = {
61
+ kind: "reading";
62
+ } | {
63
+ kind: "deploying";
64
+ } | {
65
+ kind: "serving";
66
+ since: number;
67
+ } | {
68
+ kind: "waiting";
69
+ since: number;
70
+ };
71
+ export declare function withoutLockfiles<T>(files: Record<string, T>): Record<string, T>;
72
+ /** How long, and how often, content is asked whether it served the build. */
73
+ export declare const SERVE_WAIT_MS: number;
74
+ export declare const SERVE_POLL_MS = 5000;
75
+ /**
76
+ * Build the proposal's staged files and serve the build at its address.
77
+ *
78
+ * The files and what they are for (`inputs`) come in one answer, so the build
79
+ * names exactly what it was made of; content refuses it if they were staged
80
+ * again meanwhile. The tab builds as for a publish and stops once the build is
81
+ * uploaded -- nothing goes live -- and content hands it to the platform.
82
+ *
83
+ * Serving can take longer than a gateway waits for an answer, and content
84
+ * finishes it all the same. So a gateway that gives up is not a failure: the
85
+ * proposal is read until it says it is built from these inputs, and served
86
+ * once more only if it never does.
87
+ */
88
+ export declare function buildProposal<P extends BuiltProposal>(deps: {
89
+ name: string;
90
+ client: ProposalBuildClient<P>;
91
+ /**
92
+ * `target`: the proposal's own, when it changed the dependencies and builds
93
+ * on the layer content had built for it; `undefined` builds on the site's,
94
+ * as every build of a proposal did before.
95
+ */
96
+ deploy: (files: Record<string, string | null>, target: BuildTargetResponse | undefined) => Promise<StudioDeployResult>;
97
+ /**
98
+ * Whether this document can build at all (`canBuildHere`): Safari cannot,
99
+ * and a proposal's build has no builder tab to hand off to yet.
100
+ */
101
+ canBuildHere: () => boolean;
102
+ onStep?: (step: ProposalBuildStep) => void;
103
+ /** For tests: the clock, and waiting on it. */
104
+ now?: () => number;
105
+ sleep?: (ms: number) => Promise<void>;
106
+ }): Promise<ProposalBuildOutcome<P>>;
@@ -0,0 +1,22 @@
1
+ import type * as TanstackBuild from "@valbuild/tanstack-build";
2
+ type Builder = typeof TanstackBuild;
3
+ /**
4
+ * What the Studio uses out of the builder package: five methods, each of which
5
+ * may answer later.
6
+ *
7
+ * Later because the builder runs in a worker (`importBuilder` in `@valbuild/ui`'s `loadBuilder.ts`), so
8
+ * even `bakedGit` -- synchronous in the package -- is a round trip here. The
9
+ * package module itself still satisfies this type, which is what lets a test
10
+ * hand one in.
11
+ */
12
+ export type StudioBuilder = {
13
+ bakedGit: (...args: Parameters<Builder["bakedGit"]>) => ReturnType<Builder["bakedGit"]> | Promise<ReturnType<Builder["bakedGit"]>>;
14
+ rebakeGit: (...args: Parameters<Builder["rebakeGit"]>) => ReturnType<Builder["rebakeGit"]> | Promise<ReturnType<Builder["rebakeGit"]>>;
15
+ buildUserApp: Builder["buildUserApp"];
16
+ publishArtifacts: Builder["publishArtifacts"];
17
+ /** A build's name, before building it: see `buildInputId`. */
18
+ buildInputId: Builder["buildInputId"];
19
+ /** A tree's Val modules, as one module to evaluate: see `bundleValModules`. */
20
+ bundleValModules: Builder["bundleValModules"];
21
+ };
22
+ export {};
@@ -0,0 +1,21 @@
1
+ export declare function onPublishRefusal(listener: ((body: unknown) => void) | null): void;
2
+ /** The publish API refused, and said why. */
3
+ export declare class StudioPublishError extends Error {
4
+ readonly statusCode: number;
5
+ readonly body: unknown;
6
+ constructor(statusCode: number, message: string, body: unknown);
7
+ }
8
+ /**
9
+ * Was this a failure that asking again could get past?
10
+ *
11
+ * No answer at all (the request never got through) and the answers that mean
12
+ * "not now" -- a timeout, too many requests, a server or gateway error. Every
13
+ * other status is content answering, and the same request gets the same
14
+ * answer.
15
+ */
16
+ export declare function isTransientPublishError(error: unknown): boolean;
17
+ /**
18
+ * One JSON call through this origin, with the session cookie: its body, or a
19
+ * `StudioPublishError` carrying the answer's own message.
20
+ */
21
+ export declare function callJson(fetchImpl: typeof fetch, url: string, method: "GET" | "POST", body?: unknown): Promise<unknown>;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * A site's build, published through content, from a browser: the deploy
3
+ * (read what to build and on what, build it, upload it, confirm it) and the
4
+ * publish job a tab runs (valbuild/home `docs/app-mode.md`, "Publishing is a
5
+ * queued job").
6
+ *
7
+ * Here rather than in the Studio because two pages run it: the Studio, which
8
+ * is a managed project's deployer, and home's upgrade page, which builds and
9
+ * publishes an upgrade proposal and pins this package at an exact version so
10
+ * that a site's own Val never reaches its upgrade (valbuild/home
11
+ * `docs/plans/upgrades-v2.md`, piece E). The builder is the caller's: see
12
+ * `StudioBuilder`.
13
+ */
14
+ export type { StudioBuilder } from "./builder.js";
15
+ export { StudioPublishError, callJson, isTransientPublishError, onPublishRefusal, } from "./callJson.js";
16
+ export { StudioUploadError, createStudioPublishClient, isExpiredSlot, publishApiOf, type CarriedArtifact, type LivePublicFiles, type PublishApiAt, type StudioPublishClient, } from "./publishClient.js";
17
+ export { runStudioPublish, type PublishPhase, type StudioPublishResult, } from "./runStudioPublish.js";
18
+ export { carriedInto, runStudioDeploy, splitBinaryFiles, withCommittedFiles, type CommittedBinaryFiles, type DeployPhase, type StudioDeployOptions, type StudioDeployResult, } from "./runStudioDeploy.js";
19
+ export { STUDIO_OUT_OF_DATE, STUDIO_OUT_OF_DATE_MESSAGE, layerMoved, loadedLayer, markStudioOutOfDate, readLiveLayer, rememberLoadedLayer, resetLoadedLayerForTests, siteMovedSinceLoad, studioOutOfDateRefusals, subscribeStudioOutOfDate, type LayerReading, } from "./loadedLayer.js";
20
+ export { MergePrepareAnswer, createStudioJobClient, isMergeChange, type PreparedJob, type StudioJobClient, } from "./jobClient.js";
21
+ export { RENEW_EVERY_MS, runJobToEnd, runStudioJob, type JobPhase, type StudioJobResult, } from "./runStudioJob.js";
22
+ export { SERVE_POLL_MS, SERVE_WAIT_MS, buildProposal, withoutLockfiles, type BuiltProposal, type ProposalBuildClient, type ProposalBuildOutcome, type ProposalBuildStep, } from "./buildProposal.js";
23
+ export { proposalProject } from "./proposalProject.js";