diff --git a/package-lock.json b/package-lock.json index a24ed5a..3a3dcb4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,13 @@ { "name": "google-news-scraper", - "version": "1.2.7", + "version": "2.0.0-alpha.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "google-news-scraper", - "version": "1.2.7", - "license": "MIT", + "version": "2.0.0-alpha.5", + "license": "SEE LICENSE IN LICENSE.txt", "dependencies": { "@mozilla/readability": "^0.5.0", "@rollup/plugin-babel": "^6.0.4", diff --git a/package.json b/package.json index ff378db..d12ce7f 100644 --- a/package.json +++ b/package.json @@ -1,20 +1,18 @@ { "name": "google-news-scraper", - "version": "1.2.7", + "version": "2.0.0-alpha.7", "description": "Lightweight async scraper for Google News", "main": "./dist/cjs/index.js", - "module": "./dist/esm/index.js", + "module": "./dist/esm/index.mjs", "types": "./dist/tsc/index.d.ts", "exports": { - "import": "./dist/esm/index.js", + "import": "./dist/esm/index.mjs", "require": "./dist/cjs/index.js" }, "files": [ - "dist/cjs/index.js", - "dist/cjs/min/index.min.js", - "dist/esm/index.js", - "dist/esm/min/index.min.js", - "dist/tsc/index.d.ts" + "dist/cjs/**/*.cjs", + "dist/esm/**/*.js", + "dist/tsc/**/*.d.ts" ], "scripts": { "test": "jest", @@ -22,7 +20,6 @@ "build:rollup": "rollup -c", "build": "rm -rf ./dist/* && npm run build:ts && npm run build:rollup" }, - "type": "module", "repository": { "type": "git", "url": "https://github.com/lewisdonovan/google-news-scraper" @@ -39,7 +36,7 @@ "google crawler" ], "author": "Lewis Donovan", - "license": "SEE LICENSE IN LICENSE.txt", + "license": "SEE LICENSE IN LICENSE.txt", "dependencies": { "@mozilla/readability": "^0.5.0", "@rollup/plugin-babel": "^6.0.4", diff --git a/rollup.config.js b/rollup.config.js index b1eabff..7c26866 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -12,14 +12,14 @@ export default { format: 'esm', sourcemap: true, preserveModules: false, - entryFileNames: '[name].js', + entryFileNames: '[name].mjs', }, { dir: './dist/esm/min', format: 'esm', plugins: [terser()], sourcemap: true, - entryFileNames: '[name].min.js', + entryFileNames: '[name].min.mjs', }, { dir: './dist/cjs', diff --git a/src/getLogger.ts b/src/getLogger.ts index 4b35881..d889ce2 100644 --- a/src/getLogger.ts +++ b/src/getLogger.ts @@ -1,4 +1,4 @@ -import { LogLevel } from "./types"; +import { LogLevel } from "./types" import winston from 'winston'; const config = { diff --git a/src/global.d.ts b/src/global.d.ts deleted file mode 100644 index 9f5f183..0000000 --- a/src/global.d.ts +++ /dev/null @@ -1 +0,0 @@ -// declare module 'jsdom'; \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 9d431ab..b34d125 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,7 +7,13 @@ import getArticleType from './getArticleType'; import getPrettyUrl from './getPrettyUrl'; import buildQueryString from './buildQueryString'; import getArticleContent from './getArticleContent'; -import { Article, Articles, GNSConfig, GNSUserConfig, QueryVars } from './types'; +import { + QueryVars, + GNSUserConfig, + GNSConfig, + Article, + Articles +} from "./types" const googleNewsScraper = async (userConfig: GNSUserConfig) => { const config: GNSConfig = { @@ -131,4 +137,5 @@ const googleNewsScraper = async (userConfig: GNSUserConfig) => { } +export * from "./types"; export default googleNewsScraper; \ No newline at end of file diff --git a/src/types.ts b/src/types.ts index c1a61b6..71f8f74 100644 --- a/src/types.ts +++ b/src/types.ts @@ -57,4 +57,8 @@ export interface ExtractArticleContentAndFaviconProps { browser: Browser; filterWords: string[]; logger: winston.Logger; -} \ No newline at end of file +} + +declare const googleNewsScraper: (userConfig: GNSUserConfig) => Promise; + +export default googleNewsScraper; diff --git a/tsconfig.json b/tsconfig.json index 66e8b1d..4e2fb0d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,7 @@ "target": "ES6", "module": "ESNext", "declaration": true, + "declarationMap": false, "outDir": "./dist/tsc", "rootDir": "./src", "strict": true,