Skip to content

Commit

Permalink
Merge pull request #73 from laxmanpokhrel/fix/individual-export-decle…
Browse files Browse the repository at this point in the history
…ration

Fix/individual export declaration
  • Loading branch information
laxmanpokhrel authored Feb 26, 2024
2 parents bb3a139 + a2f021b commit dfe86cc
Show file tree
Hide file tree
Showing 39 changed files with 144 additions and 122 deletions.
File renamed without changes.
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ node_modules/
.releaserc
yarn.lock
package-lock.json
tsconfig.esm.json
tsconfig.json
1 change: 1 addition & 0 deletions .release/release-notes.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
## This release for testing subpath modules and their declerations
- Folder structure changed
145 changes: 115 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,132 @@
"url": "https://github.com/laxmanpokhrel/xmanscript-utils.git"
},
"type": "module",
"types": "./@types",
"exports": {
"./abbreviateCurrencyValue": "./lib/abbreviateCurrencyValue",
"./areObjectsEqual": "./lib/areObjectsEqual",
"./calculateAndInjectPercentageByMaxValue": "./lib/calculateAndInjectPercentageByMaxValue",
"./calculateAndInjectPercentageBySum": "./lib/calculateAndInjectPercentageBySum",
"./calculateSumOfKey": "./lib/calculateSumOfKey",
"./containsBinaryData": "./lib/containsBinaryData",
"./convertNestedKeysToObject": "./lib/convertNestedKeysToObject",
"./countKeyOccurrences": "./lib/countKeyOccurrences",
"./distributePercentageEqually": "./lib/distributePercentageEqually",
"./distributePercentageEquallyWithRemainder": "./lib/distributePercentageEquallyWithRemainder",
"./formatNumberToCommaString": "./lib/formatNumberToCommaString",
"./abbreviateCurrencyValue": {
"types": "./lib/abbreviateCurrencyValue/index.d.ts",
"default": "./lib/abbreviateCurrencyValue/index.js"
},
"./areObjectsEqual": {
"types": "./lib/areObjectsEqual/index.d.ts",
"default": "./lib/areObjectsEqual/index.js"
},
"./calculateAndInjectPercentageByMaxValue": {
"types": "./lib/calculateAndInjectPercentageByMaxValue/index.d.ts",
"default": "./lib/calculateAndInjectPercentageByMaxValue/index.js"
},
"./calculateAndInjectPercentageBySum": {
"types": "./lib/calculateAndInjectPercentageBySum/index.d.ts",
"default": "./lib/calculateAndInjectPercentageBySum/index.js"
},
"./calculateSumOfKey": {
"types": "./lib/calculateSumOfKey/index.d.ts",
"default": "./lib/calculateSumOfKey/index.js"
},
"./containsBinaryData": {
"types": "./lib/containsBinaryData/index.d.ts",
"default": "./lib/containsBinaryData/index.js"
},
"./convertNestedKeysToObject": {
"types": "./lib/convertNestedKeysToObject/index.d.ts",
"default": "./lib/convertNestedKeysToObject/index.js"
},
"./countKeyOccurrences": {
"types": "./lib/countKeyOccurrences/index.d.ts",
"default": "./lib/countKeyOccurrences/index.js"
},
"./distributePercentageEqually": {
"types": "./lib/distributePercentageEqually/index.d.ts",
"default": "./lib/distributePercentageEqually/index.js"
},
"./distributePercentageEquallyWithRemainder": {
"types": "./lib/distributePercentageEquallyWithRemainder/index.d.ts",
"default": "./lib/distributePercentageEquallyWithRemainder/index.js"
},
"./formatNumberToCommaString": {
"types": "./lib/formatNumberToCommaString/index.d.ts",
"default": "./lib/formatNumberToCommaString/index.js"
},
"./getDifferenceObject": {
"types": "./lib/getDifferenceObject/index.d.ts",
"default": "./lib/getDifferenceObject/index.js"
},
"./getFileExtension": "./lib/getFileExtension",
"./getMinMax": "./lib/getMinMax",
"./groupArrayOfObjectsByValueOfAKey": "./lib/groupArrayOfObjectsByValueOfAKey",
"./intersectObjects": "./lib/intersectObjects",
"./isJSONObject": "./lib/isJSONObject",
"./markCheckedByStringMatch": "./lib/markCheckedByStringMatch",
"./objectToFormDataWithFiles": "./lib/objectToFormDataWithFiles",
"./omitKey": "./lib/omitKey",
"./parseToBoolean": "./lib/parseToBoolean",
"./partitionObjectsByKey": "./lib/partitionObjectsByKey",
"./removeObjectFromArray": "./lib/removeObjectFromArray",
"./getFileExtension": {
"types": "./lib/getFileExtension/index.d.ts",
"default": "./lib/getFileExtension/index.js"
},
"./getMinMax": {
"types": "./lib/getMinMax/index.d.ts",
"default": "./lib/getMinMax/index.js"
},
"./groupArrayOfObjectsByValueOfAKey": {
"types": "./lib/groupArrayOfObjectsByValueOfAKey/index.d.ts",
"default": "./lib/groupArrayOfObjectsByValueOfAKey/index.js"
},
"./intersectObjects": {
"types": "./lib/intersectObjects/index.d.ts",
"default": "./lib/intersectObjects/index.js"
},
"./isJSONObject": {
"types": "./lib/isJSONObject/index.d.ts",
"default": "./lib/isJSONObject/index.js"
},
"./markCheckedByStringMatch": {
"types": "./lib/markCheckedByStringMatch/index.d.ts",
"default": "./lib/markCheckedByStringMatch/index.js"
},
"./objectToFormDataWithFiles": {
"types": "./lib/objectToFormDataWithFiles/index.d.ts",
"default": "./lib/objectToFormDataWithFiles/index.js"
},
"./omitKey": {
"types": "./lib/omitKey/index.d.ts",
"default": "./lib/omitKey/index.js"
},
"./parseToBoolean": {
"types": "./lib/parseToBoolean/index.d.ts",
"default": "./lib/parseToBoolean/index.js"
},
"./partitionObjectsByKey": {
"types": "./lib/partitionObjectsByKey/index.d.ts",
"default": "./lib/partitionObjectsByKey/index.js"
},
"./removeObjectFromArray": {
"types": "./lib/removeObjectFromArray/index.d.ts",
"default": "./lib/removeObjectFromArray/index.js"
},
"./scrollToComponent": {
"types":"./lib/scrollToComponent/index.d.ts",
"types": "./lib/scrollToComponent/index.d.ts",
"default": "./lib/scrollToComponent/index.js"
},
"./setKeysToValueInObjects": "./lib/setKeysToValueInObjects",
"./setValueOfKeyForMatchingValuesOfAKey": "./lib/setValueOfKeyForMatchingValuesOfAKey",
"./splitArrayIntoChunks": "./lib/splitArrayIntoChunks",
"./setKeysToValueInObjects": {
"types": "./lib/setKeysToValueInObjects/index.d.ts",
"default": "./lib/setKeysToValueInObjects/index.js"
},
"./setValueOfKeyForMatchingValuesOfAKey": {
"types": "./lib/setValueOfKeyForMatchingValuesOfAKey/index.d.ts",
"default": "./lib/setValueOfKeyForMatchingValuesOfAKey/index.js"
},
"./splitArrayIntoChunks": {
"types": "./lib/splitArrayIntoChunks/index.d.ts",
"default": "./lib/splitArrayIntoChunks/index.js"
},
"./strictIntersectObjects": {
"types": "./lib/strictIntersectObjects/index.d.ts",
"default": "./lib/strictIntersectObjects/index.js"
},
"./toggleObjectInArray": "./lib/toggleObjectInArray",
"./uniqueValuesOfKey": "./lib/uniqueValuesOfKey",
"./validateObjectsForKey": "./lib/validateObjectsForKey"
"./toggleObjectInArray": {
"types": "./lib/toggleObjectInArray/index.d.ts",
"default": "./lib/toggleObjectInArray/index.js"
},
"./uniqueValuesOfKey": {
"types": "./lib/uniqueValuesOfKey/index.d.ts",
"default": "./lib/uniqueValuesOfKey/index.js"
},
"./validateObjectsForKey": {
"types": "./lib/validateObjectsForKey/index.d.ts",
"default": "./lib/validateObjectsForKey/index.js"
}
},
"keywords": [
"utils",
Expand All @@ -62,7 +147,7 @@
"homepage": "https://github.com/laxmanpokhrel/xmanscript-utils#readme",
"main": "./lib/index.js",
"scripts": {
"build": "rm -rf lib && tsc",
"build": "rm -rf lib && tsc && tsc -p tsconfig.esm.json",
"prepare": "husky install",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-restricted-syntax */
import validateObjectsForKey from './validateObjectsForKey';

import validateObjectsForKey from '../validateObjectsForKey';

/**
* The function calculates and injects the percentage value based on the maximum value of a specified
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-restricted-syntax */
import validateObjectsForKey from './validateObjectsForKey';

import validateObjectsForKey from '../validateObjectsForKey';

/**
* The function calculates the percentage of a specific key's value based on sum of values in that key in each object of an array and
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-param-reassign */
import countKeyOccurrences from './countKeyOccurrences';

import countKeyOccurrences from '../countKeyOccurrences';

/**
* The `distributePercentageEqually` function takes a JSON object and a key, and updates the values of that key in
Expand Down
File renamed without changes.
8 changes: 0 additions & 8 deletions src/getDifferenceObject/package.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 0 additions & 8 deletions src/intersectObjects/package.json

This file was deleted.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isJSONObject from './isJSONObject';
import isJSONObject from '../isJSONObject';

/**
* The function `objectToFormDataWithFiles` converts a JSON object into a FormData object, handling file uploads
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
56 changes: 0 additions & 56 deletions src/scrollToComponent.ts

This file was deleted.

8 changes: 0 additions & 8 deletions src/scrollToComponent/package.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import areObjectsEqual from './areObjectsEqual';
import areObjectsEqual from '../areObjectsEqual';

/**
* The function removes the target object from the array if it exists, otherwise it adds it to the
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "esnext",
"outDir": "./lib/esm"
}
}
18 changes: 11 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@



{
"compilerOptions": {
"target": "ES6",
"module": "ES2015",
// "module": "ES2015",
"declaration": true,
"sourceMap": true,
"outDir": "./lib",
// "outDir": "./lib",
// "baseUrl": "src/",
"strict": true,
"lib": ["ES2020", "DOM"],
Expand All @@ -19,9 +22,10 @@
"noFallthroughCasesInSwitch": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": false,
// "declarationDir": "./@types"

"module": "commonjs",
"outDir": "./lib/commonjs",
"moduleResolution": "node",
},
"exclude": ["node_modules"],
"include": [".eslintrc.js", "src", "src/**/*.ts"]
}
"exclude": ["node_modules",],
"include": [".eslintrc.cjs", "src", "src/**/*.ts"]
}

0 comments on commit dfe86cc

Please sign in to comment.