@valbuild/core 0.137.0 → 0.138.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.
- package/CHANGELOG.md +16 -0
- package/dist/declarations/src/index.d.ts +1 -1
- package/dist/declarations/src/source/settings.d.ts +14 -0
- package/dist/{index-481a7dcd.cjs.prod.js → index-3296fc4f.cjs.prod.js} +52 -6
- package/dist/{index-42ab6700.esm.js → index-a25822a3.esm.js} +52 -6
- package/dist/{index-fed897a2.cjs.dev.js → index-d3c51a0d.cjs.dev.js} +52 -6
- package/dist/valbuild-core.cjs.dev.js +1 -1
- package/dist/valbuild-core.cjs.prod.js +1 -1
- package/dist/valbuild-core.esm.js +1 -1
- package/package.json +1 -1
- package/patch/dist/valbuild-core-patch.cjs.dev.js +1 -1
- package/patch/dist/valbuild-core-patch.cjs.prod.js +1 -1
- package/patch/dist/valbuild-core-patch.esm.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @valbuild/core
|
|
2
2
|
|
|
3
|
+
## 0.138.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#751](https://github.com/valbuild/val/pull/751) [`5876fe0`](https://github.com/valbuild/val/commit/5876fe075fdee1f76f1cdaa2488ac52c58c894a8) Thanks [@freekh](https://github.com/freekh)! - Publishing no longer asks for a commit message by default.
|
|
8
|
+
|
|
9
|
+
- **Publish publishes.** In HTTP mode, pressing Publish goes straight to publishing, just as Save already did in local development. Where an AI model is available it writes the commit message (the button reads "Preparing" meanwhile, for up to 15 seconds). Otherwise the message is built from what changed, and names the exact path when a single field changed, e.g. `Update hero.title in /content/home.val.ts`. When several things changed, the message body lists the changed modules and their fields: up to six modules and five fields each, then how many more.
|
|
10
|
+
- **`studio.commitMessage: "required"`** in `s.settings()` brings the box back, redesigned. Editors can turn it on from the Studio too: Settings → Studio → "Ask for a commit message". It opens empty rather than pre-filled, so a message cannot be published unread. The AI fills it in when it can, and Publish stays disabled until there is a message. Nothing publishes on its own: the countdown that published while the AI was still writing is gone.
|
|
11
|
+
- **The overlay menu stays open** while the commit message popover is open, or a publish is under way. Before, moving onto the popover collapsed the menu and the popover moved with it.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#752](https://github.com/valbuild/val/pull/752) [`57af895`](https://github.com/valbuild/val/commit/57af8959cc46519a405b1ed7441623f8bf2e6d27) Thanks [@freekh](https://github.com/freekh)! - `s.date()` now reports a value that is not a real `YYYY-MM-DD` day as a validation error. It used to check only `from` / `to`, and compared those as plain strings, so a typo like `"19f81-12-30"` passed a `.from("1900-01-01").to("2024-01-01")` range without a word. Impossible days such as `"2023-02-29"` are rejected too, and a `from` / `to` bound that is not a valid date is reported as a schema error.
|
|
16
|
+
|
|
17
|
+
The Studio's date field no longer shows a year below 100 (`"0050-01-01"`) as empty: it was read as 1950 and discarded.
|
|
18
|
+
|
|
3
19
|
## 0.137.0
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -54,7 +54,7 @@ export { type SerializedImageSchema, ImageSchema } from "./schema/image.js";
|
|
|
54
54
|
export { type SerializedFileSchema, FileSchema } from "./schema/file.js";
|
|
55
55
|
export { type SerializedDateSchema, DateSchema } from "./schema/date.js";
|
|
56
56
|
export { type SerializedSettingsSchema, SettingsSchema, } from "./schema/settings.js";
|
|
57
|
-
export { type SettingsSource, type AssistantSettingsSource, type LocalesSettingsSource, type AssistantAvailability, type ThemeSettingsSource, type StudioSettingsSource, type ThemeRadius, ASSISTANT_SETTINGS_MAX_LENGTH, THEME_LOGO_DIRECTORY, THEME_RADIUS_STEPS, THEME_RADIUS_LENGTHS, assistantAvailability, } from "./source/settings.js";
|
|
57
|
+
export { type SettingsSource, type AssistantSettingsSource, type LocalesSettingsSource, type AssistantAvailability, type ThemeSettingsSource, type StudioSettingsSource, type StudioCommitMessageMode, type ThemeRadius, ASSISTANT_SETTINGS_MAX_LENGTH, THEME_LOGO_DIRECTORY, THEME_RADIUS_STEPS, THEME_RADIUS_LENGTHS, assistantAvailability, } from "./source/settings.js";
|
|
58
58
|
export { type ResolvedSettingsModule, SETTINGS_MODULE_CONVENTION, isRootModuleFilePath, resolveSettingsModule, } from "./settingsModule.js";
|
|
59
59
|
export { type Locale, localeTagError, localeOfValue } from "./locale.js";
|
|
60
60
|
export { type SerializedLocaleSchema, LocaleSchema } from "./schema/locale.js";
|
|
@@ -52,7 +52,21 @@ export type StudioSettingsSource = {
|
|
|
52
52
|
* that browser and is not here.
|
|
53
53
|
*/
|
|
54
54
|
tour?: boolean | null;
|
|
55
|
+
/**
|
|
56
|
+
* Whether publishing asks for a commit message.
|
|
57
|
+
*
|
|
58
|
+
* Unset means `"automatic"`: pressing Publish publishes, with a summary the
|
|
59
|
+
* AI writes where one is available and one assembled from what changed where
|
|
60
|
+
* it is not. Nobody is shown a box. `"required"` opens the box on every
|
|
61
|
+
* publish and will not publish it empty — the AI still fills it in, where
|
|
62
|
+
* there is one, but a person has to read it and press Publish.
|
|
63
|
+
*
|
|
64
|
+
* Only the HTTP (remote) mode commits, so this changes nothing in local
|
|
65
|
+
* development, where Save writes to disk.
|
|
66
|
+
*/
|
|
67
|
+
commitMessage?: StudioCommitMessageMode | null;
|
|
55
68
|
};
|
|
69
|
+
export type StudioCommitMessageMode = "automatic" | "required";
|
|
56
70
|
/**
|
|
57
71
|
* How the Studio looks in this project.
|
|
58
72
|
*
|
|
@@ -8758,7 +8758,8 @@ function settings() {
|
|
|
8758
8758
|
}).nullable().describe("The project's own mark, shown where Val's is in the Studio. A square-ish mark rather than a wordmark: the slot is 32px wide.")
|
|
8759
8759
|
}),
|
|
8760
8760
|
studio: new SettingsSchema({
|
|
8761
|
-
tour: _boolean().nullable().describe("Whether editors are offered the guided tour of the Studio. Unset means yes. Off hides the offer for everyone on this project — the tour stays in Quick actions for anyone who wants it.")
|
|
8761
|
+
tour: _boolean().nullable().describe("Whether editors are offered the guided tour of the Studio. Unset means yes. Off hides the offer for everyone on this project — the tour stays in Quick actions for anyone who wants it."),
|
|
8762
|
+
commitMessage: enumSchema("automatic", "required").nullable().describe("Whether publishing asks for a commit message. Unset is the same as 'automatic': Publish publishes straight away, with a message the AI writes (or one listing what changed). 'required' asks every time, and will not publish an empty one.")
|
|
8762
8763
|
}),
|
|
8763
8764
|
locales: new SettingsSchema({
|
|
8764
8765
|
// Nullable because the source type is, and because the Studio writes
|
|
@@ -10930,7 +10931,7 @@ var DateSchema = /*#__PURE__*/function (_Schema) {
|
|
|
10930
10931
|
}, {
|
|
10931
10932
|
key: "executeValidate",
|
|
10932
10933
|
value: function executeValidate(path, src) {
|
|
10933
|
-
var _this$options, _this$options2, _this$options3, _this$options4;
|
|
10934
|
+
var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6;
|
|
10934
10935
|
var errors = this.executeCustomValidateFunctions(src, this.customValidateFunctions, {
|
|
10935
10936
|
path: path
|
|
10936
10937
|
});
|
|
@@ -10944,7 +10945,31 @@ var DateSchema = /*#__PURE__*/function (_Schema) {
|
|
|
10944
10945
|
});
|
|
10945
10946
|
return _defineProperty({}, path, errors);
|
|
10946
10947
|
}
|
|
10947
|
-
|
|
10948
|
+
// The bounds below are compared as strings, which only orders days when
|
|
10949
|
+
// every side is a real `YYYY-MM-DD`: "19f81-12-30" sorts between
|
|
10950
|
+
// "1900-01-01" and "2024-01-01" and would pass them.
|
|
10951
|
+
if (!isCalendarDay(src)) {
|
|
10952
|
+
errors.push({
|
|
10953
|
+
message: "Value '".concat(src, "' is not a valid date (expected YYYY-MM-DD)"),
|
|
10954
|
+
value: src
|
|
10955
|
+
});
|
|
10956
|
+
return _defineProperty({}, path, errors);
|
|
10957
|
+
}
|
|
10958
|
+
var bounds = [["From", (_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.from], ["To", (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.to]];
|
|
10959
|
+
for (var _i = 0, _bounds = bounds; _i < _bounds.length; _i++) {
|
|
10960
|
+
var _bounds$_i = _slicedToArray(_bounds[_i], 2),
|
|
10961
|
+
name = _bounds$_i[0],
|
|
10962
|
+
bound = _bounds$_i[1];
|
|
10963
|
+
if (bound !== undefined && !isCalendarDay(bound)) {
|
|
10964
|
+
errors.push({
|
|
10965
|
+
message: "".concat(name, " date '").concat(bound, "' is not a valid date (expected YYYY-MM-DD)"),
|
|
10966
|
+
value: src,
|
|
10967
|
+
typeError: true
|
|
10968
|
+
});
|
|
10969
|
+
return _defineProperty({}, path, errors);
|
|
10970
|
+
}
|
|
10971
|
+
}
|
|
10972
|
+
if ((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.from && (_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.to) {
|
|
10948
10973
|
if (this.options.from > this.options.to) {
|
|
10949
10974
|
errors.push({
|
|
10950
10975
|
message: "From date ".concat(this.options.from, " is after to date ").concat(this.options.to),
|
|
@@ -10957,14 +10982,14 @@ var DateSchema = /*#__PURE__*/function (_Schema) {
|
|
|
10957
10982
|
value: src
|
|
10958
10983
|
});
|
|
10959
10984
|
}
|
|
10960
|
-
} else if ((_this$
|
|
10985
|
+
} else if ((_this$options5 = this.options) !== null && _this$options5 !== void 0 && _this$options5.from) {
|
|
10961
10986
|
if (src < this.options.from) {
|
|
10962
10987
|
errors.push({
|
|
10963
10988
|
message: "Date is before the minimum date ".concat(this.options.from),
|
|
10964
10989
|
value: src
|
|
10965
10990
|
});
|
|
10966
10991
|
}
|
|
10967
|
-
} else if ((_this$
|
|
10992
|
+
} else if ((_this$options6 = this.options) !== null && _this$options6 !== void 0 && _this$options6.to) {
|
|
10968
10993
|
if (src > this.options.to) {
|
|
10969
10994
|
errors.push({
|
|
10970
10995
|
message: "Date is after the maximum date ".concat(this.options.to),
|
|
@@ -11134,6 +11159,27 @@ var DateSchema = /*#__PURE__*/function (_Schema) {
|
|
|
11134
11159
|
}
|
|
11135
11160
|
}]);
|
|
11136
11161
|
}(Schema);
|
|
11162
|
+
var CALENDAR_DAY = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
11163
|
+
|
|
11164
|
+
/**
|
|
11165
|
+
* Whether `value` is a `YYYY-MM-DD` day that exists on the calendar — so
|
|
11166
|
+
* "2023-02-29" and "2024-13-01" are not, even though they have the shape.
|
|
11167
|
+
*/
|
|
11168
|
+
function isCalendarDay(value) {
|
|
11169
|
+
var match = CALENDAR_DAY.exec(value);
|
|
11170
|
+
if (!match) {
|
|
11171
|
+
return false;
|
|
11172
|
+
}
|
|
11173
|
+
var year = Number(match[1]);
|
|
11174
|
+
var month = Number(match[2]);
|
|
11175
|
+
var day = Number(match[3]);
|
|
11176
|
+
// Out-of-range fields roll over (Feb 30 -> Mar 2) instead of failing, so a
|
|
11177
|
+
// day is real only if it survives the round trip. setUTCFullYear, not
|
|
11178
|
+
// Date.UTC: the latter maps years 0-99 to 1900-1999.
|
|
11179
|
+
var date = new Date(0);
|
|
11180
|
+
date.setUTCFullYear(year, month - 1, day);
|
|
11181
|
+
return date.getUTCFullYear() === year && date.getUTCMonth() === month - 1 && date.getUTCDate() === day;
|
|
11182
|
+
}
|
|
11137
11183
|
var date = function date(options) {
|
|
11138
11184
|
return new DateSchema(options);
|
|
11139
11185
|
};
|
|
@@ -14341,7 +14387,7 @@ function isPageRouter(routerId) {
|
|
|
14341
14387
|
|
|
14342
14388
|
var corePackageJson = {
|
|
14343
14389
|
name: "@valbuild/core",
|
|
14344
|
-
version: "0.
|
|
14390
|
+
version: "0.138.0",
|
|
14345
14391
|
"private": false,
|
|
14346
14392
|
description: "Val - supercharged hard-coded content",
|
|
14347
14393
|
repository: {
|
|
@@ -8756,7 +8756,8 @@ function settings() {
|
|
|
8756
8756
|
}).nullable().describe("The project's own mark, shown where Val's is in the Studio. A square-ish mark rather than a wordmark: the slot is 32px wide.")
|
|
8757
8757
|
}),
|
|
8758
8758
|
studio: new SettingsSchema({
|
|
8759
|
-
tour: _boolean().nullable().describe("Whether editors are offered the guided tour of the Studio. Unset means yes. Off hides the offer for everyone on this project — the tour stays in Quick actions for anyone who wants it.")
|
|
8759
|
+
tour: _boolean().nullable().describe("Whether editors are offered the guided tour of the Studio. Unset means yes. Off hides the offer for everyone on this project — the tour stays in Quick actions for anyone who wants it."),
|
|
8760
|
+
commitMessage: enumSchema("automatic", "required").nullable().describe("Whether publishing asks for a commit message. Unset is the same as 'automatic': Publish publishes straight away, with a message the AI writes (or one listing what changed). 'required' asks every time, and will not publish an empty one.")
|
|
8760
8761
|
}),
|
|
8761
8762
|
locales: new SettingsSchema({
|
|
8762
8763
|
// Nullable because the source type is, and because the Studio writes
|
|
@@ -10928,7 +10929,7 @@ var DateSchema = /*#__PURE__*/function (_Schema) {
|
|
|
10928
10929
|
}, {
|
|
10929
10930
|
key: "executeValidate",
|
|
10930
10931
|
value: function executeValidate(path, src) {
|
|
10931
|
-
var _this$options, _this$options2, _this$options3, _this$options4;
|
|
10932
|
+
var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6;
|
|
10932
10933
|
var errors = this.executeCustomValidateFunctions(src, this.customValidateFunctions, {
|
|
10933
10934
|
path: path
|
|
10934
10935
|
});
|
|
@@ -10942,7 +10943,31 @@ var DateSchema = /*#__PURE__*/function (_Schema) {
|
|
|
10942
10943
|
});
|
|
10943
10944
|
return _defineProperty({}, path, errors);
|
|
10944
10945
|
}
|
|
10945
|
-
|
|
10946
|
+
// The bounds below are compared as strings, which only orders days when
|
|
10947
|
+
// every side is a real `YYYY-MM-DD`: "19f81-12-30" sorts between
|
|
10948
|
+
// "1900-01-01" and "2024-01-01" and would pass them.
|
|
10949
|
+
if (!isCalendarDay(src)) {
|
|
10950
|
+
errors.push({
|
|
10951
|
+
message: "Value '".concat(src, "' is not a valid date (expected YYYY-MM-DD)"),
|
|
10952
|
+
value: src
|
|
10953
|
+
});
|
|
10954
|
+
return _defineProperty({}, path, errors);
|
|
10955
|
+
}
|
|
10956
|
+
var bounds = [["From", (_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.from], ["To", (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.to]];
|
|
10957
|
+
for (var _i = 0, _bounds = bounds; _i < _bounds.length; _i++) {
|
|
10958
|
+
var _bounds$_i = _slicedToArray(_bounds[_i], 2),
|
|
10959
|
+
name = _bounds$_i[0],
|
|
10960
|
+
bound = _bounds$_i[1];
|
|
10961
|
+
if (bound !== undefined && !isCalendarDay(bound)) {
|
|
10962
|
+
errors.push({
|
|
10963
|
+
message: "".concat(name, " date '").concat(bound, "' is not a valid date (expected YYYY-MM-DD)"),
|
|
10964
|
+
value: src,
|
|
10965
|
+
typeError: true
|
|
10966
|
+
});
|
|
10967
|
+
return _defineProperty({}, path, errors);
|
|
10968
|
+
}
|
|
10969
|
+
}
|
|
10970
|
+
if ((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.from && (_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.to) {
|
|
10946
10971
|
if (this.options.from > this.options.to) {
|
|
10947
10972
|
errors.push({
|
|
10948
10973
|
message: "From date ".concat(this.options.from, " is after to date ").concat(this.options.to),
|
|
@@ -10955,14 +10980,14 @@ var DateSchema = /*#__PURE__*/function (_Schema) {
|
|
|
10955
10980
|
value: src
|
|
10956
10981
|
});
|
|
10957
10982
|
}
|
|
10958
|
-
} else if ((_this$
|
|
10983
|
+
} else if ((_this$options5 = this.options) !== null && _this$options5 !== void 0 && _this$options5.from) {
|
|
10959
10984
|
if (src < this.options.from) {
|
|
10960
10985
|
errors.push({
|
|
10961
10986
|
message: "Date is before the minimum date ".concat(this.options.from),
|
|
10962
10987
|
value: src
|
|
10963
10988
|
});
|
|
10964
10989
|
}
|
|
10965
|
-
} else if ((_this$
|
|
10990
|
+
} else if ((_this$options6 = this.options) !== null && _this$options6 !== void 0 && _this$options6.to) {
|
|
10966
10991
|
if (src > this.options.to) {
|
|
10967
10992
|
errors.push({
|
|
10968
10993
|
message: "Date is after the maximum date ".concat(this.options.to),
|
|
@@ -11132,6 +11157,27 @@ var DateSchema = /*#__PURE__*/function (_Schema) {
|
|
|
11132
11157
|
}
|
|
11133
11158
|
}]);
|
|
11134
11159
|
}(Schema);
|
|
11160
|
+
var CALENDAR_DAY = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
11161
|
+
|
|
11162
|
+
/**
|
|
11163
|
+
* Whether `value` is a `YYYY-MM-DD` day that exists on the calendar — so
|
|
11164
|
+
* "2023-02-29" and "2024-13-01" are not, even though they have the shape.
|
|
11165
|
+
*/
|
|
11166
|
+
function isCalendarDay(value) {
|
|
11167
|
+
var match = CALENDAR_DAY.exec(value);
|
|
11168
|
+
if (!match) {
|
|
11169
|
+
return false;
|
|
11170
|
+
}
|
|
11171
|
+
var year = Number(match[1]);
|
|
11172
|
+
var month = Number(match[2]);
|
|
11173
|
+
var day = Number(match[3]);
|
|
11174
|
+
// Out-of-range fields roll over (Feb 30 -> Mar 2) instead of failing, so a
|
|
11175
|
+
// day is real only if it survives the round trip. setUTCFullYear, not
|
|
11176
|
+
// Date.UTC: the latter maps years 0-99 to 1900-1999.
|
|
11177
|
+
var date = new Date(0);
|
|
11178
|
+
date.setUTCFullYear(year, month - 1, day);
|
|
11179
|
+
return date.getUTCFullYear() === year && date.getUTCMonth() === month - 1 && date.getUTCDate() === day;
|
|
11180
|
+
}
|
|
11135
11181
|
var date = function date(options) {
|
|
11136
11182
|
return new DateSchema(options);
|
|
11137
11183
|
};
|
|
@@ -14339,7 +14385,7 @@ function isPageRouter(routerId) {
|
|
|
14339
14385
|
|
|
14340
14386
|
var corePackageJson = {
|
|
14341
14387
|
name: "@valbuild/core",
|
|
14342
|
-
version: "0.
|
|
14388
|
+
version: "0.138.0",
|
|
14343
14389
|
"private": false,
|
|
14344
14390
|
description: "Val - supercharged hard-coded content",
|
|
14345
14391
|
repository: {
|
|
@@ -8758,7 +8758,8 @@ function settings() {
|
|
|
8758
8758
|
}).nullable().describe("The project's own mark, shown where Val's is in the Studio. A square-ish mark rather than a wordmark: the slot is 32px wide.")
|
|
8759
8759
|
}),
|
|
8760
8760
|
studio: new SettingsSchema({
|
|
8761
|
-
tour: _boolean().nullable().describe("Whether editors are offered the guided tour of the Studio. Unset means yes. Off hides the offer for everyone on this project — the tour stays in Quick actions for anyone who wants it.")
|
|
8761
|
+
tour: _boolean().nullable().describe("Whether editors are offered the guided tour of the Studio. Unset means yes. Off hides the offer for everyone on this project — the tour stays in Quick actions for anyone who wants it."),
|
|
8762
|
+
commitMessage: enumSchema("automatic", "required").nullable().describe("Whether publishing asks for a commit message. Unset is the same as 'automatic': Publish publishes straight away, with a message the AI writes (or one listing what changed). 'required' asks every time, and will not publish an empty one.")
|
|
8762
8763
|
}),
|
|
8763
8764
|
locales: new SettingsSchema({
|
|
8764
8765
|
// Nullable because the source type is, and because the Studio writes
|
|
@@ -10930,7 +10931,7 @@ var DateSchema = /*#__PURE__*/function (_Schema) {
|
|
|
10930
10931
|
}, {
|
|
10931
10932
|
key: "executeValidate",
|
|
10932
10933
|
value: function executeValidate(path, src) {
|
|
10933
|
-
var _this$options, _this$options2, _this$options3, _this$options4;
|
|
10934
|
+
var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6;
|
|
10934
10935
|
var errors = this.executeCustomValidateFunctions(src, this.customValidateFunctions, {
|
|
10935
10936
|
path: path
|
|
10936
10937
|
});
|
|
@@ -10944,7 +10945,31 @@ var DateSchema = /*#__PURE__*/function (_Schema) {
|
|
|
10944
10945
|
});
|
|
10945
10946
|
return _defineProperty({}, path, errors);
|
|
10946
10947
|
}
|
|
10947
|
-
|
|
10948
|
+
// The bounds below are compared as strings, which only orders days when
|
|
10949
|
+
// every side is a real `YYYY-MM-DD`: "19f81-12-30" sorts between
|
|
10950
|
+
// "1900-01-01" and "2024-01-01" and would pass them.
|
|
10951
|
+
if (!isCalendarDay(src)) {
|
|
10952
|
+
errors.push({
|
|
10953
|
+
message: "Value '".concat(src, "' is not a valid date (expected YYYY-MM-DD)"),
|
|
10954
|
+
value: src
|
|
10955
|
+
});
|
|
10956
|
+
return _defineProperty({}, path, errors);
|
|
10957
|
+
}
|
|
10958
|
+
var bounds = [["From", (_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.from], ["To", (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.to]];
|
|
10959
|
+
for (var _i = 0, _bounds = bounds; _i < _bounds.length; _i++) {
|
|
10960
|
+
var _bounds$_i = _slicedToArray(_bounds[_i], 2),
|
|
10961
|
+
name = _bounds$_i[0],
|
|
10962
|
+
bound = _bounds$_i[1];
|
|
10963
|
+
if (bound !== undefined && !isCalendarDay(bound)) {
|
|
10964
|
+
errors.push({
|
|
10965
|
+
message: "".concat(name, " date '").concat(bound, "' is not a valid date (expected YYYY-MM-DD)"),
|
|
10966
|
+
value: src,
|
|
10967
|
+
typeError: true
|
|
10968
|
+
});
|
|
10969
|
+
return _defineProperty({}, path, errors);
|
|
10970
|
+
}
|
|
10971
|
+
}
|
|
10972
|
+
if ((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.from && (_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.to) {
|
|
10948
10973
|
if (this.options.from > this.options.to) {
|
|
10949
10974
|
errors.push({
|
|
10950
10975
|
message: "From date ".concat(this.options.from, " is after to date ").concat(this.options.to),
|
|
@@ -10957,14 +10982,14 @@ var DateSchema = /*#__PURE__*/function (_Schema) {
|
|
|
10957
10982
|
value: src
|
|
10958
10983
|
});
|
|
10959
10984
|
}
|
|
10960
|
-
} else if ((_this$
|
|
10985
|
+
} else if ((_this$options5 = this.options) !== null && _this$options5 !== void 0 && _this$options5.from) {
|
|
10961
10986
|
if (src < this.options.from) {
|
|
10962
10987
|
errors.push({
|
|
10963
10988
|
message: "Date is before the minimum date ".concat(this.options.from),
|
|
10964
10989
|
value: src
|
|
10965
10990
|
});
|
|
10966
10991
|
}
|
|
10967
|
-
} else if ((_this$
|
|
10992
|
+
} else if ((_this$options6 = this.options) !== null && _this$options6 !== void 0 && _this$options6.to) {
|
|
10968
10993
|
if (src > this.options.to) {
|
|
10969
10994
|
errors.push({
|
|
10970
10995
|
message: "Date is after the maximum date ".concat(this.options.to),
|
|
@@ -11134,6 +11159,27 @@ var DateSchema = /*#__PURE__*/function (_Schema) {
|
|
|
11134
11159
|
}
|
|
11135
11160
|
}]);
|
|
11136
11161
|
}(Schema);
|
|
11162
|
+
var CALENDAR_DAY = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
11163
|
+
|
|
11164
|
+
/**
|
|
11165
|
+
* Whether `value` is a `YYYY-MM-DD` day that exists on the calendar — so
|
|
11166
|
+
* "2023-02-29" and "2024-13-01" are not, even though they have the shape.
|
|
11167
|
+
*/
|
|
11168
|
+
function isCalendarDay(value) {
|
|
11169
|
+
var match = CALENDAR_DAY.exec(value);
|
|
11170
|
+
if (!match) {
|
|
11171
|
+
return false;
|
|
11172
|
+
}
|
|
11173
|
+
var year = Number(match[1]);
|
|
11174
|
+
var month = Number(match[2]);
|
|
11175
|
+
var day = Number(match[3]);
|
|
11176
|
+
// Out-of-range fields roll over (Feb 30 -> Mar 2) instead of failing, so a
|
|
11177
|
+
// day is real only if it survives the round trip. setUTCFullYear, not
|
|
11178
|
+
// Date.UTC: the latter maps years 0-99 to 1900-1999.
|
|
11179
|
+
var date = new Date(0);
|
|
11180
|
+
date.setUTCFullYear(year, month - 1, day);
|
|
11181
|
+
return date.getUTCFullYear() === year && date.getUTCMonth() === month - 1 && date.getUTCDate() === day;
|
|
11182
|
+
}
|
|
11137
11183
|
var date = function date(options) {
|
|
11138
11184
|
return new DateSchema(options);
|
|
11139
11185
|
};
|
|
@@ -14341,7 +14387,7 @@ function isPageRouter(routerId) {
|
|
|
14341
14387
|
|
|
14342
14388
|
var corePackageJson = {
|
|
14343
14389
|
name: "@valbuild/core",
|
|
14344
|
-
version: "0.
|
|
14390
|
+
version: "0.138.0",
|
|
14345
14391
|
"private": false,
|
|
14346
14392
|
description: "Val - supercharged hard-coded content",
|
|
14347
14393
|
repository: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { v as ASSISTANT_SETTINGS_MAX_LENGTH, A as ArraySchema, B as BooleanSchema, Y as CODE_LANGUAGES, Z as COLOR_FORMATS, X as CodeSchema, W as ColorSchema, e as DEFAULT_APP_HOST, $ as DEFAULT_COLOR_FORMAT, D as DEFAULT_CONTENT_HOST, f as DEFAULT_STATIC_HOST, n as DEFAULT_VAL_REMOTE_HOST, t as DateSchema, a0 as DateTimeSchema, a6 as DiscriminatedUnionSchema, a7 as EnumSchema, F as FATAL_ERROR_TYPES, r as FileSchema, G as GenericSelector, q as ImageSchema, I as Internal, a1 as KeyOfSchema, a8 as LiteralSchema, L as LocaleSchema, M as ModuleFilePathSep, N as NumberSchema, O as ObjectSchema, R as RecordSchema, a5 as RichTextSchema, a4 as RouteSchema, z as SETTINGS_MODULE_CONVENTION, S as Schema, u as SettingsSchema, p as StringSchema, T as THEME_LOGO_DIRECTORY, x as THEME_RADIUS_LENGTHS, w as THEME_RADIUS_STEPS, am as UNSAFE_URL_SCHEMES, V as VAL_EXTENSION, a2 as ValViewSchema, y as assistantAvailability, j as computeSourcesSha, h as computeValModuleShas, K as declaredKeySetOf, o as derefPatch, ai as describeSchemeRejection, a9 as deserializeSchema, U as discriminatedUnionBranchOf, g as extractValModules, ag as getSourcePathFromRoute, l as hasMediaSchema, k as hasRemoteFileSchema, i as initVal, aj as isCheckableScheme, ab as isInlineRender, ah as isPageRouter, C as isRootModuleFilePath, a3 as isValViewSource, J as localeOfValue, H as localeTagError, Q as missingDeclaredKeys, m as modules, ac as parseNextJsRoutePattern, ad as parseTanStackRoutePattern, aa as previewScope, ak as rejectScheme, E as resolveSettingsModule, al as schemeOf, ae as tanStackSegmentsOfRoutePath, af as validateUrlAgainstPattern } from './index-
|
|
1
|
+
export { v as ASSISTANT_SETTINGS_MAX_LENGTH, A as ArraySchema, B as BooleanSchema, Y as CODE_LANGUAGES, Z as COLOR_FORMATS, X as CodeSchema, W as ColorSchema, e as DEFAULT_APP_HOST, $ as DEFAULT_COLOR_FORMAT, D as DEFAULT_CONTENT_HOST, f as DEFAULT_STATIC_HOST, n as DEFAULT_VAL_REMOTE_HOST, t as DateSchema, a0 as DateTimeSchema, a6 as DiscriminatedUnionSchema, a7 as EnumSchema, F as FATAL_ERROR_TYPES, r as FileSchema, G as GenericSelector, q as ImageSchema, I as Internal, a1 as KeyOfSchema, a8 as LiteralSchema, L as LocaleSchema, M as ModuleFilePathSep, N as NumberSchema, O as ObjectSchema, R as RecordSchema, a5 as RichTextSchema, a4 as RouteSchema, z as SETTINGS_MODULE_CONVENTION, S as Schema, u as SettingsSchema, p as StringSchema, T as THEME_LOGO_DIRECTORY, x as THEME_RADIUS_LENGTHS, w as THEME_RADIUS_STEPS, am as UNSAFE_URL_SCHEMES, V as VAL_EXTENSION, a2 as ValViewSchema, y as assistantAvailability, j as computeSourcesSha, h as computeValModuleShas, K as declaredKeySetOf, o as derefPatch, ai as describeSchemeRejection, a9 as deserializeSchema, U as discriminatedUnionBranchOf, g as extractValModules, ag as getSourcePathFromRoute, l as hasMediaSchema, k as hasRemoteFileSchema, i as initVal, aj as isCheckableScheme, ab as isInlineRender, ah as isPageRouter, C as isRootModuleFilePath, a3 as isValViewSource, J as localeOfValue, H as localeTagError, Q as missingDeclaredKeys, m as modules, ac as parseNextJsRoutePattern, ad as parseTanStackRoutePattern, aa as previewScope, ak as rejectScheme, E as resolveSettingsModule, al as schemeOf, ae as tanStackSegmentsOfRoutePath, af as validateUrlAgainstPattern } from './index-a25822a3.esm.js';
|
|
2
2
|
import './result-daff1cae.esm.js';
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var dist_valbuildCore = require('../../dist/index-
|
|
5
|
+
var dist_valbuildCore = require('../../dist/index-d3c51a0d.cjs.dev.js');
|
|
6
6
|
var result = require('../../dist/result-bb1f436e.cjs.dev.js');
|
|
7
7
|
var util = require('../../dist/util-b213092b.cjs.dev.js');
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var dist_valbuildCore = require('../../dist/index-
|
|
5
|
+
var dist_valbuildCore = require('../../dist/index-3296fc4f.cjs.prod.js');
|
|
6
6
|
var result = require('../../dist/result-787e35f6.cjs.prod.js');
|
|
7
7
|
var util = require('../../dist/util-030d8a1f.cjs.prod.js');
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as _typeof, a as _slicedToArray, P as PatchError, s as splitModuleFilePathAndModulePath, b as _createClass, c as _classCallCheck, d as _toConsumableArray } from '../../dist/index-
|
|
2
|
-
export { P as PatchError } from '../../dist/index-
|
|
1
|
+
import { _ as _typeof, a as _slicedToArray, P as PatchError, s as splitModuleFilePathAndModulePath, b as _createClass, c as _classCallCheck, d as _toConsumableArray } from '../../dist/index-a25822a3.esm.js';
|
|
2
|
+
export { P as PatchError } from '../../dist/index-a25822a3.esm.js';
|
|
3
3
|
import { f as isNonEmpty, e as err, o as ok, m as map, g as flatMap, i as isErr, h as flatMapReduce, j as filterOrElse, k as mapErr, l as map$1, n as all, p as flatten, q as allT } from '../../dist/result-daff1cae.esm.js';
|
|
4
4
|
import { p as pipe } from '../../dist/util-18613e99.esm.js';
|
|
5
5
|
|