Browse Source
- Added "type": "module" to package.json to support ES module imports for Electron SQLite - Renamed postcss.config.js to postcss.config.cjs to maintain CommonJS syntax - This ensures build tools can properly load the PostCSS configurationpull/134/head
12 changed files with 262 additions and 115 deletions
@ -0,0 +1,69 @@ |
|||||
|
#! /bin/bash |
||||
|
|
||||
|
# Exit on any error |
||||
|
set -e |
||||
|
|
||||
|
# Function to check if a command exists |
||||
|
check_command() { |
||||
|
if ! command -v $1 &> /dev/null; then |
||||
|
echo "Error: $1 is required but not installed." |
||||
|
exit 1 |
||||
|
fi |
||||
|
} |
||||
|
|
||||
|
# Check required commands |
||||
|
check_command node |
||||
|
check_command npm |
||||
|
|
||||
|
# Clean up previous builds |
||||
|
echo "Cleaning previous builds..." |
||||
|
rm -rf dist* |
||||
|
|
||||
|
# Set environment variables for the build |
||||
|
echo "Setting up environment variables..." |
||||
|
export VITE_PLATFORM=electron |
||||
|
export VITE_PWA_ENABLED=false |
||||
|
export VITE_DISABLE_PWA=true |
||||
|
|
||||
|
# Ensure TypeScript is installed |
||||
|
echo "Checking TypeScript installation..." |
||||
|
if [ ! -f "./node_modules/.bin/tsc" ]; then |
||||
|
echo "Installing TypeScript..." |
||||
|
npm install --save-dev typescript@~5.2.2 |
||||
|
# Verify installation |
||||
|
if [ ! -f "./node_modules/.bin/tsc" ]; then |
||||
|
echo "TypeScript installation failed!" |
||||
|
exit 1 |
||||
|
fi |
||||
|
fi |
||||
|
|
||||
|
# Get git hash for versioning |
||||
|
GIT_HASH=$(git log -1 --pretty=format:%h) |
||||
|
|
||||
|
# Build web assets |
||||
|
echo "Building web assets..." |
||||
|
VITE_GIT_HASH=$GIT_HASH npx vite build --config vite.config.app.electron.mts --mode electron |
||||
|
|
||||
|
# TypeScript compilation |
||||
|
echo "Running TypeScript compilation..." |
||||
|
if ! ./node_modules/.bin/tsc -p tsconfig.electron.json; then |
||||
|
echo "TypeScript compilation failed!" |
||||
|
exit 1 |
||||
|
fi |
||||
|
|
||||
|
# Build electron main process |
||||
|
echo "Building electron main process..." |
||||
|
VITE_GIT_HASH=$GIT_HASH npx vite build --config vite.config.electron.mts --mode electron |
||||
|
|
||||
|
# Organize files |
||||
|
echo "Organizing build files..." |
||||
|
mkdir -p dist-electron/www |
||||
|
cp -r dist/* dist-electron/www/ |
||||
|
mkdir -p dist-electron/resources |
||||
|
cp src/electron/preload.js dist-electron/resources/preload.js |
||||
|
|
||||
|
# Build the AppImage |
||||
|
echo "Building AppImage..." |
||||
|
npx electron-builder --linux AppImage |
||||
|
|
||||
|
echo "Build completed successfully!" |
@ -1,6 +1,46 @@ |
|||||
declare module '@capacitor-community/sqlite/electron/dist/plugin' { |
declare module '@capacitor-community/sqlite/electron/dist/plugin.js' { |
||||
export class CapacitorSQLiteElectron { |
export class CapacitorSQLite { |
||||
constructor(); |
constructor(); |
||||
handle(event: Electron.IpcMainInvokeEvent, ...args: any[]): Promise<any>; |
handle(event: Electron.IpcMainInvokeEvent, ...args: any[]): Promise<any>; |
||||
|
createConnection(options: any): Promise<any>; |
||||
|
closeConnection(options: any): Promise<any>; |
||||
|
echo(options: any): Promise<any>; |
||||
|
open(options: any): Promise<any>; |
||||
|
close(options: any): Promise<any>; |
||||
|
beginTransaction(options: any): Promise<any>; |
||||
|
commitTransaction(options: any): Promise<any>; |
||||
|
rollbackTransaction(options: any): Promise<any>; |
||||
|
isTransactionActive(options: any): Promise<any>; |
||||
|
getVersion(options: any): Promise<any>; |
||||
|
getTableList(options: any): Promise<any>; |
||||
|
execute(options: any): Promise<any>; |
||||
|
executeSet(options: any): Promise<any>; |
||||
|
run(options: any): Promise<any>; |
||||
|
query(options: any): Promise<any>; |
||||
|
isDBExists(options: any): Promise<any>; |
||||
|
isDBOpen(options: any): Promise<any>; |
||||
|
isDatabase(options: any): Promise<any>; |
||||
|
isTableExists(options: any): Promise<any>; |
||||
|
deleteDatabase(options: any): Promise<any>; |
||||
|
isJsonValid(options: any): Promise<any>; |
||||
|
importFromJson(options: any): Promise<any>; |
||||
|
exportToJson(options: any): Promise<any>; |
||||
|
createSyncTable(options: any): Promise<any>; |
||||
|
setSyncDate(options: any): Promise<any>; |
||||
|
getSyncDate(options: any): Promise<any>; |
||||
|
deleteExportedRows(options: any): Promise<any>; |
||||
|
addUpgradeStatement(options: any): Promise<any>; |
||||
|
copyFromAssets(options: any): Promise<any>; |
||||
|
getFromHTTPRequest(options: any): Promise<any>; |
||||
|
getDatabaseList(): Promise<any>; |
||||
|
checkConnectionsConsistency(options: any): Promise<any>; |
||||
|
isSecretStored(): Promise<any>; |
||||
|
isPassphraseValid(options: any): Promise<any>; |
||||
|
setEncryptionSecret(options: any): Promise<any>; |
||||
|
changeEncryptionSecret(options: any): Promise<any>; |
||||
|
clearEncryptionSecret(): Promise<any>; |
||||
|
isInConfigEncryption(): Promise<any>; |
||||
|
isDatabaseEncrypted(options: any): Promise<any>; |
||||
|
checkEncryptionSecret(options: any): Promise<any>; |
||||
} |
} |
||||
} |
} |
Loading…
Reference in new issue