fix: cleanup package.json scripts

This commit is contained in:
Thomas Allmer
2019-08-04 18:13:02 +02:00
parent efa49d7d02
commit be6bdb5bcd
25 changed files with 48 additions and 276 deletions

View File

@@ -33,7 +33,7 @@ jobs:
- run: npm run lint
# run tests
- run: npm run test:ci
- run: npm run test:node
- run: npm run test:bs
- persist_to_workspace:

View File

@@ -3,6 +3,7 @@
"private": true,
"license": "MIT",
"scripts": {
"build": "lerna run build",
"lint": "run-p lint:*",
"lint:eslint": "eslint --ext .js,.html .",
"lint:prettier": "prettier \"**/*.js\" --list-different || (echo '↑↑ these files are not prettier formatted ↑↑' && exit 1)",
@@ -10,18 +11,19 @@
"format": "npm run format:eslint && npm run format:prettier",
"format:eslint": "eslint --ext .js,.html . --fix",
"format:prettier": "prettier \"**/*.js\" --write",
"postinstall": "npm run build",
"publish": "lerna publish --message 'chore: release new versions'",
"site:build": "npm run vuepress:build",
"site:start": "npm run vuepress:start",
"build": "lerna run build",
"test": "karma start --coverage",
"test:watch": "karma start --auto-watch=true --single-run=false",
"test:update-snapshots": "karma start --update-snapshots",
"test:prune-snapshots": "karma start --prune-snapshots",
"test:ci": "lerna run test:ci",
"test:compatibility": "karma start --compatibility all --coverage",
"test:compatibility:watch": "karma start --auto-watch=true --single-run=false --compatibility all --coverage",
"test": "yarn test:browser && yarn test:node",
"test:browser": "karma start --coverage",
"test:browser:watch": "karma start --auto-watch=true --single-run=false",
"test:browser:update-snapshots": "karma start --update-snapshots",
"test:browser:prune-snapshots": "karma start --prune-snapshots",
"test:browser:compatibility": "karma start --compatibility all --coverage",
"test:browser:compatibility:watch": "karma start --auto-watch=true --single-run=false --compatibility all --coverage",
"test:bs": "karma start karma.bs.conf.js --compatibility all --coverage",
"test:node": "lerna run test:node",
"vuepress:build": "vuepress build docs",
"vuepress:start": "vuepress dev docs"
},

View File

@@ -14,11 +14,11 @@
"directory": "packages/building-rollup"
},
"scripts": {
"start:build": "es-dev-server --app-index dist/index.html --open",
"build": "rimraf dist && rollup -c demo/js/rollup.config.js",
"build:modern": "rimraf dist && rollup -c demo/js/rollup.modern.config.js",
"build:ts": "rimraf dist && rollup -c demo/ts/rollup.config.js",
"build:ts-babel": "rimraf dist && rollup -c demo/ts-babel/rollup.config.js",
"demo:start:build": "es-dev-server --app-index dist/index.html --open",
"demo:build": "rimraf dist && rollup -c demo/js/rollup.config.js",
"demo:build:modern": "rimraf dist && rollup -c demo/js/rollup.modern.config.js",
"demo:build:ts": "rimraf dist && rollup -c demo/ts/rollup.config.js",
"demo:build:ts-babel": "rimraf dist && rollup -c demo/ts-babel/rollup.config.js",
"prepublishOnly": "../../scripts/insert-header.js"
},
"main": "index.js",

View File

