@junobuild/config 2.2.0 → 2.3.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,6 +1,6 @@
1
1
  import type { Identity } from '@dfinity/agent';
2
2
  import type { Principal } from '@dfinity/principal';
3
- import * as z from 'zod/v4';
3
+ import * as z from 'zod';
4
4
  /**
5
5
  * @see OnRunContext
6
6
  */
@@ -1,7 +1,7 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  import { type OnRun } from './run.context';
3
3
  import type { OnRunEnv } from './run.env';
4
- export declare const RunFnSchema: z.core.$ZodFunction<z.ZodTuple<[z.ZodObject<{
4
+ export declare const RunFnSchema: z.ZodFunction<z.ZodTuple<[z.ZodObject<{
5
5
  satelliteId: z.ZodPipe<z.ZodUnknown, z.ZodTransform<import("@dfinity/principal").Principal, unknown>>;
6
6
  identity: z.ZodUnknown;
7
7
  container: z.ZodOptional<z.ZodString>;
@@ -1,4 +1,4 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  import { type JunoConfigEnv } from '../types/juno.env';
3
3
  /**
4
4
  * @see OnRunEnv
@@ -1,5 +1,5 @@
1
1
  import { type PrincipalText } from '@dfinity/zod-schemas';
2
- import * as z from 'zod/v4';
2
+ import * as z from 'zod';
3
3
  import { type StorageConfig } from '../shared/storage.config';
4
4
  import { type CliConfig } from '../types/cli.config';
5
5
  import { type JunoConfigMode } from '../types/juno.env';
@@ -75,8 +75,8 @@ export declare const JunoConsoleConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
75
75
  precompress: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
76
76
  pattern: z.ZodOptional<z.ZodString>;
77
77
  mode: z.ZodOptional<z.ZodEnum<{
78
- both: "both";
79
78
  replace: "replace";
79
+ both: "both";
80
80
  }>>;
81
81
  algorithm: z.ZodOptional<z.ZodEnum<{
82
82
  gzip: "gzip";
@@ -85,8 +85,8 @@ export declare const JunoConsoleConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
85
85
  }, z.core.$strict>, z.ZodArray<z.ZodObject<{
86
86
  pattern: z.ZodOptional<z.ZodString>;
87
87
  mode: z.ZodOptional<z.ZodEnum<{
88
- both: "both";
89
88
  replace: "replace";
89
+ both: "both";
90
90
  }>>;
91
91
  algorithm: z.ZodOptional<z.ZodEnum<{
92
92
  gzip: "gzip";
@@ -135,8 +135,8 @@ export declare const JunoConsoleConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
135
135
  precompress: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
136
136
  pattern: z.ZodOptional<z.ZodString>;
137
137
  mode: z.ZodOptional<z.ZodEnum<{
138
- both: "both";
139
138
  replace: "replace";
139
+ both: "both";
140
140
  }>>;
141
141
  algorithm: z.ZodOptional<z.ZodEnum<{
142
142
  gzip: "gzip";
@@ -145,8 +145,8 @@ export declare const JunoConsoleConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
145
145
  }, z.core.$strict>, z.ZodArray<z.ZodObject<{
146
146
  pattern: z.ZodOptional<z.ZodString>;
147
147
  mode: z.ZodOptional<z.ZodEnum<{
148
- both: "both";
149
148
  replace: "replace";
149
+ both: "both";
150
150
  }>>;
151
151
  algorithm: z.ZodOptional<z.ZodEnum<{
152
152
  gzip: "gzip";
@@ -1,4 +1,4 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  /**
3
3
  * @see JunoPackageDependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  /**
3
3
  * @see SatelliteAssertions
4
4
  */
@@ -1,5 +1,5 @@
1
1
  import { type PrincipalText } from '@dfinity/zod-schemas';
2
- import * as z from 'zod/v4';
2
+ import * as z from 'zod';
3
3
  /**
4
4
  * @see AuthenticationConfigInternetIdentity
5
5
  */
@@ -1,4 +1,4 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  import { type Rule } from './rules';
3
3
  /**
4
4
  * @see DatastoreCollection
@@ -1,4 +1,4 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  import { type MaxMemorySizeConfig } from '../../shared/feature.config';
3
3
  /**
4
4
  * @see DatastoreConfig
@@ -1,4 +1,4 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  /**
3
3
  * Represents the ports exposed by an emulator container.
4
4
  */
@@ -1,4 +1,4 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  /**
3
3
  * @see ModuleLogVisibility
4
4
  */
@@ -1,5 +1,5 @@
1
1
  import { type PrincipalText } from '@dfinity/zod-schemas';
2
- import * as z from 'zod/v4';
2
+ import * as z from 'zod';
3
3
  import { type JunoConfigMode } from '../../types/juno.env';
4
4
  import type { Either } from '../../types/utility.types';
5
5
  /**
@@ -1,4 +1,4 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  /**
3
3
  * @see PermissionText
4
4
  */
@@ -1,5 +1,5 @@
1
1
  import { type PrincipalText } from '@dfinity/zod-schemas';
2
- import * as z from 'zod/v4';
2
+ import * as z from 'zod';
3
3
  import { type StorageConfig } from '../../shared/storage.config';
4
4
  import type { CliConfig } from '../../types/cli.config';
5
5
  import { type JunoConfigMode } from '../../types/juno.env';
@@ -1,4 +1,4 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  import { type EmulatorConfig } from './configs/emulator.config';
3
3
  import { type OrbiterConfig } from './configs/orbiter.config';
4
4
  import { type SatelliteConfig } from './configs/satellite.config';
@@ -1,4 +1,4 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  /**
3
3
  * @see MaxMemorySizeConfig
4
4
  */
@@ -1,4 +1,4 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  import { type MaxMemorySizeConfig } from './feature.config';
3
3
  /**
4
4
  * @see StorageConfigSourceGlob
@@ -1,4 +1,4 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  import { type EncodingType } from './encoding';
3
3
  /**
4
4
  * @see Precompress
@@ -6,8 +6,8 @@ import { type EncodingType } from './encoding';
6
6
  export declare const PrecompressSchema: z.ZodObject<{
7
7
  pattern: z.ZodOptional<z.ZodString>;
8
8
  mode: z.ZodOptional<z.ZodEnum<{
9
- both: "both";
10
9
  replace: "replace";
10
+ both: "both";
11
11
  }>>;
12
12
  algorithm: z.ZodOptional<z.ZodEnum<{
13
13
  gzip: "gzip";
@@ -23,8 +23,8 @@ export declare const CliConfigSchema: z.ZodObject<{
23
23
  precompress: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
24
24
  pattern: z.ZodOptional<z.ZodString>;
25
25
  mode: z.ZodOptional<z.ZodEnum<{
26
- both: "both";
27
26
  replace: "replace";
27
+ both: "both";
28
28
  }>>;
29
29
  algorithm: z.ZodOptional<z.ZodEnum<{
30
30
  gzip: "gzip";
@@ -33,8 +33,8 @@ export declare const CliConfigSchema: z.ZodObject<{
33
33
  }, z.core.$strict>, z.ZodArray<z.ZodObject<{
34
34
  pattern: z.ZodOptional<z.ZodString>;
35
35
  mode: z.ZodOptional<z.ZodEnum<{
36
- both: "both";
37
36
  replace: "replace";
37
+ both: "both";
38
38
  }>>;
39
39
  algorithm: z.ZodOptional<z.ZodEnum<{
40
40
  gzip: "gzip";
@@ -1,4 +1,4 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  /**
3
3
  * see EncodingType
4
4
  */
@@ -1,4 +1,4 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  /**
3
3
  * @see JunoConfigMode
4
4
  */
@@ -1,4 +1,4 @@
1
- import * as z from 'zod/v4';
1
+ import * as z from 'zod';
2
2
  /**
3
3
  * Ensures an unknown object is an identity.
4
4
  */
@@ -1,5 +1,5 @@
1
1
  import { Principal } from '@dfinity/principal';
2
- import * as z from 'zod/v4';
2
+ import * as z from 'zod';
3
3
  /**
4
4
  * Ensures reliable validation of PrincipalTextSchema inside z.record.
5
5
  */
@@ -1,2 +1,23 @@
1
- import * as z from 'zod/v4';
2
- export declare const createFunctionSchema: <T extends z.core.$ZodFunction>(schema: T) => z.ZodCustom<Parameters<T["implement"]>[0], Parameters<T["implement"]>[0]>;
1
+ import * as z from 'zod';
2
+ /**
3
+ * Wraps a Zod function schema so that parsing returns the **original function**
4
+ * instead of Zod's wrapped validator.
5
+ *
6
+ * Why?
7
+ * ----
8
+ * In Zod v4, `z.function({...})` normally returns a wrapper that validates
9
+ * both arguments and the return value **every time the function is called**.
10
+ * If your function's return type is `void | Promise<void>`, Zod tries to
11
+ * validate it synchronously, which can throw
12
+ * "Encountered Promise during synchronous parse"
13
+ * when the implementation is async.
14
+ *
15
+ * By using `.implement`, we tell Zod: “this is the function that satisfies
16
+ * the schema.” That way the schema still validates the function shape at
17
+ * parse time, but the returned value is the **original function** you passed
18
+ * in — no runtime wrapper, no sync/async mismatch.
19
+ *
20
+ * Reference:
21
+ * https://github.com/colinhacks/zod/issues/4143#issuecomment-2845134912*
22
+ */
23
+ export declare const createFunctionSchema: <T extends z.ZodFunction>(schema: T) => z.ZodCustom<Parameters<T["implement"]>[0], Parameters<T["implement"]>[0]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junobuild/config",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Configuration options for Juno CLI",
5
5
  "author": "David Dal Busco (https://daviddalbusco.com)",
6
6
  "license": "MIT",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "homepage": "https://juno.build",
43
43
  "peerDependencies": {
44
- "@dfinity/zod-schemas": "^1.1.0",
45
- "zod": "^3.25"
44
+ "@dfinity/zod-schemas": "^2",
45
+ "zod": "^4"
46
46
  }
47
47
  }