@holo-js/kernel 0.4.3 → 0.5.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.
@@ -1 +1 @@
1
- 731be2ee12b49399911c6874cccfaa76770cab20b0a7851445e5a16a73368102
1
+ 486c1f5896690163f7e182854d2055414c2b979e7f627235bb12b934f1cb4c5e
@@ -14,18 +14,19 @@ function isUnreported(error, exceptions) {
14
14
  return exceptions.dontReport?.some((errorClass) => error instanceof errorClass) ?? false;
15
15
  }
16
16
  function deliver(exceptions, error, context) {
17
- if (exceptions && isUnreported(error, exceptions)) return;
17
+ if (exceptions && isUnreported(error, exceptions)) return Promise.resolve();
18
18
  if (!exceptions?.report) {
19
19
  console.error(describeContext(context), error);
20
- return;
20
+ return Promise.resolve();
21
21
  }
22
- void Promise.resolve(exceptions.report(error, context)).catch((reporterError) => logReporterFailure(error, context, reporterError));
22
+ return Promise.resolve(exceptions.report(error, context)).catch((reporterError) => logReporterFailure(error, context, reporterError));
23
23
  }
24
24
  function reportWith(exceptions, error, context) {
25
25
  try {
26
- deliver(exceptions, error, context);
26
+ return deliver(exceptions, error, context);
27
27
  } catch (reporterError) {
28
28
  logReporterFailure(error, context, reporterError);
29
+ return Promise.resolve();
29
30
  }
30
31
  }
