migration: move to bash based build scripts

This commit is contained in:
Matthew Raymer
2025-06-24 11:11:33 +00:00
parent 2b0e60dfc2
commit 25974cae22
34 changed files with 3350 additions and 571 deletions

View File

@@ -1,4 +0,0 @@
import { initializeApp } from "./main.common";
const app = initializeApp();
app.mount("#app");

View File

@@ -1,59 +0,0 @@
import webview
import os
import sys
from http.server import HTTPServer, SimpleHTTPRequestHandler
import threading
def get_dist_path():
if getattr(sys, 'frozen', False):
base_path = sys._MEIPASS
else:
base_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
dist_path = os.path.join(base_path, 'dist')
print(f"Dist path: {dist_path}")
return dist_path
class CustomHandler(SimpleHTTPRequestHandler):
def __init__(self, *args, **kwargs):
dist_dir = get_dist_path()
print(f"Serving from directory: {dist_dir}")
super().__init__(*args, directory=dist_dir, **kwargs)
def log_message(self, format, *args):
# Override to show more detailed logging
print(f"Request: {format%args}")
if hasattr(self, 'path'):
print(f"Requested path: {self.path}")
full_path = os.path.join(self.directory, self.path.lstrip('/'))
print(f"Full path: {full_path}")
print(f"File exists: {os.path.exists(full_path)}")
if self.path.endswith('.html'):
print(f"HTML content: {open(full_path).read()[:200]}...")
def run_server(port=8000):
server_address = ('localhost', port)
httpd = HTTPServer(server_address, CustomHandler)
print(f"Serving files from {get_dist_path()} at http://localhost:{port}")
httpd.serve_forever()
def main():
dist_path = get_dist_path()
# Start local server
server_thread = threading.Thread(target=run_server)
server_thread.daemon = True
server_thread.start()
# Create window using local server
window = webview.create_window(
'TimeSafari',
url='http://localhost:8000',
width=1200,
height=800
)
webview.start(debug=True)
if __name__ == '__main__':
main()

View File

