diff --git a/.github/workflows/ci-lint-typescript.yml b/.github/workflows/ci-lint-typescript.yml index 6307335b83..2b8a1c58c6 100644 --- a/.github/workflows/ci-lint-typescript.yml +++ b/.github/workflows/ci-lint-typescript.yml @@ -22,14 +22,14 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@v4 + with: + package_json_file: libs/typescript/package.json - name: Install Node dependencies - run: | - pnpm install --frozen-lockfile - pnpm -C libs/typescript install --frozen-lockfile + run: pnpm -C libs/typescript install --frozen-lockfile - name: TypeScript typecheck - run: node ./scripts/typescript-typecheck.js + run: pnpm -C libs/typescript typecheck - name: Prettier check - run: pnpm prettier --check "libs/typescript/**/*.{ts,tsx,js,jsx,json,md,yaml,yml}" + run: pnpm -C libs/typescript format:check diff --git a/.github/workflows/claude-auto-fix.yml b/.github/workflows/claude-auto-fix.yml index f978d156fb..563b90a206 100644 --- a/.github/workflows/claude-auto-fix.yml +++ b/.github/workflows/claude-auto-fix.yml @@ -252,7 +252,7 @@ jobs: TYPESCRIPT TOOLS: - prettier: code formatter - - TypeScript: type checking via node ./scripts/typescript-typecheck.js + - TypeScript: type checking via pnpm -C libs/typescript typecheck - pnpm: package manager TASK: @@ -269,10 +269,10 @@ jobs: - Formatting: uv run black . - Linting: uv run ruff check . --fix For TypeScript lint failures: - - Formatting: pnpm prettier --write "**/*.{ts,tsx,js,jsx,json,md,yaml,yml}" + - Formatting: pnpm -C libs/typescript format After auto-fixing, verify the fix passes: - Python: uv run isort --check-only . && uv run black --check . && uv run ruff check . - - TypeScript: pnpm prettier --check "**/*.{ts,tsx,js,jsx,json,md,yaml,yml}" + - TypeScript: pnpm -C libs/typescript format:check FIXING TEST FAILURES: For Python test failures: @@ -280,7 +280,7 @@ jobs: - The test environment uses CUA_TELEMETRY_ENABLED=false - Tests use pytest-asyncio with asyncio_mode=auto For TypeScript build/type failures: - - Check types: node ./scripts/typescript-typecheck.js + - Check types: pnpm -C libs/typescript typecheck - Build: cd libs/typescript && pnpm install && pnpm build IMPORTANT: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a2e354939e..7fc73c95df 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,11 +11,11 @@ repos: - repo: local hooks: - - id: tsc + - id: typescript-typecheck name: TypeScript type check - entry: node ./scripts/typescript-typecheck.js - language: node - files: \.(ts|tsx)$ + entry: pnpm -C libs/typescript typecheck + language: system + files: ^libs/typescript/.*\.(ts|tsx)$ pass_filenames: false - repo: https://github.com/PyCQA/isort diff --git a/libs/typescript/.prettierignore b/libs/typescript/.prettierignore new file mode 100644 index 0000000000..a695b1a918 --- /dev/null +++ b/libs/typescript/.prettierignore @@ -0,0 +1,3 @@ +node_modules/ +**/dist/ +**/coverage/ diff --git a/libs/typescript/package.json b/libs/typescript/package.json index ebc0f82fd8..86cd628fff 100644 --- a/libs/typescript/package.json +++ b/libs/typescript/package.json @@ -14,7 +14,7 @@ "test:core": "pnpm --filter @trycua/core test", "test:computer": "pnpm --filter @trycua/computer test", "test": "pnpm -r test", - "typecheck": "pnpm -r typecheck", + "typecheck": "pnpm build:core && pnpm -r typecheck", "format": "prettier --write .", "format:check": "prettier --check ." }, diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 2df654cb9e..0000000000 --- a/package-lock.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "cua", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "devDependencies": { - "prettier": "^3.6.2" - } - }, - "node_modules/prettier": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", - "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", - "dev": true, - "license": "MIT", - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - } - } -}