Add monorepo support to project (#682)

* feat: add monorepo support

* fix: correct relatedProjects structure in vercel.json

* update github actions with monorepo support

* removed legacy dep

* moved jsr config into web package
This commit is contained in:
Dan Ditomaso
2025-06-25 21:56:55 -04:00
committed by GitHub
parent 85ee0747d1
commit 1c13343e8a
463 changed files with 7568 additions and 2196 deletions
+38
View File
@@ -0,0 +1,38 @@
import { z } from "zod/v4";
import { Protobuf } from "@meshtastic/core";
import { makePskHelpers } from "./pskSchema.ts";
import { validateMaxByteLength } from "@core/utils/string.ts";
const RoleEnum = z.enum(Protobuf.Channel.Channel_Role);
const moduleSettingsSchema = z.object({
positionPrecision: z.union([
z.literal(0),
z.coerce.number().int().min(10).max(19),
z.literal(32),
]),
});
export function makeChannelSchema(allowedBytes: number) {
const { stringSchema } = makePskHelpers([allowedBytes]);
const ChannelSettingsSchema = z.object({
channelNum: z.coerce.number().int().min(0).max(7),
psk: stringSchema(false),
name: z.string()
.refine(
(s) => validateMaxByteLength(s, 12).isValid,
{ message: "formValidation.tooBig.bytes", params: { maximum: 12 } },
),
id: z.coerce.number().int(),
uplinkEnabled: z.boolean(),
downlinkEnabled: z.boolean(),
moduleSettings: moduleSettingsSchema,
});
return z.object({
index: z.coerce.number(),
settings: ChannelSettingsSchema,
role: RoleEnum,
});
}