@holo-js/forms 0.3.22 → 0.3.24

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/dist/index.mjs CHANGED
@@ -205,8 +205,7 @@ function isNextHeadersModule(value) {
205
205
  }
206
206
  async function importNextHeadersModule() {
207
207
  try {
208
- const runtime = globalThis;
209
- const module = runtime.__holoFormsNextHeadersImport__ ? await runtime.__holoFormsNextHeadersImport__() : await import(
208
+ const module = await import(
210
209
  /* @vite-ignore */
211
210
  /* webpackIgnore: true */
212
211
  nextHeadersModuleSpecifier
@@ -420,7 +419,7 @@ async function safeParse(input, schemaDefinition, options = {}) {
420
419
  if (usesSecurityOptions) {
421
420
  const request = normalizedRequestInput;
422
421
  try {
423
- const { loadSecurityModule } = await import("./security-ODATEIFI.mjs");
422
+ const { loadSecurityModule } = await import("./security-YE5UGG47.mjs");
424
423
  const security = await loadSecurityModule();
425
424
  const inspection = await safeParseInput(request.clone(), schemaDefinition);
426
425
  const throttleValues = inspection.valid ? inspection.data : inspection.values;
@@ -430,7 +429,7 @@ async function safeParse(input, schemaDefinition, options = {}) {
430
429
  values: throttleValues
431
430
  });
432
431
  } catch (error) {
433
- const { formsSecurityInternals } = await import("./security-ODATEIFI.mjs");
432
+ const { formsSecurityInternals } = await import("./security-YE5UGG47.mjs");
434
433
  if (formsSecurityInternals.isRootSecurityError(error)) {
435
434
  if (validatedSubmission) {
436
435
  return createFailedSubmission(
@@ -22,21 +22,8 @@ import {
22
22
 
23
23
  // src/client-security.ts
24
24
  var securityClientModulePromise;
25
- async function importSecurityClientModule() {
26
- if (typeof process !== "undefined" && process.env && process.env.VITEST) {
27
- return await import(
28
- /* @vite-ignore */
29
- "@holo-js/security/client"
30
- );
31
- }
32
- return await import("@holo-js/security/client");
33
- }
34
25
  async function loadSecurityClientModule() {
35
- const runtime = globalThis;
36
- if (runtime.__holoFormsSecurityClientModule__) {
37
- return runtime.__holoFormsSecurityClientModule__;
38
- }
39
- securityClientModulePromise ??= (runtime.__holoFormsSecurityClientImport__ ? runtime.__holoFormsSecurityClientImport__() : importSecurityClientModule()).then((module) => module).catch(async (error) => {
26
+ securityClientModulePromise ??= import("@holo-js/security/client").catch((error) => {
40
27
  securityClientModulePromise = void 0;
41
28
  if (isMissingOptionalPackageError(error)) {
42
29
  throw createMissingSecurityPackageError();
@@ -373,6 +360,7 @@ var FormClientState = class {
373
360
  };
374
361
 
375
362
  // src/internal/client.ts
363
+ import { normalizeHoloHttpError } from "@holo-js/kernel/http-errors";
376
364
  var browserFormSubmitSymbol = /* @__PURE__ */ Symbol("browserFormSubmit");
377
365
  var clientSubmitControlFlowErrors = /* @__PURE__ */ new WeakSet();
378
366
  function isBrowserFormSubmitter(value) {
@@ -816,7 +804,7 @@ function createFormClient(schemaDefinition, options = {}) {
816
804
  throw error;
817
805
  }
818
806
  return applyServerState(
819
- validationExceptionToFailure(error, localSubmission.data) ?? createTransportFailure(localSubmission.data),
807
+ validationExceptionToFailure(error, localSubmission.data) ?? createTransportFailure(localSubmission.data, normalizeHoloHttpError(error)?.status),
820
808
  submissionSequence
821
809
  );
822
810
  }
@@ -8,21 +8,8 @@ import "./chunk-OFPH5LBY.mjs";
8
8
 
9
9
  // src/security.ts
10
10
  var securityModulePromise;
11
- async function importSecurityModule() {
12
- if (typeof process !== "undefined" && process.env && process.env.VITEST) {
13
- return await import(
14
- /* @vite-ignore */
15
- "@holo-js/security"
16
- );
17
- }
18
- return await import("@holo-js/security");
19
- }
20
11
  async function loadSecurityModule() {
21
- const runtime = globalThis;
22
- if (runtime.__holoFormsSecurityModule__) {
23
- return runtime.__holoFormsSecurityModule__;
24
- }
25
- securityModulePromise ??= (runtime.__holoFormsSecurityImport__ ? runtime.__holoFormsSecurityImport__() : importSecurityModule()).then((module) => module).catch(async (error) => {
12
+ securityModulePromise ??= import("@holo-js/security").catch((error) => {
26
13
  securityModulePromise = void 0;
27
14
  if (isMissingOptionalPackageError(error)) {
28
15
  throw createMissingSecurityPackageError();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holo-js/forms",
3
- "version": "0.3.22",
3
+ "version": "0.3.24",
4
4
  "description": "Holo-JS Framework - forms-first validation and submission contracts",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -25,13 +25,14 @@
25
25
  "build": "tsup",
26
26
  "stub": "tsup",
27
27
  "typecheck": "tsc -p tsconfig.json --noEmit",
28
- "test": "vitest --run"
28
+ "test": "vitest --run && node --test --test-concurrency=3 ../../tests/forms-native-browser.mjs ../../tests/forms-native-packages.mjs"
29
29
  },
30
30
  "dependencies": {
31
- "@holo-js/validation": "^0.3.22"
31
+ "@holo-js/kernel": "^0.3.24",
32
+ "@holo-js/validation": "^0.3.24"
32
33
  },
33
34
  "peerDependencies": {
34
- "@holo-js/security": "^0.3.22"
35
+ "@holo-js/security": "^0.3.24"
35
36
  },
36
37
  "peerDependenciesMeta": {
37
38
  "@holo-js/security": {