@valbuild/server 0.148.1 → 0.148.3

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.
@@ -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-42772c21.cjs.prod.js');
15
+ var ValRouterCore = require('./ValRouterCore-dfb7b578.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
- console.error("Could not parse presigned auth nonce response. Error: " + zodValidationError.fromError(parsed.error));
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
- console.error(unknownErrorMessage);
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
- console.error("Could not get presigned auth nonce (connection error?):", e);
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
- console.warn("Val: polling interval of patches exceeded");
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
- console.warn("Val: polling interval of files exceeded");
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
- console.warn("Val: something is wrong with the patch store.", problem);
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
- console.warn(`Val: removed the unpublished change ${action.name} because ${action.because}. See ${patchesDir}/${PATCH_REPAIR_LOG_FILE_NAME}.`);
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
- console.warn(`Val: removed the unused patch directory ${action.name}.`);
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
- console.warn(`Val: the patch store could not be repaired, so it was reset. The previous contents are in ${reset.movedTo}.`);
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
- console.warn(`Val: could not repair the patch store now. ${locked.message}`);
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
- console.error("Failed to upload remote file", ref, res.error);
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
- console.error("Could not parse presigned auth nonce response. Error: " + zodValidationError.fromError(parsed.error));
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
- console.error("Presigned auth nonce error:", message);
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
- console.error(unknownErrorMessage);
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
- console.error("Could not get presigned auth nonce (connection error?):", e);
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
- console.error(message);
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
- console.error("Could not get nonce (connection error?):", e instanceof Error ? e.message : e.toString());
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
- console.error("Could not parse patches response. Error: " + zodValidationError.fromError(parsed.error));
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
- console.error("Could not get patches. HTTP error: " + patchesRes.status + " " + patchesRes.statusText);
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
- console.error("Could not get patches (connection error):", err instanceof Error ? err.message : JSON.stringify(err));
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
- console.error("Expected 1 file, got more:", filesRes.files);
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
- console.error("Error getting file:", filePath, filesRes.error);
7304
+ core.Internal.log.error("Error getting file:", filePath, filesRes.error);
7305
7305
  return null;
7306
7306
  }
7307
7307
  if (filesRes.errors) {
7308
- console.error("Failed while retrieving files", filePath, filesRes.errors);
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
- console.error("Expected 1 file, got more:", filesRes.files);
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
- console.warn(warning);
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
- console.debug(`Invalid JWT (${reason}): ${message}`);
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
- console.warn(`[val] link check refused ${hostname}: resolves to ${describeBlocked(reason)} (${entry.address})`);
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
- console.error(`Reached max depth while scanning for .git folder. Current working dir: ${cwd}.`);
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
- console.error("Error while reading .git", err);
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
- console.warn("Cache size exceeded, clearing cache");
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
- console.error(`Snapshot patch could not be read: ${err.message}`);
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-7ca3dc68.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-7ca3dc68.esm.js';
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-2579e663.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-2579e663.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
- console.error("Could not parse presigned auth nonce response. Error: " + fromError(parsed.error));
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
- console.error(unknownErrorMessage);
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
- console.error("Could not get presigned auth nonce (connection error?):", e);
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
- console.warn("Val: polling interval of patches exceeded");
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
- console.warn("Val: polling interval of files exceeded");
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
- console.warn("Val: something is wrong with the patch store.", problem);
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
- console.warn(`Val: removed the unpublished change ${action.name} because ${action.because}. See ${patchesDir}/${PATCH_REPAIR_LOG_FILE_NAME}.`);
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
- console.warn(`Val: removed the unused patch directory ${action.name}.`);
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
- console.warn(`Val: the patch store could not be repaired, so it was reset. The previous contents are in ${reset.movedTo}.`);
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
- console.warn(`Val: could not repair the patch store now. ${locked.message}`);
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
- console.error("Failed to upload remote file", ref, res.error);
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
- console.error("Could not parse presigned auth nonce response. Error: " + fromError(parsed.error));
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
- console.error("Presigned auth nonce error:", message);
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
- console.error(unknownErrorMessage);
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
- console.error("Could not get presigned auth nonce (connection error?):", e);
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
- console.error(message);
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
- console.error("Could not get nonce (connection error?):", e instanceof Error ? e.message : e.toString());
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
- console.error("Could not parse patches response. Error: " + fromError(parsed.error));
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
- console.error("Could not get patches. HTTP error: " + patchesRes.status + " " + patchesRes.statusText);
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
- console.error("Could not get patches (connection error):", err instanceof Error ? err.message : JSON.stringify(err));
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
- console.error("Expected 1 file, got more:", filesRes.files);
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
- console.error("Error getting file:", filePath, filesRes.error);
7268
+ Internal.log.error("Error getting file:", filePath, filesRes.error);
7269
7269
  return null;
7270
7270
  }
7271
7271
  if (filesRes.errors) {
7272
- console.error("Failed while retrieving files", filePath, filesRes.errors);
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
- console.error("Expected 1 file, got more:", filesRes.files);
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
- console.warn(warning);
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
- console.debug(`Invalid JWT (${reason}): ${message}`);
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
- console.warn(`[val] link check refused ${hostname}: resolves to ${describeBlocked(reason)} (${entry.address})`);
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
- console.error(`Reached max depth while scanning for .git folder. Current working dir: ${cwd}.`);
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
- console.error("Error while reading .git", err);
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
- console.warn("Cache size exceeded, clearing cache");
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
- console.error(`Snapshot patch could not be read: ${err.message}`);
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.1",
30
+ "version": "0.148.3",
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.0",
45
- "@valbuild/shared": "0.148.0",
46
- "@valbuild/ui": "0.148.1"
44
+ "@valbuild/core": "0.148.2",
45
+ "@valbuild/shared": "0.148.3",
46
+ "@valbuild/ui": "0.148.3"
47
47
  },
48
48
  "engines": {
49
49
  "node": "^20.19.0 || >=22"