Export du dépôt interne d'Aleop, révision 0936ea1 (fichiers publiés identiques à e46bc12). Paquets construits depuis cette source : - Android : AAB 2026.10.0, code 4 - iPhone : archive 2026.10.0 (18) - Bureau : macOS universel build 13, Windows build 14, MSIX build 15 - Extensions Chrome, Edge et Firefox : 2026.10.0.3
29 lignes
1.4 KiB
JavaScript
29 lignes
1.4 KiB
JavaScript
// GPL-3.0-only. Wrapper du build amont : bloque le code commercial, relève les modules réels.
|
|
// Même garde-fou que extensions/webpack-oss.cjs, pour les trois configs du bureau
|
|
// (main, renderer, preload).
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
const root = __dirname;
|
|
const { tag } = require('./upstream.json');
|
|
const source = path.join(root, '.cache', `clients-${tag}`);
|
|
class OssBoundaryPlugin {
|
|
apply(compiler) {
|
|
compiler.hooks.compilation.tap('LoksiOssBoundary', compilation => {
|
|
compilation.hooks.finishModules.tap('LoksiOssBoundary', modules => {
|
|
const resources = [...modules].map(m => m.resource).filter(Boolean).sort();
|
|
const forbidden = resources.filter(p => /[/\\]bitwarden_license[/\\]|[/\\]commercial-sdk-internal[/\\]/.test(p));
|
|
if (forbidden.length) throw new Error(`Code commercial interdit : ${forbidden.join(', ')}`);
|
|
const name = `desktop-${compiler.options.name}`.replace(/[^a-zA-Z0-9.-]/g, '_');
|
|
fs.mkdirSync(path.join(root, 'reports'), { recursive: true });
|
|
fs.writeFileSync(path.join(root, 'reports', `${name}-modules.json`),
|
|
JSON.stringify(resources.map(p => path.relative(source, p)), null, 2));
|
|
});
|
|
});
|
|
}
|
|
}
|
|
module.exports = (...args) => {
|
|
const configs = require(path.join(source, 'apps/desktop/webpack.config.js'))(...args);
|
|
for (const config of configs) config.plugins.push(new OssBoundaryPlugin());
|
|
return configs;
|
|
};
|