@@ -9,9 +9,9 @@
"access": "public"
},
"scripts": {
"test": "mocha test/**/*.test.js test/*.test.js",
"test:update-snapshots": "mocha test/**/*.test.js test/*.test.js --update-snapshots",
"test:ci": "npm run test"
"test": "npm run test:node",
"test:node": "mocha test/**/*.test.js test/*.test.js",
"test:update-snapshots": "mocha test/**/*.test.js test/*.test.js --update-snapshots"
},
"repository": {
"type": "git",

View File

@@ -14,15 +14,15 @@
"directory": "packages/building-webpack"
},
"scripts": {
"start:build": "http-server dist -o",
"build": "webpack --mode production --config demo/js/webpack.config.js",
"start:webpack-dev": "webpack-dev-server --mode development --config demo/js/webpack.config.js --open",
"start:webpack-dev:legacy": "webpack-dev-server --mode development --config demo/js/webpack.config.js --open --legacy",
"build:modern": "webpack --mode production --config demo/js/webpack.modern.config.js",
"start:webpack-dev:modern": "webpack-dev-server --mode development --config demo/js/webpack.modern.config.js --open",
"build:ts-babel": "webpack --mode production --config demo/ts-babel/webpack.config.js",
"build:ts": "webpack --mode production --config demo/ts/webpack.config.js",
"build:stats": "webpack --mode production --config demo/js/webpack.modern.config.js --profile --json > build-stats.json",
"demo:start": "http-server dist -o",
"demo:build": "webpack --mode production --config demo/js/webpack.config.js",
"demo:webpack-dev": "webpack-dev-server --mode development --config demo/js/webpack.config.js --open",
"demo:webpack-dev:legacy": "webpack-dev-server --mode development --config demo/js/webpack.config.js --open --legacy",
"demo:build:modern": "webpack --mode production --config demo/js/webpack.modern.config.js",
"demo:webpack-dev:modern": "webpack-dev-server --mode development --config demo/js/webpack.modern.config.js --open",
"demo:build:ts-babel": "webpack --mode production --config demo/ts-babel/webpack.config.js",
"demo:build:ts": "webpack --mode production --config demo/ts/webpack.config.js",
"demo:build:stats": "webpack --mode production --config demo/js/webpack.modern.config.js --profile --json > build-stats.json",
"prepublishOnly": "../../scripts/insert-header.js"
},
"main": "index.js",

View File

@@ -22,8 +22,8 @@
"scripts": {
"build": "rimraf dist && babel src --out-dir dist --copy-files --include-dotfiles",
"start": "npm run build && node ./dist/create.js",
"test": "mocha --require @babel/register",
"test:ci": "npm run test",
"test": "npm run test:node",
"test:node": "mocha --require @babel/register",
"test:watch": "onchange 'src/**/*.js' 'test/**/*.js' -- npm run test --silent",
"prepublishOnly": "npm run build && ../../scripts/insert-header.js"
},

View File

@@ -19,9 +19,9 @@
],
"scripts": {
"build": "babel src --out-dir dist --copy-files --include-dotfiles",
"test": "mocha test/**/*.test.js test/*.test.js --require @babel/register",
"test": "npm run test:node",
"test:node": "mocha test/**/*.test.js test/*.test.js --require @babel/register",
"test:update-snapshots": "mocha test/**/*.test.js test/*.test.js --require @babel/register --update-snapshots",
"test:ci": "npm run test",
"start": "yarn build && node dist/cli.js --app-index demo/import-map/index.html --open --watch --http2",
"start:compat-esm": "yarn build && node dist/cli.js --app-index demo/import-map/index.html --open --watch --http2 --compatibility esm",
"start:compat-modern": "yarn build && node dist/cli.js --app-index demo/import-map/index.html --open --watch --http2 --compatibility modern",

View File

@@ -20,8 +20,8 @@
"scripts": {
"build": "babel src --out-dir dist --copy-files --include-dotfiles",
"start": "npm run build && node ./dist/generate.js",
"test": "mocha --require @babel/register",
"test:ci": "npm run test",
"test": "npm run test:node",
"test:node": "mocha --require @babel/register",
"test:watch": "onchange 'src/**/*.js' 'test/**/*.js' -- npm run test --silent",
"prepublishOnly": "npm run build && ../../scripts/insert-header.js"
},

View File

@@ -20,8 +20,8 @@
"scripts": {
"build": "babel src --out-dir dist --copy-files --include-dotfiles",
"start": "npm run build && node ./dist/index.js",
"test": "mocha --require @babel/register",
"test:ci": "npm run test",
"test": "npm run test:node",
"test:node": "mocha --require @babel/register",
"test:watch": "onchange 'src/**/*.js' 'test/**/*.js' -- npm run test --silent",
"prepublishOnly": "npm run build && ../../scripts/insert-header.js"
},

View File

@@ -10,9 +10,9 @@
"access": "public"
},
"scripts": {
"test": "mocha test/**/*.test.js test/*.test.js",
"test:update-snapshots": "mocha test/**/*.test.js test/*.test.js --update-snapshots",
"test:ci": "npm run test"
"test": "npm run test:node",
"test:node": "mocha test/**/*.test.js test/*.test.js",
"test:update-snapshots": "mocha test/**/*.test.js test/*.test.js --update-snapshots"
},
"repository": {
"type": "git",

View File

@@ -1,15 +0,0 @@
/* eslint-disable import/no-extraneous-dependencies */
const merge = require('webpack-merge');
const bsSettings = require('@open-wc/testing-karma-bs/bs-settings.js');
const createBaseConfig = require('./karma.conf.js');
module.exports = config => {
config.set(
merge(bsSettings(config), createBaseConfig(config), {
browserStack: {
project: 'open-wc',
},
}),
);
return config;
};

View File

@@ -1,26 +0,0 @@
/* eslint-disable import/no-extraneous-dependencies */
const { createDefaultConfig } = require('@open-wc/testing-karma');
const merge = require('webpack-merge');
module.exports = config => {
config.set(
merge(createDefaultConfig(config), {
files: [
// allows running single tests with the --grep flag
{ pattern: config.grep ? config.grep : 'test/**/*.test.js', type: 'module' },
],
coverageIstanbulReporter: {
thresholds: {
global: {
statements: 80,
branches: 70,
functions: 70,
lines: 80,
},
},
},
}),
);
return config;
};

View File

@@ -21,22 +21,11 @@
"index.js"
],
"scripts": {
"test": "karma start --coverage",
"test:watch": "karma start --auto-watch=true --single-run=false",
"test:compatibility": "karma start --compatibility all --coverage",
"test:compatibility:watch": "karma start --compatibility all --auto-watch=true --single-run=false",
"test:bs": "karma start karma.bs.conf.js --compatibility --coverage",
"test:update-snapshots": "karma start --update-snapshots",
"test:prune-snapshots": "karma start --prune-snapshots",
"prepublishOnly": "../../scripts/insert-header.js"
},
"devDependencies": {
"@bundled-es-modules/chai": "^4.2.0",
"@open-wc/testing-helpers": "^1.1.6",
"@open-wc/testing-karma": "^3.1.10",
"@open-wc/testing-karma-bs": "^1.1.35",
"@open-wc/testing-wallaby": "^0.1.12",
"mocha": "^5.0.0",
"webpack-merge": "^4.1.5"
"mocha": "^5.0.0"
}
}

