vue-qrcode-reader icon indicating copy to clipboard operation
vue-qrcode-reader copied to clipboard

feat:support formats

Open carpONE opened this issue 1 year ago • 6 comments

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

carpONE avatar Jan 14 '24 11:01 carpONE

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

比如说:

  • 如果提交信息中包含 bug 修复式更新(fix),那么它会增加最小的那个版本号(patch);
  • 如果提交信息中包含功能性更新(feature),那么它会增加中间那个版本号(minor);
  • 如果提交信息中包含破坏性更新(breaking change),那么它会增加最大的那个版本号(major);
  • 如果它没能从提交信息中解析出来更新类型,那么它不会增加版本号。

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

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

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

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

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

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

Sec-ant avatar Jan 14 '24 12:01 Sec-ant

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

Sec-ant avatar Jan 14 '24 12:01 Sec-ant

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

gruhn avatar Feb 15 '24 16:02 gruhn

@gruhn yes

carpONE avatar Feb 18 '24 01:02 carpONE

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 avatar Feb 18 '24 05:02 Sec-ant

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";

Sec-ant avatar Feb 18 '24 05:02 Sec-ant

Hey guys, Approximately when will this be merged?

adam-torok avatar Mar 19 '24 10:03 adam-torok

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.

gruhn avatar Mar 19 '24 19:03 gruhn

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

adam-torok avatar Mar 20 '24 08:03 adam-torok

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

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Mar 22 '24 17:03 github-actions[bot]

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.

gruhn avatar Mar 22 '24 17:03 gruhn

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.

Sec-ant avatar Mar 22 '24 17:03 Sec-ant

Don’t worry :)

gruhn avatar Mar 23 '24 06:03 gruhn

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

adam-torok avatar Mar 23 '24 12:03 adam-torok

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

Vamosz avatar Mar 25 '24 11:03 Vamosz

It is already merged. It should ship with version 3.2.0

gruhn avatar Mar 25 '24 17:03 gruhn