@hkdigital/lib-core 0.4.70 → 0.4.71

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.
@@ -465,7 +465,7 @@ export function parseFunctionName(frame) {
465
465
  }
466
466
 
467
467
  // Strip Firefox function naming artifacts like "</timeoutId<"
468
- functionName = functionName.replace(/<\/[^<>]*</g, '');
468
+ functionName = functionName.replace(/<\/[^<>]*</, '');
469
469
 
470
470
  return functionName;
471
471
  }
@@ -387,6 +387,7 @@ export async function httpRequest(options) {
387
387
  if (!isTestEnv) {
388
388
  if (cachedResponse) {
389
389
  console.debug(`http:cache-hit [${url.pathname}]`);
390
+ console.debug(`cached-response has body: ${!!cachedResponse.body}`);
390
391
  return cachedResponse;
391
392
  } else {
392
393
  console.debug(`http:cache-miss [${url.pathname}]`);
@@ -5,7 +5,7 @@
5
5
  // AbortError,
6
6
  // TimeoutError,
7
7
  // TypeOrValueError
8
- // } from '$lib/errors/index.js';
8
+ // } from '../../errors/index.js';
9
9
 
10
10
  // import { setRequestHeaders } from './headers.js';
11
11
  // import { getErrorFromResponse } from './errors.js';
@@ -245,6 +245,7 @@ export function loadResponseBuffer(response, onProgress) {
245
245
  let bytesLoaded = 0;
246
246
 
247
247
  if (onProgress /*&& size*/) {
248
+ console.debug(`loadResponseBuffer:initial-progress size=${size}`);
248
249
  onProgress({ bytesLoaded, size });
249
250
  }
250
251
 
@@ -274,6 +275,7 @@ export function loadResponseBuffer(response, onProgress) {
274
275
  chunks.push(value);
275
276
 
276
277
  if (onProgress /*&& size*/) {
278
+ console.debug(`loadResponseBuffer:chunk-progress ${bytesLoaded}/${size}`);
277
279
  onProgress({ bytesLoaded, size });
278
280
  }
279
281
  }
@@ -19,6 +19,8 @@ import {
19
19
  import { waitForState } from '../../../util/svelte.js';
20
20
  import { TimeoutError } from '../../../generic/errors.js';
21
21
 
22
+ const MAX_TIMEOUT_MS = 120000;
23
+
22
24
  /** @typedef {import('./typedef.js').SceneLoadingProgress} SceneLoadingProgress */
23
25
 
24
26
  /**
@@ -223,9 +225,6 @@ export default class SceneBase {
223
225
  * Object with promise that resolves when loaded and abort function
224
226
  */
225
227
  preload({ timeoutMs = 10000, onProgress } = {}) {
226
- /** @type {number|NodeJS.Timeout|null} */
227
- let timeoutId = null;
228
-
229
228
  /** @type {number|NodeJS.Timeout|null} */
230
229
  let progressIntervalId = null;
231
230
 
@@ -281,8 +280,8 @@ export default class SceneBase {
281
280
  this.load();
282
281
 
283
282
  // Wait for completion with timeout
284
- // 0 means no timeout, but we still need a reasonable value for waitForState
285
- const waitTimeout = timeoutMs > 0 ? timeoutMs : 120000;
283
+ // 0 means no timeout, but actually we use max timeout
284
+ const waitTimeout = timeoutMs > 0 ? timeoutMs : MAX_TIMEOUT_MS;
286
285
 
287
286
  waitForState(() => {
288
287
  return (
@@ -307,6 +307,7 @@ export default class NetworkLoader {
307
307
  const { bufferPromise, abort: abortLoadBody } = loadResponseBuffer(
308
308
  response,
309
309
  ({ bytesLoaded, size }) => {
310
+ console.debug(`loader:progress [${this._url}] ${bytesLoaded}/${size} bytes`);
310
311
  this._bytesLoaded = bytesLoaded;
311
312
  this._size = size;
312
313
  }
@@ -57,7 +57,7 @@ export type ServiceManagerConfig = {
57
57
  * Result of health check for all services
58
58
  */
59
59
  export type HealthCheckResult = {
60
- [x: string]: import("../service-base/typedef.js").HealthStatus;
60
+ [x: string]: import("../typedef.js").HealthStatus;
61
61
  };
62
62
  /**
63
63
  * Service class constructor type
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-core",
3
- "version": "0.4.70",
3
+ "version": "0.4.71",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"
@@ -93,46 +93,46 @@
93
93
  "vite-imagetools": "^8.0.0"
94
94
  },
95
95
  "devDependencies": {
96
- "@eslint/js": "^9.33.0",
97
- "@playwright/test": "^1.54.2",
96
+ "@eslint/js": "^9.37.0",
97
+ "@playwright/test": "^1.56.0",
98
98
  "@skeletonlabs/skeleton": "3.1.7",
99
99
  "@skeletonlabs/skeleton-svelte": "1.3.1",
100
100
  "@steeze-ui/heroicons": "^2.4.2",
101
- "@sveltejs/adapter-auto": "^6.1.0",
102
- "@sveltejs/package": "^2.4.1",
103
- "@sveltejs/vite-plugin-svelte": "^6.1.1",
104
- "@tailwindcss/typography": "^0.5.16",
101
+ "@sveltejs/adapter-auto": "^6.1.1",
102
+ "@sveltejs/package": "^2.5.4",
103
+ "@sveltejs/vite-plugin-svelte": "^6.2.1",
104
+ "@tailwindcss/postcss": "^4.1.14",
105
+ "@tailwindcss/typography": "^0.5.19",
105
106
  "@testing-library/svelte": "^5.2.8",
106
107
  "@testing-library/user-event": "^14.6.1",
107
- "@tailwindcss/postcss": "^4.1.11",
108
108
  "@types/eslint": "^9.6.1",
109
- "@types/node": "^24.2.1",
109
+ "@types/node": "^24.7.2",
110
110
  "autoprefixer": "^10.4.21",
111
- "eslint": "^9.33.0",
111
+ "eslint": "^9.37.0",
112
112
  "eslint-config-prettier": "^10.1.8",
113
113
  "eslint-plugin-import": "^2.32.0",
114
- "eslint-plugin-svelte": "^3.11.0",
115
- "fake-indexeddb": "^6.1.0",
116
- "globals": "^16.3.0",
114
+ "eslint-plugin-svelte": "^3.12.4",
115
+ "fake-indexeddb": "^6.2.3",
116
+ "globals": "^16.4.0",
117
117
  "jsdom": "^26.1.0",
118
- "jsonwebtoken": "^9.0.0",
119
- "npm-check-updates": "^18.0.2",
118
+ "jsonwebtoken": "^9.0.2",
119
+ "npm-check-updates": "^18.3.1",
120
120
  "npm-run-all": "^4.1.5",
121
- "pino": "^9.8.0",
122
- "pino-pretty": "^13.1.1",
121
+ "pino": "^9.13.1",
122
+ "pino-pretty": "^13.1.2",
123
123
  "postcss": "^8.5.6",
124
124
  "postcss-mixins": "^12.1.2",
125
125
  "prettier": "^3.6.2",
126
126
  "prettier-plugin-svelte": "^3.4.0",
127
127
  "prettier-plugin-tailwindcss": "^0.6.14",
128
- "publint": "^0.3.12",
128
+ "publint": "^0.3.14",
129
129
  "standardized-audio-context-mock": "^9.7.24",
130
- "svelte": "^5.38.1",
131
- "svelte-check": "^4.3.1",
130
+ "svelte": "^5.39.11",
131
+ "svelte-check": "^4.3.3",
132
132
  "svelte-preprocess": "^6.0.3",
133
- "tailwindcss": "^4.1.11",
134
- "typescript": "^5.9.2",
135
- "vite": "^7.1.2",
133
+ "tailwindcss": "^4.1.14",
134
+ "typescript": "^5.9.3",
135
+ "vite": "^7.1.9",
136
136
  "vite-imagetools": "^8.0.0",
137
137
  "vitest": "^3.2.4"
138
138
  }