diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..87697e5b29 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,17 @@ +# Keep the e2e image build context lean and Linux-clean: never copy host +# (macOS) node_modules or build outputs — deps are installed fresh inside the +# image. What actually lands in the image is selected explicitly by the COPY +# steps in tests/Dockerfile (manifests + example apps), not by exclusions here; +# these entries just stop the heavy/irrelevant trees from bloating the context. +**/node_modules +**/dist +**/types +**/.vite +**/.vite-plus +**/*.tsbuildinfo +**/.DS_Store +.git +**/test-results +**/blob-report +**/playwright-report +tests/.vitest-attachments diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index e9511bbf61..0000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "root": true, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "react-app", - "react-app/jest" - ], - "parser": "@typescript-eslint/parser", - "plugins": ["import", "@typescript-eslint"], - "settings": { - "import/extensions": [".ts", ".cts", ".mts", ".tsx", ".js", ".jsx"], - "import/external-module-folders": ["node_modules", "node_modules/@types"], - "import/parsers": { - "@typescript-eslint/parser": [".ts", ".cts", ".mts", ".tsx"] - }, - "import/resolver": { - "node": { - "extensions": [".ts", ".cts", ".mts", ".tsx", ".js", ".jsx"] - } - } - }, - "ignorePatterns": ["**/ui/*"], - "rules": { - "no-console": "error", - "curly": 1, - "import/extensions": ["error", "always", { "ignorePackages": true }], - "import/no-extraneous-dependencies": [ - "error", - { - "devDependencies": true, - "peerDependencies": true, - "optionalDependencies": false, - "bundledDependencies": false - } - ], - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/ban-ts-comment": "off", - "import/no-cycle": "error" - } -} diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index f258f05126..d431145bc6 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -3,4 +3,4 @@ blank_issues_enabled: false contact_links: - name: Share an idea or suggest an enhancement url: https://github.com/TypeCellOS/BlockNote/discussions/categories/ideas-enhancements - about: Share feature ideas, enhancement suggestions, or other ideas for the BlockNote project. \ No newline at end of file + about: Share feature ideas, enhancement suggestions, or other ideas for the BlockNote project. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ce593666e8..4cd39c8b21 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -57,3 +57,12 @@ updates: - "y-prosemirror" cooldown: default-days: 7 + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "ci" + include: "scope" + cooldown: + default-days: 7 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fef3e24484..2f8f7dfc38 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,9 +11,6 @@ permissions: env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true - NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN: ${{ secrets.NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN }} - NX_SELF_HOSTED_REMOTE_CACHE_SERVER: ${{ secrets.NX_SELF_HOSTED_REMOTE_CACHE_SERVER }} - pnpm_config_store_dir: ./node_modules/.pnpm-store jobs: build: @@ -21,46 +18,31 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 with: fetch-depth: 100 persist-credentials: false - - name: Install pnpm - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 - - - uses: nrwl/nx-set-shas@afb73a62d26e41464e9254689e1fd6122ee683c1 # v5 - - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 - with: - cache: "pnpm" - cache-dependency-path: "**/pnpm-lock.yaml" - node-version-file: ".nvmrc" - - - name: Cache NX - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 + - uses: voidzero-dev/setup-vp@2dec1e33f4ab2c6d5bce1b0c4607961bb1a3f7a1 # v1 with: - path: .nx/cache - key: nx-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-${{ github.sha }} - restore-keys: | - nx-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}- - nx-${{ env.NX_BRANCH }}- - nx- + node-version-file: ".node-version" + cache: true - name: Install Dependencies - run: pnpm install + run: vp install - name: Lint packages - run: pnpm run lint + run: vp lint - name: Build packages - run: pnpm run build + run: vp run -r build - name: Run unit tests - run: pnpm run test + run: vp run -r test - name: Run Next.js integration test (production build) - run: NEXTJS_TEST_MODE=build npx vitest run tests/src/unit/nextjs/serverUtil.test.ts + run: NEXTJS_TEST_MODE=build vp test run src/unit/nextjs/serverUtil.test.ts + working-directory: tests - name: Upload webpack stats artifact (editor) uses: relative-ci/agent-upload-artifact-action@a2b5741b4f7e6a989c84ec1a3059696b23c152e5 # v2 @@ -70,61 +52,20 @@ jobs: - name: Soft release id: soft-release - run: pnpx pkg-pr-new publish './packages/*' # TODO disabled only for AI branch--compact - - playwright-build: - name: "Playwright Build" - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - with: - fetch-depth: 100 - persist-credentials: false - - - name: Install pnpm - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 - - - uses: nrwl/nx-set-shas@afb73a62d26e41464e9254689e1fd6122ee683c1 # v5 - - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 - with: - cache: "pnpm" - cache-dependency-path: "**/pnpm-lock.yaml" - node-version-file: ".nvmrc" - - - name: Cache NX - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 - with: - path: .nx/cache - key: nx-playwright-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-${{ github.sha }} - restore-keys: | - nx-playwright-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}- - nx-playwright-${{ env.NX_BRANCH }}- - nx- - - - name: Install dependencies - run: pnpm install - - - name: Build packages - run: pnpm run build - - - name: Upload build artifacts - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 - with: - name: playwright-build - path: | - packages/*/dist - playground/dist - retention-days: 1 - - playwright: - name: "Playwright Tests - ${{ matrix.browser }} (${{ matrix.shardIndex }}/${{ matrix.shardTotal }})" + run: vp dlx pkg-pr-new publish './packages/*' # TODO disabled only for AI branch--compact + + e2e: + # Vitest Browser Mode runs in the Playwright Linux container — the same + # environment as the local Docker run — so behaviour matches local dev. + # The suite resolves every `@blocknote/*` import to its `src/` via the + # aliases in `tests/vite.config.browser.ts` (vite transpiles the package + # sources on the fly), so the packages do NOT need to be built to `dist` + # first — `vp install` + the checked-out sources are enough. + name: "E2E - ${{ matrix.browser }} (${{ matrix.shardIndex }}/${{ matrix.shardTotal }})" runs-on: ubuntu-latest - needs: playwright-build timeout-minutes: 30 container: - image: mcr.microsoft.com/playwright:v1.51.1-noble + image: mcr.microsoft.com/playwright:v1.60.0-noble strategy: fail-fast: false matrix: @@ -132,33 +73,30 @@ jobs: shardIndex: [1, 2] shardTotal: [2] steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 with: fetch-depth: 100 persist-credentials: false - - name: Install pnpm - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 - - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 + - uses: voidzero-dev/setup-vp@2dec1e33f4ab2c6d5bce1b0c4607961bb1a3f7a1 # v1 with: - cache: "pnpm" - cache-dependency-path: "**/pnpm-lock.yaml" - node-version-file: ".nvmrc" - - - name: Download build artifacts - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 - with: - name: playwright-build + node-version-file: ".node-version" + cache: true - name: Install dependencies - run: pnpm install - - - name: Run server and Playwright tests - run: | - HOME=/root PLAYWRIGHT_CONFIG="--project ${{ matrix.browser }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}" pnpm run e2e + run: vp install + + # No preview server: Vitest Browser Mode serves the tests + mounted example + # apps itself. `--browser` selects this matrix job's browser and + # `--shard=/` splits that browser's test files across two + # parallel machines. Each shard records a machine-readable `blob` report + # (named per browser+shard so they don't collide); the `merge-reports` job + # stitches every browser's shards into one HTML report afterwards. + - name: Run e2e tests (${{ matrix.browser }} ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}) + run: HOME=/root vp test -c vite.config.browser.ts --run --browser ${{ matrix.browser }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=default --reporter=blob --outputFile.blob=blob-report/blob-${{ matrix.browser }}-${{ matrix.shardIndex }}.json + working-directory: tests - - name: Upload blob report + - name: Upload blob report (${{ matrix.browser }} ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}) uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 if: ${{ !cancelled() }} with: @@ -166,50 +104,98 @@ jobs: path: tests/blob-report/ retention-days: 1 - - name: Upload HTML report + - name: Upload failure artifacts uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 - if: ${{ !cancelled() }} + if: ${{ failure() }} with: - name: playwright-report-${{ matrix.browser }}-${{ matrix.shardIndex }} - path: tests/playwright-report/ - retention-days: 30 + name: e2e-attachments-${{ matrix.browser }}-${{ matrix.shardIndex }} + path: tests/.vitest-attachments/ + retention-days: 7 merge-reports: - name: "Merge Playwright Reports" - if: ${{ !cancelled() }} - needs: playwright + # Stitch every browser+shard blob report into a single navigable HTML + # report (the Vitest equivalent of `playwright merge-reports`). Runs even + # when a shard failed, so the report always covers every browser. + name: "E2E Report" runs-on: ubuntu-latest + needs: e2e + if: ${{ !cancelled() }} + timeout-minutes: 15 + # Same container as the e2e shards: `--mergeReports` doesn't run tests or + # launch browsers, but the HTML reporter still resolves the test files' + # browser environment, so the browser config must stay enabled (and present). + container: + image: mcr.microsoft.com/playwright:v1.60.0-noble steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 with: + fetch-depth: 100 persist-credentials: false - - name: Install pnpm - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 - - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 + - uses: voidzero-dev/setup-vp@2dec1e33f4ab2c6d5bce1b0c4607961bb1a3f7a1 # v1 with: - cache: "pnpm" - cache-dependency-path: "**/pnpm-lock.yaml" - node-version-file: ".nvmrc" + node-version-file: ".node-version" + cache: true - name: Install dependencies - run: pnpm install + run: vp install + # Gather every shard's blob into one directory (blob-report-chromium-1, …). - name: Download blob reports uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: - path: tests/all-blob-reports + path: tests/blob-report pattern: blob-report-* merge-multiple: true - - name: Merge reports - run: npx playwright merge-reports --reporter html ./all-blob-reports + # Re-emit a single HTML report from the merged blobs (no tests are run). + - name: Merge into HTML report + run: HOME=/root vp test -c vite.config.browser.ts --mergeReports=blob-report --reporter=html working-directory: tests - name: Upload merged HTML report uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + if: ${{ !cancelled() }} with: - name: playwright-report-merged + name: e2e-report path: tests/playwright-report/ - retention-days: 30 + retention-days: 7 + + deploy-report: + # Publish the merged report to a GitHub Pages PR preview and comment the + # link on the PR (Vercel-style). Pages serves it over HTTP, so the report's + # data loads correctly — unlike opening the downloaded artifact over file:// + # (the @vitest/ui report fetches its data and is blocked by CORS there). + # + # Default `needs` semantics: this runs only when `merge-reports` succeeded + # (i.e. a report exists) — but regardless of whether the tests passed, so a + # red run still gets a navigable preview. Skipped for fork PRs, whose + # read-only token can't push to gh-pages or comment (they keep the artifact). + name: "E2E Report Preview" + runs-on: ubuntu-latest + needs: merge-reports + if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }} + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 + with: + persist-credentials: false + + - name: Download merged report + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 + with: + name: e2e-report + path: e2e-report + + # Deploys to the `gh-pages` branch under `pr-preview/pr-/` and posts a + # sticky comment with the URL. The companion `pr-preview-cleanup` workflow + # removes it when the PR closes. + - name: Deploy report to PR preview + uses: rossjrw/pr-preview-action@ffa7509e91a3ec8dfc2e5536c4d5c1acdf7a6de9 # v1 + with: + source-dir: e2e-report + preview-branch: gh-pages + umbrella-dir: pr-preview + action: deploy diff --git a/.github/workflows/fresh-install-tests.yml b/.github/workflows/fresh-install-tests.yml index d5698a1fbc..a1b441678d 100644 --- a/.github/workflows/fresh-install-tests.yml +++ b/.github/workflows/fresh-install-tests.yml @@ -20,7 +20,6 @@ permissions: env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true - pnpm_config_store_dir: ./node_modules/.pnpm-store jobs: fresh-install-unit-tests: @@ -30,23 +29,20 @@ jobs: steps: - id: checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - - id: install_pnpm - name: Install pnpm - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 - - - id: setup_node - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 + - id: setup_vp + uses: voidzero-dev/setup-vp@2dec1e33f4ab2c6d5bce1b0c4607961bb1a3f7a1 # v1 with: - node-version-file: ".nvmrc" - # Intentionally no pnpm cache — we want fresh prod dep resolution + node-version-file: ".node-version" + # Intentionally no install cache — we want fresh prod dep resolution. + cache: false - id: install_dependencies name: Install dependencies - run: pnpm install + run: vp install - id: update_prod_deps name: Update prod deps of published packages @@ -55,6 +51,8 @@ jobs: # ranges. This simulates what a user gets when running # `npm install @blocknote/react` in a fresh project. # DevDependencies are left at their lockfile versions. + # NB: this uses pnpm directly because vp doesn't expose a `--prod`-only + # update flow; setup-vp installs pnpm on PATH so this still works. run: | FILTERS=$(node -e " const fs = require('fs'); @@ -84,15 +82,11 @@ jobs: - id: build_packages name: Build packages - run: pnpm run build - env: - NX_SKIP_NX_CACHE: "true" + run: vp run -r build - id: run_unit_tests name: Run unit tests - run: pnpm run test - env: - NX_SKIP_NX_CACHE: "true" + run: vp run -r test - name: Notify Slack on workflow failure if: ${{ failure() }} @@ -105,8 +99,7 @@ jobs: RUN_ATTEMPT: ${{ github.run_attempt }} BRANCH: ${{ github.ref_name }} STEPS_CHECKOUT_OUTCOME: ${{ steps.checkout.outcome }} - STEPS_INSTALL_PNPM_OUTCOME: ${{ steps.install_pnpm.outcome }} - STEPS_SETUP_NODE_OUTCOME: ${{ steps.setup_node.outcome }} + STEPS_SETUP_VP_OUTCOME: ${{ steps.setup_vp.outcome }} STEPS_INSTALL_DEPENDENCIES_OUTCOME: ${{ steps.install_dependencies.outcome }} STEPS_UPDATE_PROD_DEPS_OUTCOME: ${{ steps.update_prod_deps.outcome }} STEPS_DEDUPE_DEPS_OUTCOME: ${{ steps.dedupe_deps.outcome }} @@ -121,10 +114,8 @@ jobs: failed_step="Unknown step" if [ "${STEPS_CHECKOUT_OUTCOME}" = "failure" ]; then failed_step="Checkout repository" - elif [ "${STEPS_INSTALL_PNPM_OUTCOME}" = "failure" ]; then - failed_step="Install pnpm" - elif [ "${STEPS_SETUP_NODE_OUTCOME}" = "failure" ]; then - failed_step="Setup Node.js" + elif [ "${STEPS_SETUP_VP_OUTCOME}" = "failure" ]; then + failed_step="Setup Vite+" elif [ "${STEPS_INSTALL_DEPENDENCIES_OUTCOME}" = "failure" ]; then failed_step="Install dependencies" elif [ "${STEPS_UPDATE_PROD_DEPS_OUTCOME}" = "failure" ]; then diff --git a/.github/workflows/pr-preview-cleanup.yml b/.github/workflows/pr-preview-cleanup.yml new file mode 100644 index 0000000000..239dc2f381 --- /dev/null +++ b/.github/workflows/pr-preview-cleanup.yml @@ -0,0 +1,30 @@ +name: pr-preview-cleanup + +# Removes the GitHub Pages e2e-report preview that `build.yml`'s `deploy-report` +# job published for a PR, once that PR is closed/merged. Kept separate from +# `build.yml` so closing a PR doesn't re-run the whole build + e2e suite. +on: + pull_request: + types: [closed] + +permissions: + contents: write + pull-requests: write + +jobs: + remove-preview: + name: "Remove E2E Report Preview" + runs-on: ubuntu-latest + # Fork PRs never got a preview (read-only token), so nothing to remove. + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} + steps: + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 + with: + persist-credentials: false + + - name: Remove PR preview + uses: rossjrw/pr-preview-action@ffa7509e91a3ec8dfc2e5536c4d5c1acdf7a6de9 # v1 + with: + preview-branch: gh-pages + umbrella-dir: pr-preview + action: remove diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 12bda34238..b39deb9957 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -13,65 +13,21 @@ on: required: true type: string -env: - FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true - NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN: ${{ secrets.NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN }} - NX_SELF_HOSTED_REMOTE_CACHE_SERVER: ${{ secrets.NX_SELF_HOSTED_REMOTE_CACHE_SERVER }} - pnpm_config_store_dir: ./node_modules/.pnpm-store +permissions: {} jobs: publish: name: Publish runs-on: ubuntu-latest - permissions: - contents: write - id-token: write # needed for provenance data generation - attestations: write - timeout-minutes: 10 + timeout-minutes: 5 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - with: - ref: ${{ inputs.version }} - fetch-depth: 100 - persist-credentials: false - - name: Display version being published + - name: Publish disabled + # NX has been removed (it was driving `nx release publish`) and the + # replacement release tool is not yet in place. This workflow is + # intentionally a no-op so a stray tag push doesn't silently succeed + # without actually publishing anything. Once a release tool is wired + # up, restore the publish steps and remove this guard. run: | - echo "Publishing version: ${INPUTS_VERSION}" - env: - INPUTS_VERSION: ${{ inputs.version }} - - - run: jq '.packageManager' package.json | tr -d '"pnpm@' - id: package-manager-version - - - name: Install pnpm - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 - with: - version: ${{ steps.package-manager-version.outputs.stdout }} - - - uses: nrwl/nx-set-shas@afb73a62d26e41464e9254689e1fd6122ee683c1 # v5 - - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 # zizmor: ignore[cache-poisoning] - with: - # No pnpm cache -- correctness over speed for publish workflows - node-version-file: ".nvmrc" - - - name: Cache NX - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 - with: - path: .nx/cache - key: nx-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-${{ github.sha }} - restore-keys: | - nx-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}- - nx-${{ env.NX_BRANCH }}- - nx- - lookup-only: true - - - name: Install Dependencies & Build - run: pnpm install && pnpm build - - - name: Print Environment Info - run: pnpm exec nx report - - - name: Publish packages - # Ensure npm 11.5.1 or later for trusted publishing - run: npm install -g npm@latest && pnpm exec nx release publish --access public + echo "::error::Publish workflow is disabled — release tooling is being replaced." + echo "::error::Re-enable this workflow once a release tool is wired up." + exit 1 diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml index 1111b104a8..0b9ea34841 100644 --- a/.github/workflows/zizmor.yml +++ b/.github/workflows/zizmor.yml @@ -18,7 +18,7 @@ jobs: actions: read steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false diff --git a/.gitignore b/.gitignore index 898dcdcc62..9fac8b5d4a 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,10 @@ examples/*/types tsconfig.tsbuildinfo # testing coverage +# Vitest's attachment store (failure screenshots / diffs). Accumulates across +# runs; the HTML reporter copies what it needs into playwright-report/data, +# so the originals are unreferenced cruft. +.vitest-attachments/ # production /build diff --git a/.node-version b/.node-version new file mode 100644 index 0000000000..5bf4400f22 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +24.15.0 diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index c5ddcef4e7..0000000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -v22.14.0 \ No newline at end of file diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 0f4e5b7d67..0000000000 --- a/.prettierrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/prettierrc", - "semi": true, - "singleQuote": false, - "tabWidth": 2, - "printWidth": 80, - "trailingComma": "all", - "bracketSpacing": true, - "arrowParens": "always", - "endOfLine": "lf", - "plugins": ["prettier-plugin-tailwindcss"] -} diff --git a/.vite-hooks/pre-commit b/.vite-hooks/pre-commit new file mode 100755 index 0000000000..85fb65b4fc --- /dev/null +++ b/.vite-hooks/pre-commit @@ -0,0 +1 @@ +vp staged diff --git a/.vscode/extensions.json b/.vscode/extensions.json index c224675018..1b6c379e0a 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,5 +1,5 @@ { // See http://go.microsoft.com/fwlink/?LinkId=827846 // for the documentation about the extensions.json format - "recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"] + "recommendations": ["VoidZero.vite-plus-extension-pack"] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 7c24081186..80f6014497 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,10 +1,16 @@ { - "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.defaultFormatter": "oxc.oxc-vscode", "editor.formatOnSave": true, - "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, - "[typescriptreact]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.formatOnSaveMode": "file", + "editor.codeActionsOnSave": { + "source.fixAll.oxc": "explicit" }, + "oxc.fmt.configPath": "./vite.config.ts", + "npm.scriptRunner": "vp", + "[javascript]": { "editor.defaultFormatter": "oxc.oxc-vscode" }, + "[javascriptreact]": { "editor.defaultFormatter": "oxc.oxc-vscode" }, + "[typescript]": { "editor.defaultFormatter": "oxc.oxc-vscode" }, + "[typescriptreact]": { "editor.defaultFormatter": "oxc.oxc-vscode" }, "search.exclude": { "packages/editor/public/types": true, "packages/website/docs/.vitepress": false, @@ -15,11 +21,5 @@ "editor.defaultFormatter": "redhat.vscode-xml" }, "scm.defaultViewMode": "tree", - "search.defaultViewMode": "tree", - "[typescript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[mdx]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - } + "search.defaultViewMode": "tree" } diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000000..362b82a43a --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,16 @@ + + +# Using Vite+, the Unified Toolchain for the Web + +This project is using Vite+, a unified toolchain built on top of Vite, Rolldown, Vitest, tsdown, Oxlint, Oxfmt, and Vite Task. Vite+ wraps runtime management, package management, and frontend tooling in a single global CLI called `vp`. Vite+ is distinct from Vite, and it invokes Vite through `vp dev` and `vp build`. Run `vp help` to print a list of commands and `vp --help` for information about a specific command. + +Docs are local at `node_modules/vite-plus/docs` or online at https://viteplus.dev/guide/. + +## Review Checklist + +- [ ] Run `vp install` after pulling remote changes and before getting started. +- [ ] Run `vp check` and `vp test` to format, lint, type check and test changes. +- [ ] Check if there are `vite.config.ts` tasks or `package.json` scripts necessary for validation, run via `vp run