UNPKG

kotori-bot

Version:

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

78 lines (77 loc) 2.67 kB
/** * @Package kotori-bot * @Version 1.7.3 * @Author Arimura Sena <me@hotaru.icu> * @Copyright 2024-2025 Hotaru. All rights reserved. * @License GPL-3.0 * @Link https://github.com/kotorijs/kotori * @Date 2026/2/14 15:49:07 */ "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, pub2: () => pub2 }); module.exports = __toCommonJS(pub_exports); var import_prompts = require("@inquirer/prompts"); var import_get_packages = require("@manypkg/get-packages"); var import_shelljs = require("shelljs"); var import_common = require("./common"); async function pub2() { if (await (0, import_prompts.confirm)({ default: false, message: "Are you sure you have built all packages in workspace (includes types for main packages) before publishing?" })) { (0, import_shelljs.exec)("pnpm -r publish --no-git-checks --access public"); } } 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); } } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { pub2 });