Skip to content

Commit 06301e4

Browse files
committed
Initial commit
0 parents  commit 06301e4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+7107
-0
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build
2+
dist
3+
example

.github/workflows/release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Publish Package to npmjs
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish-npm:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
13+
with:
14+
node-version: 20
15+
registry-url: https://registry.npmjs.org/
16+
- run: npm install
17+
- run: npm publish
18+
env:
19+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.gitignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# node files
2+
dist
3+
node_modules
4+
5+
# iOS files
6+
Pods
7+
Podfile.lock
8+
Build
9+
xcuserdata
10+
11+
# macOS files
12+
.DS_Store
13+
14+
15+
16+
# Based on Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore
17+
18+
# Built application files
19+
*.apk
20+
*.ap_
21+
22+
# Files for the ART/Dalvik VM
23+
*.dex
24+
25+
# Java class files
26+
*.class
27+
28+
# Generated files
29+
bin
30+
gen
31+
out
32+
33+
# Gradle files
34+
.gradle
35+
build
36+
37+
# Local configuration file (sdk path, etc)
38+
local.properties
39+
40+
# Proguard folder generated by Eclipse
41+
proguard
42+
43+
# Log Files
44+
*.log
45+
46+
# Android Studio Navigation editor temp files
47+
.navigation
48+
49+
# Android Studio captures folder
50+
captures
51+
52+
# IntelliJ
53+
*.iml
54+
.idea
55+
56+
# Keystore files
57+
# Uncomment the following line if you do not want to check your keystore files in.
58+
#*.jks
59+
60+
# External native build folder generated in Android Studio 2.2 and later
61+
.externalNativeBuild

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build
2+
dist

CONTRIBUTING.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Contributing
2+
3+
This guide provides instructions for contributing to this Capacitor plugin.
4+
5+
## Developing
6+
7+
### Local Setup
8+
9+
1. Fork and clone the repo.
10+
1. Install the dependencies.
11+
12+
```shell
13+
npm install
14+
```
15+
16+
1. Install SwiftLint if you're on macOS.
17+
18+
```shell
19+
brew install swiftlint
20+
```
21+
22+
### Scripts
23+
24+
#### `npm run build`
25+
26+
Build the plugin web assets and generate plugin API documentation using [`@capacitor/docgen`](https://github.com/ionic-team/capacitor-docgen).
27+
28+
It will compile the TypeScript code from `src/` into ESM JavaScript in `dist/esm/`. These files are used in apps with bundlers when your plugin is imported.
29+
30+
Then, Rollup will bundle the code into a single file at `dist/plugin.js`. This file is used in apps without bundlers by including it as a script in `index.html`.
31+
32+
#### `npm run verify`
33+
34+
Build and validate the web and native projects.
35+
36+
This is useful to run in CI to verify that the plugin builds for all platforms.
37+
38+
#### `npm run lint` / `npm run fmt`
39+
40+
Check formatting and code quality, autoformat/autofix if possible.
41+
42+
This template is integrated with ESLint, Prettier, and SwiftLint. Using these tools is completely optional, but the [Capacitor Community](https://github.com/capacitor-community/) strives to have consistent code style and structure for easier cooperation.
43+
44+
## Publishing
45+
46+
There is a `prepublishOnly` hook in `package.json` which prepares the plugin before publishing, so all you need to do is run:
47+
48+
```shell
49+
npm publish
50+
```
51+
52+
> **Note**: The [`files`](https://docs.npmjs.com/cli/v7/configuring-npm/package-json#files) array in `package.json` specifies which files get published. If you rename files/directories or add files elsewhere, you may need to update it.

LuisbytesCapacitorMixpanel.podspec

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
require 'json'
2+
3+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4+
5+
Pod::Spec.new do |s|
6+
s.name = 'LuisbytesCapacitorMixpanel'
7+
s.version = package['version']
8+
s.summary = package['description']
9+
s.license = package['license']
10+
s.homepage = package['repository']['url']
11+
s.author = package['author']
12+
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13+
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
14+
s.ios.deployment_target = '13.0'
15+
s.dependency 'Capacitor'
16+
s.dependency 'Mixpanel-swift'
17+
s.swift_version = '5.1'
18+
end

0 commit comments

Comments
 (0)