@@ -2,7 +2,6 @@ import { PlatformService } from "./PlatformService";
import { WebPlatformService } from "./platforms/WebPlatformService";
import { CapacitorPlatformService } from "./platforms/CapacitorPlatformService";
import { ElectronPlatformService } from "./platforms/ElectronPlatformService";
import { PyWebViewPlatformService } from "./platforms/PyWebViewPlatformService";
/**
* Factory class for creating platform-specific service implementations.
@@ -12,7 +11,6 @@ import { PyWebViewPlatformService } from "./platforms/PyWebViewPlatformService";
* environment variable. Supported platforms are:
* - capacitor: Mobile platform using Capacitor
* - electron: Desktop platform using Electron
* - pywebview: Python WebView implementation
* - web: Default web platform (fallback)
*
* @example
@@ -44,9 +42,6 @@ export class PlatformServiceFactory {
case "electron":
PlatformServiceFactory.instance = new ElectronPlatformService();
break;
case "pywebview":
PlatformServiceFactory.instance = new PyWebViewPlatformService();
break;
case "web":
default:
PlatformServiceFactory.instance = new WebPlatformService();

View File

@@ -1,135 +0,0 @@
import {
ImageResult,
PlatformService,
PlatformCapabilities,
} from "../PlatformService";
import { logger } from "../../utils/logger";
import { QueryExecResult } from "@/interfaces/database";
/**
* Platform service implementation for PyWebView platform.
* Note: This is a placeholder implementation with most methods currently unimplemented.
* Implements the PlatformService interface but throws "Not implemented" errors for most operations.
*
* @remarks
* This service is intended for Python-based desktop applications using pywebview.
* Future implementations should provide:
* - Integration with Python backend file operations
* - System camera access through Python
* - Native system dialogs via pywebview
* - Python-JavaScript bridge functionality
*/
export class PyWebViewPlatformService implements PlatformService {
/**
* Gets the capabilities of the PyWebView platform
* @returns Platform capabilities object
*/
getCapabilities(): PlatformCapabilities {
return {
hasFileSystem: false, // Not implemented yet
hasCamera: false, // Not implemented yet
isMobile: false,
isIOS: false,
hasFileDownload: false, // Not implemented yet
needsFileHandlingInstructions: false,
};
}
/**
* Reads a file using the Python backend.
* @param _path - Path to the file to read
* @returns Promise that should resolve to file contents
* @throws Error with "Not implemented" message
* @todo Implement file reading through pywebview's Python-JavaScript bridge
*/
async readFile(_path: string): Promise<string> {
throw new Error("Not implemented");
}
/**
* Writes content to a file using the Python backend.
* @param _path - Path where to write the file
* @param _content - Content to write to the file
* @throws Error with "Not implemented" message
* @todo Implement file writing through pywebview's Python-JavaScript bridge
*/
async writeFile(_path: string, _content: string): Promise<void> {
throw new Error("Not implemented");
}
/**
* Deletes a file using the Python backend.
* @param _path - Path to the file to delete
* @throws Error with "Not implemented" message
* @todo Implement file deletion through pywebview's Python-JavaScript bridge
*/
async deleteFile(_path: string): Promise<void> {
throw new Error("Not implemented");
}
/**
* Lists files in the specified directory using the Python backend.
* @param _directory - Path to the directory to list
* @returns Promise that should resolve to array of filenames
* @throws Error with "Not implemented" message
* @todo Implement directory listing through pywebview's Python-JavaScript bridge
*/
async listFiles(_directory: string): Promise<string[]> {
throw new Error("Not implemented");
}
/**
* Should open system camera through Python backend.
* @returns Promise that should resolve to captured image data
* @throws Error with "Not implemented" message
* @todo Implement camera access using Python's camera libraries
*/
async takePicture(): Promise<ImageResult> {
logger.error("takePicture not implemented in PyWebView platform");
throw new Error("Not implemented");
}
/**
* Should open system file picker through pywebview.
* @returns Promise that should resolve to selected image data
* @throws Error with "Not implemented" message
* @todo Implement file picker using pywebview's file dialog API
*/
async pickImage(): Promise<ImageResult> {
logger.error("pickImage not implemented in PyWebView platform");
throw new Error("Not implemented");
}
/**
* Should handle deep link URLs through the Python backend.
* @param _url - The deep link URL to handle
* @throws Error with "Not implemented" message
* @todo Implement deep link handling using Python's URL handling capabilities
*/
async handleDeepLink(_url: string): Promise<void> {
logger.error("handleDeepLink not implemented in PyWebView platform");
throw new Error("Not implemented");
}
dbQuery(sql: string, params?: unknown[]): Promise<QueryExecResult> {
throw new Error("Not implemented for " + sql + " with params " + params);
}
dbExec(
sql: string,
params?: unknown[],
): Promise<{ changes: number; lastId?: number }> {
throw new Error("Not implemented for " + sql + " with params " + params);
}
/**
* Should write and share a file using the Python backend.
* @param _fileName - Name of the file to write and share
* @param _content - Content to write to the file
* @throws Error with "Not implemented" message
* @todo Implement file writing and sharing through pywebview's Python-JavaScript bridge
*/
async writeAndShareFile(_fileName: string, _content: string): Promise<void> {
logger.error("writeAndShareFile not implemented in PyWebView platform");
throw new Error("Not implemented");
}
}

View File

@@ -324,14 +324,6 @@ export class WebPlatformService implements PlatformService {
return false;
}
/**
* Checks if running on PyWebView platform.
* @returns false, as this is not PyWebView
*/
isPyWebView(): boolean {
return false;
}
/**
* Checks if running on web platform.
* @returns true, as this is the web implementation

View File

@@ -255,7 +255,7 @@ Raymer * @version 1.0.0 */
<button class="text-blue-500">View All New Activity For You</button>
</div>
</div>
<div>{{ apiServer }}</div>
<InfiniteScroll @reached-bottom="loadMoreGives">
<ul id="listLatestActivity" class="space-y-4">
<ActivityListItem
@@ -345,6 +345,7 @@ import { logger } from "../utils/logger";
import { GiveRecordWithContactInfo } from "../interfaces/give";
import { PlatformServiceFactory } from "@/services/PlatformServiceFactory";
import * as Package from "../../package.json";
import { id_ce_authorityKeyIdentifier } from "node_modules/@simplewebauthn/server/esm/deps";
interface Claim {
claim?: Claim; // For nested claims in Verifiable Credentials