From f4542082a2bc2c1d846033f37a037f20e4c16acc Mon Sep 17 00:00:00 2001 From: Supan Adit Pratama Date: Tue, 29 Oct 2024 01:36:26 +0700 Subject: [PATCH] feat: export testing to different project --- index.js | 7 +++++- libs/prisma/src/index.ts | 1 + libs/prisma/src/processes/list.process.ts | 1 + libs/prisma/tsconfig.lib.json | 24 +++++++++++++++++---- libs/skeleton/src/index.ts | 1 - package.json | 4 +++- tsconfig.lib.json | 26 +++++++++++++++++++++++ 7 files changed, 57 insertions(+), 7 deletions(-) create mode 100644 tsconfig.lib.json diff --git a/index.js b/index.js index cdcf4fc..db0e954 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,9 @@ require = require('esm')(module /*, options*/); module.exports = { - ...require('./dist/libs/skeleton'), + // For npm run build:libs + ...require('./dist/libs/skeleton/src'), + ...require('./dist/libs/prisma/src'), + // For Prisma Only + // ...require('./dist/libs/prisma/prisma/src'), + // ...require('./dist/libs/prisma/skeleton/src'), }; diff --git a/libs/prisma/src/index.ts b/libs/prisma/src/index.ts index 4c7392b..767b911 100644 --- a/libs/prisma/src/index.ts +++ b/libs/prisma/src/index.ts @@ -1,3 +1,4 @@ export * from './prisma.module'; export * from './prisma.service'; export * from './constants'; +export * from './processes/list.process'; diff --git a/libs/prisma/src/processes/list.process.ts b/libs/prisma/src/processes/list.process.ts index 8a9cbf5..4cf4200 100644 --- a/libs/prisma/src/processes/list.process.ts +++ b/libs/prisma/src/processes/list.process.ts @@ -9,6 +9,7 @@ export class PrismaListProcess extends PrismaProcess implements ListProcess { } result() { + console.log('ASDASDASDASD'); return this.data; } } diff --git a/libs/prisma/tsconfig.lib.json b/libs/prisma/tsconfig.lib.json index e350873..ad9b7c2 100644 --- a/libs/prisma/tsconfig.lib.json +++ b/libs/prisma/tsconfig.lib.json @@ -1,9 +1,25 @@ { "extends": "../../tsconfig.json", "compilerOptions": { + "module": "commonjs", "declaration": true, - "outDir": "../../dist/libs/prisma" + "noImplicitAny": false, + "removeComments": true, + "noLib": false, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "target": "es6", + "sourceMap": false, + "outDir": "../../dist/libs/prisma", + "skipLibCheck": true, }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist", "test", "**/*spec.ts"] -} + "include": [ + "src/**/*" + ], + "exclude": [ + "node_modules", + "dist", + "test", + "**/*spec.ts" + ] +} \ No newline at end of file diff --git a/libs/skeleton/src/index.ts b/libs/skeleton/src/index.ts index c72e6fa..c3ac984 100644 --- a/libs/skeleton/src/index.ts +++ b/libs/skeleton/src/index.ts @@ -1,3 +1,2 @@ export * from './constants'; export * from './skeleton-crud.controller'; - diff --git a/package.json b/package.json index 9613576..8baa927 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,8 @@ "scripts": { "build": "nest build", "build:lib:skeleton": "tsc -p libs/skeleton/tsconfig.lib.json", + "build:lib:prisma": "tsc -p libs/prisma/tsconfig.lib.json", + "build:libs": "tsc -p tsconfig.lib.json", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\" \"libs/**/*.ts\"", "start": "nest start", "start:dev": "nest start --watch", @@ -78,4 +80,4 @@ "^@autocrud/prisma(|/.*)$": "/libs/prisma/src/$1" } } -} +} \ No newline at end of file diff --git a/tsconfig.lib.json b/tsconfig.lib.json new file mode 100644 index 0000000..e582e7d --- /dev/null +++ b/tsconfig.lib.json @@ -0,0 +1,26 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "declaration": true, + "noImplicitAny": false, + "removeComments": true, + "noLib": false, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "target": "es6", + "sourceMap": false, + "outDir": "./dist/libs", + "skipLibCheck": true, + }, + "include": [ + "libs/prisma/src/**/*", + "libs/skeleton/src/**/*" + ], + "exclude": [ + "node_modules", + "dist", + "test", + "**/*spec.ts" + ] +} \ No newline at end of file