From e291d489e3004f01b3ce4214c36bc385859914d7 Mon Sep 17 00:00:00 2001 From: Supan Adit Pratama Date: Sat, 26 Oct 2024 17:41:36 +0700 Subject: [PATCH] feat: change the base to skeleton --- libs/autocrud/src/autocrud.module.ts | 10 ---------- libs/autocrud/src/autocrud.service.spec.ts | 18 ------------------ libs/autocrud/src/autocrud.service.ts | 4 ---- libs/autocrud/src/index.ts | 4 ---- libs/skeleton/src/index.ts | 1 + .../interfaces/standard-process.interface.ts | 0 .../src/skeleton-crud.controller.ts} | 2 +- libs/{autocrud => skeleton}/tsconfig.lib.json | 2 +- nest-cli.json | 8 ++++---- package.json | 4 ++-- test/jest-e2e.json | 4 ++-- tsconfig.json | 8 ++++---- 12 files changed, 15 insertions(+), 50 deletions(-) delete mode 100644 libs/autocrud/src/autocrud.module.ts delete mode 100644 libs/autocrud/src/autocrud.service.spec.ts delete mode 100644 libs/autocrud/src/autocrud.service.ts delete mode 100644 libs/autocrud/src/index.ts create mode 100644 libs/skeleton/src/index.ts rename libs/{autocrud => skeleton}/src/interfaces/standard-process.interface.ts (100%) rename libs/{autocrud/src/autocrud.controller.ts => skeleton/src/skeleton-crud.controller.ts} (92%) rename libs/{autocrud => skeleton}/tsconfig.lib.json (91%) diff --git a/libs/autocrud/src/autocrud.module.ts b/libs/autocrud/src/autocrud.module.ts deleted file mode 100644 index 3bbc7d1..0000000 --- a/libs/autocrud/src/autocrud.module.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Module } from '@nestjs/common'; -import { AutocrudService as AutoCRUDService } from './autocrud.service'; -import { AutoCRUDController } from './autocrud.controller'; - -@Module({ - providers: [AutoCRUDService], - exports: [AutoCRUDService], - controllers: [AutoCRUDController], -}) -export class AutoCRUDModule {} diff --git a/libs/autocrud/src/autocrud.service.spec.ts b/libs/autocrud/src/autocrud.service.spec.ts deleted file mode 100644 index e871c1c..0000000 --- a/libs/autocrud/src/autocrud.service.spec.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Test, TestingModule } from '@nestjs/testing'; -import { AutocrudService } from './autocrud.service'; - -describe('AutocrudService', () => { - let service: AutocrudService; - - beforeEach(async () => { - const module: TestingModule = await Test.createTestingModule({ - providers: [AutocrudService], - }).compile(); - - service = module.get(AutocrudService); - }); - - it('should be defined', () => { - expect(service).toBeDefined(); - }); -}); diff --git a/libs/autocrud/src/autocrud.service.ts b/libs/autocrud/src/autocrud.service.ts deleted file mode 100644 index 604d74b..0000000 --- a/libs/autocrud/src/autocrud.service.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Injectable } from '@nestjs/common'; - -@Injectable() -export class AutocrudService {} diff --git a/libs/autocrud/src/index.ts b/libs/autocrud/src/index.ts deleted file mode 100644 index 942c7e8..0000000 --- a/libs/autocrud/src/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import 'reflect-metadata'; -export * from './autocrud.module'; -export * from './autocrud.service'; -export * from './autocrud.controller'; diff --git a/libs/skeleton/src/index.ts b/libs/skeleton/src/index.ts new file mode 100644 index 0000000..79b7acf --- /dev/null +++ b/libs/skeleton/src/index.ts @@ -0,0 +1 @@ +export * from './skeleton-crud.controller'; diff --git a/libs/autocrud/src/interfaces/standard-process.interface.ts b/libs/skeleton/src/interfaces/standard-process.interface.ts similarity index 100% rename from libs/autocrud/src/interfaces/standard-process.interface.ts rename to libs/skeleton/src/interfaces/standard-process.interface.ts diff --git a/libs/autocrud/src/autocrud.controller.ts b/libs/skeleton/src/skeleton-crud.controller.ts similarity index 92% rename from libs/autocrud/src/autocrud.controller.ts rename to libs/skeleton/src/skeleton-crud.controller.ts index 55a2ffe..2ab0cac 100644 --- a/libs/autocrud/src/autocrud.controller.ts +++ b/libs/skeleton/src/skeleton-crud.controller.ts @@ -1,6 +1,6 @@ import { Delete, Get, Param, Patch, Post, Put } from '@nestjs/common'; -export class AutoCRUDController { +export class SkeletonCRUDController { @Post() create() {} diff --git a/libs/autocrud/tsconfig.lib.json b/libs/skeleton/tsconfig.lib.json similarity index 91% rename from libs/autocrud/tsconfig.lib.json rename to libs/skeleton/tsconfig.lib.json index e2305a4..57afa0a 100644 --- a/libs/autocrud/tsconfig.lib.json +++ b/libs/skeleton/tsconfig.lib.json @@ -10,7 +10,7 @@ "experimentalDecorators": true, "target": "es6", "sourceMap": false, - "outDir": "../../dist/libs/autocrud", + "outDir": "../../dist/libs/skeleton", "skipLibCheck": true, }, "include": [ diff --git a/nest-cli.json b/nest-cli.json index 2e5d7ba..ee8a6db 100644 --- a/nest-cli.json +++ b/nest-cli.json @@ -7,13 +7,13 @@ "webpack": true }, "projects": { - "autocrud": { + "skeleton": { "type": "library", - "root": "libs/autocrud", + "root": "libs/skeleton", "entryFile": "index", - "sourceRoot": "libs/autocrud/src", + "sourceRoot": "libs/skeleton/src", "compilerOptions": { - "tsConfigPath": "libs/autocrud/tsconfig.lib.json" + "tsConfigPath": "libs/skeleton/tsconfig.lib.json" } } } diff --git a/package.json b/package.json index 2f2190a..3198603 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "license": "UNLICENSED", "scripts": { "build": "nest build", - "build:lib:autocrud": "tsc -p libs/autocrud/tsconfig.lib.json", + "build:lib:skeleton": "tsc -p libs/skeleton/tsconfig.lib.json", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\" \"libs/**/*.ts\"", "start": "nest start", "start:dev": "nest start --watch", @@ -72,7 +72,7 @@ "/libs/" ], "moduleNameMapper": { - "^@autocrud/autocrud(|/.*)$": "/libs/autocrud/src/$1" + "^@autocrud/skeleton(|/.*)$": "/libs/skeleton/src/$1" } } } \ No newline at end of file diff --git a/test/jest-e2e.json b/test/jest-e2e.json index dbbab4c..7bd7c70 100644 --- a/test/jest-e2e.json +++ b/test/jest-e2e.json @@ -11,7 +11,7 @@ "^.+\\.(t|j)s$": "ts-jest" }, "moduleNameMapper": { - "@autocrud/autocrud/(.*)": "/../libs/autocrud/src/$1", - "@autocrud/autocrud": "/../libs/autocrud/src" + "@autocrud/skeleton/(.*)": "/../libs/skeleton/src/$1", + "@autocrud/skeleton": "/../libs/skeleton/src" } } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index abcb245..791086a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,11 +18,11 @@ "forceConsistentCasingInFileNames": false, "noFallthroughCasesInSwitch": false, "paths": { - "@autocrud/autocrud": [ - "libs/autocrud/src" + "@autocrud/skeleton": [ + "libs/skeleton/src" ], - "@autocrud/autocrud/*": [ - "libs/autocrud/src/*" + "@autocrud/skeleton/*": [ + "libs/skeleton/src/*" ] } }