mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-09-10 12:50:38 +08:00
* fixed[tagsView]: DEL_OTHERS_VIEWS cachedViews bug (#913) * mutations DEL_OTHERS_VIEWS state.cachedViews -> i type is string slice(begin: number, end: number) * fix[Tinymce]: fixed tinymce upload dialog bug #654 * [release] 3.7.3 * docs: add gitee * perf[login.vue]: Improve input background and cursor color (#927) * 完善input背景和光标色; 1.完善在Chrome浏览器时登陆界面的input标签 使用记住密码之后颜色和背景不一致; 2.目前的rgb值是 #2d3a4b 修改的rgb值是 #283443; 3.修复光标使用Chrome记录的账号之后变黑色; 4.移除 .title-container .title 重复的font-weight: 400; 5.不用IE我们大家都是好朋友!~ * Update index.vue * docs: tweak * tweak * fix: demo links * fixBug[waves.js]: wave's position (#949) * fixBug[waves.js]-wave's position * fix[waves.js]-wave's position * fix typo(#965) * update to webpack4 (#889) * [release] 3.8.0 * Update README.zh-CN.md * format code * docs: change vueAdmin-template => vue-admin-template
65 lines
1.3 KiB
JavaScript
65 lines
1.3 KiB
JavaScript
'use strict'
|
|
const chalk = require('chalk')
|
|
const semver = require('semver')
|
|
const packageConfig = require('../package.json')
|
|
const shell = require('shelljs')
|
|
|
|
function exec(cmd) {
|
|
return require('child_process')
|
|
.execSync(cmd)
|
|
.toString()
|
|
.trim()
|
|
}
|
|
|
|
const versionRequirements = [
|
|
{
|
|
name: 'node',
|
|
currentVersion: semver.clean(process.version),
|
|
versionRequirement: packageConfig.engines.node
|
|
}
|
|
]
|
|
|
|
if (shell.which('npm')) {
|
|
versionRequirements.push({
|
|
name: 'npm',
|
|
currentVersion: exec('npm --version'),
|
|
versionRequirement: packageConfig.engines.npm
|
|
})
|
|
}
|
|
|
|
module.exports = function() {
|
|
const warnings = []
|
|
|
|
for (let i = 0; i < versionRequirements.length; i++) {
|
|
const mod = versionRequirements[i]
|
|
|
|
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
|
|
warnings.push(
|
|
mod.name +
|
|
': ' +
|
|
chalk.red(mod.currentVersion) +
|
|
' should be ' +
|
|
chalk.green(mod.versionRequirement)
|
|
)
|
|
}
|
|
}
|
|
|
|
if (warnings.length) {
|
|
console.log('')
|
|
console.log(
|
|
chalk.yellow(
|
|
'To use this template, you must update following to modules:'
|
|
)
|
|
)
|
|
console.log()
|
|
|
|
for (let i = 0; i < warnings.length; i++) {
|
|
const warning = warnings[i]
|
|
console.log(' ' + warning)
|
|
}
|
|
|
|
console.log()
|
|
process.exit(1)
|
|
}
|
|
}
|