Skip to content

Commit cead020

Browse files
authored
Merge pull request #76 from ionic-team/feat/spm-support
feat(ios): add support for spm
2 parents aae47e0 + d3bd8f2 commit cead020

Some content is hidden

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

48 files changed

+19104
-4
lines changed

Package.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,23 @@ import PackageDescription
33

44
let package = Package(
55
name: "CapacitorInappbrowser",
6-
platforms: [.iOS(.v13)],
6+
platforms: [.iOS(.v14)],
77
products: [
88
.library(
99
name: "CapacitorInappbrowser",
1010
targets: ["InAppBrowserPlugin"])
1111
],
1212
dependencies: [
13-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", branch: "main")
13+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", branch: "main"),
14+
.package(url: "https://github.com/OutSystems/OSInAppBrowserLib-iOS.git", from: "2.2.0")
1415
],
1516
targets: [
1617
.target(
1718
name: "InAppBrowserPlugin",
1819
dependencies: [
1920
.product(name: "Capacitor", package: "capacitor-swift-pm"),
20-
.product(name: "Cordova", package: "capacitor-swift-pm")
21+
.product(name: "Cordova", package: "capacitor-swift-pm"),
22+
.product(name: "OSInAppBrowserLib", package: "OSInAppBrowserLib-iOS")
2123
],
2224
path: "ios/Sources/InAppBrowserPlugin"),
2325
.testTarget(

example-app-spm/.gitignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/dist
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
/.nx
21+
/.nx/cache
22+
/.vscode/*
23+
!/.vscode/extensions.json
24+
.idea
25+
26+
npm-debug.log*
27+
yarn-debug.log*
28+
yarn-error.log*
29+
30+
# Optional eslint cache
31+
.eslintcache

example-app-spm/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Created with Capacitor Create App
2+
3+
This app was created using [`@capacitor/create-app`](https://github.com/ionic-team/create-capacitor-app),
4+
and comes with a very minimal shell for building an app.
5+
6+
### Running this example
7+
8+
To run the provided example, you can use `npm start` command.
9+
10+
```bash
11+
npm start
12+
```

example-app-spm/capacitor.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import type { CapacitorConfig } from '@capacitor/cli';
2+
3+
const config: CapacitorConfig = {
4+
appId: 'io.ionic.starter',
5+
appName: 'example-app',
6+
webDir: 'dist'
7+
};
8+
9+
export default config;

example-app-spm/cypress.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from "cypress";
2+
3+
export default defineConfig({
4+
e2e: {
5+
baseUrl: "http://localhost:5173",
6+
setupNodeEvents(on, config) {
7+
// implement node event listeners here
8+
},
9+
},
10+
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
describe('My First Test', () => {
2+
it('Visits the app root url', () => {
3+
cy.visit('/')
4+
cy.contains('#container', 'Ready to create an app?')
5+
})
6+
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "[email protected]",
4+
"body": "Fixtures are a great way to mock data for responses to routes"
5+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/// <reference types="cypress" />
2+
// ***********************************************
3+
// This example commands.ts shows you how to
4+
// create various custom commands and overwrite
5+
// existing commands.
6+
//
7+
// For more comprehensive examples of custom
8+
// commands please read more here:
9+
// https://on.cypress.io/custom-commands
10+
// ***********************************************
11+
//
12+
//
13+
// -- This is a parent command --
14+
// Cypress.Commands.add('login', (email, password) => { ... })
15+
//
16+
//
17+
// -- This is a child command --
18+
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
19+
//
20+
//
21+
// -- This is a dual command --
22+
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
23+
//
24+
//
25+
// -- This will overwrite an existing command --
26+
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
27+
//
28+
// declare global {
29+
// namespace Cypress {
30+
// interface Chainable {
31+
// login(email: string, password: string): Chainable<void>
32+
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
33+
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
34+
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
35+
// }
36+
// }
37+
// }
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// ***********************************************************
2+
// This example support/e2e.ts is processed and
3+
// loaded automatically before your test files.
4+
//
5+
// This is a great place to put global configuration and
6+
// behavior that modifies Cypress.
7+
//
8+
// You can change the location of this file or turn off
9+
// automatically serving support files with the
10+
// 'supportFile' configuration option.
11+
//
12+
// You can read more here:
13+
// https://on.cypress.io/configuration
14+
// ***********************************************************
15+
16+
// Import commands.js using ES2015 syntax:
17+
import './commands'
18+
19+
// Alternatively you can use CommonJS syntax:
20+
// require('./commands')

example-app-spm/index.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Ionic App</title>
6+
7+
<base href="/" />
8+
9+
<meta name="color-scheme" content="light dark" />
10+
<meta
11+
name="viewport"
12+
content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
13+
/>
14+
<meta name="format-detection" content="telephone=no" />
15+
<meta name="msapplication-tap-highlight" content="no" />
16+
17+
<link rel="manifest" href="/manifest.json" />
18+
19+
<link rel="shortcut icon" type="image/png" href="/favicon.png" />
20+
21+
<!-- add to homescreen for ios -->
22+
<meta name="apple-mobile-web-app-capable" content="yes" />
23+
<meta name="apple-mobile-web-app-title" content="Ionic App" />
24+
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
25+
</head>
26+
<body>
27+
<div id="root"></div>
28+
<script type="module" src="/src/main.tsx"></script>
29+
</body>
30+
</html>

0 commit comments

Comments
 (0)