refactor: clean up duplicate imports and dead code
- Merge type and value imports from the same module into single imports - Remove dead import-badges action (flow uses /api/admin/import/badges) - Remove unused babel-plugin-react-compiler devDependency - Remove stray test.txt file - Update knip config: track css imports, drop redundant ignore entries - Update contract test to drop obsolete dead-action assertion
This commit is contained in:
1 parent
76730b84cf
commit
ae1393d3e3
15 files changed
+45
-75
No files matched your search
@@ -1,4 +1,3 @@
|
||||
import type { LucideIcon } from "lucide-react";
|
||||
import {
|
||||
Activity,
|
||||
AlertTriangle,
|
||||
@@ -19,6 +18,7 @@ import {
|
||||
Languages,
|
||||
LayoutDashboard,
|
||||
ListOrdered,
|
||||
type LucideIcon,
|
||||
Megaphone,
|
||||
Monitor,
|
||||
Newspaper,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { NextRequest } from "next/server";
|
||||
import { NextResponse } from "next/server";
|
||||
import { type NextRequest, NextResponse } from "next/server";
|
||||
import { logAuthorizationEvent } from "@/lib/admin/authorization-events";
|
||||
import { validateCsrfToken } from "@/lib/foundation/security";
|
||||
import { canAccess, getApiAdminContext } from "@/lib/permissions";
|
||||
|
||||
@@ -45,9 +45,6 @@ describe("admin import backend contract", () => {
|
||||
expect(service).toContain("ExternalTexts.json");
|
||||
expect(service).toContain("WebsiteBadges");
|
||||
expect(service).toContain("importBadgeSynced");
|
||||
expect(readFileSync("src/actions/import-badges.ts", "utf8")).toContain(
|
||||
"importBadgeSynced",
|
||||
);
|
||||
expect(
|
||||
readFileSync("src/app/api/admin/import/badges/route.ts", "utf8"),
|
||||
).toContain("importBadgeSynced");
|
||||
|
||||
@@ -4,23 +4,6 @@ import { and, eq, type SQL, sql } from "drizzle-orm";
|
||||
import { CatalogPages, db, ItemsBase } from "@/lib/db";
|
||||
import { officialHabboEnrichmentWarning } from "@/lib/habbo-gamedata-hotel";
|
||||
import { logger } from "@/lib/logger";
|
||||
import {
|
||||
appendFurniEntry,
|
||||
buildFurniEntry,
|
||||
removeFurniEntry,
|
||||
} from "@/lib/services/furni-data";
|
||||
import type { OfficialHabboFurniEntry } from "@/lib/services/habbo-furnidata-cache";
|
||||
import { lookupOfficialHabboFurni } from "@/lib/services/habbo-furnidata-cache";
|
||||
import { getHabboGamedataHotel } from "@/lib/services/habbo-gamedata-hotel";
|
||||
|
||||
// Re-export the download helpers now owned by the shared import core.
|
||||
// Existing furni callers keep importing them from here.
|
||||
export {
|
||||
downloadFile,
|
||||
validatePngBytes,
|
||||
validateSwfBytes,
|
||||
} from "@/lib/services/import/core/download";
|
||||
|
||||
import {
|
||||
DEFAULT_FURNI_ICON_DIR,
|
||||
DEFAULT_FURNI_NITRO_DIR,
|
||||
@@ -28,14 +11,32 @@ import {
|
||||
getFurniAssetDirs,
|
||||
getFurniAssetWriteTargets,
|
||||
} from "@/lib/services/furni-asset-dirs";
|
||||
import { downloadFile } from "@/lib/services/import/core/download";
|
||||
import type { ConversionResult } from "@/lib/services/swf-to-nitro";
|
||||
import {
|
||||
appendFurniEntry,
|
||||
buildFurniEntry,
|
||||
removeFurniEntry,
|
||||
} from "@/lib/services/furni-data";
|
||||
import {
|
||||
lookupOfficialHabboFurni,
|
||||
type OfficialHabboFurniEntry,
|
||||
} from "@/lib/services/habbo-furnidata-cache";
|
||||
import { getHabboGamedataHotel } from "@/lib/services/habbo-gamedata-hotel";
|
||||
import {
|
||||
downloadFile,
|
||||
validatePngBytes,
|
||||
validateSwfBytes,
|
||||
} from "@/lib/services/import/core/download";
|
||||
import {
|
||||
type ConversionResult,
|
||||
convertSwfToNitro,
|
||||
extractIconFromSwf,
|
||||
} from "@/lib/services/swf-to-nitro";
|
||||
import type { ImportSingleResult } from "@/types/furni";
|
||||
|
||||
// Re-export the download helpers now owned by the shared import core.
|
||||
// Existing furni callers keep importing them from here.
|
||||
export { downloadFile, validatePngBytes, validateSwfBytes };
|
||||
|
||||
// ── Constants ────────────────────────────────────────────────────────
|
||||
|
||||
// turbopackIgnore hints: this module is reached by App Router routes; without
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import type { CurrencyDb } from "./send-currency";
|
||||
import { type CurrencyDb, sendCurrency } from "./send-currency";
|
||||
|
||||
vi.mock("@/lib/db", () => ({
|
||||
db: {},
|
||||
@@ -9,8 +9,6 @@ vi.mock("@/lib/db", () => ({
|
||||
|
||||
vi.mock("@/lib/services/rcon", () => ({}));
|
||||
|
||||
import { sendCurrency } from "./send-currency";
|
||||
|
||||
const mockDb = {} as CurrencyDb;
|
||||
|
||||
describe("sendCurrency", () => {
|
||||
|
||||
Reference in new issue
Block a user