From 5a77e3651898736e2562248a1fb19f3e567cdd04 Mon Sep 17 00:00:00 2001 From: "sasi.rv" Date: Wed, 28 Jul 2021 21:34:54 +0530 Subject: [PATCH] changes to publish in npm --- .github/README.md | 20 ++++++++++++++++++++ .github/workflows/npm-publish.yml | 22 ++++++++++++++++++++++ .gitignore | 2 +- .npmignore | 6 ++++++ README.md | 23 ++++++++++++++++------- docs/get-started.md | 23 +++++++++++++++++++++-- package-lock.json | 20 +++++++++++++++++--- package.json | 17 ++++++++++++++--- src/virtual-select.js | 2 +- webpack.config.js | 5 ++--- 10 files changed, 120 insertions(+), 20 deletions(-) create mode 100644 .github/README.md create mode 100644 .github/workflows/npm-publish.yml create mode 100644 .npmignore diff --git a/.github/README.md b/.github/README.md new file mode 100644 index 0000000..6de8c37 --- /dev/null +++ b/.github/README.md @@ -0,0 +1,20 @@ +# Virtual Select 1.0 + +> A javascript plugin for dropdown with virtual scroll + +- Simple and lightweight +- Support more than 100000 dropdown options +- Support multi-select +- Support search feature + +[Documentation](https://sa-si-dev.github.io/virtual-select) + +[Changelog](https://github.com/sa-si-dev/virtual-select/releases) + +## Commands + +| Command | Description | +|---------|-------------| +| npm run start | Builds dist versions of the plugin on file change | +| npm run build | Builds dist versions of the plugin | +| npm run docs | Starts a local documentation server | diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..21b6145 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,22 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages + +name: Node.js Package + +on: + release: + types: [created] + +jobs: + publish-npm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 14 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} diff --git a/.gitignore b/.gitignore index a5c704c..701f281 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ .vscode .DS_Store -node_modules \ No newline at end of file +node_modules diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..1c3d299 --- /dev/null +++ b/.npmignore @@ -0,0 +1,6 @@ +.vscode +.DS_Store +node_modules + +.github +docs diff --git a/README.md b/README.md index 6de8c37..669b854 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Virtual Select 1.0 +# Virtual Select Plugin > A javascript plugin for dropdown with virtual scroll @@ -11,10 +11,19 @@ [Changelog](https://github.com/sa-si-dev/virtual-select/releases) -## Commands +## Install -| Command | Description | -|---------|-------------| -| npm run start | Builds dist versions of the plugin on file change | -| npm run build | Builds dist versions of the plugin | -| npm run docs | Starts a local documentation server | +```shell +npm install --save virtual-select-plugin +``` + +## Import files + +```html + + + + + + +``` diff --git a/docs/get-started.md b/docs/get-started.md index 99f8750..c8107a5 100644 --- a/docs/get-started.md +++ b/docs/get-started.md @@ -20,9 +20,9 @@ OR from below direct links [virtual-select.min.js](https://raw.githubusercontent.com/{{repo}}/master/dist/virtual-select.min.js) -[tooltip.min.css](https://raw.githubusercontent.com/{{repo}}/master/dist/tooltip.min.css) +[tooltip.min.css](https://raw.githubusercontent.com/sa-si-dev/tooltip/master/dist/tooltip.min.css) -[tooltip.min.js](https://raw.githubusercontent.com/{{repo}}/master/dist/tooltip.min.js) +[tooltip.min.js](https://raw.githubusercontent.com/sa-si-dev/tooltip/master/dist/tooltip.min.js) ## Import files @@ -45,6 +45,25 @@ Tooltip would be used to show selected values and options text, if text is long If you want to use tooltip plug-in in your project, refer [Tooltip Documentation](https://sa-si-dev.github.io/tooltip) +## Install from NPM + +We could install this plugin from NPM and use it + +```shell +npm install --save virtual-select-plugin +``` + +## Import files from node_modules + +```html + + + + + + +``` + ## Initiatize plugin ```html diff --git a/package-lock.json b/package-lock.json index a04d9e0..d0790bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,16 @@ { - "name": "virtual-select", - "version": "1.0.0", + "name": "virtual-select-plugin", + "version": "1.0.13", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "1.0.0", + "name": "virtual-select-plugin", + "version": "1.0.13", "license": "ISC", + "dependencies": { + "tooltip-plugin": "^1.0.14" + }, "devDependencies": { "@babel/core": "^7.14.0", "@babel/preset-env": "^7.14.0", @@ -9012,6 +9016,11 @@ "node": ">=0.6" } }, + "node_modules/tooltip-plugin": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/tooltip-plugin/-/tooltip-plugin-1.0.14.tgz", + "integrity": "sha512-Ldb0a3CLWl2dpjVljYOoRWsSJr0JikX+1bl5q8yVBSkHMT/jckxyxxKHE6FIJgEhZXQtbvEtlzYo73LNRCEZyA==" + }, "node_modules/tough-cookie": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", @@ -17144,6 +17153,11 @@ "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true }, + "tooltip-plugin": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/tooltip-plugin/-/tooltip-plugin-1.0.14.tgz", + "integrity": "sha512-Ldb0a3CLWl2dpjVljYOoRWsSJr0JikX+1bl5q8yVBSkHMT/jckxyxxKHE6FIJgEhZXQtbvEtlzYo73LNRCEZyA==" + }, "tough-cookie": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", diff --git a/package.json b/package.json index f5fa4e3..5a8f34f 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,25 @@ { - "name": "virtual-select", - "version": "1.0.0", + "name": "virtual-select-plugin", + "version": "1.0.13", "description": "A javascript plugin for dropdown with virtual scroll", "scripts": { "start": "webpack --mode development --watch", "build": "webpack --mode production", "docs": "docsify serve docs" }, - "author": "", + "author": "Sa Si Dev", + "keywords": [ + "javascript", + "plugin", + "select", + "dropdown", + "virtual select", + "virtual scroll" + ], "license": "ISC", + "dependencies": { + "tooltip-plugin": "^1.0.14" + }, "devDependencies": { "@babel/core": "^7.14.0", "@babel/preset-env": "^7.14.0", diff --git a/src/virtual-select.js b/src/virtual-select.js index 0620ecb..9c99682 100755 --- a/src/virtual-select.js +++ b/src/virtual-select.js @@ -1,6 +1,6 @@ import { Utils, DomUtils } from './utils'; -const virtualSelectVersion = 'v1.0.12'; +const virtualSelectVersion = 'v1.0.13'; const dropboxCloseButtonFullHeight = 48; const searchHeight = 40; diff --git a/webpack.config.js b/webpack.config.js index b33e2af..ca58450 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,7 +4,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const TerserPlugin = require('terser-webpack-plugin'); const FileManagerPlugin = require('filemanager-webpack-plugin'); -const banner = `Virtual Select v1.0.12 +const banner = `Virtual Select v1.0.13 https://sa-si-dev.github.io/virtual-select Licensed under MIT (https://github.com/sa-si-dev/virtual-select/blob/master/LICENSE)`; @@ -37,8 +37,7 @@ module.exports = (env, options) => { onEnd: { delete: ['dist/styles.min.js'], copy: [ - { source: 'static', destination: 'dist' }, - { source: 'static', destination: 'docs/assets' }, + { source: 'node_modules/tooltip-plugin/dist', destination: 'docs/assets' }, { source: 'dist', destination: 'docs/assets' }, ], },