Skip to content

Commit

Permalink
v7.3.0
Browse files Browse the repository at this point in the history
- Add support to `signal`
- Stop support Node < 15
- Stop support commonjs version
  - Remove build script
- Update examples code
- Update dependencies
  • Loading branch information
ndaidong committed Jul 8, 2023
1 parent 4c1a49c commit bfca881
Show file tree
Hide file tree
Showing 19 changed files with 43 additions and 338 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ yarn.lock
coverage.lcov
pnpm-lock.yaml

deno.lock

evaluation
70 changes: 0 additions & 70 deletions build.js

This file was deleted.

48 changes: 0 additions & 48 deletions build.test.js

This file was deleted.

42 changes: 0 additions & 42 deletions dist/article-extractor.esm.js

This file was deleted.

62 changes: 0 additions & 62 deletions dist/cjs/article-extractor.js

This file was deleted.

84 changes: 0 additions & 84 deletions dist/cjs/index.d.ts

This file was deleted.

5 changes: 0 additions & 5 deletions dist/cjs/package.json

This file was deleted.

4 changes: 2 additions & 2 deletions examples/browser-article-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"start": "node server"
},
"dependencies": {
"express": "^4.18.1",
"got": "^12.5.0"
"express": "^4.18.2",
"got": "^13.0.0"
}
}
2 changes: 1 addition & 1 deletion examples/browser-article-parser/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h1>article-parser on browser</h1>
</div>
</body>
<script type="module">
import { extract } from 'https://unpkg.com/@extractus/article-extractor@latest/dist/article-extractor.esm.js'
import { extract } from "https://esm.sh/@extractus/article-extractor@latest"

const loadFeed = async (url, useProxy = false) => {
const data = await extract(url, {
Expand Down
4 changes: 2 additions & 2 deletions examples/bun-article-parser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
To install dependencies:

```bash
bun i
bun install
```

Start server:

```bash
bun run index.ts
bun start
```

Open `http://localhost:3100/?url=https://dev.to/ndaidong/how-to-make-your-mongodb-container-more-secure-1646` to see the result.
Expand Down
7 changes: 5 additions & 2 deletions examples/bun-article-parser/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"name": "bun-article-parser",
"module": "index.ts",
"scripts": {
"start": "bun run index.ts"
},
"devDependencies": {
"bun-types": "^0.1.0"
"bun-types": "^0.6.13"
},
"dependencies": {
"@extractus/article-extractor": "latest",
"hono": "^2.1.4"
"hono": "^3.2.7"
}
}
2 changes: 1 addition & 1 deletion examples/deno-article-parser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
With `deno`, we have not much thing to do. Just start the server:

```bash
deno run --allow-net --allow-env --allow-read index.ts
deno task dev
```

Open `http://localhost:3100/?url=https://dev.to/ndaidong/how-to-make-your-mongodb-container-more-secure-1646` to see the result.
Expand Down
13 changes: 13 additions & 0 deletions examples/deno-article-parser/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "deno-article-parser",
"version": "1.0.0",
"tasks": {
"dev": "deno run --allow-net --allow-env --allow-read index.ts",
},
"compilerOptions": {
"allowJs": true,
"noImplicitAny": false,
"lib": ["deno.window"],
"strict": true
}
}
6 changes: 1 addition & 5 deletions examples/deno-article-parser/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { serve } from 'https://deno.land/std/http/server.ts'

import { Hono } from 'https://deno.land/x/hono@v2.1.4/mod.ts'
import { Hono } from 'https://deno.land/x/hono@v3.2.7/mod.ts'

// for deno > 1.28 only
import { extract } from 'npm:@extractus/article-extractor'

// for deno < 1.28
// import { extract } from 'https://esm.sh/@extractus/article-extractor'

const app = new Hono()

const meta = {
Expand Down
2 changes: 1 addition & 1 deletion examples/node-article-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
},
"dependencies": {
"@extractus/article-extractor": "latest",
"express": "^4.18.1"
"express": "^4.18.2"
}
}
4 changes: 2 additions & 2 deletions examples/tsnode-article-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"start": "node dist/index.js"
},
"devDependencies": {
"typescript": "^4.8.3"
"typescript": "^5.1.6"
},
"dependencies": {
"@extractus/article-extractor": "latest",
"express": "^4.18.1"
"express": "^4.18.2"
}
}
5 changes: 5 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ export interface FetchOptions {
* default: null
*/
agent?: object;
/**
* signal to terminate request
* default: null
*/
signal?: object;
}

export interface ArticleData {
Expand Down
10 changes: 2 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "7.2.18",
"version": "7.3.0",
"name": "@extractus/article-extractor",
"description": "To extract main article from given URL",
"homepage": "https://github.com/extractus/article-extractor",
Expand All @@ -10,23 +10,18 @@
"author": "@extractus",
"main": "./src/main.js",
"type": "module",
"exports": {
"import": "./src/main.js",
"require": "./dist/cjs/article-extractor.js"
},
"browser": {
"linkedom": "./src/browser/linkedom.js"
},
"types": "./index.d.ts",
"engines": {
"node": ">= 14"
"node": ">= 15"
},
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"pretest": "npm run lint",
"test": "NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --verbose --coverage=true",
"build": "node build",
"eval": "node eval",
"reset": "node reset"
},
Expand All @@ -39,7 +34,6 @@
},
"devDependencies": {
"@types/sanitize-html": "^2.9.0",
"esbuild": "^0.18.11",
"eslint": "^8.44.0",
"https-proxy-agent": "^7.0.0",
"jest": "^29.6.0",
Expand Down
Loading

0 comments on commit bfca881

Please sign in to comment.