fix: publish script (#5573)

* fix: publish script

* fix: publish script
This commit is contained in:
ClarkXia 2022-11-17 15:00:51 +08:00 committed by GitHub
parent 9c9f8c26c8
commit 2dd157c101
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 4 deletions

View File

@ -19,7 +19,7 @@
"version": "tsx ./scripts/tagVersion.ts",
"version:check": "tsx ./scripts/versionCheck.ts",
"lint": "eslint --cache --ext .js,.jsx,.ts,.tsx ./",
"publish": "tsx ./scripts/publishPackageWithDistTag.ts",
"publish": "tsx ./scripts/publishPackage.ts",
"publish:beta": "PUBLISH_TYPE=beta tsx ./scripts/publishPackageWithDistTag.ts",
"publish:release": "PUBLISH_TYPE=release VERSION_PREFIX=rc tsx ./scripts/publishPackageWithDistTag.ts",
"cov": "vitest run --coverage",

View File

@ -2,6 +2,7 @@
"name": "@ice/miniapp-html-styles",
"version": "1.0.0",
"description": "html styles for ice miniapp",
"main": "./html.css",
"exports": {
"./html": "./html.css",
"./html5": "./html5.css"

View File

@ -2,7 +2,7 @@
* Scripts to check unpublished version and run publish
*/
import { spawnSync } from 'child_process';
import { setPublishedPackages } from './published-info';
import { setPublishedPackages } from './publishedInfo';
import type { IPackageInfo } from './getPackageInfos';
import { getPackageInfos } from './getPackageInfos';
@ -25,7 +25,7 @@ console.log('[PUBLISH] Start:');
getPackageInfos(publishTag).then((packageInfos: IPackageInfo[]) => {
// Publish
let publishedCount = 0;
const publishedPackages = [];
const publishedPackages: string[] = [];
for (let i = 0; i < packageInfos.length; i++) {
const { name, directory, localVersion, shouldPublish } = packageInfos[i];
if (shouldPublish) {

View File

@ -94,7 +94,7 @@ getPackageInfos(publishTag).then((packageInfos: IPackageInfo[]) => {
// Publish
let publishedCount = 0;
const publishedPackages = [];
const publishedPackages: string[] = [];
shouldPublishPackages.forEach((packageInfo) => {
const { name, directory, distTagVersion } = packageInfo;
publishedCount++;
@ -105,5 +105,6 @@ getPackageInfos(publishTag).then((packageInfos: IPackageInfo[]) => {
console.log(`[PUBLISH PACKAGE ${PUBLISH_TYPE.toUpperCase()}] Complete (count=${publishedCount}):`);
console.log(`${publishedPackages.join('\n')}`);
console.log(`[TNPM SYNC PACKAGES] tnpm sync ${publishedPackages.map((p: string) => p.split(':')[0]).join(' ')}`);
setPublishedPackages(publishedPackages);
});