mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Cascade different refactorings to eliminate global shared state from app paths
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
1 parent
908a40975e
commit
9d33fff906
336 files changed
+9105
-3307
No files matched your search
@@ -21,11 +21,14 @@
|
||||
|
||||
import type { InstalledExtension } from "./extension-discovery/extension-discovery";
|
||||
import { action, observable, makeObservable, computed } from "mobx";
|
||||
import { FilesystemProvisionerStore } from "../main/extension-filesystem";
|
||||
import logger from "../main/logger";
|
||||
import type { ProtocolHandlerRegistration } from "./registries";
|
||||
import type { PackageJson } from "type-fest";
|
||||
import { Disposer, disposer } from "../common/utils";
|
||||
import {
|
||||
LensExtensionDependencies,
|
||||
setLensExtensionDependencies,
|
||||
} from "./lens-extension-set-dependencies";
|
||||
|
||||
export type LensExtensionId = string; // path to manifest (package.json)
|
||||
export type LensExtensionConstructor = new (...args: ConstructorParameters<typeof LensExtension>) => LensExtension;
|
||||
@@ -75,6 +78,12 @@ export class LensExtension {
|
||||
return this.manifest.description;
|
||||
}
|
||||
|
||||
private dependencies: LensExtensionDependencies;
|
||||
|
||||
[setLensExtensionDependencies] = (dependencies: LensExtensionDependencies) => {
|
||||
this.dependencies = dependencies;
|
||||
};
|
||||
|
||||
/**
|
||||
* getExtensionFileFolder returns the path to an already created folder. This
|
||||
* folder is for the sole use of this extension.
|
||||
@@ -83,7 +92,7 @@ export class LensExtension {
|
||||
* folder name.
|
||||
*/
|
||||
async getExtensionFileFolder(): Promise<string> {
|
||||
return FilesystemProvisionerStore.getInstance().requestDirectory(this.id);
|
||||
return this.dependencies.fileSystemProvisionerStore.requestDirectory(this.id);
|
||||
}
|
||||
|
||||
@action
|
||||
|
||||
Reference in new issue
Block a user