├── .gitignore ├── .prettierrc ├── README.md ├── package.json ├── rollup.config.js ├── src ├── index.ts └── tsconfig.json ├── tsconfig.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | lib 2 | node_modules 3 | npm-debug.log 4 | src/*.js 5 | tests/*.spec.js 6 | package-lock.json 7 | .vscode/setting.json 8 | .idea 9 | yarn-error.log 10 | coverage 11 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "singleQuote": true, 4 | "tabWidth": 4, 5 | "trailingComma": "all" 6 | } 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Welcome to vue-decorator 2 | 3 | Hi!, this is a wrapper to two good projects: 4 | 1. [vue-class-component](https://github.com/vuejs/vue-class-component) 5 | 2. [vue-property-decorator](https://github.com/kaorun343/vue-property-decorator) 6 | 7 | This give us custom decorators provide by vue-class-component and vue-property-decorator that fits Vue 3 8 | 9 | ##Compatible: Vue 3 10 | 11 | ## Install 12 | ### yarn 13 | ```bash 14 | yarn add vue-decorator 15 | ``` 16 | ### npm 17 | ```bash 18 | npm i vue-decorator 19 | ``` 20 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-decorator", 3 | "version": "1.1.3", 4 | "description": "Custom decorators to vue-class-component that fits Vue 3", 5 | "main": "lib/index.umd.js", 6 | "module": "lib/index.js", 7 | "types": "lib/index.d.ts", 8 | "sideEffects": false, 9 | "files": [ 10 | "lib" 11 | ], 12 | "keywords": [ 13 | "vue", 14 | "vue3", 15 | "typescript", 16 | "decorator" 17 | ], 18 | "author": "calebeaires", 19 | "license": "MIT", 20 | "scripts": { 21 | "build": "tsc -p ./src/tsconfig.json && rollup -c", 22 | "test": "jest" 23 | }, 24 | "dependencies": { 25 | }, 26 | "devDependencies": { 27 | "rollup": "^2.35.1", 28 | "typescript": "^4.1.3", 29 | "vue": "^3.0.11", 30 | "vue-class-component": "^8.0.0-rc.1", 31 | "vue-property-decorator": "^10.0.0-rc.3" 32 | }, 33 | "repository": { 34 | "type": "git", 35 | "url": "git+https://github.com/calebeaires/vue-decorator.git" 36 | }, 37 | "bugs": { 38 | "url": "https://github.com/calebeaires/vue-decorator/issues" 39 | }, 40 | "homepage": "https://github.com/calebeaires/vue-decorator#readme" 41 | } 42 | -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | input: 'lib/index.js', 3 | output: { 4 | file: 'lib/index.umd.js', 5 | format: 'umd', 6 | name: 'VueClassDecorator', 7 | globals: { 8 | vue: 'Vue', 9 | 'vue-class-component': 'VueClassComponent', 10 | 'vue-property-decorator': 'vuePropertyDecorator', 11 | }, 12 | exports: 'named', 13 | }, 14 | external: ['vue', 'vue-class-component', 'vue-property-decorator', 'reflect-metadata'], 15 | }; 16 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export * from 'vue-class-component'; 2 | export * from 'vue-property-decorator'; 3 | -------------------------------------------------------------------------------- /src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "outDir": "../lib", 6 | "rootDir": "./" 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "es2020", 5 | "lib": [ 6 | "dom", 7 | "es2015", 8 | "es2016", 9 | "es2017", 10 | "es2020" 11 | ], 12 | "strict": true, 13 | "moduleResolution": "node", 14 | "esModuleInterop": true, 15 | "experimentalDecorators": true, 16 | "emitDecoratorMetadata": true 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@babel/helper-validator-identifier@^7.14.0": 6 | version "7.14.0" 7 | resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz#d26cad8a47c65286b15df1547319a5d0bcf27288" 8 | integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A== 9 | 10 | "@babel/parser@^7.12.0": 11 | version "7.14.1" 12 | resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.1.tgz#1bd644b5db3f5797c4479d89ec1817fe02b84c47" 13 | integrity sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q== 14 | 15 | "@babel/types@^7.12.0": 16 | version "7.14.1" 17 | resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.1.tgz#095bd12f1c08ab63eff6e8f7745fa7c9cc15a9db" 18 | integrity sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA== 19 | dependencies: 20 | "@babel/helper-validator-identifier" "^7.14.0" 21 | to-fast-properties "^2.0.0" 22 | 23 | "@vue/compiler-core@3.0.11": 24 | version "3.0.11" 25 | resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.0.11.tgz#5ef579e46d7b336b8735228758d1c2c505aae69a" 26 | integrity sha512-6sFj6TBac1y2cWCvYCA8YzHJEbsVkX7zdRs/3yK/n1ilvRqcn983XvpBbnN3v4mZ1UiQycTvOiajJmOgN9EVgw== 27 | dependencies: 28 | "@babel/parser" "^7.12.0" 29 | "@babel/types" "^7.12.0" 30 | "@vue/shared" "3.0.11" 31 | estree-walker "^2.0.1" 32 | source-map "^0.6.1" 33 | 34 | "@vue/compiler-dom@3.0.11": 35 | version "3.0.11" 36 | resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.0.11.tgz#b15fc1c909371fd671746020ba55b5dab4a730ee" 37 | integrity sha512-+3xB50uGeY5Fv9eMKVJs2WSRULfgwaTJsy23OIltKgMrynnIj8hTYY2UL97HCoz78aDw1VDXdrBQ4qepWjnQcw== 38 | dependencies: 39 | "@vue/compiler-core" "3.0.11" 40 | "@vue/shared" "3.0.11" 41 | 42 | "@vue/reactivity@3.0.11": 43 | version "3.0.11" 44 | resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.0.11.tgz#07b588349fd05626b17f3500cbef7d4bdb4dbd0b" 45 | integrity sha512-SKM3YKxtXHBPMf7yufXeBhCZ4XZDKP9/iXeQSC8bBO3ivBuzAi4aZi0bNoeE2IF2iGfP/AHEt1OU4ARj4ao/Xw== 46 | dependencies: 47 | "@vue/shared" "3.0.11" 48 | 49 | "@vue/runtime-core@3.0.11": 50 | version "3.0.11" 51 | resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.0.11.tgz#c52dfc6acf3215493623552c1c2919080c562e44" 52 | integrity sha512-87XPNwHfz9JkmOlayBeCCfMh9PT2NBnv795DSbi//C/RaAnc/bGZgECjmkD7oXJ526BZbgk9QZBPdFT8KMxkAg== 53 | dependencies: 54 | "@vue/reactivity" "3.0.11" 55 | "@vue/shared" "3.0.11" 56 | 57 | "@vue/runtime-dom@3.0.11": 58 | version "3.0.11" 59 | resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.0.11.tgz#7a552df21907942721feb6961c418e222a699337" 60 | integrity sha512-jm3FVQESY3y2hKZ2wlkcmFDDyqaPyU3p1IdAX92zTNeCH7I8zZ37PtlE1b9NlCtzV53WjB4TZAYh9yDCMIEumA== 61 | dependencies: 62 | "@vue/runtime-core" "3.0.11" 63 | "@vue/shared" "3.0.11" 64 | csstype "^2.6.8" 65 | 66 | "@vue/shared@3.0.11": 67 | version "3.0.11" 68 | resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.0.11.tgz#20d22dd0da7d358bb21c17f9bde8628152642c77" 69 | integrity sha512-b+zB8A2so8eCE0JsxjL24J7vdGl8rzPQ09hZNhystm+KqSbKcAej1A+Hbva1rCMmTTqA+hFnUSDc5kouEo0JzA== 70 | 71 | csstype@^2.6.8: 72 | version "2.6.17" 73 | resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.17.tgz#4cf30eb87e1d1a005d8b6510f95292413f6a1c0e" 74 | integrity sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A== 75 | 76 | estree-walker@^2.0.1: 77 | version "2.0.2" 78 | resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" 79 | integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== 80 | 81 | fsevents@~2.3.1: 82 | version "2.3.2" 83 | resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" 84 | integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== 85 | 86 | rollup@^2.35.1: 87 | version "2.47.0" 88 | resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.47.0.tgz#9d958aeb2c0f6a383cacc0401dff02b6e252664d" 89 | integrity sha512-rqBjgq9hQfW0vRmz+0S062ORRNJXvwRpzxhFXORvar/maZqY6za3rgQ/p1Glg+j1hnc1GtYyQCPiAei95uTElg== 90 | optionalDependencies: 91 | fsevents "~2.3.1" 92 | 93 | source-map@^0.6.1: 94 | version "0.6.1" 95 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" 96 | integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== 97 | 98 | to-fast-properties@^2.0.0: 99 | version "2.0.0" 100 | resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" 101 | integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= 102 | 103 | typescript@^4.1.3: 104 | version "4.2.4" 105 | resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961" 106 | integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg== 107 | 108 | vue-class-component@^8.0.0-rc.1: 109 | version "8.0.0-rc.1" 110 | resolved "https://registry.yarnpkg.com/vue-class-component/-/vue-class-component-8.0.0-rc.1.tgz#db692cd97656eb9a08206c03d0b7398cdb1d9420" 111 | integrity sha512-w1nMzsT/UdbDAXKqhwTmSoyuJzUXKrxLE77PCFVuC6syr8acdFDAq116xgvZh9UCuV0h+rlCtxXolr3Hi3HyPQ== 112 | 113 | vue-property-decorator@^10.0.0-rc.3: 114 | version "10.0.0-rc.3" 115 | resolved "https://registry.yarnpkg.com/vue-property-decorator/-/vue-property-decorator-10.0.0-rc.3.tgz#bb0cb2c7c31dc41149eb432f2104fb82dc3d95be" 116 | integrity sha512-EGqjf8Lq+kTausZzfLB1ynWOcyay8ZLAc5p2VlKGEX2q+BjYw84oZxr6IcdwuxGIdNmriZqPUX6AlAluBdnbEg== 117 | 118 | vue@^3.0.11: 119 | version "3.0.11" 120 | resolved "https://registry.yarnpkg.com/vue/-/vue-3.0.11.tgz#c82f9594cbf4dcc869241d4c8dd3e08d9a8f4b5f" 121 | integrity sha512-3/eUi4InQz8MPzruHYSTQPxtM3LdZ1/S/BvaU021zBnZi0laRUyH6pfuE4wtUeLvI8wmUNwj5wrZFvbHUXL9dw== 122 | dependencies: 123 | "@vue/compiler-dom" "3.0.11" 124 | "@vue/runtime-dom" "3.0.11" 125 | "@vue/shared" "3.0.11" 126 | --------------------------------------------------------------------------------