gruhn / vue-qrcode-reader

A set of Vue.js components for detecting and decoding QR codes.
https://gruhn.github.io/vue-qrcode-reader
MIT License
2.03k stars 330 forks source link

feat:support formats #414

Closed carpONE closed 3 months ago

carpONE commented 5 months ago

vue-qrcode-reader^3.x version Support barcode formats other than QR codes

  1. Upgrade barcode detector dependency from 1.0.3 to 2.2.2 to provide support for barcode formats other than QR codes
Sec-ant commented 5 months ago

有一点忘记跟你说了,这个仓库用到了 semantic-release 自动化构建工作流,它会根据提交信息(commit message)来确认是否发布新的版本以及版本号应该如何新增。

比如说:

版本号增加后它会自动发布一个新版本。

为了让 semantic release 工作流能够正常从你的提交信息中解析出来更新类型,你应该将你的提交信息改写为符合“约定式提交”风格的信息。

以本 PR 为例,支持 formats 属于功能性更新,按照惯例,你应该将你的提交信息改写为 feat: support formats 类似这样的信息(第一行信息是这个,后面的详细信息可以空一行之后写)。这样在你的提交合并之后,才会触发自动化工作流更新版本号并发布一个新版本。

如果你了解修改已有的提交信息的方法(rebase + force push),你可以尝试修改一下你的提交信息,让它更符合约定的风格。

如果你不确定该如何修改,也可以让仓库作者在合并时修改。

了解并遵循这样的风格有利于代码维护(从提交历史中可以清楚地了解每个提交所做的工作),也方便参与到开源社区贡献代码。

Sec-ant commented 5 months ago

PR 的标题和简介与提交信息是两回事儿,你可以参考一下这个文档修改提交信息:https://docs.github.com/zh/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/changing-a-commit-message

还有这个回答:https://stackoverflow.com/questions/10728420/editing-the-git-commit-message-in-github

gruhn commented 4 months ago

@Sec-ant @carpONE would you say this is ready to be merged?

carpONE commented 4 months ago

@gruhn yes

Sec-ant commented 4 months ago

The npm registry in the package-lock.json file is littered with a deprecated third-party registry: https://registry.npm.taobao.org/. This is mainly for the mainland Chinese users to install packages behind the firewall. Yet it no longer works and is renamed to a new host name registry.npmmirror.com now, and I think it's better to only override it with another registry locally by the users who need this, so we should regenerate this file with the official registry: https://registry.npmjs.org.

Sec-ant commented 4 months ago

For consistency, and correctness, we should also change this line: https://github.com/carpONE/vue-qrcode-reader/blob/50ecc21ec88621ae8957283ee50b16a83f1ea050/src/mixins/CommonAPI.vue#L2

import { BarcodeDetector } from "barcode-detector";
adam-torok commented 3 months ago

Hey guys, Approximately when will this be merged?

gruhn commented 3 months ago

If @carpONE is not coming back and nobody else wants to take on the suggestions by @Sec-ant, I could just merge it. It’s just the legacy channel I guess.

adam-torok commented 3 months ago

the merge would be appreciated as we could use the formats in vue2 👍

github-actions[bot] commented 3 months ago

:tada: This PR is included in version 3.2.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

gruhn commented 3 months ago

FYI: Also tried to make your suggested adjustments @Sec-ant. Thanks for the info with the package.json. But got an error when trying to build with this import:

import { BarcodeDetector } from 'barcode-detector/pure'
 ERROR  Failed to compile with 1 error                                                                                                                                                                   6:36:43 PM

This dependency was not found:

* barcode-detector/pure in ./src/misc/scanner.js

To install it, you can run: npm install --save barcode-detector/pure
 ERROR  Build failed with errors.
Sec-ant commented 3 months ago

Hi, @gruhn, sorry for not being able to help much. A lot is going on on my side. I will try to find some time to look into this and other issues I once promised.

gruhn commented 3 months ago

Don’t worry :)

adam-torok commented 3 months ago

Thank you for the merge, it was a life saver!

Vamosz commented 3 months ago

Hi @carpONE, @gruhn! When will you guys merge this pull request?

gruhn commented 3 months ago

It is already merged. It should ship with version 3.2.0