feat: rename old -> v1 folder

This commit is contained in:
2026-09-10 20:23:45 +05:00
parent 1e5e096d5d
commit 33e3f3c4f0
60 changed files with 60 additions and 69 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
import type { CategoryId } from "../old/categories"; import type { CategoryId } from "../v1/categories";
export const LOCALES = ["ru", "en"] as const; export const LOCALES = ["ru", "en"] as const;
export type Locale = (typeof LOCALES)[number]; export type Locale = (typeof LOCALES)[number];
+2 -2
View File
@@ -1,7 +1,7 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vitest";
import { TOOLS } from "../old/registry"; import { TOOLS } from "../v1/registry";
import { normalizeForSearch, scoreDoc, type SearchDoc } from "./matching";
import { setLocale } from "./locale.svelte"; import { setLocale } from "./locale.svelte";
import { normalizeForSearch, scoreDoc, type SearchDoc } from "./matching";
import { toolSearchDoc } from "./tool-strings"; import { toolSearchDoc } from "./tool-strings";
describe("normalizeForSearch", () => { describe("normalizeForSearch", () => {
+1 -2
View File
@@ -1,8 +1,7 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vitest";
import { TOOLS } from "../old/registry"; import { isChainable, TOOLS } from "../v1/registry";
import { normalizeForSearch, scoreDoc } from "./matching"; import { normalizeForSearch, scoreDoc } from "./matching";
import { toolSearchDoc } from "./tool-strings"; import { toolSearchDoc } from "./tool-strings";
import { isChainable } from "../old/registry";
function hits(q: string): string[] { function hits(q: string): string[] {
const nq = normalizeForSearch(q); const nq = normalizeForSearch(q);
+3 -3
View File
@@ -1,10 +1,10 @@
import { afterEach, describe, expect, it, vi } from "vitest"; import { afterEach, describe, expect, it, vi } from "vitest";
import { setLocale } from "./locale.svelte"; import { TOOLS } from "../v1/registry";
import { t } from "./t";
import { LOCALE_TAGS } from "./dict"; import { LOCALE_TAGS } from "./dict";
import { setLocale } from "./locale.svelte";
import { normalizeForSearch, scoreDoc } from "./matching"; import { normalizeForSearch, scoreDoc } from "./matching";
import { t } from "./t";
import { toolSearchDoc } from "./tool-strings"; import { toolSearchDoc } from "./tool-strings";
import { TOOLS } from "../old/registry";
afterEach(() => { afterEach(() => {
setLocale("ru"); setLocale("ru");
+2 -2
View File
@@ -1,6 +1,6 @@
import type { ParamDef, ToolEntry } from "$lib/old/registry"; import type { ParamDef, ToolEntry } from "$lib/v1/registry";
import type { SearchDoc } from "./matching";
import { getMergedDict } from "./locale.svelte"; import { getMergedDict } from "./locale.svelte";
import type { SearchDoc } from "./matching";
import { ru } from "./ru"; import { ru } from "./ru";
/** /**
+1 -1
View File
@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vitest";
import { TOOLS } from "../old/registry"; import { TOOLS } from "../v1/registry";
import { en } from "./en"; import { en } from "./en";
import { ru } from "./ru"; import { ru } from "./ru";
@@ -1,9 +1,9 @@
<script lang="ts"> <script lang="ts">
import Button from "./ui/Button.svelte";
import { downloadBlob, encode } from "$lib/core/io"; import { downloadBlob, encode } from "$lib/core/io";
import type { PixelImage } from "$lib/core/types"; import type { PixelImage } from "$lib/core/types";
import type { OutputFormat } from "$lib/old/registry";
import { t } from "$lib/i18n/t"; import { t } from "$lib/i18n/t";
import type { OutputFormat } from "$lib/v1/registry";
import Button from "./ui/Button.svelte";
interface Props { interface Props {
image: PixelImage | null; image: PixelImage | null;
@@ -1,12 +1,12 @@
<script lang="ts"> <script lang="ts">
import { t } from "$lib/i18n/t";
import { optionLabel, paramLabel } from "$lib/i18n/tool-strings";
import type { ParamDef, ToolEntry } from "$lib/v1/registry";
import CheckboxField from "./ui/CheckboxField.svelte"; import CheckboxField from "./ui/CheckboxField.svelte";
import ColorField from "./ui/ColorField.svelte"; import ColorField from "./ui/ColorField.svelte";
import SelectField from "./ui/SelectField.svelte"; import SelectField from "./ui/SelectField.svelte";
import SliderField from "./ui/SliderField.svelte"; import SliderField from "./ui/SliderField.svelte";
import TextField from "./ui/TextField.svelte"; import TextField from "./ui/TextField.svelte";
import type { ParamDef, ToolEntry } from "$lib/old/registry";
import { optionLabel, paramLabel } from "$lib/i18n/tool-strings";
import { t } from "$lib/i18n/t";
interface Props { interface Props {
tool: ToolEntry; tool: ToolEntry;
@@ -7,34 +7,27 @@
unsupportedImageError, unsupportedImageError,
} from "$lib/core/io"; } from "$lib/core/io";
import type { PixelImage } from "$lib/core/types"; import type { PixelImage } from "$lib/core/types";
import { t } from "$lib/i18n/t";
import { toolDescription, toolTitle } from "$lib/i18n/tool-strings";
import { import {
defaultParams, defaultParams,
getTool, getTool,
outputOf,
sanitizeParams, sanitizeParams,
type ToolEntry, type ToolEntry,
} from "$lib/old/registry"; } from "$lib/v1/registry";
import { createAutoRunner } from "$lib/v1/tools/auto-run";
import { executeStep } from "$lib/v1/tools/executor";
import { clearOverlay, setOverlay } from "$lib/v1/tools/overlay-store.svelte";
import { import {
loadStoredSteps, loadStoredSteps,
newStepId, newStepId,
saveSteps, saveSteps,
type PipelineStep, type PipelineStep,
} from "$lib/old/tools/pipeline"; } from "$lib/v1/tools/pipeline";
import { TOOL_ICONS } from "$lib/old/tools/tool-icons"; import { TOOL_ICONS } from "$lib/v1/tools/tool-icons";
import DownloadButton from "./DownloadButton.svelte";
import ParamForm from "./ParamForm.svelte";
import Preview from "./Preview.svelte";
import ToolSearch from "./search/ToolSearch.svelte";
import { createAutoRunner } from "$lib/old/tools/auto-run";
import { executeStep } from "$lib/old/tools/executor";
import {
clearOverlay,
setOverlay,
} from "$lib/old/tools/overlay-store.svelte";
import { t } from "$lib/i18n/t";
import { toolDescription, toolTitle } from "$lib/i18n/tool-strings";
import type { StageStatus } from "./stage/stage-props";
import ChainToolBlock from "./chain/ChainToolBlock.svelte"; import ChainToolBlock from "./chain/ChainToolBlock.svelte";
import ToolSearch from "./search/ToolSearch.svelte";
import type { StageStatus } from "./stage/stage-props";
import ToolStage from "./stage/ToolStage.svelte"; import ToolStage from "./stage/ToolStage.svelte";
import ToolStageClassic from "./stage/ToolStageClassic.svelte"; import ToolStageClassic from "./stage/ToolStageClassic.svelte";
@@ -1,14 +1,14 @@
<script lang="ts"> <script lang="ts">
import { outputOf, sanitizeParams, type ToolEntry } from "$lib/old/registry";
import type { PixelImage } from "$lib/core/types"; import type { PixelImage } from "$lib/core/types";
import { t } from "$lib/i18n/t"; import { t } from "$lib/i18n/t";
import { toolTitle } from "$lib/i18n/tool-strings"; import { toolTitle } from "$lib/i18n/tool-strings";
import { outputOf, sanitizeParams, type ToolEntry } from "$lib/v1/registry";
import { TOOL_ICONS } from "$lib/v1/tools/tool-icons";
import DownloadButton from "../DownloadButton.svelte"; import DownloadButton from "../DownloadButton.svelte";
import Preview from "../Preview.svelte";
import ParamsCard from "../tool/ParamsCard.svelte";
import Button from "../ui/Button.svelte"; import Button from "../ui/Button.svelte";
import EmptyState from "../ui/EmptyState.svelte"; import EmptyState from "../ui/EmptyState.svelte";
import ParamsCard from "../tool/ParamsCard.svelte";
import Preview from "../Preview.svelte";
import { TOOL_ICONS } from "$lib/old/tools/tool-icons";
interface Props { interface Props {
index: number; index: number;
@@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { TOOL_ICONS } from "$lib/old/tools/tool-icons"; import { TOOL_ICONS } from "$lib/v1/tools/tool-icons";
interface Props { interface Props {
toolId: string; toolId: string;
@@ -1,5 +1,4 @@
<script lang="ts"> <script lang="ts">
import { isChainable, TOOLS } from "$lib/old/registry";
import { LOCALE_TAGS } from "$lib/i18n/dict"; import { LOCALE_TAGS } from "$lib/i18n/dict";
import { getLocale } from "$lib/i18n/locale.svelte"; import { getLocale } from "$lib/i18n/locale.svelte";
import { normalizeForSearch, scoreDoc } from "$lib/i18n/matching"; import { normalizeForSearch, scoreDoc } from "$lib/i18n/matching";
@@ -9,6 +8,7 @@
toolSearchDoc, toolSearchDoc,
toolTitle, toolTitle,
} from "$lib/i18n/tool-strings"; } from "$lib/i18n/tool-strings";
import { isChainable, TOOLS } from "$lib/v1/registry";
import ToolCard from "./ToolCard.svelte"; import ToolCard from "./ToolCard.svelte";
interface Props { interface Props {
@@ -1,20 +1,19 @@
<script lang="ts"> <script lang="ts">
import type { Snippet } from "svelte";
import { outputOf, sanitizeParams, type ToolEntry } from "$lib/old/registry";
import type { ImageInfo } from "$lib/core/analyze"; import type { ImageInfo } from "$lib/core/analyze";
import type { PixelImage } from "$lib/core/types"; import type { PixelImage } from "$lib/core/types";
import { t } from "$lib/i18n/t"; import { t } from "$lib/i18n/t";
import { toolTitle } from "$lib/i18n/tool-strings"; import { outputOf, sanitizeParams, type ToolEntry } from "$lib/v1/registry";
import { TOOL_ICONS } from "$lib/old/tools/tool-icons"; import { TOOL_ICONS } from "$lib/v1/tools/tool-icons";
import type { Snippet } from "svelte";
import DownloadButton from "../DownloadButton.svelte"; import DownloadButton from "../DownloadButton.svelte";
import Button from "../ui/Button.svelte"; import Preview from "../Preview.svelte";
import EmptyState from "../ui/EmptyState.svelte";
import OverlayCard from "../tool/OverlayCard.svelte"; import OverlayCard from "../tool/OverlayCard.svelte";
import ParamsCard from "../tool/ParamsCard.svelte"; import ParamsCard from "../tool/ParamsCard.svelte";
import ResultCard from "../tool/ResultCard.svelte"; import ResultCard from "../tool/ResultCard.svelte";
import SourceCard from "../tool/SourceCard.svelte"; import SourceCard from "../tool/SourceCard.svelte";
import TextInputCard from "../tool/TextInputCard.svelte"; import TextInputCard from "../tool/TextInputCard.svelte";
import Preview from "../Preview.svelte"; import Button from "../ui/Button.svelte";
import EmptyState from "../ui/EmptyState.svelte";
import type { StageStatus } from "./stage-props"; import type { StageStatus } from "./stage-props";
interface Props { interface Props {
@@ -1,6 +1,6 @@
import type { ImageInfo } from "$lib/core/analyze"; import type { ImageInfo } from "$lib/core/analyze";
import type { PixelImage } from "$lib/core/types"; import type { PixelImage } from "$lib/core/types";
import type { ToolEntry } from "$lib/old/registry"; import type { ToolEntry } from "$lib/v1/registry";
export type StageStatus = "idle" | "loaded" | "processing" | "error"; export type StageStatus = "idle" | "loaded" | "processing" | "error";
@@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import ParamForm from "../ParamForm.svelte";
import type { ParamDef, ToolEntry } from "$lib/old/registry";
import { t } from "$lib/i18n/t"; import { t } from "$lib/i18n/t";
import type { ParamDef, ToolEntry } from "$lib/v1/registry";
import ParamForm from "../ParamForm.svelte";
interface Props { interface Props {
tool: ToolEntry; tool: ToolEntry;
@@ -1,14 +1,14 @@
<script lang="ts"> <script lang="ts">
import Button from "../ui/Button.svelte";
import DownloadButton from "../DownloadButton.svelte";
import EmptyState from "../ui/EmptyState.svelte";
import InfoPanel from "../InfoPanel.svelte";
import Preview from "../Preview.svelte";
import TextResult from "./TextResult.svelte";
import type { ImageInfo } from "$lib/core/analyze"; import type { ImageInfo } from "$lib/core/analyze";
import type { PixelImage } from "$lib/core/types"; import type { PixelImage } from "$lib/core/types";
import { outputOf, type ToolEntry } from "$lib/old/registry";
import { t } from "$lib/i18n/t"; import { t } from "$lib/i18n/t";
import { outputOf, type ToolEntry } from "$lib/v1/registry";
import DownloadButton from "../DownloadButton.svelte";
import InfoPanel from "../InfoPanel.svelte";
import Preview from "../Preview.svelte";
import Button from "../ui/Button.svelte";
import EmptyState from "../ui/EmptyState.svelte";
import TextResult from "./TextResult.svelte";
type Status = "idle" | "loaded" | "processing" | "error"; type Status = "idle" | "loaded" | "processing" | "error";
+4 -4
View File
@@ -1,10 +1,10 @@
<script lang="ts"> <script lang="ts">
import { getTool } from "$lib/old/registry";
import { t } from "$lib/i18n/t"; import { t } from "$lib/i18n/t";
import { toolTitle } from "$lib/i18n/tool-strings"; import { toolTitle } from "$lib/i18n/tool-strings";
import ToolPage from "$lib/old/components/ToolPage.svelte"; import ToolPage from "$lib/v1/components/ToolPage.svelte";
import ToolSearch from "$lib/old/components/search/ToolSearch.svelte"; import ToolSearch from "$lib/v1/components/search/ToolSearch.svelte";
import Button from "$lib/old/components/ui/Button.svelte"; import Button from "$lib/v1/components/ui/Button.svelte";
import { getTool } from "$lib/v1/registry";
const LAST_TOOL_KEY = "last-tool-id"; const LAST_TOOL_KEY = "last-tool-id";
+2 -2
View File
@@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import ToolPage from "$lib/old/components/ToolPage.svelte"; import ToolPage from "$lib/v1/components/ToolPage.svelte";
import { getTool } from "$lib/old/registry"; import { getTool } from "$lib/v1/registry";
const base = getTool("linear-gradient-png")!; const base = getTool("linear-gradient-png")!;
</script> </script>
+3 -3
View File
@@ -1,10 +1,10 @@
<script lang="ts"> <script lang="ts">
import { CATEGORIES } from "$lib/old/categories";
import { resolve } from "$app/paths"; import { resolve } from "$app/paths";
import { t } from "$lib/i18n/t"; import { t } from "$lib/i18n/t";
import { toolDescription, toolTitle } from "$lib/i18n/tool-strings"; import { toolDescription, toolTitle } from "$lib/i18n/tool-strings";
import ToolCard from "$lib/old/components/search/ToolCard.svelte"; import { CATEGORIES } from "$lib/v1/categories";
import { TOOLS } from "$lib/old/registry"; import ToolCard from "$lib/v1/components/search/ToolCard.svelte";
import { TOOLS } from "$lib/v1/registry";
</script> </script>
<svelte:head> <svelte:head>
+2 -2
View File
@@ -1,8 +1,8 @@
<script lang="ts"> <script lang="ts">
import ToolPage from "$lib/old/components/ToolPage.svelte";
import { getTool } from "$lib/old/registry";
import { t } from "$lib/i18n/t"; import { t } from "$lib/i18n/t";
import { toolDescription, toolTitle } from "$lib/i18n/tool-strings"; import { toolDescription, toolTitle } from "$lib/i18n/tool-strings";
import ToolPage from "$lib/v1/components/ToolPage.svelte";
import { getTool } from "$lib/v1/registry";
let { data } = $props(); let { data } = $props();
+2 -2
View File
@@ -1,6 +1,6 @@
import { error } from "@sveltejs/kit";
import { getTool, TOOLS } from "$lib/old/registry";
import { t } from "$lib/i18n/t"; import { t } from "$lib/i18n/t";
import { getTool, TOOLS } from "$lib/v1/registry";
import { error } from "@sveltejs/kit";
import type { EntryGenerator, PageLoad } from "./$types"; import type { EntryGenerator, PageLoad } from "./$types";
export const entries: EntryGenerator = () => export const entries: EntryGenerator = () =>