View File

@@ -1,22 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="../../../mocha/mocha.css" rel="stylesheet" />
<script src="../../../mocha/mocha.js"></script>
<script src="../../../@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
</head>
<body>
<div id="mocha"></div>
<script>
mocha.setup('bdd');
</script>
<script type="module">
import './get-diffable-html.test.js';
mocha.checkLeaks();
mocha.run();
</script>
</body>
</html>

View File

@@ -1,15 +0,0 @@
/* eslint-disable import/no-extraneous-dependencies */
const merge = require('webpack-merge');
const bsSettings = require('@open-wc/testing-karma-bs/bs-settings.js');
const createBaseConfig = require('./karma.conf.js');
module.exports = config => {
config.set(
merge(bsSettings(config), createBaseConfig(config), {
browserStack: {
project: 'open-wc',
},
}),
);
return config;
};

View File

@@ -1,27 +0,0 @@
/* eslint-disable import/no-extraneous-dependencies */
const { createDefaultConfig } = require('@open-wc/testing-karma');
const merge = require('webpack-merge');
module.exports = config => {
config.set(
merge(createDefaultConfig(config), {
files: [
// allows running single tests with the --grep flag
{ pattern: config.grep ? config.grep : 'test/**/*.test.js', type: 'module' },
],
// TODO: not yet within the 90% default
coverageIstanbulReporter: {
thresholds: {
global: {
statements: 80,
branches: 70,
functions: 70,
lines: 80,
},
},
},
}),
);
return config;
};

View File

