Let ts_rs run formatting types instead of prettier

This commit is contained in:
Sebastian Martinez
2024-12-02 16:34:12 +01:00
parent 45699e4fc8
commit e093a5bc29
13 changed files with 573 additions and 121 deletions
+1 -1
View File
@@ -12,6 +12,6 @@ radicle-surf = { version = "0.22.1", features = ["serde"] }
serde = { version = "1.0.210", features = ["derive"] }
serde_json = { version = "1.0.132" }
thiserror = { version = "1.0.65" }
ts-rs = { version = "10.0.0", features = [ "serde-json-impl", "no-serde-warnings" ] }
ts-rs = { version = "10.0.0", features = ["serde-json-impl", "no-serde-warnings", "format"] }
localtime = { version = "1.3.1" }
tempfile = { version = "3.14.0" }
+1 -1
View File
@@ -1,6 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
*A type alias for the TS type `never`.
* A type alias for the TS type `never`.
*/
export type Never = never;
@@ -3,11 +3,11 @@ import type { Embed } from "../thread/Embed";
import type { State } from "./State";
export type Action =
| { type: "assign"; assignees: Array<string> }
| { type: "edit"; title: string }
| { type: "lifecycle"; state: State }
| { type: "label"; labels: Array<string> }
| { type: "comment"; body: string; replyTo?: string; embeds?: Array<Embed> }
| { type: "comment.edit"; id: string; body: string; embeds?: Array<Embed> }
| { type: "comment.redact"; id: string }
| { type: "comment.react"; id: string; reaction: string; active: boolean };
| { "type": "assign"; assignees: Array<string> }
| { "type": "edit"; title: string }
| { "type": "lifecycle"; state: State }
| { "type": "label"; labels: Array<string> }
| { "type": "comment"; body: string; replyTo?: string; embeds?: Array<Embed> }
| { "type": "comment.edit"; id: string; body: string; embeds?: Array<Embed> }
| { "type": "comment.redact"; id: string }
| { "type": "comment.react"; id: string; reaction: string; active: boolean };
@@ -3,17 +3,25 @@ import type { Author } from "../Author";
import type { Embed } from "../thread/Embed";
import type { State } from "./State";
export type Operation = {
entryId: string;
timestamp: number;
author: Author;
} & (
| { type: "assign"; assignees: Array<string> }
| { type: "edit"; title: string }
| { type: "lifecycle"; state: State }
| { type: "label"; labels: Array<string> }
| { type: "comment"; body: string; replyTo?: string; embeds?: Array<Embed> }
| { type: "comment.edit"; id: string; body: string; embeds?: Array<Embed> }
| { type: "comment.redact"; id: string }
| { type: "comment.react"; id: string; reaction: string; active: boolean }
);
export type Operation =
& { entryId: string; timestamp: number; author: Author }
& (
| { "type": "assign"; assignees: Array<string> }
| { "type": "edit"; title: string }
| { "type": "lifecycle"; state: State }
| { "type": "label"; labels: Array<string> }
| {
"type": "comment";
body: string;
replyTo?: string;
embeds?: Array<Embed>;
}
| {
"type": "comment.edit";
id: string;
body: string;
embeds?: Array<Embed>;
}
| { "type": "comment.redact"; id: string }
| { "type": "comment.react"; id: string; reaction: string; active: boolean }
);
@@ -1,6 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CloseReason } from "./CloseReason";
export type State =
| { status: "closed"; reason: CloseReason }
| { status: "open" };
export type State = { "status": "closed"; reason: CloseReason } | {
"status": "open";
};
@@ -3,92 +3,92 @@ import type { CodeLocation } from "../thread/CodeLocation";
import type { Embed } from "../thread/Embed";
export type Action =
| { type: "edit"; title: string; target: string }
| { type: "label"; labels: Array<string> }
| { type: "lifecycle"; state: { status: "draft" | "open" | "archived" } }
| { type: "assign"; assignees: Array<string> }
| { type: "merge"; revision: string; commit: string }
| { "type": "edit"; title: string; target: string }
| { "type": "label"; labels: Array<string> }
| { "type": "lifecycle"; state: { status: "draft" | "open" | "archived" } }
| { "type": "assign"; assignees: Array<string> }
| { "type": "merge"; revision: string; commit: string }
| {
type: "review";
revision: string;
summary?: string;
verdict?: string;
labels?: Array<string>;
}
"type": "review";
revision: string;
summary?: string;
verdict?: string;
labels?: Array<string>;
}
| {
type: "review.edit";
review: string;
summary?: string;
verdict?: string;
labels?: Array<string>;
}
| { type: "review.redact"; review: string }
"type": "review.edit";
review: string;
summary?: string;
verdict?: string;
labels?: Array<string>;
}
| { "type": "review.redact"; review: string }
| {
type: "review.comment";
review: string;
body: string;
location?: CodeLocation;
reply_to?: string;
embeds?: Array<Embed>;
}
"type": "review.comment";
review: string;
body: string;
location?: CodeLocation;
reply_to?: string;
embeds?: Array<Embed>;
}
| {
type: "review.comment.edit";
review: string;
comment: string;
body: string;
embeds?: Array<Embed>;
}
| { type: "review.comment.redact"; review: string; comment: string }
"type": "review.comment.edit";
review: string;
comment: string;
body: string;
embeds?: Array<Embed>;
}
| { "type": "review.comment.redact"; review: string; comment: string }
| {
type: "review.comment.react";
review: string;
comment: string;
reaction: string;
active: boolean;
}
| { type: "review.comment.resolve"; review: string; comment: string }
| { type: "review.comment.unresolve"; review: string; comment: string }
"type": "review.comment.react";
review: string;
comment: string;
reaction: string;
active: boolean;
}
| { "type": "review.comment.resolve"; review: string; comment: string }
| { "type": "review.comment.unresolve"; review: string; comment: string }
| {
type: "revision";
description: string;
base: string;
oid: string;
resolves?: Array<[string, string]>;
}
"type": "revision";
description: string;
base: string;
oid: string;
resolves?: Array<[string, string]>;
}
| {
type: "revision.edit";
revision: string;
description: string;
embeds?: Array<Embed>;
}
"type": "revision.edit";
revision: string;
description: string;
embeds?: Array<Embed>;
}
| {
type: "revision.react";
revision: string;
location?: CodeLocation;
reaction: string;
active: boolean;
}
| { type: "revision.redact"; revision: string }
"type": "revision.react";
revision: string;
location?: CodeLocation;
reaction: string;
active: boolean;
}
| { "type": "revision.redact"; revision: string }
| {
type: "revision.comment";
revision: string;
location?: CodeLocation;
body: string;
replyTo?: string;
embeds?: Array<Embed>;
}
"type": "revision.comment";
revision: string;
location?: CodeLocation;
body: string;
replyTo?: string;
embeds?: Array<Embed>;
}
| {
type: "revision.comment.edit";
revision: string;
comment: string;
body: string;
embeds?: Array<Embed>;
}
| { type: "revision.comment.redact"; revision: string; comment: string }
"type": "revision.comment.edit";
revision: string;
comment: string;
body: string;
embeds?: Array<Embed>;
}
| { "type": "revision.comment.redact"; revision: string; comment: string }
| {
type: "revision.comment.react";
revision: string;
comment: string;
reaction: string;
active: boolean;
};
"type": "revision.comment.react";
revision: string;
comment: string;
reaction: string;
active: boolean;
};
@@ -1,7 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type State =
| { status: "draft" }
| { status: "open"; conflicts?: Array<[string, string]> }
| { status: "archived" }
| { status: "merged"; revision: string; commit: string };
| { "status": "draft" }
| { "status": "open"; conflicts?: Array<[string, string]> }
| { "status": "archived" }
| { "status": "merged"; revision: string; commit: string };
@@ -1,5 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type CodeRange =
| { type: "lines"; range: { start: number; end: number } }
| { type: "chars"; line: number; range: { start: number; end: number } };
export type CodeRange = {
"type": "lines";
range: { start: number; end: number };
} | { "type": "chars"; line: number; range: { start: number; end: number } };
@@ -15,7 +15,7 @@ export type Config = {
/**
* Default seeding policy.
*/
seedingPolicy:
| { default: "allow"; scope: "followed" | "all" }
| { default: "block" };
seedingPolicy: { default: "allow"; scope: "followed" | "all" } | {
default: "block";
};
};
@@ -1,5 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type Visibility =
| { type: "public" }
| { type: "private"; allow?: Array<string> };
export type Visibility = { "type": "public" } | {
"type": "private";
allow?: Array<string>;
};