├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc ├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .npmignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── _config.yml ├── config ├── .eslintrc ├── banner.js ├── build.js ├── bundle.js ├── entry.js ├── karma.base.conf.js ├── karma.cover.conf.js ├── karma.sauce.conf.js ├── karma.unit.conf.js ├── nightwatch.conf.js ├── version.js └── webpack.dev.conf.js ├── dist ├── README.md ├── vue-toastr-2.common.js ├── vue-toastr-2.esm.js ├── vue-toastr-2.js ├── vue-toastr-2.min.css └── vue-toastr-2.min.js ├── package.json ├── src ├── index.js ├── jquery.min.js └── toastr.min.js ├── test ├── .eslintrc ├── helpers │ ├── assert.js │ ├── entry.js │ └── wait-for-update.js └── unit │ ├── add.test.js │ ├── index.html │ └── index.js └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015"], 3 | "plugins": ["babel-plugin-espower"], 4 | "env": { 5 | "test": { 6 | "plugins": ["istanbul"], 7 | "presets": ["power-assert"] 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | config/*.js 2 | src/toastr.min.js 3 | src/jquery.min.js 4 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "babel-eslint", 4 | "extends": "vue" 5 | } 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 29 | 30 | 31 | ### vue & vue-toastr-2 version 32 | 2.0.x, x.y.z 33 | 34 | ### Reproduction Link 35 | 36 | 37 | ### Steps to reproduce 38 | 39 | ### What is Expected? 40 | 41 | ### What is actually happening? 42 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saivarunk/vue-toastr-2/f9f50a43d92784e4c1187be1a2d66e39f00c282f/.github/PULL_REQUEST_TEMPLATE.md -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | lib 2 | coverage 3 | dist/*.gz 4 | docs/_book 5 | test/e2e/report 6 | test/e2e/screenshots 7 | node_modules 8 | .DS_Store 9 | *.log 10 | *.swp 11 | *~ 12 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .* 2 | *.log 3 | *.swp 4 | *.yml 5 | coverage 6 | docs/_book 7 | config 8 | dist/*.map 9 | lib 10 | test 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '6' 4 | before_install: 5 | - npm install -g phantomjs 6 | deploy: 7 | provider: npm 8 | email: saivarunk@gmail.com 9 | on: 10 | tags: false 11 | repo: saivarunk/vue-toastr-2 12 | api_key: 13 | secure: dGn/LVaSW2v7omjqbCGvxBJR/ZhYmGhoutv+EXLsS0SZwvEKatr5eNWPkUR5AfkbprTHgox64HdmOv92NyTOu9MKXeThxb4LdLCZwgKEQYziAfVfBOKzFVppKu14a5ulDGLCMoEOuhDhv05hnxjGdN43MkZF/PjrFMwU9FICyLqzxytwnjGFWhBwZFy+Vi9ao3oxOfJT86exLf1iHrxfR2sCE7oKMmRjb0uakZI4zyycRmkR8n2XsgKwWgW2V/+Ns0L/guSxMzEBE5iKviP2TDyRaefXn6XT3jPlmQHVv3ycvz6Z0MUw0gm9L/bNdAQ+Xo8B/wMVl5VglCX9DR3cQdEv6rBQbu15y0zSgxf2uY+zibO45m7R80J+JKhmOjjCJvXqpl2C7bpFabtc/ily3QKZBz39Otz2452ECOH+T4um1W+XllnJfrKSs67IDk3rAJTJEOcRPoAWj8YYEdMw3vJosymv+PfTsJiEKsvDWTgxKYaRwWjUfo9PRyzJ2Af341metcKj878b+GL5nONW/x+hUNS7XxCoRLx6Bt/8bLm+lhzq30/D4IrfWoJrF1usKbEXlWY+AG1YKG+8JfQTEPwmvZAZMviNGUy3krCP3vAGDYCsDT8h/JwYZwmH8rR4mh9nrEAXWm+5VemzKsF3ykrEm2p1I+a5m80M50/mdJ0= 14 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saivarunk/vue-toastr-2/f9f50a43d92784e4c1187be1a2d66e39f00c282f/CHANGELOG.md -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # vue-toastr-2 Contributing Guide 2 | 3 | - [Issue Reporting Guidelines](#issue-reporting-guidelines) 4 | - [Pull Request Guidelines](#pull-request-guidelines) 5 | - [Development Setup](#development-setup) 6 | 7 | ## Issue Reporting Guidelines 8 | 9 | - The issue list of this repo is **exclusively** for bug reports and feature requests. Non-conforming issues will be closed immediately. 10 | 11 | - For simple beginner questions, you can get quick answers from [The Gitter chat room](https://gitter.im/vuejs/vue). 12 | 13 | - For more complicated questions, you can use [the official forum](http://forum.vuejs.org/) or StackOverflow. Make sure to provide enough information when asking your questions - this makes it easier for others to help you! 14 | 15 | - Try to search for your issue, it may have already been answered or even fixed in the development branch. 16 | 17 | - Check if the issue is reproducible with the latest stable version of Vue. If you are using a pre-release, please indicate the specific version you are using. 18 | 19 | - It is **required** that you clearly describe the steps necessary to reproduce the issue you are running into. Issues with no clear repro steps will not be triaged. If an issue labeled "need repro" receives no further input from the issue author for more than 5 days, it will be closed. 20 | 21 | - It is recommended that you make a JSFiddle/JSBin/Codepen to demonstrate your issue. You could start with [this template](http://jsfiddle.net/5sH6A/) that already includes the latest version of Vue. 22 | 23 | - For bugs that involves build setups, you can create a reproduction repository with steps in the README. 24 | 25 | - If your issue is resolved but still open, don’t hesitate to close it. In case you found a solution by yourself, it could be helpful to explain how you fixed it. 26 | 27 | ## Pull Request Guidelines 28 | 29 | - The `master` branch is basically just a snapshot of the latest stable release. All development should be done in dedicated branches. **Do not submit PRs against the `master` branch.** 30 | 31 | - Checkout a topic branch from the relevant branch, e.g. `master`, and merge back against that branch. 32 | 33 | - Work in the `src` folder and **DO NOT** checkin `dist` in the commits. 34 | 35 | - It's OK to have multiple small commits as you work on the PR - we will let GitHub automatically squash it before merging. 36 | 37 | - Make sure `npm test` passes. (see [development setup](#development-setup)) 38 | 39 | - If adding new feature: 40 | - Add accompanying test case. 41 | - Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it greenlighted before working on it. 42 | 43 | - If fixing a bug: 44 | - Provide detailed description of the bug in the PR. Live demo preferred. 45 | - Add appropriate test coverage if applicable. 46 | 47 | ### Work Step Example 48 | - Fork the repository from [saivarunk/vue-toastr-2](https://github.com/saivarunk/vue-toastr-2) ! 49 | - Create your topic branch from `master`: `git branch my-new-topic origin/master` 50 | - Add codes and pass tests ! 51 | - Commit your changes: `git commit -am 'Add some topic'` 52 | - Push to the branch: `git push origin my-new-topic` 53 | - Submit a pull request to `master` branch of `saivarunk/vue-toastr-2` repository ! 54 | 55 | ## Development Setup 56 | 57 | You will need [Node.js](http://nodejs.org). 58 | 59 | After cloning the repo, run: 60 | 61 | $ npm install 62 | 63 | ### Commonly used NPM scripts 64 | 65 | # watch and serve with hot reload unit test at localhost:8080 66 | $ npm run dev 67 | 68 | # lint source codes 69 | $ npm run lint 70 | 71 | # run unit tests in browser (firefox/safari/chrome) 72 | $ npm run test:unit 73 | 74 | # build all dist files, including npm packages 75 | $ npm run build 76 | 77 | # run the full test suite, include linting 78 | $ npm test 79 | 80 | There are some other scripts available in the `scripts` section of the `package.json` file. 81 | 82 | The default test script will do the following: lint with ESLint -> unit tests with coverage. **Please make sure to have this pass successfully before submitting a PR.** Although the same tests will be run against your PR on the CI server, it is better to have it working locally beforehand. 83 | 84 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Varun 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-toastr-2 2 | 3 | [![npm](https://img.shields.io/npm/v/vue-toastr-2.svg)](https://www.npmjs.com/package/vue-toastr-2) 4 | [![npm](https://img.shields.io/npm/dm/vue-simple-upload.svg)](https://www.npmjs.com/package/vue-toastr-2) 5 | [![vue2](https://img.shields.io/badge/vue-2.x-brightgreen.svg)](https://vuejs.org/) 6 | [![BuildStatus](https://secure.travis-ci.org/saivarunk/vue-toastr-2.png?branch=master)](https://travis-ci.org/saivarunk/vue-toastr-2) 7 | 8 | Simple toast notifications for Vue.js 9 | 10 | # Installation 11 | 12 | ### Direct Download / CDN 13 | 14 | https://unpkg.com/vue-toastr-2/dist/vue-toastr-2 15 | 16 | [unpkg.com](https://unpkg.com) provides NPM-based CDN links. The above link will always point to the latest release on NPM. You can also use a specific version/tag via URLs like https://unpkg.com/vue-toastr-2@0.0.0/dist/vue-toastr-2.js 17 | 18 | Include vue-toastr-2 after Vue and it will install itself automatically: 19 | 20 | ```html 21 | 22 | 23 | 24 | ``` 25 | 26 | ### NPM 27 | 28 | These dependencies are required to use vue-toastr-2 while using npm 29 | 30 | - jquery 31 | - toastr 32 | 33 | ``` 34 | $ npm install jquery 35 | $ npm install toastr 36 | $ npm install vue-toastr-2 37 | ``` 38 | ### Yarn 39 | 40 | ``` 41 | $ yarn add jquery 42 | $ yarn add toastr 43 | $ yarn add vue-toastr-2 44 | ``` 45 | When used with a module system, you must explicitly install the `vue-toastr-2` via `Vue.use()`: 46 | 47 | ```javascript 48 | import Vue from 'vue' 49 | import VueToastr2 from 'vue-toastr-2' 50 | import 'vue-toastr-2/dist/vue-toastr-2.min.css' 51 | 52 | window.toastr = require('toastr') 53 | 54 | Vue.use(VueToastr2) 55 | ``` 56 | 57 | You don't need to do this when using global script tags. 58 | 59 | # Usage 60 | 61 | The notifications can be triggered from the components using this.$toastr property. 62 | 63 | For documentation of options, look at [toastr](https://www.npmjs.com/package/toastr) 64 | 65 | ## Success 66 | 67 | ```javascript 68 | this.$toastr.success('Message', 'Title', options); 69 | ``` 70 | 71 | ## Error 72 | 73 | ```javascript 74 | this.$toastr.error('Message', 'Title', options); 75 | ``` 76 | 77 | ## Warning 78 | 79 | ```javascript 80 | this.$toastr.warning('Message', 'Title', options); 81 | ``` 82 | 83 | ## info 84 | 85 | ```javascript 86 | this.$toastr.info('Message', 'Title', options); 87 | ``` 88 | 89 | ### Dev Build 90 | 91 | You will have to clone directly from GitHub and build `vue-toastr-2` yourself if 92 | you want to use the latest dev build. 93 | 94 | $ git clone https://github.com/saivarunk/vue-toastr-2.git node_modules/vue-toastr-2 95 | $ cd node_modules/vue-toastr-2 96 | $ npm install 97 | $ npm run build 98 | 99 | ## :scroll: Changelog 100 | Details changes for each release are documented in the [CHANGELOG.md](https://github.com/saivarunk/vue-toastr-2/blob/master/CHANGELOG.md). 101 | 102 | 103 | ## :exclamation: Issues 104 | Please make sure to read the [Issue Reporting Checklist](https://github.com/saivarunk/vue-toastr-2/blob/master/CONTRIBUTING.md#issue-reporting-guidelines) before opening an issue. Issues not conforming to the guidelines may be closed immediately. 105 | 106 | 107 | ## :muscle: Contribution 108 | Please make sure to read the [Contributing Guide](https://github.com/saivarunk/vue-toastr-2/blob/master/CONTRIBUTING.md) before making a pull request. 109 | 110 | ## :copyright: License 111 | 112 | [MIT](http://opensource.org/licenses/MIT) 113 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-slate -------------------------------------------------------------------------------- /config/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "globals": { 3 | "process": true 4 | }, 5 | "extends": "vue", 6 | "rules": { 7 | "no-multiple-empty-lines": [2, {"max": 2}], 8 | "no-console": 0 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /config/banner.js: -------------------------------------------------------------------------------- 1 | const pack = require('../package.json') 2 | const version = process.env.VERSION || pack.version 3 | 4 | module.exports = 5 | '/*!\n' + 6 | ` * ${pack.name} v${version} \n` + 7 | ` * (c) ${new Date().getFullYear()} ${pack.author.name}\n` + 8 | ` * Released under the ${pack.license} License.\n` + 9 | ' */' 10 | -------------------------------------------------------------------------------- /config/build.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | const exist = fs.existsSync 3 | const mkdir = fs.mkdirSync 4 | const getAllEntries = require('./entry').getAllEntries 5 | const build = require('./bundle') 6 | 7 | if (!exist('dist')) { 8 | mkdir('dist') 9 | } 10 | 11 | let entries = getAllEntries() 12 | 13 | // filter entries via command line arg 14 | if (process.argv[2]) { 15 | const filters = process.argv[2].split(',') 16 | entries = entries.filter(b => { 17 | return filters.some(f => b.dest.indexOf(f) > -1) 18 | }) 19 | } 20 | 21 | build(entries) 22 | -------------------------------------------------------------------------------- /config/bundle.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | const readFile = fs.readFile 3 | const writeFile = fs.writeFile 4 | const relative = require('path').relative 5 | const gzip = require('zlib').gzip 6 | const rollup = require('rollup') 7 | const uglify = require('uglify-js') 8 | 9 | module.exports = build 10 | 11 | function build(entries) { 12 | let built = 0 13 | const total = entries.length 14 | const next = () => { 15 | buildEntry(entries[built]).then(() => { 16 | built++ 17 | if (built < total) { 18 | next() 19 | } 20 | }).catch(logError) 21 | } 22 | next() 23 | } 24 | 25 | function buildEntry(config) { 26 | const isProd = /min\.js$/.test(config.dest) 27 | return rollup.rollup(config).then(bundle => { 28 | const code = bundle.generate(config).code 29 | if (isProd) { 30 | var minified = (config.banner ? config.banner + '\n' : '') + uglify.minify(code, { 31 | fromString: true, 32 | output: { 33 | screw_ie8: true, 34 | ascii_only: true 35 | }, 36 | compress: { 37 | pure_funcs: ['makeMap'] 38 | } 39 | }).code 40 | return write(config.dest, minified).then(zip(config.dest)) 41 | } else { 42 | return write(config.dest, code) 43 | } 44 | }) 45 | } 46 | 47 | function write(dest, code) { 48 | return new Promise(function(resolve, reject) { 49 | writeFile(dest, code, function(err) { 50 | if (err) { 51 | return reject(err) 52 | } 53 | console.log(blue(relative(process.cwd(), dest)) + ' ' + getSize(code)) 54 | resolve() 55 | }) 56 | }) 57 | } 58 | 59 | function zip(file) { 60 | return function() { 61 | return new Promise(function(resolve, reject) { 62 | readFile(file, function(err, buf) { 63 | if (err) { 64 | return reject(err) 65 | } 66 | gzip(buf, function(err, buf) { 67 | if (err) { 68 | return reject(err) 69 | } 70 | write(file + '.gz', buf).then(resolve) 71 | }) 72 | }) 73 | }) 74 | } 75 | } 76 | 77 | function getSize(code) { 78 | return (code.length / 1024).toFixed(2) + 'kb' 79 | } 80 | 81 | function logError(e) { 82 | console.log(e) 83 | } 84 | 85 | function blue(str) { 86 | return '\x1b[1m\x1b[34m' + str + '\x1b[39m\x1b[22m' 87 | } 88 | -------------------------------------------------------------------------------- /config/entry.js: -------------------------------------------------------------------------------- 1 | const replace = require('rollup-plugin-replace') 2 | const buble = require('rollup-plugin-buble') 3 | const banner = require('./banner') 4 | const pack = require('../package.json') 5 | const resolve = require('rollup-plugin-node-resolve') 6 | 7 | function toUpper(_, c) { 8 | return c ? c.toUpperCase() : '' 9 | } 10 | 11 | const classifyRE = /(?:^|[-_\/])(\w)/g 12 | 13 | function classify(str) { 14 | return str.replace(classifyRE, toUpper) 15 | } 16 | const moduleName = classify(pack.name) 17 | 18 | const entries = { 19 | commonjs: { 20 | entry: 'src/index.js', 21 | plugins: [ resolve({ 22 | module: true, 23 | browser: true 24 | }) ], 25 | dest: `dist/${pack.name}.common.js`, 26 | format: 'cjs', 27 | banner 28 | }, 29 | esm: { 30 | entry: 'src/index.js', 31 | plugins: [ resolve({ 32 | module: true, 33 | browser: true 34 | }) ], 35 | dest: `dist/${pack.name}.esm.js`, 36 | format: 'es', 37 | banner 38 | }, 39 | production: { 40 | entry: 'src/index.js', 41 | plugins: [ resolve({ 42 | module: true, 43 | browser: true 44 | }) ], 45 | dest: `dist/${pack.name}.min.js`, 46 | format: 'umd', 47 | env: 'production', 48 | moduleName, 49 | banner 50 | }, 51 | development: { 52 | entry: 'src/index.js', 53 | plugins: [ resolve({ 54 | module: true, 55 | browser: true 56 | })], 57 | dest: `dist/${pack.name}.js`, 58 | format: 'umd', 59 | env: 'development', 60 | moduleName, 61 | banner 62 | } 63 | } 64 | 65 | function genConfig(opts) { 66 | const config = { 67 | entry: opts.entry, 68 | dest: opts.dest, 69 | format: opts.format, 70 | banner: opts.banner, 71 | moduleName, 72 | plugins: [ 73 | buble() 74 | ] 75 | } 76 | 77 | const replacePluginOptions = { 78 | '__VERSION__': pack.version 79 | } 80 | if (opts.env) { 81 | replacePluginOptions['process.env.NODE_ENV'] = JSON.stringify(opts.env) 82 | } 83 | config.plugins.push(replace(replacePluginOptions)) 84 | 85 | return config 86 | } 87 | 88 | exports.getEntry = name => genConfig(entries[name]) 89 | exports.getAllEntries = () => Object.keys(entries).map(name => genConfig(entries[name])) 90 | -------------------------------------------------------------------------------- /config/karma.base.conf.js: -------------------------------------------------------------------------------- 1 | const webpack = require('webpack') 2 | 3 | const webpackConfig = { 4 | module: { 5 | loaders: [{ 6 | test: /\.js$/, 7 | exclude: /node_modules|vue\/dist/, 8 | loader: 'babel-loader' 9 | }] 10 | }, 11 | plugins: [ 12 | new webpack.DefinePlugin({ 13 | 'process.env': { 14 | NODE_ENV: '"development"' 15 | } 16 | }) 17 | ], 18 | devtool: '#inline-source-map' 19 | } 20 | 21 | module.exports = { 22 | basePath: '', 23 | files: [ 24 | '../test/unit/index.js' 25 | ], 26 | exclude: [ 27 | ], 28 | frameworks: ['mocha', 'phantomjs-shim'], 29 | preprocessors: { 30 | '../test/unit/index.js': ['webpack', 'sourcemap'] 31 | }, 32 | webpack: webpackConfig, 33 | webpackMiddleware: { 34 | noInfo: true 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /config/karma.cover.conf.js: -------------------------------------------------------------------------------- 1 | const base = require('./karma.base.conf') 2 | 3 | module.exports = config => { 4 | const options = Object.assign(base, { 5 | browsers: ['PhantomJS'], 6 | reporters: ['mocha', 'coverage'], 7 | coverageReporter: { 8 | reporters: [ 9 | { type: 'lcov', dir: '../coverage', subdir: '.' }, 10 | { type: 'text-summary', dir: '../coverage', subdir: '.' } 11 | ] 12 | }, 13 | singleRun: true 14 | }) 15 | 16 | config.set(options) 17 | } 18 | -------------------------------------------------------------------------------- /config/karma.sauce.conf.js: -------------------------------------------------------------------------------- 1 | const base = require('./karma.base.conf') 2 | const pack = require('../package.json') 3 | 4 | /** 5 | * Having too many tests running concurrently on saucelabs 6 | * causes timeouts and errors, so we have to run them in 7 | * smaller batches. 8 | */ 9 | 10 | const batches = [ 11 | // the coolkids 12 | { 13 | sl_chrome: { 14 | base: 'SauceLabs', 15 | browserName: 'chrome', 16 | platform: 'Windows 7' 17 | }, 18 | sl_firefox: { 19 | base: 'SauceLabs', 20 | browserName: 'firefox' 21 | }, 22 | sl_mac_safari: { 23 | base: 'SauceLabs', 24 | browserName: 'safari', 25 | platform: 'OS X 10.10' 26 | } 27 | }, 28 | // ie family 29 | { 30 | sl_ie_9: { 31 | base: 'SauceLabs', 32 | browserName: 'internet explorer', 33 | platform: 'Windows 7', 34 | version: '9' 35 | }, 36 | sl_ie_10: { 37 | base: 'SauceLabs', 38 | browserName: 'internet explorer', 39 | platform: 'Windows 8', 40 | version: '10' 41 | }, 42 | sl_ie_11: { 43 | base: 'SauceLabs', 44 | browserName: 'internet explorer', 45 | platform: 'Windows 8.1', 46 | version: '11' 47 | }, 48 | sl_edge: { 49 | base: 'SauceLabs', 50 | platform: 'Windows 10', 51 | browserName: 'MicrosoftEdge' 52 | } 53 | }, 54 | // mobile 55 | { 56 | sl_ios_safari_8: { 57 | base: 'SauceLabs', 58 | browserName: 'iphone', 59 | version: '8.4' 60 | }, 61 | sl_ios_safari_9: { 62 | base: 'SauceLabs', 63 | browserName: 'iphone', 64 | version: '9.3' 65 | }, 66 | sl_android_4_2: { 67 | base: 'SauceLabs', 68 | browserName: 'android', 69 | version: '4.2' 70 | }, 71 | sl_android_5_1: { 72 | base: 'SauceLabs', 73 | browserName: 'android', 74 | version: '5.1' 75 | } 76 | } 77 | ] 78 | 79 | module.exports = config => { 80 | const batch = batches[process.argv[5] || 0] 81 | 82 | config.set(Object.assign(base, { 83 | singleRun: true, 84 | browsers: Object.keys(batch), 85 | customLaunchers: batch, 86 | reporters: process.env.CI 87 | ? ['dots', 'saucelabs'] // avoid spamming CI output 88 | : ['progress', 'saucelabs'], 89 | sauceLabs: { 90 | testName: `${pack.name} unit tests`, 91 | recordScreenshots: false, 92 | build: process.env.CIRCLE_BUILD_NUM || process.env.SAUCE_BUILD_ID || Date.now() 93 | }, 94 | captureTimeout: 300000, 95 | browserNoActivityTimeout: 300000 96 | })) 97 | } 98 | -------------------------------------------------------------------------------- /config/karma.unit.conf.js: -------------------------------------------------------------------------------- 1 | const base = require('./karma.base.conf') 2 | 3 | module.exports = config => { 4 | config.set(Object.assign(base, { 5 | reporters: ['progress'], 6 | browsers: ['Chrome', 'Firefox', 'Safari'], 7 | singleRun: true 8 | })) 9 | } 10 | -------------------------------------------------------------------------------- /config/nightwatch.conf.js: -------------------------------------------------------------------------------- 1 | // http://nightwatchjs.org/guide#settings-file 2 | module.exports = { 3 | src_folders: ['test/e2e/test'], 4 | output_folder: 'test/e2e/report', 5 | custom_commands_path: ['node_modules/nightwatch-helpers/commands'], 6 | custom_assertions_path: ['node_modules/nightwatch-helpers/assertions'], 7 | 8 | selenium: { 9 | start_process: true, 10 | server_path: 'node_modules/selenium-server/lib/runner/selenium-server-standalone-2.53.1.jar', 11 | host: '127.0.0.1', 12 | port: 4444, 13 | cli_args: { 14 | 'webdriver.chrome.driver': require('chromedriver').path 15 | } 16 | }, 17 | 18 | test_settings: { 19 | default: { 20 | selenium_port: 4444, 21 | selenium_host: 'localhost', 22 | silent: true, 23 | screenshots: { 24 | enabled: true, 25 | on_failure: true, 26 | on_error: false, 27 | path: 'test/e2e/screenshots' 28 | } 29 | }, 30 | 31 | chrome: { 32 | desiredCapabilities: { 33 | browserName: 'chrome', 34 | javascriptEnabled: true, 35 | acceptSslCerts: true 36 | } 37 | }, 38 | 39 | firefox: { 40 | desiredCapabilities: { 41 | browserName: 'firefox', 42 | javascriptEnabled: true, 43 | acceptSslCerts: true 44 | } 45 | }, 46 | 47 | phantomjs: { 48 | desiredCapabilities: { 49 | browserName: 'phantomjs', 50 | javascriptEnabled: true, 51 | acceptSslCerts: true 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /config/version.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | const pack = require('../package.json') 3 | 4 | // update installation.md 5 | const installation = fs 6 | .readFileSync('./gitbook/installation.md', 'utf-8') 7 | .replace( 8 | /https:\/\/unpkg\.com\/vue-toastr-2@[\d.]+.[\d]+\/dist\/vue-toastr-2\.js/, 9 | 'https://unpkg.com/vue-toastr-2@' + pack.version + '/dist/vue-toastr-2.js.' 10 | ) 11 | fs.writeFileSync('./gitbook/installation.md', installation) 12 | -------------------------------------------------------------------------------- /config/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const webpack = require('webpack') 3 | 4 | module.exports = { 5 | entry: 'mocha-loader!./test/unit/index.js', 6 | output: { 7 | path: path.resolve(__dirname, '/test/unit'), 8 | filename: 'tests.js', 9 | publicPath: '/' 10 | }, 11 | module: { 12 | rules: [{ 13 | test: /\.js$/, 14 | exclude: /node_modules|vue\/dist/, 15 | loader: 'babel-loader' 16 | }] 17 | }, 18 | plugins: [ 19 | new webpack.DefinePlugin({ 20 | 'process.env': { 21 | NODE_ENV: '"development"' 22 | } 23 | }) 24 | ], 25 | devtool: '#eval-source-map' 26 | } 27 | -------------------------------------------------------------------------------- /dist/README.md: -------------------------------------------------------------------------------- 1 | ## Explanation of Build Files 2 | 3 | - UMD: vue-toastr-2.js 4 | - CommonJS: vue-toastr-2.common.js 5 | - ES Module: vue-toastr-2.esm.js 6 | 7 | ### Terms 8 | 9 | - **[UMD](https://github.com/umdjs/umd)**: UMD builds can be used directly in the browser via a ` 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/unit/index.js: -------------------------------------------------------------------------------- 1 | // import all helpers 2 | const helpersContext = require.context('../helpers', true) 3 | helpersContext.keys().forEach(helpersContext) 4 | 5 | // require all test files 6 | const testsContext = require.context('./', true, /\.test/) 7 | testsContext.keys().forEach(testsContext) 8 | --------------------------------------------------------------------------------