Add capacitorjs

This commit is contained in:
Jonathan Staab 2023-04-24 20:19:22 -05:00
parent 8cb7fddfea
commit 139209c83e
8 changed files with 1135 additions and 7 deletions

View File

@ -1 +1,3 @@
node_modules
android
dist

1
.gitignore vendored
View File

@ -12,6 +12,7 @@ lerna-debug.log*
node_modules
dist
dist-ssr
android
# Editor directories and files
.vscode/*

View File

@ -1,5 +1,6 @@
# Current
- [ ] Fix multiplexing
- [ ] Extract libraries
- Cursor
- parseContent

10
capacitor.config.ts Normal file
View File

@ -0,0 +1,10 @@
import {CapacitorConfig} from "@capacitor/cli"
const config: CapacitorConfig = {
appId: "social.coracle.app",
appName: "Coracle",
webDir: "dist",
bundledWebRuntime: false,
}
export default config

1103
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -15,6 +15,7 @@
"watch": "find src -type f | entr -r"
},
"devDependencies": {
"@capacitor/cli": "^4.7.3",
"@sveltejs/vite-plugin-svelte": "^1.1.0",
"@typescript-eslint/eslint-plugin": "^5.50.0",
"@typescript-eslint/parser": "^5.50.0",
@ -32,6 +33,9 @@
},
"dependencies": {
"@bugsnag/js": "^7.18.0",
"@capacitor/android": "^4.7.3",
"@capacitor/core": "^4.7.3",
"@capacitor/ios": "^4.7.3",
"@fortawesome/fontawesome-free": "^6.2.1",
"@noble/secp256k1": "^1.7.0",
"@scure/base": "^1.1.1",

View File

@ -1,4 +1,5 @@
<script lang="ts">
import {Capacitor} from "@capacitor/core"
import {fly} from "svelte/transition"
import {navigate} from "svelte-routing"
import {modal} from "src/partials/state"
@ -43,8 +44,11 @@
<i>To the Nostr Network</i>
</div>
<p class="text-center">
Click below to log in or create an account. If you have a <Anchor href={nip07} external
>compatible browser extension</Anchor> installed, we will use that.
Click below to log in or create an account.
{#if !Capacitor.isNativePlatform()}
If you have a <Anchor href={nip07} external>compatible browser extension</Anchor> installed,
we will use that.
{/if}
</p>
<div class="flex flex-col items-center gap-4">
<div class="flex gap-4">

View File

@ -1,4 +1,5 @@
<script lang="ts">
import {Capacitor} from "@capacitor/core"
import {toHex} from "src/util/nostr"
import {toast} from "src/partials/state"
import Input from "src/partials/Input.svelte"
@ -37,9 +38,11 @@
</div>
<Anchor type="button" on:click={logIn}>Log In</Anchor>
</div>
<p class="rounded border-2 border-solid border-warning bg-gray-8 py-3 px-6">
Note that sharing your private key directly is not recommended, instead you should use a <Anchor
href={nip07}
external>compatible browser extension</Anchor> to securely store your key.
</p>
{#if !Capacitor.isNativePlatform()}
<p class="rounded border-2 border-solid border-warning bg-gray-8 py-3 px-6">
Note that sharing your private key directly is not recommended, instead you should use a <Anchor
href={nip07}
external>compatible browser extension</Anchor> to securely store your key.
</p>
{/if}
</Content>