@@ -20,11 +20,6 @@
"index-no-side-effects.js"
],
"scripts": {
"test": "karma start --coverage",
"test:watch": "karma start --auto-watch=true --single-run=false",
"test:compatibility": "karma start --compatibility all --coverage",
"test:compatibility:watch": "karma start --compatibility all --auto-watch=true --single-run=false",
"test:bs": "karma start karma.bs.conf.js --compatibility --coverage",
"prepublishOnly": "../../scripts/insert-header.js"
},
"peerDependencies": {
@@ -32,9 +27,6 @@
},
"devDependencies": {
"@bundled-es-modules/chai": "^4.2.0",
"@open-wc/testing-karma": "^3.1.10",
"@open-wc/testing-karma-bs": "^1.1.35",
"@open-wc/testing-wallaby": "^0.1.12",
"lit-html": "^1.0.0",
"mocha": "^5.0.0",
"sinon": "^7.2.7",

View File

@@ -1,26 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="../../../node_modules/mocha/mocha.css" rel="stylesheet" />
<script src="../../../node_modules/mocha/mocha.js"></script>
<script src="../../../node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
</head>
<body>
<div id="mocha"></div>
<script>
mocha.setup('bdd');
</script>
<script type="module">
import './elementUpdated.test.js';
import './fixture.test.js';
import './helpers.test.js';
import './lit-html.test.js';
import './stringLitFixture.test.js';
mocha.checkLeaks();
mocha.run();
</script>
</body>
</html>

View File

@@ -15,12 +15,12 @@
"directory": "packages/testing-karma"
},
"scripts": {
"test": "karma start demo/karma.conf.js --coverage --legacy",
"test:watch": "karma start demo/karma.conf.js --auto-watch=true --single-run=false",
"test:update-snapshots": "karma start demo/karma.conf.js --update-snapshots",
"test:prune-snapshots": "karma start demo/karma.conf.js --prune-snapshots",
"test:legacy": "karma start demo/karma.conf.js --legacy --coverage",
"test:bs": "karma start demo/karma.bs.conf.js --legacy --coverage",
"demo:test": "karma start demo/karma.conf.js --coverage --legacy",
"demo:test:watch": "karma start demo/karma.conf.js --auto-watch=true --single-run=false",
"demo:test:update-snapshots": "karma start demo/karma.conf.js --update-snapshots",
"demo:test:prune-snapshots": "karma start demo/karma.conf.js --prune-snapshots",
"demo:test:legacy": "karma start demo/karma.conf.js --legacy --coverage",
"demo:test:bs": "karma start demo/karma.bs.conf.js --legacy --coverage",
"prepublishOnly": "../../scripts/insert-header.js"
},
"files": [

View File

@@ -1,15 +0,0 @@
/* eslint-disable import/no-extraneous-dependencies */
const merge = require('webpack-merge');
const bsSettings = require('@open-wc/testing-karma-bs/bs-settings.js');
const createBaseConfig = require('./karma.conf.js');
module.exports = config => {
config.set(
merge(bsSettings(config), createBaseConfig(config), {
browserStack: {
project: 'your-name',
},
}),
);
return config;
};

View File

@@ -1,28 +0,0 @@
/* eslint-disable import/no-extraneous-dependencies */
const { createDefaultConfig } = require('@open-wc/testing-karma');
const merge = require('webpack-merge');
module.exports = config => {
config.set(
merge(createDefaultConfig(config), {
files: [
// allows running single tests with the --grep flag
{ pattern: config.grep ? config.grep : 'test/**/*.test.js', type: 'module' },
require.resolve('axe-core/axe.min.js'),
],
// is a meta package with with just some smoke tests
coverageIstanbulReporter: {
thresholds: {
global: {
statements: 0,
branches: 0,
functions: 0,
lines: 0,
},
},
},
}),
);
return config;
};

View File

@@ -20,13 +20,6 @@
"register-chai-plugins.js"
],
"scripts": {
"test": "karma start --coverage",
"test:watch": "karma start --auto-watch=true --single-run=false",
"test:compatibility": "karma start --compatibility all --coverage",
"test:compatibility:watch": "karma start --compatibility all --auto-watch=true --single-run=false",
"test:bs": "karma start karma.bs.conf.js --compatibility --coverage",
"test:update-snapshots": "karma start --update-snapshots",
"test:prune-snapshots": "karma start --prune-snapshots",
"prepublishOnly": "../../scripts/insert-header.js"
},
"dependencies": {
@@ -38,11 +31,5 @@
"@types/mocha": "^5.0.0",
"chai-a11y-axe": "^1.1.1",
"mocha": "^5.0.0"
},
"devDependencies": {
"@open-wc/testing-karma": "^3.1.10",
"@open-wc/testing-karma-bs": "^1.1.35",
"@open-wc/testing-wallaby": "^0.1.12",
"webpack-merge": "^4.1.5"
}
}

View File

@@ -1,22 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="../../../mocha/mocha.css" rel="stylesheet" />
<script src="../../../mocha/mocha.js"></script>
<script src="../../../@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
</head>
<body>
<div id="mocha"></div>
<script>
mocha.setup('bdd');
</script>
<script type="module">
import './index.js';
mocha.checkLeaks();
mocha.run();
</script>
</body>
</html>

View File

@@ -1,2 +0,0 @@
import './side-effects.test.js';
import './chaiA11yAxe.test.js';

View File

@@ -19,8 +19,8 @@
"*.js"
],
"scripts": {
"test": "mocha --require @babel/register",
"test:ci": "npm run test",
"test": "npm run test:node",
"test:node": "mocha --require @babel/register",
"prepublishOnly": "../../scripts/insert-header.js"
},
"devDependencies": {