mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
Compare commits
6 commits
0551b8e12d
...
8c0a20a743
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c0a20a743 | ||
|
|
6d85dbdfcb | ||
|
|
77cd27a458 | ||
|
|
e5e688a154 | ||
|
|
fa5be6bd6a | ||
|
|
bf9840bd14 |
48
.github/workflows/publish.yml
vendored
Normal file
48
.github/workflows/publish.yml
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
name: Build & Publish Packages
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
package:
|
||||
description: "Package to publish"
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- client
|
||||
- sdk
|
||||
tag:
|
||||
description: "NPM tag to use"
|
||||
required: true
|
||||
type: choice
|
||||
default: nightly
|
||||
options:
|
||||
- latest
|
||||
- nightly
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
# For provenance generation
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
environment: NPM Deploy
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
|
||||
- name: Install
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
- name: Publish to NPM
|
||||
working-directory: packages/${{ inputs.package }}
|
||||
run: bun publish --provenance --tag ${{ inputs.tag }} --access public
|
||||
env:
|
||||
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Publish to JSR
|
||||
working-directory: packages/${{ inputs.package }}
|
||||
run: bunx jsr publish --allow-slow-types --allow-dirty
|
||||
11
.github/workflows/test-publish.yml
vendored
11
.github/workflows/test-publish.yml
vendored
|
|
@ -23,16 +23,13 @@ jobs:
|
|||
- uses: oven-sh/setup-bun@v2
|
||||
|
||||
- name: Install
|
||||
run: bun install
|
||||
|
||||
- name: Configure .npmrc
|
||||
working-directory: packages/${{ matrix.package }}
|
||||
run: |
|
||||
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
- name: Publish to NPM
|
||||
working-directory: packages/${{ matrix.package }}
|
||||
run: bun publish --dry-run
|
||||
env:
|
||||
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
run: bun publish --dry-run --access public
|
||||
|
||||
- name: Publish to JSR
|
||||
working-directory: packages/${{ matrix.package }}
|
||||
|
|
|
|||
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
|
|
@ -8,7 +8,9 @@
|
|||
"config",
|
||||
"plugin",
|
||||
"worker",
|
||||
"media"
|
||||
"media",
|
||||
"packages/client",
|
||||
"packages/sdk"
|
||||
],
|
||||
"languageToolLinter.languageTool.ignoredWordsInWorkspace": ["versia"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import type { z } from "zod";
|
|||
import { apiRoute } from "@/api";
|
||||
import { markdownParse } from "~/classes/functions/status";
|
||||
import { config } from "~/config.ts";
|
||||
import manifest from "~/package.json";
|
||||
import manifest from "~/package.json" with { type: "json" };
|
||||
|
||||
export default apiRoute((app) =>
|
||||
app.get(
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { describeRoute } from "hono-openapi";
|
|||
import { resolver } from "hono-openapi/zod";
|
||||
import { apiRoute } from "@/api";
|
||||
import { config } from "~/config.ts";
|
||||
import pkg from "~/package.json";
|
||||
import pkg from "~/package.json" with { type: "json" };
|
||||
|
||||
export default apiRoute((app) =>
|
||||
app.get(
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { resolver } from "hono-openapi/zod";
|
|||
import { z } from "zod";
|
||||
import { apiRoute } from "@/api";
|
||||
import { config } from "~/config.ts";
|
||||
import manifest from "~/package.json";
|
||||
import manifest from "~/package.json" with { type: "json" };
|
||||
|
||||
export default apiRoute((app) =>
|
||||
app.get(
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { resolver } from "hono-openapi/zod";
|
|||
import { apiRoute } from "@/api";
|
||||
import { urlToContentFormat } from "@/content_types";
|
||||
import { config } from "~/config.ts";
|
||||
import pkg from "~/package.json";
|
||||
import pkg from "~/package.json" with { type: "json" };
|
||||
import { InstanceMetadataSchema } from "~/packages/sdk/schemas";
|
||||
|
||||
export default apiRoute((app) =>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { versionPlugin } from "@clerc/plugin-version";
|
|||
import { Clerc } from "clerc";
|
||||
import { searchManager } from "~/classes/search/search-manager.ts";
|
||||
import { setupDatabase } from "~/drizzle/db.ts";
|
||||
import pkg from "~/package.json";
|
||||
import pkg from "~/package.json" with { type: "json" };
|
||||
import { rebuildIndexCommand } from "./index/rebuild.ts";
|
||||
import { refetchInstanceCommand } from "./instance/refetch.ts";
|
||||
import { createUserCommand } from "./user/create.ts";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"$schema": "https://jsr.io/schema/config-file.v1.json",
|
||||
"name": "@versia/client",
|
||||
"version": "0.2.0-alpha.1",
|
||||
"version": "0.2.0-alpha.2",
|
||||
"exports": {
|
||||
".": "./index.ts",
|
||||
"./schemas": "./schemas.ts"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@versia/client",
|
||||
"displayName": "Versia Client",
|
||||
"version": "0.2.0-alpha.1",
|
||||
"version": "0.2.0-alpha.2",
|
||||
"author": {
|
||||
"email": "jesse.wierzbinski@lysand.org",
|
||||
"name": "Jesse Wierzbinski (CPlusPatch)",
|
||||
|
|
|
|||
|
|
@ -102,6 +102,25 @@ export const Instance = z
|
|||
.openapi({
|
||||
description: "An image used to represent this instance.",
|
||||
}),
|
||||
/* Versia Server API extension */
|
||||
banner: z
|
||||
.object({
|
||||
url: z.string().url().openapi({
|
||||
description: "The URL for the banner image.",
|
||||
example:
|
||||
"https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png",
|
||||
}),
|
||||
blurhash: z.string().optional().openapi({
|
||||
description:
|
||||
"A hash computed by the BlurHash algorithm, for generating colorful preview thumbnails when media has not been downloaded yet.",
|
||||
example: "UUKJMXv|x]t7^*t7Rjaz^jazRjaz",
|
||||
}),
|
||||
})
|
||||
.optional()
|
||||
.openapi({
|
||||
description:
|
||||
"A wide banner image used to represent this instance.",
|
||||
}),
|
||||
icon: z.array(InstanceIcon).openapi({
|
||||
description:
|
||||
"The list of available size variants for this instance configured icon.",
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ export class BaseClient {
|
|||
}
|
||||
|
||||
/** Overridable by testing */
|
||||
private fetch = fetch;
|
||||
private fetch = (...args: Parameters<typeof fetch>) => fetch(...args);
|
||||
|
||||
private async request<ReturnType>(
|
||||
request: Request,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { sign } from "./crypto.ts";
|
||||
import { Collection, URICollection } from "./entities/collection.ts";
|
||||
import type { Entity } from "./entities/entity.ts";
|
||||
import { homepage, version } from "./package.json";
|
||||
import { homepage, version } from "./package.json" with { type: "json" };
|
||||
import { WebFingerSchema } from "./schemas/webfinger.ts";
|
||||
|
||||
const DEFAULT_UA = `VersiaFederationClient/${version} (+${homepage})`;
|
||||
|
|
|
|||
12
packages/sdk/jsr.jsonc
Normal file
12
packages/sdk/jsr.jsonc
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"$schema": "https://jsr.io/schema/config-file.v1.json",
|
||||
"name": "@versia/sdk",
|
||||
"version": "0.0.1",
|
||||
"exports": {
|
||||
".": "./inbox-processor.ts",
|
||||
"./http": "./http.ts",
|
||||
"./crypto": "./crypto.ts",
|
||||
"./entities": "./entities.ts",
|
||||
"./schemas": "./schemas.ts"
|
||||
}
|
||||
}
|
||||
|
|
@ -61,8 +61,6 @@ export const generateClient = async (
|
|||
token?.data.accessToken,
|
||||
);
|
||||
|
||||
// @ts-expect-error This doesn't include fetch.preconnect, which is a custom property
|
||||
// added by Bun
|
||||
// biome-ignore lint/complexity/useLiteralKeys: Overriding private properties
|
||||
client["fetch"] = (
|
||||
input: RequestInfo | string | URL | Request,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { mediaQueue } from "~/classes/queues/media";
|
|||
import { pushQueue } from "~/classes/queues/push";
|
||||
import { relationshipQueue } from "~/classes/queues/relationships";
|
||||
import { config } from "~/config.ts";
|
||||
import pkg from "~/package.json";
|
||||
import pkg from "~/package.json" with { type: "json" };
|
||||
import type { HonoEnv } from "~/types/api";
|
||||
|
||||
export const applyToHono = (app: Hono<HonoEnv>): void => {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import * as Sentry from "@sentry/bun";
|
||||
import { env } from "bun";
|
||||
import { config } from "~/config.ts";
|
||||
import pkg from "~/package.json";
|
||||
import pkg from "~/package.json" with { type: "json" };
|
||||
|
||||
const sentryInstance =
|
||||
config.logging.sentry &&
|
||||
|
|
|
|||
Loading…
Reference in a new issue