Skip to content

Commit

Permalink
feat(components/tool/app): Add browser plugin support to sui-app
Browse files Browse the repository at this point in the history
  • Loading branch information
oegea committed May 23, 2024
1 parent f930dc6 commit 61d2ab7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions components/tool/app/bin/commands/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ module.exports = async () => {

if (!hasDependency('@capacitor/app')) installDependency('@capacitor/app@5')

if (!hasDependency('@capacitor/browser')) installDependency('@capacitor/browser@6')

// If app has already been initialized
if (hasCapacitorConfig()) {
reportError(`\nThis project has already-been initialized. Please run sui-app remove before initializing again.\n`)
Expand Down
1 change: 1 addition & 0 deletions components/tool/app/bin/commands/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const uninstallPlugins = () => {
uninstallPackage('@capacitor/local-notifications')
uninstallPackage('@capgo/capacitor-updater')
uninstallPackage('@capacitor/app')
uninstallPackage('@capacitor/browser')
}

// Business logic
Expand Down
4 changes: 4 additions & 0 deletions components/tool/app/src/browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import {Browser} from '@capacitor/browser'

export const close = () => Browser.close()
export const open = config => Browser.open(config)
3 changes: 2 additions & 1 deletion components/tool/app/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as biometric from './biometric.js'
import * as browser from './browser.js'
import * as core from './core.js'
import * as liveUpdates from './liveUpdates.js'
import * as localNotifications from './localNotifications.js'
Expand All @@ -7,4 +8,4 @@ export default function SuiApp() {
throw new Error('sui-app is a set of tools and is not intended to be renderized as a React component')
}

export {biometric, core, liveUpdates, localNotifications}
export {biometric, browser, core, liveUpdates, localNotifications}

0 comments on commit 61d2ab7

Please sign in to comment.