UNPKG

kotori-bot

Version:

Cross-platform chatbot framework base on Node.js and TypeScript

64 lines (63 loc) 2.2 kB
/** * @Package kotori-bot * @Version 1.7.0 * @Author Arimura Sena <me@hotaru.icu> * @Copyright 2024-2025 Hotaru. All rights reserved. * @License BAN-ZHINESE-USING * @Link https://github.com/kotorijs/kotori * @Date 17:26:14 */ "use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var pub_exports = {}; __export(pub_exports, { default: () => pub }); module.exports = __toCommonJS(pub_exports); var import_get_packages = require("@manypkg/get-packages"); var import_shelljs = require("shelljs"); var import_common = require("./common"); function pub(filters) { const start = Date.now(); let failed = 0; try { (0, import_common.ensureWorkspaceRoot)(); const pkgs = (0, import_get_packages.getPackagesSync)(import_common.CWD).packages.filter((pkg) => (0, import_common.matchesFilter)(pkg, filters)); if (pkgs.length === 0) { console.log("No packages matched the filter criteria"); return; } console.log(`Publishing ${pkgs.length} packages...`); for (const pkg of pkgs) { try { (0, import_shelljs.cd)(pkg.dir); (0, import_shelljs.exec)("pnpm publish --no-git-checks --access=public"); } catch (err) { failed += 1; console.error(err); } } console.log( `Publish summary: ${pkgs.length === failed} succeed, ${failed} failed, in ${(Date.now() - start) / 1e3}s.` ); } catch (err) { console.error("Publish failed.", err); process.exit(1); } }