Skip to content

Commit c84142b

Browse files
committed
chore: update dev dependencies, fix code style issues
1 parent 9b26b56 commit c84142b

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

lib/writeCRX3File.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,13 @@ function writeFromListOfFiles (crxStream, files) {
130130
.then(resolve)
131131
.catch(reject);
132132

133-
const zipOptions = {
134-
compressionLevel: 9
135-
};
133+
const zipOptions = {compressionLevel: 9}; // eslint-disable-line no-magic-numbers
136134

137135
if (crxStream.crx.cfg.forceDateTime > 0) {
138136
zipOptions.mtime = new Date(crxStream.crx.cfg.forceDateTime);
139137
}
140138

141-
files.forEach(file => zip.addFile(file, file.replace(rootPath, ''), zipOptions)); // eslint-disable-line no-magic-numbers
139+
files.forEach(file => zip.addFile(file, file.replace(rootPath, ''), zipOptions));
142140

143141
zip.end();
144142
});

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "crx3",
3-
"version": "1.1.4",
3+
"version": "2.0.0",
44
"description": "Package web extension into CRX file (version 3) for Google Chrome and Chromium browsers",
55
"main": "index.js",
66
"homepage": "https://github.com/ahwayakchih/crx3",
@@ -22,8 +22,8 @@
2222
"devDependencies": {
2323
"c8": "^10.1.3",
2424
"docdash": "^2.0.1",
25-
"eslint": "^9.18.0",
26-
"eslint-plugin-jsdoc": "^50.6.1",
25+
"eslint": "^9.19.0",
26+
"eslint-plugin-jsdoc": "^50.6.3",
2727
"jsdoc": "^4.0.2",
2828
"tap-diff": "^0.1.1",
2929
"tape": "^5.6.3",

test/lib/writeCRX3File.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,15 @@ function testWriteCRX3FileWithFilesAndOptions (t) {
9090
};
9191

9292
const manifestPath = path.join(CWD, 'example', 'example-extension', 'manifest.json');
93+
// Use the same date and time for source files as those already in example ZIP and CRX files, that we will compare new ones to.
94+
const filesTimestamp = 1553470140000; // '2019-03-24T23:29:00.000Z'
9395
const p = writeCRX3File([manifestPath], {
9496
crxPath : temp.crx,
9597
zipPath : temp.zip,
9698
xmlPath : temp.xml,
9799
keyPath : path.join(CWD, 'example', 'example-extension.pem'),
98100
crxURL : `http://127.0.0.1:8080/${path.basename(temp.crx)}`,
99-
forceDateTime: 1553470140000 // '2019-03-24T23:29:00.000Z'
101+
forceDateTime: filesTimestamp
100102
});
101103

102104
t.strictEqual(typeof p, 'object', 'Should return object when called with files and options');
@@ -217,10 +219,12 @@ async function doesItWorkInChrome (t, cfg) {
217219

218220
const margin = ' '.padStart(t._objectPrintDepth || 0, '.'); // eslint-disable-line no-underscore-dangle
219221

220-
// Since v112, Chrome/Chromium has "new" headless mode, which supports extensions and does not need XVFB.
221-
// But there are problems running it by GitHub Actions (inside a rootful container),
222-
// so allow to force using "full mode" by setting `CHROME_DISABLE_SANDBOX` in environment.
223-
/* eslint-disable array-element-newline, array-bracket-newline, multiline-comment-style */
222+
/*
223+
* Since v112, Chrome/Chromium has "new" headless mode, which supports extensions and does not need XVFB.
224+
* But there are problems running it by GitHub Actions (inside a rootful container),
225+
* so allow to force using "full mode" by setting `CHROME_DISABLE_SANDBOX` in environment.
226+
*/
227+
/* eslint-disable array-element-newline, multiline-comment-style */
224228
const runFullModeMode = process.env.CHROME_DISABLE_SANDBOX || !testVersion(chromeVersion.trim(), '112.0.5614.0');
225229
const browserIgnoreDefaultArgs = [
226230
'--disable-extensions', // Do not disable extensions when we want to test them ;P
@@ -253,7 +257,7 @@ async function doesItWorkInChrome (t, cfg) {
253257
else {
254258
t.comment(`${margin}Running browser using "new" headless mode, XVFB is not needed`);
255259
}
256-
/* eslint-enable array-element-newline, array-bracket-newline, multiline-comment-style */
260+
/* eslint-enable array-element-newline, multiline-comment-style */
257261

258262
const browser = await puppeteer.launch({
259263
headless : false, // This has to be false, even when we're passing `headless=new` option

0 commit comments

Comments
 (0)