Skip to content

Commit

Permalink
Merge pull request #102 from wu-component/feat/core-v2
Browse files Browse the repository at this point in the history
feature: update version
  • Loading branch information
canyuegongzi authored Dec 11, 2023
2 parents bfb7ef5 + 9ada1a0 commit 4624059
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
50 changes: 50 additions & 0 deletions component/scripts/publish.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
const shell = require('shelljs');
const shellPublish = 'pnpm -r exec npm publish --access public';
Expand All @@ -6,3 +7,52 @@ const result = shell.exec(shellPublish);
if (result.code === 0) {
console.log("publish build success");
}
*/
const shell = require('shelljs');
const path = require("path");
const fs = require("fs-extra");
const utils = require("./check/utils")
const { getTargets, getPath, bytesToSize } = utils;
const packages = getPath(`../../packages`)
let targets = getTargets(packages);

const task = () => {
targets = targets.filter(name => !["common", "theme"].includes(name));
const successList = []
const failList = []

for (let i = 0; i < targets.length; i ++) {
try {
const filePath = getPath(`${packages}/${targets[i]}`);
const pcg = require(`${packages}/${targets[i]}/package.json`);
const { version, name } = pcg
const shellPublish = `cd ${filePath} && npm publish --access public`;
//const shellPublish = `cd ${filePath}`;
const result = shell.exec(shellPublish);
if (result.code === 0) {
console.log(`${name}@${version}publish success`);
successList.push({
name,
version,
errMsg: null
})
} else {
failList.push({
name,
version,
errMsg: '发布失败'
})
}
}catch (e) {

}
}


console.log(`publish success components(${successList.length})`)
console.table(successList);
console.log(`publish fail components(${failList.length})`)
console.table(failList);
}

task()
2 changes: 1 addition & 1 deletion packages/wu-core-router/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wu-component/wu-core-router",
"version": "2.0.1",
"version": "2.0.2",
"description": "> TODO: description",
"author": "Marvin <[email protected]>",
"homepage": "",
Expand Down

0 comments on commit 4624059

Please sign in to comment.