npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@comate/plugin-host

v0.9.2

Published

本包提供在插件进程中运行的逻辑。

Downloads

7

Readme

Comate插件宿主运行时

本包提供在插件进程中运行的逻辑。

使用时目录结构

对于一个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:导出面向插件开发者的接口。