Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend-deno/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM denoland/deno:alpine-2.1.4
FROM denoland/deno:alpine-2.5.4

WORKDIR /app

Expand Down
22 changes: 9 additions & 13 deletions backend-deno/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@
"version": "0.0.0-to-be-replaced-by-ci",
"exports": "./mod.ts",
"publish": {
"include": [
"mod.ts",
"README.md",
"LICENSE"
]
"include": ["mod.ts", "README.md", "LICENSE"]
},
"imports": {
"@nats-io/nats-core": "jsr:@nats-io/nats-core@3.0.0-45",
"@nats-io/transport-deno": "jsr:@nats-io/transport-deno@3.0.0-18",
"@std/assert": "jsr:@std/assert@^1.0.8",
"@std/cli": "jsr:@std/cli@^1.0.7",
"@std/jsonc": "jsr:@std/jsonc@^1.0.1",
"@std/path": "jsr:@std/path@^1.0.8",
"jsr:@wuespace/telestion": "./mod.ts",
"zod": "npm:zod@^3.23.8"
"@nats-io/nats-core": "jsr:@nats-io/nats-core@^3.2.0",
"@nats-io/transport-deno": "jsr:@nats-io/transport-deno@^3.2.0",
"@std/assert": "jsr:@std/assert@^1.0.15",
"@std/cli": "jsr:@std/cli@^1.0.23",
"@std/jsonc": "jsr:@std/jsonc@^1.0.2",
"@std/path": "jsr:@std/path@^1.1.2",
"@zod/zod": "jsr:@zod/zod@^4.1.12",
"jsr:@wuespace/telestion": "./mod.ts"
}
}
115 changes: 60 additions & 55 deletions backend-deno/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 5 additions & 13 deletions backend-deno/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as natsTransport from "@nats-io/transport-deno";
import { parseArgs } from "@std/cli";
import { parse as parseJSON } from "@std/jsonc";
import { resolve } from "@std/path";
import { z, type ZodSchema, type ZodTypeDef } from "zod";
import { z, type ZodType } from "@zod/zod";

let args = Deno.args;
let natsModule = natsTransport;
Expand Down Expand Up @@ -34,11 +34,7 @@ export interface StartServiceConfig {
natsMock?: unknown;
}

const StartServiceConfigSchema: ZodSchema<
StartServiceConfig,
ZodTypeDef,
Partial<StartServiceConfig>
> = z.object({
const StartServiceConfigSchema: ZodType<StartServiceConfig, Partial<StartServiceConfig>> = z.object({
nats: z.boolean().default(true),
overwriteArgs: z.array(z.string()).optional(),
natsMock: z.unknown().optional(),
Expand Down Expand Up @@ -98,17 +94,13 @@ export interface MinimalConfig {
* console.log(config.SERVICE_NAME); // "my-service"
* ```
*/
export const MinimalConfigSchema: ZodSchema<
MinimalConfig,
ZodTypeDef,
MinimalConfig
> = z.object({
export const MinimalConfigSchema: ZodType<MinimalConfig> = z.object({
NATS_URL: z.string(),
NATS_USER: z.string().optional(),
NATS_PASSWORD: z.string().optional(),
SERVICE_NAME: z.string(),
DATA_DIR: z.string(),
}).passthrough();
}).loose();

/**
* Starts the service and returns the APIs available to the Telestion service.
Expand Down Expand Up @@ -182,7 +174,7 @@ function assembleConfig() {
const withoutConfigFile = z.object({
CONFIG_FILE: z.string().optional(),
CONFIG_KEY: z.string().optional(),
}).passthrough().parse({
}).loose().parse({
...getDefaultConfig(),
...Deno.env.toObject(),
...flags,
Expand Down
2 changes: 1 addition & 1 deletion backend-deno/samples/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM denoland/deno:alpine-2.1.2
FROM denoland/deno:alpine-2.5.4
LABEL maintainer="WüSpace e. V. <telestion@wuespace.de>"

# Add files
Expand Down
2 changes: 1 addition & 1 deletion backend-deno/samples/config/mod.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { startService } from "jsr:@wuespace/telestion";
import { z } from "npm:zod";
import { z } from "jsr:@zod/zod";

// Start the service
const { config, serviceName, dataDir } = await startService({
Expand Down
4 changes: 2 additions & 2 deletions backend-deno/samples/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ services:
nats:
image: nats:latest
ports:
- "4222:4222"
- "8222:8222"
- "4222"
- "8222"
# volumes:
# - ./nats.conf:/etc/nats.conf
config:
Expand Down
2 changes: 1 addition & 1 deletion backend-deno/samples/latest-value-cache/mod.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { startService } from "jsr:@wuespace/telestion";
import { z } from "npm:zod";
import { z } from "jsr:@zod/zod";

const { messageBus, config, serviceName } = await startService();

Expand Down
2 changes: 1 addition & 1 deletion backend-deno/samples/publisher/mod.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { startService } from "jsr:@wuespace/telestion";
import { z } from "npm:zod";
import { z } from "jsr:@zod/zod";

const { messageBus, config } = await startService();

Expand Down
2 changes: 1 addition & 1 deletion backend-deno/samples/requester/mod.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { startService } from "jsr:@wuespace/telestion";
import { z } from "npm:zod";
import { z } from "jsr:@zod/zod";

const { messageBus, config } = await startService();

Expand Down
Loading