diff --git a/.github/workflows/test-and-check.yml b/.github/workflows/test-and-check.yml new file mode 100644 index 00000000..0b8d1fe4 --- /dev/null +++ b/.github/workflows/test-and-check.yml @@ -0,0 +1,29 @@ +name: Test and check +on: + push: + +jobs: + test: + runs-on: ubuntu-24.04 + strategy: + matrix: + node-version: [20, 22] + steps: + - uses: actions/checkout@v4 + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10.8.0 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + - name: Install dependencies + run: pnpm install + - name: Run linter + run: pnpm check:turbo + - name: Run linter (formatting) + run: pnpm check:format + - name: Run tests + run: pnpm test diff --git a/.prettierignore b/.prettierignore index 8b491ea9..062d9d6d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,5 @@ .changeset +.github/ pnpm-lock.yaml vitest.config.ts.timestamp* vite.config.ts.timestamp* diff --git a/apps/sandbox-container/.eslintrc.cjs b/apps/sandbox-container/.eslintrc.cjs new file mode 100644 index 00000000..f6bf291a --- /dev/null +++ b/apps/sandbox-container/.eslintrc.cjs @@ -0,0 +1,5 @@ +/** @type {import("eslint").Linter.Config} */ +module.exports = { + root: true, + extends: ['@repo/eslint-config/default.cjs'], +} diff --git a/apps/sandbox-container/package.json b/apps/sandbox-container/package.json index 15c1ee64..6a79ca05 100644 --- a/apps/sandbox-container/package.json +++ b/apps/sandbox-container/package.json @@ -4,6 +4,7 @@ "private": true, "type": "module", "scripts": { + "check:types": "run-tsc", "deploy": "wrangler deploy", "dev": "concurrently \"tsx container/index.ts\" \"wrangler dev --var \"ENVIRONMENT:dev\"\"", "build": "docker build .", diff --git a/apps/workers-observability/package.json b/apps/workers-observability/package.json index 2199c60b..2184c600 100644 --- a/apps/workers-observability/package.json +++ b/apps/workers-observability/package.json @@ -3,6 +3,8 @@ "version": "0.0.1", "private": true, "scripts": { + "check:lint": "run-eslint-workers", + "check:types": "run-tsc", "deploy": "wrangler deploy", "dev": "wrangler dev", "start": "wrangler dev", diff --git a/apps/workers-observability/worker-configuration.d.ts b/apps/workers-observability/worker-configuration.d.ts index b0651f00..d389ebdd 100644 --- a/apps/workers-observability/worker-configuration.d.ts +++ b/apps/workers-observability/worker-configuration.d.ts @@ -2,6 +2,7 @@ // Runtime types generated with workerd@1.20250310.0 2025-03-10 export interface Env { OAUTH_KV: KVNamespace; + // eslint-disable-next-line @typescript-eslint/consistent-type-imports MCP_OBJECT: DurableObjectNamespace; AI: Ai; CLOUDFLARE_CLIENT_ID: string; diff --git a/package.json b/package.json index 583d9273..208e8078 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,9 @@ "sideEffects": false, "scripts": { "changeset:new": "run-changeset-new", + "check:deps": "pnpm exec syncpack lint", + "check:format": "prettier . --check --cache --ignore-unknown", + "check:turbo": "run-turbo check", "test:ci": "run-vitest-ci", "test": "vitest run", "lint": "prettier . --write", @@ -32,6 +35,7 @@ "@vitest/ui": "3.0.9", "prettier": "3.5.3", "syncpack": "13.0.3", + "turbo": "^2.5.0", "typescript": "5.5.4", "vitest": "3.0.9" }, diff --git a/packages/tools/bin/run-turbo b/packages/tools/bin/run-turbo new file mode 100755 index 00000000..f9230fd2 --- /dev/null +++ b/packages/tools/bin/run-turbo @@ -0,0 +1,8 @@ +#!/bin/bash + +# Helper script for running turbo with tracking disabled +# so that we don't have to export this env var everywhere. + +export DO_NOT_TRACK=1 + +turbo "$@" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f672e70e..ef4e2a46 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -39,6 +39,9 @@ importers: syncpack: specifier: 13.0.3 version: 13.0.3(typescript@5.5.4) + turbo: + specifier: ^2.5.0 + version: 2.5.0 typescript: specifier: 5.5.4 version: 5.5.4 @@ -169,7 +172,7 @@ importers: version: 9.1.0(eslint@8.57.0) eslint-config-turbo: specifier: 2.4.2 - version: 2.4.2(eslint@8.57.0)(turbo@2.4.4) + version: 2.4.2(eslint@8.57.0)(turbo@2.5.0) eslint-import-resolver-typescript: specifier: 3.8.3 version: 3.8.3(eslint-plugin-import@2.31.0)(eslint@8.57.0) @@ -3177,38 +3180,38 @@ packages: engines: {node: '>=18.0.0'} hasBin: true - turbo-darwin-64@2.4.4: - resolution: {integrity: sha512-5kPvRkLAfmWI0MH96D+/THnDMGXlFNmjeqNRj5grLKiry+M9pKj3pRuScddAXPdlxjO5Ptz06UNaOQrrYGTx1g==} + turbo-darwin-64@2.5.0: + resolution: {integrity: sha512-fP1hhI9zY8hv0idym3hAaXdPi80TLovmGmgZFocVAykFtOxF+GlfIgM/l4iLAV9ObIO4SUXPVWHeBZQQ+Hpjag==} cpu: [x64] os: [darwin] - turbo-darwin-arm64@2.4.4: - resolution: {integrity: sha512-/gtHPqbGQXDFhrmy+Q/MFW2HUTUlThJ97WLLSe4bxkDrKHecDYhAjbZ4rN3MM93RV9STQb3Tqy4pZBtsd4DfCw==} + turbo-darwin-arm64@2.5.0: + resolution: {integrity: sha512-p9sYq7kXH7qeJwIQE86cOWv/xNqvow846l6c/qWc26Ib1ci5W7V0sI5thsrP3eH+VA0d+SHalTKg5SQXgNQBWA==} cpu: [arm64] os: [darwin] - turbo-linux-64@2.4.4: - resolution: {integrity: sha512-SR0gri4k0bda56hw5u9VgDXLKb1Q+jrw4lM7WAhnNdXvVoep4d6LmnzgMHQQR12Wxl3KyWPbkz9d1whL6NTm2Q==} + turbo-linux-64@2.5.0: + resolution: {integrity: sha512-1iEln2GWiF3iPPPS1HQJT6ZCFXynJPd89gs9SkggH2EJsj3eRUSVMmMC8y6d7bBbhBFsiGGazwFIYrI12zs6uQ==} cpu: [x64] os: [linux] - turbo-linux-arm64@2.4.4: - resolution: {integrity: sha512-COXXwzRd3vslQIfJhXUklgEqlwq35uFUZ7hnN+AUyXx7hUOLIiD5NblL+ETrHnhY4TzWszrbwUMfe2BYWtaPQg==} + turbo-linux-arm64@2.5.0: + resolution: {integrity: sha512-bKBcbvuQHmsX116KcxHJuAcppiiBOfivOObh2O5aXNER6mce7YDDQJy00xQQNp1DhEfcSV2uOsvb3O3nN2cbcA==} cpu: [arm64] os: [linux] - turbo-windows-64@2.4.4: - resolution: {integrity: sha512-PV9rYNouGz4Ff3fd6sIfQy5L7HT9a4fcZoEv8PKRavU9O75G7PoDtm8scpHU10QnK0QQNLbE9qNxOAeRvF0fJg==} + turbo-windows-64@2.5.0: + resolution: {integrity: sha512-9BCo8oQ7BO7J0K913Czbc3tw8QwLqn2nTe4E47k6aVYkM12ASTScweXPTuaPFP5iYXAT6z5Dsniw704Ixa5eGg==} cpu: [x64] os: [win32] - turbo-windows-arm64@2.4.4: - resolution: {integrity: sha512-403sqp9t5sx6YGEC32IfZTVWkRAixOQomGYB8kEc6ZD+//LirSxzeCHCnM8EmSXw7l57U1G+Fb0kxgTcKPU/Lg==} + turbo-windows-arm64@2.5.0: + resolution: {integrity: sha512-OUHCV+ueXa3UzfZ4co/ueIHgeq9B2K48pZwIxKSm5VaLVuv8M13MhM7unukW09g++dpdrrE1w4IOVgxKZ0/exg==} cpu: [arm64] os: [win32] - turbo@2.4.4: - resolution: {integrity: sha512-N9FDOVaY3yz0YCOhYIgOGYad7+m2ptvinXygw27WPLQvcZDl3+0Sa77KGVlLSiuPDChOUEnTKE9VJwLSi9BPGQ==} + turbo@2.5.0: + resolution: {integrity: sha512-PvSRruOsitjy6qdqwIIyolv99+fEn57gP6gn4zhsHTEcCYgXPhv6BAxzAjleS8XKpo+Y582vTTA9nuqYDmbRuA==} hasBin: true type-check@0.4.0: @@ -5001,11 +5004,11 @@ snapshots: dependencies: eslint: 8.57.0 - eslint-config-turbo@2.4.2(eslint@8.57.0)(turbo@2.4.4): + eslint-config-turbo@2.4.2(eslint@8.57.0)(turbo@2.5.0): dependencies: eslint: 8.57.0 - eslint-plugin-turbo: 2.4.2(eslint@8.57.0)(turbo@2.4.4) - turbo: 2.4.4 + eslint-plugin-turbo: 2.4.2(eslint@8.57.0)(turbo@2.5.0) + turbo: 2.5.0 eslint-import-resolver-node@0.3.9: dependencies: @@ -5072,11 +5075,11 @@ snapshots: eslint-plugin-only-warn@1.1.0: {} - eslint-plugin-turbo@2.4.2(eslint@8.57.0)(turbo@2.4.4): + eslint-plugin-turbo@2.4.2(eslint@8.57.0)(turbo@2.5.0): dependencies: dotenv: 16.0.3 eslint: 8.57.0 - turbo: 2.4.4 + turbo: 2.5.0 eslint-plugin-unused-imports@3.2.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0): dependencies: @@ -6593,32 +6596,32 @@ snapshots: optionalDependencies: fsevents: 2.3.3 - turbo-darwin-64@2.4.4: + turbo-darwin-64@2.5.0: optional: true - turbo-darwin-arm64@2.4.4: + turbo-darwin-arm64@2.5.0: optional: true - turbo-linux-64@2.4.4: + turbo-linux-64@2.5.0: optional: true - turbo-linux-arm64@2.4.4: + turbo-linux-arm64@2.5.0: optional: true - turbo-windows-64@2.4.4: + turbo-windows-64@2.5.0: optional: true - turbo-windows-arm64@2.4.4: + turbo-windows-arm64@2.5.0: optional: true - turbo@2.4.4: + turbo@2.5.0: optionalDependencies: - turbo-darwin-64: 2.4.4 - turbo-darwin-arm64: 2.4.4 - turbo-linux-64: 2.4.4 - turbo-linux-arm64: 2.4.4 - turbo-windows-64: 2.4.4 - turbo-windows-arm64: 2.4.4 + turbo-darwin-64: 2.5.0 + turbo-darwin-arm64: 2.5.0 + turbo-linux-64: 2.5.0 + turbo-linux-arm64: 2.5.0 + turbo-windows-64: 2.5.0 + turbo-windows-arm64: 2.5.0 type-check@0.4.0: dependencies: diff --git a/turbo.json b/turbo.json new file mode 100644 index 00000000..f0b06266 --- /dev/null +++ b/turbo.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://turbo.build/schema.json", + "tasks": { + "check": { + "dependsOn": ["^check:types", "^check:lint", "check:types", "check:lint"] + }, + "check:types": { + "dependsOn": ["^check:types"] + }, + "check:lint": { + "dependsOn": ["^check:lint"] + }, + "//#check:format": {}, + "//#check:deps": {} + } +}