Skip to content

Commit

Permalink
Merge branch 'master' into feature/datamatrixwriter
Browse files Browse the repository at this point in the history
  • Loading branch information
werthdavid authored Apr 19, 2023
2 parents 86e2934 + 72a7cfb commit ebaf826
Show file tree
Hide file tree
Showing 14 changed files with 887 additions and 622 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 12
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down
54 changes: 0 additions & 54 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

46 changes: 5 additions & 41 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 12
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down Expand Up @@ -58,47 +58,11 @@ jobs:
with:
name: pack-artifact

- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: 12
node-version: 18
registry-url: https://registry.npmjs.org/

- run: npm publish ./pack-artifact/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:

- name: Download build artifacts
uses: actions/download-artifact@v1
with:
name: pack-artifact

- name: Install JQ for JSON handling
run: sudo apt-get install jq

- name: Get repository name
run: echo ::set-env name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")
shell: bash

- name: Rename NPM package
run: |
ORG_NAME="zxing-js"
PACKAGE_NAME="@$ORG_NAME/$REPOSITORY_NAME"
tar -xzf ./pack-artifact/package.tgz
cd ./package
mv package.json temp.json
jq -r --arg NAME $PACKAGE_NAME '.name |= $NAME' temp.json > package.json
rm temp.json
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/

- run: npm publish ./pack-artifact/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ There is otherwise no active development or roadmap for this project. It is "DIY

## Status

[![Build Status](https://travis-ci.org/zxing-js/library.svg?branch=master)](https://travis-ci.org/zxing-js/library)
[![Maintainer wanted](https://img.shields.io/badge/maintained-help%20wanted-red)](https://npmjs.org/package/@zxing/ngx-scanner)
[![Greenkeeper badge](https://badges.greenkeeper.io/zxing-js/library.svg)](https://greenkeeper.io/)

Expand Down
115 changes: 0 additions & 115 deletions docs/examples/barcode-camera/index.html

This file was deleted.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zxing/library",
"version": "0.19.1",
"version": "0.19.3",
"description": "TypeScript port of ZXing multi-format 1D/2D barcode image processing library.",
"keywords": [
"reader",
Expand Down Expand Up @@ -65,7 +65,7 @@
"tslint": "./node_modules/.bin/tslint \"./src/**/*.ts\""
},
"dependencies": {
"ts-custom-error": "^3.0.0"
"ts-custom-error": "^3.2.1"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^7.1.3",
Expand All @@ -88,15 +88,15 @@
"karma-sourcemap-loader": "^0.3.7",
"karma-typescript": "^3.0.13",
"karma-typescript-preprocessor": "^0.4.0",
"mocha": "^5.2.0",
"mocha": "^6.2.3",
"mocha-lcov-reporter": "^1.3.0",
"nyc": "^15.1.0",
"rollup": "^2.8.2",
"seedrandom": "^2.4.4",
"sharp": "^0.22.1",
"shx": "0.3.2",
"sharp": "^0.31.3",
"shx": "0.3.4",
"sinon": "^7.2.7",
"terser": "^5.3.7",
"terser": "^5.16.1",
"ts-node": "^9.0.0",
"tsconfig-paths": "^3.9.0",
"tslint": "^6.1.3",
Expand Down
7 changes: 6 additions & 1 deletion src/browser/BrowserCodeReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,12 @@ export class BrowserCodeReader {
protected getCaptureCanvasContext(mediaElement?: HTMLVisualMediaElement) {
if (!this.captureCanvasContext) {
const elem = this.getCaptureCanvas(mediaElement);
const ctx = elem.getContext('2d');
let ctx;
try {
ctx = elem.getContext('2d', {willReadFrequently: true}) as CanvasRenderingContext2D;
} catch (e) {
ctx = elem.getContext('2d');
}
this.captureCanvasContext = ctx;
}

Expand Down
5 changes: 2 additions & 3 deletions src/core/common/detector/MathUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ export default class MathUtils {
* @param d real value to round
* @return nearest {@code int}
*/
public static round(d: number /*float*/): number /*int*/ {
// @ts-ignore
if (NaN === d) return 0;
public static round(d: number/*float*/): number /*int*/ {
if (isNaN(d)) return 0;
if (d <= Number.MIN_SAFE_INTEGER) return Number.MIN_SAFE_INTEGER;
if (d >= Number.MAX_SAFE_INTEGER) return Number.MAX_SAFE_INTEGER;
return /*(int) */ (d + (d < 0.0 ? -0.5 : 0.5)) | 0;
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.lib-cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"outDir": "dist/cjs"
"outDir": "dist/cjs",
"sourceMap": false
},
"exclude": [
"src/test"
]
}
}
5 changes: 3 additions & 2 deletions tsconfig.lib-es2015.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"compilerOptions": {
"module": "es2015",
"target": "es2015",
"outDir": "dist/es2015"
"outDir": "dist/es2015",
"sourceMap": false
},
"exclude": [
"src/test"
]
}
}
5 changes: 3 additions & 2 deletions tsconfig.lib-esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"compilerOptions": {
"module": "es2015",
"target": "es5",
"outDir": "dist/esm"
"outDir": "dist/esm",
"sourceMap": false
},
"exclude": [
"src/test"
]
}
}
Loading

0 comments on commit ebaf826

Please sign in to comment.