Skip to content

Commit 45384d4

Browse files
committed
feat: initial version
0 parents  commit 45384d4

111 files changed

Lines changed: 20338 additions & 0 deletions

File tree

Some content is hidden

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

.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-app

.gitignore

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

.prettierignore

Whitespace-only changes.

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.

CapacitorFoundationModels.podspec

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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 = 'CapacitorFoundationModels'
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/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14+
s.ios.deployment_target = '14.0'
15+
s.dependency 'Capacitor'
16+
s.swift_version = '5.1'
17+
end

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Quéau Jean Pierre
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Package.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// swift-tools-version: 5.9
2+
import PackageDescription
3+
4+
let package = Package(
5+
name: "CapacitorFoundationModels",
6+
platforms: [.iOS(.v14)],
7+
products: [
8+
.library(
9+
name: "CapacitorFoundationModels",
10+
targets: ["FoundationModelsPlugin"])
11+
],
12+
dependencies: [
13+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0")
14+
],
15+
targets: [
16+
.target(
17+
name: "FoundationModelsPlugin",
18+
dependencies: [
19+
.product(name: "Capacitor", package: "capacitor-swift-pm"),
20+
.product(name: "Cordova", package: "capacitor-swift-pm")
21+
],
22+
path: "ios/Sources/FoundationModelsPlugin")
23+
]
24+
)

0 commit comments

Comments
 (0)