Skip to content

Commit

Permalink
v2.0.0 API (#443)
Browse files Browse the repository at this point in the history
* Initial Commit

* Add Linting

* Minor tidy

* Fixup polling

* Fixup webusb

* Complete webusb tests

* Organise source files

* Move polling to just InEndpoint

* Tidy source

* Fixups

* Remove 'this' aliasing

* Add npmignore

* Script updates

* v2.0.0-alpha.1

* Add gitattributes to stop autocrlf

* New interface

* Fixup tests for new API

* Updates

* Fix binary loading path

* Formatting

* Update yarn.lock

* Port hotplug ref/unref to v2.0.0

* Port windows hotplug poll to v2.0.0

* Add findBySerialNumber test

* Update docs

* Tweak docs

* Add device timeout option

* Implement events
  • Loading branch information
thegecko committed Dec 11, 2021
1 parent f4486cb commit 9ef44b5
Show file tree
Hide file tree
Showing 30 changed files with 7,111 additions and 5,339 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
@@ -0,0 +1,4 @@
node_modules
build
dist
docs
87 changes: 87 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,87 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
// https://eslint.org/docs/rules/
"eslint:recommended",
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/no-empty-interface": [
"warn"
],
"@typescript-eslint/no-this-alias": [
"warn"
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_"
}
],
"block-spacing": [
"error",
"always"
],
"brace-style": [
"error",
"1tbs",
{
"allowSingleLine": true
}
],
"eol-last": [
"error"
],
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
"linebreak-style": [
"error",
"unix"
],
"no-console": [
"warn"
],
"no-constant-condition": [
"error",
{
"checkLoops": false
}
],
"no-trailing-spaces": [
"error"
],
"object-curly-spacing": [
"error",
"always"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
},
"env": {
"commonjs": true,
"es6": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module",
"project": [
"./tsconfig.json"
]
}
}
1 change: 1 addition & 0 deletions .gitattributes
@@ -0,0 +1 @@
* -text
35 changes: 35 additions & 0 deletions .github/workflows/docs.yml
@@ -0,0 +1,35 @@
name: docs

on:
push:
branches:
- master
workflow_dispatch:

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2
with:
node-version: 14.x
- uses: actions/checkout@v2
with:
submodules: recursive
- run: yarn install --ignore-scripts
- run: yarn compile
- run: yarn docs
- name: Deploy to gh-pages
if: ${{ github.event_name == 'push' }}
run: |
git config --global user.name thegecko
git config --global user.email github@thegecko.org
TMPDIR=`mktemp -d`
cp -R docs/* $TMPDIR
git checkout gh-pages
git pull
git clean -fd
cp -R $TMPDIR/* ./
git add .
git commit --allow-empty --message "Automatic Deployment"
git push
4 changes: 2 additions & 2 deletions .github/workflows/prebuild.yml
Expand Up @@ -44,8 +44,8 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: recursive
- run: npm install --ignore-scripts
- run: npm run prebuild-${{ matrix.name }}
- run: yarn install --ignore-scripts
- run: yarn prebuild-${{ matrix.name }}
- run: tar -zcvf ${{ matrix.name }}.tar.gz -C prebuilds .
- uses: actions/upload-artifact@v2
with:
Expand Down
7 changes: 5 additions & 2 deletions .gitignore
@@ -1,6 +1,9 @@
build/*
prebuilds/
.DS_Store
node_modules
build
*~
*.log
docs
test/*.js
dist
prebuilds
4 changes: 3 additions & 1 deletion .npmignore
@@ -1,6 +1,8 @@
build/*
.DS_Store
node_modules
build
*~
*.log
docs
test/*.js
.github
15 changes: 15 additions & 0 deletions .vscode/launch.json
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Full Test",
"type": "node-terminal",
"request": "launch",
"preLaunchTask": "test",
"command": "exit 0",
}
]
}
23 changes: 23 additions & 0 deletions .vscode/tasks.json
@@ -0,0 +1,23 @@
{
"tasks": [
{
"label": "compile",
"type": "npm",
"script": "compile"
},
{
"label": "watch",
"type": "npm",
"script": "watch",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "test",
"type": "npm",
"script": "full-test"
}
]
}

0 comments on commit 9ef44b5

Please sign in to comment.