@aglyn/plugins-marketplace 1.0.0-beta.143 → 1.0.0-beta.145
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -6
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -1,7 +1,71 @@
|
|
|
1
|
-
# @aglyn/plugins-
|
|
1
|
+
# @aglyn/plugins-marketplace
|
|
2
2
|
|
|
3
|
-
The
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
> Beta. Published from the Aglyn monorepo under the `beta` dist-tag; APIs can change between beta releases.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
npm install @aglyn/plugins-marketplace@beta
|
|
10
|
+
|
|
11
|
+
Peer dependencies: `react`, `@mui/material`, `firebase`, `next`, and `firebase-admin` for the server entry.
|
|
12
|
+
|
|
13
|
+
## What's in it
|
|
14
|
+
|
|
15
|
+
**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.
|
|
16
|
+
|
|
17
|
+
**Console** (`registerMarketplaceConsole`, the `console` registrar in `plugins.config.json`). The plugin adds no nav item. It exposes its UI through widget slots that the console app renders without importing the plugin:
|
|
18
|
+
|
|
19
|
+
- `orgMarketplace`: browse and install, at organization scope.
|
|
20
|
+
- `marketplaceListing`: the content of one listing's detail page.
|
|
21
|
+
- `orgAddons`: the installed add-ons card, with upgrade, uninstall and sharing an install with the whole organization.
|
|
22
|
+
- `pluginSiteSet`: which sites one installation applies to.
|
|
23
|
+
|
|
24
|
+
It also registers a `rating` custom field type (`registerCustomFieldType`) with a starred input.
|
|
25
|
+
|
|
26
|
+
**Server** (`registerMarketplaceConsoleApi`, the `consoleApi` registrar, exported from `@aglyn/plugins-marketplace/server`). Routes registered with `registerPluginApiRoute` under the `marketplace` prefix:
|
|
27
|
+
|
|
28
|
+
- 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.
|
|
29
|
+
- Publish: `marketplace/publish`, `publish-plugin`, `publish-layout`, `publish-template`, `publish-theme`, `publish-dataset-schema`, `publish-email-starter`, `publish-email-template`, `publisher-profile`, `verification-request`.
|
|
30
|
+
- Listings: `marketplace/listing-versions`, `preview-image`, `reviews`, `report`.
|
|
31
|
+
- Paid listings: `marketplace/checkout` and `marketplace/connect`, plus a handler on the platform billing webhook (`registerBillingWebhookHandler`).
|
|
32
|
+
|
|
33
|
+
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.
|
|
34
|
+
|
|
35
|
+
**Exports from `.`**
|
|
36
|
+
|
|
37
|
+
- `registerMarketplaceConsole`, `BUNDLE_ID` (`'marketplace'`).
|
|
38
|
+
- `MarketplaceBrowse`, `HostPluginsCard`, `PluginSiteSetPanel` and the `useMarketplaceActions` hook, shared with the console's listing and publisher routes.
|
|
39
|
+
- 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`.
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
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:
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
// console, client side
|
|
47
|
+
import { registerMarketplaceConsole } from '@aglyn/plugins-marketplace'
|
|
48
|
+
registerMarketplaceConsole()
|
|
49
|
+
|
|
50
|
+
// console, server side
|
|
51
|
+
import { registerMarketplaceConsoleApi } from '@aglyn/plugins-marketplace/server'
|
|
52
|
+
registerMarketplaceConsoleApi()
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Model helpers import from the root:
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import {
|
|
59
|
+
listingArtifactLabel,
|
|
60
|
+
validateListingContent,
|
|
61
|
+
type MarketplaceListing,
|
|
62
|
+
} from '@aglyn/plugins-marketplace'
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## How it fits
|
|
66
|
+
|
|
67
|
+
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.
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
Apache-2.0. Source: https://github.com/aglyn/aglyn/tree/main/libs/plugins/marketplace
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/plugins-marketplace",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.145",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/aglyn": "1.0.0-beta.
|
|
29
|
-
"@aglyn/shared-data-mdi": "1.0.0-beta.
|
|
30
|
-
"@aglyn/shared-ui-jsx": "1.0.0-beta.
|
|
31
|
-
"@aglyn/shared-ui-next": "1.0.0-beta.
|
|
32
|
-
"@aglyn/shared-ui-snackstack": "1.0.0-beta.
|
|
33
|
-
"@aglyn/shared-util-email": "1.0.0-beta.
|
|
34
|
-
"@aglyn/shared-util-http": "1.0.0-beta.
|
|
35
|
-
"@aglyn/tenant-data-admin": "1.0.0-beta.
|
|
36
|
-
"@aglyn/tenant-feature-instance": "1.0.0-beta.
|
|
37
|
-
"@aglyn/tenant-runtime": "1.0.0-beta.
|
|
28
|
+
"@aglyn/aglyn": "1.0.0-beta.145",
|
|
29
|
+
"@aglyn/shared-data-mdi": "1.0.0-beta.145",
|
|
30
|
+
"@aglyn/shared-ui-jsx": "1.0.0-beta.145",
|
|
31
|
+
"@aglyn/shared-ui-next": "1.0.0-beta.145",
|
|
32
|
+
"@aglyn/shared-ui-snackstack": "1.0.0-beta.145",
|
|
33
|
+
"@aglyn/shared-util-email": "1.0.0-beta.145",
|
|
34
|
+
"@aglyn/shared-util-http": "1.0.0-beta.145",
|
|
35
|
+
"@aglyn/tenant-data-admin": "1.0.0-beta.145",
|
|
36
|
+
"@aglyn/tenant-feature-instance": "1.0.0-beta.145",
|
|
37
|
+
"@aglyn/tenant-runtime": "1.0.0-beta.145",
|
|
38
38
|
"@swc/helpers": "0.5.23"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|