forked from jsnbuchanan/crowd-funder-for-time-pwa
feat: Complete PlatformServiceMixin migration and enhance tooling
- Update migration assessment: All database operations now migrated (60/60 components) - Enhance validate-migration.sh: Improved pattern detection and reporting - Upgrade format-markdown.sh: Add parallel processing and CI-friendly output - Clean up legacy logging patterns in ContactImportView.vue - Remove unused imports and optimize PlatformServiceMixin - Streamline deep links service and utility functions Migration Status: 100% database operations complete, only 4 logging cleanup files remain
This commit is contained in:
@@ -34,7 +34,6 @@ import { PlatformServiceFactory } from "../services/PlatformServiceFactory";
|
||||
import { IIdentifier } from "@veramo/core";
|
||||
import { DEFAULT_ROOT_DERIVATION_PATH } from "./crypto";
|
||||
|
||||
// Self-contained utility functions to replace databaseUtil dependencies
|
||||
function parseJsonField<T>(value: unknown, defaultValue: T): T {
|
||||
if (typeof value === "string") {
|
||||
try {
|
||||
|
||||
@@ -147,8 +147,6 @@ export class DeepLinkHandler {
|
||||
params[routeConfig.paramKey ?? "id"] = pathParams.join("/");
|
||||
}
|
||||
|
||||
// Note: Logging removed to eliminate databaseUtil dependency
|
||||
// Deep link parsing debug info can be added back using PlatformServiceMixin if needed
|
||||
return { path: routePath, params, query };
|
||||
}
|
||||
|
||||
@@ -174,7 +172,6 @@ export class DeepLinkHandler {
|
||||
const validRoute = routeSchema.parse(path) as DeepLinkRoute;
|
||||
routeName = ROUTE_MAP[validRoute].name;
|
||||
} catch (error) {
|
||||
// Log the invalid route attempt - using console.error instead of databaseUtil
|
||||
console.error(`[DeepLink] Invalid route path: ${path}`);
|
||||
|
||||
// Redirect to error page with information about the invalid link
|
||||
@@ -261,7 +258,6 @@ export class DeepLinkHandler {
|
||||
await this.validateAndRoute(path, sanitizedParams, query);
|
||||
} catch (error) {
|
||||
const deepLinkError = error as DeepLinkError;
|
||||
// Log the error using console.error instead of databaseUtil
|
||||
console.error(
|
||||
`[DeepLink] Error (${deepLinkError.code}): ${deepLinkError.details}`,
|
||||
);
|
||||
|
||||
@@ -124,7 +124,7 @@ export const PlatformServiceMixin = {
|
||||
|
||||
/**
|
||||
* Access to in-memory logs array
|
||||
* Provides direct access to memoryLogs without requiring databaseUtil import
|
||||
* Provides direct access to memoryLogs
|
||||
*/
|
||||
$memoryLogs(): string[] {
|
||||
return _memoryLogs;
|
||||
@@ -159,7 +159,7 @@ export const PlatformServiceMixin = {
|
||||
|
||||
methods: {
|
||||
// =================================================
|
||||
// SELF-CONTAINED UTILITY METHODS (no databaseUtil dependency)
|
||||
// SELF-CONTAINED UTILITY METHODS
|
||||
// =================================================
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
* Enhanced logger with self-contained database logging
|
||||
*
|
||||
* Eliminates circular dependency with databaseUtil by using direct database access.
|
||||
* Provides comprehensive logging with console and database output.
|
||||
*
|
||||
* @author Matthew Raymer
|
||||
|
||||
@@ -256,10 +256,6 @@ import { createNotifyHelpers, TIMEOUTS } from "@/utils/notify";
|
||||
// TODO: Testing Required - Database Operations + Logging Migration to PlatformServiceMixin
|
||||
// Priority: Medium | Migrated: 2025-07-06 | Author: Matthew Raymer
|
||||
//
|
||||
// MIGRATION DETAILS: Migrated from legacy databaseUtil + logConsoleAndDb to PlatformServiceMixin
|
||||
// - Replaced logConsoleAndDb() with this.$logAndConsole()
|
||||
// - Replaced databaseUtil.* calls with mixin methods
|
||||
// - Removed PlatformServiceFactory direct usage in favor of mixin
|
||||
//
|
||||
// TESTING NEEDED: Contact import functionality
|
||||
// 1. Test contact import via URL: /contact-import?contacts=[{"did":"did:example:123","name":"Alice"}]
|
||||
|
||||
Reference in New Issue
Block a user