Remove ES5 compilation for libraries. Remove Node-based Jasmine tests. Tests run in Chromium headless mode.

(I got tired of Babel breaking every time I switched computers.)
This commit is contained in:
Timothy Farrell 2018-03-24 06:00:50 -05:00
parent 9a9bbadacd
commit 463df71e77
6 changed files with 7 additions and 60 deletions

View File

@ -1,38 +1,16 @@
{
"name": "router",
"version": "2.0.0",
"version": "2.1.0",
"description": "A slim and unopinionated router",
"main": "lib/index.js",
"jsnext:main": "src/index.js",
"files": ["dist", "lib", "src"],
"main": "src/index.js",
"files": ["src"],
"scripts": {
"lint": "eslint src",
"clean": "rimraf dist lib",
"build:lib": "NODE_ENV=production babel src --presets=\"stage-0,es2015\" --out-dir lib",
"build:umd": "npm run build:lib && NODE_ENV=production rollup -c",
"build:umd:min":
"npm run build:umd && uglifyjs -m --screw-ie8 -c -o dist/router.min.js dist/router.js",
"build:umd:gzip": "npm run build:umd:min && gzip -c9 dist/router.min.js > dist/router.min.js.gz",
"build": "npm run build:umd:gzip && ls -l dist/",
"prepublish": "npm run clean && npm run build",
"test": "npm run build:lib && jasmine --verbose"
"test": "node ../../bin/runTests.js ./"
},
"keywords": ["router"],
"author": "Timothy Farrell <tim@thecookiejar.me> (https://github.com/explorigin)",
"license": "Apache-2.0",
"devDependencies": {
"babel-cli": "6.18.0",
"babel-core": "6.21.0",
"babel-preset-es2015": "6.18.0",
"babel-preset-es2015-rollup": "3.0.0",
"babel-preset-stage-0": "6.16.0",
"jasmine": "^2.5.3",
"rimraf": "2.5.4",
"rollup-plugin-json": "2.1.0",
"rollup-plugin-babel": "^2.7.1",
"uglifyjs": "2.4.10"
},
"dependencies": {
"trimkit": "^1.0.2"
"trimkit": "^1.1.0"
}
}

View File

@ -1,21 +0,0 @@
import json from 'rollup-plugin-json';
import babel from 'rollup-plugin-babel';
const babelConfig = {
env: {
es6: true,
browser: true
},
plugins: [],
presets: ['stage-0', 'es2015-rollup']
};
export default {
entry: 'src/index.js',
moduleName: 'Router',
plugins: [json(), babel(babelConfig)],
output: {
format: 'umd',
file: 'dist/router.js'
}
};

View File

@ -1,3 +0,0 @@
self = window = {
location: {}
};

View File

@ -1,4 +1,4 @@
const { Router } = require('../lib/index.js');
import { Router } from '../src/index.js';
describe('router.href builds urls', () => {
const router = Router([

View File

@ -1,7 +0,0 @@
{
"spec_dir": "spec",
"spec_files": ["**/*[sS]pec.js"],
"helpers": ["helpers/**/*.js"],
"stopSpecOnExpectationFailure": false,
"random": false
}

View File

@ -1,4 +1,4 @@
import { isFunction, isUndefined, Null, ObjectKeys } from 'trimkit';
import { isFunction, isUndefined, Null, ObjectKeys } from '../node_modules/trimkit/src/index.js';
const VARMATCH_RE = /:([^\/]+)/g;
const ROUTEELEMENT_RE = /^[^\/]+$/;