zotero/scripts/build.js
Adomas Venčkauskas a24cada451 React Tag Selector polish, i18n and tests
- Added icon-button UI code for the menubutton
- Upgrade to React 16 to allow non-standard attrs, such as `tooltiptext`
to support XUL tooltips
- Add i18n support for React UI elements
- Update tests for reactified tag selector
2019-01-21 11:01:27 +02:00

45 lines
No EOL
1.6 KiB
JavaScript

const colors = require('colors/safe');
const getBrowserify = require('./browserify');
const getCopy = require('./copy');
const getJS = require('./js');
const getSass = require('./sass');
const getSymlinks = require('./symlinks');
const { formatDirsForMatcher, getSignatures, writeSignatures, cleanUp, onSuccess, onError} = require('./utils');
const { dirs, symlinkDirs, copyDirs, symlinkFiles, jsFiles, scssFiles, ignoreMask } = require('./config');
if (require.main === module) {
(async () => {
try {
const t1 = Date.now();
global.isError = false; // used to prevent further output to avoid concealing errors
const symlinks = symlinkFiles
.concat(dirs.map(d => `${d}/**`))
.concat([`!${formatDirsForMatcher(dirs)}/**/*.js`])
.concat([`!${formatDirsForMatcher(dirs)}/**/*.jsx`])
.concat([`!${formatDirsForMatcher(copyDirs)}/**`])
const signatures = await getSignatures();
const results = await Promise.all([
getBrowserify(signatures),
getCopy(copyDirs.map(d => `${d}/**`), { ignore: ignoreMask }, signatures),
getJS(jsFiles, { ignore: ignoreMask }, signatures),
getSass(scssFiles, { ignore: ignoreMask }, signatures),
getSymlinks(symlinks, { nodir: true, ignore: ignoreMask }, signatures),
getSymlinks(symlinkDirs, { ignore: ignoreMask }, signatures),
cleanUp(signatures)
]);
await writeSignatures(signatures);
for (const result of results) {
onSuccess(result);
}
const t2 = Date.now();
console.log(colors.yellow(`Total build time ${t2 - t1}ms`));
} catch (err) {
process.exitCode = 1;
global.isError = true;
onError(err);
}
})();
}