diff --git a/package.json b/package.json index b2b460f..032b5e7 100644 --- a/package.json +++ b/package.json @@ -2,16 +2,62 @@ "name": "waitasecond", "version": "1.8.8", "description": "Simple tool library for the waiting using Promises.", - "main": "dist/main.js", - "typings": "dist/main.d.ts", "sideEffects": false, - "files": [ - "dist/**" - ], + "main": "./dist/main.js", + "types": "./dist/main.d.ts", "exports": { ".": "./dist/main.js", - "./*": "./dist/functions/*.js" + "./forAllImagesInElement": "./dist/functions/forAllImagesInElement.js", + "./forAnimationFrame": "./dist/functions/forAnimationFrame.js", + "./forDocumentLoad": "./dist/functions/forDocumentLoad.js", + "./forDOMContentLoaded": "./dist/functions/forDOMContentLoaded.js", + "./forEver": "./dist/functions/forEver.js", + "./forImmediate": "./dist/functions/forImmediate.js", + "./forTime": "./dist/functions/forTime.js", + "./forTimeout": "./dist/functions/forTimeout.js", + "./forTimeSynced": "./dist/functions/forTimeSynced.js", + "./forValueDefined": "./dist/functions/forValueDefined.js" }, + "typesVersions": { + "*": { + "./forAllImagesInElement": [ + "./dist/functions/forAllImagesInElement.d.ts" + ], + "./forAnimationFrame": [ + "./dist/functions/forAnimationFrame.d.ts" + ], + "./forDocumentLoad": [ + "./dist/functions/forDocumentLoad.d.ts" + ], + "./forDOMContentLoaded": [ + "./dist/functions/forDOMContentLoaded.d.ts" + ], + "./forEver": [ + "./dist/functions/forEver.d.ts" + ], + "./forImmediate": [ + "./dist/functions/forImmediate.d.ts" + ], + "./forTime": [ + "./dist/functions/forTime.d.ts" + ], + "./forTimeout": [ + "./dist/functions/forTimeout.d.ts" + ], + "./forTimeSynced": [ + "./dist/functions/forTimeSynced.d.ts" + ], + "./forValueDefined": [ + "./dist/functions/forValueDefined.d.ts" + ] + } + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com:hejny/waitasecond.git" + }, + "author": "Pavol Hejný", + "license": "MIT", "scripts": { "test": "npm run test-unit && npm run test-integration", "test-unit": "jest --config jestconfig.json", @@ -31,12 +77,6 @@ "preversion": "npm run lint && npm test && npm run generate-main-exports-commit && npm run build && npm run prettier-commit", "postversion": "npm run generate-documentation-commit && git push && git push --tags && npm publish" }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com:hejny/waitasecond.git" - }, - "author": "Pavol Hejný", - "license": "MIT", "dependencies": { "ts-essentials": "^8.1.0" }, diff --git a/scripts/generate-main-exports/generate-main-exports.ts b/scripts/generate-main-exports/generate-main-exports.ts index 84075da..3938ce1 100644 --- a/scripts/generate-main-exports/generate-main-exports.ts +++ b/scripts/generate-main-exports/generate-main-exports.ts @@ -68,5 +68,6 @@ async function main() { } /** + * TODO: Generate also exports and typesVersions in package.json * TODO: This should be an indipendent lib */