diff --git a/main/index.ts b/main/index.ts index 0bae8ca..5db0a8b 100644 --- a/main/index.ts +++ b/main/index.ts @@ -2,10 +2,13 @@ import { app, BrowserWindow } from 'electron'; import modifyProcessEnv from './utils/modifyProcessEnv'; import { createWindow } from './window'; import handleIPC from './ipc'; +import { checkForUpdates } from './utils/autoUpdater'; process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 'true'; app.whenReady().then(() => { + checkForUpdates(); + modifyProcessEnv(); createWindow(); diff --git a/main/utils/autoUpdater.ts b/main/utils/autoUpdater.ts new file mode 100644 index 0000000..b211fe5 --- /dev/null +++ b/main/utils/autoUpdater.ts @@ -0,0 +1,46 @@ +import { NsisUpdater, MacUpdater, AppImageUpdater } from 'electron-updater'; +import * as isDev from 'electron-is-dev'; +import log from './log'; + +let AutoUpdater; +if (process.platform === 'win32') { + AutoUpdater = NsisUpdater; +} else if (process.platform === 'darwin') { + AutoUpdater = MacUpdater; +} else { + AutoUpdater = AppImageUpdater; +} + +const autoUpdater = new AutoUpdater(); + +autoUpdater.logger = log; +autoUpdater.logger.transports.file.level = 'info'; + +autoUpdater.on('checking-for-update', () => { + log.info('checking-for-update'); +}); +autoUpdater.on('update-available', (info) => { + log.info('update-available', info); +}); +autoUpdater.on('update-not-available', (info) => { + log.info('update-not-available', info); +}); +autoUpdater.on('error', (error) => { + log.error('error', error); +}); +autoUpdater.on('download-progress', (meta) => { + log.info('download-progress', meta); +}); +autoUpdater.on('update-downloaded', (info) => { + log.info('update-downloaded', info); +}); + +export function checkForUpdates() { + if (isDev) { + return; + } + autoUpdater.checkForUpdates(); +} + +export default autoUpdater; + diff --git a/package-lock.json b/package-lock.json index 723083a..41e408a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -782,6 +782,36 @@ "defer-to-connect": "^1.0.1" } }, + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/@tootallnate/once/download/@tootallnate/once-1.1.2.tgz", + "integrity": "sha1-zLkURTYBeaBOf+av94wA/8Hur4I=", + "dev": true + }, + "@tsconfig/node10": { + "version": "1.0.7", + "resolved": "https://registry.nlark.com/@tsconfig/node10/download/@tsconfig/node10-1.0.7.tgz", + "integrity": "sha1-HrHeNsc0eKJHnMZh71rxwW2G1gY=", + "dev": true + }, + "@tsconfig/node12": { + "version": "1.0.7", + "resolved": "https://registry.nlark.com/@tsconfig/node12/download/@tsconfig/node12-1.0.7.tgz", + "integrity": "sha1-Z3vZEX6BZNwxmYfdb/X8G6b78Ys=", + "dev": true + }, + "@tsconfig/node14": { + "version": "1.0.0", + "resolved": "https://registry.nlark.com/@tsconfig/node14/download/@tsconfig/node14-1.0.0.tgz", + "integrity": "sha1-W9BG5Qix7pC8CRdmdYg4dB/e/W4=", + "dev": true + }, + "@tsconfig/node16": { + "version": "1.0.1", + "resolved": "https://registry.nlark.com/@tsconfig/node16/download/@tsconfig/node16-1.0.1.tgz", + "integrity": "sha1-pspqmg/zZq9DP0L18OEkeU/2uPE=", + "dev": true + }, "@types/debug": { "version": "4.1.5", "resolved": "https://registry.nlark.com/@types/debug/download/@types/debug-4.1.5.tgz", @@ -888,6 +918,11 @@ "xmlbuilder": ">=11.0.1" } }, + "@types/semver": { + "version": "7.3.6", + "resolved": "https://registry.nlark.com/@types/semver/download/@types/semver-7.3.6.tgz?cache=0&sync_timestamp=1620925383788&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fsemver%2Fdownload%2F%40types%2Fsemver-7.3.6.tgz", + "integrity": "sha1-6YMXdvRRKnum2lPnHCbl+2eILWM=" + }, "@types/shelljs": { "version": "0.8.8", "resolved": "https://registry.nlark.com/@types/shelljs/download/@types/shelljs-0.8.8.tgz?cache=0&sync_timestamp=1621243494131&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fshelljs%2Fdownload%2F%40types%2Fshelljs-0.8.8.tgz", @@ -1031,11 +1066,35 @@ "integrity": "sha1-/IZh4Rt6wVOcR9v+oucrOvNNJns=", "dev": true }, + "address": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/address/download/address-1.1.2.tgz", + "integrity": "sha1-vxEWycdYxRt6kz0pa3LCIe2UKLY=", + "dev": true + }, "adm-zip": { "version": "0.5.5", "resolved": "https://registry.npm.taobao.org/adm-zip/download/adm-zip-0.5.5.tgz", "integrity": "sha1-tlSdvqdB5AUDCfG7TUfEc5fOLE8=" }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npm.taobao.org/agent-base/download/agent-base-6.0.2.tgz?cache=0&sync_timestamp=1603479872755&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fagent-base%2Fdownload%2Fagent-base-6.0.2.tgz", + "integrity": "sha1-Sf/1hXfP7j83F2/qtMIuAPhtf3c=", + "dev": true, + "requires": { + "debug": "4" + } + }, + "agentkeepalive": { + "version": "3.5.2", + "resolved": "https://registry.npm.taobao.org/agentkeepalive/download/agentkeepalive-3.5.2.tgz?cache=0&sync_timestamp=1612490497760&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fagentkeepalive%2Fdownload%2Fagentkeepalive-3.5.2.tgz", + "integrity": "sha1-oROSTdP6JKC8O3gQjEUMKr7gD2c=", + "dev": true, + "requires": { + "humanize-ms": "^1.2.1" + } + }, "ajv": { "version": "6.12.6", "resolved": "https://registry.nlark.com/ajv/download/ajv-6.12.6.tgz", @@ -1053,6 +1112,62 @@ "integrity": "sha1-MfKdpatuANHC0yms97WSlhTVAU0=", "dev": true }, + "ali-oss": { + "version": "6.15.2", + "resolved": "https://registry.npm.taobao.org/ali-oss/download/ali-oss-6.15.2.tgz?cache=0&sync_timestamp=1617265852289&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fali-oss%2Fdownload%2Fali-oss-6.15.2.tgz", + "integrity": "sha1-J2w73/X4lGCsn+rI0dKgvDKhjWw=", + "dev": true, + "requires": { + "address": "^1.0.0", + "agentkeepalive": "^3.4.1", + "bowser": "^1.6.0", + "co-defer": "^1.0.0", + "copy-to": "^2.0.1", + "dateformat": "^2.0.0", + "debug": "^2.2.0", + "destroy": "^1.0.4", + "end-or-error": "^1.0.1", + "get-ready": "^1.0.0", + "humanize-ms": "^1.2.0", + "is-type-of": "^1.0.0", + "js-base64": "^2.5.2", + "jstoxml": "^0.2.3", + "merge-descriptors": "^1.0.1", + "mime": "^2.4.5", + "mz-modules": "^2.1.0", + "platform": "^1.3.1", + "pump": "^3.0.0", + "sdk-base": "^2.0.1", + "stream-http": "2.8.2", + "stream-wormhole": "^1.0.4", + "urllib": "^2.33.1", + "utility": "^1.8.0", + "xml2js": "^0.4.16" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz?cache=0&sync_timestamp=1607566580543&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-2.6.9.tgz", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "js-base64": { + "version": "2.6.4", + "resolved": "https://registry.nlark.com/js-base64/download/js-base64-2.6.4.tgz?cache=0&sync_timestamp=1621703335082&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjs-base64%2Fdownload%2Fjs-base64-2.6.4.tgz", + "integrity": "sha1-9OaGxd4eofhn28rT1G2WlCjfmMQ=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz?cache=0&sync_timestamp=1607433905701&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, "ansi-align": { "version": "3.0.0", "resolved": "https://registry.npm.taobao.org/ansi-align/download/ansi-align-3.0.0.tgz", @@ -1133,6 +1248,12 @@ "color-convert": "^2.0.1" } }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npm.taobao.org/any-promise/download/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", + "dev": true + }, "app-builder-bin": { "version": "3.5.12", "resolved": "https://registry.npm.taobao.org/app-builder-bin/download/app-builder-bin-3.5.12.tgz", @@ -1190,11 +1311,16 @@ } } }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npm.taobao.org/arg/download/arg-4.1.3.tgz?cache=0&sync_timestamp=1605575041404&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Farg%2Fdownload%2Farg-4.1.3.tgz", + "integrity": "sha1-Jp/HrVuOQstjyJbVZmAXJhwUQIk=", + "dev": true + }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npm.taobao.org/argparse/download/argparse-2.0.1.tgz", - "integrity": "sha1-JG9Q88p4oyQPbJl+ipvR6sSeSzg=", - "dev": true + "integrity": "sha1-JG9Q88p4oyQPbJl+ipvR6sSeSzg=" }, "array-ify": { "version": "1.0.0", @@ -1283,6 +1409,15 @@ "resolved": "https://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, + "ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npm.taobao.org/ast-types/download/ast-types-0.13.4.tgz", + "integrity": "sha1-7g13s0MmOWXsw/ti2hbnIisrZ4I=", + "dev": true, + "requires": { + "tslib": "^2.0.1" + } + }, "astral-regex": { "version": "1.0.0", "resolved": "https://registry.npm.taobao.org/astral-regex/download/astral-regex-1.0.0.tgz", @@ -1426,6 +1561,12 @@ "dev": true, "optional": true }, + "bowser": { + "version": "1.9.4", + "resolved": "https://registry.npm.taobao.org/bowser/download/bowser-1.9.4.tgz", + "integrity": "sha1-iQxYooE6nTJDcEM0+oG5alwVDJo=", + "dev": true + }, "boxen": { "version": "5.0.1", "resolved": "https://registry.npm.taobao.org/boxen/download/boxen-5.0.1.tgz?cache=0&sync_timestamp=1617702541647&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fboxen%2Fdownload%2Fboxen-5.0.1.tgz", @@ -1585,6 +1726,18 @@ } } }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/builtin-status-codes/download/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/bytes/download/bytes-3.1.0.tgz", + "integrity": "sha1-9s95M6Ng4FiPqf3oVlHNx/gF0fY=", + "dev": true + }, "cacheable-request": { "version": "6.1.0", "resolved": "https://registry.npm.taobao.org/cacheable-request/download/cacheable-request-6.1.0.tgz", @@ -1815,6 +1968,12 @@ "mimic-response": "^1.0.0" } }, + "co-defer": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/co-defer/download/co-defer-1.0.0.tgz", + "integrity": "sha1-Pkp4eo7tawoh7ih8CU9+jeDTyBg=", + "dev": true + }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", @@ -2207,6 +2366,12 @@ "path-starts-with": "^1.0.0" } }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/content-type/download/content-type-1.0.4.tgz", + "integrity": "sha1-4TjMdeBAxyexlm/l5fjJruJW/js=", + "dev": true + }, "conventional-changelog-angular": { "version": "5.0.12", "resolved": "https://registry.npm.taobao.org/conventional-changelog-angular/download/conventional-changelog-angular-5.0.12.tgz", @@ -2260,6 +2425,12 @@ } } }, + "copy-to": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/copy-to/download/copy-to-2.0.1.tgz", + "integrity": "sha1-JoD7uAaKSNCGVrYJgJK9r8kG9KU=", + "dev": true + }, "core-js": { "version": "3.12.1", "resolved": "https://registry.nlark.com/core-js/download/core-js-3.12.1.tgz?cache=0&sync_timestamp=1620507873758&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcore-js%2Fdownload%2Fcore-js-3.12.1.tgz", @@ -2295,6 +2466,12 @@ "buffer": "^5.1.0" } }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/create-require/download/create-require-1.1.1.tgz", + "integrity": "sha1-wdfo8eX2z8n/ZfnNNS03NIdWwzM=", + "dev": true + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-7.0.3.tgz", @@ -2331,12 +2508,24 @@ "assert-plus": "^1.0.0" } }, + "data-uri-to-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npm.taobao.org/data-uri-to-buffer/download/data-uri-to-buffer-3.0.1.tgz", + "integrity": "sha1-WUuJc5OMW8LDMEZTV4U0GrxPNjY=", + "dev": true + }, "date-fns": { "version": "2.21.3", "resolved": "https://registry.nlark.com/date-fns/download/date-fns-2.21.3.tgz?cache=0&sync_timestamp=1620446248863&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fdate-fns%2Fdownload%2Fdate-fns-2.21.3.tgz", "integrity": "sha1-j19oidepa7zB8OpQI5s5eoM1f5s=", "dev": true }, + "dateformat": { + "version": "2.2.0", + "resolved": "https://registry.npm.taobao.org/dateformat/download/dateformat-2.2.0.tgz?cache=0&sync_timestamp=1612067621293&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdateformat%2Fdownload%2Fdateformat-2.2.0.tgz", + "integrity": "sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI=", + "dev": true + }, "debug": { "version": "4.3.1", "resolved": "https://registry.npm.taobao.org/debug/download/debug-4.3.1.tgz?cache=0&sync_timestamp=1607566580543&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.3.1.tgz", @@ -2463,6 +2652,15 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "default-user-agent": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/default-user-agent/download/default-user-agent-1.0.0.tgz", + "integrity": "sha1-FsRu/cq6PtxF8k8r1IaLAbfCrcY=", + "dev": true, + "requires": { + "os-name": "~1.0.3" + } + }, "defer-to-connect": { "version": "1.1.3", "resolved": "https://registry.npm.taobao.org/defer-to-connect/download/defer-to-connect-1.1.3.tgz?cache=0&sync_timestamp=1614211480566&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdefer-to-connect%2Fdownload%2Fdefer-to-connect-1.1.3.tgz", @@ -2478,11 +2676,34 @@ "object-keys": "^1.0.12" } }, + "degenerator": { + "version": "2.2.0", + "resolved": "https://registry.npm.taobao.org/degenerator/download/degenerator-2.2.0.tgz", + "integrity": "sha1-SemMEfoCk8Wybt+7UvFXKa/NslQ=", + "dev": true, + "requires": { + "ast-types": "^0.13.2", + "escodegen": "^1.8.1", + "esprima": "^4.0.0" + } + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/depd/download/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/destroy/download/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, "detect-node": { "version": "2.1.0", "resolved": "https://registry.nlark.com/detect-node/download/detect-node-2.1.0.tgz?cache=0&sync_timestamp=1621147029891&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fdetect-node%2Fdownload%2Fdetect-node-2.1.0.tgz", @@ -2490,6 +2711,32 @@ "dev": true, "optional": true }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npm.taobao.org/diff/download/diff-4.0.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdiff%2Fdownload%2Fdiff-4.0.2.tgz", + "integrity": "sha1-YPOuy4nV+uUgwRqhnvwruYKq3n0=", + "dev": true + }, + "digest-header": { + "version": "0.0.1", + "resolved": "https://registry.npm.taobao.org/digest-header/download/digest-header-0.0.1.tgz", + "integrity": "sha1-Ecz23uxXZqw3l0TZAcEsuklRS+Y=", + "dev": true, + "requires": { + "utility": "0.1.11" + }, + "dependencies": { + "utility": { + "version": "0.1.11", + "resolved": "https://registry.npm.taobao.org/utility/download/utility-0.1.11.tgz?cache=0&sync_timestamp=1608037972811&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Futility%2Fdownload%2Futility-0.1.11.tgz", + "integrity": "sha1-/eYM+bTkdRlHoM9dEEzik2ciZxU=", + "dev": true, + "requires": { + "address": ">=0.0.1" + } + } + } + }, "dir-compare": { "version": "2.4.0", "resolved": "https://registry.nlark.com/dir-compare/download/dir-compare-2.4.0.tgz", @@ -2652,6 +2899,12 @@ "version-range": "^1.0.0" } }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/ee-first/download/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, "ejs": { "version": "3.1.6", "resolved": "https://registry.npm.taobao.org/ejs/download/ejs-3.1.6.tgz?cache=0&sync_timestamp=1612643435705&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fejs%2Fdownload%2Fejs-3.1.6.tgz", @@ -2734,6 +2987,50 @@ "integrity": "sha1-bh+tjyUIJ/VSRnLlcvgjs0pkF+E=", "dev": true }, + "electron-updater": { + "version": "4.3.9", + "resolved": "https://registry.nlark.com/electron-updater/download/electron-updater-4.3.9.tgz?cache=0&sync_timestamp=1620720236740&other_urls=https%3A%2F%2Fregistry.nlark.com%2Felectron-updater%2Fdownload%2Felectron-updater-4.3.9.tgz", + "integrity": "sha1-JHxmC6+tfAeTXhuBrNPppf1zMVQ=", + "requires": { + "@types/semver": "^7.3.5", + "builder-util-runtime": "8.7.5", + "fs-extra": "^10.0.0", + "js-yaml": "^4.1.0", + "lazy-val": "^1.0.4", + "lodash.escaperegexp": "^4.1.2", + "lodash.isequal": "^4.5.0", + "semver": "^7.3.5" + }, + "dependencies": { + "builder-util-runtime": { + "version": "8.7.5", + "resolved": "https://registry.nlark.com/builder-util-runtime/download/builder-util-runtime-8.7.5.tgz", + "integrity": "sha1-++WeJ0gYiF4NLjWNW3AXw0rmsPU=", + "requires": { + "debug": "^4.3.2", + "sax": "^1.2.4" + } + }, + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-4.3.2.tgz?cache=0&sync_timestamp=1607566580543&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.3.2.tgz", + "integrity": "sha1-8KScGKyHeeMdSgxgKd+3aHPHQos=", + "requires": { + "ms": "2.1.2" + } + }, + "fs-extra": { + "version": "10.0.0", + "resolved": "https://registry.nlark.com/fs-extra/download/fs-extra-10.0.0.tgz?cache=0&sync_timestamp=1620079845472&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ffs-extra%2Fdownload%2Ffs-extra-10.0.0.tgz", + "integrity": "sha1-n/YbZV3eU/s0qC34S7IUzoAuF8E=", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + } + } + }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npm.taobao.org/emoji-regex/download/emoji-regex-8.0.0.tgz?cache=0&sync_timestamp=1614682707048&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Femoji-regex%2Fdownload%2Femoji-regex-8.0.0.tgz", @@ -2755,6 +3052,12 @@ "once": "^1.4.0" } }, + "end-or-error": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/end-or-error/download/end-or-error-1.0.1.tgz", + "integrity": "sha1-3HpiEP5403L+4kqLSJnb0VVBTcs=", + "dev": true + }, "entities": { "version": "2.2.0", "resolved": "https://registry.npm.taobao.org/entities/download/entities-2.2.0.tgz", @@ -2835,12 +3138,40 @@ "integrity": "sha1-Gy3HcANnbEV+x2Cy3GjttkgYhnU=", "dev": true }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npm.taobao.org/escape-html/download/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz?cache=0&sync_timestamp=1618677243201&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fescape-string-regexp%2Fdownload%2Fescape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, + "escodegen": { + "version": "1.14.3", + "resolved": "https://registry.npm.taobao.org/escodegen/download/escodegen-1.14.3.tgz", + "integrity": "sha1-TnuB+6YVgdyXWC7XjKt/Do1j9QM=", + "dev": true, + "requires": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "dev": true, + "optional": true + } + } + }, "eslint": { "version": "6.8.0", "resolved": "https://registry.nlark.com/eslint/download/eslint-6.8.0.tgz?cache=0&sync_timestamp=1620440445769&other_urls=https%3A%2F%2Fregistry.nlark.com%2Feslint%2Fdownload%2Feslint-6.8.0.tgz", @@ -3502,6 +3833,15 @@ "resolved": "https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz", "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=" }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/extend-shallow/download/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, "external-editor": { "version": "3.1.0", "resolved": "https://registry.npm.taobao.org/external-editor/download/external-editor-3.1.0.tgz", @@ -3632,6 +3972,12 @@ "resolved": "https://registry.nlark.com/file-type/download/file-type-5.2.0.tgz?cache=0&sync_timestamp=1620212521104&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ffile-type%2Fdownload%2Ffile-type-5.2.0.tgz", "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=" }, + "file-uri-to-path": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/file-uri-to-path/download/file-uri-to-path-2.0.0.tgz", + "integrity": "sha1-e0Fa66In1XWFHgpbDGQNdlZAP7o=", + "dev": true + }, "filelist": { "version": "1.0.2", "resolved": "https://registry.npm.taobao.org/filelist/download/filelist-1.0.2.tgz?cache=0&sync_timestamp=1612641447730&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffilelist%2Fdownload%2Ffilelist-1.0.2.tgz", @@ -3698,6 +4044,17 @@ "mime-types": "^2.1.12" } }, + "formstream": { + "version": "1.1.1", + "resolved": "https://registry.nlark.com/formstream/download/formstream-1.1.1.tgz", + "integrity": "sha1-FyWdJEDDXKlzbbn0X7O6P4Zpx1A=", + "dev": true, + "requires": { + "destroy": "^1.0.4", + "mime": "^2.5.2", + "pause-stream": "~0.0.11" + } + }, "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npm.taobao.org/fs-constants/download/fs-constants-1.0.0.tgz", @@ -3727,6 +4084,42 @@ "resolved": "https://registry.npm.taobao.org/fs.realpath/download/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "ftp": { + "version": "0.3.10", + "resolved": "https://registry.npm.taobao.org/ftp/download/ftp-0.3.10.tgz", + "integrity": "sha1-kZfYYa2BQvPmPVqDv+TFn3MwiF0=", + "dev": true, + "requires": { + "readable-stream": "1.1.x", + "xregexp": "2.0.0" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npm.taobao.org/isarray/download/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npm.taobao.org/readable-stream/download/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npm.taobao.org/string_decoder/download/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npm.taobao.org/function-bind/download/function-bind-1.1.1.tgz", @@ -3761,6 +4154,12 @@ "has-symbols": "^1.0.1" } }, + "get-ready": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/get-ready/download/get-ready-1.0.0.tgz", + "integrity": "sha1-+RgX8emt7P6hOlYq38jeiDqzR4I=", + "dev": true + }, "get-stdin": { "version": "8.0.0", "resolved": "https://registry.npm.taobao.org/get-stdin/download/get-stdin-8.0.0.tgz?cache=0&sync_timestamp=1618557624027&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fget-stdin%2Fdownload%2Fget-stdin-8.0.0.tgz", @@ -3776,6 +4175,48 @@ "pinkie-promise": "^2.0.0" } }, + "get-uri": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/get-uri/download/get-uri-3.0.2.tgz", + "integrity": "sha1-8O8TVvqrxw4flAT6O2ayupv8clw=", + "dev": true, + "requires": { + "@tootallnate/once": "1", + "data-uri-to-buffer": "3", + "debug": "4", + "file-uri-to-path": "2", + "fs-extra": "^8.1.0", + "ftp": "^0.3.10" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.nlark.com/fs-extra/download/fs-extra-8.1.0.tgz?cache=0&sync_timestamp=1620079845472&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ffs-extra%2Fdownload%2Ffs-extra-8.1.0.tgz", + "integrity": "sha1-SdQ8RaiM2Wd2aMt74bRu/bjS4cA=", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/jsonfile/download/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npm.taobao.org/universalify/download/universalify-0.1.2.tgz", + "integrity": "sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY=", + "dev": true + } + } + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npm.alibaba-inc.com/getpass/download/getpass-0.1.7.tgz", @@ -4078,6 +4519,30 @@ "integrity": "sha1-SekcXL82yblLz81xwj1SSex045A=", "dev": true }, + "http-errors": { + "version": "1.7.3", + "resolved": "https://registry.npm.taobao.org/http-errors/download/http-errors-1.7.3.tgz", + "integrity": "sha1-bGGeT5xgMIw4UZSYwU+7EKrOuwY=", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } + }, + "http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npm.taobao.org/http-proxy-agent/download/http-proxy-agent-4.0.1.tgz", + "integrity": "sha1-ioyO9/WTLM+VPClsqCkblap0qjo=", + "dev": true, + "requires": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + } + }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npm.alibaba-inc.com/http-signature/download/http-signature-1.2.0.tgz", @@ -4088,11 +4553,30 @@ "sshpk": "^1.7.0" } }, + "https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npm.taobao.org/https-proxy-agent/download/https-proxy-agent-5.0.0.tgz", + "integrity": "sha1-4qkFQqu2inYuCghQ9sntrf2FBrI=", + "dev": true, + "requires": { + "agent-base": "6", + "debug": "4" + } + }, "human-signals": { "version": "2.1.0", "resolved": "https://registry.npm.taobao.org/human-signals/download/human-signals-2.1.0.tgz", "integrity": "sha1-3JH8ukLk0G5Kuu0zs+ejwC9RTqA=" }, + "humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npm.taobao.org/humanize-ms/download/humanize-ms-1.2.1.tgz", + "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", + "dev": true, + "requires": { + "ms": "^2.0.0" + } + }, "husky": { "version": "6.0.0", "resolved": "https://registry.nlark.com/husky/download/husky-6.0.0.tgz?cache=0&sync_timestamp=1618846986927&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fhusky%2Fdownload%2Fhusky-6.0.0.tgz", @@ -4268,6 +4752,12 @@ "resolved": "https://registry.npm.taobao.org/interpret/download/interpret-1.4.0.tgz", "integrity": "sha1-Zlq4vE2iendKQFhOgS4+D6RbGh4=" }, + "ip": { + "version": "1.1.5", + "resolved": "https://registry.npm.taobao.org/ip/download/ip-1.1.5.tgz", + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", + "dev": true + }, "is-alphabetical": { "version": "1.0.4", "resolved": "https://registry.npm.taobao.org/is-alphabetical/download/is-alphabetical-1.0.4.tgz?cache=0&sync_timestamp=1615453703061&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-alphabetical%2Fdownload%2Fis-alphabetical-1.0.4.tgz", @@ -4326,6 +4816,12 @@ "ci-info": "^2.0.0" } }, + "is-class-hotfix": { + "version": "0.0.6", + "resolved": "https://registry.npm.taobao.org/is-class-hotfix/download/is-class-hotfix-0.0.6.tgz", + "integrity": "sha1-pSfTH7IyeSgd3l84XHe13nCnJDU=", + "dev": true + }, "is-core-module": { "version": "2.4.0", "resolved": "https://registry.nlark.com/is-core-module/download/is-core-module-2.4.0.tgz", @@ -4346,6 +4842,12 @@ "integrity": "sha1-ZaOllYocW2OnBuGzM9fNn2MNP6U=", "dev": true }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npm.taobao.org/is-extendable/download/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npm.taobao.org/is-extglob/download/is-extglob-2.1.1.tgz", @@ -4489,6 +4991,17 @@ "text-extensions": "^1.0.0" } }, + "is-type-of": { + "version": "1.2.1", + "resolved": "https://registry.npm.taobao.org/is-type-of/download/is-type-of-1.2.1.tgz", + "integrity": "sha1-4mPsOFes608oxHEw7HjbCakg+MU=", + "dev": true, + "requires": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz", @@ -4633,7 +5146,6 @@ "version": "4.1.0", "resolved": "https://registry.npm.taobao.org/js-yaml/download/js-yaml-4.1.0.tgz?cache=0&sync_timestamp=1618435004368&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjs-yaml%2Fdownload%2Fjs-yaml-4.1.0.tgz", "integrity": "sha1-wftl+PUBeQHN0slRhkuhhFihBgI=", - "dev": true, "requires": { "argparse": "^2.0.1" } @@ -4730,6 +5242,12 @@ } } }, + "jstoxml": { + "version": "0.2.4", + "resolved": "https://registry.npm.taobao.org/jstoxml/download/jstoxml-0.2.4.tgz?cache=0&sync_timestamp=1618720242181&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjstoxml%2Fdownload%2Fjstoxml-0.2.4.tgz", + "integrity": "sha1-/z+2eFaIOgMpU8fOjOdIYhD0hEc=", + "dev": true + }, "jsx-ast-utils": { "version": "2.4.1", "resolved": "https://registry.npm.taobao.org/jsx-ast-utils/download/jsx-ast-utils-2.4.1.tgz", @@ -4761,6 +5279,15 @@ "integrity": "sha1-FfvQu7g0R/POCdivJH7UfGjt6A0=", "dev": true }, + "ko-sleep": { + "version": "1.0.3", + "resolved": "https://registry.npm.taobao.org/ko-sleep/download/ko-sleep-1.0.3.tgz", + "integrity": "sha1-KKKgoUhei39BX/SI3uF9JHiKsII=", + "dev": true, + "requires": { + "ms": "^2.0.0" + } + }, "latest-version": { "version": "5.1.0", "resolved": "https://registry.npm.taobao.org/latest-version/download/latest-version-5.1.0.tgz", @@ -4773,8 +5300,7 @@ "lazy-val": { "version": "1.0.5", "resolved": "https://registry.nlark.com/lazy-val/download/lazy-val-1.0.5.tgz?cache=0&sync_timestamp=1620971308718&other_urls=https%3A%2F%2Fregistry.nlark.com%2Flazy-val%2Fdownload%2Flazy-val-1.0.5.tgz", - "integrity": "sha1-bPO59bwxzufuPjacCDK3WD3Nkj0=", - "dev": true + "integrity": "sha1-bPO59bwxzufuPjacCDK3WD3Nkj0=" }, "levn": { "version": "0.3.0", @@ -4852,6 +5378,16 @@ "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, + "lodash.escaperegexp": { + "version": "4.1.2", + "resolved": "https://registry.npm.taobao.org/lodash.escaperegexp/download/lodash.escaperegexp-4.1.2.tgz", + "integrity": "sha1-ZHYsSGGAglGKw99Mz11YhtriA0c=" + }, + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npm.taobao.org/lodash.isequal/download/lodash.isequal-4.5.0.tgz", + "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" + }, "lodash.truncate": { "version": "4.4.2", "resolved": "https://registry.npm.taobao.org/lodash.truncate/download/lodash.truncate-4.4.2.tgz", @@ -4893,7 +5429,6 @@ "version": "6.0.0", "resolved": "https://registry.npm.taobao.org/lru-cache/download/lru-cache-6.0.0.tgz", "integrity": "sha1-bW/mVw69lqr5D8rR2vo7JWbbOpQ=", - "dev": true, "requires": { "yallist": "^4.0.0" } @@ -4913,6 +5448,12 @@ } } }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npm.taobao.org/make-error/download/make-error-1.3.6.tgz", + "integrity": "sha1-LrLjfqm2fEiR9oShOUeZr0hM96I=", + "dev": true + }, "map-obj": { "version": "4.2.1", "resolved": "https://registry.npm.taobao.org/map-obj/download/map-obj-4.2.1.tgz", @@ -4996,6 +5537,12 @@ "yargs-parser": "^20.2.3" } }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/merge-descriptors/download/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true + }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npm.taobao.org/merge-stream/download/merge-stream-2.0.0.tgz", @@ -5120,8 +5667,7 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&sync_timestamp=1607433905701&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz", - "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=", - "dev": true + "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=" }, "mute-stream": { "version": "0.0.8", @@ -5129,12 +5675,42 @@ "integrity": "sha1-FjDEKyJR/4HiooPelqVJfqkuXg0=", "dev": true }, + "mz": { + "version": "2.7.0", + "resolved": "https://registry.npm.taobao.org/mz/download/mz-2.7.0.tgz", + "integrity": "sha1-lQCAV6Vsr63CvGPd5/n/aVWUjjI=", + "dev": true, + "requires": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "mz-modules": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/mz-modules/download/mz-modules-2.1.0.tgz", + "integrity": "sha1-f1KYd6/Q1C9AmnRjuWmG1hz7z5Y=", + "dev": true, + "requires": { + "glob": "^7.1.2", + "ko-sleep": "^1.0.3", + "mkdirp": "^0.5.1", + "pump": "^3.0.0", + "rimraf": "^2.6.1" + } + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npm.taobao.org/natural-compare/download/natural-compare-1.4.0.tgz", "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "netmask": { + "version": "2.0.2", + "resolved": "https://registry.npm.taobao.org/netmask/download/netmask-2.0.2.tgz?cache=0&sync_timestamp=1617387791479&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnetmask%2Fdownload%2Fnetmask-2.0.2.tgz", + "integrity": "sha1-iwGgdkQGXVNjg4NYI7xSAE66xec=", + "dev": true + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npm.taobao.org/nice-try/download/nice-try-1.0.5.tgz", @@ -5340,12 +5916,31 @@ "word-wrap": "~1.2.3" } }, + "os-name": { + "version": "1.0.3", + "resolved": "https://registry.npm.taobao.org/os-name/download/os-name-1.0.3.tgz", + "integrity": "sha1-GzefZINa98Wn9JizV8uVIVwVnt8=", + "dev": true, + "requires": { + "osx-release": "^1.0.0", + "win-release": "^1.0.0" + } + }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npm.taobao.org/os-tmpdir/download/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, + "osx-release": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/osx-release/download/osx-release-1.1.0.tgz", + "integrity": "sha1-8heRGigTaUmvG/kwiyQeJzfTzWw=", + "dev": true, + "requires": { + "minimist": "^1.1.0" + } + }, "p-cancelable": { "version": "1.1.0", "resolved": "https://registry.nlark.com/p-cancelable/download/p-cancelable-1.1.0.tgz", @@ -5376,6 +5971,34 @@ "integrity": "sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=", "dev": true }, + "pac-proxy-agent": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/pac-proxy-agent/download/pac-proxy-agent-4.1.0.tgz", + "integrity": "sha1-Zog+6rrckV/F6VRXMkyw8Kx43vs=", + "dev": true, + "requires": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4", + "get-uri": "3", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "5", + "pac-resolver": "^4.1.0", + "raw-body": "^2.2.0", + "socks-proxy-agent": "5" + } + }, + "pac-resolver": { + "version": "4.2.0", + "resolved": "https://registry.npm.taobao.org/pac-resolver/download/pac-resolver-4.2.0.tgz", + "integrity": "sha1-uCvLmZLUgWaSC8g8dUKrtFS9m90=", + "dev": true, + "requires": { + "degenerator": "^2.2.0", + "ip": "^1.1.5", + "netmask": "^2.0.1" + } + }, "package-json": { "version": "6.5.0", "resolved": "https://registry.npm.taobao.org/package-json/download/package-json-6.5.0.tgz", @@ -5472,6 +6095,15 @@ "resolved": "https://registry.npm.taobao.org/path-type/download/path-type-4.0.0.tgz?cache=0&sync_timestamp=1611752015315&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpath-type%2Fdownload%2Fpath-type-4.0.0.tgz", "integrity": "sha1-hO0BwKe6OAr+CdkKjBgNzZ0DBDs=" }, + "pause-stream": { + "version": "0.0.11", + "resolved": "https://registry.npm.taobao.org/pause-stream/download/pause-stream-0.0.11.tgz", + "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "dev": true, + "requires": { + "through": "~2.3" + } + }, "pend": { "version": "1.2.0", "resolved": "https://registry.npm.taobao.org/pend/download/pend-1.2.0.tgz", @@ -5625,6 +6257,12 @@ } } }, + "platform": { + "version": "1.3.6", + "resolved": "https://registry.npm.taobao.org/platform/download/platform-1.3.6.tgz", + "integrity": "sha1-SLTOmDFksgnC1FoQetsx9HOm56c=", + "dev": true + }, "plist": { "version": "3.0.2", "resolved": "https://registry.npm.taobao.org/plist/download/plist-3.0.2.tgz?cache=0&sync_timestamp=1616733409780&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fplist%2Fdownload%2Fplist-3.0.2.tgz", @@ -5854,6 +6492,45 @@ "dev": true, "optional": true }, + "proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npm.taobao.org/proxy-agent/download/proxy-agent-4.0.1.tgz", + "integrity": "sha1-MmwyUHdscETNGWVcy/rfLgZaBFw=", + "dev": true, + "requires": { + "agent-base": "^6.0.0", + "debug": "4", + "http-proxy-agent": "^4.0.0", + "https-proxy-agent": "^5.0.0", + "lru-cache": "^5.1.1", + "pac-proxy-agent": "^4.1.0", + "proxy-from-env": "^1.0.0", + "socks-proxy-agent": "^5.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npm.taobao.org/lru-cache/download/lru-cache-5.1.1.tgz", + "integrity": "sha1-HaJ+ZxAnGUdpXa9oSOhH8B2EuSA=", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npm.taobao.org/yallist/download/yallist-3.1.1.tgz", + "integrity": "sha1-27fa+b/YusmrRev2ArjLrQ1dCP0=", + "dev": true + } + } + }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/proxy-from-env/download/proxy-from-env-1.1.0.tgz", + "integrity": "sha1-4QLxbKNVQkhldV0sno6k8k1Yw+I=", + "dev": true + }, "psl": { "version": "1.8.0", "resolved": "https://registry.npm.alibaba-inc.com/psl/download/psl-1.8.0.tgz", @@ -5905,6 +6582,29 @@ "integrity": "sha1-W4h48ROlgheEjGSCAmxz4bpXcn8=", "dev": true }, + "raw-body": { + "version": "2.4.1", + "resolved": "https://registry.npm.taobao.org/raw-body/download/raw-body-2.4.1.tgz", + "integrity": "sha1-MKyC+Yu1rowVLmcUnayNVRU7Fow=", + "dev": true, + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.3", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "dependencies": { + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.nlark.com/iconv-lite/download/iconv-lite-0.4.24.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ficonv-lite%2Fdownload%2Ficonv-lite-0.4.24.tgz", + "integrity": "sha1-ICK0sl+93CHS9SSXSkdKr+czkIs=", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + } + } + }, "rc": { "version": "1.2.8", "resolved": "https://registry.npm.taobao.org/rc/download/rc-1.2.8.tgz", @@ -6375,8 +7075,16 @@ "sax": { "version": "1.2.4", "resolved": "https://registry.npm.taobao.org/sax/download/sax-1.2.4.tgz", - "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=", - "dev": true + "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=" + }, + "sdk-base": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/sdk-base/download/sdk-base-2.0.1.tgz", + "integrity": "sha1-ukAonovfJy7RHdnql+r5jgNtJMY=", + "dev": true, + "requires": { + "get-ready": "~1.0.0" + } }, "seek-bzip": { "version": "1.0.6", @@ -6390,7 +7098,6 @@ "version": "7.3.5", "resolved": "https://registry.npm.taobao.org/semver/download/semver-7.3.5.tgz?cache=0&sync_timestamp=1616463603361&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-7.3.5.tgz", "integrity": "sha1-C2Ich5NI2JmOSw5L6Us/EuYBjvc=", - "dev": true, "requires": { "lru-cache": "^6.0.0" } @@ -6444,6 +7151,12 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/setprototypeof/download/setprototypeof-1.1.1.tgz", + "integrity": "sha1-fpWsskqpL1iF4KvvW6ExMw1K5oM=", + "dev": true + }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npm.taobao.org/shebang-command/download/shebang-command-2.0.0.tgz", @@ -6511,8 +7224,28 @@ "version": "4.1.0", "resolved": "https://registry.npm.taobao.org/smart-buffer/download/smart-buffer-4.1.0.tgz", "integrity": "sha1-kWBcJdkWUvRmHqacz0XxszHKIbo=", + "dev": true + }, + "socks": { + "version": "2.6.1", + "resolved": "https://registry.npm.taobao.org/socks/download/socks-2.6.1.tgz?cache=0&sync_timestamp=1618719357511&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsocks%2Fdownload%2Fsocks-2.6.1.tgz", + "integrity": "sha1-mJ5lNKB88zfesbHJSqpEKWUg0w4=", "dev": true, - "optional": true + "requires": { + "ip": "^1.1.5", + "smart-buffer": "^4.1.0" + } + }, + "socks-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npm.taobao.org/socks-proxy-agent/download/socks-proxy-agent-5.0.0.tgz", + "integrity": "sha1-fA82Tnsc9KekN+cSU77XLpAEvmA=", + "dev": true, + "requires": { + "agent-base": "6", + "debug": "4", + "socks": "^2.3.3" + } }, "source-map": { "version": "0.5.7", @@ -6633,11 +7366,36 @@ "integrity": "sha1-aLVcth6mOf9XE282shaikYANFGU=", "dev": true }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npm.taobao.org/statuses/download/statuses-1.5.0.tgz?cache=0&sync_timestamp=1609653993999&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstatuses%2Fdownload%2Fstatuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true + }, "stealthy-require": { "version": "1.1.1", "resolved": "https://registry.npm.alibaba-inc.com/stealthy-require/download/stealthy-require-1.1.1.tgz", "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" }, + "stream-http": { + "version": "2.8.2", + "resolved": "https://registry.npm.taobao.org/stream-http/download/stream-http-2.8.2.tgz?cache=0&sync_timestamp=1618430770209&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstream-http%2Fdownload%2Fstream-http-2.8.2.tgz", + "integrity": "sha1-QSboxrEHAERlkYqi/DVUnndALIc=", + "dev": true, + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "stream-wormhole": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/stream-wormhole/download/stream-wormhole-1.1.0.tgz", + "integrity": "sha1-MAr/Rs7VU8/sZCoFJRiFQXaTwz0=", + "dev": true + }, "string-width": { "version": "4.2.2", "resolved": "https://registry.npm.taobao.org/string-width/download/string-width-4.2.2.tgz?cache=0&sync_timestamp=1618558823901&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstring-width%2Fdownload%2Fstring-width-4.2.2.tgz", @@ -7140,6 +7898,24 @@ "integrity": "sha1-uQgSC1wb1LueukFCPXWxdgEatoo=", "dev": true }, + "thenify": { + "version": "3.3.1", + "resolved": "https://registry.npm.taobao.org/thenify/download/thenify-3.3.1.tgz", + "integrity": "sha1-iTLmhqQGYDigFt2eLKRq3Zg4qV8=", + "dev": true, + "requires": { + "any-promise": "^1.0.0" + } + }, + "thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npm.taobao.org/thenify-all/download/thenify-all-1.6.0.tgz", + "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", + "dev": true, + "requires": { + "thenify": ">= 3.1.0 < 4" + } + }, "throttleit": { "version": "1.0.0", "resolved": "https://registry.npm.alibaba-inc.com/throttleit/download/throttleit-1.0.0.tgz", @@ -7181,6 +7957,12 @@ "os-tmpdir": "~1.0.2" } }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/to-arraybuffer/download/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, "to-buffer": { "version": "1.1.1", "resolved": "https://registry.npm.taobao.org/to-buffer/download/to-buffer-1.1.1.tgz", @@ -7206,6 +7988,12 @@ "is-number": "^7.0.0" } }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/toidentifier/download/toidentifier-1.0.0.tgz", + "integrity": "sha1-fhvjRw8ed5SLxD2Uo8j013UrpVM=", + "dev": true + }, "tough-cookie": { "version": "2.5.0", "resolved": "https://registry.npm.alibaba-inc.com/tough-cookie/download/tough-cookie-2.5.0.tgz", @@ -7248,6 +8036,24 @@ "utf8-byte-length": "^1.0.1" } }, + "ts-node": { + "version": "10.0.0", + "resolved": "https://registry.nlark.com/ts-node/download/ts-node-10.0.0.tgz?cache=0&sync_timestamp=1621798304685&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fts-node%2Fdownload%2Fts-node-10.0.0.tgz", + "integrity": "sha1-BfELmnFrC2JBKa1E8OoF2shLo74=", + "dev": true, + "requires": { + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + } + }, "tsconfig-paths": { "version": "3.9.0", "resolved": "https://registry.npm.taobao.org/tsconfig-paths/download/tsconfig-paths-3.9.0.tgz", @@ -7359,6 +8165,15 @@ "through": "^2.3.8" } }, + "unescape": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/unescape/download/unescape-1.0.1.tgz", + "integrity": "sha1-lW5DD2HK2KTVfYLFGPXmzF0N2pY=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1" + } + }, "unified": { "version": "9.2.1", "resolved": "https://registry.npm.taobao.org/unified/download/unified-9.2.1.tgz?cache=0&sync_timestamp=1614242747826&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Funified%2Fdownload%2Funified-9.2.1.tgz", @@ -7419,6 +8234,12 @@ "resolved": "https://registry.npm.taobao.org/universalify/download/universalify-2.0.0.tgz", "integrity": "sha1-daSYTv7cSwiXXFrrc/Uw0C3yVxc=" }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/unpipe/download/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, "update-notifier": { "version": "5.1.0", "resolved": "https://registry.npm.taobao.org/update-notifier/download/update-notifier-5.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fupdate-notifier%2Fdownload%2Fupdate-notifier-5.1.0.tgz", @@ -7463,6 +8284,55 @@ "prepend-http": "^2.0.0" } }, + "urllib": { + "version": "2.37.1", + "resolved": "https://registry.nlark.com/urllib/download/urllib-2.37.1.tgz", + "integrity": "sha1-EBa4iqsysnBIpNUtNiA3ccY+Ow8=", + "dev": true, + "requires": { + "any-promise": "^1.3.0", + "content-type": "^1.0.2", + "debug": "^2.6.9", + "default-user-agent": "^1.0.0", + "digest-header": "^0.0.1", + "ee-first": "~1.1.1", + "formstream": "^1.1.0", + "humanize-ms": "^1.2.0", + "iconv-lite": "^0.4.15", + "ip": "^1.1.5", + "proxy-agent": "^4.0.1", + "pump": "^3.0.0", + "qs": "^6.4.0", + "statuses": "^1.3.1", + "utility": "^1.16.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz?cache=0&sync_timestamp=1607566580543&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-2.6.9.tgz", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.nlark.com/iconv-lite/download/iconv-lite-0.4.24.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ficonv-lite%2Fdownload%2Ficonv-lite-0.4.24.tgz", + "integrity": "sha1-ICK0sl+93CHS9SSXSkdKr+czkIs=", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz?cache=0&sync_timestamp=1607433905701&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, "utf8-byte-length": { "version": "1.0.4", "resolved": "https://registry.npm.taobao.org/utf8-byte-length/download/utf8-byte-length-1.0.4.tgz", @@ -7474,6 +8344,19 @@ "resolved": "https://registry.npm.taobao.org/util-deprecate/download/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, + "utility": { + "version": "1.17.0", + "resolved": "https://registry.npm.taobao.org/utility/download/utility-1.17.0.tgz?cache=0&sync_timestamp=1608037972811&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Futility%2Fdownload%2Futility-1.17.0.tgz", + "integrity": "sha1-YIGfcSpuDOd09S+x1pGZKl9Z02I=", + "dev": true, + "requires": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + } + }, "uuid": { "version": "3.4.0", "resolved": "https://registry.npm.alibaba-inc.com/uuid/download/uuid-3.4.0.tgz", @@ -7613,6 +8496,23 @@ "string-width": "^4.0.0" } }, + "win-release": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/win-release/download/win-release-1.1.1.tgz", + "integrity": "sha1-X6VeAr58qTTt/BJmVjLoSbcuUgk=", + "dev": true, + "requires": { + "semver": "^5.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz?cache=0&sync_timestamp=1616463603361&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-5.7.1.tgz", + "integrity": "sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=", + "dev": true + } + } + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npm.taobao.org/word-wrap/download/word-wrap-1.2.3.tgz", @@ -7662,6 +8562,24 @@ "integrity": "sha1-S8jZmEQDaWIl74OhVzy7y0552xM=", "dev": true }, + "xml2js": { + "version": "0.4.23", + "resolved": "https://registry.npm.taobao.org/xml2js/download/xml2js-0.4.23.tgz", + "integrity": "sha1-oMaVFnUkIesqx1juTUzPWIQ+rGY=", + "dev": true, + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "dependencies": { + "xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npm.taobao.org/xmlbuilder/download/xmlbuilder-11.0.1.tgz", + "integrity": "sha1-vpuuHIoEbnazESdyY0fQrXACvrM=", + "dev": true + } + } + }, "xmlbuilder": { "version": "15.1.1", "resolved": "https://registry.npm.taobao.org/xmlbuilder/download/xmlbuilder-15.1.1.tgz", @@ -7674,6 +8592,12 @@ "resolved": "https://registry.npm.taobao.org/xmldom/download/xmldom-0.6.0.tgz?cache=0&sync_timestamp=1618680237797&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fxmldom%2Fdownload%2Fxmldom-0.6.0.tgz", "integrity": "sha1-Q6luy4vuzpkc7zgsCDl9gtTQxG8=" }, + "xregexp": { + "version": "2.0.0", + "resolved": "https://registry.nlark.com/xregexp/download/xregexp-2.0.0.tgz", + "integrity": "sha1-UqY+VsoLhKfzpfPWGHLxJq16WUM=", + "dev": true + }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npm.taobao.org/xtend/download/xtend-4.0.2.tgz", @@ -7688,8 +8612,7 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npm.taobao.org/yallist/download/yallist-4.0.0.tgz", - "integrity": "sha1-m7knkNnA7/7GO+c1GeEaNQGaOnI=", - "dev": true + "integrity": "sha1-m7knkNnA7/7GO+c1GeEaNQGaOnI=" }, "yaml": { "version": "1.10.2", @@ -7727,6 +8650,12 @@ "fd-slicer": "~1.1.0" } }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npm.taobao.org/yn/download/yn-3.1.1.tgz", + "integrity": "sha1-HodAGgnXZ8HV6rJqbkwYUYLS61A=", + "dev": true + }, "yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npm.taobao.org/yocto-queue/download/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index 3c5a676..1dc5a14 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,9 @@ "build": "rm -rf ./dist && npm run build:renderer && npm run build:main", "build:renderer": "cd ./renderer && npm run build", "build:main": "tsc --build ./main/tsconfig.json", - "package": "rm -rf release && npm run build && npm run copy:static && NPM_CONFIG_ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ electron-builder build --mac", + "build:app": "NPM_CONFIG_ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ electron-builder build", + "package": "rm -rf release && npm run build && npm run copy:static && npm run build:app && npm run upload:app", + "upload:app": "ts-node ./scripts/uploadApp", "lint": "npm run eslint && npm run stylelint", "eslint": "eslint --ext .ts,.tsx,.js,.jsx ./", "eslint:fix": "npm run eslint -- --fix", @@ -30,6 +32,12 @@ "dist/**/*", "package.json" ], + "publish": [ + { + "provider": "generic", + "url": "https://iceworks.oss-cn-hangzhou.aliyuncs.com/toolkit/${os}" + } + ], "asar": false, "directories": { "buildResources": "resource", @@ -71,6 +79,7 @@ "decompress": "^4.2.1", "electron-is-dev": "^2.0.0", "electron-log": "^4.3.4", + "electron-updater": "^4.3.9", "execa": "^5.0.0", "fs-extra": "^9.1.0", "globby": "^11.0.3", @@ -88,12 +97,14 @@ "@types/decompress": "^4.2.3", "@types/node-fetch": "^2.5.10", "@types/shelljs": "^0.8.8", + "ali-oss": "^6.15.2", "concurrently": "^5.1.0", "electron": "^12.0.0", "electron-builder": "^22.10.5", "eslint": "^6.8.0", "husky": "^6.0.0", "stylelint": "^13.2.0", + "ts-node": "^10.0.0", "typescript": "^4.0.0", "wait-on": "^5.3.0" } diff --git a/scripts/uploadApp.ts b/scripts/uploadApp.ts new file mode 100644 index 0000000..6b7a42e --- /dev/null +++ b/scripts/uploadApp.ts @@ -0,0 +1,39 @@ +import * as path from 'path'; +import uploadToOSS from './uploadToOSS'; +const packageJSON = require('../package.json'); + +const isMac = process.platform === 'darwin'; + +const { build: { productName }, version } = packageJSON; + +(async function () { + const channel = 'latest'; + + let channelExt = ''; + let OSSObjectDir = 'toolkit'; + // e.g: AppWorks Toolkit-0.1.0 + let distFileName = ''; + // e.g: .dmg .exe + let distFileExt = ''; + // e.g.: mac win + let platform = ''; + if (isMac) { + channelExt = '-mac.yml'; + platform = 'mac'; + OSSObjectDir = `${OSSObjectDir}/${platform}`; + distFileName = `${productName}-${version}`; + distFileExt = '.dmg'; + } + const buildResourcesDir = path.join(__dirname, '..', 'release'); + // upload app resource + // 软件内获取的版本最新版本信息,用于升级软件 e.g: latest-mac.yml + const channelFile = `${channel}${channelExt}`; + // 软件安装包 e.g: AppWorks Toolkit-0.1.0.dmg + const packageFile = `${distFileName}${distFileExt}`; + // 软件压缩包 e.g: AppWorks Toolkit-0.1.0-mac.zip + const packageZipFile = `${distFileName}-${platform}.zip`; + + Promise.all([ + [channelFile, packageFile, packageZipFile].map((file: string) => uploadToOSS(`${OSSObjectDir}/${file}`, path.join(buildResourcesDir, file))), + ]); +})(); diff --git a/scripts/uploadToOSS.ts b/scripts/uploadToOSS.ts new file mode 100644 index 0000000..f5e3fb4 --- /dev/null +++ b/scripts/uploadToOSS.ts @@ -0,0 +1,27 @@ +import * as oss from 'ali-oss'; + +const ossClient = oss({ + bucket: 'iceworks', + endpoint: 'oss-cn-hangzhou.aliyuncs.com', + accessKeyId: process.env.ACCESS_KEY_ID, + accessKeySecret: process.env.ACCESS_KEY_SECRET, + timeout: '300s', +}); + +function uploadToOSS(target: string, filePath: string) { + return new Promise((resolve, reject) => { + console.log(`[UPLOAD] start to upload ${filePath}.`); + ossClient + .put(target, filePath) + .then(() => { + console.log(`[UPLOAD] ${filePath} upload success.`); + resolve(0); + }) + .catch((e: Error) => { + console.log(`[ERROR] ${filePath} upload failed.`); + reject(e.message); + }); + }); +} + +export default uploadToOSS;