Organise files more consistently

Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
This commit is contained in:
Rūdolfs Ošiņš
2022-12-22 16:46:08 +01:00
parent e86accafae
commit caa83db480
130 changed files with 720 additions and 707 deletions
+19 -16
View File
@@ -1,22 +1,25 @@
<script lang="ts">
import { Connection, state, session } from "@app/session";
import { getWallet } from "@app/wallet";
import { initialize, activeRouteStore } from "@app/router";
import { twemoji, unreachable } from "@app/utils";
import Plausible from "plausible-tracker";
import ColorPalette from "@app/ColorPalette.svelte";
import Faucet from "@app/base/faucet/Routes.svelte";
import Header from "@app/Header.svelte";
import Home from "@app/base/home/Index.svelte";
import Loading from "@app/Loading.svelte";
import Modal from "@app/Modal.svelte";
import NotFound from "@app/NotFound.svelte";
import Profile from "@app/Profile.svelte";
import Projects from "@app/base/projects/View.svelte";
import Registrations from "@app/base/registrations/Routes.svelte";
import Seeds from "@app/base/seeds/Routes.svelte";
import Vesting from "@app/base/vesting/Routes.svelte";
import { Connection, state, session } from "@app/lib/session";
import { getWallet } from "@app/lib/wallet";
import { initialize, activeRouteStore } from "@app/lib/router";
import { twemoji, unreachable } from "@app/lib/utils";
import ColorPalette from "./App/ColorPalette.svelte";
import Header from "./App/Header.svelte";
import Loading from "@app/components/Loading.svelte";
import Modal from "@app/components/Modal.svelte";
import NotFound from "@app/components/NotFound.svelte";
import Faucet from "@app/views/faucet/Routes.svelte";
import Home from "@app/views/home/Index.svelte";
import Profile from "@app/views/profiles/Profile.svelte";
import Projects from "@app/views/projects/View.svelte";
import Registrations from "@app/views/registrations/Routes.svelte";
import Seeds from "@app/views/seeds/Routes.svelte";
import Vesting from "@app/views/vesting/Routes.svelte";
initialize();
+19 -18
View File
@@ -1,24 +1,25 @@
<script lang="ts">
import type { Wallet } from "@app/wallet";
import type { ProjectsAndProfiles } from "@app/Search.svelte";
import type { Session } from "@app/session";
import type { Wallet } from "@app/lib/wallet";
import type { ProjectsAndProfiles } from "./Header/Search.svelte";
import type { Session } from "@app/lib/session";
import Avatar from "@app/Avatar.svelte";
import Button from "@app/Button.svelte";
import Connect from "@app/Connect.svelte";
import Floating from "@app/Floating.svelte";
import Icon from "@app/Icon.svelte";
import Link from "@app/router/Link.svelte";
import Loading from "@app/Loading.svelte";
import Logo from "@app/Logo.svelte";
import Search from "@app/Search.svelte";
import SearchResults from "@app/components/Modal/SearchResults.svelte";
import SettingsDropdown from "@app/components/SettingsDropdown.svelte";
import Avatar from "@app/components/Avatar.svelte";
import Button from "@app/components/Button.svelte";
import Connect from "@app/components/Connect.svelte";
import Floating from "@app/components/Floating.svelte";
import Icon from "@app/components/Icon.svelte";
import Link from "@app/components/Link.svelte";
import Loading from "@app/components/Loading.svelte";
import SettingsDropdown from "./Header/SettingsDropdown.svelte";
import { Profile, ProfileType } from "@app/profile";
import { closeFocused } from "@app/Floating.svelte";
import { disconnectWallet } from "@app/session";
import { formatAddress, formatBalance } from "@app/utils";
import Logo from "./Header/Logo.svelte";
import Search from "./Header/Search.svelte";
import SearchResults from "./Header/SearchResults.svelte";
import { Profile, ProfileType } from "@app/lib/profile";
import { closeFocused } from "@app/components/Floating.svelte";
import { disconnectWallet } from "@app/lib/session";
import { formatAddress, formatBalance } from "@app/lib/utils";
export let session: Session | null;
export let wallet: Wallet;
@@ -1,13 +1,13 @@
<script lang="ts" context="module">
import type { Host } from "@app/api";
import type { ProjectInfo } from "@app/project";
import type { Host } from "@app/lib/api";
import type { ProjectInfo } from "@app/lib/project";
import { ethers } from "ethers";
import * as utils from "@app/utils";
import { Profile } from "@app/profile";
import { Project } from "@app/project";
import { config } from "@app/config";
import * as utils from "@app/lib/utils";
import { Profile } from "@app/lib/profile";
import { Project } from "@app/lib/project";
import { config } from "@app/lib/config";
export interface ProjectsAndProfiles {
projects: { info: ProjectInfo; seed: Host }[];
@@ -125,14 +125,14 @@
</script>
<script lang="ts" strictEvents>
import type { Wallet } from "@app/wallet";
import type { Wallet } from "@app/lib/wallet";
import debounce from "lodash/debounce";
import { createEventDispatcher } from "svelte";
import * as router from "@app/router";
import * as router from "@app/lib/router";
import TextInput from "@app/TextInput.svelte";
import { unreachable } from "@app/utils";
import TextInput from "@app/components/TextInput.svelte";
import { unreachable } from "@app/lib/utils";
export let wallet: Wallet;
@@ -1,12 +1,12 @@
<script lang="ts" strictEvents>
import Modal from "@app/Modal.svelte";
import { formatRadicleUrn, getSeedEmoji, twemoji } from "@app/utils";
import type { Wallet } from "@app/wallet";
import Address from "@app/Address.svelte";
import Button from "@app/Button.svelte";
import Modal from "@app/components/Modal.svelte";
import { formatRadicleUrn, getSeedEmoji, twemoji } from "@app/lib/utils";
import type { Wallet } from "@app/lib/wallet";
import Address from "@app/components/Address.svelte";
import Button from "@app/components/Button.svelte";
import { createEventDispatcher } from "svelte";
import type { ProjectsAndProfiles } from "@app/Search.svelte";
import Link from "@app/router/Link.svelte";
import type { ProjectsAndProfiles } from "./Search.svelte";
import Link from "@app/components/Link.svelte";
export let query: string;
export let results: ProjectsAndProfiles;
@@ -1,10 +1,10 @@
<script lang="ts">
import type { CodeFont } from "@app/appearance";
import type { CodeFont } from "@app/lib/appearance";
import Icon from "@app/Icon.svelte";
import ThemeToggle from "@app/ThemeToggle.svelte";
import { codeFont, storeCodeFont } from "@app/appearance";
import { codeFonts } from "@app/appearance";
import Icon from "@app/components/Icon.svelte";
import ThemeToggle from "./ThemeToggle.svelte";
import { codeFont, storeCodeFont } from "@app/lib/appearance";
import { codeFonts } from "@app/lib/appearance";
import { quadIn } from "svelte/easing";
import { slide } from "svelte/transition";
+29
View File
@@ -0,0 +1,29 @@
<script lang="ts">
import Icon from "@app/components/Icon.svelte";
import Toggle from "@app/components/Toggle.svelte";
import { theme, storeTheme } from "@app/lib/appearance";
$: document.documentElement.setAttribute("data-theme", $theme);
</script>
<style>
.theme {
display: flex;
justify-content: center;
align-items: center;
user-select: none;
gap: 0.5rem;
cursor: pointer;
}
</style>
<div class="theme">
<Icon name="sun" on:click={() => theme.set("light")} />
<Toggle
checked={$theme === "dark"}
on:change={() => {
theme.set($theme === "dark" ? "light" : "dark");
storeTheme($theme);
}} />
<Icon name="moon" on:click={() => theme.set("dark")} />
</div>
-50
View File
@@ -1,50 +0,0 @@
<script lang="ts" context="module">
export type Theme = "dark" | "light";
import { writable } from "svelte/store";
export const theme = writable<Theme>(loadTheme());
function storeTheme(theme: Theme): void {
window.localStorage.setItem("theme", theme);
}
function loadTheme(): Theme {
const storedTheme = window.localStorage.getItem("theme");
if (storedTheme === null) {
return "dark";
} else {
return storedTheme as Theme;
}
}
</script>
<script lang="ts">
import Icon from "@app/Icon.svelte";
import Toggle from "@app/Toggle.svelte";
$: document.documentElement.setAttribute("data-theme", $theme);
</script>
<style>
.theme {
display: flex;
justify-content: center;
align-items: center;
user-select: none;
gap: 0.5rem;
cursor: pointer;
}
</style>
<div class="theme">
<Icon name="sun" on:click={() => theme.set("light")} />
<Toggle
checked={$theme === "dark"}
on:change={() => {
theme.set($theme === "dark" ? "light" : "dark");
storeTheme($theme);
}} />
<Icon name="moon" on:click={() => theme.set("dark")} />
</div>
-59
View File
@@ -1,59 +0,0 @@
import type { Wallet } from "@app/wallet";
import * as ethers from "ethers";
import * as cache from "@app/cache";
import * as utils from "@app/utils";
import { assert } from "@app/error";
import ethereumContractAbis from "@app/ethereum/contractAbis.json";
export class Org {
address: string;
owner: string;
name?: string | null;
constructor(address: string, owner: string, name?: string | null) {
assert(ethers.utils.isAddress(address), "address must be valid");
this.address = address.toLowerCase(); // Don't store address checksum.
this.owner = owner;
this.name = name;
}
static async get(addressOrName: string, wallet: Wallet): Promise<Org | null> {
const org = await getOrgContract(addressOrName, wallet);
try {
const [owner, resolved] = await resolveOrgOwner(org);
// If what is resolved is not the same as the input, it's because we
// were given a name.
if (utils.isAddressEqual(addressOrName, resolved)) {
return new Org(resolved, owner, null);
} else {
return new Org(resolved, owner, addressOrName);
}
} catch (e) {
console.error(e);
return null;
}
}
}
export const getOrgContract = cache.cached(
async (addressOrName: string, wallet: Wallet) => {
return new ethers.Contract(
addressOrName,
ethereumContractAbis.org,
wallet.provider,
);
},
addressOrName => addressOrName,
);
export const resolveOrgOwner = cache.cached(
async (org: ethers.Contract) => {
return await Promise.all([org.owner(), org.resolvedAddress]);
},
org => org.address,
);
-26
View File
@@ -1,26 +0,0 @@
import * as ethers from "ethers";
import type { Wallet } from "@app/wallet";
import { assert } from "@app/error";
import type { TransactionResponse } from "@ethersproject/providers";
import ethereumContractAbis from "@app/ethereum/contractAbis.json";
export class User {
address: string;
constructor(address: string) {
assert(ethers.utils.isAddress(address), "address must be valid");
this.address = address.toLowerCase(); // Don't store address checksum.
}
async setName(name: string, wallet: Wallet): Promise<TransactionResponse> {
assert(wallet.signer);
const reverseRegistrar = new ethers.Contract(
wallet.reverseRegistrar.address,
ethereumContractAbis.reverseRegistrar,
wallet.signer,
);
return reverseRegistrar.setName(name);
}
}
@@ -1,19 +1,20 @@
<script lang="ts">
import type { Wallet } from "@app/wallet";
import type { Wallet } from "@app/lib/wallet";
import { onMount } from "svelte";
import { ethers } from "ethers";
import Avatar from "@app/components/Avatar.svelte";
import Badge from "@app/components/Badge.svelte";
import Link from "@app/components/Link.svelte";
import {
AddressType,
explorerLink,
formatAddress,
identifyAddress,
parseEnsLabel,
} from "@app/utils";
import { Profile, ProfileType } from "@app/profile";
import Avatar from "@app/Avatar.svelte";
import Badge from "@app/Badge.svelte";
import Link from "@app/router/Link.svelte";
} from "@app/lib/utils";
import { Profile, ProfileType } from "@app/lib/profile";
export let address: string;
export let wallet: Wallet;
@@ -1,5 +1,5 @@
<script lang="ts">
import Loading from "@app/Loading.svelte";
import Loading from "@app/components/Loading.svelte";
type T = $$Generic;
@@ -1,10 +1,12 @@
<script lang="ts">
import type { Wallet } from "@app/wallet";
import { formatRadicleUrn, formatTimestamp } from "@app/utils";
import Address from "@app/Address.svelte";
import { Profile, ProfileType } from "@app/profile";
import type { Author } from "@app/lib/cobs";
import type { Wallet } from "@app/lib/wallet";
import { onMount } from "svelte";
import type { Author } from "@app/cobs";
import Address from "@app/components/Address.svelte";
import { Profile, ProfileType } from "@app/lib/profile";
import { formatRadicleUrn, formatTimestamp } from "@app/lib/utils";
export let noAvatar = false;
export let author: Author;
@@ -1,6 +1,6 @@
<script lang="ts">
import { createIcon } from "@app/blockies";
import { isAddress, isPeerId, isRadicleId } from "@app/utils";
import { createIcon } from "@app/lib/blockies";
import { isAddress, isPeerId, isRadicleId } from "@app/lib/utils";
export let title: string;
export let source: string;
@@ -1,8 +1,9 @@
<script lang="ts" strictEvents>
import Icon from "@app/Icon.svelte";
import { toClipboard } from "@app/utils";
import { createEventDispatcher } from "svelte";
import Icon from "@app/components/Icon.svelte";
import { toClipboard } from "@app/lib/utils";
const dispatch = createEventDispatcher<{ copied: never }>();
const copy = () => {
@@ -1,15 +1,17 @@
<script lang="ts">
import { onMount } from "svelte";
import type { Wallet } from "@app/wallet";
import type { Comment, Thread } from "@app/issue";
import Avatar from "@app/Avatar.svelte";
import Markdown from "@app/Markdown.svelte";
import ReactionSelector from "@app/ReactionSelector.svelte";
import type { Blob } from "@app/project";
import { Profile, ProfileType } from "@app/profile";
import type { Blob } from "@app/lib/project";
import type { Comment, Thread } from "@app/lib/issue";
import type { Wallet } from "@app/lib/wallet";
import Authorship from "@app/Authorship.svelte";
import Reactions from "@app/Reactions.svelte";
import { onMount } from "svelte";
import Authorship from "@app/components/Authorship.svelte";
import Avatar from "@app/components/Avatar.svelte";
import Markdown from "@app/components/Markdown.svelte";
import ReactionSelector from "./Comment/ReactionSelector.svelte";
import Reactions from "./Comment/Reactions.svelte";
import { Profile, ProfileType } from "@app/lib/profile";
export let comment: Comment | Thread;
export let wallet: Wallet;
@@ -1,8 +1,8 @@
<!-- TODO: Once we are able to add reactions, we should allow people to interact with the reaction handler -->
<script lang="ts" strictEvents>
import { createEventDispatcher } from "svelte";
import Icon from "@app/Icon.svelte";
import { config } from "@app/config";
import Icon from "@app/components/Icon.svelte";
import { config } from "@app/lib/config";
const showReactions = false;
@@ -1,6 +1,6 @@
<script lang="ts" strictEvents>
import { createEventDispatcher } from "svelte";
import Button from "@app/Button.svelte";
import Button from "@app/components/Button.svelte";
export let reactions: Record<string, number> | null = null;
@@ -1,11 +1,14 @@
<script lang="ts">
import type { Err } from "@app/lib/error";
import type { Wallet } from "@app/lib/wallet";
import { get } from "svelte/store";
import { Connection, state } from "@app/session";
import type { Err } from "@app/error";
import ErrorModal from "@app/ErrorModal.svelte";
import type { Wallet } from "@app/wallet";
import ConnectWallet from "@app/components/Modal/ConnectWallet.svelte";
import Button from "@app/Button.svelte";
import Button from "@app/components/Button.svelte";
import ConnectWallet from "@app/components/Connect/ConnectWallet.svelte";
import ErrorModal from "@app/components/ErrorModal.svelte";
import { Connection, state } from "@app/lib/session";
export let caption = "Connect";
export let wallet: Wallet;
@@ -1,13 +1,13 @@
<script lang="ts" strictEvents>
import type { Wallet } from "@app/wallet";
import type { Wallet } from "@app/lib/wallet";
import { createEventDispatcher } from "svelte";
import { qrcode } from "pure-svg-code";
import Button from "@app/Button.svelte";
import Modal from "@app/Modal.svelte";
import { state } from "@app/session";
import { twemoji } from "@app/utils";
import Button from "@app/components/Button.svelte";
import Modal from "@app/components/Modal.svelte";
import { state } from "@app/lib/session";
import { twemoji } from "@app/lib/utils";
export let uri: string;
export let wallet: Wallet;
@@ -1,7 +1,8 @@
<script lang="ts" strictEvents>
import { createEventDispatcher } from "svelte";
import Badge from "@app/Badge.svelte";
import { twemoji } from "@app/utils";
import { twemoji } from "@app/lib/utils";
import Badge from "@app/components/Badge.svelte";
export let items: {
key: string;
@@ -1,10 +1,12 @@
<script lang="ts" strictEvents>
import type { Err } from "@app/error";
import type { Err } from "@app/lib/error";
import Button from "@app/Button.svelte";
import Modal from "@app/Modal.svelte";
import { createEventDispatcher } from "svelte";
import { twemoji } from "@app/utils";
import Button from "@app/components/Button.svelte";
import Modal from "@app/components/Modal.svelte";
import { twemoji } from "@app/lib/utils";
const dispatch = createEventDispatcher<{ close: never }>();
@@ -49,7 +49,7 @@
</script>
<script lang="ts" strictEvents>
import type { Wallet } from "@app/wallet";
import type { Wallet } from "@app/lib/wallet";
import cloneDeep from "lodash/cloneDeep";
import { createEventDispatcher } from "svelte";
@@ -60,11 +60,11 @@
isUrl,
isAddress,
formatSeedId,
} from "@app/utils";
} from "@app/lib/utils";
import Address from "@app/Address.svelte";
import Button from "@app/Button.svelte";
import TextInput from "@app/TextInput.svelte";
import Address from "@app/components/Address.svelte";
import Button from "@app/components/Button.svelte";
import TextInput from "@app/components/TextInput.svelte";
export let fields: Field[];
export let editable = false;
@@ -1,5 +1,5 @@
<script lang="ts">
import { unreachable } from "@app/utils";
import { unreachable } from "@app/lib/utils";
export let name:
| "browse"
@@ -1,7 +1,8 @@
<script lang="ts" strictEvents>
import type { Route } from "@app/lib/router/definitions";
import { createEventDispatcher } from "svelte";
import type { Route } from "./definitions";
import { push, routeToPath } from "./index";
import { push, routeToPath } from "@app/lib/router";
export let route: Route;
export let title: string | null = null;
@@ -1,8 +1,9 @@
<script lang="ts">
import Button from "@app/Button.svelte";
import Loading from "@app/Loading.svelte";
import { fade } from "svelte/transition";
import Button from "@app/components/Button.svelte";
import Loading from "@app/components/Loading.svelte";
type Item = $$Generic;
export let complete = false;
@@ -1,10 +1,14 @@
<script lang="ts">
import type * as proj from "@app/project";
import type * as proj from "@app/lib/project";
import dompurify from "dompurify";
import matter from "@radicle/gray-matter";
import { base } from "@app/router";
import { highlight } from "@app/syntax";
import { marked } from "marked";
import { onMount } from "svelte";
import { toDom } from "hast-util-to-dom";
import { base } from "@app/lib/router";
import { highlight } from "@app/lib/syntax";
import {
markdownExtensions as extensions,
renderer,
@@ -12,10 +16,7 @@
isUrl,
twemoji,
scrollIntoView,
} from "@app/utils";
import { marked } from "marked";
import { onMount } from "svelte";
import { toDom } from "hast-util-to-dom";
} from "@app/lib/utils";
export let content: string;
export let doc = matter(content);
@@ -1,9 +1,9 @@
<script lang="ts">
import * as router from "@app/router";
import { twemoji } from "@app/utils";
import * as router from "@app/lib/router";
import { twemoji } from "@app/lib/utils";
import Button from "@app/Button.svelte";
import Modal from "@app/Modal.svelte";
import Button from "@app/components/Button.svelte";
import Modal from "@app/components/Modal.svelte";
export let title = "";
export let subtitle = "";
@@ -1,5 +1,5 @@
<script lang="ts">
import { twemoji } from "@app/utils";
import { twemoji } from "@app/lib/utils";
export let emoji: string;
</script>
@@ -1,6 +1,6 @@
<script lang="ts">
import type { ProjectsParams } from "./definitions";
import { updateProjectRoute, projectLinkHref } from "./index";
import type { ProjectsParams } from "@app/lib/router/definitions";
import { updateProjectRoute, projectLinkHref } from "@app/lib/router";
export let projectParams: Partial<ProjectsParams>;
export let id: string | undefined = undefined;
@@ -1,6 +1,6 @@
<script lang="ts">
import { parseRadicleId, toClipboard, twemoji } from "@app/utils";
import Button from "@app/Button.svelte";
import { parseRadicleId, toClipboard, twemoji } from "@app/lib/utils";
import Button from "@app/components/Button.svelte";
export let urn: string;
@@ -1,13 +1,14 @@
<script lang="ts">
import type { Seed } from "@app/lib/seed";
import Clipboard from "@app/components/Clipboard.svelte";
import Link from "@app/components/Link.svelte";
import {
formatSeedAddress,
formatSeedId,
formatSeedHost,
twemoji,
} from "@app/utils";
import type { Seed } from "@app/base/seeds/Seed";
import Clipboard from "@app/Clipboard.svelte";
import Link from "@app/router/Link.svelte";
} from "@app/lib/utils";
export let seed: Seed;
export let port: number;
@@ -2,7 +2,7 @@
import { createEventDispatcher } from "svelte";
import { onMount } from "svelte";
import Loading from "@app/Loading.svelte";
import Loading from "@app/components/Loading.svelte";
export let name: string | undefined = undefined;
export let placeholder: string | undefined = undefined;
@@ -10,7 +10,7 @@
type T = $$Generic;
import { createEventDispatcher } from "svelte";
import { capitalize } from "@app/utils";
import { capitalize } from "@app/lib/utils";
export let options: ToggleButtonOption<T>[];
export let active: T;
+1 -1
View File
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/naming-convention */
import type { Config } from "@app/config";
import type { Config } from "@app/lib/config";
import type { FakeTimers } from "@sinonjs/fake-timers";
declare global {
+2 -2
View File
@@ -1,5 +1,5 @@
if (window.PLAYWRIGHT) import("./e2eTestStubs");
import App from "./App.svelte";
if (window.PLAYWRIGHT) import("@app/lib/e2eTestStubs");
import App from "@app/App.svelte";
const app = new App({
target: document.body,
View File
@@ -1,5 +1,8 @@
import { writable } from "svelte/store";
export type Theme = "dark" | "light";
export const theme = writable<Theme>(loadTheme());
export type CodeFont = "jetbrains" | "system";
export const codeFont = writable<CodeFont>(loadCodeFont());
@@ -29,3 +32,17 @@ export const codeFonts: {
},
{ storedName: "system", fontFamily: "monospace", displayName: "System" },
];
function loadTheme(): Theme {
const storedTheme = window.localStorage.getItem("theme");
if (storedTheme === null) {
return "dark";
} else {
return storedTheme as Theme;
}
}
export function storeTheme(theme: Theme): void {
window.localStorage.setItem("theme", theme);
}
View File
+1 -1
View File
@@ -1,4 +1,4 @@
import type { PeerId } from "@app/project";
import type { PeerId } from "@app/lib/project";
export interface Author {
peer: PeerId;
+4 -4
View File
@@ -1,7 +1,7 @@
import type { Stats, Person } from "@app/project";
import type { Diff } from "@app/diff";
import { ApiError } from "@app/api";
import { getDaysPassed } from "@app/utils";
import type { Stats, Person } from "@app/lib/project";
import type { Diff } from "@app/lib/diff";
import { ApiError } from "@app/lib/api";
import { getDaysPassed } from "@app/lib/utils";
export interface CommitsHistory {
headers: CommitMetadata[];
View File
View File
View File
View File
+8 -7
View File
@@ -1,12 +1,13 @@
import type { TransactionResponse } from "@ethersproject/providers";
import type { TypedDataSigner } from "@ethersproject/abstract-signer";
import type { Wallet } from "@app/lib/wallet";
import type { WalletConnectSigner } from "@app/lib/walletConnectSigner";
import * as ethers from "ethers";
import type { Wallet } from "@app/wallet";
import { assert } from "@app/error";
import type { TransactionResponse } from "@ethersproject/providers";
import { toWei } from "@app/utils";
import type { WalletConnectSigner } from "@app/WalletConnectSigner";
import type { TypedDataSigner } from "@ethersproject/abstract-signer";
import ethereumContractAbis from "@app/ethereum/contractAbis.json";
import ethereumContractAbis from "@app/lib/ethereum/contractAbis.json";
import { assert } from "@app/lib/error";
import { toWei } from "@app/lib/utils";
type Signer = (ethers.Signer & TypedDataSigner) | WalletConnectSigner | null;
+2 -2
View File
@@ -1,5 +1,5 @@
import { type Host, Request } from "@app/api";
import type { Author } from "@app/cobs";
import { type Host, Request } from "@app/lib/api";
import type { Author } from "@app/lib/cobs";
export interface TimelineItem {
person: Author;
+8 -7
View File
@@ -1,10 +1,11 @@
import type { PeerId, Urn } from "@app/project";
import type { Host } from "@app/api";
import { Request } from "@app/api";
import type { Comment, Thread } from "@app/issue";
import type { Author, PeerInfo } from "@app/cobs";
import type { Diff } from "@app/diff";
import type { Commit, DiffStats } from "@app/commit";
import type { Author, PeerInfo } from "@app/lib/cobs";
import type { Comment, Thread } from "@app/lib/issue";
import type { Commit, DiffStats } from "@app/lib/commit";
import type { Diff } from "@app/lib/diff";
import type { Host } from "@app/lib/api";
import type { PeerId, Urn } from "@app/lib/project";
import { Request } from "@app/lib/api";
export interface IPatch {
id: string;
+86 -7
View File
@@ -1,4 +1,16 @@
import type { EnsProfile } from "@app/base/registrations/registrar";
import type { EnsProfile } from "@app/lib/registrar";
import type { Seed, InvalidSeed } from "@app/lib/seed";
import type { TransactionResponse } from "@ethersproject/providers";
import type { Wallet } from "@app/lib/wallet";
import * as ethers from "ethers";
import * as cache from "@app/lib/cache";
import * as utils from "@app/lib/utils";
import ethereumContractAbis from "@app/lib/ethereum/contractAbis.json";
import { NotFoundError, MissingReverseRecord } from "@app/lib/error";
import { assert } from "@app/lib/error";
import { cached } from "@app/lib/cache";
import {
isAddress,
resolveEnsProfile,
@@ -6,12 +18,79 @@ import {
AddressType,
identifyAddress,
isFulfilled,
} from "@app/utils";
import type { Wallet } from "@app/wallet";
import { cached } from "@app/cache";
import type { Seed, InvalidSeed } from "@app/base/seeds/Seed";
import { Org } from "@app/base/orgs/Org";
import { NotFoundError, MissingReverseRecord } from "@app/error";
} from "@app/lib/utils";
class Org {
address: string;
owner: string;
name?: string | null;
constructor(address: string, owner: string, name?: string | null) {
assert(ethers.utils.isAddress(address), "address must be valid");
this.address = address.toLowerCase(); // Don't store address checksum.
this.owner = owner;
this.name = name;
}
static async get(addressOrName: string, wallet: Wallet): Promise<Org | null> {
const org = await getOrgContract(addressOrName, wallet);
try {
const [owner, resolved] = await resolveOrgOwner(org);
// If what is resolved is not the same as the input, it's because we
// were given a name.
if (utils.isAddressEqual(addressOrName, resolved)) {
return new Org(resolved, owner, null);
} else {
return new Org(resolved, owner, addressOrName);
}
} catch (e) {
console.error(e);
return null;
}
}
}
export class User {
address: string;
constructor(address: string) {
assert(ethers.utils.isAddress(address), "address must be valid");
this.address = address.toLowerCase(); // Don't store address checksum.
}
async setName(name: string, wallet: Wallet): Promise<TransactionResponse> {
assert(wallet.signer);
const reverseRegistrar = new ethers.Contract(
wallet.reverseRegistrar.address,
ethereumContractAbis.reverseRegistrar,
wallet.signer,
);
return reverseRegistrar.setName(name);
}
}
const getOrgContract = cache.cached(
async (addressOrName: string, wallet: Wallet) => {
return new ethers.Contract(
addressOrName,
ethereumContractAbis.org,
wallet.provider,
);
},
addressOrName => addressOrName,
);
const resolveOrgOwner = cache.cached(
async (org: ethers.Contract) => {
return await Promise.all([org.owner(), org.resolvedAddress]);
},
org => org.address,
);
export interface IProfile {
address: string;
+7 -6
View File
@@ -1,9 +1,10 @@
import { type Host, Request } from "@app/api";
import type { Commit, CommitHeader, CommitsHistory } from "@app/commit";
import { isFulfilled, isOid, isRadicleId } from "@app/utils";
import { Profile, ProfileType } from "@app/profile";
import { Seed } from "@app/base/seeds/Seed";
import type { Wallet } from "@app/wallet";
import type { Commit, CommitHeader, CommitsHistory } from "@app/lib/commit";
import type { Wallet } from "@app/lib/wallet";
import { type Host, Request } from "@app/lib/api";
import { Profile, ProfileType } from "@app/lib/profile";
import { Seed } from "@app/lib/seed";
import { isFulfilled, isOid, isRadicleId } from "@app/lib/utils";
export type Urn = string;
export type PeerId = string;
@@ -1,16 +1,18 @@
import { ethers } from "ethers";
import { writable } from "svelte/store";
import type { BigNumber } from "ethers";
import type { EnsResolver } from "@ethersproject/providers";
import type { TypedDataSigner } from "@ethersproject/abstract-signer";
import * as session from "@app/session";
import { Failure } from "@app/error";
import type { Wallet } from "@app/wallet";
import { isFulfilled, unixTime } from "@app/utils";
import { assert } from "@app/error";
import { Seed, InvalidSeed } from "@app/base/seeds/Seed";
import * as cache from "@app/cache";
import ethereumContractAbis from "@app/ethereum/contractAbis.json";
import type { Wallet } from "@app/lib/wallet";
import { ethers } from "ethers";
import { writable } from "svelte/store";
import * as cache from "@app/lib/cache";
import * as session from "@app/lib/session";
import ethereumContractAbis from "@app/lib/ethereum/contractAbis.json";
import { Failure } from "@app/lib/error";
import { Seed, InvalidSeed } from "@app/lib/seed";
import { assert } from "@app/lib/error";
import { isFulfilled, unixTime } from "@app/lib/utils";
export interface Registration {
profile: EnsProfile;
@@ -1,9 +1,10 @@
import type { TransactionResponse } from "@ethersproject/providers";
import type { EnsResolver } from "@ethersproject/providers";
import type { TransactionResponse } from "@ethersproject/providers";
import type { Wallet } from "@app/lib/wallet";
import ethereumContractAbis from "@app/lib/ethereum/contractAbis.json";
import { assert } from "@app/lib/error";
import { ethers } from "ethers";
import type { Wallet } from "@app/wallet";
import { assert } from "@app/error";
import ethereumContractAbis from "@app/ethereum/contractAbis.json";
export type EnsRecord = { name: string; value: string };
+2 -2
View File
@@ -1,8 +1,8 @@
import type { ProjectsParams, Route, ProjectRoute } from "./definitions";
import type { ProjectsParams, Route, ProjectRoute } from "./router/definitions";
import type { Readable } from "svelte/store";
import { get, writable, derived } from "svelte/store";
import { unreachable } from "@app/utils";
import { unreachable } from "@app/lib/utils";
// This is only respected by Safari.
const documentTitle = "Radicle Interface";
@@ -1,4 +1,4 @@
import type { VestingInfo } from "@app/base/vesting/vesting";
import type { VestingInfo } from "@app/lib/vesting";
export type Route =
| FaucetRoute
+7 -5
View File
@@ -1,8 +1,10 @@
import { Request, type Host } from "@app/api";
import * as proj from "@app/project";
import { isDomain } from "@app/utils";
import { assert } from "@app/error";
import { getSeedEmoji } from "@app/utils";
import type { Host } from "@app/lib/api";
import * as proj from "@app/lib/project";
import { Request } from "@app/lib/api";
import { assert } from "@app/lib/error";
import { getSeedEmoji } from "@app/lib/utils";
import { isDomain } from "@app/lib/utils";
export interface Stats {
projects: { count: number };
+7 -5
View File
@@ -1,15 +1,17 @@
import { get, writable, derived } from "svelte/store";
import type { Readable } from "svelte/store";
import type { BigNumber } from "ethers";
import type { Readable } from "svelte/store";
import type {
TransactionReceipt,
TransactionResponse,
} from "@ethersproject/providers";
import { Wallet, getWallet } from "@app/wallet";
import { Unreachable, assert, assertEq } from "@app/error";
import type { TypedDataSigner } from "@ethersproject/abstract-signer";
import type { WalletConnectSigner } from "./WalletConnectSigner";
import type { WalletConnectSigner } from "@app/lib/walletConnectSigner";
import * as ethers from "ethers";
import { get, writable, derived } from "svelte/store";
import { Unreachable, assert, assertEq } from "@app/lib/error";
import { Wallet, getWallet } from "@app/lib/wallet";
export enum Connection {
Disconnected,
+12 -16
View File
@@ -1,26 +1,22 @@
import type { EnsProfile } from "@app/base/registrations/registrar";
import type { Wallet } from "@app/wallet";
import type { EnsProfile } from "@app/lib/registrar";
import type { Wallet } from "@app/lib/wallet";
import type { marked } from "marked";
import * as cache from "@app/cache";
import emojis from "@app/emojis";
import katex from "katex";
import md5 from "md5";
import twemojiModule from "twemoji";
import { BigNumber } from "ethers";
import { ProfileType } from "@app/profile";
import { assert } from "@app/error";
import { base } from "@app/router";
import { config } from "@app/config";
import { ethers } from "ethers";
import { getAddress, getResolver } from "@app/base/registrations/registrar";
import {
getAvatar,
getSeed,
getRegistration,
} from "@app/base/registrations/registrar";
import { BigNumber, ethers } from "ethers";
import { parseUnits } from "@ethersproject/units";
import * as cache from "@app/lib/cache";
import emojis from "@app/lib/emojis";
import { ProfileType } from "@app/lib/profile";
import { assert } from "@app/lib/error";
import { base } from "@app/lib/router";
import { config } from "@app/lib/config";
import { getAddress, getResolver } from "@app/lib/registrar";
import { getAvatar, getSeed, getRegistration } from "@app/lib/registrar";
export enum AddressType {
Contract,
Org,
@@ -1,12 +1,12 @@
import type { Wallet } from "@app/wallet";
import type { Wallet } from "@app/lib/wallet";
import { ethers } from "ethers";
import { assert } from "@app/error";
import { writable } from "svelte/store";
import * as session from "@app/session";
import * as utils from "@app/utils";
import ethereumContractAbis from "@app/ethereum/contractAbis.json";
import * as session from "@app/lib/session";
import * as utils from "@app/lib/utils";
import ethereumContractAbis from "@app/lib/ethereum/contractAbis.json";
import { assert } from "@app/lib/error";
export interface VestingInfo {
token: string;
+6 -6
View File
@@ -5,12 +5,12 @@ import WalletConnect from "@walletconnect/client";
import { ethers } from "ethers";
import { get, writable } from "svelte/store";
import { WalletConnectSigner } from "@app/WalletConnectSigner";
import { capitalize } from "@app/utils";
import ethereumContractAbis from "@app/ethereum/contractAbis.json";
import homestead from "@app/ethereum/networks/homestead.json";
import goerli from "@app/ethereum/networks/goerli.json";
import { config } from "@app/config";
import ethereumContractAbis from "@app/lib/ethereum/contractAbis.json";
import goerli from "@app/lib/ethereum/networks/goerli.json";
import homestead from "@app/lib/ethereum/networks/homestead.json";
import { WalletConnectSigner } from "@app/lib/walletConnectSigner";
import { capitalize } from "@app/lib/utils";
import { config } from "@app/lib/config";
interface NetworkConfig {
name: string;
@@ -1,18 +1,19 @@
import type WalletConnect from "@walletconnect/client";
import * as ethers from "ethers";
import * as ethersBytes from "@ethersproject/bytes";
import type { Deferrable } from "@ethersproject/properties";
import type {
TransactionRequest,
TransactionResponse,
} from "@ethersproject/abstract-provider";
import { resolveProperties } from "@ethersproject/properties";
import type { Deferrable } from "@ethersproject/properties";
import { _TypedDataEncoder } from "ethers/lib/utils";
import type {
TypedDataDomain,
TypedDataField,
} from "@ethersproject/abstract-signer";
import * as ethers from "ethers";
import * as ethersBytes from "@ethersproject/bytes";
import { _TypedDataEncoder } from "ethers/lib/utils";
import { resolveProperties } from "@ethersproject/properties";
export class WalletConnectSigner extends ethers.Signer {
public walletConnect: WalletConnect;
public readonly provider: ethers.providers.JsonRpcProvider;
@@ -1,18 +1,18 @@
<script lang="ts">
import type { Wallet } from "@app/wallet";
import type { Wallet } from "@app/lib/wallet";
import { formatEther } from "@ethersproject/units";
import * as router from "@app/router";
import Button from "@app/Button.svelte";
import TextInput from "@app/TextInput.svelte";
import * as router from "@app/lib/router";
import Button from "@app/components/Button.svelte";
import TextInput from "@app/components/TextInput.svelte";
import {
calculateTimeLock,
getMaxWithdrawAmount,
lastWithdrawalByUser,
} from "./lib";
import { session } from "@app/session";
import { setOpenGraphMetaTag, toWei, capitalize } from "@app/utils";
} from "@app/lib/faucet";
import { session } from "@app/lib/session";
import { setOpenGraphMetaTag, toWei, capitalize } from "@app/lib/utils";
export let wallet: Wallet;
@@ -1,9 +1,9 @@
<script lang="ts">
import type { Wallet } from "@app/wallet";
import type { FaucetRoute } from "@app/router/definitions";
import type { Wallet } from "@app/lib/wallet";
import type { FaucetRoute } from "@app/lib/router/definitions";
import Form from "@app/base/faucet/Form.svelte";
import Withdraw from "@app/base/faucet/Withdraw.svelte";
import Form from "@app/views/faucet/Form.svelte";
import Withdraw from "@app/views/faucet/Withdraw.svelte";
export let activeRoute: FaucetRoute;
export let wallet: Wallet;
@@ -1,18 +1,18 @@
<script lang="ts">
import type { State } from "@app/utils";
import type { Wallet } from "@app/wallet";
import type { State } from "@app/lib/utils";
import type { Wallet } from "@app/lib/wallet";
import { onMount } from "svelte";
import { twemoji } from "@app/utils";
import { twemoji } from "@app/lib/utils";
import * as router from "@app/router";
import Button from "@app/Button.svelte";
import ErrorModal from "@app/ErrorModal.svelte";
import Loading from "@app/Loading.svelte";
import Modal from "@app/Modal.svelte";
import { Status } from "@app/utils";
import { session } from "@app/session";
import { withdraw } from "./lib";
import * as router from "@app/lib/router";
import Button from "@app/components/Button.svelte";
import ErrorModal from "@app/components/ErrorModal.svelte";
import Loading from "@app/components/Loading.svelte";
import Modal from "@app/components/Modal.svelte";
import { Status } from "@app/lib/utils";
import { session } from "@app/lib/session";
import { withdraw } from "@app/lib/faucet";
export let wallet: Wallet;
export let amount: string | null;
@@ -1,14 +1,14 @@
<script lang="ts">
import type { Host } from "@app/api";
import type { ProjectInfo } from "@app/project";
import type { Host } from "@app/lib/api";
import type { ProjectInfo } from "@app/lib/project";
import * as router from "@app/router";
import Loading from "@app/Loading.svelte";
import Message from "@app/Message.svelte";
import Widget from "@app/base/projects/Widget.svelte";
import { config } from "@app/config";
import { Project } from "@app/project";
import { setOpenGraphMetaTag, twemoji } from "@app/utils";
import * as router from "@app/lib/router";
import Loading from "@app/components/Loading.svelte";
import Message from "@app/components/Message.svelte";
import Widget from "@app/views/projects/Widget.svelte";
import { config } from "@app/lib/config";
import { Project } from "@app/lib/project";
import { setOpenGraphMetaTag, twemoji } from "@app/lib/utils";
setOpenGraphMetaTag([
{ prop: "og:title", content: "Radicle Interface" },
@@ -1,28 +1,27 @@
<script lang="ts">
import type { SvelteComponent } from "svelte";
import type { Wallet } from "@app/wallet";
import type { Seed, Stats } from "@app/base/seeds/Seed";
import type { ProjectInfo } from "@app/project";
import * as utils from "@app/utils";
import Address from "@app/Address.svelte";
import Async from "@app/Async.svelte";
import Avatar from "@app/Avatar.svelte";
import Badge from "@app/Badge.svelte";
import Button from "@app/Button.svelte";
import ErrorModal from "@app/ErrorModal.svelte";
import Icon from "@app/Icon.svelte";
import Link from "@app/router/Link.svelte";
import Loading from "@app/Loading.svelte";
import NotFound from "@app/NotFound.svelte";
import Projects from "@app/base/seeds/View/Projects.svelte";
import RadicleUrn from "@app/RadicleUrn.svelte";
import SeedAddress from "@app/SeedAddress.svelte";
import SetName from "@app/ens/SetName.svelte";
import { MissingReverseRecord, NotFoundError } from "@app/error";
import { Profile, ProfileType } from "@app/profile";
import { User } from "@app/base/users/User";
import { defaultLinkPort } from "@app/base/seeds/Seed";
import { session } from "@app/session";
import type { Wallet } from "@app/lib/wallet";
import type { Seed, Stats } from "@app/lib/seed";
import type { ProjectInfo } from "@app/lib/project";
import * as utils from "@app/lib/utils";
import Address from "@app/components/Address.svelte";
import Async from "@app/components/Async.svelte";
import Avatar from "@app/components/Avatar.svelte";
import Badge from "@app/components/Badge.svelte";
import Button from "@app/components/Button.svelte";
import ErrorModal from "@app/components/ErrorModal.svelte";
import Icon from "@app/components/Icon.svelte";
import Link from "@app/components/Link.svelte";
import Loading from "@app/components/Loading.svelte";
import NotFound from "@app/components/NotFound.svelte";
import Projects from "@app/views/seeds/View/Projects.svelte";
import RadicleUrn from "@app/components/RadicleUrn.svelte";
import SeedAddress from "@app/components/SeedAddress.svelte";
import SetName from "./SetName.svelte";
import { MissingReverseRecord, NotFoundError } from "@app/lib/error";
import { User, Profile, ProfileType } from "@app/lib/profile";
import { defaultLinkPort } from "@app/lib/seed";
import { session } from "@app/lib/session";
export let wallet: Wallet;
export let addressOrName: string;
@@ -1,16 +1,16 @@
<script lang="ts" strictEvents>
import type { Wallet } from "@app/wallet";
import type { User } from "@app/base/users/User";
import type { Wallet } from "@app/lib/wallet";
import type { User } from "@app/lib/profile";
import { createEventDispatcher } from "svelte";
import * as router from "@app/router";
import Button from "@app/Button.svelte";
import ErrorModal from "@app/ErrorModal.svelte";
import Loading from "@app/Loading.svelte";
import Modal from "@app/Modal.svelte";
import TextInput from "@app/TextInput.svelte";
import { formatAddress, isAddressEqual, twemoji } from "@app/utils";
import * as router from "@app/lib/router";
import Button from "@app/components/Button.svelte";
import ErrorModal from "@app/components/ErrorModal.svelte";
import Loading from "@app/components/Loading.svelte";
import Modal from "@app/components/Modal.svelte";
import TextInput from "@app/components/TextInput.svelte";
import { formatAddress, isAddressEqual, twemoji } from "@app/lib/utils";
const dispatch = createEventDispatcher<{ close: never }>();
@@ -1,16 +1,16 @@
<script lang="ts">
import type { MaybeBlob, Blob } from "@app/project";
import type { MaybeHighlighted } from "@app/syntax";
import type { ProjectRoute } from "@app/router/definitions";
import type { MaybeBlob, Blob } from "@app/lib/project";
import type { MaybeHighlighted } from "@app/lib/syntax";
import type { ProjectRoute } from "@app/lib/router/definitions";
import HeaderToggleLabel from "@app/base/projects/HeaderToggleLabel.svelte";
import Readme from "@app/base/projects/Readme.svelte";
import HeaderToggleLabel from "@app/views/projects/HeaderToggleLabel.svelte";
import Readme from "@app/views/projects/Readme.svelte";
import { afterUpdate, beforeUpdate, onMount } from "svelte";
import { highlight } from "@app/syntax";
import { isMarkdownPath, scrollIntoView, twemoji } from "@app/utils";
import { lineNumbersGutter } from "@app/syntax";
import { highlight } from "@app/lib/syntax";
import { isMarkdownPath, scrollIntoView, twemoji } from "@app/lib/utils";
import { lineNumbersGutter } from "@app/lib/syntax";
import { toHtml } from "hast-util-to-html";
import { updateProjectRoute } from "@app/router";
import { updateProjectRoute } from "@app/lib/router";
export let activeRoute: ProjectRoute;
export let blob: Blob;
@@ -1,10 +1,10 @@
<script lang="ts" strictEvents>
import { createEventDispatcher } from "svelte";
import type { ProjectInfo, Branches } from "@app/project";
import { getOid } from "@app/project";
import { formatCommit } from "@app/utils";
import Dropdown from "@app/Dropdown.svelte";
import Floating from "@app/Floating.svelte";
import type { ProjectInfo, Branches } from "@app/lib/project";
import { getOid } from "@app/lib/project";
import { formatCommit } from "@app/lib/utils";
import Dropdown from "@app/components/Dropdown.svelte";
import Floating from "@app/components/Floating.svelte";
export let branches: Branches;
export let project: ProjectInfo;
@@ -7,14 +7,14 @@
</script>
<script lang="ts">
import type * as proj from "@app/project";
import type { ProjectRoute } from "@app/router/definitions";
import type * as proj from "@app/lib/project";
import type { ProjectRoute } from "@app/lib/router/definitions";
import * as router from "@app/router";
import * as utils from "@app/utils";
import Button from "@app/Button.svelte";
import Loading from "@app/Loading.svelte";
import Placeholder from "@app/Placeholder.svelte";
import * as router from "@app/lib/router";
import * as utils from "@app/lib/utils";
import Button from "@app/components/Button.svelte";
import Loading from "@app/components/Loading.svelte";
import Placeholder from "@app/components/Placeholder.svelte";
import { onMount } from "svelte";
import Tree from "./Tree.svelte";
@@ -1,8 +1,8 @@
<script lang="ts">
import * as utils from "@app/utils";
import Clipboard from "@app/Clipboard.svelte";
import Floating from "@app/Floating.svelte";
import { closeFocused } from "@app/Floating.svelte";
import * as utils from "@app/lib/utils";
import Clipboard from "@app/components/Clipboard.svelte";
import Floating from "@app/components/Floating.svelte";
import { closeFocused } from "@app/components/Floating.svelte";
export let seedHost: string;
export let urn: string;
@@ -1,12 +1,12 @@
<script lang="ts">
import type { Commit } from "@app/commit";
import type { Commit } from "@app/lib/commit";
import { formatCommit, twemoji } from "@app/utils";
import { formatCommit, twemoji } from "@app/lib/utils";
import Changeset from "@app/base/projects/SourceBrowser/Changeset.svelte";
import CommitAuthorship from "@app/base/projects/Commit/CommitAuthorship.svelte";
import CommitVerifiedBadge from "@app/base/projects/Commit/CommitVerifiedBadge.svelte";
import * as router from "@app/router";
import Changeset from "@app/views/projects/SourceBrowser/Changeset.svelte";
import CommitAuthorship from "@app/views/projects/Commit/CommitAuthorship.svelte";
import CommitVerifiedBadge from "@app/views/projects/Commit/CommitVerifiedBadge.svelte";
import * as router from "@app/lib/router";
export let commit: Commit;
@@ -1,8 +1,8 @@
<script lang="ts">
import type { CommitMetadata } from "@app/commit";
import type { CommitMetadata } from "@app/lib/commit";
import Badge from "@app/Badge.svelte";
import { formatTimestamp, gravatarURL } from "@app/utils";
import Badge from "@app/components/Badge.svelte";
import { formatTimestamp, gravatarURL } from "@app/lib/utils";
export let commit: CommitMetadata;
export let noTime = false;
@@ -1,9 +1,9 @@
<script lang="ts" strictEvents>
import type { CommitMetadata } from "@app/commit";
import { formatCommit, twemoji } from "@app/utils";
import type { CommitMetadata } from "@app/lib/commit";
import { formatCommit, twemoji } from "@app/lib/utils";
import { createEventDispatcher } from "svelte";
import Icon from "@app/Icon.svelte";
import Icon from "@app/components/Icon.svelte";
import CommitAuthorship from "./CommitAuthorship.svelte";
import CommitVerifiedBadge from "./CommitVerifiedBadge.svelte";
@@ -1,9 +1,9 @@
<script lang="ts">
import type { CommitMetadata } from "@app/commit";
import type { CommitMetadata } from "@app/lib/commit";
import debounce from "lodash/debounce";
import Badge from "@app/Badge.svelte";
import Badge from "@app/components/Badge.svelte";
import CommitAuthorship from "./CommitAuthorship.svelte";
export let commit: CommitMetadata;
@@ -1,6 +1,6 @@
<script lang="ts">
import { onMount } from "svelte";
import type { WeeklyActivity } from "./commit";
import type { WeeklyActivity } from "@app/lib/commit";
export let strokeWidth: number;
export let points: WeeklyActivity[];
@@ -1,14 +1,14 @@
<script lang="ts">
import type { Project } from "@app/project";
import type { Tree } from "@app/project";
import type { ProjectRoute } from "@app/router/definitions";
import type { Project } from "@app/lib/project";
import type { Tree } from "@app/lib/project";
import type { ProjectRoute } from "@app/lib/router/definitions";
import * as router from "@app/router";
import BranchSelector from "@app/base/projects/BranchSelector.svelte";
import CloneButton from "@app/base/projects/CloneButton.svelte";
import PeerSelector from "@app/base/projects/PeerSelector.svelte";
import { closeFocused } from "@app/Floating.svelte";
import HeaderToggleLabel from "@app/base/projects/HeaderToggleLabel.svelte";
import * as router from "@app/lib/router";
import BranchSelector from "@app/views/projects/BranchSelector.svelte";
import CloneButton from "@app/views/projects/CloneButton.svelte";
import PeerSelector from "@app/views/projects/PeerSelector.svelte";
import { closeFocused } from "@app/components/Floating.svelte";
import HeaderToggleLabel from "@app/views/projects/HeaderToggleLabel.svelte";
export let activeRoute: ProjectRoute;
export let project: Project;
@@ -1,11 +1,11 @@
<script lang="ts">
import type { CommitMetadata, CommitsHistory } from "@app/commit";
import type { CommitMetadata, CommitsHistory } from "@app/lib/commit";
import CommitTeaser from "./Commit/CommitTeaser.svelte";
import { Project } from "@app/project";
import { groupCommits } from "@app/commit";
import List from "@app/List.svelte";
import * as router from "@app/router";
import { Project } from "@app/lib/project";
import { groupCommits } from "@app/lib/commit";
import List from "@app/components/List.svelte";
import * as router from "@app/lib/router";
export let project: Project;
export let history: CommitsHistory;
@@ -1,11 +1,11 @@
<script lang="ts">
import type { Wallet } from "@app/wallet";
import type { Blob, Project } from "@app/project";
import { canonicalize, capitalize } from "@app/utils";
import { formatObjectId } from "@app/cobs";
import Comment from "@app/Comment.svelte";
import type { Issue } from "@app/issue";
import Authorship from "@app/Authorship.svelte";
import type { Wallet } from "@app/lib/wallet";
import type { Blob, Project } from "@app/lib/project";
import { canonicalize, capitalize } from "@app/lib/utils";
import { formatObjectId } from "@app/lib/cobs";
import Comment from "@app/components/Comment.svelte";
import type { Issue } from "@app/lib/issue";
import Authorship from "@app/components/Authorship.svelte";
export let issue: Issue;
export let project: Project;
@@ -1,13 +1,13 @@
<script lang="ts">
import type { Issue } from "@app/issue";
import type { Wallet } from "@app/wallet";
import type { Issue } from "@app/lib/issue";
import type { Wallet } from "@app/lib/wallet";
import { Profile, ProfileType } from "@app/profile";
import { formatObjectId } from "@app/cobs";
import { Profile, ProfileType } from "@app/lib/profile";
import { formatObjectId } from "@app/lib/cobs";
import { onMount } from "svelte";
import { twemoji } from "@app/utils";
import { twemoji } from "@app/lib/utils";
import Authorship from "@app/Authorship.svelte";
import Authorship from "@app/components/Authorship.svelte";
export let issue: Issue;
export let wallet: Wallet;
@@ -3,17 +3,17 @@
</script>
<script lang="ts">
import type { Wallet } from "@app/wallet";
import type { Issue } from "@app/issue";
import type { ToggleButtonOption } from "@app/ToggleButton.svelte";
import type { Wallet } from "@app/lib/wallet";
import type { Issue } from "@app/lib/issue";
import type { ToggleButtonOption } from "@app/components/ToggleButton.svelte";
import { capitalize } from "@app/utils";
import { groupIssues } from "@app/issue";
import * as router from "@app/router";
import { capitalize } from "@app/lib/utils";
import { groupIssues } from "@app/lib/issue";
import * as router from "@app/lib/router";
import IssueTeaser from "@app/base/projects/Issue/IssueTeaser.svelte";
import Placeholder from "@app/Placeholder.svelte";
import ToggleButton from "@app/ToggleButton.svelte";
import IssueTeaser from "@app/views/projects/Issue/IssueTeaser.svelte";
import Placeholder from "@app/components/Placeholder.svelte";
import ToggleButton from "@app/components/ToggleButton.svelte";
export let wallet: Wallet;
export let issues: Issue[];
@@ -1,18 +1,18 @@
<script lang="ts">
import type { Wallet } from "@app/wallet";
import type { Project } from "@app/project";
import type { Wallet } from "@app/lib/wallet";
import type { Project } from "@app/lib/project";
import { capitalize } from "@app/utils";
import { Patch, PatchTab } from "@app/patch";
import { formatObjectId } from "@app/cobs";
import Authorship from "@app/Authorship.svelte";
import { capitalize } from "@app/lib/utils";
import { Patch, PatchTab } from "@app/lib/patch";
import { formatObjectId } from "@app/lib/cobs";
import Authorship from "@app/components/Authorship.svelte";
import Changeset from "./SourceBrowser/Changeset.svelte";
import PatchSideBar from "./Patch/PatchSideBar.svelte";
import PatchTabBar from "./Patch/PatchTabBar.svelte";
import PatchTimeline from "./Patch/PatchTimeline.svelte";
import Placeholder from "@app/Placeholder.svelte";
import * as router from "@app/router";
import Placeholder from "@app/components/Placeholder.svelte";
import * as router from "@app/lib/router";
export let patch: Patch;
export let project: Project;
@@ -1,5 +1,5 @@
<script lang="ts">
import type { Patch } from "@app/patch";
import type { Patch } from "@app/lib/patch";
export let patch: Patch;
</script>
@@ -1,13 +1,13 @@
<script lang="ts" strictEvents>
import type { ToggleButtonOption } from "@app/ToggleButton.svelte";
import type { ToggleButtonOption } from "@app/components/ToggleButton.svelte";
import Dropdown from "@app/Dropdown.svelte";
import Floating, { closeFocused } from "@app/Floating.svelte";
import ToggleButton from "@app/ToggleButton.svelte";
import Dropdown from "@app/components/Dropdown.svelte";
import Floating, { closeFocused } from "@app/components/Floating.svelte";
import ToggleButton from "@app/components/ToggleButton.svelte";
import type { Revision } from "@app/patch";
import { PatchTab } from "@app/patch";
import { formatCommit, formatTimestamp } from "@app/utils";
import type { Revision } from "@app/lib/patch";
import { PatchTab } from "@app/lib/patch";
import { formatCommit, formatTimestamp } from "@app/lib/utils";
import { createEventDispatcher } from "svelte";
export let revisions: Revision[];
@@ -1,13 +1,13 @@
<script lang="ts">
import type { Patch } from "@app/patch";
import type { Wallet } from "@app/wallet";
import type { Patch } from "@app/lib/patch";
import type { Wallet } from "@app/lib/wallet";
import { Profile, ProfileType } from "@app/profile";
import { formatObjectId } from "@app/cobs";
import { Profile, ProfileType } from "@app/lib/profile";
import { formatObjectId } from "@app/lib/cobs";
import { onMount } from "svelte";
import { twemoji } from "@app/utils";
import { twemoji } from "@app/lib/utils";
import Authorship from "@app/Authorship.svelte";
import Authorship from "@app/components/Authorship.svelte";
export let patch: Patch;
export let wallet: Wallet;
@@ -1,12 +1,12 @@
<script lang="ts">
import type { Wallet } from "@app/wallet";
import { type Patch, TimelineType } from "@app/patch";
import { formatSeedId } from "@app/utils";
import { canonicalize } from "@app/utils";
import Comment from "@app/Comment.svelte";
import type { Blob, Project } from "@app/project";
import Authorship from "@app/Authorship.svelte";
import Review from "@app/Review.svelte";
import type { Wallet } from "@app/lib/wallet";
import { type Patch, TimelineType } from "@app/lib/patch";
import { formatSeedId } from "@app/lib/utils";
import { canonicalize } from "@app/lib/utils";
import Comment from "@app/components/Comment.svelte";
import type { Blob, Project } from "@app/lib/project";
import Authorship from "@app/components/Authorship.svelte";
import Review from "@app/views/projects/Patch/Review.svelte";
export let patch: Patch;
export let revisionNumber: number;

Some files were not shown because too many files have changed in this diff Show More