mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-09-17 18:06:10 +08:00
Compare commits
26 Commits
v1.38.1
...
feat/deps-
Author | SHA1 | Date | |
---|---|---|---|
![]() |
fbad603d05 | ||
![]() |
a1231f6a73 | ||
![]() |
f32b201778 | ||
![]() |
613f39a59e | ||
![]() |
94c06e9908 | ||
![]() |
ac1a000a3b | ||
![]() |
4e51f291ca | ||
![]() |
04b5d12daa | ||
![]() |
67644b5c11 | ||
![]() |
546faef83f | ||
![]() |
e713f4bbd1 | ||
![]() |
5a6463de33 | ||
![]() |
1fb308af94 | ||
![]() |
f10d4d3004 | ||
![]() |
0f44de772f | ||
![]() |
814a9d10fb | ||
![]() |
c08c5c0b07 | ||
![]() |
dc8c134ff0 | ||
![]() |
1d1e6cde0f | ||
![]() |
f16aff5674 | ||
![]() |
d7da311c5e | ||
![]() |
abef760f43 | ||
![]() |
467ef0c60d | ||
![]() |
0b08c7760d | ||
![]() |
b24b27d100 | ||
![]() |
4f0784172f |
@@ -8,7 +8,8 @@
|
||||
"recommended": true,
|
||||
"suspicious": {
|
||||
"noExplicitAny": "off",
|
||||
"noAssignInExpressions": "off"
|
||||
"noAssignInExpressions": "off",
|
||||
"noDoubleEquals": "off"
|
||||
},
|
||||
"style": {
|
||||
"noNonNullAssertion": "off"
|
||||
|
133
bun.lock
Executable file → Normal file
133
bun.lock
Executable file → Normal file
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"lockfileVersion": 0,
|
||||
"lockfileVersion": 1,
|
||||
"workspaces": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
@@ -15,6 +15,8 @@
|
||||
"form-data": "^4.0.1",
|
||||
"fs-extra": "8",
|
||||
"gradle-to-js": "^2.0.1",
|
||||
"i18next": "^24.2.2",
|
||||
"isomorphic-git": "^1.29.0",
|
||||
"isomorphic-unzip": "^1.1.5",
|
||||
"node-fetch": "^2.6.1",
|
||||
"plist": "^3.1.0",
|
||||
@@ -32,12 +34,23 @@
|
||||
"@biomejs/biome": "^1.9.4",
|
||||
"@swc/cli": "^0.5.1",
|
||||
"@swc/core": "^1.9.3",
|
||||
"@types/filesize-parser": "^1.5.3",
|
||||
"@types/fs-extra": "^11.0.4",
|
||||
"@types/node": "^22.9.3",
|
||||
"@types/node-fetch": "^2.6.12",
|
||||
"@types/progress": "^2.0.7",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@types/tcp-ping": "^0.1.6",
|
||||
"@types/update-notifier": "^6.0.8",
|
||||
"@types/yauzl": "^2.10.3",
|
||||
"@types/yazl": "^2.4.6",
|
||||
"typescript": "^5.7.2",
|
||||
},
|
||||
},
|
||||
},
|
||||
"packages": {
|
||||
"@babel/runtime": ["@babel/runtime@7.26.9", "", { "dependencies": { "regenerator-runtime": "^0.14.0" } }, "sha512-aA63XwOkcl4xxQa3HjPMqOP6LiK0ZDv3mUPYEFXkpHbaFjtGggE1A61FjFzJnB+p7/oy2gA8E+rcBNl/zC1tMg=="],
|
||||
|
||||
"@badisi/latest-version": ["@badisi/latest-version@7.0.10", "", { "dependencies": { "@colors/colors": "^1.6.0", "global-dirs": "3.0.1", "ora": "^8.1.0", "registry-auth-token": "^5.0.2", "semver": "^7.6.3" }, "bin": { "latest-version": "bin/latest-version", "lv": "bin/latest-version" } }, "sha512-1lX9wvXiJC552C+rrwwjEbpvvuDwYTU3OLFwFA1pTVYTnJGUkbBkfqz1MuTIPP1fL2LCvjd21ri/u39sSIcMTg=="],
|
||||
|
||||
"@biomejs/biome": ["@biomejs/biome@1.9.4", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "1.9.4", "@biomejs/cli-darwin-x64": "1.9.4", "@biomejs/cli-linux-arm64": "1.9.4", "@biomejs/cli-linux-arm64-musl": "1.9.4", "@biomejs/cli-linux-x64": "1.9.4", "@biomejs/cli-linux-x64-musl": "1.9.4", "@biomejs/cli-win32-arm64": "1.9.4", "@biomejs/cli-win32-x64": "1.9.4" }, "bin": { "biome": "bin/biome" } }, "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog=="],
|
||||
@@ -142,10 +155,32 @@
|
||||
|
||||
"@tokenizer/token": ["@tokenizer/token@0.3.0", "", {}, "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A=="],
|
||||
|
||||
"@types/configstore": ["@types/configstore@6.0.2", "", {}, "sha512-OS//b51j9uyR3zvwD04Kfs5kHpve2qalQ18JhY/ho3voGYUTPLEG90/ocfKPI48hyHH8T04f7KEEbK6Ue60oZQ=="],
|
||||
|
||||
"@types/filesize-parser": ["@types/filesize-parser@1.5.3", "", {}, "sha512-D8veS92mQAfcKz5kbV9WINfKvvaxVfQHqnO3OWW6FxdYTZozDDb8mTLWCsvEqe8M/M7skeULTZzYeMf3Lsss+A=="],
|
||||
|
||||
"@types/fs-extra": ["@types/fs-extra@11.0.4", "", { "dependencies": { "@types/jsonfile": "*", "@types/node": "*" } }, "sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ=="],
|
||||
|
||||
"@types/http-cache-semantics": ["@types/http-cache-semantics@4.0.4", "", {}, "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA=="],
|
||||
|
||||
"@types/jsonfile": ["@types/jsonfile@6.1.4", "", { "dependencies": { "@types/node": "*" } }, "sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ=="],
|
||||
|
||||
"@types/node": ["@types/node@22.9.3", "", { "dependencies": { "undici-types": "~6.19.8" } }, "sha512-F3u1fs/fce3FFk+DAxbxc78DF8x0cY09RRL8GnXLmkJ1jvx3TtPdWoTT5/NiYfI5ASqXBmfqJi9dZ3gxMx4lzw=="],
|
||||
|
||||
"@types/node-fetch": ["@types/node-fetch@2.6.12", "", { "dependencies": { "@types/node": "*", "form-data": "^4.0.0" } }, "sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA=="],
|
||||
|
||||
"@types/progress": ["@types/progress@2.0.7", "", { "dependencies": { "@types/node": "*" } }, "sha512-iadjw02vte8qWx7U0YM++EybBha2CQLPGu9iJ97whVgJUT5Zq9MjAPYUnbfRI2Kpehimf1QjFJYxD0t8nqzu5w=="],
|
||||
|
||||
"@types/semver": ["@types/semver@7.5.8", "", {}, "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ=="],
|
||||
|
||||
"@types/tcp-ping": ["@types/tcp-ping@0.1.6", "", {}, "sha512-1TTOm3cK+0NrZ6uTlY51YERzo5tEW3RybX1594vy9oiZOc1vsVL4LmdiIklDJXYLlzmve5lBkM5GjvwBG1Bc4A=="],
|
||||
|
||||
"@types/update-notifier": ["@types/update-notifier@6.0.8", "", { "dependencies": { "@types/configstore": "*", "boxen": "^7.1.1" } }, "sha512-IlDFnfSVfYQD+cKIg63DEXn3RFmd7W1iYtKQsJodcHK9R1yr8aKbKaPKfBxzPpcHCq2DU8zUq4PIPmy19Thjfg=="],
|
||||
|
||||
"@types/yauzl": ["@types/yauzl@2.10.3", "", { "dependencies": { "@types/node": "*" } }, "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q=="],
|
||||
|
||||
"@types/yazl": ["@types/yazl@2.4.6", "", { "dependencies": { "@types/node": "*" } }, "sha512-/ifFjQtcKaoZOjl5NNCQRR0fAKafB3Foxd7J/WvFPTMea46zekapcR30uzkwIkKAAuq5T6d0dkwz754RFH27hg=="],
|
||||
|
||||
"@xhmikosr/archive-type": ["@xhmikosr/archive-type@7.0.0", "", { "dependencies": { "file-type": "^19.0.0" } }, "sha512-sIm84ZneCOJuiy3PpWR5bxkx3HaNt1pqaN+vncUBZIlPZCq8ASZH+hBVdu5H8znR7qYC6sKwx+ie2Q7qztJTxA=="],
|
||||
|
||||
"@xhmikosr/bin-check": ["@xhmikosr/bin-check@7.0.3", "", { "dependencies": { "execa": "^5.1.1", "isexe": "^2.0.0" } }, "sha512-4UnCLCs8DB+itHJVkqFp9Zjg+w/205/J2j2wNBsCEAm/BuBmtua2hhUOdAMQE47b1c7P9Xmddj0p+X1XVsfHsA=="],
|
||||
@@ -182,6 +217,8 @@
|
||||
|
||||
"arraybuffer.prototype.slice": ["arraybuffer.prototype.slice@1.0.3", "", { "dependencies": { "array-buffer-byte-length": "^1.0.1", "call-bind": "^1.0.5", "define-properties": "^1.2.1", "es-abstract": "^1.22.3", "es-errors": "^1.2.1", "get-intrinsic": "^1.2.3", "is-array-buffer": "^3.0.4", "is-shared-array-buffer": "^1.0.2" } }, "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A=="],
|
||||
|
||||
"async-lock": ["async-lock@1.4.1", "", {}, "sha512-Az2ZTpuytrtqENulXwO3GGv1Bztugx6TT37NIo7imr/Qo0gsYiGtSdBa2B6fsXhTpVZDNfu1Qn3pk531e3q+nQ=="],
|
||||
|
||||
"asynckit": ["asynckit@0.4.0", "", {}, "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="],
|
||||
|
||||
"available-typed-arrays": ["available-typed-arrays@1.0.7", "", { "dependencies": { "possible-typed-array-names": "^1.0.0" } }, "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ=="],
|
||||
@@ -200,7 +237,7 @@
|
||||
|
||||
"bin-version-check": ["bin-version-check@5.1.0", "", { "dependencies": { "bin-version": "^6.0.0", "semver": "^7.5.3", "semver-truncate": "^3.0.0" } }, "sha512-bYsvMqJ8yNGILLz1KP9zKLzQ6YpljV3ln1gqhuLkUtyfGi3qXKGuK2p+U4NAvjVFzDFiBBtOpCOSFNuYYEGZ5g=="],
|
||||
|
||||
"boxen": ["boxen@5.1.2", "", { "dependencies": { "ansi-align": "^3.0.0", "camelcase": "^6.2.0", "chalk": "^4.1.0", "cli-boxes": "^2.2.1", "string-width": "^4.2.2", "type-fest": "^0.20.2", "widest-line": "^3.1.0", "wrap-ansi": "^7.0.0" } }, "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ=="],
|
||||
"boxen": ["boxen@7.1.1", "", { "dependencies": { "ansi-align": "^3.0.1", "camelcase": "^7.0.1", "chalk": "^5.2.0", "cli-boxes": "^3.0.0", "string-width": "^5.1.2", "type-fest": "^2.13.0", "widest-line": "^4.0.1", "wrap-ansi": "^8.1.0" } }, "sha512-2hCgjEmP8YLWQ130n2FerGv7rYpfBmnmp9Uy2Le1vge6X3gZIfSmEzP5QTDElFxcvVcXlEn8Aq6MU/PZygIOog=="],
|
||||
|
||||
"bplist-parser": ["bplist-parser@0.3.2", "", { "dependencies": { "big-integer": "1.6.x" } }, "sha512-apC2+fspHGI3mMKj+dGevkGo/tCqVB8jMb6i+OX+E29p0Iposz07fABkRIfVUPNd5A5VbuOz1bZbnmkKLYF+wQ=="],
|
||||
|
||||
@@ -224,7 +261,7 @@
|
||||
|
||||
"call-bind": ["call-bind@1.0.7", "", { "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.1" } }, "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w=="],
|
||||
|
||||
"camelcase": ["camelcase@6.3.0", "", {}, "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA=="],
|
||||
"camelcase": ["camelcase@7.0.1", "", {}, "sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw=="],
|
||||
|
||||
"cgbi-to-png": ["cgbi-to-png@1.0.7", "", { "dependencies": { "bufferpack": "0.0.6", "crc": "^3.3.0", "stream-to-buffer": "^0.1.0", "streamifier": "^0.1.1" } }, "sha512-YR80kxTPuq9oRpZUdQmNEQWrmTKLINk1cfLVfyrV7Rfr9KLtLJdcockPKbreIr4JYAq+DhHBR7w+WA/tF5VDaQ=="],
|
||||
|
||||
@@ -232,9 +269,11 @@
|
||||
|
||||
"ci-info": ["ci-info@2.0.0", "", {}, "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ=="],
|
||||
|
||||
"clean-git-ref": ["clean-git-ref@2.0.1", "", {}, "sha512-bLSptAy2P0s6hU4PzuIMKmMJJSE6gLXGH1cntDu7bWJUksvuM+7ReOK61mozULErYvP6a15rnYl0zFDef+pyPw=="],
|
||||
|
||||
"cli-arguments": ["cli-arguments@0.2.1", "", {}, "sha512-vaoTjiREjxKlpTNMiaJUkQnYRhgui8r+huhB6mMHcGQyz5F7Hd1o1jsW9C/wRKjlNYQ6fTvODLtZe7DxfEIz8g=="],
|
||||
|
||||
"cli-boxes": ["cli-boxes@2.2.1", "", {}, "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw=="],
|
||||
"cli-boxes": ["cli-boxes@3.0.0", "", {}, "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g=="],
|
||||
|
||||
"cli-cursor": ["cli-cursor@5.0.0", "", { "dependencies": { "restore-cursor": "^5.0.0" } }, "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw=="],
|
||||
|
||||
@@ -264,6 +303,8 @@
|
||||
|
||||
"crc": ["crc@3.8.0", "", { "dependencies": { "buffer": "^5.1.0" } }, "sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ=="],
|
||||
|
||||
"crc-32": ["crc-32@1.2.2", "", { "bin": { "crc32": "bin/crc32.njs" } }, "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ=="],
|
||||
|
||||
"cross-spawn": ["cross-spawn@7.0.3", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w=="],
|
||||
|
||||
"crypto-random-string": ["crypto-random-string@2.0.0", "", {}, "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA=="],
|
||||
@@ -298,11 +339,15 @@
|
||||
|
||||
"delayed-stream": ["delayed-stream@1.0.0", "", {}, "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="],
|
||||
|
||||
"diff3": ["diff3@0.0.3", "", {}, "sha512-iSq8ngPOt0K53A6eVr4d5Kn6GNrM2nQZtC740pzIriHtn4pOQ2lyzEXQMBeVcWERN0ye7fhBsk9PbLLQOnUx/g=="],
|
||||
|
||||
"dot-prop": ["dot-prop@5.3.0", "", { "dependencies": { "is-obj": "^2.0.0" } }, "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q=="],
|
||||
|
||||
"duplexer3": ["duplexer3@0.1.5", "", {}, "sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA=="],
|
||||
|
||||
"emoji-regex": ["emoji-regex@10.4.0", "", {}, "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw=="],
|
||||
"eastasianwidth": ["eastasianwidth@0.2.0", "", {}, "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="],
|
||||
|
||||
"emoji-regex": ["emoji-regex@9.2.2", "", {}, "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg=="],
|
||||
|
||||
"end-of-stream": ["end-of-stream@1.4.4", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q=="],
|
||||
|
||||
@@ -414,12 +459,18 @@
|
||||
|
||||
"human-signals": ["human-signals@2.1.0", "", {}, "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw=="],
|
||||
|
||||
"i18next": ["i18next@24.2.2", "", { "dependencies": { "@babel/runtime": "^7.23.2" }, "peerDependencies": { "typescript": "^5" }, "optionalPeers": ["typescript"] }, "sha512-NE6i86lBCKRYZa5TaUDkU5S4HFgLIEJRLr3Whf2psgaxBleQ2LC1YW1Vc+SCgkAW7VEzndT6al6+CzegSUHcTQ=="],
|
||||
|
||||
"ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="],
|
||||
|
||||
"ignore": ["ignore@5.3.2", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="],
|
||||
|
||||
"import-lazy": ["import-lazy@2.1.0", "", {}, "sha512-m7ZEHgtw69qOGw+jwxXkHlrlIPdTGkyh66zXZ1ajZbxkDBNjSY/LGbmjc7h0s2ELsUDTAhFr55TrPSSqJGPG0A=="],
|
||||
|
||||
"imurmurhash": ["imurmurhash@0.1.4", "", {}, "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="],
|
||||
|
||||
"inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="],
|
||||
|
||||
"ini": ["ini@2.0.0", "", {}, "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA=="],
|
||||
|
||||
"inspect-with-kind": ["inspect-with-kind@1.0.5", "", { "dependencies": { "kind-of": "^6.0.2" } }, "sha512-MAQUJuIo7Xqk8EVNP+6d3CKq9c80hi4tjIbIAT6lmGW9W6WzlHiu9PS8uSuUYU+Do+j1baiFp3H25XEVxDIG2g=="],
|
||||
@@ -488,6 +539,8 @@
|
||||
|
||||
"isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="],
|
||||
|
||||
"isomorphic-git": ["isomorphic-git@1.29.0", "", { "dependencies": { "async-lock": "^1.4.1", "clean-git-ref": "^2.0.1", "crc-32": "^1.2.0", "diff3": "0.0.3", "ignore": "^5.1.4", "minimisted": "^2.0.0", "pako": "^1.0.10", "path-browserify": "^1.0.1", "pify": "^4.0.1", "readable-stream": "^3.4.0", "sha.js": "^2.4.9", "simple-get": "^4.0.1" }, "bin": { "isogit": "cli.cjs" } }, "sha512-zWGqk8901cicvVEhVpN76AwKrS/TzHak2NQCtNXIAavpMIy/yqh+d/JtC9A8AUKZAauUdOyEWKI29tuCLAL+Zg=="],
|
||||
|
||||
"isomorphic-unzip": ["isomorphic-unzip@1.1.5", "", { "dependencies": { "buffer": "^5.0.7", "yauzl": "^2.8.0" } }, "sha512-2McA51lWhmO3Kk438jxVcYeh6L+AOqVnl9XdX1yI7GlLA9RwEyTBgGem1rNuRIU2abAmOiv+IagThdUxASY4IA=="],
|
||||
|
||||
"json-buffer": ["json-buffer@3.0.1", "", {}, "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ=="],
|
||||
@@ -528,12 +581,14 @@
|
||||
|
||||
"mimic-function": ["mimic-function@5.0.1", "", {}, "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA=="],
|
||||
|
||||
"mimic-response": ["mimic-response@1.0.1", "", {}, "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ=="],
|
||||
"mimic-response": ["mimic-response@3.1.0", "", {}, "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="],
|
||||
|
||||
"minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
|
||||
|
||||
"minimist": ["minimist@1.2.8", "", {}, "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="],
|
||||
|
||||
"minimisted": ["minimisted@2.0.1", "", { "dependencies": { "minimist": "^1.2.5" } }, "sha512-1oPjfuLQa2caorJUM8HV8lGgWCc0qqAO1MNv/k05G4qslmsndV/5WdNZrqCiyqiz3wohia2Ij2B7w2Dr7/IyrA=="],
|
||||
|
||||
"mixme": ["mixme@0.5.10", "", {}, "sha512-5H76ANWinB1H3twpJ6JY8uvAtpmFvHNArpilJAjXRKXSDDLPIMoZArw5SH0q9z+lLs8IrMw7Q2VWpWimFKFT1Q=="],
|
||||
|
||||
"mute-stream": ["mute-stream@2.0.0", "", {}, "sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA=="],
|
||||
@@ -566,6 +621,10 @@
|
||||
|
||||
"package-json": ["package-json@6.5.0", "", { "dependencies": { "got": "^9.6.0", "registry-auth-token": "^4.0.0", "registry-url": "^5.0.0", "semver": "^6.2.0" } }, "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ=="],
|
||||
|
||||
"pako": ["pako@1.0.11", "", {}, "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="],
|
||||
|
||||
"path-browserify": ["path-browserify@1.0.1", "", {}, "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="],
|
||||
|
||||
"path-exists": ["path-exists@4.0.0", "", {}, "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="],
|
||||
|
||||
"path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="],
|
||||
@@ -576,6 +635,8 @@
|
||||
|
||||
"picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="],
|
||||
|
||||
"pify": ["pify@4.0.1", "", {}, "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g=="],
|
||||
|
||||
"piscina": ["piscina@4.7.0", "", { "optionalDependencies": { "@napi-rs/nice": "^1.0.1" } }, "sha512-b8hvkpp9zS0zsfa939b/jXbe64Z2gZv0Ha7FYPNUiDIB1y2AtxcOZdfP8xN8HFjUaqQiT9gRlfjAsoL8vdJ1Iw=="],
|
||||
|
||||
"plist": ["plist@3.1.0", "", { "dependencies": { "@xmldom/xmldom": "^0.8.8", "base64-js": "^1.5.1", "xmlbuilder": "^15.1.1" } }, "sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ=="],
|
||||
@@ -604,6 +665,10 @@
|
||||
|
||||
"read": ["read@4.0.0", "", { "dependencies": { "mute-stream": "^2.0.0" } }, "sha512-nbYGT3cec3J5NPUeJia7l72I3oIzMIB6yeNyDqi8CVHr3WftwjrCUqR0j13daoHEMVaZ/rxCpmHKrbods3hI2g=="],
|
||||
|
||||
"readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="],
|
||||
|
||||
"regenerator-runtime": ["regenerator-runtime@0.14.1", "", {}, "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="],
|
||||
|
||||
"regexp.prototype.flags": ["regexp.prototype.flags@1.5.3", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-errors": "^1.3.0", "set-function-name": "^2.0.2" } }, "sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ=="],
|
||||
|
||||
"registry-auth-token": ["registry-auth-token@5.0.2", "", { "dependencies": { "@pnpm/npm-conf": "^2.1.0" } }, "sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ=="],
|
||||
@@ -646,6 +711,8 @@
|
||||
|
||||
"set-function-name": ["set-function-name@2.0.2", "", { "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "functions-have-names": "^1.2.3", "has-property-descriptors": "^1.0.2" } }, "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ=="],
|
||||
|
||||
"sha.js": ["sha.js@2.4.11", "", { "dependencies": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" }, "bin": { "sha.js": "./bin.js" } }, "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ=="],
|
||||
|
||||
"shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="],
|
||||
|
||||
"shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="],
|
||||
@@ -654,6 +721,10 @@
|
||||
|
||||
"signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="],
|
||||
|
||||
"simple-concat": ["simple-concat@1.0.1", "", {}, "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q=="],
|
||||
|
||||
"simple-get": ["simple-get@4.0.1", "", { "dependencies": { "decompress-response": "^6.0.0", "once": "^1.3.1", "simple-concat": "^1.0.0" } }, "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA=="],
|
||||
|
||||
"slash": ["slash@3.0.0", "", {}, "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q=="],
|
||||
|
||||
"smartwrap": ["smartwrap@2.0.2", "", { "dependencies": { "array.prototype.flat": "^1.2.3", "breakword": "^1.0.5", "grapheme-splitter": "^1.0.4", "strip-ansi": "^6.0.0", "wcwidth": "^1.0.1", "yargs": "^15.1.0" }, "bin": { "smartwrap": "src/terminal-adapter.js" } }, "sha512-vCsKNQxb7PnCNd2wY1WClWifAc2lwqsG8OaswpJkVJsvMGcnEntdTCDajZCkk93Ay1U3t/9puJmb525Rg5MZBA=="],
|
||||
@@ -676,7 +747,7 @@
|
||||
|
||||
"streamx": ["streamx@2.20.2", "", { "dependencies": { "fast-fifo": "^1.3.2", "queue-tick": "^1.0.1", "text-decoder": "^1.1.0" }, "optionalDependencies": { "bare-events": "^2.2.0" } }, "sha512-aDGDLU+j9tJcUdPGOaHmVF1u/hhI+CsGkT02V3OKlHDV7IukOI+nTWAGkiZEKCO35rWN1wIr4tS7YFr1f4qSvA=="],
|
||||
|
||||
"string-width": ["string-width@7.2.0", "", { "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", "strip-ansi": "^7.1.0" } }, "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ=="],
|
||||
"string-width": ["string-width@5.1.2", "", { "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", "strip-ansi": "^7.0.1" } }, "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA=="],
|
||||
|
||||
"string.prototype.trim": ["string.prototype.trim@1.2.9", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.0", "es-object-atoms": "^1.0.0" } }, "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw=="],
|
||||
|
||||
@@ -684,6 +755,8 @@
|
||||
|
||||
"string.prototype.trimstart": ["string.prototype.trimstart@1.0.8", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" } }, "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg=="],
|
||||
|
||||
"string_decoder": ["string_decoder@1.3.0", "", { "dependencies": { "safe-buffer": "~5.2.0" } }, "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA=="],
|
||||
|
||||
"strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="],
|
||||
|
||||
"strip-dirs": ["strip-dirs@3.0.0", "", { "dependencies": { "inspect-with-kind": "^1.0.5", "is-plain-obj": "^1.1.0" } }, "sha512-I0sdgcFTfKQlUPZyAqPJmSG3HLO9rWDFnxonnIbskYNM3DwFOeTNB5KzVq3dA1GdRAc/25b5Y7UO2TQfKWw4aQ=="],
|
||||
@@ -714,7 +787,7 @@
|
||||
|
||||
"tty-table": ["tty-table@4.2.3", "", { "dependencies": { "chalk": "^4.1.2", "csv": "^5.5.3", "kleur": "^4.1.5", "smartwrap": "^2.0.2", "strip-ansi": "^6.0.1", "wcwidth": "^1.0.1", "yargs": "^17.7.1" }, "bin": { "tty-table": "adapters/terminal-adapter.js" } }, "sha512-Fs15mu0vGzCrj8fmJNP7Ynxt5J7praPXqFN0leZeZBXJwkMxv9cb2D454k1ltrtUSJbZ4yH4e0CynsHLxmUfFA=="],
|
||||
|
||||
"type-fest": ["type-fest@0.20.2", "", {}, "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ=="],
|
||||
"type-fest": ["type-fest@2.19.0", "", {}, "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA=="],
|
||||
|
||||
"typed-array-buffer": ["typed-array-buffer@1.0.2", "", { "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", "is-typed-array": "^1.1.13" } }, "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ=="],
|
||||
|
||||
@@ -744,6 +817,8 @@
|
||||
|
||||
"url-parse-lax": ["url-parse-lax@3.0.0", "", { "dependencies": { "prepend-http": "^2.0.0" } }, "sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ=="],
|
||||
|
||||
"util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="],
|
||||
|
||||
"wcwidth": ["wcwidth@1.0.1", "", { "dependencies": { "defaults": "^1.0.3" } }, "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg=="],
|
||||
|
||||
"webidl-conversions": ["webidl-conversions@3.0.1", "", {}, "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="],
|
||||
@@ -758,9 +833,9 @@
|
||||
|
||||
"which-typed-array": ["which-typed-array@1.1.15", "", { "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", "has-tostringtag": "^1.0.2" } }, "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA=="],
|
||||
|
||||
"widest-line": ["widest-line@3.1.0", "", { "dependencies": { "string-width": "^4.0.0" } }, "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg=="],
|
||||
"widest-line": ["widest-line@4.0.1", "", { "dependencies": { "string-width": "^5.0.1" } }, "sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig=="],
|
||||
|
||||
"wrap-ansi": ["wrap-ansi@7.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="],
|
||||
"wrap-ansi": ["wrap-ansi@8.1.0", "", { "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } }, "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ=="],
|
||||
|
||||
"wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="],
|
||||
|
||||
@@ -790,15 +865,17 @@
|
||||
|
||||
"ansi-align/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
|
||||
|
||||
"boxen/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
|
||||
"boxen/chalk": ["chalk@5.3.0", "", {}, "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w=="],
|
||||
|
||||
"cacheable-request/mimic-response": ["mimic-response@4.0.0", "", {}, "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg=="],
|
||||
|
||||
"cliui/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
|
||||
|
||||
"config-chain/ini": ["ini@1.3.8", "", {}, "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="],
|
||||
"cliui/wrap-ansi": ["wrap-ansi@7.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="],
|
||||
|
||||
"decompress-response/mimic-response": ["mimic-response@3.1.0", "", {}, "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="],
|
||||
"clone-response/mimic-response": ["mimic-response@1.0.1", "", {}, "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ=="],
|
||||
|
||||
"config-chain/ini": ["ini@1.3.8", "", {}, "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="],
|
||||
|
||||
"file-type/get-stream": ["get-stream@9.0.1", "", { "dependencies": { "@sec-ant/readable-stream": "^0.4.1", "is-stream": "^4.0.1" } }, "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA=="],
|
||||
|
||||
@@ -812,6 +889,8 @@
|
||||
|
||||
"ora/chalk": ["chalk@5.3.0", "", {}, "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w=="],
|
||||
|
||||
"ora/string-width": ["string-width@7.2.0", "", { "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", "strip-ansi": "^7.1.0" } }, "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ=="],
|
||||
|
||||
"ora/strip-ansi": ["strip-ansi@7.1.0", "", { "dependencies": { "ansi-regex": "^6.0.1" } }, "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ=="],
|
||||
|
||||
"package-json/got": ["got@9.6.0", "", { "dependencies": { "@sindresorhus/is": "^0.14.0", "@szmarczak/http-timer": "^1.1.2", "cacheable-request": "^6.0.0", "decompress-response": "^3.3.0", "duplexer3": "^0.1.4", "get-stream": "^4.1.0", "lowercase-keys": "^1.0.1", "mimic-response": "^1.0.1", "p-cancelable": "^1.0.0", "to-readable-stream": "^1.0.0", "url-parse-lax": "^3.0.0" } }, "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q=="],
|
||||
@@ -834,9 +913,11 @@
|
||||
|
||||
"string-width/strip-ansi": ["strip-ansi@7.1.0", "", { "dependencies": { "ansi-regex": "^6.0.1" } }, "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ=="],
|
||||
|
||||
"widest-line/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
|
||||
"update-notifier/boxen": ["boxen@5.1.2", "", { "dependencies": { "ansi-align": "^3.0.0", "camelcase": "^6.2.0", "chalk": "^4.1.0", "cli-boxes": "^2.2.1", "string-width": "^4.2.2", "type-fest": "^0.20.2", "widest-line": "^3.1.0", "wrap-ansi": "^7.0.0" } }, "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ=="],
|
||||
|
||||
"wrap-ansi/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
|
||||
"wrap-ansi/ansi-styles": ["ansi-styles@6.2.1", "", {}, "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug=="],
|
||||
|
||||
"wrap-ansi/strip-ansi": ["strip-ansi@7.1.0", "", { "dependencies": { "ansi-regex": "^6.0.1" } }, "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ=="],
|
||||
|
||||
"yargs/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
|
||||
|
||||
@@ -844,12 +925,12 @@
|
||||
|
||||
"ansi-align/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
|
||||
|
||||
"boxen/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
|
||||
|
||||
"cliui/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
|
||||
|
||||
"file-type/get-stream/is-stream": ["is-stream@4.0.1", "", {}, "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A=="],
|
||||
|
||||
"ora/string-width/emoji-regex": ["emoji-regex@10.4.0", "", {}, "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw=="],
|
||||
|
||||
"ora/strip-ansi/ansi-regex": ["ansi-regex@6.1.0", "", {}, "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA=="],
|
||||
|
||||
"package-json/got/@sindresorhus/is": ["@sindresorhus/is@0.14.0", "", {}, "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ=="],
|
||||
@@ -864,6 +945,8 @@
|
||||
|
||||
"package-json/got/lowercase-keys": ["lowercase-keys@1.0.1", "", {}, "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA=="],
|
||||
|
||||
"package-json/got/mimic-response": ["mimic-response@1.0.1", "", {}, "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ=="],
|
||||
|
||||
"package-json/got/p-cancelable": ["p-cancelable@1.1.0", "", {}, "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw=="],
|
||||
|
||||
"smartwrap/yargs/cliui": ["cliui@6.0.0", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^6.2.0" } }, "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ=="],
|
||||
@@ -876,9 +959,19 @@
|
||||
|
||||
"string-width/strip-ansi/ansi-regex": ["ansi-regex@6.1.0", "", {}, "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA=="],
|
||||
|
||||
"widest-line/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
|
||||
"update-notifier/boxen/camelcase": ["camelcase@6.3.0", "", {}, "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA=="],
|
||||
|
||||
"wrap-ansi/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
|
||||
"update-notifier/boxen/cli-boxes": ["cli-boxes@2.2.1", "", {}, "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw=="],
|
||||
|
||||
"update-notifier/boxen/string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
|
||||
|
||||
"update-notifier/boxen/type-fest": ["type-fest@0.20.2", "", {}, "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ=="],
|
||||
|
||||
"update-notifier/boxen/widest-line": ["widest-line@3.1.0", "", { "dependencies": { "string-width": "^4.0.0" } }, "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg=="],
|
||||
|
||||
"update-notifier/boxen/wrap-ansi": ["wrap-ansi@7.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="],
|
||||
|
||||
"wrap-ansi/strip-ansi/ansi-regex": ["ansi-regex@6.1.0", "", {}, "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA=="],
|
||||
|
||||
"yargs/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
|
||||
|
||||
@@ -900,6 +993,8 @@
|
||||
|
||||
"smartwrap/yargs/yargs-parser/camelcase": ["camelcase@5.3.1", "", {}, "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg=="],
|
||||
|
||||
"update-notifier/boxen/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
|
||||
|
||||
"package-json/got/cacheable-request/keyv/json-buffer": ["json-buffer@3.0.0", "", {}, "sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ=="],
|
||||
|
||||
"package-json/got/cacheable-request/responselike/lowercase-keys": ["lowercase-keys@1.0.1", "", {}, "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA=="],
|
||||
|
12
cli.json
12
cli.json
@@ -145,6 +145,18 @@
|
||||
},
|
||||
"sourcemap": {
|
||||
"default": false
|
||||
},
|
||||
"taro": {
|
||||
"default": false
|
||||
},
|
||||
"expo": {
|
||||
"default": false
|
||||
},
|
||||
"rncli": {
|
||||
"default": false
|
||||
},
|
||||
"disableHermes": {
|
||||
"default": false
|
||||
}
|
||||
}
|
||||
},
|
||||
|
16
package.json
16
package.json
@@ -1,10 +1,11 @@
|
||||
{
|
||||
"name": "react-native-update-cli",
|
||||
"version": "1.38.1",
|
||||
"version": "1.42.0",
|
||||
"description": "Command tools for javaScript updater with `pushy` service for react native apps.",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
"pushy": "lib/index.js"
|
||||
"pushy": "lib/index.js",
|
||||
"cresc": "lib/index.js"
|
||||
},
|
||||
"files": [
|
||||
"lib",
|
||||
@@ -46,6 +47,8 @@
|
||||
"form-data": "^4.0.1",
|
||||
"fs-extra": "8",
|
||||
"gradle-to-js": "^2.0.1",
|
||||
"i18next": "^24.2.2",
|
||||
"isomorphic-git": "^1.29.0",
|
||||
"isomorphic-unzip": "^1.1.5",
|
||||
"node-fetch": "^2.6.1",
|
||||
"plist": "^3.1.0",
|
||||
@@ -66,7 +69,16 @@
|
||||
"@biomejs/biome": "^1.9.4",
|
||||
"@swc/cli": "^0.5.1",
|
||||
"@swc/core": "^1.9.3",
|
||||
"@types/filesize-parser": "^1.5.3",
|
||||
"@types/fs-extra": "^11.0.4",
|
||||
"@types/node": "^22.9.3",
|
||||
"@types/node-fetch": "^2.6.12",
|
||||
"@types/progress": "^2.0.7",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@types/tcp-ping": "^0.1.6",
|
||||
"@types/update-notifier": "^6.0.8",
|
||||
"@types/yauzl": "^2.10.3",
|
||||
"@types/yazl": "^2.4.6",
|
||||
"typescript": "^5.7.2"
|
||||
}
|
||||
}
|
||||
|
31
src/api.ts
31
src/api.ts
@@ -6,7 +6,7 @@ import ProgressBar from 'progress';
|
||||
import packageJson from '../package.json';
|
||||
import tcpp from 'tcp-ping';
|
||||
import filesizeParser from 'filesize-parser';
|
||||
import { pricingPageUrl } from './utils';
|
||||
import { pricingPageUrl, credentialFile, IS_CRESC } from './utils/constants';
|
||||
import type { Session } from 'types';
|
||||
import FormData from 'form-data';
|
||||
|
||||
@@ -15,8 +15,12 @@ const tcpPing = util.promisify(tcpp.ping);
|
||||
let session: Session | undefined;
|
||||
let savedSession: Session | undefined;
|
||||
|
||||
const defaultEndpoint = 'https://update.reactnative.cn/api';
|
||||
let host = process.env.PUSHY_REGISTRY || defaultEndpoint;
|
||||
const defaultEndpoint = IS_CRESC
|
||||
? 'https://api.cresc.dev'
|
||||
: 'https://update.reactnative.cn/api';
|
||||
|
||||
const host =
|
||||
process.env.PUSHY_REGISTRY || process.env.RNU_API || defaultEndpoint;
|
||||
|
||||
const userAgent = `react-native-update-cli/${packageJson.version}`;
|
||||
|
||||
@@ -27,13 +31,13 @@ export const replaceSession = (newSession: { token: string }) => {
|
||||
};
|
||||
|
||||
export const loadSession = async () => {
|
||||
if (fs.existsSync('.update')) {
|
||||
if (fs.existsSync(credentialFile)) {
|
||||
try {
|
||||
replaceSession(JSON.parse(fs.readFileSync('.update', 'utf8')));
|
||||
replaceSession(JSON.parse(fs.readFileSync(credentialFile, 'utf8')));
|
||||
savedSession = session;
|
||||
} catch (e) {
|
||||
console.error(
|
||||
'Failed to parse file `.update`. Try to remove it manually.',
|
||||
`Failed to parse file ${credentialFile}. Try to remove it manually.`,
|
||||
);
|
||||
throw e;
|
||||
}
|
||||
@@ -45,18 +49,17 @@ export const saveSession = () => {
|
||||
if (session !== savedSession) {
|
||||
const current = session;
|
||||
const data = JSON.stringify(current, null, 4);
|
||||
fs.writeFileSync('.update', data, 'utf8');
|
||||
fs.writeFileSync(credentialFile, data, 'utf8');
|
||||
savedSession = current;
|
||||
}
|
||||
};
|
||||
|
||||
export const closeSession = () => {
|
||||
if (fs.existsSync('.update')) {
|
||||
fs.unlinkSync('.update');
|
||||
if (fs.existsSync(credentialFile)) {
|
||||
fs.unlinkSync(credentialFile);
|
||||
savedSession = undefined;
|
||||
}
|
||||
session = undefined;
|
||||
host = process.env.PUSHY_REGISTRY || defaultEndpoint;
|
||||
};
|
||||
|
||||
async function query(url: string, options: fetch.RequestInit) {
|
||||
@@ -121,7 +124,7 @@ export async function uploadFile(fn: string, key?: string) {
|
||||
timeout: 1000,
|
||||
});
|
||||
// console.log({pingResult});
|
||||
if (isNaN(pingResult.avg) || pingResult.avg > 150) {
|
||||
if (Number.isNaN(pingResult.avg) || pingResult.avg > 150) {
|
||||
realUrl = backupUrl;
|
||||
}
|
||||
}
|
||||
@@ -137,7 +140,7 @@ export async function uploadFile(fn: string, key?: string) {
|
||||
);
|
||||
}
|
||||
|
||||
const bar = new ProgressBar(' 上传中 [:bar] :percent :etas', {
|
||||
const bar = new ProgressBar(' Uploading [:bar] :percent :etas', {
|
||||
complete: '=',
|
||||
incomplete: ' ',
|
||||
total: fileSize,
|
||||
@@ -145,9 +148,9 @@ export async function uploadFile(fn: string, key?: string) {
|
||||
|
||||
const form = new FormData();
|
||||
|
||||
Object.entries(formData).forEach(([k, v]) => {
|
||||
for (const [k, v] of Object.entries(formData)) {
|
||||
form.append(k, v);
|
||||
});
|
||||
}
|
||||
const fileStream = fs.createReadStream(fn);
|
||||
fileStream.on('data', (data) => {
|
||||
bar.tick(data.length);
|
||||
|
@@ -3,6 +3,7 @@ import fs from 'node:fs';
|
||||
import Table from 'tty-table';
|
||||
|
||||
import { post, get, doDelete } from './api';
|
||||
import type { Platform } from './types';
|
||||
|
||||
const validPlatforms = {
|
||||
ios: 1,
|
||||
@@ -10,14 +11,14 @@ const validPlatforms = {
|
||||
harmony: 1,
|
||||
};
|
||||
|
||||
export function checkPlatform(platform) {
|
||||
export function checkPlatform(platform: Platform) {
|
||||
if (!validPlatforms[platform]) {
|
||||
throw new Error(`无法识别的平台 '${platform}'`);
|
||||
}
|
||||
return platform;
|
||||
}
|
||||
|
||||
export function getSelectedApp(platform) {
|
||||
export function getSelectedApp(platform: Platform) {
|
||||
checkPlatform(platform);
|
||||
|
||||
if (!fs.existsSync('update.json')) {
|
||||
@@ -34,7 +35,7 @@ export function getSelectedApp(platform) {
|
||||
return updateInfo[platform];
|
||||
}
|
||||
|
||||
export async function listApp(platform) {
|
||||
export async function listApp(platform: Platform) {
|
||||
const { data } = await get('/app/list');
|
||||
const list = platform ? data.filter((v) => v.platform === platform) : data;
|
||||
|
||||
@@ -58,12 +59,12 @@ export async function listApp(platform) {
|
||||
return list;
|
||||
}
|
||||
|
||||
export async function chooseApp(platform) {
|
||||
export async function chooseApp(platform: Platform) {
|
||||
const list = await listApp(platform);
|
||||
|
||||
while (true) {
|
||||
const id = await question('输入应用 id:');
|
||||
const app = list.find((v) => v.id === (id | 0));
|
||||
const app = list.find((v) => v.id === Number(id));
|
||||
if (app) {
|
||||
return app;
|
||||
}
|
@@ -1,17 +1,20 @@
|
||||
import path from 'node:path';
|
||||
import { getRNVersion, translateOptions } from './utils';
|
||||
import { translateOptions } from './utils';
|
||||
import * as fs from 'fs-extra';
|
||||
import { ZipFile } from 'yazl';
|
||||
import { open as openZipFile } from 'yauzl';
|
||||
import { question, printVersionCommand } from './utils';
|
||||
import { question, checkPlugins } from './utils';
|
||||
import { checkPlatform } from './app';
|
||||
import { spawn, spawnSync } from 'node:child_process';
|
||||
import semverSatisfies from 'semver/functions/satisfies';
|
||||
const g2js = require('gradle-to-js/lib/parser');
|
||||
import os from 'os';
|
||||
import os from 'node:os';
|
||||
const properties = require('properties');
|
||||
const path = require('path');
|
||||
import { depVersions } from './utils/dep-versions';
|
||||
|
||||
let bsdiff, hdiff, diff;
|
||||
let bsdiff;
|
||||
let hdiff;
|
||||
let diff;
|
||||
try {
|
||||
bsdiff = require('node-bsdiff').diff;
|
||||
} catch (e) {}
|
||||
@@ -20,16 +23,35 @@ try {
|
||||
hdiff = require('node-hdiffpatch').diff;
|
||||
} catch (e) {}
|
||||
|
||||
async function runReactNativeBundleCommand(
|
||||
async function runReactNativeBundleCommand({
|
||||
bundleName,
|
||||
development,
|
||||
dev,
|
||||
entryFile,
|
||||
outputFolder,
|
||||
platform,
|
||||
sourcemapOutput,
|
||||
config,
|
||||
) {
|
||||
let gradleConfig = {};
|
||||
disableHermes,
|
||||
cli,
|
||||
}: {
|
||||
bundleName: string;
|
||||
dev: string;
|
||||
entryFile: string;
|
||||
outputFolder: string;
|
||||
platform: string;
|
||||
sourcemapOutput: string;
|
||||
config?: string;
|
||||
disableHermes?: boolean;
|
||||
cli: {
|
||||
taro?: boolean;
|
||||
expo?: boolean;
|
||||
rncli?: boolean;
|
||||
};
|
||||
}) {
|
||||
let gradleConfig: {
|
||||
crunchPngs?: boolean;
|
||||
enableHermes?: boolean;
|
||||
} = {};
|
||||
if (platform === 'android') {
|
||||
gradleConfig = await checkGradleConfig();
|
||||
if (gradleConfig.crunchPngs !== false) {
|
||||
@@ -39,9 +61,9 @@ async function runReactNativeBundleCommand(
|
||||
}
|
||||
}
|
||||
|
||||
let reactNativeBundleArgs = [];
|
||||
const reactNativeBundleArgs: string[] = [];
|
||||
|
||||
let envArgs = process.env.PUSHY_ENV_ARGS;
|
||||
const envArgs = process.env.PUSHY_ENV_ARGS;
|
||||
|
||||
if (envArgs) {
|
||||
Array.prototype.push.apply(
|
||||
@@ -52,15 +74,33 @@ async function runReactNativeBundleCommand(
|
||||
|
||||
fs.emptyDirSync(outputFolder);
|
||||
|
||||
let cliPath;
|
||||
|
||||
let cliPath: string | undefined;
|
||||
let usingExpo = false;
|
||||
try {
|
||||
cliPath = require.resolve('@expo/cli', {
|
||||
paths: [process.cwd()],
|
||||
});
|
||||
usingExpo = true;
|
||||
} catch (e) {
|
||||
|
||||
const getExpoCli = () => {
|
||||
try {
|
||||
cliPath = require.resolve('@expo/cli', {
|
||||
paths: [process.cwd()],
|
||||
});
|
||||
const expoCliVersion = JSON.parse(
|
||||
fs
|
||||
.readFileSync(
|
||||
require.resolve('@expo/cli/package.json', {
|
||||
paths: [process.cwd()],
|
||||
}),
|
||||
)
|
||||
.toString(),
|
||||
).version;
|
||||
// expo cli 0.10.17 (expo 49) 开始支持 bundle:embed
|
||||
if (semverSatisfies(expoCliVersion, '>= 0.10.17')) {
|
||||
usingExpo = true;
|
||||
} else {
|
||||
cliPath = undefined;
|
||||
}
|
||||
} catch (e) {}
|
||||
};
|
||||
|
||||
const getRnCli = () => {
|
||||
try {
|
||||
// rn >= 0.75
|
||||
cliPath = require.resolve('@react-native-community/cli/build/bin.js', {
|
||||
@@ -72,14 +112,49 @@ async function runReactNativeBundleCommand(
|
||||
paths: [process.cwd()],
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const getTaroCli = () => {
|
||||
try {
|
||||
cliPath = require.resolve('@tarojs/cli/bin/taro', {
|
||||
paths: [process.cwd()],
|
||||
});
|
||||
} catch (e) {}
|
||||
};
|
||||
|
||||
if (cli.expo) {
|
||||
getExpoCli();
|
||||
} else if (cli.taro) {
|
||||
getTaroCli();
|
||||
} else if (cli.rncli) {
|
||||
getRnCli();
|
||||
}
|
||||
const bundleCommand = usingExpo ? 'export:embed' : platform === 'harmony' ? 'bundle-harmony' : 'bundle';
|
||||
if (platform == 'harmony') {
|
||||
|
||||
if (!cliPath) {
|
||||
getExpoCli();
|
||||
if (!usingExpo) {
|
||||
getRnCli();
|
||||
}
|
||||
}
|
||||
|
||||
const bundleParams = await checkPlugins();
|
||||
const isSentry = bundleParams.sentry;
|
||||
|
||||
let bundleCommand = 'bundle';
|
||||
if (usingExpo) {
|
||||
bundleCommand = 'export:embed';
|
||||
} else if (platform === 'harmony') {
|
||||
bundleCommand = 'bundle-harmony';
|
||||
} else if (cli.taro) {
|
||||
bundleCommand = 'build';
|
||||
}
|
||||
|
||||
if (platform === 'harmony') {
|
||||
Array.prototype.push.apply(reactNativeBundleArgs, [
|
||||
cliPath,
|
||||
bundleCommand,
|
||||
'--dev',
|
||||
development,
|
||||
dev,
|
||||
'--entry-file',
|
||||
entryFile,
|
||||
]);
|
||||
@@ -91,8 +166,7 @@ async function runReactNativeBundleCommand(
|
||||
if (config) {
|
||||
reactNativeBundleArgs.push('--config', config);
|
||||
}
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
Array.prototype.push.apply(reactNativeBundleArgs, [
|
||||
cliPath,
|
||||
bundleCommand,
|
||||
@@ -100,15 +174,17 @@ async function runReactNativeBundleCommand(
|
||||
outputFolder,
|
||||
'--bundle-output',
|
||||
path.join(outputFolder, bundleName),
|
||||
'--dev',
|
||||
development,
|
||||
'--entry-file',
|
||||
entryFile,
|
||||
'--platform',
|
||||
platform,
|
||||
'--reset-cache',
|
||||
]);
|
||||
|
||||
if (cli.taro) {
|
||||
reactNativeBundleArgs.push(...['--type', 'rn']);
|
||||
} else {
|
||||
reactNativeBundleArgs.push(...['--dev', dev, '--entry-file', entryFile]);
|
||||
}
|
||||
|
||||
if (sourcemapOutput) {
|
||||
reactNativeBundleArgs.push('--sourcemap-output', sourcemapOutput);
|
||||
}
|
||||
@@ -140,17 +216,22 @@ async function runReactNativeBundleCommand(
|
||||
),
|
||||
);
|
||||
} else {
|
||||
let hermesEnabled = false;
|
||||
let hermesEnabled: boolean | undefined = false;
|
||||
|
||||
if (platform === 'android') {
|
||||
const gradlePropeties = await new Promise((resolve) => {
|
||||
if (disableHermes) {
|
||||
hermesEnabled = false;
|
||||
console.log('Hermes disabled');
|
||||
} else if (platform === 'android') {
|
||||
const gradlePropeties = await new Promise<{
|
||||
hermesEnabled?: boolean;
|
||||
}>((resolve) => {
|
||||
properties.parse(
|
||||
'./android/gradle.properties',
|
||||
{ path: true },
|
||||
function (error, props) {
|
||||
(error: any, props: { hermesEnabled?: boolean }) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
resolve(null);
|
||||
resolve({});
|
||||
}
|
||||
|
||||
resolve(props);
|
||||
@@ -166,7 +247,7 @@ async function runReactNativeBundleCommand(
|
||||
fs.existsSync('ios/Pods/hermes-engine')
|
||||
) {
|
||||
hermesEnabled = true;
|
||||
}else if (platform === 'harmony') {
|
||||
} else if (platform === 'harmony') {
|
||||
await copyHarmonyBundle(outputFolder);
|
||||
}
|
||||
if (hermesEnabled) {
|
||||
@@ -174,6 +255,7 @@ async function runReactNativeBundleCommand(
|
||||
bundleName,
|
||||
outputFolder,
|
||||
sourcemapOutput,
|
||||
!isSentry,
|
||||
);
|
||||
}
|
||||
resolve(null);
|
||||
@@ -182,7 +264,7 @@ async function runReactNativeBundleCommand(
|
||||
});
|
||||
}
|
||||
|
||||
async function copyHarmonyBundle(outputFolder) {
|
||||
async function copyHarmonyBundle(outputFolder: string) {
|
||||
const harmonyRawPath = 'harmony/entry/src/main/resources/rawfile';
|
||||
try {
|
||||
await fs.ensureDir(harmonyRawPath);
|
||||
@@ -196,7 +278,7 @@ async function copyHarmonyBundle(outputFolder) {
|
||||
|
||||
await fs.ensureDir(outputFolder);
|
||||
await fs.copy(harmonyRawPath, outputFolder);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error('copyHarmonyBundle 错误:', error);
|
||||
throw new Error(`复制文件失败: ${error.message}`);
|
||||
}
|
||||
@@ -210,7 +292,7 @@ function getHermesOSBin() {
|
||||
|
||||
async function checkGradleConfig() {
|
||||
let enableHermes = false;
|
||||
let crunchPngs;
|
||||
let crunchPngs: boolean | undefined;
|
||||
try {
|
||||
const gradleConfig = await g2js.parseFile('android/app/build.gradle');
|
||||
crunchPngs = gradleConfig.android.buildTypes.release.crunchPngs;
|
||||
@@ -234,11 +316,12 @@ async function checkGradleConfig() {
|
||||
}
|
||||
|
||||
async function compileHermesByteCode(
|
||||
bundleName,
|
||||
outputFolder,
|
||||
sourcemapOutput,
|
||||
bundleName: string,
|
||||
outputFolder: string,
|
||||
sourcemapOutput: string,
|
||||
shouldCleanSourcemap: boolean,
|
||||
) {
|
||||
console.log(`Hermes enabled, now compiling to hermes bytecode:\n`);
|
||||
console.log('Hermes enabled, now compiling to hermes bytecode:\n');
|
||||
// >= rn 0.69
|
||||
const rnDir = path.dirname(
|
||||
require.resolve('react-native', {
|
||||
@@ -264,13 +347,11 @@ async function compileHermesByteCode(
|
||||
if (sourcemapOutput) {
|
||||
fs.copyFileSync(
|
||||
sourcemapOutput,
|
||||
path.join(outputFolder, bundleName + '.txt.map'),
|
||||
path.join(outputFolder, `${bundleName}.txt.map`),
|
||||
);
|
||||
args.push('-output-source-map');
|
||||
}
|
||||
console.log(
|
||||
'Running hermesc: ' + hermesCommand + ' ' + args.join(' ') + '\n',
|
||||
);
|
||||
console.log(`Running hermesc: ${hermesCommand} ${args.join(' ')}`);
|
||||
spawnSync(hermesCommand, args, {
|
||||
stdio: 'ignore',
|
||||
});
|
||||
@@ -280,13 +361,13 @@ async function compileHermesByteCode(
|
||||
if (!fs.existsSync(composerPath)) {
|
||||
return;
|
||||
}
|
||||
console.log(`Composing source map`);
|
||||
console.log('Composing source map');
|
||||
spawnSync(
|
||||
'node',
|
||||
[
|
||||
composerPath,
|
||||
path.join(outputFolder, bundleName + '.txt.map'),
|
||||
path.join(outputFolder, bundleName + '.map'),
|
||||
path.join(outputFolder, `${bundleName}.txt.map`),
|
||||
path.join(outputFolder, `${bundleName}.map`),
|
||||
'-o',
|
||||
sourcemapOutput,
|
||||
],
|
||||
@@ -295,22 +376,120 @@ async function compileHermesByteCode(
|
||||
},
|
||||
);
|
||||
}
|
||||
fs.removeSync(path.join(outputFolder, bundleName + '.txt.map'));
|
||||
if (shouldCleanSourcemap) {
|
||||
fs.removeSync(path.join(outputFolder, `${bundleName}.txt.map`));
|
||||
}
|
||||
}
|
||||
|
||||
async function pack(dir, output) {
|
||||
async function copyDebugidForSentry(
|
||||
bundleName: string,
|
||||
outputFolder: string,
|
||||
sourcemapOutput: string,
|
||||
) {
|
||||
if (sourcemapOutput) {
|
||||
let copyDebugidPath;
|
||||
try {
|
||||
copyDebugidPath = require.resolve(
|
||||
'@sentry/react-native/scripts/copy-debugid.js',
|
||||
{
|
||||
paths: [process.cwd()],
|
||||
},
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(
|
||||
'无法找到 Sentry copy-debugid.js 脚本文件,请确保已正确安装 @sentry/react-native',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fs.existsSync(copyDebugidPath)) {
|
||||
return;
|
||||
}
|
||||
console.log('Copying debugid');
|
||||
spawnSync(
|
||||
'node',
|
||||
[
|
||||
copyDebugidPath,
|
||||
path.join(outputFolder, `${bundleName}.txt.map`),
|
||||
path.join(outputFolder, `${bundleName}.map`),
|
||||
],
|
||||
{
|
||||
stdio: 'ignore',
|
||||
},
|
||||
);
|
||||
}
|
||||
fs.removeSync(path.join(outputFolder, `${bundleName}.txt.map`));
|
||||
}
|
||||
|
||||
async function uploadSourcemapForSentry(
|
||||
bundleName: string,
|
||||
outputFolder: string,
|
||||
sourcemapOutput: string,
|
||||
version: string,
|
||||
) {
|
||||
if (sourcemapOutput) {
|
||||
let sentryCliPath;
|
||||
try {
|
||||
sentryCliPath = require.resolve('@sentry/cli/bin/sentry-cli', {
|
||||
paths: [process.cwd()],
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('无法找到 Sentry CLI 工具,请确保已正确安装 @sentry/cli');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fs.existsSync(sentryCliPath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
spawnSync(
|
||||
'node',
|
||||
[sentryCliPath, 'releases', 'set-commits', version, '--auto'],
|
||||
{
|
||||
stdio: 'inherit',
|
||||
},
|
||||
);
|
||||
console.log(`Sentry release created for version: ${version}`);
|
||||
|
||||
console.log('Uploading sourcemap');
|
||||
spawnSync(
|
||||
'node',
|
||||
[
|
||||
sentryCliPath,
|
||||
'releases',
|
||||
'files',
|
||||
version,
|
||||
'upload-sourcemaps',
|
||||
'--strip-prefix',
|
||||
path.join(process.cwd(), outputFolder),
|
||||
path.join(outputFolder, bundleName),
|
||||
path.join(outputFolder, `${bundleName}.map`),
|
||||
],
|
||||
{
|
||||
stdio: 'inherit',
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const ignorePackingFileNames = ['.', '..', 'index.bundlejs.map'];
|
||||
const ignorePackingExtensions = ['DS_Store'];
|
||||
async function pack(dir: string, output: string) {
|
||||
console.log('Packing');
|
||||
fs.ensureDirSync(path.dirname(output));
|
||||
await new Promise((resolve, reject) => {
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
const zipfile = new ZipFile();
|
||||
|
||||
function addDirectory(root, rel) {
|
||||
function addDirectory(root: string, rel: string) {
|
||||
if (rel) {
|
||||
zipfile.addEmptyDirectory(rel);
|
||||
}
|
||||
const childs = fs.readdirSync(root);
|
||||
for (const name of childs) {
|
||||
if (name === '.' || name === '..' || name === 'index.bundlejs.map') {
|
||||
if (
|
||||
ignorePackingFileNames.includes(name) ||
|
||||
ignorePackingExtensions.some((ext) => name.endsWith(`.${ext}`))
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
const fullPath = path.join(root, name);
|
||||
@@ -320,30 +499,28 @@ async function pack(dir, output) {
|
||||
zipfile.addFile(fullPath, rel + name);
|
||||
} else if (stat.isDirectory()) {
|
||||
//console.log('adding: ' + rel+name+'/');
|
||||
addDirectory(fullPath, rel + name + '/');
|
||||
addDirectory(fullPath, `${rel}${name}/`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addDirectory(dir, '');
|
||||
|
||||
zipfile.outputStream.on('error', (err) => reject(err));
|
||||
zipfile.outputStream
|
||||
.pipe(fs.createWriteStream(output))
|
||||
.on('close', function () {
|
||||
resolve();
|
||||
});
|
||||
zipfile.outputStream.on('error', (err: any) => reject(err));
|
||||
zipfile.outputStream.pipe(fs.createWriteStream(output)).on('close', () => {
|
||||
resolve();
|
||||
});
|
||||
zipfile.end();
|
||||
});
|
||||
console.log('ppk热更包已生成并保存到: ' + output);
|
||||
console.log(`ppk热更包已生成并保存到: ${output}`);
|
||||
}
|
||||
|
||||
export function readEntire(entry, zipFile) {
|
||||
const buffers = [];
|
||||
export function readEntire(entry: string, zipFile: ZipFile) {
|
||||
const buffers: Buffer[] = [];
|
||||
return new Promise((resolve, reject) => {
|
||||
zipFile.openReadStream(entry, (err, stream) => {
|
||||
zipFile.openReadStream(entry, (err: any, stream: any) => {
|
||||
stream.pipe({
|
||||
write(chunk) {
|
||||
write(chunk: Buffer) {
|
||||
buffers.push(chunk);
|
||||
},
|
||||
end() {
|
||||
@@ -358,12 +535,12 @@ export function readEntire(entry, zipFile) {
|
||||
});
|
||||
}
|
||||
|
||||
function basename(fn) {
|
||||
function basename(fn: string) {
|
||||
const m = /^(.+\/)[^\/]+\/?$/.exec(fn);
|
||||
return m && m[1];
|
||||
return m?.[1];
|
||||
}
|
||||
|
||||
async function diffFromPPK(origin, next, output) {
|
||||
async function diffFromPPK(origin: string, next: string, output: string) {
|
||||
fs.ensureDirSync(path.dirname(output));
|
||||
|
||||
const originEntries = {};
|
||||
@@ -377,7 +554,10 @@ async function diffFromPPK(origin, next, output) {
|
||||
// isFile
|
||||
originMap[entry.crc32] = entry.fileName;
|
||||
|
||||
if (entry.fileName === 'index.bundlejs' || entry.fileName === 'bundle.harmony.js') {
|
||||
if (
|
||||
entry.fileName === 'index.bundlejs' ||
|
||||
entry.fileName === 'bundle.harmony.js'
|
||||
) {
|
||||
// This is source.
|
||||
return readEntire(entry, zipFile).then((v) => (originSource = v));
|
||||
}
|
||||
@@ -386,7 +566,7 @@ async function diffFromPPK(origin, next, output) {
|
||||
|
||||
if (!originSource) {
|
||||
throw new Error(
|
||||
`Bundle file not found! Please use default bundle file name and path.`,
|
||||
'Bundle file not found! Please use default bundle file name and path.',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -398,16 +578,14 @@ async function diffFromPPK(origin, next, output) {
|
||||
zipfile.outputStream.on('error', (err) => {
|
||||
throw err;
|
||||
});
|
||||
zipfile.outputStream
|
||||
.pipe(fs.createWriteStream(output))
|
||||
.on('close', function () {
|
||||
resolve();
|
||||
});
|
||||
zipfile.outputStream.pipe(fs.createWriteStream(output)).on('close', () => {
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
const addedEntry = {};
|
||||
|
||||
function addEntry(fn) {
|
||||
function addEntry(fn: string) {
|
||||
//console.log(fn);
|
||||
if (!fn || addedEntry[fn]) {
|
||||
return;
|
||||
@@ -439,7 +617,7 @@ async function diffFromPPK(origin, next, output) {
|
||||
);
|
||||
//console.log('End diff');
|
||||
});
|
||||
}else if (entry.fileName === 'bundle.harmony.js') {
|
||||
} else if (entry.fileName === 'bundle.harmony.js') {
|
||||
//console.log('Found bundle');
|
||||
return readEntire(entry, nextZipfile).then((newSource) => {
|
||||
//console.log('Begin diff');
|
||||
@@ -471,7 +649,7 @@ async function diffFromPPK(origin, next, output) {
|
||||
addEntry(basename(entry.fileName));
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
nextZipfile.openReadStream(entry, function (err, readStream) {
|
||||
nextZipfile.openReadStream(entry, (err, readStream) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
@@ -487,9 +665,9 @@ async function diffFromPPK(origin, next, output) {
|
||||
|
||||
const deletes = {};
|
||||
|
||||
for (let k in originEntries) {
|
||||
for (const k in originEntries) {
|
||||
if (!newEntries[k]) {
|
||||
console.log('Delete ' + k);
|
||||
console.log(`Delete ${k}`);
|
||||
deletes[k] = 1;
|
||||
}
|
||||
}
|
||||
@@ -504,11 +682,11 @@ async function diffFromPPK(origin, next, output) {
|
||||
}
|
||||
|
||||
async function diffFromPackage(
|
||||
origin,
|
||||
next,
|
||||
output,
|
||||
originBundleName,
|
||||
transformPackagePath = (v) => v,
|
||||
origin: string,
|
||||
next: string,
|
||||
output: string,
|
||||
originBundleName: string,
|
||||
transformPackagePath = (v: string) => v,
|
||||
) {
|
||||
fs.ensureDirSync(path.dirname(output));
|
||||
|
||||
@@ -517,7 +695,7 @@ async function diffFromPackage(
|
||||
|
||||
let originSource;
|
||||
|
||||
await enumZipEntries(origin, (entry, zipFile) => {
|
||||
await enumZipEntries(origin, (entry: any, zipFile: any) => {
|
||||
if (!/\/$/.test(entry.fileName)) {
|
||||
const fn = transformPackagePath(entry.fileName);
|
||||
if (!fn) {
|
||||
@@ -538,7 +716,7 @@ async function diffFromPackage(
|
||||
|
||||
if (!originSource) {
|
||||
throw new Error(
|
||||
`Bundle file not found! Please use default bundle file name and path.`,
|
||||
'Bundle file not found! Please use default bundle file name and path.',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -550,11 +728,9 @@ async function diffFromPackage(
|
||||
zipfile.outputStream.on('error', (err) => {
|
||||
throw err;
|
||||
});
|
||||
zipfile.outputStream
|
||||
.pipe(fs.createWriteStream(output))
|
||||
.on('close', function () {
|
||||
resolve();
|
||||
});
|
||||
zipfile.outputStream.pipe(fs.createWriteStream(output)).on('close', () => {
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
await enumZipEntries(next, (entry, nextZipfile) => {
|
||||
@@ -581,7 +757,7 @@ async function diffFromPackage(
|
||||
);
|
||||
//console.log('End diff');
|
||||
});
|
||||
}else {
|
||||
} else {
|
||||
// If same file.
|
||||
if (originEntries[entry.fileName] === entry.crc32) {
|
||||
copies[entry.fileName] = '';
|
||||
@@ -594,7 +770,7 @@ async function diffFromPackage(
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
nextZipfile.openReadStream(entry, function (err, readStream) {
|
||||
nextZipfile.openReadStream(entry, (err, readStream) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
@@ -613,55 +789,66 @@ async function diffFromPackage(
|
||||
await writePromise;
|
||||
}
|
||||
|
||||
export async function enumZipEntries(zipFn, callback, nestedPath = '') {
|
||||
export async function enumZipEntries(
|
||||
zipFn: string,
|
||||
callback: (entry: any, zipFile: any) => void,
|
||||
nestedPath = '',
|
||||
) {
|
||||
return new Promise((resolve, reject) => {
|
||||
openZipFile(zipFn, { lazyEntries: true }, async (err, zipfile) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
zipfile.on('end', resolve);
|
||||
zipfile.on('error', reject);
|
||||
zipfile.on('entry', async (entry) => {
|
||||
const fullPath = nestedPath + entry.fileName;
|
||||
|
||||
try {
|
||||
if (
|
||||
!entry.fileName.endsWith('/') &&
|
||||
entry.fileName.toLowerCase().endsWith('.hap')
|
||||
) {
|
||||
const tempDir = path.join(os.tmpdir(), 'nested_zip_' + Date.now());
|
||||
await fs.ensureDir(tempDir);
|
||||
const tempZipPath = path.join(tempDir, 'temp.zip');
|
||||
|
||||
await new Promise((res, rej) => {
|
||||
zipfile.openReadStream(entry, async (err, readStream) => {
|
||||
if (err) return rej(err);
|
||||
const writeStream = fs.createWriteStream(tempZipPath);
|
||||
readStream.pipe(writeStream);
|
||||
writeStream.on('finish', res);
|
||||
writeStream.on('error', rej);
|
||||
});
|
||||
});
|
||||
|
||||
await enumZipEntries(tempZipPath, callback, fullPath + '/');
|
||||
|
||||
await fs.remove(tempDir);
|
||||
}
|
||||
|
||||
const result = callback(entry, zipfile, fullPath);
|
||||
if (result && typeof result.then === 'function') {
|
||||
await result;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('处理文件时出错:', error);
|
||||
openZipFile(
|
||||
zipFn,
|
||||
{ lazyEntries: true },
|
||||
async (err: any, zipfile: ZipFile) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
zipfile.readEntry();
|
||||
});
|
||||
zipfile.on('end', resolve);
|
||||
zipfile.on('error', reject);
|
||||
zipfile.on('entry', async (entry) => {
|
||||
const fullPath = nestedPath + entry.fileName;
|
||||
|
||||
zipfile.readEntry();
|
||||
});
|
||||
try {
|
||||
if (
|
||||
!entry.fileName.endsWith('/') &&
|
||||
entry.fileName.toLowerCase().endsWith('.hap')
|
||||
) {
|
||||
const tempDir = path.join(
|
||||
os.tmpdir(),
|
||||
`nested_zip_${Date.now()}`,
|
||||
);
|
||||
await fs.ensureDir(tempDir);
|
||||
const tempZipPath = path.join(tempDir, 'temp.zip');
|
||||
|
||||
await new Promise((res, rej) => {
|
||||
zipfile.openReadStream(entry, async (err, readStream) => {
|
||||
if (err) return rej(err);
|
||||
const writeStream = fs.createWriteStream(tempZipPath);
|
||||
readStream.pipe(writeStream);
|
||||
writeStream.on('finish', res);
|
||||
writeStream.on('error', rej);
|
||||
});
|
||||
});
|
||||
|
||||
await enumZipEntries(tempZipPath, callback, `${fullPath}/`);
|
||||
|
||||
await fs.remove(tempDir);
|
||||
}
|
||||
|
||||
const result = callback(entry, zipfile, fullPath);
|
||||
if (result && typeof result.then === 'function') {
|
||||
await result;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('处理文件时出错:', error);
|
||||
}
|
||||
|
||||
zipfile.readEntry();
|
||||
});
|
||||
|
||||
zipfile.readEntry();
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -697,7 +884,7 @@ function diffArgsCheck(args, options, diffFn) {
|
||||
return {
|
||||
origin,
|
||||
next,
|
||||
realOutput: output.replace(/\$\{time\}/g, '' + Date.now()),
|
||||
realOutput: output.replace(/\$\{time\}/g, `${Date.now()}`),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -707,43 +894,70 @@ export const commands = {
|
||||
options.platform || (await question('平台(ios/android/harmony):')),
|
||||
);
|
||||
|
||||
let { bundleName, entryFile, intermediaDir, output, dev, sourcemap } =
|
||||
translateOptions({
|
||||
...options,
|
||||
platform,
|
||||
});
|
||||
const {
|
||||
bundleName,
|
||||
entryFile,
|
||||
intermediaDir,
|
||||
output,
|
||||
dev,
|
||||
sourcemap,
|
||||
taro,
|
||||
expo,
|
||||
rncli,
|
||||
disableHermes,
|
||||
} = translateOptions({
|
||||
...options,
|
||||
platform,
|
||||
});
|
||||
|
||||
const sourcemapOutput = path.join(intermediaDir, bundleName + '.map');
|
||||
const bundleParams = await checkPlugins();
|
||||
const sourcemapPlugin = bundleParams.sourcemap;
|
||||
const isSentry = bundleParams.sentry;
|
||||
|
||||
const realOutput = output.replace(/\$\{time\}/g, '' + Date.now());
|
||||
const sourcemapOutput = path.join(intermediaDir, `${bundleName}.map`);
|
||||
|
||||
const realOutput = output.replace(/\$\{time\}/g, `${Date.now()}`);
|
||||
|
||||
if (!platform) {
|
||||
throw new Error('Platform must be specified.');
|
||||
}
|
||||
|
||||
const { version, major, minor } = getRNVersion();
|
||||
console.log(`Bundling with react-native: ${depVersions['react-native']}`);
|
||||
|
||||
console.log('Bundling with react-native: ', version);
|
||||
|
||||
await runReactNativeBundleCommand(
|
||||
await runReactNativeBundleCommand({
|
||||
bundleName,
|
||||
dev,
|
||||
entryFile,
|
||||
intermediaDir,
|
||||
outputFolder: intermediaDir,
|
||||
platform,
|
||||
sourcemap ? sourcemapOutput : '',
|
||||
);
|
||||
sourcemapOutput: sourcemap || sourcemapPlugin ? sourcemapOutput : '',
|
||||
disableHermes,
|
||||
cli: {
|
||||
taro,
|
||||
expo,
|
||||
rncli,
|
||||
},
|
||||
});
|
||||
|
||||
await pack(path.resolve(intermediaDir), realOutput);
|
||||
|
||||
const v = await question('是否现在上传此热更包?(Y/N)');
|
||||
if (v.toLowerCase() === 'y') {
|
||||
await this.publish({
|
||||
const versionName = await this.publish({
|
||||
args: [realOutput],
|
||||
options: {
|
||||
platform,
|
||||
},
|
||||
});
|
||||
if (isSentry) {
|
||||
await copyDebugidForSentry(bundleName, intermediaDir, sourcemapOutput);
|
||||
await uploadSourcemapForSentry(
|
||||
bundleName,
|
||||
intermediaDir,
|
||||
sourcemapOutput,
|
||||
versionName,
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -817,7 +1031,7 @@ export const commands = {
|
||||
|
||||
await diffFromPackage(origin, next, realOutput, 'main.jsbundle', (v) => {
|
||||
const m = /^Payload\/[^/]+\/(.+)$/.exec(v);
|
||||
return m && m[1];
|
||||
return m?.[1];
|
||||
});
|
||||
|
||||
console.log(`${realOutput} generated.`);
|
||||
@@ -832,7 +1046,7 @@ export const commands = {
|
||||
|
||||
await diffFromPackage(origin, next, realOutput, 'main.jsbundle', (v) => {
|
||||
const m = /^Payload\/[^/]+\/(.+)$/.exec(v);
|
||||
return m && m[1];
|
||||
return m?.[1];
|
||||
});
|
||||
|
||||
console.log(`${realOutput} generated.`);
|
17
src/index.ts
17
src/index.ts
@@ -2,8 +2,21 @@
|
||||
|
||||
import { loadSession } from './api';
|
||||
import updateNotifier from 'update-notifier';
|
||||
import { printVersionCommand } from './utils/index.js';
|
||||
import { printVersionCommand } from './utils';
|
||||
import pkg from '../package.json';
|
||||
import i18next from 'i18next';
|
||||
import en from './locales/en';
|
||||
import zh from './locales/zh';
|
||||
import { IS_CRESC } from './utils/constants';
|
||||
|
||||
i18next.init({
|
||||
lng: IS_CRESC ? 'en' : 'zh',
|
||||
// debug: process.env.NODE_ENV !== 'production',
|
||||
resources: {
|
||||
en,
|
||||
zh,
|
||||
},
|
||||
});
|
||||
|
||||
updateNotifier({ pkg }).notify({
|
||||
isGlobal: true,
|
||||
@@ -39,7 +52,7 @@ async function run() {
|
||||
|
||||
const argv = require('cli-arguments').parse(require('../cli.json'));
|
||||
global.NO_INTERACTIVE = argv.options['no-interactive'];
|
||||
global.USE_ACC_OSS = argv.options['acc'];
|
||||
global.USE_ACC_OSS = argv.options.acc;
|
||||
|
||||
loadSession()
|
||||
.then(() => commands[argv.command](argv))
|
||||
|
1
src/locales/en.ts
Normal file
1
src/locales/en.ts
Normal file
@@ -0,0 +1 @@
|
||||
export default {};
|
1
src/locales/zh.ts
Normal file
1
src/locales/zh.ts
Normal file
@@ -0,0 +1 @@
|
||||
export default {};
|
@@ -5,8 +5,9 @@ import { checkPlatform, getSelectedApp } from './app';
|
||||
|
||||
import { getApkInfo, getIpaInfo, getAppInfo } from './utils';
|
||||
import Table from 'tty-table';
|
||||
import { depVersions } from './utils/dep-versions';
|
||||
|
||||
export async function listPackage(appId) {
|
||||
export async function listPackage(appId: string) {
|
||||
const { data } = await get(`/app/${appId}/package/list?limit=1000`);
|
||||
|
||||
const header = [{ value: '原生包 Id' }, { value: '原生版本' }];
|
||||
@@ -35,12 +36,12 @@ export async function listPackage(appId) {
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function choosePackage(appId) {
|
||||
export async function choosePackage(appId: string) {
|
||||
const list = await listPackage(appId);
|
||||
|
||||
while (true) {
|
||||
const id = await question('输入原生包 id:');
|
||||
const app = list.find((v) => v.id === (id | 0));
|
||||
const app = list.find((v) => v.id === Number(id));
|
||||
if (app) {
|
||||
return app;
|
||||
}
|
||||
@@ -48,7 +49,7 @@ export async function choosePackage(appId) {
|
||||
}
|
||||
|
||||
export const commands = {
|
||||
uploadIpa: async function ({ args }) {
|
||||
uploadIpa: async ({ args }: { args: string[] }) => {
|
||||
const fn = args[0];
|
||||
if (!fn || !fn.endsWith('.ipa')) {
|
||||
throw new Error('使用方法: pushy uploadIpa ipa后缀文件');
|
||||
@@ -79,13 +80,14 @@ export const commands = {
|
||||
name: versionName,
|
||||
hash,
|
||||
buildTime,
|
||||
deps: depVersions,
|
||||
});
|
||||
saveToLocal(fn, `${appId}/package/${id}.ipa`);
|
||||
console.log(
|
||||
`已成功上传ipa原生包(id: ${id}, version: ${versionName}, buildTime: ${buildTime})`,
|
||||
);
|
||||
},
|
||||
uploadApk: async function ({ args }) {
|
||||
uploadApk: async ({ args }) => {
|
||||
const fn = args[0];
|
||||
if (!fn || !fn.endsWith('.apk')) {
|
||||
throw new Error('使用方法: pushy uploadApk apk后缀文件');
|
||||
@@ -116,13 +118,14 @@ export const commands = {
|
||||
name: versionName,
|
||||
hash,
|
||||
buildTime,
|
||||
deps: depVersions,
|
||||
});
|
||||
saveToLocal(fn, `${appId}/package/${id}.apk`);
|
||||
console.log(
|
||||
`已成功上传apk原生包(id: ${id}, version: ${versionName}, buildTime: ${buildTime})`,
|
||||
);
|
||||
},
|
||||
uploadApp: async function ({ args }) {
|
||||
uploadApp: async ({ args }) => {
|
||||
const fn = args[0];
|
||||
if (!fn || !fn.endsWith('.app')) {
|
||||
throw new Error('使用方法: pushy uploadApp app后缀文件');
|
||||
@@ -135,7 +138,6 @@ export const commands = {
|
||||
} = await getAppInfo(fn);
|
||||
const { appId, appKey } = await getSelectedApp('harmony');
|
||||
|
||||
|
||||
if (appIdInPkg && appIdInPkg != appId) {
|
||||
throw new Error(
|
||||
`appId不匹配!当前app: ${appIdInPkg}, 当前update.json: ${appId}`,
|
||||
@@ -154,34 +156,35 @@ export const commands = {
|
||||
name: versionName,
|
||||
hash,
|
||||
buildTime,
|
||||
deps: depVersions,
|
||||
});
|
||||
saveToLocal(fn, `${appId}/package/${id}.app`);
|
||||
console.log(
|
||||
`已成功上传app原生包(id: ${id}, version: ${versionName}, buildTime: ${buildTime})`,
|
||||
);
|
||||
},
|
||||
parseApp: async function ({ args }) {
|
||||
parseApp: async ({ args }) => {
|
||||
const fn = args[0];
|
||||
if (!fn || !fn.endsWith('.app')) {
|
||||
throw new Error('使用方法: pushy parseApp app后缀文件');
|
||||
}
|
||||
console.log(await getAppInfo(fn));
|
||||
},
|
||||
parseIpa: async function ({ args }) {
|
||||
parseIpa: async ({ args }) => {
|
||||
const fn = args[0];
|
||||
if (!fn || !fn.endsWith('.ipa')) {
|
||||
throw new Error('使用方法: pushy parseIpa ipa后缀文件');
|
||||
}
|
||||
console.log(await getIpaInfo(fn));
|
||||
},
|
||||
parseApk: async function ({ args }) {
|
||||
parseApk: async ({ args }) => {
|
||||
const fn = args[0];
|
||||
if (!fn || !fn.endsWith('.apk')) {
|
||||
throw new Error('使用方法: pushy parseApk apk后缀文件');
|
||||
}
|
||||
console.log(await getApkInfo(fn));
|
||||
},
|
||||
packages: async function ({ options }) {
|
||||
packages: async ({ options }) => {
|
||||
const platform = checkPlatform(
|
||||
options.platform || (await question('平台(ios/android/harmony):')),
|
||||
);
|
@@ -6,3 +6,5 @@ declare global {
|
||||
export interface Session {
|
||||
token: string;
|
||||
}
|
||||
|
||||
export type Platform = 'ios' | 'android' | 'harmony';
|
||||
|
@@ -2,12 +2,12 @@ import { question } from './utils';
|
||||
import { post, get, replaceSession, saveSession, closeSession } from './api';
|
||||
import crypto from 'node:crypto';
|
||||
|
||||
function md5(str) {
|
||||
function md5(str: string) {
|
||||
return crypto.createHash('md5').update(str).digest('hex');
|
||||
}
|
||||
|
||||
export const commands = {
|
||||
login: async ({ args }) => {
|
||||
login: async ({ args }: { args: string[] }) => {
|
||||
const email = args[0] || (await question('email:'));
|
||||
const pwd = args[1] || (await question('password:', true));
|
||||
const { token, info } = await post('/user/login', {
|
@@ -42,7 +42,7 @@ class Zip {
|
||||
regex = decodeNullUnicode(regex);
|
||||
return new Promise((resolve, reject) => {
|
||||
this.unzip.getBuffer([regex], { type }, (err, buffers) => {
|
||||
console.log(buffers);
|
||||
// console.log(buffers);
|
||||
err ? reject(err) : resolve(buffers[regex]);
|
||||
});
|
||||
});
|
||||
|
28
src/utils/check-plugin.ts
Normal file
28
src/utils/check-plugin.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { plugins } from './plugin-config';
|
||||
|
||||
interface BundleParams {
|
||||
sentry: boolean;
|
||||
sourcemap: boolean;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export async function checkPlugins(): Promise<BundleParams> {
|
||||
const params: BundleParams = {
|
||||
sentry: false,
|
||||
sourcemap: false,
|
||||
};
|
||||
|
||||
for (const plugin of plugins) {
|
||||
try {
|
||||
const isEnabled = await plugin.detect();
|
||||
if (isEnabled && plugin.bundleParams) {
|
||||
Object.assign(params, plugin.bundleParams);
|
||||
console.log(`检测到 ${plugin.name} 插件,应用相应打包配置`);
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn(`检测 ${plugin.name} 插件时出错:`, err);
|
||||
}
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
13
src/utils/constants.ts
Normal file
13
src/utils/constants.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import path from 'node:path';
|
||||
|
||||
const scriptName: 'cresc' | 'pushy' = path.basename(process.argv[1]) as
|
||||
| 'cresc'
|
||||
| 'pushy';
|
||||
export const IS_CRESC = scriptName === 'cresc';
|
||||
|
||||
export const credentialFile = IS_CRESC ? '.cresc.token' : '.update';
|
||||
export const updateJson = IS_CRESC ? 'cresc.config.json' : 'update.json';
|
||||
export const tempDir = IS_CRESC ? '.cresc.temp' : '.pushy';
|
||||
export const pricingPageUrl = IS_CRESC
|
||||
? 'https://cresc.dev/pricing'
|
||||
: 'https://pushy.reactnative.cn/pricing.html';
|
26
src/utils/dep-versions.ts
Normal file
26
src/utils/dep-versions.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
const currentPackage = require(`${process.cwd()}/package.json`);
|
||||
|
||||
const depKeys = Object.keys(currentPackage.dependencies);
|
||||
const devDepKeys = Object.keys(currentPackage.devDependencies);
|
||||
const dedupedDeps = [...new Set([...depKeys, ...devDepKeys])];
|
||||
|
||||
const _depVersions: Record<string, string> = {};
|
||||
|
||||
for (const dep of dedupedDeps) {
|
||||
try {
|
||||
const packageJsonPath = require.resolve(`${dep}/package.json`, {
|
||||
paths: [process.cwd()],
|
||||
});
|
||||
const version = require(packageJsonPath).version;
|
||||
_depVersions[dep] = version;
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
export const depVersions = Object.keys(_depVersions)
|
||||
.sort() // Sort the keys alphabetically
|
||||
.reduce((obj, key) => {
|
||||
obj[key] = _depVersions[key]; // Rebuild the object with sorted keys
|
||||
return obj;
|
||||
}, {} as Record<string, string>);
|
||||
|
||||
// console.log({ depVersions });
|
@@ -6,10 +6,13 @@ import AppInfoParser from './app-info-parser';
|
||||
import semverSatisfies from 'semver/functions/satisfies';
|
||||
import chalk from 'chalk';
|
||||
import latestVersion from '@badisi/latest-version';
|
||||
import { checkPlugins } from './check-plugin';
|
||||
|
||||
import { read } from 'read';
|
||||
import { tempDir } from './constants';
|
||||
import { depVersions } from './dep-versions';
|
||||
|
||||
export async function question(query, password) {
|
||||
export async function question(query: string, password?: boolean) {
|
||||
if (NO_INTERACTIVE) {
|
||||
return '';
|
||||
}
|
||||
@@ -20,14 +23,15 @@ export async function question(query, password) {
|
||||
});
|
||||
}
|
||||
|
||||
export function translateOptions(options) {
|
||||
const ret = {};
|
||||
for (let key in options) {
|
||||
export function translateOptions(options: Record<string, string>) {
|
||||
const ret: Record<string, string> = {};
|
||||
for (const key in options) {
|
||||
const v = options[key];
|
||||
if (typeof v === 'string') {
|
||||
ret[key] = v.replace(/\$\{(\w+)\}/g, function (v, n) {
|
||||
return options[n] || process.env[n] || v;
|
||||
});
|
||||
ret[key] = v.replace(
|
||||
/\$\{(\w+)\}/g,
|
||||
(v, n) => options[n] || process.env[n] || v,
|
||||
);
|
||||
} else {
|
||||
ret[key] = v;
|
||||
}
|
||||
@@ -35,25 +39,7 @@ export function translateOptions(options) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
export function getRNVersion() {
|
||||
const version = JSON.parse(
|
||||
fs.readFileSync(
|
||||
require.resolve('react-native/package.json', {
|
||||
paths: [process.cwd()],
|
||||
}),
|
||||
),
|
||||
).version;
|
||||
|
||||
// We only care about major and minor version.
|
||||
const match = /^(\d+)\.(\d+)\./.exec(version);
|
||||
return {
|
||||
version,
|
||||
major: match[1] | 0,
|
||||
minor: match[2] | 0,
|
||||
};
|
||||
}
|
||||
|
||||
export async function getApkInfo(fn) {
|
||||
export async function getApkInfo(fn: string) {
|
||||
const appInfoParser = new AppInfoParser(fn);
|
||||
const bundleFile = await appInfoParser.parser.getEntry(
|
||||
/assets\/index.android.bundle/,
|
||||
@@ -124,7 +110,7 @@ export async function getAppInfo(fn) {
|
||||
return { versionName, buildTime, ...appCredential };
|
||||
}
|
||||
|
||||
export async function getIpaInfo(fn) {
|
||||
export async function getIpaInfo(fn: string) {
|
||||
const appInfoParser = new AppInfoParser(fn);
|
||||
const bundleFile = await appInfoParser.parser.getEntry(
|
||||
/payload\/.+?\.app\/main.jsbundle/,
|
||||
@@ -161,26 +147,31 @@ export async function getIpaInfo(fn) {
|
||||
return { versionName, buildTime, ...appCredential };
|
||||
}
|
||||
|
||||
const localDir = path.resolve(os.homedir(), '.pushy');
|
||||
const localDir = path.resolve(os.homedir(), tempDir);
|
||||
fs.ensureDirSync(localDir);
|
||||
export function saveToLocal(originPath, destName) {
|
||||
export function saveToLocal(originPath: string, destName: string) {
|
||||
// TODO
|
||||
// const destPath = path.join(localDir, destName);
|
||||
// fs.ensureDirSync(path.dirname(destPath));
|
||||
// fs.copyFileSync(originPath, destPath);
|
||||
}
|
||||
|
||||
async function getLatestVersion(pkgName) {
|
||||
return Promise.race([
|
||||
latestVersion(pkgName)
|
||||
.then((p) => p.latest)
|
||||
.catch(() => ''),
|
||||
new Promise((resolve) => setTimeout(() => resolve(''), 2000)),
|
||||
]);
|
||||
async function getLatestVersion(pkgNames: string[]) {
|
||||
return latestVersion(pkgNames, {
|
||||
useCache: true,
|
||||
requestOptions: {
|
||||
timeout: 2000,
|
||||
},
|
||||
})
|
||||
.then((pkgs) => pkgs.map((pkg) => pkg.latest))
|
||||
.catch(() => []);
|
||||
}
|
||||
|
||||
export async function printVersionCommand() {
|
||||
let latestPushyCliVersion = await getLatestVersion('react-native-update-cli');
|
||||
let [latestPushyCliVersion, latestPushyVersion] = await getLatestVersion([
|
||||
'react-native-update-cli',
|
||||
'react-native-update',
|
||||
]);
|
||||
latestPushyCliVersion = latestPushyCliVersion
|
||||
? ` (最新:${chalk.green(latestPushyCliVersion)})`
|
||||
: '';
|
||||
@@ -188,22 +179,11 @@ export async function printVersionCommand() {
|
||||
`react-native-update-cli: ${pkg.version}${latestPushyCliVersion}`,
|
||||
);
|
||||
let pushyVersion = '';
|
||||
try {
|
||||
const PACKAGE_JSON_PATH = require.resolve(
|
||||
'react-native-update/package.json',
|
||||
{
|
||||
paths: [process.cwd()],
|
||||
},
|
||||
);
|
||||
pushyVersion = require(PACKAGE_JSON_PATH).version;
|
||||
let latestPushyVersion = await getLatestVersion('react-native-update');
|
||||
latestPushyVersion = latestPushyVersion
|
||||
? ` (最新:${chalk.green(latestPushyVersion)})`
|
||||
: '';
|
||||
console.log(`react-native-update: ${pushyVersion}${latestPushyVersion}`);
|
||||
} catch (e) {
|
||||
console.log('react-native-update: 无法获取版本号,请在项目目录中运行命令');
|
||||
}
|
||||
pushyVersion = depVersions['react-native-update'];
|
||||
latestPushyVersion = latestPushyVersion
|
||||
? ` (最新:${chalk.green(latestPushyVersion)})`
|
||||
: '';
|
||||
console.log(`react-native-update: ${pushyVersion}${latestPushyVersion}`);
|
||||
if (pushyVersion) {
|
||||
if (semverSatisfies(pushyVersion, '<8.5.2')) {
|
||||
console.warn(
|
||||
@@ -217,10 +197,12 @@ export async function printVersionCommand() {
|
||||
);
|
||||
} else if (semverSatisfies(pushyVersion, '10.0.0 - 10.17.0')) {
|
||||
console.warn(
|
||||
`当前版本已不再支持,请升级到 v10 的最新小版本(代码无需改动,可直接热更): npm i react-native-update@10`,
|
||||
'当前版本已不再支持,请升级到 v10 的最新小版本(代码无需改动,可直接热更): npm i react-native-update@10',
|
||||
);
|
||||
}
|
||||
} else {
|
||||
console.log('react-native-update: 无法获取版本号,请在项目目录中运行命令');
|
||||
}
|
||||
}
|
||||
|
||||
export const pricingPageUrl = 'https://pushy.reactnative.cn/pricing.html';
|
||||
export { checkPlugins };
|
24
src/utils/lock-checker.ts
Normal file
24
src/utils/lock-checker.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
const lockFiles = [
|
||||
'package-lock.json',
|
||||
'yarn.lock',
|
||||
'pnpm-lock.yaml',
|
||||
'bun.lockb',
|
||||
'bun.lock',
|
||||
];
|
||||
|
||||
const lockNotFound = `
|
||||
没有检测到任何 lock 文件,这可能导致依赖关系不一致而使热更异常。
|
||||
`;
|
||||
|
||||
const multipleLocksFound = `
|
||||
检测到多个锁文件(),这可能导致依赖关系不一致而使热更异常。
|
||||
`;
|
||||
|
||||
|
||||
const lockBestPractice = `
|
||||
关于 lock 文件的最佳实践:
|
||||
1. 开发团队中的所有成员应该使用相同的包管理器,维护同一份 lock 文件。
|
||||
2. 将 lock 文件添加到版本控制中(但不要同时提交多种不同格式的 lock 文件)。
|
||||
3. 代码审核时应关注 lock 文件的变化。
|
||||
这样可以最大限度避免因依赖关系不一致而导致的热更异常,也降低供应链攻击等安全隐患。
|
||||
`;
|
32
src/utils/plugin-config.ts
Normal file
32
src/utils/plugin-config.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import fs from 'fs-extra';
|
||||
|
||||
interface PluginConfig {
|
||||
name: string;
|
||||
bundleParams?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
detect: () => Promise<boolean>;
|
||||
}
|
||||
|
||||
export const plugins: PluginConfig[] = [
|
||||
{
|
||||
name: 'sentry',
|
||||
bundleParams: {
|
||||
sentry: true,
|
||||
sourcemap: true,
|
||||
},
|
||||
detect: async () => {
|
||||
try {
|
||||
await fs.access('ios/sentry.properties');
|
||||
return true;
|
||||
} catch {
|
||||
try {
|
||||
await fs.access('android/sentry.properties');
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
];
|
@@ -4,8 +4,9 @@ import { question, saveToLocal } from './utils';
|
||||
import { checkPlatform, getSelectedApp } from './app';
|
||||
import { choosePackage } from './package';
|
||||
import { compare } from 'compare-versions';
|
||||
import { depVersions } from './utils/dep-versions';
|
||||
|
||||
async function showVersion(appId, offset) {
|
||||
async function showVersion(appId: string, offset: number) {
|
||||
const { data, count } = await get(`/app/${appId}/version/list`);
|
||||
console.log(`Offset ${offset}`);
|
||||
for (const version of data) {
|
||||
@@ -13,12 +14,12 @@ async function showVersion(appId, offset) {
|
||||
.slice(0, 3)
|
||||
.map((v) => v.name)
|
||||
.join(', ');
|
||||
const count = version.packages.length;
|
||||
if (count > 3) {
|
||||
packageInfo += `...and ${count - 3} more`;
|
||||
const pkgCount = version.packages.length;
|
||||
if (pkgCount > 3) {
|
||||
packageInfo += `...and ${pkgCount - 3} more`;
|
||||
}
|
||||
if (count === 0) {
|
||||
packageInfo = `(no package)`;
|
||||
if (pkgCount === 0) {
|
||||
packageInfo = 'no package';
|
||||
} else {
|
||||
packageInfo = `[${packageInfo}]`;
|
||||
}
|
||||
@@ -31,7 +32,7 @@ async function showVersion(appId, offset) {
|
||||
return data;
|
||||
}
|
||||
|
||||
async function listVersions(appId) {
|
||||
async function listVersions(appId: string) {
|
||||
let offset = 0;
|
||||
while (true) {
|
||||
await showVersion(appId, offset);
|
||||
@@ -52,7 +53,7 @@ async function listVersions(appId) {
|
||||
}
|
||||
}
|
||||
|
||||
async function chooseVersion(appId) {
|
||||
async function chooseVersion(appId: string) {
|
||||
let offset = 0;
|
||||
while (true) {
|
||||
const data = await showVersion(appId, offset);
|
||||
@@ -97,11 +98,13 @@ export const commands = {
|
||||
|
||||
const { hash } = await uploadFile(fn);
|
||||
|
||||
const versionName = name || (await question('输入版本名称: ')) || '(未命名)';
|
||||
const { id } = await post(`/app/${appId}/version/create`, {
|
||||
name: name || (await question('输入版本名称: ')) || '(未命名)',
|
||||
name: versionName,
|
||||
hash,
|
||||
description: description || (await question('输入版本描述:')),
|
||||
metaInfo: metaInfo || (await question('输入自定义的 meta info:')),
|
||||
deps: depVersions,
|
||||
});
|
||||
// TODO local diff
|
||||
saveToLocal(fn, `${appId}/ppk/${id}.ppk`);
|
||||
@@ -111,6 +114,7 @@ export const commands = {
|
||||
if (v.toLowerCase() === 'y') {
|
||||
await this.update({ args: [], options: { versionId: id, platform } });
|
||||
}
|
||||
return versionName;
|
||||
},
|
||||
versions: async ({ options }) => {
|
||||
const platform = checkPlatform(
|
@@ -52,9 +52,9 @@
|
||||
] /* List of folders to include type definitions from. */,
|
||||
// "types": [], /* Type declaration files to be included in compilation. */
|
||||
"allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */,
|
||||
// "paths": {
|
||||
// "@/*": ["src/*"]
|
||||
// },
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
},
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
|
||||
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
||||
|
Reference in New Issue
Block a user