diff --git a/package.json b/package.json index 9f87d0a..785e4cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cntdys", - "version": "0.5.0", + "version": "0.5.1", "description": "more calendar for less bytes", "keywords": [ "calendar" @@ -12,19 +12,24 @@ "homepage": "https://github.com/zigomir/cntdys", "author": "Ziga Vidic (https://ziga.dev/)", "license": "MIT", - "main": "dist/main.commonjs.js", - "module": "dist/main.js", - "unpkg": "dist/main.js", + "main": "./dist/main.commonjs.js", + "module": "./dist/main.js", + "unpkg": "./dist/main.js", "type": "module", - "types": "dist/types/src/main.d.ts", + "types": "./dist/src/types.d.ts", "files": [ "dist/" ], + "exports": { + "import": "./dist/main.js", + "require": "./dist/main.commonjs.js" + }, "scripts": { "test": "yarn test:coverage && yarn test:bundlesize", "test:dev": "uvu -r ts-node/register test", "test:bundlesize": "bundlesize", - "test:coverage": "c8 --include=src yarn test:dev", + "test:coverage": "c8 --check-coverage --lines 100 --functions 100 --branches 100 --include=src/main.ts yarn test:dev", + "test:coverage:debug": "c8 --include=src/main.ts --reporter=html yarn test:dev", "dev": "tsc --watch", "clean": "rm -rf build/* && rm -rf dist/*", "build:commonjs": "tsc --module CommonJS && cp build/src/main.js dist/main.commonjs.js", diff --git a/src/main.ts b/src/main.ts index 0c467dd..3ceca4a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,4 @@ import { DayEnum, IDay, IMonth, MonthEnum, MonthNumber, Year } from './types' -export { DayEnum, IDay, IMonth, MonthEnum, MonthNumber, Year } const isLeap = (year: Year) => year % 400 === 0 || (year % 100 !== 0 && year % 4 === 0) diff --git a/src/types.ts b/src/types.ts index 63c3d27..62c2a94 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,3 +1,4 @@ +export { calendarMonth, getDaysInMonth, getNextDay, getPreviousDay, getNextMonth, getPreviousMonth } from './main' export type Year = number export type MonthNumber = MonthEnum diff --git a/tsconfig.json b/tsconfig.json index 026759b..1942323 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,7 @@ "noImplicitThis": true, "noFallthroughCasesInSwitch": true, "declaration": true, - "declarationDir": "dist/types" + "declarationDir": "dist" }, "ts-node": { "transpileOnly": true,