Skip to content

Commit db8a862

Browse files
iguangfeiclaude
andcommitted
chore(pdf): 本地 PDF 解析改用 @deckflow/pdf-lite-parse
pdf-lite-parse 已迁到 deckflow 名下,旧包标记为废弃。解析器代码不变, IR 里记录的 producer 名称仍是 pdf-lite-parse,已有本地 PDF 产物继续可复用。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 3c29915 commit db8a862

11 files changed

Lines changed: 30 additions & 24 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
- Depend on `@deckflow/pdf-lite-parse@0.2.1`, the new scoped name of the local PDF parser; the unscoped
6+
`pdf-lite-parse` package is deprecated. The parser code is unchanged, and so is the `pdf-lite-parse`
7+
producer name recorded in IR, so existing local PDF artifacts stay reusable.
8+
39
## 2.4.0 — 2026-09-23 — PPTX lists and clean emphasis
410

511
- Read PPTX list structure in both engines: each paragraph's outline level and bullet are resolved

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ npm install -g @deckflow/deckops
2727

2828
The CLI and Node.js entry require Node.js 22.18 or newer. Frontend applications use the separate cloud-only [browser entry](#use-it-in-the-browser).
2929

30-
Local PDF parsing uses `pdf-lite-parse@0.2.1` and exports embedded images without expensive composite-figure rasterization. Extractable overlay text is retained separately; visual fidelity losses are reported in `quality`. `--no-images` (SDK: `includeImages: false`) skips image export entirely.
30+
Local PDF parsing uses `@deckflow/pdf-lite-parse@0.2.1` and exports embedded images without expensive composite-figure rasterization. Extractable overlay text is retained separately; visual fidelity losses are reported in `quality`. `--no-images` (SDK: `includeImages: false`) skips image export entirely.
3131

3232
Ordinary `npm install @deckflow/deckops` is now lightweight for PDF parsing: the parser embeds a pinned subset of PDF.js and its portable resources, with no separately installed `pdfjs-dist` or automatic canvas dependency. DeckProbe is pinned to the published 2.6.0 package; it uses its matching optional native CLI when available and falls back to WASM otherwise. To omit those as well and use the strict no-native installation:
3333

3434
```bash
3535
npm install --omit=optional @deckflow/deckops
3636
```
3737

38-
Embedded-image PDF parsing works in both installation modes without canvas. Use the cloud engine explicitly when full figure fidelity is needed. Applications calling `pdf-lite-parse` directly can explicitly install canvas for its opt-in composite mode; DeckOps does not enable it automatically.
38+
Embedded-image PDF parsing works in both installation modes without canvas. Use the cloud engine explicitly when full figure fidelity is needed. Applications calling `@deckflow/pdf-lite-parse` directly can explicitly install canvas for its opt-in composite mode; DeckOps does not enable it automatically.
3939

4040
## Content and upgrade policy
4141

@@ -322,7 +322,7 @@ their original MIT license; this change does not revoke permissions already gran
322322

323323
Third-party components retain their own licenses and copyright notices. See
324324
[THIRD_PARTY_NOTICES](THIRD_PARTY_NOTICES) and the licenses accompanying those
325-
components, including the PDF.js resources embedded in `pdf-lite-parse`.
325+
components, including the PDF.js resources embedded in `@deckflow/pdf-lite-parse`.
326326
The DeckOps license does not replace or remove those notices.
327327

328328
Source and build instructions are available in this repository; use the tag or

‎THIRD_PARTY_NOTICES‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ That license does not relicense the third-party components listed below.
55
Their applicable original licenses, copyright statements and attribution
66
notices must be retained when redistributing those components.
77

8-
pdf-lite-parse
8+
@deckflow/pdf-lite-parse
99
Copyright its contributors. Licensed under the Apache License 2.0.
1010
https://github.com/deckflow/pdf-lite-parse
1111

1212
PDF.js / pdfjs-dist
1313
Copyright Mozilla Foundation and contributors. Licensed under the Apache License 2.0.
1414
https://github.com/mozilla/pdf.js
15-
An allowlisted runtime and resource subset is embedded in pdf-lite-parse.
15+
An allowlisted runtime and resource subset is embedded in @deckflow/pdf-lite-parse.
1616
See its dist/vendor/pdfjs/PROVENANCE.json, LICENSE, and resource license notices.
1717

1818
@napi-rs/canvas (only if explicitly installed by a consumer; not a dependency)

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
},
7777
"dependencies": {
7878
"@deckflow/deckprobe": "2.6.0",
79+
"@deckflow/pdf-lite-parse": "0.2.1",
7980
"axios": "1.19.0",
8081
"chalk": "^5.3.0",
8182
"commander": "^11.1.0",
@@ -84,7 +85,6 @@
8485
"open": "^10.1.0",
8586
"p-limit": "^5.0.0",
8687
"parse5": "^7.3.0",
87-
"pdf-lite-parse": "0.2.1",
8888
"saxes": "^6.0.0"
8989
},
9090
"devDependencies": {

‎pnpm-lock.yaml‎

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

‎scripts/check-package-size.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ try {
6868
'--engine', 'local', '--preflight', 'off', '--output', defaultOutput, '--json'], {encoding:'utf8'}));
6969
if (!defaultSmoke.ok || defaultSmoke.engine !== 'local') throw new Error('Default production install failed the local PDF smoke test.');
7070
const ir = JSON.parse(fs.readFileSync(path.join(defaultOutput, 'ir.json'), 'utf8'));
71-
const parserVersion = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')).dependencies['pdf-lite-parse'];
71+
const parserVersion = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')).dependencies['@deckflow/pdf-lite-parse'];
7272
if (ir.producer.version !== parserVersion) throw new Error('Installed PDF parser version does not match the dependency pin.');
7373
process.stdout.write(`tarball ${(item.size / MiB).toFixed(2)} MiB; strict install ${(installedBytes / MiB).toFixed(2)} MiB; default install ${(defaultBytes / MiB).toFixed(2)} MiB (${defaultNative} native binaries); cold-start P95 ${p95.toFixed(0)} ms; PDF RSS ${(measured.maxRssBytes / MiB).toFixed(2)} MiB; files >1 MiB ${large.length}\n`);
7474
} finally {

‎src/ir/cloud-adapter.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pLimit from 'p-limit';
22
import type { ParseResult } from '../cloud/parse-facade.js';
3-
import type { ResultArtifact } from 'pdf-lite-parse';
3+
import type { ResultArtifact } from '@deckflow/pdf-lite-parse';
44
import { stableId } from './ids.js';
55
import {
66
bulletDeclaration, levelStyleKey, listParagraphs, masterTextStyleKey, matchLayoutPlaceholder, placeholderKind, resolveList,

‎src/ir/result3-adapter.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Element, Mark, ResultArtifact, Warning } from 'pdf-lite-parse';
1+
import type { Element, Mark, ResultArtifact, Warning } from '@deckflow/pdf-lite-parse';
22
import { stableId } from './ids.js';
33
import type { CandidateAsset, DeckIR, DeckIrNode, ParseCandidate, QualityCheck } from './schema.js';
44
import { makeIr, qualityOf, type SourceIdentity } from '../local/common.js';

‎src/local/pdf/adapter.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ParseArtifacts, ParseOptions } from 'pdf-lite-parse';
1+
import type { ParseArtifacts, ParseOptions } from '@deckflow/pdf-lite-parse';
22
import { DeckOpsError } from '../../errors/index.js';
33
import { result3ToDeckIr } from '../../ir/result3-adapter.js';
44
import type { ParseCandidate } from '../../ir/schema.js';
@@ -14,7 +14,7 @@ export interface LocalPdfOptions {
1414

1515
export async function parsePdf(input: string | Uint8Array, source: SourceIdentity, limits: LocalLimits, options: LocalPdfOptions = {}): Promise<ParseCandidate> {
1616
// Deliberately lazy: formats/help and OOXML paths do not load PDF.js.
17-
const { parseArtifacts } = await import('pdf-lite-parse');
17+
const { parseArtifacts } = await import('@deckflow/pdf-lite-parse');
1818
const upstreamOptions: ParseOptions = {
1919
images: options.includeImages === false ? 'none' : 'embedded',
2020
...(options.password !== undefined ? { password: options.password } : {}),

‎src/version.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ const require = createRequire(import.meta.url);
44

55
export const VERSION: string = (require('../package.json') as { version: string }).version;
66
/** Exact dependency pin, read without loading PDF.js. */
7-
export const PDF_PARSER_VERSION: string = (require('../package.json') as { dependencies: Record<string, string> }).dependencies['pdf-lite-parse']!;
7+
export const PDF_PARSER_VERSION: string = (require('../package.json') as { dependencies: Record<string, string> }).dependencies['@deckflow/pdf-lite-parse']!;

0 commit comments

Comments
 (0)