Skip to content

Commit 2c784ce

Browse files
authored
Inspector v2: Improved extension details (#17389)
This is addressing an Inspector v2 forum ask: https://forum.babylonjs.com/t/introducing-inspector-v2/60937/85 It adds more details to extension metadata and displays it in the extensions dialog. It also makes it more clear at a glance whether an extension is currently installed. There is also some general style improvements, like using the Fluent Card component which is made for this type of use case. <img width="607" height="513" alt="image" src="https://github.com/user-attachments/assets/4f955cee-20d9-4045-865e-ded14b64f3df" /> <img width="600" height="499" alt="image" src="https://github.com/user-attachments/assets/e6e3c261-6c78-4814-a33a-7e19092f7f65" /> <img width="445" height="315" alt="image" src="https://github.com/user-attachments/assets/dfdaaf77-e381-41a6-8d63-c7eb05d8c69d" /> <img width="404" height="313" alt="image" src="https://github.com/user-attachments/assets/ccec0448-660d-4ec9-bfbd-54c0fdacb7ba" />
1 parent 927bcc0 commit 2c784ce

File tree

4 files changed

+308
-44
lines changed

4 files changed

+308
-44
lines changed

packages/dev/inspector-v2/src/extensibility/defaultInspectorExtensionFeed.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1+
import type { ExtensionMetadata } from "./extensionFeed";
2+
13
import { BuiltInsExtensionFeed } from "./builtInsExtensionFeed";
24

5+
const BabylonWebResources = {
6+
homepage: "https://www.babylonjs.com",
7+
repository: "https://github.com/BabylonJS/Babylon.js",
8+
bugs: "https://github.com/BabylonJS/Babylon.js/issues",
9+
} as const satisfies Partial<ExtensionMetadata>;
10+
311
/**
412
* Well-known default built in extensions for the Inspector.
513
*/
@@ -14,18 +22,24 @@ export const DefaultInspectorExtensionFeed = new BuiltInsExtensionFeed("Inspecto
1422
name: "Export Tools",
1523
description: "Adds new features to enable exporting Babylon assets such as .gltf, .glb, .babylon, and more.",
1624
keywords: ["export", "gltf", "glb", "babylon", "exporter", "tools"],
25+
...BabylonWebResources,
26+
author: { name: "Alex Chuber", forumUserName: "alexchuber" },
1727
getExtensionModuleAsync: async () => await import("../services/panes/tools/exportService"),
1828
},
1929
{
2030
name: "Capture Tools",
2131
description: "Adds new features to enable capturing screenshots, GIFs, videos, and more.",
2232
keywords: ["capture", "screenshot", "gif", "video", "tools"],
33+
...BabylonWebResources,
34+
author: { name: "Alex Chuber", forumUserName: "alexchuber" },
2335
getExtensionModuleAsync: async () => await import("../services/panes/tools/captureService"),
2436
},
2537
{
2638
name: "Import Tools",
2739
description: "Adds new features related to importing Babylon assets.",
2840
keywords: ["import", "tools"],
41+
...BabylonWebResources,
42+
author: { name: "Alex Chuber", forumUserName: "alexchuber" },
2943
getExtensionModuleAsync: async () => await import("../services/panes/tools/importService"),
3044
},
3145
]);

packages/dev/inspector-v2/src/extensibility/extensionFeed.ts

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,38 @@
11
import type { WeaklyTypedServiceDefinition } from "../modularity/serviceContainer";
22

3+
export type PersonMetadata = {
4+
/**
5+
* The name of the person.
6+
*/
7+
readonly name: string;
8+
9+
/**
10+
* The email address of the person.
11+
*/
12+
readonly email?: string;
13+
14+
/**
15+
* The URL to the person's website.
16+
*/
17+
readonly url?: string;
18+
19+
/**
20+
* The Babylon forum username of the person.
21+
*/
22+
readonly forumUserName?: string;
23+
};
24+
325
export type ExtensionMetadata = {
426
/**
527
* The name of the extension.
628
*/
729
readonly name: string;
830

31+
/**
32+
* The version of the extension (as valid semver).
33+
*/
34+
readonly version?: string;
35+
936
/**
1037
* The description of the extension.
1138
*/
@@ -14,7 +41,37 @@ export type ExtensionMetadata = {
1441
/**
1542
* The keywords of the extension.
1643
*/
17-
readonly keywords: readonly string[];
44+
readonly keywords?: readonly string[];
45+
46+
/**
47+
* The URL to the extension homepage.
48+
*/
49+
readonly homepage?: string;
50+
51+
/**
52+
* Specify the place where your code lives. This is helpful for people who want to contribute.
53+
*/
54+
readonly repository?: string;
55+
56+
/**
57+
* The URL to your extension's issue tracker and / or the email address to which issues should be reported. These are helpful for people who encounter issues with your extension.
58+
*/
59+
readonly bugs?: string;
60+
61+
/**
62+
* A license for your package so that people know how they are permitted to use it, and any restrictions you're placing on it.
63+
*/
64+
readonly license?: string;
65+
66+
/**
67+
* The primary author of the extension.
68+
*/
69+
readonly author?: string | PersonMetadata;
70+
71+
/**
72+
* The contributors to the extension.
73+
*/
74+
readonly contributors?: readonly (string | PersonMetadata)[];
1875
};
1976

2077
export type ExtensionModule = {

packages/dev/inspector-v2/src/modularTool.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import { ExtensionManagerContext } from "./contexts/extensionManagerContext";
3333
import { ExtensionManager } from "./extensibility/extensionManager";
3434
import { SetThemeMode } from "./hooks/themeHooks";
3535
import { ServiceContainer } from "./modularity/serviceContainer";
36-
import { ExtensionListServiceDefinition } from "./services/extensionsListService";
3736
import { MakeShellServiceDefinition, RootComponentServiceIdentity } from "./services/shellService";
3837
import { ThemeSelectorServiceDefinition } from "./services/themeSelectorService";
3938

@@ -134,6 +133,7 @@ export function MakeModularTool(options: ModularToolOptions): IDisposable {
134133

135134
// Register the extension list service (for browsing/installing extensions) if extension feeds are provided.
136135
if (extensionFeeds.length > 0) {
136+
const { ExtensionListServiceDefinition } = await import("./services/extensionsListService");
137137
await serviceContainer.addServiceAsync(ExtensionListServiceDefinition);
138138
}
139139

0 commit comments

Comments
 (0)