@junobuild/config 2.2.0 → 2.3.0-next-2025-09-27

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
  */
@@ -80,6 +80,61 @@ export interface EmulatorRunner {
80
80
  */
81
81
  platform?: 'linux/amd64' | 'linux/arm64';
82
82
  }
83
+ /**
84
+ * Network services that can be enabled in the emulator.
85
+ *
86
+ * Each flag corresponds to a system canister or application that can be included
87
+ * in the local Internet Computer network when the emulator starts.
88
+ */
89
+ export interface NetworkServices {
90
+ /**
91
+ * Registry canister: Stores network configuration and topology (subnet membership, public keys, feature flags).
92
+ * Acts as the source of truth other system canisters read/write to.
93
+ */
94
+ registry?: boolean;
95
+ /**
96
+ * CMC (Cycles Minting Canister): Converts ICP to cycles and distributes them; maintains subnet lists and conversion rate.
97
+ */
98
+ cmc?: boolean;
99
+ /**
100
+ * ICP token: Deploys the ICP ledger and index canisters.
101
+ */
102
+ icp?: boolean;
103
+ /**
104
+ * Cycles token: Deploys the cycles ledger and index canisters.
105
+ */
106
+ cycles?: boolean;
107
+ /**
108
+ * NNS governance canisters: Deploys the governance and root canisters.
109
+ * Core governance system (neurons, proposals, voting) and related control logic.
110
+ * Enables managing network-level decisions in an emulated environment.
111
+ */
112
+ nns?: boolean;
113
+ /**
114
+ * SNS canisters: Deploys the SNS-W and aggregator canisters.
115
+ * Service Nervous System stack used to govern individual dapps.
116
+ */
117
+ sns?: boolean;
118
+ /**
119
+ * Internet Identity: Deploys the II canister for authentication.
120
+ */
121
+ ii?: boolean;
122
+ /**
123
+ * NNS dapp: Deploys the NNS UI canister and frontend application
124
+ * Requires cmc, icp, nns, sns, ii to be enabled.
125
+ */
126
+ nns_dapp?: boolean;
127
+ }
128
+ /**
129
+ * Configuration for customizing the Internet Computer network bootstrapped
130
+ * by the emulator.
131
+ */
132
+ export interface Network {
133
+ /**
134
+ * System canisters and applications available in the network.
135
+ */
136
+ services: NetworkServices;
137
+ }
83
138
  /**
84
139
  * @see EmulatorConfig
85
140
  */
@@ -98,6 +153,18 @@ export declare const EmulatorConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
98
153
  "linux/arm64": "linux/arm64";
99
154
  }>>;
100
155
  }, z.core.$strict>>;
156
+ network: z.ZodOptional<z.ZodObject<{
157
+ services: z.ZodObject<{
158
+ registry: z.ZodOptional<z.ZodBoolean>;
159
+ cmc: z.ZodOptional<z.ZodBoolean>;
160
+ icp: z.ZodOptional<z.ZodBoolean>;
161
+ cycles: z.ZodOptional<z.ZodBoolean>;
162
+ nns: z.ZodOptional<z.ZodBoolean>;
163
+ sns: z.ZodOptional<z.ZodBoolean>;
164
+ ii: z.ZodOptional<z.ZodBoolean>;
165
+ nns_dapp: z.ZodOptional<z.ZodBoolean>;
166
+ }, z.core.$strict>;
167
+ }, z.core.$strict>>;
101
168
  skylab: z.ZodObject<{
102
169
  ports: z.ZodOptional<z.ZodObject<{
103
170
  server: z.ZodOptional<z.ZodNumber>;
@@ -120,6 +187,18 @@ export declare const EmulatorConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
120
187
  "linux/arm64": "linux/arm64";
121
188
  }>>;
122
189
  }, z.core.$strict>>;
