@valbuild/server 0.148.1 → 0.148.2
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 +23 -0
- package/browser/dist/valbuild-server-browser.cjs.dev.js +1 -1
- package/browser/dist/valbuild-server-browser.cjs.prod.js +1 -1
- package/browser/dist/valbuild-server-browser.esm.js +1 -1
- package/dist/{ValRouterCore-9bdaaf89.cjs.dev.js → ValRouterCore-72594062.cjs.dev.js} +34 -34
- package/dist/{ValRouterCore-7ca3dc68.esm.js → ValRouterCore-ad10b6cf.esm.js} +34 -34
- package/dist/{ValRouterCore-42772c21.cjs.prod.js → ValRouterCore-dd465930.cjs.prod.js} +34 -34
- package/dist/{getJsonEntryAtCommit-2e36e805.cjs.prod.js → getJsonEntryAtCommit-2a0e9eaf.cjs.prod.js} +1 -1
- package/dist/{getJsonEntryAtCommit-64f67a50.cjs.dev.js → getJsonEntryAtCommit-85159574.cjs.dev.js} +1 -1
- package/dist/{getJsonEntryAtCommit-40b6d9c1.esm.js → getJsonEntryAtCommit-e32a470b.esm.js} +1 -1
- package/dist/valbuild-server.cjs.dev.js +32 -32
- package/dist/valbuild-server.cjs.prod.js +32 -32
- package/dist/valbuild-server.esm.js +33 -33
- package/package.json +4 -4
|
@@ -12,7 +12,7 @@ var path = require('path');
|
|
|
12
12
|
var fs = require('fs');
|
|
13
13
|
var vm = require('node:vm');
|
|
14
14
|
var node_module = require('node:module');
|
|
15
|
-
var ValRouterCore = require('./ValRouterCore-
|
|
15
|
+
var ValRouterCore = require('./ValRouterCore-dd465930.cjs.prod.js');
|
|
16
16
|
var server = require('@valbuild/ui/server');
|
|
17
17
|
var z = require('zod');
|
|
18
18
|
var zodValidationError = require('zod-validation-error');
|
|
@@ -2551,7 +2551,7 @@ class ValOpsFS extends ValRouterCore.ValOps {
|
|
|
2551
2551
|
}
|
|
2552
2552
|
};
|
|
2553
2553
|
}
|
|
2554
|
-
|
|
2554
|
+
core.Internal.log.error("Could not parse presigned auth nonce response. Error: " + zodValidationError.fromError(parsed.error));
|
|
2555
2555
|
return {
|
|
2556
2556
|
status: "error",
|
|
2557
2557
|
statusCode: 500,
|
|
@@ -2570,7 +2570,7 @@ class ValOpsFS extends ValRouterCore.ValOps {
|
|
|
2570
2570
|
};
|
|
2571
2571
|
}
|
|
2572
2572
|
const unknownErrorMessage = `Could not get presigned auth nonce. HTTP error: ${res.status} ${res.statusText}`;
|
|
2573
|
-
|
|
2573
|
+
core.Internal.log.error(unknownErrorMessage);
|
|
2574
2574
|
return {
|
|
2575
2575
|
status: "error",
|
|
2576
2576
|
statusCode: 500,
|
|
@@ -2579,7 +2579,7 @@ class ValOpsFS extends ValRouterCore.ValOps {
|
|
|
2579
2579
|
}
|
|
2580
2580
|
};
|
|
2581
2581
|
} catch (e) {
|
|
2582
|
-
|
|
2582
|
+
core.Internal.log.error("Could not get presigned auth nonce (connection error?):", e);
|
|
2583
2583
|
return {
|
|
2584
2584
|
status: "error",
|
|
2585
2585
|
statusCode: 500,
|
|
@@ -2684,7 +2684,7 @@ class ValOpsFS extends ValRouterCore.ValOps {
|
|
|
2684
2684
|
}
|
|
2685
2685
|
}
|
|
2686
2686
|
if (Date.now() - start > interval) {
|
|
2687
|
-
|
|
2687
|
+
core.Internal.log.debug("polling interval of patches exceeded");
|
|
2688
2688
|
}
|
|
2689
2689
|
if (stopPolling) {
|
|
2690
2690
|
return;
|
|
@@ -2713,7 +2713,7 @@ class ValOpsFS extends ValRouterCore.ValOps {
|
|
|
2713
2713
|
}
|
|
2714
2714
|
}
|
|
2715
2715
|
if (Date.now() - start > interval) {
|
|
2716
|
-
|
|
2716
|
+
core.Internal.log.debug("polling interval of files exceeded");
|
|
2717
2717
|
}
|
|
2718
2718
|
// Checked BEFORE rescheduling, as the patches-directory poller
|
|
2719
2719
|
// above does. Without it this walk goes on forever: the `finally`
|
|
@@ -2884,7 +2884,7 @@ class ValOpsFS extends ValRouterCore.ValOps {
|
|
|
2884
2884
|
async repairStore(read) {
|
|
2885
2885
|
const patchesDir = this.getPatchesDir();
|
|
2886
2886
|
for (const problem of describePatchStoreProblems(read.problems)) {
|
|
2887
|
-
|
|
2887
|
+
core.Internal.log.warn("something is wrong with the patch store.", problem);
|
|
2888
2888
|
}
|
|
2889
2889
|
const locked = await withPatchLock(this.getPatchLockFile(), {
|
|
2890
2890
|
ttlMs: 30_000,
|
|
@@ -2908,7 +2908,7 @@ class ValOpsFS extends ValRouterCore.ValOps {
|
|
|
2908
2908
|
}
|
|
2909
2909
|
for (const action of repairPatchStore(patchesDir, current)) {
|
|
2910
2910
|
if (action.type === "removed-unreadable-patch") {
|
|
2911
|
-
|
|
2911
|
+
core.Internal.log.warn(`removed the unpublished change ${action.name} because ${action.because}. See ${patchesDir}/${PATCH_REPAIR_LOG_FILE_NAME}.`);
|
|
2912
2912
|
// Queued rather than only logged: this is someone's unpublished
|
|
2913
2913
|
// work being thrown away, and a server console is not somewhere the
|
|
2914
2914
|
// person editing is looking.
|
|
@@ -2919,7 +2919,7 @@ class ValOpsFS extends ValRouterCore.ValOps {
|
|
|
2919
2919
|
} else if (action.type === "removed-orphan-directory") {
|
|
2920
2920
|
// Not queued. Nothing ever read this - it is a record whose log line
|
|
2921
2921
|
// never landed - so there is no edit to tell anyone about.
|
|
2922
|
-
|
|
2922
|
+
core.Internal.log.warn(`removed the unused patch directory ${action.name}.`);
|
|
2923
2923
|
}
|
|
2924
2924
|
}
|
|
2925
2925
|
const after = readPatchStore(patchesDir);
|
|
@@ -2939,7 +2939,7 @@ class ValOpsFS extends ValRouterCore.ValOps {
|
|
|
2939
2939
|
message: reset.error
|
|
2940
2940
|
};
|
|
2941
2941
|
}
|
|
2942
|
-
|
|
2942
|
+
core.Internal.log.warn(`the patch store could not be repaired, so it was reset. The previous contents are in ${reset.movedTo}.`);
|
|
2943
2943
|
return {
|
|
2944
2944
|
status: "ok",
|
|
2945
2945
|
entries: []
|
|
@@ -2949,7 +2949,7 @@ class ValOpsFS extends ValRouterCore.ValOps {
|
|
|
2949
2949
|
// Someone else holds the lock, quite possibly to run this same repair.
|
|
2950
2950
|
// Serving what was read is safe — those entries are the ones that ARE
|
|
2951
2951
|
// readable — and the next read tries again.
|
|
2952
|
-
|
|
2952
|
+
core.Internal.log.warn(`could not repair the patch store now. ${locked.message}`);
|
|
2953
2953
|
return {
|
|
2954
2954
|
status: "ok",
|
|
2955
2955
|
entries: read.entries
|
|
@@ -3460,7 +3460,7 @@ class ValOpsFS extends ValRouterCore.ValOps {
|
|
|
3460
3460
|
}
|
|
3461
3461
|
const res = await ValRouterCore.uploadRemoteFile(this.contentUrl, this.options.config.project, splitRemoteRefRes.bucket, splitRemoteRefRes.fileHash, ValRouterCore.getFileExt(splitRemoteRefRes.filePath), fileBuffer, auth);
|
|
3462
3462
|
if (!res.success) {
|
|
3463
|
-
|
|
3463
|
+
core.Internal.log.error("Failed to upload remote file", ref, res.error);
|
|
3464
3464
|
throw new Error(`Failed to upload remote file: ${ref}. ${res.error}`);
|
|
3465
3465
|
}
|
|
3466
3466
|
uploadedRemoteRefs.push(ref);
|
|
@@ -6440,7 +6440,7 @@ class ValOpsHttp extends ValRouterCore.ValOps {
|
|
|
6440
6440
|
}
|
|
6441
6441
|
};
|
|
6442
6442
|
} else {
|
|
6443
|
-
|
|
6443
|
+
core.Internal.log.error("Could not parse presigned auth nonce response. Error: " + zodValidationError.fromError(parsed.error));
|
|
6444
6444
|
return {
|
|
6445
6445
|
status: "error",
|
|
6446
6446
|
statusCode: 500,
|
|
@@ -6463,7 +6463,7 @@ class ValOpsHttp extends ValRouterCore.ValOps {
|
|
|
6463
6463
|
if ((_res$headers$get = res.headers.get("Content-Type")) !== null && _res$headers$get !== void 0 && _res$headers$get.includes("application/json")) {
|
|
6464
6464
|
const json = await res.json();
|
|
6465
6465
|
const message = internal.getErrorMessageFromUnknownJson(json, unknownErrorMessage);
|
|
6466
|
-
|
|
6466
|
+
core.Internal.log.error("Presigned auth nonce error:", message);
|
|
6467
6467
|
return {
|
|
6468
6468
|
status: "error",
|
|
6469
6469
|
statusCode: 500,
|
|
@@ -6472,7 +6472,7 @@ class ValOpsHttp extends ValRouterCore.ValOps {
|
|
|
6472
6472
|
}
|
|
6473
6473
|
};
|
|
6474
6474
|
}
|
|
6475
|
-
|
|
6475
|
+
core.Internal.log.error(unknownErrorMessage);
|
|
6476
6476
|
return {
|
|
6477
6477
|
status: "error",
|
|
6478
6478
|
statusCode: 500,
|
|
@@ -6481,7 +6481,7 @@ class ValOpsHttp extends ValRouterCore.ValOps {
|
|
|
6481
6481
|
}
|
|
6482
6482
|
};
|
|
6483
6483
|
} catch (e) {
|
|
6484
|
-
|
|
6484
|
+
core.Internal.log.error("Could not get presigned auth nonce (connection error?):", e);
|
|
6485
6485
|
return {
|
|
6486
6486
|
status: "error",
|
|
6487
6487
|
statusCode: 500,
|
|
@@ -6532,7 +6532,7 @@ class ValOpsHttp extends ValRouterCore.ValOps {
|
|
|
6532
6532
|
}
|
|
6533
6533
|
if (message) {
|
|
6534
6534
|
message = `Could not get patches: ${message}`;
|
|
6535
|
-
|
|
6535
|
+
core.Internal.log.error(message);
|
|
6536
6536
|
return {
|
|
6537
6537
|
type: "error",
|
|
6538
6538
|
error: {
|
|
@@ -6760,7 +6760,7 @@ class ValOpsHttp extends ValRouterCore.ValOps {
|
|
|
6760
6760
|
}
|
|
6761
6761
|
};
|
|
6762
6762
|
}).catch(e => {
|
|
6763
|
-
|
|
6763
|
+
core.Internal.log.error("Could not get nonce (connection error?):", e instanceof Error ? e.message : e.toString());
|
|
6764
6764
|
return {
|
|
6765
6765
|
status: "error",
|
|
6766
6766
|
error: {
|
|
@@ -6996,7 +6996,7 @@ class ValOpsHttp extends ValRouterCore.ValOps {
|
|
|
6996
6996
|
} : {})
|
|
6997
6997
|
};
|
|
6998
6998
|
}
|
|
6999
|
-
|
|
6999
|
+
core.Internal.log.error("Could not parse patches response. Error: " + zodValidationError.fromError(parsed.error));
|
|
7000
7000
|
return {
|
|
7001
7001
|
patches,
|
|
7002
7002
|
error: {
|
|
@@ -7004,7 +7004,7 @@ class ValOpsHttp extends ValRouterCore.ValOps {
|
|
|
7004
7004
|
}
|
|
7005
7005
|
};
|
|
7006
7006
|
}
|
|
7007
|
-
|
|
7007
|
+
core.Internal.log.error("Could not get patches. HTTP error: " + patchesRes.status + " " + patchesRes.statusText);
|
|
7008
7008
|
if (patchesRes.status === 401) {
|
|
7009
7009
|
return {
|
|
7010
7010
|
patches,
|
|
@@ -7020,7 +7020,7 @@ class ValOpsHttp extends ValRouterCore.ValOps {
|
|
|
7020
7020
|
}
|
|
7021
7021
|
};
|
|
7022
7022
|
} catch (err) {
|
|
7023
|
-
|
|
7023
|
+
core.Internal.log.error("Could not get patches (connection error):", err instanceof Error ? err.message : JSON.stringify(err));
|
|
7024
7024
|
return {
|
|
7025
7025
|
patches: [],
|
|
7026
7026
|
networkError: true,
|
|
@@ -7286,7 +7286,7 @@ class ValOpsHttp extends ValRouterCore.ValOps {
|
|
|
7286
7286
|
}
|
|
7287
7287
|
const file = filesRes.files[0];
|
|
7288
7288
|
if (filesRes.files.length > 1) {
|
|
7289
|
-
|
|
7289
|
+
core.Internal.log.error("Expected 1 file, got more:", filesRes.files);
|
|
7290
7290
|
}
|
|
7291
7291
|
if (!file) {
|
|
7292
7292
|
return null;
|
|
@@ -7301,15 +7301,15 @@ class ValOpsHttp extends ValRouterCore.ValOps {
|
|
|
7301
7301
|
remote
|
|
7302
7302
|
}]);
|
|
7303
7303
|
if (filesRes.error) {
|
|
7304
|
-
|
|
7304
|
+
core.Internal.log.error("Error getting file:", filePath, filesRes.error);
|
|
7305
7305
|
return null;
|
|
7306
7306
|
}
|
|
7307
7307
|
if (filesRes.errors) {
|
|
7308
|
-
|
|
7308
|
+
core.Internal.log.error("Failed while retrieving files", filePath, filesRes.errors);
|
|
7309
7309
|
}
|
|
7310
7310
|
const file = filesRes.files[0];
|
|
7311
7311
|
if (filesRes.files.length > 1) {
|
|
7312
|
-
|
|
7312
|
+
core.Internal.log.error("Expected 1 file, got more:", filesRes.files);
|
|
7313
7313
|
}
|
|
7314
7314
|
if (!file) {
|
|
7315
7315
|
return null;
|
|
@@ -8484,7 +8484,7 @@ function warnIfInsecureUrls(urls) {
|
|
|
8484
8484
|
for (const name of CREDENTIAL_BEARING_URLS) {
|
|
8485
8485
|
const warning = insecureUrlWarning(name, urls[name]);
|
|
8486
8486
|
if (warning) {
|
|
8487
|
-
|
|
8487
|
+
core.Internal.log.warn(warning);
|
|
8488
8488
|
}
|
|
8489
8489
|
}
|
|
8490
8490
|
}
|
|
@@ -8612,7 +8612,7 @@ const CLOCK_SKEW_LEEWAY_SECONDS = 60;
|
|
|
8612
8612
|
function failure(reason, message) {
|
|
8613
8613
|
// NOTE: deliberately never logs the token itself - it is a credential, and
|
|
8614
8614
|
// anything we print here ends up in the host's request logs.
|
|
8615
|
-
|
|
8615
|
+
core.Internal.log.debug(`Invalid JWT (${reason}): ${message}`);
|
|
8616
8616
|
return {
|
|
8617
8617
|
success: false,
|
|
8618
8618
|
reason,
|
|
@@ -8994,7 +8994,7 @@ function guardedLookup(lookup) {
|
|
|
8994
8994
|
// Server-side only. This is the half an operator needs to work out
|
|
8995
8995
|
// why a link check refused a URL, and the half a caller must not
|
|
8996
8996
|
// be given.
|
|
8997
|
-
|
|
8997
|
+
core.Internal.log.warn(`[val] link check refused ${hostname}: resolves to ${describeBlocked(reason)} (${entry.address})`);
|
|
8998
8998
|
callback(new Error(REFUSED_MESSAGE), "", 0);
|
|
8999
8999
|
return;
|
|
9000
9000
|
}
|
|
@@ -13524,7 +13524,7 @@ async function safeReadGit(cwd) {
|
|
|
13524
13524
|
async function findGitHead(currentDir, depth) {
|
|
13525
13525
|
const gitHeadPath = path.join(currentDir, ".git", "HEAD");
|
|
13526
13526
|
if (depth > 1000) {
|
|
13527
|
-
|
|
13527
|
+
core.Internal.log.error(`Reached max depth while scanning for .git folder. Current working dir: ${cwd}.`);
|
|
13528
13528
|
return {
|
|
13529
13529
|
commit: undefined,
|
|
13530
13530
|
branch: undefined
|
|
@@ -13561,7 +13561,7 @@ async function safeReadGit(cwd) {
|
|
|
13561
13561
|
try {
|
|
13562
13562
|
return findGitHead(cwd, 0);
|
|
13563
13563
|
} catch (err) {
|
|
13564
|
-
|
|
13564
|
+
core.Internal.log.error("Error while reading .git", err);
|
|
13565
13565
|
return {
|
|
13566
13566
|
commit: undefined,
|
|
13567
13567
|
branch: undefined
|
|
@@ -13642,7 +13642,7 @@ class ValModuleLoader {
|
|
|
13642
13642
|
}).code;
|
|
13643
13643
|
if (!this.disableCache) {
|
|
13644
13644
|
if (this.cacheSize > MAX_CACHE_SIZE) {
|
|
13645
|
-
|
|
13645
|
+
core.Internal.log.debug("Cache size exceeded, clearing cache");
|
|
13646
13646
|
this.cache = {};
|
|
13647
13647
|
this.cacheSize = 0;
|
|
13648
13648
|
}
|
|
@@ -15194,7 +15194,7 @@ async function replaySnapshot(snapshotDir) {
|
|
|
15194
15194
|
}
|
|
15195
15195
|
if (patchesRes.errors && patchesRes.errors.length > 0) {
|
|
15196
15196
|
for (const err of patchesRes.errors) {
|
|
15197
|
-
|
|
15197
|
+
core.Internal.log.error(`Snapshot patch could not be read: ${err.message}`);
|
|
15198
15198
|
}
|
|
15199
15199
|
}
|
|
15200
15200
|
const analysis = {
|
|
@@ -10,8 +10,8 @@ import path from 'path';
|
|
|
10
10
|
import fs from 'fs';
|
|
11
11
|
import vm from 'node:vm';
|
|
12
12
|
import { Module } from 'node:module';
|
|
13
|
-
import { r as resolveExistingJsonPath, f as findNestedJsonValuesRecords, v as validateJsonValuesEntries, i as isJsonValuesRootOp, a as rebaseContentOp, c as classifyJsonValuesOp, V as ValOps, b as bufferFromDataUrl, g as getFieldsForType, u as uploadRemoteFile, d as getFileExt, e as guessMimeTypeFromPath, h as createMetadataFromBuffer, j as ValOpsMemory, k as isHlsMasterPlaylist, s as sumHlsSegmentDurations, p as parseHlsMasterVariants, l as largestHlsVariant, m as fallbackRefOf, n as mapHlsUris, o as movedRemoteHost, q as needsHostCheck, t as rewriteRefHost, w as fallbackRemoteHost, x as checkRemoteFiles, y as ValServer, z as createValRequestHandler, A as getNewJsonEntryPaths, B as formatPatchSourceError } from './ValRouterCore-
|
|
14
|
-
export { I as InMemoryPatchStore, j as ValOpsMemory, C as askOncePerHost, c as classifyJsonValuesOp, B as formatPatchSourceError, d as getFileExt, D as getSettings, a as rebaseContentOp, u as uploadRemoteFile } from './ValRouterCore-
|
|
13
|
+
import { r as resolveExistingJsonPath, f as findNestedJsonValuesRecords, v as validateJsonValuesEntries, i as isJsonValuesRootOp, a as rebaseContentOp, c as classifyJsonValuesOp, V as ValOps, b as bufferFromDataUrl, g as getFieldsForType, u as uploadRemoteFile, d as getFileExt, e as guessMimeTypeFromPath, h as createMetadataFromBuffer, j as ValOpsMemory, k as isHlsMasterPlaylist, s as sumHlsSegmentDurations, p as parseHlsMasterVariants, l as largestHlsVariant, m as fallbackRefOf, n as mapHlsUris, o as movedRemoteHost, q as needsHostCheck, t as rewriteRefHost, w as fallbackRemoteHost, x as checkRemoteFiles, y as ValServer, z as createValRequestHandler, A as getNewJsonEntryPaths, B as formatPatchSourceError } from './ValRouterCore-ad10b6cf.esm.js';
|
|
14
|
+
export { I as InMemoryPatchStore, j as ValOpsMemory, C as askOncePerHost, c as classifyJsonValuesOp, B as formatPatchSourceError, d as getFileExt, D as getSettings, a as rebaseContentOp, u as uploadRemoteFile } from './ValRouterCore-ad10b6cf.esm.js';
|
|
15
15
|
import { createUIRequestHandler } from '@valbuild/ui/server';
|
|
16
16
|
import z$1, { z } from 'zod';
|
|
17
17
|
import { fromError } from 'zod-validation-error';
|
|
@@ -2515,7 +2515,7 @@ class ValOpsFS extends ValOps {
|
|
|
2515
2515
|
}
|
|
2516
2516
|
};
|
|
2517
2517
|
}
|
|
2518
|
-
|
|
2518
|
+
Internal.log.error("Could not parse presigned auth nonce response. Error: " + fromError(parsed.error));
|
|
2519
2519
|
return {
|
|
2520
2520
|
status: "error",
|
|
2521
2521
|
statusCode: 500,
|
|
@@ -2534,7 +2534,7 @@ class ValOpsFS extends ValOps {
|
|
|
2534
2534
|
};
|
|
2535
2535
|
}
|
|
2536
2536
|
const unknownErrorMessage = `Could not get presigned auth nonce. HTTP error: ${res.status} ${res.statusText}`;
|
|
2537
|
-
|
|
2537
|
+
Internal.log.error(unknownErrorMessage);
|
|
2538
2538
|
return {
|
|
2539
2539
|
status: "error",
|
|
2540
2540
|
statusCode: 500,
|
|
@@ -2543,7 +2543,7 @@ class ValOpsFS extends ValOps {
|
|
|
2543
2543
|
}
|
|
2544
2544
|
};
|
|
2545
2545
|
} catch (e) {
|
|
2546
|
-
|
|
2546
|
+
Internal.log.error("Could not get presigned auth nonce (connection error?):", e);
|
|
2547
2547
|
return {
|
|
2548
2548
|
status: "error",
|
|
2549
2549
|
statusCode: 500,
|
|
@@ -2648,7 +2648,7 @@ class ValOpsFS extends ValOps {
|
|
|
2648
2648
|
}
|
|
2649
2649
|
}
|
|
2650
2650
|
if (Date.now() - start > interval) {
|
|
2651
|
-
|
|
2651
|
+
Internal.log.debug("polling interval of patches exceeded");
|
|
2652
2652
|
}
|
|
2653
2653
|
if (stopPolling) {
|
|
2654
2654
|
return;
|
|
@@ -2677,7 +2677,7 @@ class ValOpsFS extends ValOps {
|
|
|
2677
2677
|
}
|
|
2678
2678
|
}
|
|
2679
2679
|
if (Date.now() - start > interval) {
|
|
2680
|
-
|
|
2680
|
+
Internal.log.debug("polling interval of files exceeded");
|
|
2681
2681
|
}
|
|
2682
2682
|
// Checked BEFORE rescheduling, as the patches-directory poller
|
|
2683
2683
|
// above does. Without it this walk goes on forever: the `finally`
|
|
@@ -2848,7 +2848,7 @@ class ValOpsFS extends ValOps {
|
|
|
2848
2848
|
async repairStore(read) {
|
|
2849
2849
|
const patchesDir = this.getPatchesDir();
|
|
2850
2850
|
for (const problem of describePatchStoreProblems(read.problems)) {
|
|
2851
|
-
|
|
2851
|
+
Internal.log.warn("something is wrong with the patch store.", problem);
|
|
2852
2852
|
}
|
|
2853
2853
|
const locked = await withPatchLock(this.getPatchLockFile(), {
|
|
2854
2854
|
ttlMs: 30_000,
|
|
@@ -2872,7 +2872,7 @@ class ValOpsFS extends ValOps {
|
|
|
2872
2872
|
}
|
|
2873
2873
|
for (const action of repairPatchStore(patchesDir, current)) {
|
|
2874
2874
|
if (action.type === "removed-unreadable-patch") {
|
|
2875
|
-
|
|
2875
|
+
Internal.log.warn(`removed the unpublished change ${action.name} because ${action.because}. See ${patchesDir}/${PATCH_REPAIR_LOG_FILE_NAME}.`);
|
|
2876
2876
|
// Queued rather than only logged: this is someone's unpublished
|
|
2877
2877
|
// work being thrown away, and a server console is not somewhere the
|
|
2878
2878
|
// person editing is looking.
|
|
@@ -2883,7 +2883,7 @@ class ValOpsFS extends ValOps {
|
|
|
2883
2883
|
} else if (action.type === "removed-orphan-directory") {
|
|
2884
2884
|
// Not queued. Nothing ever read this - it is a record whose log line
|
|
2885
2885
|
// never landed - so there is no edit to tell anyone about.
|
|
2886
|
-
|
|
2886
|
+
Internal.log.warn(`removed the unused patch directory ${action.name}.`);
|
|
2887
2887
|
}
|
|
2888
2888
|
}
|
|
2889
2889
|
const after = readPatchStore(patchesDir);
|
|
@@ -2903,7 +2903,7 @@ class ValOpsFS extends ValOps {
|
|
|
2903
2903
|
message: reset.error
|
|
2904
2904
|
};
|
|
2905
2905
|
}
|
|
2906
|
-
|
|
2906
|
+
Internal.log.warn(`the patch store could not be repaired, so it was reset. The previous contents are in ${reset.movedTo}.`);
|
|
2907
2907
|
return {
|
|
2908
2908
|
status: "ok",
|
|
2909
2909
|
entries: []
|
|
@@ -2913,7 +2913,7 @@ class ValOpsFS extends ValOps {
|
|
|
2913
2913
|
// Someone else holds the lock, quite possibly to run this same repair.
|
|
2914
2914
|
// Serving what was read is safe — those entries are the ones that ARE
|
|
2915
2915
|
// readable — and the next read tries again.
|
|
2916
|
-
|
|
2916
|
+
Internal.log.warn(`could not repair the patch store now. ${locked.message}`);
|
|
2917
2917
|
return {
|
|
2918
2918
|
status: "ok",
|
|
2919
2919
|
entries: read.entries
|
|
@@ -3424,7 +3424,7 @@ class ValOpsFS extends ValOps {
|
|
|
3424
3424
|
}
|
|
3425
3425
|
const res = await uploadRemoteFile(this.contentUrl, this.options.config.project, splitRemoteRefRes.bucket, splitRemoteRefRes.fileHash, getFileExt(splitRemoteRefRes.filePath), fileBuffer, auth);
|
|
3426
3426
|
if (!res.success) {
|
|
3427
|
-
|
|
3427
|
+
Internal.log.error("Failed to upload remote file", ref, res.error);
|
|
3428
3428
|
throw new Error(`Failed to upload remote file: ${ref}. ${res.error}`);
|
|
3429
3429
|
}
|
|
3430
3430
|
uploadedRemoteRefs.push(ref);
|
|
@@ -6404,7 +6404,7 @@ class ValOpsHttp extends ValOps {
|
|
|
6404
6404
|
}
|
|
6405
6405
|
};
|
|
6406
6406
|
} else {
|
|
6407
|
-
|
|
6407
|
+
Internal.log.error("Could not parse presigned auth nonce response. Error: " + fromError(parsed.error));
|
|
6408
6408
|
return {
|
|
6409
6409
|
status: "error",
|
|
6410
6410
|
statusCode: 500,
|
|
@@ -6427,7 +6427,7 @@ class ValOpsHttp extends ValOps {
|
|
|
6427
6427
|
if ((_res$headers$get = res.headers.get("Content-Type")) !== null && _res$headers$get !== void 0 && _res$headers$get.includes("application/json")) {
|
|
6428
6428
|
const json = await res.json();
|
|
6429
6429
|
const message = getErrorMessageFromUnknownJson(json, unknownErrorMessage);
|
|
6430
|
-
|
|
6430
|
+
Internal.log.error("Presigned auth nonce error:", message);
|
|
6431
6431
|
return {
|
|
6432
6432
|
status: "error",
|
|
6433
6433
|
statusCode: 500,
|
|
@@ -6436,7 +6436,7 @@ class ValOpsHttp extends ValOps {
|
|
|
6436
6436
|
}
|
|
6437
6437
|
};
|
|
6438
6438
|
}
|
|
6439
|
-
|
|
6439
|
+
Internal.log.error(unknownErrorMessage);
|
|
6440
6440
|
return {
|
|
6441
6441
|
status: "error",
|
|
6442
6442
|
statusCode: 500,
|
|
@@ -6445,7 +6445,7 @@ class ValOpsHttp extends ValOps {
|
|
|
6445
6445
|
}
|
|
6446
6446
|
};
|
|
6447
6447
|
} catch (e) {
|
|
6448
|
-
|
|
6448
|
+
Internal.log.error("Could not get presigned auth nonce (connection error?):", e);
|
|
6449
6449
|
return {
|
|
6450
6450
|
status: "error",
|
|
6451
6451
|
statusCode: 500,
|
|
@@ -6496,7 +6496,7 @@ class ValOpsHttp extends ValOps {
|
|
|
6496
6496
|
}
|
|
6497
6497
|
if (message) {
|
|
6498
6498
|
message = `Could not get patches: ${message}`;
|
|
6499
|
-
|
|
6499
|
+
Internal.log.error(message);
|
|
6500
6500
|
return {
|
|
6501
6501
|
type: "error",
|
|
6502
6502
|
error: {
|
|
@@ -6724,7 +6724,7 @@ class ValOpsHttp extends ValOps {
|
|
|
6724
6724
|
}
|
|
6725
6725
|
};
|
|
6726
6726
|
}).catch(e => {
|
|
6727
|
-
|
|
6727
|
+
Internal.log.error("Could not get nonce (connection error?):", e instanceof Error ? e.message : e.toString());
|
|
6728
6728
|
return {
|
|
6729
6729
|
status: "error",
|
|
6730
6730
|
error: {
|
|
@@ -6960,7 +6960,7 @@ class ValOpsHttp extends ValOps {
|
|
|
6960
6960
|
} : {})
|
|
6961
6961
|
};
|
|
6962
6962
|
}
|
|
6963
|
-
|
|
6963
|
+
Internal.log.error("Could not parse patches response. Error: " + fromError(parsed.error));
|
|
6964
6964
|
return {
|
|
6965
6965
|
patches,
|
|
6966
6966
|
error: {
|
|
@@ -6968,7 +6968,7 @@ class ValOpsHttp extends ValOps {
|
|
|
6968
6968
|
}
|
|
6969
6969
|
};
|
|
6970
6970
|
}
|
|
6971
|
-
|
|
6971
|
+
Internal.log.error("Could not get patches. HTTP error: " + patchesRes.status + " " + patchesRes.statusText);
|
|
6972
6972
|
if (patchesRes.status === 401) {
|
|
6973
6973
|
return {
|
|
6974
6974
|
patches,
|
|
@@ -6984,7 +6984,7 @@ class ValOpsHttp extends ValOps {
|
|
|
6984
6984
|
}
|
|
6985
6985
|
};
|
|
6986
6986
|
} catch (err) {
|
|
6987
|
-
|
|
6987
|
+
Internal.log.error("Could not get patches (connection error):", err instanceof Error ? err.message : JSON.stringify(err));
|
|
6988
6988
|
return {
|
|
6989
6989
|
patches: [],
|
|
6990
6990
|
networkError: true,
|
|
@@ -7250,7 +7250,7 @@ class ValOpsHttp extends ValOps {
|
|
|
7250
7250
|
}
|
|
7251
7251
|
const file = filesRes.files[0];
|
|
7252
7252
|
if (filesRes.files.length > 1) {
|
|
7253
|
-
|
|
7253
|
+
Internal.log.error("Expected 1 file, got more:", filesRes.files);
|
|
7254
7254
|
}
|
|
7255
7255
|
if (!file) {
|
|
7256
7256
|
return null;
|
|
@@ -7265,15 +7265,15 @@ class ValOpsHttp extends ValOps {
|
|
|
7265
7265
|
remote
|
|
7266
7266
|
}]);
|
|
7267
7267
|
if (filesRes.error) {
|
|
7268
|
-
|
|
7268
|
+
Internal.log.error("Error getting file:", filePath, filesRes.error);
|
|
7269
7269
|
return null;
|
|
7270
7270
|
}
|
|
7271
7271
|
if (filesRes.errors) {
|
|
7272
|
-
|
|
7272
|
+
Internal.log.error("Failed while retrieving files", filePath, filesRes.errors);
|
|
7273
7273
|
}
|
|
7274
7274
|
const file = filesRes.files[0];
|
|
7275
7275
|
if (filesRes.files.length > 1) {
|
|
7276
|
-
|
|
7276
|
+
Internal.log.error("Expected 1 file, got more:", filesRes.files);
|
|
7277
7277
|
}
|
|
7278
7278
|
if (!file) {
|
|
7279
7279
|
return null;
|
|
@@ -8448,7 +8448,7 @@ function warnIfInsecureUrls(urls) {
|
|
|
8448
8448
|
for (const name of CREDENTIAL_BEARING_URLS) {
|
|
8449
8449
|
const warning = insecureUrlWarning(name, urls[name]);
|
|
8450
8450
|
if (warning) {
|
|
8451
|
-
|
|
8451
|
+
Internal.log.warn(warning);
|
|
8452
8452
|
}
|
|
8453
8453
|
}
|
|
8454
8454
|
}
|
|
@@ -8576,7 +8576,7 @@ const CLOCK_SKEW_LEEWAY_SECONDS = 60;
|
|
|
8576
8576
|
function failure(reason, message) {
|
|
8577
8577
|
// NOTE: deliberately never logs the token itself - it is a credential, and
|
|
8578
8578
|
// anything we print here ends up in the host's request logs.
|
|
8579
|
-
|
|
8579
|
+
Internal.log.debug(`Invalid JWT (${reason}): ${message}`);
|
|
8580
8580
|
return {
|
|
8581
8581
|
success: false,
|
|
8582
8582
|
reason,
|
|
@@ -8958,7 +8958,7 @@ function guardedLookup(lookup) {
|
|
|
8958
8958
|
// Server-side only. This is the half an operator needs to work out
|
|
8959
8959
|
// why a link check refused a URL, and the half a caller must not
|
|
8960
8960
|
// be given.
|
|
8961
|
-
|
|
8961
|
+
Internal.log.warn(`[val] link check refused ${hostname}: resolves to ${describeBlocked(reason)} (${entry.address})`);
|
|
8962
8962
|
callback(new Error(REFUSED_MESSAGE), "", 0);
|
|
8963
8963
|
return;
|
|
8964
8964
|
}
|
|
@@ -13488,7 +13488,7 @@ async function safeReadGit(cwd) {
|
|
|
13488
13488
|
async function findGitHead(currentDir, depth) {
|
|
13489
13489
|
const gitHeadPath = path.join(currentDir, ".git", "HEAD");
|
|
13490
13490
|
if (depth > 1000) {
|
|
13491
|
-
|
|
13491
|
+
Internal.log.error(`Reached max depth while scanning for .git folder. Current working dir: ${cwd}.`);
|
|
13492
13492
|
return {
|
|
13493
13493
|
commit: undefined,
|
|
13494
13494
|
branch: undefined
|
|
@@ -13525,7 +13525,7 @@ async function safeReadGit(cwd) {
|
|
|
13525
13525
|
try {
|
|
13526
13526
|
return findGitHead(cwd, 0);
|
|
13527
13527
|
} catch (err) {
|
|
13528
|
-
|
|
13528
|
+
Internal.log.error("Error while reading .git", err);
|
|
13529
13529
|
return {
|
|
13530
13530
|
commit: undefined,
|
|
13531
13531
|
branch: undefined
|
|
@@ -13606,7 +13606,7 @@ class ValModuleLoader {
|
|
|
13606
13606
|
}).code;
|
|
13607
13607
|
if (!this.disableCache) {
|
|
13608
13608
|
if (this.cacheSize > MAX_CACHE_SIZE) {
|
|
13609
|
-
|
|
13609
|
+
Internal.log.debug("Cache size exceeded, clearing cache");
|
|
13610
13610
|
this.cache = {};
|
|
13611
13611
|
this.cacheSize = 0;
|
|
13612
13612
|
}
|
|
@@ -15158,7 +15158,7 @@ async function replaySnapshot(snapshotDir) {
|
|
|
15158
15158
|
}
|
|
15159
15159
|
if (patchesRes.errors && patchesRes.errors.length > 0) {
|
|
15160
15160
|
for (const err of patchesRes.errors) {
|
|
15161
|
-
|
|
15161
|
+
Internal.log.error(`Snapshot patch could not be read: ${err.message}`);
|
|
15162
15162
|
}
|
|
15163
15163
|
}
|
|
15164
15164
|
const analysis = {
|
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
],
|
|
28
28
|
"exports": true
|
|
29
29
|
},
|
|
30
|
-
"version": "0.148.
|
|
30
|
+
"version": "0.148.2",
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@prettier/sync": "^0.6.1",
|
|
33
33
|
"@types/jest": "^30.0.0",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"typescript": "^6.0.3",
|
|
42
42
|
"zod": "^4.4.3",
|
|
43
43
|
"zod-validation-error": "^5.0.0",
|
|
44
|
-
"@valbuild/core": "0.148.
|
|
45
|
-
"@valbuild/shared": "0.148.
|
|
46
|
-
"@valbuild/ui": "0.148.
|
|
44
|
+
"@valbuild/core": "0.148.2",
|
|
45
|
+
"@valbuild/shared": "0.148.2",
|
|
46
|
+
"@valbuild/ui": "0.148.2"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": "^20.19.0 || >=22"
|