31
32
  function configure(exceptions) {
@@ -35,11 +36,16 @@ function configure(exceptions) {
35
36
  return previous;
36
37
  }
37
38
  function reportError(error, context) {
38
- reportWith(errorReportingState().exceptions, error, context);
39
+ void reportWith(errorReportingState().exceptions, error, context);
40
+ }
41
+ function reportErrorAndWait(error, context) {
42
+ return reportWith(errorReportingState().exceptions, error, context);
39
43
  }
40
44
  function captureErrorReporter() {
41
45
  const exceptions = errorReportingState().exceptions;
42
- return (error, context) => reportWith(exceptions, error, context);
46
+ return (error, context) => {
47
+ void reportWith(exceptions, error, context);
48
+ };
43
49
  }
44
50
  var errorReportingInternals = {
45
51
  configure
@@ -47,6 +53,7 @@ var errorReportingInternals = {
47
53
 
48
54
  export {
49
55
  reportError,
56
+ reportErrorAndWait,
50
57
  captureErrorReporter,
51
58
  errorReportingInternals
52
59
  };
@@ -10,10 +10,11 @@ interface HoloExceptionsConfig {
10
10
  type HoloErrorReporter = (error: unknown, context: HoloErrorReportContext) => void;
11
11
  declare function configure(exceptions: HoloExceptionsConfig | undefined): HoloExceptionsConfig | undefined;
12
12
  declare function reportError(error: unknown, context: HoloErrorReportContext): void;
13
+ declare function reportErrorAndWait(error: unknown, context: HoloErrorReportContext): Promise<void>;
13
14
  declare function captureErrorReporter(): HoloErrorReporter;
14
15
  declare const errorReportingInternals: {
15
16
  configure: typeof configure;
16
17
  };
17
18
 
18
- export { captureErrorReporter, errorReportingInternals, reportError };
19
+ export { captureErrorReporter, errorReportingInternals, reportError, reportErrorAndWait };
19
20
  export type { HoloErrorReportContext, HoloErrorReporter, HoloExceptionsConfig, HoloUnreportedErrorClass };
@@ -1,10 +1,12 @@
1
1
  import {
2
2
  captureErrorReporter,
3
3
  errorReportingInternals,
4
- reportError
5
- } from "./chunk-QQ5YD7HZ.mjs";
4
+ reportError,
5
+ reportErrorAndWait
6
+ } from "./chunk-4NL655I5.mjs";
6
7
  export {
7
8
  captureErrorReporter,
8
9
  errorReportingInternals,
9
- reportError
10
+ reportError,
11
+ reportErrorAndWait
10
12
  };
package/dist/index.d.ts CHANGED
@@ -408,6 +408,10 @@ declare const DEFAULT_REDIS_DB = 0;
408
408
  declare const holoRedisDefaults: Readonly<NormalizedHoloRedisConfig>;
409
409
  declare function resolveNormalizedRedisConnection(config: NormalizedHoloRedisConfig, connectionName: string, label: string): NormalizedHoloRedisConnectionConfig;
410
410
  declare function normalizeRedisConfig(config?: HoloRedisConfig): NormalizedHoloRedisConfig;
411
+ declare function withoutDatabasePath(url: string): string;
412
+ declare const redisUrlInternals: Readonly<{
413
+ withoutDatabasePath: typeof withoutDatabasePath;
414
+ }>;
411
415
  declare function defineRedisConfig<TConfig extends HoloRedisConfig>(config: TConfig): Readonly<TConfig>;
412
416
 
413
417
  type HoloRequestHeaders = Headers | ReadonlyArray<readonly [string, string]> | Record<string, string | readonly string[] | undefined> | {
@@ -503,5 +507,5 @@ declare const responseCookieInternals: {
503
507
  parseResponseCookie: typeof parseResponseCookie;
504
508
  };
505
509
 
506
- export { COOKIE_WRITE_UNAVAILABLE, DEFAULT_HOLO_PROJECT_PATHS, DEFAULT_REDIS_CONNECTION, DEFAULT_REDIS_DB, DEFAULT_REDIS_HOST, DEFAULT_REDIS_PORT, HOLO_PROJECT_PREPARE_API_VERSION, HoloProjectPrepareError, HoloRequestUrlError, RuntimeLifecycle, cookieEncryptionInternals, createCookieWriteUnavailableError, createRuntimeLifecycle, defineHoloPlugin, defineHoloProject, defineHoloProjectPreparer, defineRedisConfig, holoRedisDefaults, loadHoloPluginBootModules, loadHoloPluginContributionModules, loadHoloPluginDefinitions, localStoragePathInternals, normalizeHoloPluginDefinition, normalizeHoloProjectConfig, normalizeRedisConfig, requestUrlInternals, resolveHoloPluginModulePath, resolveNormalizedRedisConnection, resolveRequestUrl, resolveRetryBackoffSeconds, responseCookieInternals, sameOriginRedirectPath };
510
+ export { COOKIE_WRITE_UNAVAILABLE, DEFAULT_HOLO_PROJECT_PATHS, DEFAULT_REDIS_CONNECTION, DEFAULT_REDIS_DB, DEFAULT_REDIS_HOST, DEFAULT_REDIS_PORT, HOLO_PROJECT_PREPARE_API_VERSION, HoloProjectPrepareError, HoloRequestUrlError, RuntimeLifecycle, cookieEncryptionInternals, createCookieWriteUnavailableError, createRuntimeLifecycle, defineHoloPlugin, defineHoloProject, defineHoloProjectPreparer, defineRedisConfig, holoRedisDefaults, loadHoloPluginBootModules, loadHoloPluginContributionModules, loadHoloPluginDefinitions, localStoragePathInternals, normalizeHoloPluginDefinition, normalizeHoloProjectConfig, normalizeRedisConfig, redisUrlInternals, requestUrlInternals, resolveHoloPluginModulePath, resolveNormalizedRedisConnection, resolveRequestUrl, resolveRetryBackoffSeconds, responseCookieInternals, sameOriginRedirectPath };
507
511
  export type { ConcurrencyOptions, DatabaseLogger, HoloConnectionAddressProvider, HoloDatabaseDriver, HoloForwardedRequest, HoloForwardedRequestResolver, HoloGeneratedProjectArtifact, HoloManagedProjectArtifact, HoloPluginBroadcastContributions, HoloPluginCacheContributions, HoloPluginCliContributions, HoloPluginConfigContributions, HoloPluginContributions, HoloPluginDefinition, HoloPluginDependencyContributions, HoloPluginFrameworkContribution, HoloPluginFrameworkTsconfigKind, HoloPluginMailContributions, HoloPluginMigrationContributions, HoloPluginNotificationContributions, HoloPluginPackageManager, HoloPluginProjectContributions, HoloPluginQueueContributions, HoloPluginRuntimeContributions, HoloPluginRuntimeMapContributions, HoloPluginRuntimeModule, HoloProjectArtifactContents, HoloProjectConfig, HoloProjectConnectionConfig, HoloProjectDatabaseConfig, HoloProjectPaths, HoloProjectPrepareChange, HoloProjectPrepareChangeKind, HoloProjectPrepareCommand, HoloProjectPrepareContext, HoloProjectPrepareDiagnostic, HoloProjectPrepareFailure, HoloProjectPrepareFramework, HoloProjectPrepareFullRetry, HoloProjectPrepareLogger, HoloProjectPrepareModule, HoloProjectPreparePlugin, HoloProjectPrepareResult, HoloProjectPrepareRun, HoloProjectPrepareSource, HoloProjectPrepareWatch, HoloProjectPreparedResult, HoloProjectPreparer, HoloRedisClusterNodeConfig, HoloRedisConfig, HoloRedisConnectionConfig, HoloRequestHeaders, HoloRequestInput, LoadedHoloPluginDefinition, MigrationErrorLog, MigrationStartLog, MigrationSuccessLog, NormalizedHoloProjectConfig, NormalizedHoloRedisClusterNodeConfig, NormalizedHoloRedisConfig, NormalizedHoloRedisConnectionConfig, PluginLoadOptions, QueryErrorLog, QueryStartLog, QuerySuccessLog, RuntimeContribution, RuntimeLifecycleContext, SeederErrorLog, SeederStartLog, SeederSuccessLog, TransactionLog, TransactionScopeKind };
package/dist/index.mjs CHANGED
@@ -437,6 +437,12 @@ function normalizeRedisConfig(config = {}) {
437
437
  connections
438
438
  });
439
439
  }
440
+ function withoutDatabasePath(url) {
441
+ const parsed = new URL(url);
442
+ parsed.pathname = "";
443
+ return parsed.toString();
444
+ }
445
+ var redisUrlInternals = Object.freeze({ withoutDatabasePath });
440
446
  function defineRedisConfig(config) {
441
447
  return Object.freeze({ ...config });
442
448
  }
@@ -788,6 +794,7 @@ export {
788
794
  readBoundedRequestFormData,
789
795
  readBoundedRequestJson,
790
796
  readBoundedRequestText,
797
+ redisUrlInternals,
791
798
  requestBodyInternals,
792
799
  requestBodyLimitFor,
793
800
  requestUrlInternals,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  reportError
3
- } from "./chunk-QQ5YD7HZ.mjs";
3
+ } from "./chunk-4NL655I5.mjs";
4
4
 
5
5
  // src/managedResources.ts
6
6
  import { isDeepStrictEqual } from "util";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holo-js/kernel",
3
- "version": "0.4.3",
3
+ "version": "0.5.0",
4
4
  "description": "Holo-JS Framework - contracts, plugins, and runtime lifecycle",
5
5
  "type": "module",
6
6
  "license": "MIT",