@junobuild/config 0.1.6 → 0.1.7

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/README.md CHANGED
@@ -53,7 +53,9 @@ Configuration options for [Juno] CLI.
53
53
 
54
54
  ### :tropical_drink: Interfaces
55
55
 
56
- - [OrbiterConfig](#gear-orbiterconfig)
56
+ - [JunoConfigEnv](#gear-junoconfigenv)
57
+ - [OrbiterId](#gear-orbiterid)
58
+ - [OrbiterIds](#gear-orbiterids)
57
59
  - [ModuleSettings](#gear-modulesettings)
58
60
  - [MaxMemorySizeConfig](#gear-maxmemorysizeconfig)
59
61
  - [StorageConfigHeader](#gear-storageconfigheader)
@@ -61,7 +63,6 @@ Configuration options for [Juno] CLI.
61
63
  - [StorageConfigRedirect](#gear-storageconfigredirect)
62
64
  - [StorageConfig](#gear-storageconfig)
63
65
  - [CliConfig](#gear-cliconfig)
64
- - [JunoConfigEnv](#gear-junoconfigenv)
65
66
  - [SatelliteAssertions](#gear-satelliteassertions)
66
67
  - [AuthenticationConfigInternetIdentity](#gear-authenticationconfiginternetidentity)
67
68
  - [AuthenticationConfig](#gear-authenticationconfig)
@@ -75,7 +76,15 @@ Configuration options for [Juno] CLI.
75
76
  - [SatelliteDevConfig](#gear-satellitedevconfig)
76
77
  - [JunoDevConfig](#gear-junodevconfig)
77
78
 
78
- #### :gear: OrbiterConfig
79
+ #### :gear: JunoConfigEnv
80
+
81
+ Represents the environment configuration for Juno.
82
+
83
+ | Property | Type | Description |
84
+ | -------- | -------- | ---------------------------------------------------------- |
85
+ | `mode` | `string` | The mode of the Juno configuration. type: {JunoConfigMode} |
86
+
87
+ #### :gear: OrbiterId
79
88
 
80
89
  Represents the configuration for an orbiter.
81
90
 
@@ -84,6 +93,14 @@ Represents the configuration for an orbiter.
84
93
  | `id` | `string` | The identifier of the orbiter used in the dApp. type: {string} |
85
94
  | `orbiterId` | `string or undefined` | The deprecated identifier of the orbiter. deprecated: `orbiterId` will be removed in the future. Use `id` instead.type: {string} |
86
95
 
96
+ #### :gear: OrbiterIds
97
+
98
+ Represents a mapping of orbiter identitifiers to different configurations based on the mode of the application.
99
+
100
+ | Property | Type | Description |
101
+ | -------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
102
+ | `ids` | `Record<string, string>` | A mapping of orbiter identifiers (IDs) to different configurations based on the mode of the application. This allows the application to use different orbiter IDs, such as production, development, etc. Example: { "production": "xo2hm-lqaaa-aaaal-ab3oa-cai", "development": "gl6nx-5maaa-aaaaa-qaaqq-cai" } type: {Record<JunoConfigMode, string>} |
103
+
87
104
  #### :gear: ModuleSettings
88
105
 
89
106
  Settings for a module - Satellite, Mission Control or Orbiter.
@@ -164,14 +181,6 @@ Configures the hosting behavior of the Storage.
164
181
  | `predeploy` | `string[] or undefined` | Defines a list of scripts or commands to be run before the deployment process begins. This can be useful for tasks such as compiling assets, running tests, or building production-ready files. Example: `json { "predeploy": ["npm run build", "npm run lint"] } ` type: {string[]}optional |
165
182
  | `postdeploy` | `string[] or undefined` | Defines a list of scripts or commands to be run after the deployment process completes. This can be used for tasks such as notifications, cleanup, or sending confirmation messages to services or team members. Example: `json { "postdeploy": ["./scripts/notify-admins.sh", "echo 'Deployment complete'"] } ` type: {string[]}optional |
166
183
 
167
- #### :gear: JunoConfigEnv
168
-
169
- Represents the environment configuration for Juno.
170
-
171
- | Property | Type | Description |
172
- | -------- | -------- | ---------------------------------------------------------- |
173
- | `mode` | `string` | The mode of the Juno configuration. type: {JunoConfigMode} |
174
-
175
184
  #### :gear: SatelliteAssertions
176
185
 
177
186
  Configuration for satellite assertions.
@@ -243,10 +252,10 @@ changes, typically through CLI commands (e.g., `juno config`).
243
252
 
244
253
  Represents the overall configuration for Juno.
245
254
 
246
- | Property | Type | Description |
247
- | ----------- | ---------------------------- | ------------------------------------------------------------------------- |
248
- | `satellite` | `SatelliteConfig` | The configuration for the satellite. type: {SatelliteConfig} |
249
- | `orbiter` | `OrbiterConfig or undefined` | The optional configuration for the orbiter. type: {OrbiterConfig}optional |
255
+ | Property | Type | Description |
256
+ | ----------- | ----------------- | ------------------------------------------------------------------------- |
257
+ | `satellite` | `SatelliteConfig` | The configuration for the satellite. type: {SatelliteConfig} |
258
+ | `orbiter` | `undefined` | The optional configuration for the orbiter. type: {OrbiterConfig}optional |
250
259
 
251
260
  #### :gear: SatelliteDevCollections
252
261
 
@@ -286,10 +295,11 @@ Represents the development configuration for Juno.
286
295
 
287
296
  ### :cocktail: Types
288
297
 
298
+ - [JunoConfigMode](#gear-junoconfigmode)
299
+ - [OrbiterConfig](#gear-orbiterconfig)
289
300
  - [ModuleLogVisibility](#gear-modulelogvisibility)
290
301
  - [StorageConfigSourceGlob](#gear-storageconfigsourceglob)
291
302
  - [ENCODING_TYPE](#gear-encoding_type)
292
- - [JunoConfigMode](#gear-junoconfigmode)
293
303
  - [SatelliteConfig](#gear-satelliteconfig)
294
304
  - [SatelliteDevDataStoreCollection](#gear-satellitedevdatastorecollection)
295
305
  - [SatelliteDevDbCollection](#gear-satellitedevdbcollection)
@@ -297,6 +307,22 @@ Represents the development configuration for Juno.
297
307
  - [JunoDevConfigFn](#gear-junodevconfigfn)
298
308
  - [JunoDevConfigFnOrObject](#gear-junodevconfigfnorobject)
299
309
 
310
+ #### :gear: JunoConfigMode
311
+
312
+ | Type | Type |
313
+ | ---------------- | ------------------------ |
314
+ | `JunoConfigMode` | `'production' or string` |
315
+
316
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/types/juno.env.ts#L5)
317
+
318
+ #### :gear: OrbiterConfig
319
+
320
+ | Type | Type |
321
+ | --------------- | ------------------------------ |
322
+ | `OrbiterConfig` | `Either<OrbiterId, OrbiterId>` |
323
+
324
+ [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/satellite/mainnet/configs/orbiter.config.ts#L49)
325
+
300
326
  #### :gear: ModuleLogVisibility
301
327
 
302
328
  | Type | Type |
@@ -321,14 +347,6 @@ Represents the development configuration for Juno.
321
347
 
322
348
  [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/types/encoding.ts#L5)
323
349
 
324
- #### :gear: JunoConfigMode
325
-
326
- | Type | Type |
327
- | ---------------- | ------------------------ |
328
- | `JunoConfigMode` | `'production' or string` |
329
-
330
- [:link: Source](https://github.com/junobuild/juno-js/tree/main/packages/config/src/types/juno.env.ts#L5)
331
-
332
350
  #### :gear: SatelliteConfig
333
351
 
334
352
  | Type | Type |
@@ -1,8 +1,10 @@
1
+ import type { JunoConfigMode } from '../../../types/juno.env';
2
+ import type { Either } from '../../../types/utility.types';
1
3
  /**
2
4
  * Represents the configuration for an orbiter.
3
- * @interface OrbiterConfig
5
+ * @interface OrbiterId
4
6
  */
5
- export interface OrbiterConfig {
7
+ export interface OrbiterId {
6
8
  /**
7
9
  * The identifier of the orbiter used in the dApp.
8
10
  * @type {string}
@@ -15,3 +17,29 @@ export interface OrbiterConfig {
15
17
  */
16
18
  orbiterId?: string;
17
19
  }
20
+ /**
21
+ * Represents a mapping of orbiter identitifiers to different configurations based on the mode of the application.
22
+ * @interface OrbiterIds
23
+ */
24
+ export interface OrbiterIds {
25
+ /**
26
+ * A mapping of orbiter identifiers (IDs) to different configurations based on the mode of the application.
27
+ *
28
+ * This allows the application to use different orbiter IDs, such as production, development, etc.
29
+ *
30
+ * Example:
31
+ * {
32
+ * "production": "xo2hm-lqaaa-aaaal-ab3oa-cai",
33
+ * "development": "gl6nx-5maaa-aaaaa-qaaqq-cai"
34
+ * }
35
+ * @type {Record<JunoConfigMode, string>}
36
+ */
37
+ ids: Record<JunoConfigMode, string>;
38
+ }
39
+ /**
40
+ * Represents the configuration for an orbiter (analytics).
41
+ *
42
+ * @typedef {Either<OrbiterId, OrbiterIds>} OrbiterConfig
43
+ * @property {OrbiterId | OrbiterIds} OrbiterId or SateOrbiterIdslliteIds - Defines a unique Orbiter or a collection of Orbiters.
44
+ */
45
+ export type OrbiterConfig = Either<OrbiterId, OrbiterId>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junobuild/config",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Configuration options for Juno CLI",
5
5
  "author": "David Dal Busco (https://daviddalbusco.com)",
6
6
  "license": "MIT",