Commit a5f06f4e authored by ke.zhou@definesys.com's avatar ke.zhou@definesys.com
Browse files

初次提交插件前端模版工程

parents
No related merge requests found
Showing with 848 additions and 0 deletions
+848 -0
> 1%
last 2 versions
not ie <= 9
\ No newline at end of file
/*
* @Author: DevinShi
* @Date: 2020-02-03 09:01:16
* @LastEditors: DevinShi
* @LastEditTime: 2020-02-03 09:08:38
* @Description: file content description
*/
"use strict";
module.exports = {
types: [
{ value: "feat", name: "功能: 一个新的功能" },
{ value: "fix", name: "修复: 修复一个Bug" },
{ value: "docs", name: "文档: 变更的只有文档" },
{ value: "style", name: "格式: 空格, 分号等格式修复" },
{ value: "refactor", name: "重构: 代码重构,注意和特性、修复区分开" },
{ value: "perf", name: "性能: 提升性能" },
{ value: "test", name: "测试: 添加一个测试" },
{ value: "chore", name: "工具: 开发工具变动(构建、脚手架工具等)" },
{ value: "revert", name: "回滚: 代码回退" }
],
// scopes: [
// {name: '模块1'},
// {name: '模块2'},
// {name: '模块3'},
// {name: '模块4'}
// ],
// it needs to match the value for field type. Eg.: 'fix'
scopeOverrides: {
fix: [
{ name: "功能" },
{ name: "样式" },
{ name: "e2e测试" },
{ name: "单元测试" }
],
chore: [{
name: '依赖修改',
}, {
name: '打包工具'
}]
},
// override the messages, defaults are as follows
messages: {
type: "选择一种你的提交类型:",
scope: "选择一个scope (可选):",
// used if allowCustomScopes is true
customScope: "自定义一个scope用于这次提交:",
subject: "短说明:\n",
body: '长说明,使用"|"换行(可选):\n',
breaking: "非兼容性说明 (可选):\n",
footer: "关联关闭的issue,例如:#31, #34(可选):\n",
confirmCommit: "确定提交说明?"
},
allowCustomScopes: true,
allowBreakingChanges: ["feat", "fix"],
// limit subject length
subjectLimit: 100
};
.czrc 0 → 100644
{ "path": "node_modules/cz-customizable" }
\ No newline at end of file
root = true
[*]
charset=utf-8
end_of_line=lf
insert_final_newline=false
indent_style=space
indent_size=2
[{.eslintrc,.babelrc,.stylelintrc,*.json}]
indent_style=space
indent_size=2
[*.less]
indent_style=space
indent_size=2
[*.{js,jsx,ts,tsx,vue,html}]
indent_style=space
indent_size=2
.env 0 → 100644
VUE_APP_BASE_DOMAIN=http://39.99.176.43:30607
VUE_APP_TENANT_ID=170113763830136833
VUE_APP_PUBLIC_PATH=/app/
\ No newline at end of file
*.sh
node_modules
lib
*.md
*.scss
*.woff
*.ttf
.vscode
.idea
/build/
/dist/
/public/
/script/
/config/
/docs
.vscode
module.exports = {
root: true,
env: {
node: true
},
extends: ['plugin:vue/recommended', '@vue/standard'],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'space-before-function-paren': 'off',
// 禁止在计算属性中对属性修改
'vue/no-side-effects-in-computed-properties': 'off',
// 属性空格
'vue/attribute-hyphenation': 'off',
'vue/html-closing-bracket-newline': 'off',
'vue/html-self-closing': 'off',
'vue/require-default-prop': 'off',
'vue/max-attributes-per-line': 'off'
},
parserOptions: {
parser: 'babel-eslint'
},
overrides: [
{
files: ['**/__tests__/*.{j,t}s?(x)'],
env: {
jest: true
}
}
]
}
.gitignore 0 → 100644
.DS_Store
node_modules
/dist
/tests/e2e/reports/
selenium-debug.log
chromedriver.log
geckodriver.log
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
/apaas-custom-plugin-*
*.zip
/PLUGIN_*
/crypto
*.js
*.png
*.eot
*.ttf
*.woff
/dist/
/lib/
/public/
.output.js
/**
* Element UI 懒加载插件,由于我们需要使用懒加载scss动态编译主题,所以不使用
*/
// eslint-disable-next-line no-unused-vars
const elementUIComponentPlugin = [
'component',
{
libraryName: 'element-ui',
styleLibraryName: '../packages/theme-chalk/src',
ext: '.scss'
},
'element-ui'
]
const XLibComponentPlugin = [
'component',
{
libraryName: '@x-ui/x-dcloud-ui',
styleLibrary: {
base: false,
name: 'theme-chalk/theme'
},
ext: '.scss'
},
'@x-ui/x-dcloud-ui'
]
const XDcloudPageWebPlugin = [
'component',
{
libraryName: '@x-apaas/x-dcloud-page-web',
styleLibrary: {
base: false,
name: 'theme-chalk/theme'
},
ext: '.scss'
},
'@x-apaas/x-dcloud-page-web'
]
const PortalGraphEnginePlugin = [
'component',
{
libraryName: '@deportal/portal-graph-engine',
styleLibrary: {
base: false,
name: 'theme-chalk/theme'
},
ext: '.scss'
},
'@deportal/portal-graph-engine'
]
module.exports = {
presets: [
[
'@vue/cli-plugin-babel/preset',
{
useBuiltIns: 'entry'
}
]
],
plugins: [
elementUIComponentPlugin,
XLibComponentPlugin,
XDcloudPageWebPlugin,
PortalGraphEnginePlugin
]
}
const shell = require('shelljs')
const path = require('path')
const fs = require('fs')
const rimraf = require('rimraf')
const getHelp = require('./help.js')
const envDefine = require('./build-en-define.json')
const sha256 = require('./sha256')
const clc = require('./clc')
const customs = fs.readdirSync(path.resolve(process.cwd(), 'src/custom'))
let all = customs.reduce((result, dir) => {
// ignore directories whose name starts without `apaas-custom-plugin-`
if (dir.indexOf('xdap-plugin-')) return result
try {
const apaasJson = JSON.parse(fs.readFileSync(path.resolve(process.cwd(), 'src', 'custom', dir, 'apaas.json')))
// match every plugins except those whose local.notAll is true
if (apaasJson && (!apaasJson.local || !apaasJson.local.notAll)) result.push(dir.slice(20))
} catch (e) {
} finally {
return result
}
}, [])
const help = getHelp(all)
let crypto = 'noc'
let noZip = 'noz'
let batchMode = false
let plugin = ''
let async = false
let env = envDefine.join(',')
let outputSha256 = false
const pickValue = function(a, i) {
return a && a[i] && !a[i].startsWith('-') && a[i]
}
const parseArgv = function(argv) {
const localArgv = [...argv]
for (let i = 0; i < localArgv.length; i++) {
if (localArgv[i].startsWith('--')) {
switch (localArgv[i]) {
case '--clean':
case '--rm':
rimraf.sync(path.resolve(process.cwd(), 'crypto'))
rimraf.sync(path.resolve(process.cwd(), 'crypto*.zip'))
rimraf.sync(path.resolve(process.cwd(), 'PLUGIN_*'))
rimraf.sync(path.resolve(process.cwd(), 'PLUGIN_*.zip'))
process.exit(0)
case '--help':
console.log(help)
process.exit(0)
default:
break
}
} else if (localArgv[i].startsWith('-')) {
const flag = localArgv[i].slice(0)
const flags = (flag && flag.split('')) || []
flags.forEach((f) => {
let a
switch (f) {
case 'c':
crypto = '-c'
break
case 'b':
batchMode = true
break
case 'a':
async = true
break
case 'A':
;(a = pickValue(localArgv, i + 1)) && a && ((all = a.split(',')), i++)
break
case 'Z':
noZip = '-Z'
break
case 'i':
;(a = pickValue(localArgv, i + 1)) && a && ((plugin = a), i++)
break
case 'h':
console.log(help)
process.exit(0)
case 'e':
;(a = pickValue(localArgv, i + 1)) && a && ((env = a), i++)
case 's':
outputSha256 = true
default:
break
}
})
}
}
if (!batchMode && !plugin) {
val = process.argv.slice(2, 3)[0]
val && !val.startsWith('-') && (plugin = val)
if (!plugin) {
console.error('未指定插件名')
process.exit(0)
}
}
}
parseArgv(process.argv.slice(2))
const scriptPath = path.resolve(process.cwd(), 'build/build-plugins.js')
const doBuild = (item) => {
shell.exec(`node ${scriptPath} ${item} ${crypto} ${noZip} ${env} ${outputSha256 ? 'sha' : ''}`, { async: async })
}
if (outputSha256) {
sha256.create()
}
if (batchMode) {
all.forEach(doBuild)
} else {
doBuild(plugin)
}
sha256.show()
sha256.close()
["admin", "app", "mobile", "workbench", "workbenchm"]
const shell = require('shelljs')
const fs = require('fs')
const path = require('path')
const zipper = require('zip-local')
const envDefine = require('./build-en-define.json')
const md5 = require('md5')
const sha256 = require('./sha256')
const clc = require('./clc')
const argv = process.argv.splice(2, 1)[0]
if (!argv) {
clc.red('未指定插件名')
process.exit(0)
}
const crypto = process.argv.splice(2, 1)[0] === '-c'
const noZip = process.argv.splice(2, 1)[0] === '-Z'
const env = process.argv.splice(2, 1)[0]
const realEnv = (env && env.split(',')) || envDefine
const outputSha256 = process.argv.splice(2, 1)[0] === 'sha'
const lib = async (cmd, program) => {
const customModule = cmd.custom
// 获取指定 custom 目录下的apaas.json
const customModulePath = path.resolve(process.cwd(), 'src/custom', customModule)
const customModuleConfigPath = path.resolve(customModulePath, 'apaas.json')
if (!fs.existsSync(customModuleConfigPath)) {
clc.red(`Error: 自开发模块 ${customModule} 下不存在需要的 apaas.json 文件`)
clc.red('exit')
process.exit(0)
}
const apaasConfig = JSON.parse(fs.readFileSync(customModuleConfigPath))
if (apaasConfig.extend) {
const extendModulePath = `${customModulePath}/${apaasConfig.extend}`
fs.existsSync(extendModulePath) && shell.exec(`node ${extendModulePath}`)
}
const buildArray = realEnv
.map((_) => {
if (!apaasConfig[_]) {
return
}
const newConfig = { ...apaasConfig }
delete newConfig[_]
newConfig.outputName = md5(apaasConfig.code)
return {
// 排第一,且不会被覆盖
entry: apaasConfig[_],
...newConfig,
entry: apaasConfig[_],
type: _
}
})
.filter((item) => item)
clc.cyan(`Building ${customModule} (${apaasConfig.code})...`)
const result = buildArray.map((config) => doLib(config, customModulePath))
if (result === [-1, -1]) {
process.exit(0)
}
const cryptoPath = crypto ? 'crypto/' + md5(apaasConfig.code) : apaasConfig.code
writeApaasJson(cryptoPath, apaasConfig)
if (!noZip) {
zip(cryptoPath, cryptoPath, customModule)
}
clc.green(`Built ${customModule} (${apaasConfig.code}) successfully!`)
}
/**
* @params apaasModuleConfig 源配置信息
* @params customModulePath 打包入口
*/
const doLib = (apaasModuleConfig, customModulePath) => {
const customModuleEntryPath = path.resolve(customModulePath, apaasModuleConfig.entry)
const moduleType = apaasModuleConfig.type
const outputName =
(crypto ? 'crypto/' + md5(apaasModuleConfig.code) : apaasModuleConfig.code) + '/' + moduleType
if (!fs.existsSync(customModuleEntryPath)) {
clc.red(`Error: apaas.json 指定的entry: ${apaasModuleConfig.entry} 的路径错误 `)
clc.red(`error path is ${customModuleEntryPath}`)
return -1
}
clc.magenta(`Building ${moduleType} of ${apaasModuleConfig.code}...`)
const customCliPath = path.resolve(
process.cwd(),
'./node_modules/@vue/cli-service/bin/vue-cli-service.js'
)
// 使用vue build 打包,并生成文件
shell.exec(
`node ${customCliPath} build --target lib --name ${apaasModuleConfig.outputName} --dest ${outputName} ${customModuleEntryPath} --formats umd,umd-min`
)
const suffix = ['umd.js', 'umd.min.js', 'css']
suffix.forEach((item) => {
shell.mv(
path.resolve(process.cwd(), `${outputName}/${apaasModuleConfig.outputName}.${item}`),
path.resolve(process.cwd(), `${outputName}/index.${item}`)
)
})
// shell.cp('-R', customModuleConfigPath, `${outputPath}/`)
const newOutputConfig = { ...apaasModuleConfig }
realEnv.forEach((_) => {
delete newOutputConfig[_]
})
const outputPath = path.resolve(process.cwd(), outputName)
// rm demo.html
shell.rm(path.resolve(process.cwd(), `${outputName}`, 'demo.html'))
// 拷贝public文件到指定目录
apaasModuleConfig.copyAssets.forEach((copyAsset) => {
copyAssetSource = copyAsset + copyAsset.endsWith('/') ? moduleType : '/' + moduleType
const assetPath = path.resolve(process.cwd(), copyAssetSource)
if (fs.existsSync(assetPath)) {
const outputAsset = path.resolve(outputPath, copyAsset.replace('public/', 'static/'))
shell.mkdir('-p', outputAsset)
shell.cp('-R', `${assetPath}/*`, `${outputAsset}/`)
}
})
clc.yellow(`Built ${moduleType} of ${apaasModuleConfig.code} successfully!`)
}
/**
* @params outputPath 目标文件夹命
* @params originJson 源配置信息
*/
const writeApaasJson = function(outputPath, originJson) {
const newOutputConfig = { ...originJson }
delete newOutputConfig.type
delete newOutputConfig.outputName
delete newOutputConfig.local
newOutputConfig.extraConfig = { ...newOutputConfig.extraConfig }
realEnv.forEach((item) => {
if (newOutputConfig[item]) {
newOutputConfig.extraConfig[item] = true
delete newOutputConfig[item]
newOutputConfig.extraConfig[item + 'Css'] = fs.existsSync(
path.resolve(process.cwd(), outputPath, item, 'index.css')
)
const md5Code = md5(fs.readFileSync(path.resolve(`${outputPath}/${item}/index.umd.min.js`)))
newOutputConfig.extraConfig[item + 'Version'] = md5Code
}
})
fs.writeFile(`${outputPath}/apaas.json`, JSON.stringify(newOutputConfig, null, ' '), function(
error
) {
if (error) {
clc.red(`配置信息写入失败\n${error}`)
}
})
}
/**
* @params originPath 源文件夹名
* @params outputName 目标文件名
*/
const zip = function(originName, outputName, customModule) {
const originPath = path.resolve(process.cwd(), originName)
const outputZipPath = path.resolve(process.cwd(), `${outputName}.zip`)
if (fs.existsSync(outputZipPath)) {
shell.rm(outputZipPath)
}
// 生成zip并压缩
zipper.zip(originPath, function(error, zipped) {
if (!error) {
zipped.compress() // compress before exporting
var buff = zipped.memory() // get the zipped file as a Buffer
zipped.save(outputZipPath, function(error) {
if (!error) {
clc.green('zipped successfully !')
if (outputSha256) {
sha256.generate(customModule, outputZipPath)
}
// 删除指定生成目录
// shell.rm('-r',originPath)
} else {
clc.red(`write error: ${error}`)
}
})
} else {
clc.red(`read error: ${error}`)
}
})
}
module.exports = lib(
{
custom: `plugin-${argv}`
},
{}
)
const shell = require('shelljs');
const fs = require('fs')
const path = require('path')
const zipper = require("zip-local");
const colors = require('colors');
const lib = async (cmd, program) => {
const customModule = cmd.custom
// 获取指定 custom 目录下的apaas.json
const customModulePath = path.resolve(`${process.cwd()}`, 'src/custom', customModule)
const customModuleConfigPath = path.resolve(customModulePath, 'apaas.json')
if (!fs.existsSync(customModuleConfigPath)) {
console.log(`Error: 自开发模块 ${customModule} 下不存在需要的 apaas.json 文件`['red'])
console.log(`exit`['red'])
process.exit(0)
}
const apaasConfig = JSON.parse(fs.readFileSync(customModuleConfigPath))
const customModuleEntryPath = path.resolve(customModulePath, apaasConfig.entry)
if (!fs.existsSync(customModuleEntryPath)) {
console.log(`Error: apaas.json 指定的entry: ${apaasConfig.entry} 的路径错误 `['red'])
console.log(`error path is ${customModuleEntryPath}`['red'])
console.log(`exit`['red'])
process.exit(0)
}
const customCliPath = path.resolve(`${process.cwd()}`, './node_modules/@vue/cli-service/bin/vue-cli-service.js')
const outputPath = path.resolve(`${process.cwd()}`, `${apaasConfig.outputName}`)
const outputZipPath = path.resolve(`${process.cwd()}`, `${apaasConfig.outputName}.zip`)
// 使用vue build 打包,并生成文件
var nodeExec = shell.which('vue-cli-service');
if (nodeExec) {
shell.exec(`vue-cli-service build --target lib --name ${apaasConfig.outputName} --dest ${apaasConfig.outputName} ${customModuleEntryPath}`)
} else {
shell.exec(`node ${customCliPath} build --target lib --name ${apaasConfig.outputName} --dest ${apaasConfig.outputName} ${customModuleEntryPath}`)
}
// shell.exec(`node ${customCliPath} build --target lib --name ${apaasConfig.outputName} --dest ${apaasConfig.outputName} ${customModuleEntryPath}`)
shell.cp('-R', customModuleConfigPath, `${outputPath}/`)
// 拷贝public文件到指定目录
apaasConfig.copyAssets.forEach(copyAsset => {
const assetPath = path.resolve(`${process.cwd()}`, copyAsset)
const outputAsset = path.resolve(outputPath, copyAsset.replace('public/', 'static/'))
shell.mkdir('-p', outputAsset)
shell.cp('-R', `${assetPath}/*`, `${outputAsset}/`)
});
if (fs.existsSync(outputZipPath)) {
shell.rm(outputZipPath)
}
// 生成zip并压缩
zipper.zip(outputPath, function(error, zipped) {
if(!error) {
zipped.compress(); // compress before exporting
var buff = zipped.memory(); // get the zipped file as a Buffer
zipped.save(`${outputZipPath}`, function(error) {
if(!error) {
console.log("saved successfully !");
// 删除指定生成目录
// shell.rm('-r',outputPath)
}
});
}
})
}
const argv = process.argv.splice(2, 1);
console.log(argv)
module.exports = lib({
custom: `apaas-custom-plugin-${argv}`
}, {})
\ No newline at end of file
const clc = function(colorCode) {
return function(text) {
console.log(`\x1b[${colorCode}m${text}\x1b[0m`)
}
}
clc.red = clc(31) // failed to build
clc.green = clc(32) // module built successfully
clc.yellow = clc(33) // env built successfully
// clc.blue = clc(34)
clc.magenta = clc(35) // env building
clc.cyan = clc(36) // module building
module.exports = clc
\ No newline at end of file
const help = function(all) {
return `
插件打包入口
格式:
1. node thisJs xx <params> <value> 用指定的参数和值打包xx插件
2. node thisJs xx 打包xx插件
3. node thisJs <params> <value> 用指定的参数和值打包xx插件,notes: 必须要包含 -i 或者 -a 参数
参数:
-i <plugin_name> 指定插件名,优先级高于格式1和格式2指定的插件名
-b 采用批量打包模式,批量打包默认的插件为上文中的 all 变量值指定的插件集合,此参数将忽略 -i 指定的具体插件名
批量打包默认的插件: ${all.join(',')}
-c 加密命名,插件打包后的文件夹或压缩文件使用 md5 加密插件 code 后的字符串命名
-Z 取消压缩。默认会给每一个插件打包,使用此命令则取消打包这一步
-A <plugins_str> 声明参与批量打包的所有插件,用英文逗号分隔多个插件,如 oo,aa 表示打包oo和aa这两个插件,需要 -b 参数才会实际生效
-a 使用异步打包模式
-e 限制打包环境,默认会打所有的环境下的包。用英文逗号分隔多个环境,被这个参数指定的环境才会参与打包,前提是该插件有指定环境下的包
-h, --help 查看打包命令帮助
-m 使用现代模式打包(将不支持IE)
--clean, --rm 清除所有打包产生的文件
-s 输出单个插件打包文件的sha256值,使用 -Z 参数时,此参数无效
支持缩略形式的参数,如 -cZ 相当于 -c -Z,其后需要跟变量的参数,写在省略形式前的会读取其后的变量值并生效
如 -iA oo 表示指定打包oo插件;-Ai oo,aa表示指定需要批量打包的插件为 oo 和 aa
`
}
module.exports = help
const program = require('commander');
const shelljs = require('shelljs');
const userHome = require('user-home');
const fs = require('fs')
const path = require('path')
const colors = require('colors');
const init = (cmd, program) => {
const moduleName = cmd.moduleName
const projectPath = path.resolve(`${process.cwd()}`, `apaas-custom-${moduleName}`)
const customPath = path.resolve(projectPath, 'src/custom');
const staticPath = path.resolve(projectPath, 'public/custom');
//检查控制台是否以运行`git `开头的命令
if (!shelljs.which('git')) {
//在控制台输出内容
console.log('error 本机上没有git,请检查git是否安装或相关环境变量是否正确'['red']);
shelljs.exit(1);
}
const version = 'v0.0.1'
const gitTemplateRepo = `${userHome}/.apaasCliRepo`
shelljs.rm('-rf', gitTemplateRepo)
shelljs.mkdir('-p', gitTemplateRepo)
shelljs.exec(`git clone --branch ${version} https://gitee.com/shiyutian/apaas-custom-vue-starter.git --depth=1 ${gitTemplateRepo}`);
shelljs.rm('-rf', path.resolve(`${gitTemplateRepo}`, '.git'))
if (fs.existsSync(projectPath)) {
// 当前路径已经在相关工程
console.log('error 当前路径已经存在工程,请检查相关目录设置'['red'])
shelljs.exit(1);
} else {
shelljs.mkdir('-p', `${process.cwd()}`)
}
shelljs.cp('-R', `${gitTemplateRepo}/.`, projectPath)
const demoCustomModuleName = 'hello'
const demoCustomModulePath = path.resolve(customPath, `apaas-custom-${demoCustomModuleName}`)
const writeAndReplaceFileSync = (filePath) => {
const stat = fs.lstatSync(filePath)
if (stat.isDirectory()) {
const customModuleFileNames = fs.readdirSync(filePath)
customModuleFileNames.forEach(fileName => {
const tempFilePath = path.join(filePath, fileName)
writeAndReplaceFileSync(tempFilePath)
})
} else {
let fileContent = fs.readFileSync(filePath, 'utf-8')
fileContent = fileContent.replace(/{{moduleName}}/g, moduleName)
fileContent = fileContent.replace(/{{ModuleName}}/g, moduleName.charAt(0).toUpperCase() + moduleName.slice(1))
fs.writeFileSync(filePath, fileContent)
}
}
writeAndReplaceFileSync(demoCustomModulePath)
fs.renameSync(demoCustomModulePath, path.resolve(customPath, `apaas-custom-${moduleName}`))
fs.renameSync(path.resolve(staticPath, `apaas-custom-${demoCustomModuleName}`), path.resolve(staticPath, `apaas-custom-${moduleName}`))
}
module.exports = init
init({ moduleName : 'nice' }, program)
\ No newline at end of file
const fs = require('fs')
const clc = require('./clc')
const file = '.256.tmp'
const os = require('os')
const push = function(code, sha256) {
fs.appendFileSync(file, code + ',' + sha256 + '\n')
}
const generate = function(code, filePath) {
try {
const platform = os.platform()
let r = ''
switch(platform) {
case 'win32':
r = shell.exec(`certutil -hashfile ${filePath} SHA256`)
push(code, r.split('\n')[1])
break
case 'darwin':
r =shell.exec(`shasum -a 256 ${filePath}`)
push(code, r.split(' ')[0])
break
case 'linux':
r = shell.exec(`sha256sum ${filePath}`)
push(code, r.split(' ')[0])
break
default:
break
}
} catch(e) {
console.error(e)
clc.red('failed to compute sha256')
}
}
const create = function() {
fs.writeFileSync(file, '')
}
const close = function() {
if (fs.existsSync(file)) fs.unlinkSync(file)
}
const show = function() {
const content = fs.readFileSync(file, { encoding: 'utf8' })
const lines = content.split('\n')
lines.forEach((line) => {
if (line) {
const [code, sha256] = line.split(',')
clc.green(`Sha256 sum of package ${code} is ${sha256}`)
}
})
}
module.exports.generate = generate
module.exports.create = create
module.exports.close = close
module.exports.push = push
module.exports.show = show
module.exports = {
extends: ['@commitlint/config-conventional']
}
module.exports = {
preset: '@vue/cli-plugin-unit-jest',
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^@examples/(.*)$': '<rootDir>/examples/$1',
'^@packages/(.*)$': '<rootDir>/packages/$1',
'\\.(css|less|sass)$': 'identity-obj-proxy'
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment