From 95621da654c6ead2e28ded4d0e46af2cdf4eddae Mon Sep 17 00:00:00 2001 From: Revone Date: Sun, 19 Nov 2023 17:48:54 +0800 Subject: [PATCH] chore: Check if the latest version of the npm package is already installable. --- CHANGELOG.md | 2 +- package.json | 3 ++- scripts/check_exist_remotely.sh | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100755 scripts/check_exist_remotely.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index b168111..ce0dd2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file. - [Semantic Versioning](https://semver.org/spec/v2.0.0.html) - [`auto-changelog`](https://github.com/CookPete/auto-changelog) -## [v1.46.1](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming) +## [v1.46.2](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming) ### Changes diff --git a/package.json b/package.json index 589b64a..97278ce 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "format:src": "prettier --write 'src/**/*.{js,ts}'", "format:test": "prettier --write 'test/**/*.{js,ts}'", "format": "npm run format:src && npm run format:test", + "check:exist-latest": "sh scripts/check_exist_remotely.sh", "ci": "env && git fetch --tags && npm run inspect && npm run lint && npm run build && npm run test:unit && npm run changelog", "update:subs": "npm i avl-tree-typed binary-tree-typed bst-typed heap-typed data-structure-typed --save-dev", "install:all-subs": "npm i avl-tree-typed binary-tree-typed bst-typed deque-typed directed-graph-typed doubly-linked-list-typed graph-typed heap-typed linked-list-typed max-heap-typed max-priority-queue-typed min-heap-typed min-priority-queue-typed priority-queue-typed singly-linked-list-typed stack-typed tree-multimap-typed trie-typed undirected-graph-typed queue-typed --save-dev", @@ -40,7 +41,7 @@ "copy:to-subs": "sh scripts/copy_to_all_subs.sh", "publish:subs": "npm run copy:to-subs && sh scripts/publish_all_subs.sh", "publish:docs": "sh scripts/publish_docs.sh", - "publish:all": "npm run ci && npm publish && npm run publish:docs && npm run publish:subs" + "publish:all": "npm run ci && npm publish && npm run publish:docs && npm run check:exist-latest && npm run publish:subs" }, "repository": { "type": "git", diff --git a/scripts/check_exist_remotely.sh b/scripts/check_exist_remotely.sh new file mode 100755 index 0000000..2327bf2 --- /dev/null +++ b/scripts/check_exist_remotely.sh @@ -0,0 +1,3 @@ +PACKAGE_VERSION=$(jq -r '.version' package.json) +echo checking data-structure-typed@$PACKAGE_VERSION +npm view data-structure-typed@$PACKAGE_VERSION