stylus/tools/zip.js
tophf fdbfb23547
API groups + use executeScript for early injection (#1149)
* parserlib: fast section extraction, tweaks and speedups
* csslint: "simple-not" rule
* csslint: enable and fix "selector-newline" rule
* simplify db: resolve with result
* simplify download()
* remove noCode param as it wastes more time/memory on copying
* styleManager: switch style<->data names to reflect their actual contents
* inline method bodies to avoid indirection and enable better autocomplete/hint/jump support in IDE
* upgrade getEventKeyName to handle mouse clicks
* don't trust location.href as it hides text fragment
* getAllKeys is implemented since Chrome48, FF44
* allow recoverable css errors + async'ify usercss.js
* openManage: unminimize windows
* remove the obsolete Chrome pre-65 workaround
* fix temporal dead zone in apply.js
* ff bug workaround for simple editor window
* consistent window scrolling in scrollToEditor and jumpToPos
* rework waitForSelector and collapsible <details>
* blank paint frame workaround for new Chrome
* extract stuff from edit.js and load on demand
* simplify regexpTester::isShown
* move MozDocMapper to sections-util.js
* extract fitSelectBox()
* initialize router earlier
* use helpPopup.close()
* fix autofocus in popups, follow-up to 5bb1b5ef
* clone objects in prefs.get() + cosmetics
* reuse getAll result for INC
2021-01-01 17:27:58 +03:00

54 lines
1.1 KiB
JavaScript

#!/usr/bin/env node
'use strict';
const fs = require('fs');
const archiver = require('archiver');
function createZip() {
const fileName = 'stylus.zip';
const ignore = [
'.*', // dot files/folders (glob, not regexp)
'node_modules/**',
'tools/**',
'package.json',
'package-lock.json',
'yarn.lock',
'*.zip',
'*.map',
];
const file = fs.createWriteStream(fileName);
const archive = archiver('zip');
return new Promise((resolve, reject) => {
archive.on('finish', () => {
resolve();
});
archive.on('warning', err => {
if (err.code === 'ENOENT') {
console.log('\x1b[33m%s\x1b[0m', 'Warning', err.message);
} else {
reject();
throw err;
}
});
archive.on('error', err => {
reject();
throw err;
});
archive.pipe(file);
archive.glob('**', {ignore});
archive.finalize();
});
}
(async () => {
try {
await createZip();
console.log('\x1b[32m%s\x1b[0m', 'Stylus zip complete');
} catch (err) {
console.error(err);
process.exit(1);
}
})();