diff --git a/packages/wxa-cli/package-lock.json b/packages/wxa-cli/package-lock.json index ccc6f3ec..ef86dc69 100644 --- a/packages/wxa-cli/package-lock.json +++ b/packages/wxa-cli/package-lock.json @@ -1738,9 +1738,9 @@ } }, "@wxa/compiler-babel": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@wxa/compiler-babel/-/compiler-babel-2.2.0.tgz", - "integrity": "sha512-kjQL/T0vLdulAoaCVzlmAE3UbtC1e/c6JVmf/OL9hi7oDspAhlyHSySOH9JhTGYzOKPYbJpBrO1EoMMsnLWRMA==", + "version": "2.2.7", + "resolved": "https://registry.npm.taobao.org/@wxa/compiler-babel/download/@wxa/compiler-babel-2.2.7.tgz", + "integrity": "sha1-AydEuIAI8egJUNztqnDHmOEIXrA=", "requires": { "@babel/core": "^7.1.0", "debug": "^4.0.1", @@ -1750,17 +1750,17 @@ }, "dependencies": { "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "4.3.1", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-4.3.1.tgz?cache=0&sync_timestamp=1607566533140&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.3.1.tgz", + "integrity": "sha1-8NIpxQXgxtjEmsVT0bE9wYP2su4=", "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" } }, "find-cache-dir": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "resolved": "https://registry.npm.taobao.org/find-cache-dir/download/find-cache-dir-2.1.0.tgz", + "integrity": "sha1-jQ+UzRP+Q8bHwmGg2GEVypGMBfc=", "requires": { "commondir": "^1.0.1", "make-dir": "^2.0.0", @@ -1770,11 +1770,11 @@ } }, "@wxa/compiler-sass": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@wxa/compiler-sass/-/compiler-sass-2.2.0.tgz", - "integrity": "sha512-te92dBDbVQDMaqaTopmK9pIx8W2WWg3bESVv4T71WS4UHLzy3boqnjICS5w4ZfCHpeL4imvMiAVZe37tHcT3Jw==", + "version": "2.2.7", + "resolved": "https://registry.nlark.com/@wxa/compiler-sass/download/@wxa/compiler-sass-2.2.7.tgz", + "integrity": "sha1-gGe1vzRPRFW0Yg95snOOqAePa1E=", "requires": { - "node-sass": "^4.12.0" + "node-sass": "^4.14.1" } }, "@xtuc/ieee754": { @@ -1791,8 +1791,8 @@ }, "abbrev": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + "resolved": "https://registry.npm.taobao.org/abbrev/download/abbrev-1.1.1.tgz", + "integrity": "sha1-+PLIh60Qv2f2NPAFtph/7TF5qsg=" }, "acorn": { "version": "5.7.4", @@ -1842,7 +1842,7 @@ }, "amdefine": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/amdefine/download/amdefine-1.0.1.tgz", "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" }, "ansi-escapes": { @@ -1879,8 +1879,8 @@ }, "are-we-there-yet": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "resolved": "https://registry.npm.taobao.org/are-we-there-yet/download/are-we-there-yet-1.1.5.tgz", + "integrity": "sha1-SzXClE8GKov82mZBB2A1D+nd/CE=", "requires": { "delegates": "^1.0.0", "readable-stream": "^2.0.6" @@ -1912,7 +1912,7 @@ }, "array-find-index": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/array-find-index/download/array-find-index-1.0.2.tgz", "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=" }, "array-union": { @@ -1940,8 +1940,8 @@ }, "asn1": { "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "resolved": "https://registry.npm.taobao.org/asn1/download/asn1-0.2.4.tgz", + "integrity": "sha1-jSR136tVO7M+d7VOWeiAu4ziMTY=", "requires": { "safer-buffer": "~2.1.0" } @@ -1995,7 +1995,7 @@ }, "assert-plus": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, "assign-symbols": { @@ -2012,12 +2012,12 @@ }, "async-foreach": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", + "resolved": "https://registry.npm.taobao.org/async-foreach/download/async-foreach-0.1.3.tgz", "integrity": "sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI=" }, "asynckit": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "resolved": "https://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "atob": { @@ -2027,13 +2027,13 @@ }, "aws-sign2": { "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "resolved": "https://registry.npm.taobao.org/aws-sign2/download/aws-sign2-0.7.0.tgz", "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" }, "aws4": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", - "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==" + "version": "1.11.0", + "resolved": "https://registry.npm.taobao.org/aws4/download/aws4-1.11.0.tgz?cache=0&sync_timestamp=1604101166484&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Faws4%2Fdownload%2Faws4-1.11.0.tgz", + "integrity": "sha1-1h9G2DslGSUOJ4Ta9bCUeai0HFk=" }, "babel-code-frame": { "version": "6.26.0", @@ -2164,7 +2164,7 @@ }, "bcrypt-pbkdf": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/bcrypt-pbkdf/download/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "requires": { "tweetnacl": "^0.14.3" @@ -2193,7 +2193,7 @@ }, "block-stream": { "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "resolved": "https://registry.npm.taobao.org/block-stream/download/block-stream-0.0.9.tgz", "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", "requires": { "inherits": "~2.0.0" @@ -2452,12 +2452,12 @@ }, "camelcase": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "resolved": "https://registry.npm.taobao.org/camelcase/download/camelcase-2.1.1.tgz?cache=0&sync_timestamp=1603923709404&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcamelcase%2Fdownload%2Fcamelcase-2.1.1.tgz", "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" }, "camelcase-keys": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/camelcase-keys/download/camelcase-keys-2.1.0.tgz", "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", "requires": { "camelcase": "^2.0.0", @@ -2471,7 +2471,7 @@ }, "caseless": { "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "resolved": "https://registry.npm.taobao.org/caseless/download/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" }, "chalk": { @@ -2617,7 +2617,7 @@ }, "code-point-at": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/code-point-at/download/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, "collection-visit": { @@ -2644,8 +2644,8 @@ }, "combined-stream": { "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "resolved": "https://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.8.tgz", + "integrity": "sha1-w9RaizT9cwYxoRCoolIGgrMdWn8=", "requires": { "delayed-stream": "~1.0.0" } @@ -2690,7 +2690,7 @@ }, "console-control-strings": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/console-control-strings/download/console-control-strings-1.1.0.tgz", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" }, "constants-browserify": { @@ -2799,7 +2799,7 @@ }, "cross-spawn": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-3.0.1.tgz", "integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=", "requires": { "lru-cache": "^4.0.1", @@ -2827,7 +2827,7 @@ }, "currently-unhandled": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "resolved": "https://registry.npm.taobao.org/currently-unhandled/download/currently-unhandled-0.4.1.tgz", "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", "requires": { "array-find-index": "^1.0.1" @@ -2841,7 +2841,7 @@ }, "dashdash": { "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "resolved": "https://registry.npm.taobao.org/dashdash/download/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "requires": { "assert-plus": "^1.0.0" @@ -2923,12 +2923,12 @@ }, "delayed-stream": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, "delegates": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/delegates/download/delegates-1.0.0.tgz", "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" }, "des.js": { @@ -3050,7 +3050,7 @@ }, "ecc-jsbn": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "resolved": "https://registry.npm.taobao.org/ecc-jsbn/download/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "requires": { "jsbn": "~0.1.0", @@ -3144,8 +3144,8 @@ }, "error-ex": { "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "resolved": "https://registry.npm.taobao.org/error-ex/download/error-ex-1.3.2.tgz", + "integrity": "sha1-tKxAZIEH/c3PriQvQovqihTU8b8=", "requires": { "is-arrayish": "^0.2.1" } @@ -3496,8 +3496,8 @@ }, "extend": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "resolved": "https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz", + "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=" }, "extend-shallow": { "version": "3.0.2", @@ -3589,7 +3589,7 @@ }, "extsprintf": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "resolved": "https://registry.npm.taobao.org/extsprintf/download/extsprintf-1.3.0.tgz", "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" }, "fast-deep-equal": { @@ -3817,13 +3817,13 @@ }, "forever-agent": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "resolved": "https://registry.npm.taobao.org/forever-agent/download/forever-agent-0.6.1.tgz", "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" }, "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==", + "resolved": "https://registry.npm.taobao.org/form-data/download/form-data-2.3.3.tgz", + "integrity": "sha1-3M5SwF9kTymManq5Nr1yTO/786Y=", "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -3879,8 +3879,8 @@ }, "fstream": { "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", - "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", + "resolved": "https://registry.npm.taobao.org/fstream/download/fstream-1.0.12.tgz", + "integrity": "sha1-Touo7i1Ivk99DeUFRVVI6uWTIEU=", "requires": { "graceful-fs": "^4.1.2", "inherits": "~2.0.0", @@ -3901,7 +3901,7 @@ }, "gauge": { "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "resolved": "https://registry.npm.taobao.org/gauge/download/gauge-2.7.4.tgz", "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "requires": { "aproba": "^1.0.3", @@ -3916,8 +3916,8 @@ }, "gaze": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", - "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", + "resolved": "https://registry.npm.taobao.org/gaze/download/gaze-1.1.3.tgz", + "integrity": "sha1-xEFzPhO5J6yMD/C0w7Az8ogSkko=", "requires": { "globule": "^1.0.0" } @@ -3934,7 +3934,7 @@ }, "get-stdin": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "resolved": "https://registry.nlark.com/get-stdin/download/get-stdin-4.0.1.tgz", "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=" }, "get-value": { @@ -3944,7 +3944,7 @@ }, "getpass": { "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "resolved": "https://registry.npm.taobao.org/getpass/download/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "requires": { "assert-plus": "^1.0.0" @@ -4039,8 +4039,8 @@ }, "globule": { "version": "1.3.2", - "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.2.tgz", - "integrity": "sha512-7IDTQTIu2xzXkT+6mlluidnWo+BypnbSoEVVQCGfzqnl5Ik8d3e1d4wycb8Rj9tWW+Z39uPWsdlquqiqPCd/pA==", + "resolved": "https://registry.npm.taobao.org/globule/download/globule-1.3.2.tgz", + "integrity": "sha1-2L3Z6eTu+PluJFmZpd7n612FKcQ=", "requires": { "glob": "~7.1.1", "lodash": "~4.17.10", @@ -4059,13 +4059,13 @@ }, "har-schema": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/har-schema/download/har-schema-2.0.0.tgz", "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" }, "har-validator": { "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "resolved": "https://registry.npm.taobao.org/har-validator/download/har-validator-5.1.5.tgz", + "integrity": "sha1-HwgDufjLIMD6E4It8ezds2veHv0=", "requires": { "ajv": "^6.12.3", "har-schema": "^2.0.0" @@ -4099,7 +4099,7 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/has-unicode/download/has-unicode-2.0.1.tgz", "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" }, "has-value": { @@ -4210,9 +4210,9 @@ } }, "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==" + "version": "2.8.9", + "resolved": "https://registry.npm.taobao.org/hosted-git-info/download/hosted-git-info-2.8.9.tgz", + "integrity": "sha1-3/wL+aIcAiCQkPKqaUKeFBTa8/k=" }, "htmlparser2": { "version": "3.10.1", @@ -4241,7 +4241,7 @@ }, "http-signature": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "resolved": "https://registry.npm.taobao.org/http-signature/download/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "requires": { "assert-plus": "^1.0.0", @@ -4298,12 +4298,12 @@ }, "in-publish": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.1.tgz", - "integrity": "sha512-oDM0kUSNFC31ShNxHKUyfZKy8ZeXZBWMjMdZHKLOk13uvT27VTL/QzRGfRUcevJhpkZAvlhPYuXkF7eNWrtyxQ==" + "resolved": "https://registry.npm.taobao.org/in-publish/download/in-publish-2.0.1.tgz", + "integrity": "sha1-lIsaU1yAMFYc6lIvc/ePS+NX4Aw=" }, "indent-string": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/indent-string/download/indent-string-2.1.0.tgz?cache=0&sync_timestamp=1618679442183&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Findent-string%2Fdownload%2Findent-string-2.1.0.tgz", "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", "requires": { "repeating": "^2.0.0" @@ -4434,7 +4434,7 @@ }, "is-arrayish": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "resolved": "https://registry.npm.taobao.org/is-arrayish/download/is-arrayish-0.2.1.tgz", "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" }, "is-binary-path": { @@ -4507,12 +4507,12 @@ }, "is-finite": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", - "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==" + "resolved": "https://registry.nlark.com/is-finite/download/is-finite-1.1.0.tgz", + "integrity": "sha1-kEE1x3+0LAZB1qobzbxNqo2ggvM=" }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-1.0.0.tgz?cache=0&sync_timestamp=1618552489864&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-fullwidth-code-point%2Fdownload%2Fis-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "requires": { "number-is-nan": "^1.0.0" @@ -4563,12 +4563,12 @@ }, "is-typedarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, "is-utf8": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "resolved": "https://registry.npm.taobao.org/is-utf8/download/is-utf8-0.2.1.tgz", "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" }, "is-windows": { @@ -4598,7 +4598,7 @@ }, "isstream": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "resolved": "https://registry.npm.taobao.org/isstream/download/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, "js-base64": { @@ -4623,7 +4623,7 @@ }, "jsbn": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "resolved": "https://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" }, "jsesc": { @@ -4639,7 +4639,7 @@ }, "json-schema": { "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "resolved": "https://registry.npm.taobao.org/json-schema/download/json-schema-0.2.3.tgz?cache=0&sync_timestamp=1609553637722&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjson-schema%2Fdownload%2Fjson-schema-0.2.3.tgz", "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" }, "json-schema-traverse": { @@ -4655,7 +4655,7 @@ }, "json-stringify-safe": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/json-stringify-safe/download/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "json5": { @@ -4668,7 +4668,7 @@ }, "jsprim": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "resolved": "https://registry.npm.taobao.org/jsprim/download/jsprim-1.4.1.tgz", "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", "requires": { "assert-plus": "1.0.0", @@ -4707,7 +4707,7 @@ }, "load-json-file": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/load-json-file/download/load-json-file-1.1.0.tgz", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "requires": { "graceful-fs": "^4.1.2", @@ -4719,7 +4719,7 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npm.taobao.org/pify/download/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" } } @@ -4776,7 +4776,7 @@ }, "loud-rejection": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "resolved": "https://registry.npm.taobao.org/loud-rejection/download/loud-rejection-1.6.0.tgz", "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", "requires": { "currently-unhandled": "^0.4.1", @@ -4808,7 +4808,7 @@ }, "map-obj": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/map-obj/download/map-obj-1.0.1.tgz?cache=0&sync_timestamp=1617771232226&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmap-obj%2Fdownload%2Fmap-obj-1.0.1.tgz", "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" }, "map-visit": { @@ -4842,7 +4842,7 @@ }, "meow": { "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "resolved": "https://registry.nlark.com/meow/download/meow-3.7.0.tgz?cache=0&sync_timestamp=1620227889221&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fmeow%2Fdownload%2Fmeow-3.7.0.tgz", "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "requires": { "camelcase-keys": "^2.0.0", @@ -4978,16 +4978,16 @@ } }, "mime-db": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" + "version": "1.47.0", + "resolved": "https://registry.npm.taobao.org/mime-db/download/mime-db-1.47.0.tgz?cache=0&sync_timestamp=1617306166016&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmime-db%2Fdownload%2Fmime-db-1.47.0.tgz", + "integrity": "sha1-jLMT5Zll08Bc+/iYkVomevRqM1w=" }, "mime-types": { - "version": "2.1.27", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "version": "2.1.30", + "resolved": "https://registry.npm.taobao.org/mime-types/download/mime-types-2.1.30.tgz?cache=0&sync_timestamp=1617340124913&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmime-types%2Fdownload%2Fmime-types-2.1.30.tgz", + "integrity": "sha1-bnvotMR5gl+F7WMmaV23P5MF1i0=", "requires": { - "mime-db": "1.44.0" + "mime-db": "1.47.0" } }, "mimic-fn": { @@ -5140,8 +5140,8 @@ }, "node-gyp": { "version": "3.8.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", - "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", + "resolved": "https://registry.nlark.com/node-gyp/download/node-gyp-3.8.0.tgz", + "integrity": "sha1-VAMEJhwzDoDQ1e3OJTpoyzlkIYw=", "requires": { "fstream": "^1.0.0", "glob": "^7.0.3", @@ -5159,7 +5159,7 @@ "dependencies": { "semver": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-5.3.0.tgz", "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" } } @@ -5222,8 +5222,8 @@ }, "node-sass": { "version": "4.14.1", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.1.tgz", - "integrity": "sha512-sjCuOlvGyCJS40R8BscF5vhVlQjNN069NtQ1gSxyK1u9iqvn6tf7O1R4GNowVZfiZUCRt5MmMs1xd+4V/7Yr0g==", + "resolved": "https://registry.npm.taobao.org/node-sass/download/node-sass-4.14.1.tgz?cache=0&sync_timestamp=1604150653238&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnode-sass%2Fdownload%2Fnode-sass-4.14.1.tgz", + "integrity": "sha1-mch+wu+3BH7WOPtMnbfzpC4iF7U=", "requires": { "async-foreach": "^0.1.3", "chalk": "^1.1.1", @@ -5246,12 +5246,12 @@ "dependencies": { "ansi-styles": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-2.2.1.tgz", "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" }, "chalk": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "resolved": "https://registry.nlark.com/chalk/download/chalk-1.1.3.tgz?cache=0&sync_timestamp=1618995367379&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fchalk%2Fdownload%2Fchalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "requires": { "ansi-styles": "^2.2.1", @@ -5263,14 +5263,14 @@ }, "supports-color": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-2.0.0.tgz?cache=0&sync_timestamp=1618560983872&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" } } }, "nopt": { "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "resolved": "https://registry.npm.taobao.org/nopt/download/nopt-3.0.6.tgz", "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", "requires": { "abbrev": "1" @@ -5278,8 +5278,8 @@ }, "normalize-package-data": { "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "resolved": "https://registry.npm.taobao.org/normalize-package-data/download/normalize-package-data-2.5.0.tgz", + "integrity": "sha1-5m2xg4sgDB38IzIl0SyzZSDiNKg=", "requires": { "hosted-git-info": "^2.1.4", "resolve": "^1.10.0", @@ -5294,8 +5294,8 @@ }, "npmlog": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "resolved": "https://registry.npm.taobao.org/npmlog/download/npmlog-4.1.2.tgz", + "integrity": "sha1-CKfyqL9zRgR3mp76StXMcXq7lUs=", "requires": { "are-we-there-yet": "~1.1.2", "console-control-strings": "~1.1.0", @@ -5305,13 +5305,13 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "resolved": "https://registry.nlark.com/number-is-nan/download/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "oauth-sign": { "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + "resolved": "https://registry.npm.taobao.org/oauth-sign/download/oauth-sign-0.9.0.tgz", + "integrity": "sha1-R6ewFrqmi1+g7PPe4IqFxnmsZFU=" }, "object-assign": { "version": "4.1.1", @@ -5421,7 +5421,7 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "resolved": "https://registry.npm.taobao.org/os-homedir/download/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" }, "os-tmpdir": { @@ -5431,8 +5431,8 @@ }, "osenv": { "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "resolved": "https://registry.npm.taobao.org/osenv/download/osenv-0.1.5.tgz", + "integrity": "sha1-hc36+uso6Gd/QW4odZK18/SepBA=", "requires": { "os-homedir": "^1.0.0", "os-tmpdir": "^1.0.0" @@ -5491,7 +5491,7 @@ }, "parse-json": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "resolved": "https://registry.npm.taobao.org/parse-json/download/parse-json-2.2.0.tgz?cache=0&sync_timestamp=1610966709037&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fparse-json%2Fdownload%2Fparse-json-2.2.0.tgz", "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "requires": { "error-ex": "^1.2.0" @@ -5548,7 +5548,7 @@ }, "path-type": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/path-type/download/path-type-1.1.0.tgz?cache=0&sync_timestamp=1611752058913&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpath-type%2Fdownload%2Fpath-type-1.1.0.tgz", "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", "requires": { "graceful-fs": "^4.1.2", @@ -5558,7 +5558,7 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npm.taobao.org/pify/download/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" } } @@ -5578,7 +5578,7 @@ }, "performance-now": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, "picomatch": { @@ -5593,12 +5593,12 @@ }, "pinkie": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "resolved": "https://registry.npm.taobao.org/pinkie/download/pinkie-2.0.4.tgz", "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" }, "pinkie-promise": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/pinkie-promise/download/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "requires": { "pinkie": "^2.0.0" @@ -5708,8 +5708,8 @@ }, "psl": { "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + "resolved": "https://registry.npm.taobao.org/psl/download/psl-1.8.0.tgz", + "integrity": "sha1-kyb4vPsBOtzABf3/BWrM4CDlHCQ=" }, "public-encrypt": { "version": "4.0.3", @@ -5773,8 +5773,8 @@ }, "qs": { "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + "resolved": "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz?cache=0&sync_timestamp=1616385315895&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.5.2.tgz", + "integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY=" }, "querystring": { "version": "0.2.0", @@ -5809,7 +5809,7 @@ }, "read-pkg": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/read-pkg/download/read-pkg-1.1.0.tgz", "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", "requires": { "load-json-file": "^1.0.0", @@ -5819,7 +5819,7 @@ }, "read-pkg-up": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "resolved": "https://registry.npm.taobao.org/read-pkg-up/download/read-pkg-up-1.0.1.tgz?cache=0&sync_timestamp=1616916344510&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fread-pkg-up%2Fdownload%2Fread-pkg-up-1.0.1.tgz", "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "requires": { "find-up": "^1.0.0", @@ -5828,7 +5828,7 @@ "dependencies": { "find-up": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "resolved": "https://registry.npm.taobao.org/find-up/download/find-up-1.1.2.tgz?cache=0&sync_timestamp=1599054261724&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffind-up%2Fdownload%2Ffind-up-1.1.2.tgz", "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "requires": { "path-exists": "^2.0.0", @@ -5837,7 +5837,7 @@ }, "path-exists": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "resolved": "https://registry.npm.taobao.org/path-exists/download/path-exists-2.1.0.tgz", "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "requires": { "pinkie-promise": "^2.0.0" @@ -5877,7 +5877,7 @@ }, "redent": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "resolved": "https://registry.nlark.com/redent/download/redent-1.0.0.tgz", "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", "requires": { "indent-string": "^2.1.0", @@ -5977,7 +5977,7 @@ }, "repeating": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "resolved": "https://registry.nlark.com/repeating/download/repeating-2.0.1.tgz", "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", "requires": { "is-finite": "^1.0.0" @@ -5985,8 +5985,8 @@ }, "request": { "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "resolved": "https://registry.npm.taobao.org/request/download/request-2.88.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frequest%2Fdownload%2Frequest-2.88.2.tgz", + "integrity": "sha1-1zyRhzHLWofaBH4gcjQUb2ZNErM=", "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -6178,8 +6178,8 @@ }, "sass-graph": { "version": "2.2.5", - "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.5.tgz", - "integrity": "sha512-VFWDAHOe6mRuT4mZRd4eKE+d8Uedrk6Xnh7Sh9b4NGufQLQjOrvf/MQoOdx+0s92L89FeyUUNfU597j/3uNpag==", + "resolved": "https://registry.npm.taobao.org/sass-graph/download/sass-graph-2.2.5.tgz", + "integrity": "sha1-qYHIdEa4MZ2W3OBnHkh4eb0kwug=", "requires": { "glob": "^7.0.0", "lodash": "^4.0.0", @@ -6208,7 +6208,7 @@ }, "scss-tokenizer": { "version": "0.2.3", - "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz", + "resolved": "https://registry.npm.taobao.org/scss-tokenizer/download/scss-tokenizer-0.2.3.tgz", "integrity": "sha1-jrBtualyMzOCTT9VMGQRSYR85dE=", "requires": { "js-base64": "^2.1.8", @@ -6217,7 +6217,7 @@ "dependencies": { "source-map": { "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.4.4.tgz", "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "requires": { "amdefine": ">=0.0.4" @@ -6496,8 +6496,8 @@ }, "spdx-correct": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "resolved": "https://registry.npm.taobao.org/spdx-correct/download/spdx-correct-3.1.1.tgz", + "integrity": "sha1-3s6BrJweZxPl99G28X1Gj6U9iak=", "requires": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" @@ -6505,22 +6505,22 @@ }, "spdx-exceptions": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" + "resolved": "https://registry.npm.taobao.org/spdx-exceptions/download/spdx-exceptions-2.3.0.tgz", + "integrity": "sha1-PyjOGnegA3JoPq3kpDMYNSeiFj0=" }, "spdx-expression-parse": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "resolved": "https://registry.npm.taobao.org/spdx-expression-parse/download/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha1-z3D1BILu/cmOPOCmgz5KU87rpnk=", "requires": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" } }, "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==" + "version": "3.0.7", + "resolved": "https://registry.npm.taobao.org/spdx-license-ids/download/spdx-license-ids-3.0.7.tgz?cache=0&sync_timestamp=1606610751920&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fspdx-license-ids%2Fdownload%2Fspdx-license-ids-3.0.7.tgz", + "integrity": "sha1-6cGKQQ5e1+EkQqVJ+9ivp2cDjWU=" }, "split-string": { "version": "3.1.0", @@ -6538,8 +6538,8 @@ }, "sshpk": { "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "resolved": "https://registry.npm.taobao.org/sshpk/download/sshpk-1.16.1.tgz", + "integrity": "sha1-+2YcC+8ps520B2nuOfpwCT1vaHc=", "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -6582,8 +6582,8 @@ }, "stdout-stream": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.1.tgz", - "integrity": "sha512-j4emi03KXqJWcIeF8eIXkjMFN1Cmb8gUlDYGeBALLPo5qdyTfA9bOtl8m33lRoC+vFMkP3gl0WsDr6+gzxbbTA==", + "resolved": "https://registry.npm.taobao.org/stdout-stream/download/stdout-stream-1.4.1.tgz", + "integrity": "sha1-WsF0zdXNcmEEqgwLK9g4FdjVNd4=", "requires": { "readable-stream": "^2.0.1" } @@ -6629,7 +6629,7 @@ }, "string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "resolved": "https://registry.nlark.com/string-width/download/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "requires": { "code-point-at": "^1.0.0", @@ -6673,7 +6673,7 @@ }, "strip-bom": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "resolved": "https://registry.nlark.com/strip-bom/download/strip-bom-2.0.0.tgz", "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", "requires": { "is-utf8": "^0.2.0" @@ -6681,7 +6681,7 @@ }, "strip-indent": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "resolved": "https://registry.nlark.com/strip-indent/download/strip-indent-1.0.1.tgz?cache=0&sync_timestamp=1620053310624&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fstrip-indent%2Fdownload%2Fstrip-indent-1.0.1.tgz", "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", "requires": { "get-stdin": "^4.0.1" @@ -6779,8 +6779,8 @@ }, "tar": { "version": "2.2.2", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", - "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", + "resolved": "https://registry.npm.taobao.org/tar/download/tar-2.2.2.tgz", + "integrity": "sha1-DKiEhWLHKZuLRG/2pNYM27I+3EA=", "requires": { "block-stream": "*", "fstream": "^1.0.12", @@ -6930,8 +6930,8 @@ }, "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==", + "resolved": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftough-cookie%2Fdownload%2Ftough-cookie-2.5.0.tgz", + "integrity": "sha1-zZ+yoKodWhK0c72fuW+j3P9lreI=", "requires": { "psl": "^1.1.28", "punycode": "^2.1.1" @@ -6939,13 +6939,13 @@ }, "trim-newlines": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "resolved": "https://registry.nlark.com/trim-newlines/download/trim-newlines-1.0.0.tgz?cache=0&sync_timestamp=1619005721489&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ftrim-newlines%2Fdownload%2Ftrim-newlines-1.0.0.tgz", "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=" }, "true-case-path": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.3.tgz", - "integrity": "sha512-m6s2OdQe5wgpFMC+pAJ+q9djG82O2jcHPOI6RNg1yy9rCYR+WD6Nbpl32fDpfC56nirdRy+opFa/Vk7HYhqaew==", + "resolved": "https://registry.npm.taobao.org/true-case-path/download/true-case-path-1.0.3.tgz", + "integrity": "sha1-+BO1qMhrQNpZYGcisUTjIleZ9H0=", "requires": { "glob": "^7.1.2" } @@ -6963,7 +6963,7 @@ }, "tunnel-agent": { "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "resolved": "https://registry.npm.taobao.org/tunnel-agent/download/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "requires": { "safe-buffer": "^5.0.1" @@ -6971,7 +6971,7 @@ }, "tweetnacl": { "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "resolved": "https://registry.npm.taobao.org/tweetnacl/download/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" }, "type-check": { @@ -7145,8 +7145,8 @@ }, "uuid": { "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + "resolved": "https://registry.npm.taobao.org/uuid/download/uuid-3.4.0.tgz", + "integrity": "sha1-sj5DWK+oogL+ehAK8fX4g/AgB+4=" }, "v8-compile-cache": { "version": "2.1.1", @@ -7161,8 +7161,8 @@ }, "validate-npm-package-license": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "resolved": "https://registry.npm.taobao.org/validate-npm-package-license/download/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha1-/JH2uce6FchX9MssXe/uw51PQQo=", "requires": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" @@ -7170,7 +7170,7 @@ }, "verror": { "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "resolved": "https://registry.npm.taobao.org/verror/download/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "requires": { "assert-plus": "^1.0.0", @@ -7519,8 +7519,8 @@ }, "wide-align": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "resolved": "https://registry.npm.taobao.org/wide-align/download/wide-align-1.1.3.tgz", + "integrity": "sha1-rgdOa9wMFKQx6ATmJFScYzsABFc=", "requires": { "string-width": "^1.0.2 || 2" } @@ -7675,7 +7675,7 @@ }, "zlib": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/zlib/-/zlib-1.0.5.tgz", + "resolved": "https://registry.npm.taobao.org/zlib/download/zlib-1.0.5.tgz", "integrity": "sha1-bnyXL8NxxkWmr7A6sUdp3vEU/MA=" } } diff --git a/packages/wxa-cli/src/const/wxaConfigs.js b/packages/wxa-cli/src/const/wxaConfigs.js index 4e6b28d7..400d4145 100644 --- a/packages/wxa-cli/src/const/wxaConfigs.js +++ b/packages/wxa-cli/src/const/wxaConfigs.js @@ -38,7 +38,7 @@ export default class DefaultWxaConfigs { ], optimization: { splitDeps: { - maxDeps: -1, + enable: false, }, allowEmptyAttributes: true, transformPxToRpx: false, diff --git a/packages/wxa-cli/src/generator/index.js b/packages/wxa-cli/src/generator/index.js index 22e7bd35..f881a73d 100644 --- a/packages/wxa-cli/src/generator/index.js +++ b/packages/wxa-cli/src/generator/index.js @@ -45,11 +45,12 @@ export default class Generator { // https://github.com/wxajs/wxa/issues/5#issuecomment-498186337 // if a module is unrecognized, then we just copy it to dist. if (mdl.code != null) { + let outputCode = mdl.codes && mdl.codes.get(outputPath) || mdl.code; if (mdl.sourceMap && mdl.kind === 'js') { writeFile(outputPath+'.map', JSON.stringify(mdl.sourceMap)); - mdl.code += `\n//@ sourceMappingURL=${path.basename(outputPath)}.map`; + outputCode += `\n//@ sourceMappingURL=${path.basename(outputPath)}.map`; } - writeFile(outputPath, mdl.code); + writeFile(outputPath, outputCode); } else { copy(mdl.src, outputPath); } diff --git a/packages/wxa-cli/src/optimizer/splitDeps.js b/packages/wxa-cli/src/optimizer/splitDeps.js index 1b8807b7..7ba43327 100644 --- a/packages/wxa-cli/src/optimizer/splitDeps.js +++ b/packages/wxa-cli/src/optimizer/splitDeps.js @@ -1,27 +1,63 @@ import path from 'path'; -import logger from '../helpers/logger'; -const COLOR = { - SKIP: 1, - INIT: 0, -}; +function getRegExp(str, flag) { + return new RegExp(str.replace(/\\/g, '\\\\', flag)); +} + +// 字符编码数值对应的存储长度: +// UCS-2编码(16进制) UTF-8 字节流(二进制) +// 0000 - 007F 0xxxxxxx (1字节) +// 0080 - 07FF 110xxxxx 10xxxxxx (2字节) +// 0800 - FFFF 1110xxxx 10xxxxxx 10xxxxxx (3字节) +function getBytes(str) { + let totalLength = 0; + let charCode; + for (let i = 0; i < str.length; i++) { + charCode = str.charCodeAt(i); + if (charCode < 0x007f) { + totalLength++; + } else if (0x0080 <= charCode && charCode <= 0x07ff) { + totalLength += 2; + } else if (0x0800 <= charCode && charCode <= 0xffff) { + totalLength += 3; + } else { + totalLength += 4; + } + } + return totalLength; +} export default class SplitDeps { constructor({appConfigs, wxaConfigs, cwd, cmdOptions}) { this.cmdOptions = cmdOptions; this.wxaConfigs = wxaConfigs; - this.maxSplitDeps = wxaConfigs.optimization.splitDeps.maxDeps; - this.NMReg = new RegExp(path.join(cwd, 'node_modules')); + this.config = wxaConfigs.optimization.splitDeps; + this.NMReg = getRegExp(path.join(cwd, 'node_modules')); + this.mainNodes = []; + + // 分包的依赖集(未被主包依赖) + this.subPackagesDeps = new Map(); + // 分包的依赖,但最终会打包进主包 + this.subPackagesDepsInMain = {}; + this.mainDeps = new Set(); let pkg = appConfigs.subpackages || appConfigs.subPackages; if (pkg) { // flattern pages array and remember the subpackage's root. - this.subPages = pkg.reduce((prev, pkg)=>{ + this.subPages = pkg.reduce((prev, pkg) => { if (Array.isArray(pkg.pages)) { - prev.push({ - reg: new RegExp('^'+path.join(wxaConfigs.context, pkg.root)), - path: pkg.root, - }); + let obj = { + reg: getRegExp( + '^' + path.join(wxaConfigs.context, pkg.root) + ), + outputReg: getRegExp( + '^' + path.join(wxaConfigs.output.path, pkg.root) + ), + path: path.join(wxaConfigs.context, pkg.root), + root: pkg.root, + }; + prev.push(obj); + this.subPackagesDeps.set(obj.path, new Set()); } return prev; @@ -34,192 +70,744 @@ export default class SplitDeps { run(indexedMap) { if (this.isNoSubPackage) return; - let [src, root] = Array.from(indexedMap).find(([src, mdl])=>mdl.isROOT) || []; + if (!this.config.enable) { + return; + } + + let [src, root] = + Array.from(indexedMap).find(([src, mdl]) => mdl.isROOT) || []; if (root == null) return; - // 从入口开始溯源 - root.childNodes.forEach((entryPoint, src)=>{ - let pkg = this.subPages.find((sub)=>sub.reg.test(src)); - if (pkg) { - this.start(entryPoint, pkg); + this.root = root; + + this.normalizeSrc(root); + + root.childNodes.forEach((node) => { + let isSubPage = this.subPages.some((sub) => sub.reg.test(node.src)); + + if (!isSubPage) { + this.mainNodes.push(node); } }); + + this.split(); } - clean(dep) { - dep.$depSplitColor = COLOR.INIT; - dep.childNodes.forEach((child)=> { - if (dep.$depSplitColor !== COLOR.INIT) { - this.clean(child); + split() { + this.collectDeps(); + this.normalizeDeps(); + this.analysisDeps(); + this.filterDeps(); + this.moveDeps(); + } + + /** + * 收集分包的依赖 + * subPackagesDeps 数据结构: + * { + * [分包路径]: 依赖数组 + * } + */ + collectDeps() { + let traversal = (dep, pkg) => { + dep.$visited = true; + dep.childNodes.forEach((child) => { + // 处理循环引用 + if (child.$visited) return; + + if (child.pret.isWXALib || this.isInMainPackage(child)) { + return; + } + + // 抽象节点或是本身就是分包的文件 + // 继续遍历下一层 + if (child.isAbstract || pkg.reg.test(child.src)) { + traversal(child, pkg); + return; + } + + // 分包的依赖项 + child.isSplit = true; + this.subPackagesDeps.get(pkg.path).add(child); + traversal(child, pkg); + }); + + dep.$visited = false; + }; + // 从入口开始溯源 + this.root.childNodes.forEach((entryPoint) => { + let pkg = this.subPages.find((sub) => sub.reg.test(entryPoint.src)); + if (pkg) { + traversal(entryPoint, pkg); } }); } - start(dep, pkg) { - dep.$depSplitColor = COLOR.SKIP; + /** + * 格式化 subPackagesDeps: + * { + * [分包路径]: { + * [依赖路径]:{ + * deps: 依赖数组 (组件有多个文件), + * references: 被多少个分包引用, + * size: 依赖大小(递归遍历子依赖,计算不在主包依赖大小之和) + * } + * } + * } + */ + normalizeDeps() { + // 当一个分包内依赖格式化完毕 + // 将依赖信息存储 + let normalizedDeps = {}; + + let doNormalize = (deps) => { + let subPackageInfo = {}; + + deps.forEach((dep) => { + let ext = path.extname(dep.src); + if (ext === '.wxml') { + let src = this.removePathExt(dep.src); + + // 先从缓存中读取依赖信息 + // 这么做的目的是让同一依赖信息 depInfo 在不同分包下维持同一引用 + let depInfo = normalizedDeps[src]; + if (depInfo) { + subPackageInfo[src] = depInfo; + return; + } - dep.childNodes.forEach((child, src)=>{ - // circular dependency - if (child.$depSplitColor === COLOR.SKIP) return; + let set = new Set(); + set.add(dep); + subPackageInfo[src] = { + deps: set, + }; + } + }); - if ( - // an abstract file will never be output, but we still need to track it's childNodes. - child.isAbstract || - // if the child nodes isn't from node_module, it's sub-child nodes might be. - !this.NMReg.test(child.src) - ) { - return this.start(child, pkg); - } + deps.forEach((dep) => { + let reference = Array.from(dep.reference); + let ext = path.extname(dep.src); + if (reference.length === 1 && reference[0][1].isAbstract) { + let src = this.removePathExt(dep.src); + + // 先取缓存 + let depInfo = normalizedDeps[src]; + if (depInfo) { + subPackageInfo[src] = depInfo; + return; + } + + depInfo = subPackageInfo[src] || {deps: new Set()}; + let set = depInfo.deps; + set.add(dep); + subPackageInfo[src] = depInfo; + } else if (['.wxss', '.json', '.wxml', '.js'].includes(ext)) { + // 将组件的四个文件作为一个依赖整体 + + let src = this.removePathExt(dep.src); + + // 先取缓存 + let depInfo = normalizedDeps[src]; + if (depInfo) { + subPackageInfo[src] = depInfo; + return; + } + + if (subPackageInfo[src]) { + subPackageInfo[src].deps.add(dep); + } else { + subPackageInfo[dep.src] = { + deps: new Set().add(dep), + }; + } + } else { + let src = dep.src; + + // 先取缓存 + let depInfo = normalizedDeps[src]; + if (depInfo) { + subPackageInfo[src] = depInfo; + return; + } + + subPackageInfo[src] = { + deps: new Set().add(dep), + }; + } + }); + + normalizedDeps = {...normalizedDeps, ...subPackageInfo}; + return subPackageInfo; + }; - if (!this.ifMatchRule(child)) return; + let subPackagesDeps = new Map(); + this.subPackagesDeps.forEach((deps, subPackageSrc) => { + subPackagesDeps.set(subPackageSrc, doNormalize(deps)); + }); + this.subPackagesDeps = subPackagesDeps; + } + + analysisDeps() { + this.subPackagesDeps.forEach((subPackageInfo) => { + Object.keys(subPackageInfo).forEach((depSrc) => { + let depInfo = subPackageInfo[depSrc]; + + depInfo.children = depInfo.children || new Set(); + depInfo.parents = depInfo.parents || new Set(); + // 依赖信息 depInfo 之间的关系 + depInfo.deps.forEach((dep) => { + dep.childNodes.forEach((child) => { + let src = child.src; + let nSrc = this.removePathExt(src); + + let childDepInfo = + subPackageInfo[src] || subPackageInfo[nSrc]; + if (childDepInfo) { + childDepInfo.parents = + childDepInfo.parents || new Set(); + + depInfo.children.add(childDepInfo); + childDepInfo.parents.add(depInfo); + } + }); + }); - if (this.cmdOptions.verbose) logger.info('Find NPM need track to subpackages', child.src); - // fulfill all condition just track all the sub-nodes without any hesitate. - this.trackChildNodes(child, {output: dep.meta.outputPath, originOutput: dep.meta.outputPath, instance: dep, isSplitEntry: true}, pkg); + // 已经计算过大小 + // 不同分包下同一依赖的信息维持同一引用 + if (depInfo.references) { + depInfo.references++; + return; + } + + depInfo.references = 1; + }); }); } - ifMatchRule(child) { - // not match condition meanning all it's sub-child needn't handle. - // or the main packages depend on it. - // just stop the spliting loop. - if ( - child.reference.size >= this.maxSplitDeps && - this.getReferenceSize(child) > this.maxSplitDeps - ) return false; + /** + * 计算依赖大小,会递归遍历子节点 + */ + computeDepSize() { + let compute = (deps) => { + let size = 0; + + let run = (deps) => { + deps.forEach((dep) => { + // 处理循环引用 + if (dep.$t) { + return; + } + dep.$t = true; + + // 跳过被主包引用的子依赖 + if (!dep.isSplit) { + return; + } + + size += dep.size; + run(dep.childNodes); + }); + }; + + function clean(deps) { + deps.forEach((dep) => { + if (!dep.$t) { + return; + } + delete dep.$t; + + clean(dep.childNodes); + }); + } + + run(deps); + clean(deps); - if (child.pret.isWXALib) return false; + return size; + }; - if (this.isInMainPackage(child)) return false; + this.subPackagesDeps.forEach((subPackageInfo) => { + Object.keys(subPackageInfo).forEach((depSrc) => { + let depInfo = subPackageInfo[depSrc]; - return true; + // 已经计算过大小 + // 不同分包下同一依赖的信息维持同一引用 + if (depInfo.size) { + return; + } + + depInfo.size = compute(depInfo.deps); + }); + }); } - isInMainPackage(child) { - if (!child.reference || !child.reference.size) { - // entry point. - return ( - !this.subPages.some((sub)=>sub.reg.test(child.src)) || - // if a node_module pkg is push in entry. then we always compiler its' to main-package. - this.NMReg.test(child.src) + /** + * 过滤依赖,根据条件将 subPackagesDeps 中的依赖放入到 subPackagesDepsInMain + */ + filterDeps() { + // 如果要移动到主包 + // 那该dep且其所有子dep都需要被移动 + let moveToMain = (filter) => { + let mark = (depInfo) => { + if (depInfo.inMain) { + return; + } + + depInfo.inMain = true; + + depInfo.children.forEach((childDepInfo) => { + mark(childDepInfo); + }); + }; + + this.subPackagesDeps.forEach((subPackageInfo) => { + Object.keys(subPackageInfo).forEach((depSrc) => { + let depInfo = subPackageInfo[depSrc]; + if (filter(depSrc, depInfo)) { + mark(depInfo); + } + }); + }); + + this.subPackagesDeps.forEach((subPackageInfo) => { + Object.keys(subPackageInfo).forEach((depSrc) => { + let depInfo = subPackageInfo[depSrc]; + + if (depInfo.inMain) { + delete subPackageInfo[depSrc]; + if (!this.subPackagesDepsInMain[depSrc]) { + this.subPackagesDepsInMain[depSrc] = depInfo; + depInfo.deps.forEach((dep) => { + delete dep.isSplit; + }); + } + } + }); + }); + }; + + this.computeDepSize(); + + let {enableLocalDep} = this.config; + + if (!enableLocalDep) { + moveToMain((depSrc, depInfo) => { + // 非npm的依赖放入主包 + return !this.NMReg.test(depSrc); + }); + } + + let doFilter = (filter) => { + let defaultFilter = { + maxDeps: Number.MAX_SAFE_INTEGER, + minDeps: 0, + maxDepSize: Number.MAX_SAFE_INTEGER, + minDepSize: 0, + }; + let {maxDeps, minDeps, maxDepSize, minDepSize} = Object.assign( + defaultFilter, + filter ); + + moveToMain((depSrc, depInfo) => { + // 放在主包 + return ( + depInfo.references > maxDeps || + depInfo.references < minDeps || + depInfo.size > maxDepSize || + depInfo.size < minDepSize + ); + }); + + this.computeDepSize(); + }; + + + let {filter} = this.config; + + if (Array.isArray(filter)) { + filter.forEach((item) => { + doFilter(item); + }); + } else { + doFilter(filter); } - let refs = Array.from(child.reference); - let inMain = []; - refs.forEach(([src, mdl])=>{ - // if a child module has neigth subpage nor node_modules reference, then it's in main package - if ( - !this.subPages.some((sub)=>sub.reg.test(src)) && - !this.NMReg.test(src) - ) { - inMain.push(true); + } + + /** + * 改变 subPackagesDeps 中依赖的输出路径 + * 一个依赖可能有多个输出路径,但它的输出只能是在各个分包或是主包中二选一 + */ + moveDeps() { + // 储存每个分包下的,已经移动的依赖和其改变的父节点 + let movedDepAndChangedParent = new Map(); + let change = (dep, parent, pkg, allDeps) => { + let {root} = pkg; + let {outputPath: oldOutputPath} = dep.meta; + let newOutputPath = ''; + let isNpmDep = this.NMReg.test(dep.src); + + // npm 的文件 + // 放到对应分包的npm目录下 + if (isNpmDep) { + let subNpm = path.join(root, 'npm'); + newOutputPath = oldOutputPath.replace( + getRegExp( + '^' + path.join(this.wxaConfigs.output.path, 'npm') + ), + path.join(this.wxaConfigs.output.path, subNpm) + ); } else { - inMain.push(false); + // 主包的文件 + // 输出到对应分包下的_main目录下 + let subMain = path.join(root, '_main'); + newOutputPath = oldOutputPath.replace( + getRegExp('^' + this.wxaConfigs.output.path), + path.join(this.wxaConfigs.output.path, subMain) + ); } - }); - let isInMainPkg = inMain.some((item)=>item); - if (!isInMainPkg && this.NMReg.test(child.src)) { - // deep check third party module. - for (let i = 0; i < refs.length; i ++) { - let parentNode = refs[i][1]; - if (parentNode.isROOT) continue; + // 更改父节点引用该文件时的路径 + this.changePatnInCode( + parent.referenceNode, + parent.oldOutputPath, + parent.newOutputPath, + oldOutputPath, + newOutputPath + ); + + dep.output.delete(oldOutputPath); + dep.output.add(newOutputPath); + + // 每次移动dep到分包 + // 存储移动的dep和其改变的父节点 + let changedParents = movedDepAndChangedParent.get(dep) || new Set(); + changedParents.add(parent.referenceNode); + movedDepAndChangedParent.set(dep, changedParents); + + // 更改引用子节点时的路径 + dep.childNodes.forEach((child) => { + let trueChild = child; + if (child.isAbstract) { + trueChild = Array.from(child.childNodes)[0][1]; + } + + // 子节点不会发生输出路径改变 + // 如果子节点会输出路径改变,那在接下来的遍历中,必然会遍历到该子节点,从而改变这个父节点引用子节点的路径 + if (!allDeps.includes(trueChild)) { + this.changePatnInCode( + dep, + oldOutputPath, + newOutputPath, + trueChild.meta.outputPath, + trueChild.meta.outputPath + ); + } + }); + + return {oldOutputPath, newOutputPath}; + }; + + let start = (dep, pkg, allDeps) => { + dep.node.$visited = true; + + dep.node.childNodes.forEach((child) => { + // 循环引用 + if (child.$visited) { + return; + } + + if (child.isAbstract) { + start( + { + oldOutputPath: dep.oldOutputPath, + newOutputPath: dep.newOutputPath, + node: child, + referenceNode: dep.node, + }, + pkg, + allDeps + ); + return; + } + + // 依赖已经被移动且该依赖已经改变过父节点 + // 直接返回 + if ( + movedDepAndChangedParent.has(child) && + movedDepAndChangedParent.get(child).has(dep.referenceNode) + ) { + return; + } + + if (allDeps.includes(child)) { + let {oldOutputPath, newOutputPath} = change( + child, + dep, + pkg, + allDeps + ); + + start( + { + oldOutputPath, + newOutputPath, + node: child, + referenceNode: child, + }, + pkg, + allDeps + ); + } + }); + + delete dep.node.$visited; + }; + + this.subPackagesDeps.forEach((subPackageInfo, subPackageSrc) => { + let pkg = this.subPages.find((sub) => sub.path === subPackageSrc); + let allDeps = this.getSubPackageDeps(subPackageInfo); + movedDepAndChangedParent = new Map(); + + // 遍历当前分包 + Object.keys(subPackageInfo).forEach((depSrc) => { + let depInfo = subPackageInfo[depSrc]; + + depInfo.deps.forEach((dep) => { + let allParents = Array.from(dep.reference.values()); + let parents = []; + + allParents.forEach((parent) => { + if (parent.isAbstract) { + let pParents = Array.from( + parent.reference.values() + ); + pParents.forEach((pParent) => { + if (pkg.reg.test(pParent.src)) { + parents.push(pParent); + } + }); + return; + } + + if (pkg.reg.test(parent.src)) { + parents.push(parent); + } + }); + + // 在当前分包内没有找到parent + // 那表示该依赖并不是被当前分包直接引用 + // 那一定能在之后的遍历中找到一个父节点被当前分包直接引用 + // 对那个父节点所形成的依赖子树进行output路径修改 + if (!parents.length) { + return; + } + + parents.forEach((parent) => { + start( + { + node: parent, + referenceNode: parent, + oldOutputPath: parent.meta.outputPath, + newOutputPath: parent.meta.outputPath, + }, + pkg, + allDeps + ); + }); + }); + }); + }); + } - isInMainPkg = this.isInMainPackage(parentNode); - // if one of parent is in main, then just stop the loop. - if (isInMainPkg) break; + // 格式化路径 + normalizeSrc(node) { + function run(node) { + // 处理循环引用 + if (node.$t) { + return; } + + node.$t = true; + node.src && (node.src = path.normalize(node.src)); + + node.childNodes.forEach((child) => run(child)); } - return isInMainPkg; - } - - trackChildNodes(dep, parent, subpage) { - // if (/select\-revenue/g.test(dep.src)) debugger; - // depth-first - dep.$$isSplit = true; - let {path: pkg} = subpage; - // dep is node modules so that nested track sub child-nodes to add all deps to sub-packages - // four steps to finish deps delivery: - // 1. generate new outputpath - // 2. generate new relative path - // 3. replace parent's code. - // 4. repeat 1-3 on childnodes. - let {outputPath} = dep.meta; - let originResolvedPath = './'+this.getResolved(parent.originOutput, outputPath); - // let mainNpm = path.join(this.wxaConfigs.context) - let subNpm = path.join(pkg, 'npm'); - - let newOutputPath = outputPath.replace(new RegExp('^'+this.wxaConfigs.output.path+'/npm'), path.join(this.wxaConfigs.output.path, subNpm)); - - let newResolvedPath = './'+this.getResolved(parent.output, newOutputPath); - // component dependency - if (parent.instance.kind === 'json') { - originResolvedPath = this.getPathWithoutExtension(originResolvedPath); - newResolvedPath = this.getPathWithoutExtension(newResolvedPath); + function clean(node) { + if (!node.$t) { + return; + } + + delete node.$t; + node.childNodes.forEach((child) => clean(child)); } - parent.instance.code = parent.instance.code.replace(new RegExp(originResolvedPath, 'gm'), newResolvedPath); - - // clean multi output - // if a split module is not an entry module, then we need to check it's reference carefully cause there maybe some other page import it directly. so that we cannot delete it's origin output. - if ( - dep.output.has(outputPath) && - !this.isInMainPackage(dep) && - (parent.isSplitEntry || !this.hasNoSplitReference(dep)) - ) dep.output.delete(outputPath); - - // update output path - dep.output.add(newOutputPath); - - if (dep.childNodes) { - dep.childNodes.forEach((child)=>{ - // check node_modules's dependencies. - if (!this.ifMatchRule(child)) { - // if (/wxa_wrap/.test(child.src)) { - // debugger; - // } - let originResolvedPath = './' + this.getResolved(outputPath, child.meta.outputPath); - let newChildResolvedPath = './' + this.getResolved(newOutputPath, child.meta.outputPath); - if (dep.kind === 'json') { - originResolvedPath = this.getPathWithoutExtension(originResolvedPath); - newChildResolvedPath = this.getPathWithoutExtension(newChildResolvedPath); + run(node); + clean(node); + } + + getSubPackageDeps(subPackageInfo) { + let allDeps = []; + Object.keys(subPackageInfo).forEach((depSrc) => { + let depInfo = subPackageInfo[depSrc]; + allDeps = [...allDeps, ...depInfo.deps]; + }); + return allDeps; + } + + // 是否被主包依赖 + isInMainPackage(child) { + let run = (child) => { + // 处理循环引用 + if (child.$t) { + return; + } + + child.$t = true; + + let refs = Array.from(child.reference); + + // 是否被主包页面直接依赖 + let isMainDependent = refs.some(([src, mdl]) => { + return this.mainNodes.some((node) => node.src === mdl.src); + }); + + if (isMainDependent) { + return true; + } + + // 如果不在主包,检查其父节点(依赖其的文件) + if (!isMainDependent) { + for (let i = 0; i < refs.length; i++) { + let parentNode = refs[i][1]; + if (!parentNode.isROOT) { + if (run(parentNode)) { + return true; + } } - dep.code = dep.code.replace(new RegExp('["\']'+originResolvedPath+'["\']', 'gm'), '"'+newChildResolvedPath+'"'); - // debugger; - return; - }; + } + } + + return false; + }; + + let clean = (child) => { + if (!child.$t) { + return; + } - this.trackChildNodes(child, {output: newOutputPath, originOutput: outputPath, instance: dep}, subpage); + delete child.$t; + + child.reference.forEach((parent) => { + clean(parent); }); - } + }; + + let res = run(child); + clean(child); + + return res; } - hasNoSplitReference(dep) { - return Array.from(dep.reference).some(([src, instance])=>!instance.$$isSplit); + changePatnInCode(node, oldPath, newPath, depOldPath, depNewPath) { + let noPrefixOriginResolvedPath = this.getResolved(oldPath, depOldPath); + let noPrefixNewResolvedPath = this.getResolved(newPath, depNewPath); + + if (node.kind === 'json') { + noPrefixOriginResolvedPath = this.getPathWithoutExtension(noPrefixOriginResolvedPath); + noPrefixNewResolvedPath = this.getPathWithoutExtension(noPrefixNewResolvedPath); + } + + let originResolvedPath = './' + noPrefixOriginResolvedPath; + let newResolvedPath = './' + noPrefixNewResolvedPath; + + // 在默认输出下,一个节点只会输出一个文件 + // 但这里一个节点会输出多个文件,多个文件不同目录 + // 那么它们引用子文件时,所写路径也会不一样 + // 所以要存在多个code(文件内容),与不同输出路径对应 + let codes = node.codes || new Map(); + let code = codes.get(newPath) || node.code; + + code = code.replace( + getRegExp('["\']' + originResolvedPath + '["\']', 'gm'), + '"' + newResolvedPath + '"' + ); + + // wxs 引用的文件,并不是以 ./ 开头 + code = code.replace( + getRegExp('["\']' + noPrefixOriginResolvedPath + '["\']', 'gm'), + '"' + noPrefixNewResolvedPath + '"' + ); + codes.set(newPath, code); + node.codes = codes; } + // 去掉路径最后的文件类型后缀 getPathWithoutExtension(pathString) { + return this.removePathExt(pathString).replace(/\\/g, '/'); + } + + removePathExt(pathString) { let opath = path.parse(pathString); - pathString = opath.dir + '/' + opath.name; - pathString = pathString.replace(/\\/g, '/'); - return pathString; + // path.join 会丢失路径前的'./'字符 + return path.join(opath.dir, opath.name); } getResolved(from, to) { return path.relative(path.dirname(from), to).replace(/\\/g, '/'); } - getReferenceSize(dep) { - let from = new Set(); + // 检查一个依赖被多少分包依赖 + // 没使用到, 但可以直接检查一个依赖 + checkReferenceSize(dep) { + let run = (dep) => { + if (dep.isROOT) { + return true; + } - dep.reference.forEach((mdl)=>{ - let m = this.subPages.find((sub)=>sub.reg.test(mdl.src)); - if (m) from.add(m.path); - }); + // 处理循环引用 + if (dep.$t) { + return true; + } + + dep.$t = true; + + let from = new Set(); + + dep.reference.forEach((mdl) => { + let m = this.subPages.find((sub) => sub.reg.test(mdl.src)); + if (m) from.add(m.path); + }); + + let nums = from.size; + + if (nums < this.config.maxDeps) { + return Array.from(dep.reference.values()).every((parent) => + run(parent) + ); + } + + return false; + }; + + let clean = (dep) => { + if (!dep.$t) { + return; + } + + delete dep.$t; + + dep.reference.forEach((parent) => { + clean(parent); + }); + }; + + let res = run(dep); + clean(dep); - return from.size; + return res; } } diff --git a/packages/wxa-cli/src/schedule.js b/packages/wxa-cli/src/schedule.js index 32fc1d37..21a8f429 100644 --- a/packages/wxa-cli/src/schedule.js +++ b/packages/wxa-cli/src/schedule.js @@ -123,7 +123,7 @@ class Schedule { let tasks = []; while (this.$depPending.length) { let dep = this.$depPending.shift(); - + // debug('file to parse %O', dep); tasks.push(this.$parse(dep)); } @@ -302,7 +302,7 @@ class Schedule { outerDependencies: new Set(), dependency: function(file) { // debugger; - this.outerDependencies.add(file); + this.outerDependencies.add(path.normalize(file)); }, };