From 359aea89682e9d8c682f43c33c5d7b33841a9488 Mon Sep 17 00:00:00 2001 From: Xymorot Date: Thu, 7 Jan 2021 23:21:03 +0100 Subject: [PATCH] refactor: move shared types and services into a "shared" folder inside "src" --- .eslintrc.json | 2 +- src/renderer/services/api.ts | 2 +- src/{ => shared}/services/uuid.spec.ts | 0 src/{ => shared}/services/uuid.ts | 0 {types => src/shared/types}/deep-partial.d.ts | 0 {types => src/shared/types}/entities/work.d.ts | 0 {types => src/shared/types}/http-code.d.ts | 0 .../shared/types}/ipc-controller-method-decorator.d.ts | 0 {types => src/shared/types}/ipc.d.ts | 0 {types => src/shared/types}/milliseconds.d.ts | 0 tsconfig.json | 2 +- tsconfig.renderer.json | 8 +------- 12 files changed, 4 insertions(+), 10 deletions(-) rename src/{ => shared}/services/uuid.spec.ts (100%) rename src/{ => shared}/services/uuid.ts (100%) rename {types => src/shared/types}/deep-partial.d.ts (100%) rename {types => src/shared/types}/entities/work.d.ts (100%) rename {types => src/shared/types}/http-code.d.ts (100%) rename {types => src/shared/types}/ipc-controller-method-decorator.d.ts (100%) rename {types => src/shared/types}/ipc.d.ts (100%) rename {types => src/shared/types}/milliseconds.d.ts (100%) diff --git a/.eslintrc.json b/.eslintrc.json index efc11ae..23edeca 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -180,7 +180,7 @@ } }, { - "files": ["types/**/*"], + "files": ["src/shared/types/**/*"], "rules": { "@typescript-eslint/no-magic-numbers": "off" } diff --git a/src/renderer/services/api.ts b/src/renderer/services/api.ts index 60006d6..4150527 100644 --- a/src/renderer/services/api.ts +++ b/src/renderer/services/api.ts @@ -1,5 +1,5 @@ import { ipcRenderer } from 'electron'; -import { uuid } from '../../services/uuid'; +import { uuid } from '../../shared/services/uuid'; import IpcRendererEvent = Electron.IpcRendererEvent; const ipcClient: IpcClient = { diff --git a/src/services/uuid.spec.ts b/src/shared/services/uuid.spec.ts similarity index 100% rename from src/services/uuid.spec.ts rename to src/shared/services/uuid.spec.ts diff --git a/src/services/uuid.ts b/src/shared/services/uuid.ts similarity index 100% rename from src/services/uuid.ts rename to src/shared/services/uuid.ts diff --git a/types/deep-partial.d.ts b/src/shared/types/deep-partial.d.ts similarity index 100% rename from types/deep-partial.d.ts rename to src/shared/types/deep-partial.d.ts diff --git a/types/entities/work.d.ts b/src/shared/types/entities/work.d.ts similarity index 100% rename from types/entities/work.d.ts rename to src/shared/types/entities/work.d.ts diff --git a/types/http-code.d.ts b/src/shared/types/http-code.d.ts similarity index 100% rename from types/http-code.d.ts rename to src/shared/types/http-code.d.ts diff --git a/types/ipc-controller-method-decorator.d.ts b/src/shared/types/ipc-controller-method-decorator.d.ts similarity index 100% rename from types/ipc-controller-method-decorator.d.ts rename to src/shared/types/ipc-controller-method-decorator.d.ts diff --git a/types/ipc.d.ts b/src/shared/types/ipc.d.ts similarity index 100% rename from types/ipc.d.ts rename to src/shared/types/ipc.d.ts diff --git a/types/milliseconds.d.ts b/src/shared/types/milliseconds.d.ts similarity index 100% rename from types/milliseconds.d.ts rename to src/shared/types/milliseconds.d.ts diff --git a/tsconfig.json b/tsconfig.json index 99370fb..7daad4e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,5 +15,5 @@ "emitDecoratorMetadata": true, "importsNotUsedAsValues": "error" }, - "include": ["declarations/**/*.ts", "types/**/*.ts", "src/main.ts", "src/main/**/*.ts", "src/services/**/*.ts"] + "include": ["declarations/**/*.ts", "src/main.ts", "src/main/**/*.ts", "src/shared/**/*.ts"] } diff --git a/tsconfig.renderer.json b/tsconfig.renderer.json index 0d6ed5d..eba5212 100644 --- a/tsconfig.renderer.json +++ b/tsconfig.renderer.json @@ -9,11 +9,5 @@ "preserveConstEnums": false, "importsNotUsedAsValues": "error" }, - "include": [ - "declarations/**/*.ts", - "types/**/*.ts", - "src/renderer.ts", - "src/renderer/**/*.ts", - "src/services/**/*.ts" - ] + "include": ["declarations/**/*.ts", "src/renderer.ts", "src/renderer/**/*.ts", "src/shared/**/*.ts"] }