190
+ network: z.ZodOptional<z.ZodObject<{
191
+ services: z.ZodObject<{
192
+ registry: z.ZodOptional<z.ZodBoolean>;
193
+ cmc: z.ZodOptional<z.ZodBoolean>;
194
+ icp: z.ZodOptional<z.ZodBoolean>;
195
+ cycles: z.ZodOptional<z.ZodBoolean>;
196
+ nns: z.ZodOptional<z.ZodBoolean>;
197
+ sns: z.ZodOptional<z.ZodBoolean>;
198
+ ii: z.ZodOptional<z.ZodBoolean>;
199
+ nns_dapp: z.ZodOptional<z.ZodBoolean>;
200
+ }, z.core.$strict>;
201
+ }, z.core.$strict>>;
123
202
  console: z.ZodObject<{
124
203
  ports: z.ZodOptional<z.ZodObject<{
125
204
  /**
@@ -147,6 +226,18 @@ export declare const EmulatorConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
147
226
  "linux/arm64": "linux/arm64";
148
227
  }>>;
149
228
  }, z.core.$strict>>;
229
+ network: z.ZodOptional<z.ZodObject<{
230
+ services: z.ZodObject<{
231
+ registry: z.ZodOptional<z.ZodBoolean>;
232
+ cmc: z.ZodOptional<z.ZodBoolean>;
233
+ icp: z.ZodOptional<z.ZodBoolean>;
234
+ cycles: z.ZodOptional<z.ZodBoolean>;
235
+ nns: z.ZodOptional<z.ZodBoolean>;
236
+ sns: z.ZodOptional<z.ZodBoolean>;
237
+ ii: z.ZodOptional<z.ZodBoolean>;
238
+ nns_dapp: z.ZodOptional<z.ZodBoolean>;
239
+ }, z.core.$strict>;
240
+ }, z.core.$strict>>;
150
241
  satellite: z.ZodObject<{
151
242
  ports: z.ZodOptional<z.ZodObject<{
152
243
  /**
@@ -165,11 +256,14 @@ export declare const EmulatorConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
165
256
  */
166
257
  export type EmulatorConfig = {
167
258
  runner?: EmulatorRunner;
259
+ network?: Network;
168
260
  skylab: EmulatorSkylab;
169
261
  } | {
170
262
  runner?: EmulatorRunner;
263
+ network?: Network;
171
264
  console: EmulatorConsole;
172
265
  } | {
173
266
  runner?: EmulatorRunner;
267
+ network?: Network;
174
268
  satellite: EmulatorSatellite;
175
269
  };
@@ -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';
@@ -245,6 +245,18 @@ export declare const JunoConfigSchema: z.ZodObject<{
245
245
  "linux/arm64": "linux/arm64";
246
246
  }>>;
247
247
  }, z.core.$strict>>;
248
+ network: z.ZodOptional<z.ZodObject<{
249
+ services: z.ZodObject<{
250
+ registry: z.ZodOptional<z.ZodBoolean>;
251
+ cmc: z.ZodOptional<z.ZodBoolean>;
252
+ icp: z.ZodOptional<z.ZodBoolean>;
253
+ cycles: z.ZodOptional<z.ZodBoolean>;
254
+ nns: z.ZodOptional<z.ZodBoolean>;
255
+ sns: z.ZodOptional<z.ZodBoolean>;
256
+ ii: z.ZodOptional<z.ZodBoolean>;
257
+ nns_dapp: z.ZodOptional<z.ZodBoolean>;
258
+ }, z.core.$strict>;
259
+ }, z.core.$strict>>;
248
260
  skylab: z.ZodObject<{
249
261
  ports: z.ZodOptional<z.ZodObject<{
250
262
  server: z.ZodOptional<z.ZodNumber>;
@@ -267,6 +279,18 @@ export declare const JunoConfigSchema: z.ZodObject<{
267
279
  "linux/arm64": "linux/arm64";
268
280
  }>>;
269
281
  }, z.core.$strict>>;
282
+ network: z.ZodOptional<z.ZodObject<{
283
+ services: z.ZodObject<{
284
+ registry: z.ZodOptional<z.ZodBoolean>;
285
+ cmc: z.ZodOptional<z.ZodBoolean>;
286
+ icp: z.ZodOptional<z.ZodBoolean>;
287
+ cycles: z.ZodOptional<z.ZodBoolean>;
288
+ nns: z.ZodOptional<z.ZodBoolean>;
289
+ sns: z.ZodOptional<z.ZodBoolean>;
290
+ ii: z.ZodOptional<z.ZodBoolean>;
291
+ nns_dapp: z.ZodOptional<z.ZodBoolean>;
292
+ }, z.core.$strict>;
293
+ }, z.core.$strict>>;
270
294
  console: z.ZodObject<{
271
295
  ports: z.ZodOptional<z.ZodObject<{
272
296
  server: z.ZodOptional<z.ZodNumber>;
@@ -288,6 +312,18 @@ export declare const JunoConfigSchema: z.ZodObject<{
288
312
  "linux/arm64": "linux/arm64";
289
313
  }>>;
290
314
  }, z.core.$strict>>;
315
+ network: z.ZodOptional<z.ZodObject<{
316
+ services: z.ZodObject<{
317
+ registry: z.ZodOptional<z.ZodBoolean>;
318
+ cmc: z.ZodOptional<z.ZodBoolean>;
319
+ icp: z.ZodOptional<z.ZodBoolean>;
320
+ cycles: z.ZodOptional<z.ZodBoolean>;
321
+ nns: z.ZodOptional<z.ZodBoolean>;
322
+ sns: z.ZodOptional<z.ZodBoolean>;
323
+ ii: z.ZodOptional<z.ZodBoolean>;
324
+ nns_dapp: z.ZodOptional<z.ZodBoolean>;
325
+ }, z.core.$strict>;
326
+ }, z.core.$strict>>;
291
327
  satellite: z.ZodObject<{
292
328
  ports: z.ZodOptional<z.ZodObject<{
293
329
  server: z.ZodOptional<z.ZodNumber>;
@@ -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-next-2025-09-27",
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": "*",
45
+ "zod": "*"
46
46
  }
47
- }
47
+ }