Skip to content

Commit 781484f

Browse files
dargmuesligruhn
authored andcommitted
feat: migrate to Vue 3
* use VitePress (instead of VuePress) * migrate to Vue Composion API (internal) * migrate to TypeScript * use `@sec-ant/barcode-detector` * minimal Nix dev shell config BREAKING CHANGE: drop Vue 2 support See #203
1 parent b057338 commit 781484f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+6295
-1092
lines changed

.eslintrc.cjs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true,
5+
es2022: true,
6+
},
7+
extends: [
8+
'plugin:vue/vue3-essential',
9+
'eslint:recommended',
10+
'@vue/eslint-config-typescript',
11+
'@vue/eslint-config-prettier/skip-formatting'
12+
],
13+
parserOptions: {
14+
ecmaVersion: 11
15+
}
16+
}

.eslintrc.js

-25
This file was deleted.

.github/workflows/main.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
name: Release
2+
23
on:
34
push:
45
branches:
56
- master
7+
- vue3-compatibility
8+
69
jobs:
710
release:
811
name: Release
@@ -12,20 +15,22 @@ jobs:
1215
uses: actions/checkout@v2
1316
with:
1417
fetch-depth: 0
18+
- run: corepack enable
1519
- name: Setup Node
1620
uses: actions/setup-node@v1
1721
with:
18-
node-version: 16
22+
node-version: 18
23+
cache: pnpm
1924
- name: Install & Build
2025
run: |
21-
npm ci
22-
npm run build
23-
npm run build:docs
26+
pnpm install
27+
pnpm run build
28+
pnpm run docs:build
2429
- name: Deploy Docs
2530
uses: JamesIves/github-pages-deploy-action@4.1.4
2631
with:
2732
branch: gh-pages
28-
folder: docs/.vuepress/dist
33+
folder: docs/.vitepress/dist
2934
- name: Release
3035
env:
3136
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+222-19
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,229 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/node,linux,macos,windows,vue
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=node,linux,macos,windows,vue
3+
4+
### Linux ###
5+
*~
6+
7+
# temporary files which can be created if a process still has a handle open of a deleted file
8+
.fuse_hidden*
9+
10+
# KDE directory preferences
11+
.directory
12+
13+
# Linux trash folder which might appear on any partition or disk
14+
.Trash-*
15+
16+
# .nfs files are created when an open file is removed but is still being accessed
17+
.nfs*
18+
19+
### macOS ###
20+
# General
121
.DS_Store
2-
node_modules
3-
/dist
4-
/docs/.vuepress/dist
22+
.AppleDouble
23+
.LSOverride
524

6-
/tests/e2e/videos/
7-
/tests/e2e/screenshots/
25+
# Icon must end with two \r
26+
Icon
827

9-
# local env files
10-
.env.local
11-
.env.*.local
1228

