From 260f782a6f46d92eecb9a0d386b9901568ab30a2 Mon Sep 17 00:00:00 2001 From: lieser Date: Sun, 12 Nov 2023 18:10:52 +0100 Subject: [PATCH 1/2] Use Markdown for changelog --- CHANGELOG.md | 344 ++++++++++++++++++++++++++++++++++++++++++++++++++ CHANGELOG.txt | 337 ------------------------------------------------- 2 files changed, 344 insertions(+), 337 deletions(-) create mode 100644 CHANGELOG.md delete mode 100644 CHANGELOG.txt diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..efb33819 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,344 @@ +# Changelog + + + +All notable changes to this project will be documented in this file. + +## 2.2.1 (2021-04-08) + +- Added integration with Silvermel and Charamel themes for favicons (#254 by dodmi) + +Backports (by dodmi): + +- Authentication-Results header: fixed parsing of version (#253) +- Authentication-Results header: fixed parsing of quoted SDID and AUID (#229, #234, #253) +- Authentication-Results header: fixed missing reason on fail resulting in error (#232, #252) +- Updated default rules and favicons (#255) + +## 2.2.0 (2020-01-19) + +- Authentication-Results header: fix relaxed parsing option and trailing ";" +- exposed option on how to treat weak keys. Default is now ignore (was warning since 2.1.0) (#174) +- fixed default text color for unsigned e-mail in dark theme if highlighting of From header is enabled (#181) +- libunbound resolver: add ability to explicitly load dependencies of libunbound (#170, #179) +- updated default rules and favicons (#165, #168, #169, #180) + +## 2.1.0 (2019-08-29) + +- Cryptographic Algorithm and Key Usage Update (RFC 8301, #141) +- updated default rules and favicons (#140, #145, #152, #157, #159) +- added Hungarian translation (by Óvári) (#164) + +## 2.0.1 (2019-01-18) + +- fixed signature verification in case the RSA key has an odd key length (#112) +- fixed DMARC heuristic (#125) +- fixed "*" not being recognized as valid Service Type in DKIM Keys (#134) +- changed update DKIM key button to now update the keys of all DKIM signatures in the e-mail +- Authentication-Results header: fixed mixed case results specified by older SPF specs resulting in a parsing error (#135) +- JSDNS: fixed a problem getting the default DNS servers on Windows (#116, #120) +- JSDNS: reduced default DNS server timeout from 10 to 5 seconds +- updated included third-party libraries +- updated default rules and favicons + +## 2.0.0 (2018-04-19) + +- now requires at least Thunderbird 52 +- added toolbar button and menuitem for sign rules +- added option to try to read non RFC compliant Authentication-Results header +- fixed incompatibility with Thunderbird 57/59/60 +- fixed favicons not being shown if the CardBook add-on is installed +- fixed "Add must be signed exception" button being disabled if wrong signer is only a warning +- updated default rules and favicons + +## 1.7.0 (2017-07-22) + +- libunbound resolver: added ability to specify multiple trust anchors +- libunbound resolver: added new root trust anchor (key tag 20326) +- updated default rules and favicons + +## 1.6.5 (2017-05-14) + +- added Japanese translation (by SAKURAI Kenichi) +- updated default rules + +## 1.6.4 (2017-02-09) + +- fixed saving of result with DNSSEC lock enabled +- fixed incompatibility with Thunderbird 52 and libunbound +- updated default rules and favicons + +## 1.6.3 (2016-11-20) + +- fixed incompatibility with Thunderbird 52 +- updated default rules and favicons + +## 1.6.2 (2016-10-24) + +- fixed incompatibility with Silvermel/Charamel +- fixed Problem with copied header fields +- updated default rules and favicons + +## 1.6.1 (2016-09-26) + +- fixed problem with old Thunderbird versions and sign rules + +## 1.6.0 (2016-09-25) + +- added option to indicate successful DNSSEC validation with a lock (enabled by default) +- added option to show the favicon of some known signing domains (enabled by default) +- added option to show the ARH result alongside the add-ons, instead of replacing it +- JSDNS: differentiate between a server error and an non existing DKIM key +- sign rules: ignore must be signed for outgoing messages +- sign rules: updated default rules +- fixed updating a DKIM key or marking it as secure via the "Other Actions" button + +## 1.5.1 (2016-06-11) + +- fixed verification for external messages +- sign rules: updated default rules + +## 1.5.0 (2016-05-17) + +- added option to enable/disable DKIM verification for each account +- JavaScript DNS library: added support to use a proxy +- sign rules: updated default rules (added firefox.com) +- DKIM key: empty, but existing DNS record is now treated as a missing key instead as an ill-formed one +- fixed installing problem if extensions.getAddons.cache.enabled is set to false () + +## 1.4.1 (2016-02-13) + +- fixed incompatibility with Thunderbird 46 +- Authentication-Results header: fixed trusting all authentication servers + +## 1.4.0 (2016-02-08) + +- simplified shown error reasons and added advanced option for detailed reasons +- Authentication-Results header: reading of the ARH can now be set for each account +- Authentication-Results header: added option to only trust specific authentication servers +- Authentication-Results header: continue verification if there is no DKIM result in the ARH header +- Authentication-Results header: allow also unknown property types to be compliant with RFC 7601 +- Authentication-Results header: fixed bug if ARH header exists, but no message authentication was done +- JavaScript DNS library: no longer get the DNS servers from deactivated interfaces under windows +- libunbound resolver: no longer blocks the UI of Thunderbird +- libunbound resolver: changing preferences no longer needs a restart + +## 1.3.6 (2015-09-13) + +- fixed error in parsing of Authentication-Results header +- added additional debugging calls + +## 1.3.5 (2015-07-11) + +- fixed bug if a header field body started with a ":" + +## 1.3.4 (2015-06-21) + +- added compatibility for Thunderbird 40 + +## 1.3.3 (2015-03-21) + +- fixed bug in the sorting of the results of multiple DKIM signatures + +## 1.3.2 (2015-02-21) + +- updated default sign rules + +## 1.3.1 (2014-12-10) + +- DNS errors in DMARC heuristic are now ignored (previously this resulted in an internal error) +- fixed error resulting in incompatibility with Thunderbird 36 + +## 1.3.0 (2014-12-08) + +- added option to treat ill-formed selector tag as as error/warning/nothing (default warning; previous behavior was error) +- added support for multiple signatures +- added option to read Authentication-Results header +- added French translation (by Christophe CHAUVET) + +- fixed problem with JavaScript DNS Resolver and long DKIM keys, resulting in error "Key couldn't be decoded" +- fixed incompatibility with compact headers add-on + +## 1.2.2 (2014-08-16) + +- added Chinese (Simplified) translation (by YFdyh000) +- fixed the showing of a wrong error reason in some cases of a bad RSA signature + +## 1.2.1 (2014-06-30) + +- fixed an issue in formated strings ("%S" was not replaced) + +## 1.2.0 (2014-06-25) + +- added option for sign rules to allow also subdomains of the SDIDs (enabled by default) +- fixed comparison of domains (was case sensitive) +- updated default sign rules + +## 1.1.2 (2014-05-08) + +- fixed error if e-mail is from a domain on the public suffix list (like "googlecode.com") +- updated default sign rules + +## 1.1.1 (2014-04-10) + +- fixed bug in use of libundboud (non existing domain was treated as server error; caused problems with DMARC) + +## 1.1.0 (2014-04-07) + +- added options for automatically added sign rules +- added option to use DMARC to heuristically determinate if an e-mail should be signed +- fixed sign rules being automatically added even if signRules are disabled +- fixed bug in getting DNS name server from OS under Linux/Mac (last line was not read) + +## 1.0.5 (2014-01-14) + +- added Italian translation (by Michele Locati) +- statusbarpanel and tooltip are now set to loading on reverify +- DKIM Keys and signers rules window can now be opened at the same time + +## 1.0.4 (2013-12-20) + +- fixed bug in an error message of the JavaScript DNS library +- added advanced options for the JavaScript DNS library useful in case of bad network connection (not available through GUI) + +## 1.0.3 (2013-12-12) + +- fixed bug in sign rules if from address contains capital letters +- fixed verification of unsigned e-mails which are marked as should be signed by sign rules + +## 1.0.2 (2013-11-22) + +- fixed internal error if sign rules are disabled + +## 1.0.1 (2013-11-22) + +- fixed DKIM_SIGWARNING_FROM_NOT_IN_SDID + +## 1.0.0 (2013-11-21) + +- added signers rules +- added key storing +- added libunbound as second DNS resolver (supports DNSSEC) +- from tooltip now also works if Thunderbird's status bar is disabled + +- fixed some patterns (A-z to A-Za-z, dkim_safe_char, qp_hdr_value) +- fixed pattern for note tag in DKIM key +- fixed bug in DKIM_SIGWARNING_FROM_NOT_IN_AUID +- validate tag list as specified in Section 3.2 of RFC 6376 +- now differentiation between missing and ill-formed tags +- added check that hash declared in DKIM-Signature is included in the hashs declared in the key record +- added check that the hash algorithm in the public key is the same as in the header + +## 0.6.3 (2013-10-13) + +- fixed bug for detection of configured DNS Servers in Windows + (if more then one DNS server was configured for an adapter) + +## 0.6.2 (2013-10-13) + +- fixed bug if "other actions" button of CompactHeader add-on toolbar is not included + +## 0.6.1 (2013-10-12) + +- better detection of configured DNS Servers in Windows + +## 0.6.0 (2013-09-26) + +- added option for displaying of header, status bar and tooltip for From header +- fixed false detection of DKIM_SIGERROR_DOMAIN_I +- made options height smaller +- fixed error in "simple" body canonicalization algorithm resulting in "Wrong body hash" +- fixed bug for mixed CRLF and LF EOLs in body (resulting in "Wrong body hash") +- fixed error if external message was viewed (but there is still a problem with IMAP attachments) +- fixed bug ("DKIM-Signature" header name was case sensitive) + +## 0.5.1 (2013-09-20) + +- added option to get DNS Servers from OS + +## 0.5.0 (2013-09-10) + +- added support of multiple DNS servers +- added optional saving of the result +- DNS Server not reachable no longer treated as a PERMFAIL +- added TEMPFAIL + +## 0.4.4 (2013-08-02) + +- changed how msgHdrViewOverlay.css is loaded + +## 0.4.3 (2013-07-27) + +- header highlighting now works with collapsed header from CompactHeader addon +- works now also if e-mail has LF line ending + +## 0.4.2 (2013-06-28) + +- fixed alignment of warning-icon in mac (by Nils Maier) + +## 0.4.1 (2013-06-28) + +- DKIM-Signature header field name now in same style as the others (by Nils Maier) +- fixed bug if message needs to be downloaded from IMAP server +- added German translation (by ionum) +- fixed relaxed canonicalization of a body with only empty lines (by ionum) +- small displaying changes in options + +## 0.4.0 (2013-06-09) + +- warnings are displayed +- added warning for + - Signature is expired + - Signature is in the future + - From is not in SDID + - From is not in AUID + - Signature key is small +- added option to treat testmode as warning, not as error +- added options for highlighting of From header +- added option to always show DKIM-Signature header field +- fixed relaxed body canonicalization for non trailing CRLF +- fixed parsing of Message canonicalization if only one algorithm is named +- added partial support of CNAME record type in DNS Library +- fix bug if nonexisting header field is signed +- fixed parsing of AUID + +## 0.3.3 (2013-05-31) + +- fixed issue with RSS feeds +- added debug info to rsasign-1.2.js + +## 0.3.2 (2013-05-30) + +- fixed regex pattern for SDID, Selector and local_part + +## 0.3.1 (2013-05-30) + +- fixed problem with CompactHeader addon + +## 0.3.0 (2013-05-29) + +- options dialog added +- body length tag was checked before canonicalization +- fixed simple body canonicalization for empty body or no trailing CRLF +- DNS, RSA, ... helper scripts now in DKIM_Verifier namespace + +## 0.2.2 (2013-05-22) + +- fixed regex pattern for domain_name ("." was not escaped) + +## 0.2.1 (2013-05-22) + +- query method was parsed wrong +- last header field was parsed wrong +- DNS exception now caught + +## 0.2 (2013-05-16) + +- check that from header is signed now included +- key record flags are no longer ignored +- Multiple Instances of a header Field are now supported +- encoding issue for body hash fixed + +## 0.1 (2013-05-13) + +- Initial release diff --git a/CHANGELOG.txt b/CHANGELOG.txt deleted file mode 100644 index 31f258a7..00000000 --- a/CHANGELOG.txt +++ /dev/null @@ -1,337 +0,0 @@ -2.2.1 [2021-04-08] ------------------- - - Added integration with Silvermel and Charamel themes for favicons (#254 by dodmi) - -Backports (by dodmi): - - Authentication-Results header: fixed parsing of version (#253) - - Authentication-Results header: fixed parsing of quoted SDID and AUID (#229, #234, #253) - - Authentication-Results header: fixed missing reason on fail resulting in error (#232, #252) - - Updated default rules and favicons (#255) - -2.2.0 [2020-01-19] ------------------- - - Authentication-Results header: fix relaxed parsing option and trailing ";" - - exposed option on how to treat weak keys. Default is now ignore (was warning since 2.1.0) (#174) - - fixed default text color for unsigned e-mail in dark theme if highlighting of From header is enabled (#181) - - libunbound resolver: add ability to explicitly load dependencies of libunbound (#170, #179) - - updated default rules and favicons (#165, #168, #169, #180) - -2.1.0 [2019-08-29] ------------------- - - Cryptographic Algorithm and Key Usage Update (RFC 8301, #141) - - updated default rules and favicons (#140, #145, #152, #157, #159) - - added Hungarian translation (by Óvári) (#164) - -2.0.1 [2019-01-18] ------------------- - - fixed signature verification in case the RSA key has an odd key length (#112) - - fixed DMARC heuristic (#125) - - fixed "*" not being recognized as valid Service Type in DKIM Keys (#134) - - changed update DKIM key button to now update the keys of all DKIM signatures in the e-mail - - Authentication-Results header: fixed mixed case results specified by older SPF specs resulting in a parsing error (#135) - - JSDNS: fixed a problem getting the default DNS servers on Windows (#116, #120) - - JSDNS: reduced default DNS server timeout from 10 to 5 seconds - - updated included third-party libraries - - updated default rules and favicons - -2.0.0 [2018-04-19] ------------------- - - now requires at least Thunderbird 52 - - added toolbar button and menuitem for sign rules - - added option to try to read non RFC compliant Authentication-Results header - - fixed incompatibility with Thunderbird 57/59/60 - - fixed favicons not being shown if the CardBook add-on is installed - - fixed "Add must be signed exception" button being disabled if wrong signer is only a warning - - updated default rules and favicons - -1.7.0 [2017-07-22] ------------------- - - libunbound resolver: added ability to specify multiple trust anchors - - libunbound resolver: added new root trust anchor (key tag 20326) - - updated default rules and favicons - -1.6.5 [2017-05-14] ------------------- - - added Japanese translation (by SAKURAI Kenichi) - - updated default rules - -1.6.4 [2017-02-09] ------------------- - - fixed saving of result with DNSSEC lock enabled - - fixed incompatibility with Thunderbird 52 and libunbound - - updated default rules and favicons - -1.6.3 [2016-11-20] ------------------- - - fixed incompatibility with Thunderbird 52 - - updated default rules and favicons - -1.6.2 [2016-10-24] ------------------- - - fixed incompatibility with Silvermel/Charamel - - fixed Problem with copied header fields - - updated default rules and favicons - -1.6.1 [2016-09-26] ------------------- - - fixed problem with old Thunderbird versions and sign rules - -1.6.0 [2016-09-25] ------------------- - - added option to indicate successful DNSSEC validation with a lock (enabled by default) - - added option to show the favicon of some known signing domains (enabled by default) - - added option to show the ARH result alongside the add-ons, instead of replacing it - - JSDNS: differentiate between a server error and an non existing DKIM key - - sign rules: ignore must be signed for outgoing messages - - sign rules: updated default rules - - fixed updating a DKIM key or marking it as secure via the "Other Actions" button - -1.5.1 [2016-06-11] ------------------- - - fixed verification for external messages - - sign rules: updated default rules - -1.5.0 [2016-05-17] ------------------- - - added option to enable/disable DKIM verification for each account - - JavaScript DNS library: added support to use a proxy - - sign rules: updated default rules (added firefox.com) - - DKIM key: empty, but existing DNS record is now treated as a missing key instead as an ill-formed one - - fixed installing problem if extensions.getAddons.cache.enabled is set to false (https://bugzilla.mozilla.org/show_bug.cgi?id=1187725) - -1.4.1 [2016-02-13] ------------------- - - fixed incompatibility with Thunderbird 46 - - Authentication-Results header: fixed trusting all authentication servers - -1.4.0 [2016-02-08] ------------------- - - simplified shown error reasons and added advanced option for detailed reasons - - Authentication-Results header: reading of the ARH can now be set for each account - - Authentication-Results header: added option to only trust specific authentication servers - - Authentication-Results header: continue verification if there is no DKIM result in the ARH header - - Authentication-Results header: allow also unknown property types to be compliant with RFC 7601 - - Authentication-Results header: fixed bug if ARH header exists, but no message authentication was done - - JavaScript DNS library: no longer get the DNS servers from deactivated interfaces under windows - - libunbound resolver: no longer blocks the UI of Thunderbird - - libunbound resolver: changing preferences no longer needs a restart - -1.3.6 [2015-09-13] ------------------- - - fixed error in parsing of Authentication-Results header - - added additional debugging calls - -1.3.5 [2015-07-11] ------------------- - - fixed bug if a header field body started with a ":" - -1.3.4 [2015-06-21] ------------------- - - added compatibility for Thunderbird 40 - -1.3.3 [2015-03-21] ------------------- - - fixed bug in the sorting of the results of multiple DKIM signatures - -1.3.2 [2015-02-21] ------------------- - - updated default sign rules - -1.3.1 [2014-12-10] ------------------- - - DNS errors in DMARC heuristic are now ignored (previously this resulted in an internal error) - - fixed error resulting in incompatibility with Thunderbird 36 - -1.3.0 [2014-12-08] ------------------- - - added option to treat ill-formed selector tag as as error/warning/nothing (default warning; previous behavior was error) - - added support for multiple signatures - - added option to read Authentication-Results header - - added French translation (by Christophe CHAUVET) - - - fixed problem with JavaScript DNS Resolver and long DKIM keys, resulting in error "Key couldn't be decoded" - - fixed incompatibility with compact headers add-on - -1.2.2 [2014-08-16] ------------------- - - added Chinese (Simplified) translation (by YFdyh000) - - fixed the showing of a wrong error reason in some cases of a bad RSA signature - -1.2.1 [2014-06-30] ------------------- - - fixed an issue in formated strings ("%S" was not replaced) - -1.2.0 [2014-06-25] ------------------- - - added option for sign rules to allow also subdomains of the SDIDs (enabled by default) - - fixed comparison of domains (was case sensitive) - - updated default sign rules - -1.1.2 [2014-05-08] ------------------- - - fixed error if e-mail is from a domain on the public suffix list (like "googlecode.com") - - updated default sign rules - -1.1.1 [2014-04-10] ------------------- - - fixed bug in use of libundboud (non existing domain was treated as server error; caused problems with DMARC) - -1.1.0 [2014-04-07] ------------------- - - added options for automatically added sign rules - - added option to use DMARC to heuristically determinate if an e-mail should be signed - - fixed sign rules being automatically added even if signRules are disabled - - fixed bug in getting DNS name server from OS under Linux/Mac (last line was not read) - -1.0.5 [2014-01-14] ------------------- - - added Italian translation (by Michele Locati) - - statusbarpanel and tooltip are now set to loading on reverify - - DKIM Keys and signers rules window can now be opened at the same time - -1.0.4 [2013-12-20] ------------------- - - fixed bug in an error message of the JavaScript DNS library - - added advanced options for the JavaScript DNS library useful in case of bad network connection (not available through GUI) - -1.0.3 [2013-12-12] ------------------- - - fixed bug in sign rules if from address contains capital letters - - fixed verification of unsigned e-mails which are marked as should be signed by sign rules - -1.0.2 [2013-11-22] ------------------- - - fixed internal error if sign rules are disabled - -1.0.1 [2013-11-22] ------------------- - - fixed DKIM_SIGWARNING_FROM_NOT_IN_SDID - -1.0.0 [2013-11-21] ------------------- - - added signers rules - - added key storing - - added libunbound as second DNS resolver (supports DNSSEC) - - from tooltip now also works if Thunderbird's status bar is disabled - - - fixed some patterns (A-z to A-Za-z, dkim_safe_char, qp_hdr_value) - - fixed pattern for note tag in DKIM key - - fixed bug in DKIM_SIGWARNING_FROM_NOT_IN_AUID - - validate tag list as specified in Section 3.2 of RFC 6376 - - now differentiation between missing and ill-formed tags - - added check that hash declared in DKIM-Signature is included in the hashs declared in the key record - - added check that the hash algorithm in the public key is the same as in the header - -0.6.3 [2013-10-13] ------------------- - - fixed bug for detection of configured DNS Servers in Windows - (if more then one DNS server was configured for an adapter) - -0.6.2 [2013-10-13] ------------------- - - fixed bug if "other actions" button of CompactHeader add-on toolbar is not included - -0.6.1 [2013-10-12] ------------------- - - better detection of configured DNS Servers in Windows - -0.6.0 [2013-09-26] ------------------- - - added option for displaying of header, status bar and tooltip for From header - - fixed false detection of DKIM_SIGERROR_DOMAIN_I - - made options height smaller - - fixed error in "simple" body canonicalization algorithm resulting in "Wrong body hash" - - fixed bug for mixed CRLF and LF EOLs in body (resulting in "Wrong body hash") - - fixed error if external message was viewed (but there is still a problem with IMAP attachments) - - fixed bug ("DKIM-Signature" header name was case sensitive) - -0.5.1 [2013-09-20] ------------------- - - added option to get DNS Servers from OS - -0.5.0 [2013-09-10] ------------------- - - added support of multiple DNS servers - - added optional saving of the result - - DNS Server not reachable no longer treated as a PERMFAIL - - added TEMPFAIL - -0.4.4 [2013-08-02] ------------------- - - changed how msgHdrViewOverlay.css is loaded - -0.4.3 [2013-07-27] ------------------- - - header highlighting now works with collapsed header from CompactHeader addon - - works now also if e-mail has LF line ending - -0.4.2 [2013-06-28] ------------------- - - fixed alignment of warning-icon in mac (by Nils Maier) - -0.4.1 [2013-06-28] ------------------- - - DKIM-Signature header field name now in same style as the others (by Nils Maier) - - fixed bug if message needs to be downloaded from IMAP server - - added German translation (by ionum) - - fixed relaxed canonicalization of a body with only empty lines (by ionum) - - small displaying changes in options - -0.4.0 [2013-06-09] ------------------- - - warnings are displayed - - added warning for - - Signature is expired - - Signature is in the future - - From is not in SDID - - From is not in AUID - - Signature key is small - - added option to treat testmode as warning, not as error - - added options for highlighting of From header - - added option to always show DKIM-Signature header field - - fixed relaxed body canonicalization for non trailing CRLF - - fixed parsing of Message canonicalization if only one algorithm is named - - added partial support of CNAME record type in DNS Library - - fix bug if nonexisting header field is signed - - fixed parsing of AUID - -0.3.3 [2013-05-31] ------------------- - - fixed issue with RSS feeds - - added debug info to rsasign-1.2.js - -0.3.2 [2013-05-30] ------------------- - - fixed regex pattern for SDID, Selector and local_part - -0.3.1 [2013-05-30] ------------------- - - fixed problem with CompactHeader addon - -0.3.0 [2013-05-29] ------------------- - - options dialog added - - body length tag was checked before canonicalization - - fixed simple body canonicalization for empty body or no trailing CRLF - - DNS, RSA, ... helper scripts now in DKIM_Verifier namespace - -0.2.2 [2013-05-22] ------------------- - - fixed regex pattern for domain_name ("." was not escaped) - -0.2.1 [2013-05-22] ------------------- - - query method was parsed wrong - - last header field was parsed wrong - - DNS exception now caught - -0.2 [2013-05-16] ----------------- - - check that from header is signed now included - - key record flags are no longer ignored - - Multiple Instances of a header Field are now supported - - encoding issue for body hash fixed - -0.1 [2013-05-13] ----------------- - - Initial release From a52350837fcdd92edaf32f72edb26ec36a0d094e Mon Sep 17 00:00:00 2001 From: lieser Date: Sun, 12 Nov 2023 18:20:04 +0100 Subject: [PATCH 2/2] Add script for packing add-on --- .vscode/tasks.json | 6 +- CHANGELOG.md | 4 + README.md | 36 ++- jsconfig.json | 1 + package-lock.json | 568 ++++++++++++++++++++++++++++++++++++++++- package.json | 7 +- scripts/.eslintrc.json | 9 + scripts/pack.js | 223 ++++++++++++++++ 8 files changed, 840 insertions(+), 14 deletions(-) create mode 100644 scripts/.eslintrc.json create mode 100644 scripts/pack.js diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 67bab21c..98a19824 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -5,8 +5,10 @@ "tasks": [ { "label": "Build xpi", - "type": "shell", - "command": "rm ./dkim_verifier@pl.xpi; & \\\"$($Env:ProgramFiles)/7-Zip/7z.exe\\\" a -tzip -mx1 dkim_verifier@pl.xpi ./chrome/ ./components/ ./data/ ./defaults/ '-i!modules/*.js' '-i!modules/*.jsm' ./CHANGELOG.txt ./chrome.manifest ./icon.png ./icon_32.png ./install.rdf ./LICENSE.txt ./README.md ./THIRDPARTY_LICENSE.txt", + "detail": "node ./scripts/pack.js", + "type": "npm", + "script": "pack", + "problemMatcher": [], "group": { "kind": "build", "isDefault": true diff --git a/CHANGELOG.md b/CHANGELOG.md index efb33819..3dec0fa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. +## Unreleased + +- TODO: List backports (by dodmi) + ## 2.2.1 (2021-04-08) - Added integration with Silvermel and Charamel themes for favicons (#254 by dodmi) diff --git a/README.md b/README.md index 9cb3504f..15c96f84 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,36 @@ -DKIM Verifier -============= +# DKIM Verifier This is an add-on for Mozilla Thunderbird that verifies DKIM signatures according to the RFC 6376. -More Information in the wiki at https://github.com/lieser/dkim_verifier/wiki +Usage information can be found in the wiki at . + +## Packing the Add-on + +This Add-on does not require any extra build steps. +All files in the repository are already in the format required by Thunderbird. +It only needs to be packed into an extension file. + +Thunderbird extensions are packed as normal zip files. +Often the file extension `.xpi` is used, +but this is not a requirement. + +### Manually + +You can simply use your favorite zip tool to pack the content of the extension. + +The required files are listed below under *Code structure*, +but for simplicity you can also pack the complete folder. +Just make sure the content is directly in the zip file and not in an extra root directory. + +### Using Node.js + +Requirements: + +- [Node.js](https://nodejs.org) +- [Git](https://git-scm.com/) (must be in the path environment variable) + +Run the following command to pack the extension: + +```bash +npm run pack +``` diff --git a/jsconfig.json b/jsconfig.json index c4a5b6c6..8c630eb6 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "module": "esnext", "target": "es2017", "lib": [ "es2017", diff --git a/package-lock.json b/package-lock.json index a560a9e4..96cd3dd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,10 +9,14 @@ "tweetnacl-es6": "1.0.3" }, "devDependencies": { + "@types/node": "^20.9.0", "eslint": "^8.53.0", "eslint-plugin-jsdoc": "^46.8.2", "eslint-plugin-mocha": "^10.2.0", "eslint-plugin-mozilla": "^3.2.0", + "globby": "^13.1.4", + "jszip": "^3.10.1", + "simple-git": "^3.20.0", "tsc-silent": "^1.2.2", "typescript": "^5.2.2" }, @@ -698,6 +702,21 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@kwsites/file-exists": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", + "integrity": "sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1" + } + }, + "node_modules/@kwsites/promise-deferred": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz", + "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==", + "dev": true + }, "node_modules/@microsoft/eslint-plugin-sdl": { "version": "0.2.1", "resolved": "git+ssh://git@github.com/mozfreddyb/eslint-plugin-sdl.git#17b22cd527682108af7a1a4edacf69cb7a9b4a06", @@ -1095,10 +1114,13 @@ } }, "node_modules/@types/node": { - "version": "10.12.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.7.tgz", - "integrity": "sha512-Zh5Z4kACfbeE8aAOYh9mqotRxaZMro8MbBQtR8vEXOMiZo2rGEh2LayJijKdlu48YnS6y2EFU/oo2NCe5P6jGw==", - "dev": true + "version": "20.9.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz", + "integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", @@ -1325,6 +1347,18 @@ "concat-map": "0.0.1" } }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/browserslist": { "version": "4.22.1", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", @@ -1488,6 +1522,12 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -1567,6 +1607,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -2215,6 +2267,34 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -2248,6 +2328,18 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -2460,6 +2552,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/globby": { + "version": "13.1.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.4.tgz", + "integrity": "sha512-iui/IiiW+QrJ1X1hKH5qwlMQyv34wJAYwH1vrf8b9kBA4sNiif3gKsMHa+BrdnOpEudWjpotfa7LrTzB1ERS/g==", + "dev": true, + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.11", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -2604,6 +2715,12 @@ "node": ">= 4" } }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", + "dev": true + }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -2805,6 +2922,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/is-number-object": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", @@ -3026,6 +3152,18 @@ "node": ">=4.0" } }, + "node_modules/jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "dev": true, + "dependencies": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -3048,6 +3186,15 @@ "node": ">= 0.8.0" } }, + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "dev": true, + "dependencies": { + "immediate": "~3.0.5" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -3104,6 +3251,28 @@ "yallist": "^3.0.2" } }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -3309,6 +3478,12 @@ "node": ">=6" } }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -3355,12 +3530,33 @@ "dev": true, "peer": true }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -3370,6 +3566,12 @@ "node": ">= 0.8.0" } }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, "node_modules/progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -3434,6 +3636,27 @@ "dev": true, "peer": true }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readable-stream/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, "node_modules/regenerator-runtime": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", @@ -3600,6 +3823,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/safe-regex": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", @@ -3695,6 +3924,12 @@ "node": ">= 0.4" } }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -3731,6 +3966,33 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/simple-git": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.20.0.tgz", + "integrity": "sha512-ozK8tl2hvLts8ijTs18iFruE+RoqmC/mqZhjs/+V7gS5W68JpJ3+FCTmLVqmR59MaUQ52MfGQuWsIqfsTbbJ0Q==", + "dev": true, + "dependencies": { + "@kwsites/file-exists": "^1.1.1", + "@kwsites/promise-deferred": "^1.1.1", + "debug": "^4.3.4" + }, + "funding": { + "type": "github", + "url": "https://github.com/steveukx/git-js?sponsor=1" + } + }, + "node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/slice-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", @@ -3778,6 +4040,15 @@ "dev": true, "peer": true }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -3966,6 +4237,18 @@ "node": ">=4" } }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, "node_modules/tsc-silent": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tsc-silent/-/tsc-silent-1.2.2.tgz", @@ -3986,6 +4269,12 @@ "yargs": "12 - 15" } }, + "node_modules/tsc-silent/node_modules/@types/node": { + "version": "10.12.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.7.tgz", + "integrity": "sha512-Zh5Z4kACfbeE8aAOYh9mqotRxaZMro8MbBQtR8vEXOMiZo2rGEh2LayJijKdlu48YnS6y2EFU/oo2NCe5P6jGw==", + "dev": true + }, "node_modules/tweetnacl-es6": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl-es6/-/tweetnacl-es6-1.0.3.tgz", @@ -4113,6 +4402,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "node_modules/update-browserslist-db": { "version": "1.0.13", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", @@ -4152,6 +4447,12 @@ "punycode": "^2.1.0" } }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, "node_modules/v8-compile-cache": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", @@ -4908,6 +5209,21 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "@kwsites/file-exists": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", + "integrity": "sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==", + "dev": true, + "requires": { + "debug": "^4.1.1" + } + }, + "@kwsites/promise-deferred": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz", + "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==", + "dev": true + }, "@microsoft/eslint-plugin-sdl": { "version": "git+ssh://git@github.com/mozfreddyb/eslint-plugin-sdl.git#17b22cd527682108af7a1a4edacf69cb7a9b4a06", "integrity": "sha512-OlvVvzLr/KI0FEnDhNNB69EU8EnU41+To9AO9Y45tzetJrTf+V8oSPAFnkUrmitdqY6+uDaCVJSZkfQLeBXwJA==", @@ -5227,10 +5543,13 @@ } }, "@types/node": { - "version": "10.12.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.7.tgz", - "integrity": "sha512-Zh5Z4kACfbeE8aAOYh9mqotRxaZMro8MbBQtR8vEXOMiZo2rGEh2LayJijKdlu48YnS6y2EFU/oo2NCe5P6jGw==", - "dev": true + "version": "20.9.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz", + "integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==", + "dev": true, + "requires": { + "undici-types": "~5.26.4" + } }, "@ungap/structured-clone": { "version": "1.2.0", @@ -5394,6 +5713,15 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, "browserslist": { "version": "4.22.1", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", @@ -5496,6 +5824,12 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true }, + "core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -5552,6 +5886,15 @@ "object-keys": "^1.1.1" } }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -6021,6 +6364,30 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } + } + }, "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -6051,6 +6418,15 @@ "flat-cache": "^3.0.4" } }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, "find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -6206,6 +6582,19 @@ "define-properties": "^1.1.3" } }, + "globby": { + "version": "13.1.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.4.tgz", + "integrity": "sha512-iui/IiiW+QrJ1X1hKH5qwlMQyv34wJAYwH1vrf8b9kBA4sNiif3gKsMHa+BrdnOpEudWjpotfa7LrTzB1ERS/g==", + "dev": true, + "requires": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.11", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^4.0.0" + } + }, "gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -6304,6 +6693,12 @@ "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true }, + "immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", + "dev": true + }, "import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -6445,6 +6840,12 @@ "dev": true, "peer": true }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, "is-number-object": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", @@ -6606,6 +7007,18 @@ "object.values": "^1.1.6" } }, + "jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "dev": true, + "requires": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, "keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -6625,6 +7038,15 @@ "type-check": "~0.4.0" } }, + "lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "dev": true, + "requires": { + "immediate": "~3.0.5" + } + }, "locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -6672,6 +7094,22 @@ "yallist": "^3.0.2" } }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -6826,6 +7264,12 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true + }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -6860,18 +7304,36 @@ "dev": true, "peer": true }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, "picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -6916,6 +7378,29 @@ "dev": true, "peer": true }, + "readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + } + } + }, "regenerator-runtime": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", @@ -7022,6 +7507,12 @@ "isarray": "^2.0.5" } }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "safe-regex": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", @@ -7101,6 +7592,12 @@ "has-property-descriptors": "^1.0.0" } }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true + }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -7128,6 +7625,23 @@ "object-inspect": "^1.9.0" } }, + "simple-git": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.20.0.tgz", + "integrity": "sha512-ozK8tl2hvLts8ijTs18iFruE+RoqmC/mqZhjs/+V7gS5W68JpJ3+FCTmLVqmR59MaUQ52MfGQuWsIqfsTbbJ0Q==", + "dev": true, + "requires": { + "@kwsites/file-exists": "^1.1.1", + "@kwsites/promise-deferred": "^1.1.1", + "debug": "^4.3.4" + } + }, + "slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true + }, "slice-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", @@ -7169,6 +7683,15 @@ "dev": true, "peer": true }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -7313,6 +7836,15 @@ "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "dev": true }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, "tsc-silent": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tsc-silent/-/tsc-silent-1.2.2.tgz", @@ -7321,6 +7853,14 @@ "requires": { "@types/node": "10.12.7", "yargs": "12 - 15" + }, + "dependencies": { + "@types/node": { + "version": "10.12.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.7.tgz", + "integrity": "sha512-Zh5Z4kACfbeE8aAOYh9mqotRxaZMro8MbBQtR8vEXOMiZo2rGEh2LayJijKdlu48YnS6y2EFU/oo2NCe5P6jGw==", + "dev": true + } } }, "tweetnacl-es6": { @@ -7413,6 +7953,12 @@ "which-boxed-primitive": "^1.0.2" } }, + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "update-browserslist-db": { "version": "1.0.13", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", @@ -7432,6 +7978,12 @@ "punycode": "^2.1.0" } }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, "v8-compile-cache": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", diff --git a/package.json b/package.json index a830cc78..c5307836 100644 --- a/package.json +++ b/package.json @@ -17,17 +17,22 @@ "scripts": { "lint": "eslint .", "lint:ci": "eslint --config .eslintrc-ci.json --max-warnings=0 .", - "checkJs": "tsc-silent --project jsconfig.json --suppress @/thirdparty/" + "checkJs": "tsc-silent --project jsconfig.json --suppress @/thirdparty/", + "pack": "node ./scripts/pack.js" }, "type": "module", "dependencies": { "tweetnacl-es6": "1.0.3" }, "devDependencies": { + "@types/node": "^20.9.0", "eslint": "^8.53.0", "eslint-plugin-jsdoc": "^46.8.2", "eslint-plugin-mocha": "^10.2.0", "eslint-plugin-mozilla": "^3.2.0", + "globby": "^13.1.4", + "jszip": "^3.10.1", + "simple-git": "^3.20.0", "tsc-silent": "^1.2.2", "typescript": "^5.2.2" }, diff --git a/scripts/.eslintrc.json b/scripts/.eslintrc.json new file mode 100644 index 00000000..554c46ae --- /dev/null +++ b/scripts/.eslintrc.json @@ -0,0 +1,9 @@ +{ + "env": { + "node": true + }, + "parserOptions": { + "ecmaVersion": 2022, + "sourceType": "module" + } +} diff --git a/scripts/pack.js b/scripts/pack.js new file mode 100644 index 00000000..9b474ba5 --- /dev/null +++ b/scripts/pack.js @@ -0,0 +1,223 @@ +/** + * Pack the extension into a xpi/zip file. + */ + +// @ts-check + +import JSZip from "jszip"; +import chalk from "chalk"; +import fs from "node:fs/promises"; +import { globby } from "globby"; +import { simpleGit } from "simple-git"; + +/** + * Get the date as a string in the form of `YYYY-MM-DD` + * + * @param {Date} date + * @returns {string} + */ +function dateToString(date) { + return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`; +} + +/** + * Collect all files that should be included in the packed extension. + * + * @returns {Promise} + */ +async function collectFiles() { + /** @type {string[]} */ + const files = []; + + files.push(...await globby("chrome", { + expandDirectories: { + extensions: [ + // content + "js", "xml", "xul", + // locale + "dtd", "properties", + // skin + "css", "png", + ], + } + })); + files.push(...await globby("components", { + expandDirectories: { + extensions: ["js"], + } + })); + files.push(...await globby("data", { expandDirectories: true })); + files.push(...await globby("defaults", { + expandDirectories: { + extensions: ["js"], + } + })); + files.push(...await globby("modules", { + expandDirectories: { + extensions: ["js"], + } + })); + files.push(...await globby("thirdparty", { expandDirectories: true })); + + files.push("CHANGELOG.md"); + files.push("chrome.manifest"); + files.push("icon.png"); + files.push("icon_32.png"); + files.push("install.rdf"); + files.push("LICENSE.txt"); + files.push("README.md"); + files.push("THIRDPARTY_LICENSE.txt"); + + return files; +} + +/** + * Check if the build is dirty. + * + * @param {string[]} files + * @returns {Promise} + */ +async function isDirty(files) { + const status = await simpleGit().status(["--ignored"]); + let dirty = false; + + const modifiedFiles = status.modified.filter(value => files.includes(value)); + if (modifiedFiles.length !== 0) { + dirty = true; + console.warn(chalk.red("Dirty build: some files are modified!")); + console.log("Included modified files:", modifiedFiles); + } + + const addedFiles = status.not_added.filter(value => files.includes(value)); + if (addedFiles.length !== 0) { + dirty = true; + console.warn(chalk.red("Dirty build: some untracked files are included!")); + console.log("Included untracked files:", addedFiles); + } + + const stagedFiles = status.staged.filter(value => files.includes(value)); + if (stagedFiles.length !== 0) { + dirty = true; + console.warn(chalk.red("Dirty build: some files are staged!")); + console.log("Included staged files:", stagedFiles); + } + + const ignoredFiles = status.ignored?.filter(value => files.includes(value)); + if (ignoredFiles && ignoredFiles.length !== 0) { + dirty = true; + console.warn(chalk.red("Dirty build: some ignored files are included!")); + console.log("Included ignored files:", ignoredFiles); + } + + return dirty; +} + +/** + * Get the archive name and date that should be used. + * + * @param {boolean} dirty + * @returns {Promise<[string, Date]>} + */ +async function createArchiveInfo(dirty) { + if (dirty) { + return ["dkim_verifier@pl.xpi", new Date()]; + } + + const changelog = await fs.readFile("CHANGELOG.md", { encoding: "utf8" }); + + if (changelog.includes("\n## Unreleased")) { + const commit = await simpleGit().log({ maxCount: 1 }); + const date = new Date(commit.latest?.date ?? new Date()); + const ShortHashLength = 7; + const shortHash = commit.latest?.hash.substring(0, ShortHashLength); + return [`dkim_verifier@pl-${dateToString(date)}-${shortHash}.xpi`, date]; + } + + let matchRes = changelog.match(/## (\S+) \((\S+)\)/); + if (!matchRes) { + throw new Error("Can not parse changelog"); + } + const [, changelogVersion, date] = matchRes; + if (!changelogVersion || !date) { + throw new Error("Can not parse changelog"); + } + const installRdf = await fs.readFile("install.rdf", "utf8"); + matchRes = installRdf.match(/(2.2.1)<\/em:version>/); + if (!matchRes) { + throw new Error("Can not parse install.rdf"); + } + const [, installRdfVersion] = matchRes; + if (changelogVersion !== installRdfVersion) { + throw new Error("Version in changelog doe not match manifest"); + } + return [`dkim_verifier-${changelogVersion}.xpi`, new Date(date)]; + +} + +/** + * Try to remove/rename old build. + * In Windows Thunderbird keeps a reference to an installed xpi, + * which results in errors if we try to remove it. + * + * @param {string} name + * @returns {Promise} + */ +async function removeOldBuild(name) { + const inUseName = "dkim_verifier_in_use@pl.xpi"; + + try { + await fs.rm(inUseName, { force: true }); + } catch (error) { + // ignore + } + + try { + await fs.rm(name, { force: true }); + } catch (error) { + // Sometimes if removing does not work, renaming does + fs.rename(name, inUseName); + await fs.rm(name, { force: true }); + } +} + +/** + * Pack the given files into a ZIP archive. + * + * @param {string[]} files + * @param {string} archiveName + * @param {Date} archiveDate + * @returns {Promise} + */ +async function packFiles(files, archiveName, archiveDate) { + /** + * Add a single file to a ZIP archive. + * + * @param {JSZip} zip + * @param {string} filePath + * @returns {void} + */ + function addFile(zip, filePath) { + zip.file(filePath, fs.readFile(filePath), { + date: archiveDate, + createFolders: false, + }); + } + + // Sort files to get deterministic output + files.sort(); + + const zip = new JSZip(); + files.forEach(file => addFile(zip, file)); + + fs.writeFile(archiveName, await zip.generateAsync({ + type: "nodebuffer", + compression: "DEFLATE", + })); +} + +const packedFiles = await collectFiles(); +const dirty = await isDirty(packedFiles); +const [archiveName, archiveDate] = await createArchiveInfo(dirty); +await removeOldBuild(archiveName); +await packFiles(packedFiles, archiveName, archiveDate); +console.info(`Created packed extension '${archiveName}'`);