14 | Capacitor Test Plugin Project
15 |
16 | This project can be used to test out the functionality of your plugin. Nothing in the
17 | example-app/ folder will be published to npm when using this template, so you can create away!
18 |
19 | Echo Text:
20 |
21 | Click Me!
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/assets/plugin-template/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
19 | # AndroidX package structure to make it clearer which packages are bundled with the
20 | # Android operating system, and which are packaged with your app's APK
21 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
22 | android.useAndroidX=true
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2020-present Ionic
2 | https://ionic.io
3 |
4 | MIT License
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining
7 | a copy of this software and associated documentation files (the
8 | "Software"), to deal in the Software without restriction, including
9 | without limitation the rights to use, copy, modify, merge, publish,
10 | distribute, sublicense, and/or sell copies of the Software, and to
11 | permit persons to whom the Software is furnished to do so, subject to
12 | the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be
15 | included in all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on:
4 | push:
5 | branches:
6 | - '**'
7 | pull_request:
8 | branches:
9 | - '**'
10 |
11 | jobs:
12 | lint:
13 | runs-on: ubuntu-latest
14 | timeout-minutes: 30
15 | steps:
16 | - uses: actions/setup-node@v4
17 | with:
18 | node-version: 22.x
19 | - uses: actions/checkout@v4
20 | - name: Restore Dependency Cache
21 | uses: actions/cache@v4
22 | with:
23 | path: ~/.npm
24 | key: ${{ runner.OS }}-dependency-cache-${{ hashFiles('**/package.json') }}
25 | - run: npm install
26 | - run: npm run lint
27 | build:
28 | runs-on: ubuntu-latest
29 | timeout-minutes: 30
30 | needs:
31 | - lint
32 | steps:
33 | - uses: actions/setup-node@v4
34 | with:
35 | node-version: 22.x
36 | - uses: actions/checkout@v4
37 | - name: Restore Dependency Cache
38 | uses: actions/cache@v4
39 | with:
40 | path: ~/.npm
41 | key: ${{ runner.OS }}-dependency-cache-${{ hashFiles('**/package.json') }}
42 | - run: npm install
43 | - run: npm run build
44 |
--------------------------------------------------------------------------------
/assets/plugin-template/.gitignore:
--------------------------------------------------------------------------------
1 | # node files
2 | dist
3 | node_modules
4 |
5 | # iOS files
6 | Pods
7 | Podfile.lock
8 | Package.resolved
9 | Build
10 | xcuserdata
11 | /.build
12 | /Packages
13 | xcuserdata/
14 | DerivedData/
15 | .swiftpm/configuration/registries.json
16 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
17 | .netrc
18 |
19 |
20 | # macOS files
21 | .DS_Store
22 |
23 |
24 |
25 | # Based on Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore
26 |
27 | # Built application files
28 | *.apk
29 | *.ap_
30 |
31 | # Files for the ART/Dalvik VM
32 | *.dex
33 |
34 | # Java class files
35 | *.class
36 |
37 | # Generated files
38 | bin
39 | gen
40 | out
41 |
42 | # Gradle files
43 | .gradle
44 | build
45 |
46 | # Local configuration file (sdk path, etc)
47 | local.properties
48 |
49 | # Proguard folder generated by Eclipse
50 | proguard
51 |
52 | # Log Files
53 | *.log
54 |
55 | # Android Studio Navigation editor temp files
56 | .navigation
57 |
58 | # Android Studio captures folder
59 | captures
60 |
61 | # IntelliJ
62 | *.iml
63 | .idea
64 |
65 | # Keystore files
66 | # Uncomment the following line if you do not want to check your keystore files in.
67 | #*.jks
68 |
69 | # External native build folder generated in Android Studio 2.2 and later
70 | .externalNativeBuild
71 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Create Capacitor Plugin
2 |
3 | Generate a new Capacitor plugin.
4 |
5 | ## Usage
6 |
7 | ```
8 | npm init @capacitor/plugin [