Skip to content

Commit b88e01a

Browse files
feat(config): extend emulator type with apple container (#592)
* feat(config): extend emulator type with apple container * 🤖 Documentation auto-update --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 37642ef commit b88e01a

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

packages/config/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ References:
207207

208208
| Constant | Type |
209209
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
210-
| `EmulatorConfigSchema` | `ZodUnion<readonly [ZodObject<{ runner: ZodOptional<ZodObject<{ type: ZodEnum<{ docker: "docker"; podman: "podman"; }>; image: ZodOptional<ZodString>; name: ZodOptional<ZodString>; volume: ZodOptional<...>; target: ZodOptional<...>; platform: ZodOptional<...>; }, $strict>>; skylab: ZodObject<...>; }, $strict>, ZodObj...` |
210+
| `EmulatorConfigSchema` | `ZodUnion<readonly [ZodObject<{ runner: ZodOptional<ZodObject<{ type: ZodEnum<{ docker: "docker"; podman: "podman"; container: "container"; }>; image: ZodOptional<ZodString>; name: ZodOptional<ZodString>; volume: ZodOptional<...>; target: ZodOptional<...>; platform: ZodOptional<...>; }, $strict>>; skylab: ZodObject<....` |
211211

212212
References:
213213

@@ -604,7 +604,7 @@ Shared options for all runner variants.
604604

605605
| Property | Type | Description |
606606
| ---------- | --------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
607-
| `type` | `"docker" or "podman"` | The containerization tool to run the emulator. |
607+
| `type` | `"docker" or "podman" or "container"` | The containerization tool to run the emulator. |
608608
| `image` | `string or undefined` | Image reference. default: depends on emulator type, e.g. "junobuild/skylab:latest" |
609609
| `name` | `string or undefined` | Optional container name to use for the emulator. Useful for reusing or managing a specific container. |
610610
| `volume` | `string or undefined` | Persistent volume to store internal state. default: "juno" |

packages/config/src/satellite/configs/emulator.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export interface EmulatorSatellite {
9999
* @see EmulatorRunner
100100
*/
101101
const EmulatorRunnerSchema = z.strictObject({
102-
type: z.enum(['docker', 'podman']),
102+
type: z.enum(['docker', 'podman', 'container']),
103103
image: z.string().optional(),
104104
name: z.string().optional(),
105105
volume: z.string().optional(),
@@ -114,7 +114,7 @@ export interface EmulatorRunner {
114114
/**
115115
* The containerization tool to run the emulator.
116116
*/
117-
type: 'docker' | 'podman';
117+
type: 'docker' | 'podman' | 'container';
118118

119119
/**
120120
* Image reference.

packages/config/src/tests/satellite/configs/emulator.config.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,16 @@ describe('emulator.config', () => {
219219
expect(result.success).toBe(true);
220220
});
221221

222+
it('accepts runner with type container', () => {
223+
const result = EmulatorConfigSchema.safeParse({
224+
runner: {
225+
type: 'container'
226+
},
227+
console: {}
228+
});
229+
expect(result.success).toBe(true);
230+
});
231+
222232
it('rejects runner with invalid type value', () => {
223233
const result = EmulatorConfigSchema.safeParse({
224234
runner: {

0 commit comments

Comments
 (0)