mirror of
https://github.com/thegecko/web-bluetooth-dfu.git
synced 2025-12-13 20:48:15 +08:00
Update deps and CircleCI v2
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,4 +5,3 @@ dist
|
||||
lib
|
||||
types
|
||||
npm-debug.log
|
||||
package-lock.json
|
||||
|
||||
69
circle.yml
69
circle.yml
@@ -1,30 +1,45 @@
|
||||
machine:
|
||||
node:
|
||||
version: 4.8.0
|
||||
environment:
|
||||
LIVE_BRANCH: gh-pages
|
||||
version: 2
|
||||
|
||||
compile:
|
||||
override:
|
||||
- npm run gulp
|
||||
jobs:
|
||||
build:
|
||||
docker:
|
||||
- image: circleci/node:4.8.0
|
||||
steps:
|
||||
- checkout
|
||||
- run: npm install
|
||||
- run: npm run build
|
||||
- persist_to_workspace:
|
||||
root: ../
|
||||
paths:
|
||||
- project
|
||||
|
||||
test:
|
||||
override:
|
||||
- exit 0
|
||||
deploy:
|
||||
docker:
|
||||
- image: circleci/node:4.8.0
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: ../
|
||||
- run: mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
|
||||
- run: git config --global user.name thegecko
|
||||
- run: git config --global user.email github@thegecko.org
|
||||
- run: git add --force dist types docs
|
||||
- run: git stash save
|
||||
- run: git checkout gh-pages
|
||||
- run: git merge master --no-commit
|
||||
- run: git checkout stash -- .
|
||||
- run: git commit --allow-empty --message "Automatic Deployment [skip ci]"
|
||||
- run: git push
|
||||
- run: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc'
|
||||
- run: npm publish || true
|
||||
|
||||
deployment:
|
||||
staging:
|
||||
branch: master
|
||||
commands:
|
||||
- echo Syncing to $LIVE_BRANCH on GitHub...
|
||||
- git config --global user.name thegecko
|
||||
- git config --global user.email github@thegecko.org
|
||||
- git add --force dist lib types
|
||||
- git stash save
|
||||
- git checkout $LIVE_BRANCH
|
||||
- git merge master --no-commit
|
||||
- git checkout stash -- .
|
||||
- git commit --allow-empty --message "Automatic Deployment [skip ci]"
|
||||
- git push
|
||||
- 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc'
|
||||
- npm publish || true
|
||||
workflows:
|
||||
version: 2
|
||||
commit:
|
||||
jobs:
|
||||
- build
|
||||
- deploy:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
branches:
|
||||
only: master
|
||||
|
||||
@@ -31,98 +31,24 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<link href="https://fonts.googleapis.com/css?family=Raleway:400,600" rel="stylesheet">
|
||||
<style>
|
||||
html {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
body {
|
||||
font-family: 'Raleway', sans-serif;
|
||||
color: #d7ecfb;
|
||||
background-color: #072b44;
|
||||
text-align: center;
|
||||
}
|
||||
h1 {
|
||||
font-weight: 400;
|
||||
}
|
||||
strong {
|
||||
font-weight: 600;
|
||||
}
|
||||
#drop {
|
||||
position: relative;
|
||||
margin: 20px auto;
|
||||
max-width: 500px;
|
||||
background-color: rgba(255, 255, 255, 0.10);
|
||||
padding: 100px 20px 80px 20px;
|
||||
outline: 2px dashed #072b44;
|
||||
outline-offset: -10px;
|
||||
}
|
||||
#drop.hover {
|
||||
outline-offset: -10px;
|
||||
background-color: rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
#icon {
|
||||
width: 100%;
|
||||
fill: #d7ecfb;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
#github {
|
||||
fill: #d7ecfb;
|
||||
}
|
||||
#github:hover {
|
||||
fill: #8bb5ba;
|
||||
}
|
||||
#file {
|
||||
width: 0.1px;
|
||||
height: 0.1px;
|
||||
opacity: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
#label {
|
||||
cursor: pointer;
|
||||
}
|
||||
#label:hover strong {
|
||||
color: #8bb5ba;
|
||||
}
|
||||
#select {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
#button {
|
||||
font-size: 12px;
|
||||
color: inherit;
|
||||
margin: 20px auto;
|
||||
border: 0px;
|
||||
background-color: #1b679c;
|
||||
height: 30px;
|
||||
padding: 0 30px;
|
||||
border-radius: 4px;
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
}
|
||||
#button:hover {
|
||||
background: #2674ab;
|
||||
}
|
||||
#status {
|
||||
margin: 20px auto;
|
||||
border: 1px solid #d7ecfb;
|
||||
width: 70%;
|
||||
height: 24px;
|
||||
visibility: hidden;
|
||||
}
|
||||
#bar {
|
||||
background: #2674ab;
|
||||
width: 0%;
|
||||
height: 100%;
|
||||
}
|
||||
#transfer {
|
||||
width: 100%;
|
||||
line-height: 24px;
|
||||
margin-top: -24px;
|
||||
}
|
||||
html { margin: 0; padding: 0; border: 0; }
|
||||
body { font-family: 'Raleway', sans-serif; color: #d7ecfb; background-color: #072b44; text-align: center; }
|
||||
h1 { font-weight: 400; }
|
||||
strong { font-weight: 600; }
|
||||
#drop { position: relative; margin: 20px auto; max-width: 500px; background-color: rgba(255, 255, 255, 0.10); padding: 100px 20px 80px 20px; outline: 2px dashed #072b44; outline-offset: -10px; }
|
||||
#drop.hover { outline-offset: -10px; background-color: rgba(255, 255, 255, 0.15); }
|
||||
#icon { width: 100%; fill: #d7ecfb; margin-bottom: 30px; }
|
||||
#github { fill: #d7ecfb; }
|
||||
#github:hover { fill: #8bb5ba; }
|
||||
#file { width: 0.1px; height: 0.1px; opacity: 0; z-index: -1; }
|
||||
#label { cursor: pointer; }
|
||||
#label:hover strong { color: #8bb5ba; }
|
||||
#select { position: absolute; left: 0; right: 0; visibility: hidden; }
|
||||
#button { font-size: 12px; color: inherit; margin: 20px auto; border: 0px; background-color: #1b679c; height: 30px; padding: 0 30px; border-radius: 4px; text-transform: uppercase; cursor: pointer; outline: none; }
|
||||
#button:hover { background: #2674ab; }
|
||||
#status { margin: 20px auto; border: 1px solid #d7ecfb; width: 70%; height: 24px; visibility: hidden; }
|
||||
#bar { background: #2674ab; width: 0%; height: 100%; }
|
||||
#transfer { width: 100%; line-height: 24px; margin-top: -24px; }
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
||||
5353
package-lock.json
generated
Normal file
5353
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "web-bluetooth-dfu",
|
||||
"version": "1.0.2",
|
||||
"version": "1.1.0",
|
||||
"description": "Device firmware update with Web Bluetooth",
|
||||
"homepage": "https://thegecko.github.io/web-bluetooth-dfu/",
|
||||
"author": "Rob Moran <github@thegecko.org>",
|
||||
@@ -30,9 +30,11 @@
|
||||
"engines": {
|
||||
"node": ">=4.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"dependencies": {
|
||||
"@types/node": "^8.0.54",
|
||||
"@types/web-bluetooth": "0.0.4",
|
||||
"@types/web-bluetooth": "0.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^15.0.0",
|
||||
"crc-32": "^1.0.2",
|
||||
"del": "^3.0.0",
|
||||
@@ -44,11 +46,11 @@
|
||||
"jszip": "^3.1.3",
|
||||
"merge2": "^1.2.0",
|
||||
"progress": "^2.0.0",
|
||||
"tslint": "^5.8.0",
|
||||
"tslint": "5.8.0",
|
||||
"tslint-eslint-rules": "^4.1.1",
|
||||
"typescript": "^2.6.2",
|
||||
"vinyl-buffer": "^1.0.1",
|
||||
"vinyl-source-stream": "^2.0.0",
|
||||
"webbluetooth": "^1.0.4"
|
||||
"webbluetooth": "^1.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,6 +283,7 @@ export class SecureDfu extends EventDispatcher {
|
||||
|
||||
const value = new Uint8Array(size);
|
||||
value.set(operation);
|
||||
|
||||
if (buffer) {
|
||||
const data = new Uint8Array(buffer);
|
||||
value.set(data, operation.length);
|
||||
@@ -410,15 +411,12 @@ export class SecureDfu extends EventDispatcher {
|
||||
* @param uuids Optional alternative uuids for service, control, packet or button
|
||||
* @returns Promise containing the device
|
||||
*/
|
||||
public requestDevice(
|
||||
buttonLess: boolean,
|
||||
filters: Array<BluetoothLEScanFilterInit>,
|
||||
uuids: UuidOptions = this.DEFAULT_UUIDS
|
||||
): Promise<BluetoothDevice> {
|
||||
public requestDevice(buttonLess: boolean, filters: Array<BluetoothLEScanFilterInit>, uuids: UuidOptions = this.DEFAULT_UUIDS): Promise<BluetoothDevice> {
|
||||
uuids = {
|
||||
...this.DEFAULT_UUIDS,
|
||||
...uuids
|
||||
};
|
||||
|
||||
if (!buttonLess && !filters) {
|
||||
filters = [ { services: [ uuids.service ] } ];
|
||||
}
|
||||
@@ -450,6 +448,7 @@ export class SecureDfu extends EventDispatcher {
|
||||
...this.DEFAULT_UUIDS,
|
||||
...uuids
|
||||
};
|
||||
|
||||
return this.gattConnect(device, uuids.service)
|
||||
.then(characteristics => {
|
||||
this.log(`found ${characteristics.length} characteristic(s)`);
|
||||
|
||||
Reference in New Issue
Block a user