diff --git a/.editorconfig b/.editorconfig index 2e9ea972..dad3b573 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,4 @@ [*.{js, ts}] indent_style = space -indent_size = 2 \ No newline at end of file +indent_size = 2 +end_of_line = lf diff --git a/.eslintrc.js b/.eslintrc.js index 218ed932..3efdb030 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,15 +2,22 @@ module.exports = { env: { node: true }, - parser: '@typescript-eslint/parser', + parser: "@typescript-eslint/parser", extends: [ "eslint:recommended", "plugin:prettier/recommended", - "plugin:jest/recommended", "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/eslint-recommended" ], parserOptions: { sourceType: "module" + }, + rules: { + "prettier/prettier": [ + "error", + { + endOfLine: "auto" + } + ] } }; diff --git a/.gitignore b/.gitignore index 45645129..2ebbf1fe 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,6 @@ /node_modules # Tests coverage results -/coverage \ No newline at end of file +/coverage + +.DS_Store \ No newline at end of file diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 00000000..5f06efb2 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,32 @@ +# Version 1.0.0 - 27.08.2022 + +This is the first release of the package with various bug fixes and dependencies updates from the original repo. +This package can be installed by running. + +`npm install styled-qr-code` or `yarn add styled-qr-code` + +## Breaking change + +- removed the deprecated method signature `download(extension: string)`. Now only `download({name: 'qr', extension: 'png')` is supported +- The orientation of the generated qr code has been fixed to generate qr codes compatible with all known scanners see [#49](https://github.com/kozakdenys/qr-code-styling/issues/105) [#105 QR code is not valid by some scanners](https://github.com/kozakdenys/qr-code-styling/issues/105). + An configuration option `useLegacyDotRotation` has been added to restore the previous behavior. +- images options `crossOrigin` are now set to anonymous by default + +## Feat + +- added optional quality parameter to get getRawData to control the size and quality of the returned image +- added convenience method `toDataUrl` to return a base64 encoded string of the qr code instead of making a detour via a blob +- improved typescript types + +- updated lockfile to v2 [1d91c08fabe430911f68e15cc108c5f015b5329c](1d91c08fabe430911f68e15cc108c5f015b5329c) +- fix svg: [1d91c08fabe430911f68e15cc108c5f015b5329c](1d91c08fabe430911f68e15cc108c5f015b5329c) +- svg now includes images as base64 link: [78070cf808e0b60bb2f6ac310083688f1c27cf99](78070cf808e0b60bb2f6ac310083688f1c27cf99) +- images are now correctly cropped [f400491fe13c5969b8a9d8c1e2e7c90b7067c5a59](f400491fe13c5969b8a9d8c1e2e7c90b7067c5a5) + +## Dependencies + +Updated multiple dependencies and resolved security vulnerabilities. For a full list see: [https://github.com/KilianB/styled-qr-code/commit/535017b1e8dba2eb66666e42eb61e15f8a9866b9#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519](package diff) + +## Misc + +- update example to include legacy and new qr code generation codes diff --git a/README.md b/README.md index 7f9acc19..a387e771 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,16 @@ # QR Code Styling -[![Version](https://img.shields.io/npm/v/qr-code-styling.svg)](https://www.npmjs.org/package/qr-code-styling) +[![Version](https://img.shields.io/npm/v/styled-qr-code.svg)](https://www.npmjs.org/package/styled-qr-code) JavaScript library for generating QR codes with a logo and styling. -Try it here https://qr-code-styling.com +This is a fork of the currently unmaintained [repository by kozakdenys](https://github.com/kozakdenys/qr-code-styling) fixing multiple issues: + +- [#49](https://github.com/kozakdenys/qr-code-styling/issues/105) [#105 QR code is not valid by some scanners](https://github.com/kozakdenys/qr-code-styling/issues/105) +- outdated dependencies +- release for es2017 + +Try the old version here https://qr-code-styling.com to get a feel -If you have issues / suggestions / notes / questions, please open an issue or contact me. Let's create a cool library together. ### Examples
@@ -16,7 +21,7 @@ If you have issues / suggestions / notes / questions, please open an issue or co ### Installation ``` -npm install qr-code-styling +npm install qr-code-styling ``` ### Usage @@ -58,6 +63,7 @@ npm install qr-code-styling