File tree 11 files changed +78
-14
lines changed
11 files changed +78
-14
lines changed Original file line number Diff line number Diff line change @@ -8,17 +8,17 @@ on: [push, pull_request]
8
8
jobs :
9
9
test :
10
10
11
- runs-on : ubuntu-22.04
11
+ runs-on : ubuntu-latest
12
12
13
13
strategy :
14
14
matrix :
15
- node_version : [16 .x, 18 .x, 20 .x]
15
+ node_version : [18 .x, 20 .x, 21 .x]
16
16
17
17
steps :
18
18
- uses : actions/checkout@v3
19
19
20
20
- name : setup Node.js v${{ matrix.node_version }}
21
- uses : actions/setup-node@v3
21
+ uses : actions/setup-node@v4
22
22
with :
23
23
node-version : ${{ matrix.node_version }}
24
24
31
31
npm run build --if-present
32
32
npm run test
33
33
34
- - name : sync to coveralls
35
- uses : coverallsapp/github-action@v1.1.2
34
+ - name : Report Coveralls
35
+ uses : coverallsapp/github-action@v2
36
36
with :
37
37
github-token : ${{ secrets.GITHUB_TOKEN }}
38
38
Original file line number Diff line number Diff line change 38
38
39
39
steps :
40
40
- name : Checkout repository
41
- uses : actions/checkout@v3
41
+ uses : actions/checkout@v4
42
42
43
43
# Initializes the CodeQL tools for scanning.
44
44
- name : Initialize CodeQL
Original file line number Diff line number Diff line change @@ -18,3 +18,6 @@ pnpm-lock.yaml
18
18
19
19
output.json
20
20
deno.lock
21
+
22
+ bundle.cjs
23
+ bundle.cjs.map
Original file line number Diff line number Diff line change @@ -49,6 +49,21 @@ import { extract } from 'https://esm.sh/@extractus/feed-extractor'
49
49
Please check [ the examples] ( https://github.com/extractus/feed-extractor/tree/main/examples ) for reference.
50
50
51
51
52
+ ## Automate RSS feed extraction with GitHub Actions
53
+
54
+ [ RSS Feed Fetch Action] ( https://github.com/Promptly-Technologies-LLC/rss-fetch-action ) is a GitHub Action designed to automate the fetching of RSS feeds.
55
+ It fetches an RSS feed from a given URL and saves it to a specified file in your GitHub repository.
56
+ This action is particularly useful for populating content on GitHub Pages websites or other static site generators.
57
+
58
+
59
+ ## CJS Deprecated
60
+
61
+ CJS is deprecated for this package. When calling ` require('@extractus/feed-extractor') ` a deprecation warning is now logged. You should update your code to use the ESM export.
62
+
63
+ - You can ignore this warning via the environment variable ` FEED_EXTRACTOR_CJS_IGNORE_WARNING=true `
64
+ - To see where the warning is coming from you can set the environment variable ` FEED_EXTRACTOR_CJS_TRACE_WARNING=true `
65
+
66
+
52
67
## APIs
53
68
54
69
- [ extract()] ( #extract )
Original file line number Diff line number Diff line change
1
+ import { build } from 'esbuild'
2
+ import fs from 'fs'
3
+
4
+ const { dependencies } = JSON . parse ( fs . readFileSync ( './package.json' , 'utf8' ) )
5
+ // we need esbuild to process esm dependencies while leaving cjs compatible ones
6
+ // out of the bundle
7
+ const esmDependencies = new Set ( [ 'bellajs' ] )
8
+ const externalDeps = Object . keys ( dependencies )
9
+ . filter ( dep => ! esmDependencies . has ( dep ) )
10
+
11
+ build ( {
12
+ entryPoints : [ './src/cjs-entry.js' ] ,
13
+ bundle : true ,
14
+ platform : 'node' ,
15
+ target : 'node16' ,
16
+ outfile : 'bundle.cjs' ,
17
+ minify : true ,
18
+ sourcemap : true ,
19
+ external : externalDeps ,
20
+ } )
Original file line number Diff line number Diff line change 5
5
"start" : " bun run index.ts"
6
6
},
7
7
"devDependencies" : {
8
- "bun-types" : " ^0.6.13 "
8
+ "bun-types" : " ^1.0.14 "
9
9
},
10
10
"dependencies" : {
11
11
"@extractus/feed-extractor" : " latest" ,
12
- "hono" : " ^3.2.7 "
12
+ "hono" : " ^3.10.2 "
13
13
}
14
14
}
Original file line number Diff line number Diff line change 1
1
import { serve } from 'https://deno.land/std/http/server.ts'
2
2
3
- import { Hono } from 'https://deno.land/x/hono@v3.2.7 /mod.ts'
3
+ import { Hono } from 'https://deno.land/x/hono@v3.10.2 /mod.ts'
4
4
5
5
import { extract } from 'npm:@extractus/feed-extractor'
6
6
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " tsnode-feed-reader" ,
3
3
"version" : " 1.0.0" ,
4
+ "type" : " module" ,
4
5
"main" : " index.ts" ,
5
6
"scripts" : {
6
7
"prestart" : " npx tsc" ,
7
8
"start" : " node dist/index.js"
8
9
},
9
10
"devDependencies" : {
10
- "typescript" : " ^5.1.6 "
11
+ "typescript" : " ^5.3.2 "
11
12
},
12
13
"dependencies" : {
13
14
"@extractus/feed-extractor" : " latest" ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"compilerOptions" : {
3
- "module" : "commonjs " ,
3
+ "module" : "es6 " ,
4
4
"esModuleInterop" : true ,
5
5
"target" : "es6" ,
6
6
"moduleResolution" : "node" ,
Original file line number Diff line number Diff line change 1
1
{
2
- "version" : " 7.0.7 " ,
2
+ "version" : " 7.0.8 " ,
3
3
"name" : " @extractus/feed-extractor" ,
4
4
"description" : " To read and normalize RSS/ATOM/JSON feed data" ,
5
5
"homepage" : " https://extractor-demos.pages.dev" ,
10
10
"author" : " @extractus" ,
11
11
"main" : " ./src/main.js" ,
12
12
"type" : " module" ,
13
+ "exports" : {
14
+ "." : {
15
+ "types" : " ./index.d.ts" ,
16
+ "import" : " ./src/main.js" ,
17
+ "require" : " ./bundle.cjs" ,
18
+ "default" : " ./src/main.js"
19
+ }
20
+ },
13
21
"imports" : {
14
22
"cross-fetch" : " ./src/deno/cross-fetch.js"
15
23
},
23
31
"scripts" : {
24
32
"lint" : " eslint ." ,
25
33
"lint:fix" : " eslint --fix ." ,
34
+ "build" : " node build" ,
35
+ "prepublishOnly" : " npm run build" ,
26
36
"pretest" : " npm run lint" ,
27
37
"test" : " NODE_ENV=test NODE_OPTIONS=--experimental-vm-modules jest --verbose --coverage=true" ,
28
38
"eval" : " node eval" ,
35
45
"html-entities" : " ^2.4.0"
36
46
},
37
47
"devDependencies" : {
38
- "eslint" : " ^8.53.0" ,
48
+ "esbuild" : " ^0.19.8" ,
49
+ "eslint" : " ^8.55.0" ,
39
50
"https-proxy-agent" : " ^7.0.2" ,
40
51
"jest" : " ^29.7.0" ,
41
- "nock" : " ^13.3.8 "
52
+ "nock" : " ^13.4.0 "
42
53
},
43
54
"keywords" : [
44
55
" extractor" ,
Original file line number Diff line number Diff line change
1
+ function warnCjsUsage ( ) {
2
+ if ( process . env . FEED_EXTRACTOR_CJS_IGNORE_WARNING ?. toLowerCase ( ) === 'true' ) return
3
+ const yellow = ( str ) => `\u001b[33m${ str } \u001b[39m`
4
+ const log = process . env . FEED_EXTRACTOR_CJS_TRACE_WARNING ?. toLowerCase ( ) === 'true' ? console . trace : console . warn
5
+ log (
6
+ yellow (
7
+ 'The CJS build of @extractus/feed-extractor is deprecated. See https://github.com/extractus/feed-extractor#cjs-deprecated for details.'
8
+ )
9
+ )
10
+ }
11
+
12
+ warnCjsUsage ( )
13
+
14
+ export * from './main'
You can’t perform that action at this time.
0 commit comments