diff options
author | LinuxWizard42 <computerwizard@linuxmail.org> | 2022-10-12 23:08:57 +0300 |
---|---|---|
committer | LinuxWizard42 <computerwizard@linuxmail.org> | 2022-10-12 23:08:57 +0300 |
commit | 726b81b19251674e149ccfbb1abacbd837fc6db0 (patch) | |
tree | fbdbb227dc01357eb76e8222d76185bc124c5ca6 /node_modules/electron-packager | |
parent | 34f0890e175698940d49238097579f44e4d78c89 (diff) | |
download | FlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.gz FlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.zst |
Removed files that should not have been included in git
Diffstat (limited to 'node_modules/electron-packager')
136 files changed, 0 insertions, 11746 deletions
diff --git a/node_modules/electron-packager/LICENSE b/node_modules/electron-packager/LICENSE deleted file mode 100644 index 3f64d56..0000000 --- a/node_modules/electron-packager/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2015 Max Ogden and other contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file diff --git a/node_modules/electron-packager/NEWS.md b/node_modules/electron-packager/NEWS.md deleted file mode 100644 index 91cb4c8..0000000 --- a/node_modules/electron-packager/NEWS.md +++ /dev/null @@ -1,944 +0,0 @@ -# Electron Packager: Changes by Version - -## [Unreleased] - -[Unreleased]: https://github.com/electron/electron-packager/compare/v16.0.0...main - -## [16.0.0] - 2022-08-23 - -[16.0.0]: https://github.com/electron/electron-packager/compare/v15.5.1...v16.0.0 - -### Fixed - -* Properly import info logger (#1405) - -### Changed - -* Bump `got` to 2.0.0 (#1397) - -### Removed - -* Node 12 support (#1399) - -## [15.5.2] - 2022-08-22 - -[15.5.2]: https://github.com/electron/electron-packager/compare/v15.5.1...v15.5.2 - -### Fixed - -* Package should not log info on `--quiet` flag -* Ignore `node_gyp_bins` directory if it exists - -## [15.5.1] - 2022-04-20 - -[15.5.1]: https://github.com/electron/electron-packager/compare/v15.5.0...v15.5.1 - -### Fixed - -* Univeral builds single-arch components are now built sequentially instead of in parallel to fix race conditions in hooks -* The typescript definition for HookFunction now correctly allows an error to be passed - -## [15.5.0] - 2022-04-19 - -[15.5.0]: https://github.com/electron/electron-packager/compare/v15.4.0...v15.5.0 - -### Added - -* New `universal` architecture supported when packaging for macOS to generate a universal app -* `osxUniveral` option to allow providing options to `@electron/universal` when packaging a universal app - -## [15.4.0] - 2021-09-10 - -[15.4.0]: https://github.com/electron/electron-packager/compare/v15.3.0...v15.4.0 - -### Added - -* `extendHelperInfo` option to allow extending helper app `Info.plist` files (#1233) -* Automatically insert `ElectronAsarIntegrity` into `Info.plist` files (#1279) - -### Fixed - -* Compatibility with `electron-notarize@^1.1.0` (#1278) - -## [15.3.0] - 2021-07-17 - -[15.3.0]: https://github.com/electron/electron-packager/compare/v15.2.0...v15.3.0 - -### Added - -* Bundled app validation to ensure that both `package.json` and the main entry point exist (#1257) -* Support for customizing Windows targets on darwin/arm64 (#1260) -* Support for customizing Windows targets on WSL without Wine installed (#1260) - -## [15.2.0] - 2020-12-04 - -[15.2.0]: https://github.com/electron/electron-packager/compare/v15.1.0...v15.2.0 - -### Added - -* Upgrade `electron-osx-sign` to 0.5.0 which adds a new option, `entitlementsForFile` (#1189) - -### Fixed - -* Add package manager lockfiles to default ignore list (#1182) -* Allow checking official builds against prerelease versions (#1191) - -## [15.1.0] - 2020-08-21 - -[15.1.0]: https://github.com/electron/electron-packager/compare/v15.0.0...v15.1.0 - -### Added - -* add darwin/arm64 and mas/arm64 as official platform/arch combinations (#1168) - -### Fixed - -* TypeScript: ensure `OsxNotarizeOptions` definition contains credentials (#1167) - -## [15.0.0] - 2020-06-27 - -[15.0.0]: https://github.com/electron/electron-packager/compare/v14.2.1...v15.0.0 - -### Added - -* mac: app API key notarization (#1127) -* TypeScript definition (#1131) - -### Changed - -* Replace `cross-zip` with `extract-zip` (#1139) - -### Removed - -* Node < 10 support (#1122) - -## [14.2.1] - 2020-02-07 - -[14.2.1]: https://github.com/electron/electron-packager/compare/v14.2.0...v14.2.1 - -### Fixed - -* mac: don't fail if the icon path doesn't exist (#1101) -* win32: correctly catch missing wine exceptions (#1117) - -## [14.2.0] - 2020-01-13 - -[14.2.0]: https://github.com/electron/electron-packager/compare/v14.1.1...v14.2.0 - -### Added - -* `electronZipDir` option (#1094) - -## [14.1.1] - 2019-11-19 - -[14.1.1]: https://github.com/electron/electron-packager/compare/v14.1.0...v14.1.1 - -### Fixed - -* Regression that caused the symlink test on Windows to not work as intended (#1071) -* Always initialize proxy support when running the CLI (#1077) -* Clarify the error message when infer cannot find a package.json file (#1079) -* Handle a missing inferred app version better (#1079) - -### Chores - -* Upgrade `electron-notarize` to `^0.2.0` (#1069) - -## [14.1.0] - 2019-10-28 - -[14.1.0]: https://github.com/electron/electron-packager/compare/v14.0.6...v14.1.0 - -### Added - -* (darwin/mas only) `usageDescription` option (#1049) -* Support for official win32/arm64 builds (#1053) - -## [14.0.6] - 2019-09-09 - -[14.0.6]: https://github.com/electron/electron-packager/compare/v14.0.5...v14.0.6 - -### Fixed - -* Send the properly formatted options from the CLI to electron-osx-sign (#1047) - -## [14.0.5] - 2019-08-28 - -[14.0.5]: https://github.com/electron/electron-packager/compare/v14.0.4...v14.0.5 - -### Fixed - -* Ensure that CFBundleExecutable and friends are correct for helper apps (#1046) - -## [14.0.4] - 2019-07-30 - -[14.0.4]: https://github.com/electron/electron-packager/compare/v14.0.3...v14.0.4 - -### Fixed - -* Packaging apps based on Electron >= 6.0.0 correctly renames and packages the new - Electron GPU Helper bundles (#1036) - -## [14.0.3] - 2019-07-18 - -[14.0.3]: https://github.com/electron/electron-packager/compare/v14.0.2...v14.0.3 - -### Fixed - -* Packaging Electron 6 based apps now correctly renames and packages the new - Electron Helper bundles (#1033) - -## [14.0.2] - 2019-07-18 - -[14.0.2]: https://github.com/electron/electron-packager/compare/v14.0.1...v14.0.2 - -### Fixed - -* Warn Windows 7 users of the unzip dependencies (#1030) - -## [14.0.1] - 2019-07-02 - -[14.0.1]: https://github.com/electron/electron-packager/compare/v14.0.0...v14.0.1 - -### Changed - -* Upgrade `fs-extra` to `^8.1.0` (#993) - -### Fixed - -* Host info shows OS release - -## [14.0.0] - 2019-06-20 - -[14.0.0]: https://github.com/electron/electron-packager/compare/v13.1.1...v14.0.0 - -### Added - -* Ignore system junk files by default (#1005) - -### Fixed - -* Handle inference when `electron-prebuilt-compile` points to a non-version (#978) - -### Changed - -* Replace `extract-zip` with `cross-zip` - on macOS/Linux, the `zip` binary is required; on Windows, - a relatively recent Powershell and .NET runtime is required, see `cross-zip` for details (#984) -* Convert from `electron-download` to `@electron/get` (#1002). Drops support for versions of Electron - < 1.3.2, plus all of the `download` options have changed, notably: - * `cache` is now `cacheRoot` - * `strictSSL` is now `rejectUnauthorized` - * The `mirror` URL string is now a set of options defined by `mirrorOptions` - * `quiet` is removed as the default downloader no longer has a progress bar -* Linux/ia32 support for Electron >= 4 is downgraded to a warning from `@electron/get` (#1016) - -### Removed - -* Node < 8 support (#973) - -## [13.1.1] - 2019-03-04 - -[13.1.1]: https://github.com/electron/electron-packager/compare/v13.1.0...v13.1.1 - -### Fixed - -* Linux/ia32 is no longer officially supported for Electron >= 4 (#957) - -## [13.1.0] - 2019-02-19 - -[13.1.0]: https://github.com/electron/electron-packager/compare/v13.0.1...v13.1.0 - -### Added - -* Support for inferring version from Electron nightlies (#931) - -### Fixed - -* Infer versions from `electron-prebuilt-compile` better (#932) -* Upgrade `asar` to `^1.0.0`, which removes a vulnerable transitive dependency (#952) - -## [13.0.1] - 2018-12-12 - -[13.0.1]: https://github.com/electron/electron-packager/compare/v13.0.0...v13.0.1 - -### Fixed - -* Ensure relative out dirs are correctly ignored when copying (#919) - -## [13.0.0] - 2018-12-04 - -[13.0.0]: https://github.com/electron/electron-packager/compare/v12.2.0...v13.0.0 - -### Added - -* `prebuiltAsar` option to specify a prebuilt ASAR file (#823) -* support for macOS Mojave app notarization (#899) - -### Changed - -* **Dropped support for running on Node < 6.0.** (#900) - -### Removed - -* Deprecated target arch APIs (#915) -* The callback version of the API (use `nodeify` if you need that syntax style) (#916) - -## [12.2.0] - 2018-10-02 - -[12.2.0]: https://github.com/electron/electron-packager/compare/v12.1.2...v12.2.0 - -### Added - -* darwinDarkModeSupport option to support macOS Mojave dark mode for older Electron versions (#893) - -### Fixed - -* Don't handle EH/NP Helpers if they don't exist (#894) - -## [12.1.2] - 2018-09-12 - -[12.1.2]: https://github.com/electron/electron-packager/compare/v12.1.1...v12.1.2 - -### Fixed - -* Prune user-namespaced modules (#889) - -## [12.1.1] - 2018-08-18 - -[12.1.1]: https://github.com/electron/electron-packager/compare/v12.1.0...v12.1.1 - -### Changed - -* Host arch utilities moved to electron-download. This is not a breaking change, as the existing API - has been kept the same. - -### Deprecated - -* `hostArch` and `unameArch` in `electron-packager/targets`, replaced with `host` and `uname` in - `electron-download/lib/arch`, respectively - -## [12.1.0] - 2018-05-18 - -[12.1.0]: https://github.com/electron/electron-packager/compare/v12.0.2...v12.1.0 - -### Added - -* `--version` shows the Packager/Node versions & host platform/arch (#841) - -### Fixed - -* `mips64el` arch is only available with Electron 1.8.x (#843) -* better detection of node modules (#847) - -## [12.0.2] - 2018-05-02 - -[12.0.2]: https://github.com/electron/electron-packager/compare/v12.0.1...v12.0.2 - -### Fixed - -* Support for Node 10 via the CLI (#835) - -### Deprecated - -* The callback version of the API (use `nodeify` if you need that syntax style) (#837) - -## [12.0.1] - 2018-04-10 - -[12.0.1]: https://github.com/electron/electron-packager/compare/v12.0.0...v12.0.1 - -### Fixed - -* Upgraded `galactus` to `^0.2.1` to fix a bug with relative paths - -## [12.0.0] - 2018-04-03 - -[12.0.0]: https://github.com/electron/electron-packager/compare/v11.2.0...v12.0.0 - -### Changed - -* `prune` exclusively utilizes the `galactus` module for pruning devDependencies, instead of - depending on package managers (#819) -* `electron-packager` is no longer ignored by default (#819) -* A warning is emitted when an Electron module is a production dependency (#819) - -### Removed - -* `packageManager` option (#819) - -## [11.2.1] - 2019-01-02 - -[11.2.1]: https://github.com/electron/electron-packager/compare/v11.2.0...v11.2.1 - -### Fixed - -* Don't handle EH/NP Helpers if they don't exist (Backport of #894) - -## [11.2.0] - 2018-03-24 - -[11.2.0]: https://github.com/electron/electron-packager/compare/v11.1.0...v11.2.0 - -### Added - -* Utility function to execute hooks serially (#814) - -## [11.1.0] - 2018-03-04 - -[11.1.0]: https://github.com/electron/electron-packager/compare/v11.0.1...v11.1.0 - -### Added - -* Support for MAS Login Helper (Electron 2.0.0-beta.1 and above) (#807) - -## [11.0.1] - 2018-02-12 - -[11.0.1]: https://github.com/electron/electron-packager/compare/v11.0.0...v11.0.1 - -### Fixed - -* `rcedit` module updated to 1.0.0, which fixes some bugs (#804) -* `--help` prints usage to stdout (#805) - -## [11.0.0] - 2018-02-06 - -[11.0.0]: https://github.com/electron/electron-packager/compare/v10.1.2...v11.0.0 - -### Added - -* `linux` platform, `mips64el` arch builds (Electron 1.8.2-beta.5 and above) (#800) - -### Changed - -* `all` or `platform=linux, arch=all` now include `arch=mips64el` if the Electron version specified - is 1.8.2-beta.5 or above (#800) - -## [10.1.2] - 2018-01-26 - -[10.1.2]: https://github.com/electron/electron-packager/compare/v10.1.1...v10.1.2 - -### Fixed - -* `overwrite: true` when no platform/arch is specified (#794) - -## [10.1.1] - 2018-01-02 - -[10.1.1]: https://github.com/electron/electron-packager/compare/v10.1.0...v10.1.1 - -### Fixed - -* ARM detection with prebuilt armv7l Node.js (#783) -* Don't create `yarn.lock` when pruning with Yarn (#784) - -## [10.1.0] - 2017-11-19 - -[10.1.0]: https://github.com/electron/electron-packager/compare/v10.0.0...v10.1.0 - -### Added - -* Option to set the executable name separate from the app name (#758) - -### Fixed - -* `mz` dependency (#759) - -## [10.0.0] - 2017-11-19 - -[10.0.0]: https://github.com/electron/electron-packager/compare/v9.1.0...v10.0.0 - -### Changed - -* Switch from `minimist` to `yargs-parser` (#732) -* Electron Packager only officially supports Node versions that are supported by the - NodeJS team (#747) -* Refactor to use `Promise`s internally. This has the side effect of somewhat parallelizing - building two or more targets at once and/or two or more functions for a given hook, via - `Promise.all` (#753) - -## [9.1.0] - 2017-09-15 - -[9.1.0]: https://github.com/electron/electron-packager/compare/v9.0.1...v9.1.0 - -### Added - -* `hostArch()` and `allOfficialArchsForPlatformAndVersion()` (#727) - -### Changed - -* CLI arguments with nonstandard argument values emit warnings (#722) - -### Deprecated - -* In the CLI, `--tmpdir=false` has been deprecated in favor of `--no-tmpdir` (#722) - -## [9.0.1] - 2017-09-02 - -[9.0.1]: https://github.com/electron/electron-packager/compare/v9.0.0...v9.0.1 - -### Fixed - -* Inferring `win32metadata.CompanyName` from `author` in `package.json` when it's an Object (#718) - -## [9.0.0] - 2017-08-23 - -[9.0.0]: https://github.com/electron/electron-packager/compare/v8.7.2...v9.0.0 - -### Added - -* API hook for afterPrune (#677) -* Package manager-agnostic pruning support (set `packageManager` to `false`) (#690) -* `linux` platform, `arm64` arch builds (Electron 1.8.0 and above) (#711) - -### Changed - -* Promise support for `packager` - function returns a Promise instead of the return value of the - callback (#658) -* `win32metadata.CompanyName` defaults to `author` name from nearest `package.json` (#667) -* `win32metadata.FileDescription` defaults to `productName` or `name` from - nearest `package.json` (#667) -* `win32metadata.OriginalFilename` defaults to renamed `.exe` (#667) -* `win32metadata.ProductName` defaults to `productName` or `name` from nearest `package.json` (#667) -* `win32metadata.InternalName` defaults to `productName` or `name` from - nearest `package.json` (#667) -* Warn when downloading from the official Electron releases and the arch/platform combination - specified is invalid (#562) -* Do not error out immediately if a `download.mirror` is specified and an unofficial arch/platform - is specified (#670) -* Allow spaces when specifying archs/platforms as a string, rather than an array (#487) -* The `extraResource` option works on all target platforms (#637) -* `all` or `platform=linux, arch=all` now include `arch=arm64` if the Electron version specified is - 1.8.0 or above (#711) - -### Fixed - -* `common.warning` for codesigning (#694) - -### Removed - -* `version` is removed in favor of `electronVersion` (CLI: `--electron-version`) (#665) -* `version-string` is removed in favor of `win32metadata` (#668) -* Options set via the JavaScript API formatted in kebab-case (i.e., with hyphens) are removed in - favor of their camelCase variants, per JavaScript naming standards (#669) - -## [8.7.2] - 2017-06-25 - -[8.7.2]: https://github.com/electron/electron-packager/compare/v8.7.1...v8.7.2 - -### Fixed - -* Stop yarn creating `.bin` folders when pruning (#678) - -## [8.7.1] - 2017-06-05 - -[8.7.1]: https://github.com/electron/electron-packager/compare/v8.7.0...v8.7.1 - -### Fixed - -* Usage docs for `win32metadata.application-manifest` and `win32metadata.requested-execution-level` - -## [8.7.0] - 2017-05-01 - -[8.7.0]: https://github.com/electron/electron-packager/compare/v8.6.0...v8.7.0 - -### Added - -* `packageManager` (`--package-manager` via CLI) option (#618) -* `win32metadata.application-manifest` option (#610) -* `win32metadata.requested-execution-level` option (#610) - -### Fixed - -* Support for `extract-zip` >= 1.6.1 - -## [8.6.0] - 2017-03-14 - -[8.6.0]: https://github.com/electron/electron-packager/compare/v8.5.2...v8.6.0 - -### Added - -* Limited support for electron-prebuilt-compile (#608) - -### Changed - -* Options formatted in kebab-case (i.e., with hyphens) are available in camelCase, per JavaScript naming standards (#580) -* rcedit upgraded to 0.8.0 - -### Deprecated - -* Options formatted in kebab-case (i.e., with hyphens) are deprecated in favor of their camelCase variants, per JavaScript naming standards (#580) - -## [8.5.2] - 2017-02-19 - -[8.5.2]: https://github.com/electron/electron-packager/compare/v8.5.1...v8.5.2 - -### Fixed - -* Prepend all warning messages with "WARNING:" (#593) -* Ignore the generated temporary directory on Linux (#596) -* Prevent app names from ending in " Helper" (#600) - -## [8.5.1] - 2017-01-22 - -[8.5.1]: https://github.com/electron/electron-packager/compare/v8.5.0...v8.5.1 - -### Fixed - -* Show CLI option when showing option deprecation message (#560) - -## [8.5.0] - 2017-01-10 - -[8.5.0]: https://github.com/electron/electron-packager/compare/v8.4.0...v8.5.0 - -### Added - -* `electronVersion` (`--electron-version` via CLI) option (#547) - -### Deprecated - -* `version` is deprecated in favor of `electronVersion` (`--electron-version` via CLI) (#547) - -## [8.4.0] - 2016-12-08 - -[8.4.0]: https://github.com/electron/electron-packager/compare/v8.3.0...v8.4.0 - -### Added - -* `quiet` option (#541) - -### Fixed - -* Better type checking when validating arch/platform (#534) - -## [8.3.0] - 2016-11-16 - -[8.3.0]: https://github.com/electron/electron-packager/compare/v8.2.0...v8.3.0 - -### Changed - -* Upgrade to electron-osx-sign 0.4.x (#384) - -### Fixed - -* Clarify symlink error message for Windows - -## [8.2.0] - 2016-10-29 - -[8.2.0]: https://github.com/electron/electron-packager/compare/v8.1.0...v8.2.0 - -### Added - -* Allow `extend-info` to specify an object instead of a filename (#510) - -### Fixed - -* Retrieving metadata from `package.json` by upgrading `get-package-info` (#505) -* Typo when using `extend-info` (#510) - -## [8.1.0] - 2016-09-30 - -[8.1.0]: https://github.com/electron/electron-packager/compare/v8.0.0...v8.1.0 - -### Added - -* `.o` and `.obj` files are ignored by default (#491) -* Electron downloads are now checked against their published checksums (#493) -* Documentation for `download.quiet` option to enable/disable progress bar (#494) -* The `build-version` property, when unspecified, now defaults to the - `app-version` property value on Windows (#501) - -## [8.0.0] - 2016-09-03 - -[8.0.0]: https://github.com/electron/electron-packager/compare/v7.7.0...v8.0.0 - -### Added - -* `win32metadata` option (#331, #463) -* `linux` platform, `armv7l` arch support (#106, #474) - -### Changed - -* `all` now includes the `linux` platform, `armv7l` arch combination -* Default the `platform` option to the host platform (#464) -* Default the `arch` option to the host arch (#36, #464) -* Default the `prune` option to `true` (#235, #472) - -### Fixed - -* Allow scoped package names as Electron app names - invalid characters are replaced with - hyphens (#308, #455) - -### Deprecated - -* `version-string` is deprecated in favor of `win32metadata` (#331, #463) - -### Removed - -* `asar-unpack` is removed in favor of `asar.unpack` -* `asar-unpack-dir` is removed in favor of `asar.unpackDir` -* `cache` is removed in favor of `download.cache` -* `strict-ssl` is removed in favor of `download.strictSSL` - -## [7.7.0] - 2016-08-20 - -[7.7.0]: https://github.com/electron/electron-packager/compare/v7.6.0...v7.7.0 - -### Added - -* The `package.json` `version` property is the default app version if `--app-version` is - unspecified (#449) - -### Changed - -* [darwin/mas] Explicitly disallow `osx-sign.binaries` (#459) - -## [7.6.0] - 2016-08-14 - -[7.6.0]: https://github.com/electron/electron-packager/compare/v7.5.1...v7.6.0 - -### Added - -* [API] hook for afterCopy (#448) -* [darwin/mas] Documentation for `protocol` and `protocol-name` options (#121, #450) - -### Changed - -* [CLI] Minimum Node version is enforced (#454) - -### Fixed - -* [CLI] ensure --out has either a string or null value (#442) -* Use `get-package-info` (again) to support finding prebuilt in parent directories (#445) - -## [7.5.1] - 2016-08-06 - -[7.5.1]: https://github.com/electron/electron-packager/compare/v7.5.0...v7.5.1 - -### Fixed - -* Resolve to absolute path when inferring app name/Electron version (#440) - -## [7.5.0] - 2016-08-04 - -[7.5.0]: https://github.com/electron/electron-packager/compare/v7.4.0...v7.5.0 - -### Added - -* Support the new `electron` package name (#435) - -## [7.4.0] - 2016-07-31 - -[7.4.0]: https://github.com/electron/electron-packager/compare/v7.3.0...v7.4.0 - -### Added - -* Basic debugging messages via the `debug` module - see CONTRIBUTING.md for usage (#433) - -### Changed - -* Clearer error message when inferring the app name and/or Electron version fails - -### Fixed - -* (Test) apps named "Electron" can be packaged successfully (#415) - -## [7.3.0] - 2016-07-10 - -[7.3.0]: https://github.com/electron/electron-packager/compare/v7.2.0...v7.3.0 - -### Added - -* `asar` options can be specified as an `Object` (via the API) or with dot notation (via the CLI) - - see the respective docs for details (#353, #417) - -### Deprecated - -* `asar-unpack` is deprecated in favor of `asar.unpack` (#417) -* `asar-unpack-dir` is deprecated in favor of `asar.unpackDir` (#417) - -## [7.2.0] - 2016-07-03 - -[7.2.0]: https://github.com/electron/electron-packager/compare/v7.1.0...v7.2.0 - -### Added - -* `derefSymlinks` option (#410) - -### Fixed - -* Clarified message when `wine` is not found (#357) - -## [7.1.0] - 2016-06-22 - -[7.1.0]: https://github.com/electron/electron-packager/compare/v7.0.4...v7.1.0 - -### Added - -* Add `afterExtract` hook (#354, #403) - -## [7.0.4] - 2016-06-14 - -[7.0.4]: https://github.com/electron/electron-packager/compare/v7.0.3...v7.0.4 - -### Fixed - -* Clarified app name/Electron version error message (#390) - -## [7.0.3] - 2016-05-31 - -[7.0.3]: https://github.com/electron/electron-packager/compare/v7.0.2...v7.0.3 - -### Changed - -* [contributors] Code contributions need to be validated in "strict" mode (#342, #351) - -### Fixed - -* CLI output truncated when using Node 6 (and possibly earlier) (#381) - -## [7.0.2] - 2016-05-18 - -[7.0.2]: https://github.com/electron/electron-packager/compare/v7.0.1...v7.0.2 - -### Fixed - -* The default `.git` ignore only ignores that directory (#344) -* Specifying the `download.strictSSL` CLI parameter no longer triggers a deprecation warning for - `strict-ssl` (#349) - -## [7.0.1] - 2016-04-21 - -[7.0.1]: https://github.com/electron/electron-packager/compare/v7.0.0...v7.0.1 - -### Fixed - -* Not specifying `strict-ssl` CLI parameter no longer triggers a deprecation warning (#335) - -## [7.0.0] - 2016-04-17 - -[7.0.0]: https://github.com/electron/electron-packager/compare/v6.0.2...v7.0.0 - -### Added - -* Add `download` parameter (#320) - -### Changed - -* **Dropped support for running on Node < 4.0.** (#319) - -### Fixed - -* `strict-ssl` (and by extension, `download.strictSSL`) defaults to `true`, as documented (#320) - -### Deprecated - -* `cache` is deprecated in favor of `download.cache` (#320) -* `strict-ssl` is deprecated in favor of `download.strictSSL` (#320) - -### Removed - -* [win32] `version-string.FileVersion` and `version-string.ProductVersion` are replaced by - favor of `app-version` and `build-version`, respectively (#327) -* [win32] `version-string.LegalCopyright` is replaced by `app-copyright` (#327) - -## [6.0.2] - 2016-04-09 - -[6.0.2]: https://github.com/electron/electron-packager/compare/v6.0.1...v6.0.2 - -### Changed - -* [win32] `rcedit` dependency updated to 0.5.x. **The DLL mentioned in the 6.0.1 release notes - is no longer required.** - -## [6.0.1] - 2016-04-08 - -[6.0.1]: https://github.com/electron/electron-packager/compare/v6.0.0...v6.0.1 - -### Changed - -* [win32] `rcedit` dependency updated to 0.4.x. **A new DLL is required to run the new version - of rcedit, please see [the documentation](https://github.com/electron/electron-packager/blob/main/README.md#building-windows-apps-from-non-windows-platforms) - for details** -* API documentation moved from readme.md to docs/api.md (#296) - -### Fixed - -* [darwin/mas] The OSX icon is properly replaced when Electron ≥ 0.37.4 is used (#301) -* `default_app.asar` is deleted during packaging (necessary when Electron ≥ 0.37.4 is used). - The `default_app` folder is still deleted for older Electron versions (#298, #311) - -## [6.0.0] - 2016-03-28 - -[6.0.0]: https://github.com/electron/electron-packager/compare/v5.2.1...v6.0.0 - -### Added - -* Add support for a new target platform, Mac App Store (`mas`), including signing OS X apps - (#223, #278) -* Add `app-copyright` parameter (#223) -* Add `tmpdir` parameter to specify a custom temp directory (#230); set to `false` to disable - using a temporary directory at all (#251, #276) -* Add `NEWS.md`, a human-readable list of changes in each version (since 5.2.0) (#263) - -### Changed - -* **The GitHub repository has been moved into an organization, - [electron-userland](https://github.com/electron-userland)** -* Allow the `ignore` parameter to take a function (#247) -* [contributors] Update Standard (JavaScript coding standard) package to 5.4.x -* [contributors] Add code coverage support via Coveralls (#257) -* Better docs around contributing to the project (#258) -* Ignore the directory specified by the `out` parameter by default (#255) -* [darwin/mas] Add support for merging arbitrary plist files and adding arbitrary resource - files (#253) -* Split out the code to sign OS X apps into a separate Node module, - [electron-osx-sign](https://github.com/electron-userland/electron-osx-sign) (#223) -* [darwin/mas] **BREAKING**: The `sign` parameter is now `osx-sign` (for better cross-platform - compatibility) and optionally takes several of the same sub-parameters as - electron-osx-sign (#286) - -### Deprecated - -* [win32] `version-string.LegalCopyright` is deprecated in favor of `app-copyright` (#268) - -### Fixed - -* [darwin/mas] Ensure `CFBundleVersion` and `CFBundleShortVersionString` are strings (#250) -* [darwin/mas] Correctly set the helper bundle ID in all relevant plist files (#223) -* [darwin/mas] OSX-specific binaries are correctly renamed to the application name (#244, #293) - - **If you are upgrading from ≤ 5.2.1 and building for a `darwin` target, you may experience problems. See #323 for details.** - -## [5.2.1] - 2016-01-17 - -[5.2.1]: https://github.com/electron/electron-packager/compare/v5.2.0...v5.2.1 - -### Changed - -* [win32] Add support for Windows for the `app-version` and `build-version` parameters (#229) -* If `appname` and/or `version` are omitted from the parameters, infer from `package.json` (#94) - -### Deprecated - -* [win32] `version-string.FileVersion` and `version-string.ProductVersion` are deprecated in - favor of `app-version` and `build-version`, respectively (#229) - -### Fixed - -* Remove `default_app` from built packages (#206) -* Add documentation for optional arguments (#226) -* [darwin] Don't declare helper app as a protocol handler (#220) - -## [5.2.0] - 2015-12-16 - -[5.2.0]: https://github.com/electron/electron-packager/compare/v5.1.1...v5.2.0 - -### Added - -* Add `asar-unpack-dir` parameter (#174) -* [darwin] Add `app-category-type` parameter (#202) -* Add `strict-ssl` parameter (#209) - -### Changed - -* Ignore `node_modules/.bin` by default (#189) - ----- - -For versions prior to 5.2.0, please see `git log`. diff --git a/node_modules/electron-packager/README.md b/node_modules/electron-packager/README.md deleted file mode 100644 index c380877..0000000 --- a/node_modules/electron-packager/README.md +++ /dev/null @@ -1,206 +0,0 @@ -# Electron Packager - -Package your [Electron](https://electronjs.org) app into OS-specific bundles (`.app`, `.exe`, etc.) via JavaScript or the command line. - -[](https://circleci.com/gh/electron/electron-packager/tree/main) -[](https://codecov.io/gh/electron/electron-packager) -[](https://npm.im/electron-packager) -[](https://discord.com/invite/APGC3k5yaH) - -[Supported Platforms](#supported-platforms) | -[Installation](#installation) | -[Usage](#usage) | -[API](https://electron.github.io/electron-packager/main/) | -[Contributing](https://github.com/electron/electron-packager/blob/main/CONTRIBUTING.md) | -[Support](https://github.com/electron/electron-packager/blob/main/SUPPORT.md) | -[Related Apps/Libraries](#related) | -[FAQ](https://github.com/electron/electron-packager/blob/main/docs/faq.md) | -[Release Notes](https://github.com/electron/electron-packager/blob/main/NEWS.md) - ----- - -## About - -Electron Packager is a command line tool and Node.js library that bundles Electron-based application -source code with a renamed Electron executable and supporting files into folders ready for distribution. - -For creating distributables like installers and Linux packages, consider using either [Electron -Forge](https://github.com/electron-userland/electron-forge) (which uses Electron Packager -internally), or one of the [related Electron tools](#distributable-creators), which utilizes -Electron Packager-created folders as a basis. - -Note that packaged Electron applications can be relatively large. A zipped, minimal Electron -application is approximately the same size as the zipped prebuilt binary for a given target -platform, target arch, and [Electron version](https://github.com/electron/electron/releases) -_(files named `electron-v${version}-${platform}-${arch}.zip`)_. - -## Supported Platforms - -Electron Packager is known to run on the following **host** platforms: - -* Windows (32/64 bit) -* macOS (formerly known as OS X) -* Linux (x86/x86_64) - -It generates executables/bundles for the following **target** platforms: - -* Windows (also known as `win32`, for x86, x86_64, and arm64 architectures) -* macOS (also known as `darwin`) / [Mac App Store](https://electronjs.org/docs/tutorial/mac-app-store-submission-guide/) (also known as `mas`)<sup>*</sup> (for x86_64, arm64, and universal architectures) -* Linux (for x86, x86_64, armv7l, arm64, and mips64el architectures) - -<sup>*</sup> *Note for macOS / Mac App Store target bundles: the `.app` bundle can only be signed when building on a host macOS platform.* - -## Installation - -This module requires Node.js 10.0 or higher to run. - -```sh -npm install --save-dev electron-packager -``` - -It is **not** recommended to install `electron-packager` globally. - -### Building Windows apps from non-Windows platforms - -Building an Electron app for the Windows target platform requires editing the `Electron.exe` file. -Currently, Electron Packager uses [`node-rcedit`](https://github.com/atom/node-rcedit) to accomplish -this. A Windows executable is bundled in that Node package and needs to be run in order for this -functionality to work, so on non-Windows host platforms (not including WSL), -[Wine](https://www.winehq.org/) 1.6 or later needs to be installed. On macOS, it is installable -via [Homebrew](http://brew.sh/). - -## Usage - -JavaScript API usage can be found in the [API documentation](https://electron.github.io/electron-packager/main/modules/electronpackager.html). - -### From the Command Line - -Running Electron Packager from the command line has this basic form: - -``` -npx electron-packager <sourcedir> <appname> --platform=<platform> --arch=<arch> [optional flags...] -``` - -**Note**: `npx` can be substituted for `yarn` or `npm exec` depending on what package manager and -the version you have installed. - -This will: - -- Find or download the correct release of Electron -- Use that version of Electron to create an app in `<out>/<appname>-<platform>-<arch>` *(this can be customized via an optional flag)* - -`--platform` and `--arch` can be omitted, in two cases: - -* If you specify `--all` instead, bundles for all valid combinations of target - platforms/architectures will be created. -* Otherwise, a single bundle for the host platform/architecture will be created. - -For an overview of the other optional flags, run `electron-packager --help` or see -[usage.txt](https://github.com/electron/electron-packager/blob/main/usage.txt). For -detailed descriptions, see the [API documentation](https://electron.github.io/electron-packager/main/modules/electronpackager.html). - -If `appname` is omitted, this will use the name specified by "productName" or "name" in the nearest package.json. - -**Characters in the Electron app name which are not allowed in all target platforms' filenames -(e.g., `/`), will be replaced by hyphens (`-`).** - -You should be able to launch the app on the platform you built for. If not, check your settings and try again. - -**Be careful** not to include `node_modules` you don't want into your final app. If you put them in -the `devDependencies` section of `package.json`, by default none of the modules related to those -dependencies will be copied in the app bundles. (This behavior can be turned off with the -`prune: false` API option or `--no-prune` CLI flag.) In addition, folders like `.git` and -`node_modules/.bin` will be ignored by default. You can use `--ignore` to ignore files and folders -via a regular expression (*not* a [glob pattern](https://en.wikipedia.org/wiki/Glob_%28programming%29)). -Examples include `--ignore=\.gitignore` or `--ignore="\.git(ignore|modules)"`. - -#### Example - -Let's assume that you have made an app based on the [electron-quick-start](https://github.com/electron/electron-quick-start) repository on a macOS host platform with the following file structure: - -``` -foobar -├── package.json -├── index.html -├── […other files, like the app's LICENSE…] -└── script.js -``` - -…and that the following is true: - -* `electron-packager` is installed locally -* `productName` in `package.json` has been set to `Foo Bar` -* The `electron` module is in the `devDependencies` section of `package.json`, and set to the exact version of `1.4.15`. -* `npm install` for the `Foo Bar` app has been run at least once - -When one runs the following command for the first time in the `foobar` directory: - -``` -npx electron-packager . -``` - -`electron-packager` will do the following: - -* Use the current directory for the `sourcedir` -* Infer the `appname` from the `productName` in `package.json` -* Infer the `appVersion` from the `version` in `package.json` -* Infer the `platform` and `arch` from the host, in this example, `darwin` platform and `x64` arch. -* Download the darwin x64 build of Electron 1.4.15 (and cache the downloads in `~/.electron`) -* Build the macOS `Foo Bar.app` -* Place `Foo Bar.app` in `foobar/Foo Bar-darwin-x64/` (since an `out` directory was not specified, it used the current working directory) - -The file structure now looks like: - -``` -foobar -├── Foo Bar-darwin-x64 -│  ├── Foo Bar.app -│  │  └── […Mac app contents…] -│ ├── LICENSE [the Electron license] -│ └── version -├── […other application bundles, like "Foo Bar-win32-x64" (sans quotes)…] -├── package.json -├── index.html -├── […other files, like the app's LICENSE…] -└── script.js -``` - -The `Foo Bar.app` folder generated can be executed by a system running macOS, which will start the packaged Electron app. This is also true of the Windows x64 build on a system running a new enough version of Windows for a 64-bit system (via `Foo Bar-win32-x64/Foo Bar.exe`), and so on. - -## Related - -- [Electron Forge](https://github.com/electron-userland/electron-forge) - creates, builds, and distributes modern Electron applications -- [electron-packager-interactive](https://github.com/Urucas/electron-packager-interactive) - an interactive CLI for electron-packager -- [grunt-electron](https://github.com/sindresorhus/grunt-electron) - grunt plugin for electron-packager - -### Distributable Creators - -* [electron-installer-zip](https://github.com/electron-userland/electron-installer-zip) - creates symlink-compatible ZIP files - -Windows: - -* [electron-winstaller](https://github.com/electron/windows-installer) - Squirrel.Windows-based installer from the Electron maintainers group -* [electron-windows-store](https://github.com/felixrieseberg/electron-windows-store) - creates an AppX package for the Windows Store -* [electron-wix-msi](https://github.com/felixrieseberg/electron-wix-msi) - creates traditional MSI installers -* [electron-installer-windows](https://github.com/electron-userland/electron-installer-windows) - alternative Squirrel.Windows-based installer - -macOS: - -* [electron-installer-dmg](https://github.com/electron-userland/electron-installer-dmg) - creates a DMG - -Linux: - -* [electron-installer-debian](https://github.com/electron-userland/electron-installer-debian) - creates a DEB file -* [electron-installer-redhat](https://github.com/electron-userland/electron-installer-redhat) - creates an RPM -* [electron-installer-flatpak](https://github.com/endlessm/electron-installer-flatpak) - creates a Flatpak file -* [electron-installer-snap](https://github.com/electron-userland/electron-installer-snap) - creates a Snap file - -### Plugins - -These Node modules utilize Electron Packager API hooks: - -- [electron-packager-languages](https://npm.im/electron-packager-languages) - sets the locales - available to Electron when packaged, which is used by the Mac App Store, among other places -- [electron-packager-plugin-non-proprietary-codecs-ffmpeg](https://www.npmjs.com/package/electron-packager-plugin-non-proprietary-codecs-ffmpeg) - replaces the normal version of FFmpeg in Electron with a version without proprietary codecs -- [electron-rebuild](https://github.com/electron/electron-rebuild) - rebuilds native Node.js modules - against the packaged Electron version diff --git a/node_modules/electron-packager/bin/electron-packager.js b/node_modules/electron-packager/bin/electron-packager.js deleted file mode 100755 index 5383e93..0000000 --- a/node_modules/electron-packager/bin/electron-packager.js +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env node - -'use strict' - -/* eslint-disable no-var */ -// WHY: not consts so that this file can load in Node < 4.0 -var packageJSON = require('../package.json') -var semver = require('semver') -if (!semver.satisfies(process.versions.node, packageJSON.engines.node)) { - console.error('CANNOT RUN WITH NODE ' + process.versions.node) - console.error('Electron Packager requires Node ' + packageJSON.engines.node + '.') - process.exit(1) -} - -var cli = require('../src/cli') -cli.run(process.argv.slice(2)) diff --git a/node_modules/electron-packager/collaborators.md b/node_modules/electron-packager/collaborators.md deleted file mode 100644 index 9ec9d1f..0000000 --- a/node_modules/electron-packager/collaborators.md +++ /dev/null @@ -1,8 +0,0 @@ -## Collaborators - -Electron Packager is only possible due to the excellent work of the following collaborators: - -* [malept](https://github.com/malept) (current primary maintainer) -* [maxogden](https://github.com/maxogden) (Creator & maintainer emeritus) - -and many others as shown in the [GitHub contributors graph](https://github.com/electron/electron-packager/graphs/contributors). diff --git a/node_modules/electron-packager/docs/api.md b/node_modules/electron-packager/docs/api.md deleted file mode 100644 index 0136885..0000000 --- a/node_modules/electron-packager/docs/api.md +++ /dev/null @@ -1 +0,0 @@ -[API Documentation](https://electron.github.io/electron-packager/) has moved. diff --git a/node_modules/electron-packager/docs/faq.md b/node_modules/electron-packager/docs/faq.md deleted file mode 100644 index 198cf94..0000000 --- a/node_modules/electron-packager/docs/faq.md +++ /dev/null @@ -1,50 +0,0 @@ -# Frequently Asked Questions - -## Why does the menubar appear when running in development mode, but disappear when packaged? - -**Note**: as of Electron 5, the menubar always appears, so this question is not relevant to -officially supported versions of Electron. - -Based on [a comment from **@MarshallOfSound**](https://github.com/electron/electron-packager/issues/553#issuecomment-270805213): - -When you're running in "development mode" (for example, `electron /path/to/app`), Electron uses the -`default_app` codepath to run your app, which also provides a default menubar. When the app is -packaged, Electron runs your app directly. To have a menubar that's consistent between development -and packaged modes, you'll need to [define it yourself](https://electronjs.org/docs/api/menu/). - -## Why isn't my `ignore` option working? - -As stated in the documentation for [`ignore`](https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html#ignore), it uses "[one] or more additional -[regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) -patterns. […] Please note that [glob patterns](https://en.wikipedia.org/wiki/Glob_%28programming%29) -will not work." - -## Why isn't the relative path in my app code working? - -To make a path work in both development and packaged mode, you'll need to generate a path based on -the location of the JavaScript file that is referencing the file. For example, if you had an app -structure like the following: - -``` -AppName -├── package.json -├── data -│  └── somedata.json -└── src -   └── main.js -``` - -In `src/main.js`, you would access `data/somedata.json` similar to this: - -```javascript -const path = require('path'); -const jsonFilename = path.resolve(__dirname, '..', 'data', 'somedata.json'); -console.log(require(jsonFilename)); -``` - -## How do I set an icon on Linux? - -The docs for [`icon`](https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html#icon) -already show how to set an icon on your `BrowserWindow`, but your dock/taskbar may not use that and -instead use the `Icon` value in your `.desktop` file. The [Linux distributable creators](https://github.com/electron/electron-packager#distributable-creators) -can help you set/distribute the appropriate icon in that case. diff --git a/node_modules/electron-packager/node_modules/.bin/extract-zip b/node_modules/electron-packager/node_modules/.bin/extract-zip deleted file mode 120000 index af9b561..0000000 --- a/node_modules/electron-packager/node_modules/.bin/extract-zip +++ /dev/null @@ -1 +0,0 @@ -../extract-zip/cli.js
\ No newline at end of file diff --git a/node_modules/electron-packager/node_modules/.bin/semver b/node_modules/electron-packager/node_modules/.bin/semver deleted file mode 120000 index 5aaadf4..0000000 --- a/node_modules/electron-packager/node_modules/.bin/semver +++ /dev/null @@ -1 +0,0 @@ -../semver/bin/semver.js
\ No newline at end of file diff --git a/node_modules/electron-packager/node_modules/debug/LICENSE b/node_modules/electron-packager/node_modules/debug/LICENSE deleted file mode 100644 index 1a9820e..0000000 --- a/node_modules/electron-packager/node_modules/debug/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -(The MIT License) - -Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> -Copyright (c) 2018-2021 Josh Junon - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the 'Software'), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT -LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/node_modules/electron-packager/node_modules/debug/README.md b/node_modules/electron-packager/node_modules/debug/README.md deleted file mode 100644 index e9c3e04..0000000 --- a/node_modules/electron-packager/node_modules/debug/README.md +++ /dev/null @@ -1,481 +0,0 @@ -# debug -[](https://travis-ci.org/debug-js/debug) [](https://coveralls.io/github/debug-js/debug?branch=master) [](https://visionmedia-community-slackin.now.sh/) [](#backers) -[](#sponsors) - -<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png"> - -A tiny JavaScript debugging utility modelled after Node.js core's debugging -technique. Works in Node.js and web browsers. - -## Installation - -```bash -$ npm install debug -``` - -## Usage - -`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. - -Example [_app.js_](./examples/node/app.js): - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %o', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example [_worker.js_](./examples/node/worker.js): - -```js -var a = require('debug')('worker:a') - , b = require('debug')('worker:b'); - -function work() { - a('doing lots of uninteresting work'); - setTimeout(work, Math.random() * 1000); -} - -work(); - -function workb() { - b('doing some work'); - setTimeout(workb, Math.random() * 2000); -} - -workb(); -``` - -The `DEBUG` environment variable is then used to enable these based on space or -comma-delimited names. - -Here are some examples: - -<img width="647" alt="screen shot 2017-08-08 at 12 53 04 pm" src="https://user-images.githubusercontent.com/71256/29091703-a6302cdc-7c38-11e7-8304-7c0b3bc600cd.png"> -<img width="647" alt="screen shot 2017-08-08 at 12 53 38 pm" src="https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png"> -<img width="647" alt="screen shot 2017-08-08 at 12 53 25 pm" src="https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png"> - -#### Windows command prompt notes - -##### CMD - -On Windows the environment variable is set using the `set` command. - -```cmd -set DEBUG=*,-not_this -``` - -Example: - -```cmd -set DEBUG=* & node app.js -``` - -##### PowerShell (VS Code default) - -PowerShell uses different syntax to set environment variables. - -```cmd -$env:DEBUG = "*,-not_this" -``` - -Example: - -```cmd -$env:DEBUG='app';node app.js -``` - -Then, run the program to be debugged as usual. - -npm script example: -```js - "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js", -``` - -## Namespace Colors - -Every debug instance has a color generated for it based on its namespace name. -This helps when visually parsing the debug output to identify which debug instance -a debug line belongs to. - -#### Node.js - -In Node.js, colors are enabled when stderr is a TTY. You also _should_ install -the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, -otherwise debug will only use a small handful of basic colors. - -<img width="521" src="https://user-images.githubusercontent.com/71256/29092181-47f6a9e6-7c3a-11e7-9a14-1928d8a711cd.png"> - -#### Web Browser - -Colors are also enabled on "Web Inspectors" that understand the `%c` formatting -option. These are WebKit web inspectors, Firefox ([since version -31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) -and the Firebug plugin for Firefox (any version). - -<img width="524" src="https://user-images.githubusercontent.com/71256/29092033-b65f9f2e-7c39-11e7-8e32-f6f0d8e865c1.png"> - - -## Millisecond diff - -When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - -<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png"> - -When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: - -<img width="647" src="https://user-images.githubusercontent.com/71256/29091956-6bd78372-7c39-11e7-8c55-c948396d6edd.png"> - - -## Conventions - -If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. - -## Wildcards - -The `*` character may be used as a wildcard. Suppose for example your library has -debuggers named "connect:bodyParser", "connect:compress", "connect:session", -instead of listing all three with -`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do -`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - -You can also exclude specific debuggers by prefixing them with a "-" character. -For example, `DEBUG=*,-connect:*` would include all debuggers except those -starting with "connect:". - -## Environment Variables - -When running through Node.js, you can set a few environment variables that will -change the behavior of the debug logging: - -| Name | Purpose | -|-----------|-------------------------------------------------| -| `DEBUG` | Enables/disables specific debugging namespaces. | -| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | -| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | -| `DEBUG_DEPTH` | Object inspection depth. | -| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | - - -__Note:__ The environment variables beginning with `DEBUG_` end up being -converted into an Options object that gets used with `%o`/`%O` formatters. -See the Node.js documentation for -[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) -for the complete list. - -## Formatters - -Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. -Below are the officially supported formatters: - -| Formatter | Representation | -|-----------|----------------| -| `%O` | Pretty-print an Object on multiple lines. | -| `%o` | Pretty-print an Object all on a single line. | -| `%s` | String. | -| `%d` | Number (both integer and float). | -| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | -| `%%` | Single percent sign ('%'). This does not consume an argument. | - - -### Custom formatters - -You can add custom formatters by extending the `debug.formatters` object. -For example, if you wanted to add support for rendering a Buffer as hex with -`%h`, you could do something like: - -```js -const createDebug = require('debug') -createDebug.formatters.h = (v) => { - return v.toString('hex') -} - -// …elsewhere -const debug = createDebug('foo') -debug('this is hex: %h', new Buffer('hello world')) -// foo this is hex: 68656c6c6f20776f726c6421 +0ms -``` - - -## Browser Support - -You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), -or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), -if you don't want to build it yourself. - -Debug's enable state is currently persisted by `localStorage`. -Consider the situation shown below where you have `worker:a` and `worker:b`, -and wish to debug both. You can enable this using `localStorage.debug`: - -```js -localStorage.debug = 'worker:*' -``` - -And then refresh the page. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - b('doing some work'); -}, 1200); -``` - -In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_. - -<img width="647" src="https://user-images.githubusercontent.com/7143133/152083257-29034707-c42c-4959-8add-3cee850e6fcf.png"> - -## Output streams - - By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: - -Example [_stdout.js_](./examples/node/stdout.js): - -```js -var debug = require('debug'); -var error = debug('app:error'); - -// by default stderr is used -error('goes to stderr!'); - -var log = debug('app:log'); -// set this namespace to log via console.log -log.log = console.log.bind(console); // don't forget to bind to console! -log('goes to stdout'); -error('still goes to stderr!'); - -// set all output to go via console.info -// overrides all per-namespace log settings -debug.log = console.info.bind(console); -error('now goes to stdout via console.info'); -log('still goes to stdout, but via console.info now'); -``` - -## Extend -You can simply extend debugger -```js -const log = require('debug')('auth'); - -//creates new debug instance with extended namespace -const logSign = log.extend('sign'); -const logLogin = log.extend('login'); - -log('hello'); // auth hello -logSign('hello'); //auth:sign hello -logLogin('hello'); //auth:login hello -``` - -## Set dynamically - -You can also enable debug dynamically by calling the `enable()` method : - -```js -let debug = require('debug'); - -console.log(1, debug.enabled('test')); - -debug.enable('test'); -console.log(2, debug.enabled('test')); - -debug.disable(); -console.log(3, debug.enabled('test')); - -``` - -print : -``` -1 false -2 true -3 false -``` - -Usage : -`enable(namespaces)` -`namespaces` can include modes separated by a colon and wildcards. - -Note that calling `enable()` completely overrides previously set DEBUG variable : - -``` -$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))' -=> false -``` - -`disable()` - -Will disable all namespaces. The functions returns the namespaces currently -enabled (and skipped). This can be useful if you want to disable debugging -temporarily without knowing what was enabled to begin with. - -For example: - -```js -let debug = require('debug'); -debug.enable('foo:*,-foo:bar'); -let namespaces = debug.disable(); -debug.enable(namespaces); -``` - -Note: There is no guarantee that the string will be identical to the initial -enable string, but semantically they will be identical. - -## Checking whether a debug target is enabled - -After you've created a debug instance, you can determine whether or not it is -enabled by checking the `enabled` property: - -```javascript -const debug = require('debug')('http'); - -if (debug.enabled) { - // do stuff... -} -``` - -You can also manually toggle this property to force the debug instance to be -enabled or disabled. - -## Usage in child processes - -Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process. -For example: - -```javascript -worker = fork(WORKER_WRAP_PATH, [workerPath], { - stdio: [ - /* stdin: */ 0, - /* stdout: */ 'pipe', - /* stderr: */ 'pipe', - 'ipc', - ], - env: Object.assign({}, process.env, { - DEBUG_COLORS: 1 // without this settings, colors won't be shown - }), -}); - -worker.stderr.pipe(process.stderr, { end: false }); -``` - - -## Authors - - - TJ Holowaychuk - - Nathan Rajlich - - Andrew Rhyne - - Josh Junon - -## Backers - -Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] - -<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a> -<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a> - - -## Sponsors - -Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] - -<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a> -<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a> - -## License - -(The MIT License) - -Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> -Copyright (c) 2018-2021 Josh Junon - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/electron-packager/node_modules/debug/package.json b/node_modules/electron-packager/node_modules/debug/package.json deleted file mode 100644 index 3bcdc24..0000000 --- a/node_modules/electron-packager/node_modules/debug/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "debug", - "version": "4.3.4", - "repository": { - "type": "git", - "url": "git://github.com/debug-js/debug.git" - }, - "description": "Lightweight debugging utility for Node.js and the browser", - "keywords": [ - "debug", - "log", - "debugger" - ], - "files": [ - "src", - "LICENSE", - "README.md" - ], - "author": "Josh Junon <josh.junon@protonmail.com>", - "contributors": [ - "TJ Holowaychuk <tj@vision-media.ca>", - "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)", - "Andrew Rhyne <rhyneandrew@gmail.com>" - ], - "license": "MIT", - "scripts": { - "lint": "xo", - "test": "npm run test:node && npm run test:browser && npm run lint", - "test:node": "istanbul cover _mocha -- test.js", - "test:browser": "karma start --single-run", - "test:coverage": "cat ./coverage/lcov.info | coveralls" - }, - "dependencies": { - "ms": "2.1.2" - }, - "devDependencies": { - "brfs": "^2.0.1", - "browserify": "^16.2.3", - "coveralls": "^3.0.2", - "istanbul": "^0.4.5", - "karma": "^3.1.4", - "karma-browserify": "^6.0.0", - "karma-chrome-launcher": "^2.2.0", - "karma-mocha": "^1.3.0", - "mocha": "^5.2.0", - "mocha-lcov-reporter": "^1.2.0", - "xo": "^0.23.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - }, - "main": "./src/index.js", - "browser": "./src/browser.js", - "engines": { - "node": ">=6.0" - } -} diff --git a/node_modules/electron-packager/node_modules/debug/src/browser.js b/node_modules/electron-packager/node_modules/debug/src/browser.js deleted file mode 100644 index cd0fc35..0000000 --- a/node_modules/electron-packager/node_modules/debug/src/browser.js +++ /dev/null @@ -1,269 +0,0 @@ -/* eslint-env browser */ - -/** - * This is the web browser implementation of `debug()`. - */ - -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = localstorage(); -exports.destroy = (() => { - let warned = false; - - return () => { - if (!warned) { - warned = true; - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - }; -})(); - -/** - * Colors. - */ - -exports.colors = [ - '#0000CC', - '#0000FF', - '#0033CC', - '#0033FF', - '#0066CC', - '#0066FF', - '#0099CC', - '#0099FF', - '#00CC00', - '#00CC33', - '#00CC66', - '#00CC99', - '#00CCCC', - '#00CCFF', - '#3300CC', - '#3300FF', - '#3333CC', - '#3333FF', - '#3366CC', - '#3366FF', - '#3399CC', - '#3399FF', - '#33CC00', - '#33CC33', - '#33CC66', - '#33CC99', - '#33CCCC', - '#33CCFF', - '#6600CC', - '#6600FF', - '#6633CC', - '#6633FF', - '#66CC00', - '#66CC33', - '#9900CC', - '#9900FF', - '#9933CC', - '#9933FF', - '#99CC00', - '#99CC33', - '#CC0000', - '#CC0033', - '#CC0066', - '#CC0099', - '#CC00CC', - '#CC00FF', - '#CC3300', - '#CC3333', - '#CC3366', - '#CC3399', - '#CC33CC', - '#CC33FF', - '#CC6600', - '#CC6633', - '#CC9900', - '#CC9933', - '#CCCC00', - '#CCCC33', - '#FF0000', - '#FF0033', - '#FF0066', - '#FF0099', - '#FF00CC', - '#FF00FF', - '#FF3300', - '#FF3333', - '#FF3366', - '#FF3399', - '#FF33CC', - '#FF33FF', - '#FF6600', - '#FF6633', - '#FF9900', - '#FF9933', - '#FFCC00', - '#FFCC33' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -// eslint-disable-next-line complexity -function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { - return true; - } - - // Internet Explorer and Edge do not support colors. - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - - // Is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || - // Is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || - // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || - // Double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); -} - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs(args) { - args[0] = (this.useColors ? '%c' : '') + - this.namespace + - (this.useColors ? ' %c' : ' ') + - args[0] + - (this.useColors ? '%c ' : ' ') + - '+' + module.exports.humanize(this.diff); - - if (!this.useColors) { - return; - } - - const c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit'); - - // The final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, match => { - if (match === '%%') { - return; - } - index++; - if (match === '%c') { - // We only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); -} - -/** - * Invokes `console.debug()` when available. - * No-op when `console.debug` is not a "function". - * If `console.debug` is not available, falls back - * to `console.log`. - * - * @api public - */ -exports.log = console.debug || console.log || (() => {}); - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem('debug', namespaces); - } else { - exports.storage.removeItem('debug'); - } - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ -function load() { - let r; - try { - r = exports.storage.getItem('debug'); - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } - - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - if (!r && typeof process !== 'undefined' && 'env' in process) { - r = process.env.DEBUG; - } - - return r; -} - -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - -function localstorage() { - try { - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context - // The Browser also has localStorage in the global context. - return localStorage; - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} - -module.exports = require('./common')(exports); - -const {formatters} = module.exports; - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -formatters.j = function (v) { - try { - return JSON.stringify(v); - } catch (error) { - return '[UnexpectedJSONParseError]: ' + error.message; - } -}; diff --git a/node_modules/electron-packager/node_modules/debug/src/common.js b/node_modules/electron-packager/node_modules/debug/src/common.js deleted file mode 100644 index e3291b2..0000000 --- a/node_modules/electron-packager/node_modules/debug/src/common.js +++ /dev/null @@ -1,274 +0,0 @@ - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - */ - -function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require('ms'); - createDebug.destroy = destroy; - - Object.keys(env).forEach(key => { - createDebug[key] = env[key]; - }); - - /** - * The currently active debug mode names, and names to skip. - */ - - createDebug.names = []; - createDebug.skips = []; - - /** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - createDebug.formatters = {}; - - /** - * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the debug instance to be colored - * @return {Number|String} An ANSI color code for the given namespace - * @api private - */ - function selectColor(namespace) { - let hash = 0; - - for (let i = 0; i < namespace.length; i++) { - hash = ((hash << 5) - hash) + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } - - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - - /** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - - function debug(...args) { - // Disabled? - if (!debug.enabled) { - return; - } - - const self = debug; - - // Set `diff` timestamp - const curr = Number(new Date()); - const ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - args[0] = createDebug.coerce(args[0]); - - if (typeof args[0] !== 'string') { - // Anything else let's inspect with %O - args.unshift('%O'); - } - - // Apply any `formatters` transformations - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return '%'; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === 'function') { - const val = args[index]; - match = formatter.call(self, val); - - // Now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - // Apply env-specific formatting (colors, etc.) - createDebug.formatArgs.call(self, args); - - const logFn = self.log || createDebug.log; - logFn.apply(self, args); - } - - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend; - debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. - - Object.defineProperty(debug, 'enabled', { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - - return enabledCache; - }, - set: v => { - enableOverride = v; - } - }); - - // Env-specific initialization logic for debug instances - if (typeof createDebug.init === 'function') { - createDebug.init(debug); - } - - return debug; - } - - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - - /** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - - createDebug.names = []; - createDebug.skips = []; - - let i; - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - const len = split.length; - - for (i = 0; i < len; i++) { - if (!split[i]) { - // ignore empty strings - continue; - } - - namespaces = split[i].replace(/\*/g, '.*?'); - - if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); - } else { - createDebug.names.push(new RegExp('^' + namespaces + '$')); - } - } - } - - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - function disable() { - const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) - ].join(','); - createDebug.enable(''); - return namespaces; - } - - /** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - function enabled(name) { - if (name[name.length - 1] === '*') { - return true; - } - - let i; - let len; - - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } - - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } - - return false; - } - - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - function toNamespace(regexp) { - return regexp.toString() - .substring(2, regexp.toString().length - 2) - .replace(/\.\*\?$/, '*'); - } - - /** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - - /** - * XXX DO NOT USE. This is a temporary stub function. - * XXX It WILL be removed in the next major release. - */ - function destroy() { - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - - createDebug.enable(createDebug.load()); - - return createDebug; -} - -module.exports = setup; diff --git a/node_modules/electron-packager/node_modules/debug/src/index.js b/node_modules/electron-packager/node_modules/debug/src/index.js deleted file mode 100644 index bf4c57f..0000000 --- a/node_modules/electron-packager/node_modules/debug/src/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Detect Electron renderer / nwjs process, which is node, but we should - * treat as a browser. - */ - -if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { - module.exports = require('./browser.js'); -} else { - module.exports = require('./node.js'); -} diff --git a/node_modules/electron-packager/node_modules/debug/src/node.js b/node_modules/electron-packager/node_modules/debug/src/node.js deleted file mode 100644 index 79bc085..0000000 --- a/node_modules/electron-packager/node_modules/debug/src/node.js +++ /dev/null @@ -1,263 +0,0 @@ -/** - * Module dependencies. - */ - -const tty = require('tty'); -const util = require('util'); - -/** - * This is the Node.js implementation of `debug()`. - */ - -exports.init = init; -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.destroy = util.deprecate( - () => {}, - 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' -); - -/** - * Colors. - */ - -exports.colors = [6, 2, 3, 4, 5, 1]; - -try { - // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) - // eslint-disable-next-line import/no-extraneous-dependencies - const supportsColor = require('supports-color'); - - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } -} catch (error) { - // Swallow - we only care if `supports-color` is available; it doesn't have to be. -} - -/** - * Build up the default `inspectOpts` object from the environment variables. - * - * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js - */ - -exports.inspectOpts = Object.keys(process.env).filter(key => { - return /^debug_/i.test(key); -}).reduce((obj, key) => { - // Camel-case - const prop = key - .substring(6) - .toLowerCase() - .replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); - - // Coerce string value into JS value - let val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === 'null') { - val = null; - } else { - val = Number(val); - } - - obj[prop] = val; - return obj; -}, {}); - -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ - -function useColors() { - return 'colors' in exports.inspectOpts ? - Boolean(exports.inspectOpts.colors) : - tty.isatty(process.stderr.fd); -} - -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ - -function formatArgs(args) { - const {namespace: name, useColors} = this; - - if (useColors) { - const c = this.color; - const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); - const prefix = ` ${colorCode};1m${name} \u001B[0m`; - - args[0] = prefix + args[0].split('\n').join('\n' + prefix); - args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); - } else { - args[0] = getDate() + name + ' ' + args[0]; - } -} - -function getDate() { - if (exports.inspectOpts.hideDate) { - return ''; - } - return new Date().toISOString() + ' '; -} - -/** - * Invokes `util.format()` with the specified arguments and writes to stderr. - */ - -function log(...args) { - return process.stderr.write(util.format(...args) + '\n'); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - return process.env.DEBUG; -} - -/** - * Init logic for `debug` instances. - * - * Create a new `inspectOpts` object in case `useColors` is set - * differently for a particular `debug` instance. - */ - -function init(debug) { - debug.inspectOpts = {}; - - const keys = Object.keys(exports.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } -} - -module.exports = require('./common')(exports); - -const {formatters} = module.exports; - -/** - * Map %o to `util.inspect()`, all on a single line. - */ - -formatters.o = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts) - .split('\n') - .map(str => str.trim()) - .join(' '); -}; - -/** - * Map %O to `util.inspect()`, allowing multiple lines if needed. - */ - -formatters.O = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); -}; diff --git a/node_modules/electron-packager/node_modules/extract-zip/LICENSE b/node_modules/electron-packager/node_modules/extract-zip/LICENSE deleted file mode 100644 index 2921069..0000000 --- a/node_modules/electron-packager/node_modules/extract-zip/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2014 Max Ogden and other contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/electron-packager/node_modules/extract-zip/cli.js b/node_modules/electron-packager/node_modules/extract-zip/cli.js deleted file mode 100755 index b594016..0000000 --- a/node_modules/electron-packager/node_modules/extract-zip/cli.js +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env node - -/* eslint-disable no-process-exit */ - -var extract = require('./') - -var args = process.argv.slice(2) -var source = args[0] -var dest = args[1] || process.cwd() -if (!source) { - console.error('Usage: extract-zip foo.zip <targetDirectory>') - process.exit(1) -} - -extract(source, { dir: dest }) - .catch(function (err) { - console.error('error!', err) - process.exit(1) - }) diff --git a/node_modules/electron-packager/node_modules/extract-zip/index.d.ts b/node_modules/electron-packager/node_modules/extract-zip/index.d.ts deleted file mode 100644 index 6dbcc80..0000000 --- a/node_modules/electron-packager/node_modules/extract-zip/index.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Based on the type definitions for extract-zip 1.6 -// Definitions by: Mizunashi Mana <https://github.com/mizunashi-mana> -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/e69b58e/types/extract-zip/index.d.ts - -import { Entry, ZipFile } from 'yauzl'; - -declare namespace extract { - interface Options { - dir: string; - defaultDirMode?: number; - defaultFileMode?: number; - onEntry?: (entry: Entry, zipfile: ZipFile) => void; - } -} - -declare function extract( - zipPath: string, - opts: extract.Options, -): Promise<void>; - -export = extract; diff --git a/node_modules/electron-packager/node_modules/extract-zip/index.js b/node_modules/electron-packager/node_modules/extract-zip/index.js deleted file mode 100644 index 23384ea..0000000 --- a/node_modules/electron-packager/node_modules/extract-zip/index.js +++ /dev/null @@ -1,173 +0,0 @@ -const debug = require('debug')('extract-zip') -// eslint-disable-next-line node/no-unsupported-features/node-builtins -const { createWriteStream, promises: fs } = require('fs') -const getStream = require('get-stream') -const path = require('path') -const { promisify } = require('util') -const stream = require('stream') -const yauzl = require('yauzl') - -const openZip = promisify(yauzl.open) -const pipeline = promisify(stream.pipeline) - -class Extractor { - constructor (zipPath, opts) { - this.zipPath = zipPath - this.opts = opts - } - - async extract () { - debug('opening', this.zipPath, 'with opts', this.opts) - - this.zipfile = await openZip(this.zipPath, { lazyEntries: true }) - this.canceled = false - - return new Promise((resolve, reject) => { - this.zipfile.on('error', err => { - this.canceled = true - reject(err) - }) - this.zipfile.readEntry() - - this.zipfile.on('close', () => { - if (!this.canceled) { - debug('zip extraction complete') - resolve() - } - }) - - this.zipfile.on('entry', async entry => { - /* istanbul ignore if */ - if (this.canceled) { - debug('skipping entry', entry.fileName, { cancelled: this.canceled }) - return - } - - debug('zipfile entry', entry.fileName) - - if (entry.fileName.startsWith('__MACOSX/')) { - this.zipfile.readEntry() - return - } - - const destDir = path.dirname(path.join(this.opts.dir, entry.fileName)) - - try { - await fs.mkdir(destDir, { recursive: true }) - - const canonicalDestDir = await fs.realpath(destDir) - const relativeDestDir = path.relative(this.opts.dir, canonicalDestDir) - - if (relativeDestDir.split(path.sep).includes('..')) { - throw new Error(`Out of bound path "${canonicalDestDir}" found while processing file ${entry.fileName}`) - } - - await this.extractEntry(entry) - debug('finished processing', entry.fileName) - this.zipfile.readEntry() - } catch (err) { - this.canceled = true - this.zipfile.close() - reject(err) - } - }) - }) - } - - async extractEntry (entry) { - /* istanbul ignore if */ - if (this.canceled) { - debug('skipping entry extraction', entry.fileName, { cancelled: this.canceled }) - return - } - - if (this.opts.onEntry) { - this.opts.onEntry(entry, this.zipfile) - } - - const dest = path.join(this.opts.dir, entry.fileName) - - // convert external file attr int into a fs stat mode int - const mode = (entry.externalFileAttributes >> 16) & 0xFFFF - // check if it's a symlink or dir (using stat mode constants) - const IFMT = 61440 - const IFDIR = 16384 - const IFLNK = 40960 - const symlink = (mode & IFMT) === IFLNK - let isDir = (mode & IFMT) === IFDIR - - // Failsafe, borrowed from jsZip - if (!isDir && entry.fileName.endsWith('/')) { - isDir = true - } - - // check for windows weird way of specifying a directory - // https://github.com/maxogden/extract-zip/issues/13#issuecomment-154494566 - const madeBy = entry.versionMadeBy >> 8 - if (!isDir) isDir = (madeBy === 0 && entry.externalFileAttributes === 16) - - debug('extracting entry', { filename: entry.fileName, isDir: isDir, isSymlink: symlink }) - - const procMode = this.getExtractedMode(mode, isDir) & 0o777 - - // always ensure folders are created - const destDir = isDir ? dest : path.dirname(dest) - - const mkdirOptions = { recursive: true } - if (isDir) { - mkdirOptions.mode = procMode - } - debug('mkdir', { dir: destDir, ...mkdirOptions }) - await fs.mkdir(destDir, mkdirOptions) - if (isDir) return - - debug('opening read stream', dest) - const readStream = await promisify(this.zipfile.openReadStream.bind(this.zipfile))(entry) - - if (symlink) { - const link = await getStream(readStream) - debug('creating symlink', link, dest) - await fs.symlink(link, dest) - } else { - await pipeline(readStream, createWriteStream(dest, { mode: procMode })) - } - } - - getExtractedMode (entryMode, isDir) { - let mode = entryMode - // Set defaults, if necessary - if (mode === 0) { - if (isDir) { - if (this.opts.defaultDirMode) { - mode = parseInt(this.opts.defaultDirMode, 10) - } - - if (!mode) { - mode = 0o755 - } - } else { - if (this.opts.defaultFileMode) { - mode = parseInt(this.opts.defaultFileMode, 10) - } - - if (!mode) { - mode = 0o644 - } - } - } - - return mode - } -} - -module.exports = async function (zipPath, opts) { - debug('creating target directory', opts.dir) - - if (!path.isAbsolute(opts.dir)) { - throw new Error('Target directory is expected to be absolute') - } - - await fs.mkdir(opts.dir, { recursive: true }) - opts.dir = await fs.realpath(opts.dir) - return new Extractor(zipPath, opts).extract() -} diff --git a/node_modules/electron-packager/node_modules/extract-zip/package.json b/node_modules/electron-packager/node_modules/extract-zip/package.json deleted file mode 100644 index f59a35a..0000000 --- a/node_modules/electron-packager/node_modules/extract-zip/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "name": "extract-zip", - "version": "2.0.1", - "description": "unzip a zip file into a directory using 100% javascript", - "main": "index.js", - "types": "index.d.ts", - "bin": { - "extract-zip": "cli.js" - }, - "scripts": { - "ava": "ava", - "coverage": "nyc ava", - "lint": "yarn lint:js && yarn lint:ts && yarn tsd", - "lint:js": "eslint .", - "lint:ts": "eslint --config .eslintrc.typescript.js --ext .ts .", - "test": "yarn lint && ava", - "tsd": "tsd" - }, - "files": [ - "cli.js", - "index.d.ts" - ], - "author": "max ogden", - "license": "BSD-2-Clause", - "repository": "maxogden/extract-zip", - "keywords": [ - "unzip", - "zip", - "extract" - ], - "engines": { - "node": ">= 10.17.0" - }, - "dependencies": { - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" - }, - "optionalDependencies": { - "@types/yauzl": "^2.9.1" - }, - "devDependencies": { - "@typescript-eslint/eslint-plugin": "^3.2.0", - "@typescript-eslint/parser": "^3.2.0", - "ava": "^3.5.1", - "eslint": "^7.2.0", - "eslint-config-standard": "^14.1.1", - "eslint-plugin-ava": "^10.2.0", - "eslint-plugin-import": "^2.20.1", - "eslint-plugin-node": "^11.0.0", - "eslint-plugin-promise": "^4.2.1", - "eslint-plugin-standard": "^4.0.1", - "fs-extra": "^9.0.0", - "husky": "^4.2.3", - "lint-staged": "^10.0.9", - "nyc": "^15.0.0", - "tsd": "^0.11.0", - "typescript": "^3.8.3" - }, - "eslintConfig": { - "extends": [ - "eslint:recommended", - "plugin:ava/recommended", - "plugin:import/errors", - "plugin:import/warnings", - "plugin:node/recommended", - "plugin:promise/recommended", - "standard" - ] - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } - }, - "lint-staged": { - "*.js": "yarn lint:js --fix", - "*.ts": "yarn lint:ts --fix" - } -} diff --git a/node_modules/electron-packager/node_modules/extract-zip/readme.md b/node_modules/electron-packager/node_modules/extract-zip/readme.md deleted file mode 100644 index 4ee7108..0000000 --- a/node_modules/electron-packager/node_modules/extract-zip/readme.md +++ /dev/null @@ -1,57 +0,0 @@ -# extract-zip - -Unzip written in pure JavaScript. Extracts a zip into a directory. Available as a library or a command line program. - -Uses the [`yauzl`](http://npmjs.org/yauzl) ZIP parser. - -[](https://npm.im/extract-zip) -[](https://github.com/standard/standard) -[](https://github.com/maxogden/extract-zip/actions?query=workflow%3ACI) - -## Installation - -Make sure you have Node 10 or greater installed. - -Get the library: - -``` -npm install extract-zip --save -``` - -Install the command line program: - -``` -npm install extract-zip -g -``` - -## JS API - -```javascript -const extract = require('extract-zip') - -async function main () { - try { - await extract(source, { dir: target }) - console.log('Extraction complete') - } catch (err) { - // handle any errors - } -} -``` - -### Options - -- `dir` (required) - the path to the directory where the extracted files are written -- `defaultDirMode` - integer - Directory Mode (permissions), defaults to `0o755` -- `defaultFileMode` - integer - File Mode (permissions), defaults to `0o644` -- `onEntry` - function - if present, will be called with `(entry, zipfile)`, entry is every entry from the zip file forwarded from the `entry` event from yauzl. `zipfile` is the `yauzl` instance - -Default modes are only used if no permissions are set in the zip file. - -## CLI Usage - -``` -extract-zip foo.zip <targetDirectory> -``` - -If not specified, `targetDirectory` will default to `process.cwd()`. diff --git a/node_modules/electron-packager/node_modules/fs-extra/LICENSE b/node_modules/electron-packager/node_modules/fs-extra/LICENSE deleted file mode 100644 index 93546df..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -(The MIT License) - -Copyright (c) 2011-2017 JP Richardson - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files -(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS -OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/electron-packager/node_modules/fs-extra/README.md b/node_modules/electron-packager/node_modules/fs-extra/README.md deleted file mode 100644 index 6ed8b6a..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/README.md +++ /dev/null @@ -1,262 +0,0 @@ -Node.js: fs-extra -================= - -`fs-extra` adds file system methods that aren't included in the native `fs` module and adds promise support to the `fs` methods. It also uses [`graceful-fs`](https://github.com/isaacs/node-graceful-fs) to prevent `EMFILE` errors. It should be a drop in replacement for `fs`. - -[](https://www.npmjs.org/package/fs-extra) -[](https://github.com/jprichardson/node-fs-extra/blob/master/LICENSE) -[](https://github.com/jprichardson/node-fs-extra/actions/workflows/ci.yml?query=branch%3Amaster) -[](https://www.npmjs.org/package/fs-extra) -[](https://standardjs.com) - -Why? ----- - -I got tired of including `mkdirp`, `rimraf`, and `ncp` in most of my projects. - - - - -Installation ------------- - - npm install fs-extra - - - -Usage ------ - -`fs-extra` is a drop in replacement for native `fs`. All methods in `fs` are attached to `fs-extra`. All `fs` methods return promises if the callback isn't passed. - -You don't ever need to include the original `fs` module again: - -```js -const fs = require('fs') // this is no longer necessary -``` - -you can now do this: - -```js -const fs = require('fs-extra') -``` - -or if you prefer to make it clear that you're using `fs-extra` and not `fs`, you may want -to name your `fs` variable `fse` like so: - -```js -const fse = require('fs-extra') -``` - -you can also keep both, but it's redundant: - -```js -const fs = require('fs') -const fse = require('fs-extra') -``` - -Sync vs Async vs Async/Await -------------- -Most methods are async by default. All async methods will return a promise if the callback isn't passed. - -Sync methods on the other hand will throw if an error occurs. - -Also Async/Await will throw an error if one occurs. - -Example: - -```js -const fs = require('fs-extra') - -// Async with promises: -fs.copy('/tmp/myfile', '/tmp/mynewfile') - .then(() => console.log('success!')) - .catch(err => console.error(err)) - -// Async with callbacks: -fs.copy('/tmp/myfile', '/tmp/mynewfile', err => { - if (err) return console.error(err) - console.log('success!') -}) - -// Sync: -try { - fs.copySync('/tmp/myfile', '/tmp/mynewfile') - console.log('success!') -} catch (err) { - console.error(err) -} - -// Async/Await: -async function copyFiles () { - try { - await fs.copy('/tmp/myfile', '/tmp/mynewfile') - console.log('success!') - } catch (err) { - console.error(err) - } -} - -copyFiles() -``` - - -Methods -------- - -### Async - -- [copy](docs/copy.md) -- [emptyDir](docs/emptyDir.md) -- [ensureFile](docs/ensureFile.md) -- [ensureDir](docs/ensureDir.md) -- [ensureLink](docs/ensureLink.md) -- [ensureSymlink](docs/ensureSymlink.md) -- [mkdirp](docs/ensureDir.md) -- [mkdirs](docs/ensureDir.md) -- [move](docs/move.md) -- [outputFile](docs/outputFile.md) -- [outputJson](docs/outputJson.md) -- [pathExists](docs/pathExists.md) -- [readJson](docs/readJson.md) -- [remove](docs/remove.md) -- [writeJson](docs/writeJson.md) - -### Sync - -- [copySync](docs/copy-sync.md) -- [emptyDirSync](docs/emptyDir-sync.md) -- [ensureFileSync](docs/ensureFile-sync.md) -- [ensureDirSync](docs/ensureDir-sync.md) -- [ensureLinkSync](docs/ensureLink-sync.md) -- [ensureSymlinkSync](docs/ensureSymlink-sync.md) -- [mkdirpSync](docs/ensureDir-sync.md) -- [mkdirsSync](docs/ensureDir-sync.md) -- [moveSync](docs/move-sync.md) -- [outputFileSync](docs/outputFile-sync.md) -- [outputJsonSync](docs/outputJson-sync.md) -- [pathExistsSync](docs/pathExists-sync.md) -- [readJsonSync](docs/readJson-sync.md) -- [removeSync](docs/remove-sync.md) -- [writeJsonSync](docs/writeJson-sync.md) - - -**NOTE:** You can still use the native Node.js methods. They are promisified and copied over to `fs-extra`. See [notes on `fs.read()`, `fs.write()`, & `fs.writev()`](docs/fs-read-write-writev.md) - -### What happened to `walk()` and `walkSync()`? - -They were removed from `fs-extra` in v2.0.0. If you need the functionality, `walk` and `walkSync` are available as separate packages, [`klaw`](https://github.com/jprichardson/node-klaw) and [`klaw-sync`](https://github.com/manidlou/node-klaw-sync). - - -Third Party ------------ - -### CLI - -[fse-cli](https://www.npmjs.com/package/@atao60/fse-cli) allows you to run `fs-extra` from a console or from [npm](https://www.npmjs.com) scripts. - -### TypeScript - -If you like TypeScript, you can use `fs-extra` with it: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fs-extra - - -### File / Directory Watching - -If you want to watch for changes to files or directories, then you should use [chokidar](https://github.com/paulmillr/chokidar). - -### Obtain Filesystem (Devices, Partitions) Information - -[fs-filesystem](https://github.com/arthurintelligence/node-fs-filesystem) allows you to read the state of the filesystem of the host on which it is run. It returns information about both the devices and the partitions (volumes) of the system. - -### Misc. - -- [fs-extra-debug](https://github.com/jdxcode/fs-extra-debug) - Send your fs-extra calls to [debug](https://npmjs.org/package/debug). -- [mfs](https://github.com/cadorn/mfs) - Monitor your fs-extra calls. - - - -Hacking on fs-extra -------------------- - -Wanna hack on `fs-extra`? Great! Your help is needed! [fs-extra is one of the most depended upon Node.js packages](http://nodei.co/npm/fs-extra.png?downloads=true&downloadRank=true&stars=true). This project -uses [JavaScript Standard Style](https://github.com/feross/standard) - if the name or style choices bother you, -you're gonna have to get over it :) If `standard` is good enough for `npm`, it's good enough for `fs-extra`. - -[](https://github.com/feross/standard) - -What's needed? -- First, take a look at existing issues. Those are probably going to be where the priority lies. -- More tests for edge cases. Specifically on different platforms. There can never be enough tests. -- Improve test coverage. - -Note: If you make any big changes, **you should definitely file an issue for discussion first.** - -### Running the Test Suite - -fs-extra contains hundreds of tests. - -- `npm run lint`: runs the linter ([standard](http://standardjs.com/)) -- `npm run unit`: runs the unit tests -- `npm test`: runs both the linter and the tests - - -### Windows - -If you run the tests on the Windows and receive a lot of symbolic link `EPERM` permission errors, it's -because on Windows you need elevated privilege to create symbolic links. You can add this to your Windows's -account by following the instructions here: http://superuser.com/questions/104845/permission-to-make-symbolic-links-in-windows-7 -However, I didn't have much luck doing this. - -Since I develop on Mac OS X, I use VMWare Fusion for Windows testing. I create a shared folder that I map to a drive on Windows. -I open the `Node.js command prompt` and run as `Administrator`. I then map the network drive running the following command: - - net use z: "\\vmware-host\Shared Folders" - -I can then navigate to my `fs-extra` directory and run the tests. - - -Naming ------- - -I put a lot of thought into the naming of these functions. Inspired by @coolaj86's request. So he deserves much of the credit for raising the issue. See discussion(s) here: - -* https://github.com/jprichardson/node-fs-extra/issues/2 -* https://github.com/flatiron/utile/issues/11 -* https://github.com/ryanmcgrath/wrench-js/issues/29 -* https://github.com/substack/node-mkdirp/issues/17 - -First, I believe that in as many cases as possible, the [Node.js naming schemes](http://nodejs.org/api/fs.html) should be chosen. However, there are problems with the Node.js own naming schemes. - -For example, `fs.readFile()` and `fs.readdir()`: the **F** is capitalized in *File* and the **d** is not capitalized in *dir*. Perhaps a bit pedantic, but they should still be consistent. Also, Node.js has chosen a lot of POSIX naming schemes, which I believe is great. See: `fs.mkdir()`, `fs.rmdir()`, `fs.chown()`, etc. - -We have a dilemma though. How do you consistently name methods that perform the following POSIX commands: `cp`, `cp -r`, `mkdir -p`, and `rm -rf`? - -My perspective: when in doubt, err on the side of simplicity. A directory is just a hierarchical grouping of directories and files. Consider that for a moment. So when you want to copy it or remove it, in most cases you'll want to copy or remove all of its contents. When you want to create a directory, if the directory that it's suppose to be contained in does not exist, then in most cases you'll want to create that too. - -So, if you want to remove a file or a directory regardless of whether it has contents, just call `fs.remove(path)`. If you want to copy a file or a directory whether it has contents, just call `fs.copy(source, destination)`. If you want to create a directory regardless of whether its parent directories exist, just call `fs.mkdirs(path)` or `fs.mkdirp(path)`. - - -Credit ------- - -`fs-extra` wouldn't be possible without using the modules from the following authors: - -- [Isaac Shlueter](https://github.com/isaacs) -- [Charlie McConnel](https://github.com/avianflu) -- [James Halliday](https://github.com/substack) -- [Andrew Kelley](https://github.com/andrewrk) - - - - -License -------- - -Licensed under MIT - -Copyright (c) 2011-2017 [JP Richardson](https://github.com/jprichardson) - -[1]: http://nodejs.org/docs/latest/api/fs.html - - -[jsonfile]: https://github.com/jprichardson/node-jsonfile diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/copy/copy-sync.js b/node_modules/electron-packager/node_modules/fs-extra/lib/copy/copy-sync.js deleted file mode 100644 index 551abe0..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/copy/copy-sync.js +++ /dev/null @@ -1,169 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const path = require('path') -const mkdirsSync = require('../mkdirs').mkdirsSync -const utimesMillisSync = require('../util/utimes').utimesMillisSync -const stat = require('../util/stat') - -function copySync (src, dest, opts) { - if (typeof opts === 'function') { - opts = { filter: opts } - } - - opts = opts || {} - opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now - opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber - - // Warn about using preserveTimestamps on 32-bit node - if (opts.preserveTimestamps && process.arch === 'ia32') { - process.emitWarning( - 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' + - '\tsee https://github.com/jprichardson/node-fs-extra/issues/269', - 'Warning', 'fs-extra-WARN0002' - ) - } - - const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts) - stat.checkParentPathsSync(src, srcStat, dest, 'copy') - return handleFilterAndCopy(destStat, src, dest, opts) -} - -function handleFilterAndCopy (destStat, src, dest, opts) { - if (opts.filter && !opts.filter(src, dest)) return - const destParent = path.dirname(dest) - if (!fs.existsSync(destParent)) mkdirsSync(destParent) - return getStats(destStat, src, dest, opts) -} - -function startCopy (destStat, src, dest, opts) { - if (opts.filter && !opts.filter(src, dest)) return - return getStats(destStat, src, dest, opts) -} - -function getStats (destStat, src, dest, opts) { - const statSync = opts.dereference ? fs.statSync : fs.lstatSync - const srcStat = statSync(src) - - if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts) - else if (srcStat.isFile() || - srcStat.isCharacterDevice() || - srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts) - else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts) - else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`) - else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`) - throw new Error(`Unknown file: ${src}`) -} - -function onFile (srcStat, destStat, src, dest, opts) { - if (!destStat) return copyFile(srcStat, src, dest, opts) - return mayCopyFile(srcStat, src, dest, opts) -} - -function mayCopyFile (srcStat, src, dest, opts) { - if (opts.overwrite) { - fs.unlinkSync(dest) - return copyFile(srcStat, src, dest, opts) - } else if (opts.errorOnExist) { - throw new Error(`'${dest}' already exists`) - } -} - -function copyFile (srcStat, src, dest, opts) { - fs.copyFileSync(src, dest) - if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest) - return setDestMode(dest, srcStat.mode) -} - -function handleTimestamps (srcMode, src, dest) { - // Make sure the file is writable before setting the timestamp - // otherwise open fails with EPERM when invoked with 'r+' - // (through utimes call) - if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode) - return setDestTimestamps(src, dest) -} - -function fileIsNotWritable (srcMode) { - return (srcMode & 0o200) === 0 -} - -function makeFileWritable (dest, srcMode) { - return setDestMode(dest, srcMode | 0o200) -} - -function setDestMode (dest, srcMode) { - return fs.chmodSync(dest, srcMode) -} - -function setDestTimestamps (src, dest) { - // The initial srcStat.atime cannot be trusted - // because it is modified by the read(2) system call - // (See https://nodejs.org/api/fs.html#fs_stat_time_values) - const updatedSrcStat = fs.statSync(src) - return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime) -} - -function onDir (srcStat, destStat, src, dest, opts) { - if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts) - return copyDir(src, dest, opts) -} - -function mkDirAndCopy (srcMode, src, dest, opts) { - fs.mkdirSync(dest) - copyDir(src, dest, opts) - return setDestMode(dest, srcMode) -} - -function copyDir (src, dest, opts) { - fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts)) -} - -function copyDirItem (item, src, dest, opts) { - const srcItem = path.join(src, item) - const destItem = path.join(dest, item) - const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts) - return startCopy(destStat, srcItem, destItem, opts) -} - -function onLink (destStat, src, dest, opts) { - let resolvedSrc = fs.readlinkSync(src) - if (opts.dereference) { - resolvedSrc = path.resolve(process.cwd(), resolvedSrc) - } - - if (!destStat) { - return fs.symlinkSync(resolvedSrc, dest) - } else { - let resolvedDest - try { - resolvedDest = fs.readlinkSync(dest) - } catch (err) { - // dest exists and is a regular file or directory, - // Windows may throw UNKNOWN error. If dest already exists, - // fs throws error anyway, so no need to guard against it here. - if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest) - throw err - } - if (opts.dereference) { - resolvedDest = path.resolve(process.cwd(), resolvedDest) - } - if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { - throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`) - } - - // prevent copy if src is a subdir of dest since unlinking - // dest in this case would result in removing src contents - // and therefore a broken symlink would be created. - if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { - throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`) - } - return copyLink(resolvedSrc, dest) - } -} - -function copyLink (resolvedSrc, dest) { - fs.unlinkSync(dest) - return fs.symlinkSync(resolvedSrc, dest) -} - -module.exports = copySync diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/copy/copy.js b/node_modules/electron-packager/node_modules/fs-extra/lib/copy/copy.js deleted file mode 100644 index 09d53df..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/copy/copy.js +++ /dev/null @@ -1,235 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const path = require('path') -const mkdirs = require('../mkdirs').mkdirs -const pathExists = require('../path-exists').pathExists -const utimesMillis = require('../util/utimes').utimesMillis -const stat = require('../util/stat') - -function copy (src, dest, opts, cb) { - if (typeof opts === 'function' && !cb) { - cb = opts - opts = {} - } else if (typeof opts === 'function') { - opts = { filter: opts } - } - - cb = cb || function () {} - opts = opts || {} - - opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now - opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber - - // Warn about using preserveTimestamps on 32-bit node - if (opts.preserveTimestamps && process.arch === 'ia32') { - process.emitWarning( - 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' + - '\tsee https://github.com/jprichardson/node-fs-extra/issues/269', - 'Warning', 'fs-extra-WARN0001' - ) - } - - stat.checkPaths(src, dest, 'copy', opts, (err, stats) => { - if (err) return cb(err) - const { srcStat, destStat } = stats - stat.checkParentPaths(src, srcStat, dest, 'copy', err => { - if (err) return cb(err) - if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb) - return checkParentDir(destStat, src, dest, opts, cb) - }) - }) -} - -function checkParentDir (destStat, src, dest, opts, cb) { - const destParent = path.dirname(dest) - pathExists(destParent, (err, dirExists) => { - if (err) return cb(err) - if (dirExists) return getStats(destStat, src, dest, opts, cb) - mkdirs(destParent, err => { - if (err) return cb(err) - return getStats(destStat, src, dest, opts, cb) - }) - }) -} - -function handleFilter (onInclude, destStat, src, dest, opts, cb) { - Promise.resolve(opts.filter(src, dest)).then(include => { - if (include) return onInclude(destStat, src, dest, opts, cb) - return cb() - }, error => cb(error)) -} - -function startCopy (destStat, src, dest, opts, cb) { - if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb) - return getStats(destStat, src, dest, opts, cb) -} - -function getStats (destStat, src, dest, opts, cb) { - const stat = opts.dereference ? fs.stat : fs.lstat - stat(src, (err, srcStat) => { - if (err) return cb(err) - - if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb) - else if (srcStat.isFile() || - srcStat.isCharacterDevice() || - srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb) - else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb) - else if (srcStat.isSocket()) return cb(new Error(`Cannot copy a socket file: ${src}`)) - else if (srcStat.isFIFO()) return cb(new Error(`Cannot copy a FIFO pipe: ${src}`)) - return cb(new Error(`Unknown file: ${src}`)) - }) -} - -function onFile (srcStat, destStat, src, dest, opts, cb) { - if (!destStat) return copyFile(srcStat, src, dest, opts, cb) - return mayCopyFile(srcStat, src, dest, opts, cb) -} - -function mayCopyFile (srcStat, src, dest, opts, cb) { - if (opts.overwrite) { - fs.unlink(dest, err => { - if (err) return cb(err) - return copyFile(srcStat, src, dest, opts, cb) - }) - } else if (opts.errorOnExist) { - return cb(new Error(`'${dest}' already exists`)) - } else return cb() -} - -function copyFile (srcStat, src, dest, opts, cb) { - fs.copyFile(src, dest, err => { - if (err) return cb(err) - if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb) - return setDestMode(dest, srcStat.mode, cb) - }) -} - -function handleTimestampsAndMode (srcMode, src, dest, cb) { - // Make sure the file is writable before setting the timestamp - // otherwise open fails with EPERM when invoked with 'r+' - // (through utimes call) - if (fileIsNotWritable(srcMode)) { - return makeFileWritable(dest, srcMode, err => { - if (err) return cb(err) - return setDestTimestampsAndMode(srcMode, src, dest, cb) - }) - } - return setDestTimestampsAndMode(srcMode, src, dest, cb) -} - -function fileIsNotWritable (srcMode) { - return (srcMode & 0o200) === 0 -} - -function makeFileWritable (dest, srcMode, cb) { - return setDestMode(dest, srcMode | 0o200, cb) -} - -function setDestTimestampsAndMode (srcMode, src, dest, cb) { - setDestTimestamps(src, dest, err => { - if (err) return cb(err) - return setDestMode(dest, srcMode, cb) - }) -} - -function setDestMode (dest, srcMode, cb) { - return fs.chmod(dest, srcMode, cb) -} - -function setDestTimestamps (src, dest, cb) { - // The initial srcStat.atime cannot be trusted - // because it is modified by the read(2) system call - // (See https://nodejs.org/api/fs.html#fs_stat_time_values) - fs.stat(src, (err, updatedSrcStat) => { - if (err) return cb(err) - return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb) - }) -} - -function onDir (srcStat, destStat, src, dest, opts, cb) { - if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb) - return copyDir(src, dest, opts, cb) -} - -function mkDirAndCopy (srcMode, src, dest, opts, cb) { - fs.mkdir(dest, err => { - if (err) return cb(err) - copyDir(src, dest, opts, err => { - if (err) return cb(err) - return setDestMode(dest, srcMode, cb) - }) - }) -} - -function copyDir (src, dest, opts, cb) { - fs.readdir(src, (err, items) => { - if (err) return cb(err) - return copyDirItems(items, src, dest, opts, cb) - }) -} - -function copyDirItems (items, src, dest, opts, cb) { - const item = items.pop() - if (!item) return cb() - return copyDirItem(items, item, src, dest, opts, cb) -} - -function copyDirItem (items, item, src, dest, opts, cb) { - const srcItem = path.join(src, item) - const destItem = path.join(dest, item) - stat.checkPaths(srcItem, destItem, 'copy', opts, (err, stats) => { - if (err) return cb(err) - const { destStat } = stats - startCopy(destStat, srcItem, destItem, opts, err => { - if (err) return cb(err) - return copyDirItems(items, src, dest, opts, cb) - }) - }) -} - -function onLink (destStat, src, dest, opts, cb) { - fs.readlink(src, (err, resolvedSrc) => { - if (err) return cb(err) - if (opts.dereference) { - resolvedSrc = path.resolve(process.cwd(), resolvedSrc) - } - - if (!destStat) { - return fs.symlink(resolvedSrc, dest, cb) - } else { - fs.readlink(dest, (err, resolvedDest) => { - if (err) { - // dest exists and is a regular file or directory, - // Windows may throw UNKNOWN error. If dest already exists, - // fs throws error anyway, so no need to guard against it here. - if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb) - return cb(err) - } - if (opts.dereference) { - resolvedDest = path.resolve(process.cwd(), resolvedDest) - } - if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { - return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)) - } - - // do not copy if src is a subdir of dest since unlinking - // dest in this case would result in removing src contents - // and therefore a broken symlink would be created. - if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { - return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)) - } - return copyLink(resolvedSrc, dest, cb) - }) - } - }) -} - -function copyLink (resolvedSrc, dest, cb) { - fs.unlink(dest, err => { - if (err) return cb(err) - return fs.symlink(resolvedSrc, dest, cb) - }) -} - -module.exports = copy diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/copy/index.js b/node_modules/electron-packager/node_modules/fs-extra/lib/copy/index.js deleted file mode 100644 index 45c07a2..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/copy/index.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict' - -const u = require('universalify').fromCallback -module.exports = { - copy: u(require('./copy')), - copySync: require('./copy-sync') -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/empty/index.js b/node_modules/electron-packager/node_modules/fs-extra/lib/empty/index.js deleted file mode 100644 index b4a2e82..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/empty/index.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict' - -const u = require('universalify').fromPromise -const fs = require('../fs') -const path = require('path') -const mkdir = require('../mkdirs') -const remove = require('../remove') - -const emptyDir = u(async function emptyDir (dir) { - let items - try { - items = await fs.readdir(dir) - } catch { - return mkdir.mkdirs(dir) - } - - return Promise.all(items.map(item => remove.remove(path.join(dir, item)))) -}) - -function emptyDirSync (dir) { - let items - try { - items = fs.readdirSync(dir) - } catch { - return mkdir.mkdirsSync(dir) - } - - items.forEach(item => { - item = path.join(dir, item) - remove.removeSync(item) - }) -} - -module.exports = { - emptyDirSync, - emptydirSync: emptyDirSync, - emptyDir, - emptydir: emptyDir -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/file.js b/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/file.js deleted file mode 100644 index 15cc473..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/file.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict' - -const u = require('universalify').fromCallback -const path = require('path') -const fs = require('graceful-fs') -const mkdir = require('../mkdirs') - -function createFile (file, callback) { - function makeFile () { - fs.writeFile(file, '', err => { - if (err) return callback(err) - callback() - }) - } - - fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err - if (!err && stats.isFile()) return callback() - const dir = path.dirname(file) - fs.stat(dir, (err, stats) => { - if (err) { - // if the directory doesn't exist, make it - if (err.code === 'ENOENT') { - return mkdir.mkdirs(dir, err => { - if (err) return callback(err) - makeFile() - }) - } - return callback(err) - } - - if (stats.isDirectory()) makeFile() - else { - // parent is not a directory - // This is just to cause an internal ENOTDIR error to be thrown - fs.readdir(dir, err => { - if (err) return callback(err) - }) - } - }) - }) -} - -function createFileSync (file) { - let stats - try { - stats = fs.statSync(file) - } catch {} - if (stats && stats.isFile()) return - - const dir = path.dirname(file) - try { - if (!fs.statSync(dir).isDirectory()) { - // parent is not a directory - // This is just to cause an internal ENOTDIR error to be thrown - fs.readdirSync(dir) - } - } catch (err) { - // If the stat call above failed because the directory doesn't exist, create it - if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir) - else throw err - } - - fs.writeFileSync(file, '') -} - -module.exports = { - createFile: u(createFile), - createFileSync -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/index.js b/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/index.js deleted file mode 100644 index ecbcdd0..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/index.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict' - -const { createFile, createFileSync } = require('./file') -const { createLink, createLinkSync } = require('./link') -const { createSymlink, createSymlinkSync } = require('./symlink') - -module.exports = { - // file - createFile, - createFileSync, - ensureFile: createFile, - ensureFileSync: createFileSync, - // link - createLink, - createLinkSync, - ensureLink: createLink, - ensureLinkSync: createLinkSync, - // symlink - createSymlink, - createSymlinkSync, - ensureSymlink: createSymlink, - ensureSymlinkSync: createSymlinkSync -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/link.js b/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/link.js deleted file mode 100644 index f6d6748..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/link.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict' - -const u = require('universalify').fromCallback -const path = require('path') -const fs = require('graceful-fs') -const mkdir = require('../mkdirs') -const pathExists = require('../path-exists').pathExists -const { areIdentical } = require('../util/stat') - -function createLink (srcpath, dstpath, callback) { - function makeLink (srcpath, dstpath) { - fs.link(srcpath, dstpath, err => { - if (err) return callback(err) - callback(null) - }) - } - - fs.lstat(dstpath, (_, dstStat) => { - fs.lstat(srcpath, (err, srcStat) => { - if (err) { - err.message = err.message.replace('lstat', 'ensureLink') - return callback(err) - } - if (dstStat && areIdentical(srcStat, dstStat)) return callback(null) - - const dir = path.dirname(dstpath) - pathExists(dir, (err, dirExists) => { - if (err) return callback(err) - if (dirExists) return makeLink(srcpath, dstpath) - mkdir.mkdirs(dir, err => { - if (err) return callback(err) - makeLink(srcpath, dstpath) - }) - }) - }) - }) -} - -function createLinkSync (srcpath, dstpath) { - let dstStat - try { - dstStat = fs.lstatSync(dstpath) - } catch {} - - try { - const srcStat = fs.lstatSync(srcpath) - if (dstStat && areIdentical(srcStat, dstStat)) return - } catch (err) { - err.message = err.message.replace('lstat', 'ensureLink') - throw err - } - - const dir = path.dirname(dstpath) - const dirExists = fs.existsSync(dir) - if (dirExists) return fs.linkSync(srcpath, dstpath) - mkdir.mkdirsSync(dir) - - return fs.linkSync(srcpath, dstpath) -} - -module.exports = { - createLink: u(createLink), - createLinkSync -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink-paths.js b/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink-paths.js deleted file mode 100644 index 33cd760..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink-paths.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict' - -const path = require('path') -const fs = require('graceful-fs') -const pathExists = require('../path-exists').pathExists - -/** - * Function that returns two types of paths, one relative to symlink, and one - * relative to the current working directory. Checks if path is absolute or - * relative. If the path is relative, this function checks if the path is - * relative to symlink or relative to current working directory. This is an - * initiative to find a smarter `srcpath` to supply when building symlinks. - * This allows you to determine which path to use out of one of three possible - * types of source paths. The first is an absolute path. This is detected by - * `path.isAbsolute()`. When an absolute path is provided, it is checked to - * see if it exists. If it does it's used, if not an error is returned - * (callback)/ thrown (sync). The other two options for `srcpath` are a - * relative url. By default Node's `fs.symlink` works by creating a symlink - * using `dstpath` and expects the `srcpath` to be relative to the newly - * created symlink. If you provide a `srcpath` that does not exist on the file - * system it results in a broken symlink. To minimize this, the function - * checks to see if the 'relative to symlink' source file exists, and if it - * does it will use it. If it does not, it checks if there's a file that - * exists that is relative to the current working directory, if does its used. - * This preserves the expectations of the original fs.symlink spec and adds - * the ability to pass in `relative to current working direcotry` paths. - */ - -function symlinkPaths (srcpath, dstpath, callback) { - if (path.isAbsolute(srcpath)) { - return fs.lstat(srcpath, (err) => { - if (err) { - err.message = err.message.replace('lstat', 'ensureSymlink') - return callback(err) - } - return callback(null, { - toCwd: srcpath, - toDst: srcpath - }) - }) - } else { - const dstdir = path.dirname(dstpath) - const relativeToDst = path.join(dstdir, srcpath) - return pathExists(relativeToDst, (err, exists) => { - if (err) return callback(err) - if (exists) { - return callback(null, { - toCwd: relativeToDst, - toDst: srcpath - }) - } else { - return fs.lstat(srcpath, (err) => { - if (err) { - err.message = err.message.replace('lstat', 'ensureSymlink') - return callback(err) - } - return callback(null, { - toCwd: srcpath, - toDst: path.relative(dstdir, srcpath) - }) - }) - } - }) - } -} - -function symlinkPathsSync (srcpath, dstpath) { - let exists - if (path.isAbsolute(srcpath)) { - exists = fs.existsSync(srcpath) - if (!exists) throw new Error('absolute srcpath does not exist') - return { - toCwd: srcpath, - toDst: srcpath - } - } else { - const dstdir = path.dirname(dstpath) - const relativeToDst = path.join(dstdir, srcpath) - exists = fs.existsSync(relativeToDst) - if (exists) { - return { - toCwd: relativeToDst, - toDst: srcpath - } - } else { - exists = fs.existsSync(srcpath) - if (!exists) throw new Error('relative srcpath does not exist') - return { - toCwd: srcpath, - toDst: path.relative(dstdir, srcpath) - } - } - } -} - -module.exports = { - symlinkPaths, - symlinkPathsSync -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink-type.js b/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink-type.js deleted file mode 100644 index 42dc0ce..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink-type.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') - -function symlinkType (srcpath, type, callback) { - callback = (typeof type === 'function') ? type : callback - type = (typeof type === 'function') ? false : type - if (type) return callback(null, type) - fs.lstat(srcpath, (err, stats) => { - if (err) return callback(null, 'file') - type = (stats && stats.isDirectory()) ? 'dir' : 'file' - callback(null, type) - }) -} - -function symlinkTypeSync (srcpath, type) { - let stats - - if (type) return type - try { - stats = fs.lstatSync(srcpath) - } catch { - return 'file' - } - return (stats && stats.isDirectory()) ? 'dir' : 'file' -} - -module.exports = { - symlinkType, - symlinkTypeSync -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink.js b/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink.js deleted file mode 100644 index 2b93052..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/ensure/symlink.js +++ /dev/null @@ -1,82 +0,0 @@ -'use strict' - -const u = require('universalify').fromCallback -const path = require('path') -const fs = require('../fs') -const _mkdirs = require('../mkdirs') -const mkdirs = _mkdirs.mkdirs -const mkdirsSync = _mkdirs.mkdirsSync - -const _symlinkPaths = require('./symlink-paths') -const symlinkPaths = _symlinkPaths.symlinkPaths -const symlinkPathsSync = _symlinkPaths.symlinkPathsSync - -const _symlinkType = require('./symlink-type') -const symlinkType = _symlinkType.symlinkType -const symlinkTypeSync = _symlinkType.symlinkTypeSync - -const pathExists = require('../path-exists').pathExists - -const { areIdentical } = require('../util/stat') - -function createSymlink (srcpath, dstpath, type, callback) { - callback = (typeof type === 'function') ? type : callback - type = (typeof type === 'function') ? false : type - - fs.lstat(dstpath, (err, stats) => { - if (!err && stats.isSymbolicLink()) { - Promise.all([ - fs.stat(srcpath), - fs.stat(dstpath) - ]).then(([srcStat, dstStat]) => { - if (areIdentical(srcStat, dstStat)) return callback(null) - _createSymlink(srcpath, dstpath, type, callback) - }) - } else _createSymlink(srcpath, dstpath, type, callback) - }) -} - -function _createSymlink (srcpath, dstpath, type, callback) { - symlinkPaths(srcpath, dstpath, (err, relative) => { - if (err) return callback(err) - srcpath = relative.toDst - symlinkType(relative.toCwd, type, (err, type) => { - if (err) return callback(err) - const dir = path.dirname(dstpath) - pathExists(dir, (err, dirExists) => { - if (err) return callback(err) - if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) - mkdirs(dir, err => { - if (err) return callback(err) - fs.symlink(srcpath, dstpath, type, callback) - }) - }) - }) - }) -} - -function createSymlinkSync (srcpath, dstpath, type) { - let stats - try { - stats = fs.lstatSync(dstpath) - } catch {} - if (stats && stats.isSymbolicLink()) { - const srcStat = fs.statSync(srcpath) - const dstStat = fs.statSync(dstpath) - if (areIdentical(srcStat, dstStat)) return - } - - const relative = symlinkPathsSync(srcpath, dstpath) - srcpath = relative.toDst - type = symlinkTypeSync(relative.toCwd, type) - const dir = path.dirname(dstpath) - const exists = fs.existsSync(dir) - if (exists) return fs.symlinkSync(srcpath, dstpath, type) - mkdirsSync(dir) - return fs.symlinkSync(srcpath, dstpath, type) -} - -module.exports = { - createSymlink: u(createSymlink), - createSymlinkSync -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/fs/index.js b/node_modules/electron-packager/node_modules/fs-extra/lib/fs/index.js deleted file mode 100644 index 7b025e2..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/fs/index.js +++ /dev/null @@ -1,128 +0,0 @@ -'use strict' -// This is adapted from https://github.com/normalize/mz -// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors -const u = require('universalify').fromCallback -const fs = require('graceful-fs') - -const api = [ - 'access', - 'appendFile', - 'chmod', - 'chown', - 'close', - 'copyFile', - 'fchmod', - 'fchown', - 'fdatasync', - 'fstat', - 'fsync', - 'ftruncate', - 'futimes', - 'lchmod', - 'lchown', - 'link', - 'lstat', - 'mkdir', - 'mkdtemp', - 'open', - 'opendir', - 'readdir', - 'readFile', - 'readlink', - 'realpath', - 'rename', - 'rm', - 'rmdir', - 'stat', - 'symlink', - 'truncate', - 'unlink', - 'utimes', - 'writeFile' -].filter(key => { - // Some commands are not available on some systems. Ex: - // fs.opendir was added in Node.js v12.12.0 - // fs.rm was added in Node.js v14.14.0 - // fs.lchown is not available on at least some Linux - return typeof fs[key] === 'function' -}) - -// Export cloned fs: -Object.assign(exports, fs) - -// Universalify async methods: -api.forEach(method => { - exports[method] = u(fs[method]) -}) - -// We differ from mz/fs in that we still ship the old, broken, fs.exists() -// since we are a drop-in replacement for the native module -exports.exists = function (filename, callback) { - if (typeof callback === 'function') { - return fs.exists(filename, callback) - } - return new Promise(resolve => { - return fs.exists(filename, resolve) - }) -} - -// fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args - -exports.read = function (fd, buffer, offset, length, position, callback) { - if (typeof callback === 'function') { - return fs.read(fd, buffer, offset, length, position, callback) - } - return new Promise((resolve, reject) => { - fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => { - if (err) return reject(err) - resolve({ bytesRead, buffer }) - }) - }) -} - -// Function signature can be -// fs.write(fd, buffer[, offset[, length[, position]]], callback) -// OR -// fs.write(fd, string[, position[, encoding]], callback) -// We need to handle both cases, so we use ...args -exports.write = function (fd, buffer, ...args) { - if (typeof args[args.length - 1] === 'function') { - return fs.write(fd, buffer, ...args) - } - - return new Promise((resolve, reject) => { - fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => { - if (err) return reject(err) - resolve({ bytesWritten, buffer }) - }) - }) -} - -// fs.writev only available in Node v12.9.0+ -if (typeof fs.writev === 'function') { - // Function signature is - // s.writev(fd, buffers[, position], callback) - // We need to handle the optional arg, so we use ...args - exports.writev = function (fd, buffers, ...args) { - if (typeof args[args.length - 1] === 'function') { - return fs.writev(fd, buffers, ...args) - } - - return new Promise((resolve, reject) => { - fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => { - if (err) return reject(err) - resolve({ bytesWritten, buffers }) - }) - }) - } -} - -// fs.realpath.native sometimes not available if fs is monkey-patched -if (typeof fs.realpath.native === 'function') { - exports.realpath.native = u(fs.realpath.native) -} else { - process.emitWarning( - 'fs.realpath.native is not a function. Is fs being monkey-patched?', - 'Warning', 'fs-extra-WARN0003' - ) -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/index.js b/node_modules/electron-packager/node_modules/fs-extra/lib/index.js deleted file mode 100644 index da6711a..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/index.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict' - -module.exports = { - // Export promiseified graceful-fs: - ...require('./fs'), - // Export extra methods: - ...require('./copy'), - ...require('./empty'), - ...require('./ensure'), - ...require('./json'), - ...require('./mkdirs'), - ...require('./move'), - ...require('./output-file'), - ...require('./path-exists'), - ...require('./remove') -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/json/index.js b/node_modules/electron-packager/node_modules/fs-extra/lib/json/index.js deleted file mode 100644 index 900126a..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/json/index.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict' - -const u = require('universalify').fromPromise -const jsonFile = require('./jsonfile') - -jsonFile.outputJson = u(require('./output-json')) -jsonFile.outputJsonSync = require('./output-json-sync') -// aliases -jsonFile.outputJSON = jsonFile.outputJson -jsonFile.outputJSONSync = jsonFile.outputJsonSync -jsonFile.writeJSON = jsonFile.writeJson -jsonFile.writeJSONSync = jsonFile.writeJsonSync -jsonFile.readJSON = jsonFile.readJson -jsonFile.readJSONSync = jsonFile.readJsonSync - -module.exports = jsonFile diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/json/jsonfile.js b/node_modules/electron-packager/node_modules/fs-extra/lib/json/jsonfile.js deleted file mode 100644 index f11d34d..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/json/jsonfile.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict' - -const jsonFile = require('jsonfile') - -module.exports = { - // jsonfile exports - readJson: jsonFile.readFile, - readJsonSync: jsonFile.readFileSync, - writeJson: jsonFile.writeFile, - writeJsonSync: jsonFile.writeFileSync -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/json/output-json-sync.js b/node_modules/electron-packager/node_modules/fs-extra/lib/json/output-json-sync.js deleted file mode 100644 index d4e564f..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/json/output-json-sync.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict' - -const { stringify } = require('jsonfile/utils') -const { outputFileSync } = require('../output-file') - -function outputJsonSync (file, data, options) { - const str = stringify(data, options) - - outputFileSync(file, str, options) -} - -module.exports = outputJsonSync diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/json/output-json.js b/node_modules/electron-packager/node_modules/fs-extra/lib/json/output-json.js deleted file mode 100644 index 0afdeb6..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/json/output-json.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict' - -const { stringify } = require('jsonfile/utils') -const { outputFile } = require('../output-file') - -async function outputJson (file, data, options = {}) { - const str = stringify(data, options) - - await outputFile(file, str, options) -} - -module.exports = outputJson diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/index.js b/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/index.js deleted file mode 100644 index 9edecee..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/index.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict' -const u = require('universalify').fromPromise -const { makeDir: _makeDir, makeDirSync } = require('./make-dir') -const makeDir = u(_makeDir) - -module.exports = { - mkdirs: makeDir, - mkdirsSync: makeDirSync, - // alias - mkdirp: makeDir, - mkdirpSync: makeDirSync, - ensureDir: makeDir, - ensureDirSync: makeDirSync -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/make-dir.js b/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/make-dir.js deleted file mode 100644 index 45ece64..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/make-dir.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict' -const fs = require('../fs') -const { checkPath } = require('./utils') - -const getMode = options => { - const defaults = { mode: 0o777 } - if (typeof options === 'number') return options - return ({ ...defaults, ...options }).mode -} - -module.exports.makeDir = async (dir, options) => { - checkPath(dir) - - return fs.mkdir(dir, { - mode: getMode(options), - recursive: true - }) -} - -module.exports.makeDirSync = (dir, options) => { - checkPath(dir) - - return fs.mkdirSync(dir, { - mode: getMode(options), - recursive: true - }) -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/utils.js b/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/utils.js deleted file mode 100644 index a4059ad..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/mkdirs/utils.js +++ /dev/null @@ -1,21 +0,0 @@ -// Adapted from https://github.com/sindresorhus/make-dir -// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -'use strict' -const path = require('path') - -// https://github.com/nodejs/node/issues/8987 -// https://github.com/libuv/libuv/pull/1088 -module.exports.checkPath = function checkPath (pth) { - if (process.platform === 'win32') { - const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')) - - if (pathHasInvalidWinCharacters) { - const error = new Error(`Path contains invalid characters: ${pth}`) - error.code = 'EINVAL' - throw error - } - } -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/move/index.js b/node_modules/electron-packager/node_modules/fs-extra/lib/move/index.js deleted file mode 100644 index fcee73c..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/move/index.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict' - -const u = require('universalify').fromCallback -module.exports = { - move: u(require('./move')), - moveSync: require('./move-sync') -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/move/move-sync.js b/node_modules/electron-packager/node_modules/fs-extra/lib/move/move-sync.js deleted file mode 100644 index 8453366..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/move/move-sync.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const path = require('path') -const copySync = require('../copy').copySync -const removeSync = require('../remove').removeSync -const mkdirpSync = require('../mkdirs').mkdirpSync -const stat = require('../util/stat') - -function moveSync (src, dest, opts) { - opts = opts || {} - const overwrite = opts.overwrite || opts.clobber || false - - const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, 'move', opts) - stat.checkParentPathsSync(src, srcStat, dest, 'move') - if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest)) - return doRename(src, dest, overwrite, isChangingCase) -} - -function isParentRoot (dest) { - const parent = path.dirname(dest) - const parsedPath = path.parse(parent) - return parsedPath.root === parent -} - -function doRename (src, dest, overwrite, isChangingCase) { - if (isChangingCase) return rename(src, dest, overwrite) - if (overwrite) { - removeSync(dest) - return rename(src, dest, overwrite) - } - if (fs.existsSync(dest)) throw new Error('dest already exists.') - return rename(src, dest, overwrite) -} - -function rename (src, dest, overwrite) { - try { - fs.renameSync(src, dest) - } catch (err) { - if (err.code !== 'EXDEV') throw err - return moveAcrossDevice(src, dest, overwrite) - } -} - -function moveAcrossDevice (src, dest, overwrite) { - const opts = { - overwrite, - errorOnExist: true - } - copySync(src, dest, opts) - return removeSync(src) -} - -module.exports = moveSync diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/move/move.js b/node_modules/electron-packager/node_modules/fs-extra/lib/move/move.js deleted file mode 100644 index 7dc6ecd..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/move/move.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const path = require('path') -const copy = require('../copy').copy -const remove = require('../remove').remove -const mkdirp = require('../mkdirs').mkdirp -const pathExists = require('../path-exists').pathExists -const stat = require('../util/stat') - -function move (src, dest, opts, cb) { - if (typeof opts === 'function') { - cb = opts - opts = {} - } - - opts = opts || {} - - const overwrite = opts.overwrite || opts.clobber || false - - stat.checkPaths(src, dest, 'move', opts, (err, stats) => { - if (err) return cb(err) - const { srcStat, isChangingCase = false } = stats - stat.checkParentPaths(src, srcStat, dest, 'move', err => { - if (err) return cb(err) - if (isParentRoot(dest)) return doRename(src, dest, overwrite, isChangingCase, cb) - mkdirp(path.dirname(dest), err => { - if (err) return cb(err) - return doRename(src, dest, overwrite, isChangingCase, cb) - }) - }) - }) -} - -function isParentRoot (dest) { - const parent = path.dirname(dest) - const parsedPath = path.parse(parent) - return parsedPath.root === parent -} - -function doRename (src, dest, overwrite, isChangingCase, cb) { - if (isChangingCase) return rename(src, dest, overwrite, cb) - if (overwrite) { - return remove(dest, err => { - if (err) return cb(err) - return rename(src, dest, overwrite, cb) - }) - } - pathExists(dest, (err, destExists) => { - if (err) return cb(err) - if (destExists) return cb(new Error('dest already exists.')) - return rename(src, dest, overwrite, cb) - }) -} - -function rename (src, dest, overwrite, cb) { - fs.rename(src, dest, err => { - if (!err) return cb() - if (err.code !== 'EXDEV') return cb(err) - return moveAcrossDevice(src, dest, overwrite, cb) - }) -} - -function moveAcrossDevice (src, dest, overwrite, cb) { - const opts = { - overwrite, - errorOnExist: true - } - copy(src, dest, opts, err => { - if (err) return cb(err) - return remove(src, cb) - }) -} - -module.exports = move diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/output-file/index.js b/node_modules/electron-packager/node_modules/fs-extra/lib/output-file/index.js deleted file mode 100644 index 92297ca..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/output-file/index.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict' - -const u = require('universalify').fromCallback -const fs = require('graceful-fs') -const path = require('path') -const mkdir = require('../mkdirs') -const pathExists = require('../path-exists').pathExists - -function outputFile (file, data, encoding, callback) { - if (typeof encoding === 'function') { - callback = encoding - encoding = 'utf8' - } - - const dir = path.dirname(file) - pathExists(dir, (err, itDoes) => { - if (err) return callback(err) - if (itDoes) return fs.writeFile(file, data, encoding, callback) - - mkdir.mkdirs(dir, err => { - if (err) return callback(err) - - fs.writeFile(file, data, encoding, callback) - }) - }) -} - -function outputFileSync (file, ...args) { - const dir = path.dirname(file) - if (fs.existsSync(dir)) { - return fs.writeFileSync(file, ...args) - } - mkdir.mkdirsSync(dir) - fs.writeFileSync(file, ...args) -} - -module.exports = { - outputFile: u(outputFile), - outputFileSync -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/path-exists/index.js b/node_modules/electron-packager/node_modules/fs-extra/lib/path-exists/index.js deleted file mode 100644 index ddd9bc7..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/path-exists/index.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict' -const u = require('universalify').fromPromise -const fs = require('../fs') - -function pathExists (path) { - return fs.access(path).then(() => true).catch(() => false) -} - -module.exports = { - pathExists: u(pathExists), - pathExistsSync: fs.existsSync -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/remove/index.js b/node_modules/electron-packager/node_modules/fs-extra/lib/remove/index.js deleted file mode 100644 index 4428e59..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/remove/index.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const u = require('universalify').fromCallback -const rimraf = require('./rimraf') - -function remove (path, callback) { - // Node 14.14.0+ - if (fs.rm) return fs.rm(path, { recursive: true, force: true }, callback) - rimraf(path, callback) -} - -function removeSync (path) { - // Node 14.14.0+ - if (fs.rmSync) return fs.rmSync(path, { recursive: true, force: true }) - rimraf.sync(path) -} - -module.exports = { - remove: u(remove), - removeSync -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/remove/rimraf.js b/node_modules/electron-packager/node_modules/fs-extra/lib/remove/rimraf.js deleted file mode 100644 index 2c77102..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/remove/rimraf.js +++ /dev/null @@ -1,302 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const path = require('path') -const assert = require('assert') - -const isWindows = (process.platform === 'win32') - -function defaults (options) { - const methods = [ - 'unlink', - 'chmod', - 'stat', - 'lstat', - 'rmdir', - 'readdir' - ] - methods.forEach(m => { - options[m] = options[m] || fs[m] - m = m + 'Sync' - options[m] = options[m] || fs[m] - }) - - options.maxBusyTries = options.maxBusyTries || 3 -} - -function rimraf (p, options, cb) { - let busyTries = 0 - - if (typeof options === 'function') { - cb = options - options = {} - } - - assert(p, 'rimraf: missing path') - assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string') - assert.strictEqual(typeof cb, 'function', 'rimraf: callback function required') - assert(options, 'rimraf: invalid options argument provided') - assert.strictEqual(typeof options, 'object', 'rimraf: options should be object') - - defaults(options) - - rimraf_(p, options, function CB (er) { - if (er) { - if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') && - busyTries < options.maxBusyTries) { - busyTries++ - const time = busyTries * 100 - // try again, with the same exact callback as this one. - return setTimeout(() => rimraf_(p, options, CB), time) - } - - // already gone - if (er.code === 'ENOENT') er = null - } - - cb(er) - }) -} - -// Two possible strategies. -// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR -// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR -// -// Both result in an extra syscall when you guess wrong. However, there -// are likely far more normal files in the world than directories. This -// is based on the assumption that a the average number of files per -// directory is >= 1. -// -// If anyone ever complains about this, then I guess the strategy could -// be made configurable somehow. But until then, YAGNI. -function rimraf_ (p, options, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // sunos lets the root user unlink directories, which is... weird. - // so we have to lstat here and make sure it's not a dir. - options.lstat(p, (er, st) => { - if (er && er.code === 'ENOENT') { - return cb(null) - } - - // Windows can EPERM on stat. Life is suffering. - if (er && er.code === 'EPERM' && isWindows) { - return fixWinEPERM(p, options, er, cb) - } - - if (st && st.isDirectory()) { - return rmdir(p, options, er, cb) - } - - options.unlink(p, er => { - if (er) { - if (er.code === 'ENOENT') { - return cb(null) - } - if (er.code === 'EPERM') { - return (isWindows) - ? fixWinEPERM(p, options, er, cb) - : rmdir(p, options, er, cb) - } - if (er.code === 'EISDIR') { - return rmdir(p, options, er, cb) - } - } - return cb(er) - }) - }) -} - -function fixWinEPERM (p, options, er, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.chmod(p, 0o666, er2 => { - if (er2) { - cb(er2.code === 'ENOENT' ? null : er) - } else { - options.stat(p, (er3, stats) => { - if (er3) { - cb(er3.code === 'ENOENT' ? null : er) - } else if (stats.isDirectory()) { - rmdir(p, options, er, cb) - } else { - options.unlink(p, cb) - } - }) - } - }) -} - -function fixWinEPERMSync (p, options, er) { - let stats - - assert(p) - assert(options) - - try { - options.chmodSync(p, 0o666) - } catch (er2) { - if (er2.code === 'ENOENT') { - return - } else { - throw er - } - } - - try { - stats = options.statSync(p) - } catch (er3) { - if (er3.code === 'ENOENT') { - return - } else { - throw er - } - } - - if (stats.isDirectory()) { - rmdirSync(p, options, er) - } else { - options.unlinkSync(p) - } -} - -function rmdir (p, options, originalEr, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - - // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) - // if we guessed wrong, and it's not a directory, then - // raise the original error. - options.rmdir(p, er => { - if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) { - rmkids(p, options, cb) - } else if (er && er.code === 'ENOTDIR') { - cb(originalEr) - } else { - cb(er) - } - }) -} - -function rmkids (p, options, cb) { - assert(p) - assert(options) - assert(typeof cb === 'function') - - options.readdir(p, (er, files) => { - if (er) return cb(er) - - let n = files.length - let errState - - if (n === 0) return options.rmdir(p, cb) - - files.forEach(f => { - rimraf(path.join(p, f), options, er => { - if (errState) { - return - } - if (er) return cb(errState = er) - if (--n === 0) { - options.rmdir(p, cb) - } - }) - }) - }) -} - -// this looks simpler, and is strictly *faster*, but will -// tie up the JavaScript thread and fail on excessively -// deep directory trees. -function rimrafSync (p, options) { - let st - - options = options || {} - defaults(options) - - assert(p, 'rimraf: missing path') - assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string') - assert(options, 'rimraf: missing options') - assert.strictEqual(typeof options, 'object', 'rimraf: options should be object') - - try { - st = options.lstatSync(p) - } catch (er) { - if (er.code === 'ENOENT') { - return - } - - // Windows can EPERM on stat. Life is suffering. - if (er.code === 'EPERM' && isWindows) { - fixWinEPERMSync(p, options, er) - } - } - - try { - // sunos lets the root user unlink directories, which is... weird. - if (st && st.isDirectory()) { - rmdirSync(p, options, null) - } else { - options.unlinkSync(p) - } - } catch (er) { - if (er.code === 'ENOENT') { - return - } else if (er.code === 'EPERM') { - return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) - } else if (er.code !== 'EISDIR') { - throw er - } - rmdirSync(p, options, er) - } -} - -function rmdirSync (p, options, originalEr) { - assert(p) - assert(options) - - try { - options.rmdirSync(p) - } catch (er) { - if (er.code === 'ENOTDIR') { - throw originalEr - } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') { - rmkidsSync(p, options) - } else if (er.code !== 'ENOENT') { - throw er - } - } -} - -function rmkidsSync (p, options) { - assert(p) - assert(options) - options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) - - if (isWindows) { - // We only end up here once we got ENOTEMPTY at least once, and - // at this point, we are guaranteed to have removed all the kids. - // So, we know that it won't be ENOENT or ENOTDIR or anything else. - // try really hard to delete stuff on windows, because it has a - // PROFOUNDLY annoying habit of not closing handles promptly when - // files are deleted, resulting in spurious ENOTEMPTY errors. - const startTime = Date.now() - do { - try { - const ret = options.rmdirSync(p, options) - return ret - } catch {} - } while (Date.now() - startTime < 500) // give up after 500ms - } else { - const ret = options.rmdirSync(p, options) - return ret - } -} - -module.exports = rimraf -rimraf.sync = rimrafSync diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/util/stat.js b/node_modules/electron-packager/node_modules/fs-extra/lib/util/stat.js deleted file mode 100644 index 0ed5aec..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/util/stat.js +++ /dev/null @@ -1,154 +0,0 @@ -'use strict' - -const fs = require('../fs') -const path = require('path') -const util = require('util') - -function getStats (src, dest, opts) { - const statFunc = opts.dereference - ? (file) => fs.stat(file, { bigint: true }) - : (file) => fs.lstat(file, { bigint: true }) - return Promise.all([ - statFunc(src), - statFunc(dest).catch(err => { - if (err.code === 'ENOENT') return null - throw err - }) - ]).then(([srcStat, destStat]) => ({ srcStat, destStat })) -} - -function getStatsSync (src, dest, opts) { - let destStat - const statFunc = opts.dereference - ? (file) => fs.statSync(file, { bigint: true }) - : (file) => fs.lstatSync(file, { bigint: true }) - const srcStat = statFunc(src) - try { - destStat = statFunc(dest) - } catch (err) { - if (err.code === 'ENOENT') return { srcStat, destStat: null } - throw err - } - return { srcStat, destStat } -} - -function checkPaths (src, dest, funcName, opts, cb) { - util.callbackify(getStats)(src, dest, opts, (err, stats) => { - if (err) return cb(err) - const { srcStat, destStat } = stats - - if (destStat) { - if (areIdentical(srcStat, destStat)) { - const srcBaseName = path.basename(src) - const destBaseName = path.basename(dest) - if (funcName === 'move' && - srcBaseName !== destBaseName && - srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { - return cb(null, { srcStat, destStat, isChangingCase: true }) - } - return cb(new Error('Source and destination must not be the same.')) - } - if (srcStat.isDirectory() && !destStat.isDirectory()) { - return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)) - } - if (!srcStat.isDirectory() && destStat.isDirectory()) { - return cb(new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)) - } - } - - if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { - return cb(new Error(errMsg(src, dest, funcName))) - } - return cb(null, { srcStat, destStat }) - }) -} - -function checkPathsSync (src, dest, funcName, opts) { - const { srcStat, destStat } = getStatsSync(src, dest, opts) - - if (destStat) { - if (areIdentical(srcStat, destStat)) { - const srcBaseName = path.basename(src) - const destBaseName = path.basename(dest) - if (funcName === 'move' && - srcBaseName !== destBaseName && - srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { - return { srcStat, destStat, isChangingCase: true } - } - throw new Error('Source and destination must not be the same.') - } - if (srcStat.isDirectory() && !destStat.isDirectory()) { - throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`) - } - if (!srcStat.isDirectory() && destStat.isDirectory()) { - throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`) - } - } - - if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { - throw new Error(errMsg(src, dest, funcName)) - } - return { srcStat, destStat } -} - -// recursively check if dest parent is a subdirectory of src. -// It works for all file types including symlinks since it -// checks the src and dest inodes. It starts from the deepest -// parent and stops once it reaches the src parent or the root path. -function checkParentPaths (src, srcStat, dest, funcName, cb) { - const srcParent = path.resolve(path.dirname(src)) - const destParent = path.resolve(path.dirname(dest)) - if (destParent === srcParent || destParent === path.parse(destParent).root) return cb() - fs.stat(destParent, { bigint: true }, (err, destStat) => { - if (err) { - if (err.code === 'ENOENT') return cb() - return cb(err) - } - if (areIdentical(srcStat, destStat)) { - return cb(new Error(errMsg(src, dest, funcName))) - } - return checkParentPaths(src, srcStat, destParent, funcName, cb) - }) -} - -function checkParentPathsSync (src, srcStat, dest, funcName) { - const srcParent = path.resolve(path.dirname(src)) - const destParent = path.resolve(path.dirname(dest)) - if (destParent === srcParent || destParent === path.parse(destParent).root) return - let destStat - try { - destStat = fs.statSync(destParent, { bigint: true }) - } catch (err) { - if (err.code === 'ENOENT') return - throw err - } - if (areIdentical(srcStat, destStat)) { - throw new Error(errMsg(src, dest, funcName)) - } - return checkParentPathsSync(src, srcStat, destParent, funcName) -} - -function areIdentical (srcStat, destStat) { - return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev -} - -// return true if dest is a subdir of src, otherwise false. -// It only checks the path strings. -function isSrcSubdir (src, dest) { - const srcArr = path.resolve(src).split(path.sep).filter(i => i) - const destArr = path.resolve(dest).split(path.sep).filter(i => i) - return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true) -} - -function errMsg (src, dest, funcName) { - return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.` -} - -module.exports = { - checkPaths, - checkPathsSync, - checkParentPaths, - checkParentPathsSync, - isSrcSubdir, - areIdentical -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/lib/util/utimes.js b/node_modules/electron-packager/node_modules/fs-extra/lib/util/utimes.js deleted file mode 100644 index 75395de..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/lib/util/utimes.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') - -function utimesMillis (path, atime, mtime, callback) { - // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) - fs.open(path, 'r+', (err, fd) => { - if (err) return callback(err) - fs.futimes(fd, atime, mtime, futimesErr => { - fs.close(fd, closeErr => { - if (callback) callback(futimesErr || closeErr) - }) - }) - }) -} - -function utimesMillisSync (path, atime, mtime) { - const fd = fs.openSync(path, 'r+') - fs.futimesSync(fd, atime, mtime) - return fs.closeSync(fd) -} - -module.exports = { - utimesMillis, - utimesMillisSync -} diff --git a/node_modules/electron-packager/node_modules/fs-extra/package.json b/node_modules/electron-packager/node_modules/fs-extra/package.json deleted file mode 100644 index 059000e..0000000 --- a/node_modules/electron-packager/node_modules/fs-extra/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "fs-extra", - "version": "10.1.0", - "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.", - "engines": { - "node": ">=12" - }, - "homepage": "https://github.com/jprichardson/node-fs-extra", - "repository": { - "type": "git", - "url": "https://github.com/jprichardson/node-fs-extra" - }, - "keywords": [ - "fs", - "file", - "file system", - "copy", - "directory", - "extra", - "mkdirp", - "mkdir", - "mkdirs", - "recursive", - "json", - "read", - "write", - "extra", - "delete", - "remove", - "touch", - "create", - "text", - "output", - "move", - "promise" - ], - "author": "JP Richardson <jprichardson@gmail.com>", - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "devDependencies": { - "at-least-node": "^1.0.0", - "klaw": "^2.1.1", - "klaw-sync": "^3.0.2", - "minimist": "^1.1.1", - "mocha": "^5.0.5", - "nyc": "^15.0.0", - "proxyquire": "^2.0.1", - "read-dir-files": "^0.1.1", - "standard": "^16.0.3" - }, - "main": "./lib/index.js", - "files": [ - "lib/", - "!lib/**/__tests__/" - ], - "scripts": { - "lint": "standard", - "test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha", - "test": "npm run lint && npm run unit", - "unit": "nyc node test.js" - }, - "sideEffects": false -} diff --git a/node_modules/electron-packager/node_modules/jsonfile/CHANGELOG.md b/node_modules/electron-packager/node_modules/jsonfile/CHANGELOG.md deleted file mode 100644 index d772e43..0000000 --- a/node_modules/electron-packager/node_modules/jsonfile/CHANGELOG.md +++ /dev/null @@ -1,171 +0,0 @@ -6.1.0 / 2020-10-31 ------------------- - -- Add `finalEOL` option to disable writing final EOL ([#115](https://github.com/jprichardson/node-jsonfile/issues/115), [#137](https://github.com/jprichardson/node-jsonfile/pull/137)) -- Update dependency ([#138](https://github.com/jprichardson/node-jsonfile/pull/138)) - -6.0.1 / 2020-03-07 ------------------- - -- Update dependency ([#130](https://github.com/jprichardson/node-jsonfile/pull/130)) -- Fix code style ([#129](https://github.com/jprichardson/node-jsonfile/pull/129)) - -6.0.0 / 2020-02-24 ------------------- - -- **BREAKING:** Drop support for Node 6 & 8 ([#128](https://github.com/jprichardson/node-jsonfile/pull/128)) -- **BREAKING:** Do not allow passing `null` as options to `readFile()` or `writeFile()` ([#128](https://github.com/jprichardson/node-jsonfile/pull/128)) -- Refactor internals ([#128](https://github.com/jprichardson/node-jsonfile/pull/128)) - -5.0.0 / 2018-09-08 ------------------- - -- **BREAKING:** Drop Node 4 support -- **BREAKING:** If no callback is passed to an asynchronous method, a promise is now returned ([#109](https://github.com/jprichardson/node-jsonfile/pull/109)) -- Cleanup docs - -4.0.0 / 2017-07-12 ------------------- - -- **BREAKING:** Remove global `spaces` option. -- **BREAKING:** Drop support for Node 0.10, 0.12, and io.js. -- Remove undocumented `passParsingErrors` option. -- Added `EOL` override option to `writeFile` when using `spaces`. [#89] - -3.0.1 / 2017-07-05 ------------------- - -- Fixed bug in `writeFile` when there was a serialization error & no callback was passed. In previous versions, an empty file would be written; now no file is written. - -3.0.0 / 2017-04-25 ------------------- - -- Changed behavior of `throws` option for `readFileSync`; now does not throw filesystem errors when `throws` is `false` - -2.4.0 / 2016-09-15 ------------------- -### Changed -- added optional support for `graceful-fs` [#62] - -2.3.1 / 2016-05-13 ------------------- -- fix to support BOM. [#45][#45] - -2.3.0 / 2016-04-16 ------------------- -- add `throws` to `readFile()`. See [#39][#39] -- add support for any arbitrary `fs` module. Useful with [mock-fs](https://www.npmjs.com/package/mock-fs) - -2.2.3 / 2015-10-14 ------------------- -- include file name in parse error. See: https://github.com/jprichardson/node-jsonfile/pull/34 - -2.2.2 / 2015-09-16 ------------------- -- split out tests into separate files -- fixed `throws` when set to `true` in `readFileSync()`. See: https://github.com/jprichardson/node-jsonfile/pull/33 - -2.2.1 / 2015-06-25 ------------------- -- fixed regression when passing in string as encoding for options in `writeFile()` and `writeFileSync()`. See: https://github.com/jprichardson/node-jsonfile/issues/28 - -2.2.0 / 2015-06-25 ------------------- -- added `options.spaces` to `writeFile()` and `writeFileSync()` - -2.1.2 / 2015-06-22 ------------------- -- fixed if passed `readFileSync(file, 'utf8')`. See: https://github.com/jprichardson/node-jsonfile/issues/25 - -2.1.1 / 2015-06-19 ------------------- -- fixed regressions if `null` is passed for options. See: https://github.com/jprichardson/node-jsonfile/issues/24 - -2.1.0 / 2015-06-19 ------------------- -- cleanup: JavaScript Standard Style, rename files, dropped terst for assert -- methods now support JSON revivers/replacers - -2.0.1 / 2015-05-24 ------------------- -- update license attribute https://github.com/jprichardson/node-jsonfile/pull/21 - -2.0.0 / 2014-07-28 ------------------- -* added `\n` to end of file on write. [#14](https://github.com/jprichardson/node-jsonfile/pull/14) -* added `options.throws` to `readFileSync()` -* dropped support for Node v0.8 - -1.2.0 / 2014-06-29 ------------------- -* removed semicolons -* bugfix: passed `options` to `fs.readFile` and `fs.readFileSync`. This technically changes behavior, but -changes it according to docs. [#12][#12] - -1.1.1 / 2013-11-11 ------------------- -* fixed catching of callback bug (ffissore / #5) - -1.1.0 / 2013-10-11 ------------------- -* added `options` param to methods, (seanodell / #4) - -1.0.1 / 2013-09-05 ------------------- -* removed `homepage` field from package.json to remove NPM warning - -1.0.0 / 2013-06-28 ------------------- -* added `.npmignore`, #1 -* changed spacing default from `4` to `2` to follow Node conventions - -0.0.1 / 2012-09-10 ------------------- -* Initial release. - -[#89]: https://github.com/jprichardson/node-jsonfile/pull/89 -[#45]: https://github.com/jprichardson/node-jsonfile/issues/45 "Reading of UTF8-encoded (w/ BOM) files fails" -[#44]: https://github.com/jprichardson/node-jsonfile/issues/44 "Extra characters in written file" -[#43]: https://github.com/jprichardson/node-jsonfile/issues/43 "Prettyfy json when written to file" -[#42]: https://github.com/jprichardson/node-jsonfile/pull/42 "Moved fs.readFileSync within the try/catch" -[#41]: https://github.com/jprichardson/node-jsonfile/issues/41 "Linux: Hidden file not working" -[#40]: https://github.com/jprichardson/node-jsonfile/issues/40 "autocreate folder doesn't work from Path-value" -[#39]: https://github.com/jprichardson/node-jsonfile/pull/39 "Add `throws` option for readFile (async)" -[#38]: https://github.com/jprichardson/node-jsonfile/pull/38 "Update README.md writeFile[Sync] signature" -[#37]: https://github.com/jprichardson/node-jsonfile/pull/37 "support append file" -[#36]: https://github.com/jprichardson/node-jsonfile/pull/36 "Add typescript definition file." -[#35]: https://github.com/jprichardson/node-jsonfile/pull/35 "Add typescript definition file." -[#34]: https://github.com/jprichardson/node-jsonfile/pull/34 "readFile JSON parse error includes filename" -[#33]: https://github.com/jprichardson/node-jsonfile/pull/33 "fix throw->throws typo in readFileSync()" -[#32]: https://github.com/jprichardson/node-jsonfile/issues/32 "readFile & readFileSync can possible have strip-comments as an option?" -[#31]: https://github.com/jprichardson/node-jsonfile/pull/31 "[Modify] Support string include is unicode escape string" -[#30]: https://github.com/jprichardson/node-jsonfile/issues/30 "How to use Jsonfile package in Meteor.js App?" -[#29]: https://github.com/jprichardson/node-jsonfile/issues/29 "writefile callback if no error?" -[#28]: https://github.com/jprichardson/node-jsonfile/issues/28 "writeFile options argument broken " -[#27]: https://github.com/jprichardson/node-jsonfile/pull/27 "Use svg instead of png to get better image quality" -[#26]: https://github.com/jprichardson/node-jsonfile/issues/26 "Breaking change to fs-extra" -[#25]: https://github.com/jprichardson/node-jsonfile/issues/25 "support string encoding param for read methods" -[#24]: https://github.com/jprichardson/node-jsonfile/issues/24 "readFile: Passing in null options with a callback throws an error" -[#23]: https://github.com/jprichardson/node-jsonfile/pull/23 "Add appendFile and appendFileSync" -[#22]: https://github.com/jprichardson/node-jsonfile/issues/22 "Default value for spaces in readme.md is outdated" -[#21]: https://github.com/jprichardson/node-jsonfile/pull/21 "Update license attribute" -[#20]: https://github.com/jprichardson/node-jsonfile/issues/20 "Add simple caching functionallity" -[#19]: https://github.com/jprichardson/node-jsonfile/pull/19 "Add appendFileSync method" -[#18]: https://github.com/jprichardson/node-jsonfile/issues/18 "Add updateFile and updateFileSync methods" -[#17]: https://github.com/jprichardson/node-jsonfile/issues/17 "seem read & write sync has sequentially problem" -[#16]: https://github.com/jprichardson/node-jsonfile/pull/16 "export spaces defaulted to null" -[#15]: https://github.com/jprichardson/node-jsonfile/issues/15 "`jsonfile.spaces` should default to `null`" -[#14]: https://github.com/jprichardson/node-jsonfile/pull/14 "Add EOL at EOF" -[#13]: https://github.com/jprichardson/node-jsonfile/issues/13 "Add a final newline" -[#12]: https://github.com/jprichardson/node-jsonfile/issues/12 "readFile doesn't accept options" -[#11]: https://github.com/jprichardson/node-jsonfile/pull/11 "Added try,catch to readFileSync" -[#10]: https://github.com/jprichardson/node-jsonfile/issues/10 "No output or error from writeFile" -[#9]: https://github.com/jprichardson/node-jsonfile/pull/9 "Change 'js' to 'jf' in example." -[#8]: https://github.com/jprichardson/node-jsonfile/pull/8 "Updated forgotten module.exports to me." -[#7]: https://github.com/jprichardson/node-jsonfile/pull/7 "Add file name in error message" -[#6]: https://github.com/jprichardson/node-jsonfile/pull/6 "Use graceful-fs when possible" -[#5]: https://github.com/jprichardson/node-jsonfile/pull/5 "Jsonfile doesn't behave nicely when used inside a test suite." -[#4]: https://github.com/jprichardson/node-jsonfile/pull/4 "Added options parameter to writeFile and writeFileSync" -[#3]: https://github.com/jprichardson/node-jsonfile/issues/3 "test2" -[#2]: https://github.com/jprichardson/node-jsonfile/issues/2 "homepage field must be a string url. Deleted." -[#1]: https://github.com/jprichardson/node-jsonfile/pull/1 "adding an `.npmignore` file" diff --git a/node_modules/electron-packager/node_modules/jsonfile/LICENSE b/node_modules/electron-packager/node_modules/jsonfile/LICENSE deleted file mode 100644 index cb7e807..0000000 --- a/node_modules/electron-packager/node_modules/jsonfile/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -(The MIT License) - -Copyright (c) 2012-2015, JP Richardson <jprichardson@gmail.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files -(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, - merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS -OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/electron-packager/node_modules/jsonfile/README.md b/node_modules/electron-packager/node_modules/jsonfile/README.md deleted file mode 100644 index 910cde0..0000000 --- a/node_modules/electron-packager/node_modules/jsonfile/README.md +++ /dev/null @@ -1,230 +0,0 @@ -Node.js - jsonfile -================ - -Easily read/write JSON files in Node.js. _Note: this module cannot be used in the browser._ - -[](https://www.npmjs.org/package/jsonfile) -[](http://travis-ci.org/jprichardson/node-jsonfile) -[](https://ci.appveyor.com/project/jprichardson/node-jsonfile/branch/master) - -<a href="https://github.com/feross/standard"><img src="https://cdn.rawgit.com/feross/standard/master/sticker.svg" alt="Standard JavaScript" width="100"></a> - -Why? ----- - -Writing `JSON.stringify()` and then `fs.writeFile()` and `JSON.parse()` with `fs.readFile()` enclosed in `try/catch` blocks became annoying. - - - -Installation ------------- - - npm install --save jsonfile - - - -API ---- - -* [`readFile(filename, [options], callback)`](#readfilefilename-options-callback) -* [`readFileSync(filename, [options])`](#readfilesyncfilename-options) -* [`writeFile(filename, obj, [options], callback)`](#writefilefilename-obj-options-callback) -* [`writeFileSync(filename, obj, [options])`](#writefilesyncfilename-obj-options) - ----- - -### readFile(filename, [options], callback) - -`options` (`object`, default `undefined`): Pass in any [`fs.readFile`](https://nodejs.org/api/fs.html#fs_fs_readfile_path_options_callback) options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse). - - `throws` (`boolean`, default: `true`). If `JSON.parse` throws an error, pass this error to the callback. - If `false`, returns `null` for the object. - - -```js -const jsonfile = require('jsonfile') -const file = '/tmp/data.json' -jsonfile.readFile(file, function (err, obj) { - if (err) console.error(err) - console.dir(obj) -}) -``` - -You can also use this method with promises. The `readFile` method will return a promise if you do not pass a callback function. - -```js -const jsonfile = require('jsonfile') -const file = '/tmp/data.json' -jsonfile.readFile(file) - .then(obj => console.dir(obj)) - .catch(error => console.error(error)) -``` - ----- - -### readFileSync(filename, [options]) - -`options` (`object`, default `undefined`): Pass in any [`fs.readFileSync`](https://nodejs.org/api/fs.html#fs_fs_readfilesync_path_options) options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse). -- `throws` (`boolean`, default: `true`). If an error is encountered reading or parsing the file, throw the error. If `false`, returns `null` for the object. - -```js -const jsonfile = require('jsonfile') -const file = '/tmp/data.json' - -console.dir(jsonfile.readFileSync(file)) -``` - ----- - -### writeFile(filename, obj, [options], callback) - -`options`: Pass in any [`fs.writeFile`](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback) options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces`, or override `EOL` string or set `finalEOL` flag as `false` to not save the file with `EOL` at the end. - - -```js -const jsonfile = require('jsonfile') - -const file = '/tmp/data.json' -const obj = { name: 'JP' } - -jsonfile.writeFile(file, obj, function (err) { - if (err) console.error(err) -}) -``` -Or use with promises as follows: - -```js -const jsonfile = require('jsonfile') - -const file = '/tmp/data.json' -const obj = { name: 'JP' } - -jsonfile.writeFile(file, obj) - .then(res => { - console.log('Write complete') - }) - .catch(error => console.error(error)) -``` - - -**formatting with spaces:** - -```js -const jsonfile = require('jsonfile') - -const file = '/tmp/data.json' -const obj = { name: 'JP' } - -jsonfile.writeFile(file, obj, { spaces: 2 }, function (err) { - if (err) console.error(err) -}) -``` - -**overriding EOL:** - -```js -const jsonfile = require('jsonfile') - -const file = '/tmp/data.json' -const obj = { name: 'JP' } - -jsonfile.writeFile(file, obj, { spaces: 2, EOL: '\r\n' }, function (err) { - if (err) console.error(err) -}) -``` - - -**disabling the EOL at the end of file:** - -```js -const jsonfile = require('jsonfile') - -const file = '/tmp/data.json' -const obj = { name: 'JP' } - -jsonfile.writeFile(file, obj, { spaces: 2, finalEOL: false }, function (err) { - if (err) console.log(err) -}) -``` - -**appending to an existing JSON file:** - -You can use `fs.writeFile` option `{ flag: 'a' }` to achieve this. - -```js -const jsonfile = require('jsonfile') - -const file = '/tmp/mayAlreadyExistedData.json' -const obj = { name: 'JP' } - -jsonfile.writeFile(file, obj, { flag: 'a' }, function (err) { - if (err) console.error(err) -}) -``` - ----- - -### writeFileSync(filename, obj, [options]) - -`options`: Pass in any [`fs.writeFileSync`](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options) options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces`, or override `EOL` string or set `finalEOL` flag as `false` to not save the file with `EOL` at the end. - -```js -const jsonfile = require('jsonfile') - -const file = '/tmp/data.json' -const obj = { name: 'JP' } - -jsonfile.writeFileSync(file, obj) -``` - -**formatting with spaces:** - -```js -const jsonfile = require('jsonfile') - -const file = '/tmp/data.json' -const obj = { name: 'JP' } - -jsonfile.writeFileSync(file, obj, { spaces: 2 }) -``` - -**overriding EOL:** - -```js -const jsonfile = require('jsonfile') - -const file = '/tmp/data.json' -const obj = { name: 'JP' } - -jsonfile.writeFileSync(file, obj, { spaces: 2, EOL: '\r\n' }) -``` - -**disabling the EOL at the end of file:** - -```js -const jsonfile = require('jsonfile') - -const file = '/tmp/data.json' -const obj = { name: 'JP' } - -jsonfile.writeFileSync(file, obj, { spaces: 2, finalEOL: false }) -``` - -**appending to an existing JSON file:** - -You can use `fs.writeFileSync` option `{ flag: 'a' }` to achieve this. - -```js -const jsonfile = require('jsonfile') - -const file = '/tmp/mayAlreadyExistedData.json' -const obj = { name: 'JP' } - -jsonfile.writeFileSync(file, obj, { flag: 'a' }) -``` - -License -------- - -(MIT License) - -Copyright 2012-2016, JP Richardson <jprichardson@gmail.com> diff --git a/node_modules/electron-packager/node_modules/jsonfile/index.js b/node_modules/electron-packager/node_modules/jsonfile/index.js deleted file mode 100644 index 0582868..0000000 --- a/node_modules/electron-packager/node_modules/jsonfile/index.js +++ /dev/null @@ -1,88 +0,0 @@ -let _fs -try { - _fs = require('graceful-fs') -} catch (_) { - _fs = require('fs') -} -const universalify = require('universalify') -const { stringify, stripBom } = require('./utils') - -async function _readFile (file, options = {}) { - if (typeof options === 'string') { - options = { encoding: options } - } - - const fs = options.fs || _fs - - const shouldThrow = 'throws' in options ? options.throws : true - - let data = await universalify.fromCallback(fs.readFile)(file, options) - - data = stripBom(data) - - let obj - try { - obj = JSON.parse(data, options ? options.reviver : null) - } catch (err) { - if (shouldThrow) { - err.message = `${file}: ${err.message}` - throw err - } else { - return null - } - } - - return obj -} - -const readFile = universalify.fromPromise(_readFile) - -function readFileSync (file, options = {}) { - if (typeof options === 'string') { - options = { encoding: options } - } - - const fs = options.fs || _fs - - const shouldThrow = 'throws' in options ? options.throws : true - - try { - let content = fs.readFileSync(file, options) - content = stripBom(content) - return JSON.parse(content, options.reviver) - } catch (err) { - if (shouldThrow) { - err.message = `${file}: ${err.message}` - throw err - } else { - return null - } - } -} - -async function _writeFile (file, obj, options = {}) { - const fs = options.fs || _fs - - const str = stringify(obj, options) - - await universalify.fromCallback(fs.writeFile)(file, str, options) -} - -const writeFile = universalify.fromPromise(_writeFile) - -function writeFileSync (file, obj, options = {}) { - const fs = options.fs || _fs - - const str = stringify(obj, options) - // not sure if fs.writeFileSync returns anything, but just in case - return fs.writeFileSync(file, str, options) -} - -const jsonfile = { - readFile, - readFileSync, - writeFile, - writeFileSync -} - -module.exports = jsonfile diff --git a/node_modules/electron-packager/node_modules/jsonfile/package.json b/node_modules/electron-packager/node_modules/jsonfile/package.json deleted file mode 100644 index 4d01eb1..0000000 --- a/node_modules/electron-packager/node_modules/jsonfile/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "jsonfile", - "version": "6.1.0", - "description": "Easily read/write JSON files.", - "repository": { - "type": "git", - "url": "git@github.com:jprichardson/node-jsonfile.git" - }, - "keywords": [ - "read", - "write", - "file", - "json", - "fs", - "fs-extra" - ], - "author": "JP Richardson <jprichardson@gmail.com>", - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - }, - "devDependencies": { - "mocha": "^8.2.0", - "rimraf": "^2.4.0", - "standard": "^16.0.1" - }, - "main": "index.js", - "files": [ - "index.js", - "utils.js" - ], - "scripts": { - "lint": "standard", - "test": "npm run lint && npm run unit", - "unit": "mocha" - } -} diff --git a/node_modules/electron-packager/node_modules/jsonfile/utils.js b/node_modules/electron-packager/node_modules/jsonfile/utils.js deleted file mode 100644 index b5ff48e..0000000 --- a/node_modules/electron-packager/node_modules/jsonfile/utils.js +++ /dev/null @@ -1,14 +0,0 @@ -function stringify (obj, { EOL = '\n', finalEOL = true, replacer = null, spaces } = {}) { - const EOF = finalEOL ? EOL : '' - const str = JSON.stringify(obj, replacer, spaces) - - return str.replace(/\n/g, EOL) + EOF -} - -function stripBom (content) { - // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified - if (Buffer.isBuffer(content)) content = content.toString('utf8') - return content.replace(/^\uFEFF/, '') -} - -module.exports = { stringify, stripBom } diff --git a/node_modules/electron-packager/node_modules/ms/index.js b/node_modules/electron-packager/node_modules/ms/index.js deleted file mode 100644 index c4498bc..0000000 --- a/node_modules/electron-packager/node_modules/ms/index.js +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var w = d * 7; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - 'val is not a non-empty string or a valid number. val=' + - JSON.stringify(val) - ); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'weeks': - case 'week': - case 'w': - return n * w; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - default: - return undefined; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - return ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); -} diff --git a/node_modules/electron-packager/node_modules/ms/license.md b/node_modules/electron-packager/node_modules/ms/license.md deleted file mode 100644 index 69b6125..0000000 --- a/node_modules/electron-packager/node_modules/ms/license.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Zeit, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/electron-packager/node_modules/ms/package.json b/node_modules/electron-packager/node_modules/ms/package.json deleted file mode 100644 index eea666e..0000000 --- a/node_modules/electron-packager/node_modules/ms/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "ms", - "version": "2.1.2", - "description": "Tiny millisecond conversion utility", - "repository": "zeit/ms", - "main": "./index", - "files": [ - "index.js" - ], - "scripts": { - "precommit": "lint-staged", - "lint": "eslint lib/* bin/*", - "test": "mocha tests.js" - }, - "eslintConfig": { - "extends": "eslint:recommended", - "env": { - "node": true, - "es6": true - } - }, - "lint-staged": { - "*.js": [ - "npm run lint", - "prettier --single-quote --write", - "git add" - ] - }, - "license": "MIT", - "devDependencies": { - "eslint": "4.12.1", - "expect.js": "0.3.1", - "husky": "0.14.3", - "lint-staged": "5.0.0", - "mocha": "4.0.1" - } -} diff --git a/node_modules/electron-packager/node_modules/ms/readme.md b/node_modules/electron-packager/node_modules/ms/readme.md deleted file mode 100644 index 9a1996b..0000000 --- a/node_modules/electron-packager/node_modules/ms/readme.md +++ /dev/null @@ -1,60 +0,0 @@ -# ms - -[](https://travis-ci.org/zeit/ms) -[](https://spectrum.chat/zeit) - -Use this package to easily convert various time formats to milliseconds. - -## Examples - -```js -ms('2 days') // 172800000 -ms('1d') // 86400000 -ms('10h') // 36000000 -ms('2.5 hrs') // 9000000 -ms('2h') // 7200000 -ms('1m') // 60000 -ms('5s') // 5000 -ms('1y') // 31557600000 -ms('100') // 100 -ms('-3 days') // -259200000 -ms('-1h') // -3600000 -ms('-200') // -200 -``` - -### Convert from Milliseconds - -```js -ms(60000) // "1m" -ms(2 * 60000) // "2m" -ms(-3 * 60000) // "-3m" -ms(ms('10 hours')) // "10h" -``` - -### Time Format Written-Out - -```js -ms(60000, { long: true }) // "1 minute" -ms(2 * 60000, { long: true }) // "2 minutes" -ms(-3 * 60000, { long: true }) // "-3 minutes" -ms(ms('10 hours'), { long: true }) // "10 hours" -``` - -## Features - -- Works both in [Node.js](https://nodejs.org) and in the browser -- If a number is supplied to `ms`, a string with a unit is returned -- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`) -- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned - -## Related Packages - -- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time. - -## Caught a Bug? - -1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device -2. Link the package to the global module directory: `npm link` -3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms! - -As always, you can run the tests using: `npm test` diff --git a/node_modules/electron-packager/node_modules/semver/LICENSE b/node_modules/electron-packager/node_modules/semver/LICENSE deleted file mode 100644 index 19129e3..0000000 --- a/node_modules/electron-packager/node_modules/semver/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/electron-packager/node_modules/semver/README.md b/node_modules/electron-packager/node_modules/semver/README.md deleted file mode 100644 index df54e7a..0000000 --- a/node_modules/electron-packager/node_modules/semver/README.md +++ /dev/null @@ -1,568 +0,0 @@ -semver(1) -- The semantic versioner for npm -=========================================== - -## Install - -```bash -npm install semver -```` - -## Usage - -As a node module: - -```js -const semver = require('semver') - -semver.valid('1.2.3') // '1.2.3' -semver.valid('a.b.c') // null -semver.clean(' =v1.2.3 ') // '1.2.3' -semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true -semver.gt('1.2.3', '9.8.7') // false -semver.lt('1.2.3', '9.8.7') // true -semver.minVersion('>=1.0.0') // '1.0.0' -semver.valid(semver.coerce('v2')) // '2.0.0' -semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' -``` - -You can also just load the module for the function that you care about, if -you'd like to minimize your footprint. - -```js -// load the whole API at once in a single object -const semver = require('semver') - -// or just load the bits you need -// all of them listed here, just pick and choose what you want - -// classes -const SemVer = require('semver/classes/semver') -const Comparator = require('semver/classes/comparator') -const Range = require('semver/classes/range') - -// functions for working with versions -const semverParse = require('semver/functions/parse') -const semverValid = require('semver/functions/valid') -const semverClean = require('semver/functions/clean') -const semverInc = require('semver/functions/inc') -const semverDiff = require('semver/functions/diff') -const semverMajor = require('semver/functions/major') -const semverMinor = require('semver/functions/minor') -const semverPatch = require('semver/functions/patch') -const semverPrerelease = require('semver/functions/prerelease') -const semverCompare = require('semver/functions/compare') -const semverRcompare = require('semver/functions/rcompare') -const semverCompareLoose = require('semver/functions/compare-loose') -const semverCompareBuild = require('semver/functions/compare-build') -const semverSort = require('semver/functions/sort') -const semverRsort = require('semver/functions/rsort') - -// low-level comparators between versions -const semverGt = require('semver/functions/gt') -const semverLt = require('semver/functions/lt') -const semverEq = require('semver/functions/eq') -const semverNeq = require('semver/functions/neq') -const semverGte = require('semver/functions/gte') -const semverLte = require('semver/functions/lte') -const semverCmp = require('semver/functions/cmp') -const semverCoerce = require('semver/functions/coerce') - -// working with ranges -const semverSatisfies = require('semver/functions/satisfies') -const semverMaxSatisfying = require('semver/ranges/max-satisfying') -const semverMinSatisfying = require('semver/ranges/min-satisfying') -const semverToComparators = require('semver/ranges/to-comparators') -const semverMinVersion = require('semver/ranges/min-version') -const semverValidRange = require('semver/ranges/valid') -const semverOutside = require('semver/ranges/outside') -const semverGtr = require('semver/ranges/gtr') -const semverLtr = require('semver/ranges/ltr') -const semverIntersects = require('semver/ranges/intersects') -const simplifyRange = require('semver/ranges/simplify') -const rangeSubset = require('semver/ranges/subset') -``` - -As a command-line utility: - -``` -$ semver -h - -A JavaScript implementation of the https://semver.org/ specification -Copyright Isaac Z. Schlueter - -Usage: semver [options] <version> [<version> [...]] -Prints valid versions sorted by SemVer precedence - -Options: --r --range <range> - Print versions that match the specified range. - --i --increment [<level>] - Increment a version by the specified level. Level can - be one of: major, minor, patch, premajor, preminor, - prepatch, or prerelease. Default level is 'patch'. - Only one version may be specified. - ---preid <identifier> - Identifier to be used to prefix premajor, preminor, - prepatch or prerelease version increments. - --l --loose - Interpret versions and ranges loosely - --p --include-prerelease - Always include prerelease versions in range matching - --c --coerce - Coerce a string into SemVer if possible - (does not imply --loose) - ---rtl - Coerce version strings right to left - ---ltr - Coerce version strings left to right (default) - -Program exits successfully if any valid version satisfies -all supplied ranges, and prints all satisfying versions. - -If no satisfying versions are found, then exits failure. - -Versions are printed in ascending order, so supplying -multiple versions to the utility will just sort them. -``` - -## Versions - -A "version" is described by the `v2.0.0` specification found at -<https://semver.org/>. - -A leading `"="` or `"v"` character is stripped off and ignored. - -## Ranges - -A `version range` is a set of `comparators` which specify versions -that satisfy the range. - -A `comparator` is composed of an `operator` and a `version`. The set -of primitive `operators` is: - -* `<` Less than -* `<=` Less than or equal to -* `>` Greater than -* `>=` Greater than or equal to -* `=` Equal. If no operator is specified, then equality is assumed, - so this operator is optional, but MAY be included. - -For example, the comparator `>=1.2.7` would match the versions -`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` -or `1.1.0`. - -Comparators can be joined by whitespace to form a `comparator set`, -which is satisfied by the **intersection** of all of the comparators -it includes. - -A range is composed of one or more comparator sets, joined by `||`. A -version matches a range if and only if every comparator in at least -one of the `||`-separated comparator sets is satisfied by the version. - -For example, the range `>=1.2.7 <1.3.0` would match the versions -`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, -or `1.1.0`. - -The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, -`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. - -### Prerelease Tags - -If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then -it will only be allowed to satisfy comparator sets if at least one -comparator with the same `[major, minor, patch]` tuple also has a -prerelease tag. - -For example, the range `>1.2.3-alpha.3` would be allowed to match the -version `1.2.3-alpha.7`, but it would *not* be satisfied by -`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater -than" `1.2.3-alpha.3` according to the SemVer sort rules. The version -range only accepts prerelease tags on the `1.2.3` version. The -version `3.4.5` *would* satisfy the range, because it does not have a -prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. - -The purpose for this behavior is twofold. First, prerelease versions -frequently are updated very quickly, and contain many breaking changes -that are (by the author's design) not yet fit for public consumption. -Therefore, by default, they are excluded from range matching -semantics. - -Second, a user who has opted into using a prerelease version has -clearly indicated the intent to use *that specific* set of -alpha/beta/rc versions. By including a prerelease tag in the range, -the user is indicating that they are aware of the risk. However, it -is still not appropriate to assume that they have opted into taking a -similar risk on the *next* set of prerelease versions. - -Note that this behavior can be suppressed (treating all prerelease -versions as if they were normal versions, for the purpose of range -matching) by setting the `includePrerelease` flag on the options -object to any -[functions](https://github.com/npm/node-semver#functions) that do -range matching. - -#### Prerelease Identifiers - -The method `.inc` takes an additional `identifier` string argument that -will append the value of the string as a prerelease identifier: - -```javascript -semver.inc('1.2.3', 'prerelease', 'beta') -// '1.2.4-beta.0' -``` - -command-line example: - -```bash -$ semver 1.2.3 -i prerelease --preid beta -1.2.4-beta.0 -``` - -Which then can be used to increment further: - -```bash -$ semver 1.2.4-beta.0 -i prerelease -1.2.4-beta.1 -``` - -### Advanced Range Syntax - -Advanced range syntax desugars to primitive comparators in -deterministic ways. - -Advanced ranges may be combined in the same way as primitive -comparators using white space or `||`. - -#### Hyphen Ranges `X.Y.Z - A.B.C` - -Specifies an inclusive set. - -* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` - -If a partial version is provided as the first version in the inclusive -range, then the missing pieces are replaced with zeroes. - -* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` - -If a partial version is provided as the second version in the -inclusive range, then all versions that start with the supplied parts -of the tuple are accepted, but nothing that would be greater than the -provided tuple parts. - -* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0` -* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0` - -#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` - -Any of `X`, `x`, or `*` may be used to "stand in" for one of the -numeric values in the `[major, minor, patch]` tuple. - -* `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless - `includePrerelease` is specified, in which case any version at all - satisfies) -* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version) -* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions) - -A partial version range is treated as an X-Range, so the special -character is in fact optional. - -* `""` (empty string) := `*` := `>=0.0.0` -* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0` -* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0` - -#### Tilde Ranges `~1.2.3` `~1.2` `~1` - -Allows patch-level changes if a minor version is specified on the -comparator. Allows minor-level changes if not. - -* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0` -* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`) -* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`) -* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0` -* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`) -* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`) -* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. - -#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` - -Allows changes that do not modify the left-most non-zero element in the -`[major, minor, patch]` tuple. In other words, this allows patch and -minor updates for versions `1.0.0` and above, patch updates for -versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. - -Many authors treat a `0.x` version as if the `x` were the major -"breaking-change" indicator. - -Caret ranges are ideal when an author may make breaking changes -between `0.2.4` and `0.3.0` releases, which is a common practice. -However, it presumes that there will *not* be breaking changes between -`0.2.4` and `0.2.5`. It allows for changes that are presumed to be -additive (but non-breaking), according to commonly observed practices. - -* `^1.2.3` := `>=1.2.3 <2.0.0-0` -* `^0.2.3` := `>=0.2.3 <0.3.0-0` -* `^0.0.3` := `>=0.0.3 <0.0.4-0` -* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. -* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the - `0.0.3` version *only* will be allowed, if they are greater than or - equal to `beta`. So, `0.0.3-pr.2` would be allowed. - -When parsing caret ranges, a missing `patch` value desugars to the -number `0`, but will allow flexibility within that value, even if the -major and minor versions are both `0`. - -* `^1.2.x` := `>=1.2.0 <2.0.0-0` -* `^0.0.x` := `>=0.0.0 <0.1.0-0` -* `^0.0` := `>=0.0.0 <0.1.0-0` - -A missing `minor` and `patch` values will desugar to zero, but also -allow flexibility within those values, even if the major version is -zero. - -* `^1.x` := `>=1.0.0 <2.0.0-0` -* `^0.x` := `>=0.0.0 <1.0.0-0` - -### Range Grammar - -Putting all this together, here is a Backus-Naur grammar for ranges, -for the benefit of parser authors: - -```bnf -range-set ::= range ( logical-or range ) * -logical-or ::= ( ' ' ) * '||' ( ' ' ) * -range ::= hyphen | simple ( ' ' simple ) * | '' -hyphen ::= partial ' - ' partial -simple ::= primitive | partial | tilde | caret -primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial -partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? -xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * -tilde ::= '~' partial -caret ::= '^' partial -qualifier ::= ( '-' pre )? ( '+' build )? -pre ::= parts -build ::= parts -parts ::= part ( '.' part ) * -part ::= nr | [-0-9A-Za-z]+ -``` - -## Functions - -All methods and classes take a final `options` object argument. All -options in this object are `false` by default. The options supported -are: - -- `loose` Be more forgiving about not-quite-valid semver strings. - (Any resulting output will always be 100% strict compliant, of - course.) For backwards compatibility reasons, if the `options` - argument is a boolean value instead of an object, it is interpreted - to be the `loose` param. -- `includePrerelease` Set to suppress the [default - behavior](https://github.com/npm/node-semver#prerelease-tags) of - excluding prerelease tagged versions from ranges unless they are - explicitly opted into. - -Strict-mode Comparators and Ranges will be strict about the SemVer -strings that they parse. - -* `valid(v)`: Return the parsed version, or null if it's not valid. -* `inc(v, release)`: Return the version incremented by the release - type (`major`, `premajor`, `minor`, `preminor`, `patch`, - `prepatch`, or `prerelease`), or null if it's not valid - * `premajor` in one call will bump the version up to the next major - version and down to a prerelease of that major version. - `preminor`, and `prepatch` work the same way. - * If called from a non-prerelease version, the `prerelease` will work the - same as `prepatch`. It increments the patch version, then makes a - prerelease. If the input version is already a prerelease it simply - increments it. -* `prerelease(v)`: Returns an array of prerelease components, or null - if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` -* `major(v)`: Return the major version number. -* `minor(v)`: Return the minor version number. -* `patch(v)`: Return the patch version number. -* `intersects(r1, r2, loose)`: Return true if the two supplied ranges - or comparators intersect. -* `parse(v)`: Attempt to parse a string as a semantic version, returning either - a `SemVer` object or `null`. - -### Comparison - -* `gt(v1, v2)`: `v1 > v2` -* `gte(v1, v2)`: `v1 >= v2` -* `lt(v1, v2)`: `v1 < v2` -* `lte(v1, v2)`: `v1 <= v2` -* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, - even if they're not the exact same string. You already know how to - compare strings. -* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. -* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call - the corresponding function above. `"==="` and `"!=="` do simple - string comparison, but are included for completeness. Throws if an - invalid comparison string is provided. -* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if - `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. -* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions - in descending order when passed to `Array.sort()`. -* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions - are equal. Sorts in ascending order if passed to `Array.sort()`. - `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. -* `diff(v1, v2)`: Returns difference between two versions by the release type - (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), - or null if the versions are the same. - -### Comparators - -* `intersects(comparator)`: Return true if the comparators intersect - -### Ranges - -* `validRange(range)`: Return the valid range or null if it's not valid -* `satisfies(version, range)`: Return true if the version satisfies the - range. -* `maxSatisfying(versions, range)`: Return the highest version in the list - that satisfies the range, or `null` if none of them do. -* `minSatisfying(versions, range)`: Return the lowest version in the list - that satisfies the range, or `null` if none of them do. -* `minVersion(range)`: Return the lowest version that can possibly match - the given range. -* `gtr(version, range)`: Return `true` if version is greater than all the - versions possible in the range. -* `ltr(version, range)`: Return `true` if version is less than all the - versions possible in the range. -* `outside(version, range, hilo)`: Return true if the version is outside - the bounds of the range in either the high or low direction. The - `hilo` argument must be either the string `'>'` or `'<'`. (This is - the function called by `gtr` and `ltr`.) -* `intersects(range)`: Return true if any of the ranges comparators intersect -* `simplifyRange(versions, range)`: Return a "simplified" range that - matches the same items in `versions` list as the range specified. Note - that it does *not* guarantee that it would match the same versions in all - cases, only for the set of versions provided. This is useful when - generating ranges by joining together multiple versions with `||` - programmatically, to provide the user with something a bit more - ergonomic. If the provided range is shorter in string-length than the - generated range, then that is returned. -* `subset(subRange, superRange)`: Return `true` if the `subRange` range is - entirely contained by the `superRange` range. - -Note that, since ranges may be non-contiguous, a version might not be -greater than a range, less than a range, *or* satisfy a range! For -example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` -until `2.0.0`, so the version `1.2.10` would not be greater than the -range (because `2.0.1` satisfies, which is higher), nor less than the -range (since `1.2.8` satisfies, which is lower), and it also does not -satisfy the range. - -If you want to know if a version satisfies or does not satisfy a -range, use the `satisfies(version, range)` function. - -### Coercion - -* `coerce(version, options)`: Coerces a string to semver if possible - -This aims to provide a very forgiving translation of a non-semver string to -semver. It looks for the first digit in a string, and consumes all -remaining characters which satisfy at least a partial semver (e.g., `1`, -`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer -versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All -surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes -`3.4.0`). Only text which lacks digits will fail coercion (`version one` -is not valid). The maximum length for any semver component considered for -coercion is 16 characters; longer components will be ignored -(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any -semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value -components are invalid (`9999999999999999.4.7.4` is likely invalid). - -If the `options.rtl` flag is set, then `coerce` will return the right-most -coercible tuple that does not share an ending index with a longer coercible -tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not -`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of -any other overlapping SemVer tuple. - -### Clean - -* `clean(version)`: Clean a string to be a valid semver if possible - -This will return a cleaned and trimmed semver version. If the provided -version is not valid a null will be returned. This does not work for -ranges. - -ex. -* `s.clean(' = v 2.1.5foo')`: `null` -* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` -* `s.clean(' = v 2.1.5-foo')`: `null` -* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` -* `s.clean('=v2.1.5')`: `'2.1.5'` -* `s.clean(' =v2.1.5')`: `2.1.5` -* `s.clean(' 2.1.5 ')`: `'2.1.5'` -* `s.clean('~1.0.0')`: `null` - -## Exported Modules - -<!-- -TODO: Make sure that all of these items are documented (classes aren't, -eg), and then pull the module name into the documentation for that specific -thing. ---> - -You may pull in just the part of this semver utility that you need, if you -are sensitive to packing and tree-shaking concerns. The main -`require('semver')` export uses getter functions to lazily load the parts -of the API that are used. - -The following modules are available: - -* `require('semver')` -* `require('semver/classes')` -* `require('semver/classes/comparator')` -* `require('semver/classes/range')` -* `require('semver/classes/semver')` -* `require('semver/functions/clean')` -* `require('semver/functions/cmp')` -* `require('semver/functions/coerce')` -* `require('semver/functions/compare')` -* `require('semver/functions/compare-build')` -* `require('semver/functions/compare-loose')` -* `require('semver/functions/diff')` -* `require('semver/functions/eq')` -* `require('semver/functions/gt')` -* `require('semver/functions/gte')` -* `require('semver/functions/inc')` -* `require('semver/functions/lt')` -* `require('semver/functions/lte')` -* `require('semver/functions/major')` -* `require('semver/functions/minor')` -* `require('semver/functions/neq')` -* `require('semver/functions/parse')` -* `require('semver/functions/patch')` -* `require('semver/functions/prerelease')` -* `require('semver/functions/rcompare')` -* `require('semver/functions/rsort')` -* `require('semver/functions/satisfies')` -* `require('semver/functions/sort')` -* `require('semver/functions/valid')` -* `require('semver/ranges/gtr')` -* `require('semver/ranges/intersects')` -* `require('semver/ranges/ltr')` -* `require('semver/ranges/max-satisfying')` -* `require('semver/ranges/min-satisfying')` -* `require('semver/ranges/min-version')` -* `require('semver/ranges/outside')` -* `require('semver/ranges/to-comparators')` -* `require('semver/ranges/valid')` diff --git a/node_modules/electron-packager/node_modules/semver/bin/semver.js b/node_modules/electron-packager/node_modules/semver/bin/semver.js deleted file mode 100755 index 8d1b557..0000000 --- a/node_modules/electron-packager/node_modules/semver/bin/semver.js +++ /dev/null @@ -1,183 +0,0 @@ -#!/usr/bin/env node -// Standalone semver comparison program. -// Exits successfully and prints matching version(s) if -// any supplied version is valid and passes all tests. - -const argv = process.argv.slice(2) - -let versions = [] - -const range = [] - -let inc = null - -const version = require('../package.json').version - -let loose = false - -let includePrerelease = false - -let coerce = false - -let rtl = false - -let identifier - -const semver = require('../') - -let reverse = false - -let options = {} - -const main = () => { - if (!argv.length) { - return help() - } - while (argv.length) { - let a = argv.shift() - const indexOfEqualSign = a.indexOf('=') - if (indexOfEqualSign !== -1) { - const value = a.slice(indexOfEqualSign + 1) - a = a.slice(0, indexOfEqualSign) - argv.unshift(value) - } - switch (a) { - case '-rv': case '-rev': case '--rev': case '--reverse': - reverse = true - break - case '-l': case '--loose': - loose = true - break - case '-p': case '--include-prerelease': - includePrerelease = true - break - case '-v': case '--version': - versions.push(argv.shift()) - break - case '-i': case '--inc': case '--increment': - switch (argv[0]) { - case 'major': case 'minor': case 'patch': case 'prerelease': - case 'premajor': case 'preminor': case 'prepatch': - inc = argv.shift() - break - default: - inc = 'patch' - break - } - break - case '--preid': - identifier = argv.shift() - break - case '-r': case '--range': - range.push(argv.shift()) - break - case '-c': case '--coerce': - coerce = true - break - case '--rtl': - rtl = true - break - case '--ltr': - rtl = false - break - case '-h': case '--help': case '-?': - return help() - default: - versions.push(a) - break - } - } - - options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl } - - versions = versions.map((v) => { - return coerce ? (semver.coerce(v, options) || { version: v }).version : v - }).filter((v) => { - return semver.valid(v) - }) - if (!versions.length) { - return fail() - } - if (inc && (versions.length !== 1 || range.length)) { - return failInc() - } - - for (let i = 0, l = range.length; i < l; i++) { - versions = versions.filter((v) => { - return semver.satisfies(v, range[i], options) - }) - if (!versions.length) { - return fail() - } - } - return success(versions) -} - -const failInc = () => { - console.error('--inc can only be used on a single version with no range') - fail() -} - -const fail = () => process.exit(1) - -const success = () => { - const compare = reverse ? 'rcompare' : 'compare' - versions.sort((a, b) => { - return semver[compare](a, b, options) - }).map((v) => { - return semver.clean(v, options) - }).map((v) => { - return inc ? semver.inc(v, inc, options, identifier) : v - }).forEach((v, i, _) => { - console.log(v) - }) -} - -const help = () => console.log( -`SemVer ${version} - -A JavaScript implementation of the https://semver.org/ specification -Copyright Isaac Z. Schlueter - -Usage: semver [options] <version> [<version> [...]] -Prints valid versions sorted by SemVer precedence - -Options: --r --range <range> - Print versions that match the specified range. - --i --increment [<level>] - Increment a version by the specified level. Level can - be one of: major, minor, patch, premajor, preminor, - prepatch, or prerelease. Default level is 'patch'. - Only one version may be specified. - ---preid <identifier> - Identifier to be used to prefix premajor, preminor, - prepatch or prerelease version increments. - --l --loose - Interpret versions and ranges loosely - --p --include-prerelease - Always include prerelease versions in range matching - --c --coerce - Coerce a string into SemVer if possible - (does not imply --loose) - ---rtl - Coerce version strings right to left - ---ltr - Coerce version strings left to right (default) - -Program exits successfully if any valid version satisfies -all supplied ranges, and prints all satisfying versions. - -If no satisfying versions are found, then exits failure. - -Versions are printed in ascending order, so supplying -multiple versions to the utility will just sort them.`) - -main() diff --git a/node_modules/electron-packager/node_modules/semver/classes/comparator.js b/node_modules/electron-packager/node_modules/semver/classes/comparator.js deleted file mode 100644 index 62cd204..0000000 --- a/node_modules/electron-packager/node_modules/semver/classes/comparator.js +++ /dev/null @@ -1,136 +0,0 @@ -const ANY = Symbol('SemVer ANY') -// hoisted class for cyclic dependency -class Comparator { - static get ANY () { - return ANY - } - - constructor (comp, options) { - options = parseOptions(options) - - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp - } else { - comp = comp.value - } - } - - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) - - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version - } - - debug('comp', this) - } - - parse (comp) { - const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - const m = comp.match(r) - - if (!m) { - throw new TypeError(`Invalid comparator: ${comp}`) - } - - this.operator = m[1] !== undefined ? m[1] : '' - if (this.operator === '=') { - this.operator = '' - } - - // if it literally is just '>' or '' then allow anything. - if (!m[2]) { - this.semver = ANY - } else { - this.semver = new SemVer(m[2], this.options.loose) - } - } - - toString () { - return this.value - } - - test (version) { - debug('Comparator.test', version, this.options.loose) - - if (this.semver === ANY || version === ANY) { - return true - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } - - return cmp(version, this.operator, this.semver, this.options) - } - - intersects (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') - } - - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false, - } - } - - if (this.operator === '') { - if (this.value === '') { - return true - } - return new Range(comp.value, options).test(this.value) - } else if (comp.operator === '') { - if (comp.value === '') { - return true - } - return new Range(this.value, options).test(comp.semver) - } - - const sameDirectionIncreasing = - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '>=' || comp.operator === '>') - const sameDirectionDecreasing = - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '<=' || comp.operator === '<') - const sameSemVer = this.semver.version === comp.semver.version - const differentDirectionsInclusive = - (this.operator === '>=' || this.operator === '<=') && - (comp.operator === '>=' || comp.operator === '<=') - const oppositeDirectionsLessThan = - cmp(this.semver, '<', comp.semver, options) && - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '<=' || comp.operator === '<') - const oppositeDirectionsGreaterThan = - cmp(this.semver, '>', comp.semver, options) && - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '>=' || comp.operator === '>') - - return ( - sameDirectionIncreasing || - sameDirectionDecreasing || - (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || - oppositeDirectionsGreaterThan - ) - } -} - -module.exports = Comparator - -const parseOptions = require('../internal/parse-options') -const { re, t } = require('../internal/re') -const cmp = require('../functions/cmp') -const debug = require('../internal/debug') -const SemVer = require('./semver') -const Range = require('./range') diff --git a/node_modules/electron-packager/node_modules/semver/classes/index.js b/node_modules/electron-packager/node_modules/semver/classes/index.js deleted file mode 100644 index 5e3f5c9..0000000 --- a/node_modules/electron-packager/node_modules/semver/classes/index.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - SemVer: require('./semver.js'), - Range: require('./range.js'), - Comparator: require('./comparator.js'), -} diff --git a/node_modules/electron-packager/node_modules/semver/classes/range.js b/node_modules/electron-packager/node_modules/semver/classes/range.js deleted file mode 100644 index 7dc24bc..0000000 --- a/node_modules/electron-packager/node_modules/semver/classes/range.js +++ /dev/null @@ -1,519 +0,0 @@ -// hoisted class for cyclic dependency -class Range { - constructor (range, options) { - options = parseOptions(options) - - if (range instanceof Range) { - if ( - range.loose === !!options.loose && - range.includePrerelease === !!options.includePrerelease - ) { - return range - } else { - return new Range(range.raw, options) - } - } - - if (range instanceof Comparator) { - // just put it in the set and return - this.raw = range.value - this.set = [[range]] - this.format() - return this - } - - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease - - // First, split based on boolean or || - this.raw = range - this.set = range - .split('||') - // map the range to a 2d array of comparators - .map(r => this.parseRange(r.trim())) - // throw out any comparator lists that are empty - // this generally means that it was not a valid range, which is allowed - // in loose mode, but will still throw if the WHOLE range is invalid. - .filter(c => c.length) - - if (!this.set.length) { - throw new TypeError(`Invalid SemVer Range: ${range}`) - } - - // if we have any that are not the null set, throw out null sets. - if (this.set.length > 1) { - // keep the first one, in case they're all null sets - const first = this.set[0] - this.set = this.set.filter(c => !isNullSet(c[0])) - if (this.set.length === 0) { - this.set = [first] - } else if (this.set.length > 1) { - // if we have any that are *, then the range is just * - for (const c of this.set) { - if (c.length === 1 && isAny(c[0])) { - this.set = [c] - break - } - } - } - } - - this.format() - } - - format () { - this.range = this.set - .map((comps) => { - return comps.join(' ').trim() - }) - .join('||') - .trim() - return this.range - } - - toString () { - return this.range - } - - parseRange (range) { - range = range.trim() - - // memoize range parsing for performance. - // this is a very hot path, and fully deterministic. - const memoOpts = Object.keys(this.options).join(',') - const memoKey = `parseRange:${memoOpts}:${range}` - const cached = cache.get(memoKey) - if (cached) { - return cached - } - - const loose = this.options.loose - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] - range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) - debug('hyphen replace', range) - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range) - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace) - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace) - - // normalize spaces - range = range.split(/\s+/).join(' ') - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - let rangeList = range - .split(' ') - .map(comp => parseComparator(comp, this.options)) - .join(' ') - .split(/\s+/) - // >=0.0.0 is equivalent to * - .map(comp => replaceGTE0(comp, this.options)) - - if (loose) { - // in loose mode, throw out any that are not valid comparators - rangeList = rangeList.filter(comp => { - debug('loose invalid filter', comp, this.options) - return !!comp.match(re[t.COMPARATORLOOSE]) - }) - } - debug('range list', rangeList) - - // if any comparators are the null set, then replace with JUST null set - // if more than one comparator, remove any * comparators - // also, don't include the same comparator more than once - const rangeMap = new Map() - const comparators = rangeList.map(comp => new Comparator(comp, this.options)) - for (const comp of comparators) { - if (isNullSet(comp)) { - return [comp] - } - rangeMap.set(comp.value, comp) - } - if (rangeMap.size > 1 && rangeMap.has('')) { - rangeMap.delete('') - } - - const result = [...rangeMap.values()] - cache.set(memoKey, result) - return result - } - - intersects (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required') - } - - return this.set.some((thisComparators) => { - return ( - isSatisfiable(thisComparators, options) && - range.set.some((rangeComparators) => { - return ( - isSatisfiable(rangeComparators, options) && - thisComparators.every((thisComparator) => { - return rangeComparators.every((rangeComparator) => { - return thisComparator.intersects(rangeComparator, options) - }) - }) - ) - }) - ) - }) - } - - // if ANY of the sets match ALL of its comparators, then pass - test (version) { - if (!version) { - return false - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } - - for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true - } - } - return false - } -} -module.exports = Range - -const LRU = require('lru-cache') -const cache = new LRU({ max: 1000 }) - -const parseOptions = require('../internal/parse-options') -const Comparator = require('./comparator') -const debug = require('../internal/debug') -const SemVer = require('./semver') -const { - re, - t, - comparatorTrimReplace, - tildeTrimReplace, - caretTrimReplace, -} = require('../internal/re') - -const isNullSet = c => c.value === '<0.0.0-0' -const isAny = c => c.value === '' - -// take a set of comparators and determine whether there -// exists a version which can satisfy it -const isSatisfiable = (comparators, options) => { - let result = true - const remainingComparators = comparators.slice() - let testComparator = remainingComparators.pop() - - while (result && remainingComparators.length) { - result = remainingComparators.every((otherComparator) => { - return testComparator.intersects(otherComparator, options) - }) - - testComparator = remainingComparators.pop() - } - - return result -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -const parseComparator = (comp, options) => { - debug('comp', comp, options) - comp = replaceCarets(comp, options) - debug('caret', comp) - comp = replaceTildes(comp, options) - debug('tildes', comp) - comp = replaceXRanges(comp, options) - debug('xrange', comp) - comp = replaceStars(comp, options) - debug('stars', comp) - return comp -} - -const isX = id => !id || id.toLowerCase() === 'x' || id === '*' - -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 -const replaceTildes = (comp, options) => - comp.trim().split(/\s+/).map((c) => { - return replaceTilde(c, options) - }).join(' ') - -const replaceTilde = (comp, options) => { - const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] - return comp.replace(r, (_, M, m, p, pr) => { - debug('tilde', comp, _, M, m, p, pr) - let ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = `>=${M}.0.0 <${+M + 1}.0.0-0` - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0-0 - ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` - } else if (pr) { - debug('replaceTilde pr', pr) - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${+m + 1}.0-0` - } else { - // ~1.2.3 == >=1.2.3 <1.3.0-0 - ret = `>=${M}.${m}.${p - } <${M}.${+m + 1}.0-0` - } - - debug('tilde return', ret) - return ret - }) -} - -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 -// ^1.2.3 --> >=1.2.3 <2.0.0-0 -// ^1.2.0 --> >=1.2.0 <2.0.0-0 -const replaceCarets = (comp, options) => - comp.trim().split(/\s+/).map((c) => { - return replaceCaret(c, options) - }).join(' ') - -const replaceCaret = (comp, options) => { - debug('caret', comp, options) - const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] - const z = options.includePrerelease ? '-0' : '' - return comp.replace(r, (_, M, m, p, pr) => { - debug('caret', comp, _, M, m, p, pr) - let ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` - } else if (isX(p)) { - if (M === '0') { - ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` - } else { - ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` - } - } else if (pr) { - debug('replaceCaret pr', pr) - if (M === '0') { - if (m === '0') { - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${m}.${+p + 1}-0` - } else { - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${+m + 1}.0-0` - } - } else { - ret = `>=${M}.${m}.${p}-${pr - } <${+M + 1}.0.0-0` - } - } else { - debug('no pr') - if (M === '0') { - if (m === '0') { - ret = `>=${M}.${m}.${p - }${z} <${M}.${m}.${+p + 1}-0` - } else { - ret = `>=${M}.${m}.${p - }${z} <${M}.${+m + 1}.0-0` - } - } else { - ret = `>=${M}.${m}.${p - } <${+M + 1}.0.0-0` - } - } - - debug('caret return', ret) - return ret - }) -} - -const replaceXRanges = (comp, options) => { - debug('replaceXRanges', comp, options) - return comp.split(/\s+/).map((c) => { - return replaceXRange(c, options) - }).join(' ') -} - -const replaceXRange = (comp, options) => { - comp = comp.trim() - const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] - return comp.replace(r, (ret, gtlt, M, m, p, pr) => { - debug('xRange', comp, ret, gtlt, M, m, p, pr) - const xM = isX(M) - const xm = xM || isX(m) - const xp = xm || isX(p) - const anyX = xp - - if (gtlt === '=' && anyX) { - gtlt = '' - } - - // if we're including prereleases in the match, then we need - // to fix this to -0, the lowest possible prerelease value - pr = options.includePrerelease ? '-0' : '' - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0-0' - } else { - // nothing is forbidden - ret = '*' - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0 - } - p = 0 - - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - gtlt = '>=' - if (xm) { - M = +M + 1 - m = 0 - p = 0 - } else { - m = +m + 1 - p = 0 - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) { - M = +M + 1 - } else { - m = +m + 1 - } - } - - if (gtlt === '<') { - pr = '-0' - } - - ret = `${gtlt + M}.${m}.${p}${pr}` - } else if (xm) { - ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` - } else if (xp) { - ret = `>=${M}.${m}.0${pr - } <${M}.${+m + 1}.0-0` - } - - debug('xRange return', ret) - - return ret - }) -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -const replaceStars = (comp, options) => { - debug('replaceStars', comp, options) - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[t.STAR], '') -} - -const replaceGTE0 = (comp, options) => { - debug('replaceGTE0', comp, options) - return comp.trim() - .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') -} - -// This function is passed to string.replace(re[t.HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 -const hyphenReplace = incPr => ($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) => { - if (isX(fM)) { - from = '' - } else if (isX(fm)) { - from = `>=${fM}.0.0${incPr ? '-0' : ''}` - } else if (isX(fp)) { - from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` - } else if (fpr) { - from = `>=${from}` - } else { - from = `>=${from}${incPr ? '-0' : ''}` - } - - if (isX(tM)) { - to = '' - } else if (isX(tm)) { - to = `<${+tM + 1}.0.0-0` - } else if (isX(tp)) { - to = `<${tM}.${+tm + 1}.0-0` - } else if (tpr) { - to = `<=${tM}.${tm}.${tp}-${tpr}` - } else if (incPr) { - to = `<${tM}.${tm}.${+tp + 1}-0` - } else { - to = `<=${to}` - } - - return (`${from} ${to}`).trim() -} - -const testSet = (set, version, options) => { - for (let i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false - } - } - - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (let i = 0; i < set.length; i++) { - debug(set[i].semver) - if (set[i].semver === Comparator.ANY) { - continue - } - - if (set[i].semver.prerelease.length > 0) { - const allowed = set[i].semver - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) { - return true - } - } - } - - // Version has a -pre, but it's not one of the ones we like. - return false - } - - return true -} diff --git a/node_modules/electron-packager/node_modules/semver/classes/semver.js b/node_modules/electron-packager/node_modules/semver/classes/semver.js deleted file mode 100644 index af62955..0000000 --- a/node_modules/electron-packager/node_modules/semver/classes/semver.js +++ /dev/null @@ -1,287 +0,0 @@ -const debug = require('../internal/debug') -const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants') -const { re, t } = require('../internal/re') - -const parseOptions = require('../internal/parse-options') -const { compareIdentifiers } = require('../internal/identifiers') -class SemVer { - constructor (version, options) { - options = parseOptions(options) - - if (version instanceof SemVer) { - if (version.loose === !!options.loose && - version.includePrerelease === !!options.includePrerelease) { - return version - } else { - version = version.version - } - } else if (typeof version !== 'string') { - throw new TypeError(`Invalid Version: ${version}`) - } - - if (version.length > MAX_LENGTH) { - throw new TypeError( - `version is longer than ${MAX_LENGTH} characters` - ) - } - - debug('SemVer', version, options) - this.options = options - this.loose = !!options.loose - // this isn't actually relevant for versions, but keep it so that we - // don't run into trouble passing this.options around. - this.includePrerelease = !!options.includePrerelease - - const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) - - if (!m) { - throw new TypeError(`Invalid Version: ${version}`) - } - - this.raw = version - - // these are actually numbers - this.major = +m[1] - this.minor = +m[2] - this.patch = +m[3] - - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version') - } - - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version') - } - - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version') - } - - // numberify any prerelease numeric ids - if (!m[4]) { - this.prerelease = [] - } else { - this.prerelease = m[4].split('.').map((id) => { - if (/^[0-9]+$/.test(id)) { - const num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num - } - } - return id - }) - } - - this.build = m[5] ? m[5].split('.') : [] - this.format() - } - - format () { - this.version = `${this.major}.${this.minor}.${this.patch}` - if (this.prerelease.length) { - this.version += `-${this.prerelease.join('.')}` - } - return this.version - } - - toString () { - return this.version - } - - compare (other) { - debug('SemVer.compare', this.version, this.options, other) - if (!(other instanceof SemVer)) { - if (typeof other === 'string' && other === this.version) { - return 0 - } - other = new SemVer(other, this.options) - } - - if (other.version === this.version) { - return 0 - } - - return this.compareMain(other) || this.comparePre(other) - } - - compareMain (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - return ( - compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) - ) - } - - comparePre (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) { - return -1 - } else if (!this.prerelease.length && other.prerelease.length) { - return 1 - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0 - } - - let i = 0 - do { - const a = this.prerelease[i] - const b = other.prerelease[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) - } - - compareBuild (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - let i = 0 - do { - const a = this.build[i] - const b = other.build[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) - } - - // preminor will bump the version up to the next minor release, and immediately - // down to pre-release. premajor and prepatch work the same way. - inc (release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0 - this.patch = 0 - this.minor = 0 - this.major++ - this.inc('pre', identifier) - break - case 'preminor': - this.prerelease.length = 0 - this.patch = 0 - this.minor++ - this.inc('pre', identifier) - break - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0 - this.inc('patch', identifier) - this.inc('pre', identifier) - break - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier) - } - this.inc('pre', identifier) - break - - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if ( - this.minor !== 0 || - this.patch !== 0 || - this.prerelease.length === 0 - ) { - this.major++ - } - this.minor = 0 - this.patch = 0 - this.prerelease = [] - break - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++ - } - this.patch = 0 - this.prerelease = [] - break - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++ - } - this.prerelease = [] - break - // This probably shouldn't be used publicly. - // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. - case 'pre': - if (this.prerelease.length === 0) { - this.prerelease = [0] - } else { - let i = this.prerelease.length - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++ - i = -2 - } - } - if (i === -1) { - // didn't increment anything - this.prerelease.push(0) - } - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (compareIdentifiers(this.prerelease[0], identifier) === 0) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0] - } - } else { - this.prerelease = [identifier, 0] - } - } - break - - default: - throw new Error(`invalid increment argument: ${release}`) - } - this.format() - this.raw = this.version - return this - } -} - -module.exports = SemVer diff --git a/node_modules/electron-packager/node_modules/semver/functions/clean.js b/node_modules/electron-packager/node_modules/semver/functions/clean.js deleted file mode 100644 index 811fe6b..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/clean.js +++ /dev/null @@ -1,6 +0,0 @@ -const parse = require('./parse') -const clean = (version, options) => { - const s = parse(version.trim().replace(/^[=v]+/, ''), options) - return s ? s.version : null -} -module.exports = clean diff --git a/node_modules/electron-packager/node_modules/semver/functions/cmp.js b/node_modules/electron-packager/node_modules/semver/functions/cmp.js deleted file mode 100644 index 4011909..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/cmp.js +++ /dev/null @@ -1,52 +0,0 @@ -const eq = require('./eq') -const neq = require('./neq') -const gt = require('./gt') -const gte = require('./gte') -const lt = require('./lt') -const lte = require('./lte') - -const cmp = (a, op, b, loose) => { - switch (op) { - case '===': - if (typeof a === 'object') { - a = a.version - } - if (typeof b === 'object') { - b = b.version - } - return a === b - - case '!==': - if (typeof a === 'object') { - a = a.version - } - if (typeof b === 'object') { - b = b.version - } - return a !== b - - case '': - case '=': - case '==': - return eq(a, b, loose) - - case '!=': - return neq(a, b, loose) - - case '>': - return gt(a, b, loose) - - case '>=': - return gte(a, b, loose) - - case '<': - return lt(a, b, loose) - - case '<=': - return lte(a, b, loose) - - default: - throw new TypeError(`Invalid operator: ${op}`) - } -} -module.exports = cmp diff --git a/node_modules/electron-packager/node_modules/semver/functions/coerce.js b/node_modules/electron-packager/node_modules/semver/functions/coerce.js deleted file mode 100644 index 2e01452..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/coerce.js +++ /dev/null @@ -1,52 +0,0 @@ -const SemVer = require('../classes/semver') -const parse = require('./parse') -const { re, t } = require('../internal/re') - -const coerce = (version, options) => { - if (version instanceof SemVer) { - return version - } - - if (typeof version === 'number') { - version = String(version) - } - - if (typeof version !== 'string') { - return null - } - - options = options || {} - - let match = null - if (!options.rtl) { - match = version.match(re[t.COERCE]) - } else { - // Find the right-most coercible string that does not share - // a terminus with a more left-ward coercible string. - // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' - // - // Walk through the string checking with a /g regexp - // Manually set the index so as to pick up overlapping matches. - // Stop when we get a match that ends at the string end, since no - // coercible string can be more right-ward without the same terminus. - let next - while ((next = re[t.COERCERTL].exec(version)) && - (!match || match.index + match[0].length !== version.length) - ) { - if (!match || - next.index + next[0].length !== match.index + match[0].length) { - match = next - } - re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length - } - // leave it in a clean state - re[t.COERCERTL].lastIndex = -1 - } - - if (match === null) { - return null - } - - return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) -} -module.exports = coerce diff --git a/node_modules/electron-packager/node_modules/semver/functions/compare-build.js b/node_modules/electron-packager/node_modules/semver/functions/compare-build.js deleted file mode 100644 index 9eb881b..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/compare-build.js +++ /dev/null @@ -1,7 +0,0 @@ -const SemVer = require('../classes/semver') -const compareBuild = (a, b, loose) => { - const versionA = new SemVer(a, loose) - const versionB = new SemVer(b, loose) - return versionA.compare(versionB) || versionA.compareBuild(versionB) -} -module.exports = compareBuild diff --git a/node_modules/electron-packager/node_modules/semver/functions/compare-loose.js b/node_modules/electron-packager/node_modules/semver/functions/compare-loose.js deleted file mode 100644 index 4881fbe..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/compare-loose.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const compareLoose = (a, b) => compare(a, b, true) -module.exports = compareLoose diff --git a/node_modules/electron-packager/node_modules/semver/functions/compare.js b/node_modules/electron-packager/node_modules/semver/functions/compare.js deleted file mode 100644 index 748b7af..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/compare.js +++ /dev/null @@ -1,5 +0,0 @@ -const SemVer = require('../classes/semver') -const compare = (a, b, loose) => - new SemVer(a, loose).compare(new SemVer(b, loose)) - -module.exports = compare diff --git a/node_modules/electron-packager/node_modules/semver/functions/diff.js b/node_modules/electron-packager/node_modules/semver/functions/diff.js deleted file mode 100644 index 87200ef..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/diff.js +++ /dev/null @@ -1,23 +0,0 @@ -const parse = require('./parse') -const eq = require('./eq') - -const diff = (version1, version2) => { - if (eq(version1, version2)) { - return null - } else { - const v1 = parse(version1) - const v2 = parse(version2) - const hasPre = v1.prerelease.length || v2.prerelease.length - const prefix = hasPre ? 'pre' : '' - const defaultResult = hasPre ? 'prerelease' : '' - for (const key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return prefix + key - } - } - } - return defaultResult // may be undefined - } -} -module.exports = diff diff --git a/node_modules/electron-packager/node_modules/semver/functions/eq.js b/node_modules/electron-packager/node_modules/semver/functions/eq.js deleted file mode 100644 index 271fed9..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/eq.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const eq = (a, b, loose) => compare(a, b, loose) === 0 -module.exports = eq diff --git a/node_modules/electron-packager/node_modules/semver/functions/gt.js b/node_modules/electron-packager/node_modules/semver/functions/gt.js deleted file mode 100644 index d9b2156..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/gt.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const gt = (a, b, loose) => compare(a, b, loose) > 0 -module.exports = gt diff --git a/node_modules/electron-packager/node_modules/semver/functions/gte.js b/node_modules/electron-packager/node_modules/semver/functions/gte.js deleted file mode 100644 index 5aeaa63..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/gte.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const gte = (a, b, loose) => compare(a, b, loose) >= 0 -module.exports = gte diff --git a/node_modules/electron-packager/node_modules/semver/functions/inc.js b/node_modules/electron-packager/node_modules/semver/functions/inc.js deleted file mode 100644 index 62d1da2..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/inc.js +++ /dev/null @@ -1,18 +0,0 @@ -const SemVer = require('../classes/semver') - -const inc = (version, release, options, identifier) => { - if (typeof (options) === 'string') { - identifier = options - options = undefined - } - - try { - return new SemVer( - version instanceof SemVer ? version.version : version, - options - ).inc(release, identifier).version - } catch (er) { - return null - } -} -module.exports = inc diff --git a/node_modules/electron-packager/node_modules/semver/functions/lt.js b/node_modules/electron-packager/node_modules/semver/functions/lt.js deleted file mode 100644 index b440ab7..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/lt.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const lt = (a, b, loose) => compare(a, b, loose) < 0 -module.exports = lt diff --git a/node_modules/electron-packager/node_modules/semver/functions/lte.js b/node_modules/electron-packager/node_modules/semver/functions/lte.js deleted file mode 100644 index 6dcc956..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/lte.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const lte = (a, b, loose) => compare(a, b, loose) <= 0 -module.exports = lte diff --git a/node_modules/electron-packager/node_modules/semver/functions/major.js b/node_modules/electron-packager/node_modules/semver/functions/major.js deleted file mode 100644 index 4283165..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/major.js +++ /dev/null @@ -1,3 +0,0 @@ -const SemVer = require('../classes/semver') -const major = (a, loose) => new SemVer(a, loose).major -module.exports = major diff --git a/node_modules/electron-packager/node_modules/semver/functions/minor.js b/node_modules/electron-packager/node_modules/semver/functions/minor.js deleted file mode 100644 index 57b3455..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/minor.js +++ /dev/null @@ -1,3 +0,0 @@ -const SemVer = require('../classes/semver') -const minor = (a, loose) => new SemVer(a, loose).minor -module.exports = minor diff --git a/node_modules/electron-packager/node_modules/semver/functions/neq.js b/node_modules/electron-packager/node_modules/semver/functions/neq.js deleted file mode 100644 index f944c01..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/neq.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const neq = (a, b, loose) => compare(a, b, loose) !== 0 -module.exports = neq diff --git a/node_modules/electron-packager/node_modules/semver/functions/parse.js b/node_modules/electron-packager/node_modules/semver/functions/parse.js deleted file mode 100644 index a66663a..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/parse.js +++ /dev/null @@ -1,33 +0,0 @@ -const { MAX_LENGTH } = require('../internal/constants') -const { re, t } = require('../internal/re') -const SemVer = require('../classes/semver') - -const parseOptions = require('../internal/parse-options') -const parse = (version, options) => { - options = parseOptions(options) - - if (version instanceof SemVer) { - return version - } - - if (typeof version !== 'string') { - return null - } - - if (version.length > MAX_LENGTH) { - return null - } - - const r = options.loose ? re[t.LOOSE] : re[t.FULL] - if (!r.test(version)) { - return null - } - - try { - return new SemVer(version, options) - } catch (er) { - return null - } -} - -module.exports = parse diff --git a/node_modules/electron-packager/node_modules/semver/functions/patch.js b/node_modules/electron-packager/node_modules/semver/functions/patch.js deleted file mode 100644 index 63afca2..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/patch.js +++ /dev/null @@ -1,3 +0,0 @@ -const SemVer = require('../classes/semver') -const patch = (a, loose) => new SemVer(a, loose).patch -module.exports = patch diff --git a/node_modules/electron-packager/node_modules/semver/functions/prerelease.js b/node_modules/electron-packager/node_modules/semver/functions/prerelease.js deleted file mode 100644 index 06aa132..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/prerelease.js +++ /dev/null @@ -1,6 +0,0 @@ -const parse = require('./parse') -const prerelease = (version, options) => { - const parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null -} -module.exports = prerelease diff --git a/node_modules/electron-packager/node_modules/semver/functions/rcompare.js b/node_modules/electron-packager/node_modules/semver/functions/rcompare.js deleted file mode 100644 index 0ac509e..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/rcompare.js +++ /dev/null @@ -1,3 +0,0 @@ -const compare = require('./compare') -const rcompare = (a, b, loose) => compare(b, a, loose) -module.exports = rcompare diff --git a/node_modules/electron-packager/node_modules/semver/functions/rsort.js b/node_modules/electron-packager/node_modules/semver/functions/rsort.js deleted file mode 100644 index 82404c5..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/rsort.js +++ /dev/null @@ -1,3 +0,0 @@ -const compareBuild = require('./compare-build') -const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) -module.exports = rsort diff --git a/node_modules/electron-packager/node_modules/semver/functions/satisfies.js b/node_modules/electron-packager/node_modules/semver/functions/satisfies.js deleted file mode 100644 index 50af1c1..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/satisfies.js +++ /dev/null @@ -1,10 +0,0 @@ -const Range = require('../classes/range') -const satisfies = (version, range, options) => { - try { - range = new Range(range, options) - } catch (er) { - return false - } - return range.test(version) -} -module.exports = satisfies diff --git a/node_modules/electron-packager/node_modules/semver/functions/sort.js b/node_modules/electron-packager/node_modules/semver/functions/sort.js deleted file mode 100644 index 4d10917..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/sort.js +++ /dev/null @@ -1,3 +0,0 @@ -const compareBuild = require('./compare-build') -const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) -module.exports = sort diff --git a/node_modules/electron-packager/node_modules/semver/functions/valid.js b/node_modules/electron-packager/node_modules/semver/functions/valid.js deleted file mode 100644 index f27bae1..0000000 --- a/node_modules/electron-packager/node_modules/semver/functions/valid.js +++ /dev/null @@ -1,6 +0,0 @@ -const parse = require('./parse') -const valid = (version, options) => { - const v = parse(version, options) - return v ? v.version : null -} -module.exports = valid diff --git a/node_modules/electron-packager/node_modules/semver/index.js b/node_modules/electron-packager/node_modules/semver/index.js deleted file mode 100644 index 57e2ae6..0000000 --- a/node_modules/electron-packager/node_modules/semver/index.js +++ /dev/null @@ -1,48 +0,0 @@ -// just pre-load all the stuff that index.js lazily exports -const internalRe = require('./internal/re') -module.exports = { - re: internalRe.re, - src: internalRe.src, - tokens: internalRe.t, - SEMVER_SPEC_VERSION: require('./internal/constants').SEMVER_SPEC_VERSION, - SemVer: require('./classes/semver'), - compareIdentifiers: require('./internal/identifiers').compareIdentifiers, - rcompareIdentifiers: require('./internal/identifiers').rcompareIdentifiers, - parse: require('./functions/parse'), - valid: require('./functions/valid'), - clean: require('./functions/clean'), - inc: require('./functions/inc'), - diff: require('./functions/diff'), - major: require('./functions/major'), - minor: require('./functions/minor'), - patch: require('./functions/patch'), - prerelease: require('./functions/prerelease'), - compare: require('./functions/compare'), - rcompare: require('./functions/rcompare'), - compareLoose: require('./functions/compare-loose'), - compareBuild: require('./functions/compare-build'), - sort: require('./functions/sort'), - rsort: require('./functions/rsort'), - gt: require('./functions/gt'), - lt: require('./functions/lt'), - eq: require('./functions/eq'), - neq: require('./functions/neq'), - gte: require('./functions/gte'), - lte: require('./functions/lte'), - cmp: require('./functions/cmp'), - coerce: require('./functions/coerce'), - Comparator: require('./classes/comparator'), - Range: require('./classes/range'), - satisfies: require('./functions/satisfies'), - toComparators: require('./ranges/to-comparators'), - maxSatisfying: require('./ranges/max-satisfying'), - minSatisfying: require('./ranges/min-satisfying'), - minVersion: require('./ranges/min-version'), - validRange: require('./ranges/valid'), - outside: require('./ranges/outside'), - gtr: require('./ranges/gtr'), - ltr: require('./ranges/ltr'), - intersects: require('./ranges/intersects'), - simplifyRange: require('./ranges/simplify'), - subset: require('./ranges/subset'), -} diff --git a/node_modules/electron-packager/node_modules/semver/internal/constants.js b/node_modules/electron-packager/node_modules/semver/internal/constants.js deleted file mode 100644 index 4f0de59..0000000 --- a/node_modules/electron-packager/node_modules/semver/internal/constants.js +++ /dev/null @@ -1,17 +0,0 @@ -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -const SEMVER_SPEC_VERSION = '2.0.0' - -const MAX_LENGTH = 256 -const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || -/* istanbul ignore next */ 9007199254740991 - -// Max safe segment length for coercion. -const MAX_SAFE_COMPONENT_LENGTH = 16 - -module.exports = { - SEMVER_SPEC_VERSION, - MAX_LENGTH, - MAX_SAFE_INTEGER, - MAX_SAFE_COMPONENT_LENGTH, -} diff --git a/node_modules/electron-packager/node_modules/semver/internal/debug.js b/node_modules/electron-packager/node_modules/semver/internal/debug.js deleted file mode 100644 index 1c00e13..0000000 --- a/node_modules/electron-packager/node_modules/semver/internal/debug.js +++ /dev/null @@ -1,9 +0,0 @@ -const debug = ( - typeof process === 'object' && - process.env && - process.env.NODE_DEBUG && - /\bsemver\b/i.test(process.env.NODE_DEBUG) -) ? (...args) => console.error('SEMVER', ...args) - : () => {} - -module.exports = debug diff --git a/node_modules/electron-packager/node_modules/semver/internal/identifiers.js b/node_modules/electron-packager/node_modules/semver/internal/identifiers.js deleted file mode 100644 index e612d0a..0000000 --- a/node_modules/electron-packager/node_modules/semver/internal/identifiers.js +++ /dev/null @@ -1,23 +0,0 @@ -const numeric = /^[0-9]+$/ -const compareIdentifiers = (a, b) => { - const anum = numeric.test(a) - const bnum = numeric.test(b) - - if (anum && bnum) { - a = +a - b = +b - } - - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 -} - -const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) - -module.exports = { - compareIdentifiers, - rcompareIdentifiers, -} diff --git a/node_modules/electron-packager/node_modules/semver/internal/parse-options.js b/node_modules/electron-packager/node_modules/semver/internal/parse-options.js deleted file mode 100644 index bbd9ec7..0000000 --- a/node_modules/electron-packager/node_modules/semver/internal/parse-options.js +++ /dev/null @@ -1,11 +0,0 @@ -// parse out just the options we care about so we always get a consistent -// obj with keys in a consistent order. -const opts = ['includePrerelease', 'loose', 'rtl'] -const parseOptions = options => - !options ? {} - : typeof options !== 'object' ? { loose: true } - : opts.filter(k => options[k]).reduce((o, k) => { - o[k] = true - return o - }, {}) -module.exports = parseOptions diff --git a/node_modules/electron-packager/node_modules/semver/internal/re.js b/node_modules/electron-packager/node_modules/semver/internal/re.js deleted file mode 100644 index ed88398..0000000 --- a/node_modules/electron-packager/node_modules/semver/internal/re.js +++ /dev/null @@ -1,182 +0,0 @@ -const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants') -const debug = require('./debug') -exports = module.exports = {} - -// The actual regexps go on exports.re -const re = exports.re = [] -const src = exports.src = [] -const t = exports.t = {} -let R = 0 - -const createToken = (name, value, isGlobal) => { - const index = R++ - debug(name, index, value) - t[name] = index - src[index] = value - re[index] = new RegExp(value, isGlobal ? 'g' : undefined) -} - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') -createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+') - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*') - -// ## Main Version -// Three dot-separated numeric identifiers. - -createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})`) - -createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})`) - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] -}|${src[t.NONNUMERICIDENTIFIER]})`) - -createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] -}|${src[t.NONNUMERICIDENTIFIER]})`) - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] -}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) - -createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] -}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+') - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] -}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. - -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -createToken('FULLPLAIN', `v?${src[t.MAINVERSION] -}${src[t.PRERELEASE]}?${ - src[t.BUILD]}?`) - -createToken('FULL', `^${src[t.FULLPLAIN]}$`) - -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] -}${src[t.PRERELEASELOOSE]}?${ - src[t.BUILD]}?`) - -createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) - -createToken('GTLT', '((?:<|>)?=?)') - -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) -createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) - -createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:${src[t.PRERELEASE]})?${ - src[t.BUILD]}?` + - `)?)?`) - -createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:${src[t.PRERELEASELOOSE]})?${ - src[t.BUILD]}?` + - `)?)?`) - -createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) -createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) - -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -createToken('COERCE', `${'(^|[^\\d])' + - '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + - `(?:$|[^\\d])`) -createToken('COERCERTL', src[t.COERCE], true) - -// Tilde ranges. -// Meaning is "reasonably at or greater than" -createToken('LONETILDE', '(?:~>?)') - -createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) -exports.tildeTrimReplace = '$1~' - -createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) -createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) - -// Caret ranges. -// Meaning is "at least and backwards compatible with" -createToken('LONECARET', '(?:\\^)') - -createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) -exports.caretTrimReplace = '$1^' - -createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) -createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) - -// A simple gt/lt/eq thing, or just "" to indicate "any version" -createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) -createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) - -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] -}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) -exports.comparatorTrimReplace = '$1$2$3' - -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAIN]})` + - `\\s*$`) - -createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAINLOOSE]})` + - `\\s*$`) - -// Star ranges basically just allow anything at all. -createToken('STAR', '(<|>)?=?\\s*\\*') -// >=0.0.0 is like a star -createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$') -createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$') diff --git a/node_modules/electron-packager/node_modules/semver/package.json b/node_modules/electron-packager/node_modules/semver/package.json deleted file mode 100644 index 7898f59..0000000 --- a/node_modules/electron-packager/node_modules/semver/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "semver", - "version": "7.3.7", - "description": "The semantic version parser used by npm.", - "main": "index.js", - "scripts": { - "test": "tap", - "snap": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "postpublish": "git push origin --follow-tags", - "lint": "eslint \"**/*.js\"", - "postlint": "template-oss-check", - "lintfix": "npm run lint -- --fix", - "prepublishOnly": "git push origin --follow-tags", - "posttest": "npm run lint", - "template-oss-apply": "template-oss-apply --force" - }, - "devDependencies": { - "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.3.2", - "tap": "^16.0.0" - }, - "license": "ISC", - "repository": { - "type": "git", - "url": "https://github.com/npm/node-semver.git" - }, - "bin": { - "semver": "bin/semver.js" - }, - "files": [ - "bin/", - "classes/", - "functions/", - "internal/", - "ranges/", - "index.js", - "preload.js", - "range.bnf" - ], - "tap": { - "check-coverage": true, - "coverage-map": "map.js" - }, - "engines": { - "node": ">=10" - }, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "author": "GitHub Inc.", - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.3.2", - "engines": ">=10", - "ciVersions": [ - "10.0.0", - "10.x", - "12.x", - "14.x", - "16.x" - ], - "distPaths": [ - "bin/", - "classes/", - "functions/", - "internal/", - "ranges/", - "index.js", - "preload.js", - "range.bnf" - ] - } -} diff --git a/node_modules/electron-packager/node_modules/semver/preload.js b/node_modules/electron-packager/node_modules/semver/preload.js deleted file mode 100644 index 947cd4f..0000000 --- a/node_modules/electron-packager/node_modules/semver/preload.js +++ /dev/null @@ -1,2 +0,0 @@ -// XXX remove in v8 or beyond -module.exports = require('./index.js') diff --git a/node_modules/electron-packager/node_modules/semver/range.bnf b/node_modules/electron-packager/node_modules/semver/range.bnf deleted file mode 100644 index d4c6ae0..0000000 --- a/node_modules/electron-packager/node_modules/semver/range.bnf +++ /dev/null @@ -1,16 +0,0 @@ -range-set ::= range ( logical-or range ) * -logical-or ::= ( ' ' ) * '||' ( ' ' ) * -range ::= hyphen | simple ( ' ' simple ) * | '' -hyphen ::= partial ' - ' partial -simple ::= primitive | partial | tilde | caret -primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial -partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? -xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | [1-9] ( [0-9] ) * -tilde ::= '~' partial -caret ::= '^' partial -qualifier ::= ( '-' pre )? ( '+' build )? -pre ::= parts -build ::= parts -parts ::= part ( '.' part ) * -part ::= nr | [-0-9A-Za-z]+ diff --git a/node_modules/electron-packager/node_modules/semver/ranges/gtr.js b/node_modules/electron-packager/node_modules/semver/ranges/gtr.js deleted file mode 100644 index db7e355..0000000 --- a/node_modules/electron-packager/node_modules/semver/ranges/gtr.js +++ /dev/null @@ -1,4 +0,0 @@ -// Determine if version is greater than all the versions possible in the range. -const outside = require('./outside') -const gtr = (version, range, options) => outside(version, range, '>', options) -module.exports = gtr diff --git a/node_modules/electron-packager/node_modules/semver/ranges/intersects.js b/node_modules/electron-packager/node_modules/semver/ranges/intersects.js deleted file mode 100644 index 3d1a6f3..0000000 --- a/node_modules/electron-packager/node_modules/semver/ranges/intersects.js +++ /dev/null @@ -1,7 +0,0 @@ -const Range = require('../classes/range') -const intersects = (r1, r2, options) => { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2) -} -module.exports = intersects diff --git a/node_modules/electron-packager/node_modules/semver/ranges/ltr.js b/node_modules/electron-packager/node_modules/semver/ranges/ltr.js deleted file mode 100644 index 528a885..0000000 --- a/node_modules/electron-packager/node_modules/semver/ranges/ltr.js +++ /dev/null @@ -1,4 +0,0 @@ -const outside = require('./outside') -// Determine if version is less than all the versions possible in the range -const ltr = (version, range, options) => outside(version, range, '<', options) -module.exports = ltr diff --git a/node_modules/electron-packager/node_modules/semver/ranges/max-satisfying.js b/node_modules/electron-packager/node_modules/semver/ranges/max-satisfying.js deleted file mode 100644 index 6e3d993..0000000 --- a/node_modules/electron-packager/node_modules/semver/ranges/max-satisfying.js +++ /dev/null @@ -1,25 +0,0 @@ -const SemVer = require('../classes/semver') -const Range = require('../classes/range') - -const maxSatisfying = (versions, range, options) => { - let max = null - let maxSV = null - let rangeObj = null - try { - rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach((v) => { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { - // compare(max, v, true) - max = v - maxSV = new SemVer(max, options) - } - } - }) - return max -} -module.exports = maxSatisfying diff --git a/node_modules/electron-packager/node_modules/semver/ranges/min-satisfying.js b/node_modules/electron-packager/node_modules/semver/ranges/min-satisfying.js deleted file mode 100644 index 9b60974..0000000 --- a/node_modules/electron-packager/node_modules/semver/ranges/min-satisfying.js +++ /dev/null @@ -1,24 +0,0 @@ -const SemVer = require('../classes/semver') -const Range = require('../classes/range') -const minSatisfying = (versions, range, options) => { - let min = null - let minSV = null - let rangeObj = null - try { - rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach((v) => { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v - minSV = new SemVer(min, options) - } - } - }) - return min -} -module.exports = minSatisfying diff --git a/node_modules/electron-packager/node_modules/semver/ranges/min-version.js b/node_modules/electron-packager/node_modules/semver/ranges/min-version.js deleted file mode 100644 index 350e1f7..0000000 --- a/node_modules/electron-packager/node_modules/semver/ranges/min-version.js +++ /dev/null @@ -1,61 +0,0 @@ -const SemVer = require('../classes/semver') -const Range = require('../classes/range') -const gt = require('../functions/gt') - -const minVersion = (range, loose) => { - range = new Range(range, loose) - - let minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver - } - - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver - } - - minver = null - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i] - - let setMin = null - comparators.forEach((comparator) => { - // Clone to avoid manipulating the comparator's semver object. - const compver = new SemVer(comparator.semver.version) - switch (comparator.operator) { - case '>': - if (compver.prerelease.length === 0) { - compver.patch++ - } else { - compver.prerelease.push(0) - } - compver.raw = compver.format() - /* fallthrough */ - case '': - case '>=': - if (!setMin || gt(compver, setMin)) { - setMin = compver - } - break - case '<': - case '<=': - /* Ignore maximum versions */ - break - /* istanbul ignore next */ - default: - throw new Error(`Unexpected operation: ${comparator.operator}`) - } - }) - if (setMin && (!minver || gt(minver, setMin))) { - minver = setMin - } - } - - if (minver && range.test(minver)) { - return minver - } - - return null -} -module.exports = minVersion diff --git a/node_modules/electron-packager/node_modules/semver/ranges/outside.js b/node_modules/electron-packager/node_modules/semver/ranges/outside.js deleted file mode 100644 index ae99b10..0000000 --- a/node_modules/electron-packager/node_modules/semver/ranges/outside.js +++ /dev/null @@ -1,80 +0,0 @@ -const SemVer = require('../classes/semver') -const Comparator = require('../classes/comparator') -const { ANY } = Comparator -const Range = require('../classes/range') -const satisfies = require('../functions/satisfies') -const gt = require('../functions/gt') -const lt = require('../functions/lt') -const lte = require('../functions/lte') -const gte = require('../functions/gte') - -const outside = (version, range, hilo, options) => { - version = new SemVer(version, options) - range = new Range(range, options) - - let gtfn, ltefn, ltfn, comp, ecomp - switch (hilo) { - case '>': - gtfn = gt - ltefn = lte - ltfn = lt - comp = '>' - ecomp = '>=' - break - case '<': - gtfn = lt - ltefn = gte - ltfn = gt - comp = '<' - ecomp = '<=' - break - default: - throw new TypeError('Must provide a hilo val of "<" or ">"') - } - - // If it satisfies the range it is not outside - if (satisfies(version, range, options)) { - return false - } - - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i] - - let high = null - let low = null - - comparators.forEach((comparator) => { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator - low = low || comparator - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator - } - }) - - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false - } - - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false - } - } - return true -} - -module.exports = outside diff --git a/node_modules/electron-packager/node_modules/semver/ranges/simplify.js b/node_modules/electron-packager/node_modules/semver/ranges/simplify.js deleted file mode 100644 index 618d5b6..0000000 --- a/node_modules/electron-packager/node_modules/semver/ranges/simplify.js +++ /dev/null @@ -1,47 +0,0 @@ -// given a set of versions and a range, create a "simplified" range -// that includes the same versions that the original range does -// If the original range is shorter than the simplified one, return that. -const satisfies = require('../functions/satisfies.js') -const compare = require('../functions/compare.js') -module.exports = (versions, range, options) => { - const set = [] - let first = null - let prev = null - const v = versions.sort((a, b) => compare(a, b, options)) - for (const version of v) { - const included = satisfies(version, range, options) - if (included) { - prev = version - if (!first) { - first = version - } - } else { - if (prev) { - set.push([first, prev]) - } - prev = null - first = null - } - } - if (first) { - set.push([first, null]) - } - - const ranges = [] - for (const [min, max] of set) { - if (min === max) { - ranges.push(min) - } else if (!max && min === v[0]) { - ranges.push('*') - } else if (!max) { - ranges.push(`>=${min}`) - } else if (min === v[0]) { - ranges.push(`<=${max}`) - } else { - ranges.push(`${min} - ${max}`) - } - } - const simplified = ranges.join(' || ') - const original = typeof range.raw === 'string' ? range.raw : String(range) - return simplified.length < original.length ? simplified : range -} diff --git a/node_modules/electron-packager/node_modules/semver/ranges/subset.js b/node_modules/electron-packager/node_modules/semver/ranges/subset.js deleted file mode 100644 index e0dea43..0000000 --- a/node_modules/electron-packager/node_modules/semver/ranges/subset.js +++ /dev/null @@ -1,244 +0,0 @@ -const Range = require('../classes/range.js') -const Comparator = require('../classes/comparator.js') -const { ANY } = Comparator -const satisfies = require('../functions/satisfies.js') -const compare = require('../functions/compare.js') - -// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: -// - Every simple range `r1, r2, ...` is a null set, OR -// - Every simple range `r1, r2, ...` which is not a null set is a subset of -// some `R1, R2, ...` -// -// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: -// - If c is only the ANY comparator -// - If C is only the ANY comparator, return true -// - Else if in prerelease mode, return false -// - else replace c with `[>=0.0.0]` -// - If C is only the ANY comparator -// - if in prerelease mode, return true -// - else replace C with `[>=0.0.0]` -// - Let EQ be the set of = comparators in c -// - If EQ is more than one, return true (null set) -// - Let GT be the highest > or >= comparator in c -// - Let LT be the lowest < or <= comparator in c -// - If GT and LT, and GT.semver > LT.semver, return true (null set) -// - If any C is a = range, and GT or LT are set, return false -// - If EQ -// - If GT, and EQ does not satisfy GT, return true (null set) -// - If LT, and EQ does not satisfy LT, return true (null set) -// - If EQ satisfies every C, return true -// - Else return false -// - If GT -// - If GT.semver is lower than any > or >= comp in C, return false -// - If GT is >=, and GT.semver does not satisfy every C, return false -// - If GT.semver has a prerelease, and not in prerelease mode -// - If no C has a prerelease and the GT.semver tuple, return false -// - If LT -// - If LT.semver is greater than any < or <= comp in C, return false -// - If LT is <=, and LT.semver does not satisfy every C, return false -// - If GT.semver has a prerelease, and not in prerelease mode -// - If no C has a prerelease and the LT.semver tuple, return false -// - Else return true - -const subset = (sub, dom, options = {}) => { - if (sub === dom) { - return true - } - - sub = new Range(sub, options) - dom = new Range(dom, options) - let sawNonNull = false - - OUTER: for (const simpleSub of sub.set) { - for (const simpleDom of dom.set) { - const isSub = simpleSubset(simpleSub, simpleDom, options) - sawNonNull = sawNonNull || isSub !== null - if (isSub) { - continue OUTER - } - } - // the null set is a subset of everything, but null simple ranges in - // a complex range should be ignored. so if we saw a non-null range, - // then we know this isn't a subset, but if EVERY simple range was null, - // then it is a subset. - if (sawNonNull) { - return false - } - } - return true -} - -const simpleSubset = (sub, dom, options) => { - if (sub === dom) { - return true - } - - if (sub.length === 1 && sub[0].semver === ANY) { - if (dom.length === 1 && dom[0].semver === ANY) { - return true - } else if (options.includePrerelease) { - sub = [new Comparator('>=0.0.0-0')] - } else { - sub = [new Comparator('>=0.0.0')] - } - } - - if (dom.length === 1 && dom[0].semver === ANY) { - if (options.includePrerelease) { - return true - } else { - dom = [new Comparator('>=0.0.0')] - } - } - - const eqSet = new Set() - let gt, lt - for (const c of sub) { - if (c.operator === '>' || c.operator === '>=') { - gt = higherGT(gt, c, options) - } else if (c.operator === '<' || c.operator === '<=') { - lt = lowerLT(lt, c, options) - } else { - eqSet.add(c.semver) - } - } - - if (eqSet.size > 1) { - return null - } - - let gtltComp - if (gt && lt) { - gtltComp = compare(gt.semver, lt.semver, options) - if (gtltComp > 0) { - return null - } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { - return null - } - } - - // will iterate one or zero times - for (const eq of eqSet) { - if (gt && !satisfies(eq, String(gt), options)) { - return null - } - - if (lt && !satisfies(eq, String(lt), options)) { - return null - } - - for (const c of dom) { - if (!satisfies(eq, String(c), options)) { - return false - } - } - - return true - } - - let higher, lower - let hasDomLT, hasDomGT - // if the subset has a prerelease, we need a comparator in the superset - // with the same tuple and a prerelease, or it's not a subset - let needDomLTPre = lt && - !options.includePrerelease && - lt.semver.prerelease.length ? lt.semver : false - let needDomGTPre = gt && - !options.includePrerelease && - gt.semver.prerelease.length ? gt.semver : false - // exception: <1.2.3-0 is the same as <1.2.3 - if (needDomLTPre && needDomLTPre.prerelease.length === 1 && - lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { - needDomLTPre = false - } - - for (const c of dom) { - hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' - hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' - if (gt) { - if (needDomGTPre) { - if (c.semver.prerelease && c.semver.prerelease.length && - c.semver.major === needDomGTPre.major && - c.semver.minor === needDomGTPre.minor && - c.semver.patch === needDomGTPre.patch) { - needDomGTPre = false - } - } - if (c.operator === '>' || c.operator === '>=') { - higher = higherGT(gt, c, options) - if (higher === c && higher !== gt) { - return false - } - } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { - return false - } - } - if (lt) { - if (needDomLTPre) { - if (c.semver.prerelease && c.semver.prerelease.length && - c.semver.major === needDomLTPre.major && - c.semver.minor === needDomLTPre.minor && - c.semver.patch === needDomLTPre.patch) { - needDomLTPre = false - } - } - if (c.operator === '<' || c.operator === '<=') { - lower = lowerLT(lt, c, options) - if (lower === c && lower !== lt) { - return false - } - } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { - return false - } - } - if (!c.operator && (lt || gt) && gtltComp !== 0) { - return false - } - } - - // if there was a < or >, and nothing in the dom, then must be false - // UNLESS it was limited by another range in the other direction. - // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 - if (gt && hasDomLT && !lt && gtltComp !== 0) { - return false - } - - if (lt && hasDomGT && !gt && gtltComp !== 0) { - return false - } - - // we needed a prerelease range in a specific tuple, but didn't get one - // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, - // because it includes prereleases in the 1.2.3 tuple - if (needDomGTPre || needDomLTPre) { - return false - } - - return true -} - -// >=1.2.3 is lower than >1.2.3 -const higherGT = (a, b, options) => { - if (!a) { - return b - } - const comp = compare(a.semver, b.semver, options) - return comp > 0 ? a - : comp < 0 ? b - : b.operator === '>' && a.operator === '>=' ? b - : a -} - -// <=1.2.3 is higher than <1.2.3 -const lowerLT = (a, b, options) => { - if (!a) { - return b - } - const comp = compare(a.semver, b.semver, options) - return comp < 0 ? a - : comp > 0 ? b - : b.operator === '<' && a.operator === '<=' ? b - : a -} - -module.exports = subset diff --git a/node_modules/electron-packager/node_modules/semver/ranges/to-comparators.js b/node_modules/electron-packager/node_modules/semver/ranges/to-comparators.js deleted file mode 100644 index 6c8bc7e..0000000 --- a/node_modules/electron-packager/node_modules/semver/ranges/to-comparators.js +++ /dev/null @@ -1,8 +0,0 @@ -const Range = require('../classes/range') - -// Mostly just for testing and legacy API reasons -const toComparators = (range, options) => - new Range(range, options).set - .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) - -module.exports = toComparators diff --git a/node_modules/electron-packager/node_modules/semver/ranges/valid.js b/node_modules/electron-packager/node_modules/semver/ranges/valid.js deleted file mode 100644 index 365f356..0000000 --- a/node_modules/electron-packager/node_modules/semver/ranges/valid.js +++ /dev/null @@ -1,11 +0,0 @@ -const Range = require('../classes/range') -const validRange = (range, options) => { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, options).range || '*' - } catch (er) { - return null - } -} -module.exports = validRange diff --git a/node_modules/electron-packager/node_modules/universalify/LICENSE b/node_modules/electron-packager/node_modules/universalify/LICENSE deleted file mode 100644 index 514e84e..0000000 --- a/node_modules/electron-packager/node_modules/universalify/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -(The MIT License) - -Copyright (c) 2017, Ryan Zimmerman <opensrc@ryanzim.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the 'Software'), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/electron-packager/node_modules/universalify/README.md b/node_modules/electron-packager/node_modules/universalify/README.md deleted file mode 100644 index aa12474..0000000 --- a/node_modules/electron-packager/node_modules/universalify/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# universalify - -[](https://travis-ci.org/RyanZim/universalify) - - - - -Make a callback- or promise-based function support both promises and callbacks. - -Uses the native promise implementation. - -## Installation - -```bash -npm install universalify -``` - -## API - -### `universalify.fromCallback(fn)` - -Takes a callback-based function to universalify, and returns the universalified function. - -Function must take a callback as the last parameter that will be called with the signature `(error, result)`. `universalify` does not support calling the callback with three or more arguments, and does not ensure that the callback is only called once. - -```js -function callbackFn (n, cb) { - setTimeout(() => cb(null, n), 15) -} - -const fn = universalify.fromCallback(callbackFn) - -// Works with Promises: -fn('Hello World!') -.then(result => console.log(result)) // -> Hello World! -.catch(error => console.error(error)) - -// Works with Callbacks: -fn('Hi!', (error, result) => { - if (error) return console.error(error) - console.log(result) - // -> Hi! -}) -``` - -### `universalify.fromPromise(fn)` - -Takes a promise-based function to universalify, and returns the universalified function. - -Function must return a valid JS promise. `universalify` does not ensure that a valid promise is returned. - -```js -function promiseFn (n) { - return new Promise(resolve => { - setTimeout(() => resolve(n), 15) - }) -} - -const fn = universalify.fromPromise(promiseFn) - -// Works with Promises: -fn('Hello World!') -.then(result => console.log(result)) // -> Hello World! -.catch(error => console.error(error)) - -// Works with Callbacks: -fn('Hi!', (error, result) => { - if (error) return console.error(error) - console.log(result) - // -> Hi! -}) -``` - -## License - -MIT diff --git a/node_modules/electron-packager/node_modules/universalify/index.js b/node_modules/electron-packager/node_modules/universalify/index.js deleted file mode 100644 index ba6c662..0000000 --- a/node_modules/electron-packager/node_modules/universalify/index.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict' - -exports.fromCallback = function (fn) { - return Object.defineProperty(function (...args) { - if (typeof args[args.length - 1] === 'function') fn.apply(this, args) - else { - return new Promise((resolve, reject) => { - fn.call( - this, - ...args, - (err, res) => (err != null) ? reject(err) : resolve(res) - ) - }) - } - }, 'name', { value: fn.name }) -} - -exports.fromPromise = function (fn) { - return Object.defineProperty(function (...args) { - const cb = args[args.length - 1] - if (typeof cb !== 'function') return fn.apply(this, args) - else fn.apply(this, args.slice(0, -1)).then(r => cb(null, r), cb) - }, 'name', { value: fn.name }) -} diff --git a/node_modules/electron-packager/node_modules/universalify/package.json b/node_modules/electron-packager/node_modules/universalify/package.json deleted file mode 100644 index 006d4cc..0000000 --- a/node_modules/electron-packager/node_modules/universalify/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "universalify", - "version": "2.0.0", - "description": "Make a callback- or promise-based function support both promises and callbacks.", - "keywords": [ - "callback", - "native", - "promise" - ], - "homepage": "https://github.com/RyanZim/universalify#readme", - "bugs": "https://github.com/RyanZim/universalify/issues", - "license": "MIT", - "author": "Ryan Zimmerman <opensrc@ryanzim.com>", - "files": [ - "index.js" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/RyanZim/universalify.git" - }, - "scripts": { - "test": "standard && nyc tape test/*.js | colortape" - }, - "devDependencies": { - "colortape": "^0.1.2", - "coveralls": "^3.0.1", - "nyc": "^15.0.0", - "standard": "^14.3.1", - "tape": "^5.0.1" - }, - "engines": { - "node": ">= 10.0.0" - } -} diff --git a/node_modules/electron-packager/package.json b/node_modules/electron-packager/package.json deleted file mode 100644 index 78b8a06..0000000 --- a/node_modules/electron-packager/package.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "name": "electron-packager", - "version": "16.0.0", - "description": "Customize and package your Electron app with OS-specific bundles (.app, .exe, etc.) via JS or CLI", - "main": "src/index.js", - "types": "src/index.d.ts", - "bin": { - "electron-packager": "bin/electron-packager.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/electron/electron-packager.git" - }, - "author": "Mark Lee", - "license": "BSD-2-Clause", - "bugs": { - "url": "https://github.com/electron/electron-packager/issues" - }, - "homepage": "https://github.com/electron/electron-packager", - "files": [ - "collaborators.md", - "bin", - "docs/*.md", - "NEWS.md", - "src", - "usage.txt" - ], - "dependencies": { - "@electron/get": "^2.0.0", - "@electron/universal": "^1.2.1", - "asar": "^3.1.0", - "cross-spawn-windows-exe": "^1.2.0", - "debug": "^4.0.1", - "electron-notarize": "^1.1.1", - "electron-osx-sign": "^0.5.0", - "extract-zip": "^2.0.0", - "filenamify": "^4.1.0", - "fs-extra": "^10.1.0", - "galactus": "^0.2.1", - "get-package-info": "^1.0.0", - "junk": "^3.1.0", - "parse-author": "^2.0.0", - "plist": "^3.0.0", - "rcedit": "^3.0.1", - "resolve": "^1.1.6", - "semver": "^7.1.3", - "yargs-parser": "^21.1.1" - }, - "devDependencies": { - "@typescript-eslint/eslint-plugin": "^4.0.1", - "@typescript-eslint/parser": "^4.0.1", - "ava": "^3.10.1", - "buffer-equal": "^1.0.0", - "codecov": "^3.0.0", - "eslint": "^7.12.1", - "eslint-config-standard": "^16.0.0", - "eslint-plugin-ava": "^12.0.0", - "eslint-plugin-import": "^2.22.1", - "eslint-plugin-node": "^11.0.0", - "eslint-plugin-promise": "^5.1.0", - "nyc": "^15.0.0", - "pkg-up": "^3.0.1", - "sinon": "^14.0.0", - "tsd": "^0.14.0", - "typedoc": "^0.19.0", - "typescript": "^4.0.2" - }, - "engines": { - "node": ">= 14.17.5" - }, - "scripts": { - "ava": "ava test/index.js", - "codecov": "nyc report --reporter=text-lcov > coverage.lcov && codecov", - "coverage": "nyc ava test/index.js", - "docs:build": "node test/ci/build_docs.js", - "lint": "npm run lint:js && npm run lint:ts", - "lint:js": "eslint .", - "lint:ts": "eslint --config .eslintrc.typescript.js --ext .ts .", - "test": "npm run lint && npm run tsd && npm run coverage", - "tsd": "tsd" - }, - "directories": { - "test": "test" - }, - "keywords": [ - "electron", - "packager", - "bundler", - "app" - ], - "ava": { - "timeout": "60s" - }, - "eslintConfig": { - "extends": [ - "eslint:recommended", - "plugin:ava/recommended", - "plugin:import/errors", - "plugin:import/warnings", - "plugin:promise/recommended", - "standard" - ], - "parserOptions": { - "sourceType": "script" - }, - "plugins": [ - "ava" - ], - "rules": { - "ava/no-import-test-files": 0, - "ava/no-ignored-test-files": 0, - "indent": [ - "error", - 2, - { - "CallExpression": { - "arguments": "first" - }, - "SwitchCase": 1 - } - ], - "no-console": 0, - "strict": "error" - } - }, - "eslintIgnore": [ - "typedoc/**/*", - "**/test/fixtures/**/node_modules/**", - "**/test/work/*" - ], - "tsd": { - "directory": "test" - }, - "funding": { - "url": "https://github.com/electron/electron-packager?sponsor=1" - } -} diff --git a/node_modules/electron-packager/src/cli.js b/node_modules/electron-packager/src/cli.js deleted file mode 100644 index 4fe540e..0000000 --- a/node_modules/electron-packager/src/cli.js +++ /dev/null @@ -1,143 +0,0 @@ -'use strict' - -const { info, hostInfo, warning } = require('./common') -const fs = require('fs-extra') -const { initializeProxy } = require('@electron/get') -const packager = require('..') -const path = require('path') -const yargs = require('yargs-parser') - -/* istanbul ignore next */ -async function printUsageAndExit (isError) { - const usage = (await fs.readFile(path.resolve(__dirname, '..', 'usage.txt'))).toString() - const print = isError ? console.error : console.log - print(usage) - process.exit(isError ? 1 : 0) -} - -module.exports = { - parseArgs: function parseArgs (argv) { - const args = yargs(argv, { - boolean: [ - 'all', - 'deref-symlinks', - 'download.rejectUnauthorized', - 'junk', - 'overwrite', - 'prune', - 'quiet' - ], - default: { - 'deref-symlinks': true, - 'download.rejectUnauthorized': true, - junk: true, - prune: true - }, - string: [ - 'electron-version', - 'out' - ] - }) - - args.dir = args._[0] - args.name = args._[1] - - const protocolSchemes = [].concat(args.protocol || []) - const protocolNames = [].concat(args.protocolName || []) - - if (protocolSchemes && protocolNames && protocolNames.length === protocolSchemes.length) { - args.protocols = protocolSchemes.map(function (scheme, i) { - return { schemes: [scheme], name: protocolNames[i] } - }) - } - - if (args.out === '') { - warning('Specifying --out= without a value is the same as the default value') - args.out = null - } - - // Overrides for multi-typed arguments, because minimist doesn't support it - - // asar: `Object` or `true` - if (args.asar === 'true' || args.asar instanceof Array) { - warning('--asar does not take any arguments, it only has sub-properties (see --help)') - args.asar = true - } - - // osx-sign: `Object` or `true` - if (args.osxSign === 'true') { - warning('--osx-sign does not take any arguments, it only has sub-properties (see --help)') - args.osxSign = true - } else if (typeof args['osx-sign'] === 'object') { - if (Array.isArray(args['osx-sign'])) { - warning('Remove --osx-sign (the bare flag) from the command line, only specify sub-properties (see --help)') - } else { - // Keep kebab case of sub properties - args.osxSign = args['osx-sign'] - } - } - - if (args.osxNotarize) { - let notarize = true - if (typeof args.osxNotarize !== 'object' || Array.isArray(args.osxNotarize)) { - warning('--osx-notarize does not take any arguments, it only has sub-properties (see --help)') - notarize = false - } else if (!args.osxSign) { - warning('Notarization was enabled but macOS code signing was not, code signing is a requirement for notarization, notarize will not run') - notarize = false - } - - if (!notarize) { - args.osxNotarize = null - } - } - - // tmpdir: `String` or `false` - if (args.tmpdir === 'false') { - warning('--tmpdir=false is deprecated, use --no-tmpdir instead') - args.tmpdir = false - } - - return args - }, - run: /* istanbul ignore next */ async function run (argv) { - const args = module.exports.parseArgs(argv) - - // temporary fix for https://github.com/nodejs/node/issues/6456 - for (const stdioWriter of [process.stdout, process.stderr]) { - if (stdioWriter._handle && stdioWriter._handle.setBlocking) { - stdioWriter._handle.setBlocking(true) - } - } - - if (args.help) { - await printUsageAndExit(false) - } else if (args.version) { - if (typeof args.version !== 'boolean') { - console.error('--version does not take an argument. Perhaps you meant --app-version or --electron-version?\n') - } - console.log(hostInfo()) - process.exit(0) - } else if (!args.dir) { - await printUsageAndExit(true) - } - - initializeProxy() - - try { - const appPaths = await packager(args) - if (appPaths.length > 1) { - info(`Wrote new apps to:\n${appPaths.join('\n')}`) - } else if (appPaths.length === 1) { - info('Wrote new app to', appPaths[0]) - } - } catch (err) { - if (err.message) { - console.error(err.message) - } else { - console.error(err, err.stack) - } - process.exit(1) - } - } -} diff --git a/node_modules/electron-packager/src/common.js b/node_modules/electron-packager/src/common.js deleted file mode 100644 index 0c18623..0000000 --- a/node_modules/electron-packager/src/common.js +++ /dev/null @@ -1,128 +0,0 @@ -'use strict' - -const debug = require('debug')('electron-packager') -const filenamify = require('filenamify') -const fs = require('fs-extra') -const metadata = require('../package.json') -const os = require('os') -const path = require('path') - -function sanitizeAppName (name) { - return filenamify(name, { replacement: '-' }) -} - -function generateFinalBasename (opts) { - return `${sanitizeAppName(opts.name)}-${opts.platform}-${opts.arch}` -} - -function generateFinalPath (opts) { - return path.join(opts.out || process.cwd(), generateFinalBasename(opts)) -} - -function info (message, quiet) { - if (!quiet) { - console.error(message) - } -} - -function warning (message, quiet) { - if (!quiet) { - console.warn(`WARNING: ${message}`) - } -} - -function subOptionWarning (properties, optionName, parameter, value, quiet) { - if (Object.prototype.hasOwnProperty.call(properties, parameter)) { - warning(`${optionName}.${parameter} will be inferred from the main options`, quiet) - } - properties[parameter] = value -} - -function createAsarOpts (opts) { - let asarOptions - if (opts.asar === true) { - asarOptions = {} - } else if (typeof opts.asar === 'object') { - asarOptions = opts.asar - } else if (opts.asar === false || opts.asar === undefined) { - return false - } else { - warning(`asar parameter set to an invalid value (${opts.asar}), ignoring and disabling asar`) - return false - } - - return asarOptions -} - -module.exports = { - ensureArray: function ensureArray (value) { - return Array.isArray(value) ? value : [value] - }, - isPlatformMac: function isPlatformMac (platform) { - return platform === 'darwin' || platform === 'mas' - }, - - createAsarOpts: createAsarOpts, - - deprecatedParameter: function deprecatedParameter (properties, oldName, newName, newCLIName) { - if (Object.prototype.hasOwnProperty.call(properties, oldName)) { - warning(`The ${oldName} parameter is deprecated, use ${newName} (or --${newCLIName} in the CLI) instead`) - if (!Object.prototype.hasOwnProperty.call(properties, newName)) { - properties[newName] = properties[oldName] - } - delete properties[oldName] - } - }, - subOptionWarning: subOptionWarning, - - baseTempDir: function baseTempDir (opts) { - return path.join(opts.tmpdir || os.tmpdir(), 'electron-packager') - }, - generateFinalBasename: generateFinalBasename, - generateFinalPath: generateFinalPath, - sanitizeAppName, - /** - * Convert slashes to UNIX-format separators. - */ - normalizePath: function normalizePath (pathToNormalize) { - return pathToNormalize.replace(/\\/g, '/') - }, - /** - * Validates that the application directory contains a package.json file, and that there exists an - * appropriate main entry point file, per the rules of the "main" field in package.json. - * - * See: https://docs.npmjs.com/cli/v6/configuring-npm/package-json#main - * - * @param appDir - the directory specified by the user - * @param bundledAppDir - the directory where the appDir is copied to in the bundled Electron app - */ - validateElectronApp: async function validateElectronApp (appDir, bundledAppDir) { - debug('Validating bundled Electron app') - debug('Checking for a package.json file') - - const bundledPackageJSONPath = path.join(bundledAppDir, 'package.json') - if (!(await fs.pathExists(bundledPackageJSONPath))) { - const originalPackageJSONPath = path.join(appDir, 'package.json') - throw new Error(`Application manifest was not found. Make sure "${originalPackageJSONPath}" exists and does not get ignored by your ignore option`) - } - - debug('Checking for the main entry point file') - const packageJSON = await fs.readJson(bundledPackageJSONPath) - const mainScriptBasename = packageJSON.main || 'index.js' - const mainScript = path.resolve(bundledAppDir, mainScriptBasename) - if (!(await fs.pathExists(mainScript))) { - const originalMainScript = path.join(appDir, mainScriptBasename) - throw new Error(`The main entry point to your app was not found. Make sure "${originalMainScript}" exists and does not get ignored by your ignore option`) - } - - debug('Validation complete') - }, - - hostInfo: function hostInfo () { - return `Electron Packager ${metadata.version}\n` + - `Node ${process.version}\n` + - `Host Operating system: ${process.platform} ${os.release()} (${process.arch})` - }, - info: info, - warning: warning -} diff --git a/node_modules/electron-packager/src/copy-filter.js b/node_modules/electron-packager/src/copy-filter.js deleted file mode 100644 index e7b5ec0..0000000 --- a/node_modules/electron-packager/src/copy-filter.js +++ /dev/null @@ -1,110 +0,0 @@ -'use strict' - -const common = require('./common') -const debug = require('debug')('electron-packager') -const junk = require('junk') -const path = require('path') -const prune = require('./prune') -const targets = require('./targets') - -const DEFAULT_IGNORES = [ - '/package-lock\\.json$', - '/yarn\\.lock$', - '/\\.git($|/)', - '/node_modules/\\.bin($|/)', - '\\.o(bj)?$', - '/node_gyp_bins($|/)' -] - -function populateIgnoredPaths (opts) { - opts.originalIgnore = opts.ignore - if (typeof (opts.ignore) !== 'function') { - if (opts.ignore) { - opts.ignore = common.ensureArray(opts.ignore).concat(DEFAULT_IGNORES) - } else { - opts.ignore = [].concat(DEFAULT_IGNORES) - } - if (process.platform === 'linux') { - opts.ignore.push(common.baseTempDir(opts)) - } - - debug('Ignored path regular expressions:', opts.ignore) - } -} - -function generateIgnoredOutDirs (opts) { - const normalizedOut = opts.out ? path.resolve(opts.out) : null - const ignoredOutDirs = [] - if (normalizedOut === null || normalizedOut === process.cwd()) { - for (const [platform, archs] of Object.entries(targets.officialPlatformArchCombos)) { - for (const arch of archs) { - const basenameOpts = { - arch: arch, - name: opts.name, - platform: platform - } - ignoredOutDirs.push(path.join(process.cwd(), common.generateFinalBasename(basenameOpts))) - } - } - } else { - ignoredOutDirs.push(normalizedOut) - } - - debug('Ignored paths based on the out param:', ignoredOutDirs) - - return ignoredOutDirs -} - -function generateFilterFunction (ignore) { - if (typeof (ignore) === 'function') { - return file => !ignore(file) - } else { - const ignoredRegexes = common.ensureArray(ignore) - - return function filterByRegexes (file) { - return !ignoredRegexes.some(regex => file.match(regex)) - } - } -} - -function userPathFilter (opts) { - const filterFunc = generateFilterFunction(opts.ignore || []) - const ignoredOutDirs = generateIgnoredOutDirs(opts) - const pruner = opts.prune ? new prune.Pruner(opts.dir) : null - - return async function filter (file) { - const fullPath = path.resolve(file) - - if (ignoredOutDirs.includes(fullPath)) { - return false - } - - if (opts.junk !== false) { // defaults to true - if (junk.is(path.basename(fullPath))) { - return false - } - } - - let name = fullPath.split(path.resolve(opts.dir))[1] - - if (path.sep === '\\') { - name = common.normalizePath(name) - } - - if (pruner && name.startsWith('/node_modules/')) { - if (await prune.isModule(file)) { - return pruner.pruneModule(name) - } else { - return filterFunc(name) - } - } - - return filterFunc(name) - } -} - -module.exports = { - populateIgnoredPaths, - generateIgnoredOutDirs, - userPathFilter -} diff --git a/node_modules/electron-packager/src/download.js b/node_modules/electron-packager/src/download.js deleted file mode 100644 index 9c104a0..0000000 --- a/node_modules/electron-packager/src/download.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict' - -const common = require('./common') -const debug = require('debug')('electron-packager') -const { downloadArtifact } = require('@electron/get') -const semver = require('semver') -const targets = require('./targets') - -function createDownloadOpts (opts, platform, arch) { - const downloadOpts = { ...opts.download } - - common.subOptionWarning(downloadOpts, 'download', 'platform', platform, opts.quiet) - common.subOptionWarning(downloadOpts, 'download', 'arch', arch, opts.quiet) - common.subOptionWarning(downloadOpts, 'download', 'version', opts.electronVersion, opts.quiet) - common.subOptionWarning(downloadOpts, 'download', 'artifactName', 'electron', opts.quiet) - - return downloadOpts -} - -module.exports = { - createDownloadCombos: function createDownloadCombos (opts, selectedPlatforms, selectedArchs, ignoreFunc) { - return targets.createPlatformArchPairs(opts, selectedPlatforms, selectedArchs, ignoreFunc).map(([platform, arch]) => { - return createDownloadOpts(opts, platform, arch) - }) - }, - createDownloadOpts: createDownloadOpts, - downloadElectronZip: async function downloadElectronZip (downloadOpts) { - // armv7l builds have only been backfilled for Electron >= 1.0.0. - // See: https://github.com/electron/electron/pull/6986 - /* istanbul ignore if */ - if (downloadOpts.arch === 'armv7l' && semver.lt(downloadOpts.version, '1.0.0')) { - downloadOpts.arch = 'arm' - } - debug(`Downloading Electron with options ${JSON.stringify(downloadOpts)}`) - return downloadArtifact(downloadOpts) - } -} diff --git a/node_modules/electron-packager/src/hooks.js b/node_modules/electron-packager/src/hooks.js deleted file mode 100644 index a16426a..0000000 --- a/node_modules/electron-packager/src/hooks.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict' - -const { promisify } = require('util') - -module.exports = { - promisifyHooks: async function promisifyHooks (hooks, args) { - if (!hooks || !Array.isArray(hooks)) { - return Promise.resolve() - } - - await Promise.all(hooks.map(hookFn => promisify(hookFn).apply(this, args))) - }, - serialHooks: function serialHooks (hooks) { - return async function () { - const args = Array.prototype.splice.call(arguments, 0, arguments.length - 1) - const done = arguments[arguments.length - 1] - for (const hook of hooks) { - await hook.apply(this, args) - } - - return done() // eslint-disable-line promise/no-callback-in-promise - } - } -} diff --git a/node_modules/electron-packager/src/index.d.ts b/node_modules/electron-packager/src/index.d.ts deleted file mode 100644 index 492b51c..0000000 --- a/node_modules/electron-packager/src/index.d.ts +++ /dev/null @@ -1,568 +0,0 @@ -// Originally based on the type definitions for electron-packager 14.0 -// Project: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/electron-packager -// Original Authors: -// * Maxime LUCE <https://github.com/SomaticIT> -// * Juan Jimenez-Anca <https://github.com/cortopy> -// * John Kleinschmidt <https://github.com/jkleinsc> -// * Brendan Forster <https://github.com/shiftkey> -// * Mark Lee <https://github.com/malept> -// * Florian Keller <https://github.com/ffflorian> - -import { CreateOptions as AsarOptions } from 'asar'; -import { ElectronDownloadRequestOptions as ElectronDownloadOptions } from '@electron/get'; -import { - LegacyNotarizeCredentials, - NotaryToolCredentials, - TransporterOptions -} from 'electron-notarize/lib/types'; -import { SignOptions } from 'electron-osx-sign'; -import type { makeUniversalApp } from '@electron/universal'; - -type MakeUniversalOpts = Parameters<typeof makeUniversalApp>[0] - -type NotarizeLegacyOptions = LegacyNotarizeCredentials & TransporterOptions; - -/** - * Bundles Electron-based application source code with a renamed/customized Electron executable and - * its supporting files into folders ready for distribution. - * - * Briefly, this function: - * - finds or downloads the correct release of Electron - * - uses that version of Electron to create a app in `<out>/<appname>-<platform>-<arch>` - * - * Short example: - * - * ```javascript - * const packager = require('electron-packager') - * - * async function bundleElectronApp(options) { - * const appPaths = await packager(options) - * console.log(`Electron app bundles created:\n${appPaths.join("\n")}`) - * } - * ``` - * - * @param opts - Options to configure packaging. - * - * @returns A Promise containing the paths to the newly created application bundles. - */ -declare function electronPackager(opts: electronPackager.Options): Promise<string[]>; - -declare namespace electronPackager { - /** - * Architectures that have been supported by the official Electron prebuilt binaries, past - * and present. - */ - type OfficialArch = 'ia32' | 'x64' | 'armv7l' | 'arm64' | 'mips64el'; - /** - * Platforms that have been supported by the official Electron prebuilt binaries, past and present. - */ - type OfficialPlatform = 'linux' | 'win32' | 'darwin' | 'mas'; - type TargetArch = OfficialArch | string; - type TargetPlatform = OfficialPlatform | string; - type ArchOption = TargetArch | 'all'; - type PlatformOption = TargetPlatform | 'all'; - - /** - * A predicate function that, given an absolute file `path`, returns `true` if the file should be - * ignored, or `false` if the file should be kept. *This does not use any of the default ignored - * files/directories listed for the [[ignore]] option.* - */ - type IgnoreFunction = (path: string) => boolean; - /** - * A function that is called on the completion of a packaging stage. - * - * By default, the functions are called in parallel (via - * [`Promise.all`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all)). - * If you need the functions called serially, there is a utility function provided. Please note that - * **callback-style functions are not supported by `serialHooks`.** For example: - * - * ```javascript - * const packager = require('electron-packager') - * const { serialHooks } = require('electron-packager/src/hooks') - * - * packager({ - * // ... - * afterCopy: [serialHooks([ - * (buildPath, electronVersion, platform, arch) => { - * return new Promise((resolve, reject) => { - * setTimeout(() => { - * console.log('first function') - * resolve() - * }, 1000) - * }) - * }, - * (buildPath, electronVersion, platform, arch) => { - * console.log('second function') - * } - * ])], - * // ... - * }) - * ``` - * - * For real-world examples of `HookFunction`s, see the [list of related - * plugins](https://github.com/electron/electron-packager#plugins). - */ - type HookFunction = - /** - * @param buildPath - For [[afterExtract]], the path to the temporary folder where the prebuilt - * Electron binary has been extracted to. For [[afterCopy]] and [[afterPrune]], the path to the - * folder where the Electron app has been copied to. - * @param electronVersion - the version of Electron that is being bundled with the application. - * @param platform - The target platform you are packaging for. - * @param arch - The target architecture you are packaging for. - * @param callback - Must be called once you have completed your actions. - */ - ( - buildPath: string, - electronVersion: string, - platform: TargetArch, - arch: TargetArch, - callback: (err?: Error | null) => void - ) => void; - - /** See the documentation for [`electron-osx-sign`](https://npm.im/electron-osx-sign#opts) for details. */ - type OsxSignOptions = Omit<SignOptions, 'app' | 'binaries' | 'platform' | 'version'>; - - /** - * See the documentation for [`electron-notarize`](https://npm.im/electron-notarize#method-notarizeopts-promisevoid) - * for details. - */ - type OsxNotarizeOptions = - | ({ tool?: 'legacy' } & NotarizeLegacyOptions) - | ({ tool: 'notarytool' } & NotaryToolCredentials); - - /** - * See the documentation for [`@electron/universal`](https://github.com/electron/universal) - * for details. - */ - type OsxUniversalOptions = Omit<MakeUniversalOpts, 'x64AppPath' | 'arm64AppPath' | 'outAppPath' | 'force'> - - /** - * Defines URL protocol schemes to be used on macOS. - */ - interface MacOSProtocol { - /** - * The descriptive name. Maps to the `CFBundleURLName` metadata property. - */ - name: string; - /** - * One or more protocol schemes associated with the app. For example, specifying `myapp` - * would cause URLs such as `myapp://path` to be opened with the app. Maps to the - * `CFBundleURLSchemes` metadata property. - */ - schemes: string[]; - } - - /** - * A collection of application metadata to embed into the Windows executable. - * - * For more information, read the [`rcedit` Node module documentation](https://github.com/electron/node-rcedit#docs). - */ - interface Win32MetadataOptions { - /** Defaults to the `author` name from the nearest `package.json`. */ - CompanyName?: string; - /** Defaults to either `productName` or `name` from the nearest `package.json`. */ - FileDescription?: string; - /** Defaults to the renamed Electron `.exe` file. */ - OriginalFilename?: string; - /** Defaults to either `productName` or `name` from the nearest `package.json`. */ - ProductName?: string; - /** Defaults to either `productName` or `name` from the nearest `package.json`. */ - InternalName?: string; - /** See [MSDN](https://msdn.microsoft.com/en-us/library/6ad1fshk.aspx#Anchor_9) for details. */ - 'requested-execution-level'?: 'asInvoker' | 'highestAvailable' | 'requireAdministrator'; - /** - * Path to a local manifest file. - * - * See [MSDN](https://msdn.microsoft.com/en-us/library/windows/desktop/aa374191.aspx) for more details. - */ - 'application-manifest'?: string; - } - - /** Options passed to the `packager()` function. */ - interface Options { - /** The source directory. */ - dir: string; - /** - * Functions to be called after your app directory has been copied to a temporary directory. - * - * **Note**: `afterCopy` will not be called if the [[prebuiltAsar]] option is set. - */ - afterCopy?: HookFunction[]; - /** Functions to be called after the prebuilt Electron binary has been extracted to a temporary directory. */ - afterExtract?: HookFunction[]; - /** - * Functions to be called after Node module pruning has been applied to the application. - * - * **Note**: None of these functions will be called if the [[prune]] option is `false` or - * the [[prebuiltAsar]] option is set. - */ - afterPrune?: HookFunction[]; - - /** When `true`, sets both [[arch]] and [[platform]] to `all`. */ - all?: boolean; - /* - * The bundle identifier to use in the application's `Info.plist`. - * - * @category macOS - */ - appBundleId?: string; - /** - * The application category type, as shown in the Finder via *View → Arrange by Application - * Category* when viewing the Applications directory. - * - * For example, `app-category-type=public.app-category.developer-tools` will set the - * application category to *Developer Tools*. - * - * Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8). - * - * @category macOS - */ - appCategoryType?: string; - /** - * The human-readable copyright line for the app. Maps to the `LegalCopyright` metadata - * property on Windows, and `NSHumanReadableCopyright` on macOS. - */ - appCopyright?: string; - /** - * The release version of the application. - * - * By default the `version` property in the `package.json` is used, but it can be overridden - * with this argument. If neither are provided, the version of Electron will be used. Maps - * to the `ProductVersion` metadata property on Windows, and `CFBundleShortVersionString` - * on macOS. - */ - appVersion?: string; - /** - * The target system architecture(s) to build for. - * - * Not required if the [[all]] option is set. If `arch` is set to `all`, all supported - * architectures for the target platforms specified by [[platform]] will be built. - * Arbitrary combinations of individual architectures are also supported via a comma-delimited - * string or array of strings. The non-`all` values correspond to the architecture names used - * by [Electron releases](https://github.com/electron/electron/releases). This value - * is not restricted to the official set if [[download|`download.mirrorOptions`]] is set. - * - * Defaults to the arch of the host computer running Electron Packager. - * - * Arch values for the official prebuilt Electron binaries: - * - `ia32` - * - `x64` - * - `armv7l` - * - `arm64` _(Linux: Electron 1.8.0 and above; Windows: 6.0.8 and above; macOS: 11.0.0-beta.1 and above)_ - * - `mips64el` _(Electron 1.8.2-beta.5 to 1.8.8)_ - */ - arch?: ArchOption | ArchOption[]; - /** - * Whether to package the application's source code into an archive, using [Electron's - * archive format](https://github.com/electron/asar). Reasons why you may want to enable - * this feature include mitigating issues around long path names on Windows, slightly speeding - * up `require`, and concealing your source code from cursory inspection. When the value - * is `true`, it passes the default configuration to the `asar` module. The configuration - * values can be customized when the value is an `Object`. Supported sub-options include, but - * are not limited to: - * - `ordering` (*string*): A path to an ordering file for packing files. An explanation can be - * found on the [Atom issue tracker](https://github.com/atom/atom/issues/10163). - * - `unpack` (*string*): A [glob expression](https://github.com/isaacs/minimatch#features), - * when specified, unpacks the file with matching names to the `app.asar.unpacked` directory. - * - `unpackDir` (*string*): Unpacks the dir to the `app.asar.unpacked` directory whose names - * exactly or pattern match this string. The `asar.unpackDir` is relative to [[dir]]. - * - * Defaults to `false`. - * - * Some examples: - * - * - `asar.unpackDir = 'sub_dir'` will unpack the directory `/<dir>/sub_dir` - * - `asar.unpackDir = path.join('**', '{sub_dir1/sub_sub_dir,sub_dir2}', '*')` will unpack the directories `/<dir>/sub_dir1/sub_sub_dir` and `/<dir>/sub_dir2`, but it will not include their subdirectories. - * - `asar.unpackDir = path.join('**', '{sub_dir1/sub_sub_dir,sub_dir2}', '**')` will unpack the subdirectories of the directories `/<dir>/sub_dir1/sub_sub_dir` and `/<dir>/sub_dir2`. - * - `asar.unpackDir = path.join('**', '{sub_dir1/sub_sub_dir,sub_dir2}', '**', '*')` will unpack the directories `/<dir>/sub_dir1/sub_sub_dir` and `/<dir>/sub_dir2` and their subdirectories. - * - * **Note:** `asar` will have no effect if the [[prebuiltAsar]] option is set. - */ - asar?: boolean | AsarOptions; - /** - * The build version of the application. Defaults to the value of the [[appVersion]] option. - * Maps to the `FileVersion` metadata property on Windows, and `CFBundleVersion` on macOS. - */ - buildVersion?: string; - /** - * Forces support for Mojave (macOS 10.14) dark mode in your packaged app. This sets the - * `NSRequiresAquaSystemAppearance` key to `false` in your app's `Info.plist`. For more information, - * see the [Electron documentation](https://www.electronjs.org/docs/tutorial/mojave-dark-mode-guide) - * and the [Apple developer documentation](https://developer.apple.com/documentation/appkit/nsappearancecustomization/choosing_a_specific_appearance_for_your_app). - * - * @category macOS - */ - darwinDarkModeSupport?: boolean; - /** - * Whether symlinks should be dereferenced during the copying of the application source. - * Defaults to `true`. - * - * **Note:** `derefSymlinks` will have no effect if the [[prebuiltAsar]] option is set. - */ - derefSymlinks?: boolean; - /** - * If present, passes custom options to [`@electron/get`](https://npm.im/@electron/get). See - * the module for option descriptions, proxy support, and defaults. Supported parameters - * include, but are not limited to: - * - `cacheRoot` (*string*): The directory where prebuilt, pre-packaged Electron downloads are cached. - * - `mirrorOptions` (*Object*): Options to override the default Electron download location. - * - `rejectUnauthorized` (*boolean* - default: `true`): Whether SSL certificates are required to be - * valid when downloading Electron. - * - * **Note:** `download` sub-options will have no effect if the [[electronZipDir]] option is set. - */ - download?: ElectronDownloadOptions; - /** - * The Electron version with which the app is built (without the leading 'v') - for example, - * [`1.4.13`](https://github.com/electron/electron/releases/tag/v1.4.13). See [Electron - * releases](https://github.com/electron/electron/releases) for valid versions. If omitted, it - * will use the version of the nearest local installation of `electron`, - * `electron-prebuilt-compile`, or `electron-prebuilt`, defined in `package.json` in either - * `devDependencies` or `dependencies`. - */ - electronVersion?: string; - /** - * The local path to a directory containing Electron ZIP files for Electron Packager to unzip, instead - * of downloading them. The ZIP filenames should be in the same format as the ones downloaded from the - * [Electron releases](https://github.com/electron/electron/releases) site. - * - * **Note:** Setting this option prevents the [[download]] sub-options from being used, as - * the functionality gets skipped over. - */ - electronZipDir?: string; - /** - * The name of the executable file, sans file extension. Defaults to the value for the [[name]] - * option. For `darwin` or `mas` target platforms, this does not affect the name of the - * `.app` folder - this will use the [[name]] option instead. - */ - executableName?: string; - /** - * When the value is a string, specifies the filename of a `plist` file. Its contents are merged - * into the app's `Info.plist`. - * When the value is an `Object`, it specifies an already-parsed `plist` data structure that is - * merged into the app's `Info.plist`. - * - * Entries from `extendInfo` override entries in the base `Info.plist` file supplied by - * `electron`, `electron-prebuilt-compile`, or `electron-prebuilt`, but are overridden by other - * options such as [[appVersion]] or [[appBundleId]]. - * - * @category macOS - */ - extendInfo?: string | { [property: string]: any }; // eslint-disable-line @typescript-eslint/no-explicit-any - /** - * When the value is a string, specifies the filename of a `plist` file. Its contents are merged - * into all the Helper apps' `Info.plist` files. - * When the value is an `Object`, it specifies an already-parsed `plist` data structure that is - * merged into all the Helper apps' `Info.plist` files. - * - * Entries from `extendHelperInfo` override entries in the helper apps' `Info.plist` file supplied by - * `electron`, `electron-prebuilt-compile`, or `electron-prebuilt`, but are overridden by other - * options such as [[appVersion]] or [[appBundleId]]. - * - * @category macOS - */ - extendHelperInfo?: string | { [property: string]: any }; // eslint-disable-line @typescript-eslint/no-explicit-any - /** - * One or more files to be copied directly into the app's `Contents/Resources` directory for - * macOS target platforms, and the `resources` directory for other target platforms. The - * resources directory can be referenced in the packaged app via the - * [`process.resourcesPath`](https://www.electronjs.org/docs/api/process#processresourcespath-readonly) value. - */ - extraResource?: string | string[]; - /** - * The bundle identifier to use in the application helper's `Info.plist`. - * - * @category macOS - */ - helperBundleId?: string; - /** - * The local path to the icon file, if the target platform supports setting embedding an icon. - * - * Currently you must look for conversion tools in order to supply an icon in the format required by the platform: - * - * - macOS: `.icns` - * - Windows: `.ico` ([See the readme](https://github.com/electron/electron-packager#building-windows-apps-from-non-windows-platforms) for details on non-Windows platforms) - * - Linux: this option is not supported, as the dock/window list icon is set via - * [the `icon` option in the `BrowserWindow` constructor](https://electronjs.org/docs/api/browser-window/#new-browserwindowoptions). - * *Please note that you need to use a PNG, and not the macOS or Windows icon formats, in order for it - * to show up in the dock/window list.* Setting the icon in the file manager is not currently supported. - * - * If the file extension is omitted, it is auto-completed to the correct extension based on the - * platform, including when [[platform|`platform: 'all'`]] is in effect. - */ - icon?: string; - /** - * One or more additional [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) - * patterns which specify which files to ignore when copying files to create the app bundle(s). The - * regular expressions are matched against the absolute path of a given file/directory to be copied. - * - * **Please note that [glob patterns](https://en.wikipedia.org/wiki/Glob_%28programming%29) will not work.** - * - * The following paths are always ignored (*when you aren't using an [[IgnoreFunction]]*): - * - * - the directory specified by the [[out]] option - * - the temporary directory used to build the Electron app - * - `node_modules/.bin` - * - `node_modules/electron` - * - `node_modules/electron-prebuilt` - * - `node_modules/electron-prebuilt-compile` - * - `.git` - * - files and folders ending in `.o` and `.obj` - * - * **Note**: Node modules specified in `devDependencies` are ignored by default, via the - * [[prune]] option. - * - * **Note:** `ignore` will have no effect if the [[prebuiltAsar]] option is set. - */ - ignore?: RegExp | RegExp[] | IgnoreFunction; - /** - * Ignores [system junk files](https://github.com/sindresorhus/junk) when copying the Electron app, - * regardless of the [[ignore]] option. - * - * **Note:** `junk` will have no effect if the [[prebuiltAsar]] option is set. - */ - junk?: boolean; - /** - * The application name. If omitted, it will use the `productName` or `name` value from the - * nearest `package.json`. - * - * **Regardless of source, characters in the Electron app name which are not allowed in all target - * platforms' filenames (e.g., `/`), will be replaced by hyphens (`-`).** - */ - name?: string; - /** - * If present, notarizes macOS target apps when the host platform is macOS and XCode is installed. - * See [`electron-notarize`](https://github.com/electron/electron-notarize#method-notarizeopts-promisevoid) - * for option descriptions, such as how to use `appleIdPassword` safely or obtain an API key. - * - * **Requires the [[osxSign]] option to be set.** - * - * @category macOS - */ - osxNotarize?: OsxNotarizeOptions; - /** - * If present, signs macOS target apps when the host platform is macOS and XCode is installed. - * When the value is `true`, pass default configuration to the signing module. See - * [electron-osx-sign](https://npm.im/electron-osx-sign#opts---options) for sub-option descriptions and - * their defaults. Options include, but are not limited to: - * - `identity` (*string*): The identity used when signing the package via `codesign`. - * - `entitlements` (*string*): The path to the 'parent' entitlements. - * - `entitlements-inherit` (*string*): The path to the 'child' entitlements. - * - * @category macOS - */ - osxSign?: true | OsxSignOptions; - /** - * Used to provide custom options to the internal call to `@electron/universal` when building a macOS - * app with the target architecture of "universal". Unused otherwise, providing a value does not imply - * a universal app is built. - */ - osxUniversal?: OsxUniversalOptions; - /** - * The base directory where the finished package(s) are created. - * - * Defaults to the current working directory. - */ - out?: string; - /** - * Whether to replace an already existing output directory for a given platform (`true`) or - * skip recreating it (`false`). Defaults to `false`. - */ - overwrite?: boolean; - /** - * The target platform(s) to build for. - * - * Not required if the [[all]] option is set. If `platform` is set to `all`, all officially - * supported target platforms for the target architectures specified by the [[arch]] option - * will be built. Arbitrary combinations of individual platforms are also supported via a - * comma-delimited string or array of strings. - * - * The official non-`all` values correspond to the platform names used by [Electron - * releases](https://github.com/electron/electron/releases). This value is not restricted to - * the official set if [[download|`download.mirrorOptions]] is set. - * - * Defaults to the platform of the host computer running Electron Packager. - * - * Platform values for the official prebuilt Electron binaries: - * - `darwin` (macOS) - * - `linux` - * - `mas` (macOS, specifically for submitting to the Mac App Store) - * - `win32` - */ - platform?: PlatformOption | PlatformOption[]; - /** - * The path to a prebuilt ASAR file. - * - * **Note:** Setting this option prevents the following options from being used, as the functionality - * gets skipped over: - * - * - [[asar]] - * - [[afterCopy]] - * - [[afterPrune]] - * - [[derefSymlinks]] - * - [[ignore]] - * - [[junk]] - * - [[prune]] - */ - prebuiltAsar?: string; - /** - * The URL protocol schemes associated with the Electron app. - * - * @category macOS - */ - protocols?: MacOSProtocol[]; - /** - * Walks the `node_modules` dependency tree to remove all of the packages specified in the - * `devDependencies` section of `package.json` from the outputted Electron app. - * - * Defaults to `true`. - * - * **Note:** `prune` will have no effect if the [[prebuiltAsar]] option is set. - */ - prune?: boolean; - /** - * If `true`, disables printing informational and warning messages to the console when - * packaging the application. This does not disable errors. - * - * Defaults to `false`. - */ - quiet?: boolean; - /** - * The base directory to use as a temporary directory. Set to `false` to disable use of a - * temporary directory. Defaults to the system's temporary directory. - */ - tmpdir?: string | false; - /** - * Human-readable descriptions of how the Electron app uses certain macOS features. These are displayed - * in the App Store. A non-exhaustive list of available properties: - * - * * `Camera` - required for media access API usage in macOS Catalina - * * `Microphone` - required for media access API usage in macOS Catalina - * - * Valid properties are the [Cocoa keys for MacOS](https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html) - * of the pattern `NS(.*)UsageDescription`, where the captured group is the key to use. - * - * Example: - * - * ```javascript - * { - * usageDescription: { - * Camera: 'Needed for video calls', - * Microphone: 'Needed for voice calls' - * } - * } - * ``` - * - * @category macOS - */ - usageDescription?: { [property: string]: string }; - /** - * Application metadata to embed into the Windows executable. - * @category Windows - */ - win32metadata?: Win32MetadataOptions; - } -} - -export = electronPackager; diff --git a/node_modules/electron-packager/src/index.js b/node_modules/electron-packager/src/index.js deleted file mode 100644 index bab5fa9..0000000 --- a/node_modules/electron-packager/src/index.js +++ /dev/null @@ -1,204 +0,0 @@ -'use strict' - -const common = require('./common') -const copyFilter = require('./copy-filter') -const debug = require('debug')('electron-packager') -const download = require('./download') -const fs = require('fs-extra') -const getMetadataFromPackageJSON = require('./infer') -const hooks = require('./hooks') -const path = require('path') -const targets = require('./targets') -const unzip = require('./unzip') -const { packageUniversalMac } = require('./universal') - -function debugHostInfo () { - debug(common.hostInfo()) -} - -class Packager { - constructor (opts) { - this.opts = opts - this.tempBase = common.baseTempDir(opts) - this.useTempDir = opts.tmpdir !== false - this.canCreateSymlinks = undefined - } - - async ensureTempDir () { - if (this.useTempDir) { - await fs.remove(this.tempBase) - } else { - return Promise.resolve() - } - } - - async testSymlink (comboOpts, zipPath) { - const testPath = path.join(this.tempBase, `symlink-test-${comboOpts.platform}-${comboOpts.arch}`) - const testFile = path.join(testPath, 'test') - const testLink = path.join(testPath, 'testlink') - - try { - await fs.outputFile(testFile, '') - await fs.symlink(testFile, testLink) - this.canCreateSymlinks = true - } catch (e) { - /* istanbul ignore next */ - this.canCreateSymlinks = false - } finally { - await fs.remove(testPath) - } - - if (this.canCreateSymlinks) { - return this.checkOverwrite(comboOpts, zipPath) - } - - /* istanbul ignore next */ - return this.skipHostPlatformSansSymlinkSupport(comboOpts) - } - - /* istanbul ignore next */ - skipHostPlatformSansSymlinkSupport (comboOpts) { - common.info(`Cannot create symlinks (on Windows hosts, it requires admin privileges); skipping ${comboOpts.platform} platform`, this.opts.quiet) - return Promise.resolve() - } - - async overwriteAndCreateApp (outDir, comboOpts, zipPath) { - debug(`Removing ${outDir} due to setting overwrite: true`) - await fs.remove(outDir) - return this.createApp(comboOpts, zipPath) - } - - async extractElectronZip (comboOpts, zipPath, buildDir) { - debug(`Extracting ${zipPath} to ${buildDir}`) - await unzip(zipPath, buildDir) - await hooks.promisifyHooks(this.opts.afterExtract, [buildDir, comboOpts.electronVersion, comboOpts.platform, comboOpts.arch]) - } - - buildDir (platform, arch) { - let buildParentDir - if (this.useTempDir) { - buildParentDir = this.tempBase - } else { - buildParentDir = this.opts.out || process.cwd() - } - return path.resolve(buildParentDir, `${platform}-${arch}-template`) - } - - async createApp (comboOpts, zipPath) { - const buildDir = this.buildDir(comboOpts.platform, comboOpts.arch) - common.info(`Packaging app for platform ${comboOpts.platform} ${comboOpts.arch} using electron v${comboOpts.electronVersion}`, this.opts.quiet) - - debug(`Creating ${buildDir}`) - await fs.ensureDir(buildDir) - await this.extractElectronZip(comboOpts, zipPath, buildDir) - const os = require(targets.osModules[comboOpts.platform]) - const app = new os.App(comboOpts, buildDir) - return app.create() - } - - async checkOverwrite (comboOpts, zipPath) { - const finalPath = common.generateFinalPath(comboOpts) - if (await fs.pathExists(finalPath)) { - if (this.opts.overwrite) { - return this.overwriteAndCreateApp(finalPath, comboOpts, zipPath) - } else { - common.info(`Skipping ${comboOpts.platform} ${comboOpts.arch} (output dir already exists, use --overwrite to force)`, this.opts.quiet) - return true - } - } else { - return this.createApp(comboOpts, zipPath) - } - } - - async getElectronZipPath (downloadOpts) { - if (this.opts.electronZipDir) { - if (await fs.pathExists(this.opts.electronZipDir)) { - const zipPath = path.resolve( - this.opts.electronZipDir, - `electron-v${downloadOpts.version}-${downloadOpts.platform}-${downloadOpts.arch}.zip` - ) - if (!await fs.pathExists(zipPath)) { - throw new Error(`The specified Electron ZIP file does not exist: ${zipPath}`) - } - - return zipPath - } - - throw new Error(`The specified Electron ZIP directory does not exist: ${this.opts.electronZipDir}`) - } else { - return download.downloadElectronZip(downloadOpts) - } - } - - async packageForPlatformAndArchWithOpts (comboOpts, downloadOpts) { - const zipPath = await this.getElectronZipPath(downloadOpts) - - if (!this.useTempDir) { - return this.createApp(comboOpts, zipPath) - } - - if (common.isPlatformMac(comboOpts.platform)) { - /* istanbul ignore else */ - if (this.canCreateSymlinks === undefined) { - return this.testSymlink(comboOpts, zipPath) - } else if (!this.canCreateSymlinks) { - return this.skipHostPlatformSansSymlinkSupport(comboOpts) - } - } - - return this.checkOverwrite(comboOpts, zipPath) - } - - async packageForPlatformAndArch (downloadOpts) { - // Create delegated options object with specific platform and arch, for output directory naming - const comboOpts = { - ...this.opts, - arch: downloadOpts.arch, - platform: downloadOpts.platform, - electronVersion: downloadOpts.version - } - - if (common.isPlatformMac(comboOpts.platform) && comboOpts.arch === 'universal') { - return packageUniversalMac(this.packageForPlatformAndArchWithOpts.bind(this), this.buildDir(comboOpts.platform, comboOpts.arch), comboOpts, downloadOpts, this.tempBase) - } - - return this.packageForPlatformAndArchWithOpts(comboOpts, downloadOpts) - } -} - -async function packageAllSpecifiedCombos (opts, archs, platforms) { - const packager = new Packager(opts) - await packager.ensureTempDir() - return Promise.all(download.createDownloadCombos(opts, platforms, archs).map( - downloadOpts => packager.packageForPlatformAndArch(downloadOpts) - )) -} - -module.exports = async function packager (opts) { - debugHostInfo() - if (debug.enabled) debug(`Packager Options: ${JSON.stringify(opts)}`) - - const archs = targets.validateListFromOptions(opts, 'arch') - const platforms = targets.validateListFromOptions(opts, 'platform') - if (!Array.isArray(archs)) return Promise.reject(archs) - if (!Array.isArray(platforms)) return Promise.reject(platforms) - - debug(`Target Platforms: ${platforms.join(', ')}`) - debug(`Target Architectures: ${archs.join(', ')}`) - - const packageJSONDir = path.resolve(process.cwd(), opts.dir) || process.cwd() - - await getMetadataFromPackageJSON(platforms, opts, packageJSONDir) - if (opts.name.endsWith(' Helper')) { - throw new Error('Application names cannot end in " Helper" due to limitations on macOS') - } - - debug(`Application name: ${opts.name}`) - debug(`Target Electron version: ${opts.electronVersion}`) - - copyFilter.populateIgnoredPaths(opts) - - const appPaths = await packageAllSpecifiedCombos(opts, archs, platforms) - // Remove falsy entries (e.g. skipped platforms) - return appPaths.filter(appPath => appPath) -} diff --git a/node_modules/electron-packager/src/infer.js b/node_modules/electron-packager/src/infer.js deleted file mode 100644 index 9dde6d7..0000000 --- a/node_modules/electron-packager/src/infer.js +++ /dev/null @@ -1,178 +0,0 @@ -'use strict' - -const debug = require('debug')('electron-packager') -const getPackageInfo = require('get-package-info') -const parseAuthor = require('parse-author') -const path = require('path') -const resolve = require('resolve') -const semver = require('semver') - -function isMissingRequiredProperty (props) { - return props.some(prop => prop === 'productName' || prop === 'dependencies.electron') -} - -function errorMessageForProperty (prop) { - let hash, propDescription - switch (prop) { - case 'productName': - hash = 'name' - propDescription = 'application name' - break - case 'dependencies.electron': - hash = 'electronversion' - propDescription = 'Electron version' - break - case 'version': - hash = 'appversion' - propDescription = 'application version' - break - /* istanbul ignore next */ - default: - hash = '' - propDescription = `[Unknown Property (${prop})]` - } - - return `Unable to determine ${propDescription}. Please specify an ${propDescription}\n\n` + - 'For more information, please see\n' + - `https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html#${hash}\n` -} - -function resolvePromise (id, options) { - // eslint-disable-next-line promise/param-names - return new Promise((accept, reject) => { - resolve(id, options, (err, mainPath, pkg) => { - if (err) { - /* istanbul ignore next */ - reject(err) - } else { - accept([mainPath, pkg]) - } - }) - }) -} - -function rangeFromElectronVersion (electronVersion) { - try { - return new semver.Range(electronVersion) - } catch (error) { - return null - } -} - -async function getVersion (opts, electronProp) { - const [depType, packageName] = electronProp.prop.split('.') - const src = electronProp.src - if (packageName === 'electron-prebuilt-compile') { - const electronVersion = electronProp.pkg[depType][packageName] - const versionRange = rangeFromElectronVersion(electronVersion) - if (versionRange !== null && versionRange.intersects(new semver.Range('< 1.6.5'))) { - if (!/^\d+\.\d+\.\d+/.test(electronVersion)) { - // electron-prebuilt-compile cannot be resolved because `main` does not point - // to a valid JS file. - throw new Error('Using electron-prebuilt-compile with Electron Packager requires specifying an exact Electron version') - } - - opts.electronVersion = electronVersion - return Promise.resolve() - } - } - - const pkg = (await resolvePromise(packageName, { basedir: path.dirname(src) }))[1] - debug(`Inferring target Electron version from ${packageName} in ${src}`) - opts.electronVersion = pkg.version - return null -} - -async function handleMetadata (opts, result) { - if (result.values.productName) { - debug(`Inferring application name from ${result.source.productName.prop} in ${result.source.productName.src}`) - opts.name = result.values.productName - } - - if (result.values.version) { - debug(`Inferring appVersion from version in ${result.source.version.src}`) - opts.appVersion = result.values.version - } - - if (result.values.author && !opts.win32metadata) { - opts.win32metadata = {} - } - - if (result.values.author) { - debug(`Inferring win32metadata.CompanyName from author in ${result.source.author.src}`) - if (typeof result.values.author === 'string') { - opts.win32metadata.CompanyName = parseAuthor(result.values.author).name - } else if (result.values.author.name) { - opts.win32metadata.CompanyName = result.values.author.name - } else { - debug('Cannot infer win32metadata.CompanyName from author, no name found') - } - } - - // eslint-disable-next-line no-prototype-builtins - if (result.values.hasOwnProperty('dependencies.electron')) { - return getVersion(opts, result.source['dependencies.electron']) - } else { - return Promise.resolve() - } -} - -function handleMissingProperties (opts, err) { - const missingProps = err.missingProps.map(prop => { - return Array.isArray(prop) ? prop[0] : prop - }) - - if (isMissingRequiredProperty(missingProps)) { - const messages = missingProps.map(errorMessageForProperty) - - debug(err.message) - err.message = messages.join('\n') + '\n' - throw err - } else { - // Missing props not required, can continue w/ partial result - return handleMetadata(opts, err.result) - } -} - -module.exports = async function getMetadataFromPackageJSON (platforms, opts, dir) { - const props = [] - if (!opts.name) props.push(['productName', 'name']) - if (!opts.appVersion) props.push('version') - if (!opts.electronVersion) { - props.push([ - 'dependencies.electron', - 'devDependencies.electron', - 'dependencies.electron-nightly', - 'devDependencies.electron-nightly', - 'dependencies.electron-prebuilt-compile', - 'devDependencies.electron-prebuilt-compile', - 'dependencies.electron-prebuilt', - 'devDependencies.electron-prebuilt' - ]) - } - - if (platforms.includes('win32') && !(opts.win32metadata && opts.win32metadata.CompanyName)) { - debug('Requiring author in package.json, as CompanyName was not specified for win32metadata') - props.push('author') - } - - // Name and version provided, no need to infer - if (props.length === 0) return Promise.resolve() - - // Search package.json files to infer name and version from - try { - const result = await getPackageInfo(props, dir) - return handleMetadata(opts, result) - } catch (err) { - if (err.missingProps) { - if (err.missingProps.length === props.length) { - debug(err.message) - err.message = `Could not locate a package.json file in "${path.resolve(opts.dir)}" or its parent directories for an Electron app with the following fields: ${err.missingProps.join(', ')}` - } else { - return handleMissingProperties(opts, err) - } - } - - throw err - } -} diff --git a/node_modules/electron-packager/src/linux.js b/node_modules/electron-packager/src/linux.js deleted file mode 100644 index 1e98414..0000000 --- a/node_modules/electron-packager/src/linux.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict' - -const App = require('./platform') -const common = require('./common') - -class LinuxApp extends App { - get originalElectronName () { - return 'electron' - } - - get newElectronName () { - return common.sanitizeAppName(this.executableName) - } - - async create () { - await this.initialize() - await this.renameElectron() - await this.copyExtraResources() - return this.move() - } -} - -module.exports = { - App: LinuxApp -} diff --git a/node_modules/electron-packager/src/mac.js b/node_modules/electron-packager/src/mac.js deleted file mode 100644 index 2d6e769..0000000 --- a/node_modules/electron-packager/src/mac.js +++ /dev/null @@ -1,444 +0,0 @@ -'use strict' - -const App = require('./platform') -const common = require('./common') -const debug = require('debug')('electron-packager') -const fs = require('fs-extra') -const path = require('path') -const plist = require('plist') -const { notarize } = require('electron-notarize') -const { signAsync } = require('electron-osx-sign') - -class MacApp extends App { - constructor (opts, templatePath) { - super(opts, templatePath) - - this.appName = opts.name - } - - get appCategoryType () { - return this.opts.appCategoryType - } - - get appCopyright () { - return this.opts.appCopyright - } - - get appVersion () { - return this.opts.appVersion - } - - get buildVersion () { - return this.opts.buildVersion - } - - get enableDarkMode () { - return this.opts.darwinDarkModeSupport - } - - get usageDescription () { - return this.opts.usageDescription - } - - get protocols () { - return this.opts.protocols.map((protocol) => { - return { - CFBundleURLName: protocol.name, - CFBundleURLSchemes: [].concat(protocol.schemes) - } - }) - } - - get dotAppName () { - return `${common.sanitizeAppName(this.appName)}.app` - } - - get defaultBundleName () { - return `com.electron.${common.sanitizeAppName(this.appName).toLowerCase()}` - } - - get bundleName () { - return filterCFBundleIdentifier(this.opts.appBundleId || this.defaultBundleName) - } - - get originalResourcesDir () { - return path.join(this.contentsPath, 'Resources') - } - - get resourcesDir () { - return path.join(this.dotAppName, 'Contents', 'Resources') - } - - get electronBinaryDir () { - return path.join(this.contentsPath, 'MacOS') - } - - get originalElectronName () { - return 'Electron' - } - - get newElectronName () { - return this.appPlist.CFBundleExecutable - } - - get renamedAppPath () { - return path.join(this.stagingPath, this.dotAppName) - } - - get electronAppPath () { - return path.join(this.stagingPath, `${this.originalElectronName}.app`) - } - - get contentsPath () { - return path.join(this.electronAppPath, 'Contents') - } - - get frameworksPath () { - return path.join(this.contentsPath, 'Frameworks') - } - - get loginItemsPath () { - return path.join(this.contentsPath, 'Library', 'LoginItems') - } - - get loginHelperPath () { - return path.join(this.loginItemsPath, 'Electron Login Helper.app') - } - - updatePlist (basePlist, displayName, identifier, name) { - return Object.assign(basePlist, { - CFBundleDisplayName: displayName, - CFBundleExecutable: common.sanitizeAppName(displayName), - CFBundleIdentifier: identifier, - CFBundleName: common.sanitizeAppName(name) - }) - } - - updateHelperPlist (basePlist, suffix, identifierIgnoresSuffix) { - let helperSuffix, identifier, name - if (suffix) { - helperSuffix = `Helper ${suffix}` - if (identifierIgnoresSuffix) { - identifier = this.helperBundleIdentifier - } else { - identifier = `${this.helperBundleIdentifier}.${suffix}` - } - name = `${this.appName} ${helperSuffix}` - } else { - helperSuffix = 'Helper' - identifier = this.helperBundleIdentifier - name = this.appName - } - return this.updatePlist(basePlist, `${this.appName} ${helperSuffix}`, identifier, name) - } - - async extendPlist (basePlist, propsOrFilename) { - if (!propsOrFilename) { - return Promise.resolve() - } - - if (typeof propsOrFilename === 'string') { - const plist = await this.loadPlist(propsOrFilename) - return Object.assign(basePlist, plist) - } else { - return Object.assign(basePlist, propsOrFilename) - } - } - - async loadPlist (filename, propName) { - const loadedPlist = plist.parse((await fs.readFile(filename)).toString()) - if (propName) { - this[propName] = loadedPlist - } - return loadedPlist - } - - ehPlistFilename (helper) { - return this.helperPlistFilename(path.join(this.frameworksPath, helper)) - } - - helperPlistFilename (helperApp) { - return path.join(helperApp, 'Contents', 'Info.plist') - } - - async determinePlistFilesToUpdate () { - const appPlistFilename = path.join(this.contentsPath, 'Info.plist') - - const plists = [ - [appPlistFilename, 'appPlist'], - [this.ehPlistFilename('Electron Helper.app'), 'helperPlist'] - ] - - const possiblePlists = [ - [this.ehPlistFilename('Electron Helper (Renderer).app'), 'helperRendererPlist'], - [this.ehPlistFilename('Electron Helper (Plugin).app'), 'helperPluginPlist'], - [this.ehPlistFilename('Electron Helper (GPU).app'), 'helperGPUPlist'], - [this.ehPlistFilename('Electron Helper EH.app'), 'helperEHPlist'], - [this.ehPlistFilename('Electron Helper NP.app'), 'helperNPPlist'], - [this.helperPlistFilename(this.loginHelperPath), 'loginHelperPlist'] - ] - - const optional = await Promise.all(possiblePlists.map(async item => - (await fs.pathExists(item[0])) ? item : null)) - return plists.concat(optional.filter(item => item)) - } - - appRelativePath (p) { - return path.relative(this.contentsPath, p) - } - - async updatePlistFiles () { - const appBundleIdentifier = this.bundleName - this.helperBundleIdentifier = filterCFBundleIdentifier(this.opts.helperBundleId || `${appBundleIdentifier}.helper`) - - const plists = await this.determinePlistFilesToUpdate() - await Promise.all(plists.map(plistArgs => this.loadPlist(...plistArgs))) - await this.extendPlist(this.appPlist, this.opts.extendInfo) - if (this.asarIntegrity) { - await this.extendPlist(this.appPlist, { - ElectronAsarIntegrity: this.asarIntegrity - }) - } - this.appPlist = this.updatePlist(this.appPlist, this.executableName, appBundleIdentifier, this.appName) - - const updateIfExists = [ - ['helperRendererPlist', '(Renderer)', true], - ['helperPluginPlist', '(Plugin)', true], - ['helperGPUPlist', '(GPU)', true], - ['helperEHPlist', 'EH'], - ['helperNPPlist', 'NP'] - ] - - for (const [plistKey] of [...updateIfExists, ['helperPlist']]) { - if (!this[plistKey]) continue - await this.extendPlist(this[plistKey], this.opts.extendHelperInfo) - } - - this.helperPlist = this.updateHelperPlist(this.helperPlist) - for (const [plistKey, ...suffixArgs] of updateIfExists) { - if (!this[plistKey]) continue - this[plistKey] = this.updateHelperPlist(this[plistKey], ...suffixArgs) - } - - // Some properties need to go on all helpers as well, version, usage info, etc. - const plistsToUpdate = updateIfExists - .filter(([key]) => !!this[key]) - .map(([key]) => key) - .concat(['appPlist', 'helperPlist']) - - if (this.loginHelperPlist) { - const loginHelperName = common.sanitizeAppName(`${this.appName} Login Helper`) - this.loginHelperPlist.CFBundleExecutable = loginHelperName - this.loginHelperPlist.CFBundleIdentifier = `${appBundleIdentifier}.loginhelper` - this.loginHelperPlist.CFBundleName = loginHelperName - } - - if (this.appVersion) { - const appVersionString = '' + this.appVersion - for (const plistKey of plistsToUpdate) { - this[plistKey].CFBundleShortVersionString = this[plistKey].CFBundleVersion = appVersionString - } - } - - if (this.buildVersion) { - const buildVersionString = '' + this.buildVersion - for (const plistKey of plistsToUpdate) { - this[plistKey].CFBundleVersion = buildVersionString - } - } - - if (this.opts.protocols && this.opts.protocols.length) { - this.appPlist.CFBundleURLTypes = this.protocols - } - - if (this.appCategoryType) { - this.appPlist.LSApplicationCategoryType = this.appCategoryType - } - - if (this.appCopyright) { - this.appPlist.NSHumanReadableCopyright = this.appCopyright - } - - if (this.enableDarkMode) { - this.appPlist.NSRequiresAquaSystemAppearance = false - } - - if (this.usageDescription) { - for (const [type, description] of Object.entries(this.usageDescription)) { - const usageTypeKey = `NS${type}UsageDescription` - for (const plistKey of plistsToUpdate) { - this[plistKey][usageTypeKey] = description - } - this.appPlist[usageTypeKey] = description - } - } - - await Promise.all(plists.map(([filename, varName]) => - fs.writeFile(filename, plist.build(this[varName])))) - } - - async moveHelpers () { - const helpers = [' Helper', ' Helper EH', ' Helper NP', ' Helper (Renderer)', ' Helper (Plugin)', ' Helper (GPU)'] - await Promise.all(helpers.map(suffix => this.moveHelper(this.frameworksPath, suffix))) - if (await fs.pathExists(this.loginItemsPath)) { - await this.moveHelper(this.loginItemsPath, ' Login Helper') - } - } - - async moveHelper (helperDirectory, suffix) { - const originalBasename = `Electron${suffix}` - - if (await fs.pathExists(path.join(helperDirectory, `${originalBasename}.app`))) { - return this.renameHelperAndExecutable( - helperDirectory, - originalBasename, - `${common.sanitizeAppName(this.appName)}${suffix}` - ) - } else { - return Promise.resolve() - } - } - - async renameHelperAndExecutable (helperDirectory, originalBasename, newBasename) { - const originalAppname = `${originalBasename}.app` - const executableBasePath = path.join(helperDirectory, originalAppname, 'Contents', 'MacOS') - await this.relativeRename(executableBasePath, originalBasename, newBasename) - await this.relativeRename(helperDirectory, originalAppname, `${newBasename}.app`) - } - - async copyIcon () { - if (!this.opts.icon) { - return Promise.resolve() - } - - let icon - - try { - icon = await this.normalizeIconExtension('.icns') - } catch { - // Ignore error if icon doesn't exist, in case it's only available for other OSes - /* istanbul ignore next */ - return Promise.resolve() - } - if (icon) { - debug(`Copying icon "${icon}" to app's Resources as "${this.appPlist.CFBundleIconFile}"`) - await fs.copy(icon, path.join(this.originalResourcesDir, this.appPlist.CFBundleIconFile)) - } - } - - async renameAppAndHelpers () { - await this.moveHelpers() - await fs.rename(this.electronAppPath, this.renamedAppPath) - } - - async signAppIfSpecified () { - const osxSignOpt = this.opts.osxSign - const platform = this.opts.platform - const version = this.opts.electronVersion - - if ((platform === 'all' || platform === 'mas') && - osxSignOpt === undefined) { - common.warning('signing is required for mas builds. Provide the osx-sign option, ' + - 'or manually sign the app later.') - } - - if (osxSignOpt) { - const signOpts = createSignOpts(osxSignOpt, platform, this.renamedAppPath, version, this.opts.osxNotarize, this.opts.quiet) - debug(`Running electron-osx-sign with the options ${JSON.stringify(signOpts)}`) - try { - await signAsync(signOpts) - } catch (err) { - // Although not signed successfully, the application is packed. - common.warning(`Code sign failed; please retry manually. ${err}`) - } - } - } - - async notarizeAppIfSpecified () { - const osxNotarizeOpt = this.opts.osxNotarize - - /* istanbul ignore if */ - if (osxNotarizeOpt) { - const notarizeOpts = createNotarizeOpts( - osxNotarizeOpt, - this.bundleName, - this.renamedAppPath, - this.opts.quiet - ) - if (notarizeOpts) { - return notarize(notarizeOpts) - } - } - } - - async create () { - await this.initialize() - await this.updatePlistFiles() - await this.copyIcon() - await this.renameElectron() - await this.renameAppAndHelpers() - await this.copyExtraResources() - await this.signAppIfSpecified() - await this.notarizeAppIfSpecified() - return this.move() - } -} - -/** - * Remove special characters and allow only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.) - * Apple documentation: - * https://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070 - */ -function filterCFBundleIdentifier (identifier) { - return identifier.replace(/ /g, '-').replace(/[^a-zA-Z0-9.-]/g, '') -} - -function createSignOpts (properties, platform, app, version, notarize, quiet) { - // use default sign opts if osx-sign is true, otherwise clone osx-sign object - const signOpts = properties === true ? { identity: null } : { ...properties } - - // osx-sign options are handed off to sign module, but - // with a few additions from the main options - // user may think they can pass platform, app, or version, but they will be ignored - common.subOptionWarning(signOpts, 'osx-sign', 'platform', platform, quiet) - common.subOptionWarning(signOpts, 'osx-sign', 'app', app, quiet) - common.subOptionWarning(signOpts, 'osx-sign', 'version', version, quiet) - - if (signOpts.binaries) { - common.warning('osx-sign.binaries is not an allowed sub-option. Not passing to electron-osx-sign.') - delete signOpts.binaries - } - - // Take argument osx-sign as signing identity: - // if opts.osxSign is true (bool), fallback to identity=null for - // autodiscovery. Otherwise, provide signing certificate info. - if (signOpts.identity === true) { - signOpts.identity = null - } - - if (notarize && !signOpts.hardenedRuntime && !signOpts['hardened-runtime']) { - common.warning('notarization is enabled but hardenedRuntime was not enabled in the signing ' + - 'options. It has been enabled for you but you should enable it in your config.') - signOpts.hardenedRuntime = true - } - - return signOpts -} - -function createNotarizeOpts (properties, appBundleId, appPath, quiet) { - // osxNotarize options are handed off to the electron-notarize module, but with a few - // additions from the main options. The user may think they can pass bundle ID or appPath, - // but they will be ignored. - if (properties.tool !== 'notarytool') { - common.subOptionWarning(properties, 'osxNotarize', 'appBundleId', appBundleId, quiet) - } - common.subOptionWarning(properties, 'osxNotarize', 'appPath', appPath, quiet) - return properties -} - -module.exports = { - App: MacApp, - createNotarizeOpts: createNotarizeOpts, - createSignOpts: createSignOpts, - filterCFBundleIdentifier: filterCFBundleIdentifier -} diff --git a/node_modules/electron-packager/src/platform.js b/node_modules/electron-packager/src/platform.js deleted file mode 100644 index 9489e3d..0000000 --- a/node_modules/electron-packager/src/platform.js +++ /dev/null @@ -1,238 +0,0 @@ -'use strict' - -const asar = require('asar') -const crypto = require('crypto') -const debug = require('debug')('electron-packager') -const fs = require('fs-extra') -const path = require('path') - -const common = require('./common') -const copyFilter = require('./copy-filter') -const hooks = require('./hooks') - -class App { - constructor (opts, templatePath) { - this.opts = opts - this.templatePath = templatePath - this.asarOptions = common.createAsarOpts(opts) - - if (this.opts.prune === undefined) { - this.opts.prune = true - } - } - - /** - * Resource directory path before renaming. - */ - get originalResourcesDir () { - return this.resourcesDir - } - - /** - * Resource directory path after renaming. - */ - get resourcesDir () { - return path.join(this.stagingPath, 'resources') - } - - get originalResourcesAppDir () { - return path.join(this.originalResourcesDir, 'app') - } - - get electronBinaryDir () { - return this.stagingPath - } - - get originalElectronName () { - /* istanbul ignore next */ - throw new Error('Child classes must implement this') - } - - get newElectronName () { - /* istanbul ignore next */ - throw new Error('Child classes must implement this') - } - - get executableName () { - return this.opts.executableName || this.opts.name - } - - get stagingPath () { - if (this.opts.tmpdir === false) { - return common.generateFinalPath(this.opts) - } else { - return path.join( - common.baseTempDir(this.opts), - `${this.opts.platform}-${this.opts.arch}`, - common.generateFinalBasename(this.opts) - ) - } - } - - get appAsarPath () { - return path.join(this.originalResourcesDir, 'app.asar') - } - - async relativeRename (basePath, oldName, newName) { - debug(`Renaming ${oldName} to ${newName} in ${basePath}`) - await fs.rename(path.join(basePath, oldName), path.join(basePath, newName)) - } - - async renameElectron () { - return this.relativeRename(this.electronBinaryDir, this.originalElectronName, this.newElectronName) - } - - /** - * Performs the following initial operations for an app: - * * Creates temporary directory - * * Remove default_app (which is either a folder or an asar file) - * * If a prebuilt asar is specified: - * * Copies asar into temporary directory as app.asar - * * Otherwise: - * * Copies template into temporary directory - * * Copies user's app into temporary directory - * * Prunes non-production node_modules (if opts.prune is either truthy or undefined) - * * Creates an asar (if opts.asar is set) - * - * Prune and asar are performed before platform-specific logic, primarily so that - * this.originalResourcesAppDir is predictable (e.g. before .app is renamed for Mac) - */ - async initialize () { - debug(`Initializing app in ${this.stagingPath} from ${this.templatePath} template`) - - await fs.move(this.templatePath, this.stagingPath, { clobber: true }) - await this.removeDefaultApp() - if (this.opts.prebuiltAsar) { - await this.copyPrebuiltAsar() - } else { - await this.buildApp() - } - } - - async buildApp () { - await this.copyTemplate() - await common.validateElectronApp(this.opts.dir, this.originalResourcesAppDir) - await this.asarApp() - } - - async copyTemplate () { - const hookArgs = [ - this.originalResourcesAppDir, - this.opts.electronVersion, - this.opts.platform, - this.opts.arch - ] - - await fs.copy(this.opts.dir, this.originalResourcesAppDir, { - filter: copyFilter.userPathFilter(this.opts), - dereference: this.opts.derefSymlinks - }) - await hooks.promisifyHooks(this.opts.afterCopy, hookArgs) - if (this.opts.prune) { - await hooks.promisifyHooks(this.opts.afterPrune, hookArgs) - } - } - - async removeDefaultApp () { - await Promise.all(['default_app', 'default_app.asar'].map(async basename => fs.remove(path.join(this.originalResourcesDir, basename)))) - } - - /** - * Forces an icon filename to a given extension and returns the normalized filename, - * if it exists. Otherwise, returns null. - * - * This error path is used by win32 if no icon is specified. - */ - async normalizeIconExtension (targetExt) { - if (!this.opts.icon) throw new Error('No filename specified to normalizeIconExtension') - - let iconFilename = this.opts.icon - const ext = path.extname(iconFilename) - if (ext !== targetExt) { - iconFilename = path.join(path.dirname(iconFilename), path.basename(iconFilename, ext) + targetExt) - } - - if (await fs.pathExists(iconFilename)) { - return iconFilename - } else { - /* istanbul ignore next */ - common.warning(`Could not find icon "${iconFilename}", not updating app icon`) - } - } - - prebuiltAsarWarning (option, triggerWarning) { - if (triggerWarning) { - common.warning(`prebuiltAsar and ${option} are incompatible, ignoring the ${option} option`) - } - } - - async copyPrebuiltAsar () { - if (this.asarOptions) { - common.warning('prebuiltAsar has been specified, all asar options will be ignored') - } - - for (const hookName of ['afterCopy', 'afterPrune']) { - if (this.opts[hookName]) { - throw new Error(`${hookName} is incompatible with prebuiltAsar`) - } - } - - this.prebuiltAsarWarning('ignore', this.opts.originalIgnore) - this.prebuiltAsarWarning('prune', !this.opts.prune) - this.prebuiltAsarWarning('derefSymlinks', this.opts.derefSymlinks !== undefined) - - const src = path.resolve(this.opts.prebuiltAsar) - - const stat = await fs.stat(src) - if (!stat.isFile()) { - throw new Error(`${src} specified in prebuiltAsar must be an asar file.`) - } - - debug(`Copying asar: ${src} to ${this.appAsarPath}`) - await fs.copy(src, this.appAsarPath, { overwrite: false, errorOnExist: true }) - } - - appRelativePath (p) { - return path.relative(this.stagingPath, p) - } - - async asarApp () { - if (!this.asarOptions) { - return Promise.resolve() - } - - debug(`Running asar with the options ${JSON.stringify(this.asarOptions)}`) - await asar.createPackageWithOptions(this.originalResourcesAppDir, this.appAsarPath, this.asarOptions) - const { headerString } = asar.getRawHeader(this.appAsarPath) - this.asarIntegrity = { - [this.appRelativePath(this.appAsarPath)]: { - algorithm: 'SHA256', - hash: crypto.createHash('SHA256').update(headerString).digest('hex') - } - } - await fs.remove(this.originalResourcesAppDir) - } - - async copyExtraResources () { - if (!this.opts.extraResource) return Promise.resolve() - - const extraResources = common.ensureArray(this.opts.extraResource) - - await Promise.all(extraResources.map( - resource => fs.copy(resource, path.resolve(this.stagingPath, this.resourcesDir, path.basename(resource))) - )) - } - - async move () { - const finalPath = common.generateFinalPath(this.opts) - - if (this.opts.tmpdir !== false) { - debug(`Moving ${this.stagingPath} to ${finalPath}`) - await fs.move(this.stagingPath, finalPath) - } - - return finalPath - } -} - -module.exports = App diff --git a/node_modules/electron-packager/src/prune.js b/node_modules/electron-packager/src/prune.js deleted file mode 100644 index e5739ef..0000000 --- a/node_modules/electron-packager/src/prune.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict' - -const common = require('./common') -const galactus = require('galactus') -const fs = require('fs-extra') -const path = require('path') - -const ELECTRON_MODULES = [ - 'electron', - 'electron-prebuilt', - 'electron-prebuilt-compile' -] - -class Pruner { - constructor (dir) { - this.baseDir = common.normalizePath(dir) - this.galactus = new galactus.DestroyerOfModules({ - rootDirectory: dir, - shouldKeepModuleTest: (module, isDevDep) => this.shouldKeepModule(module, isDevDep) - }) - this.walkedTree = false - } - - setModules (moduleMap) { - const modulePaths = Array.from(moduleMap.keys()).map(modulePath => `/${common.normalizePath(modulePath)}`) - this.modules = new Set(modulePaths) - this.walkedTree = true - } - - async pruneModule (name) { - if (this.walkedTree) { - return this.isProductionModule(name) - } else { - const moduleMap = await this.galactus.collectKeptModules({ relativePaths: true }) - this.setModules(moduleMap) - return this.isProductionModule(name) - } - } - - shouldKeepModule (module, isDevDep) { - if (isDevDep || module.depType === galactus.DepType.ROOT) { - return false - } - - if (ELECTRON_MODULES.includes(module.name)) { - common.warning(`Found '${module.name}' but not as a devDependency, pruning anyway`) - return false - } - - return true - } - - isProductionModule (name) { - return this.modules.has(name) - } -} - -function isNodeModuleFolder (pathToCheck) { - return path.basename(path.dirname(pathToCheck)) === 'node_modules' || - (path.basename(path.dirname(pathToCheck)).startsWith('@') && path.basename(path.resolve(pathToCheck, `..${path.sep}..`)) === 'node_modules') -} - -module.exports = { - isModule: async function isModule (pathToCheck) { - return (await fs.pathExists(path.join(pathToCheck, 'package.json'))) && isNodeModuleFolder(pathToCheck) - }, - Pruner: Pruner -} diff --git a/node_modules/electron-packager/src/targets.js b/node_modules/electron-packager/src/targets.js deleted file mode 100644 index 39b50dd..0000000 --- a/node_modules/electron-packager/src/targets.js +++ /dev/null @@ -1,148 +0,0 @@ -'use strict' - -const common = require('./common') -const { getHostArch } = require('@electron/get') -const semver = require('semver') - -const officialArchs = ['ia32', 'x64', 'armv7l', 'arm64', 'mips64el', 'universal'] -const officialPlatforms = ['darwin', 'linux', 'mas', 'win32'] -const officialPlatformArchCombos = { - darwin: ['x64', 'arm64', 'universal'], - linux: ['ia32', 'x64', 'armv7l', 'arm64', 'mips64el'], - mas: ['x64', 'arm64', 'universal'], - win32: ['ia32', 'x64', 'arm64'] -} - -const buildVersions = { - darwin: { - arm64: '>= 11.0.0-beta.1', - universal: '>= 11.0.0-beta.1' - }, - linux: { - arm64: '>= 1.8.0', - mips64el: '^1.8.2-beta.5' - }, - mas: { - arm64: '>= 11.0.0-beta.1', - universal: '>= 11.0.0-beta.1' - }, - win32: { - arm64: '>= 6.0.8' - } -} - -// Maps to module filename for each platform (lazy-required if used) -const osModules = { - darwin: './mac', - linux: './linux', - mas: './mac', // map to darwin - win32: './win32' -} - -const supported = { - arch: new Set(officialArchs), - platform: new Set(officialPlatforms) -} - -function createPlatformArchPairs (opts, selectedPlatforms, selectedArchs, ignoreFunc) { - const combinations = [] - for (const arch of selectedArchs) { - for (const platform of selectedPlatforms) { - if (usingOfficialElectronPackages(opts)) { - if (!validOfficialPlatformArch(opts, platform, arch)) { - warnIfAllNotSpecified(opts, `The platform/arch combination ${platform}/${arch} is not currently supported by Electron Packager`) - continue - } else if (buildVersions[platform] && buildVersions[platform][arch]) { - const buildVersion = buildVersions[platform][arch] - if (buildVersion && !officialBuildExists(opts, buildVersion)) { - warnIfAllNotSpecified(opts, `Official ${platform}/${arch} support only exists in Electron ${buildVersion}`) - continue - } - } - if (typeof ignoreFunc === 'function' && ignoreFunc(platform, arch)) continue - } - combinations.push([platform, arch]) - } - } - - return combinations -} - -function unsupportedListOption (name, value, supported) { - return new Error(`Unsupported ${name}=${value} (${typeof value}); must be a string matching: ${Array.from(supported.values()).join(', ')}`) -} - -function usingOfficialElectronPackages (opts) { - return !opts.download || !Object.prototype.hasOwnProperty.call(opts.download, 'mirrorOptions') -} - -function validOfficialPlatformArch (opts, platform, arch) { - return officialPlatformArchCombos[platform] && officialPlatformArchCombos[platform].includes(arch) -} - -function officialBuildExists (opts, buildVersion) { - return semver.satisfies(opts.electronVersion, buildVersion, { includePrerelease: true }) -} - -function allPlatformsOrArchsSpecified (opts) { - return opts.all || opts.arch === 'all' || opts.platform === 'all' -} - -function warnIfAllNotSpecified (opts, message) { - if (!allPlatformsOrArchsSpecified(opts)) { - common.warning(message) - } -} - -module.exports = { - allOfficialArchsForPlatformAndVersion: function allOfficialArchsForPlatformAndVersion (platform, electronVersion) { - const archs = officialPlatformArchCombos[platform] - if (buildVersions[platform]) { - const excludedArchs = Object.keys(buildVersions[platform]) - .filter(arch => !officialBuildExists({ electronVersion: electronVersion }, buildVersions[platform][arch])) - return archs.filter(arch => !excludedArchs.includes(arch)) - } - - return archs - }, - createPlatformArchPairs, - officialArchs, - officialPlatformArchCombos, - officialPlatforms, - osModules, - supported, - // Validates list of architectures or platforms. - // Returns a normalized array if successful, or throws an Error. - validateListFromOptions: function validateListFromOptions (opts, name) { - if (opts.all) return Array.from(supported[name].values()) - - let list = opts[name] - if (!list) { - if (name === 'arch') { - list = getHostArch() - } else { - list = process[name] - } - } else if (list === 'all') { - return Array.from(supported[name].values()) - } - - if (!Array.isArray(list)) { - if (typeof list === 'string') { - list = list.split(/,\s*/) - } else { - return unsupportedListOption(name, list, supported[name]) - } - } - - const officialElectronPackages = usingOfficialElectronPackages(opts) - - for (const value of list) { - if (officialElectronPackages && !supported[name].has(value)) { - return unsupportedListOption(name, value, supported[name]) - } - } - - return list - } -} diff --git a/node_modules/electron-packager/src/universal.js b/node_modules/electron-packager/src/universal.js deleted file mode 100644 index 8ae7cb1..0000000 --- a/node_modules/electron-packager/src/universal.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict' - -const universal = require('@electron/universal') -const common = require('./common') -const fs = require('fs-extra') -const path = require('path') - -async function packageUniversalMac (packageForPlatformAndArchWithOpts, buildDir, comboOpts, downloadOpts, tempBase) { - // In order to generate a universal macOS build we actually need to build the x64 and the arm64 app - // and then glue them together - common.info(`Packaging app for platform ${comboOpts.platform} universal using electron v${comboOpts.electronVersion} - Building x64 and arm64 slices now`, comboOpts.quiet) - await fs.mkdirp(tempBase) - const tempDir = await fs.mkdtemp(path.resolve(tempBase, 'electron-packager-universal-')) - - const { App } = require('./mac') - const app = new App(comboOpts, buildDir) - const universalStagingPath = app.stagingPath - const finalUniversalPath = common.generateFinalPath(app.opts) - - if (await fs.pathExists(finalUniversalPath)) { - if (comboOpts.overwrite) { - await fs.remove(finalUniversalPath) - } else { - common.info(`Skipping ${comboOpts.platform} ${comboOpts.arch} (output dir already exists, use --overwrite to force)`, comboOpts.quiet) - return true - } - } - - const tempPackages = {} - - for (const tempArch of ['x64', 'arm64']) { - const tempOpts = { - ...comboOpts, - arch: tempArch, - out: tempDir - } - const tempDownloadOpts = { - ...downloadOpts, - arch: tempArch - } - // Do not sign or notarize the individual slices, we sign and notarize the merged app later - delete tempOpts.osxSign - delete tempOpts.osxNotarize - - tempPackages[tempArch] = await packageForPlatformAndArchWithOpts(tempOpts, tempDownloadOpts) - } - - const x64AppPath = tempPackages.x64 - const arm64AppPath = tempPackages.arm64 - - common.info(`Stitching universal app for platform ${comboOpts.platform}`, comboOpts.quiet) - - const generatedFiles = await fs.readdir(x64AppPath) - const appName = generatedFiles.filter(file => path.extname(file) === '.app')[0] - - await universal.makeUniversalApp({ - ...comboOpts.osxUniversal, - x64AppPath: path.resolve(x64AppPath, appName), - arm64AppPath: path.resolve(arm64AppPath, appName), - outAppPath: path.resolve(universalStagingPath, appName) - }) - - await app.signAppIfSpecified() - await app.notarizeAppIfSpecified() - await app.move() - - for (const generatedFile of generatedFiles) { - if (path.extname(generatedFile) === '.app') continue - - await fs.copy(path.resolve(x64AppPath, generatedFile), path.resolve(finalUniversalPath, generatedFile)) - } - - await fs.remove(tempDir) - - return finalUniversalPath -} - -module.exports = { - packageUniversalMac -} diff --git a/node_modules/electron-packager/src/unzip.js b/node_modules/electron-packager/src/unzip.js deleted file mode 100644 index 705c552..0000000 --- a/node_modules/electron-packager/src/unzip.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict' - -const extractZip = require('extract-zip') - -module.exports = async function extractElectronZip (zipPath, targetDir) { - await extractZip(zipPath, { dir: targetDir }) -} diff --git a/node_modules/electron-packager/src/win32.js b/node_modules/electron-packager/src/win32.js deleted file mode 100644 index 9416617..0000000 --- a/node_modules/electron-packager/src/win32.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict' - -const debug = require('debug')('electron-packager') -const path = require('path') -const { WrapperError } = require('cross-spawn-windows-exe') - -const App = require('./platform') -const common = require('./common') - -function updateWineMissingException (err) { - if (err instanceof WrapperError) { - err.message += '\n\n' + - 'Wine is required to use the appCopyright, appVersion, buildVersion, icon, and \n' + - 'win32metadata parameters for Windows targets.\n\n' + - 'See https://github.com/electron/electron-packager#building-windows-apps-from-non-windows-platforms for details.' - } - - return err -} - -class WindowsApp extends App { - get originalElectronName () { - return 'electron.exe' - } - - get newElectronName () { - return `${common.sanitizeAppName(this.executableName)}.exe` - } - - get electronBinaryPath () { - return path.join(this.stagingPath, this.newElectronName) - } - - generateRceditOptionsSansIcon () { - const win32metadata = { - FileDescription: this.opts.name, - InternalName: this.opts.name, - OriginalFilename: this.newElectronName, - ProductName: this.opts.name, - ...this.opts.win32metadata - } - - const rcOpts = { 'version-string': win32metadata } - - if (this.opts.appVersion) { - rcOpts['product-version'] = rcOpts['file-version'] = this.opts.appVersion - } - - if (this.opts.buildVersion) { - rcOpts['file-version'] = this.opts.buildVersion - } - - if (this.opts.appCopyright) { - rcOpts['version-string'].LegalCopyright = this.opts.appCopyright - } - - const manifestProperties = ['application-manifest', 'requested-execution-level'] - for (const manifestProperty of manifestProperties) { - if (win32metadata[manifestProperty]) { - rcOpts[manifestProperty] = win32metadata[manifestProperty] - } - } - - return rcOpts - } - - async getIconPath () { - if (!this.opts.icon) { - return Promise.resolve() - } - - return this.normalizeIconExtension('.ico') - } - - needsRcedit () { - return this.opts.icon || this.opts.win32metadata || this.opts.appCopyright || this.opts.appVersion || this.opts.buildVersion - } - - async runRcedit () { - /* istanbul ignore if */ - if (!this.needsRcedit()) { - return Promise.resolve() - } - - const rcOpts = this.generateRceditOptionsSansIcon() - - // Icon might be omitted or only exist in one OS's format, so skip it if normalizeExt reports an error - const icon = await this.getIconPath() - if (icon) { - rcOpts.icon = icon - } - - debug(`Running rcedit with the options ${JSON.stringify(rcOpts)}`) - try { - await require('rcedit')(this.electronBinaryPath, rcOpts) - } catch (err) { - throw updateWineMissingException(err) - } - } - - async create () { - await this.initialize() - await this.renameElectron() - await this.copyExtraResources() - await this.runRcedit() - return this.move() - } -} - -module.exports = { - App: WindowsApp, - updateWineMissingException: updateWineMissingException -} diff --git a/node_modules/electron-packager/usage.txt b/node_modules/electron-packager/usage.txt deleted file mode 100644 index c0ff945..0000000 --- a/node_modules/electron-packager/usage.txt +++ /dev/null @@ -1,124 +0,0 @@ -Usage: electron-packager <sourcedir> <appname> [options...] - -Required parameters - -sourcedir the base directory of the application source - - Examples: electron-packager ./ - electron-packager ./ --all - -Optional parameters - -appname the name of the app, if it needs to be different from the "productName" or "name" - in the nearest package.json - -Options - -version prints the version of Electron Packager and Node, plus the target platform and - arch, for bug reporting purposes, and exits immediately - -* All platforms * - -all equivalent to --platform=all --arch=all -app-copyright human-readable copyright line for the app -app-version release version to set for the app -arch all, or one or more of: ia32, x64, armv7l, arm64, mips64el, universal (comma-delimited if - multiple). Defaults to the host arch. - For info on arch/platform support see https://github.com/electron/electron-packager/#supported-platforms -asar whether to package the source code within your app into an archive. You can either - pass --asar by itself to use the default configuration, OR use dot notation to - configure a list of sub-properties, e.g. --asar.unpackDir=sub_dir - do not use - --asar and its sub-properties simultaneously. - - Properties supported include: - - ordering: path to an ordering file for file packing - - unpack: unpacks the files to the app.asar.unpacked directory whose filenames - regex .match this string - - unpackDir: unpacks the dir to the app.asar.unpacked directory whose names glob - pattern or exactly match this string. It's relative to the <sourcedir>. -build-version build version to set for the app -download a list of sub-options to pass to @electron/get. They are specified via dot - notation, e.g., --download.cacheRoot=/tmp/cache - Properties supported: - - cacheRoot: directory of cached Electron downloads. For default value, see - @electron/get documentation - - mirrorOptions: alternate URL options for downloading Electron zips. See - @electron/get documentation for details - - rejectUnauthorized: whether SSL certs are required to be valid when downloading - Electron. Defaults to true, use --no-download.rejectUnauthorized to disable - checks. -electron-version the version of Electron that is being packaged, see - https://github.com/electron/electron/releases -electron-zip-dir the local path to a directory containing Electron ZIP files -executable-name the name of the executable file, sans file extension. Defaults to appname -extra-resource a file to copy into the app's resources directory -icon the local path to an icon file to use as the icon for the app. - Note: Format depends on platform. -ignore do not copy files into app whose filenames RegExp.match this string. See also: - https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html#ignore - and --no-prune. Can be specified multiple times -no-deref-symlinks make sure symlinks are not dereferenced within the app source -no-junk do not ignore system junk files from the packaged app -no-prune do not prune devDependencies from the packaged app -out the dir to put the app into at the end. Defaults to current working dir -overwrite if output directory for a platform already exists, replaces it rather than - skipping it -platform all, or one or more of: darwin, linux, mas, win32 (comma-delimited if multiple). - Defaults to the host platform -prebuilt-asar path to a prebuilt asar file (asar, ignore, no-prune, and no-deref-symlinks - options are incompatible with this option and will be ignored) -quiet Do not print informational or warning messages -tmpdir temp directory. Defaults to system temp directory, use --no-tmpdir to disable - use of a temporary directory. - -* darwin/mas target platforms only * - -app-bundle-id bundle identifier to use in the app plist -app-category-type the application category type - For example, `app-category-type=public.app-category.developer-tools` will set the - application category to 'Developer Tools'. -darwin-dark-mode-support - forces support for Mojave/10.14 dark mode in the packaged app -extend-info a plist file to merge into the app plist -helper-bundle-id bundle identifier to use in the app helper plist -osx-sign (macOS host platform only) Whether to sign the macOS app packages. You can either - pass --osx-sign by itself to use the default configuration, or use dot notation - to configure a list of sub-properties, e.g. --osx-sign.identity="My Name" - For info on supported values see https://npm.im/electron-osx-sign#opts---options - Properties supported include: - - identity: should contain the identity to be used when running `codesign` - - entitlements: the path to entitlements used in signing - - entitlements-inherit: the path to the 'child' entitlements -osx-notarize (macOS host platform only, requires --osx-sign) Whether to notarize the macOS app - packages. You must use dot notation to configure a list of sub-properties, e.g. - --osx-notarize.appleId="foo@example.com" - For info on supported values see https://npm.im/electron-notarize#method-notarizeopts-promisevoid - Properties supported include: - - appleId: should contain your apple ID username / email - - appleIdPassword: should contain the password for the provided apple ID - - appleApiKey: should contain an App Store Connect API key - - appleApiIssuer: should contain the API key's issuer -protocol URL protocol scheme to register the app as an opener of. - For example, `--protocol=myapp` would register the app to open - URLs such as `myapp://path`. This argument requires a `--protocol-name` - argument to also be specified. -protocol-name Descriptive name of URL protocol scheme specified via `--protocol` -usage-description Human-readable descriptions of how the app uses certain macOS features. Displayed - in the App Store. A non-exhaustive list of properties supported: - - Camera - - Microphone - -* win32 target platform only * - -win32metadata a list of sub-properties used to set the application metadata embedded into - the executable. They are specified via dot notation, - e.g. --win32metadata.CompanyName="Company Inc." - or --win32metadata.ProductName="Product" - Properties supported: - - CompanyName (default: author name from nearest package.json) - - FileDescription (default: appname) - - OriginalFilename (default: renamed exe) - - ProductName (default: appname) - - InternalName (default: appname) - - requested-execution-level (user, asInvoker, or requireAdministrator) - - application-manifest |