Skip to content

Commit

Permalink
refactor: rename build to scripts (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyerburgh committed Feb 3, 2018
1 parent 20465ab commit 91472e4
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 47 deletions.
9 changes: 0 additions & 9 deletions build/config/rollup-options-test.js

This file was deleted.

14 changes: 0 additions & 14 deletions build/git-hooks/commit-msg

This file was deleted.

4 changes: 0 additions & 4 deletions build/git-hooks/pre-commit

This file was deleted.

8 changes: 0 additions & 8 deletions build/install-hooks.js

This file was deleted.

15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,23 @@
"types/index.d.ts"
],
"scripts": {
"build": "node build/build.js",
"build:test": "cross-env NODE_ENV=test node build/build.js",
"build": "node scripts/build.js",
"build:test": "cross-env NODE_ENV=test node scripts/build.js",
"coverage": "cross-env NODE_ENV=coverage nyc --reporter=lcov --reporter=text npm run test:unit",
"docs": "cd docs && gitbook install && gitbook serve",
"docs:deploy": "build/update-docs.sh",
"docs:deploy": "scripts/update-docs.sh",
"docs:serve": "cd docs && gitbook serve",
"flow": "flow check",
"lint": "eslint --ext js,vue src test flow build --ignore-path .gitignore",
"lint:docs": "eslint --ext js,vue,md docs --ignore-path .gitignore",
"lint:fix": "npm run lint -- --fix",
"setup": "node build/install-hooks.js",
"test": "npm run lint && npm run lint:docs && npm run flow && npm run test:types && npm run test:unit && npm run test:unit:karma",
"test:compat": "test/test.sh",
"test:unit": "npm run build:test && cross-env BABEL_ENV=test && mocha-webpack --webpack-config build/webpack.test.config.js test/specs --recursive --require test/setup/mocha.setup.js",
"test:compat": "scripts/test-compat.sh",
"test:unit": "npm run build:test && cross-env BABEL_ENV=test && mocha-webpack --webpack-config test/setup/webpack.test.config.js test/specs --recursive --require test/setup/mocha.setup.js",
"test:unit:karma": "npm run build:test && cross-env BABEL_ENV=test TARGET=browser karma start test/setup/karma.conf.js --single-run",
"test:types": "tsc -p types",
"release": "bash build/release.sh",
"release:note": "node build/gen-release-note.js"
"release": "bash scripts/release.sh",
"release:note": "node scripts/gen-release-note.js"
},
"repository": {
"type": "git",
Expand Down
36 changes: 34 additions & 2 deletions build/build.js → scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ const buble = require('rollup-plugin-buble')
const nodeResolve = require('rollup-plugin-node-resolve')
const commonjs = require('rollup-plugin-commonjs')
const chalk = require('chalk')
const rollupOptionsBuild = require('./config/rollup-options-build')
const rollupOptionsTest = require('./config/rollup-options-test')

function success (text) {
console.log(chalk.green(`${text} ✔`))
Expand All @@ -16,6 +14,40 @@ function error (text) {
console.log(chalk.red(`${text} ✘`))
}

const rollupOptionsBuild = [
{
dest: resolve('dist/vue-test-utils.js'),
format: 'cjs'
},
{
name: 'globals',
dest: resolve('dist/vue-test-utils.iife.js'),
moduleName: 'vueTestUtils',
format: 'iife',
globals: {
'vue': 'Vue',
'vue-template-compiler': 'VueTemplateCompiler'
}
},
{
dest: resolve('dist/vue-test-utils.umd.js'),
format: 'umd',
globals: {
'vue': 'Vue',
'vue-template-compiler': 'VueTemplateCompiler'
},
moduleName: 'vueTestUtils'
}
]

const rollupOptionsTest = [
{
dest: resolve('dist/vue-test-utils.js'),
format: 'cjs',
sourceMap: 'inline'
}
]

const rollupOptions = process.env.NODE_ENV === 'test' ? rollupOptionsTest : rollupOptionsBuild

rollupOptions.forEach(options => {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/setup/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const webpackConfig = require('../../build/webpack.test.config.js')
const webpackConfig = require('./webpack.test.config.js')

module.exports = function (config) {
config.set({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const nodeExternals = require('webpack-node-externals')
const browser = process.env.TARGET === 'browser'
const path = require('path')

const projectRoot = path.resolve(__dirname, '../')
const projectRoot = path.resolve(__dirname, '../../')
const isCoverage = process.env.NODE_ENV === 'coverage'
const rules = [].concat(
isCoverage ? {
Expand Down

0 comments on commit 91472e4

Please sign in to comment.