Skip to content

Commit

Permalink
Merge pull request #5 from robsonos/dev
Browse files Browse the repository at this point in the history
Merge dev into main 🔀
  • Loading branch information
robsonos committed Dec 19, 2023
2 parents 0cf2b47 + 5aaedbe commit 45b8938
Show file tree
Hide file tree
Showing 14 changed files with 2,278 additions and 1,906 deletions.
30 changes: 29 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,34 @@ jobs:
- name: Lint
run: yarn lint

build-example:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'

- name: Install plugin dependencies
run: yarn install --frozen-lockfile

- name: Build plugin
run: yarn build

- name: Install example dependencies
run: yarn install --frozen-lockfile
working-directory: example

- name: Build example
run: yarn build
working-directory: example

verify-android:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -76,7 +104,7 @@ jobs:

create-pr:
runs-on: ubuntu-latest
needs: [lint, verify-ios, verify-android]
needs: [lint, verify-ios, verify-android, build-example]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}
42 changes: 38 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash

```

#### Sample .zshrc
#### Local setup

Your `~/.zshrc` should look more or less like this the following:
Your `~/.zshrc` should look more or less like the following:

```shell
# rbenv
Expand All @@ -58,8 +58,29 @@ eval "$(jenv init -)"

# nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

# nvm autoload .nvmrc
autoload -U add-zsh-hook
load-nvmrc() {
local nvmrc_path
nvmrc_path="$(nvm_find_nvmrc)"

if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version
nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")

if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$(nvm version)" ]; then
nvm use
fi
elif [ -n "$(PWD=$OLDPWD nvm_find_nvmrc)" ] && [ "$(nvm version)" != "$(nvm version default)" ]; then
echo "Reverting to nvm default version"
nvm use default
fi
}

# android
export ANDROID_HOME=$HOME/Library/Android/sdk
Expand All @@ -69,6 +90,19 @@ export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/emulator
```

You will also need a `~/.huskyrc` like this the following for [husky](https://typicode.github.io/husky/):

```shell
# nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

if [ -f ".nvmrc" ]; then
nvm use --silent
fi

