diff --git a/index.ts b/index.ts deleted file mode 100644 index ac710c9..0000000 --- a/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { ListenerRss } from "./src/listener-rss"; -export { ListenerRSSInfos } from "./src/Models/ListenerRSSInfos"; diff --git a/package.json b/package.json index 8255a23..0492dd7 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,8 @@ "name": "listener-rss", "version": "1.0.0", "description": "A lightweight library to give some additions for the [rss-parser package](https://github.com/rbren/rss-parser).", - "main": "index.js", + "main": "build/index.js", + "types": "build/index.d.ts", "scripts": { "test": "cross-env TS_NODE_PROJECT='./tests/tsconfig.json' mocha --require ts-node/register ./tests/**/*-spec.ts", "build": "tsc -p ./src" diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..4046865 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,2 @@ +export { ListenerRss } from "./listener-rss"; +export { ListenerRSSInfos } from "./Models/ListenerRSSInfos"; diff --git a/src/listener-rss.ts b/src/listener-rss.ts index 06a14b8..97a5ca9 100644 --- a/src/listener-rss.ts +++ b/src/listener-rss.ts @@ -67,9 +67,9 @@ export class ListenerRss extends EventEmitter { */ start(): void { this.loopRunning = true; - + const fun: () => void = async () => { - await Promise.resolve( + await Promise.resolve( await this.fetchRSS() .then((obj: { [key: string]: any }) => { this.emit("update", obj); diff --git a/src/tsconfig.json b/src/tsconfig.json index 9a2ee73..a980c34 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -2,9 +2,5 @@ "extends": "../tsconfig.base.json", "compilerOptions": { "moduleResolution": "node" - }, - "exclude": [ - "build/", - "node_modules" - ] + } } diff --git a/tsconfig.base.json b/tsconfig.base.json index 1021bc9..da71bfa 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "es2018", - "module": "es2015", + "module": "CommonJS", "lib": ["es6"], "allowJs": true, "outDir": "build", @@ -12,10 +12,14 @@ "esModuleInterop": true, "resolveJsonModule": false, "skipLibCheck": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "declaration": true }, + "include": [ + "src" + ], "exclude": [ "build/", - "node_modules" + "node_modules/" ] }