New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-promise-button

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-promise-button - npm Package Compare versions

Comparing version 0.1.6 to 1.0.0-alpha.1

.browserslistrc

88

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc