Skip to content

Commit

Permalink
fix(uuid): replaced vue-uuid with uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdehaven committed Feb 5, 2022
1 parent 59e6b79 commit 62a14fd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 26 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"dependencies": {
"swrv": "^0.9.6",
"vue-uuid": "^2.0.2"
"uuid": "^8.3.2"
},
"devDependencies": {
"@commitlint/cli": "^16.1.0",
Expand All @@ -52,6 +52,7 @@
"@types/inquirer": "^8.2.0",
"@types/node": "^17.0.14",
"@types/node-emoji": "^1.8.1",
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^5.10.2",
"@typescript-eslint/parser": "^5.10.2",
"@vitejs/plugin-vue": "^2.1.0",
Expand Down
6 changes: 3 additions & 3 deletions src/components/KCard/KCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

<script lang="ts">
import { defineComponent, computed } from 'vue'
import { uuid } from 'vue-uuid'
import { v1 as uuidv1 } from 'uuid'
export default defineComponent({
name: 'KCard',
Expand Down Expand Up @@ -120,8 +120,8 @@ export default defineComponent({
},
setup(props) {
const titleId = computed((): string => props.testMode ? uuid.v1() : 'test-title-id-1234')
const contentId = computed((): string => props.testMode ? uuid.v1() : 'test-content-id-1234')
const titleId = computed((): string => props.testMode ? uuidv1() : 'test-title-id-1234')
const contentId = computed((): string => props.testMode ? uuidv1() : 'test-content-id-1234')
return {
titleId,
Expand Down
21 changes: 11 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { App, Plugin } from 'vue'
import { App } from 'vue'
import * as components from './components' // Import all components
import './styles/styles.scss' // Import all styles

const install: Plugin = (app: App) => {
for (const key in components) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
app.component(key, components[key])
}
}

// Export install function
export default install
export default {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
install: (app: App, options: Record<string, any>) => {
for (const key in components) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
app.component(key, components[key])
}
},
}

// Export all components
export * from './components'
4 changes: 2 additions & 2 deletions src/vue.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// <reference types="vite/client" />
/* eslint-disable */

declare module '*.vue' {
import { DefineComponent } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any>
export default component
}
12 changes: 2 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d"
integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==

"@types/uuid@^8.0.0":
"@types/uuid@^8.3.4":
version "8.3.4"
resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc"
integrity sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==
Expand Down Expand Up @@ -4888,7 +4888,7 @@ util-deprecate@^1.0.1, util-deprecate@^1.0.2:
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=

uuid@^8.1.0, uuid@^8.3.2:
uuid@^8.3.2:
version "8.3.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
Expand Down Expand Up @@ -5094,14 +5094,6 @@ vue-tsc@^0.29.8:
"@volar/shared" "0.29.8"
vscode-vue-languageservice "0.29.8"

vue-uuid@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/vue-uuid/-/vue-uuid-2.0.2.tgz#0cfb739e660a3af1d4e3342743578114f79b2438"
integrity sha512-PRf1CHg3uKi77bVRyAuW2u/T2PO9LxMr7cw9t9rNdpZTkNDyw1Fx6eJVL+8JOtM9VxxPkoZ/rwhXJ5l+X5AYzQ==
dependencies:
"@types/uuid" "^8.0.0"
uuid "^8.1.0"

vue@^3.2.25, vue@^3.2.28:
version "3.2.29"
resolved "https://registry.yarnpkg.com/vue/-/vue-3.2.29.tgz#3571b65dbd796d3a6347e2fd45a8e6e11c13d56a"
Expand Down

0 comments on commit 62a14fd

Please sign in to comment.