diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c1fc1e9..a7496e4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,19 +1,9 @@ version: 2 updates: - - package-ecosystem: "npm" - directory: "./app" - schedule: - interval: "weekly" - day: "saturday" - groups: - npm: - patterns: - - "*" - package-ecosystem: "npm" directory: "." schedule: - interval: "weekly" - day: "saturday" + interval: "daily" groups: npm: patterns: @@ -21,8 +11,7 @@ updates: - package-ecosystem: "github-actions" directory: ".github/" schedule: - interval: "weekly" - day: "saturday" + interval: "daily" groups: gha: patterns: diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index a6c9db6..1525cb1 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -2,7 +2,7 @@ name: cd on: push: branches: - - master + - main jobs: release: @@ -11,10 +11,9 @@ jobs: - uses: actions/checkout@v3.3.0 - uses: actions/setup-node@v3.6.0 with: - node-version: "18" + node-version: 20 - run: npm ci - - run: npm run deps - uses: JS-DevTools/npm-publish@v2.1.0 with: token: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e50955c..f02e2ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,10 +2,10 @@ name: ci on: pull_request: branches: - - master + - main workflow_dispatch: branches: - - master + - main concurrency: group: ${{ github.ref }} @@ -15,14 +15,13 @@ jobs: test: strategy: matrix: - os: [macos-12, ubuntu-22.04, windows-2022] + os: [macos-14, ubuntu-22.04, windows-2022] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3.3.0 - uses: actions/setup-node@v3.6.0 with: - node-version: 16 + node-version: 20 cache: "npm" - run: npm ci - - run: npm run deps - - run: npm run test + - run: npm t diff --git a/CODEOWNERS b/CODEOWNERS deleted file mode 100644 index d607742..0000000 --- a/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @ayushmanchhabra diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 139518a..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,12 +0,0 @@ -## Code style -### EditorConfig -This project has a [.editorconfig file](.editorconfig). See [http://editorconfig.org/](http://editorconfig.org/) for details and to install the plugin for your editor / IDE. - -### Running the tests - -1. `npm run deps` to install all dependencies -2. `npm test` to actually run the tests - -## Docs generation - -[README.md](README.md) is generated based on [docs/README.hbs](docs/README.hbs) and the JSDoc comments in [app/updater.js](app/updater.js). When changing the readme / API, make sure to run `grunt docs` before committing. \ No newline at end of file diff --git a/LICENSE b/LICENSE index db4fa7e..53298f1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,6 @@ The MIT License (MIT) +Copyright (c) 2023 NW.js Utils Copyright (c) 2014 Eldar Djafarov Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/app/package-lock.json b/app/package-lock.json deleted file mode 100644 index 3af9fa0..0000000 --- a/app/package-lock.json +++ /dev/null @@ -1,944 +0,0 @@ -{ - "name": "updapp", - "version": "0.0.1", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "updapp", - "version": "0.0.1", - "license": "MIT", - "dependencies": { - "del": "^7.1.0", - "ncp": "^2.0.0", - "request": "^2.36.0", - "semver": "^7.6.2" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/aggregate-error": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", - "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", - "dependencies": { - "clean-stack": "^4.0.0", - "indent-string": "^5.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "engines": { - "node": ">=0.8" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" - }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", - "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==" - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" - }, - "node_modules/clean-stack": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", - "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", - "dependencies": { - "escape-string-regexp": "5.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, - "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" - }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/del": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/del/-/del-7.1.0.tgz", - "integrity": "sha512-v2KyNk7efxhlyHpjEvfyxaAihKKK0nWCuf6ZtqZcFFpQRG0bJ12Qsr0RpvsICMjAAZ8DOVCxrlqpxISlMHC4Kg==", - "dependencies": { - "globby": "^13.1.2", - "graceful-fs": "^4.2.10", - "is-glob": "^4.0.3", - "is-path-cwd": "^3.0.0", - "is-path-inside": "^4.0.0", - "p-map": "^5.5.0", - "rimraf": "^3.0.2", - "slash": "^4.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "engines": [ - "node >=0.6.0" - ] - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "engines": { - "node": "*" - } - }, - "node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" - }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "dependencies": { - "assert-plus": "^1.0.0" - } - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globby": { - "version": "13.1.4", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.4.tgz", - "integrity": "sha512-iui/IiiW+QrJ1X1hKH5qwlMQyv34wJAYwH1vrf8b9kBA4sNiif3gKsMHa+BrdnOpEudWjpotfa7LrTzB1ERS/g==", - "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.11", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" - }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", - "engines": { - "node": ">=4" - } - }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, - "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "engines": { - "node": ">= 4" - } - }, - "node_modules/indent-string": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", - "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-path-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-3.0.0.tgz", - "integrity": "sha512-kyiNFFLU0Ampr6SDZitD/DwUo4Zs1nSdnygUBqsu3LooL00Qvb5j+UnvApUn/TTj1J3OuE6BTdQ5rudKmU2ZaA==", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-path-inside": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", - "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" - }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==" - }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==" - }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" - }, - "node_modules/jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ncp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", - "integrity": "sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==", - "bin": { - "ncp": "bin/ncp" - } - }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "engines": { - "node": "*" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/p-map": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", - "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", - "dependencies": { - "aggregate-error": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "engines": { - "node": ">=8" - } - }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" - }, - "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", - "engines": { - "node": ">=6" - } - }, - "node_modules/qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==" - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "bin": { - "uuid": "bin/uuid" - } - }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - } - } -} diff --git a/app/package.json b/app/package.json index 51f2493..6f836ce 100644 --- a/app/package.json +++ b/app/package.json @@ -4,20 +4,14 @@ "description": "", "author": "Eldar Djafarov ", "license": "MIT", - "manifestUrl": "https://raw.githubusercontent.com/openconf/updater/master/package.json", + "manifestUrl": "https://raw.githubusercontent.com/nwutils/nw-updater/main/package.json", "packages": { "mac": { - "url": "https://github.com/openconf/updater/blob/master/deploy/releases/updapp/mac/updapp.dmg?raw=true" + "url": "https://github.com/nwutils/nw-updater/archive/refs/tags/0.2.1.tar.gz" } }, "window": { "toolbar": true }, - "main": "app://updapp/index.html", - "dependencies": { - "ncp": "^2.0.0", - "request": "^2.36.0", - "del": "^7.1.0", - "semver": "^7.6.2" - } + "main": "app://updapp/index.html" } diff --git a/app/updater.js b/app/updater.js index 43355cd..45736cf 100644 --- a/app/updater.js +++ b/app/updater.js @@ -1,432 +1,416 @@ - var request = require('request'); - var path = require('path'); - var os = require('os'); - var fs = require('fs'); - var exec = require('child_process').exec; - var spawn = require('child_process').spawn; - var ncp = require('ncp'); - var del = require('del'); - var semver = require('semver'); - - var platform = process.platform; - platform = /^win/.test(platform)? 'win' : /^darwin/.test(platform)? 'mac' : 'linux' + (process.arch == 'ia32' ? '32' : '64'); - +import child_process from 'node:child_process'; +import fs from 'node:fs'; +import os from 'node:os'; +import path from 'node:path'; +import process from 'node:process'; + +import del from 'del'; +import ncp from 'ncp'; +import semver from 'semver'; + + +let platform = process.platform; +platform = /^win/.test(platform) ? 'win' : /^darwin/.test(platform) ? 'mac' : 'linux' + (process.arch == 'ia32' ? '32' : '64'); + +/** + * @typedef {object} Platform + * @property {string} url - The URL to the package + * @property {string} execPath - The path to the executable + */ + +/** + * @typedef {object} Packages + * @property {Platform} win - The Windows package + * @property {Platform} mac - The macOS package + * @property {Platform} linux32 - The Linux 32-bit package + * @property {Platform} linux64 - The Linux 64-bit package + */ + +/** + * @typedef {object} Manifest + * @property {string} name - The name of the application + * @property {string} version - The current version of the application + * @property {string} manifestUrl - The URL to the remote manifest file + * @property {Packages} packages - The packages for the application + */ + +/** + * @typedef {object} UpdaterOptions + * @property {string} temporaryDirectory - The path to a directory to download the updates to and unpack them in. Defaults to [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) + */ + +class updater { /** - * Creates new instance of updater. Manifest could be a `package.json` of project. - * - * Note that compressed apps are assumed to be downloaded in the format produced by [node-webkit-builder](https://github.com/mllrsohn/node-webkit-builder) (or [grunt-node-webkit-builder](https://github.com/mllrsohn/grunt-node-webkit-builder)). - * + * Creates new instance of updater. + * * @constructor - * @param {object} manifest - See the [manifest schema](#manifest-schema) below. - * @param {object} options - Optional - * @property {string} options.temporaryDirectory - (Optional) path to a directory to download the updates to and unpack them in. Defaults to [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) + * @param {Manifest} manifest - See the [manifest schema](https://github.com/nwutils/nw-updater?tab=readme-ov-file#manifest-schema). + * @param {UpdaterOptions} options - Optional */ - function updater(manifest, options){ + constructor(manifest, options) { this.manifest = manifest; this.options = { temporaryDirectory: options && options.temporaryDirectory || os.tmpdir() }; } - /** - * Will check the latest available version of the application by requesting the manifest specified in `manifestUrl`. - * - * The callback will always be called; the second parameter indicates whether or not there's a newer version. - * This function assumes you use [Semantic Versioning](http://semver.org) and enforces it; if your local version is `0.2.0` and the remote one is `0.1.23456` then the callback will be called with `false` as the second paramter. If on the off chance you don't use semantic versioning, you could manually download the remote manifest and call `download` if you're happy that the remote version is newer. - * - * @param {function} cb - Callback arguments: error, newerVersionExists (`Boolean`), remoteManifest + * Check the latest available version of the application by requesting the manifest specified in `manifestUrl`. + * + * @async + * @method + * @returns {Promise.} */ - updater.prototype.checkNewVersion = function(cb){ - request.get(this.manifest.manifestUrl, gotManifest.bind(this)); //get manifest from url - - /** - * @private - */ - function gotManifest(err, req, data){ - if(err) { - return cb(err); - } - - if(req.statusCode < 200 || req.statusCode > 299){ - return cb(new Error(req.statusCode)); - } - - try{ - data = JSON.parse(data); - } catch(e){ - return cb(e) - } + async checkNewVersion() { + const response = await axios({ + method: 'get', + url: this.manifest.manifestUrl, + responseType: 'json' + }); - try { - cb(null, semver.gt(data.version, this.manifest.version), data); - } catch (e) { - return cb(e) - } - - } - }; + return semver.gt(response.data.version, this.manifest.version); + } /** - * Downloads the new app to a template folder - * @param {Function} cb - called when download completes. Callback arguments: error, downloaded filepath - * @param {Object} newManifest - see [manifest schema](#manifest-schema) below - * @return {Request} Request - stream, the stream contains `manifest` property with new manifest and 'content-length' property with the size of package. + * Downloads the new app to a temorary folder. + * + * @async + * @method + * @param {Manifest} newManifest - see [manifest schema](https://github.com/nwutils/nw-updater?tab=readme-ov-file#manifest-schema) below + * @returns {Promise.} */ - updater.prototype.download = function(cb, newManifest){ - var manifest = newManifest || this.manifest; - var url = manifest.packages[platform].url; - var pkg = request(url, function(err, response){ - if(err){ - cb(err); - } - if(response && (response.statusCode < 200 || response.statusCode >= 300)){ - pkg.abort(); - return cb(new Error(response.statusCode)); - } - }); - pkg.on('response', function(response){ - if(response && response.headers && response.headers['content-length']){ - pkg['content-length'] = response.headers['content-length']; - } - }); - var filename = decodeURI(path.basename(url)), - destinationPath = path.join(this.options.temporaryDirectory, filename); - // download the package to template folder - fs.unlink(path.join(this.options.temporaryDirectory, filename), function(){ - pkg.pipe(fs.createWriteStream(destinationPath)); - pkg.resume(); + async download(newManifest) { + const manifest = newManifest ?? this.manifest; + const url = manifest.packages[platform].url; + const filename = decodeURI(path.basename(url)) + const destinationPath = path.resolve(this.options.temporaryDirectory, filename); + + const writeStream = fs.createWriteStream(destinationPath); + + const response = await axios({ + method: 'get', + url: url, + responseType: 'stream' }); - pkg.on('error', cb); - pkg.on('end', appDownloaded); - pkg.pause(); - - function appDownloaded(){ - process.nextTick(function(){ - if(pkg.response.statusCode >= 200 && pkg.response.statusCode < 300){ - cb(null, destinationPath); - } - }); - } - return pkg; - }; + await stream.promises.pipeline(response.data, writeStream); + } /** - * Returns executed application path + * Returns executed application path. + * * @returns {string} */ - updater.prototype.getAppPath = function(){ - var appPath = { - mac: path.join(process.cwd(),'../../..'), + getAppPath() { + let appPath = { + mac: path.join(process.cwd(), '../../..'), win: path.dirname(process.execPath) }; appPath.linux32 = appPath.win; appPath.linux64 = appPath.win; return appPath[platform]; - }; - + } /** - * Returns current application executable + * Returns current application executable. + * * @returns {string} */ - updater.prototype.getAppExec = function(){ - var execFolder = this.getAppPath(); - var exec = { + getAppExec() { + let execFolder = this.getAppPath(); + let exec = { mac: '', win: path.basename(process.execPath), linux32: path.basename(process.execPath), linux64: path.basename(process.execPath) }; return path.join(execFolder, exec[platform]); - }; - + } /** - * Will unpack the `filename` in temporary folder. - * For Windows, [unzip](https://www.mkssoftware.com/docs/man1/unzip.1.asp) is used (which is [not signed](https://github.com/edjafarov/node-webkit-updater/issues/68)). - * - * @param {string} filename - * @param {function} cb - Callback arguments: error, unpacked directory - * @param {object} manifest - */ - updater.prototype.unpack = function(filename, cb, manifest){ + * Will unpack the `filename` in temporary folder. + * For Windows, [unzip](https://www.mkssoftware.com/docs/man1/unzip.1.asp) is used (which is [not signed](https://github.com/edjafarov/node-webkit-updater/issues/68)). + * + * @param {string} filename + * @param {function} cb - Callback arguments: error, unpacked directory + * @param {object} manifest + */ + unpack(filename, cb, manifest) { pUnpack[platform](filename, cb, manifest, this.options.temporaryDirectory); - }; + } + /** + * Runs installer + * @param {string} appPath + * @param {array} args - Arguments which will be passed when running the new app + * @param {object} options - Optional + * @returns {function} + */ + runInstaller(appPath, args, options) { + return pRun[platform].apply(this, arguments); + } + /** + * Installs the app (copies current application to `copyPath`) + * @param {string} copyPath + * @param {function} cb - Callback arguments: error + */ + install(copyPath, cb) { + pInstall[platform].apply(this, arguments); + } + /** + * Runs the app from original app executable path. + * @param {string} execPath + * @param {array} args - Arguments passed to the app being ran. + * @param {object} options - Optional. See `spawn` from nodejs docs. + * + * Note: if this doesn't work, try `gui.Shell.openItem(execPath)` (see [node-webkit Shell](https://github.com/rogerwang/node-webkit/wiki/Shell)). + */ + run(execPath, args, options) { + var arg = arguments; + if (platform.indexOf('linux') === 0) arg[0] = path.dirname(arg[0]); + pRun[platform].apply(this, arg); + } +} + +/** + * @private + * @param {string} zipPath + * @param {string} temporaryDirectory + * @return {string} + */ +var getZipDestinationDirectory = function (zipPath, temporaryDirectory) { + return path.join(temporaryDirectory, path.basename(zipPath, path.extname(zipPath))); +}, /** * @private - * @param {string} zipPath - * @param {string} temporaryDirectory + * @param {object} manifest * @return {string} */ - var getZipDestinationDirectory = function(zipPath, temporaryDirectory){ - return path.join(temporaryDirectory, path.basename(zipPath, path.extname(zipPath))); - }, - /** - * @private - * @param {object} manifest - * @return {string} - */ - getExecPathRelativeToPackage = function(manifest){ - var execPath = manifest.packages[platform] && manifest.packages[platform].execPath; + getExecPathRelativeToPackage = function (manifest) { + var execPath = manifest.packages[platform] && manifest.packages[platform].execPath; - if(execPath){ - return execPath; - } - else { - var suffix = { - win: '.exe', - mac: '.app' - }; - return manifest.name + (suffix[platform] || ''); - } - }; + if (execPath) { + return execPath; + } + else { + var suffix = { + win: '.exe', + mac: '.app' + }; + return manifest.name + (suffix[platform] || ''); + } + }; - var pUnpack = { - /** - * @private - */ - mac: function(filename, cb, manifest, temporaryDirectory){ - var args = arguments, - extension = path.extname(filename), - destination = path.join(temporaryDirectory, path.basename(filename, extension)); +var pUnpack = { + /** + * @private + */ + mac: function (filename, cb, manifest, temporaryDirectory) { + var args = arguments, + extension = path.extname(filename), + destination = path.join(temporaryDirectory, path.basename(filename, extension)); - if(!fs.existsSync(destination)){ - fs.mkdirSync(destination); - } + if (!fs.existsSync(destination)) { + fs.mkdirSync(destination); + } - if(extension === ".zip"){ - exec('unzip -xo "' + filename + '" >/dev/null',{ cwd: destination }, function(err){ - if(err){ - console.log(err); - return cb(err); - } - var appPath = path.join(destination, getExecPathRelativeToPackage(manifest)); - cb(null, appPath); - }) + if (extension === ".zip") { + child_process.exec('unzip -xo "' + filename + '" >/dev/null', { cwd: destination }, function (err) { + if (err) { + console.log(err); + return cb(err); + } + var appPath = path.join(destination, getExecPathRelativeToPackage(manifest)); + cb(null, appPath); + }) - } - else if(extension === ".dmg"){ - // just in case if something was wrong during previous mount - exec('hdiutil unmount /Volumes/'+path.basename(filename, '.dmg'), function(err){ - // create a CDR from the DMG to bypass any steps which require user interaction - var cdrPath = filename.replace(/.dmg$/, '.cdr'); - exec('hdiutil convert "' + filename + '" -format UDTO -o "' + cdrPath + '"', function(err){ - exec('hdiutil attach "' + cdrPath + '" -nobrowse', function(err){ - if(err) { - if(err.code == 1){ - pUnpack.mac.apply(this, args); - } - return cb(err); + } + else if (extension === ".dmg") { + // just in case if something was wrong during previous mount + child_process.exec('hdiutil unmount /Volumes/' + path.basename(filename, '.dmg'), function (err) { + // create a CDR from the DMG to bypass any steps which require user interaction + var cdrPath = filename.replace(/.dmg$/, '.cdr'); + child_process.exec('hdiutil convert "' + filename + '" -format UDTO -o "' + cdrPath + '"', function (err) { + child_process.exec('hdiutil attach "' + cdrPath + '" -nobrowse', function (err) { + if (err) { + if (err.code == 1) { + pUnpack.mac.apply(this, args); } - findMountPoint(path.basename(filename, '.dmg'), cb); - }); + return cb(err); + } + findMountPoint(path.basename(filename, '.dmg'), cb); }); }); + }); - function findMountPoint(dmg_name, callback) { - exec('hdiutil info', function(err, stdout){ - if (err) return callback(err); - var results = stdout.split("\n"); - var dmgExp = new RegExp(dmg_name + '$'); - for (var i=0,l=results.length;i NUL', function(err){ - if(err){ - return cb(err); - } - - cb(null, path.join(destinationDirectory, getExecPathRelativeToPackage(manifest))); - }); - }; - - fs.exists(destinationDirectory, function(exists){ - if(exists) { - del(destinationDirectory, {force: true}, function (err) { + } + }, + /** + * @private + */ + win: function (filename, cb, manifest, temporaryDirectory) { + var destinationDirectory = getZipDestinationDirectory(filename, temporaryDirectory), + unzip = function () { + // unzip by C. Spieler (docs: https://www.mkssoftware.com/docs/man1/unzip.1.asp, issues: http://www.info-zip.org/) + child_process.exec('"' + path.resolve(__dirname, 'tools/unzip.exe') + '" -u -o "' + + filename + '" -d "' + destinationDirectory + '" > NUL', function (err) { if (err) { - cb(err); - } - else { - unzip(); + return cb(err); } - }); - } - else { - unzip(); - } - }); - }, - /** - * @private - */ - linux32: function(filename, cb, manifest, temporaryDirectory){ - //filename fix - exec('tar -zxvf "' + filename + '" >/dev/null',{cwd: temporaryDirectory}, function(err){ - console.log(arguments); - if(err){ - console.log(err); - return cb(err); - } - cb(null,path.join(temporaryDirectory, getExecPathRelativeToPackage(manifest))); - }) - } - }; - pUnpack.linux64 = pUnpack.linux32; + cb(null, path.join(destinationDirectory, getExecPathRelativeToPackage(manifest))); + }); + }; + fs.stat(destinationDirectory, function (err, _) { + if (!err) { + del(destinationDirectory, { force: true }, function (err) { + if (err) { + cb(err); + } + else { + unzip(); + } + }); + } + else { + unzip(); + } + }); + }, /** - * Runs installer - * @param {string} appPath - * @param {array} args - Arguments which will be passed when running the new app - * @param {object} options - Optional - * @returns {function} + * @private */ - updater.prototype.runInstaller = function(appPath, args, options){ - return pRun[platform].apply(this, arguments); - }; - - var pRun = { - /** - * @private - */ - mac: function(appPath, args, options){ - //spawn - if(args && args.length) { - args = [appPath].concat('--args', args); - } else { - args = [appPath]; + linux32: function (filename, cb, manifest, temporaryDirectory) { + //filename fix + child_process.exec('tar -zxvf "' + filename + '" >/dev/null', { cwd: temporaryDirectory }, function (err) { + console.log(arguments); + if (err) { + console.log(err); + return cb(err); } - return run('open', args, options); - }, - /** - * @private - */ - win: function(appPath, args, options, cb){ - return run(appPath, args, options, cb); - }, - /** - * @private - */ - linux32: function(appPath, args, options, cb){ - var appExec = path.join(appPath, path.basename(this.getAppExec())); - fs.chmodSync(appExec, 0755) - if(!options) options = {}; - options.cwd = appPath; - return run(appPath + "/"+path.basename(this.getAppExec()), args, options, cb); - } - }; + cb(null, path.join(temporaryDirectory, getExecPathRelativeToPackage(manifest))); + }) + } +}; +pUnpack.linux64 = pUnpack.linux32; - pRun.linux64 = pRun.linux32; + +var pRun = { /** * @private */ - function run(path, args, options){ - var opts = { - detached: true - }; - for(var key in options){ - opts[key] = options[key]; + mac: function (appPath, args, options) { + //spawn + if (args && args.length) { + args = [appPath].concat('--args', args); + } else { + args = [appPath]; } - var sp = spawn(path, args, opts); - sp.unref(); - return sp; - } - + return run('open', args, options); + }, /** - * Installs the app (copies current application to `copyPath`) - * @param {string} copyPath - * @param {function} cb - Callback arguments: error + * @private */ - updater.prototype.install = function(copyPath, cb){ - pInstall[platform].apply(this, arguments); + win: function (appPath, args, options, cb) { + return run(appPath, args, options, cb); + }, + /** + * @private + */ + linux32: function (appPath, args, options, cb) { + var appExec = path.join(appPath, path.basename(this.getAppExec())); + fs.chmodSync(appExec, '0o755') + if (!options) options = {}; + options.cwd = appPath; + return run(appPath + "/" + path.basename(this.getAppExec()), args, options, cb); + } +}; + +pRun.linux64 = pRun.linux32; + +/** + * @private + */ +function run(path, args, options) { + var opts = { + detached: true }; + for (var key in options) { + opts[key] = options[key]; + } + var sp = child_process.spawn(path, args, opts); + sp.unref(); + return sp; +} - var pInstall = { - /** - * @private - */ - mac: function(to, cb){ - ncp(this.getAppPath(), to, cb); - }, - /** - * @private - */ - win: function(to, cb){ - var self = this; - var errCounter = 50; - deleteApp(appDeleted); - - function appDeleted(err){ - if(err){ - errCounter--; - if(errCounter > 0) { - setTimeout(function(){ - deleteApp(appDeleted); - }, 100); - } else { - return cb(err); - } - } - else { - ncp(self.getAppPath(), to, appCopied); +var pInstall = { + /** + * @private + */ + mac: function (to, cb) { + ncp(this.getAppPath(), to, cb); + }, + /** + * @private + */ + win: function (to, cb) { + var self = this; + var errCounter = 50; + deleteApp(appDeleted); + + function appDeleted(err) { + if (err) { + errCounter--; + if (errCounter > 0) { + setTimeout(function () { + deleteApp(appDeleted); + }, 100); + } else { + return cb(err); } } - function deleteApp(cb){ - del(to + '/**/*', {force: true}, cb); + else { + ncp(self.getAppPath(), to, appCopied); } - function appCopied(err){ - if(err){ - setTimeout(deleteApp, 100, appDeleted); - return - } - cb(); + } + function deleteApp(cb) { + del(to + '/**/*', { force: true }, cb); + } + function appCopied(err) { + if (err) { + setTimeout(deleteApp, 100, appDeleted); + return } - }, - /** - * @private - */ - linux32: function(to, cb){ - ncp(this.getAppPath(), to, cb); + cb(); } - }; - pInstall.linux64 = pInstall.linux32; - + }, /** - * Runs the app from original app executable path. - * @param {string} execPath - * @param {array} args - Arguments passed to the app being ran. - * @param {object} options - Optional. See `spawn` from nodejs docs. - * - * Note: if this doesn't work, try `gui.Shell.openItem(execPath)` (see [node-webkit Shell](https://github.com/rogerwang/node-webkit/wiki/Shell)). + * @private */ - updater.prototype.run = function(execPath, args, options){ - var arg = arguments; - if(platform.indexOf('linux') === 0) arg[0] = path.dirname(arg[0]); - pRun[platform].apply(this, arg); - }; + linux32: function (to, cb) { + ncp(this.getAppPath(), to, cb); + } +}; +pInstall.linux64 = pInstall.linux32; - module.exports = updater; +export default updater; diff --git a/docs/README.hbs b/docs/README.hbs deleted file mode 100644 index 1b2e425..0000000 --- a/docs/README.hbs +++ /dev/null @@ -1,101 +0,0 @@ -node-webkit-updater [![NPM version][npm-image]][npm-url] -======= -This is [node-webkit](https://github.com/rogerwang/node-webkit)-updater. - -``` -npm install node-webkit-updater -``` - -It gives you low-level API to: - -1. Check the manifest for version (from your running "old" app). -2. If the version is different from the running one, download new package to a temp directory. -3. Unpack the package in temp. -4. Run new app from temp and kill the old one (i.e. still all from the running app). -5. The new app (in temp) will copy itself to the original folder, overwriting the old app. -6. The new app will run itself from original folder and exit the process. - -You should build this logic by yourself though. As a reference you can use [example](app/index.html). - -Covered by tests and works for [linux](http://screencast.com/t/Je2ptbHhP), [windows](http://screencast.com/t/MSTKqVS3) and [mac](http://screencast.com/t/OXyC5xoA). - -## Examples - -- [Basic](examples/basic.js) - - -## API - -{{heading-depth-set 2~}} -{{#class name="updater"~}} -{{>body~}} -{{>members~}} -{{/class}} ---- - -## Manifest Schema - -An example manifest: - -```json -{ - "name": "updapp", - "version": "0.0.2", - "author": "Eldar Djafarov ", - "manifestUrl": "http://localhost:3000/package.json", - "packages": { - "mac": { - "url": "http://localhost:3000/releases/updapp/mac/updapp.zip" - }, - "win": { - "url": "http://localhost:3000/releases/updapp/win/updapp.zip" - }, - "linux32": { - "url": "http://localhost:3000/releases/updapp/linux32/updapp.tar.gz" - } - } -} -``` - -The manifest could be a `package.json` of project, but doesn't have to be. - -### manifest.name - -The name of your app. From time, it is assumed your Mac app is called `.app`, your Windows executable is `.exe`, etc. - -### manifest.version -[semver](http://semver.org) version of your app. - -### manifest.manifestUrl -The URL where your latest manifest is hosted; where node-webkit-updater looks to check if there is a newer version of your app available. - -### manifest.packages -An "object" containing an object for each OS your app (at least this version of your app) supports; `mac`, `win`, `linux32`, `linux64`. - -### manifest.packages.{mac, win, linux32, linux64}.url -Each package has to contain a `url` property pointing to where the app (for the version & OS in question) can be downloaded. - -### manifest.packages.{mac, win, linux32, linux64}.execPath (Optional) -It's assumed your app is stored at the root of your package, use this to override that and specify a path (relative to the root of your package). - -This can also be used to override `manifest.name`; e.g. if your `manifest.name` is `helloWorld` (therefore `helloWorld.app` on Mac) but your Windows executable is named `nw.exe`. Then you'd set `execPath` to `nw.exe` - ---- - -## Troubleshooting - -### Mac -If you get an error on Mac about too many files being open, run `ulimit -n 10240` - -### Windows -#### EnigmaVirtualBox -On Windows, there is no "unzip" command built in by default. As a result, this project uses a third party "unzip.exe" in order to extract the downloaded update. On the NWJS site, in the "How to package and distribute your apps" file, one of the recommended methods of distribution is using EnigmaVirtualBox to package the app, nw.exe, and required DLLs into a single EXE file. This method works great for distribution, but unfortunately breaks node-webkit-updater, because it wraps the required unzip.exe file inside of the created EnigmaVirtualBox EXE. As a result, *it is not possible to use EnigmaVirtualBox to distribute your app if you plan on using node-webkit-updater*. Try using InnoSetup instead. -#### Install to /Users/USER/AppData/roaming -When using Inno Setup, the default behavior is to install to /Program Files/. This works fine for running the app, but it breaks node-webkit-updater. This directory requires administrator priveleges in order to write to it. When node-webkit-updater installs an update, part of the process is to delete the old files and move the new files into their place. Normally, apps will be run as a standard user account (not with admin priveleges). This means that node-webkit-updater *does not* have permission to write to the /Program Files directory, since it wasn't run as admin. This can cause a hang up at step 5 of the process (updater.install()). In order to fix this problem, change your Inno Setup config to install to the user's AppData/roaming. This can be done by using the `{userappdata}` constant instead of the `{app}` constant. - -## Contributing - -See [CONTRIBUTING.md](CONTRIBUTING.md) - -[npm-url]: https://npmjs.org/package/node-webkit-updater -[npm-image]: https://badge.fury.io/js/node-webkit-updater.png diff --git a/gruntfile.js b/gruntfile.js index 9015000..bd164da 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -65,12 +65,13 @@ module.exports = function(grunt){ } }, nwjs: { - options: { - srcDir: src, - version: '0.76.1', - outDir: dest, // Where the build version of my node-webkit app is saved - glob: false, - }, + build: { + options: { + outDir: dest, // Where the build version of my node-webkit app is saved + glob: false, + }, + src: src, + } }, mochaTest:{ test:{ diff --git a/index.d.ts b/index.d.ts index 654488f..a8ab308 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,87 +1,153 @@ -declare namespace NodeWebkitUpdater { +declare module "updater" { + export default updater; + export type Platform = { + /** + * - The URL to the package + */ + url: string; + /** + * - The path to the executable + */ + execPath: string; + }; + export type Packages = { + /** + * - The Windows package + */ + win: Platform; + /** + * - The macOS package + */ + mac: Platform; + /** + * - The Linux 32-bit package + */ + linux32: Platform; + /** + * - The Linux 64-bit package + */ + linux64: Platform; + }; + export type Manifest = { + /** + * - The name of the application + */ + name: string; + /** + * - The current version of the application + */ + version: string; + /** + * - The URL to the remote manifest file + */ + manifestUrl: string; + /** + * - The packages for the application + */ + packages: Packages; + }; + export type UpdaterOptions = { + /** + * - The path to a directory to download the updates to and unpack them in. Defaults to [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) + */ + temporaryDirectory: string; + }; + /** + * @typedef {object} Platform + * @property {string} url - The URL to the package + * @property {string} execPath - The path to the executable + */ + /** + * @typedef {object} Packages + * @property {Platform} win - The Windows package + * @property {Platform} mac - The macOS package + * @property {Platform} linux32 - The Linux 32-bit package + * @property {Platform} linux64 - The Linux 64-bit package + */ + /** + * @typedef {object} Manifest + * @property {string} name - The name of the application + * @property {string} version - The current version of the application + * @property {string} manifestUrl - The URL to the remote manifest file + * @property {Packages} packages - The packages for the application + */ /** - * Creates new instance of updater. Manifest could be a `package.json` of project. - * - * Note that compressed apps are assumed to be downloaded in the format produced by [node-webkit-builder](https://github.com/mllrsohn/node-webkit-builder) (or [grunt-node-webkit-builder](https://github.com/mllrsohn/grunt-node-webkit-builder)). - * - * @constructor - * @param {object} manifest - See the [manifest schema](#manifest-schema) below. - * @param {object} options - Optional - * @property {string} options.temporaryDirectory - (Optional) path to a directory to download the updates to and unpack them in. Defaults to [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) + * @typedef {object} UpdaterOptions + * @property {string} temporaryDirectory - The path to a directory to download the updates to and unpack them in. Defaults to [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) */ - export class Updater { - - + class updater { /** - * Will check the latest available version of the application by requesting the manifest specified in `manifestUrl`. + * Creates new instance of updater. * - * The callback will always be called; the second parameter indicates whether or not there's a newer version. - * This function assumes you use [Semantic Versioning](http://semver.org) and enforces it; if your local version is `0.2.0` and the remote one is `0.1.23456` then the callback will be called with `false` as the second paramter. If on the off chance you don't use semantic versioning, you could manually download the remote manifest and call `download` if you're happy that the remote version is newer. + * @constructor + * @param {Manifest} manifest - See the [manifest schema](https://github.com/nwutils/nw-updater?tab=readme-ov-file#manifest-schema). + * @param {UpdaterOptions} options - Optional + */ + constructor(manifest: Manifest, options: UpdaterOptions); + manifest: Manifest; + options: { + temporaryDirectory: any; + }; + /** + * Check the latest available version of the application by requesting the manifest specified in `manifestUrl`. * - * @param {function} cb - Callback arguments: error, newerVersionExists (`Boolean`), remoteManifest + * @async + * @method + * @returns {Promise.} */ - checkNewVersion(cb: (error: string, isNew: boolean, data: any) => void): void; - + checkNewVersion(): Promise; /** - * Downloads the new app to a template folder - * @param {Function} cb - called when download completes. Callback arguments: error, downloaded filepath - * @param {Object} newManifest - see [manifest schema](#manifest-schema) below - * @return {Request} Request - stream, the stream contains `manifest` property with new manifest and 'content-length' property with the size of package. + * Downloads the new app to a temorary folder. + * + * @async + * @method + * @param {Manifest} newManifest - see [manifest schema](https://github.com/nwutils/nw-updater?tab=readme-ov-file#manifest-schema) below + * @returns {Promise.} */ - download(cb: (error: string, filepath: string) => void, newManifest: any): void; - + download(newManifest: Manifest): Promise; /** - * Returns executed application path + * Returns executed application path. + * * @returns {string} */ getAppPath(): string; - /** - * Returns current application executable + * Returns current application executable. + * * @returns {string} */ getAppExec(): string; - /** - * Will unpack the `filename` in temporary folder. - * For Windows, [unzip](https://www.mkssoftware.com/docs/man1/unzip.1.asp) is used (which is [not signed](https://github.com/edjafarov/node-webkit-updater/issues/68)). - * - * @param {string} filename - * @param {function} cb - Callback arguments: error, unpacked directory - * @param {object} manifest - */ - unpack(filename: string, cb: (error: string, unpacked_path: string) => void, manifest: any): void; - + * Will unpack the `filename` in temporary folder. + * For Windows, [unzip](https://www.mkssoftware.com/docs/man1/unzip.1.asp) is used (which is [not signed](https://github.com/edjafarov/node-webkit-updater/issues/68)). + * + * @param {string} filename + * @param {function} cb - Callback arguments: error, unpacked directory + * @param {object} manifest + */ + unpack(filename: string, cb: Function, manifest: object): void; /** - * Runs installer - * @param {string} appPath - * @param {array} args - Arguments which will be passed when running the new app - * @param {object} options - Optional - * @returns {function} - */ - runInstaller(appPath: string, args: string[], options: any): () => void; - + * Runs installer + * @param {string} appPath + * @param {array} args - Arguments which will be passed when running the new app + * @param {object} options - Optional + * @returns {function} + */ + runInstaller(appPath: string, args: any[], options: object, ...args: any[]): Function; /** - * Installs the app (copies current application to `copyPath`) - * @param {string} copyPath - * @param {function} cb - Callback arguments: error - */ - install(copyPath: string, cb: () => void): void; - + * Installs the app (copies current application to `copyPath`) + * @param {string} copyPath + * @param {function} cb - Callback arguments: error + */ + install(copyPath: string, cb: Function, ...args: any[]): void; /** - * Runs the app from original app executable path. - * @param {string} execPath - * @param {array} args - Arguments passed to the app being ran. - * @param {object} options - Optional. See `spawn` from nodejs docs. - * - * Note: if this doesn't work, try `gui.Shell.openItem(execPath)` (see [node-webkit Shell](https://github.com/rogerwang/node-webkit/wiki/Shell)). - */ - run(execPath: string, args: string[], options: any): void; + * Runs the app from original app executable path. + * @param {string} execPath + * @param {array} args - Arguments passed to the app being ran. + * @param {object} options - Optional. See `spawn` from nodejs docs. + * + * Note: if this doesn't work, try `gui.Shell.openItem(execPath)` (see [node-webkit Shell](https://github.com/rogerwang/node-webkit/wiki/Shell)). + */ + run(execPath: string, args: any[], options: object, ...args: any[]): void; } } - -interface UpdaterConstructor { - new (manifest: any, options?: any): NodeWebkitUpdater.Updater -} - -declare const updater: UpdaterConstructor; diff --git a/package-lock.json b/package-lock.json index 6a38a54..8626472 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,9 +8,9 @@ "name": "node-webkit-updater", "version": "0.3.3", "dependencies": { + "axios": "^1.7.2", "del": "^7.1.0", "ncp": "^2.0.0", - "request": "^2.64.0", "semver": "^7.6.2" }, "devDependencies": { @@ -25,7 +25,9 @@ "grunt-jsdoc-to-markdown": "^6.0.0", "grunt-mocha-test": "^0.13.3", "grunt-nw-builder": "^4.7.4", - "mocha": "^10.4.0" + "mocha": "^10.4.0", + "nw-builder": "^4.7.4", + "request": "^2.64.0" } }, "node_modules/@babel/parser": { @@ -693,6 +695,7 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -917,13 +920,14 @@ "node_modules/aws4": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", - "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==" + "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==", + "dev": true }, "node_modules/axios": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", - "dev": true, + "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -934,7 +938,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -973,6 +976,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", + "dev": true, "dependencies": { "tweetnacl": "^0.14.3" } @@ -1360,7 +1364,8 @@ "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", + "dev": true }, "node_modules/catharsis": { "version": "0.9.0", @@ -1884,6 +1889,7 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", + "dev": true, "dependencies": { "assert-plus": "^1.0.0" }, @@ -1895,6 +1901,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "dev": true, "engines": { "node": ">=0.8" } @@ -2105,6 +2112,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", + "dev": true, "dependencies": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -2332,12 +2340,14 @@ "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true }, "node_modules/extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", + "dev": true, "engines": [ "node >=0.6.0" ] @@ -2345,7 +2355,8 @@ "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true }, "node_modules/fast-glob": { "version": "3.2.12", @@ -2365,7 +2376,8 @@ "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, "node_modules/fastq": { "version": "1.15.0", @@ -2522,7 +2534,6 @@ "version": "1.15.6", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", - "dev": true, "funding": [ { "type": "individual", @@ -2579,6 +2590,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", + "dev": true, "engines": { "node": "*" } @@ -2587,6 +2599,7 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -2737,6 +2750,7 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", + "dev": true, "dependencies": { "assert-plus": "^1.0.0" } @@ -2745,6 +2759,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "dev": true, "engines": { "node": ">=0.8" } @@ -3222,6 +3237,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", + "dev": true, "engines": { "node": ">=4" } @@ -3231,6 +3247,7 @@ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", "deprecated": "this library is no longer supported", + "dev": true, "dependencies": { "ajv": "^6.12.3", "har-schema": "^2.0.0" @@ -3421,6 +3438,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", + "dev": true, "dependencies": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -3435,6 +3453,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "dev": true, "engines": { "node": ">=0.8" } @@ -3760,7 +3779,8 @@ "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "dev": true }, "node_modules/is-unc-path": { "version": "1.0.0", @@ -3831,7 +3851,8 @@ "node_modules/isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==" + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", + "dev": true }, "node_modules/jackspeak": { "version": "3.1.2", @@ -3876,7 +3897,8 @@ "node_modules/jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==" + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", + "dev": true }, "node_modules/jsdoc": { "version": "4.0.2", @@ -3989,22 +4011,26 @@ "node_modules/json-schema": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "dev": true }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true }, "node_modules/jsprim": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "dev": true, "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -4019,6 +4045,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "dev": true, "engines": { "node": ">=0.8" } @@ -4955,6 +4982,7 @@ "resolved": "https://registry.npmjs.org/nw-builder/-/nw-builder-4.7.4.tgz", "integrity": "sha512-klgSL8xs8cr4918bev1Vm4Hm6/v6IqekDixonOQThh3mvAqrjdmkH2nkLnyV1xiWiAqjnX3f/5vuxBF2+oqr8A==", "dev": true, + "license": "MIT", "dependencies": { "axios": "^1.6.8", "cli-progress": "^3.12.0", @@ -5057,6 +5085,7 @@ "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true, "engines": { "node": "*" } @@ -5359,7 +5388,8 @@ "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", + "dev": true }, "node_modules/picomatch": { "version": "2.3.1", @@ -5442,13 +5472,13 @@ "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", + "dev": true }, "node_modules/pump": { "version": "3.0.0", @@ -5464,6 +5494,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true, "engines": { "node": ">=6" } @@ -5735,6 +5766,7 @@ "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "dev": true, "dependencies": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -5765,6 +5797,7 @@ "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", + "dev": true, "engines": { "node": "*" } @@ -5773,6 +5806,7 @@ "version": "6.5.3", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "dev": true, "engines": { "node": ">=0.6" } @@ -5781,6 +5815,7 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, "dependencies": { "psl": "^1.1.28", "punycode": "^2.1.1" @@ -5793,6 +5828,7 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dev": true, "dependencies": { "safe-buffer": "^5.0.1" }, @@ -5805,6 +5841,7 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "dev": true, "bin": { "uuid": "bin/uuid" } @@ -5896,6 +5933,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, "funding": [ { "type": "github", @@ -5914,7 +5952,8 @@ "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true }, "node_modules/semver": { "version": "7.6.2", @@ -6186,6 +6225,7 @@ "version": "1.17.0", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "dev": true, "dependencies": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -6210,6 +6250,7 @@ "version": "0.2.6", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "dev": true, "dependencies": { "safer-buffer": "~2.1.0" } @@ -6218,6 +6259,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "dev": true, "engines": { "node": ">=0.8" } @@ -6622,7 +6664,8 @@ "node_modules/tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==" + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", + "dev": true }, "node_modules/type-is": { "version": "1.6.18", @@ -6733,6 +6776,7 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, "dependencies": { "punycode": "^2.1.0" } @@ -6777,6 +6821,7 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", + "dev": true, "engines": [ "node >=0.6.0" ], @@ -6790,6 +6835,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "dev": true, "engines": { "node": ">=0.8" } @@ -6797,7 +6843,8 @@ "node_modules/verror/node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", + "dev": true }, "node_modules/walk-back": { "version": "5.1.0", diff --git a/package.json b/package.json index c8f2d84..f529418 100644 --- a/package.json +++ b/package.json @@ -9,39 +9,36 @@ "version": "0.3.3", "author": { "name": "Eldar Djafarov", - "email": "djkojb@gmail.com", "url": "https://github.com/edjafarov" }, "maintainers": [ { "name": "Ayushman Chhabra", - "email": "info@ayushmanchhabra.com", "url": "https://ayushmanchhabra.com/" } ], "contributors": [ { "name": "The nw-updater Authors", - "url": "https://github.com/tharatau/nw-updater/graphs/contributors" + "url": "https://github.com/nwutils/nw-updater/graphs/contributors" } ], "main": "./app/updater.js", + "types": "./index.d.ts", + "homepage": "https://github.com/nwutils/nw-updater", "repository": { "type": "git", - "url": "https://github.com/tharatau/nw-updater.git" + "url": "https://github.com/nwutils/nw-updater.git" }, - "bugs": { - "url": "https://github.com/tharatau/nw-updater/issues" - }, - "homepage": "https://github.com/tharatau/nw-updater", "scripts": { - "deps": "npm i && cd app && npm i && cd ..", - "test": "node node_modules/grunt-cli/bin/grunt clean mochaTest" + "grunt": "grunt", + "test": "node node_modules/grunt-cli/bin/grunt clean mochaTest", + "types": "npx -p typescript tsc app/updater.js --declaration --allowJs --emitDeclarationOnly --outFile ./index.d.ts" }, "dependencies": { - "ncp": "^2.0.0", - "request": "^2.64.0", + "axios": "^1.7.2", "del": "^7.1.0", + "ncp": "^2.0.0", "semver": "^7.6.2" }, "devDependencies": { @@ -56,6 +53,8 @@ "grunt-jsdoc-to-markdown": "^6.0.0", "grunt-mocha-test": "^0.13.3", "grunt-nw-builder": "^4.7.4", - "mocha": "^10.4.0" + "mocha": "^10.4.0", + "nw-builder": "^4.7.4", + "request": "^2.64.0" } } diff --git a/test/basicTest.spec.js b/test/basicTest.spec.js index a2e7e83..77a80b8 100644 --- a/test/basicTest.spec.js +++ b/test/basicTest.spec.js @@ -1,6 +1,5 @@ const { cp } = require('node:fs/promises'); var ncp = require('ncp'); -var expect = require('chai').expect; var spawn = require('child_process').spawn; var exec = require('child_process').exec; var express = require('express'); @@ -12,9 +11,11 @@ var fs = require('fs'); var getPort = undefined; var port = null; var app; +var expect; (async function () { try { + expect = (await import('chai')).expect; getPort = (await import('get-port')).default; } catch (e) { console.log(e); @@ -124,7 +125,7 @@ describe("build app", function () { }); it('should be updated, with new version', function (done) { - var os = { + let os = { mac: { dir: 'osx/', run: 'open ' + __dirname + "/deploy0.1/updapp/osx/updapp.app"