From 603c9b8a38082dc7f4731d59101555dbc974240a Mon Sep 17 00:00:00 2001 From: tecvan <84165678+Tecvan-fe@users.noreply.github.com> Date: Thu, 31 Jul 2025 17:40:27 +0800 Subject: [PATCH] chore: remove useless files (#405) --- common/_templates/rsbuild-web/scm_build.sh | 24 ----- common/_templates/rspack-web/scm_build.sh | 24 ----- frontend/apps/coze-studio/scm_build.sh | 29 ------ frontend/scripts/scm_base.sh | 104 --------------------- 4 files changed, 181 deletions(-) delete mode 100644 common/_templates/rsbuild-web/scm_build.sh delete mode 100644 common/_templates/rspack-web/scm_build.sh delete mode 100644 frontend/apps/coze-studio/scm_build.sh delete mode 100644 frontend/scripts/scm_base.sh diff --git a/common/_templates/rsbuild-web/scm_build.sh b/common/_templates/rsbuild-web/scm_build.sh deleted file mode 100644 index 8ecfea30..00000000 --- a/common/_templates/rsbuild-web/scm_build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -# Switch cwd to the project folder -cd $(dirname "$0") - -# Import the utilities functions -source ../../scripts/scm_base.sh - -# Clean up the build directory -rm -rf dist -rm -rf "${ROOT_DIR}"/output - -# Prepare -prepare_environment - -# Install the dependencies -install_project_deps - -build_project - -mkdir -p ${ROOT_DIR}/output -cp -r ./dist/* ${ROOT_DIR}/output/ diff --git a/common/_templates/rspack-web/scm_build.sh b/common/_templates/rspack-web/scm_build.sh deleted file mode 100644 index 01c8dbb2..00000000 --- a/common/_templates/rspack-web/scm_build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -# Switch cwd to the project folder -cd $(dirname "$0") - -# Import the utilities functions -source ../../scripts/scm_base.sh - -# Clean up the build directory -rm -rf output -rm -rf "${ROOT_DIR}"/output - -# Prepare -prepare_environment - -# Install the dependencies -install_project_deps - -build_project - -mkdir -p ${ROOT_DIR}/output -cp -r ./output/* ${ROOT_DIR}/output/ diff --git a/frontend/apps/coze-studio/scm_build.sh b/frontend/apps/coze-studio/scm_build.sh deleted file mode 100644 index bbdd94c7..00000000 --- a/frontend/apps/coze-studio/scm_build.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -# Switch cwd to the project folder -cd $(dirname "$0") - -# Import the utilities functions -source ../../scripts/scm_base.sh - -# Clean up the build directory -rm -rf dist -rm -rf "${ROOT_DIR}"/output - -# Prepare -prepare_environment - -# Install the dependencies -CUSTOM_SKIP_POST_INSTALL=true rushx --debug install -t . -t tag:phase-prebuild -t @coze-arch/rush-x -t tag:rush-tools - -NO_STARLING=true bash $ROOT_DIR/scripts/post-rush-install.sh - -NODE_OPTIONS='--max-old-space-size=8192' NODE_ENV=production npm run build - -mkdir -p ${ROOT_DIR}/output -mkdir -p ${ROOT_DIR}/output_resource/static -cp -r ./dist/index.html ${ROOT_DIR}/output/ - -cp -r ./dist/static/* ${ROOT_DIR}/output_resource/static diff --git a/frontend/scripts/scm_base.sh b/frontend/scripts/scm_base.sh deleted file mode 100644 index 80d3aee2..00000000 --- a/frontend/scripts/scm_base.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env bash -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -ROOT_DIR=$(realpath "$SCRIPT_DIR/..") -echo $ROOT_DIR -RUSH_FILE="$ROOT_DIR/common/scripts/install-run-rush.js" - -source "$ROOT_DIR/scripts/setup-env.sh" - -# Fix https://code.byted.org/apaas/monorepo/issues/45 -# Use the latest git version from leafboat -export PATH=/tmp/leafboat/bin:$PATH - -die() { - echo $1 - exit 1 -} - -rushx() { - node $RUSH_FILE "$@" -} - -rushtool () { - RUSH_X_PATH=$ROOT_DIR/ee/infra/rush-x/bin/run - node $RUSH_X_PATH "$@" -} - -# Install multiple package dependencies at the same time. -# -# Usage: -# install_package_deps @kunlun/typings @apaas/vite.app @apaas/react.app -install_package_deps() -{ - if [ $# -eq 0 ]; then - die "install_package_deps: missing arguments" - fi - - args="" - for pkg in "$@"; - do - args="-t ${pkg} -t tag:rush-tools ${args}" - done - rushx --debug install ${args} -} - -# Prepare the rush project environment. -prepare_environment() -{ - npm i -g pnpm@8.15.8 -} - - -# Install current project dependencies. -# It will abort with errors if package.json is not found in the current directory. -# -# Usage: -# install_project_deps -install_project_deps() -{ - if [ ! -f package.json ]; then - die "install_project_deps: package.json not found" - fi - install_package_deps . -} - - -# Build current project. -# It will abort with errors if package.json is not found in the current directory. -# -# Usage: -# build_project -build_project() -{ - if [ ! -f package.json ]; then - die "build_project: package.json not found" - fi - rushx build -t . -} - -# Build current project with dependencies. -# It will abort with errors if package.json is not found in the current directory. -# -# Usage: -# build_project_deps -build_project_deps() -{ - if [ ! -f package.json ]; then - die "build_project: package.json not found" - fi - rushx build -T . -} - -# Force Build current project. -# It will abort with errors if package.json is not found in the current directory. -# -# Usage: -# build_project_ignore_cache -build_project_ignore_cache() -{ - if [ ! -f package.json ]; then - die "build_project: package.json not found" - fi - rushx build -T . -v - rushx rebuild -o . -v -}