UNPKG

1.69 kBJavaScriptView Raw
1'use strict';
2
3var _require = require('mrm-core'),
4 json = _require.json,
5 install = _require.install;
6
7var packages = [
8// Utilities
9'nsp', 'del-cli', 'cross-env', 'standard-version',
10
11// Jest
12'jest', 'babel-jest',
13
14// Babel
15'babel-cli', 'babel-polyfill', 'babel-preset-env', 'babel-plugin-transform-object-rest-spread',
16
17// ESLint
18'eslint', 'eslint-plugin-import', 'eslint-config-webpack', 'lint-staged', 'pre-commit'];
19
20module.exports = function (config) {
21 json('package.json').merge({
22 main: 'dist/cjs.js',
23 files: ['dist'],
24 engines: {
25 // Some versions are skipped because of known issues, see https://github.com/webpack-contrib/organization/issues/7
26 node: `>= ${config.minNode} < 5.0.0 || >= 5.10`
27 },
28 peerDependencies: {
29 webpack: '^2.0.0 || >= 3.0.0-rc.0 || ^3.0.0'
30 },
31 scripts: {
32 start: 'npm run build -- -w',
33 'appveyor:test': 'npm run test',
34 build: "cross-env NODE_ENV=production babel src -d dist --ignore 'src/**/*.test.js'",
35 clean: 'del-cli dist',
36 lint: 'eslint --cache src test',
37 'lint-staged': 'lint-staged',
38 prebuild: 'npm run clean',
39 prepublish: 'npm run build',
40 release: 'standard-version',
41 security: 'nsp check',
42 test: 'jest',
43 'test:watch': 'jest --watch',
44 'test:coverage': "jest --collectCoverageFrom='src/**/*.js' --coverage",
45 'travis:lint': 'npm run lint && npm run security',
46 'travis:test': 'npm run test -- --runInBand',
47 'travis:coverage': 'npm run test:coverage -- --runInBand'
48 },
49 'pre-commit': 'lint-staged',
50 'lint-staged': {
51 '*.js': ['eslint --fix', 'git add']
52 }
53 }).save();
54
55 install(packages);
56};
\No newline at end of file