Skip to content

Commit be47b08

Browse files
committed
maint: move typings from root to dist, verify the files for distribution
1 parent 02b9571 commit be47b08

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pdf2json",
3-
"version": "3.1.7",
3+
"version": "3.2.0",
44
"description": "PDF file parser that converts PDF binaries to JSON and text, powered by porting a fork of PDF.JS to Node.js",
55
"keywords": [
66
"pdf",
@@ -31,7 +31,7 @@
3131
},
3232
"main": "./dist/pdfparser.cjs",
3333
"module": "./dist/pdfparser.js",
34-
"typings": "./pdfparser.d.ts",
34+
"typings": "./dist/pdfparser.d.ts",
3535
"scripts": {
3636
"pretest": "npm run build",
3737
"test:jest": "jest --config ./jest.config.json --detectOpenHandles",
@@ -120,8 +120,6 @@
120120
"bin/",
121121
"dist/",
122122
"package.json",
123-
"pdfparser.d.ts",
124-
"pdfparser.js",
125123
"readme.md",
126124
"license.txt"
127125
]

rollup/bundle-pdfjs-base.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,11 @@ if (fs.existsSync(targetDir)) {
8181
}
8282
fs.mkdirSync(targetDir);
8383

84-
fs.copyFileSync(path.join(__dirname, "../pdfparser.d.ts"), path.join(targetDir, "pdfparser.d.ts"));
84+
// copy and patch the type definition file
85+
const typeDefSrcPath = path.join(__dirname, "../src/types/pdfparser.d.ts");
86+
fs.copyFileSync(typeDefSrcPath, path.join(targetDir, "pdfparser.d.ts"));
8587
// .d.cts should have "export =" instead of "export default"
86-
const typeDefContent = fs.readFileSync(path.join(__dirname, "../pdfparser.d.ts"), "utf8");
88+
const typeDefContent = fs.readFileSync(typeDefSrcPath, "utf8");
8789
fs.writeFileSync(
8890
path.join(targetDir, "pdfparser.d.cts"),
8991
typeDefContent.replace("export default", "export =")
File renamed without changes.

0 commit comments

Comments
 (0)