Security News
Highlights from the 2024 Rails Community Survey
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
@comate/plugin-host
Advanced tools
本包提供在插件进程中运行的逻辑。
对于一个Comate插件,它在构建时,不能将@comate/plugin-host
与自己的源码打包,即在使用构建工具时,需要设置@comate/plugin-host
为外部依赖(externals
)。在发布插件时,命令行工具会检查插件包的代码中是否有本项目留下的"THIS IS COMATE"
这一段字符串,如存在则禁止发布插件。
正常情况下,在Comate Engine中,运行的代码结构是这样的:
/dist
index.js # Comate Engine的主入口
/plugins # 放各种Comate插件
/foo # 每个插件一个独立目录,目录名必须和插件名称一样
package.json # 插件的描述文件
/node_modules
/@comate
/plugin-host # 本项目的内容
package.json # Comate Engine的项目根目录
在这个结构下,根据NodeJS的模块检索逻辑,插件可以顺利地通过import {} from '@comate/plugin-host'
拿到本包提供的SDK。
本项目各目录的职责如下:
internals
:一系列内部的能力实现,主要被各类Provider
所引用。providers
:提供给插件开发者的几个Provider
基类的实现。utils
:一些杂七杂八的工具函数。registry.ts
:负责在插件进程内注册和管理插件的能力。`bridge.ts
:与Engine进程通信。main.ts
:执行插件的入口,读取插件信息、注册能力、调度执行。index.ts
:导出面向插件开发者的接口。FAQs
We found that @comate/plugin-host demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.