From 3d3d9d7862ac91091688b3c491571f6333b97df7 Mon Sep 17 00:00:00 2001 From: Mirone Date: Fri, 6 Sep 2024 01:12:09 +0800 Subject: [PATCH] chore: clean unused scripts (#8202) --- package.json | 1 - scripts/clean.sh | 27 --------------- scripts/publish.sh | 43 ------------------------ scripts/replace-canary-version.sh | 55 ------------------------------- 4 files changed, 126 deletions(-) delete mode 100755 scripts/clean.sh delete mode 100755 scripts/publish.sh delete mode 100755 scripts/replace-canary-version.sh diff --git a/package.json b/package.json index 005d22d8342b..a3b0d66f2db4 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "size:data": "tsx ./scripts/size-data.ts", "size:report": "tsx ./scripts/size-report.ts", "size:generate": "./scripts/size-generate.sh", - "clean": "./scripts/clean.sh", "ci:version:canary": "changeset version --snapshot canary && pnpm install --no-frozen-lockfile", "ci:publish:canary": "pnpm run build:packages && pnpm publish --access public -r --no-git-checks --tag canary", "release-note:draft": "tsx ./scripts/release-note/convert.ts", diff --git a/scripts/clean.sh b/scripts/clean.sh deleted file mode 100755 index 0c5c9e4e2207..000000000000 --- a/scripts/clean.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -set -eu -o pipefail - -# ALL_PACKAGES -packages=( - "framework/block-std" - "framework/global" - "framework/store" - "framework/inline" - "framework/sync" - "affine/model" - "affine/shared" - "affine/components" - "affine/block-paragraph" - "affine/block-list" - "affine/block-surface" - "blocks" - "docs" - "presets" - "playground" -) - -for package in "${packages[@]}" -do - rm -rf "packages/$package/dist" "packages/$package/tsconfig.tsbuildinfo" "test-results" "packages/$package/node_modules/.vite" -done diff --git a/scripts/publish.sh b/scripts/publish.sh deleted file mode 100755 index 0460733d7f99..000000000000 --- a/scripts/publish.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -# Never set eux here otherwise it will break the CI - -# ALL_PACKAGES -packages=( - "framework/block-std" - "framework/global" - "framework/store" - "framework/inline" - "framework/sync" - "affine/model" - "affine/shared" - "affine/components" - "affine/block-paragraph" - "affine/block-list" - "affine/block-surface" - "blocks" - # "docs" # NOT PUBLISHING - "presets" - # "playground" # NOT PUBLISHING -) - -npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" - -pnpm build:packages - -for package in "${packages[@]}" -do - cd "packages/$package" - - if [ "$CANARY" = "true" ]; then - pnpm publish --no-git-checks --tag canary - else - pnpm publish - fi - - if [[ $package == framework/* || $package == affine/* ]]; then - cd ../../../ - else - cd ../../ - fi -done diff --git a/scripts/replace-canary-version.sh b/scripts/replace-canary-version.sh deleted file mode 100755 index 87814129583f..000000000000 --- a/scripts/replace-canary-version.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash - -# Never set eux here otherwise it will break the CI - -# ALL_PACKAGES -packages=( - "framework/block-std" - "framework/global" - "framework/store" - "framework/inline" - "framework/sync" - "affine/model" - "affine/shared" - "affine/components" - "affine/block-paragraph" - "affine/block-list" - "affine/block-surface" - "blocks" - # "docs" # NOT PUBLISHING - "presets" - # "playground" # NOT PUBLISHING -) - -replace() { - mv package-modified.json package.json - - CURRENT_VERSION="0.16.0" - IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION" - MINOR=$((MINOR + 1)) - VERSION="$MAJOR.$MINOR.$PATCH" - - # https://github.com/toeverything/set-build-version - pnpm version "$VERSION-canary-$BUILD_VERSION" --no-git-tag-version --no-commit-hooks -} - -for package in "${packages[@]}" -do - unprefixed_package="$package" - - if [[ $unprefixed_package == affine/* ]]; then - unprefixed_package="${unprefixed_package/#affine\//affine-}" - elif [[ $unprefixed_package == framework/* ]]; then - unprefixed_package="${unprefixed_package/#framework\//}" - fi - - cd "packages/$package" - jq ".name = \"@blocksuite/${unprefixed_package}\"" package.json > package-modified.json - replace - - if [[ $package == framework/* || $package == affine/* ]]; then - cd ../../../ - else - cd ../../ - fi -done