13-
# Log files
29+
# Thumbnails
30+
._*
31+
32+
# Files that might appear in the root of a volume
33+
.DocumentRevisions-V100
34+
.fseventsd
35+
.Spotlight-V100
36+
.TemporaryItems
37+
.Trashes
38+
.VolumeIcon.icns
39+
.com.apple.timemachine.donotpresent
40+
41+
# Directories potentially created on remote AFP share
42+
.AppleDB
43+
.AppleDesktop
44+
Network Trash Folder
45+
Temporary Items
46+
.apdisk
47+
48+
### macOS Patch ###
49+
# iCloud generated files
50+
*.icloud
51+
52+
### Node ###
53+
# Logs
54+
logs
55+
*.log
1456
npm-debug.log*
1557
yarn-debug.log*
1658
yarn-error.log*
17-
pnpm-debug.log*
18-
19-
# Editor directories and files
20-
.idea
21-
.vscode
22-
*.suo
23-
*.ntvs*
24-
*.njsproj
25-
*.sln
26-
*.sw?
59+
lerna-debug.log*
60+
.pnpm-debug.log*
61+
62+
# Diagnostic reports (https://nodejs.org/api/report.html)
63+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
64+
65+
# Runtime data
66+
pids
67+
*.pid
68+
*.seed
69+
*.pid.lock
70+
71+
# Directory for instrumented libs generated by jscoverage/JSCover
72+
lib-cov
73+
74+
# Coverage directory used by tools like istanbul
75+
coverage
76+
*.lcov
77+
78+
# nyc test coverage
79+
.nyc_output
80+
81+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
82+
.grunt
83+
84+
# Bower dependency directory (https://bower.io/)
85+
bower_components
86+
87+
# node-waf configuration
88+
.lock-wscript
89+
90+
# Compiled binary addons (https://nodejs.org/api/addons.html)
91+
build/Release
92+
93+
# Dependency directories
94+
node_modules/
95+
jspm_packages/
96+
97+
# Snowpack dependency directory (https://snowpack.dev/)
98+
web_modules/
99+
100+
# TypeScript cache
101+
*.tsbuildinfo
102+
103+
# Optional npm cache directory
104+
.npm
105+
106+
# Optional eslint cache
107+
.eslintcache
108+
109+
# Optional stylelint cache
110+
.stylelintcache
111+
112+
# Microbundle cache
113+
.rpt2_cache/
114+
.rts2_cache_cjs/
115+
.rts2_cache_es/
116+
.rts2_cache_umd/
117+
118+
# Optional REPL history
119+
.node_repl_history
120+
121+
# Output of 'npm pack'
122+
*.tgz
123+
124+
# Yarn Integrity file
125+
.yarn-integrity
126+
127+
# dotenv environment variable files
128+
.env
129+
.env.development.local
130+
.env.test.local
131+
.env.production.local
132+
.env.local
133+
134+
# parcel-bundler cache (https://parceljs.org/)
135+
.cache
136+
.parcel-cache
137+
138+
# Next.js build output
139+
.next
140+
out
141+
142+
# Nuxt.js build / generate output
143+
.nuxt
144+
dist
145+
146+
# Gatsby files
147+
.cache/
148+
# Comment in the public line in if your project uses Gatsby and not Next.js
149+
# https://nextjs.org/blog/next-9-1#public-directory-support
150+
# public
151+
152+
# vuepress build output
153+
.vuepress/dist
154+
155+
# vuepress v2.x temp and cache directory
156+
.temp
157+
158+
# Docusaurus cache and generated files
159+
.docusaurus
160+
161+
# Serverless directories
162+
.serverless/
163+
164+
# FuseBox cache
165+
.fusebox/
166+
167+
# DynamoDB Local files
168+
.dynamodb/
169+
170+
# TernJS port file
171+
.tern-port
172+
173+
# Stores VSCode versions used for testing VSCode extensions
174+
.vscode-test
175+
176+
# yarn v2
177+
.yarn/cache
178+
.yarn/unplugged
179+
.yarn/build-state.yml
180+
.yarn/install-state.gz
181+
.pnp.*
182+
183+
### Node Patch ###
184+
# Serverless Webpack directories
185+
.webpack/
186+
187+
# Optional stylelint cache
188+
189+
# SvelteKit build / generate output
190+
.svelte-kit
191+
192+
### Vue ###
193+
# gitignore template for Vue.js projects
194+
#
195+
# Recommended template: Node.gitignore
196+
197+
# TODO: where does this rule come from?
198+
docs/_book
199+
200+
# TODO: where does this rule come from?
201+
test/
202+
203+
### Windows ###
204+
# Windows thumbnail cache files
205+
Thumbs.db
206+
Thumbs.db:encryptable
207+
ehthumbs.db
208+
ehthumbs_vista.db
209+
210+
# Dump file
211+
*.stackdump
212+
213+
# Folder config file
214+
[Dd]esktop.ini
215+
216+
# Recycle Bin used on file shares
217+
$RECYCLE.BIN/
218+
219+
# Windows Installer files
220+
*.cab
221+
*.msi
222+
*.msix
223+
*.msm
224+
*.msp
225+
226+
# Windows shortcuts
227+
*.lnk
228+
229+
# End of https://www.toptal.com/developers/gitignore/api/node,linux,macos,windows,vue

.husky/pre-commit

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
# shellcheck source=./_/husky.sh
3+
. "$(dirname "$(readlink -f "$0")")/_/husky.sh"
4+
5+
pnpm lint-staged

.lintstagedrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"*.{js,jsx,vue}": ["pnpm lint --fix", "git add"]
3+
}

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

.prettierrc.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://json.schemastore.org/prettierrc",
3+
"semi": false,
4+
"tabWidth": 2,
5+
"singleQuote": true,
6+
"printWidth": 100,
7+
"trailingComma": "none"
8+
}

.releaserc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
branches:
22
- name: master
3-
- name: beta
3+
- name: vue3-compatibility
44
prerelease: true

.vscode/extensions.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3+
}

README.md

+4-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<br>
66

77
<a href="https://vuejs.org/">
8-
<img src="https://img.shields.io/badge/vue-2.x-brightgreen.svg" alt="for Vue.js 2">
8+
<img src="https://img.shields.io/badge/vue-3-brightgreen.svg" alt="for Vue 3">
99
</a>
1010

1111
<a href="https://www.npmjs.com/package/vue-qrcode-reader">
@@ -173,11 +173,8 @@ Please create a GitHub issue from the [wrong camera selected](https://github.com
173173
#### Some of my QR codes are not being detected.
174174
175175
- Make sure, there is some white border around the QR code.
176-
- Color inverted QR codes are not supported (dark background, light foreground).
177-
- [Model 1 QR codes](https://en.wikipedia.org/wiki/QR_code#Model_1) are also not supported.
176+
- [Model 1 QR codes](https://en.wikipedia.org/wiki/QR_code#Model_1) are not supported.
178177
179-
# Thanks :pray:
178+
#### How to make it work with Vue 2?
180179
181-
<a href="https://browserstack.com">
182-
<img height="38" src="https://raw.githubusercontent.com/gruhn/vue-qrcode-reader/master/.github/browserstack-logo.png" alt="BrowserStack Logo">
183-
</a>
180+
Support is dropped but you can downgrade to vue-qrcode-reader v3.* or lower.

babel.config.js

-3
This file was deleted.

docs/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.vitepress/dist
2+
.vitepress/cache

0 commit comments

Comments
 (0)