@aglyn/plugins-marketplace

中文文档
1.19.0发布于 2026/11/07Apache-2.0TypeScriptES Module构建来源已验证近 30 天下载 9804

The Marketplace plugin for Aglyn: browsing, installing, updating and publishing marketplace listings from the console, and the server routes behind those actions. Install it if you run the Aglyn console and want the marketplace in it; it is a first-party

原始使用文档
文档目录5 节
  1. Install
  2. What's in it
  3. Usage
  4. How it fits
  5. License

@aglyn/plugins-marketplace

The Marketplace plugin for Aglyn: browsing, installing, updating and publishing marketplace listings from the console, and the server routes behind those actions. Install it if you run the Aglyn console and want the marketplace in it; it is a first-party plugin, not a standalone library.

Published to npm from the Aglyn monorepo. Versions follow semantic versioning.

Install

npm install @aglyn/plugins-marketplace

Peer dependencies: react, @mui/material, firebase, next, and firebase-admin for the server entry.

What's in it

On a published site. Nothing of its own. What a listing installs (a component, site template, layout, theme, dataset schema, email template, email starter or plugin) is copied into the site's own collections and renders through the normal pipeline, so there is no separate site bundle.

Console (registerMarketplaceConsole, the console registrar in plugins.config.json). The Marketplace hub at /[orgSlug]/marketplace is one orgNavItems entry, served by the console's generic org plugin route: browse, installed, licenses, and the seller sections. The report and review queues are staffPages. On console pages that are not the marketplace, it draws into widget slots the console renders without importing the plugin:

  • hostArtifactPublish: the publish dialog for something a console page holds (a layout, a theme, a site template).
  • orgPluginInstalls: the workspace's installed marketplace plugins, on its Plugins page.
  • pluginInstallStatus: whether an installation runs the newest installable version, on its installation page.
  • pluginSiteSet: which sites one installation applies to.
  • sitePluginConnections: a site's connections to the services an installed plugin's manifest declares (connect, choose, sync, disconnect), on the site's page for that plugin.
  • staffOverview: recent purchases and the refund-reversal recovery queue, on the staff overview.
  • templateGallery: the "Marketplace templates" shelf of a site's template gallery, installing through install-template.
  • templateInstallStatus: "Update available" on a library row whose template it installed, re-installing through install-template.

It declares templateSource in plugins.config.json: the source.type its template install stamps, and the "Marketplace" badge a site's library shows for it.

It also registers a rating custom field type (registerCustomFieldType) with a starred input.

Server (registerMarketplaceConsoleApi, the consoleApi registrar, exported from @aglyn/plugins-marketplace/server). Routes registered with registerPluginApiRoute under the marketplace prefix:

  • Install: marketplace/install, install-plugin, install-layout, install-template, install-theme, install-dataset-schema, install-email-starter, install-email-template, and update-artifact for reconciling an installed copy with a newer published version.
  • Publish: marketplace/publish, publish-plugin, publish-layout, publish-template, publish-theme, publish-dataset-schema, publish-email-starter, publish-email-template, publisher-profile, verification-request.
  • Listings: marketplace/listing-versions, preview-image, reviews, report.
  • Paid listings: marketplace/pay (in the console, on the workspace's card on file), marketplace/checkout (the hosted page, kept for what still links to it), marketplace/connect and marketplace/publisher-standing, plus a handler on the platform billing webhook (registerBillingWebhookHandler).

The server entry also registers the server side of the rating field type, so its validators run on write paths where no client loaded the plugin.

From its server declarations it also answers the platform's kill switch for another plugin (registerPluginRevocationReader, plugin-revocations): a listing's revocation, which the campaign send path reads before it mails a design installed from that listing.

A listing type whose copies live in another plugin's storage is that plugin's to read and write: install-dataset-schema, publish-dataset-schema and update-artifact keep the listing, its gates, the purchase, the provenance stamp and the tally, and ask the type's owner for the rest through @aglyn/aglyn/plugin-manager/plugin-artifact-types (the data plugin keeps datasetSchema). With no owner in the deployment the doors refuse (501, or 503 when the declared owner did not start) before anything is written.

Exports from .

  • registerMarketplaceConsole, BUNDLE_ID ('marketplace').
  • MarketplaceBrowse, HostPluginsCard, PluginSiteSetPanel and the useMarketplaceActions hook, shared with the console's listing and publisher routes.
  • The marketplace model: MarketplaceListing, MarketplacePublisherProfile, InstallPin, ARTIFACT_TYPE_LABELS, listingArtifactLabel, installTargetsFor, resolveInstallPlan, resolvePluginInstallState, resolveUninstallTargets, validateListingContent, validatePublisherProfileContent, isValidPublisherHandle, and the artifact update helpers planArtifactUpdate and applyArtifactUpdate.

Usage

The plugin is loaded through Aglyn's plugin manager: the console's generated loader manifests import the package and call the registrars named in plugins.config.json. An app that wires plugins by hand calls them once at startup:

// console, client side
import { registerMarketplaceConsole } from '@aglyn/plugins-marketplace'
registerMarketplaceConsole()

// console, server side
import { registerMarketplaceConsoleApi } from '@aglyn/plugins-marketplace/server'
registerMarketplaceConsoleApi()

Model helpers import from the root:

import {
  listingArtifactLabel,
  validateListingContent,
  type MarketplaceListing,
} from '@aglyn/plugins-marketplace'

How it fits

A plugin package (scope:plugin). It depends on the core (@aglyn/aglyn), the tenant packages (@aglyn/tenant-runtime, @aglyn/tenant-data-admin, @aglyn/tenant-feature-instance) and generic @aglyn/shared-* packages. It imports no other plugin: the element that draws an installed marketplace plugin on a page belongs to @aglyn/plugins-mui, and the two meet through core registries. The core never imports this package; the console reaches it through the loader manifest and the slots above.

License

Apache-2.0. Source: https://github.com/aglyn/aglyn/tree/main/libs/plugins/marketplace

版本与发布记录

@aglyn/plugins-marketplace 共发布 162 个版本,首次发布于 2026/09/21;过去 12 个月发布了 162 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.19.0latest2026/11/07今天
1.18.02026/11/07今天
1.17.02026/11/07今天
1.16.02026/11/07今天
1.15.22026/11/061 天前
1.15.12026/11/061 天前

其他发布通道:beta → 1.0.0-beta.296。

关于 @aglyn/plugins-marketplace 的常见问题

@aglyn/plugins-marketplace 是什么?

The Marketplace plugin for Aglyn: browsing, installing, updating and publishing marketplace listings from the console, and the server routes behind those actions. Install it if you run the Aglyn console and want the marketplace in it; it is a first-party

如何安装 @aglyn/plugins-marketplace?

在项目目录运行 npm install @aglyn/plugins-marketplace,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:next(^16.3.3)、react(^19.2.8)、firebase(^13.0.0)、@mui/material(^9.3.1)、firebase-admin(^14.3.0)、@mui/x-data-grid(^9.12.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@aglyn/plugins-marketplace 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@aglyn/plugins-marketplace 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@aglyn/plugins-marketplace 可以商用吗?

@aglyn/plugins-marketplace 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@aglyn/plugins-marketplace 的下载量有多少?

根据 npm 官方下载统计,@aglyn/plugins-marketplace 在 2026/10/05 – 2026/11/03 这 30 天内被下载 9,804 次,日均约 327 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aglyn/plugins-marketplace 还在维护吗?

最新版本 1.19.0 发布于 2026/11/07(今天);至今共发布 162 个版本,其中过去 12 个月发布了 162 个;首次发布于 2026/09/21。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。