Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: update version #102

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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