Permalink
Browse files

feat: use babel

  • Loading branch information...
pi0 committed Sep 21, 2017
1 parent 42dfcf3 commit 5e653e6c9d4f3386514ae9bfa7ef16b84c9a80ce
Showing with 117 additions and 127 deletions.
  1. +0 −17 .babelrc
  2. +15 −0 build/build
  3. +2 −5 build/rollup.config.js
  4. +26 −0 lib/.babelrc
  5. +0 −35 lib/extra.js
  6. +20 −20 package.json
  7. +7 −0 tests/.babelrc
  8. +18 −1 tests/components/col.spec.js
  9. +2 −3 tests/components/dropdown.spec.js
  10. +1 −1 tests/helpers.js
  11. +26 −45 yarn.lock

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -e
rm -f dist/*
rollup -c build/rollup.config.js
uglify=`pwd`/node_modules/.bin/uglifyjs
cd dist
for f in *.js; do
o=`echo $f | sed s/\.js/.min.js/`
echo "$f ~> $o"
$uglify $f --source-map -o $o
done
@@ -1,11 +1,9 @@
const fs = require("fs");
const path = require("path");
const vue = require("rollup-plugin-vue");
const buble = require("rollup-plugin-buble");
const babel = require("rollup-plugin-babel");
const resolve = require("rollup-plugin-node-resolve");
const commonjs = require("rollup-plugin-commonjs");
const uglify = require("rollup-plugin-uglify");
const { minify } = require("uglify-es");
const CleanCSS = require("clean-css");
const { camelCase } = require("lodash");
const { name, dependencies } = require("../package.json");
@@ -37,8 +35,7 @@ module.exports = {
}),
resolve({ external: ["vue"] }),
commonjs(),
buble({ objectAssign: "Object.assign" }),
uglify({}, minify)
babel()
],
output: [
{
@@ -0,0 +1,26 @@
{
"presets": [
[
"env",
{
"targets": {
"browsers": [
"last 4 versions",
"safari >= 7"
]
},
"modules": false
}
]
],
"plugins": [
"external-helpers"
],
"env": {
"test": {
"plugins": [
"istanbul"
]
}
}
}

This file was deleted.

Oops, something went wrong.
@@ -47,18 +47,14 @@
"dist"
],
"scripts": {
"build": "npm run build:core && npm run build:extra",
"build:core": "rollup -c build/rollup.config.js",
"build:extra": "rollup -c build/rollup.extra.config.js",
"watch": "npm run watch:core",
"watch:core": "rollup -c build/rollup.config.js --watch",
"watch:extra": "rollup -c build/rollup.extra.config.js --watch",
"build": "build/build",
"watch": "rollup -c build/rollup.config.js --watch",
"docs-dev": "nuxt dev",
"docs-gen": "nuxt generate",
"docs-publish": "./build/gh-pages",
"test": "jest --maxWorkers=2",
"test-dev": "jest",
"prepublish": "npm run build && npm run test",
"test": "NODE_ENV=test npm run build && jest --maxWorkers=2",
"test-dev": "NODE_ENV=test npm run build && jest",
"prepublish": "npm run test && npm run build",
"postpublish": "npm run docs-publish",
"release": "standard-version"
},
@@ -70,11 +66,13 @@
},
"devDependencies": {
"@nuxtjs/pwa": "^0.2.1",
"clean-css": "^4.1.8",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-istanbul": "^4.1.5",
"clean-css": "^4.1.9",
"codecov": "^2.3.0",
"codemirror": "^5.29.0",
"codemirror": "^5.30.0",
"cross-env": "^5.0.5",
"eslint": "^4.7.0",
"eslint": "^4.7.1",
"eslint-plugin-html": "^3.2.2",
"eslint-plugin-vue": "^2.1.0",
"eslint-plugin-vue-libs": "^1.2.1",
@@ -84,20 +82,19 @@
"jest": "^21.1.0",
"jest-vue-preprocessor": "^1.1.0",
"lodash": "latest",
"lodash.startcase": "^4.4.0",
"markdown-loader": "^2.0.1",
"marked": "^0.3.6",
"nuxt": "1.0.0-rc11",
"popper.js": "^1.12.5",
"rollup": "^0.50.0",
"rollup-plugin-buble": "^0.15.0",
"rollup-plugin-babel": "^3.0.2",
"rollup-plugin-commonjs": "^8.2.1",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-uglify": "^2.0.1",
"rollup-plugin-vue": "^2.4.2",
"rollup-watch": "^4.3.1",
"standard-version": "^4.2.0",
"uglify-es": "^3.1.1",
"lodash.startcase": "^4.4.0",
"popper.js": "^1.12.5",
"vue-functional-data-merge": "^1.0.6"
},
"jest": {
@@ -107,11 +104,14 @@
"vue"
],
"transform": {
"^.+\\.js$": "<rootDir>/node_modules/babel-jest",
".*\\.(vue)$": "<rootDir>/node_modules/jest-vue-preprocessor"
"^.+\\.js$": "babel-jest",
".*\\.(vue)$": "jest-vue-preprocessor"
},
"coverageDirectory": "./coverage/",
"collectCoverage": true
"collectCoverage": true,
"collectCoverageFrom": [
"lib"
]
},
"keywords": [
"Bootstrap",
@@ -161,4 +161,4 @@
"Tag",
"Tooltip"
]
}
}
@@ -0,0 +1,7 @@
{
"presets": [
["env", {
"modules": "umd"
}]
]
}
@@ -1,5 +1,22 @@
import { loadFixture, testVM } from "../helpers";
import { computeBkPtClass } from "../../lib/components/col";
// TODO: Export function from col.js
function computeBkPtClass(type, breakpoint, val) {
let className = type;
if (val === false || val === null || val === undefined) {
return undefined;
}
if (breakpoint) {
className += `-${breakpoint}`;
}
if (type === "col" && (val === "" || val === true)) {
// .col-md
return className.toLowerCase();
}
// .order-md-6
className += `-${val}`;
return className.toLowerCase();
}
describe("col", async () => {
beforeEach(loadFixture("col"));
@@ -1,13 +1,12 @@
import { loadFixture, testVM, nextTick } from "../helpers";
import { keys } from "../../lib/utils/object";
describe("dropdown", async () => {
beforeEach(loadFixture("dropdown"));
testVM();
it("should work", async () => {
const { app: { $refs } } = window;
const dds = keys($refs).map(ref => $refs[ref]);
const dds = Object.keys($refs).map(ref => $refs[ref]);
dds.forEach(dd => {
expect(dd._isVue).toBe(true);
@@ -24,7 +23,7 @@ describe("dropdown", async () => {
it("should open only one dropdown at a time", async () => {
const { app: { $refs } } = window;
const dds = keys($refs).map(ref => $refs[ref].$el);
const dds = Object.keys($refs).map(ref => $refs[ref].$el);
// Without async iterators, just use a for loop.
for (let i = 0; i < dds.length; i++) {
@@ -1,7 +1,7 @@
import { readFileSync } from "fs";
import { resolve } from "path";
import Vue from "vue/dist/vue.common";
import BootstrapVue from "../lib";
import BootstrapVue from "..";
const readFile = path => String(readFileSync(resolve(__dirname, "fixtures", path)));
Oops, something went wrong.

0 comments on commit 5e653e6

Please sign in to comment.