diff --git a/packages/config/README.md b/packages/config/README.md index a9b0fcfc..621e97d8 100644 --- a/packages/config/README.md +++ b/packages/config/README.md @@ -207,7 +207,7 @@ References: | Constant | Type | | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `EmulatorConfigSchema` | `ZodUnion; image: ZodOptional; name: ZodOptional; volume: ZodOptional<...>; target: ZodOptional<...>; platform: ZodOptional<...>; }, $strict>>; skylab: ZodObject<...>; }, $strict>, ZodObj...` | +| `EmulatorConfigSchema` | `ZodUnion; image: ZodOptional; name: ZodOptional; volume: ZodOptional<...>; target: ZodOptional<...>; platform: ZodOptional<...>; }, $strict>>; skylab: ZodObject<....` | References: @@ -604,7 +604,7 @@ Shared options for all runner variants. | Property | Type | Description | | ---------- | --------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `type` | `"docker" or "podman"` | The containerization tool to run the emulator. | +| `type` | `"docker" or "podman" or "container"` | The containerization tool to run the emulator. | | `image` | `string or undefined` | Image reference. default: depends on emulator type, e.g. "junobuild/skylab:latest" | | `name` | `string or undefined` | Optional container name to use for the emulator. Useful for reusing or managing a specific container. | | `volume` | `string or undefined` | Persistent volume to store internal state. default: "juno" | diff --git a/packages/config/src/satellite/configs/emulator.config.ts b/packages/config/src/satellite/configs/emulator.config.ts index 3c24b796..ec5b1cd0 100644 --- a/packages/config/src/satellite/configs/emulator.config.ts +++ b/packages/config/src/satellite/configs/emulator.config.ts @@ -99,7 +99,7 @@ export interface EmulatorSatellite { * @see EmulatorRunner */ const EmulatorRunnerSchema = z.strictObject({ - type: z.enum(['docker', 'podman']), + type: z.enum(['docker', 'podman', 'container']), image: z.string().optional(), name: z.string().optional(), volume: z.string().optional(), @@ -114,7 +114,7 @@ export interface EmulatorRunner { /** * The containerization tool to run the emulator. */ - type: 'docker' | 'podman'; + type: 'docker' | 'podman' | 'container'; /** * Image reference. diff --git a/packages/config/src/tests/satellite/configs/emulator.config.spec.ts b/packages/config/src/tests/satellite/configs/emulator.config.spec.ts index 1431edce..0a61e2f8 100644 --- a/packages/config/src/tests/satellite/configs/emulator.config.spec.ts +++ b/packages/config/src/tests/satellite/configs/emulator.config.spec.ts @@ -219,6 +219,16 @@ describe('emulator.config', () => { expect(result.success).toBe(true); }); + it('accepts runner with type container', () => { + const result = EmulatorConfigSchema.safeParse({ + runner: { + type: 'container' + }, + console: {} + }); + expect(result.success).toBe(true); + }); + it('rejects runner with invalid type value', () => { const result = EmulatorConfigSchema.safeParse({ runner: {