diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a11fb9264..c1c5ee240c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: - name: Build Zotero run: npm run build - # Currently necessary for pdf-worker Webpack: https://stackoverflow.com/a/69746937 + # Currently necessary for document-worker Webpack: https://stackoverflow.com/a/69746937 env: NODE_OPTIONS: --openssl-legacy-provider diff --git a/.gitmodules b/.gitmodules index f2a61cbf94..b17354e26d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -30,8 +30,8 @@ url = https://github.com/zotero/reader.git branch = master [submodule "pdf-worker"] - path = pdf-worker - url = https://github.com/zotero/pdf-worker.git + path = document-worker + url = https://github.com/zotero/document-worker.git branch = master [submodule "note-editor"] path = note-editor diff --git a/CLAUDE.md b/CLAUDE.md index ee1c392a0e..028e856761 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -78,7 +78,7 @@ Several features are developed in separate repos and included as Git submodules: - `reader/` -- PDF/EPUB/snapshot reader with annotations - `note-editor/` -- Rich text note editor -- `pdf-worker/` -- PDF processing (extraction, manipulation) +- `document-worker/` -- PDF processing (extraction, manipulation) - `translators/` -- 760+ web translators for importing metadata from websites - `styles/` -- CSL citation styles - `chrome/content/zotero/xpcom/utilities/` -- Shared utility library diff --git a/pdf-worker b/document-worker similarity index 100% rename from pdf-worker rename to document-worker diff --git a/js-build/build.js b/js-build/build.js index 6b39260812..a2e074d371 100644 --- a/js-build/build.js +++ b/js-build/build.js @@ -6,7 +6,7 @@ const getJS = require('./js'); const getSass = require('./sass'); const getSymlinks = require('./symlinks'); const getReader = require('./reader'); -const getPDFWorker = require('./pdf-worker'); +const getDocumentWorker = require('./document-worker'); const getZoteroNoteEditor = require('./note-editor'); const { formatDirsForMatcher, getSignatures, writeSignatures, cleanUp, onSuccess, onError} = require('./utils'); const { dirs, symlinkDirs, copyDirs, symlinkFiles, jsFiles, scssFiles, ignoreMask } = require('./config'); @@ -37,7 +37,7 @@ if (require.main === module) { getSymlinks(symlinks, { nodir: true, ignore: ignoreMask }, signatures), getSymlinks(symlinkDirs, { ignore: ignoreMask }, signatures), getReader(signatures), - getPDFWorker(signatures), + getDocumentWorker(signatures), getZoteroNoteEditor(signatures) ]); diff --git a/js-build/clean.js b/js-build/clean.js index b0f62ad87e..0ad4ecc50a 100644 --- a/js-build/clean.js +++ b/js-build/clean.js @@ -18,7 +18,7 @@ if (require.main === module) { await getClean(path.join(ROOT, 'build')); await getClean(path.join(ROOT, '.signatures.json')); await getClean(path.join(ROOT, 'reader/build')); - await getClean(path.join(ROOT, 'pdf-worker/build')); + await getClean(path.join(ROOT, 'document-worker/build')); await getClean(path.join(ROOT, 'note-editor/build')); } catch (err) { process.exitCode = 1; diff --git a/js-build/pdf-worker.js b/js-build/document-worker.js similarity index 76% rename from js-build/pdf-worker.js rename to js-build/document-worker.js index b820304f3a..3bdc7c3e50 100644 --- a/js-build/pdf-worker.js +++ b/js-build/document-worker.js @@ -7,19 +7,19 @@ const exec = util.promisify(require('child_process').exec); const { getSignatures, writeSignatures, onSuccess, onError } = require('./utils'); const { buildsURL } = require('./config'); -async function getPDFWorker(signatures) { +async function getDocumentWorker(signatures) { const t1 = Date.now(); - const modulePath = path.join(__dirname, '..', 'pdf-worker'); + const modulePath = path.join(__dirname, '..', 'document-worker'); const { stdout } = await exec('git rev-parse HEAD', { cwd: modulePath }); const hash = stdout.trim(); - if (!('pdf-worker' in signatures) || signatures['pdf-worker'].hash !== hash) { + if (!('document-worker' in signatures) || signatures['document-worker'].hash !== hash) { const targetDir = path.join(__dirname, '..', 'build', 'chrome', 'content', 'zotero', 'xpcom', 'pdfWorker'); try { const filename = hash + '.zip'; - const tmpDir = path.join(__dirname, '..', 'tmp', 'builds', 'pdf-worker'); + const tmpDir = path.join(__dirname, '..', 'tmp', 'builds', 'document-worker'); const url = buildsURL + 'document-worker/' + filename; await fs.remove(targetDir); @@ -38,26 +38,26 @@ async function getPDFWorker(signatures) { await exec('npm run build', { cwd: modulePath }); await fs.copy(path.join(modulePath, 'build', 'worker.js'), path.join(targetDir, 'worker.js')); } - signatures['pdf-worker'] = { hash }; + signatures['document-worker'] = { hash }; } const t2 = Date.now(); return { - action: 'pdf-worker', + action: 'document-worker', count: 1, totalCount: 1, processingTime: t2 - t1 }; } -module.exports = getPDFWorker; +module.exports = getDocumentWorker; if (require.main === module) { (async () => { try { const signatures = await getSignatures(); - onSuccess(await getPDFWorker(signatures)); + onSuccess(await getDocumentWorker(signatures)); await writeSignatures(signatures); } catch (err) {