From 4135a933f3a5e7afb52709bf5726d6b343aee094 Mon Sep 17 00:00:00 2001 From: Supan Adit Pratama Date: Tue, 29 Oct 2024 08:20:33 +0700 Subject: [PATCH] feat: chaining index ts for distribution --- .npmignore | 1 + index.js | 9 --------- index.ts | 1 + libs/index.ts | 2 ++ package.json | 7 ++++++- tsconfig.lib.json | 7 ++++--- 6 files changed, 14 insertions(+), 13 deletions(-) delete mode 100644 index.js create mode 100644 index.ts create mode 100644 libs/index.ts diff --git a/.npmignore b/.npmignore index c631500..3f32e6e 100644 --- a/.npmignore +++ b/.npmignore @@ -9,6 +9,7 @@ test .eslintrc.js jsr.json mod.ts +index.js nest-cli.json package-lock.json tsconfig.build.json diff --git a/index.js b/index.js deleted file mode 100644 index db0e954..0000000 --- a/index.js +++ /dev/null @@ -1,9 +0,0 @@ -require = require('esm')(module /*, options*/); -module.exports = { - // 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/index.ts b/index.ts new file mode 100644 index 0000000..704a425 --- /dev/null +++ b/index.ts @@ -0,0 +1 @@ +export * from './libs/index'; diff --git a/libs/index.ts b/libs/index.ts new file mode 100644 index 0000000..3efbec2 --- /dev/null +++ b/libs/index.ts @@ -0,0 +1,2 @@ +export * from './prisma/src/index'; +export * from './skeleton/src/index'; diff --git a/package.json b/package.json index d496ca1..31e7ea4 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,14 @@ { "name": "@aditama-labs/nest-autocrud", - "version": "0.0.3", + "version": "0.0.5", "description": "NestJS Auto CRUD Library", "author": "Supan Adit Pratama", "license": "MIT", + "main": "dist/libs/index.js", + "publishConfig": { + "directory": "dist", + "access": "public" + }, "scripts": { "build": "nest build", "build:lib:skeleton": "tsc -p libs/skeleton/tsconfig.lib.json", diff --git a/tsconfig.lib.json b/tsconfig.lib.json index e582e7d..6bf7ce4 100644 --- a/tsconfig.lib.json +++ b/tsconfig.lib.json @@ -10,12 +10,13 @@ "experimentalDecorators": true, "target": "es6", "sourceMap": false, - "outDir": "./dist/libs", + "outDir": "./dist", + "rootDir": ".", "skipLibCheck": true, }, "include": [ - "libs/prisma/src/**/*", - "libs/skeleton/src/**/*" + "index.ts", + "libs/**/*", ], "exclude": [ "node_modules",