shashkovdanil / clean-publish

Removing configuration files and fields in package.json before publishing to npm

Home Page:https://www.npmjs.com/package/clean-publish

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Separate CLI API of the JS API

isuvorov opened this issue · comments

Hello everyone, thank you for such a useful package!

Have you thought about separating the CLI API (handleOptions) of the JS API (run function content)?
And makes package.json exports.

I'll explain the motivation:
Right now, I'm using clean-publish in my CLI tools with a call to process.spawn and passing a bunch of arguments, and in monorepos with 50+ packages, such spawn becomes a liitle stuck.

I posted a draft of my thoughts here:
isuvorov@16477fc

I've solved my task, but maybe this will also be useful for you.
I can do this more neatly, write typings, add usage examples in the doc and makes PR.
The only question is, do you need such functionality in principle?


Всем привет, спасибо за такой полезный пакет!

А вы не думали над тем, чтобы отделить CLI API (handleOptions) от самой реализации JS API cleanPublish (в функциии run)?
И раздать его в package.json exports;

Поясню мотивацию:
Сейчас я использую clean-publish в своих CLI инструментах вызова process.spawn и передаю туда с кучей аргументов, и в монорепах с 50+ пакетами такой вызов становится ощутимый.

Драфт моих мыслей выложил тут:
isuvorov@16477fc

Свою задачу я решил, но может вам тоже будет это полезно.
Я могу сделать это более аккуратно, прописать тайпинги, добавить примеры использования в доку и сделать PR.
Вопрос только, нужен ли вам впринципи такой функционал?

Sure! Create PR.