Skip to content

Commit 37cc362

Browse files
committed
WIP V5 Typescript
1 parent 2081261 commit 37cc362

Some content is hidden

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

97 files changed

+8235
-163
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
node_modules/
22
.DS_Store
3+
dist/
4+
tmp/

.pre-commit-config.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- repo: git://github.com/awebdeveloper/pre-commit-tslint/
2+
sha: 'v0.0.2' # Use the sha or tag you want to point at
3+
hooks:
4+
- id: tslint
5+
exclude: 'tests'
6+
additional_dependencies: ['[email protected]', '[email protected]', '[email protected]']
7+
args: ['--config', 'tslint.json', '--project', 'tsconfig.json', '--fix']

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
======
33

4+
# 5.0.0.alpha_1
5+
6+
* Rewrote the plugin in Typescript.
7+
* Added support for application file manifests.
8+
* Added full support for partial update downloads, greatly decreasing network bandwidth.
9+
* **Deprecated old plugin API** in favor of modern promise-based API using async/await. Existing methods are still available, but may be removed in the future.
10+
411
## 4.1.7
512

613
* Fix a redirect bug in iOS that would give the `background` update method inconsistent behavior

README.md

+28
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,31 @@ The plugin will be available on `window` as `IonicCordova`
3333
* `IonicCordova.deploy.getVersions(success, failure)` - List downloaded versions on this device.
3434
* `IonicCordova.deploy.deleteVersion(uuid, success, failure)` - Delete a downloaded version by UUID from this device.
3535

36+
## Local Development
37+
38+
```bash
39+
npm install
40+
npm run create-dev
41+
```
42+
43+
This will create a blank Ionic app in a local `tmp` directory with the plugin and dependencies installed, and the iOS platform added. Native plugin code is installed with `--link` and any changes to the typescript in `www` will be copied over into the app's `platforms/ios` and `platforms/android` directories.
44+
45+
### Some other helpful dev commands
46+
47+
```bash
48+
npm run apply-dev
49+
```
50+
51+
Updates the linked plugin in the `tmp` test app with your JavaScript changes
52+
53+
```bash
54+
npm run watch
55+
```
56+
57+
Watches for Typescript changes
58+
59+
```bash
60+
npm run watch-dev
61+
```
62+
63+
Watches for Typescript changes, then runs the `apply-dev` script to propogate them to the testing app.

apply-changes.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# local manual "watch" script
2+
set -o errexit
3+
4+
# Sync to iOS
5+
cp tmp/plugins/cordova-plugin-ionic/dist/* tmp/platforms/ios/www/plugins/cordova-plugin-ionic/dist/
6+
sed -i '' 's/"use strict"/cordova.define("cordova-plugin-ionic.common", function(require, exports, module) {"use strict"/' tmp/platforms/ios/www/plugins/cordova-plugin-ionic/dist/common.js
7+
sed -i '' 's/"use strict"/cordova.define("cordova-plugin-ionic.guards", function(require, exports, module) {"use strict"/' tmp/platforms/ios/www/plugins/cordova-plugin-ionic/dist/guards.js
8+
echo '});' >> tmp/platforms/ios/www/plugins/cordova-plugin-ionic/dist/common.js
9+
echo '});' >> tmp/platforms/ios/www/plugins/cordova-plugin-ionic/dist/guards.js
10+
11+
# Sync to Android
12+
cp tmp/plugins/cordova-plugin-ionic/dist/* tmp/platforms/android/platform_www/plugins/cordova-plugin-ionic/dist/
13+
sed -i '' 's/"use strict"/cordova.define("cordova-plugin-ionic.common", function(require, exports, module) {"use strict"/' tmp/platforms/android/platform_www/plugins/cordova-plugin-ionic/dist/common.js
14+
sed -i '' 's/"use strict"/cordova.define("cordova-plugin-ionic.guards", function(require, exports, module) {"use strict"/' tmp/platforms/android/platform_www/plugins/cordova-plugin-ionic/dist/guards.js
15+
echo '});' >> tmp/platforms/android/platform_www/plugins/cordova-plugin-ionic/dist/common.js
16+
echo '});' >> tmp/platforms/android/platform_www/plugins/cordova-plugin-ionic/dist/guards.js

create-local-app.sh

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
set -o errexit
3+
set -o nounset
4+
5+
# Stop CLI prompts and init config vars
6+
APP_ID=${IONIC_APP_ID:-6cda5a01}
7+
CHANNEL=${IONIC_CHANNEL:-Production}
8+
CI=1
9+
UPDATE_METHOD=${IONIC_UPDATE_METHOD:-none}
10+
11+
# Build the plugin ts
12+
npm run build
13+
14+
# Create a blank ionic app cd
15+
ionic start tmp blank --type=ionic-angular --pro-id=${APP_ID} --cordova
16+
cd tmp
17+
npm run build
18+
19+
# Add cordova platform and install the plugin
20+
cordova platform add ios
21+
cordova platform add android
22+
cordova plugin add .. --save --variable APP_ID="${APP_ID}" --variable CHANNEL_NAME="${CHANNEL}" --variable UPDATE_METHOD="${UPDATE_METHOD}" --variable WARN_DEBUG="false" --link
23+
cordova prepare ios
24+
cordova prepare android

0 commit comments

Comments
 (0)