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

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,68 @@ 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:
92
+ * Stores network configuration and topology (subnet membership, public keys, feature flags).
93
+ * Acts as the source of truth other system canisters read/write to.
94
+ */
95
+ registry?: boolean;
96
+ /**
97
+ * CMC (Cycles Minting Canister):
98
+ * Converts ICP to cycles and distributes them; maintains subnet lists and conversion rate.
99
+ */
100
+ cmc?: boolean;
101
+ /**
102
+ * ICP token:
103
+ * Deploys the ICP ledger and index canisters.
104
+ */
105
+ icp?: boolean;
106
+ /**
107
+ * Cycles token:
108
+ * Deploys the cycles ledger and index canisters.
109
+ */
110
+ cycles?: boolean;
111
+ /**
112
+ * NNS governance canisters:
113
+ * Deploys the governance and root canisters.
114
+ * Core governance system (neurons, proposals, voting) and related control logic.
115
+ * Enables managing network-level decisions in an emulated environment.
116
+ */
117
+ nns?: boolean;
118
+ /**
119
+ * SNS canisters:
120
+ * Deploys the SNS-W and aggregator canisters.
121
+ * Service Nervous System stack used to govern individual dapps.
122
+ */
123
+ sns?: boolean;
124
+ /**
125
+ * Internet Identity (II):
126
+ * Deploys the II canister for authentication.
127
+ */
128
+ ii?: boolean;
129
+ /**
130
+ * NNS dapp:
131
+ * Deploys the NNS UI canister and frontend application
132
+ */
133
+ nnsDapp?: boolean;
134
+ }
135
+ /**
136
+ * Configuration for customizing the Internet Computer network bootstrapped
137
+ * by the emulator.
138
+ */
139
+ export interface Network {
140
+ /**
141
+ * System canisters and applications available in the network.
142
+ */
143
+ services: NetworkServices;
144
+ }
83
145
  /**
84
146
  * @see EmulatorConfig
85
147
  */
@@ -98,6 +160,18 @@ export declare const EmulatorConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
98
160
  "linux/arm64": "linux/arm64";
99
161
  }>>;
100
162
  }, z.core.$strict>>;
163
+ network: z.ZodOptional<z.ZodObject<{
164
+ services: z.ZodObject<{
165
+ registry: z.ZodOptional<z.ZodBoolean>;
166
+ cmc: z.ZodOptional<z.ZodBoolean>;
167
+ icp: z.ZodOptional<z.ZodBoolean>;
168
+ cycles: z.ZodOptional<z.ZodBoolean>;
169
+ nns: z.ZodOptional<z.ZodBoolean>;
170
+ sns: z.ZodOptional<z.ZodBoolean>;
171
+ ii: z.ZodOptional<z.ZodBoolean>;
172
+ nnsDapp: z.ZodOptional<z.ZodBoolean>;
173
+ }, z.core.$strict>;
174
+ }, z.core.$strict>>;
101
175
  skylab: z.ZodObject<{
102
176
  ports: z.ZodOptional<z.ZodObject<{
103
177
  server: z.ZodOptional<z.ZodNumber>;
@@ -120,6 +194,18 @@ export declare const EmulatorConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
120
194
  "linux/arm64": "linux/arm64";
121
195
  }>>;
122
196
  }, z.core.$strict>>;
197
+ network: z.ZodOptional<z.ZodObject<{
198
+ services: z.ZodObject<{
199
+ registry: z.ZodOptional<z.ZodBoolean>;
200
+ cmc: z.ZodOptional<z.ZodBoolean>;
201
+ icp: z.ZodOptional<z.ZodBoolean>;
202
+ cycles: z.ZodOptional<z.ZodBoolean>;
203
+ nns: z.ZodOptional<z.ZodBoolean>;
204
+ sns: z.ZodOptional<z.ZodBoolean>;
205
+ ii: z.ZodOptional<z.ZodBoolean>;
206
+ nnsDapp: z.ZodOptional<z.ZodBoolean>;
207
+ }, z.core.$strict>;
208
+ }, z.core.$strict>>;
123
209
  console: z.ZodObject<{
124
210
  ports: z.ZodOptional<z.ZodObject<{
125
211
  /**
@@ -147,6 +233,18 @@ export declare const EmulatorConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
147
233
  "linux/arm64": "linux/arm64";
148
234
  }>>;
149
235
  }, z.core.$strict>>;
236
+ network: z.ZodOptional<z.ZodObject<{
237
+ services: z.ZodObject<{
238
+ registry: z.ZodOptional<z.ZodBoolean>;
239
+ cmc: z.ZodOptional<z.ZodBoolean>;
240
+ icp: z.ZodOptional<z.ZodBoolean>;
241
+ cycles: z.ZodOptional<z.ZodBoolean>;
242
+ nns: z.ZodOptional<z.ZodBoolean>;
243
+ sns: z.ZodOptional<z.ZodBoolean>;
244
+ ii: z.ZodOptional<z.ZodBoolean>;
245
+ nnsDapp: z.ZodOptional<z.ZodBoolean>;
246
+ }, z.core.$strict>;
247
+ }, z.core.$strict>>;
150
248
  satellite: z.ZodObject<{
151
249
  ports: z.ZodOptional<z.ZodObject<{
152
250
  /**
@@ -165,11 +263,14 @@ export declare const EmulatorConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
165
263
  */
166
264
  export type EmulatorConfig = {
167
265
  runner?: EmulatorRunner;
266
+ network?: Network;
168
267
  skylab: EmulatorSkylab;
169
268
  } | {
170
269
  runner?: EmulatorRunner;
270
+ network?: Network;
171
271
  console: EmulatorConsole;
172
272
  } | {
173
273
  runner?: EmulatorRunner;
274
+ network?: Network;
174
275
  satellite: EmulatorSatellite;
175
276
  };
@@ -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
+ nnsDapp: 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
+ nnsDapp: 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
+ nnsDapp: 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-26",
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
+ }