提交 d3d85941 编写于 作者: fxy060608's avatar fxy060608

feat(qa): add validate

上级 6f34bae9
......@@ -12,6 +12,11 @@ const Css2jsonPlugin = require('@hap-toolkit/dsl-vue/lib/plugin/css2json-plugin'
const InstVuePlugin = require('./plugin/instvue-plugin')
const parseManifest = require('./manifest/index')
const validate = require('./validate')
parseManifest(process.UNI_PAGES, process.UNI_MANIFEST)
validate()
const env = {
// 平台:native
......@@ -22,14 +27,9 @@ const env = {
const dslFilename = ('vue.' + (process.env.NODE_ENV === 'production' ? 'prod' : 'dev') + '.js')
parseManifest(process.UNI_PAGES, process.UNI_MANIFEST)
const manifest = global.framework.manifest
if (!manifest.package) {
console.error(`maniest.json quickapp 节点缺少 package 配置`)
process.exit(0)
}
function genPriorities(entryPagePath) {
const o = [/^i18n\/.+\.json$/i, 'manifest.json', 'app.js', /^common\//i];
......
......@@ -16,6 +16,10 @@ module.exports = function parseBase(manifest, manifestJson) {
merge(manifest, manifestJson)
manifest.versionCode = parseInt(manifest.versionCode) || 1
if (!manifest.package) {
manifest.package = manifest.name || 'Bundle'
}
if (!manifest.config) {
manifest.config = {}
}
......
const fs = require('fs')
const path = require('path')
module.exports = function() {
const manifest = global.framework.manifest
if (manifest.package === 'Bundle') {
console.error(`> 建议配置 manifest.json->quickapp->package 应用包名`)
}
const signPath = './sign/' + (process.env.NODE_ENV === 'production' ? 'release' : 'debug')
const privatePemPath = path.resolve(process.env.UNI_INPUT_DIR, signPath + '/private.pem')
const certificatePemPath = path.resolve(process.env.UNI_INPUT_DIR, signPath + '/certificate.pem')
if (!fs.existsSync(privatePemPath)) {
console.error(`> 缺少私钥文件, 打包失败: ${privatePemPath}`)
process.exit(0)
}
if (!fs.existsSync(certificatePemPath)) {
console.error(`> 缺少证书文件, 打包失败: ${certificatePemPath}`)
process.exit(0)
}
}
......@@ -280,7 +280,7 @@ let hasNVue = false
if (process.env.UNI_USING_NATIVE) {
console.log('当前nvue编译模式:' + (isNVueCompiler ? 'uni-app' : 'weex') +
' 。编译模式差异见:https://ask.dcloud.net.cn/article/36074')
} else if (process.env.UNI_PLATFORM !== 'h5') {
} else if (process.env.UNI_PLATFORM !== 'h5' && process.env.UNI_PLATFORM !== 'quickapp') {
try {
let info = ''
if (process.env.UNI_PLATFORM === 'app-plus') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册