diff --git a/bin/find-arduino.js b/bin/find-arduino.ts similarity index 68% rename from bin/find-arduino.js rename to bin/find-arduino.ts index c81b7c6..4e54977 100755 --- a/bin/find-arduino.js +++ b/bin/find-arduino.ts @@ -1,9 +1,10 @@ -#!/usr/bin/env node +#!/usr/bin/env node -r esbuild-register // outputs the path to an Arduino to stdout or an error to stderror -const SerialPort = require('../packages/serialport') -SerialPort.list().then(ports => { +import { autoDetect } from '../lib' + +autoDetect().list().then(ports => { const port = ports.find(port => /arduino/i.test(port.manufacturer)) if (!port) { console.error('Arduino Not found') diff --git a/package.json b/package.json index 7610c7b..7379d08 100644 --- a/package.json +++ b/package.json @@ -61,10 +61,10 @@ "prebuildify-cross": "prebuildify-cross --napi --target 14.0.0 --force --strip --verbose", "rebuild": "node-gyp rebuild", "coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov", - "format": "eslint lib test --fix", - "lint": "eslint lib test && cc --verbose", + "format": "eslint lib test bin --fix", + "lint": "eslint lib test bin && cc --verbose", "test": "nyc --reporter=html --reporter=text --reporter lcovonly mocha", - "test:arduino": "TEST_PORT=$(./bin/find-arduino.js) npm test", + "test:arduino": "TEST_PORT=$(./bin/find-arduino.ts) npm test", "test:watch": "mocha -w", "semantic-release": "semantic-release", "typecheck": "tsc"