-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use Vue CLI provided config boilerplate
Issue: #51
- Loading branch information
Showing
30 changed files
with
20,469 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
> 1% | ||
last 2 versions | ||
ie >= 10 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
module.exports = { | ||
root: true, | ||
parser: "babel-eslint", | ||
env: { | ||
node: true | ||
}, | ||
extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"], | ||
parserOptions: { | ||
sourceType: "module" | ||
parser: "babel-eslint" | ||
}, | ||
extends: "prettier", | ||
// required to lint *.vue files | ||
plugins: ["html"], | ||
env: { | ||
browser: true | ||
} | ||
// add your custom rules here | ||
// 'rules': { | ||
// // allow paren-less arrow functions | ||
// 'arrow-parens': 0, | ||
// // allow async-await | ||
// 'generator-star-spacing': 0, | ||
// // allow debugger during development | ||
// 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, | ||
// // trailing comma | ||
// 'comma-dangle': ['error', 'always-multiline'], | ||
// } | ||
rules: { | ||
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off", | ||
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off" | ||
}, | ||
overrides: [ | ||
{ | ||
files: [ | ||
"**/__tests__/*.{j,t}s?(x)", | ||
"**/tests/unit/**/*.spec.{j,t}s?(x)" | ||
], | ||
env: { | ||
mocha: true | ||
} | ||
} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,25 @@ | ||
node_modules/ | ||
dist/ | ||
npm-debug.log | ||
yarn-error.log | ||
package-lock.json | ||
.DS_Store | ||
node_modules | ||
/dist | ||
|
||
/tests/e2e/videos/ | ||
/tests/e2e/screenshots/ | ||
|
||
# local env files | ||
.env.local | ||
.env.*.local | ||
|
||
# Log files | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
|
||
# Editor directories and files | ||
.idea | ||
.vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: ["@vue/cli-plugin-babel/preset"] | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"pluginsFile": "tests/e2e/plugins/index.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<template> | ||
<div> | ||
<p> | ||
Last result: <b>{{ decodedContent }}</b> | ||
</p> | ||
|
||
<p class="error"> | ||
{{ errorMessage }} | ||
</p> | ||
|
||
<qrcode-stream | ||
@decode="onDecode" | ||
:torch="torch" | ||
@init="onInit" | ||
></qrcode-stream> | ||
|
||
<button @click="torch = !torch">Torch On/Off</button> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import QrcodeStream from "../src/components/QrcodeStream"; | ||
export default { | ||
components: { QrcodeStream }, | ||
data() { | ||
return { | ||
decodedContent: "", | ||
errorMessage: "", | ||
torch: false | ||
}; | ||
}, | ||
methods: { | ||
onDecode(content) { | ||
this.decodedContent = content; | ||
}, | ||
onInit(promise) { | ||
promise | ||
.then(({ capabilities }) => { | ||
console.log("Successfully initilized! Ready for scanning now!"); | ||
console.log(capabilities) | ||
}) | ||
.catch(error => { | ||
if (error.name === "NotAllowedError") { | ||
this.errorMessage = "Hey! I need access to your camera"; | ||
} else if (error.name === "NotFoundError") { | ||
this.errorMessage = "Do you even have a camera on your device?"; | ||
} else if (error.name === "NotSupportedError") { | ||
this.errorMessage = | ||
"Seems like this page is served in non-secure context (HTTPS, localhost or file://)"; | ||
} else if (error.name === "NotReadableError") { | ||
this.errorMessage = | ||
"Couldn't access your camera. Is it already in use?"; | ||
} else if (error.name === "OverconstrainedError") { | ||
this.errorMessage = | ||
"Constraints don't match any installed camera. Did you asked for the front camera although there is none?"; | ||
} else { | ||
this.errorMessage = "UNKNOWN ERROR: " + error.message; | ||
} | ||
}); | ||
} | ||
} | ||
}; | ||
</script> |
Oops, something went wrong.