1
0
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:
Iku-turso 2022-11-24 10:34:53 +02:00
parent 7bac8f303a
commit f06cde41df
17 changed files with 25 additions and 59 deletions

View File

@ -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",

View File

@ -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" });

View File

@ -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",
];

View File

@ -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>;

View File

@ -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",

View File

@ -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({

View File

@ -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";

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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;

View File

@ -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;

View File

@ -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({

View File

@ -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";

View File

@ -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"