diff --git a/.gitignore b/.gitignore index c06549d..3a96e2e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ build node_modules -.DS_STORE +auth.json diff --git a/README.md b/README.md index 3f44f8c..c22fe34 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,15 @@

-Origami is an open-source research tool. It automatically scraps Google Scholar pages to retrieve "cited by" papers, and presents the results as an interactive graph. +Origami is an open-source research tool. It automatically scraps Google Scholar pages to retrieve "cited by" papers and presents the results as an interactive graph. ![demo](images/demo.png "A screenshot") ## Download -| [
](https://github.com/aMarcireau/origami/releases/download/v0.11.0/Origami-linux-x64.zip) | [
](https://github.com/aMarcireau/origami/releases/download/v0.11.0/Origami-darwin-x64.zip) | [
](https://github.com/aMarcireau/origami/releases/download/v0.11.0/Origami-win32-x64.zip) | +| [
](https://github.com/aMarcireau/origami/releases/download/v0.10.3/Origami-linux-x64.zip) | [
](https://github.com/aMarcireau/origami/releases/download/v0.10.3/Origami-darwin-x64.zip) | [
](https://github.com/aMarcireau/origami/releases/download/v0.10.3/Origami-win32-x64.zip) | | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [Download for Linux](https://github.com/aMarcireau/origami/releases/download/v0.11.0/Origami-linux-x64.zip) | [Download for macOS](https://github.com/aMarcireau/origami/releases/download/v0.11.0/Origami-darwin-x64.zip) | [Download for Windows](https://github.com/aMarcireau/origami/releases/download/v0.11.0/Origami-win32-x64.zip) | +| [Download for Linux](https://github.com/aMarcireau/origami/releases/download/v0.10.3/Origami-linux-x64.zip) | [Download for macOS](https://github.com/aMarcireau/origami/releases/download/v0.10.3/Origami-darwin-x64.zip) | [Download for Windows](https://github.com/aMarcireau/origami/releases/download/v0.10.3/Origami-win32-x64.zip) | Visit the [Releases](https://github.com/aMarcireau/origami/releases) page to download Origami for other platforms. @@ -19,7 +19,7 @@ Visit the [Releases](https://github.com/aMarcireau/origami/releases) page to dow To change the color theme, edit `colors.json`. You can find it at: - `Origami/resources/app/colors.json` on Linux -- `Origami.app/Contents/Resources/app/colors.json` on macOS (right-cick on the app and choose _Show Package Contents_) +- `Origami.app/Contents/Resources/app/colors.json` on macOS (right-click on the app and choose _Show Package Contents_) - `Origami\resources\app\colors.json` on Windows The `themes` directory of this repository contains several themes suggestions. @@ -43,11 +43,11 @@ Origami can load several DOIs at once from a [JSON](https://www.json.org) format ### Saves -Origami saves and load collections in [JSON](https://www.json.org) format. The generated files have the following structure: +Origami saves and loads collections in [JSON](https://www.json.org) format. The generated files have the following structure: ```yaml { - "appVersion": "0.11.0", # the version of the app used to generate this save + "appVersion": "0.10.3", # the version of the app used to generate this save "display": 0, # the current display's index (0 for graph, 1 for list) "knownDois": ["10.1109/tpami.2016.2574707"], # list of DOIs clicked at least once (used to highlight new publications) "crossref": # pending requests to crossref.org @@ -137,7 +137,7 @@ Origami saves and load collections in [JSON](https://www.json.org) format. The g "updated": 1513430331442, # last metadata update, in milliseconds since 1970-01-01 "selected": false # false means that the publication is not selected - # a single publication may be selected at once, + # only one publication can be selected "bibtex": "@article{...}", # the article's BibTeX as a string "x": 1.0813568646326681, # the publication's node position's x coordinate in the graph, float "y": -1.563450690825733, # the publication's node position's y coordinate in the graph, float @@ -166,20 +166,30 @@ Origami is build with [Electron](https://electronjs.org), [React](https://reactj Follow these steps to download the source code, edit and build Origami: -1. Install [Node.js](https://nodejs.org). -2. Clone the repository by running from a terminal `git clone https://github.com/aMarcireau/origami.git`. -3. Go to the created _origami_ folder and run `npm install`. +1. install [Node.js](https://nodejs.org) +2. clone the repository by running from a terminal `git clone https://github.com/aMarcireau/origami.git` +3. go to the created _origami_ folder and run `npm install` -For development, run from the _origami_ folder the command `npm run-script watch`. A development build is triggered every time a file in the _souce_ directory is modified. +For development, run the command `npm run-script watch` from the _origami_ folder. A development build is triggered every time a file in the _souce_ directory is modified. -In order to create a new release, run: +To create a new release: -1. `npm run-script build` to generate a production build for each supported platform. -2. `npm run-script release` to create a new Github release (requires administration rights on this repository). +1. create a personal access token (see https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) +2. create a file auth.json in the _origami_ directory with the following structure: + +```json +{ + "username": "Github username", + "token": "personal access token" +} +``` + +3. generate a production build for each supported platform with `npm run-script build` +4. create a new Github release (requires administration rights on this repository) with `npm run-script release` To build Windows apps with macOS Catalina, one must patch Wine (see https://github.com/electron/node-rcedit/issues/51#issuecomment-546234084). -The code documentation is held in the [Wiki](https://github.com/aMarcireau/origami/wiki). +Code documentation: [Wiki](https://github.com/aMarcireau/origami/wiki). ## License diff --git a/package-lock.json b/package-lock.json index bef63ec..711abba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "@babel/preset-react": "7.14.5", "ajv": "8.6.3", "archiver": "5.3.0", + "axios": "0.21.4", "babel-loader": "8.2.2", "babel-plugin-transform-class-properties": "6.24.1", "css-select": "4.1.3", @@ -29,7 +30,6 @@ "react-redux": "7.2.5", "redux": "4.1.1", "redux-thunk": "2.3.0", - "request": "2.88.2", "uglify-es": "3.3.9", "url-template": "2.0.8", "webpack": "webpack-4", @@ -2370,15 +2370,6 @@ "node": ">= 6" } }, - "node_modules/asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, "node_modules/asn1.js": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", @@ -2407,15 +2398,6 @@ "util": "0.10.3" } }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, "node_modules/assert/node_modules/inherits": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", @@ -2453,12 +2435,6 @@ "dev": true, "optional": true }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, "node_modules/at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", @@ -2501,21 +2477,15 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "node_modules/axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "dev": true, - "engines": { - "node": "*" + "dependencies": { + "follow-redirects": "^1.14.0" } }, - "node_modules/aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", - "dev": true - }, "node_modules/babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", @@ -2834,15 +2804,6 @@ } ] }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, "node_modules/big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -3264,12 +3225,6 @@ "url": "https://opencollective.com/browserslist" } }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -3562,18 +3517,6 @@ "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", "dev": true }, - "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==", - "dev": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", @@ -4248,18 +4191,6 @@ "d3-transition": "1" } }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/debug": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", @@ -4355,15 +4286,6 @@ "node": ">=0.10.0" } }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/des.js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", @@ -4540,16 +4462,6 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "node_modules/electron-notarize": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/electron-notarize/-/electron-notarize-1.1.1.tgz", @@ -5185,12 +5097,6 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, "node_modules/extend-shallow": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", @@ -5276,15 +5182,6 @@ "@types/yauzl": "^2.9.1" } }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true, - "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", @@ -5502,6 +5399,26 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/follow-redirects": { + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", + "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -5517,29 +5434,6 @@ "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", "dev": true }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true, - "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==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, "node_modules/fragment-cache": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", @@ -5823,15 +5717,6 @@ "node": ">=0.10.0" } }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0" - } - }, "node_modules/glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", @@ -6013,51 +5898,6 @@ "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", "dev": true }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true, - "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", - "dev": true, - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/har-validator/node_modules/ajv": { - "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", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/har-validator/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==", - "dev": true - }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -6323,21 +6163,6 @@ "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", "dev": true }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, "node_modules/https-browserify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", @@ -6853,12 +6678,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, "node_modules/is-weakmap": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", @@ -6931,24 +6750,12 @@ "node": ">=0.10.0" } }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -6973,12 +6780,6 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, - "node_modules/json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, "node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", @@ -6989,7 +6790,8 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true + "dev": true, + "optional": true }, "node_modules/json5": { "version": "2.2.0", @@ -7018,21 +6820,6 @@ "graceful-fs": "^4.1.6" } }, - "node_modules/jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, "node_modules/junk": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/junk/-/junk-3.1.0.tgz", @@ -7422,27 +7209,6 @@ "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", "dev": true }, - "node_modules/mime-db": { - "version": "1.49.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz", - "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.32", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz", - "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==", - "dev": true, - "dependencies": { - "mime-db": "1.49.0" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", @@ -7772,15 +7538,6 @@ "url": "https://github.com/fb55/nth-check?sponsor=1" } }, - "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==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -8245,12 +8002,6 @@ "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", "dev": true }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, "node_modules/picomatch": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", @@ -8404,12 +8155,6 @@ "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", "dev": true }, - "node_modules/psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", - "dev": true - }, "node_modules/public-encrypt": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", @@ -8470,15 +8215,6 @@ "node": ">=6" } }, - "node_modules/qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true, - "engines": { - "node": ">=0.6" - } - }, "node_modules/querystring": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", @@ -8953,38 +8689,6 @@ "node": ">=0.10" } }, - "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", - "dev": true, - "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/require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", @@ -9629,31 +9333,6 @@ "dev": true, "optional": true }, - "node_modules/sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, - "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/ssri": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz", @@ -10347,19 +10026,6 @@ "node": ">=0.10.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==", - "dev": true, - "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/trim-repeated": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz", @@ -10394,24 +10060,6 @@ "node": ">=0.6.11 <=0.7.0 || >=0.7.3" } }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "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": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, "node_modules/type-fest": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", @@ -10730,16 +10378,6 @@ "integrity": "sha1-ihagXURWV6Oupe7MWxKk+lN5dyw=", "dev": true }, - "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.", - "dev": true, - "bin": { - "uuid": "bin/uuid" - } - }, "node_modules/v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -10756,20 +10394,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, "node_modules/vm-browserify": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", @@ -13034,15 +12658,6 @@ } } }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, "asn1.js": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", @@ -13090,12 +12705,6 @@ } } }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - }, "assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", @@ -13115,12 +12724,6 @@ "dev": true, "optional": true }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, "at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", @@ -13145,17 +12748,14 @@ "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", "dev": true }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", - "dev": true + "axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "dev": true, + "requires": { + "follow-redirects": "^1.14.0" + } }, "babel-code-frame": { "version": "6.26.0", @@ -13429,15 +13029,6 @@ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "dev": true }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, "big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -13793,12 +13384,6 @@ "integrity": "sha512-V7mQTFhjITxuk9zBpI6nYsiTXhcPe05l+364nZjK7MFK/E7ibvYBSAXr4YcA6oPR8j3ZLM/LN+lUqUVAQEUZFg==", "dev": true }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -14042,15 +13627,6 @@ "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", "dev": true }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", @@ -14662,15 +14238,6 @@ "d3-transition": "1" } }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, "debug": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", @@ -14743,12 +14310,6 @@ "isobject": "^3.0.1" } }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, "des.js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", @@ -14905,16 +14466,6 @@ } } }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "electron-notarize": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/electron-notarize/-/electron-notarize-1.1.1.tgz", @@ -15425,12 +14976,6 @@ } } }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, "extend-shallow": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", @@ -15495,12 +15040,6 @@ "yauzl": "^2.10.0" } }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -15688,6 +15227,12 @@ } } }, + "follow-redirects": { + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", + "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==", + "dev": true + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -15700,23 +15245,6 @@ "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", "dev": true }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "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==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, "fragment-cache": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", @@ -15968,15 +15496,6 @@ "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", "dev": true }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, "glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", @@ -16118,42 +15637,6 @@ "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", "dev": true }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "dev": true, - "requires": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "dependencies": { - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "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==", - "dev": true - } - } - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -16350,17 +15833,6 @@ "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", "dev": true }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, "https-browserify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", @@ -16726,12 +16198,6 @@ "has-tostringtag": "^1.0.0" } }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, "is-weakmap": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", @@ -16786,24 +16252,12 @@ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -16822,12 +16276,6 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, "json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", @@ -16838,7 +16286,8 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true + "dev": true, + "optional": true }, "json5": { "version": "2.2.0", @@ -16859,18 +16308,6 @@ "universalify": "^2.0.0" } }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, "junk": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/junk/-/junk-3.1.0.tgz", @@ -17212,21 +16649,6 @@ } } }, - "mime-db": { - "version": "1.49.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz", - "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==", - "dev": true - }, - "mime-types": { - "version": "2.1.32", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz", - "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==", - "dev": true, - "requires": { - "mime-db": "1.49.0" - } - }, "mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", @@ -17518,12 +16940,6 @@ "boolbase": "^1.0.0" } }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true - }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -17894,12 +17310,6 @@ "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", "dev": true }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, "picomatch": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", @@ -18014,12 +17424,6 @@ "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", "dev": true }, - "psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", - "dev": true - }, "public-encrypt": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", @@ -18081,12 +17485,6 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - }, "querystring": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", @@ -18465,34 +17863,6 @@ "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, - "request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "dev": true, - "requires": { - "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" - } - }, "require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", @@ -19034,23 +18404,6 @@ "dev": true, "optional": true }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, - "requires": { - "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" - } - }, "ssri": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz", @@ -19618,16 +18971,6 @@ "repeat-string": "^1.6.1" } }, - "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==", - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, "trim-repeated": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz", @@ -19656,21 +18999,6 @@ "dev": true, "optional": true }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, "type-fest": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", @@ -19938,12 +19266,6 @@ "integrity": "sha1-ihagXURWV6Oupe7MWxKk+lN5dyw=", "dev": true }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true - }, "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -19960,17 +19282,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, "vm-browserify": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", diff --git a/package.json b/package.json index f09a19a..7255c54 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "@babel/preset-react": "7.14.5", "ajv": "8.6.3", "archiver": "5.3.0", + "axios": "0.21.4", "babel-loader": "8.2.2", "babel-plugin-transform-class-properties": "6.24.1", "css-select": "4.1.3", @@ -25,7 +26,6 @@ "react-redux": "7.2.5", "redux": "4.1.1", "redux-thunk": "2.3.0", - "request": "2.88.2", "uglify-es": "3.3.9", "url-template": "2.0.8", "webpack": "webpack-4", diff --git a/scripts/release.js b/scripts/release.js index a43e4a1..0faf0fb 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -1,7 +1,7 @@ +const axios = require("axios"); const child_process = require("child_process"); const fs = require("fs"); const path = require("path"); -const request = require("request"); const readline = require("readline"); const stream = require("stream"); const archiver = require("archiver"); @@ -79,614 +79,206 @@ if (version.identifier == null) { } } -const usernameInterface = readline.createInterface({ - input: process.stdin, - output: process.stdout, - terminal: true, -}); -usernameInterface.question("username: ", username => { - usernameInterface.close(); - const passwordInterface = readline.createInterface({ - input: process.stdin, - output: new stream.Writable({ - write: (chunk, encoding, callback) => { - callback(); - }, - }), - terminal: true, - }); - passwordInterface.question("", password => { - passwordInterface.close(); - process.stdout.write("\n"); - request.post( +(async () => { + const auth = JSON.parse( + fs.readFileSync(path.join(path.dirname(__dirname), "auth.json")) + ); + auth.password = auth.token; + delete auth.token; + const release = ( + await axios.post( + "https://api.github.com/repos/amarcireau/origami/releases", { - url: "https://api.github.com/repos/amarcireau/origami/releases", - auth: { - user: username, - pass: password, - sendImmediately: true, - }, - headers: { "user-agent": "origami" }, - json: { - tag_name: `v${versionAsString}`, - draft: true, - prerelease: false, - }, + tag_name: `v${versionAsString}`, + draft: true, + prerelease: false, }, - (error, httpIncomingMessage, body) => { - if (error) { - console.error( - "https://api.github.com/repos/amarcireau/origami/releases", - error - ); - process.exit(1); - } - if (httpIncomingMessage.statusCode !== 201) { - console.error( - "https://api.github.com/repos/amarcireau/origami/releases", - body - ); - process.exit(1); - } - const id = body.id; - console.log( - `Created the release v${versionAsString} (id: ${id})` - ); - request.get( - { - url: `https://api.github.com/repos/amarcireau/origami/releases/${id}`, - auth: { - user: username, - pass: password, - sendImmediately: true, - }, - headers: { "user-agent": "origami" }, - json: true, - }, - (error, httpIncomingMessage, body) => { - if (error) { - console.error( - `https://api.github.com/repos/amarcireau/origami/releases/${id}`, - error + { auth } + ) + ).data; + console.log( + `Created the draft release v${versionAsString} (id: ${release.id})` + ); + try { + fs.mkdirSync(`${path.dirname(__dirname)}/build/archives`); + } catch (_) {} + await Promise.all( + fs + .readdirSync(`${path.dirname(__dirname)}/build`, { + withFileTypes: true, + }) + .filter(dirent => dirent.isDirectory()) + .map(dirent => [ + dirent.name, + /^Origami-([^-]+)-([^-]+)$/.exec(dirent.name), + ]) + .filter(([_, match]) => match != null) + .map(([name, match]) => + (async () => { + const outputFilename = `${path.dirname( + __dirname + )}/build/archives/${name}.zip`; + await new Promise((resolve, reject) => { + const output = fs.createWriteStream(outputFilename); + output.on("close", resolve); + const archive = archiver("zip", { + zlib: { + level: zlib.constants.Z_BEST_COMPRESSION, + }, + }); + archive.on("error", reject); + archive.pipe(output); + if (match[1] === "darwin" || match[1] === "mas") { + archive.directory( + `${path.dirname( + __dirname + )}/build/${name}/Origami.app`, + "Origami.app" ); - process.exit(1); - } - if (httpIncomingMessage.statusCode !== 200) { - console.error( - `https://api.github.com/repos/amarcireau/origami/releases/${id}`, - body + } else { + archive.directory( + `${path.dirname(__dirname)}/build/${name}`, + "Origami" ); - process.exit(1); } - try { - fs.mkdirSync( - `${path.dirname(__dirname)}/build/archives` - ); - } catch (error) {} - let directoriesLeft = 0; - for (const directoryToZip of fs.readdirSync( - `${path.dirname(__dirname)}/build` - )) { - if ( - fs - .lstatSync( - `${path.dirname( - __dirname - )}/build/${directoryToZip}` - ) - .isDirectory() - ) { - const matchedConfiguration = - /^Origami-([^-]+)-([^-]+)$/.exec( - directoryToZip - ); - if (matchedConfiguration != null) { - ++directoriesLeft; - const output = fs.createWriteStream( - `${path.dirname( - __dirname - )}/build/archives/${directoryToZip}.zip` - ); - output.on("close", () => { - console.log( - `Created '${path.dirname( - __dirname - )}/build/archives/${directoryToZip}.zip'` - ); - fs.readFile( - `${path.dirname( - __dirname - )}/build/archives/${directoryToZip}.zip`, - (error, archive) => { - if (error) { - console.error( - `${path.dirname( - __dirname - )}/build/archives/${directoryToZip}.zip`, - error - ); - process.exit(1); - } - const url = urlTemplate - .parse(body.upload_url) - .expand({ - name: `${directoryToZip}.zip`, - }); - request.post( - { - url, - auth: { - user: username, - pass: password, - sendImmediately: true, - }, - headers: { - "user-agent": - "origami", - "Content-Type": - "application/zip", - }, - body: archive, - }, - ( - error, - httpIncomingMessage, - body - ) => { - if (error) { - console.error( - url, - error - ); - process.exit(1); - } - if ( - httpIncomingMessage.statusCode !== - 201 - ) { - console.error( - url, - body - ); - process.exit(1); - } - console.log( - `Uploaded '${directoryToZip}'` - ); - --directoriesLeft; - if ( - directoriesLeft === - 0 && - version.identifier == - null - ) { - request.get( - { - url: "https://api.github.com/repos/amarcireau/origami/releases", - auth: { - user: username, - pass: password, - sendImmediately: true, - }, - headers: { - "user-agent": - "origami", - }, - json: true, - }, - ( - error, - httpIncomingMessage, - body - ) => { - if (error) { - console.error( - "https://api.github.com/repos/amarcireau/origami/releases", - error - ); - process.exit( - 1 - ); - } - if ( - httpIncomingMessage.statusCode !== - 200 - ) { - console.error( - "https://api.github.com/repos/amarcireau/origami/releases", - body - ); - process.exit( - 1 - ); - } - const releasesAndVersionsToPurge = - []; - for (const release of body) { - if ( - release.id !== - id - ) { - const releaseSemverMatch = - semver.exec( - release.tag_name - ); - if ( - releaseSemverMatch - ) { - const releaseVersion = - { - major: parseInt( - releaseSemverMatch[1] - ), - minor: parseInt( - releaseSemverMatch[2] - ), - patch: parseInt( - releaseSemverMatch[3] - ), - identifier: - releaseSemverMatch[4] - ? releaseSemverMatch[4] - : null, - }; - if ( - release.draft - ) { - request.delete( - { - url: `https://api.github.com/repos/amarcireau/origami/releases/${release.id}`, - auth: { - user: username, - pass: password, - sendImmediately: true, - }, - headers: - { - "user-agent": - "origami", - }, - json: true, - }, - ( - error, - httpIncomingMessage, - body - ) => { - if ( - error - ) { - console.error( - `https://api.github.com/repos/amarcireau/origami/releases/${release.id}`, - error - ); - process.exit( - 1 - ); - } - if ( - httpIncomingMessage.statusCode !== - 204 - ) { - console.error( - `https://api.github.com/repos/amarcireau/origami/releases/${release.id}`, - body - ); - process.exit( - 1 - ); - } - console.log( - `${release.tag_name} (${release.id}) deleted (it was a draft)` - ); - } - ); - } else if ( - releaseVersion.identifier - ) { - console.log( - `${release.tag_name} (${release.id}) has an identifier: skipping automatic operations` - ); - } else if ( - isSmallerThan( - version, - releaseVersion - ) || - areEqual( - version, - releaseVersion - ) - ) { - console.log( - `${release.tag_name} (${release.id}) is greater than or identical to the current version: skipping automatic operations` - ); - } else { - releasesAndVersionsToPurge.push( - { - release: - release, - version: - releaseVersion, - } - ); - } - } else { - console.log( - `${release.tag_name} (${release.id}) does not have the expected format: skipping automatic operations` - ); - } - } - } - let previousMajorVersion = - null; - let previousMinorVersion = - null; - for (const releaseAndVersion of releasesAndVersionsToPurge) { - if ( - releaseAndVersion - .version - .major < - version.major - - 1 || - (releaseAndVersion - .version - .major === - version.major && - releaseAndVersion - .version - .minor < - version.minor - - 1) || - (releaseAndVersion - .version - .major === - version.major && - releaseAndVersion - .version - .minor === - version.minor) - ) { - continue; - } - if ( - releaseAndVersion - .version - .major === - version.major - - 1 && - (previousMajorVersion == - null || - isSmallerThan( - previousMajorVersion, - releaseAndVersion.version - )) - ) { - previousMajorVersion = - releaseAndVersion.version; - continue; - } - if ( - releaseAndVersion - .version - .major === - version.major && - releaseAndVersion - .version - .minor === - version.minor - - 1 && - (previousMinorVersion == - null || - isSmallerThan( - previousMinorVersion, - releaseAndVersion.version - )) - ) { - previousMinorVersion = - releaseAndVersion.version; - continue; - } - } - console.log( - previousMajorVersion == - null - ? "There is no previous major version" - : `Previous major version preserved: v${previousMajorVersion.major}.${previousMajorVersion.minor}.${previousMajorVersion.patch}` - ); - console.log( - previousMinorVersion == - null - ? "There is no previous minor version" - : `Previous minor version preserved: v${previousMinorVersion.major}.${previousMinorVersion.minor}.${previousMinorVersion.patch}` - ); - for (const releaseAndVersion of releasesAndVersionsToPurge) { - if ( - (previousMajorVersion && - areEqual( - previousMajorVersion, - releaseAndVersion.version - )) || - (previousMinorVersion && - areEqual( - previousMinorVersion, - releaseAndVersion.version - )) - ) { - console.log( - `${ - releaseAndVersion - .release - .tag_name - } (${ - releaseAndVersion - .release - .id - }) was not purged (previous ${ - previousMajorVersion && - areEqual( - previousMajorVersion, - releaseAndVersion.version - ) - ? "major" - : "minor" - })` - ); - continue; - } - for (const asset of releaseAndVersion - .release - .assets) { - request.delete( - { - url: `https://api.github.com/repos/amarcireau/origami/releases/assets/${asset.id}`, - auth: { - user: username, - pass: password, - sendImmediately: true, - }, - headers: - { - "user-agent": - "origami", - }, - json: true, - }, - ( - error, - httpIncomingMessage, - body - ) => { - if ( - error - ) { - console.error( - `https://api.github.com/repos/amarcireau/origami/releases/assets/${asset.id}`, - error - ); - process.exit( - 1 - ); - } - if ( - httpIncomingMessage.statusCode !== - 204 - ) { - console.error( - `https://api.github.com/repos/amarcireau/origami/releases/assets/${asset.id}`, - body - ); - process.exit( - 1 - ); - } - console.log( - `${asset.name} of ${releaseAndVersion.release.tag_name} (${asset.id} of ${releaseAndVersion.release.id}) deleted (expired version)` - ); - } - ); - } - } - } - ); - } - } - ); - } - ); - }); - const archive = archiver("zip", { - zlib: { - level: zlib.constants - .Z_BEST_COMPRESSION, - }, - }); - archive.on("error", error => { - throw error; - }); - archive.pipe(output); - if ( - matchedConfiguration[1] === "darwin" || - matchedConfiguration[1] === "mas" - ) { - // resolve Framework symlinks manually before zipping - try { - fs.mkdirSync( - `${path.dirname( - __dirname - )}/build/archives` - ); - } catch (error) {} - child_process.execSync( - `rm -rf '${path.dirname( - __dirname - )}/build/archives/${directoryToZip}'` - ); - fs.mkdirSync( - `${path.dirname( - __dirname - )}/build/archives/${directoryToZip}` - ); - child_process.execSync( - `cp -R '${path.dirname( - __dirname - )}/build/${directoryToZip}/Origami.app' '${path.dirname( - __dirname - )}/build/archives/${directoryToZip}/Origami.app'` - ); - const frameworks = `${path.dirname( - __dirname - )}/build/archives/${directoryToZip}/Origami.app/Contents/Frameworks`; - for (const frameworkFile of fs.readdirSync( - frameworks - )) { - if ( - path.extname(frameworkFile) === - ".framework" - ) { - const framework = `${frameworks}/${frameworkFile}`; - for (const element of fs.readdirSync( - framework - )) { - if ( - element !== "Versions" - ) { - child_process.execSync( - `rm -rf '${framework}/${element}'` - ); - child_process.execSync( - `cp -R '${framework}/Versions/A/${element}' '${framework}/${element}'` - ); - } - } - child_process.execSync( - `rm -rf '${framework}/Versions'` - ); - } - } - - archive.directory( - `${path.dirname( - __dirname - )}/build/archives/${directoryToZip}/Origami.app`, - "Origami.app" - ); - archive.finalize(); - } else { - archive.directory( - `${path.dirname( - __dirname - )}/build/${directoryToZip}`, - "Origami" - ); - archive.finalize(); - } - } - } - } - } + archive.finalize(); + }); + console.log(`Created "${outputFilename}"`); + await axios({ + url: urlTemplate.parse(release.upload_url).expand({ + name: `${name}.zip`, + }), + method: "post", + auth, + maxContentLength: Infinity, + maxBodyLength: Infinity, + headers: { + "Content-Length": fs.statSync(outputFilename).size, + "Content-Type": "application/zip", + }, + data: fs.createReadStream(outputFilename), + }); + console.log(`Uploaded "${name}.zip"`); + })() + ) + ); + console.log( + `Upload complete, visit ${release.html_url} to publish the release` + ); + if (version.identifier == null) { + const releasesToPurge = []; + for (const otherRelease of ( + await axios.get( + "https://api.github.com/repos/amarcireau/origami/releases", + { auth } + ) + ).data + .filter(otherRelease => otherRelease.id !== release.id) + .map(otherRelease => [ + otherRelease, + semver.exec(otherRelease.tag_name), + ]) + .filter(([_, semverMatch]) => semverMatch != null) + .map(([otherRelease, semverMatch]) => ({ + ...otherRelease, + version: { + major: parseInt(semverMatch[1]), + minor: parseInt(semverMatch[2]), + patch: parseInt(semverMatch[3]), + identifier: semverMatch[4] ? semverMatch[4] : null, + }, + }))) { + if (otherRelease.draft) { + await axios.delete( + `https://api.github.com/repos/amarcireau/origami/releases/${otherRelease.id}`, + { auth } + ); + console.log( + `draft version ${otherRelease.tag_name} (${otherRelease.id}) deleted` ); + } else if (otherRelease.version.identifier) { + console.log( + `${otherRelease.tag_name} (${otherRelease.id}) has an identifier: skipping automatic operations` + ); + } else if ( + isSmallerThan(version, otherRelease.version) || + areEqual(version, otherRelease.version) + ) { + console.log( + `${otherRelease.tag_name} (${otherRelease.id}) is greater than or identical to the current version: skipping automatic operations` + ); + } else { + releasesToPurge.push(otherRelease); + } + } + let previousMajorVersion = null; + let previousMinorVersion = null; + for (const otherRelease of releasesToPurge) { + if ( + otherRelease.version.major < version.major - 1 || + (otherRelease.version.major === version.major && + otherRelease.version.minor < version.minor - 1) || + (otherRelease.version.major === version.major && + otherRelease.version.minor === version.minor) + ) { + continue; } + if ( + otherRelease.version.major === version.major - 1 && + (previousMajorVersion == null || + isSmallerThan(previousMajorVersion, otherRelease.version)) + ) { + previousMajorVersion = otherRelease.version; + continue; + } + if ( + otherRelease.version.major === version.major && + otherRelease.version.minor === version.minor - 1 && + (previousMinorVersion == null || + isSmallerThan(previousMinorVersion, otherRelease.version)) + ) { + previousMinorVersion = otherRelease.version; + continue; + } + } + console.log( + previousMajorVersion == null + ? "There is no previous major version" + : `Previous major version preserved: v${previousMajorVersion.major}.${previousMajorVersion.minor}.${previousMajorVersion.patch}` + ); + console.log( + previousMinorVersion == null + ? "There is no previous minor version" + : `Previous minor version preserved: v${previousMinorVersion.major}.${previousMinorVersion.minor}.${previousMinorVersion.patch}` ); - }); - process.stdout.write("password: "); -}); + for (const otherRelease of releasesToPurge) { + if ( + (previousMajorVersion && + areEqual(previousMajorVersion, otherRelease.version)) || + (previousMinorVersion && + areEqual(previousMinorVersion, otherRelease.version)) + ) { + console.log( + `${otherRelease.tag_name} (${ + otherRelease.id + }) was not purged (previous ${ + previousMajorVersion && + areEqual(previousMajorVersion, otherRelease.version) + ? "major" + : "minor" + })` + ); + continue; + } + for (const asset of otherRelease.assets) { + await axios.delete( + `https://api.github.com/repos/amarcireau/origami/releases/assets/${asset.id}`, + { auth } + ); + console.log( + `${asset.name} of ${otherRelease.tag_name} (${asset.id} of ${otherRelease.id}) deleted (expired version)` + ); + } + } + } +})(); diff --git a/source/main.js b/source/main.js index d85d0ef..30c5c01 100644 --- a/source/main.js +++ b/source/main.js @@ -152,13 +152,12 @@ function createWindow() { /// filename: string, the filename used if the save was not cancelled electron.ipcMain.on("save-to-file", (event, filename, data) => { if (filename == null) { - electron.dialog.showSaveDialog( - mainWindow, - { + electron.dialog + .showSaveDialog(mainWindow, { filters: [{ name: "JSON", extensions: ["json"] }], - }, - filePaths => { - if (filePaths == null) { + }) + .then(result => { + if (result.canceled) { event.sender.send( "saved-to-file", true, @@ -166,26 +165,25 @@ function createWindow() { null ); } else { - fs.writeFile(filePaths, data, error => { + fs.writeFile(result.filePath, data, error => { if (error) { event.sender.send( "saved-to-file", false, true, - filePaths + result.filePath ); } else { event.sender.send( "saved-to-file", false, false, - filePaths + result.filePath ); } }); } - } - ); + }); } else { fs.writeFile(filename, data, error => { if (error) { @@ -217,22 +215,21 @@ function createWindow() { electron.ipcMain.on( "save-to-file-then-new", (event, filename, data) => { - electron.dialog.showMessageBox( - mainWindow, - { + electron.dialog + .showMessageBox(mainWindow, { type: "question", buttons: ["Save", "Cancel", "Don't Save"], message: "Do you want to save your changes?", - }, - response => { - if (response === 2) { + }) + .then(result => { + if (result.response === 2) { event.sender.send( "saved-to-file-then-new", false, false, null ); - } else if (response === 1) { + } else if (result.response === 1) { event.sender.send( "saved-to-file-then-new", true, @@ -241,18 +238,20 @@ function createWindow() { ); } else { if (filename == null) { - electron.dialog.showSaveDialog( - mainWindow, - { + electron.dialog + .showSaveDialog(mainWindow, { filters: [ { name: "JSON", extensions: ["json"], }, ], - }, - filePaths => { - if (filePaths == null) { + }) + .then(result => { + if ( + result.canceled || + result.filePaths.length === 0 + ) { event.sender.send( "saved-to-file-then-new", true, @@ -261,7 +260,7 @@ function createWindow() { ); } else { fs.writeFile( - filePaths, + result.filePaths, data, error => { if (error) { @@ -269,21 +268,20 @@ function createWindow() { "saved-to-file-then-new", false, true, - filePaths + result.filePaths ); } else { event.sender.send( "saved-to-file-then-new", false, false, - filePaths + result.filePaths ); } } ); } - } - ); + }); } else { fs.writeFile(filename, data, error => { if (error) { @@ -304,8 +302,7 @@ function createWindow() { }); } } - } - ); + }); } ); @@ -325,15 +322,17 @@ function createWindow() { "save-to-file-then-open", (event, filename, data) => { const openFileDialog = saveFilename => { - electron.dialog.showOpenDialog( - mainWindow, - { + electron.dialog + .showOpenDialog(mainWindow, { filters: [ { name: "JSON", extensions: ["json"] }, ], - }, - filePaths => { - if (filePaths == null) { + }) + .then(result => { + if ( + result.canceled || + result.filePaths.length === 0 + ) { event.sender.send( "saved-to-file-then-opened", false, @@ -345,34 +344,36 @@ function createWindow() { null ); } else { - fs.readFile(filePaths[0], (error, data) => { - if (error) { - event.sender.send( - "saved-to-file-then-opened", - false, - false, - false, - true, - saveFilename, - filePaths[0], - null - ); - } else { - event.sender.send( - "saved-to-file-then-opened", - false, - false, - false, - false, - saveFilename, - filePaths[0], - data - ); + fs.readFile( + result.filePaths[0], + (error, data) => { + if (error) { + event.sender.send( + "saved-to-file-then-opened", + false, + false, + false, + true, + saveFilename, + result.filePaths[0], + null + ); + } else { + event.sender.send( + "saved-to-file-then-opened", + false, + false, + false, + false, + saveFilename, + result.filePaths[0], + data + ); + } } - }); + ); } - } - ); + }); }; electron.dialog.showMessageBox( mainWindow, @@ -397,18 +398,17 @@ function createWindow() { ); } else { if (filename == null) { - electron.dialog.showSaveDialog( - mainWindow, - { + electron.dialog + .showSaveDialog(mainWindow, { filters: [ { name: "JSON", extensions: ["json"], }, ], - }, - filePaths => { - if (filePaths == null) { + }) + .then(result => { + if (result.canceled) { event.sender.send( "saved-to-file-then-opened", true, @@ -421,7 +421,7 @@ function createWindow() { ); } else { fs.writeFile( - filePaths, + result.filePath, data, error => { if (error) { @@ -431,20 +431,19 @@ function createWindow() { false, true, false, - filePaths, + result.filePath, null, null ); } else { openFileDialog( - filePaths + result.filePath ); } } ); } - } - ); + }); } else { fs.writeFile(filename, data, error => { if (error) { @@ -476,13 +475,12 @@ function createWindow() { /// filename: string, the filename used if the opening was not cancelled /// data: buffer, content of the opened file electron.ipcMain.on("open", event => { - electron.dialog.showOpenDialog( - mainWindow, - { + electron.dialog + .showOpenDialog(mainWindow, { filters: [{ name: "JSON", extensions: ["json"] }], - }, - filePaths => { - if (filePaths == null) { + }) + .then(result => { + if (result.canceled || result.filePaths.length === 0) { event.sender.send( "opened", true, @@ -491,13 +489,13 @@ function createWindow() { null ); } else { - fs.readFile(filePaths[0], (error, data) => { + fs.readFile(result.filePaths[0], (error, data) => { if (error) { event.sender.send( "opened", false, true, - filePaths[0], + result.filePaths[0], null ); } else { @@ -505,14 +503,13 @@ function createWindow() { "opened", false, false, - filePaths[0], + result.filePaths[0], data ); } }); } - } - ); + }); }); /// 'backup' moves an existing save and creates a new one, reporting errors with 'backedup'. @@ -572,13 +569,12 @@ function createWindow() { /// filename: string, the filename used if the opening was not cancelled /// data: buffer, content of the opened file electron.ipcMain.on("import-publications", event => { - electron.dialog.showOpenDialog( - mainWindow, - { + electron.dialog + .showOpenDialog(mainWindow, { filters: [{ name: "JSON", extensions: ["json"] }], - }, - filePaths => { - if (filePaths == null) { + }) + .then(result => { + if (result.canceled || result.filePaths.length === 0) { event.sender.send( "imported-publications", true, @@ -587,13 +583,13 @@ function createWindow() { null ); } else { - fs.readFile(filePaths[0], (error, data) => { + fs.readFile(result.filePaths[0], (error, data) => { if (error) { event.sender.send( "imported-publications", false, true, - filePaths[0], + result.filePaths[0], null ); } else { @@ -601,14 +597,13 @@ function createWindow() { "imported-publications", false, false, - filePaths[0], + result.filePaths[0], data ); } }); } - } - ); + }); }); /// 'import-dois' prompts for a file to open and sends back its contents with 'imported-dois'. @@ -618,13 +613,12 @@ function createWindow() { /// filename: string, the filename used if the opening was not cancelled /// data: buffer, content of the opened file electron.ipcMain.on("import-dois", event => { - electron.dialog.showOpenDialog( - mainWindow, - { + electron.dialog + .showOpenDialog(mainWindow, { filters: [{ name: "JSON", extensions: ["json"] }], - }, - filePaths => { - if (filePaths == null) { + }) + .then(result => { + if (result.canceled || result.filePaths.length === 0) { event.sender.send( "imported-dois", true, @@ -633,13 +627,13 @@ function createWindow() { null ); } else { - fs.readFile(filePaths[0], (error, data) => { + fs.readFile(result.filePaths[0], (error, data) => { if (error) { event.sender.send( "imported-dois", false, true, - filePaths[0], + result.filePaths[0], null ); } else { @@ -647,14 +641,13 @@ function createWindow() { "imported-dois", false, false, - filePaths[0], - data + result.filePaths[0], + data.toString() ); } }); } - } - ); + }); }); /// 'import-bibtex' prompts for a file to open and sends back its contents with 'imported-bibtex'. @@ -664,13 +657,12 @@ function createWindow() { /// filename: string, the filename used if the opening was not cancelled /// data: buffer, content of the opened file electron.ipcMain.on("import-bibtex", event => { - electron.dialog.showOpenDialog( - mainWindow, - { + electron.dialog + .showOpenDialog(mainWindow, { filters: [{ name: "BibTeX", extensions: ["bib"] }], - }, - filePaths => { - if (filePaths == null) { + }) + .then(result => { + if (result.canceled || result.filePaths.length === 0) { event.sender.send( "imported-bibtex", true, @@ -679,13 +671,13 @@ function createWindow() { null ); } else { - fs.readFile(filePaths[0], (error, data) => { + fs.readFile(result.filePaths[0], (error, data) => { if (error) { event.sender.send( "imported-bibtex", false, true, - filePaths[0], + result.filePaths[0], null ); } else { @@ -693,14 +685,13 @@ function createWindow() { "imported-bibtex", false, false, - filePaths[0], - data + result.filePaths[0], + data.toString() ); } }); } - } - ); + }); }); /// 'export-bibtex' stores the given data to the given file and sends back 'exported-bibtex'. @@ -709,33 +700,31 @@ function createWindow() { /// failed: bool, true if the save failed /// filename: string, the filename used if the save was not cancelled electron.ipcMain.on("export-bibtex", (event, data) => { - electron.dialog.showSaveDialog( - mainWindow, - { + electron.dialog + .showSaveDialog(mainWindow, { filters: [{ name: "BibTeX", extensions: ["bib"] }], - }, - filePaths => { - if (filePaths == null) { + }) + .then(result => { + if (result.canceled) { event.sender.send("exported-bibtex", false, null); } else { - fs.writeFile(filePaths, data, error => { + fs.writeFile(result.filePath, data, error => { if (error) { event.sender.send( "exported-bibtex", true, - filePaths + result.filePath ); } else { event.sender.send( "exported-bibtex", false, - filePaths + result.filePath ); } }); } - } - ); + }); }); /// 'secure-cookies' changes the secure flag to true for all cookies. diff --git a/source/package.json b/source/package.json index d010a91..06dda03 100644 --- a/source/package.json +++ b/source/package.json @@ -1,6 +1,6 @@ { "name": "Origami", - "version": "0.11.0", + "version": "0.10.3", "main": "main.js", "private": true, "devDependencies": {