mirror of
https://github.com/zotero/zotero.git
synced 2026-08-28 05:25:31 +00:00
Rename pdf-worker submodule to document-worker
Some checks are pending
CI / Build, Upload, Test (push) Waiting to run
Some checks are pending
CI / Build, Upload, Test (push) Waiting to run
Repo moved to zotero/document-worker on GitHub
After pulling, run:
git submodule sync
git submodule update --init document-worker
If an old `pdf-worker/` directory is left behind, it can be removed manually.
This commit is contained in:
parent
9abd13fd22
commit
a487dd9eef
7 changed files with 15 additions and 15 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -53,7 +53,7 @@ jobs:
|
||||||
|
|
||||||
- name: Build Zotero
|
- name: Build Zotero
|
||||||
run: npm run build
|
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:
|
env:
|
||||||
NODE_OPTIONS: --openssl-legacy-provider
|
NODE_OPTIONS: --openssl-legacy-provider
|
||||||
|
|
||||||
|
|
|
||||||
4
.gitmodules
vendored
4
.gitmodules
vendored
|
|
@ -30,8 +30,8 @@
|
||||||
url = https://github.com/zotero/reader.git
|
url = https://github.com/zotero/reader.git
|
||||||
branch = master
|
branch = master
|
||||||
[submodule "pdf-worker"]
|
[submodule "pdf-worker"]
|
||||||
path = pdf-worker
|
path = document-worker
|
||||||
url = https://github.com/zotero/pdf-worker.git
|
url = https://github.com/zotero/document-worker.git
|
||||||
branch = master
|
branch = master
|
||||||
[submodule "note-editor"]
|
[submodule "note-editor"]
|
||||||
path = note-editor
|
path = note-editor
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ Several features are developed in separate repos and included as Git submodules:
|
||||||
|
|
||||||
- `reader/` -- PDF/EPUB/snapshot reader with annotations
|
- `reader/` -- PDF/EPUB/snapshot reader with annotations
|
||||||
- `note-editor/` -- Rich text note editor
|
- `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
|
- `translators/` -- 760+ web translators for importing metadata from websites
|
||||||
- `styles/` -- CSL citation styles
|
- `styles/` -- CSL citation styles
|
||||||
- `chrome/content/zotero/xpcom/utilities/` -- Shared utility library
|
- `chrome/content/zotero/xpcom/utilities/` -- Shared utility library
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ const getJS = require('./js');
|
||||||
const getSass = require('./sass');
|
const getSass = require('./sass');
|
||||||
const getSymlinks = require('./symlinks');
|
const getSymlinks = require('./symlinks');
|
||||||
const getReader = require('./reader');
|
const getReader = require('./reader');
|
||||||
const getPDFWorker = require('./pdf-worker');
|
const getDocumentWorker = require('./document-worker');
|
||||||
const getZoteroNoteEditor = require('./note-editor');
|
const getZoteroNoteEditor = require('./note-editor');
|
||||||
const { formatDirsForMatcher, getSignatures, writeSignatures, cleanUp, onSuccess, onError} = require('./utils');
|
const { formatDirsForMatcher, getSignatures, writeSignatures, cleanUp, onSuccess, onError} = require('./utils');
|
||||||
const { dirs, symlinkDirs, copyDirs, symlinkFiles, jsFiles, scssFiles, ignoreMask } = require('./config');
|
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(symlinks, { nodir: true, ignore: ignoreMask }, signatures),
|
||||||
getSymlinks(symlinkDirs, { ignore: ignoreMask }, signatures),
|
getSymlinks(symlinkDirs, { ignore: ignoreMask }, signatures),
|
||||||
getReader(signatures),
|
getReader(signatures),
|
||||||
getPDFWorker(signatures),
|
getDocumentWorker(signatures),
|
||||||
getZoteroNoteEditor(signatures)
|
getZoteroNoteEditor(signatures)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ if (require.main === module) {
|
||||||
await getClean(path.join(ROOT, 'build'));
|
await getClean(path.join(ROOT, 'build'));
|
||||||
await getClean(path.join(ROOT, '.signatures.json'));
|
await getClean(path.join(ROOT, '.signatures.json'));
|
||||||
await getClean(path.join(ROOT, 'reader/build'));
|
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'));
|
await getClean(path.join(ROOT, 'note-editor/build'));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
process.exitCode = 1;
|
process.exitCode = 1;
|
||||||
|
|
|
||||||
|
|
@ -7,19 +7,19 @@ const exec = util.promisify(require('child_process').exec);
|
||||||
const { getSignatures, writeSignatures, onSuccess, onError } = require('./utils');
|
const { getSignatures, writeSignatures, onSuccess, onError } = require('./utils');
|
||||||
const { buildsURL } = require('./config');
|
const { buildsURL } = require('./config');
|
||||||
|
|
||||||
async function getPDFWorker(signatures) {
|
async function getDocumentWorker(signatures) {
|
||||||
const t1 = Date.now();
|
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 { stdout } = await exec('git rev-parse HEAD', { cwd: modulePath });
|
||||||
const hash = stdout.trim();
|
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');
|
const targetDir = path.join(__dirname, '..', 'build', 'chrome', 'content', 'zotero', 'xpcom', 'pdfWorker');
|
||||||
try {
|
try {
|
||||||
const filename = hash + '.zip';
|
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;
|
const url = buildsURL + 'document-worker/' + filename;
|
||||||
|
|
||||||
await fs.remove(targetDir);
|
await fs.remove(targetDir);
|
||||||
|
|
@ -38,26 +38,26 @@ async function getPDFWorker(signatures) {
|
||||||
await exec('npm run build', { cwd: modulePath });
|
await exec('npm run build', { cwd: modulePath });
|
||||||
await fs.copy(path.join(modulePath, 'build', 'worker.js'), path.join(targetDir, 'worker.js'));
|
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();
|
const t2 = Date.now();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
action: 'pdf-worker',
|
action: 'document-worker',
|
||||||
count: 1,
|
count: 1,
|
||||||
totalCount: 1,
|
totalCount: 1,
|
||||||
processingTime: t2 - t1
|
processingTime: t2 - t1
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = getPDFWorker;
|
module.exports = getDocumentWorker;
|
||||||
|
|
||||||
if (require.main === module) {
|
if (require.main === module) {
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
const signatures = await getSignatures();
|
const signatures = await getSignatures();
|
||||||
onSuccess(await getPDFWorker(signatures));
|
onSuccess(await getDocumentWorker(signatures));
|
||||||
await writeSignatures(signatures);
|
await writeSignatures(signatures);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
Loading…
Add table
Reference in a new issue