Skip to content

Commit

Permalink
v2: Ignore other devices (#48)
Browse files Browse the repository at this point in the history
An early design oversight has lead to a v2 release. The
`connectedDevice` event performs no checking to ensure the device that
connected is one the library cares about. I never tested the scenario of
connecting something other than a bunch of laser printers at the same
time until now. Since that required an API change I figured I'd add as
much API-breaking-changes in one go as I could.

Anyway.

This includes a switch to Vite, which I've found a VERY pleasant
ecosystem to work within for building the package.

## Breaking changes:

* USBDeviceManager is the new manager class.
* LabelPrinter is the new Printer class.
* A few other ancillary classes became interfaces and names changes
slightly. The types should be self-explanatory to follow.
  • Loading branch information
Cellivar authored Jan 8, 2024
1 parent fe74128 commit 6b5ed1f
Show file tree
Hide file tree
Showing 50 changed files with 8,444 additions and 10,159 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
indent_size = 2
33 changes: 0 additions & 33 deletions .eslintrc

This file was deleted.

8 changes: 8 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-env node */
module.exports = {
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
root: true,
ignorePatterns: ['**/node_modules/**']
};
29 changes: 12 additions & 17 deletions .github/workflows/build_npm.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Build

permissions:
issues: write
pull-requests: write

on:
pull_request:
push:
Expand All @@ -9,23 +13,14 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Build on Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: 20
- run: npm ci --ignore-scripts
- uses: mattallty/jest-github-action@v1
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: mattallty/jest-github-action@v1
if: github.event_name == 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
coverage-comment: false
- name: 'Test'
run: npx vitest --coverage.enabled true
- name: 'Report Coverage'
if: ${{ !cancelled() }}
uses: davelosert/vitest-coverage-report-action@v2
8 changes: 5 additions & 3 deletions .github/workflows/publish_npm.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
name: Publish Package to npmjs

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
environment: publish
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: npm ci --ignore-scripts
- run: npm run build
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
coverage/
dist/
node_modules/
tsconfig.tsbuildinfo
4 changes: 0 additions & 4 deletions .npmignore

This file was deleted.

7 changes: 0 additions & 7 deletions .prettierrc

This file was deleted.

Loading

0 comments on commit 6b5ed1f

Please sign in to comment.