From 66ddab8ebfc922336e74d9034500c8ebda500e68 Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Fri, 14 Mar 2025 14:18:38 +0800 Subject: [PATCH] chore: Update package.json scripts for improved build and testing workflow - Reorganized scripts to include a new build check that runs tests, type checks, and i18n checks before publishing. - Restored and structured type checking and linting scripts for better clarity and usability. - Ensured post-installation dependencies are correctly handled. --- package.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 57718664..10272fc9 100644 --- a/package.json +++ b/package.json @@ -18,16 +18,10 @@ } }, "scripts": { - "format": "prettier --write .", - "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix", - "typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false", - "typecheck:web": "tsc --noEmit -p tsconfig.web.json --composite false", - "typecheck": "npm run typecheck:node && npm run typecheck:web", "start": "electron-vite preview", "dev": "electron-vite dev", - "build:check": "yarn typecheck", "build": "npm run typecheck && electron-vite build", - "postinstall": "electron-builder install-app-deps", + "build:check": "yarn test && yarn typecheck && yarn check:i18n", "build:unpack": "dotenv npm run build && electron-builder --dir", "build:win": "dotenv npm run build && electron-builder --win", "build:win:x64": "dotenv npm run build && electron-builder --win --x64", @@ -39,14 +33,20 @@ "build:linux:x64": "dotenv electron-vite build && electron-builder --linux --x64", "build:npm": "node scripts/build-npm.js", "release": "node scripts/version.js", - "publish": "yarn release patch push", + "publish": "yarn build:check && yarn release patch push", "pulish:artifacts": "cd packages/artifacts && npm publish && cd -", "generate:agents": "yarn workspace @cherry-studio/database agents", "generate:icons": "electron-icon-builder --input=./build/logo.png --output=build", "analyze:renderer": "VISUALIZER_RENDERER=true yarn build", "analyze:main": "VISUALIZER_MAIN=true yarn build", - "check": "node scripts/check-i18n.js", - "test": "tsx --test src/**/*.test.ts" + "typecheck": "npm run typecheck:node && npm run typecheck:web", + "typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false", + "typecheck:web": "tsc --noEmit -p tsconfig.web.json --composite false", + "check:i18n": "node scripts/check-i18n.js", + "test": "npx -y tsx --test src/**/*.test.ts", + "format": "prettier --write .", + "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix", + "postinstall": "electron-builder install-app-deps" }, "dependencies": { "@agentic/exa": "^7.3.3",