From 185efadd86279c21ccb74a6ae4afa59f9d2e7dad Mon Sep 17 00:00:00 2001 From: Richard Zampieri Date: Sun, 8 Sep 2024 00:41:34 -0700 Subject: [PATCH] feat: add shared lib as deps & remove config --- package.json | 1 + src/@types/config.ts | 40 ------------------------- src/@types/index.ts | 1 - src/generate/utils/command-utils.ts | 2 +- src/generate/utils/nonopininated-cmd.ts | 2 +- src/generate/utils/opinionated-cmd.ts | 2 +- src/index.ts | 1 - src/types.ts | 1 - src/utils/compiler.ts | 2 +- 9 files changed, 5 insertions(+), 47 deletions(-) delete mode 100644 src/@types/config.ts delete mode 100644 src/@types/index.ts delete mode 100644 src/types.ts diff --git a/package.json b/package.json index 7891adb..18e9920 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ }, "dependencies": { "@expressots/boost-ts": "1.3.0", + "@expressots/shared": "file:../shared/expressots-shared-0.0.1-beta.tgz", "axios": "^1.7.3", "chalk-animation": "2.0.3", "cli-progress": "3.12.0", diff --git a/src/@types/config.ts b/src/@types/config.ts deleted file mode 100644 index 9d788c4..0000000 --- a/src/@types/config.ts +++ /dev/null @@ -1,40 +0,0 @@ -export const enum Pattern { - LOWER_CASE = "lowercase", - KEBAB_CASE = "kebab-case", - PASCAL_CASE = "PascalCase", - CAMEL_CASE = "camelCase", -} - -interface IProviders { - prisma?: { - schemaName: string; - schemaPath: string; - entitiesPath: string; - entityNamePattern: string; - }; -} - -/** - * The configuration object for the Expresso CLI. - * - * @property {Pattern} scaffoldPattern - The pattern to use when scaffolding files. - * @property {string} sourceRoot - The root directory for the source files. - * @property {boolean} opinionated - Whether or not to use the opinionated configuration. - * - * @see [ExpressoConfig](https://expresso-ts.com/docs) - */ -export interface ExpressoConfig { - scaffoldPattern: Pattern; - sourceRoot: string; - opinionated: boolean; - providers?: IProviders; - scaffoldSchematics?: { - entity?: string; - controller?: string; - usecase?: string; - dto?: string; - module?: string; - provider?: string; - middleware?: string; - }; -} diff --git a/src/@types/index.ts b/src/@types/index.ts deleted file mode 100644 index 5c62e04..0000000 --- a/src/@types/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./config"; diff --git a/src/generate/utils/command-utils.ts b/src/generate/utils/command-utils.ts index 9dd1dae..7000346 100644 --- a/src/generate/utils/command-utils.ts +++ b/src/generate/utils/command-utils.ts @@ -11,7 +11,7 @@ import { import { printError } from "../../utils/cli-ui"; import { verifyIfFileExists } from "../../utils/verify-file-exists"; import Compiler from "../../utils/compiler"; -import { ExpressoConfig, Pattern } from "../../types"; +import { ExpressoConfig, Pattern } from "@expressots/shared"; export const enum PathStyle { None = "none", diff --git a/src/generate/utils/nonopininated-cmd.ts b/src/generate/utils/nonopininated-cmd.ts index a7b8a4b..182ba40 100644 --- a/src/generate/utils/nonopininated-cmd.ts +++ b/src/generate/utils/nonopininated-cmd.ts @@ -3,7 +3,7 @@ import { anyCaseToKebabCase, anyCaseToPascalCase, } from "@expressots/boost-ts"; -import { ExpressoConfig } from "../../@types"; +import { ExpressoConfig } from "@expressots/shared"; import { printGenerateSuccess } from "../../utils/cli-ui"; import { diff --git a/src/generate/utils/opinionated-cmd.ts b/src/generate/utils/opinionated-cmd.ts index 3c48006..d8a09c8 100644 --- a/src/generate/utils/opinionated-cmd.ts +++ b/src/generate/utils/opinionated-cmd.ts @@ -20,7 +20,7 @@ import { addModuleToContainer, addModuleToContainerNestedPath, } from "../../utils/add-module-to-container"; -import { ExpressoConfig } from "../../@types"; +import { ExpressoConfig } from "@expressots/shared"; /** * Process commands for opinionated service scaffolding diff --git a/src/index.ts b/src/index.ts index 814fd72..5656364 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,3 @@ -export * from "./types"; export * from "./generate"; export * from "./utils"; export * from "./new"; diff --git a/src/types.ts b/src/types.ts deleted file mode 100644 index 0303157..0000000 --- a/src/types.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./@types"; diff --git a/src/utils/compiler.ts b/src/utils/compiler.ts index 37e2035..14d4c26 100644 --- a/src/utils/compiler.ts +++ b/src/utils/compiler.ts @@ -1,7 +1,7 @@ import { existsSync } from "node:fs"; import path from "path"; import { RegisterOptions, Service } from "ts-node"; -import { ExpressoConfig } from "../types"; +import { ExpressoConfig } from "@expressots/shared"; import { printError } from "./cli-ui"; /**