简体   繁体   English

带有纱线工作区的 Oclif

[英]Oclif with yarn workspaces

I have a node / typescript application that leverages yarn workspaces.我有一个利用纱线工作区的节点/typescript 应用程序。 We are also using oclif for our cli.我们还在 cli 中使用 oclif。

I want to set up an architecutre where my main cli can leverge cli-plugins from the domains我想建立一个架构,我的主要 cli 可以利用域中的 cli 插件

\domains
    \emailService
        package.json
        \emailServiceCLIPlugin
           package.json
    \authenationService 
        package.json
        \AuthenticationServiceCLIPlugin
           package.json
\cli (my mainCLI)
   package.json. <--- in here I would like to plugin in the above two CLIPlugin packages

Is this possible?这可能吗? Or there there another good pattern that I can put into effect to get the commands from these domain libraries into my core CLI或者我可以实施另一种好的模式,将这些域库中的命令导入我的核心 CLI

This is possible.这个有可能。

You just need to add a glob pattern in your root package.json workspaces setting.您只需在根 package.json 工作区设置中添加一个全局模式。 then you can reference your package in the cli plugin array然后您可以在 cli 插件数组中引用您的 package

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM