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/workflows/build.yml b/.github/workflows/build.yml index 91b5ca0414..82109bfebb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,9 +8,6 @@ on: 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: @@ -22,41 +19,26 @@ jobs: with: fetch-depth: 100 - - name: Install pnpm - uses: pnpm/action-setup@v5 - - - uses: nrwl/nx-set-shas@v5 - - - uses: actions/setup-node@v6 - with: - cache: "pnpm" - cache-dependency-path: "**/pnpm-lock.yaml" - node-version-file: ".nvmrc" - - - name: Cache NX - uses: actions/cache@v5 + - uses: voidzero-dev/setup-vp@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@v2 @@ -77,32 +59,16 @@ jobs: with: fetch-depth: 100 - - name: Install pnpm - uses: pnpm/action-setup@v5 - - - uses: nrwl/nx-set-shas@v5 - - - uses: actions/setup-node@v6 - with: - cache: "pnpm" - cache-dependency-path: "**/pnpm-lock.yaml" - node-version-file: ".nvmrc" - - - name: Cache NX - uses: actions/cache@v5 + - uses: voidzero-dev/setup-vp@v1 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- + node-version-file: ".node-version" + cache: true - name: Install dependencies - run: pnpm install + run: vp install - name: Build packages - run: pnpm run build + run: vp run -r build - name: Upload build artifacts uses: actions/upload-artifact@v7 @@ -131,14 +97,10 @@ jobs: with: fetch-depth: 100 - - name: Install pnpm - uses: pnpm/action-setup@v5 - - - uses: actions/setup-node@v6 + - uses: voidzero-dev/setup-vp@v1 with: - cache: "pnpm" - cache-dependency-path: "**/pnpm-lock.yaml" - node-version-file: ".nvmrc" + node-version-file: ".node-version" + cache: true - name: Download build artifacts uses: actions/download-artifact@v8 @@ -146,11 +108,11 @@ jobs: name: playwright-build - name: Install dependencies - run: pnpm install + run: vp install - name: Run server and Playwright tests run: | - HOME=/root PLAYWRIGHT_CONFIG="--project ${{ matrix.browser }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}" pnpm run e2e + HOME=/root PLAYWRIGHT_CONFIG="--project ${{ matrix.browser }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}" vp run e2e - name: Upload blob report uses: actions/upload-artifact@v7 @@ -176,17 +138,13 @@ jobs: steps: - uses: actions/checkout@v6 - - name: Install pnpm - uses: pnpm/action-setup@v5 - - - uses: actions/setup-node@v6 + - uses: voidzero-dev/setup-vp@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 - name: Download blob reports uses: actions/download-artifact@v8 @@ -196,7 +154,7 @@ jobs: merge-multiple: true - name: Merge reports - run: npx playwright merge-reports --reporter html ./all-blob-reports + run: vp exec playwright merge-reports --reporter html ./all-blob-reports working-directory: tests - name: Upload merged HTML report diff --git a/.github/workflows/fresh-install-tests.yml b/.github/workflows/fresh-install-tests.yml index 6d6ed4a452..22d18f9fef 100644 --- a/.github/workflows/fresh-install-tests.yml +++ b/.github/workflows/fresh-install-tests.yml @@ -17,7 +17,6 @@ on: env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true - pnpm_config_store_dir: ./node_modules/.pnpm-store jobs: fresh-install-unit-tests: @@ -29,19 +28,16 @@ jobs: - id: checkout uses: actions/checkout@v6 - - id: install_pnpm - name: Install pnpm - uses: pnpm/action-setup@v5 - - - id: setup_node - uses: actions/setup-node@v6 + - id: setup_vp + uses: voidzero-dev/setup-vp@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 @@ -50,6 +46,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'); @@ -79,15 +77,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() }} @@ -108,10 +102,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/publish.yaml b/.github/workflows/publish.yaml index 280d5a5af1..8dfb78073f 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -13,62 +13,19 @@ 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 - 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@v6 - with: - ref: ${{ inputs.version }} - fetch-depth: 100 - - 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 }}" - - - run: jq '.packageManager' package.json | tr -d '"pnpm@' - id: package-manager-version - - - name: Install pnpm - uses: pnpm/action-setup@v5 - with: - version: ${{ steps.package-manager-version.outputs.stdout }} - - - uses: nrwl/nx-set-shas@v5 - - - uses: actions/setup-node@v6 - with: - cache: "pnpm" - cache-dependency-path: "**/pnpm-lock.yaml" - node-version-file: ".nvmrc" - - - name: Cache NX - uses: actions/cache@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- - - - 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/.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/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000000..ef041769ab --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,15 @@ + + +# 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