mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
Upgrades Vitest from 4.1.4 to 5.0.0 across the monorepo, fixes the handful of things v5 turned into hard errors, and drops the `vi.clearAllMocks()` boilerplate that v5's `clearMocks` default makes redundant. **Changed:** - `vitest`, `@vitest/ui`, `@vitest/coverage-v8` 4.1.4 → 5.0.0 (catalog) - `vi.mock` calls that lived inside `beforeAll`/`beforeEach`/test bodies moved to module scope (v5 throws on nested calls). Affects the Studio and docs setup files and four Studio tests. - `detectBrowser` test restores `navigator` via `vi.unstubAllGlobals()` instead of assigning `global.navigator`, which now reaches jsdom's getter-only property. - `RowEditor.utils.test.ts` restores its `JSON.stringify` spy. It used to leak a throwing mock for the rest of the file, which v5's coverage provider now trips over. A later test in the same file had been asserting the leak's side effect (valid JSON reported as invalid) and now asserts the correct behavior. - `@testing-library/jest-dom` 6.6 → 7.0.1. Its vitest type augmentation resolves through a peer now, so it lands on each package's own `vitest` instead of whichever copy pnpm hoisted. Fixes `toBeInTheDocument` type errors in dev-tools after the reshuffle. - `@testing-library/react` 16.0.0 → 16.3.3 for the React 19 peer range. - `vite: catalog:` added to dev-tools, www, and common. Without it they resolved a newer vite than the catalog pin, which forked a second vitest instance in the lockfile. There's now one. - ai-commands custom matcher types use v5's `Matchers<R, T>` form. - 110 test files: `vi.clearAllMocks()` removed from `beforeEach`/`afterEach` hooks, along with hooks that only did that and the imports they left unused. Calls that also reset/restore mocks are untouched. Second commit, mechanical. **Added:** - `.vitest/` to the root gitignore (v5 writes JSON/JUnit/HTML reporter output there) **Removed:** - `vite-tsconfig-paths` catalog entry and deps. Vitest 5 resolves tsconfig paths itself. Release-age note: this sat in draft with a temporary `minimumReleaseAgeExclude` entry for `vitest` and `@vitest/*` while 5.0.0 was inside the workspace's 3-day `minimumReleaseAge` window. That window has closed, so the exclusion is gone and nothing bypasses the release-age gate. **Perf** (local, medians of 3 runs, same machine): | Suite | v4.1.4 | v5.0.0 | |---|---|---| | studio | 144.1s | 141.7s (-2%) | | studio `--coverage` | 156.9s | 146.4s (-7%) | | ui-patterns | 6.27s | 5.07s (-19%) | | ui `--coverage` | 3.35s | 2.14s (-36%) | | www | 0.89s | 0.47s (-47%) | Studio is dominated by jsdom environment setup per file, which v5 doesn't change. `vitest doctor` recommends keeping the current pool config: the vm pools and `isolate: false` all break tests. ## To test - `pnpm install --frozen-lockfile` succeeds with no `minimumReleaseAgeExclude` entry for vitest. - CI: Studio unit tests, ui, ui-patterns, www, docs, and typecheck/lint should all be green. The lint ratchet was checked locally: warning counts on touched Studio files are identical to master. - `pnpm test:studio` locally passes with coverage (588 files, 6240 tests). - Open a Studio test that uses `toBeInTheDocument` in your editor and confirm no type errors on jest-dom matchers, in Studio and in `packages/dev-tools`. - Known pre-existing failures unrelated to this PR: one dev-tools test (`getEventCountBadge` capped pill) fails on master too. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Tests - Improved test coverage for JSON validation and mobile navigation behavior. - Updated test setup, cleanup, environment configuration, and matcher support across application and shared package suites. - Removed obsolete coverage for alternate MCP transport selection. ## Chores - Streamlined TypeScript path resolution and Vitest reporter output handling. - Updated testing libraries and Vitest tooling across documentation, Studio, website, and shared packages. - Added Vitest reporter output to ignored files. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
188 lines
7.8 KiB
JSON
188 lines
7.8 KiB
JSON
{
|
|
"name": "docs",
|
|
"version": "0.0.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"build": "next build",
|
|
"build:analyze": "ANALYZE=true next build",
|
|
"build:guides-markdown": "tsx ./internals/generate-guides-markdown.ts",
|
|
"build:federated-content": "tsx --conditions=react-server ./scripts/federated-content/fetch-federated-content.ts",
|
|
"prebuild:reference-markdown": "pnpm run codegen:references",
|
|
"build:reference-markdown": "tsx ./internals/generate-reference-markdown.ts",
|
|
"build:markdown": "pnpm build:guides-markdown && pnpm build:reference-markdown",
|
|
"build:gz-archive": "tsx ./internals/generate-gz-archive.ts",
|
|
"build:sitemap": "tsx ./internals/generate-sitemap.ts",
|
|
"clean": "rimraf .next .turbo features/docs/generated examples __generated__ tsconfig.tsbuildinfo",
|
|
"codegen:examples": "shx cp -r ../../examples ./examples",
|
|
"codegen:graphql": "tsx --conditions=react-server ./scripts/graphqlSchema.ts && graphql-codegen --config codegen.ts",
|
|
"codegen:references:new:ensure": "(test -f spec/reference/javascript/v2/supabase.json || (cd spec && make download.tsdoc.v2)) && (test -f spec/reference/server/v1/server.json || (cd spec && make download.server.v1)) && (test -f spec/reference/middleware/v1/middleware.json || (cd spec && make download.middleware.v1))",
|
|
"codegen:references:dart": "tsx scripts/generate-dart-reference.ts",
|
|
"precodegen:references:new": "pnpm run codegen:references:new:ensure && pnpm run codegen:references:dart",
|
|
"codegen:references:new": "pnpm run codegen:references:new:ensure && tsx scripts/build-reference-content.ts",
|
|
"codegen:references:legacy": "tsx features/docs/Reference.generated.script.ts",
|
|
"codegen:references": "pnpm codegen:references:legacy && pnpm codegen:references:new",
|
|
"dev": "run-p --race dev:next dev:watch:troubleshooting",
|
|
"dev:next": "next dev --port 3001",
|
|
"dev:secrets:pull": "AWS_PROFILE=supa-dev node ../../scripts/getSecrets.js -n local/docs",
|
|
"dev:watch:troubleshooting": "node ./scripts/troubleshooting/watch.mjs",
|
|
"embeddings": "tsx --conditions=react-server scripts/search/generate-embeddings.ts",
|
|
"embeddings:nimbus": "ENABLED_FEATURES_OVERRIDE_DISABLE_ALL=true pnpm run embeddings",
|
|
"embeddings:refresh": "pnpm run embeddings --refresh",
|
|
"embeddings:nimbus:refresh": "ENABLED_FEATURES_OVERRIDE_DISABLE_ALL=true pnpm run embeddings:refresh",
|
|
"last-changed": "tsx scripts/last-changed.ts",
|
|
"last-changed:reset": "pnpm run last-changed -- --reset",
|
|
"lint": "eslint .",
|
|
"lint:mdx": "supa-mdx-lint content --config ../../supa-mdx-lint.config.toml",
|
|
"postbuild": "pnpm run build:sitemap && ./../../scripts/upload-static-assets.sh",
|
|
"prebuild": "pnpm run codegen:graphql && pnpm run codegen:references && pnpm run codegen:examples && pnpm build:federated-content && pnpm run build:markdown && pnpm run build:gz-archive",
|
|
"predev": "pnpm run codegen:graphql && pnpm run codegen:references && pnpm run codegen:examples",
|
|
"preembeddings": "pnpm run codegen:references",
|
|
"preinstall": "npx only-allow pnpm",
|
|
"presync": "pnpm run codegen:graphql",
|
|
"pretest": "pnpm run codegen:examples",
|
|
"pretypecheck": "pnpm run codegen:graphql && next typegen",
|
|
"start": "next start",
|
|
"sync": "tsx --conditions=react-server ./resources/rootSync.ts",
|
|
"test": "pnpm supabase start && pnpm run test:local && pnpm supabase stop",
|
|
"test:local": "vitest --exclude \"**/*.smoke.test.ts\"",
|
|
"test:local:unwatch": "vitest --exclude \"**/*.smoke.test.ts\" --run",
|
|
"test:smoke": "pnpm run codegen:references && vitest -t \"prod smoke test\"",
|
|
"troubleshooting:sync": "node features/docs/Troubleshooting.script.mjs",
|
|
"typecheck": "tsc --noEmit"
|
|
},
|
|
"dependencies": {
|
|
"@har-sdk/openapi-sampler": "^2.2.0",
|
|
"@hookform/resolvers": "^3.1.1",
|
|
"@mdx-js/loader": "^3.0.0",
|
|
"@mdx-js/react": "^3.0.0",
|
|
"@next/bundle-analyzer": "15.3.1",
|
|
"@next/mdx": "15.3.1",
|
|
"@octokit/auth-app": "^7.0.0",
|
|
"@octokit/core": "^7.0.6",
|
|
"@octokit/graphql": "^8.0.0",
|
|
"@octokit/plugin-paginate-graphql": "^4.0.0",
|
|
"@octokit/plugin-retry": "^8.1.0",
|
|
"@sentry/nextjs": "catalog:",
|
|
"@supabase/supabase-js": "catalog:",
|
|
"@tanstack/react-query": "~5.83.0",
|
|
"acorn": "^8.11.3",
|
|
"acorn-typescript": "^1.4.13",
|
|
"ai-commands": "workspace:*",
|
|
"beautiful-mermaid": "^1.1.3",
|
|
"class-variance-authority": "^0.7.1",
|
|
"common": "workspace:*",
|
|
"common-tags": "^1.8.2",
|
|
"config": "workspace:*",
|
|
"dev-tools": "workspace:*",
|
|
"eslint-config-supabase": "workspace:*",
|
|
"framer-motion": "^11.18.2",
|
|
"github-slugger": "^2.0.0",
|
|
"graphql": "^16.10.0",
|
|
"graphql-validation-complexity": "^0.4.2",
|
|
"gray-matter": "^4.0.3",
|
|
"hast-util-has-property": "^2.0.1",
|
|
"hast-util-to-html": "^9.0.5",
|
|
"icons": "workspace:*",
|
|
"isbot": "^5.1.2",
|
|
"js-yaml": "^3.14.2",
|
|
"jsrsasign": "^11.0.0",
|
|
"katex": "^0.16.21",
|
|
"libpg-query": "15.2.0",
|
|
"lodash-es": "catalog:",
|
|
"lucide-react": "*",
|
|
"mdast": "^3.0.0",
|
|
"mdast-util-from-markdown": "^1.2.0",
|
|
"mdast-util-gfm": "^2.0.2",
|
|
"mdast-util-mdx": "^2.0.0",
|
|
"mdast-util-mdx-jsx": "^2.0.0",
|
|
"mdast-util-to-hast": "^12.3.0",
|
|
"mdast-util-to-markdown": "^1.5.0",
|
|
"mdast-util-to-string": "^3.1.1",
|
|
"micromark-extension-gfm": "^2.0.3",
|
|
"micromark-extension-mdxjs": "^1.0.0",
|
|
"next": "^15.5.21",
|
|
"next-mdx-remote-client": "^1.1.7",
|
|
"next-plugin-yaml": "^1.0.1",
|
|
"next-themes": "catalog:",
|
|
"nuqs": "^1.19.1",
|
|
"openai": "^4.75.1",
|
|
"openapi-fetch": "0.12.4",
|
|
"radix-ui": "catalog:",
|
|
"react": "catalog:",
|
|
"react-copy-to-clipboard": "^5.1.0",
|
|
"react-dom": "catalog:",
|
|
"react-error-boundary": "^4.0.12",
|
|
"react-hook-form": "^7.71.2",
|
|
"react-intersection-observer": "^9.5.3",
|
|
"react-markdown": "^10.1.0",
|
|
"react-use": "^17.5.0",
|
|
"rehype-katex": "^7.0.0",
|
|
"rehype-slug": "^5.1.0",
|
|
"remark": "^14.0.2",
|
|
"remark-emoji": "^3.1.2",
|
|
"remark-gfm": "^4.0.0",
|
|
"remark-math": "^6.0.0",
|
|
"server-only": "^0.0.1",
|
|
"shared-data": "workspace:*",
|
|
"ui": "workspace:*",
|
|
"ui-patterns": "workspace:*",
|
|
"unist-builder": "^3.0.1",
|
|
"unist-util-filter": "^4.0.1",
|
|
"unist-util-visit": "^4.1.2",
|
|
"uuid": "^14.0.0",
|
|
"valtio": "catalog:",
|
|
"yaml": "^2.8.1",
|
|
"zod": "catalog:"
|
|
},
|
|
"devDependencies": {
|
|
"@babel/core": "*",
|
|
"@graphiql/toolkit": "^0.9.1",
|
|
"@graphql-codegen/cli": "5.0.5",
|
|
"@graphql-codegen/typescript": "4.1.6",
|
|
"@graphql-codegen/typescript-resolvers": "4.5.0",
|
|
"@redocly/cli": "^2.26.0",
|
|
"@supabase/supa-mdx-lint": "0.3.2",
|
|
"@testing-library/react": "^16.3.3",
|
|
"@types/common-tags": "^1.8.4",
|
|
"@types/estree": "1.0.5",
|
|
"@types/graphql-validation-complexity": "^0.4.4",
|
|
"@types/hast": "^2.3.4",
|
|
"@types/jsrsasign": "^10.5.12",
|
|
"@types/lodash-es": "^4.17.12",
|
|
"@types/mdast": "^3.0.0",
|
|
"@types/node": "catalog:",
|
|
"@types/react": "catalog:",
|
|
"@types/react-copy-to-clipboard": "^5.0.4",
|
|
"@types/react-dom": "catalog:",
|
|
"@types/unist": "^2.0.6",
|
|
"@typescript/native": "catalog:",
|
|
"amaro": "^1.1.5",
|
|
"api-types": "workspace:*",
|
|
"cheerio": "^1.0.0-rc.12",
|
|
"chokidar": "^4.0.3",
|
|
"config": "workspace:*",
|
|
"dotenv": "^16.0.3",
|
|
"ejs": "^3.1.10",
|
|
"globby": "^13.2.2",
|
|
"graphiql": "^4.0.2",
|
|
"npm-run-all": "^4.1.5",
|
|
"openapi-types": "^12.1.3",
|
|
"postcss": "catalog:",
|
|
"shiki": "^3.2.1",
|
|
"shx": "^0.4.0",
|
|
"simple-git": "^3.24.0",
|
|
"slugify": "^1.6.6",
|
|
"smol-toml": "^1.3.1",
|
|
"tailwindcss": "catalog:",
|
|
"tar": "^7.5.21",
|
|
"tsconfig": "workspace:*",
|
|
"tsx": "catalog:",
|
|
"twoslash": "^0.3.1",
|
|
"typescript": "catalog:",
|
|
"unist-util-visit-parents": "5.1.3",
|
|
"vite": "catalog:",
|
|
"vitest": "catalog:"
|
|
}
|
|
}
|