Skip to content

Commit 91472e4

Browse files
authored
refactor: rename build to scripts (#409)
1 parent 20465ab commit 91472e4

13 files changed

+43
-47
lines changed

build/config/rollup-options-test.js

-9
This file was deleted.

build/git-hooks/commit-msg

-14
This file was deleted.

build/git-hooks/pre-commit

-4
This file was deleted.

build/install-hooks.js

-8
This file was deleted.

package.json

+7-8
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,23 @@
99
"types/index.d.ts"
1010
],
1111
"scripts": {
12-
"build": "node build/build.js",
13-
"build:test": "cross-env NODE_ENV=test node build/build.js",
12+
"build": "node scripts/build.js",
13+
"build:test": "cross-env NODE_ENV=test node scripts/build.js",
1414
"coverage": "cross-env NODE_ENV=coverage nyc --reporter=lcov --reporter=text npm run test:unit",
1515
"docs": "cd docs && gitbook install && gitbook serve",
16-
"docs:deploy": "build/update-docs.sh",
16+
"docs:deploy": "scripts/update-docs.sh",
1717
"docs:serve": "cd docs && gitbook serve",
1818
"flow": "flow check",
1919
"lint": "eslint --ext js,vue src test flow build --ignore-path .gitignore",
2020
"lint:docs": "eslint --ext js,vue,md docs --ignore-path .gitignore",
2121
"lint:fix": "npm run lint -- --fix",
22-
"setup": "node build/install-hooks.js",
2322
"test": "npm run lint && npm run lint:docs && npm run flow && npm run test:types && npm run test:unit && npm run test:unit:karma",
24-
"test:compat": "test/test.sh",
25-
"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",
23+
"test:compat": "scripts/test-compat.sh",
24+
"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",
2625
"test:unit:karma": "npm run build:test && cross-env BABEL_ENV=test TARGET=browser karma start test/setup/karma.conf.js --single-run",
2726
"test:types": "tsc -p types",
28-
"release": "bash build/release.sh",
29-
"release:note": "node build/gen-release-note.js"
27+
"release": "bash scripts/release.sh",
28+
"release:note": "node scripts/gen-release-note.js"
3029
},
3130
"repository": {
3231
"type": "git",

build/build.js renamed to scripts/build.js

+34-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ const buble = require('rollup-plugin-buble')
55
const nodeResolve = require('rollup-plugin-node-resolve')
66
const commonjs = require('rollup-plugin-commonjs')
77
const chalk = require('chalk')
8-
const rollupOptionsBuild = require('./config/rollup-options-build')
9-
const rollupOptionsTest = require('./config/rollup-options-test')
108

119
function success (text) {
1210
console.log(chalk.green(`${text} ✔`))
@@ -16,6 +14,40 @@ function error (text) {
1614
console.log(chalk.red(`${text} ✘`))
1715
}
1816

17+
const rollupOptionsBuild = [
18+
{
19+
dest: resolve('dist/vue-test-utils.js'),
20+
format: 'cjs'
21+
},
22+
{
23+
name: 'globals',
24+
dest: resolve('dist/vue-test-utils.iife.js'),
25+
moduleName: 'vueTestUtils',
26+
format: 'iife',
27+
globals: {
28+
'vue': 'Vue',
29+
'vue-template-compiler': 'VueTemplateCompiler'
30+
}
31+
},
32+
{
33+
dest: resolve('dist/vue-test-utils.umd.js'),
34+
format: 'umd',
35+
globals: {
36+
'vue': 'Vue',
37+
'vue-template-compiler': 'VueTemplateCompiler'
38+
},
39+
moduleName: 'vueTestUtils'
40+
}
41+
]
42+
43+
const rollupOptionsTest = [
44+
{
45+
dest: resolve('dist/vue-test-utils.js'),
46+
format: 'cjs',
47+
sourceMap: 'inline'
48+
}
49+
]
50+
1951
const rollupOptions = process.env.NODE_ENV === 'test' ? rollupOptionsTest : rollupOptionsBuild
2052

2153
rollupOptions.forEach(options => {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

test/setup/karma.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const webpackConfig = require('../../build/webpack.test.config.js')
1+
const webpackConfig = require('./webpack.test.config.js')
22

33
module.exports = function (config) {
44
config.set({

build/webpack.test.config.js renamed to test/setup/webpack.test.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const nodeExternals = require('webpack-node-externals')
22
const browser = process.env.TARGET === 'browser'
33
const path = require('path')
44

5-
const projectRoot = path.resolve(__dirname, '../')
5+
const projectRoot = path.resolve(__dirname, '../../')
66
const isCoverage = process.env.NODE_ENV === 'coverage'
77
const rules = [].concat(
88
isCoverage ? {

0 commit comments

Comments
 (0)