feat: 3.0.5
This commit is contained in:
parent
28e1c3e9e4
commit
59ad497ee7
|
@ -87,6 +87,8 @@ function copyToNPM () {
|
|||
gulp.src(['src/cnchar/main/package.json'])
|
||||
.pipe(gulp.dest('npm/packages/cnchar'));
|
||||
|
||||
copyCncharTypes(gulpReadme);
|
||||
|
||||
alias.forEach(alia => {
|
||||
gulp.src(`src/cnchar/alias/${alia}/package.json`)
|
||||
.pipe(gulp.dest(`npm/packages/${alia}`));
|
||||
|
@ -97,6 +99,13 @@ function copyToNPM () {
|
|||
});
|
||||
}
|
||||
|
||||
function copyCncharTypes (gulpReadme) {
|
||||
gulp.src(['src/cnchar-types/**/*.ts', 'src/cnchar-types/package.json'])
|
||||
.pipe(gulp.dest('npm/packages/cnchar-types'));
|
||||
|
||||
gulpReadme.pipe(gulp.dest(`npm/packages/cnchar-types`));
|
||||
}
|
||||
|
||||
function copyLatest () {
|
||||
// gulp.src(`dist/*.${version}.min.js`)
|
||||
// .pipe(rename(function (path) {
|
||||
|
@ -126,4 +135,5 @@ function copyLatest () {
|
|||
.pipe(gulp.dest('npm/packages/hanzi-util-base'));
|
||||
}
|
||||
|
||||
|
||||
task();
|
|
@ -10,7 +10,7 @@ async function main () {
|
|||
const publish = 'npm publish ';
|
||||
const publishPackage = `${publish}npm/packages/`;
|
||||
const publishAll = `${publishPackage}cnchar-all`;
|
||||
const publishTypes = `${publish}src/cnchar-types`;
|
||||
const publishTypes = `${publishPackage}cnchar-types`;
|
||||
const publishMain = `${publishPackage}cnchar`;
|
||||
let cmds = [];
|
||||
let cmdConsole = [];
|
||||
|
@ -49,11 +49,24 @@ async function main () {
|
|||
];
|
||||
}
|
||||
console.log(`Start Publish... [0/${cmds.length}]`);
|
||||
const errorList = [];
|
||||
for (let i = 0; i < cmds.length; i++) {
|
||||
await exec(cmds[i]);
|
||||
console.log(`${cmdConsole[i]} publish success. [${i + 1}/${cmds.length}]`);
|
||||
const {success, stderr} = await exec(cmds[i]); {
|
||||
if (success) {
|
||||
console.log(`${cmdConsole[i]} publish success. [${i + 1}/${cmds.length}]`);
|
||||
} else {
|
||||
console.log(stderr);
|
||||
console.log(`${cmdConsole[i]} publish fail!. [${i + 1}/${cmds.length}]`);
|
||||
errorList.push(cmdConsole[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log('Finished!');
|
||||
|
||||
if (errorList.length > 0) {
|
||||
console.log(`Fail Items: ${cmdConsole.toString()}`);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
main();
|
||||
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
###
|
||||
# @Author: tackchen
|
||||
# @Date: 2021-12-16 17:39:00
|
||||
# @LastEditors: tackchen
|
||||
# @FilePath: /cnchar/helper/publish.sh
|
||||
# @Description: Coding something
|
||||
###
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
# cd $(cd `dirname $0`; pwd)
|
||||
# cd ../npm/packages
|
||||
|
||||
# bast_path=$(pwd)
|
||||
|
||||
# echo "$bast_path/cnchar"
|
||||
|
||||
# packages=("cnchar" "cnchar-poly" )
|
||||
|
||||
# for package in ${packages[@]}
|
||||
# do
|
||||
# echo "The value is: $package"
|
||||
# done
|
||||
|
||||
# cd $(cd `dirname $0`; pwd)
|
||||
# cd ../npm/packages
|
||||
|
||||
# bast_path=$(pwd)
|
||||
# files=$(ls $bast_path)
|
||||
# for filename in ${files[@]}
|
||||
# do
|
||||
# echo "$bast_path/$filename"
|
||||
# done
|
|
@ -45,13 +45,14 @@ async function exec (cmd) {
|
|||
return new Promise(resolve => {
|
||||
childProcess.exec(cmd, function (error, stdout, stderr) {
|
||||
if (error) {
|
||||
throw new Error('publish error');
|
||||
resolve({success: false, stdout, stderr});
|
||||
} else {
|
||||
resolve({
|
||||
success: true,
|
||||
stdout,
|
||||
stderr
|
||||
});
|
||||
}
|
||||
resolve({
|
||||
success: true,
|
||||
stdout,
|
||||
stderr
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "cnchar-types",
|
||||
"version": "3.0.2",
|
||||
"version": "3.0.5",
|
||||
"lockfileVersion": 1
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue