fix: resolve PWA build issues with SQL.js worker files

- Update worker format to ESM in Vite config to fix IIFE format error

- Increase PWA precache file size limit to 10MB to accommodate SQL.js files

- Fix type declarations for worker configuration

- Add proper type annotations for Vite config

- Add type declarations for absurd-sql module
This commit is contained in:
Matthew Raymer
2025-05-27 06:54:29 +00:00
parent 2d654b4586
commit 3428f9e6ab
7 changed files with 116 additions and 23 deletions

View File

@@ -53,7 +53,7 @@ async function example() {
[did, publicKeyHex]
);
} catch (error) {
} catch (error) {
console.error('Database operation failed:', error);
}
}
@@ -88,7 +88,7 @@ export class AbsurdSqlDatabaseService implements PlatformService {
private static instance: AbsurdSqlDatabaseService | null = null;
private db: AbsurdSqlDatabase | null = null;
private initialized: boolean = false;
// Singleton pattern
static getInstance(): AbsurdSqlDatabaseService {
if (!AbsurdSqlDatabaseService.instance) {
@@ -101,7 +101,7 @@ export class AbsurdSqlDatabaseService implements PlatformService {
async dbQuery(sql: string, params: unknown[] = []): Promise<QueryExecResult[]> {
await this.waitForInitialization();
return this.queueOperation<QueryExecResult[]>("query", sql, params);
}
}
async dbExec(sql: string, params: unknown[] = []): Promise<void> {
await this.waitForInitialization();
@@ -136,8 +136,8 @@ async function getAccount(did: string): Promise<Account | undefined> {
}
return account;
}
```
}
```
## Success Criteria