mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Migrate to appPaths-Feature
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi> Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
This commit is contained in:
parent
7bac8f303a
commit
f06cde41df
@ -3,4 +3,4 @@
|
||||
<component name="PrettierConfiguration">
|
||||
<option name="myRunOnReformat" value="true" />
|
||||
</component>
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@ -293,14 +293,15 @@
|
||||
"winston-transport-browserconsole": "^1.0.5",
|
||||
"ws": "^8.11.0",
|
||||
"xterm-link-provider": "^1.3.1",
|
||||
"@lensapp/app-paths": "^0.1.1",
|
||||
"@lensapp/aws-clusters": "^0.1.0",
|
||||
"@lensapp/cluster": "^0.1.5",
|
||||
"@lensapp/feature-core": "^0.1.6",
|
||||
"@lensapp/fs": "^0.2.0",
|
||||
"@lensapp/logging": "^0.1.5",
|
||||
"@lensapp/shell": "^0.1.6",
|
||||
"@lensapp/utils": "^0.2.4",
|
||||
"@lensapp/preferences": "^0.1.6",
|
||||
"@lensapp/aws-clusters": "^0.1.0"
|
||||
"@lensapp/shell": "^0.1.6",
|
||||
"@lensapp/utils": "^0.2.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@async-fn/jest": "1.6.4",
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectionToken } from "@ogre-tools/injectable";
|
||||
import type { PathName } from "./app-path-names";
|
||||
|
||||
export type AppPaths = Record<PathName, string>;
|
||||
|
||||
export const appPathsInjectionToken = getInjectionToken<AppPaths>({ id: "app-paths-token" });
|
||||
|
||||
|
||||
@ -1,26 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import type { app as electronApp } from "electron";
|
||||
|
||||
export type PathName = Parameters<typeof electronApp["getPath"]>[0];
|
||||
|
||||
export const pathNames: PathName[] = [
|
||||
"home",
|
||||
"appData",
|
||||
"userData",
|
||||
"cache",
|
||||
"temp",
|
||||
"exe",
|
||||
"module",
|
||||
"desktop",
|
||||
"documents",
|
||||
"downloads",
|
||||
"music",
|
||||
"pictures",
|
||||
"videos",
|
||||
"logs",
|
||||
"crashDumps",
|
||||
"recent",
|
||||
];
|
||||
@ -2,7 +2,7 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import type { AppPaths } from "./app-path-injection-token";
|
||||
import type { AppPaths } from "@lensapp/app-paths";
|
||||
import type { RequestChannel } from "../utils/channel/request-channel-listener-injection-token";
|
||||
|
||||
export type AppPathsChannel = RequestChannel<void, AppPaths>;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { AppPaths } from "./app-path-injection-token";
|
||||
import type { AppPaths } from "@lensapp/app-paths";
|
||||
|
||||
const appPathsStateInjectable = getInjectable({
|
||||
id: "app-paths-state",
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { appPathsInjectionToken } from "./app-path-injection-token";
|
||||
import { appPathsInjectionToken } from "@lensapp/app-paths";
|
||||
import appPathsStateInjectable from "./app-paths-state.injectable";
|
||||
|
||||
const appPathsInjectable = getInjectable({
|
||||
|
||||
@ -2,10 +2,9 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import type { AppPaths } from "./app-path-injection-token";
|
||||
import { appPathsInjectionToken } from "./app-path-injection-token";
|
||||
import type { AppPaths, PathName } from "@lensapp/app-paths";
|
||||
import { appPathsInjectionToken } from "@lensapp/app-paths";
|
||||
import getElectronAppPathInjectable from "../../main/app-paths/get-electron-app-path/get-electron-app-path.injectable";
|
||||
import type { PathName } from "./app-path-names";
|
||||
import setElectronAppPathInjectable from "../../main/app-paths/set-electron-app-path/set-electron-app-path.injectable";
|
||||
import directoryForIntegrationTestingInjectable from "../../main/app-paths/directory-for-integration-testing/directory-for-integration-testing.injectable";
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { appPathsInjectionToken } from "../app-path-injection-token";
|
||||
import { appPathsInjectionToken } from "@lensapp/app-paths";
|
||||
|
||||
const directoryForDownloadsInjectable = getInjectable({
|
||||
id: "directory-for-downloads",
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { appPathsInjectionToken } from "../app-path-injection-token";
|
||||
import { appPathsInjectionToken } from "@lensapp/app-paths";
|
||||
|
||||
const directoryForExesInjectable = getInjectable({
|
||||
id: "directory-for-exes",
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { appPathsInjectionToken } from "../app-path-injection-token";
|
||||
import { appPathsInjectionToken } from "@lensapp/app-paths";
|
||||
|
||||
const directoryForTempInjectable = getInjectable({
|
||||
id: "directory-for-temp",
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { appPathsInjectionToken } from "../app-path-injection-token";
|
||||
import { appPathsInjectionToken } from "@lensapp/app-paths";
|
||||
|
||||
const directoryForUserDataInjectable = getInjectable({
|
||||
id: "directory-for-user-data",
|
||||
|
||||
@ -3,9 +3,8 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { fromPairs } from "lodash/fp";
|
||||
import type { PathName } from "../../common/app-paths/app-path-names";
|
||||
import { pathNames } from "../../common/app-paths/app-path-names";
|
||||
import type { AppPaths } from "../../common/app-paths/app-path-injection-token";
|
||||
import type { AppPaths, PathName } from "@lensapp/app-paths";
|
||||
import { pathNames } from "@lensapp/app-paths";
|
||||
|
||||
interface Dependencies {
|
||||
getAppPath: (name: PathName) => string;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import type { App } from "electron";
|
||||
import type { PathName } from "../../../common/app-paths/app-path-names";
|
||||
import type { PathName } from "@lensapp/app-paths";
|
||||
|
||||
interface Dependencies {
|
||||
app: App;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { PathName } from "../../../common/app-paths/app-path-names";
|
||||
import type { PathName } from "@lensapp/app-paths";
|
||||
import electronAppInjectable from "../../electron-app/electron-app.injectable";
|
||||
|
||||
const setElectronAppPathInjectable = getInjectable({
|
||||
|
||||
@ -3,12 +3,12 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { AppPaths } from "../../common/app-paths/app-path-injection-token";
|
||||
import type { AppPaths } from "@lensapp/app-paths";
|
||||
import getElectronAppPathInjectable from "./get-electron-app-path/get-electron-app-path.injectable";
|
||||
import setElectronAppPathInjectable from "./set-electron-app-path/set-electron-app-path.injectable";
|
||||
import directoryForIntegrationTestingInjectable from "./directory-for-integration-testing/directory-for-integration-testing.injectable";
|
||||
import appPathsStateInjectable from "../../common/app-paths/app-paths-state.injectable";
|
||||
import { pathNames } from "../../common/app-paths/app-path-names";
|
||||
import { pathNames } from "@lensapp/app-paths";
|
||||
import { fromPairs, map } from "lodash/fp";
|
||||
import { pipeline } from "@ogre-tools/fp";
|
||||
import joinPathsInjectable from "../../common/path/join-paths.injectable";
|
||||
|
||||
@ -1101,6 +1101,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b"
|
||||
integrity sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==
|
||||
|
||||
"@lensapp/app-paths@^0.1.1":
|
||||
version "0.1.1"
|
||||
resolved "http://localhost:53093/@lensapp%2fapp-paths/-/app-paths-0.1.1.tgz#b70237b63ee50c24fede036852b421ecae0c9475"
|
||||
integrity sha512-4/pK8MgXq1/ltFf9DjmC/PFjiJ9vKPx7d69RAjEApKB0+7SO9T0/Y4Hu8jfGOz8sUFdofjxlkmhMYGFWGuqihA==
|
||||
|
||||
"@lensapp/aws-clusters@^0.1.0":
|
||||
version "0.1.0"
|
||||
resolved "http://localhost:53093/@lensapp%2faws-clusters/-/aws-clusters-0.1.0.tgz#4b10554d910f8909d793e15b7c6c605d8dd1ca4e"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user