fix(capacitor): getting capacitor to build
This commit is contained in:
@@ -790,7 +790,7 @@ java -version # Should be 11+
|
||||
|
||||
# Solution: Clear Gradle cache
|
||||
./gradlew clean
|
||||
rm -rf ~/.gradle/caches/
|
||||
rm -rf ~/.gradle/caches ~/.gradle/daemon
|
||||
```
|
||||
|
||||
#### Build Failures
|
||||
|
||||
@@ -13,7 +13,18 @@ export default defineConfigWithVueTs(
|
||||
files: ['**/*.{ts,mts,tsx,vue}'],
|
||||
},
|
||||
|
||||
globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),
|
||||
globalIgnores([
|
||||
'**/dist/**',
|
||||
'**/dist-ssr/**',
|
||||
'**/coverage/**',
|
||||
'**/android/**',
|
||||
'**/ios/**',
|
||||
'**/node_modules/**',
|
||||
'**/*.js',
|
||||
'**/*.min.js',
|
||||
'**/build/**',
|
||||
'**/.gradle/**'
|
||||
]),
|
||||
|
||||
pluginVue.configs['flat/essential'],
|
||||
vueTsConfigs.recommended,
|
||||
|
||||
49
test-apps/daily-notification-test/src/env.d.ts
vendored
49
test-apps/daily-notification-test/src/env.d.ts
vendored
@@ -2,7 +2,7 @@
|
||||
|
||||
declare module '*.vue' {
|
||||
import type { DefineComponent } from 'vue'
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
const component: DefineComponent<Record<string, unknown>, Record<string, unknown>, unknown>
|
||||
export default component
|
||||
}
|
||||
|
||||
@@ -10,48 +10,49 @@ declare module '*.vue' {
|
||||
declare module 'vue-facing-decorator' {
|
||||
import { ComponentOptions } from 'vue'
|
||||
|
||||
export interface ComponentOptionsWithProps<T = any> extends ComponentOptions<T> {
|
||||
props?: any
|
||||
export interface ComponentOptionsWithProps<T = Record<string, unknown>> extends ComponentOptions<T> {
|
||||
props?: Record<string, unknown>
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function Component(options?: any): any
|
||||
export function toNative<T>(component: T): T
|
||||
|
||||
export class Vue {
|
||||
$emit(event: string, ...args: any[]): void
|
||||
$props: any
|
||||
$data: any
|
||||
$refs: any
|
||||
$slots: any
|
||||
$scopedSlots: any
|
||||
$attrs: any
|
||||
$listeners: any
|
||||
$emit(event: string, ...args: unknown[]): void
|
||||
$props: Record<string, unknown>
|
||||
$data: Record<string, unknown>
|
||||
$refs: Record<string, unknown>
|
||||
$slots: Record<string, unknown>
|
||||
$scopedSlots: Record<string, unknown>
|
||||
$attrs: Record<string, unknown>
|
||||
$listeners: Record<string, unknown>
|
||||
$parent: Vue | null
|
||||
$root: Vue
|
||||
$children: Vue[]
|
||||
$el: Element | undefined
|
||||
$options: ComponentOptions
|
||||
$isServer: boolean
|
||||
$ssrContext: any
|
||||
$vnode: any
|
||||
$createElement: any
|
||||
$mount: any
|
||||
$ssrContext: Record<string, unknown>
|
||||
$vnode: Record<string, unknown>
|
||||
$createElement: (...args: unknown[]) => unknown
|
||||
$mount: (elementOrSelector?: string | Element) => Vue
|
||||
$forceUpdate: () => void
|
||||
$destroy: () => void
|
||||
$nextTick: (callback?: () => void) => Promise<void>
|
||||
$set: (target: any, key: string | number, value: any) => void
|
||||
$delete: (target: any, key: string | number) => void
|
||||
$watch: (expOrFn: string | Function, callback: Function, options?: any) => Function
|
||||
$on: (event: string | string[], callback: Function) => Vue
|
||||
$once: (event: string | string[], callback: Function) => Vue
|
||||
$off: (event?: string | string[], callback?: Function) => Vue
|
||||
$set: (target: Record<string, unknown>, key: string | number, value: unknown) => void
|
||||
$delete: (target: Record<string, unknown>, key: string | number) => void
|
||||
$watch: (expOrFn: string | ((...args: unknown[]) => unknown), callback: (...args: unknown[]) => unknown, options?: Record<string, unknown>) => (...args: unknown[]) => unknown
|
||||
$on: (event: string | string[], callback: (...args: unknown[]) => unknown) => Vue
|
||||
$once: (event: string | string[], callback: (...args: unknown[]) => unknown) => Vue
|
||||
$off: (event?: string | string[], callback?: (...args: unknown[]) => unknown) => Vue
|
||||
}
|
||||
|
||||
export function Prop(options?: any): PropertyDecorator
|
||||
export function Prop(options?: Record<string, unknown>): PropertyDecorator
|
||||
export function Emit(event?: string): MethodDecorator
|
||||
export function Watch(path: string, options?: any): MethodDecorator
|
||||
export function Watch(path: string, options?: Record<string, unknown>): MethodDecorator
|
||||
export function Inject(key?: string | symbol): PropertyDecorator
|
||||
export function Provide(key?: string | symbol): PropertyDecorator
|
||||
export function Model(event?: string, options?: any): PropertyDecorator
|
||||
export function Model(event?: string, options?: Record<string, unknown>): PropertyDecorator
|
||||
export function Ref(refKey?: string): PropertyDecorator
|
||||
}
|
||||
|
||||
@@ -2,6 +2,10 @@ export {}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
Capacitor?: any
|
||||
Capacitor?: {
|
||||
Plugins?: Record<string, unknown>
|
||||
isNativePlatform?: () => boolean
|
||||
getPlatform?: () => string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,26 @@ declare global {
|
||||
}
|
||||
Capacitor?: {
|
||||
Plugins?: {
|
||||
DailyNotification?: any
|
||||
DailyNotification?: {
|
||||
checkStatus(): Promise<{
|
||||
canScheduleNow: boolean
|
||||
postNotificationsGranted: boolean
|
||||
channelEnabled: boolean
|
||||
channelImportance: number
|
||||
channelId: string
|
||||
exactAlarmsGranted: boolean
|
||||
exactAlarmsSupported: boolean
|
||||
androidVersion: number
|
||||
nextScheduledAt: number
|
||||
}>
|
||||
scheduleNotification(options: {
|
||||
title: string
|
||||
body: string
|
||||
scheduledTime: number
|
||||
}): Promise<void>
|
||||
cancelNotification(id: string): Promise<void>
|
||||
requestPermissions(): Promise<boolean>
|
||||
}
|
||||
Clipboard?: {
|
||||
write(options: { string: string }): Promise<void>
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ const runPluginDiagnostics = async (): Promise<void> => {
|
||||
console.log('✅ DailyNotification plugin available')
|
||||
|
||||
// Get all available plugins
|
||||
const allPlugins = Object.keys((window as any).Capacitor?.Plugins || {})
|
||||
const allPlugins = Object.keys((window as Window & { Capacitor?: { Plugins?: Record<string, unknown> } }).Capacitor?.Plugins || {})
|
||||
console.log('📋 All available plugins:', allPlugins)
|
||||
|
||||
// Test the checkStatus method
|
||||
@@ -311,7 +311,7 @@ const runPluginDiagnostics = async (): Promise<void> => {
|
||||
dailyNotificationAvailable: true,
|
||||
allAvailablePlugins: allPlugins,
|
||||
dailyNotificationStatus: status,
|
||||
capacitorVersion: (window as any).Capacitor?.getPlatform ? 'Available' : 'Unknown',
|
||||
capacitorVersion: (window as Window & { Capacitor?: { getPlatform?: () => string } }).Capacitor?.getPlatform ? 'Available' : 'Unknown',
|
||||
webViewInfo: {
|
||||
userAgent: navigator.userAgent,
|
||||
platform: navigator.platform
|
||||
@@ -331,8 +331,8 @@ const runPluginDiagnostics = async (): Promise<void> => {
|
||||
}
|
||||
} else {
|
||||
console.warn('⚠️ DailyNotification plugin not available')
|
||||
const allPlugins = Object.keys((window as any).Capacitor?.Plugins || {})
|
||||
alert(`❌ Plugin Diagnostics Complete!\n\nPlatform: ${platform}\nDailyNotification Plugin: Not Available\n\nAll Available Plugins (${allPlugins.length}):\n${allPlugins.join(', ')}\n\nCapacitor Plugins Object:\n${JSON.stringify((window as any).Capacitor?.Plugins || {}, null, 2)}`)
|
||||
const allPlugins = Object.keys((window as Window & { Capacitor?: { Plugins?: Record<string, unknown> } }).Capacitor?.Plugins || {})
|
||||
alert(`❌ Plugin Diagnostics Complete!\n\nPlatform: ${platform}\nDailyNotification Plugin: Not Available\n\nAll Available Plugins (${allPlugins.length}):\n${allPlugins.join(', ')}\n\nCapacitor Plugins Object:\n${JSON.stringify((window as Window & { Capacitor?: { Plugins?: Record<string, unknown> } }).Capacitor?.Plugins || {}, null, 2)}`)
|
||||
}
|
||||
} else {
|
||||
console.log('🌐 Running in web mode - plugin not available')
|
||||
|
||||
@@ -102,11 +102,11 @@ class LogsView extends Vue {
|
||||
this.isCopying = true
|
||||
try {
|
||||
const text = this.logs.map(l => `[${this.formatTimestamp(l.ts)}] ${l.msg}`).join('\n')
|
||||
if ((navigator as any)?.clipboard?.writeText) {
|
||||
if ((navigator as Navigator & { clipboard?: { writeText?: (text: string) => Promise<void> } })?.clipboard?.writeText) {
|
||||
await navigator.clipboard.writeText(text); return
|
||||
}
|
||||
const Cap = (window as any)?.Capacitor
|
||||
const Clip = Cap?.Plugins?.Clipboard
|
||||
const Cap = (window as Window & { Capacitor?: { Plugins?: Record<string, unknown> } })?.Capacitor
|
||||
const Clip = Cap?.Plugins?.Clipboard as { write?: (options: { string: string }) => Promise<void> } | undefined
|
||||
if (Clip?.write) { await Clip.write({ string: text }); return }
|
||||
console.warn('No clipboard API available.')
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user