feat(client): added capacitor app for web#2740
feat(client): added capacitor app for web#2740ayush-teon wants to merge 52 commits intoOutlineFoundation:masterfrom
Conversation
* Capacitor App added * Updated Comments * Updated Comments * Comments addressed and updated * Splash & Icon images removed * Update README.md
* Capacitor App added * Updated Comments * Updated Comments * Comments addressed and updated * Splash & Icon images removed * Update README.md * Streamlined package.json * Actions added to capacitor * Addressed package.json review comments. * Updated build and setup * Package updated * Setup and Build files updated * Setup file updated * Build and Setup files updated * Build, Setup and Package files updated * Build, Setup and Package files updated * Gitignore, Setup and Package files updated * Setup and Gradle settings updated * Updated Readme and title --------- Co-authored-by: Zahirul Islam <[email protected]>
…lidation Nthlink/capacitor migration key validation
* UI fixes for Capacitor * UI fixes for Capacitor * Fixed Capacitor UI * Removed listeners * Event listeners updated * Update client/web/views/root_view/add_access_key_dialog/index.ts Co-authored-by: J. Yi <[email protected]> --------- Co-authored-by: J. Yi <[email protected]>
…and iOS (#7) * UI fixes for Capacitor * UI fixes for Capacitor * Fixed Capacitor UI * Removed listeners * Converted android project from Java to Kotlin * Imported OutlineAndroidLib and added Plugin for capactior * Imported OutlineAppleLib and added Plugin for capacitor * Minor Fixes * added capacitor outline plugin and web server * Fixed sidebar and root-app height issue for ios * Added capacitor outline plugin * Updated cordova and capacitor build issues * updated capacitor build for build params * updated capacitor life cycle to register plugin * Fixed status type casting for ios * updated entry point html for capacitor * Added capacitor android * es lint fixed * Updated ios build for vpn extension provisioning profile for PacketTunnel * Fixed ios splash screen and external link issue on ios and android * reverted settings.json * Added android build folder to gitignore * Added cordova outline plugin relative path to capacitor and removed capacitor plugin * Added staging build configuration for capacitor ios and android * fixed android language switch issue * revert b6a663a server manager formatting * revert b6a663a commit formatting * Added templates to resolve dependencies, added generic pluginRegisterListener method and added platform based rootPath * reverted 36e9c7b commit formatting * revert b6a663a commit formatting * added relative path for outline plugin * Mac Catalyst support added * Merge branch 'nthlink/capacitor-outline-cap-plugin', remote-tracking branch 'origin' into nthlink/capacitor-outline-debug * revert server manager changes * revert previous messages * reverted to latest merged master branch * revert outlinePlugin change in cordova plugins * Build updated * revert eslint.json * added closing body tag * removed logging tag from android main activity * added vpn extension symbolic link * updated copyright text * Bundle IDs updated * Spawn stream reverted * Updated build config for production * updated build action for android debug * added hot reloading for android and ios for development and updated page UI issues * reverted merged files * reverted UI files * added browser plugin for external link handling * App Groups bundle ID updated * removed patch package and revert lock file * added comments in AppDelegate and refactored sync files * removed ios integration * Icon added for android build * Update client/capacitor/README.md Co-authored-by: J. Yi <[email protected]> --------- Co-authored-by: Ayush Kumar Sethi <[email protected]> Co-authored-by: Hasnainhanifse <[email protected]> Co-authored-by: J. Yi <[email protected]>
) * UI fixes for Capacitor * UI fixes for Capacitor * Fixed Capacitor UI * Removed listeners * Converted android project from Java to Kotlin * Imported OutlineAndroidLib and added Plugin for capactior * Imported OutlineAppleLib and added Plugin for capacitor * Minor Fixes * added capacitor outline plugin and web server * Fixed sidebar and root-app height issue for ios * Added capacitor outline plugin * Updated cordova and capacitor build issues * updated capacitor build for build params * updated capacitor life cycle to register plugin * Fixed status type casting for ios * updated entry point html for capacitor * Added capacitor android * es lint fixed * Updated ios build for vpn extension provisioning profile for PacketTunnel * Fixed ios splash screen and external link issue on ios and android * reverted settings.json * Added android build folder to gitignore * Added cordova outline plugin relative path to capacitor and removed capacitor plugin * Added staging build configuration for capacitor ios and android * fixed android language switch issue * revert b6a663a server manager formatting * revert b6a663a commit formatting * Added templates to resolve dependencies, added generic pluginRegisterListener method and added platform based rootPath * reverted 36e9c7b commit formatting * revert b6a663a commit formatting * added relative path for outline plugin * Mac Catalyst support added * Merge branch 'nthlink/capacitor-outline-cap-plugin', remote-tracking branch 'origin' into nthlink/capacitor-outline-debug * revert server manager changes * revert previous messages * reverted to latest merged master branch * revert outlinePlugin change in cordova plugins * Build updated * revert eslint.json * added closing body tag * removed logging tag from android main activity * added vpn extension symbolic link * updated copyright text * Bundle IDs updated * Spawn stream reverted * Updated build config for production * updated build action for android debug * added hot reloading for android and ios for development and updated page UI issues * reverted merged files * reverted UI files * added browser plugin for external link handling * App Groups bundle ID updated * removed patch package and revert lock file * added comments in AppDelegate and refactored sync files * Fixed iOS removed mac config * Code Signing Updated for Capacitor iOS * Bundle ID Updated for VPN extension on Capacitor iOS --------- Co-authored-by: Hasnainhanifse <[email protected]>
* fix: feedback implemented * updated capacitor build script with npx cap copy and removed scripts * Updates to readme and package --------- Co-authored-by: Muhammad Asad <[email protected]> Co-authored-by: Hasnainhanifse <[email protected]>
* updated contact view unit tests * updated taskfile.yml for go license check workflow task * fixed parser project error for capacitor files * fixed lint workflow by adding ignore lint checking * fixed swift package issue --------- Co-authored-by: Hasnainhanifse <[email protected]>
* updated contact view unit tests * updated taskfile.yml for go license check workflow task * fixed parser project error for capacitor files * fixed lint workflow by adding ignore lint checking * fixed swift package issue * updated lint errors for remaining files --------- Co-authored-by: Hasnainhanifse <[email protected]>
* updated contact view unit tests * updated taskfile.yml for go license check workflow task * fixed parser project error for capacitor files * fixed lint workflow by adding ignore lint checking * fixed swift package issue * updated lint errors for remaining files * updated empty commit --------- Co-authored-by: Ayush Kumar Sethi <[email protected]>
* updated contact view unit tests * updated taskfile.yml for go license check workflow task * fixed parser project error for capacitor files * fixed lint workflow by adding ignore lint checking * fixed swift package issue * updated lint errors for remaining files * updated empty commit * ensure receiver checks satisfy CodeQL intent verification --------- Co-authored-by: Hasnainhanifse <[email protected]> Co-authored-by: Hasnain Hanif <[email protected]>
* updated contact view unit tests * updated taskfile.yml for go license check workflow task * fixed parser project error for capacitor files * fixed lint workflow by adding ignore lint checking * fixed swift package issue * updated lint errors for remaining files * updated empty commit * ensure receiver checks satisfy CodeQL intent verification * added codeql comment to suppress intent verification alert * add timeout for chromium version fetching --------- Co-authored-by: Hasnainhanifse <[email protected]> Co-authored-by: Hasnain Hanif <[email protected]>
| window.onload = start; | ||
| function start() { | ||
| getDeviceInfo().then(info => { | ||
| document.body.innerHTML = JSON.stringify(info, null, 4); |
There was a problem hiding this comment.
Why are you setting the document body? Also, setting the innerHTML is often unsafe. This is very strange.
There was a problem hiding this comment.
Duplicate with mispeled name.
Please review the code and let us know when you've done so.
| ], | ||
| "scripts": { | ||
| "clean": "rm -rf node_modules", | ||
| "cap:sync:ios": "node build/cap-sync-ios.mjs", |
There was a problem hiding this comment.
Why are you adding this? We should be able to just use cap sync directly.
| **Debug mode:** | ||
|
|
||
| ```sh | ||
| npm run action client/capacitor/build capacitor-ios |
There was a problem hiding this comment.
We should use the capacitor command line here.
There was a problem hiding this comment.
Remove Android code from this PR
| return Boolean(capacitor?.isNativePlatform?.()); | ||
| } | ||
|
|
||
| export function isCapacitorBrowserPlatform(): boolean { |
| import {SentryErrorReporter, Tags} from '../shared/error_reporter'; | ||
|
|
||
| const isCapacitorRuntime = isCapacitorPlatform(); | ||
| const isNativeCapacitorPlatform = isCapacitorNativePlatform(); |
There was a problem hiding this comment.
Why do you need this? You are already in the Capacitor main
There was a problem hiding this comment.
It's not clear to me we need this file, given we have a Capacitor-specific main. We can probably delete it.
| }, | ||
| "scripts": { | ||
| "clean": "rm -rf output node_modules www platforms plugins", | ||
| "clean": "rm -rf output node_modules www platforms plugins capacitor/android/app/src/main/res/mipmap-* capacitor/android/app/src/main/res/drawable/splash.png capacitor/android/app/src/main/res/drawable* capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/[email protected] capacitor/ios/App/App/Assets.xcassets/Splash.imageset/Default@*", |
There was a problem hiding this comment.
It's not clear to me whether we should delete all the images.
| .DS_Store | ||
| .sourcemaps | ||
| **/output/ | ||
| **/icons/ No newline at end of file |
There was a problem hiding this comment.
Not clear to me why we are ignoring the icons
| // limitations under the License. | ||
|
|
||
| import * as Sentry from '@sentry/browser'; | ||
| // eslint-disable-next-line n/no-extraneous-import |
There was a problem hiding this comment.
Why do we need this file? It seems exactly the same as the cordova one.
| } | ||
|
|
||
| quitApplication() { | ||
| pluginExec<void>('quitApplication').catch((err: unknown) => { |
There was a problem hiding this comment.
Call CapacitorPluginOutine.quitApplication() here instead of pluginExec
There was a problem hiding this comment.
We shouldn't need this file. Capacitor already gives us this functionality.
| import {CapacitorVpnApi} from './outline_server_repository/vpn.capacitor'; | ||
| import {FakeVpnApi} from './outline_server_repository/vpn.fake'; | ||
| import {OutlinePlatform} from './platform'; | ||
| import {pluginExec} from './plugin.capacitor'; |
There was a problem hiding this comment.
We shouldn't import pluginExec. Replace with calls to CapacitorPluginOutline instead
| super(appVersion, dsn, tags); | ||
| this.hasNativeErrorReporting = Boolean(dsn && dsn.trim().length > 0); | ||
| if (this.hasNativeErrorReporting) { | ||
| pluginExec<void>('initializeErrorReporting', dsn.trim()).catch( |
There was a problem hiding this comment.
Call CapacitorPluginOutline directly. Same in all the other places below.
There was a problem hiding this comment.
Let's revert the Android and iOS code in this web PR
No description provided.