```

#### Dependency version

ruby:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ Contains data related to the DFU update process, such as progress and speed.
| **`avgSpeed`** | <code>number</code> | The average speed in bytes per millisecond. | 1.0.0 |
| **`currentPart`** | <code>number</code> | The number of parts being sent. In case the ZIP file contains a Soft Device and/or a Bootloader together with the application the SD+BL are sent as part 1, then the service starts again and send the application as part 2. | 1.0.0 |
| **`partsTotal`** | <code>number</code> | The total number of parts. | 1.0.0 |
| **`duration`** | <code>number</code> | The total time elapsed since the start of the DFU process in milliseconds | 1.0.1 |
| **`remainingTime`** | <code>number</code> | The estimated remaining time to the end of the DFU process in milliseconds | 1.0.1 |
| **`duration`** | <code>number</code> | The total time elapsed since the start of the DFU process in milliseconds | 1.1.0 |
| **`remainingTime`** | <code>number</code> | The estimated remaining time to the end of the DFU process in milliseconds | 1.1.0 |


### Type Aliases
Expand Down
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
2 changes: 1 addition & 1 deletion example/android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ android {
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {
implementation project(':capacitor-community-bluetooth-le')
implementation project(':capacitor-community-nordic-dfu')
implementation project(':capacitor-filesystem')
implementation project(':capawesome-capacitor-file-picker')
implementation project(':capacitor-community-nordic-dfu')

}

Expand Down
6 changes: 3 additions & 3 deletions example/android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/
include ':capacitor-community-bluetooth-le'
project(':capacitor-community-bluetooth-le').projectDir = new File('../node_modules/@capacitor-community/bluetooth-le/android')

include ':capacitor-community-nordic-dfu'
project(':capacitor-community-nordic-dfu').projectDir = new File('../node_modules/capacitor-community-nordic-dfu/android')

include ':capacitor-filesystem'
project(':capacitor-filesystem').projectDir = new File('../node_modules/@capacitor/filesystem/android')

include ':capawesome-capacitor-file-picker'
project(':capawesome-capacitor-file-picker').projectDir = new File('../node_modules/@capawesome/capacitor-file-picker/android')

include ':capacitor-community-nordic-dfu'
project(':capacitor-community-nordic-dfu').projectDir = new File('../node_modules/capacitor-community-nordic-dfu/android')
6 changes: 3 additions & 3 deletions example/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "app:build:production"
"buildTarget": "app:build:production"
},
"development": {
"browserTarget": "app:build:development"
"buildTarget": "app:build:development"
},
"ci": {
"progress": false
Expand All @@ -93,7 +93,7 @@
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "app:build"
"buildTarget": "app:build"
}
},
"test": {
Expand Down
2 changes: 1 addition & 1 deletion example/ios/App/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ def capacitor_pods
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCommunityBluetoothLe', :path => '../../node_modules/@capacitor-community/bluetooth-le'
pod 'CapacitorCommunityNordicDfu', :path => '../../node_modules/capacitor-community-nordic-dfu'
pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem'
pod 'CapawesomeCapacitorFilePicker', :path => '../../node_modules/@capawesome/capacitor-file-picker'
pod 'CapacitorCommunityNordicDfu', :path => '../../node_modules/capacitor-community-nordic-dfu'
end

target 'App' do
Expand Down
68 changes: 33 additions & 35 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,56 +16,54 @@
"test": "ng test"
},
"dependencies": {
"@angular/animations": "^16.0.0",
"@angular/common": "^16.0.0",
"@angular/compiler": "^16.0.0",
"@angular/core": "^16.0.0",
"@angular/forms": "^16.0.0",
"@angular/platform-browser": "^16.0.0",
"@angular/platform-browser-dynamic": "^16.0.0",
"@angular/router": "^16.0.0",
"@capacitor-community/bluetooth-le": "^3.0.1",
"capacitor-community-nordic-dfu": "file:..",
"@capacitor/android": "^5.3.0",
"@capacitor/core": "^5.3.0",
"@capacitor/filesystem": "^5.1.4",
"@capacitor/ios": "^5.3.0",
"@angular/animations": "^17.0.2",
"@angular/common": "^17.0.2",
"@angular/compiler": "^17.0.2",
"@angular/core": "^17.0.2",
"@angular/forms": "^17.0.2",
"@angular/platform-browser": "^17.0.2",
"@angular/platform-browser-dynamic": "^17.0.2",
"@angular/router": "^17.0.2",
"@capacitor-community/bluetooth-le": "^3.1.1",
"@capacitor/android": "5.6.0",
"@capacitor/core": "5.6.0",
"@capacitor/filesystem": "^5.2.0",
"@capacitor/ios": "5.6.0",
"@capawesome/capacitor-file-picker": "^5.1.1",
"@ionic/angular": "^7.0.0",
"ionicons": "^7.0.0",
"@ionic/angular": "^7.5.0",
"capacitor-community-nordic-dfu": "file:..",
"ionicons": "^7.2.1",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.13.0"
"zone.js": "~0.14.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "^16.0.0",
"@angular-eslint/builder": "^16.0.0",
"@angular-eslint/eslint-plugin": "^16.0.0",
"@angular-eslint/eslint-plugin-template": "^16.0.0",
"@angular-eslint/schematics": "^16.0.0",
"@angular-eslint/template-parser": "^16.0.0",
"@angular/cli": "^16.0.0",
"@angular/compiler-cli": "^16.0.0",
"@angular/language-service": "^16.0.0",
"@capacitor/cli": "^5.5.1",
"@angular-devkit/build-angular": "^17.0.0",
"@angular-eslint/builder": "^17.0.0",
"@angular-eslint/eslint-plugin": "^17.0.0",
"@angular-eslint/eslint-plugin-template": "^17.0.0",
"@angular-eslint/schematics": "^17.0.0",
"@angular-eslint/template-parser": "^17.0.0",
"@angular/cli": "^17.0.0",
"@angular/compiler-cli": "^17.0.2",
"@angular/language-service": "^17.0.2",
"@capacitor/cli": "5.6.0",
"@ionic/angular-toolkit": "^9.0.0",
"@types/jasmine": "~4.3.0",
"@types/node": "^12.11.1",
"@typescript-eslint/eslint-plugin": "5.3.0",
"@typescript-eslint/parser": "5.3.0",
"@types/jasmine": "~5.1.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^7.26.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsdoc": "30.7.6",
"eslint-plugin-prefer-arrow": "1.2.2",
"jasmine-core": "~4.6.0",
"jasmine-core": "~5.1.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"karma-jasmine-html-reporter": "~2.1.0",
"ts-node": "^8.3.0",
"typescript": "~5.0.2"
"typescript": "~5.2.2"
}
}
Loading

0 comments on commit 45b8938

Please sign in to comment.