Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • polycentric/leveldb-capacitor-plugin
1 result
Show changes
Commits on Source (4)
stages:
- build
- deploy
variables:
# Define the NPM registry and NPM token (you should configure these as environment variables in GitLab CI/CD settings)
NPM_REGISTRY: "https://registry.npmjs.org/"
NPM_TOKEN: $NPM_TOKEN
cache:
paths:
- node_modules/
before_script:
- npm install
build:
stage: build
script:
- npm run build
artifacts:
paths:
- dist/
expire_in: 1 day
publish:
stage: deploy
script:
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
- npm publish --registry $NPM_REGISTRY
only:
- master
when: manual
environment:
name: production
// @ts-check
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
);
\ No newline at end of file
.idea/
node_modules/
.vscode/
*.map
.DS_Store
.sourcemaps
dist/
## Created with Capacitor Create App
This app was created using [`@capacitor/create-app`](https://github.com/ionic-team/create-capacitor-app),
and comes with a very minimal shell for building an app.
### Running this example
To run the provided example, you can use `npm start` command.
```bash
npm start
```
{
"appId": "com.example.plugin",
"appName": "example",
"bundledWebRuntime": false,
"webDir": "dist",
"plugins": {
"SplashScreen": {
"launchShowDuration": 0
}
}
}
\ No newline at end of file
{
"name": "capacitor-app",
"version": "1.0.0",
"description": "An Amazing Capacitor App",
"main": "index.js",
"keywords": [
"capacitor",
"mobile"
],
"scripts": {
"start": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@capacitor/core": "latest",
"@capacitor/camera": "latest",
"@capacitor/splash-screen": "latest",
"@polycentric/leveldb-capacitor-plugin": "file:..",
"@capacitor/ios": "^6.0.0",
"@capacitor/android": "^6.0.0"
},
"devDependencies": {
"@capacitor/cli": "latest",
"vite": "^2.9.13"
},
"author": "",
"license": "ISC"
}
\ No newline at end of file
example/src/assets/icon/favicon.ico

99.4 KiB

example/src/assets/imgs/logo.png

11.8 KiB

html,
body {
padding: 0;
margin: 0;
}
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8" />
<title>Awesome Capacitor App</title>
<meta
name="viewport"
content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<script
type="module"
src="https://unpkg.com/@ionic/pwa-elements@latest/dist/ionicpwaelements/ionicpwaelements.esm.js"
></script>
<script
nomodule
src="https://unpkg.com/@ionic/pwa-elements@latest/dist/ionicpwaelements/ionicpwaelements.js"
></script>
<link rel="icon" type="image/x-icon" href="./assets/icon/favicon.ico" />
<link rel="manifest" href="./manifest.json" />
<link rel="stylesheet" href="./css/style.css" />
<meta name="theme-color" content="#31d53d" />
</head>
<body>
<capacitor-welcome></capacitor-welcome>
<script src="./js/capacitor-welcome.js" type="module"></script>
</body>
</html>
import { SplashScreen } from '@capacitor/splash-screen';
import { Camera } from '@capacitor/camera';
window.customElements.define(
'capacitor-welcome',
class extends HTMLElement {
constructor() {
super();
SplashScreen.hide();
const root = this.attachShadow({ mode: 'open' });
root.innerHTML = `
<style>
:host {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
display: block;
width: 100%;
height: 100%;
}
h1, h2, h3, h4, h5 {
text-transform: uppercase;
}
.button {
display: inline-block;
padding: 10px;
background-color: #73B5F6;
color: #fff;
font-size: 0.9em;
border: 0;
border-radius: 3px;
text-decoration: none;
cursor: pointer;
}
main {
padding: 15px;
}
main hr { height: 1px; background-color: #eee; border: 0; }
main h1 {
font-size: 1.4em;
text-transform: uppercase;
letter-spacing: 1px;
}
main h2 {
font-size: 1.1em;
}
main h3 {
font-size: 0.9em;
}
main p {
color: #333;
}
main pre {
white-space: pre-line;
}
</style>
<div>
<capacitor-welcome-titlebar>
<h1>Capacitor</h1>
</capacitor-welcome-titlebar>
<main>
<p>
Capacitor makes it easy to build powerful apps for the app stores, mobile web (Progressive Web Apps), and desktop, all
with a single code base.
</p>
<h2>Getting Started</h2>
<p>
You'll probably need a UI framework to build a full-featured app. Might we recommend
<a target="_blank" href="http://ionicframework.com/">Ionic</a>?
</p>
<p>
Visit <a href="https://capacitorjs.com">capacitorjs.com</a> for information
on using native features, building plugins, and more.
</p>
<a href="https://capacitorjs.com" target="_blank" class="button">Read more</a>
<h2>Tiny Demo</h2>
<p>
This demo shows how to call Capacitor plugins. Say cheese!
</p>
<p>
<button class="button" id="take-photo">Take Photo</button>
</p>
<p>
<img id="image" style="max-width: 100%">
</p>
</main>
</div>
`;
}
connectedCallback() {
const self = this;
self.shadowRoot.querySelector('#take-photo').addEventListener('click', async function (e) {
try {
const photo = await Camera.getPhoto({
resultType: 'uri',
});
const image = self.shadowRoot.querySelector('#image');
if (!image) {
return;
}
image.src = photo.webPath;
} catch (e) {
console.warn('User cancelled', e);
}
});
}
}
);
window.customElements.define(
'capacitor-welcome-titlebar',
class extends HTMLElement {
constructor() {
super();
const root = this.attachShadow({ mode: 'open' });
root.innerHTML = `
<style>
:host {
position: relative;
display: block;
padding: 15px 15px 15px 15px;
text-align: center;
background-color: #73B5F6;
}
::slotted(h1) {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 0.9em;
font-weight: 600;
color: #fff;
}
</style>
<slot></slot>
`;
}
}
);
{
"name": "App",
"short_name": "App",
"start_url": "index.html",
"display": "standalone",
"icons": [{
"src": "assets/imgs/logo.png",
"sizes": "512x512",
"type": "image/png"
}],
"background_color": "#31d53d",
"theme_color": "#31d53d"
}
import { defineConfig } from 'vite';
export default defineConfig({
root: './src',
build: {
outDir: '../dist',
minify: false,
emptyOutDir: true,
},
});
This diff is collapsed.
{
"name": "@polycentric/leveldb-capacitor-plugin",
"version": "0.0.1",
"type": "module",
"description": "LevelDB plugin for Capacitor supporting iOS and Android",
"main": "dist/plugin.cjs.js",
"module": "dist/esm/index.js",
......@@ -13,14 +14,11 @@
"ios/Plugin/",
"PolycentricLeveldbCapacitorPlugin.podspec"
],
"author": "",
"author": "aidan",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://FUTO.org/TODO.git"
},
"bugs": {
"url": "https://FUTO.org/TODO/issues"
"url": "git+https://gitlab.futo.org/polycentric/leveldb-capacitor-plugin"
},
"keywords": [
"capacitor",
......@@ -34,11 +32,11 @@
"verify:web": "npm run build",
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
"eslint": "eslint . --ext ts",
"eslint": "eslint src",
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
"swiftlint": "node-swiftlint",
"docgen": "docgen --api MobileLevelPlugin --output-readme README.md --output-json dist/docs.json",
"build": "npm run clean && tsc --noEmit && ./build.sh",
"build": "npm run clean && tsc --emitDeclarationOnly && ./build.sh",
"clean": "rimraf ./dist",
"watch": "tsc --watch",
"prepublishOnly": "npm run build"
......@@ -48,16 +46,19 @@
"@capacitor/core": "^6.0.0",
"@capacitor/docgen": "^0.2.2",
"@capacitor/ios": "^6.0.0",
"@eslint/js": "^9.4.0",
"@ionic/eslint-config": "^0.3.0",
"@ionic/prettier-config": "^1.0.1",
"@ionic/swiftlint-config": "^1.1.2",
"@types/eslint__js": "^8.42.3",
"esbuild": "^0.21.4",
"eslint": "^9.1.1",
"eslint": "^8.57.0",
"prettier": "~2.3.0",
"prettier-plugin-java": "~1.0.2",
"rimraf": "^3.0.2",
"swiftlint": "^1.0.1",
"typescript": "^5.4.5"
"typescript": "^5.4.5",
"typescript-eslint": "^7.12.0"
},
"peerDependencies": {
"@capacitor/core": "^6.0.0"
......