From f5fd4c0a0414c7d70efca33ec8065a3b405425cf Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Mon, 13 May 2024 22:35:25 -1000 Subject: [PATCH] fix(build): :bug: Fix builds for JSR support --- federation/index.ts | 2 +- federation/jsr.jsonc | 8 ++++++++ federation/schemas/extensions/vanity.ts | 2 +- federation/schemas/regex.ts | 4 ++-- federation/tsconfig.json | 8 -------- tsconfig.json | 5 +---- 6 files changed, 13 insertions(+), 16 deletions(-) create mode 100644 federation/jsr.jsonc delete mode 100644 federation/tsconfig.json diff --git a/federation/index.ts b/federation/index.ts index 66b882c..5676f1a 100644 --- a/federation/index.ts +++ b/federation/index.ts @@ -26,7 +26,7 @@ import { User, VanityExtension, Visibility, -} from "~/federation/schemas/base"; +} from "./schemas/base"; export type InferType = z.infer; diff --git a/federation/jsr.jsonc b/federation/jsr.jsonc new file mode 100644 index 0000000..eb6664e --- /dev/null +++ b/federation/jsr.jsonc @@ -0,0 +1,8 @@ +{ + "$schema": "https://jsr.io/schema/config-file.v1.json", + "name": "@lysand-org/federation", + "version": "3.0.0", + "exports": { + ".": "./index.ts" + } +} diff --git a/federation/schemas/extensions/vanity.ts b/federation/schemas/extensions/vanity.ts index 0fabc46..f182f08 100644 --- a/federation/schemas/extensions/vanity.ts +++ b/federation/schemas/extensions/vanity.ts @@ -5,7 +5,7 @@ * @see https://lysand.org/extensions/vanity */ -import { z } from "zod"; +import { type AnyZodObject, ZodObject, z } from "zod"; import { ContentFormat } from "../content_format"; /** diff --git a/federation/schemas/regex.ts b/federation/schemas/regex.ts index f7cf362..5622d38 100644 --- a/federation/schemas/regex.ts +++ b/federation/schemas/regex.ts @@ -18,7 +18,7 @@ import { /** * Regular expression for matching emojis. */ -export const emojiRegex = createRegExp( +export const emojiRegex: RegExp = createRegExp( // A-Z a-z 0-9 _ - oneOrMore(letter.or(digit).or(exactly("_")).or(exactly("-"))), [caseInsensitive, global], @@ -28,7 +28,7 @@ export const emojiRegex = createRegExp( * Regular expression for matching an extension_type * @example org.lysand:custom_emojis/Emoji */ -export const extensionTypeRegex = createRegExp( +export const extensionTypeRegex: RegExp = createRegExp( // org namespace, then colon, then alphanumeric/_/-, then extension name exactly( oneOrMore(exactly(letter.lowercase.or(digit).or(charIn("_-.")))), diff --git a/federation/tsconfig.json b/federation/tsconfig.json deleted file mode 100644 index 8fc1e6a..0000000 --- a/federation/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "paths": { - "~/*": ["./*"] - } - } -} diff --git a/tsconfig.json b/tsconfig.json index 2f1460a..674c9ce 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,10 +23,7 @@ "verbatimModuleSyntax": true, "types": [ "bun-types" // add Bun global - ], - "paths": { - "~/*": ["./*"] - } + ] }, "include": ["*.ts", "*.d.ts", "**/*.ts", "**/*.d.ts"] }