Skip to content

Commit f9b5ac9

Browse files
authored
Update configs, deps, examples and tests (#90)
Various maintenance updates: rename and clarify GitHub Actions publish step, enable Biome HTML formatting and bump biome schema; tighten Biome lint rules and include/exclude adjustments. Bump multiple dev/optional dependencies in package.json and update example scripts to remove unused imports/vars and minor formatting fixes. Fix several report/demo HTML templates to use template literals / modern arrow IIFE. Normalize rolldown config copy calls and adjust output options (disable code splitting, silence plugin timings). Tidy scripts (path joins, function renames) and clean up test fixtures and Jest configs with minor type/format fixes. These changes improve build/tooling reliability and code/style consistency.
1 parent 41b511a commit f9b5ac9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+180
-168
lines changed

.github/workflows/publish_npm_package.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ jobs:
7373
echo "tag=latest" >> $GITHUB_OUTPUT
7474
fi
7575
76-
- run: npm publish --provenance --access public --tag ${{ steps.publish_tag.outputs.tag }}
77-
env:
78-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
76+
- name: Publish to npm (Trusted Publishing)
77+
run: npm publish --provenance --access public --tag ${{ steps.publish_tag.outputs.tag }}
78+
79+
#- run: npm publish --provenance --access public --tag ${{ steps.publish_tag.outputs.tag }}
80+
# env:
81+
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
"editor.defaultFormatter": "biomejs.biome"
2828
},
2929

30+
"[html]": {
31+
"editor.defaultFormatter": "biomejs.biome"
32+
},
33+
3034
"[json]": {
3135
"editor.defaultFormatter": "biomejs.biome"
3236
},

biome.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.3.1/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.3.14/schema.json",
33
"vcs": {
44
"enabled": true,
55
"clientKind": "git",
@@ -9,12 +9,14 @@
99
"ignoreUnknown": false,
1010
"includes": [
1111
"**",
12+
"examples/**",
1213
"!dist",
1314
"!reports/demo/dist-web",
1415
"!reports/test",
1516
"!reports/pdf",
1617
"!reports/coverage",
1718
"!reports/benchmark",
19+
"!reports/benchmark.html",
1820
"!bin/worker/worker_source.js",
1921
"!bin/worker/worker_source.cjs",
2022
"!tests/integration/*/node_modules"
@@ -30,16 +32,13 @@
3032
"rules": {
3133
"recommended": true,
3234
"suspicious": {
33-
"noImplicitAnyLet": "warn",
34-
"noDebugger": "warn",
35-
"noConsole": "warn"
35+
"noDebugger": "warn"
3636
},
3737
"style": {
38-
"useConst": {
39-
"level": "info",
40-
"fix": "none",
41-
"options": {}
42-
}
38+
"useConst": "warn"
39+
},
40+
"correctness": {
41+
"noUnusedVariables": "warn"
4342
}
4443
}
4544
},
@@ -48,6 +47,7 @@
4847
"quoteStyle": "single"
4948
}
5049
},
50+
5151
"assist": {
5252
"enabled": true,
5353
"actions": {
@@ -70,7 +70,6 @@
7070
},
7171
"overrides": [
7272
{
73-
"includes": ["examples/**"],
7473
"linter": {
7574
"enabled": false
7675
},

examples/_extract-signature.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ async function getSignature(signatureCount: number = 1) {
4040
// const byteRangePos = pdf.indexOf('/ByteRange [');
4141
const byteRangePos = getSubstringIndex(pdf, '/ByteRange [', signatureCount);
4242
if (byteRangePos === -1) {
43-
debugger;
43+
//debugger;
4444
}
4545

4646
const byteRangeEnd = pdf.indexOf(']', byteRangePos);
4747
if (byteRangeEnd === -1) {
48-
debugger;
48+
//debugger;
4949
}
5050

5151
const byteRange = pdf.slice(byteRangePos, byteRangeEnd + 1).toString();

examples/basic.cdn.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
<head>
55
<script type="module">
6+
67
import { PDFParse } from 'https://cdn.jsdelivr.net/npm/pdf-parse@latest/+esm';
8+
79
PDFParse.setWorker('https://cdn.jsdelivr.net/npm/pdf-parse@latest/dist/pdf-parse/web/pdf.worker.mjs');
810

911
async function parsePDF(file) {

examples/basic.esm.worker.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
<head>
55
<script type="module">
6+
67
import { PDFParse } from 'https://cdn.jsdelivr.net/npm/pdf-parse@latest/dist/pdf-parse/web/pdf-parse.es.js';
8+
79
PDFParse.setWorker('https://cdn.jsdelivr.net/npm/pdf-parse@latest/dist/pdf-parse/web/pdf.worker.mjs');
810

911
async function parsePDF(file) {

examples/get-image.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { readFile, writeFile } from 'node:fs/promises';
1+
import { writeFile } from 'node:fs/promises';
22
import { PDFParse } from 'pdf-parse';
33

44
const link = new URL('https://mehmet-kozan.github.io/pdf-parse/pdf/image-test.pdf');

examples/get-info.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { readFile } from 'node:fs/promises';
21
import { PDFParse } from 'pdf-parse';
32

43
const link = 'https://mehmet-kozan.github.io/pdf-parse/pdf/climate.pdf';

examples/get-screenshot.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { readFile, writeFile } from 'node:fs/promises';
1+
import { writeFile } from 'node:fs/promises';
22
import { PDFParse } from 'pdf-parse';
33

44
const link = 'https://bitcoin.org/bitcoin.pdf';

examples/get-table.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { readFile } from 'node:fs/promises';
21
import { PDFParse } from 'pdf-parse/pro';
32

43
const link = new URL('https://mehmet-kozan.github.io/pdf-parse/pdf/simple-table.pdf');

0 commit comments

Comments
 (0)