diff --git a/.gitignore b/.gitignore index 4a824fc..55fe6d9 100644 --- a/.gitignore +++ b/.gitignore @@ -130,4 +130,6 @@ dist .yarn/install-state.gz .pnp.* -.idea \ No newline at end of file +.idea +*.d.ts +*.d.ts.map \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index d8f1b39..903a89d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,29 @@ { "name": "datelative", - "version": "0.0.1", + "version": "0.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "datelative", - "version": "0.0.1", - "license": "ISC" + "version": "0.0.3", + "license": "MIT", + "devDependencies": { + "typescript": "^5.3.3" + } + }, + "node_modules/typescript": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } } } } diff --git a/package.json b/package.json index 35a7032..e24df65 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,26 @@ { "name": "datelative", - "version": "0.0.2", + "version": "0.0.3", "description": "A library that converts relative string text to JavaScript dates", "main": "index.js", + "types": "index.d.ts", "type": "module", "scripts": { "test": "node --test", - "test:watch": "node --test --watch" + "test:watch": "node --test --watch", + "prepublishOnly": "npx tsc" }, "repository": { "type": "git", "url": "git+https://github.com/onhate/datelative.git" }, + "files": [ + "index.js", + "index.d.ts", + "index.d.ts.map", + "README.md", + "package.json" + ], "keywords": [ "date", "relative", @@ -23,5 +32,7 @@ "url": "https://github.com/onhate/datelative/issues" }, "homepage": "https://github.com/onhate/datelative#readme", - "dependencies": {} -} \ No newline at end of file + "devDependencies": { + "typescript": "^5.3.3" + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..712ee16 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,11 @@ +{ + "include": [ + "index.js" + ], + "compilerOptions": { + "allowJs": true, + "declaration": true, + "emitDeclarationOnly": true, + "declarationMap": true + } +} \ No newline at end of file