Radish alpha
r
Radicle desktop app
Radicle
Git (anonymous pull)
Log in to clone via SSH
Use `ts_rs` format feature instead of prettier
Sebastian Martinez committed 1 year ago
commit 54e81832b8f84f417123f3527b0c4ff7866f1bb4
parent 52c25a905d8edbbe98523c1e80e9edfbd2ce7030
11 files changed +129 -119
modified crates/radicle-types/Cargo.toml
@@ -12,5 +12,5 @@ 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 = [ "format", "serde-json-impl", "no-serde-warnings" ] }
localtime = { version = "1.3.1" }
modified crates/radicle-types/bindings/cob/Never.ts
@@ -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;
modified crates/radicle-types/bindings/cob/issue/Action.ts
@@ -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 };
modified crates/radicle-types/bindings/cob/issue/Operation.ts
@@ -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 }
+
  );
modified crates/radicle-types/bindings/cob/issue/State.ts
@@ -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";
+
};
modified crates/radicle-types/bindings/cob/patch/Action.ts
@@ -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;
+
  };
modified crates/radicle-types/bindings/cob/patch/State.ts
@@ -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 };
modified crates/radicle-types/bindings/cob/thread/CodeRange.ts
@@ -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 } };
modified crates/radicle-types/bindings/config/Config.ts
@@ -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";
+
  };
};
modified crates/radicle-types/bindings/repo/Visibility.ts
@@ -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>;
+
};
modified package.json
@@ -16,7 +16,7 @@
    "check-rs": "scripts/check-rs",
    "test:e2e": "TZ='UTC' playwright test",
    "format": "npx prettier '**/*.@(ts|js|svelte|json|css|html|yml)' --write",
-
    "generate-types": "cargo test --manifest-path ./crates/radicle-types/Cargo.toml && npx prettier ./crates/radicle-types/bindings --write",
+
    "generate-types": "cargo test --manifest-path ./crates/radicle-types/Cargo.toml",
    "tauri": "npx tauri"
  },
  "engines": {