mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-23 20:54:50 +03:00
Extract persisted into a shared library
This commit is contained in:
parent
902b6526bf
commit
316dd8d2b6
@ -4,7 +4,7 @@ import {
|
||||
LONG_DEFAULT_COMMIT_TEMPLATE,
|
||||
SHORT_DEFAULT_COMMIT_TEMPLATE
|
||||
} from '$lib/ai/prompts';
|
||||
import { persisted, type Persisted } from '$lib/persisted/persisted';
|
||||
import { persisted, type Persisted } from '@gitbutler/shared/persisted';
|
||||
import { get } from 'svelte/store';
|
||||
import type { Prompt, Prompts, UserPrompt } from '$lib/ai/types';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { isStr } from '$lib/utils/string';
|
||||
import type { Persisted } from '$lib/persisted/persisted';
|
||||
import type { Result } from '$lib/result';
|
||||
import type { Persisted } from '@gitbutler/shared/persisted';
|
||||
|
||||
export enum ModelKind {
|
||||
OpenAI = 'openai',
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { invoke } from '$lib/backend/ipc';
|
||||
import { showError } from '$lib/notifications/toasts';
|
||||
import { persisted } from '$lib/persisted/persisted';
|
||||
import * as toasts from '$lib/utils/toasts';
|
||||
import { persisted } from '@gitbutler/shared/persisted';
|
||||
import { open } from '@tauri-apps/api/dialog';
|
||||
import { plainToInstance } from 'class-transformer';
|
||||
import { get, writable } from 'svelte/store';
|
||||
|
@ -16,7 +16,6 @@
|
||||
import { getGitHostListingService } from '$lib/gitHost/interface/gitHostListingService';
|
||||
import { getGitHostPrMonitor } from '$lib/gitHost/interface/gitHostPrMonitor';
|
||||
import { showError } from '$lib/notifications/toasts';
|
||||
import { persisted } from '$lib/persisted/persisted';
|
||||
import { isFailure } from '$lib/result';
|
||||
import ScrollableContainer from '$lib/scroll/ScrollableContainer.svelte';
|
||||
import { SETTINGS, type Settings } from '$lib/settings/userSettings';
|
||||
@ -32,6 +31,7 @@
|
||||
import { FileIdSelection } from '$lib/vbranches/fileIdSelection';
|
||||
import { VirtualBranch } from '$lib/vbranches/types';
|
||||
import { getContext, getContextStore, getContextStoreBySymbol } from '@gitbutler/shared/context';
|
||||
import { persisted } from '@gitbutler/shared/persisted';
|
||||
import Button from '@gitbutler/ui/Button.svelte';
|
||||
import EmptyStatePlaceholder from '@gitbutler/ui/EmptyStatePlaceholder.svelte';
|
||||
import lscache from 'lscache';
|
||||
|
@ -13,7 +13,7 @@
|
||||
import { getContext, getContextStore } from '@gitbutler/shared/context';
|
||||
import Button from '@gitbutler/ui/Button.svelte';
|
||||
import Icon from '@gitbutler/ui/Icon.svelte';
|
||||
import type { Persisted } from '$lib/persisted/persisted';
|
||||
import type { Persisted } from '@gitbutler/shared/persisted';
|
||||
|
||||
interface Props {
|
||||
uncommittedChanges?: number;
|
||||
|
@ -9,7 +9,6 @@
|
||||
import { getGitHostListingService } from '$lib/gitHost/interface/gitHostListingService';
|
||||
import { createGitHostPrMonitorStore } from '$lib/gitHost/interface/gitHostPrMonitor';
|
||||
import { createGitHostPrServiceStore } from '$lib/gitHost/interface/gitHostPrService';
|
||||
import { persisted } from '$lib/persisted/persisted';
|
||||
import { SETTINGS, type Settings } from '$lib/settings/userSettings';
|
||||
import Resizer from '$lib/shared/Resizer.svelte';
|
||||
import Stack from '$lib/stack/Stack.svelte';
|
||||
@ -27,6 +26,7 @@
|
||||
getContextStoreBySymbol,
|
||||
createContextStore
|
||||
} from '@gitbutler/shared/context';
|
||||
import { persisted } from '@gitbutler/shared/persisted';
|
||||
import lscache from 'lscache';
|
||||
import { setContext } from 'svelte';
|
||||
import { quintOut } from 'svelte/easing';
|
||||
|
@ -8,8 +8,8 @@ import {
|
||||
getEntryWorkspaceStatus,
|
||||
type SidebarEntrySubject
|
||||
} from '$lib/navigation/types';
|
||||
import { persisted, type Persisted } from '$lib/persisted/persisted';
|
||||
import { debouncedDerive } from '$lib/utils/debounce';
|
||||
import { persisted, type Persisted } from '@gitbutler/shared/persisted';
|
||||
import { Transform, Type, plainToInstance } from 'class-transformer';
|
||||
import Fuse from 'fuse.js';
|
||||
import { derived, readable, writable, type Readable, type Writable } from 'svelte/store';
|
||||
|
@ -5,7 +5,7 @@
|
||||
import SelectItem from '$lib/select/SelectItem.svelte';
|
||||
import { getContext } from '@gitbutler/shared/context';
|
||||
import type { Prompts, UserPrompt } from '$lib/ai/types';
|
||||
import type { Persisted } from '$lib/persisted/persisted';
|
||||
import type { Persisted } from '@gitbutler/shared/persisted';
|
||||
|
||||
export let promptUse: 'commits' | 'branches';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { persisted, type Persisted } from '$lib/persisted/persisted';
|
||||
import { persisted, type Persisted } from '@gitbutler/shared/persisted';
|
||||
|
||||
export function projectHttpsWarningBannerDismissed(projectId: string): Persisted<boolean> {
|
||||
const key = 'projectHttpsWarningBannerDismissed_';
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @module appSettings
|
||||
*/
|
||||
import { persisted, type Persisted } from '$lib/persisted/persisted';
|
||||
import { persisted, type Persisted } from '@gitbutler/shared/persisted';
|
||||
|
||||
export function featureBaseBranchSwitching(): Persisted<boolean> {
|
||||
const key = 'featureBaseBranchSwitching';
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { ProjectMetrics, type ProjectMetricsReport } from './projectMetrics';
|
||||
import { persisted } from '$lib/persisted/persisted';
|
||||
import { persisted } from '@gitbutler/shared/persisted';
|
||||
import posthog from 'posthog-js';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
|
@ -10,11 +10,11 @@
|
||||
import { ModeService } from '$lib/modes/service';
|
||||
import EditButton from '$lib/navigation/EditButton.svelte';
|
||||
import TopicsButton from '$lib/navigation/TopicsButton.svelte';
|
||||
import { persisted } from '$lib/persisted/persisted';
|
||||
import { platformName } from '$lib/platform/platform';
|
||||
import { SETTINGS, type Settings } from '$lib/settings/userSettings';
|
||||
import { createKeybind } from '$lib/utils/hotkeys';
|
||||
import { getContext, getContextStoreBySymbol } from '@gitbutler/shared/context';
|
||||
import { persisted } from '@gitbutler/shared/persisted';
|
||||
import { env } from '$env/dynamic/public';
|
||||
|
||||
const minResizerWidth = 280;
|
||||
|
@ -1,13 +1,13 @@
|
||||
<script lang="ts">
|
||||
import { invoke } from '$lib/backend/ipc';
|
||||
import { ProjectService } from '$lib/backend/projects';
|
||||
import { persisted } from '$lib/persisted/persisted';
|
||||
import Section from '$lib/settings/Section.svelte';
|
||||
import InfoMessage, { type MessageStyle } from '$lib/shared/InfoMessage.svelte';
|
||||
import Spacer from '$lib/shared/Spacer.svelte';
|
||||
import TextBox from '$lib/shared/TextBox.svelte';
|
||||
import { parseRemoteUrl } from '$lib/url/gitUrl';
|
||||
import { getContext } from '@gitbutler/shared/context';
|
||||
import { persisted } from '@gitbutler/shared/persisted';
|
||||
import Button from '@gitbutler/ui/Button.svelte';
|
||||
import * as Sentry from '@sentry/sveltekit';
|
||||
import { open } from '@tauri-apps/api/dialog';
|
||||
|
@ -2,8 +2,8 @@
|
||||
import ContextMenuItem from '$lib/components/contextmenu/ContextMenuItem.svelte';
|
||||
import ContextMenuSection from '$lib/components/contextmenu/ContextMenuSection.svelte';
|
||||
import { MergeMethod } from '$lib/gitHost/interface/types';
|
||||
import { persisted, type Persisted } from '$lib/persisted/persisted';
|
||||
import DropDownButton from '$lib/shared/DropDownButton.svelte';
|
||||
import { persisted, type Persisted } from '@gitbutler/shared/persisted';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
|
||||
export let projectId: string;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { persisted, type Persisted } from '$lib/persisted/persisted';
|
||||
import { persisted, type Persisted } from '@gitbutler/shared/persisted';
|
||||
|
||||
const PR_DEFAULT_ACTION_KEY_NAME = 'projectDefaultPrAction';
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
import { getGitHostListingService } from '$lib/gitHost/interface/gitHostListingService';
|
||||
import { getGitHostPrMonitor } from '$lib/gitHost/interface/gitHostPrMonitor';
|
||||
import { showError } from '$lib/notifications/toasts';
|
||||
import { persisted } from '$lib/persisted/persisted';
|
||||
import { isFailure } from '$lib/result';
|
||||
import ScrollableContainer from '$lib/scroll/ScrollableContainer.svelte';
|
||||
import { SETTINGS, type Settings } from '$lib/settings/userSettings';
|
||||
@ -28,6 +27,7 @@
|
||||
import { FileIdSelection } from '$lib/vbranches/fileIdSelection';
|
||||
import { VirtualBranch } from '$lib/vbranches/types';
|
||||
import { getContext, getContextStore, getContextStoreBySymbol } from '@gitbutler/shared/context';
|
||||
import { persisted } from '@gitbutler/shared/persisted';
|
||||
import Button from '@gitbutler/ui/Button.svelte';
|
||||
import EmptyStatePlaceholder from '@gitbutler/ui/EmptyStatePlaceholder.svelte';
|
||||
import lscache from 'lscache';
|
||||
|
@ -9,7 +9,7 @@
|
||||
import { getContext, getContextStore } from '@gitbutler/shared/context';
|
||||
import Button from '@gitbutler/ui/Button.svelte';
|
||||
import Icon from '@gitbutler/ui/Icon.svelte';
|
||||
import type { Persisted } from '$lib/persisted/persisted';
|
||||
import type { Persisted } from '@gitbutler/shared/persisted';
|
||||
|
||||
interface Props {
|
||||
uncommittedChanges?: number;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { persisted } from '$lib/persisted/persisted';
|
||||
import { persisted } from '@gitbutler/shared/persisted';
|
||||
import { get, type Readable } from 'svelte/store';
|
||||
import type { Project } from '$lib/backend/projects';
|
||||
import type { GitHostIssueService } from '$lib/gitHost/interface/gitHostIssueService';
|
||||
|
Loading…
Reference in New Issue
Block a user