@dxos/app-framework 0.8.4-main.cb12b3f963 → 0.8.4-main.d05539e30a
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/browser/{capability-5RRH3WIB.mjs → capability-K5XIVCQU.mjs} +10 -10
- package/dist/lib/browser/{capability-5RRH3WIB.mjs.map → capability-K5XIVCQU.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-WBHCSOBW.mjs → chunk-5AHASNDW.mjs} +17 -2
- package/dist/lib/browser/chunk-5AHASNDW.mjs.map +7 -0
- package/dist/lib/browser/chunk-5GY3YOEL.mjs +28 -0
- package/dist/lib/browser/chunk-5GY3YOEL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ZGJAZSNE.mjs → chunk-BRK6GYNB.mjs} +7 -7
- package/dist/lib/browser/{chunk-ZGJAZSNE.mjs.map → chunk-BRK6GYNB.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-3JWJXGLK.mjs → chunk-IW44C7UL.mjs} +5 -1
- package/dist/lib/browser/chunk-IW44C7UL.mjs.map +7 -0
- package/dist/lib/browser/{chunk-23D4SJUE.mjs → chunk-KFDF7KR3.mjs} +2 -2
- package/dist/lib/browser/{chunk-CZ4BIAHH.mjs → chunk-KLHQNYJ2.mjs} +2 -2
- package/dist/lib/browser/{chunk-MX5DKEJH.mjs → chunk-QLML5QFJ.mjs} +4 -7
- package/dist/lib/browser/chunk-QLML5QFJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-Z55LVAGN.mjs → chunk-SLX73WRZ.mjs} +7 -2
- package/dist/lib/browser/chunk-SLX73WRZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-PC4NOADA.mjs → chunk-UVTGHZQF.mjs} +60 -18
- package/dist/lib/browser/chunk-UVTGHZQF.mjs.map +7 -0
- package/dist/lib/browser/{chunk-NBXPP7JR.mjs → chunk-VJ5PFAWC.mjs} +312 -40
- package/dist/lib/browser/chunk-VJ5PFAWC.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +9 -11
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/common/activation-events.mjs +9 -13
- package/dist/lib/browser/common/capabilities.mjs +15 -5
- package/dist/lib/browser/core/capability.mjs +3 -1
- package/dist/lib/browser/core/plugin-manager.mjs +3 -3
- package/dist/lib/browser/core/plugin.mjs +4 -2
- package/dist/lib/browser/core/url-loader.mjs +3 -3
- package/dist/lib/browser/index.mjs +26 -43
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/process-manager-capability-JIWLN7SU.mjs +89 -0
- package/dist/lib/browser/process-manager-capability-JIWLN7SU.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +26 -18
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/browser/testing/react.mjs +8 -8
- package/dist/lib/browser/ui/index.mjs +16 -10
- package/dist/lib/node-esm/{capability-JOIQ2MQE.mjs → capability-RLKFFLTB.mjs} +10 -10
- package/dist/lib/node-esm/{capability-JOIQ2MQE.mjs.map → capability-RLKFFLTB.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-M3HKPRPO.mjs → chunk-42UNAKYO.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-HTBJU5FX.mjs → chunk-6S45OMUP.mjs} +7 -2
- package/dist/lib/node-esm/chunk-6S45OMUP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-D347W3KO.mjs → chunk-BYHYYJZH.mjs} +7 -7
- package/dist/lib/node-esm/{chunk-D347W3KO.mjs.map → chunk-BYHYYJZH.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-SDJ4B2LU.mjs → chunk-CTKEZHKF.mjs} +5 -1
- package/dist/lib/node-esm/chunk-CTKEZHKF.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-42J2ZUQQ.mjs → chunk-JNT72ZCN.mjs} +60 -18
- package/dist/lib/node-esm/chunk-JNT72ZCN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-KFZEB6BV.mjs +29 -0
- package/dist/lib/node-esm/chunk-KFZEB6BV.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-WKTLE7MG.mjs → chunk-LJNUFNDO.mjs} +4 -7
- package/dist/lib/node-esm/chunk-LJNUFNDO.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SBS2YMPT.mjs → chunk-OUEMWPIW.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-WFSRZKBP.mjs → chunk-PW2VYGOS.mjs} +17 -2
- package/dist/lib/node-esm/chunk-PW2VYGOS.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-MUVUQC3G.mjs → chunk-SFYCO3PT.mjs} +312 -40
- package/dist/lib/node-esm/chunk-SFYCO3PT.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +9 -11
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/common/activation-events.mjs +9 -13
- package/dist/lib/node-esm/common/capabilities.mjs +15 -5
- package/dist/lib/node-esm/core/capability.mjs +3 -1
- package/dist/lib/node-esm/core/plugin-manager.mjs +3 -3
- package/dist/lib/node-esm/core/plugin.mjs +4 -2
- package/dist/lib/node-esm/core/url-loader.mjs +3 -3
- package/dist/lib/node-esm/index.mjs +26 -43
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/process-manager-capability-PHKLO2BL.mjs +90 -0
- package/dist/lib/node-esm/process-manager-capability-PHKLO2BL.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +26 -18
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/testing/react.mjs +8 -8
- package/dist/lib/node-esm/ui/index.mjs +16 -10
- package/dist/plugin/node-esm/index.mjs +26 -8
- package/dist/plugin/node-esm/index.mjs.map +4 -4
- package/dist/plugin/node-esm/meta.json +1 -1
- package/dist/types/src/cli/cli.d.ts +1 -3
- package/dist/types/src/cli/cli.d.ts.map +1 -1
- package/dist/types/src/common/activation-events.d.ts +10 -13
- package/dist/types/src/common/activation-events.d.ts.map +1 -1
- package/dist/types/src/common/capabilities.d.ts +111 -6
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/core/capability.d.ts +5 -0
- package/dist/types/src/core/capability.d.ts.map +1 -1
- package/dist/types/src/core/plugin-manager.d.ts +62 -4
- package/dist/types/src/core/plugin-manager.d.ts.map +1 -1
- package/dist/types/src/core/plugin.d.ts +69 -0
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/core/registry.d.ts +6 -0
- package/dist/types/src/core/registry.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts +3 -0
- package/dist/types/src/plugin-process-manager/ProcessManagerPlugin.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/capability.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/errors.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/history-tracker.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/history-tracker.test.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/index.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/types.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/undo-mapping.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/undo-registry.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/history/undo-registry.test.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/index.d.ts +3 -0
- package/dist/types/src/plugin-process-manager/index.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/meta.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts +8 -0
- package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts.map +1 -0
- package/dist/types/src/plugin-process-manager/testing.d.ts.map +1 -0
- package/dist/types/src/testing/harness.d.ts +16 -4
- package/dist/types/src/testing/harness.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -1
- package/dist/types/src/ui/components/PluginManager/PluginManagerContext.stories.d.ts.map +1 -1
- package/dist/types/src/ui/components/Surface/SurfaceInfo.d.ts.map +1 -1
- package/dist/types/src/ui/hooks/index.d.ts +1 -0
- package/dist/types/src/ui/hooks/index.d.ts.map +1 -1
- package/dist/types/src/ui/hooks/useApp.d.ts +5 -8
- package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -1
- package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts +24 -0
- package/dist/types/src/ui/hooks/useProcessManagerRuntime.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/boot-loader/BootLoader.stories.d.ts.map +1 -1
- package/dist/types/src/vite-plugin/boot-loader/index.d.ts +1 -51
- package/dist/types/src/vite-plugin/boot-loader/index.d.ts.map +1 -1
- package/dist/types/src/vite-plugin/boot-loader/loader.d.ts +51 -0
- package/dist/types/src/vite-plugin/boot-loader/loader.d.ts.map +1 -0
- package/dist/types/src/vite-plugin/import-map/index.d.ts.map +1 -1
- package/dist/types/src/vite-plugin/packages.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +31 -27
- package/src/cli/cli.ts +1 -6
- package/src/common/activation-events.ts +10 -15
- package/src/common/capabilities.ts +142 -6
- package/src/core/capability.ts +7 -0
- package/src/core/plugin-manager.test.ts +237 -9
- package/src/core/plugin-manager.ts +365 -13
- package/src/core/plugin.ts +50 -0
- package/src/core/registry.ts +6 -0
- package/src/index.ts +1 -2
- package/src/plugin-process-manager/ProcessManagerPlugin.ts +24 -0
- package/src/{plugin-operation → plugin-process-manager}/index.ts +1 -1
- package/src/plugin-process-manager/meta.ts +14 -0
- package/src/plugin-process-manager/process-manager-capability.ts +178 -0
- package/src/testing/harness.ts +25 -7
- package/src/testing/service.ts +1 -1
- package/src/testing/withPluginManager.tsx +5 -2
- package/src/ui/components/App/App.stories.tsx +2 -8
- package/src/ui/components/Placeholder/Placeholder.tsx +2 -2
- package/src/ui/components/PluginManager/PluginManagerContext.stories.tsx +1 -2
- package/src/ui/components/Surface/SurfaceComponent.tsx +2 -2
- package/src/ui/components/Surface/SurfaceInfo.tsx +0 -1
- package/src/ui/components/Surface/types.test.ts +2 -2
- package/src/ui/hooks/index.ts +1 -0
- package/src/ui/hooks/useApp.test.tsx +1 -1
- package/src/ui/hooks/useApp.tsx +5 -11
- package/src/ui/hooks/useProcessManagerRuntime.ts +68 -0
- package/src/vite-plugin/boot-loader/BootLoader.stories.tsx +8 -1
- package/src/vite-plugin/boot-loader/boot-loader.css +48 -22
- package/src/vite-plugin/boot-loader/boot-loader.js +67 -16
- package/src/vite-plugin/boot-loader/index.ts +1 -108
- package/src/vite-plugin/boot-loader/loader.ts +123 -0
- package/src/vite-plugin/import-map/index.ts +3 -0
- package/src/vite-plugin/index.ts +2 -2
- package/src/vite-plugin/packages.ts +0 -1
- package/tsconfig.json +6 -0
- package/dist/lib/browser/capability-LUKGKUQH.mjs +0 -38
- package/dist/lib/browser/capability-LUKGKUQH.mjs.map +0 -7
- package/dist/lib/browser/chunk-3JWJXGLK.mjs.map +0 -7
- package/dist/lib/browser/chunk-45CHLTBV.mjs +0 -34
- package/dist/lib/browser/chunk-45CHLTBV.mjs.map +0 -7
- package/dist/lib/browser/chunk-MX5DKEJH.mjs.map +0 -7
- package/dist/lib/browser/chunk-NBXPP7JR.mjs.map +0 -7
- package/dist/lib/browser/chunk-PC4NOADA.mjs.map +0 -7
- package/dist/lib/browser/chunk-WBHCSOBW.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z55LVAGN.mjs.map +0 -7
- package/dist/lib/browser/invoker-capability-K4GHUFXF.mjs +0 -44
- package/dist/lib/browser/invoker-capability-K4GHUFXF.mjs.map +0 -7
- package/dist/lib/node-esm/capability-FCGZVIEG.mjs +0 -39
- package/dist/lib/node-esm/capability-FCGZVIEG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-42J2ZUQQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6XW6LET6.mjs +0 -35
- package/dist/lib/node-esm/chunk-6XW6LET6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HTBJU5FX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MUVUQC3G.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SDJ4B2LU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WFSRZKBP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WKTLE7MG.mjs.map +0 -7
- package/dist/lib/node-esm/invoker-capability-XEPW5LMJ.mjs +0 -45
- package/dist/lib/node-esm/invoker-capability-XEPW5LMJ.mjs.map +0 -7
- package/dist/types/src/plugin-operation/OperationPlugin.d.ts +0 -3
- package/dist/types/src/plugin-operation/OperationPlugin.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/capability.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/errors.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/index.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/types.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/undo-registry.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/index.d.ts +0 -3
- package/dist/types/src/plugin-operation/index.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/invoker-capability.d.ts +0 -6
- package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/meta.d.ts.map +0 -1
- package/dist/types/src/plugin-operation/testing.d.ts.map +0 -1
- package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts +0 -3
- package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts.map +0 -1
- package/dist/types/src/plugin-runtime/capability.d.ts +0 -6
- package/dist/types/src/plugin-runtime/capability.d.ts.map +0 -1
- package/dist/types/src/plugin-runtime/index.d.ts +0 -2
- package/dist/types/src/plugin-runtime/index.d.ts.map +0 -1
- package/dist/types/src/plugin-runtime/meta.d.ts +0 -3
- package/dist/types/src/plugin-runtime/meta.d.ts.map +0 -1
- package/src/plugin-operation/OperationPlugin.ts +0 -24
- package/src/plugin-operation/invoker-capability.ts +0 -55
- package/src/plugin-operation/meta.ts +0 -11
- package/src/plugin-runtime/RuntimePlugin.ts +0 -19
- package/src/plugin-runtime/capability.ts +0 -53
- package/src/plugin-runtime/index.ts +0 -5
- package/src/plugin-runtime/meta.ts +0 -11
- /package/dist/lib/browser/{chunk-23D4SJUE.mjs.map → chunk-KFDF7KR3.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-CZ4BIAHH.mjs.map → chunk-KLHQNYJ2.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-M3HKPRPO.mjs.map → chunk-42UNAKYO.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-SBS2YMPT.mjs.map → chunk-OUEMWPIW.mjs.map} +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/capability.d.ts +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/errors.d.ts +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/history-tracker.d.ts +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/history-tracker.test.d.ts +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/index.d.ts +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/types.d.ts +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/undo-mapping.d.ts +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/undo-registry.d.ts +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/history/undo-registry.test.d.ts +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/meta.d.ts +0 -0
- /package/dist/types/src/{plugin-operation → plugin-process-manager}/testing.d.ts +0 -0
- /package/src/{plugin-operation → plugin-process-manager}/history/capability.ts +0 -0
- /package/src/{plugin-operation → plugin-process-manager}/history/errors.ts +0 -0
- /package/src/{plugin-operation → plugin-process-manager}/history/history-tracker.test.ts +0 -0
- /package/src/{plugin-operation → plugin-process-manager}/history/history-tracker.ts +0 -0
- /package/src/{plugin-operation → plugin-process-manager}/history/index.ts +0 -0
- /package/src/{plugin-operation → plugin-process-manager}/history/types.ts +0 -0
- /package/src/{plugin-operation → plugin-process-manager}/history/undo-mapping.ts +0 -0
- /package/src/{plugin-operation → plugin-process-manager}/history/undo-registry.test.ts +0 -0
- /package/src/{plugin-operation → plugin-process-manager}/history/undo-registry.ts +0 -0
- /package/src/{plugin-operation → plugin-process-manager}/testing.ts +0 -0
|
@@ -5,13 +5,14 @@ import {
|
|
|
5
5
|
} from "./chunk-66IXTIVK.mjs";
|
|
6
6
|
import {
|
|
7
7
|
LazyPluginError,
|
|
8
|
+
PluginDependencyError,
|
|
8
9
|
Service as Service2,
|
|
9
10
|
isLazy,
|
|
10
11
|
resolveLazy
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SLX73WRZ.mjs";
|
|
12
13
|
import {
|
|
13
14
|
Service
|
|
14
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-IW44C7UL.mjs";
|
|
15
16
|
import {
|
|
16
17
|
__export
|
|
17
18
|
} from "./chunk-J5LGTIGS.mjs";
|
|
@@ -277,7 +278,8 @@ var ManagerImpl = class {
|
|
|
277
278
|
// are wrapped in `PluginInitializationError` so awaiters get a tagged
|
|
278
279
|
// error rather than the wide `Error` produced by the underlying chain.
|
|
279
280
|
_initialization = Effect3.runSync(Deferred2.make());
|
|
280
|
-
constructor({ pluginLoader, plugins = [],
|
|
281
|
+
constructor({ pluginLoader, plugins = [], enabled = [], registry, pluginRegistryProvider, onRemove, loadTimeout = DEFAULT_LOAD_TIMEOUT, activationTimeout = DEFAULT_ACTIVATION_TIMEOUT }) {
|
|
282
|
+
const core = plugins.filter(({ meta }) => meta.tags?.includes("system")).map(({ meta }) => meta.id);
|
|
281
283
|
this.registry = registry ?? Registry.make();
|
|
282
284
|
this.capabilities = make2({
|
|
283
285
|
registry: this.registry
|
|
@@ -407,6 +409,20 @@ var ManagerImpl = class {
|
|
|
407
409
|
this._update(this._devPluginIdsAtom, (ids) => ids.filter((existing) => existing !== id));
|
|
408
410
|
return entry?.shadow;
|
|
409
411
|
}
|
|
412
|
+
getDependencies(id, opts) {
|
|
413
|
+
const transitive = opts?.transitive !== false;
|
|
414
|
+
if (!transitive) {
|
|
415
|
+
return this._directDependencies(id);
|
|
416
|
+
}
|
|
417
|
+
const walk = this._computeDependencyClosure(id);
|
|
418
|
+
return walk.order.filter((depId) => depId !== id);
|
|
419
|
+
}
|
|
420
|
+
getDependents(id, opts) {
|
|
421
|
+
return this._collectDependents(id, {
|
|
422
|
+
transitive: opts?.transitive !== false,
|
|
423
|
+
enabledOnly: opts?.enabledOnly === true
|
|
424
|
+
});
|
|
425
|
+
}
|
|
410
426
|
clearFailure(id) {
|
|
411
427
|
const current = this._get(this._failedAtom);
|
|
412
428
|
if (!current.some((failure) => failure.id === id)) {
|
|
@@ -424,7 +440,7 @@ var ManagerImpl = class {
|
|
|
424
440
|
return Effect3.gen(this, function* () {
|
|
425
441
|
log3("add plugin", {
|
|
426
442
|
id
|
|
427
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
443
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 262, S: this });
|
|
428
444
|
const { plugin, dev = false } = yield* this._pluginLoader(id);
|
|
429
445
|
const pluginId = plugin.meta.id;
|
|
430
446
|
const existing = this._getPlugin(pluginId);
|
|
@@ -450,12 +466,110 @@ var ManagerImpl = class {
|
|
|
450
466
|
/**
|
|
451
467
|
* Enables a plugin.
|
|
452
468
|
* @param id The id of the plugin.
|
|
469
|
+
* @param opts See {@link PluginManager.enable}.
|
|
453
470
|
*/
|
|
454
|
-
enable(id) {
|
|
471
|
+
enable(id, opts) {
|
|
472
|
+
const resolveDependencies = opts?.resolveDependencies !== false;
|
|
455
473
|
return Effect3.gen(this, function* () {
|
|
456
474
|
log3("enable plugin", {
|
|
457
|
-
id
|
|
458
|
-
|
|
475
|
+
id,
|
|
476
|
+
resolveDependencies
|
|
477
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 301, S: this });
|
|
478
|
+
if (!resolveDependencies) {
|
|
479
|
+
return yield* this._enableOne(id);
|
|
480
|
+
}
|
|
481
|
+
if (!this._getPlugin(id) && !this._getCatalogEntry(id)) {
|
|
482
|
+
return yield* this._enableOne(id);
|
|
483
|
+
}
|
|
484
|
+
const walk = this._computeDependencyClosure(id);
|
|
485
|
+
if (walk.cycle) {
|
|
486
|
+
this._recordFailure(id, "load", new PluginDependencyError({
|
|
487
|
+
context: {
|
|
488
|
+
id,
|
|
489
|
+
reason: "cycle",
|
|
490
|
+
path: walk.cycle
|
|
491
|
+
}
|
|
492
|
+
}));
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
if (walk.missing.length > 0) {
|
|
496
|
+
this._recordFailure(id, "load", new PluginDependencyError({
|
|
497
|
+
context: {
|
|
498
|
+
id,
|
|
499
|
+
reason: "missing",
|
|
500
|
+
missing: walk.missing
|
|
501
|
+
}
|
|
502
|
+
}));
|
|
503
|
+
return false;
|
|
504
|
+
}
|
|
505
|
+
let queue = walk.toInstall.slice();
|
|
506
|
+
const installed = /* @__PURE__ */ new Set();
|
|
507
|
+
while (queue.length > 0) {
|
|
508
|
+
const next = queue.shift();
|
|
509
|
+
if (installed.has(next) || this._getPlugin(next)) {
|
|
510
|
+
continue;
|
|
511
|
+
}
|
|
512
|
+
const installResult = yield* this.add(next).pipe(Effect3.either);
|
|
513
|
+
if (installResult._tag === "Left") {
|
|
514
|
+
this._recordFailure(id, "load", new PluginDependencyError({
|
|
515
|
+
context: {
|
|
516
|
+
id,
|
|
517
|
+
reason: "install-failed",
|
|
518
|
+
dependency: next
|
|
519
|
+
},
|
|
520
|
+
cause: installResult.left
|
|
521
|
+
}));
|
|
522
|
+
return false;
|
|
523
|
+
}
|
|
524
|
+
installed.add(next);
|
|
525
|
+
const rewalk = this._computeDependencyClosure(id);
|
|
526
|
+
if (rewalk.cycle) {
|
|
527
|
+
this._recordFailure(id, "load", new PluginDependencyError({
|
|
528
|
+
context: {
|
|
529
|
+
id,
|
|
530
|
+
reason: "cycle",
|
|
531
|
+
path: rewalk.cycle
|
|
532
|
+
}
|
|
533
|
+
}));
|
|
534
|
+
return false;
|
|
535
|
+
}
|
|
536
|
+
if (rewalk.missing.length > 0) {
|
|
537
|
+
this._recordFailure(id, "load", new PluginDependencyError({
|
|
538
|
+
context: {
|
|
539
|
+
id,
|
|
540
|
+
reason: "missing",
|
|
541
|
+
missing: rewalk.missing
|
|
542
|
+
}
|
|
543
|
+
}));
|
|
544
|
+
return false;
|
|
545
|
+
}
|
|
546
|
+
queue = rewalk.toInstall.filter((depId) => !installed.has(depId));
|
|
547
|
+
}
|
|
548
|
+
const order = this._computeDependencyClosure(id).order;
|
|
549
|
+
let succeeded = false;
|
|
550
|
+
for (const depId of order) {
|
|
551
|
+
const ok = yield* this._enableOne(depId);
|
|
552
|
+
if (depId === id) {
|
|
553
|
+
succeeded = ok;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
return succeeded;
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Enables a single plugin without consulting its declared dependencies.
|
|
561
|
+
* Used by {@link enable} as the leaf step after closure resolution, and
|
|
562
|
+
* directly when callers pass `{ resolveDependencies: false }`.
|
|
563
|
+
*
|
|
564
|
+
* The underlying operations (`_addModule`, `_setPendingResetByModule`,
|
|
565
|
+
* `activate`) are all idempotent, so this method is safe to call multiple
|
|
566
|
+
* times for the same id. The constructor's bootstrap path relies on this:
|
|
567
|
+
* the persisted `enabled` ids are written into `_enabledAtom` up front, so
|
|
568
|
+
* the very first `enable(id)` for those plugins sees `alreadyEnabled`-style
|
|
569
|
+
* state but still needs to perform the module registration and activation.
|
|
570
|
+
*/
|
|
571
|
+
_enableOne(id) {
|
|
572
|
+
return Effect3.gen(this, function* () {
|
|
459
573
|
const stub = this._getPlugin(id);
|
|
460
574
|
if (!stub) {
|
|
461
575
|
return false;
|
|
@@ -474,7 +588,7 @@ var ManagerImpl = class {
|
|
|
474
588
|
events: [
|
|
475
589
|
...this.getPendingReset()
|
|
476
590
|
]
|
|
477
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
591
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 428, S: this });
|
|
478
592
|
yield* Effect3.all(this.getPendingReset().map((event) => this.activate(event)), {
|
|
479
593
|
concurrency: "unbounded"
|
|
480
594
|
});
|
|
@@ -510,7 +624,7 @@ var ManagerImpl = class {
|
|
|
510
624
|
return yield* Effect3.gen(this, function* () {
|
|
511
625
|
log3("resolving lazy plugin", {
|
|
512
626
|
id
|
|
513
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
627
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 465, S: this });
|
|
514
628
|
yield* PubSub.publish(this.activation, {
|
|
515
629
|
event: "",
|
|
516
630
|
state: "activating",
|
|
@@ -559,14 +673,15 @@ var ManagerImpl = class {
|
|
|
559
673
|
/**
|
|
560
674
|
* Removes a plugin from the manager.
|
|
561
675
|
* @param id The id of the plugin.
|
|
676
|
+
* @param opts See {@link PluginManager.remove}.
|
|
562
677
|
*/
|
|
563
|
-
remove(id) {
|
|
678
|
+
remove(id, opts) {
|
|
564
679
|
return Effect3.gen(this, function* () {
|
|
565
680
|
log3("remove plugin", {
|
|
566
681
|
id
|
|
567
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
682
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 517, S: this });
|
|
568
683
|
const wasDev = this._devPlugins.has(id);
|
|
569
|
-
const disabled = yield* this.disable(id);
|
|
684
|
+
const disabled = yield* this.disable(id, opts);
|
|
570
685
|
if (!disabled) {
|
|
571
686
|
return false;
|
|
572
687
|
}
|
|
@@ -575,7 +690,7 @@ var ManagerImpl = class {
|
|
|
575
690
|
this._runForkedFiber(this._onRemove(id).pipe(Effect3.tapError((error) => Effect3.sync(() => log3.warn("plugin remove hook failed", {
|
|
576
691
|
id,
|
|
577
692
|
error
|
|
578
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
693
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 527, S: this }))), Effect3.ignore));
|
|
579
694
|
}
|
|
580
695
|
if (wasDev) {
|
|
581
696
|
const shadow = this._unmarkDev(id);
|
|
@@ -592,12 +707,53 @@ var ManagerImpl = class {
|
|
|
592
707
|
/**
|
|
593
708
|
* Disables a plugin.
|
|
594
709
|
* @param id The id of the plugin.
|
|
710
|
+
* @param opts See {@link PluginManager.disable}.
|
|
595
711
|
*/
|
|
596
|
-
disable(id) {
|
|
712
|
+
disable(id, { cascade = true } = {}) {
|
|
597
713
|
return Effect3.gen(this, function* () {
|
|
598
714
|
log3("disable plugin", {
|
|
599
|
-
id
|
|
600
|
-
|
|
715
|
+
id,
|
|
716
|
+
cascade
|
|
717
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 555, S: this });
|
|
718
|
+
if (this._get(this._coreAtom).includes(id)) {
|
|
719
|
+
return false;
|
|
720
|
+
}
|
|
721
|
+
const plugin = this._getPlugin(id);
|
|
722
|
+
if (!plugin) {
|
|
723
|
+
return false;
|
|
724
|
+
}
|
|
725
|
+
if (cascade) {
|
|
726
|
+
const enabledDependents = this._collectDependents(id, {
|
|
727
|
+
transitive: true,
|
|
728
|
+
enabledOnly: true
|
|
729
|
+
});
|
|
730
|
+
if (enabledDependents.length > 0) {
|
|
731
|
+
const coreDependent = enabledDependents.find((dependentId) => this._get(this._coreAtom).includes(dependentId));
|
|
732
|
+
if (coreDependent) {
|
|
733
|
+
return yield* Effect3.fail(new PluginDependencyError({
|
|
734
|
+
context: {
|
|
735
|
+
id,
|
|
736
|
+
reason: "core-dependent",
|
|
737
|
+
coreDependent
|
|
738
|
+
}
|
|
739
|
+
}));
|
|
740
|
+
}
|
|
741
|
+
for (const dependentId of enabledDependents) {
|
|
742
|
+
yield* this._disableOne(dependentId);
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
yield* this._disableOne(id);
|
|
747
|
+
return true;
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* Disables a single plugin without consulting its dependents. Used by
|
|
752
|
+
* {@link disable} after the dependents pass has run (or been skipped via
|
|
753
|
+
* `cascade: false`).
|
|
754
|
+
*/
|
|
755
|
+
_disableOne(id) {
|
|
756
|
+
return Effect3.gen(this, function* () {
|
|
601
757
|
if (this._get(this._coreAtom).includes(id)) {
|
|
602
758
|
return false;
|
|
603
759
|
}
|
|
@@ -628,13 +784,13 @@ var ManagerImpl = class {
|
|
|
628
784
|
log3("skipping activation during shutdown", {
|
|
629
785
|
key,
|
|
630
786
|
...params
|
|
631
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
787
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 626, S: this });
|
|
632
788
|
return false;
|
|
633
789
|
}
|
|
634
790
|
yield* Deferred2.await(this._initialization);
|
|
635
791
|
return yield* Effect3.withFiberRuntime((fiber) => this._activateEvent(key, params, fiber).pipe(together(Effect3.sleep(Duration.seconds(15)).pipe(Effect3.andThen(Effect3.sync(() => log3.warn("event activation is taking a long time", {
|
|
636
792
|
event: key
|
|
637
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
793
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 637, S: this }))))), Performance.addTrackEntry({
|
|
638
794
|
name: typeof event === "string" ? event : eventKey(event),
|
|
639
795
|
devtools: {
|
|
640
796
|
dataType: "track-entry",
|
|
@@ -673,7 +829,7 @@ var ManagerImpl = class {
|
|
|
673
829
|
const key = typeof event === "string" ? event : eventKey(event);
|
|
674
830
|
log3("reset", {
|
|
675
831
|
key
|
|
676
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
832
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 674, S: this });
|
|
677
833
|
const modules = this._getActiveModulesByEvent(key);
|
|
678
834
|
const results = yield* Effect3.all(modules.map((module) => this._deactivateModule(module)), {
|
|
679
835
|
concurrency: "unbounded"
|
|
@@ -688,7 +844,7 @@ var ManagerImpl = class {
|
|
|
688
844
|
shutdown() {
|
|
689
845
|
return this._shutdownSemaphore.withPermits(1)(Effect3.gen(this, function* () {
|
|
690
846
|
yield* Ref.set(this._shuttingDown, true);
|
|
691
|
-
log3("shutdown", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
847
|
+
log3("shutdown", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 691, S: this });
|
|
692
848
|
yield* this._interruptInFlightActivations();
|
|
693
849
|
const activeIds = [
|
|
694
850
|
...this._get(this._activeAtom)
|
|
@@ -703,7 +859,7 @@ var ManagerImpl = class {
|
|
|
703
859
|
this._moduleMemoMap.clear();
|
|
704
860
|
yield* Ref.set(this._activatingEvents, []);
|
|
705
861
|
yield* Ref.set(this._activatingModules, []);
|
|
706
|
-
log3("shutdown complete", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
862
|
+
log3("shutdown complete", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 706, S: this });
|
|
707
863
|
return true;
|
|
708
864
|
}).pipe(Effect3.ensuring(Ref.set(this._shuttingDown, false))));
|
|
709
865
|
}
|
|
@@ -728,6 +884,122 @@ var ManagerImpl = class {
|
|
|
728
884
|
_getPluginIdForModule(moduleId) {
|
|
729
885
|
return this._get(this._pluginsAtom).find((plugin) => plugin.modules.some((module) => module.id === moduleId))?.meta.id;
|
|
730
886
|
}
|
|
887
|
+
/** Looks up an id in the cached registry catalog, returning the entry or `undefined`. */
|
|
888
|
+
_getCatalogEntry(id) {
|
|
889
|
+
return this._get(this.pluginRegistry.plugins).entries.find((entry) => entry.id === id);
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* Returns the direct `dependsOn` declarations for an id, drawing from the
|
|
893
|
+
* registered plugin's meta when available and falling back to the registry
|
|
894
|
+
* catalog entry. Unknown ids return an empty list (callers detect "missing"
|
|
895
|
+
* separately).
|
|
896
|
+
*/
|
|
897
|
+
_directDependencies(id) {
|
|
898
|
+
const plugin = this._getPlugin(id);
|
|
899
|
+
if (plugin) {
|
|
900
|
+
return [
|
|
901
|
+
...plugin.meta.dependsOn ?? []
|
|
902
|
+
];
|
|
903
|
+
}
|
|
904
|
+
const catalog = this._getCatalogEntry(id);
|
|
905
|
+
return catalog?.dependsOn ? [
|
|
906
|
+
...catalog.dependsOn
|
|
907
|
+
] : [];
|
|
908
|
+
}
|
|
909
|
+
/**
|
|
910
|
+
* Computes the transitive dependency closure for an id.
|
|
911
|
+
*
|
|
912
|
+
* Walks {@link _directDependencies} (registered plugins ∪ catalog entries).
|
|
913
|
+
* Returns:
|
|
914
|
+
* - `order`: closure including the root in dependency-first topological order.
|
|
915
|
+
* - `missing`: ids in the closure that are neither registered nor in the catalog.
|
|
916
|
+
* - `toInstall`: ids in the closure that are in the catalog but not yet registered.
|
|
917
|
+
* - `cycle`: when a cycle is detected, the cycle path; otherwise `undefined`.
|
|
918
|
+
*/
|
|
919
|
+
_computeDependencyClosure(id) {
|
|
920
|
+
const order = [];
|
|
921
|
+
const visited = /* @__PURE__ */ new Set();
|
|
922
|
+
const onStack = /* @__PURE__ */ new Set();
|
|
923
|
+
const stackPath = [];
|
|
924
|
+
const missing = [];
|
|
925
|
+
const toInstall = [];
|
|
926
|
+
let cycle;
|
|
927
|
+
const knownIds = /* @__PURE__ */ new Set([
|
|
928
|
+
...this._get(this._pluginsAtom).map((plugin) => plugin.meta.id),
|
|
929
|
+
...this._get(this.pluginRegistry.plugins).entries.map((entry) => entry.id)
|
|
930
|
+
]);
|
|
931
|
+
const visit = (currentId) => {
|
|
932
|
+
if (cycle) {
|
|
933
|
+
return;
|
|
934
|
+
}
|
|
935
|
+
if (visited.has(currentId)) {
|
|
936
|
+
return;
|
|
937
|
+
}
|
|
938
|
+
if (onStack.has(currentId)) {
|
|
939
|
+
const cycleStart = stackPath.indexOf(currentId);
|
|
940
|
+
cycle = [
|
|
941
|
+
...stackPath.slice(cycleStart),
|
|
942
|
+
currentId
|
|
943
|
+
];
|
|
944
|
+
return;
|
|
945
|
+
}
|
|
946
|
+
onStack.add(currentId);
|
|
947
|
+
stackPath.push(currentId);
|
|
948
|
+
if (!knownIds.has(currentId)) {
|
|
949
|
+
missing.push(currentId);
|
|
950
|
+
} else if (!this._getPlugin(currentId)) {
|
|
951
|
+
toInstall.push(currentId);
|
|
952
|
+
}
|
|
953
|
+
for (const depId of this._directDependencies(currentId)) {
|
|
954
|
+
visit(depId);
|
|
955
|
+
if (cycle) {
|
|
956
|
+
break;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
onStack.delete(currentId);
|
|
960
|
+
stackPath.pop();
|
|
961
|
+
if (!cycle) {
|
|
962
|
+
visited.add(currentId);
|
|
963
|
+
order.push(currentId);
|
|
964
|
+
}
|
|
965
|
+
};
|
|
966
|
+
visit(id);
|
|
967
|
+
return {
|
|
968
|
+
order,
|
|
969
|
+
missing,
|
|
970
|
+
toInstall,
|
|
971
|
+
cycle
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* Walks the reverse `dependsOn` edges across registered plugins. With
|
|
976
|
+
* `enabledOnly`, filters the result to currently-enabled ids. Returns
|
|
977
|
+
* dependents in dependents-before-deps order so callers (cascade-disable)
|
|
978
|
+
* can iterate and tear down leaves first.
|
|
979
|
+
*/
|
|
980
|
+
_collectDependents(id, opts) {
|
|
981
|
+
const direct = this._get(this._pluginsAtom).filter((plugin) => plugin.meta.dependsOn?.includes(id)).map((plugin) => plugin.meta.id);
|
|
982
|
+
if (!opts.transitive) {
|
|
983
|
+
return opts.enabledOnly ? direct.filter((dependentId) => this._get(this._enabledAtom).includes(dependentId)) : direct;
|
|
984
|
+
}
|
|
985
|
+
const result = [];
|
|
986
|
+
const visited = /* @__PURE__ */ new Set();
|
|
987
|
+
const visit = (currentId) => {
|
|
988
|
+
if (visited.has(currentId)) {
|
|
989
|
+
return;
|
|
990
|
+
}
|
|
991
|
+
visited.add(currentId);
|
|
992
|
+
const parents = this._get(this._pluginsAtom).filter((plugin) => plugin.meta.dependsOn?.includes(currentId)).map((plugin) => plugin.meta.id);
|
|
993
|
+
for (const parentId of parents) {
|
|
994
|
+
visit(parentId);
|
|
995
|
+
if (parentId !== id && !result.includes(parentId)) {
|
|
996
|
+
result.push(parentId);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
};
|
|
1000
|
+
visit(id);
|
|
1001
|
+
return opts.enabledOnly ? result.filter((dependentId) => this._get(this._enabledAtom).includes(dependentId)) : result;
|
|
1002
|
+
}
|
|
731
1003
|
/**
|
|
732
1004
|
* Records a failure for a plugin. Latest failure wins so the registry UI
|
|
733
1005
|
* always sees the most recent reason. Walks the `cause` chain when checking
|
|
@@ -749,7 +1021,7 @@ var ManagerImpl = class {
|
|
|
749
1021
|
phase,
|
|
750
1022
|
reason,
|
|
751
1023
|
error: error.message
|
|
752
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
1024
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 858, S: this });
|
|
753
1025
|
this._update(this._failedAtom, (current) => [
|
|
754
1026
|
...current.filter((entry) => entry.id !== id),
|
|
755
1027
|
failure
|
|
@@ -771,7 +1043,7 @@ var ManagerImpl = class {
|
|
|
771
1043
|
this._runForkedFiber(this.disable(id).pipe(Effect3.tapError((error) => Effect3.sync(() => log3.warn("auto-disable failed", {
|
|
772
1044
|
id,
|
|
773
1045
|
error
|
|
774
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
1046
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 881, S: this }))), Effect3.ignore));
|
|
775
1047
|
}
|
|
776
1048
|
_getActiveModules() {
|
|
777
1049
|
const active = this._get(this._activeAtom);
|
|
@@ -796,7 +1068,7 @@ var ManagerImpl = class {
|
|
|
796
1068
|
if (pendingReset.length > 0) {
|
|
797
1069
|
log3("pending reset", {
|
|
798
1070
|
events: pendingReset
|
|
799
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
1071
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 907, S: this });
|
|
800
1072
|
this._update(this._pendingResetAtom, (current) => [
|
|
801
1073
|
...current,
|
|
802
1074
|
...pendingReset
|
|
@@ -846,7 +1118,7 @@ var ManagerImpl = class {
|
|
|
846
1118
|
_addPlugin(plugin) {
|
|
847
1119
|
log3("add plugin", {
|
|
848
1120
|
id: plugin.meta.id
|
|
849
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
1121
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 956, S: this });
|
|
850
1122
|
this._update(this._pluginsAtom, (plugins) => plugins.includes(plugin) ? plugins : [
|
|
851
1123
|
...plugins,
|
|
852
1124
|
plugin
|
|
@@ -855,13 +1127,13 @@ var ManagerImpl = class {
|
|
|
855
1127
|
_removePlugin(id) {
|
|
856
1128
|
log3("remove plugin", {
|
|
857
1129
|
id
|
|
858
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
1130
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 966, S: this });
|
|
859
1131
|
this._update(this._pluginsAtom, (plugins) => plugins.filter((plugin) => plugin.meta.id !== id));
|
|
860
1132
|
}
|
|
861
1133
|
_addModule(module) {
|
|
862
1134
|
log3("add module", {
|
|
863
1135
|
id: module.id
|
|
864
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
1136
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 972, S: this });
|
|
865
1137
|
this._update(this._modulesAtom, (modules) => modules.includes(module) ? modules : [
|
|
866
1138
|
...modules,
|
|
867
1139
|
module
|
|
@@ -870,7 +1142,7 @@ var ManagerImpl = class {
|
|
|
870
1142
|
_removeModule(id) {
|
|
871
1143
|
log3("remove module", {
|
|
872
1144
|
id
|
|
873
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
1145
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 982, S: this });
|
|
874
1146
|
this._update(this._modulesAtom, (modules) => modules.filter((module) => module.id !== id));
|
|
875
1147
|
}
|
|
876
1148
|
//
|
|
@@ -882,7 +1154,7 @@ var ManagerImpl = class {
|
|
|
882
1154
|
log3("activating", {
|
|
883
1155
|
key,
|
|
884
1156
|
...params
|
|
885
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
1157
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 993, S: this });
|
|
886
1158
|
yield* Ref.update(this._activatingEvents, (activating) => Array.append(activating, key));
|
|
887
1159
|
this._clearPendingReset(key);
|
|
888
1160
|
const activatingEvents = yield* this._activatingEvents;
|
|
@@ -891,7 +1163,7 @@ var ManagerImpl = class {
|
|
|
891
1163
|
if (modules.length === 0) {
|
|
892
1164
|
log3("no modules to activate", {
|
|
893
1165
|
key
|
|
894
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
1166
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 1003, S: this });
|
|
895
1167
|
if (!this._get(this._eventsFiredAtom).includes(key)) {
|
|
896
1168
|
this._update(this._eventsFiredAtom, (events) => [
|
|
897
1169
|
...events,
|
|
@@ -913,7 +1185,7 @@ var ManagerImpl = class {
|
|
|
913
1185
|
log3("activating modules", {
|
|
914
1186
|
key,
|
|
915
1187
|
modules: activatingModuleIds
|
|
916
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
1188
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 1024, S: this });
|
|
917
1189
|
performance.mark(`event:${key}:start`);
|
|
918
1190
|
yield* PubSub.publish(this.activation, {
|
|
919
1191
|
event: key,
|
|
@@ -937,7 +1209,7 @@ var ManagerImpl = class {
|
|
|
937
1209
|
});
|
|
938
1210
|
log3("activated", {
|
|
939
1211
|
key
|
|
940
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
1212
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 1049, S: this });
|
|
941
1213
|
return true;
|
|
942
1214
|
}).pipe(Effect3.ensuring(Ref.update(this._activatingModules, (activating) => Array.filter(activating, (module) => !activatingModuleIds.includes(module)))));
|
|
943
1215
|
}
|
|
@@ -969,7 +1241,7 @@ var ManagerImpl = class {
|
|
|
969
1241
|
}), together(Effect3.sleep(Duration.seconds(10)).pipe(Effect3.andThen(Effect3.sync(() => log3.warn(`${logLabel} is taking a long time`, {
|
|
970
1242
|
event: key,
|
|
971
1243
|
[eventKey2]: events.map(eventKey)
|
|
972
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
1244
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 1082, S: this }))))), Effect3.asVoid);
|
|
973
1245
|
}
|
|
974
1246
|
//
|
|
975
1247
|
// Module lifecycle helpers
|
|
@@ -1025,7 +1297,7 @@ var ManagerImpl = class {
|
|
|
1025
1297
|
log3("loading module", {
|
|
1026
1298
|
module: module.id,
|
|
1027
1299
|
parentEvent
|
|
1028
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
1300
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 1140, S: this });
|
|
1029
1301
|
performance.mark(`module:${module.id}:start`);
|
|
1030
1302
|
yield* PubSub.publish(this.activation, {
|
|
1031
1303
|
event: parentEvent,
|
|
@@ -1067,11 +1339,11 @@ var ManagerImpl = class {
|
|
|
1067
1339
|
parentEvent,
|
|
1068
1340
|
elapsed,
|
|
1069
1341
|
failed: false
|
|
1070
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
1342
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 1175, S: this });
|
|
1071
1343
|
return normalized;
|
|
1072
1344
|
}).pipe(Effect3.withSpan("PluginManager._loadModule"), together(Effect3.sleep(Duration.seconds(10)).pipe(Effect3.andThen(Effect3.sync(() => log3.warn(`module is taking a long time to activate`, {
|
|
1073
1345
|
module: module.id
|
|
1074
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
1346
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 1182, S: this }))))), Performance.addTrackEntry({
|
|
1075
1347
|
name: module.id,
|
|
1076
1348
|
devtools: {
|
|
1077
1349
|
dataType: "track-entry",
|
|
@@ -1087,7 +1359,7 @@ var ManagerImpl = class {
|
|
|
1087
1359
|
error: error instanceof Error ? error.message : String(error),
|
|
1088
1360
|
stack: error instanceof Error ? error.stack : void 0,
|
|
1089
1361
|
isDefect: !Cause.isFailure(cause)
|
|
1090
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
1362
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 1196, S: this });
|
|
1091
1363
|
const normalizedError = error instanceof Error ? error : new Error(String(error));
|
|
1092
1364
|
const pluginId = this._getPluginIdForModule(module.id);
|
|
1093
1365
|
if (pluginId !== void 0) {
|
|
@@ -1122,7 +1394,7 @@ var ManagerImpl = class {
|
|
|
1122
1394
|
const id = module.id;
|
|
1123
1395
|
log3("deactivating", {
|
|
1124
1396
|
id
|
|
1125
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
1397
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 1235, S: this });
|
|
1126
1398
|
this._moduleMemoMap.delete(id);
|
|
1127
1399
|
const capabilities = this._capabilities.get(id);
|
|
1128
1400
|
if (capabilities) {
|
|
@@ -1139,7 +1411,7 @@ var ManagerImpl = class {
|
|
|
1139
1411
|
}
|
|
1140
1412
|
log3("deactivated", {
|
|
1141
1413
|
id
|
|
1142
|
-
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L:
|
|
1414
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 1252, S: this });
|
|
1143
1415
|
return true;
|
|
1144
1416
|
});
|
|
1145
1417
|
}
|
|
@@ -1171,4 +1443,4 @@ export {
|
|
|
1171
1443
|
make5 as make,
|
|
1172
1444
|
plugin_manager_exports
|
|
1173
1445
|
};
|
|
1174
|
-
//# sourceMappingURL=chunk-
|
|
1446
|
+
//# sourceMappingURL=chunk-VJ5PFAWC.mjs.map
|