From 9ada1a0386f82a806dae829cd91c33dbcaab5894 Mon Sep 17 00:00:00 2001 From: fei Date: Mon, 11 Dec 2023 22:56:19 +0800 Subject: [PATCH] feature: update version --- component/scripts/publish.ts | 50 ++++++++++++++++++++++++++++ packages/wu-core-router/package.json | 2 +- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/component/scripts/publish.ts b/component/scripts/publish.ts index 0440f759..f9dfff54 100644 --- a/component/scripts/publish.ts +++ b/component/scripts/publish.ts @@ -1,3 +1,4 @@ +/* const shell = require('shelljs'); const shellPublish = 'pnpm -r exec npm publish --access public'; @@ -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() diff --git a/packages/wu-core-router/package.json b/packages/wu-core-router/package.json index d9ecdc37..e48c55c8 100644 --- a/packages/wu-core-router/package.json +++ b/packages/wu-core-router/package.json @@ -1,6 +1,6 @@ { "name": "@wu-component/wu-core-router", - "version": "2.0.1", + "version": "2.0.2", "description": "> TODO: description", "author": "Marvin ", "homepage": "",