@uxland/primary-shell 7.45.17 → 7.46.0
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/{component-DE0499JZ.js → component-BaD4HDNu.js} +2 -2
- package/dist/{component-DE0499JZ.js.map → component-BaD4HDNu.js.map} +1 -1
- package/dist/{index-DUgttilv.js → index-Dmk2_-SI.js} +14 -13
- package/dist/{index-DUgttilv.js.map → index-Dmk2_-SI.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/handle-plugins.ts +33 -12
package/package.json
CHANGED
package/src/handle-plugins.ts
CHANGED
|
@@ -22,20 +22,41 @@ interface PrimariaBootstrappedPlugin extends BootstrappedPlugin<PrimariaApi> {
|
|
|
22
22
|
importedPlugin: PrimariaPlugin;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
const CORE_FIRST_ID = "activity-history";
|
|
26
|
+
|
|
27
|
+
// activity-history must finish initializing before any other plugin: it
|
|
28
|
+
// registers the broker requests the rest depend on. In production it is loaded
|
|
29
|
+
// from the plugin store (versioned/uploadable) like any other plugin; this
|
|
30
|
+
// bundled copy is the fallback used when the caller does not provide it — e.g.
|
|
31
|
+
// third-party sandboxes that install primary-shell without a plugin store.
|
|
32
|
+
const bundledActivityHistory: PluginDefinition = {
|
|
33
|
+
pluginId: CORE_FIRST_ID,
|
|
34
|
+
importer: () =>
|
|
35
|
+
Promise.resolve({
|
|
36
|
+
initialize: activityHistoryInitialize,
|
|
37
|
+
dispose: activityHistoryDispose,
|
|
38
|
+
}),
|
|
39
|
+
};
|
|
35
40
|
|
|
36
41
|
export const bootstrapPlugins = async (plugins: PluginDefinition[], startup?: PrimariaStartupPlugin) => {
|
|
37
|
-
const
|
|
38
|
-
|
|
42
|
+
const incoming = plugins ?? [];
|
|
43
|
+
const provided = incoming.filter((plugin) => plugin.pluginId === CORE_FIRST_ID);
|
|
44
|
+
const rest = incoming.filter((plugin) => plugin.pluginId !== CORE_FIRST_ID);
|
|
45
|
+
|
|
46
|
+
// Prefer the store/sandbox-provided activity-history; fall back to the bundled
|
|
47
|
+
// copy. Either way it is bootstrapped — and fully initialized — before the
|
|
48
|
+
// rest, which run in parallel as before.
|
|
49
|
+
const corePlugins = provided.length ? provided : [bundledActivityHistory];
|
|
50
|
+
|
|
51
|
+
const coreBootstrapped = (await pluginBootstrapper(
|
|
52
|
+
corePlugins,
|
|
53
|
+
primariaApiFactory,
|
|
54
|
+
)) as BootstrappedPlugin<PrimariaApi>[];
|
|
55
|
+
const restBootstrapped = rest.length
|
|
56
|
+
? ((await pluginBootstrapper(rest, primariaApiFactory)) as BootstrappedPlugin<PrimariaApi>[])
|
|
57
|
+
: [];
|
|
58
|
+
|
|
59
|
+
bootstrappedPlugins = [...coreBootstrapped, ...restBootstrapped];
|
|
39
60
|
handleStartupPlugin(bootstrappedPlugins as PrimariaBootstrappedPlugin[], startup);
|
|
40
61
|
};
|
|
41
62
|
|