diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 39f1f248284e..4a4e7ac80d69 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -18,13 +18,21 @@ See below for a summary of this repo's Actions - Adds the PR to a GitHub project - Makes sure that Wrangler's warning for old Node.js versions works. -### E2E tests (e2e.yml) +### Wrangler E2E tests (e2e-wrangler.yml) - Triggers - Updates to PRs on the Cloudflare fork. - PRs in the merge queue. - Actions - - Runs the E2E tests for Wrangler & Vite. + - Runs the E2E tests for Wrangler. + +### Vite Plugin E2E tests (e2e-vite.yml) + +- Triggers + - Updates to PRs on the Cloudflare fork. + - PRs in the merge queue. +- Actions + - Runs the E2E tests for the Vite plugin. ## Deploy Pages Previews (deploy-pages-preview.yml) diff --git a/.github/workflows/bonk-pr-review.yml b/.github/workflows/bonk-pr-review.yml index f8a0fb59914f..59c0c0bba88f 100644 --- a/.github/workflows/bonk-pr-review.yml +++ b/.github/workflows/bonk-pr-review.yml @@ -35,7 +35,7 @@ jobs: } >> "$GITHUB_OUTPUT" - name: Run Bonk - uses: ask-bonk/ask-bonk/github@main + uses: ask-bonk/ask-bonk/github@24832587005550860c8ad13fd96519e731ca632a # main env: CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_AI_GATEWAY_ACCOUNT_ID }} CLOUDFLARE_GATEWAY_ID: ${{ secrets.CF_AI_GATEWAY_NAME }} diff --git a/.github/workflows/bonk.yml b/.github/workflows/bonk.yml index ece433281c2a..92f73c6a4ce4 100644 --- a/.github/workflows/bonk.yml +++ b/.github/workflows/bonk.yml @@ -27,7 +27,7 @@ jobs: fetch-depth: 1 - name: Run Bonk - uses: ask-bonk/ask-bonk/github@main + uses: ask-bonk/ask-bonk/github@24832587005550860c8ad13fd96519e731ca632a # main env: CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_AI_GATEWAY_ACCOUNT_ID }} CLOUDFLARE_GATEWAY_ID: ${{ secrets.CF_AI_GATEWAY_NAME }} diff --git a/.github/workflows/e2e-vite.yml b/.github/workflows/e2e-vite.yml new file mode 100644 index 000000000000..99aaa5ec0f41 --- /dev/null +++ b/.github/workflows/e2e-vite.yml @@ -0,0 +1,73 @@ +name: Vite Plugin E2E + +on: + merge_group: + pull_request: + +permissions: + contents: read + +jobs: + e2e-vite-plugin-test: + name: ${{ format('Vite Plugin E2E ({0})', matrix.description) }} + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }} + cancel-in-progress: true + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + include: + - os: macos-latest + description: macOS + - os: windows-latest + description: Windows + - os: ubuntu-latest + description: Linux + runs-on: ${{ matrix.os }} + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3 + id: changes + with: + filters: | + everything_but_markdown: + - '!**/*.md' + + - name: Install Dependencies + if: steps.changes.outputs.everything_but_markdown == 'true' + uses: ./.github/actions/install-dependencies + with: + turbo-api: ${{ secrets.TURBO_API }} + turbo-team: ${{ secrets.TURBO_TEAM }} + turbo-token: ${{ secrets.TURBO_TOKEN }} + turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + + - name: Bump package versions + if: steps.changes.outputs.everything_but_markdown == 'true' + run: node .github/changeset-version.js + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Run Vite plugin E2E tests + if: steps.changes.outputs.everything_but_markdown == 'true' + run: pnpm test:e2e -F @cloudflare/vite-plugin --log-order=stream + timeout-minutes: 20 + env: + NODE_DEBUG: "vite-plugin:test" + # The remote-binding tests need to connect to Cloudflare + CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} + NODE_OPTIONS: "--max_old_space_size=8192" + CI_OS: ${{ matrix.os }} + + - name: Upload turbo logs + if: always() + uses: actions/upload-artifact@v4 + with: + name: turbo-runs-${{ matrix.os }} + path: .turbo/runs diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e-wrangler.yml similarity index 56% rename from .github/workflows/e2e.yml rename to .github/workflows/e2e-wrangler.yml index 547cbc12017e..33112e79061a 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e-wrangler.yml @@ -1,4 +1,4 @@ -name: E2E +name: Wrangler E2E on: merge_group: @@ -11,7 +11,7 @@ jobs: e2e-wrangler-test: name: ${{ format('Wrangler E2E ({0})', matrix.description) }} concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-wrangler + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }} cancel-in-progress: true timeout-minutes: 60 strategy: @@ -82,67 +82,3 @@ jobs: with: name: turbo-runs-${{ matrix.os }} path: .turbo/runs - - e2e-vite-plugin-test: - name: ${{ format('Vite Plugin E2E ({0})', matrix.description) }} - concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-vite - cancel-in-progress: true - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - include: - - os: macos-latest - description: macOS - - os: windows-latest - description: Windows - - os: ubuntu-latest - description: Linux - runs-on: ${{ matrix.os }} - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3 - id: changes - with: - filters: | - everything_but_markdown: - - '!**/*.md' - - - name: Install Dependencies - if: steps.changes.outputs.everything_but_markdown == 'true' - uses: ./.github/actions/install-dependencies - with: - turbo-api: ${{ secrets.TURBO_API }} - turbo-team: ${{ secrets.TURBO_TEAM }} - turbo-token: ${{ secrets.TURBO_TOKEN }} - turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} - - - name: Bump package versions - if: steps.changes.outputs.everything_but_markdown == 'true' - run: node .github/changeset-version.js - env: - GITHUB_TOKEN: ${{ github.token }} - - - name: Run Vite plugin E2E tests - if: steps.changes.outputs.everything_but_markdown == 'true' - run: pnpm test:e2e -F @cloudflare/vite-plugin --log-order=stream - timeout-minutes: 20 - env: - NODE_DEBUG: "vite-plugin:test" - # The remote-binding tests need to connect to Cloudflare - CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} - NODE_OPTIONS: "--max_old_space_size=8192" - CI_OS: ${{ matrix.os }} - - - name: Upload turbo logs - if: always() - uses: actions/upload-artifact@v4 - with: - name: turbo-runs-${{ matrix.os }} - path: .turbo/runs diff --git a/.prettierrc b/.prettierrc index cc051c14b0bd..7b5461baa175 100644 --- a/.prettierrc +++ b/.prettierrc @@ -6,7 +6,8 @@ "trailingComma": "es5", "plugins": [ "@ianvs/prettier-plugin-sort-imports", - "prettier-plugin-packagejson" + "prettier-plugin-packagejson", + "prettier-plugin-tailwindcss" ], "overrides": [ { @@ -53,6 +54,13 @@ "options": { "proseWrap": "never" } + }, + { + "files": "packages/local-explorer-ui/**/*.{js,jsx,ts,tsx}", + "options": { + "tailwindStylesheet": "./packages/local-explorer-ui/src/styles/tailwind.css", + "tailwindFunctions": ["cn"] + } } ] } diff --git a/package.json b/package.json index 31cae1ca62a4..c57cbd99f5c9 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "author": "wrangler@cloudflare.com", "scripts": { "build": "dotenv -- turbo build", - "check": "pnpm check:fixtures && pnpm check:private-packages && pnpm check:package-deps && pnpm check:deployments && node lint-turbo.mjs && dotenv -- turbo check:lint check:type check:format type:tests", + "check": "pnpm check:fixtures && pnpm check:private-packages && pnpm check:package-deps && pnpm check:deployments && pnpm check:workflows && node lint-turbo.mjs && dotenv -- turbo check:lint check:type check:format type:tests", "check:deployments": "node -r esbuild-register tools/deployments/deploy-non-npm-packages.ts check", "check:fixtures": "node -r esbuild-register tools/deployments/validate-fixtures.ts", "check:format": "prettier . --check --ignore-unknown --cache", @@ -19,6 +19,7 @@ "check:package-deps": "node -r esbuild-register tools/deployments/validate-package-dependencies.ts", "check:private-packages": "node -r esbuild-register tools/deployments/validate-private-packages.ts", "check:type": "dotenv -- turbo check:type type:tests", + "check:workflows": "node -r esbuild-register tools/github-workflow-helpers/validate-action-pinning.ts", "dev": "dotenv -- turbo dev", "fix": "dotenv -- turbo check:lint -- --fix && pnpm run prettify", "prettify": "prettier . --write --ignore-unknown --cache", @@ -45,6 +46,7 @@ "jsonc-parser": "catalog:default", "prettier": "^3.2.5", "prettier-plugin-packagejson": "^2.2.18", + "prettier-plugin-tailwindcss": "^0.7.2", "tree-kill": "^1.2.2", "turbo": "^2.7.2", "typescript": "catalog:default", diff --git a/packages/local-explorer-ui/eslint.config.mjs b/packages/local-explorer-ui/eslint.config.mjs index 5cd441d044d1..95e0a0454d7d 100644 --- a/packages/local-explorer-ui/eslint.config.mjs +++ b/packages/local-explorer-ui/eslint.config.mjs @@ -1,4 +1,7 @@ +import { dirname } from "node:path"; +import { fileURLToPath } from "node:url"; import sharedConfig from "@cloudflare/eslint-config-shared/react"; +import tailwind from "eslint-plugin-tailwindcss"; import { defineConfig } from "eslint/config"; export default defineConfig([ @@ -6,4 +9,14 @@ export default defineConfig([ ignores: ["src/api/generated/**", "src/routeTree.gen.ts"], }, sharedConfig, + ...tailwind.configs["flat/recommended"], + { + settings: { + tailwindcss: { + callees: ["cn"], + config: + dirname(fileURLToPath(import.meta.url)) + "/src/styles/tailwind.css", + }, + }, + }, ]); diff --git a/packages/local-explorer-ui/package.json b/packages/local-explorer-ui/package.json index c17e145d182f..3dbb098284d9 100644 --- a/packages/local-explorer-ui/package.json +++ b/packages/local-explorer-ui/package.json @@ -51,6 +51,7 @@ "@types/react-dom": "^19.2.0", "@vitejs/plugin-react": "^4.4.1", "concurrently": "^9.0.0", + "eslint-plugin-tailwindcss": "^4.0.0-beta.0", "typescript": "catalog:default", "vite": "catalog:default", "vite-plugin-svgr": "^4.3.0", diff --git a/packages/local-explorer-ui/src/components/AddKVForm.tsx b/packages/local-explorer-ui/src/components/AddKVForm.tsx index f42555ffc86e..d001158d0349 100644 --- a/packages/local-explorer-ui/src/components/AddKVForm.tsx +++ b/packages/local-explorer-ui/src/components/AddKVForm.tsx @@ -54,17 +54,17 @@ export function AddKVForm({ onAdd, clearSignal = 0 }: AddKVFormProps) { return (
-
+
{keyError && ( - {keyError} + {keyError} )}
-
+