From ea31a29d3e0f606ae8ad0b784caade72a0319049 Mon Sep 17 00:00:00 2001 From: "Korimsoft [Tomas Korima]" Date: Fri, 23 Aug 2024 16:57:45 +0200 Subject: [PATCH] Build --- package.json | 6 +++--- src/builders/builder.ts | 6 +++--- src/mappers/extractAProperty.ts | 2 +- tsconfig.json | 3 ++- webpack.config.js | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 5bd1b92..a593460 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,8 @@ "name": "korimsoft-tyfun", "version": "0.2.12", "description": "Korimsoft's TyFun - A library of TypeScript functions, types, helpers, and utilities", - "main": "/dist/index.js", - "types": "/dist/type-decl/index.d.ts", + "main": "./dist/index.js", + "types": "./dist/type-decl/index.d.ts", "scripts": { "compile": "webpack ", "build": "npm run compile", @@ -17,7 +17,7 @@ "url": "git+ssh://git@github.com/Korimsoft/tyfun.git" }, "files": [ - "/dist/**" + "./dist/**" ], "keywords": [ "Typescript", diff --git a/src/builders/builder.ts b/src/builders/builder.ts index fcba46a..aa1952d 100644 --- a/src/builders/builder.ts +++ b/src/builders/builder.ts @@ -1,4 +1,4 @@ -import _ from 'lodash'; +import {cloneDeep} from 'lodash'; export type Builder = { init: (prototype?: Partial) => InitializedBuilder; @@ -12,7 +12,7 @@ type InitializedBuilder = { type PropertyAssignment = (propertyKey: keyof T, value: TValue) => InitializedBuilder; export function aBuilder(prototype: T = null as T): InitializedBuilder { - const builtObject = _.cloneDeep(prototype) ?? ({} as T); + const builtObject = cloneDeep(prototype) ?? ({} as T); return { setProperty: assignAProperty(builtObject), @@ -23,6 +23,6 @@ export function aBuilder(prototype: T = null as T): InitializedBuilder { function assignAProperty(builtObject: T): PropertyAssignment { return (propertyKey: keyof T, value: TValue) => { builtObject[propertyKey] = value; - return aBuilder(builtObject); + return aBuilder(builtObject); }; } diff --git a/src/mappers/extractAProperty.ts b/src/mappers/extractAProperty.ts index 38d0fee..275b45e 100644 --- a/src/mappers/extractAProperty.ts +++ b/src/mappers/extractAProperty.ts @@ -1,4 +1,4 @@ -import {ObjectWithId} from '../custom-types/objectWithId'; +import {ObjectWithId} from '../custom-types'; import {Mapper} from './mapper'; export function extractId(item: ObjectWithId) { diff --git a/tsconfig.json b/tsconfig.json index 045db7f..19820dc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,9 +14,10 @@ "allowSyntheticDefaultImports": true, "sourceMap": true, "declaration": true, - "declarationDir": "dist/type-decl/", + "declarationDir": "./dist/type-decl/", "declarationMap": true, "moduleDetection": "force", + "moduleResolution": "NodeNext", "noUncheckedIndexedAccess": true }, "exclude": [ "./test/*", "./node_modules/" ] diff --git a/webpack.config.js b/webpack.config.js index 70facfc..260569d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,7 +5,7 @@ module.exports = { target: 'web', devtool: 'inline-source-map', output: { - path: path.resolve(__dirname + '/dist'), + path: path.resolve(__dirname + '/dist/'), filename: 'index.js', library: { name: 'tyfun-[version]',