@dxos/plugin-registry 0.9.0 → 0.9.1-staging.ee54ba693a
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/dist/lib/neutral/RegistryPlugin.node.mjs +709 -18
- package/dist/lib/neutral/RegistryPlugin.node.mjs.map +4 -4
- package/dist/lib/neutral/chunk-ZY37XLVF.mjs +46 -0
- package/dist/lib/neutral/chunk-ZY37XLVF.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +1 -1
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/{open-plugin-registry-II735N76.mjs → open-plugin-registry-ID7LV3SF.mjs} +3 -3
- package/dist/lib/neutral/open-plugin-registry-ID7LV3SF.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +2 -2
- package/dist/lib/neutral/translations.mjs +6 -6
- package/dist/lib/neutral/translations.mjs.map +3 -3
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +4 -12
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -10
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/categories.d.ts.map +1 -1
- package/dist/types/src/commands/index.d.ts +2 -2
- package/dist/types/src/commands/index.d.ts.map +1 -1
- package/dist/types/src/commands/plugin/disable.d.ts.map +1 -0
- package/dist/types/src/commands/plugin/enable.d.ts.map +1 -0
- package/dist/types/src/commands/plugin/index.d.ts +3 -0
- package/dist/types/src/commands/plugin/index.d.ts.map +1 -0
- package/dist/types/src/commands/plugin/list.d.ts.map +1 -0
- package/dist/types/src/commands/plugin/util.d.ts.map +1 -0
- package/dist/types/src/commands/registry/index.d.ts +16 -0
- package/dist/types/src/commands/registry/index.d.ts.map +1 -0
- package/dist/types/src/commands/registry/publish-package.d.ts +29 -0
- package/dist/types/src/commands/registry/publish-package.d.ts.map +1 -0
- package/dist/types/src/commands/registry/publish-publisher.d.ts +19 -0
- package/dist/types/src/commands/registry/publish-publisher.d.ts.map +1 -0
- package/dist/types/src/commands/registry/publish.d.ts +25 -0
- package/dist/types/src/commands/registry/publish.d.ts.map +1 -0
- package/dist/types/src/commands/registry/records.d.ts +14 -0
- package/dist/types/src/commands/registry/records.d.ts.map +1 -0
- package/dist/types/src/commands/registry/unpublish.d.ts +15 -0
- package/dist/types/src/commands/registry/unpublish.d.ts.map +1 -0
- package/dist/types/src/commands/registry/util.d.ts +113 -0
- package/dist/types/src/commands/registry/util.d.ts.map +1 -0
- package/dist/types/src/commands/registry/verify.d.ts +20 -0
- package/dist/types/src/commands/registry/verify.d.ts.map +1 -0
- package/dist/types/src/components/PluginDetail/PluginDetail.d.ts +2 -2
- package/dist/types/src/components/PluginDetail/PluginDetail.d.ts.map +1 -1
- package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts +6 -5
- package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts.map +1 -1
- package/dist/types/src/components/PluginFailureBadge/PluginFailureBadge.d.ts +1 -3
- package/dist/types/src/components/PluginFailureBadge/PluginFailureBadge.d.ts.map +1 -1
- package/dist/types/src/components/PluginList/PluginItem.d.ts.map +1 -1
- package/dist/types/src/components/PluginList/PluginList.d.ts.map +1 -1
- package/dist/types/src/components/PluginList/PluginList.stories.d.ts +5 -5
- package/dist/types/src/components/PluginList/PluginList.stories.d.ts.map +1 -1
- package/dist/types/src/components/RegistrySettings/RegistrySettings.d.ts +5 -1
- package/dist/types/src/components/RegistrySettings/RegistrySettings.d.ts.map +1 -1
- package/dist/types/src/components/RegistrySettings/RegistrySettings.stories.d.ts +78 -0
- package/dist/types/src/components/RegistrySettings/RegistrySettings.stories.d.ts.map +1 -0
- package/dist/types/src/containers/LoadPluginDialog/LoadPluginDialog.d.ts.map +1 -1
- package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts.map +1 -1
- package/dist/types/src/containers/PublicRegistryArticle/PublicRegistryArticle.d.ts.map +1 -1
- package/dist/types/src/containers/PublicRegistryArticle/index.d.ts +1 -1
- package/dist/types/src/containers/PublicRegistryArticle/index.d.ts.map +1 -1
- package/dist/types/src/containers/RegistryArticle/index.d.ts +1 -1
- package/dist/types/src/containers/RegistryArticle/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useAutoTags.d.ts +2 -2
- package/dist/types/src/hooks/useAutoTags.d.ts.map +1 -1
- package/dist/types/src/hooks/useCatalogEntry.d.ts +4 -5
- package/dist/types/src/hooks/useCatalogEntry.d.ts.map +1 -1
- package/dist/types/src/hooks/usePluginActions.d.ts +3 -3
- package/dist/types/src/hooks/usePluginActions.d.ts.map +1 -1
- package/dist/types/src/hooks/useUpdateAvailable.d.ts +2 -2
- package/dist/types/src/hooks/useUpdateAvailable.d.ts.map +1 -1
- package/dist/types/src/hooks/useVersionPicker.d.ts +7 -8
- package/dist/types/src/hooks/useVersionPicker.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +32 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/open-plugin-registry.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +5 -5
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +20 -0
- package/package.json +40 -33
- package/src/RegistryPlugin.node.ts +2 -2
- package/src/RegistryPlugin.test.ts +1 -1
- package/src/capabilities/app-graph-builder.ts +46 -41
- package/src/capabilities/dev-plugin-loader.ts +1 -1
- package/src/capabilities/react-surface.tsx +1 -4
- package/src/capabilities/settings.ts +2 -2
- package/src/categories.ts +5 -4
- package/src/commands/index.ts +2 -10
- package/src/commands/{disable.ts → plugin/disable.ts} +3 -3
- package/src/commands/{enable.ts → plugin/enable.ts} +3 -3
- package/src/commands/plugin/index.ts +14 -0
- package/src/commands/{list.ts → plugin/list.ts} +4 -4
- package/src/commands/registry/index.ts +30 -0
- package/src/commands/registry/publish-package.ts +119 -0
- package/src/commands/registry/publish-publisher.ts +73 -0
- package/src/commands/registry/publish.ts +278 -0
- package/src/commands/registry/records.ts +73 -0
- package/src/commands/registry/unpublish.ts +70 -0
- package/src/commands/registry/util.ts +395 -0
- package/src/commands/registry/verify.ts +76 -0
- package/src/components/DisableDependentsAlert/DisableDependentsAlert.tsx +1 -1
- package/src/components/PluginDetail/PluginDetail.stories.tsx +31 -15
- package/src/components/PluginDetail/PluginDetail.tsx +21 -23
- package/src/components/PluginFailureBadge/PluginFailureBadge.tsx +21 -24
- package/src/components/PluginList/PluginItem.tsx +16 -11
- package/src/components/PluginList/PluginList.stories.tsx +1 -2
- package/src/components/PluginList/PluginList.tsx +18 -13
- package/src/components/RegistrySettings/RegistrySettings.stories.tsx +45 -0
- package/src/components/RegistrySettings/RegistrySettings.tsx +44 -33
- package/src/containers/BaseRegistryArticle/BaseRegistryArticle.tsx +2 -2
- package/src/containers/LoadPluginDialog/LoadPluginDialog.tsx +3 -3
- package/src/containers/PluginArticle/PluginArticle.tsx +8 -6
- package/src/containers/PublicRegistryArticle/PublicRegistryArticle.tsx +35 -28
- package/src/containers/PublicRegistryArticle/index.ts +1 -1
- package/src/containers/RegistryArticle/RegistryArticle.tsx +1 -1
- package/src/containers/RegistryArticle/index.ts +1 -1
- package/src/containers/RegistrySettingsContainer/RegistrySettingsContainer.tsx +2 -2
- package/src/hooks/useAutoTags.ts +3 -3
- package/src/hooks/useCatalogEntry.ts +6 -7
- package/src/hooks/useDisableConfirmation.ts +1 -1
- package/src/hooks/usePluginActions.ts +13 -11
- package/src/hooks/useUpdateAvailable.ts +5 -5
- package/src/hooks/useVersionPicker.ts +22 -30
- package/src/meta.ts +6 -15
- package/src/operations/open-plugin-registry.ts +2 -2
- package/src/translations.ts +6 -6
- package/src/types.ts +3 -1
- package/dist/lib/neutral/chunk-GRQI6MLI.mjs +0 -36
- package/dist/lib/neutral/chunk-GRQI6MLI.mjs.map +0 -7
- package/dist/lib/neutral/open-plugin-registry-II735N76.mjs.map +0 -7
- package/dist/types/src/commands/disable.d.ts.map +0 -1
- package/dist/types/src/commands/enable.d.ts.map +0 -1
- package/dist/types/src/commands/list.d.ts.map +0 -1
- package/dist/types/src/commands/util.d.ts.map +0 -1
- /package/dist/types/src/commands/{disable.d.ts → plugin/disable.d.ts} +0 -0
- /package/dist/types/src/commands/{enable.d.ts → plugin/enable.d.ts} +0 -0
- /package/dist/types/src/commands/{list.d.ts → plugin/list.d.ts} +0 -0
- /package/dist/types/src/commands/{util.d.ts → plugin/util.d.ts} +0 -0
- /package/src/commands/{util.ts → plugin/util.ts} +0 -0
package/src/hooks/useAutoTags.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Plugin, UrlLoader } from '@dxos/app-framework';
|
|
8
8
|
|
|
9
9
|
import { getRemotePluginIds } from '../categories';
|
|
10
10
|
|
|
@@ -21,7 +21,7 @@ export type AutoTagsMap = Record<string, readonly string[]>;
|
|
|
21
21
|
* Reads the persisted remote-plugin entries synchronously to derive `local`, and
|
|
22
22
|
* adds `registry` for any plugin id found in the supplied registry manifest entries.
|
|
23
23
|
*/
|
|
24
|
-
export const useAutoTags = (registryEntries: readonly
|
|
24
|
+
export const useAutoTags = (registryEntries: readonly Plugin.Meta[]): AutoTagsMap =>
|
|
25
25
|
useMemo(() => {
|
|
26
26
|
const byId: Record<string, string[]> = {};
|
|
27
27
|
const addTag = (id: string, tag: string) => {
|
|
@@ -39,7 +39,7 @@ export const useAutoTags = (registryEntries: readonly Registry.Plugin[]): AutoTa
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
for (const entry of registryEntries) {
|
|
42
|
-
addTag(entry.
|
|
42
|
+
addTag(entry.profile.key, 'registry');
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
return byId;
|
|
@@ -4,22 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
8
8
|
|
|
9
9
|
import { useRegistryPlugins } from './useRegistryPlugins';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* Resolves the registry catalog entry for a plugin by id, plus the
|
|
13
|
-
*
|
|
12
|
+
* Resolves the registry catalog entry for a plugin by id, plus the `moduleUrl`
|
|
13
|
+
* the install/update actions need.
|
|
14
14
|
*/
|
|
15
15
|
export const useCatalogEntry = (
|
|
16
16
|
pluginId: string,
|
|
17
17
|
): {
|
|
18
|
-
catalogEntry:
|
|
18
|
+
catalogEntry: Plugin.Meta | undefined;
|
|
19
19
|
moduleUrl: string | undefined;
|
|
20
|
-
repo: string | undefined;
|
|
21
20
|
} => {
|
|
22
21
|
const { entries } = useRegistryPlugins();
|
|
23
|
-
const catalogEntry = useMemo(() => entries.find((entry) => entry.
|
|
24
|
-
return { catalogEntry, moduleUrl: catalogEntry?.moduleUrl
|
|
22
|
+
const catalogEntry = useMemo(() => entries.find((entry) => entry.profile.key === pluginId), [entries, pluginId]);
|
|
23
|
+
return { catalogEntry, moduleUrl: catalogEntry?.release?.moduleUrl };
|
|
25
24
|
};
|
|
@@ -37,7 +37,7 @@ export const useDisableConfirmation = (manager: PluginManager.PluginManager, dis
|
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
const resolveName = (id: string): string =>
|
|
40
|
-
manager.getPlugins().find((plugin) => plugin.meta.
|
|
40
|
+
manager.getPlugins().find((plugin) => plugin.meta.profile.key === id)?.meta.profile.name ?? id;
|
|
41
41
|
void invokePromise(LayoutOperation.UpdateDialog, {
|
|
42
42
|
subject: DISABLE_DEPENDENTS_DIALOG,
|
|
43
43
|
state: true,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import { useCallback, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type
|
|
8
|
+
import { type Plugin, type PluginManager, UrlLoader } from '@dxos/app-framework';
|
|
9
9
|
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
10
10
|
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
11
11
|
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
@@ -21,8 +21,8 @@ export type PluginActionsProps = {
|
|
|
21
21
|
pluginId: string;
|
|
22
22
|
isInstalled: boolean;
|
|
23
23
|
moduleUrl: string | undefined;
|
|
24
|
-
catalogEntry:
|
|
25
|
-
pickerVersions: readonly
|
|
24
|
+
catalogEntry: Plugin.Meta | undefined;
|
|
25
|
+
pickerVersions: readonly Plugin.Release[];
|
|
26
26
|
selectedVersionTag: string | undefined;
|
|
27
27
|
syncInstalledVersion: () => void;
|
|
28
28
|
};
|
|
@@ -101,9 +101,9 @@ export const usePluginActions = ({
|
|
|
101
101
|
setInstalling(true);
|
|
102
102
|
void Effect.gen(function* () {
|
|
103
103
|
const added = yield* manager.add(moduleUrl);
|
|
104
|
-
yield* manager.enable(added.meta.
|
|
105
|
-
if (catalogEntry) {
|
|
106
|
-
UrlLoader.setInstalledVersion(added.meta.
|
|
104
|
+
yield* manager.enable(added.meta.profile.key);
|
|
105
|
+
if (catalogEntry?.release?.version) {
|
|
106
|
+
UrlLoader.setInstalledVersion(added.meta.profile.key, catalogEntry.release.version);
|
|
107
107
|
}
|
|
108
108
|
}).pipe(
|
|
109
109
|
Effect.ensuring(
|
|
@@ -125,8 +125,10 @@ export const usePluginActions = ({
|
|
|
125
125
|
void Effect.gen(function* () {
|
|
126
126
|
yield* manager.remove(pluginId);
|
|
127
127
|
const added = yield* manager.add(moduleUrl);
|
|
128
|
-
yield* manager.enable(added.meta.
|
|
129
|
-
|
|
128
|
+
yield* manager.enable(added.meta.profile.key);
|
|
129
|
+
if (catalogEntry.release?.version) {
|
|
130
|
+
UrlLoader.setInstalledVersion(added.meta.profile.key, catalogEntry.release.version);
|
|
131
|
+
}
|
|
130
132
|
}).pipe(
|
|
131
133
|
Effect.ensuring(
|
|
132
134
|
Effect.sync(() => {
|
|
@@ -139,7 +141,7 @@ export const usePluginActions = ({
|
|
|
139
141
|
}, [manager, pluginId, moduleUrl, catalogEntry, syncInstalledVersion]);
|
|
140
142
|
|
|
141
143
|
const handleInstallVersion = useCallback(() => {
|
|
142
|
-
const version = pickerVersions.find((candidate) => candidate.
|
|
144
|
+
const version = pickerVersions.find((candidate) => candidate.version === selectedVersionTag);
|
|
143
145
|
if (!version || !version.moduleUrl) {
|
|
144
146
|
return;
|
|
145
147
|
}
|
|
@@ -151,8 +153,8 @@ export const usePluginActions = ({
|
|
|
151
153
|
yield* manager.remove(pluginId);
|
|
152
154
|
}
|
|
153
155
|
const added = yield* manager.add(version.moduleUrl);
|
|
154
|
-
yield* manager.enable(added.meta.
|
|
155
|
-
UrlLoader.setInstalledVersion(added.meta.
|
|
156
|
+
yield* manager.enable(added.meta.profile.key);
|
|
157
|
+
UrlLoader.setInstalledVersion(added.meta.profile.key, version.version);
|
|
156
158
|
}).pipe(
|
|
157
159
|
Effect.ensuring(
|
|
158
160
|
Effect.sync(() => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2026 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Plugin, UrlLoader } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Returns a set of plugin ids for which the registry has a newer version
|
|
@@ -19,12 +19,12 @@ import { type Registry, UrlLoader } from '@dxos/app-framework';
|
|
|
19
19
|
* reappears after Updating…"). The loop is O(catalog size) sync reads — cheap
|
|
20
20
|
* enough to do every render.
|
|
21
21
|
*/
|
|
22
|
-
export const useUpdateAvailableIds = (entries: readonly
|
|
22
|
+
export const useUpdateAvailableIds = (entries: readonly Plugin.Meta[]): ReadonlySet<string> => {
|
|
23
23
|
const ids = new Set<string>();
|
|
24
24
|
for (const entry of entries) {
|
|
25
|
-
const installedVersion = UrlLoader.getInstalledVersion(entry.
|
|
26
|
-
if (installedVersion !== undefined && installedVersion !== entry.version) {
|
|
27
|
-
ids.add(entry.
|
|
25
|
+
const installedVersion = UrlLoader.getInstalledVersion(entry.profile.key);
|
|
26
|
+
if (installedVersion !== undefined && installedVersion !== entry.release?.version) {
|
|
27
|
+
ids.add(entry.profile.key);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
return ids;
|
|
@@ -5,53 +5,45 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import { type Dispatch, type SetStateAction, useEffect, useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type Registry, UrlLoader } from '@dxos/app-framework';
|
|
8
|
+
import { type Plugin, type Registry, UrlLoader } from '@dxos/app-framework';
|
|
9
9
|
import { EffectEx } from '@dxos/effect';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Owns the version picker's state machine: fetches the available versions list
|
|
13
|
-
* from the provider
|
|
14
|
-
*
|
|
15
|
-
* an external update doesn't strand the trigger on a
|
|
16
|
-
* available
|
|
13
|
+
* from the provider (served from the inlined `releases` array on each entry —
|
|
14
|
+
* no separate endpoint needed) and keeps the selection clamped to whatever's
|
|
15
|
+
* currently in the list so an external update doesn't strand the trigger on a
|
|
16
|
+
* tag that's no longer available.
|
|
17
17
|
*/
|
|
18
18
|
export const useVersionPicker = ({
|
|
19
19
|
provider,
|
|
20
20
|
pluginId,
|
|
21
|
-
repo,
|
|
22
21
|
moduleUrl,
|
|
23
22
|
installedVersionTag,
|
|
24
23
|
}: {
|
|
25
24
|
provider: Registry.Manager;
|
|
26
25
|
pluginId: string;
|
|
27
|
-
repo: string | undefined;
|
|
28
26
|
moduleUrl: string | undefined;
|
|
29
27
|
installedVersionTag: string | undefined;
|
|
30
28
|
}): {
|
|
31
|
-
pickerVersions: readonly
|
|
29
|
+
pickerVersions: readonly Plugin.Release[];
|
|
32
30
|
selectedVersionTag: string | undefined;
|
|
33
31
|
setSelectedVersionTag: Dispatch<SetStateAction<string | undefined>>;
|
|
34
32
|
} => {
|
|
35
|
-
const [versions, setVersions] = useState<readonly
|
|
33
|
+
const [versions, setVersions] = useState<readonly Plugin.Release[]>([]);
|
|
36
34
|
const [selectedVersionTag, setSelectedVersionTag] = useState<string | undefined>();
|
|
37
35
|
|
|
38
|
-
// Load version list
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
// `cancelled` flag guards against a stale in-flight `listVersions`
|
|
42
|
-
// response overwriting the newer state after `repo`/`pluginId` changes.
|
|
36
|
+
// Load version list whenever pluginId changes. The `cancelled` flag guards
|
|
37
|
+
// against a stale in-flight response overwriting newer state when the user
|
|
38
|
+
// navigates between plugins quickly.
|
|
43
39
|
useEffect(() => {
|
|
44
|
-
if (!repo) {
|
|
45
|
-
setVersions([]);
|
|
46
|
-
setSelectedVersionTag(undefined);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
// Clear stale picker state before fetching so the UI doesn't display the
|
|
50
|
-
// previous plugin's versions/selection while `listVersions` is pending.
|
|
51
40
|
setVersions([]);
|
|
52
41
|
setSelectedVersionTag(undefined);
|
|
42
|
+
if (!pluginId) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
53
45
|
let cancelled = false;
|
|
54
|
-
void provider.listVersions(
|
|
46
|
+
void provider.listVersions(pluginId).pipe(
|
|
55
47
|
Effect.match({
|
|
56
48
|
onSuccess: (vs) => {
|
|
57
49
|
if (cancelled) {
|
|
@@ -60,7 +52,7 @@ export const useVersionPicker = ({
|
|
|
60
52
|
setVersions(vs);
|
|
61
53
|
// Default selection: the currently installed version, or the latest.
|
|
62
54
|
const installedVersion = UrlLoader.getInstalledVersion(pluginId);
|
|
63
|
-
setSelectedVersionTag(installedVersion ?? vs[0]?.
|
|
55
|
+
setSelectedVersionTag(installedVersion ?? vs[0]?.version);
|
|
64
56
|
},
|
|
65
57
|
onFailure: () => {
|
|
66
58
|
if (cancelled) {
|
|
@@ -75,19 +67,19 @@ export const useVersionPicker = ({
|
|
|
75
67
|
return () => {
|
|
76
68
|
cancelled = true;
|
|
77
69
|
};
|
|
78
|
-
}, [provider,
|
|
70
|
+
}, [provider, pluginId]);
|
|
79
71
|
|
|
80
72
|
// Make sure the picker always lists the installed version, even if the catalog
|
|
81
73
|
// hasn't surfaced it (the current `listVersions` stub only returns latest).
|
|
82
|
-
const pickerVersions = useMemo<readonly
|
|
74
|
+
const pickerVersions = useMemo<readonly Plugin.Release[]>(() => {
|
|
83
75
|
if (!installedVersionTag) {
|
|
84
76
|
return versions;
|
|
85
77
|
}
|
|
86
|
-
if (versions.some((entry) => entry.
|
|
78
|
+
if (versions.some((entry) => entry.version === installedVersionTag)) {
|
|
87
79
|
return versions;
|
|
88
80
|
}
|
|
89
|
-
const installedEntry:
|
|
90
|
-
|
|
81
|
+
const installedEntry: Plugin.Release = {
|
|
82
|
+
version: installedVersionTag,
|
|
91
83
|
// Picker won't be re-installing this entry unless the user selects + clicks Install,
|
|
92
84
|
// and the catalog moduleUrl is the closest stand-in we have.
|
|
93
85
|
moduleUrl: moduleUrl ?? '',
|
|
@@ -102,10 +94,10 @@ export const useVersionPicker = ({
|
|
|
102
94
|
if (pickerVersions.length === 0) {
|
|
103
95
|
return;
|
|
104
96
|
}
|
|
105
|
-
if (selectedVersionTag && pickerVersions.some((entry) => entry.
|
|
97
|
+
if (selectedVersionTag && pickerVersions.some((entry) => entry.version === selectedVersionTag)) {
|
|
106
98
|
return;
|
|
107
99
|
}
|
|
108
|
-
setSelectedVersionTag(installedVersionTag ?? pickerVersions[0]?.
|
|
100
|
+
setSelectedVersionTag(installedVersionTag ?? pickerVersions[0]?.version);
|
|
109
101
|
}, [pickerVersions, selectedVersionTag, installedVersionTag]);
|
|
110
102
|
|
|
111
103
|
return { pickerVersions, selectedVersionTag, setSelectedVersionTag };
|
package/src/meta.ts
CHANGED
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Plugin } from '@dxos/app-framework';
|
|
6
|
-
import {
|
|
6
|
+
import { Paths } from '@dxos/app-toolkit';
|
|
7
7
|
import { DXN } from '@dxos/keys';
|
|
8
|
-
import { trim } from '@dxos/util';
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
import config from '../dx.config';
|
|
10
|
+
|
|
11
|
+
export const REGISTRY_ID = Paths.pinnedWorkspaceId('dxos:plugin-registry');
|
|
11
12
|
export const REGISTRY_KEY = 'plugin-registry';
|
|
12
13
|
|
|
13
14
|
// TODO(wittjosiah): Should this be a special separator or use the standard path separator?
|
|
@@ -31,17 +32,7 @@ export const getPluginPath = (pluginId: string): string => `root/${REGISTRY_ID}/
|
|
|
31
32
|
*/
|
|
32
33
|
export const getPluginSpecPath = (pluginId: string): string => `${getPluginPath(pluginId)}/spec`;
|
|
33
34
|
|
|
34
|
-
export const meta = Plugin.
|
|
35
|
-
key: DXN.make('org.dxos.plugin.registry'),
|
|
36
|
-
name: 'Plugins',
|
|
37
|
-
author: 'DXOS',
|
|
38
|
-
description: trim`
|
|
39
|
-
Plugin management system for discovering, installing, and configuring workspace extensions.
|
|
40
|
-
Browse available plugins and customize your workspace capabilities.
|
|
41
|
-
`,
|
|
42
|
-
icon: 'ph--squares-four--regular',
|
|
43
|
-
tags: ['system'],
|
|
44
|
-
});
|
|
35
|
+
export const meta = Plugin.getMetaFromConfig(config);
|
|
45
36
|
|
|
46
37
|
/** Cascade-disable confirmation dialog surface id. */
|
|
47
|
-
export const DISABLE_DEPENDENTS_DIALOG = DXN.make(`${meta.
|
|
38
|
+
export const DISABLE_DEPENDENTS_DIALOG = DXN.make(`${meta.profile.key}.disableDependentsDialog`);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import { LayoutOperation,
|
|
7
|
+
import { LayoutOperation, Paths, SettingsOperation } from '@dxos/app-toolkit';
|
|
8
8
|
import { Operation } from '@dxos/compute';
|
|
9
9
|
|
|
10
10
|
import { REGISTRY_ID } from '#meta';
|
|
@@ -13,7 +13,7 @@ const handler: Operation.WithHandler<typeof SettingsOperation.OpenPluginRegistry
|
|
|
13
13
|
SettingsOperation.OpenPluginRegistry.pipe(
|
|
14
14
|
Operation.withHandler(
|
|
15
15
|
Effect.fnUntraced(function* () {
|
|
16
|
-
yield* Operation.invoke(LayoutOperation.SwitchWorkspace, { subject: getSpacePath(REGISTRY_ID) });
|
|
16
|
+
yield* Operation.invoke(LayoutOperation.SwitchWorkspace, { subject: Paths.getSpacePath(REGISTRY_ID) });
|
|
17
17
|
}),
|
|
18
18
|
),
|
|
19
19
|
);
|
package/src/translations.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { meta } from '#meta';
|
|
|
9
9
|
export const translations = [
|
|
10
10
|
{
|
|
11
11
|
'en-US': {
|
|
12
|
-
[meta.
|
|
12
|
+
[meta.profile.key]: {
|
|
13
13
|
'plugin.name': 'Registry',
|
|
14
14
|
'details.label': 'Details',
|
|
15
15
|
'description.label': 'Description',
|
|
@@ -34,9 +34,9 @@ export const translations = [
|
|
|
34
34
|
'registry.loading.label': 'Loading registry plugins…',
|
|
35
35
|
'registry.error.label': 'Failed to load registry plugins: {{message}}',
|
|
36
36
|
'registry.empty.label': 'No registry plugins available.',
|
|
37
|
-
'dev-plugin.section.title': 'Dev
|
|
37
|
+
'dev-plugin.section.title': 'Dev Server',
|
|
38
38
|
'dev-plugin.description':
|
|
39
|
-
'Load a plugin from a local Vite dev server (the `composerPlugin` defaults to port 3967). Composer
|
|
39
|
+
'Load a plugin from a local Vite dev server (the `composerPlugin` defaults to port 3967). Composer re-attaches it on every reload, surviving HMR — useful when iterating on a community plugin against a live registry version.',
|
|
40
40
|
'dev-plugin.url.label': 'Manifest URL',
|
|
41
41
|
'dev-plugin.url.description':
|
|
42
42
|
'Defaults to the local dev server. Edit if your dev server runs on a different port.',
|
|
@@ -59,11 +59,11 @@ export const translations = [
|
|
|
59
59
|
'installed.label': 'installed',
|
|
60
60
|
'install-version.label': 'Install version',
|
|
61
61
|
'failure-badge.label': 'Plugin failure details',
|
|
62
|
-
'failure-title.label': 'Plugin {{phase}} failed
|
|
62
|
+
'failure-title.label': 'Plugin {{phase}} failed ({{reason}})',
|
|
63
63
|
'failure-phase-load.label': 'load',
|
|
64
64
|
'failure-phase-activation.label': 'activation',
|
|
65
|
-
'failure-reason-timeout.label': '
|
|
66
|
-
'failure-reason-error.label': '
|
|
65
|
+
'failure-reason-timeout.label': 'Timed out',
|
|
66
|
+
'failure-reason-error.label': 'Error',
|
|
67
67
|
'dependencies.label': 'Dependencies',
|
|
68
68
|
'dependents.label': 'Required by',
|
|
69
69
|
'spec.label': 'Specification',
|
package/src/types.ts
CHANGED
|
@@ -7,6 +7,8 @@ import * as Schema from 'effect/Schema';
|
|
|
7
7
|
|
|
8
8
|
import { Capability } from '@dxos/app-framework';
|
|
9
9
|
|
|
10
|
+
import { meta } from './meta';
|
|
11
|
+
|
|
10
12
|
export const RegistrySettingsSchema = Schema.mutable(
|
|
11
13
|
Schema.Struct({
|
|
12
14
|
experimental: Schema.optional(Schema.Boolean),
|
|
@@ -32,7 +34,7 @@ export type RegistrySettings = Schema.Schema.Type<typeof RegistrySettingsSchema>
|
|
|
32
34
|
* Per-plugin capabilities exposed by `@dxos/plugin-registry`.
|
|
33
35
|
*/
|
|
34
36
|
export namespace RegistryCapabilities {
|
|
35
|
-
export const Settings = Capability.make<Atom.Writable<RegistrySettings>>(
|
|
37
|
+
export const Settings = Capability.make<Atom.Writable<RegistrySettings>>(`${meta.profile.key}.capability.settings`);
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
export const RegistryTagType = Schema.Literal(
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// src/meta.ts
|
|
2
|
-
import { Plugin } from "@dxos/app-framework";
|
|
3
|
-
import { pinnedWorkspaceId } from "@dxos/app-toolkit";
|
|
4
|
-
import { DXN } from "@dxos/keys";
|
|
5
|
-
import { trim } from "@dxos/util";
|
|
6
|
-
var REGISTRY_ID = pinnedWorkspaceId("dxos:plugin-registry");
|
|
7
|
-
var REGISTRY_KEY = "plugin-registry";
|
|
8
|
-
var CATEGORY_SEPARATOR = ">";
|
|
9
|
-
var registryCategoryId = (category) => `${REGISTRY_KEY}${CATEGORY_SEPARATOR}${category}`;
|
|
10
|
-
var getPluginPath = (pluginId) => `root/${REGISTRY_ID}/${pluginId}`;
|
|
11
|
-
var getPluginSpecPath = (pluginId) => `${getPluginPath(pluginId)}/spec`;
|
|
12
|
-
var meta = Plugin.makeMeta({
|
|
13
|
-
key: DXN.make("org.dxos.plugin.registry"),
|
|
14
|
-
name: "Plugins",
|
|
15
|
-
author: "DXOS",
|
|
16
|
-
description: trim`
|
|
17
|
-
Plugin management system for discovering, installing, and configuring workspace extensions.
|
|
18
|
-
Browse available plugins and customize your workspace capabilities.
|
|
19
|
-
`,
|
|
20
|
-
icon: "ph--squares-four--regular",
|
|
21
|
-
tags: [
|
|
22
|
-
"system"
|
|
23
|
-
]
|
|
24
|
-
});
|
|
25
|
-
var DISABLE_DEPENDENTS_DIALOG = DXN.make(`${meta.id}.disableDependentsDialog`);
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
REGISTRY_ID,
|
|
29
|
-
REGISTRY_KEY,
|
|
30
|
-
registryCategoryId,
|
|
31
|
-
getPluginPath,
|
|
32
|
-
getPluginSpecPath,
|
|
33
|
-
meta,
|
|
34
|
-
DISABLE_DEPENDENTS_DIALOG
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=chunk-GRQI6MLI.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { pinnedWorkspaceId } from '@dxos/app-toolkit';\nimport { DXN } from '@dxos/keys';\nimport { trim } from '@dxos/util';\n\nexport const REGISTRY_ID = pinnedWorkspaceId('dxos:plugin-registry');\nexport const REGISTRY_KEY = 'plugin-registry';\n\n// TODO(wittjosiah): Should this be a special separator or use the standard path separator?\nconst CATEGORY_SEPARATOR = '>';\n\n/** Build a registry category node ID. */\nexport const registryCategoryId = (category: string): string => `${REGISTRY_KEY}${CATEGORY_SEPARATOR}${category}`;\n\n/** Qualified graph path to a specific plugin node. */\nexport const getPluginPath = (pluginId: string): string => `root/${REGISTRY_ID}/${pluginId}`;\n\n/**\n * Qualified graph path to the bundled MDL spec child node for a plugin.\n *\n * The child is contributed by whichever plugin can render MDL (today:\n * `plugin-code`). plugin-registry only knows the path convention so it can:\n * - dispatch `LayoutOperation.Open` to open the spec viewer, and\n * - probe the app graph for the child's existence to gate the \"View\n * specification\" button. If no plugin contributes a renderer for the\n * child, the node is absent and the button stays hidden.\n */\nexport const getPluginSpecPath = (pluginId: string): string => `${getPluginPath(pluginId)}/spec`;\n\nexport const meta = Plugin.makeMeta({\n key: DXN.make('org.dxos.plugin.registry'),\n name: 'Plugins',\n author: 'DXOS',\n description: trim`\n Plugin management system for discovering, installing, and configuring workspace extensions.\n Browse available plugins and customize your workspace capabilities.\n `,\n icon: 'ph--squares-four--regular',\n tags: ['system'],\n});\n\n/** Cascade-disable confirmation dialog surface id. */\nexport const DISABLE_DEPENDENTS_DIALOG = DXN.make(`${meta.id}.disableDependentsDialog`);\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,cAAc;AACvB,SAASC,yBAAyB;AAClC,SAASC,WAAW;AACpB,SAASC,YAAY;AAEd,IAAMC,cAAcH,kBAAkB,sBAAA;AACtC,IAAMI,eAAe;AAG5B,IAAMC,qBAAqB;AAGpB,IAAMC,qBAAqB,CAACC,aAA6B,GAAGH,YAAAA,GAAeC,kBAAAA,GAAqBE,QAAAA;AAGhG,IAAMC,gBAAgB,CAACC,aAA6B,QAAQN,WAAAA,IAAeM,QAAAA;AAY3E,IAAMC,oBAAoB,CAACD,aAA6B,GAAGD,cAAcC,QAAAA,CAAAA;AAEzE,IAAME,OAAOZ,OAAOa,SAAS;EAClCC,KAAKZ,IAAIa,KAAK,0BAAA;EACdC,MAAM;EACNC,QAAQ;EACRC,aAAaf;;;;EAIbgB,MAAM;EACNC,MAAM;IAAC;;AACT,CAAA;AAGO,IAAMC,4BAA4BnB,IAAIa,KAAK,GAAGH,KAAKU,EAAE,0BAA0B;",
|
|
6
|
-
"names": ["Plugin", "pinnedWorkspaceId", "DXN", "trim", "REGISTRY_ID", "REGISTRY_KEY", "CATEGORY_SEPARATOR", "registryCategoryId", "category", "getPluginPath", "pluginId", "getPluginSpecPath", "meta", "makeMeta", "key", "make", "name", "author", "description", "icon", "tags", "DISABLE_DEPENDENTS_DIALOG", "id"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/open-plugin-registry.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { LayoutOperation, SettingsOperation, getSpacePath } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\n\nimport { REGISTRY_ID } from '#meta';\n\nconst handler: Operation.WithHandler<typeof SettingsOperation.OpenPluginRegistry> =\n SettingsOperation.OpenPluginRegistry.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* () {\n yield* Operation.invoke(LayoutOperation.SwitchWorkspace, { subject: getSpacePath(REGISTRY_ID) });\n }),\n ),\n );\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiBC,mBAAmBC,oBAAoB;AACjE,SAASC,iBAAiB;AAE1B,SAASC,mBAAmB;AAE5B,IAAMC,UACJJ,kBAAkBK,mBAAmBC,KACnCJ,UAAUK,YACDC,kBAAW,aAAA;AAChB,SAAON,UAAUO,OAAOV,gBAAgBW,iBAAiB;IAAEC,SAASV,aAAaE,WAAAA;EAAa,CAAA;AAChG,CAAA,CAAA,CAAA;AAIN,IAAA,+BAAeC;",
|
|
6
|
-
"names": ["Effect", "LayoutOperation", "SettingsOperation", "getSpacePath", "Operation", "REGISTRY_ID", "handler", "OpenPluginRegistry", "pipe", "withHandler", "fnUntraced", "invoke", "SwitchWorkspace", "subject"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"disable.d.ts","sourceRoot":"","sources":["../../../../src/commands/disable.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAE/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK/C,eAAO,MAAM,OAAO;QAAsC,MAAM;2MAuB9D,CAAC;AAEH,eAAO,MAAM,OAAO;;EAMgC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"enable.d.ts","sourceRoot":"","sources":["../../../../src/commands/enable.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAE/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK/C,eAAO,MAAM,OAAO;QAAsC,MAAM;2MAoB9D,CAAC;AAEH,eAAO,MAAM,MAAM;;EAMgC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/commands/list.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAE/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAa,MAAM,gBAAgB,CAAC;AAI1D,eAAO,MAAM,OAAO,kEAyBlB,CAAC;AAEH,eAAO,MAAM,IAAI,oEAAiG,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/commands/util.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,WAAY,eAAe,2CAOlD,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|