Skip to content

Commit

Permalink
BUILD: Upgrade to qubit v0.10.2 and ts_rs v10.1.0. (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
epatters authored Dec 3, 2024
1 parent 1859ccc commit f781f01
Show file tree
Hide file tree
Showing 9 changed files with 558 additions and 276 deletions.
791 changes: 535 additions & 256 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ http = "1.1.0"
hyper = { version = "1.4.1", features = ["server"] }
jsonrpsee = "0.24.6"
jsonrpsee-server = "0.24.6"
qubit = "0.10.0"
qubit = "0.10.2"
serde = { version = "1.0.210", features = ["derive"] }
serde_json = "1.0.128"
socketioxide = { version = "0.14.1", features = ["tracing"] }
Expand All @@ -22,5 +22,5 @@ tower = { version = "0.5.1", features = ["util"] }
tower-http = { version = "0.6.1", features = ["cors", "trace"] }
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
ts-rs = { version = "9.0.1", features = ["serde-json-impl", "uuid-impl"] }
ts-rs = { version = "10.1.0", features = ["serde-json-impl", "uuid-impl"] }
uuid = { version = "1.10.0", features = ["v7", "serde"] }
8 changes: 0 additions & 8 deletions packages/backend/pkg/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/backend/pkg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"author": "Evan Patterson <evan@epatters.org>",
"license": "MIT",
"main": "index.ts",
"main": "src/index.ts",
"scripts": {
"build": "tsc -b"
},
Expand Down
11 changes: 10 additions & 1 deletion packages/backend/pkg/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,21 @@
############### & @@@@@@@@@@@@@ */

import type { RpcResult } from "./RpcResult.ts";
import type { Permissions } from "./Permissions.ts";
import type { JsonValue } from "./serde_json/JsonValue.ts";
import type { Permissions } from "./Permissions.ts";
import type { NewRef } from "./NewRef.ts";
import type { Mutation } from "@qubit-rs/client";
import type { RefDoc } from "./RefDoc.ts";
import type { Query } from "@qubit-rs/client";
import type { RefContent } from "./RefContent.ts";

export type { RpcResult } from "./RpcResult.ts";
export type { JsonValue } from "./serde_json/JsonValue.ts";
export type { Permissions } from "./Permissions.ts";
export type { NewRef } from "./NewRef.ts";
export type { Mutation } from "@qubit-rs/client";
export type { RefDoc } from "./RefDoc.ts";
export type { Query } from "@qubit-rs/client";
export type { RefContent } from "./RefContent.ts";

export type QubitServer = { new_ref: Mutation<[input: NewRef, ], RpcResult<string>>, get_doc: Query<[ref_id: string, ], RpcResult<RefDoc>>, head_snapshot: Query<[ref_id: string, ], RpcResult<JsonValue>>, save_snapshot: Mutation<[data: RefContent, ], RpcResult<null>>, sign_up_or_sign_in: Mutation<[], RpcResult<null>> };
2 changes: 1 addition & 1 deletion packages/backend/pkg/src/serde_json/JsonValue.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export type JsonValue = number | string | Array<JsonValue> | { [key: string]: JsonValue };
export type JsonValue = number | string | boolean | Array<JsonValue> | { [key in string]?: JsonValue } | null;
2 changes: 1 addition & 1 deletion packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@jupyterlab/services": "^7.3.1",
"@kobalte/core": "^0.13.7",
"@modular-forms/solid": "^0.24.1",
"@qubit-rs/client": "^0.4.4",
"@qubit-rs/client": "^0.4.5",
"@solid-primitives/active-element": "^2.0.20",
"@solid-primitives/autofocus": "^0.0.111",
"@solid-primitives/context": "^0.2.3",
Expand Down
10 changes: 5 additions & 5 deletions packages/frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion packages/frontend/src/user/permissions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getAuth, signOut } from "firebase/auth";
import { useAuth, useFirebaseApp } from "solid-firebase";
import { type ComponentProps, Match, Show, Switch, createSignal } from "solid-js";

import type { PermissionLevel, Permissions } from "catcolab-api";
import type { Permissions } from "catcolab-api";
import { Dialog, IconButton } from "../components";
import { Login } from "./login";

Expand Down Expand Up @@ -155,6 +155,8 @@ const PrivatePermissionsButton = (props: {
);
};

type PermissionLevel = Required<Permissions>["user"];

const permissionAdjective = (level?: PermissionLevel) => permissionAdjectives[level ?? "Read"];

const permissionAdjectives: { [level in PermissionLevel]: string } = {
Expand Down

0 comments on commit f781f01

Please sign in to comment.