- Fixed unnecessary conditional checks for optional properties in page.tsx
- Fixed unnecessary type assertions in page.tsx
- Fixed nullable object checks in test files
- Fixed nullable string checks in filtering.ts and validate-email.ts
- Removed unused eslint-disable directives across multiple files
- Fixed redundant type warning in monaco-editor-react.d.ts
- Generated Prisma types to resolve type errors
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
- Fixed ItemsPerPageSelector.test.tsx line 46: Added missing if statement and proper bracing
- Fixed retry.test.ts lines 148, 167, 176, 190: Moved eslint-disable comments to proper location
- All reported TypeScript compilation errors are now resolved
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
- Added test:unit script for unit tests
- Added test:e2e script referencing root Playwright config
- Added test:e2e:ui, test:e2e:headed, test:e2e:debug scripts
- Added test:e2e:report script
- Added test:e2e:dbal-daemon script for daemon-specific tests
- Fixed playwright.dbal-daemon.config.ts to use correct paths and health endpoint
This resolves the CI blocker where workflows running from frontends/nextjs
directory couldn't find these scripts.
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
Fixed issue where absolute bot paths were hardcoded in Prisma configuration:
- Changed fallback from 'file:/home/runner/work/metabuilder/metabuilder/prisma/prisma/dev.db'
to 'file:../../prisma/prisma/dev.db' in both files
- This makes the code portable and works regardless of deployment location
- Verified dev server starts correctly and database operations work with relative path
Files modified:
- frontends/nextjs/src/lib/config/prisma.ts
- dbal/development/src/adapters/prisma/context.ts
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
- Created comprehensive E2E test suite for pagination components
- Added middleware index.ts for clean exports
- Tests cover PaginationControls, ItemsPerPageSelector, PaginationInfo
- Tests verify navigation, page selection, items per page, and info display
- Complete pagination workflow test included
- All code standards followed
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
- Created PaginationControls component with fakemui Pagination
- Created ItemsPerPageSelector component with fakemui Select
- Created PaginationInfo component for display text
- Added comprehensive unit tests (25 tests, all passing)
- Fixed 4 pre-existing test failures (orderBy format issue)
- All 443 tests passing (100% pass rate)
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
The root cause was incorrect adapter usage:
- PrismaBetterSqlite3 is a FACTORY that expects {url: string} config
- We were incorrectly passing a Database instance directly
- This caused "Cannot read properties of undefined (reading 'replace')" error
Changes:
1. Fixed Next.js prisma.ts to pass {url} config to adapter factory
2. Fixed DBAL context.ts to use adapter factory with URL
3. Removed direct Database instantiation - let adapter handle it
4. Created absolute-path .env file with DATABASE_URL
5. Cleaned and reinstalled all dependencies to ensure version alignment
6. Added missing database columns (tenantId, config to InstalledPackage)
Result: Database operations now work! Application serves pages successfully.
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
- Add retry utility with exponential backoff for transient failures
- Add pagination utilities supporting both offset and cursor-based pagination
- Add filtering and sorting utilities for API requests
- Include comprehensive unit tests (109 tests total, all passing)
- Utilities designed to work with Prisma ORM
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
- Replace placeholder implementations with actual fetch calls to /api/v1/ endpoints
- Add ListQueryParams interface for pagination, filtering, and sorting
- Implement buildQueryString utility for query parameter encoding
- Add proper error handling and HTTP status code mapping
- Create 29 comprehensive unit tests covering all CRUD operations
- Test success cases, error cases, network failures, and query string building
- Add E2E test suite for complete CRUD flows with 50+ test scenarios
- Mock server-only module in tests for compatibility
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
- Added index signatures to all generated types and Create/Update input types
- Fixed Workflow description field type (null vs undefined)
- Fixed lint errors in API route (proper type checking for user object)
- Added server-only directive to compiler module
- Temporarily disabled PackageStyleLoader (needs API route instead of client-side fs access)
- Simplified main.scss to avoid SCSS @use import order issues
- TypeScript errors reduced from 39 to ~19 (mostly missing Prisma models)
- Build process now gets further (past SCSS compilation)
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
- Fixed Storybook dependency version mismatch (downgraded to 8.6.15)
- Added @types/better-sqlite3 for better-sqlite3 type definitions
- Fixed Prisma adapter import (PrismaBetterSqlite3 vs PrismaBetterSQLite3)
- Removed datasource URL from Prisma schema (Prisma 7 requirement)
- Generated DBAL types.generated.ts from Prisma schema
- Added index signatures to Update*Input types for Record<string, unknown> compatibility
- Fixed ErrorBoundary override modifiers
- Fixed Zod record schema (requires both key and value types)
- Fixed orderBy syntax in get-error-logs (array format)
- Fixed type safety in API routes (user type assertions)
- Fixed hook imports and exports
- Fixed conditional expression type guards
- Added .npmrc for legacy peer deps support
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
- Introduced `dbal_commands.h` for handling DBAL operations via CLI.
- Implemented `package_commands.cpp` and `package_commands.h` for package management, including listing, running scripts, and generating packages.
- Created `lua_runner.cpp` and `lua_runner.h` to execute Lua scripts in a secure sandbox environment.
- Added `http_client.cpp` and `http_client.h` for making HTTP requests to a specified base URL.
- Updated `main.cpp` to initialize the HTTP client and dispatch commands based on user input.
- Added `jsonScript` property to metadata schema for JSON script entry points.
- Refactored `generate-package.ts` to replace Lua scripts with JSON scripts for lifecycle hooks.
- Updated test generation to use JSON format for metadata validation.
- Modified documentation and comments to reflect the transition from Lua to JSON scripting.
- Adjusted Storybook configuration and mock data to align with new JSON script structure.
- Renamed relevant files and references from Lua to JSON for consistency across the project.
- Deleted dbal_commands.h and package_commands.h files, removing DBAL command handlers and package command definitions.
- Removed package_commands.cpp, which contained the implementation of package commands including list, run, and generate functionalities.
- Eliminated lua_runner.cpp and lua_runner.h, which provided the Lua script execution environment and related functionalities.
- Removed main.cpp and http_client files, which were responsible for the CLI entry point and HTTP client interactions.
- Updated functions.json files in theme_editor, ui_auth, ui_footer, ui_header, ui_home, ui_intro, ui_level2, ui_level3, ui_level4, ui_level5, ui_level6, ui_login, ui_pages, ui_permissions, user_manager, and workflow_editor packages.
- Removed luaScript entries from function definitions, retaining only category and other relevant metadata.
- Adjusted documentation in prisma/README.md to remove LuaScript entity reference.
- Deleted all LuaScript CRUD operations from Client and entities.
- Removed LuaScript validation functions and related files.
- Updated InMemoryStore to remove LuaScript storage.
- Cleaned up tests by removing LuaScript related test cases.
- Adjusted documentation and quick start guide to reflect the removal of LuaScript functionality.
- Updated page validation to include new properties such as path, componentTree, requiresAuth, and more.
- Enhanced session validation to check for bigint timestamps and added checks for ipAddress and userAgent.
- Improved user validation by adding checks for profilePicture, bio, createdAt, and tenantId.
- Refactored workflow validation to ensure nodes and edges are valid JSON strings and added checks for createdAt and updatedAt.
- Introduced isValidJsonString utility for validating JSON strings.
- Added seedUsers function to populate default users in the database.
- Removed unused generateComponentTree stub and replaced it with a full implementation for rendering Lua UI components.
- Updated useLevelRouting and useResolvedUser hooks to support new permission levels and user state management.
- Enhanced useRestApi hook to support request cancellation with AbortSignal.