vue-promise-button
Advanced tools
Comparing version 0.1.6 to 1.0.0-alpha.1
{ | ||
"name": "vue-promise-button", | ||
"version": "0.1.6", | ||
"description": "A promise button for vuejs, handles buttons asynchronous lock and show loading state indicator", | ||
"main": "./dist/vue-promise-button.common.js", | ||
"version": "1.0.0-alpha.1", | ||
"scripts": { | ||
"serve": "vue-cli-service serve", | ||
"build": "vue-cli-service build", | ||
"build-bundle": "vue-cli-service build --target lib --name vue-promise-button ./src/components/PromiseButton.vue", | ||
"lint": "vue-cli-service lint", | ||
"test:unit": "vue-cli-service test:unit" | ||
"dev": "vite", | ||
"build": "vue-tsc --noEmit && vite build", | ||
"preview": "vite preview --port 5050", | ||
"test:unit": "vitest --environment jsdom", | ||
"typecheck": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false", | ||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore" | ||
}, | ||
"files": [ | ||
"dist/*", | ||
"src/*", | ||
"package.json" | ||
], | ||
"keywords": [ | ||
"promise", | ||
"vue-promise", | ||
"promise-button", | ||
"vue-promise-button" | ||
], | ||
"license": "MIT", | ||
"author": "mihnsen <minhnt.hut@gmail.com> (https://github.com/mihnsen/)", | ||
"dependencies": { | ||
"vue": "^2.6.10" | ||
"vue": "^3.2.31" | ||
}, | ||
"devDependencies": { | ||
"bootstrap": "^4.3.1", | ||
"core-js": "^2.6.5", | ||
"vue-class-component": "^7.0.2", | ||
"vue-property-decorator": "^8.1.0", | ||
"@types/jest": "^23.1.4", | ||
"@typescript-eslint/eslint-plugin": "^2.3.1-alpha.1", | ||
"@typescript-eslint/parser": "^2.3.0", | ||
"@vue/cli-plugin-babel": "^3.11.0", | ||
"@vue/cli-plugin-eslint": "^3.11.0", | ||
"@vue/cli-plugin-typescript": "^3.11.0", | ||
"@vue/cli-plugin-unit-jest": "^3.11.0", | ||
"@vue/cli-service": "^3.11.0", | ||
"@vue/eslint-config-standard": "^4.0.0", | ||
"@vue/eslint-config-typescript": "^4.0.0", | ||
"@vue/test-utils": "1.0.0-beta.29", | ||
"babel-core": "7.0.0-bridge.0", | ||
"babel-eslint": "^10.0.1", | ||
"eslint": "^5.16.0", | ||
"eslint-plugin-vue": "^5.2.3", | ||
"pug": "^2.0.4", | ||
"pug-plain-loader": "^1.0.0", | ||
"sass": "^1.18.0", | ||
"sass-loader": "^7.1.0", | ||
"ts-jest": "^23.0.0", | ||
"typescript": "^3.4.3", | ||
"vue-template-compiler": "^2.6.10" | ||
}, | ||
"directories": { | ||
"test": "tests" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://git@github.com/mihnsen/vue-promise-button.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/mihnsen/vue-promise-button/issues" | ||
}, | ||
"homepage": "https://github.com/mihnsen/vue-promise-button#readme" | ||
"@rushstack/eslint-patch": "^1.1.0", | ||
"@types/jsdom": "^16.2.14", | ||
"@types/node": "^16.11.25", | ||
"@vitejs/plugin-vue": "^2.2.2", | ||
"@vue/eslint-config-prettier": "^7.0.0", | ||
"@vue/eslint-config-typescript": "^10.0.0", | ||
"@vue/test-utils": "^2.0.0-rc.18", | ||
"@vue/tsconfig": "^0.1.3", | ||
"autoprefixer": "^10.4.2", | ||
"bootstrap": "^5.1.3", | ||
"eslint": "^8.5.0", | ||
"eslint-plugin-vue": "^8.2.0", | ||
"jsdom": "^19.0.0", | ||
"prettier": "^2.5.1", | ||
"sass": "^1.49.9", | ||
"typescript": "~4.5.5", | ||
"vite": "^2.8.4", | ||
"vitest": "^0.5.9", | ||
"vue-tsc": "^0.31.4" | ||
} | ||
} |
@@ -1,83 +0,52 @@ | ||
# vue-promise-button | ||
# example-library | ||
## Installation | ||
``` | ||
npm install vue-promise-button | ||
or | ||
yarn add vue-promise-button | ||
``` | ||
This template should help get you started developing with Vue 3 in Vite. | ||
## Usage | ||
``` | ||
import PromiseButton from 'vue-promise-button'; | ||
## Recommended IDE Setup | ||
// For typescript users | ||
import PromiseButton from 'vue-promise-button/src/components/PromiseButton.vue' | ||
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.vscode-typescript-vue-plugin). | ||
// Set global if you want | ||
Vue.component('promise-button', PromiseButton); | ||
## Type Support for `.vue` Imports in TS | ||
// Use it | ||
<promise-button class="button" :promise="promise"> | ||
I'm a promise button | ||
</promise-button> | ||
``` | ||
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types. | ||
Setup your promise function as a promise like this. | ||
``` | ||
export default { | ||
methods: { | ||
promise() { | ||
return new Promise((resolve, reject) => { | ||
setTimeout(() => { | ||
resolve(true) | ||
}, 2000) | ||
}) | ||
} | ||
} | ||
} | ||
``` | ||
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps: | ||
With axios and api | ||
``` | ||
export default { | ||
methods: { | ||
promise() { | ||
return axios.get('/users/1234') | ||
} | ||
} | ||
} | ||
``` | ||
1. Disable the built-in TypeScript Extension | ||
1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette | ||
2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)` | ||
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette. | ||
## Development | ||
``` | ||
yarn install | ||
``` | ||
## Customize configuration | ||
### Compiles and hot-reloads for development | ||
See [Vite Configuration Reference](https://vitejs.dev/config/). | ||
## Project Setup | ||
```sh | ||
npm install | ||
``` | ||
yarn run serve | ||
``` | ||
### Compiles and minifies for production | ||
### Compile and Hot-Reload for Development | ||
```sh | ||
npm run dev | ||
``` | ||
yarn run build | ||
``` | ||
### Run your tests | ||
### Type-Check, Compile and Minify for Production | ||
```sh | ||
npm run build | ||
``` | ||
yarn run test | ||
``` | ||
### Lints and fixes files | ||
### Run Unit Tests with [Vitest](https://vitest.dev/) | ||
```sh | ||
npm run test:unit | ||
``` | ||
yarn run lint | ||
``` | ||
### Run your unit tests | ||
### Lint with [ESLint](https://eslint.org/) | ||
```sh | ||
npm run lint | ||
``` | ||
yarn run test:unit | ||
``` | ||
### Customize configuration | ||
See [Configuration Reference](https://cli.vuejs.org/config/). |
@@ -1,8 +0,4 @@ | ||
import Vue from 'vue' | ||
import { createApp } from 'vue' | ||
import App from './App.vue' | ||
Vue.config.productionTip = false | ||
new Vue({ | ||
render: h => h(App) | ||
}).$mount('#app') | ||
createApp(App).mount('#app') |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
19
32
1
1
26967
271
2
53
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@vue/compiler-core@3.5.13(transitive)
+ Added@vue/compiler-dom@3.5.13(transitive)
+ Added@vue/compiler-sfc@3.5.13(transitive)
+ Added@vue/compiler-ssr@3.5.13(transitive)
+ Added@vue/reactivity@3.5.13(transitive)
+ Added@vue/runtime-core@3.5.13(transitive)
+ Added@vue/runtime-dom@3.5.13(transitive)
+ Added@vue/server-renderer@3.5.13(transitive)
+ Added@vue/shared@3.5.13(transitive)
+ Addedentities@4.5.0(transitive)
+ Addedestree-walker@2.0.2(transitive)
+ Addedmagic-string@0.30.17(transitive)
+ Addedvue@3.5.13(transitive)
- Removed@vue/compiler-sfc@2.7.16(transitive)
- Removedprettier@2.8.8(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedvue@2.7.16(transitive)
Updatedvue@^3.2.31