From ac370a99b74312cc243b2030313c1ded6c4408de Mon Sep 17 00:00:00 2001 From: linbudu599 Date: Wed, 16 Mar 2022 07:59:03 +0800 Subject: [PATCH] feat: update version script --- package.json | 1 + packages/astro-docs-starter/package.json | 6 +- packages/astro-generic-starter/package.json | 2 +- pnpm-lock.yaml | 199 +++++++++++++------- scripts/cli.ts | 2 + scripts/update-dep-version.ts | 53 ++++++ scripts/utils.ts | 18 ++ 7 files changed, 211 insertions(+), 70 deletions(-) create mode 100644 scripts/update-dep-version.ts diff --git a/package.json b/package.json index c8b5ec5..0af54a2 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "jsonfile": "^6.1.0", "minimist": "^1.2.5", "nanoid": "^3.3.1", + "npm-check-updates": "^12.5.3", "ora": "^5.0.0", "preferred-pm": "^3.0.3", "prettier": "^2.5.1", diff --git a/packages/astro-docs-starter/package.json b/packages/astro-docs-starter/package.json index e4602e7..3994e9c 100644 --- a/packages/astro-docs-starter/package.json +++ b/packages/astro-docs-starter/package.json @@ -9,7 +9,7 @@ "preview": "astro preview" }, "dependencies": { - "@algolia/client-search": "^4.12.2", + "@algolia/client-search": "^4.13.0", "@docsearch/css": "^3.0.0", "@docsearch/react": "^3.0.0", "@types/react": "^17.0.40", @@ -19,6 +19,6 @@ "devDependencies": { "@astrojs/renderer-preact": "^0.5.0", "@astrojs/renderer-react": "^0.5.0", - "astro": "^0.24.0" + "astro": "^0.24.2" } -} \ No newline at end of file +} diff --git a/packages/astro-generic-starter/package.json b/packages/astro-generic-starter/package.json index e665f54..a2380dc 100644 --- a/packages/astro-generic-starter/package.json +++ b/packages/astro-generic-starter/package.json @@ -9,7 +9,7 @@ "preview": "astro preview" }, "devDependencies": { - "astro": "^0.24.0", + "astro": "^0.24.2", "@astrojs/renderer-react": "^0.5.0", "@astrojs/renderer-solid": "^0.4.0", "@astrojs/renderer-svelte": "^0.5.1" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9d370d2..6a83b2f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,6 +28,7 @@ importers: lodash: ^4.17.21 minimist: ^1.2.5 nanoid: ^3.3.1 + npm-check-updates: ^12.5.3 ora: ^5.0.0 preferred-pm: ^3.0.3 prettier: ^2.5.1 @@ -60,6 +61,7 @@ importers: jsonfile: 6.1.0 minimist: 1.2.5 nanoid: 3.3.1 + npm-check-updates: 12.5.3 ora: 5.4.1 preferred-pm: 3.0.3 prettier: 2.5.1 @@ -4516,7 +4518,6 @@ packages: /@gar/promisify/1.1.3: resolution: {integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==} - dev: false /@graphql-codegen/core/2.5.1_graphql@16.3.0: resolution: {integrity: sha512-alctBVl2hMnBXDLwkgmnFPrZVIiBDsWJSmxJcM4GKg1PB23+xuov35GE47YAyAhQItE1B1fbYnbb1PtGiDZ4LA==} @@ -6171,7 +6172,6 @@ packages: dependencies: '@gar/promisify': 1.1.3 semver: 7.3.5 - dev: false /@npmcli/git/3.0.0: resolution: {integrity: sha512-xfSBJ+KBMZWWqRHFbEgIaXG/LtELHrQZMJ72Gkb3yWdHysu/7+VGOs8ME0c3td7QNQX57Ggo3kYL6ylcd70/kA==} @@ -6186,7 +6186,6 @@ packages: promise-retry: 2.0.1 semver: 7.3.5 which: 2.0.2 - dev: false /@npmcli/installed-package-contents/1.0.7: resolution: {integrity: sha512-9rufe0wnJusCQoLpV9ZPKIVP55itrM5BxOXs10DmdbRfgWtHy1LDyskbwRnBghuB0PrF7pNPOqREVtpz4HqzKw==} @@ -6195,7 +6194,6 @@ packages: dependencies: npm-bundled: 1.1.2 npm-normalize-package-bin: 1.0.1 - dev: false /@npmcli/move-file/1.1.2: resolution: {integrity: sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==} @@ -6203,17 +6201,14 @@ packages: dependencies: mkdirp: 1.0.4 rimraf: 3.0.2 - dev: false /@npmcli/node-gyp/1.0.3: resolution: {integrity: sha512-fnkhw+fmX65kiLqk6E3BFLXNC26rUhK90zVwe2yncPliVT/Qos3xjhTLE59Df8KnPlcwIERXKVlU1bXoUQ+liA==} - dev: false /@npmcli/promise-spawn/1.3.2: resolution: {integrity: sha512-QyAGYo/Fbj4MXeGdJcFzZ+FkDkomfRBrPM+9QYJSg+PxgAUL+LU3FneQk37rKR2/zjqkCV1BLHccX98wRXG3Sg==} dependencies: infer-owner: 1.0.4 - dev: false /@npmcli/run-script/3.0.1: resolution: {integrity: sha512-o2fkld5hYwu9sKYzoXTpqEocMnDLaigobaPzLaGB63k/ExmLBTaB+KpfKlpcIePPnuP8RFR+0GDI4KopJCM6Xg==} @@ -6225,7 +6220,6 @@ packages: read-package-json-fast: 2.0.3 transitivePeerDependencies: - supports-color - dev: false /@nuxtjs/opencollective/0.3.2: resolution: {integrity: sha512-um0xL3fO7Mf4fDxcqx9KryrB7zgRM5JSlvGN5AGkP6JLM5XEKyjeAiPbNxdXVXQ16isuAhYpvP88NgL2BGd6aA==} @@ -8626,7 +8620,6 @@ packages: /@tootallnate/once/2.0.0: resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} engines: {node: '>= 10'} - dev: false /@trysound/sax/0.2.0: resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==} @@ -10729,7 +10722,6 @@ packages: humanize-ms: 1.2.1 transitivePeerDependencies: - supports-color - dev: false /aggregate-error/3.1.0: resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} @@ -11363,7 +11355,6 @@ packages: dependencies: delegates: 1.0.0 readable-stream: 3.6.0 - dev: false /arg/2.0.0: resolution: {integrity: sha512-XxNTUzKnz1ctK3ZIcI2XUPlD96wbHP2nGqkPKpvk/HNRlPveYrXIVSTk9m3LcqOgDPg3B1nMvdV/K8wZd7PG4w==} @@ -12520,7 +12511,6 @@ packages: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} dependencies: balanced-match: 1.0.2 - dev: false /braces/2.3.2: resolution: {integrity: sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==} @@ -12717,8 +12707,7 @@ packages: resolution: {integrity: sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==} /builtins/1.0.3: - resolution: {integrity: sha1-y5T662HIaWRR2zZTThQi+U8K7og=} - dev: false + resolution: {integrity: sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ==} /bundle-require/2.1.8_esbuild@0.14.7: resolution: {integrity: sha512-oOEg3A0hy/YzvNWNowtKD0pmhZKseOFweCbgyMqTIih4gRY1nJWsvrOCT27L9NbIyL5jMjTFrAUpGxxpW68Puw==} @@ -12801,7 +12790,6 @@ packages: ssri: 8.0.1 tar: 6.1.11 unique-filename: 1.1.1 - dev: false /cache-base/1.0.1: resolution: {integrity: sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==} @@ -13180,7 +13168,6 @@ packages: /chownr/2.0.0: resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} engines: {node: '>=10'} - dev: false /chrome-trace-event/1.0.3: resolution: {integrity: sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==} @@ -13196,6 +13183,10 @@ packages: /ci-info/3.3.0: resolution: {integrity: sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==} + /cint/8.2.1: + resolution: {integrity: sha512-gyWqJHXgDFPNx7PEyFJotutav+al92TTC3dWlMFyTETlOyKBQMZb7Cetqmj3GlrnSILHwSJRwf4mIGzc7C5lXw==} + dev: true + /cipher-base/1.0.4: resolution: {integrity: sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==} dependencies: @@ -13273,6 +13264,13 @@ packages: resolution: {integrity: sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==} engines: {node: '>=6'} + /cli-table/0.3.11: + resolution: {integrity: sha512-IqLQi4lO0nIB4tcdTpN4LCB9FI3uqrJZK7RC515EnhZ6qBaglkIgICb1wjeAqpdoOabm1+SuQtkXIPdYC93jhQ==} + engines: {node: '>= 0.2.0'} + dependencies: + colors: 1.0.3 + dev: true + /cli-table3/0.6.1: resolution: {integrity: sha512-w0q/enDHhPLq44ovMGdQeeDLvwxwavsJX7oQGYt/LrBlYsyaxyDnp6z3QzFut/6kLLKnlcUVJLrpB7KBfgG/RA==} engines: {node: 10.* || >= 12.*} @@ -13466,6 +13464,11 @@ packages: resolution: {integrity: sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==} dev: false + /colors/1.0.3: + resolution: {integrity: sha512-pFGrxThWcWQ2MsAz6RtgeWe4NK2kUE1WfsrvvlctdII745EW9I0yflqhe7++M5LEc7bV2c/9/5zc8sFcpL0Drw==} + engines: {node: '>=0.1.90'} + dev: true + /colors/1.4.0: resolution: {integrity: sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==} engines: {node: '>=0.1.90'} @@ -13516,6 +13519,11 @@ packages: resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} engines: {node: '>= 12'} + /commander/9.0.0: + resolution: {integrity: sha512-JJfP2saEKbQqvW+FI93OYUB4ByV5cizMpFMiiJI8xDbBvQvSkIk0VvQdn1CZ8mqAO8Loq2h0gYTYtDFUZUeERw==} + engines: {node: ^12.20.0 || >=14} + dev: true + /common-ancestor-path/1.0.1: resolution: {integrity: sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==} dev: true @@ -13625,7 +13633,6 @@ packages: /console-control-strings/1.1.0: resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - dev: false /consolidate/0.15.1: resolution: {integrity: sha512-DW46nrsMJgy9kqAbPt5rKaCr7uFtpo4mSUvLHIUbJEjm0vo+aY5QLwBUq3FK4tRnJr/X0Psc0C4jf/h+HtXSMw==} @@ -15351,7 +15358,6 @@ packages: requiresBuild: true dependencies: iconv-lite: 0.6.3 - dev: false optional: true /end-of-stream/1.4.4: @@ -15398,7 +15404,6 @@ packages: /env-paths/2.2.1: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} - dev: false /envify/4.1.0: resolution: {integrity: sha512-IKRVVoAYr4pIx4yIWNsz9mOsboxlNXiu7TNBnem/K/uTHdkyzXWDzHCK7UTolqBbgaBz0tQHsD3YNls0uIIjiw==} @@ -15419,7 +15424,6 @@ packages: /err-code/2.0.3: resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==} - dev: false /errno/0.1.8: resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==} @@ -17116,6 +17120,10 @@ packages: /fast-levenshtein/2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + /fast-memoize/2.5.2: + resolution: {integrity: sha512-Ue0LwpDYErFbmNnZSF0UH6eImUwDmogUO1jyE+JbN2gsQz/jICm1Ve7t9QT0rNSsfJt+Hs4/S3GnsDVjL4HVrw==} + dev: true + /fast-redact/3.1.1: resolution: {integrity: sha512-odVmjC8x8jNeMZ3C+rPMESzXVSEU8tSWSHv9HFxP2mm89G/1WwqhrerJDQm9Zus8X6aoRgQDThKqptdNA6bt+A==} engines: {node: '>=6'} @@ -17678,6 +17686,11 @@ packages: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} + /fp-and-or/0.1.3: + resolution: {integrity: sha512-wJaE62fLaB3jCYvY2ZHjZvmKK2iiLiiehX38rz5QZxtdN8fVPJDeZUiVvJrHStdTc+23LHlyZuSEKgFc0pxi2g==} + engines: {node: '>=10'} + dev: true + /fraction.js/4.2.0: resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==} dev: false @@ -17773,7 +17786,6 @@ packages: engines: {node: '>= 8'} dependencies: minipass: 3.1.6 - dev: false /fs-monkey/1.0.3: resolution: {integrity: sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q==} @@ -17853,7 +17865,6 @@ packages: string-width: 4.2.3 strip-ansi: 6.0.1 wide-align: 1.1.5 - dev: false /generate-function/2.3.1: resolution: {integrity: sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==} @@ -17894,6 +17905,11 @@ packages: engines: {node: '>=6'} dev: true + /get-stdin/8.0.0: + resolution: {integrity: sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==} + engines: {node: '>=10'} + dev: true + /get-stream/4.1.0: resolution: {integrity: sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==} engines: {node: '>=6'} @@ -18495,7 +18511,6 @@ packages: /has-unicode/2.0.1: resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - dev: false /has-value/0.3.1: resolution: {integrity: sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==} @@ -19039,7 +19054,6 @@ packages: debug: 4.3.3 transitivePeerDependencies: - supports-color - dev: false /http-proxy-middleware/0.19.1_debug@4.3.3: resolution: {integrity: sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q==} @@ -19174,10 +19188,9 @@ packages: engines: {node: '>=10.17.0'} /humanize-ms/1.2.1: - resolution: {integrity: sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=} + resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} dependencies: ms: 2.1.3 - dev: false /iconv-lite/0.4.13: resolution: {integrity: sha512-QwVuTNQv7tXC5mMWFX5N5wGjmybjNBBD8P3BReTkPmipoxTUFgWM2gXNvldHQr6T14DH0Dh6qBVg98iJt7u4mQ==} @@ -19200,7 +19213,6 @@ packages: engines: {node: '>=0.10.0'} dependencies: safer-buffer: 2.1.2 - dev: false /icss-replace-symbols/1.1.0: resolution: {integrity: sha512-chIaY3Vh2mh2Q3RGXttaDIzeiPvaVXJ+C4DAh/w3c37SKZ/U6PGMmuicR2EQQp9bKG8zLMCl7I+PtIoOOPp8Gg==} @@ -19248,7 +19260,6 @@ packages: engines: {node: '>=10'} dependencies: minimatch: 3.1.2 - dev: false /ignore/3.3.10: resolution: {integrity: sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==} @@ -19757,8 +19768,7 @@ packages: dev: true /is-lambda/1.0.1: - resolution: {integrity: sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU=} - dev: false + resolution: {integrity: sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==} /is-lower-case/1.1.3: resolution: {integrity: sha512-+5A1e/WJpLLXZEDlgz4G//WYSHyQBD32qa4Jd3Lw06qQlv3fJHnp3YIHjTQSGzHMgzmVKz2ZP3rBxTHkPw/lxA==} @@ -21388,6 +21398,10 @@ packages: - utf-8-validate dev: true + /jju/1.4.0: + resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} + dev: true + /joi/17.6.0: resolution: {integrity: sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw==} dependencies: @@ -21489,6 +21503,12 @@ packages: /json-parse-even-better-errors/2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + /json-parse-helpfulerror/1.0.3: + resolution: {integrity: sha512-XgP0FGR77+QhUxjXkwOMkC94k3WtqEBfcnjWqhRd82qTat4SWKRE+9kUnynz/shm3I4ea2+qISvTIeGTNU7kJg==} + dependencies: + jju: 1.4.0 + dev: true + /json-schema-traverse/0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} @@ -21546,10 +21566,13 @@ packages: optionalDependencies: graceful-fs: 4.2.9 + /jsonlines/0.1.1: + resolution: {integrity: sha512-ekDrAGso79Cvf+dtm+mL8OBI2bmAOt3gssYs833De/C9NmIpWDWyUO4zPgB5x2/OhY366dkhgfPMYfwZF7yOZA==} + dev: true + /jsonparse/1.3.1: - resolution: {integrity: sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=} + resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} engines: {'0': node >= 0.2.0} - dev: false /jsonpointer/5.0.0: resolution: {integrity: sha512-PNYZIdMjVIvVgDSYKTT63Y+KZ6IZvGRNNWcxwD+GNnUz1MKPfv30J8ueCjdwcN0nDx2SlshgyB7Oy0epAzVRRg==} @@ -22033,6 +22056,14 @@ packages: libqp: 1.1.0 dev: false + /libnpmconfig/1.2.1: + resolution: {integrity: sha512-9esX8rTQAHqarx6qeZqmGQKBNZR5OIbl/Ayr0qQDy3oXja2iFVQQI81R6GZ2a02bSNZ9p3YOGX1O6HHCb1X7kA==} + dependencies: + figgy-pudding: 3.5.2 + find-up: 3.0.0 + ini: 1.3.8 + dev: true + /libphonenumber-js/1.9.49: resolution: {integrity: sha512-/wEOIONcVboFky+lWlCaF7glm1FhBz11M5PHeCApA+xDdVfmhKjHktHS8KjyGxouV5CSXIr4f3GvLSpJa4qMSg==} dev: false @@ -22460,7 +22491,6 @@ packages: /lru-cache/7.5.0: resolution: {integrity: sha512-8neUvdgNtubJ+VNNqrqOLjUoIlN+NRPFtv1Vne2rQ4uPCxhp0W4TlqntzTLnVVezGXcSSdXTrKCTYooEQA7X6g==} engines: {node: '>=12'} - dev: false /lru_map/0.3.3: resolution: {integrity: sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==} @@ -22544,7 +22574,6 @@ packages: ssri: 8.0.1 transitivePeerDependencies: - supports-color - dev: false /make-iterator/1.0.1: resolution: {integrity: sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==} @@ -23508,7 +23537,6 @@ packages: engines: {node: '>=10'} dependencies: brace-expansion: 2.0.1 - dev: false /minimist-options/4.1.0: resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} @@ -23527,7 +23555,6 @@ packages: engines: {node: '>= 8'} dependencies: minipass: 3.1.6 - dev: false /minipass-fetch/2.0.3: resolution: {integrity: sha512-VA+eiiUtaIvpQJXISwE3OiMvQwAWrgKb97F0aXlCS1Ahikr8fEQq8m3Hf7Kv9KT3nokuHigJKsDMB6atU04olQ==} @@ -23538,35 +23565,30 @@ packages: minizlib: 2.1.2 optionalDependencies: encoding: 0.1.13 - dev: false /minipass-flush/1.0.5: resolution: {integrity: sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==} engines: {node: '>= 8'} dependencies: minipass: 3.1.6 - dev: false /minipass-json-stream/1.0.1: resolution: {integrity: sha512-ODqY18UZt/I8k+b7rl2AENgbWE8IDYam+undIJONvigAz8KR5GWblsFTEfQs0WODsjbSXWlm+JHEv8Gr6Tfdbg==} dependencies: jsonparse: 1.3.1 minipass: 3.1.6 - dev: false /minipass-pipeline/1.2.4: resolution: {integrity: sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==} engines: {node: '>=8'} dependencies: minipass: 3.1.6 - dev: false /minipass-sized/1.0.3: resolution: {integrity: sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==} engines: {node: '>=8'} dependencies: minipass: 3.1.6 - dev: false /minipass/2.9.0: resolution: {integrity: sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==} @@ -23593,7 +23615,6 @@ packages: dependencies: minipass: 3.1.6 yallist: 4.0.0 - dev: false /mississippi/3.0.0: resolution: {integrity: sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==} @@ -24073,7 +24094,6 @@ packages: which: 2.0.2 transitivePeerDependencies: - supports-color - dev: false /node-int64/0.4.0: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} @@ -24250,7 +24270,6 @@ packages: hasBin: true dependencies: abbrev: 1.1.1 - dev: false /normalize-package-data/2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} @@ -24319,18 +24338,53 @@ packages: resolution: {integrity: sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ==} dependencies: npm-normalize-package-bin: 1.0.1 - dev: false + + /npm-check-updates/12.5.3: + resolution: {integrity: sha512-siFg/+Un+j4tLA6GJCnk6hz2YU4Yc5bftDnOoiSRLKL6NeAS3FScB32mtKNBtITMJf2nsoZSr8vH+wdUGeP19g==} + engines: {node: '>=12'} + hasBin: true + dependencies: + chalk: 4.1.2 + cint: 8.2.1 + cli-table: 0.3.11 + commander: 9.0.0 + fast-memoize: 2.5.2 + find-up: 5.0.0 + fp-and-or: 0.1.3 + get-stdin: 8.0.0 + globby: 11.1.0 + hosted-git-info: 4.1.0 + json-parse-helpfulerror: 1.0.3 + jsonlines: 0.1.1 + libnpmconfig: 1.2.1 + lodash: 4.17.21 + minimatch: 5.0.1 + p-map: 4.0.0 + pacote: 13.0.3 + parse-github-url: 1.0.2 + progress: 2.0.3 + prompts: 2.4.2 + rc-config-loader: 4.0.0 + remote-git-tags: 3.0.0 + rimraf: 3.0.2 + semver: 7.3.5 + semver-utils: 1.1.4 + source-map-support: 0.5.21 + spawn-please: 1.0.0 + update-notifier: 5.1.0 + yaml: 1.10.2 + transitivePeerDependencies: + - supports-color + dev: true /npm-install-checks/4.0.0: resolution: {integrity: sha512-09OmyDkNLYwqKPOnbI8exiOZU2GVVmQp7tgez2BPi5OZC8M82elDAps7sxC4l//uSUtotWqoEIDwjRvWH4qz8w==} engines: {node: '>=10'} dependencies: semver: 7.3.5 - dev: false /npm-normalize-package-bin/1.0.1: resolution: {integrity: sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==} - dev: false /npm-package-arg/9.0.0: resolution: {integrity: sha512-yhzXxeor+Zfhe5MGwPdDumz6HtNlj2pMekWB95IX3CC6uDNgde0oPKHDCLDPoJqQfd0HqAWt+y4Hs5m7CK1+9Q==} @@ -24339,7 +24393,6 @@ packages: hosted-git-info: 4.1.0 semver: 7.3.5 validate-npm-package-name: 3.0.0 - dev: false /npm-packlist/1.4.8: resolution: {integrity: sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==} @@ -24358,7 +24411,6 @@ packages: ignore-walk: 4.0.1 npm-bundled: 1.1.2 npm-normalize-package-bin: 1.0.1 - dev: false /npm-pick-manifest/7.0.0: resolution: {integrity: sha512-njM1AcdioFaKd0JSGtLO09YA1WRwctjGQJbnHGmKS+u+uwP8oFvtZtOQWPYdxrnY5eJud3wn8OpH4sEIx6+GEQ==} @@ -24368,7 +24420,6 @@ packages: npm-normalize-package-bin: 1.0.1 npm-package-arg: 9.0.0 semver: 7.3.5 - dev: false /npm-registry-fetch/13.0.1: resolution: {integrity: sha512-Ak+LXVtSrCLOdscFW/apUw67OPNph8waHsPKM9UOJosL7i59EF5XoSWQMEsXEOeifM9Bb4/2+WrQC4t/pd8DGg==} @@ -24383,7 +24434,6 @@ packages: proc-log: 2.0.0 transitivePeerDependencies: - supports-color - dev: false /npm-run-path/2.0.2: resolution: {integrity: sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==} @@ -24414,7 +24464,6 @@ packages: console-control-strings: 1.1.0 gauge: 4.0.3 set-blocking: 2.0.0 - dev: false /nprogress/0.2.0: resolution: {integrity: sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==} @@ -24951,7 +25000,6 @@ packages: engines: {node: '>=10'} dependencies: aggregate-error: 3.1.0 - dev: false /p-retry/3.0.1: resolution: {integrity: sha512-XE6G4+YTTkT2a0UWb2kjZe8xNwf8bIbnqpc/IS/idOBVhyves0mK5OJgeocjx7q5pvX/6m23xuzVPYT1uGM73w==} @@ -25034,7 +25082,6 @@ packages: tar: 6.1.11 transitivePeerDependencies: - supports-color - dev: false /pako/1.0.11: resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} @@ -25124,6 +25171,12 @@ packages: path-root: 0.1.1 dev: false + /parse-github-url/1.0.2: + resolution: {integrity: sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==} + engines: {node: '>=0.10.0'} + hasBin: true + dev: true + /parse-json/4.0.0: resolution: {integrity: sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==} engines: {node: '>=4'} @@ -27851,7 +27904,6 @@ packages: /proc-log/2.0.0: resolution: {integrity: sha512-I/35MfCX2H8jBUhKN8JB8nmqvQo/nKdrBodBY7L3RhDSPPyvOHwLYNmPuhwuJq7a7C3vgFKWGQM+ecPStcvOHA==} engines: {node: ^12.13.0 || ^14.15.0 || >=16} - dev: false /process-nextick-args/2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} @@ -27884,7 +27936,6 @@ packages: dependencies: err-code: 2.0.3 retry: 0.12.0 - dev: false /promise.allsettled/1.0.5: resolution: {integrity: sha512-tVDqeZPoBC0SlzJHzWGZ2NKAguVq2oiYj7gbggbiTvH2itHohijTp7njOUA0aQ/nl+0lr/r6egmhoYu63UZ/pQ==} @@ -28184,6 +28235,17 @@ packages: iconv-lite: 0.4.24 unpipe: 1.0.0 + /rc-config-loader/4.0.0: + resolution: {integrity: sha512-//LRTblJEcqbmmro1GCmZ39qZXD+JqzuD8Y5/IZU3Dhp3A1Yr0Xn68ks8MQ6qKfKvYCWDveUmRDKDA40c+sCXw==} + dependencies: + debug: 4.3.3 + js-yaml: 4.1.0 + json5: 2.2.0 + require-from-string: 2.0.2 + transitivePeerDependencies: + - supports-color + dev: true + /rc/1.2.8: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true @@ -28854,7 +28916,6 @@ packages: dependencies: json-parse-even-better-errors: 2.3.1 npm-normalize-package-bin: 1.0.1 - dev: false /read-package-json/4.1.2: resolution: {integrity: sha512-Dqer4pqzamDE2O4M55xp1qZMuLPqi4ldk2ya648FOMHRjwMzFhuxVrG04wd0c38IsvkVdr3vgHI6z+QTPdAjrQ==} @@ -28864,7 +28925,6 @@ packages: json-parse-even-better-errors: 2.3.1 normalize-package-data: 3.0.3 npm-normalize-package-bin: 1.0.1 - dev: false /read-pkg-up/7.0.1: resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} @@ -29222,6 +29282,11 @@ packages: unist-util-visit: 4.1.0 dev: true + /remote-git-tags/3.0.0: + resolution: {integrity: sha512-C9hAO4eoEsX+OXA4rla66pXZQ+TLQ8T9dttgQj18yuKlPMTVkIkdYXvlMC55IuUsIkV6DpmQYi10JKFLaU+l7w==} + engines: {node: '>=8'} + dev: true + /remove-accents/0.4.2: resolution: {integrity: sha512-7pXIJqJOq5tFgG1A2Zxti3Ht8jJF337m4sowbuHsW30ZnkQFnDzy9qBNhgzX8ZLW4+UBcXiiR7SwR6pokHsxiA==} dev: false @@ -29905,6 +29970,10 @@ packages: resolution: {integrity: sha512-TcZvGMMy9vodEFSse30lWinkj+JgOBvPn8wRItpQRSayhc+4ssDs335uklkfvQQJgL/WvmHLVj4Ycv2s7QCQMg==} dev: false + /semver-utils/1.1.4: + resolution: {integrity: sha512-EjnoLE5OGmDAVV/8YDoN5KiajNadjzIp9BAHOhYeQHt7j0UWxjmgsx4YD48wp4Ue1Qogq38F1GNUJNqF1kKKxA==} + dev: true + /semver/5.3.0: resolution: {integrity: sha512-mfmm3/H9+67MCVix1h+IXTpDwL6710LyHuk7+cWC9T1mE0qz4iHhh6r4hU2wrIT9iTsAAC2XQRvfblL028cpLw==} hasBin: true @@ -30289,7 +30358,6 @@ packages: /smart-buffer/4.2.0: resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} - dev: false /smartwrap/1.2.5: resolution: {integrity: sha512-bzWRwHwu0RnWjwU7dFy7tF68pDAx/zMSu3g7xr9Nx5J0iSImYInglwEVExyHLxXljy6PWMjkSAbwF7t2mPnRmg==} @@ -30373,7 +30441,6 @@ packages: socks: 2.6.2 transitivePeerDependencies: - supports-color - dev: false /socks/2.6.2: resolution: {integrity: sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA==} @@ -30381,7 +30448,6 @@ packages: dependencies: ip: 1.1.5 smart-buffer: 4.2.0 - dev: false /solid-js/1.3.12: resolution: {integrity: sha512-JnIoF5f40WR8LTEU1McFz/xVnXT3bGyBIme7gFbGj2ch6wXg+vcfbbhc2mz6YaLJIt8NEU+wAg8v+6SX3ZP9mA==} @@ -30522,6 +30588,11 @@ packages: dev: false optional: true + /spawn-please/1.0.0: + resolution: {integrity: sha512-Kz33ip6NRNKuyTRo3aDWyWxeGeM0ORDO552Fs6E1nj4pLWPkl37SrRtTnq+MEopVaqgmaO6bAvVS+v64BJ5M/A==} + engines: {node: '>=10'} + dev: true + /spawn-wrap/2.0.0: resolution: {integrity: sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==} engines: {node: '>=8'} @@ -30672,7 +30743,6 @@ packages: engines: {node: '>= 8'} dependencies: minipass: 3.1.6 - dev: false /stable/0.1.8: resolution: {integrity: sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==} @@ -31589,7 +31659,6 @@ packages: minizlib: 2.1.2 mkdirp: 1.0.4 yallist: 4.0.0 - dev: false /tarn/3.0.2: resolution: {integrity: sha512-51LAVKUSZSVfI05vjPESNc5vwqqZpbXCsU+/+wxlOrUjk2SnFTt97v9ZgQrD4YmxYW1Px6w2KjaDitCfkvgxMQ==} @@ -33086,10 +33155,9 @@ packages: spdx-expression-parse: 3.0.1 /validate-npm-package-name/3.0.0: - resolution: {integrity: sha1-X6kS2B630MdK/BQN5zF/DKffQ34=} + resolution: {integrity: sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw==} dependencies: builtins: 1.0.3 - dev: false /validator/13.7.0: resolution: {integrity: sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==} @@ -34140,7 +34208,6 @@ packages: resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} dependencies: string-width: 4.2.3 - dev: false /widest-line/3.1.0: resolution: {integrity: sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==} diff --git a/scripts/cli.ts b/scripts/cli.ts index 0f36961..cfc2446 100644 --- a/scripts/cli.ts +++ b/scripts/cli.ts @@ -11,6 +11,7 @@ import useCachePackage from './cache-package'; import useRenameWorkspacePackage from './rename-package'; import useForkWorkspace from './fork-workspace'; import useReleaseProject from './release'; +import useUpdatePackageDependencies from './update-dep-version'; const cli = cac('LinbuduLab-Starter'); @@ -26,6 +27,7 @@ useCachePackage(cli); useRenameWorkspacePackage(cli); useForkWorkspace(cli); useReleaseProject(cli); +useUpdatePackageDependencies(cli); cli.help(); cli.parse(); diff --git a/scripts/update-dep-version.ts b/scripts/update-dep-version.ts new file mode 100644 index 0000000..5cab303 --- /dev/null +++ b/scripts/update-dep-version.ts @@ -0,0 +1,53 @@ +import { CAC } from 'cac'; + +import chalk from 'chalk'; +import { CLIUtils, Constants } from './utils'; +import consola from 'consola'; +import path from 'path'; + +import * as ncu from 'npm-check-updates'; + +export default function useUpdatePackageDependencies(cli: CAC) { + cli + .command( + 'upgrade [...pkg]', + 'update package or workspace dependencies version', + { allowUnknownOptions: true } + ) + + .action(async (pkg: string[]) => { + const useBlur = !pkg.every((p) => p.includes('-')); + + const targetPackages = pkg.length + ? CLIUtils.existWorkspacePackageFilter(pkg, useBlur) + : CLIUtils.existPackages; + + const confirm = await CLIUtils.createConfirmSelector( + `Matched projects: ${chalk.green(targetPackages.join(', '))}` + ); + + if (!confirm) { + consola.info('Operation Cancelled.'); + } + + for (const pkg of targetPackages) { + const projectPackageJsonPath = path.join( + CLIUtils.resolvePackageDir(pkg), + 'package.json' + ); + + consola.info(`Updating ${chalk.bold.green(pkg)} dependencies...`); + + await ncu.run({ + packageFile: projectPackageJsonPath, + upgrade: true, + color: true, + peer: true, + registry: Constants.internalRegistry, + jsonUpgraded: true, + }); + + consola.success(`Updated ${chalk.bold.green(pkg)} dependencies.`); + } + }); +} diff --git a/scripts/utils.ts b/scripts/utils.ts index 750c2be..2c3faf3 100644 --- a/scripts/utils.ts +++ b/scripts/utils.ts @@ -34,6 +34,10 @@ export class Constants { return path.resolve(Constants.cacheDir, 'packages'); } + public static get internalRegistry() { + return 'https://registry.npmmirror.com'; + } + /** * colors: {@link https://revel-in-color.vercel.app/} * @returns @@ -109,6 +113,20 @@ export class CLIUtils { return path.resolve(__dirname, '../', Constants.packagesCacheDir, p); } + public static existWorkspacePackageFilter(projects: string[], blur = false) { + const existPackages = CLIUtils.existPackages; + + const matcher = blur + ? existPackages.map((p) => p.split('-')).flat(Infinity) + : existPackages; + + const matched = projects.filter((p) => matcher.includes(p)); + + return blur + ? existPackages.filter((p) => matched.some((m) => p.includes(m))) + : matched; + } + public static findInfoFromKeywords(input: string) { const inputFragment = input.split('-'); for (const info of Object.values(Constants.starterInfoMap)) {