Add TypeScript Runtime Support and add Prisma 7 Compatibility#354
Merged
michelroegl-brunner merged 53 commits intomainfrom Nov 28, 2025
Merged
Add TypeScript Runtime Support and add Prisma 7 Compatibility#354michelroegl-brunner merged 53 commits intomainfrom
michelroegl-brunner merged 53 commits intomainfrom
Conversation
Upgraded multiple dependencies and devDependencies in package.json to their latest versions for improved stability and features. Changed the TypeScript 'jsx' compiler option from 'react-jsx' to 'preserve' in tsconfig.json to better align with project requirements.
…nal-chain, unescaped-entities, unused-vars, type-safety
Improves type safety and normalization in filter, repository, and script status handling across multiple components. Refactors ScriptsGrid for better readability, deduplication, and error messaging, and updates UI markup for consistency. Also adds explicit types for auto-sync settings and ensures string conversion for credential fields.
Replaces many uses of logical OR (||) with nullish coalescing (??) for more accurate handling of undefined/null values. Adds explicit type annotations and interfaces to improve type safety, especially in API routes and server-side code. Updates SSH connection test handling and config parsing in installedScripts router for better reliability. Minor fixes to deduplication logic, cookie handling, and error reporting.
Standardizes quote usage, formatting, and code style in InstalledScriptsTab.tsx. Improves readability and maintains consistent conventions across the file without changing logic or functionality.
Updated InstalledScriptsTab.tsx to use double quotes and consistent formatting throughout the file. Improved type annotations, code readability, and standardized state initialization and mutation usage. No functional changes were made; this is a style and maintainability refactor.
Added and updated eslint-disable comments in repositoryService, restoreService, and storageService to cover additional TypeScript rules. Simplified error handling by removing unused variables and catch parameters, and removed unused imports and variables in restoreService for cleaner code.
Replaces @eslint/eslintrc and FlatCompat with eslint-config-next/core-web-vitals for ESLint configuration. Updates linting scripts in package.json to use eslint directly instead of next lint. Removes @eslint/eslintrc from devDependencies.
Switched to using FlatCompat for ESLint configuration and extended the ignore list to include 'next-env.d.ts', 'postcss.config.js', and 'prettier.config.js'. This improves compatibility and prevents linting of config and environment files.
Added explicit type annotations to array mapping functions for better type safety. Updated incorrect TypeScript import extensions from .ts to .js for compatibility. Ensured default values for optional parameters and improved code clarity in API routers.
Updated several components to use explicit TypeScript types for better type safety. Normalized appriseUrls to always be an array in auto-sync settings API. Improved handling of optional server_id in BackupsTab and adjusted IP detection logic in InstalledScriptsTab. Removed unnecessary eslint-disable comments and improved code clarity in various places.
Set `checkJs` to true to allow type checking for JavaScript files. Updated include/exclude patterns to support JS and CJS files in the project.
Replaces usage of PrismaBetterSQLite3 with PrismaBetterSqlite3 for consistency and correct casing. Updates type annotations in several components and API router for improved type safety. Also adjusts PrismaClient import paths in db files.
Enhanced type safety and documentation in several files, including adding explicit type annotations for script objects and function parameters. Improved error handling and code clarity in scriptDownloader.js, and updated autoSyncService.js to remove unnecessary cron job options. Refactored prisma.config.ts for schema configuration and updated server.js to support backup storage and improve parameter defaults.
Upgraded Prisma and related dependencies to version 7.0.1 and added @prisma/adapter-better-sqlite3 and better-sqlite3 to support the new adapter. This enables improved SQLite integration and compatibility with the latest Prisma features.
Added detailed JSDoc comments and type annotations to ScriptDownloaderService for better maintainability and clarity. Refactored initialization logic to always set scriptsDirectory and repoUrl. Enhanced autoSyncService to specify cron job timezone and options. Updated PrismaClient import path for compatibility with generated client structure.
Removed or updated unnecessary eslint-disable comments across several server and service files to improve code clarity. Fixed import paths and added TypeScript ignore comments where needed for compatibility. Minor formatting adjustments were made for readability.
Updated import statements across several server files to omit explicit file extensions. This improves compatibility with module resolution and aligns with common import practices.
Updated the initialization logic to use the 'recursive' option when creating the data/ssh-keys directory, ensuring parent directories are created if they do not exist.
This commit adds TypeScript type definitions for database entities and updates all methods in DatabaseServicePrisma to use explicit type annotations and return types. This improves type safety, code clarity, and maintainability by ensuring consistent return values and better integration with Prisma-generated types.
This reverts commit aebc8a6.
…ervice) and fix .js import extensions
…ma 7, tsx support)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #347 #346 #345 #344 #343
✍️ Description
This PR introduces comprehensive TypeScript runtime support via
tsxand resolves critical compatibility issues with Prisma 7, enabling the application to run successfully in production. The changes span type safety improvements, module resolution fixes, and production deployment readiness.📋 Changes Summary (30 Commits)
🔧 Core Infrastructure Changes
TypeScript Runtime Support
tsx@^4.19.4as a production dependencystartscript:node server.js→node --import tsx server.jsdev:serverscript for consistency:node --import tsx server.js.tsfile loading in production environmentModule Resolution & Imports
.tsextensions to TypeScript imports where required🐛 Bug Fixes
Prisma 7 Compatibility
src/server/db.jsto properly import Prisma 7 clientprisma/generated/prisma/client.tsServer Initialization Issues
initializeRepositories()export tosrc/server/lib/autoSyncInit.tsTypeError: autoSyncModule.initializeRepositories is not a functionService Module Exports
src/server/services/autoSyncService.jssrc/server/services/repositoryService.jssrc/server/services/githubJsonService.jsDynamic Import Implementation
autoSyncInitmodule✨ Features & Improvements
Development Experience
dev:servercommand for development with TypeScript supportProduction Readiness
Type Safety
npm run typecheck📝 Files Modified
package.jsontsxdependency; Updated start/dev scriptsserver.jssrc/server/db.jssrc/server/lib/autoSyncInit.tsinitializeRepositories()export; Added TypeScript definitionssrc/server/services/autoSyncService.jssrc/server/services/repositoryService.jssrc/server/services/githubJsonService.jssrc/server/database-prisma.tsanytype issues; Added explicit return types🔍 Technical Details
What Was Wrong
.tsfiles while.jsversions had themHow It Was Fixed
.tsand.jsexports to match✅ Testing & Verification
npm installcompletes without errorsnpm run buildcompletes successfullynpm run typecheckpasses with no errorsnpm run lintandnpm run format:checkpassnpm startruns without errors📊 Commit Overview
30 commits across:
🔗 Related Issues
✅ Prerequisites
🛠️ Type of Change
tsx