diff --git a/.pnp.cjs b/.pnp.cjs index b447aaa..4a229a2 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -40,6 +40,7 @@ const RAW_RUNTIME_STATE = ["@hookform/resolvers", "virtual:4b468a72a559fa5f5d2d4d74dfb4714f24047e53e722d208febea6a8243349ebc587e3d0bee36084edf10263c3689d19a91a46ed5d2662f1dbdddd73d08141c5#npm:3.10.0"],\ ["@jridgewell/trace-mapping", "npm:0.3.30"],\ ["@neondatabase/serverless", "npm:0.10.4"],\ + ["@playwright/test", "npm:1.57.0"],\ ["@radix-ui/react-accordion", "virtual:4b468a72a559fa5f5d2d4d74dfb4714f24047e53e722d208febea6a8243349ebc587e3d0bee36084edf10263c3689d19a91a46ed5d2662f1dbdddd73d08141c5#npm:1.2.11"],\ ["@radix-ui/react-alert-dialog", "virtual:4b468a72a559fa5f5d2d4d74dfb4714f24047e53e722d208febea6a8243349ebc587e3d0bee36084edf10263c3689d19a91a46ed5d2662f1dbdddd73d08141c5#npm:1.1.14"],\ ["@radix-ui/react-aspect-ratio", "virtual:4b468a72a559fa5f5d2d4d74dfb4714f24047e53e722d208febea6a8243349ebc587e3d0bee36084edf10263c3689d19a91a46ed5d2662f1dbdddd73d08141c5#npm:1.1.7"],\ @@ -6374,6 +6375,16 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["@playwright/test", [\ + ["npm:1.57.0", {\ + "packageLocation": "../../../.local/share/yarn/berry/cache/@playwright-test-npm-1.57.0-d5b9717312-10c0.zip/node_modules/@playwright/test/",\ + "packageDependencies": [\ + ["@playwright/test", "npm:1.57.0"],\ + ["playwright", "npm:1.57.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["@radix-ui/number", [\ ["npm:1.1.1", {\ "packageLocation": "../../../.local/share/yarn/berry/cache/@radix-ui-number-npm-1.1.1-45006205e1-10c0.zip/node_modules/@radix-ui/number/",\ @@ -16459,6 +16470,7 @@ const RAW_RUNTIME_STATE = ["@hookform/resolvers", "virtual:4b468a72a559fa5f5d2d4d74dfb4714f24047e53e722d208febea6a8243349ebc587e3d0bee36084edf10263c3689d19a91a46ed5d2662f1dbdddd73d08141c5#npm:3.10.0"],\ ["@jridgewell/trace-mapping", "npm:0.3.30"],\ ["@neondatabase/serverless", "npm:0.10.4"],\ + ["@playwright/test", "npm:1.57.0"],\ ["@radix-ui/react-accordion", "virtual:4b468a72a559fa5f5d2d4d74dfb4714f24047e53e722d208febea6a8243349ebc587e3d0bee36084edf10263c3689d19a91a46ed5d2662f1dbdddd73d08141c5#npm:1.2.11"],\ ["@radix-ui/react-alert-dialog", "virtual:4b468a72a559fa5f5d2d4d74dfb4714f24047e53e722d208febea6a8243349ebc587e3d0bee36084edf10263c3689d19a91a46ed5d2662f1dbdddd73d08141c5#npm:1.1.14"],\ ["@radix-ui/react-aspect-ratio", "virtual:4b468a72a559fa5f5d2d4d74dfb4714f24047e53e722d208febea6a8243349ebc587e3d0bee36084edf10263c3689d19a91a46ed5d2662f1dbdddd73d08141c5#npm:1.1.7"],\ diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz index 3988666..1ae30f6 100644 Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ diff --git a/Dockerfile b/Dockerfile index 6a10dbd..8807d00 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,7 @@ WORKDIR /app COPY .yarnrc.yml package.json yarn.lock ./ # Install production dependencies (uses PnP) -RUN yarn install --immutable --production +RUN yarn workspaces focus --production # Copy PnP files and built application from builder stage COPY --from=builder --chown=nextjs:nodejs /app/.pnp.cjs /app/.pnp.loader.mjs ./ diff --git a/client/src/components/annotation/AnnotationSystem.tsx b/client/src/components/annotation/AnnotationSystem.tsx index fa17b51..2f8a8ce 100644 --- a/client/src/components/annotation/AnnotationSystem.tsx +++ b/client/src/components/annotation/AnnotationSystem.tsx @@ -18,13 +18,13 @@ import { } from "@/components/ui/card"; import { Textarea } from "@/components/ui/textarea"; import { useToast } from "@/hooks/use-toast"; -import type { AnnotationWithUser } from "@/lib/types"; +import type { AnnotationWithUser } from "../../../../shared/schema"; interface AnnotationSystemProps { - workId: number; + workId: string; selectedLineNumber: number | null; onClose: () => void; - translationId?: number; + translationId?: string; } export function AnnotationSystem({ @@ -38,7 +38,7 @@ export function AnnotationSystem({ const [isLoading, setIsLoading] = useState(true); const [newAnnotation, setNewAnnotation] = useState(""); const [isSubmitting, setIsSubmitting] = useState(false); - const [editingAnnotationId, setEditingAnnotationId] = useState( + const [editingAnnotationId, setEditingAnnotationId] = useState( null, ); const [editText, setEditText] = useState(""); @@ -47,7 +47,7 @@ export function AnnotationSystem({ // Mock user data - in a real app this would come from auth const currentUser = { - id: 1, + id: "1", name: "Anonymous", avatar: null, }; @@ -63,32 +63,40 @@ export function AnnotationSystem({ // These would be fetched from the API in a real app const mockAnnotations: AnnotationWithUser[] = [ { - id: 1, - workId, - translationId, + id: "1" as const, + workId: workId, + translationId: translationId, lineNumber: selectedLineNumber, - userId: 2, - userName: "Literary Scholar", - userAvatar: null, + userId: "2" as const, + user: { + name: "Literary Scholar", + avatar: undefined, + }, content: "This line demonstrates the poet's use of alliteration, creating a rhythmic pattern that emphasizes the emotional tone.", + type: "analysis" as const, + isOfficial: false, createdAt: new Date(Date.now() - 1000000).toISOString(), likes: 5, liked: false, }, { - id: 2, - workId, - translationId, + id: "2" as const, + workId: workId, + translationId: translationId, lineNumber: selectedLineNumber, - userId: 3, - userName: "Translator", - userAvatar: null, + userId: "3" as const, + user: { + name: "Translator", + avatar: undefined, + }, content: "The original meaning in Russian contains a wordplay that is difficult to capture in English. A more literal translation might read as...", + type: "translation" as const, + isOfficial: false, createdAt: new Date(Date.now() - 5000000).toISOString(), - likes: 12, - liked: true, + likes: 3, + liked: false, }, ]; @@ -107,14 +115,18 @@ export function AnnotationSystem({ // In a real app, this would be an API call // Mock API response const newAnnotationObj: AnnotationWithUser = { - id: Date.now(), + id: Date.now().toString(), workId, translationId, lineNumber: selectedLineNumber, - userId: currentUser.id, - userName: currentUser.name, - userAvatar: currentUser.avatar, + userId: currentUser.id.toString(), + user: { + name: currentUser.name, + avatar: currentUser.avatar || undefined, + }, content: newAnnotation, + type: "comment", + isOfficial: false, createdAt: new Date().toISOString(), likes: 0, liked: false, @@ -142,7 +154,7 @@ export function AnnotationSystem({ }; // Like an annotation - const handleLikeAnnotation = async (annotationId: number) => { + const handleLikeAnnotation = async (annotationId: string) => { try { // Optimistically update UI setAnnotations((prev) => @@ -151,7 +163,7 @@ export function AnnotationSystem({ ? { ...anno, liked: !anno.liked, - likes: anno.liked ? anno.likes - 1 : anno.likes + 1, + likes: anno.liked ? (anno.likes || 0) - 1 : (anno.likes || 0) + 1, } : anno, ), @@ -171,7 +183,7 @@ export function AnnotationSystem({ }; // Delete annotation - const handleDeleteAnnotation = async (annotationId: number) => { + const handleDeleteAnnotation = async (annotationId: string) => { try { // Optimistically update UI const filteredAnnotations = annotations.filter( @@ -202,7 +214,7 @@ export function AnnotationSystem({ }; // Save edited annotation - const handleSaveEdit = async (annotationId: number) => { + const handleSaveEdit = async (annotationId: string) => { if (!editText.trim()) return; try { @@ -309,16 +321,16 @@ export function AnnotationSystem({
- {annotation.userName.charAt(0).toUpperCase()} + {annotation.user.name.charAt(0).toUpperCase()}
- {annotation.userName} + {annotation.user.name}

{new Date(annotation.createdAt).toLocaleDateString()} @@ -327,7 +339,7 @@ export function AnnotationSystem({

{/* Edit/Delete buttons for user's own annotations */} - {annotation.userId === currentUser.id && ( + {annotation.userId === currentUser.id.toString() && (
diff --git a/client/src/components/search/FilterSidebar.tsx b/client/src/components/search/FilterSidebar.tsx index 83ffb2f..5dd4a31 100644 --- a/client/src/components/search/FilterSidebar.tsx +++ b/client/src/components/search/FilterSidebar.tsx @@ -30,7 +30,7 @@ interface FilterState { type?: string; yearStart?: number; yearEnd?: number; - tags?: number[]; + tags?: string[]; query?: string; sort?: string; page: number; @@ -98,7 +98,7 @@ export function FilterSidebar({ { value: "year_asc", label: "Year (Oldest)" }, ]; - const handleTagChange = (tagId: number, checked: boolean) => { + const handleTagChange = (tagId: string, checked: boolean) => { if (!filters.tags) { if (checked) { onFilterChange({ tags: [tagId] }); diff --git a/client/src/components/work/EnhancedLineNumberedText.tsx b/client/src/components/work/EnhancedLineNumberedText.tsx index 420cb09..ef5a33b 100644 --- a/client/src/components/work/EnhancedLineNumberedText.tsx +++ b/client/src/components/work/EnhancedLineNumberedText.tsx @@ -14,7 +14,7 @@ interface EnhancedLineNumberedTextProps { fontSizeClass?: string; onAnnotate: (lineNumber: number) => void; highlightedLine?: number; - workId: number; + workId: string; } export function EnhancedLineNumberedText({ diff --git a/client/src/components/work/EnhancedReadingView.tsx b/client/src/components/work/EnhancedReadingView.tsx index 1a62939..0e16068 100644 --- a/client/src/components/work/EnhancedReadingView.tsx +++ b/client/src/components/work/EnhancedReadingView.tsx @@ -46,7 +46,7 @@ export function EnhancedReadingView({ const { settings, increaseFontSize, decreaseFontSize, toggleZenMode } = useReadingSettings(); const [selectedTranslationId, setSelectedTranslationId] = useState< - number | undefined + string | undefined >(translations.length > 0 ? translations[0].id : undefined); const [readingProgress, setReadingProgress] = useState(0); const [selectedLineNumber, setSelectedLineNumber] = useState( @@ -67,6 +67,11 @@ export function EnhancedReadingView({ (t) => t.id === selectedTranslationId, ); + // Handle translation selection + const handleSelectTranslation = (translationId: string) => { + setSelectedTranslationId(translationId); + }; + // Determine if original text is selected const isOriginalSelected = !selectedTranslationId; @@ -585,11 +590,10 @@ export function EnhancedReadingView({
diff --git a/client/src/lib/types.ts b/client/src/lib/types.ts index b0041a6..f1bb29e 100644 --- a/client/src/lib/types.ts +++ b/client/src/lib/types.ts @@ -153,12 +153,7 @@ export const readingContextSchema = z.object({ zenMode: z.boolean(), }); -export const annotationWithUserSchema = annotationSchema.extend({ - userName: z.string(), - userAvatar: z.string().optional(), - likes: z.number(), - liked: z.boolean(), -}); +// Removed duplicate annotationWithUserSchema - using the one from @shared/schema export const blogAuthorSchema = z.object({ id: z.string(), @@ -231,7 +226,7 @@ export type TimelineEventWithAuthor = z.infer< export type SearchResults = z.infer; export type FilterParams = z.infer; export type ReadingContext = z.infer; -export type AnnotationWithUser = z.infer; +// Removed duplicate AnnotationWithUser export - using the one from @shared/schema export type BlogPostWithDetails = z.infer; export type BlogPostListItem = z.infer; diff --git a/jest.config.cjs b/jest.config.cjs index 04687ee..001497e 100644 --- a/jest.config.cjs +++ b/jest.config.cjs @@ -7,11 +7,23 @@ module.exports = { '\\\\.(css|less|scss|sass)$': 'identity-obj-proxy', '\\\\.(gif|ttf|eot|svg|png)$': 'jest-transform-stub', '^@/(.*)$': '/client/src/$1', + '^@shared/(.*)$': '/shared/$1', }, transform: { - '^.+\\\\.tsx?$': ['babel-jest', { useESM: true }], + '^.+\\\\.tsx?$': 'babel-jest', }, transformIgnorePatterns: [ - '/node_modules/(?!wouter|lucide-react)/', + 'node_modules/(?!(wouter|lucide-react)/)', ], + testMatch: [ + '/client/src/**/__tests__/**/*.(ts|tsx)', + '/client/src/**/*.(test|spec).(ts|tsx)', + ], + // ES Module support + extensionsToTreatAsEsm: ['.ts', '.tsx'], + globals: { + 'babel-jest': { + useESM: true, + }, + }, }; diff --git a/jest.setup.js b/jest.setup.js index 7b0828b..0932648 100644 --- a/jest.setup.js +++ b/jest.setup.js @@ -1 +1 @@ -import '@testing-library/jest-dom'; +require('@testing-library/jest-dom'); diff --git a/package.json b/package.json index d4857d7..e4bb71b 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "check": "tsc", "lint": "tsc --noEmit", "test": "yarn test:unit && yarn test:e2e", - "test:unit": "yarn jest", + "test:unit": "jest", "test:e2e": "playwright test" }, "dependencies": { @@ -93,6 +93,7 @@ "@babel/preset-env": "^7.28.5", "@babel/preset-react": "^7.28.5", "@babel/preset-typescript": "^7.28.5", + "@playwright/test": "^1.57.0", "@replit/vite-plugin-cartographer": "^0.1.2", "@replit/vite-plugin-runtime-error-modal": "^0.0.3", "@tailwindcss/typography": "^0.5.15", diff --git a/playwright-report/index.html b/playwright-report/index.html new file mode 100644 index 0000000..6588ca5 --- /dev/null +++ b/playwright-report/index.html @@ -0,0 +1,85 @@ + + + + + + + + + Playwright Test Report + + + + +
+ + + \ No newline at end of file diff --git a/shared/schema.ts b/shared/schema.ts index 4bdbdd2..099088e 100644 --- a/shared/schema.ts +++ b/shared/schema.ts @@ -522,6 +522,23 @@ export const updateTopicClusterSchema = createTopicClusterSchema.partial(); export const updateWorkStatsSchema = createWorkStatsSchema.partial(); export const updateUserStatsSchema = createUserStatsSchema.partial(); +// Schemas with relations +export const annotationWithUserSchema = annotationSchema.extend({ + user: z.object({ + name: z.string(), + avatar: z.string().optional(), + }), + likes: z.number().optional(), + liked: z.boolean().optional(), +}); + +export const authorWithStatsSchema = authorSchema.extend({ + works_count: z.coerce.number().int().optional(), + average_rating: z.coerce.number().optional(), + followers_count: z.coerce.number().int().optional(), + total_reads: z.coerce.number().int().optional(), +}); + // TypeScript types inferred from Zod schemas export type User = z.infer; export type Author = z.infer; @@ -554,6 +571,10 @@ export type TopicCluster = z.infer; export type WorkStats = z.infer; export type UserStats = z.infer; +// New types with relations +export type AnnotationWithUser = z.infer; +export type AuthorWithStats = z.infer; + // Input types export type CreateUser = z.infer; export type CreateAuthor = z.infer; diff --git a/test-results/.last-run.json b/test-results/.last-run.json new file mode 100644 index 0000000..5fca3f8 --- /dev/null +++ b/test-results/.last-run.json @@ -0,0 +1,4 @@ +{ + "status": "failed", + "failedTests": [] +} \ No newline at end of file diff --git a/tsc_errors.log b/tsc_errors.log deleted file mode 100644 index a14a3b1..0000000 --- a/tsc_errors.log +++ /dev/null @@ -1,274 +0,0 @@ -client/src/components/annotation/AnnotationSystem.tsx(66,6): error TS2322: Type 'number' is not assignable to type 'string'. -client/src/components/annotation/AnnotationSystem.tsx(67,6): error TS2322: Type 'number' is not assignable to type 'string'. -client/src/components/annotation/AnnotationSystem.tsx(68,6): error TS2322: Type 'number | undefined' is not assignable to type 'string | undefined'. - Type 'number' is not assignable to type 'string'. -client/src/components/annotation/AnnotationSystem.tsx(70,6): error TS2322: Type 'number' is not assignable to type 'string'. -client/src/components/annotation/AnnotationSystem.tsx(75,6): error TS2322: Type 'Date' is not assignable to type 'string'. -client/src/components/annotation/AnnotationSystem.tsx(80,6): error TS2322: Type 'number' is not assignable to type 'string'. -client/src/components/annotation/AnnotationSystem.tsx(81,6): error TS2322: Type 'number' is not assignable to type 'string'. -client/src/components/annotation/AnnotationSystem.tsx(82,6): error TS2322: Type 'number | undefined' is not assignable to type 'string | undefined'. - Type 'number' is not assignable to type 'string'. -client/src/components/annotation/AnnotationSystem.tsx(84,6): error TS2322: Type 'number' is not assignable to type 'string'. -client/src/components/annotation/AnnotationSystem.tsx(89,6): error TS2322: Type 'Date' is not assignable to type 'string'. -client/src/components/annotation/AnnotationSystem.tsx(110,5): error TS2322: Type 'number' is not assignable to type 'string'. -client/src/components/annotation/AnnotationSystem.tsx(111,5): error TS2322: Type 'number' is not assignable to type 'string'. -client/src/components/annotation/AnnotationSystem.tsx(112,5): error TS2322: Type 'number | undefined' is not assignable to type 'string | undefined'. - Type 'number' is not assignable to type 'string'. -client/src/components/annotation/AnnotationSystem.tsx(114,5): error TS2322: Type 'number' is not assignable to type 'string'. -client/src/components/annotation/AnnotationSystem.tsx(118,5): error TS2322: Type 'Date' is not assignable to type 'string'. -client/src/components/annotation/AnnotationSystem.tsx(150,6): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number' have no overlap. -client/src/components/annotation/AnnotationSystem.tsx(153,22): error TS2339: Property 'liked' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/annotation/AnnotationSystem.tsx(154,21): error TS2339: Property 'liked' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/annotation/AnnotationSystem.tsx(154,34): error TS2339: Property 'likes' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/annotation/AnnotationSystem.tsx(154,51): error TS2339: Property 'likes' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/annotation/AnnotationSystem.tsx(178,15): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number' have no overlap. -client/src/components/annotation/AnnotationSystem.tsx(200,26): error TS2345: Argument of type 'string' is not assignable to parameter of type 'SetStateAction'. -client/src/components/annotation/AnnotationSystem.tsx(212,6): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number' have no overlap. -client/src/components/annotation/AnnotationSystem.tsx(312,30): error TS2339: Property 'userAvatar' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/annotation/AnnotationSystem.tsx(313,30): error TS2339: Property 'userName' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/annotation/AnnotationSystem.tsx(316,26): error TS2339: Property 'userName' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/annotation/AnnotationSystem.tsx(321,26): error TS2339: Property 'userName' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/annotation/AnnotationSystem.tsx(330,12): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number' have no overlap. -client/src/components/annotation/AnnotationSystem.tsx(345,52): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -client/src/components/annotation/AnnotationSystem.tsx(356,11): error TS2367: This comparison appears to be unintentional because the types 'number | null' and 'string' have no overlap. -client/src/components/annotation/AnnotationSystem.tsx(373,44): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -client/src/components/annotation/AnnotationSystem.tsx(392,23): error TS2339: Property 'liked' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/annotation/AnnotationSystem.tsx(396,47): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -client/src/components/annotation/AnnotationSystem.tsx(399,45): error TS2339: Property 'liked' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/annotation/AnnotationSystem.tsx(401,29): error TS2339: Property 'likes' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/annotation/annotation-browser.tsx(30,25): error TS2339: Property 'userAvatar' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/annotation/annotation-browser.tsx(31,25): error TS2339: Property 'userName' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/annotation/annotation-browser.tsx(34,21): error TS2339: Property 'userName' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/annotation/annotation-browser.tsx(39,21): error TS2339: Property 'userName' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/authors/composables/author-stats.tsx(72,26): error TS2339: Property 'formatNumber' does not exist on type 'AuthorDisplayUtils'. -client/src/components/authors/composables/author-stats.tsx(81,26): error TS2339: Property 'formatNumber' does not exist on type 'AuthorDisplayUtils'. -client/src/components/authors/composables/author-stats.tsx(86,28): error TS2339: Property 'averageRating' does not exist on type 'AuthorWithStats'. -client/src/components/authors/composables/author-stats.tsx(90,26): error TS2339: Property 'formatRating' does not exist on type 'AuthorDisplayUtils'. -client/src/components/authors/composables/author-stats.tsx(90,46): error TS2339: Property 'averageRating' does not exist on type 'AuthorWithStats'. -client/src/components/authors/composables/author-stats.tsx(95,32): error TS2339: Property 'totalReads' does not exist on type 'AuthorWithStats'. -client/src/components/authors/composables/author-stats.tsx(99,26): error TS2339: Property 'formatNumber' does not exist on type 'AuthorDisplayUtils'. -client/src/components/authors/composables/author-stats.tsx(99,46): error TS2339: Property 'totalReads' does not exist on type 'AuthorWithStats'. -client/src/components/blog/tag-manager.tsx(35,43): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number' have no overlap. -client/src/components/blog/tag-manager.tsx(46,33): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number' have no overlap. -client/src/components/blog/tag-manager.tsx(61,48): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number' have no overlap. -client/src/components/blog/tag-manager.tsx(88,39): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -client/src/components/explore/FilterSidebar.tsx(363,41): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -client/src/components/explore/FilterSidebar.tsx(366,34): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -client/src/components/explore/FilterSidebar.tsx(396,21): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -client/src/components/explore/FilterSidebar.tsx(397,45): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -client/src/components/explore/FilterSidebar.tsx(405,44): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -client/src/components/reading/AnnotationSystem.tsx(66,6): error TS2322: Type 'number' is not assignable to type 'string'. -client/src/components/reading/AnnotationSystem.tsx(67,6): error TS2322: Type 'number' is not assignable to type 'string'. -client/src/components/reading/AnnotationSystem.tsx(68,6): error TS2322: Type 'number | undefined' is not assignable to type 'string | undefined'. - Type 'number' is not assignable to type 'string'. -client/src/components/reading/AnnotationSystem.tsx(70,6): error TS2322: Type 'number' is not assignable to type 'string'. -client/src/components/reading/AnnotationSystem.tsx(75,6): error TS2322: Type 'Date' is not assignable to type 'string'. -client/src/components/reading/AnnotationSystem.tsx(80,6): error TS2322: Type 'number' is not assignable to type 'string'. -client/src/components/reading/AnnotationSystem.tsx(81,6): error TS2322: Type 'number' is not assignable to type 'string'. -client/src/components/reading/AnnotationSystem.tsx(82,6): error TS2322: Type 'number | undefined' is not assignable to type 'string | undefined'. - Type 'number' is not assignable to type 'string'. -client/src/components/reading/AnnotationSystem.tsx(84,6): error TS2322: Type 'number' is not assignable to type 'string'. -client/src/components/reading/AnnotationSystem.tsx(89,6): error TS2322: Type 'Date' is not assignable to type 'string'. -client/src/components/reading/AnnotationSystem.tsx(110,5): error TS2322: Type 'number' is not assignable to type 'string'. -client/src/components/reading/AnnotationSystem.tsx(111,5): error TS2322: Type 'number' is not assignable to type 'string'. -client/src/components/reading/AnnotationSystem.tsx(112,5): error TS2322: Type 'number | undefined' is not assignable to type 'string | undefined'. - Type 'number' is not assignable to type 'string'. -client/src/components/reading/AnnotationSystem.tsx(114,5): error TS2322: Type 'number' is not assignable to type 'string'. -client/src/components/reading/AnnotationSystem.tsx(118,5): error TS2322: Type 'Date' is not assignable to type 'string'. -client/src/components/reading/AnnotationSystem.tsx(150,6): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number' have no overlap. -client/src/components/reading/AnnotationSystem.tsx(153,22): error TS2339: Property 'liked' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/reading/AnnotationSystem.tsx(154,21): error TS2339: Property 'liked' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/reading/AnnotationSystem.tsx(154,34): error TS2339: Property 'likes' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/reading/AnnotationSystem.tsx(154,51): error TS2339: Property 'likes' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/reading/AnnotationSystem.tsx(178,15): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number' have no overlap. -client/src/components/reading/AnnotationSystem.tsx(200,26): error TS2345: Argument of type 'string' is not assignable to parameter of type 'SetStateAction'. -client/src/components/reading/AnnotationSystem.tsx(212,6): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number' have no overlap. -client/src/components/reading/AnnotationSystem.tsx(312,30): error TS2339: Property 'userAvatar' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/reading/AnnotationSystem.tsx(313,30): error TS2339: Property 'userName' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/reading/AnnotationSystem.tsx(316,26): error TS2339: Property 'userName' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/reading/AnnotationSystem.tsx(321,26): error TS2339: Property 'userName' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/reading/AnnotationSystem.tsx(330,12): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number' have no overlap. -client/src/components/reading/AnnotationSystem.tsx(345,52): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -client/src/components/reading/AnnotationSystem.tsx(356,11): error TS2367: This comparison appears to be unintentional because the types 'number | null' and 'string' have no overlap. -client/src/components/reading/AnnotationSystem.tsx(373,44): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -client/src/components/reading/AnnotationSystem.tsx(392,23): error TS2339: Property 'liked' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/reading/AnnotationSystem.tsx(396,47): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -client/src/components/reading/AnnotationSystem.tsx(399,45): error TS2339: Property 'liked' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/reading/AnnotationSystem.tsx(401,29): error TS2339: Property 'likes' does not exist on type '{ id: string; workId: string; content: string; type: string; userId: string; isOfficial: boolean; createdAt: string; translationId?: string | undefined; lineNumber?: number | undefined; }'. -client/src/components/reading/EnhancedReadingView.tsx(50,4): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'number | (() => number | undefined) | undefined'. - Type 'string' is not assignable to type 'number | (() => number | undefined) | undefined'. -client/src/components/reading/EnhancedReadingView.tsx(67,10): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number | undefined' have no overlap. -client/src/components/reading/EnhancedReadingView.tsx(128,6): error TS2448: Block-scoped variable 'updateReadingProgress' used before its declaration. -client/src/components/reading/EnhancedReadingView.tsx(128,6): error TS2454: Variable 'updateReadingProgress' is used before being assigned. -client/src/components/reading/EnhancedReadingView.tsx(571,9): error TS2322: Type 'number | undefined' is not assignable to type 'string | undefined'. - Type 'number' is not assignable to type 'string'. -client/src/components/reading/EnhancedReadingView.tsx(584,8): error TS2322: Type 'number | undefined' is not assignable to type 'string | undefined'. - Type 'number' is not assignable to type 'string'. -client/src/components/reading/EnhancedReadingView.tsx(587,8): error TS2322: Type 'Dispatch>' is not assignable to type '(translationId: string) => void'. - Types of parameters 'value' and 'translationId' are incompatible. - Type 'string' is not assignable to type 'SetStateAction'. -client/src/components/reading/EnhancedReadingView.tsx(600,8): error TS2322: Type 'string' is not assignable to type 'number'. -client/src/components/reading/EnhancedReadingView.tsx(630,6): error TS2322: Type 'string' is not assignable to type 'number'. -client/src/components/reading/EnhancedReadingView.tsx(660,10): error TS2322: Type 'string' is not assignable to type 'number'. -client/src/components/reading/ReadingView.tsx(23,4): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'number | (() => number | undefined) | undefined'. - Type 'string' is not assignable to type 'number | (() => number | undefined) | undefined'. -client/src/components/reading/ReadingView.tsx(26,3): error TS2322: Type 'string' is not assignable to type 'number'. -client/src/components/reading/ReadingView.tsx(36,10): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number | undefined' have no overlap. -client/src/components/reading/ReadingView.tsx(258,8): error TS2322: Type 'number | undefined' is not assignable to type 'string | undefined'. - Type 'number' is not assignable to type 'string'. -client/src/components/reading/ReadingView.tsx(271,9): error TS2322: Type 'number | undefined' is not assignable to type 'string | undefined'. - Type 'number' is not assignable to type 'string'. -client/src/components/reading/ReadingView.tsx(273,9): error TS2322: Type 'Dispatch>' is not assignable to type '(translationId: string) => void'. - Types of parameters 'value' and 'translationId' are incompatible. - Type 'string' is not assignable to type 'SetStateAction'. -client/src/components/search/FilterSidebar.tsx(363,41): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -client/src/components/search/FilterSidebar.tsx(366,34): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -client/src/components/search/FilterSidebar.tsx(396,21): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -client/src/components/search/FilterSidebar.tsx(397,45): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -client/src/components/search/FilterSidebar.tsx(405,44): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -client/src/components/work/EnhancedReadingView.tsx(50,4): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'number | (() => number | undefined) | undefined'. - Type 'string' is not assignable to type 'number | (() => number | undefined) | undefined'. -client/src/components/work/EnhancedReadingView.tsx(67,10): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number | undefined' have no overlap. -client/src/components/work/EnhancedReadingView.tsx(128,6): error TS2448: Block-scoped variable 'updateReadingProgress' used before its declaration. -client/src/components/work/EnhancedReadingView.tsx(128,6): error TS2454: Variable 'updateReadingProgress' is used before being assigned. -client/src/components/work/EnhancedReadingView.tsx(571,9): error TS2322: Type 'number | undefined' is not assignable to type 'string | undefined'. - Type 'number' is not assignable to type 'string'. -client/src/components/work/EnhancedReadingView.tsx(584,8): error TS2322: Type 'number | undefined' is not assignable to type 'string | undefined'. - Type 'number' is not assignable to type 'string'. -client/src/components/work/EnhancedReadingView.tsx(587,8): error TS2322: Type 'Dispatch>' is not assignable to type '(translationId: string) => void'. - Types of parameters 'value' and 'translationId' are incompatible. - Type 'string' is not assignable to type 'SetStateAction'. -client/src/components/work/EnhancedReadingView.tsx(600,8): error TS2322: Type 'string' is not assignable to type 'number'. -client/src/components/work/EnhancedReadingView.tsx(630,6): error TS2322: Type 'string' is not assignable to type 'number'. -client/src/components/work/EnhancedReadingView.tsx(660,10): error TS2322: Type 'string' is not assignable to type 'number'. -client/src/hooks/use-author-profile.ts(86,58): error TS2339: Property 'name' does not exist on type 'string'. -client/src/hooks/use-author-profile.ts(107,40): error TS2339: Property 'name' does not exist on type 'string'. -client/src/hooks/use-author-profile.ts(139,24): error TS2345: Argument of type '{ id: string; title: string; slug: string; authorId: string; type: "other" | "poem" | "story" | "novel" | "play" | "essay"; language: string; content: string; createdAt: string; year?: number | undefined; ... 8 more ...; copyrightId?: string | undefined; }' is not assignable to parameter of type '{ id: string; title: string; slug: string; authorId: string; type: "other" | "poem" | "story" | "novel" | "play" | "essay"; language: string; content: string; createdAt: string; year?: number | undefined; ... 8 more ...; likes?: number | undefined; }'. - Types of property 'tags' are incompatible. - Type 'string[] | undefined' is not assignable to type '{ id: string; name: string; type: string; createdAt: string; }[] | undefined'. - Type 'string[]' is not assignable to type '{ id: string; name: string; type: string; createdAt: string; }[]'. - Type 'string' is not assignable to type '{ id: string; name: string; type: string; createdAt: string; }'. -client/src/hooks/use-comparison-slider.ts(81,3): error TS2322: Type 'RefObject' is not assignable to type 'RefObject'. - Type 'HTMLDivElement | null' is not assignable to type 'HTMLDivElement'. - Type 'null' is not assignable to type 'HTMLDivElement'. -client/src/hooks/use-work-api.ts(59,49): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -client/src/pages/Explore.tsx(174,7): error TS2740: Type '{}' is missing the following properties from type '{ id: string; name: string; type: string; createdAt: string; }[]': length, pop, push, concat, and 35 more. -client/src/pages/Home.tsx(101,13): error TS2322: Type '{ id: string; name: string; slug: string; createdAt: string; works: { id: string; title: string; slug: string; authorId: string; type: "other" | "poem" | "story" | "novel" | "play" | "essay"; language: string; ... 11 more ...; likes?: number | undefined; }[]; ... 11 more ...; copyright?: { ...; } | undefined; }' is not assignable to type '{ id: string; name: string; slug: string; createdAt: string; birthYear?: number | undefined; deathYear?: number | undefined; country?: string | undefined; biography?: string | undefined; ... 5 more ...; copyrightId?: string | undefined; }'. - Types of property 'country' are incompatible. - Type '{ id: string; name: string; code: string; language: string; createdAt: string; updatedAt?: string | undefined; } | undefined' is not assignable to type 'string | undefined'. - Type '{ id: string; name: string; code: string; language: string; createdAt: string; updatedAt?: string | undefined; }' is not assignable to type 'string'. -client/src/pages/Search.tsx(451,37): error TS2322: Type '{ id: string; title: string; slug: string; authorId: string; type: "other" | "poem" | "story" | "novel" | "play" | "essay"; language: string; content: string; createdAt: string; year?: number | undefined; ... 8 more ...; copyrightId?: string | undefined; } | { ...; }' is not assignable to type '{ id: string; title: string; slug: string; authorId: string; type: "other" | "poem" | "story" | "novel" | "play" | "essay"; language: string; content: string; createdAt: string; year?: number | undefined; ... 8 more ...; likes?: number | undefined; }'. - Type '{ id: string; title: string; slug: string; authorId: string; type: "other" | "poem" | "story" | "novel" | "play" | "essay"; language: string; content: string; createdAt: string; year?: number | undefined; ... 8 more ...; copyrightId?: string | undefined; }' is not assignable to type '{ id: string; title: string; slug: string; authorId: string; type: "other" | "poem" | "story" | "novel" | "play" | "essay"; language: string; content: string; createdAt: string; year?: number | undefined; ... 8 more ...; likes?: number | undefined; }'. - Types of property 'tags' are incompatible. - Type 'string[] | undefined' is not assignable to type '{ id: string; name: string; type: string; createdAt: string; }[] | undefined'. - Type 'string[]' is not assignable to type '{ id: string; name: string; type: string; createdAt: string; }[]'. - Type 'string' is not assignable to type '{ id: string; name: string; type: string; createdAt: string; }'. -client/src/pages/Search.tsx(457,37): error TS2322: Type '{ id: string; title: string; slug: string; authorId: string; type: "other" | "poem" | "story" | "novel" | "play" | "essay"; language: string; content: string; createdAt: string; year?: number | undefined; ... 8 more ...; copyrightId?: string | undefined; } | { ...; }' is not assignable to type '{ id: string; title: string; slug: string; authorId: string; type: "other" | "poem" | "story" | "novel" | "play" | "essay"; language: string; content: string; createdAt: string; year?: number | undefined; ... 8 more ...; likes?: number | undefined; }'. - Type '{ id: string; title: string; slug: string; authorId: string; type: "other" | "poem" | "story" | "novel" | "play" | "essay"; language: string; content: string; createdAt: string; year?: number | undefined; ... 8 more ...; copyrightId?: string | undefined; }' is not assignable to type '{ id: string; title: string; slug: string; authorId: string; type: "other" | "poem" | "story" | "novel" | "play" | "essay"; language: string; content: string; createdAt: string; year?: number | undefined; ... 8 more ...; likes?: number | undefined; }'. - Types of property 'tags' are incompatible. - Type 'string[] | undefined' is not assignable to type '{ id: string; name: string; type: string; createdAt: string; }[] | undefined'. - Type 'string[]' is not assignable to type '{ id: string; name: string; type: string; createdAt: string; }[]'. - Type 'string' is not assignable to type '{ id: string; name: string; type: string; createdAt: string; }'. -client/src/pages/authors/AuthorProfile.tsx(327,72): error TS2339: Property 'toLowerCase' does not exist on type '{ id: string; name: string; code: string; language: string; createdAt: string; updatedAt?: string | undefined; }'. -client/src/pages/authors/AuthorProfile.tsx(328,25): error TS2322: Type '{ id: string; name: string; code: string; language: string; createdAt: string; updatedAt?: string | undefined; }' is not assignable to type 'string'. -client/src/pages/authors/AuthorProfile.tsx(332,25): error TS2322: Type '{ id: string; name: string; code: string; language: string; createdAt: string; updatedAt?: string | undefined; }' is not assignable to type 'ReactNode'. -client/src/pages/authors/AuthorProfile.tsx(553,52): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. - Type 'undefined' is not assignable to type 'string'. -client/src/pages/authors/AuthorProfile.tsx(553,66): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. - Type 'undefined' is not assignable to type 'string'. -client/src/pages/authors/AuthorProfile.tsx(555,52): error TS2322: Type 'string | undefined' is not assignable to type 'string'. - Type 'undefined' is not assignable to type 'string'. -client/src/pages/authors/AuthorProfile.tsx(796,42): error TS2339: Property 'length' does not exist on type '{}'. -client/src/pages/authors/AuthorProfile.tsx(797,35): error TS2740: Type '{}' is missing the following properties from type '{ id: string; authorId: string; year: number; title: string; createdAt: string; description?: string | undefined; }[]': length, pop, push, concat, and 35 more. -client/src/pages/authors/AuthorProfile.tsx(1034,25): error TS2322: Type 'string | { id: string; name: string; code: string; language: string; createdAt: string; updatedAt?: string | undefined; }' is not assignable to type 'ReactNode'. - Type '{ id: string; name: string; code: string; language: string; createdAt: string; updatedAt?: string | undefined; }' is not assignable to type 'ReactNode'. -client/src/pages/authors/AuthorProfile.tsx(1183,31): error TS2322: Type 'string | { id: string; name: string; code: string; language: string; createdAt: string; updatedAt?: string | undefined; }' is not assignable to type 'ReactNode'. - Type '{ id: string; name: string; code: string; language: string; createdAt: string; updatedAt?: string | undefined; }' is not assignable to type 'ReactNode'. -client/src/pages/authors/Authors.tsx(104,24): error TS2345: Argument of type 'string' is not assignable to parameter of type 'SetStateAction'. -client/src/pages/authors/Authors.tsx(110,15): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number | null' have no overlap. -client/src/pages/authors/Authors.tsx(127,35): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. -client/src/pages/authors/Authors.tsx(127,42): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. -client/src/pages/authors/Authors.tsx(127,49): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. -client/src/pages/authors/Authors.tsx(127,56): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. -client/src/pages/authors/Authors.tsx(290,9): error TS18048: 'author.biography.length' is possibly 'undefined'. -client/src/pages/blog/BlogDetail.tsx(226,26): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. -client/src/pages/blog/BlogDetail.tsx(318,8): error TS2367: This comparison appears to be unintentional because the types 'string | undefined' and 'number' have no overlap. -client/src/pages/blog/BlogList.tsx(182,26): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. -client/src/pages/collections/Collections.tsx(89,12): error TS18048: 'collection.description.length' is possibly 'undefined'. -client/src/pages/dashboard/BlogEdit.tsx(22,36): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. - Type 'undefined' is not assignable to type 'string'. -client/src/pages/dashboard/BlogManagement.tsx(64,45): error TS2345: Argument of type '{ method: string; }' is not assignable to parameter of type 'string'. -client/src/pages/dashboard/BlogManagement.tsx(209,47): error TS2345: Argument of type 'string' is not assignable to parameter of type 'SetStateAction'. -client/src/pages/dashboard/Dashboard.tsx(223,24): error TS2339: Property 'slice' does not exist on type '{}'. -client/src/pages/user/Profile.tsx(60,20): error TS2339: Property 'avatar' does not exist on type '{}'. -client/src/pages/user/Profile.tsx(61,20): error TS2339: Property 'displayName' does not exist on type '{}'. -client/src/pages/user/Profile.tsx(61,40): error TS2339: Property 'username' does not exist on type '{}'. -client/src/pages/user/Profile.tsx(64,17): error TS2339: Property 'displayName' does not exist on type '{}'. -client/src/pages/user/Profile.tsx(64,37): error TS2339: Property 'username' does not exist on type '{}'. -client/src/pages/user/Profile.tsx(71,16): error TS2339: Property 'displayName' does not exist on type '{}'. -client/src/pages/user/Profile.tsx(71,36): error TS2339: Property 'username' does not exist on type '{}'. -client/src/pages/user/Profile.tsx(74,17): error TS2339: Property 'username' does not exist on type '{}'. -client/src/pages/user/Profile.tsx(77,16): error TS2339: Property 'bio' does not exist on type '{}'. -client/src/pages/user/Profile.tsx(146,38): error TS2322: Type '{ id: string; title: string; slug: string; authorId: string; type: "other" | "poem" | "story" | "novel" | "play" | "essay"; language: string; content: string; createdAt: string; year?: number | undefined; ... 8 more ...; copyrightId?: string | undefined; }' is not assignable to type '{ id: string; title: string; slug: string; authorId: string; type: "other" | "poem" | "story" | "novel" | "play" | "essay"; language: string; content: string; createdAt: string; year?: number | undefined; ... 8 more ...; likes?: number | undefined; }'. - Types of property 'tags' are incompatible. - Type 'string[] | undefined' is not assignable to type '{ id: string; name: string; type: string; createdAt: string; }[] | undefined'. - Type 'string[]' is not assignable to type '{ id: string; name: string; type: string; createdAt: string; }[]'. - Type 'string' is not assignable to type '{ id: string; name: string; type: string; createdAt: string; }'. -client/src/pages/user/Profile.tsx(177,26): error TS2339: Property 'length' does not exist on type '{}'. -client/src/pages/user/Profile.tsx(214,28): error TS2339: Property 'length' does not exist on type '{}'. -client/src/pages/works/NewWorkReading.tsx(198,43): error TS2448: Block-scoped variable 'generateLinguisticAnalysis' used before its declaration. -client/src/pages/works/NewWorkReading.tsx(198,43): error TS2454: Variable 'generateLinguisticAnalysis' is used before being assigned. -client/src/pages/works/NewWorkReading.tsx(385,11): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number' have no overlap. -client/src/pages/works/NewWorkReading.tsx(395,11): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number' have no overlap. -client/src/pages/works/NewWorkReading.tsx(578,10): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number | undefined' have no overlap. -client/src/pages/works/NewWorkReading.tsx(581,10): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number | undefined' have no overlap. -client/src/pages/works/NewWorkReading.tsx(671,14): error TS2367: This comparison appears to be unintentional because the types 'number | undefined' and 'string' have no overlap. -client/src/pages/works/NewWorkReading.tsx(677,53): error TS2345: Argument of type 'string' is not assignable to parameter of type 'SetStateAction'. -client/src/pages/works/NewWorkReading.tsx(1122,32): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number | undefined' have no overlap. -client/src/pages/works/NewWorkReading.tsx(1130,46): error TS2345: Argument of type 'string' is not assignable to parameter of type 'SetStateAction'. -client/src/pages/works/NewWorkReading.tsx(1760,42): error TS2345: Argument of type 'string' is not assignable to parameter of type 'SetStateAction'. -client/src/pages/works/NewWorkReading.tsx(1774,43): error TS2345: Argument of type 'string' is not assignable to parameter of type 'SetStateAction'. -client/src/pages/works/SimpleWorkReading.tsx(150,24): error TS2448: Block-scoped variable 'contentToLines' used before its declaration. -client/src/pages/works/SimpleWorkReading.tsx(150,24): error TS2454: Variable 'contentToLines' is used before being assigned. -client/src/pages/works/SimpleWorkReading.tsx(150,40): error TS2448: Block-scoped variable 'getSelectedContent' used before its declaration. -client/src/pages/works/SimpleWorkReading.tsx(150,40): error TS2454: Variable 'getSelectedContent' is used before being assigned. -client/src/pages/works/SimpleWorkReading.tsx(166,3): error TS2448: Block-scoped variable 'generateLinguisticAnalysis' used before its declaration. -client/src/pages/works/SimpleWorkReading.tsx(166,3): error TS2454: Variable 'generateLinguisticAnalysis' is used before being assigned. -client/src/pages/works/SimpleWorkReading.tsx(167,3): error TS2448: Block-scoped variable 'getSelectedContent' used before its declaration. -client/src/pages/works/SimpleWorkReading.tsx(167,3): error TS2454: Variable 'getSelectedContent' is used before being assigned. -client/src/pages/works/SimpleWorkReading.tsx(175,11): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number' have no overlap. -client/src/pages/works/SimpleWorkReading.tsx(356,11): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number' have no overlap. -client/src/pages/works/SimpleWorkReading.tsx(512,10): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number | undefined' have no overlap. -client/src/pages/works/SimpleWorkReading.tsx(604,11): error TS2367: This comparison appears to be unintentional because the types 'number | undefined' and 'string' have no overlap. -client/src/pages/works/SimpleWorkReading.tsx(609,50): error TS2345: Argument of type 'string' is not assignable to parameter of type 'SetStateAction'. -client/src/pages/works/SimpleWorkReading.tsx(802,30): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number | undefined' have no overlap. -client/src/pages/works/SimpleWorkReading.tsx(809,44): error TS2345: Argument of type 'string' is not assignable to parameter of type 'SetStateAction'. -client/src/pages/works/SimpleWorkReading.tsx(849,24): error TS2367: This comparison appears to be unintentional because the types 'string' and 'number' have no overlap. -client/src/pages/works/SimpleWorkReading.tsx(1317,41): error TS2345: Argument of type 'string' is not assignable to parameter of type 'SetStateAction'. -client/src/pages/works/SimpleWorkReading.tsx(1331,42): error TS2345: Argument of type 'string' is not assignable to parameter of type 'SetStateAction'. -server/routes/author.ts(27,13): error TS2339: Property 'authors' does not exist on type 'unknown'. -server/routes/author.ts(38,13): error TS2339: Property 'author' does not exist on type 'unknown'. -server/routes/author.ts(52,13): error TS2339: Property 'createAuthor' does not exist on type 'unknown'. -server/routes/blog.ts(18,14): error TS18046: 'data' is of type 'unknown'. -server/routes/bookmark.ts(22,13): error TS2339: Property 'bookmark' does not exist on type 'unknown'. -server/routes/like.ts(22,13): error TS2339: Property 'like' does not exist on type 'unknown'. -server/routes/like.ts(36,13): error TS2339: Property 'likes' does not exist on type 'unknown'. -server/routes/like.ts(51,13): error TS2339: Property 'createLike' does not exist on type 'unknown'. -server/routes/like.ts(64,13): error TS2339: Property 'deleteLike' does not exist on type 'unknown'. -server/routes/tag.ts(20,13): error TS2339: Property 'tags' does not exist on type 'unknown'. -server/routes/tag.ts(31,13): error TS2339: Property 'tag' does not exist on type 'unknown'. -server/routes/translation.ts(23,13): error TS2339: Property 'translation' does not exist on type 'unknown'. -server/routes/translation.ts(38,13): error TS2339: Property 'translations' does not exist on type 'unknown'. -server/routes/translation.ts(54,13): error TS2339: Property 'createTranslation' does not exist on type 'unknown'. -server/routes/translation.ts(70,13): error TS2339: Property 'updateTranslation' does not exist on type 'unknown'. -server/routes/translation.ts(87,13): error TS2339: Property 'deleteTranslation' does not exist on type 'unknown'. -server/routes/user.ts(22,13): error TS2339: Property 'user' does not exist on type 'unknown'. -server/routes/user.ts(35,13): error TS2339: Property 'users' does not exist on type 'unknown'. -server/routes/user.ts(46,13): error TS2339: Property 'updateUser' does not exist on type 'unknown'. -server/routes/user.ts(60,13): error TS2339: Property 'deleteUser' does not exist on type 'unknown'. -server/routes/userProfile.ts(7,3): error TS2724: '"../../shared/generated/graphql"' has no exported member named 'UpdateUserProfileDocument'. Did you mean 'UpdateUserDocument'? -server/routes/userProfile.ts(20,13): error TS2339: Property 'userProfile' does not exist on type 'unknown'. -server/routes/userProfile.ts(35,13): error TS2339: Property 'updateUserProfile' does not exist on type 'unknown'. -server/routes/work.ts(29,13): error TS2339: Property 'works' does not exist on type 'unknown'. -server/routes/work.ts(40,13): error TS2339: Property 'work' does not exist on type 'unknown'. -server/routes/work.ts(54,13): error TS2339: Property 'createWork' does not exist on type 'unknown'. diff --git a/tsconfig.json b/tsconfig.json index d0cf02c..35ed2cb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,10 +17,12 @@ "noFallthroughCasesInSwitch": true, "types": ["jest", "@testing-library/jest-dom"], "esModuleInterop": true, + "baseUrl": ".", "paths": { - "@/*": ["./client/src/*"] + "@/*": ["./client/src/*"], + "@shared/*": ["./shared/*"] } }, - "include": ["src", "**/*.ts", "**/*.tsx"], - "references": [{ "path": "./tsconfig.node.json" }] + "include": ["src", "client", "server", "shared", "playwright.config.ts"], + "exclude": ["node_modules", "dist"] } diff --git a/tsconfig.node.json b/tsconfig.node.json new file mode 100644 index 0000000..820f222 --- /dev/null +++ b/tsconfig.node.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true, + "strict": true, + "types": ["node"] + }, + "include": ["vite.config.ts", "server/**/*.ts", "shared/**/*.ts"] +} diff --git a/vite.config.ts b/vite.config.ts index 5a33944..a1260b8 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,7 +1,18 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' +import path from 'path' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], + root: 'client', + resolve: { + alias: { + '@': path.resolve(__dirname, './client/src'), + '@shared': path.resolve(__dirname, './shared') + } + }, + build: { + outDir: '../dist' + } }) diff --git a/yarn.lock b/yarn.lock index 0569471..818233c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3638,6 +3638,17 @@ __metadata: languageName: node linkType: hard +"@playwright/test@npm:^1.57.0": + version: 1.57.0 + resolution: "@playwright/test@npm:1.57.0" + dependencies: + playwright: "npm:1.57.0" + bin: + playwright: cli.js + checksum: 10c0/35ba4b28be72bf0a53e33dbb11c6cff848fb9a37f49e893ce63a90675b5291ec29a1ba82c8a3b043abaead129400f0589623e9ace2e6a1c8eaa409721ecc3774 + languageName: node + linkType: hard + "@radix-ui/number@npm:1.1.1": version: 1.1.1 resolution: "@radix-ui/number@npm:1.1.1" @@ -11103,7 +11114,7 @@ __metadata: languageName: node linkType: hard -"playwright@npm:^1.57.0": +"playwright@npm:1.57.0, playwright@npm:^1.57.0": version: 1.57.0 resolution: "playwright@npm:1.57.0" dependencies: @@ -11882,6 +11893,7 @@ __metadata: "@hookform/resolvers": "npm:^3.10.0" "@jridgewell/trace-mapping": "npm:^0.3.25" "@neondatabase/serverless": "npm:^0.10.4" + "@playwright/test": "npm:^1.57.0" "@radix-ui/react-accordion": "npm:^1.2.4" "@radix-ui/react-alert-dialog": "npm:^1.1.7" "@radix-ui/react-aspect-ratio": "npm:^1.1.3"