Skip to content

Commit

Permalink
chore: switch to [email protected]
Browse files Browse the repository at this point in the history
* @sec-ant/barcode-detector package name changed to barcode-detector
* [email protected] supports iOS/Safari 13.0
  • Loading branch information
Sec-ant authored and gruhn committed Sep 9, 2023
1 parent 8745e1b commit a30d4a9
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 26 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"dist"
],
"dependencies": {
"@sec-ant/barcode-detector": "^1.2.2",
"barcode-detector": "^2.0.1",
"webrtc-adapter": "^8.2.3"
},
"devDependencies": {
Expand Down
40 changes: 20 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/QrcodeCapture.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<script setup lang="ts">
import { type PropType } from 'vue'
import { processFile } from '../misc/scanner'
import { type BarcodeFormat } from '@sec-ant/barcode-detector/pure'
import { type BarcodeFormat } from 'barcode-detector/pure'
const props = defineProps({
formats: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/QrcodeDropZone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<script setup lang="ts">
import { type PropType } from 'vue'
import { processFile, processUrl } from '../misc/scanner'
import { type BarcodeFormat } from '@sec-ant/barcode-detector/pure'
import { type BarcodeFormat } from 'barcode-detector/pure'
const props = defineProps({
formats: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/QrcodeStream.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</template>

<script setup lang="ts">
import type { DetectedBarcode, BarcodeFormat } from '@sec-ant/barcode-detector/pure'
import type { DetectedBarcode, BarcodeFormat } from 'barcode-detector/pure'
import { onUnmounted, computed, onMounted, ref, toRefs, watch, type PropType, type CSSProperties } from 'vue'
import { keepScanning, setScanningFormats } from '../misc/scanner'
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import QrcodeStream from './components/QrcodeStream.vue'
import QrcodeCapture from './components/QrcodeCapture.vue'
import QrcodeDropZone from './components/QrcodeDropZone.vue'

import { setZXingModuleOverrides } from '@sec-ant/barcode-detector/pure'
import { setZXingModuleOverrides } from 'barcode-detector/pure'

// Install the components
export function install(app: App) {
Expand Down
2 changes: 1 addition & 1 deletion src/misc/scanner.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type DetectedBarcode, type BarcodeFormat, BarcodeDetector } from '@sec-ant/barcode-detector/pure'
import { type DetectedBarcode, type BarcodeFormat, BarcodeDetector } from 'barcode-detector/pure'
import { eventOn } from './callforth'
import { DropImageFetchError } from './errors'

Expand Down
12 changes: 12 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ export default defineConfig({
}
},
build: {
// these are the targets supported by zxing webassembly
// ----------------------------------------------------
// according to: https://esbuild.github.io/api/#target
// esbuild will transpile newer ES syntaxes according to this list
// newer web APIs will still have to be polyfilled if they don't exist
// ----------------------------------------------------
// according to: https://github.com/emscripten-core/emscripten/blob/b72550132f8381c3f3021853505159f6f6b11e48/src/settings.js#L1763-L1812
// even older browsers may still be supported, however let's settle on this until someone complains
// ----------------------------------------------------
// safari 13 support is requested by: https://github.com/Sec-ant/barcode-detector/issues/11
// others are defaults from emscripten and vite
target: ['es2020', 'edge88', 'firefox68', 'chrome75', 'safari13'],
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'VueQrcodeReader'
Expand Down

0 comments on commit a30d4a9

Please sign in to comment.