Skip to content

Commit

Permalink
fix: index file for 'lib/utils' causes errors
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Goniszewski <robertgoniszewski@outlook.com>
  • Loading branch information
goniszewski committed Apr 15, 2024
1 parent 52f5e94 commit e939bc5
Show file tree
Hide file tree
Showing 22 changed files with 35 additions and 35 deletions.
5 changes: 4 additions & 1 deletion src/lib/components/AddBookmarkForm/AddBookmarkForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
import { searchEngine } from '$lib/stores/search.store';
import { userSettingsStore } from '$lib/stores/user-settings.store';
import type { Metadata } from '$lib/types/Metadata.type';
import { addBookmarkToSearchIndex, showToast, validateUrlRegex } from '$lib/utils';
import { validateUrlRegex } from '$lib/utils/regex-library';
import { addBookmarkToSearchIndex } from '$lib/utils/search';
import { showToast } from '$lib/utils/show-toast';
import { IconInfoCircle } from '@tabler/icons-svelte';
import _ from 'lodash';
import { onDestroy } from 'svelte';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/AddCategoryForm/AddCategoryForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import Icon from '$lib/components/Icon/Icon.svelte';
import { icons } from '$lib/enums/icons';
import type { Category } from '$lib/types/Category.type';
import { showToast } from '$lib/utils';
import { showToast } from '$lib/utils/show-toast';
const category = writable<
Partial<
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/BookmarkCard/BookmarkCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import { searchEngine } from '$lib/stores/search.store';
import { showBookmarkStore } from '$lib/stores/show-bookmark.store';
import { userSettingsStore } from '$lib/stores/user-settings.store';
import { removeBookmarkFromSearchIndex, showToast } from '$lib/utils';
import { removeBookmarkFromSearchIndex } from '$lib/utils/search';
import { showToast } from '$lib/utils/show-toast';
import {
IconBookmark,
IconBookmarkFilled,
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/BookmarkListItem/BookmarkListItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import { showBookmarkStore } from '$lib/stores/show-bookmark.store';
import { userSettingsStore } from '$lib/stores/user-settings.store';
import type { Bookmark } from '$lib/types/Bookmark.type';
import { removeBookmarkFromSearchIndex, showToast } from '$lib/utils';
import { removeBookmarkFromSearchIndex } from '$lib/utils/search';
import { showToast } from '$lib/utils/show-toast';
import {
IconBackspace,
IconBookmark,
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/EditBookmarkForm/EditBookmarkForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import { editBookmarkStore } from '$lib/stores/edit-bookmark.store';
import { searchEngine } from '$lib/stores/search.store';
import type { Bookmark } from '$lib/types/Bookmark.type';
import { showToast, updateBookmarkInSearchIndex } from '$lib/utils';
import { updateBookmarkInSearchIndex } from '$lib/utils/search';
import { showToast } from '$lib/utils/show-toast';
let form: HTMLFormElement;
export let closeModal: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { icons } from '$lib/enums/icons';
import { editCategoryStore } from '$lib/stores/edit-category.store';
import type { Category } from '$lib/types/Category.type';
import { showToast } from '$lib/utils';
import { showToast } from '$lib/utils/show-toast';
const category = writable<Partial<Category>>({});
$: $category = { ...$editCategoryStore };
Expand Down
2 changes: 1 addition & 1 deletion src/lib/integrations/ollama/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ollamaSettings } from '$lib/types/UserSettings.type';
import { validateUrlRegex } from '$lib/utils';
import { validateUrlRegex } from '$lib/utils/regex-library';

export const defaultConfig = {
url: 'http://localhost:11434',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/types/UserSettings.type.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { sortByType } from '$lib/utils';
import type { sortByType } from '$lib/utils/sort-bookmarks';

export type ollamaSettings = {
url: string;
Expand Down
12 changes: 0 additions & 12 deletions src/lib/utils/index.ts

This file was deleted.

3 changes: 2 additions & 1 deletion src/routes/+layout.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import type { Category } from '$lib/types/Category.type';
import type { Tag } from '$lib/types/Tag.type';
import type { BookmarkDto } from '$lib/types/dto/Bookmark.dto';
import type { CategoryDto } from '$lib/types/dto/Category.dto';
import { searchIndexKeys, serializeBookmarkList } from '$lib/utils';

import type { TagWithBookmarks } from '$lib/types/dto/Tag.dto';
import { searchIndexKeys } from '$lib/utils/search';
import { serializeBookmarkList } from '$lib/utils/serialize-bookmark-list';

function tagWithBookmarkIds(bookmarks: BookmarkDto[], tags: Tag[]): TagWithBookmarks[] {
return tags.map((tag) => {
Expand Down
3 changes: 2 additions & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
import { checkPocketbaseConnection, user } from '$lib/pb';
import { searchedValue } from '$lib/stores/search.store';
import type { Category } from '$lib/types/Category.type';
import { ToastNode, buildCategoryTree, showToast } from '$lib/utils';
import { buildCategoryTree } from '$lib/utils/build-category-tree';
import { ToastNode, showToast } from '$lib/utils/show-toast';
import { IconMenu, IconX } from '@tabler/icons-svelte';
import { onDestroy, onMount } from 'svelte';
import { writable } from 'svelte/store';
Expand Down
3 changes: 2 additions & 1 deletion src/routes/+page.server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Actions } from './$types';
import { handlePBError, pb } from '$lib/pb';
import { createSlug, prepareTags } from '$lib/utils';
import { createSlug } from '$lib/utils/create-slug';
import { prepareTags } from '$lib/utils/handle-tags-input';

import type { Bookmark } from '$lib/types/Bookmark.type';
export const actions = {
Expand Down
3 changes: 2 additions & 1 deletion src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
import { userSettingsStore } from '$lib/stores/user-settings.store';
import type { Bookmark } from '$lib/types/Bookmark.type';
import type { UserSettings } from '$lib/types/UserSettings.type';
import { initializeSearch, sortBookmarks } from '$lib/utils';
import { initializeSearch } from '$lib/utils/search';
import { sortBookmarks } from '$lib/utils/sort-bookmarks';
import {
IconLayout2,
IconListDetails,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/admin/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { enhance } from '$app/forms';
import { user } from '$lib/pb';
import type { UserSettings } from '$lib/types/UserSettings.type';
import { showToast } from '$lib/utils';
import { showToast } from '$lib/utils/show-toast';
import { IconInfoCircle, IconLock, IconLockOpen, IconTrash } from '@tabler/icons-svelte';
import { writable } from 'svelte/store';
import type { PageData } from './$types';
Expand Down
6 changes: 4 additions & 2 deletions src/routes/api/bookmarks/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { authenticateUserApiRequest, removePocketbaseFields } from '$lib/pb';
import { getFileUrl, getMetadataFromHtml, prepareTags, urlDataToBlobConverter } from '$lib/utils';
import { getFileUrl } from '$lib/utils/get-file-url';
import { getMetadataFromHtml } from '$lib/utils/get-metadata';
import { prepareTags } from '$lib/utils/handle-tags-input';
import { urlDataToBlobConverter } from '$lib/utils/url-data-to-blob-converter';
import joi from 'joi';

import { json } from '@sveltejs/kit';
Expand All @@ -11,7 +14,6 @@ import type {
UpdateBookmarkRequestBody
} from '$lib/types/api/Bookmarks.type';
import type Client from 'pocketbase';

const prepareRequestedTags = (
requestBody: AddBookmarkRequestBody | UpdateBookmarkRequestBody,
userTags: { id: string; name: string }[]
Expand Down
3 changes: 1 addition & 2 deletions src/routes/api/bookmarks/simple/+server.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { authenticateUserApiRequest, removePocketbaseFields } from '$lib/pb';
import { getMetadata } from '$lib/utils';
import { getMetadata } from '$lib/utils/get-metadata';
import joi from 'joi';

import { json } from '@sveltejs/kit';

import type { Bookmark } from '$lib/types/Bookmark.type.js';
import type { RequestHandler } from '@sveltejs/kit';

export const POST: RequestHandler = async ({ locals, request, url }) => {
const { owner, error: authError } = await authenticateUserApiRequest(locals.pb, request);

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/categories/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { authenticateUserApiRequest, pb, removePocketbaseFields } from '$lib/pb.js';
import { createSlug } from '$lib/utils';
import { createSlug } from '$lib/utils/create-slug.js';
import joi from 'joi';

import { json } from '@sveltejs/kit';
Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/fetch-metadata/+server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getMetadata } from '$lib/utils';
import { getMetadata } from '$lib/utils/get-metadata';

import { json } from '@sveltejs/kit';

Expand Down
2 changes: 1 addition & 1 deletion src/routes/api/tags/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { authenticateUserApiRequest, pb, removePocketbaseFields } from '$lib/pb';
import { createSlug } from '$lib/utils';
import { createSlug } from '$lib/utils/create-slug';
import joi from 'joi';

import { json } from '@sveltejs/kit';
Expand Down
2 changes: 1 addition & 1 deletion src/routes/categories/[slug]/+layout.server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { BookmarkDto } from '$lib/types/dto/Bookmark.dto';
import type { CategoryDto } from '$lib/types/dto/Category.dto';
import { serializeBookmarkList } from '$lib/utils';
import { serializeBookmarkList } from '$lib/utils/serialize-bookmark-list';

export const load = async ({ locals, url, parent }) => {
if (!locals.user) {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/profile/edit/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { enhance } from '$app/forms';
import { user } from '$lib/pb';
import { showToast } from '$lib/utils';
import { showToast } from '$lib/utils/show-toast';
let showPasswordForm = false;
Expand Down
3 changes: 2 additions & 1 deletion src/routes/settings/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import { user } from '$lib/pb';
import { userSettingsStore } from '$lib/stores/user-settings.store';
import type { UserSettings } from '$lib/types/UserSettings.type';
import { showToast, themeChange } from '$lib/utils';
import { showToast } from '$lib/utils/show-toast';
import { themeChange } from '$lib/utils/theme-change';
import { IconPlug, IconPlugConnected } from '@tabler/icons-svelte';
import { writable } from 'svelte/store';
Expand Down

0 comments on commit e939bc5

Please sign in to comment.