Skip to content

Commit a0389cb

Browse files
authored
chore: use tsdown for bundling (#210)
1 parent 28c5765 commit a0389cb

8 files changed

Lines changed: 592 additions & 60 deletions

File tree

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "feed",
33
"version": "5.0.0",
4+
"type": "module",
45
"description": "Feed is a RSS, Atom and JSON feed generator for Node.js, making content syndication simple and intuitive!",
56
"homepage": "https://github.com/jpmonette/feed",
67
"author": "Jean-Philippe Monette <contact@jpmonette.net>",
@@ -12,7 +13,7 @@
1213
"lib"
1314
],
1415
"scripts": {
15-
"build": "rm -rf lib/ && mkdir lib && tsc",
16+
"build": "tsdown",
1617
"prepublish": "pnpm build",
1718
"test": "jest --silent",
1819
"test-travis": "jest --coverage",
@@ -46,7 +47,8 @@
4647
"prettier": "^2.8.8",
4748
"source-map-loader": "^3.0.1",
4849
"ts-jest": "^28.0.3",
49-
"typescript": "^4.9.5"
50+
"tsdown": "^0.11.2",
51+
"typescript": "^5.8.3"
5052
},
5153
"engines": {
5254
"node": ">=20",

pnpm-lock.yaml

Lines changed: 563 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/atom1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as convert from "xml-js";
22
import { generator } from "./config";
3-
import { Feed } from "./feed";
4-
import { Author, Category, Enclosure, Item } from "./typings";
3+
import type { Feed } from "./feed";
4+
import type { Author, Category, Enclosure, Item } from "./typings";
55
import { sanitize } from "./utils";
66

77
/**

src/feed.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import renderAtom from "./atom1";
22
import renderJSON from "./json";
33
import renderRSS from "./rss2";
4-
import { Author, Extension, FeedOptions, Item } from "./typings";
4+
import type { Author, Extension, FeedOptions, Item } from "./typings";
55

6-
export { Author, Extension, FeedOptions, Item };
6+
export type { Author, Extension, FeedOptions, Item };
77

88
/**
99
* Class used to generate Feeds

src/json.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Feed } from "./feed";
2-
import { Author, Category, Extension, Item } from "./typings";
1+
import type { Feed } from "./feed";
2+
import type { Author, Category, Extension, Item } from "./typings";
33

44
/**
55
* Returns a JSON feed

src/rss2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as convert from "xml-js";
22
import { generator } from "./config";
3-
import { Feed } from "./feed";
4-
import { Author, Category, Enclosure, Extension, Item } from "./typings";
3+
import type { Feed } from "./feed";
4+
import type { Author, Category, Enclosure, Extension, Item } from "./typings";
55
import { sanitize } from "./utils";
66

77
/**

tsconfig.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@
22
"compilerOptions": {
33
"allowUnreachableCode": false,
44
"allowUnusedLabels": false,
5-
"baseUrl": ".",
6-
"declaration": true,
75
"lib": [
8-
"es2015",
9-
"dom"
6+
"ESNext",
7+
"DOM",
8+
"DOM.Iterable"
109
],
11-
"module": "commonjs",
10+
"module": "ESNext",
11+
"moduleResolution": "bundler",
12+
"noEmit": true,
1213
"noFallthroughCasesInSwitch": true,
1314
"noImplicitAny": true,
1415
"noImplicitReturns": true,
15-
"outDir": "./lib",
16-
"removeComments": true,
17-
"sourceMap": true,
1816
"strict": true,
19-
"target": "es5"
17+
"target": "ESNext",
18+
"verbatimModuleSyntax": true
2019
},
2120
"include": ["./src/**/*"],
2221
"exclude": ["node_modules", "lib", "src/__tests__/**/*"]

tsdown.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineConfig } from "tsdown";
2+
3+
export default defineConfig({
4+
entry: [
5+
"./src/feed.ts",
6+
],
7+
outDir: "./lib",
8+
sourcemap: true,
9+
});

0 commit comments

Comments
 (0)