diff --git a/.storybook/config.js b/.storybook/config.js deleted file mode 100644 index 6a25335..0000000 --- a/.storybook/config.js +++ /dev/null @@ -1,8 +0,0 @@ -import { configure, setAddon } from '@storybook/vue' -import Vue from 'vue' - -function loadStories() { - require('../stories/stories.js') -} - -configure(loadStories, module) diff --git a/.storybook/main.js b/.storybook/main.js new file mode 100644 index 0000000..77dbd47 --- /dev/null +++ b/.storybook/main.js @@ -0,0 +1,4 @@ +module.exports = { + stories: ['../stories/stories.js'], + logLevel: 'debug', +} diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js index 44bfe9d..dc29f4f 100644 --- a/.storybook/webpack.config.js +++ b/.storybook/webpack.config.js @@ -1,36 +1,36 @@ const path = require('path'); -module.exports = async ({ config }) => { - // Overwrite the default storybook webpack config for same tests loaders are applied serially - config.module.rules = [ - { - test: /\.vue$/, - loader: 'vue-loader' - }, - { - test: /\.js$/, - loader: 'babel-loader', - exclude: /node_modules/ - }, - { - test: /\.(scss|css)$/, - use: ['vue-style-loader', 'css-loader', { - loader: 'sass-loader', - options: { - data: '$sass-env: development;' +module.exports = async ({config}) => { + // Overwrite the default storybook webpack config for same tests loaders are applied serially + config.module.rules = [ + { + test: /\.vue$/, + loader: 'vue-loader' + }, + { + test: /\.js$/, + loader: 'babel-loader', + exclude: /node_modules/ + }, + { + test: /\.(scss|css)$/, + use: ['style-loader', 'css-loader', { + loader: 'sass-loader', + options: { + additionalData: '$sass-env: development;' + } + }], + include: path.resolve(__dirname, '../') + }, + { + test: /\.pug$/, + loader: 'pug-plain-loader' + }, + { + test: /\.(png|jpg|gif)$/, + use: ['file-loader'] } - }], - include: path.resolve(__dirname, '../') - }, - { - test: /\.pug$/, - loader: 'pug-plain-loader' - }, - { - test: /\.(png|jpg|gif)$/, - use: ['file-loader'] - } - ]; + ]; - return config; -} \ No newline at end of file + return config; +} diff --git a/babel.config.js b/babel.config.js index fa4dd17..4d3dc61 100644 --- a/babel.config.js +++ b/babel.config.js @@ -2,8 +2,11 @@ module.exports = function (api) { if (api.env('test')) { return { presets: [ - ['@babel/preset-env', {targets: {node: 'current'}}] - ] + [ + '@babel/preset-env', + ], + ], + plugins: ['@babel/plugin-transform-runtime'], } } diff --git a/build/rollup.config.js b/build/rollup.config.js index a898374..b330765 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -15,7 +15,7 @@ module.exports = { input: 'src/main.js', output: [ { file: 'dist/eagle.cjs.js', format: 'cjs', banner, exports: 'named' }, - { file: 'dist/eagle.es.js', format: 'es', banner } + { file: 'dist/eagle.es.js', format: 'es', banner } ], external: [ 'vue', diff --git a/jest.config.js b/jest.config.js index 68e4fc8..c642d09 100644 --- a/jest.config.js +++ b/jest.config.js @@ -4,11 +4,14 @@ module.exports = { '@/([^\\.]*)$': '/src/$1' }, moduleFileExtensions: [ - 'js', - 'vue' + "js", + // tell Jest to handle `*.vue` files + "vue" ], transform: { - '^.+\\.js$': '/node_modules/babel-jest', - '.*\\.(vue)$': '/node_modules/vue-jest' - } + // process `*.js` files with `babel-jest` + ".*\\.(js)$": "babel-jest", + // process `*.vue` files with `vue-jest` + ".*\\.(vue)$": "vue-jest" + }, } diff --git a/package.json b/package.json index 31a3823..c6ad731 100644 --- a/package.json +++ b/package.json @@ -26,44 +26,44 @@ "storybook": "start-storybook -p 9001 -c .storybook", "format": "prettier --write src/themes/**/*.scss src/themes/*.scss", "lint": "eslint --ext vue,js --format node_modules/eslint-friendly-formatter src test", - "test": "jest --bail", + "test": "jest", "test:watch": "jest --watch" }, "dependencies": { "lodash.throttle": "^4.1.1" }, "devDependencies": { - "@babel/core": "^7.4.5", + "@babel/core": "^7.12.3", "@babel/plugin-transform-runtime": "^7.4.4", "@babel/preset-env": "^7.4.5", - "@storybook/vue": "^5.1.1", - "@vue/test-utils": "^1.0.0-beta.29", - "animate.css": "^3.7.0", - "babel-eslint": "^7.1.1", - "babel-jest": "^24.8.0", - "babel-loader": "^8.0.6", + "@storybook/vue": "^6.0.27", + "@vue/test-utils": "^1.1.0", + "animate.css": "^4.1.1", + "babel-eslint": "^10.1.0", + "babel-jest": "^26.6.1", + "babel-loader": "^8.1.0", "babel-preset-vue": "^2.0.2", - "css-loader": "^1.0.0", - "eslint": "^3.14.1", - "eslint-config-standard": "^6.2.1", - "eslint-friendly-formatter": "^2.0.7", - "eslint-plugin-html": "^2.0.3", - "eslint-plugin-promise": "^3.4.0", - "eslint-plugin-standard": "^2.0.1", - "file-loader": "^2.0.0", - "jest": "^24.8.0", + "css-loader": "^5.0.0", + "eslint": "^7.11.0", + "eslint-config-standard": "^15.0.0", + "eslint-friendly-formatter": "^4.0.1", + "eslint-plugin-html": "^6.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.2", + "file-loader": "^6.1.1", + "jest": "^26.6.1", "node-sass": "^4.12.0", - "prettier": "^1.15.1", - "pug": "^2.0.3", + "prettier": "^2.1.2", + "pug": "^3.0.0", "pug-plain-loader": "^1.0.0", - "rollup": "^1.14.3", + "rollup": "^2.32.1", "rollup-plugin-babel": "^4.3.2", "rollup-plugin-commonjs": "^10.0.0", "rollup-plugin-vue": "^5.0.0", - "sass-loader": "^7.1.0", - "shelljs": "^0.7.6", + "sass-loader": "^10.0.4", + "shelljs": "^0.8.4", "vue": "^2.6.10", - "vue-jest": "^4.0.0-beta.2", + "vue-jest": "^3.0.7", "vue-loader": "^15.7.0", "vue-template-compiler": "^2.6.10" }, diff --git a/src/components/AnimatedTransition.vue b/src/components/AnimatedTransition.vue index 4ddb4f7..66d9d74 100644 --- a/src/components/AnimatedTransition.vue +++ b/src/components/AnimatedTransition.vue @@ -1,6 +1,6 @@