Files
klz-cables.com/.pnpm-store/v10/files/2d/9372137bed6d31647faff91864a186758210a83aa2b05945848cb9f296a30d46e0b38ca2fc9dc277eadab883f9715a650fce741aedc9ae26a8ed4eb00861b6
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

39 lines
1.1 KiB
Plaintext

import CatalogManager from './catalog/CatalogManager.js';
import MessageExtractor from './extractor/MessageExtractor.js';
class ExtractionCompiler {
constructor(config, opts = {}) {
const extractor = opts.extractor ?? new MessageExtractor(opts);
this.manager = new CatalogManager(config, {
...opts,
extractor
});
this[Symbol.dispose] = this[Symbol.dispose].bind(this);
this.installExitHandlers();
}
async extractAll() {
// We can't rely on all files being compiled (e.g. due to persistent
// caching), so loading the messages initially is necessary.
await this.manager.loadMessages();
await this.manager.save();
}
[Symbol.dispose]() {
this.uninstallExitHandlers();
this.manager[Symbol.dispose]();
}
installExitHandlers() {
const cleanup = this[Symbol.dispose];
process.on('exit', cleanup);
process.on('SIGINT', cleanup);
process.on('SIGTERM', cleanup);
}
uninstallExitHandlers() {
const cleanup = this[Symbol.dispose];
process.off('exit', cleanup);
process.off('SIGINT', cleanup);
process.off('SIGTERM', cleanup);
}
}
export { ExtractionCompiler as default };