Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: psteinroe/supabase-cache-helpers
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @supabase-cache-helpers/postgrest-react-query@1.8.1
Choose a base ref
...
head repository: psteinroe/supabase-cache-helpers
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Jul 22, 2024

  1. Copy the full SHA
    2a7f4d5 View commit details

Commits on Jul 24, 2024

  1. Copy the full SHA
    9df6b25 View commit details
  2. Copy the full SHA
    146d436 View commit details

Commits on Aug 24, 2024

  1. Copy the full SHA
    48f6f07 View commit details

Commits on Aug 28, 2024

  1. Copy the full SHA
    4d2d1e7 View commit details
  2. Merge pull request #495 from elyobo/lo/do-not-set-primary-keys-in-update

    Strip primary keys from the update payload
    psteinroe authored Aug 28, 2024
    Copy the full SHA
    5bacd08 View commit details
  3. Merge pull request #494 from psteinroe/renovate/happy-dom-15.x

    chore(deps): update dependency happy-dom to v15
    psteinroe authored Aug 28, 2024
    Copy the full SHA
    6c076a0 View commit details
  4. Copy the full SHA
    681741e View commit details
  5. Merge pull request #496 from psteinroe/changeset-release/main

    chore: update versions
    psteinroe authored Aug 28, 2024
    Copy the full SHA
    4551a48 View commit details

Commits on Sep 5, 2024

  1. feat: support aggregates

    psteinroe committed Sep 5, 2024
    Copy the full SHA
    f89f158 View commit details
  2. Merge pull request #497 from psteinroe/feat/aggregates

    feat: support aggregates
    psteinroe authored Sep 5, 2024
    Copy the full SHA
    1c2dd56 View commit details
  3. Copy the full SHA
    21fd6a0 View commit details
  4. Merge pull request #498 from psteinroe/changeset-release/main

    chore: update versions
    psteinroe authored Sep 5, 2024
    Copy the full SHA
    ff702d3 View commit details
  5. Copy the full SHA
    746cb34 View commit details
  6. fix: remove only

    psteinroe committed Sep 5, 2024
    Copy the full SHA
    eb2f5d4 View commit details
  7. Merge pull request #499 from psteinroe/fix/empty-array-cols

    fix: transform empty jsonb array cols properly
    psteinroe authored Sep 5, 2024
    Copy the full SHA
    447074a View commit details
  8. Copy the full SHA
    22c77b0 View commit details
  9. Merge pull request #500 from psteinroe/changeset-release/main

    chore: update versions
    psteinroe authored Sep 5, 2024
    Copy the full SHA
    99f4e1b View commit details

Commits on Oct 16, 2024

  1. Copy the full SHA
    d29a685 View commit details
  2. Copy the full SHA
    cd34978 View commit details
  3. Copy the full SHA
    ab9fc08 View commit details

Commits on Oct 20, 2024

  1. fix: typo

    Bill-Park committed Oct 20, 2024
    Copy the full SHA
    a838c02 View commit details
  2. Copy the full SHA
    f23865e View commit details

Commits on Oct 29, 2024

  1. Update queries.mdx

    Fix the title for useDirectoryFileUrls to match the name of the function
    rylincoln authored Oct 29, 2024
    Copy the full SHA
    6d660ae View commit details

Commits on Oct 31, 2024

  1. Copy the full SHA
    a574c0e View commit details
  2. Copy the full SHA
    12ba9ce View commit details
  3. Copy the full SHA
    4ab3681 View commit details

Commits on Nov 1, 2024

  1. Copy the full SHA
    1a9c340 View commit details

Commits on Nov 3, 2024

  1. Copy the full SHA
    3c40e6f View commit details
  2. add changeset

    stfnsr committed Nov 3, 2024
    Copy the full SHA
    74571ce View commit details
  3. formatting

    stfnsr committed Nov 3, 2024
    Copy the full SHA
    70854e1 View commit details
  4. Copy the full SHA
    3f0a62e View commit details
  5. Copy the full SHA
    c0cdde3 View commit details
  6. Copy the full SHA
    3ce09a8 View commit details

Commits on Nov 4, 2024

  1. Copy the full SHA
    5c1bfa3 View commit details

Commits on Nov 5, 2024

  1. Copy the full SHA
    3da4d0e View commit details

Commits on Nov 6, 2024

  1. Copy the full SHA
    e967ce5 View commit details
  2. Copy the full SHA
    bfdf3ac View commit details
  3. Copy the full SHA
    e9f49c9 View commit details
  4. Copy the full SHA
    e6502c4 View commit details
  5. Copy the full SHA
    cd95e1d View commit details
  6. Merge pull request #519 from psteinroe/changeset-release/main

    chore: update versions
    psteinroe authored Nov 6, 2024
    Copy the full SHA
    0df96e2 View commit details

Commits on Nov 8, 2024

  1. Copy the full SHA
    b06405b View commit details
  2. Merge pull request #521 from psteinroe/fix/delete-single

    fix: make delete work on single query
    psteinroe authored Nov 8, 2024
    Copy the full SHA
    44adffc View commit details
  3. Copy the full SHA
    eadce6b View commit details
  4. Merge pull request #522 from psteinroe/changeset-release/main

    chore: update versions
    psteinroe authored Nov 8, 2024
    Copy the full SHA
    5f9236c View commit details
  5. Copy the full SHA
    16f4895 View commit details

Commits on Nov 9, 2024

  1. Copy the full SHA
    2349efd View commit details

Commits on Nov 12, 2024

  1. Copy the full SHA
    c97010b View commit details

Commits on Nov 15, 2024

  1. Merge pull request #513 from damien-schneider/upgrade-nextra-doc-to-v3.2

    Upgrade nextra doc to v3.2
    psteinroe authored Nov 15, 2024
    Copy the full SHA
    3a1f88d View commit details
Showing with 17,051 additions and 12,079 deletions.
  1. +32 −18 .github/workflows/ci.yml
  2. +4 −1 .github/workflows/update-prs.yml
  3. +4 −1 .gitignore
  4. +2 −0 .nvmrc
  5. +3 −22 README.md
  6. +24 −0 docs/app/[[...mdxPath]]/page.jsx
  7. +8 −0 docs/app/_meta.js
  8. +101 −0 docs/app/layout.jsx
  9. +23 −0 docs/components/linked-tabs.jsx
  10. +50 −0 docs/components/tab-context.jsx
  11. +51 −0 docs/content/configuration.mdx
  12. +1 −1 docs/{pages → content}/index.mdx
  13. +9 −0 docs/content/postgrest/_meta.ts
  14. +49 −14 docs/{pages → content}/postgrest/custom-cache-updates.mdx
  15. +28 −27 docs/{pages → content}/postgrest/getting-started.mdx
  16. +35 −26 docs/{pages → content}/postgrest/mutations.mdx
  17. +104 −46 docs/{pages → content}/postgrest/queries.mdx
  18. +199 −0 docs/content/postgrest/server.mdx
  19. +4 −0 docs/content/postgrest/ssr/_meta.ts
  20. +1 −1 docs/{pages → content}/postgrest/ssr/react-query.mdx
  21. +1 −1 docs/{pages → content}/postgrest/ssr/swr.mdx
  22. +14 −13 docs/{pages → content}/postgrest/subscriptions.mdx
  23. +5 −0 docs/content/storage/_meta.ts
  24. +28 −28 docs/{pages → content}/storage/getting-started.mdx
  25. +20 −19 docs/{pages → content}/storage/mutations.mdx
  26. +27 −26 docs/{pages → content}/storage/queries.mdx
  27. +8 −0 docs/mdx-components.jsx
  28. +0 −11 docs/next.config.js
  29. +7 −0 docs/next.config.mjs
  30. +12 −12 docs/package.json
  31. +0 −13 docs/pages/_app.tsx
  32. +0 −8 docs/pages/_meta.json
  33. +0 −29 docs/pages/configuration.mdx
  34. +0 −8 docs/pages/postgrest/_meta.json
  35. +0 −4 docs/pages/postgrest/ssr/_meta.json
  36. +0 −5 docs/pages/storage/_meta.json
  37. +19 −3 docs/styles/globals.css
  38. +0 −12 docs/tailwind.config.js
  39. +0 −68 docs/theme.config.jsx
  40. +7 −2 docs/tsconfig.json
  41. +21 −0 examples/react-query/components.json
  42. +2 −2 examples/react-query/components/contact/contact-cards.tsx
  43. +1 −1 examples/react-query/components/icons.tsx
  44. +1 −1 examples/react-query/components/typography/code.tsx
  45. +1 −4 examples/react-query/components/typography/p.tsx
  46. +0 −63 examples/react-query/components/ui/accordion.tsx
  47. +0 −156 examples/react-query/components/ui/alert-dialog.tsx
  48. +0 −7 examples/react-query/components/ui/aspect-ratio.tsx
  49. +42 −41 examples/react-query/components/ui/avatar.tsx
  50. +32 −26 examples/react-query/components/ui/button.tsx
  51. +0 −30 examples/react-query/components/ui/checkbox.tsx
  52. +0 −11 examples/react-query/components/ui/collapsible.tsx
  53. +0 −158 examples/react-query/components/ui/command.tsx
  54. +0 −200 examples/react-query/components/ui/context-menu.tsx
  55. +104 −99 examples/react-query/components/ui/dialog.tsx
  56. +222 −170 examples/react-query/components/ui/dropdown-menu.tsx
  57. +0 −29 examples/react-query/components/ui/hover-card.tsx
  58. +15 −18 examples/react-query/components/ui/input.tsx
  59. +15 −16 examples/react-query/components/ui/label.tsx
  60. +0 −236 examples/react-query/components/ui/menubar.tsx
  61. +0 −128 examples/react-query/components/ui/navigation-menu.tsx
  62. +0 −31 examples/react-query/components/ui/popover.tsx
  63. +0 −28 examples/react-query/components/ui/progress.tsx
  64. +0 −44 examples/react-query/components/ui/radio-group.tsx
  65. +0 −48 examples/react-query/components/ui/scroll-area.tsx
  66. +159 −87 examples/react-query/components/ui/select.tsx
  67. +0 −31 examples/react-query/components/ui/separator.tsx
  68. +0 −234 examples/react-query/components/ui/sheet.tsx
  69. +0 −28 examples/react-query/components/ui/slider.tsx
  70. +0 −29 examples/react-query/components/ui/switch.tsx
  71. +0 −55 examples/react-query/components/ui/tabs.tsx
  72. +0 −24 examples/react-query/components/ui/textarea.tsx
  73. +0 −128 examples/react-query/components/ui/toast.tsx
  74. +0 −32 examples/react-query/components/ui/toaster.tsx
  75. +0 −45 examples/react-query/components/ui/toggle.tsx
  76. +0 −31 examples/react-query/components/ui/tooltip.tsx
  77. +0 −188 examples/react-query/hooks/use-toast.ts
  78. +0 −8 examples/react-query/next.config.mjs
  79. +45 −46 examples/react-query/package.json
  80. +1 −1 examples/react-query/pages/_app.tsx
  81. +1 −2 examples/react-query/postcss.config.js
  82. +186 −3 examples/react-query/styles/globals.css
  83. +0 −36 examples/react-query/tailwind.config.js
  84. +539 −29 examples/react-query/types/database.ts
  85. +21 −0 examples/swr/components.json
  86. +2 −2 examples/swr/components/contact/contact-cards.tsx
  87. +1 −1 examples/swr/components/icons.tsx
  88. +1 −1 examples/swr/components/typography/code.tsx
  89. +1 −4 examples/swr/components/typography/p.tsx
  90. +0 −63 examples/swr/components/ui/accordion.tsx
  91. +0 −156 examples/swr/components/ui/alert-dialog.tsx
  92. +0 −7 examples/swr/components/ui/aspect-ratio.tsx
  93. +42 −41 examples/swr/components/ui/avatar.tsx
  94. +32 −26 examples/swr/components/ui/button.tsx
  95. +0 −30 examples/swr/components/ui/checkbox.tsx
  96. +0 −11 examples/swr/components/ui/collapsible.tsx
  97. +0 −158 examples/swr/components/ui/command.tsx
  98. +0 −200 examples/swr/components/ui/context-menu.tsx
  99. +104 −99 examples/swr/components/ui/dialog.tsx
  100. +222 −168 examples/swr/components/ui/dropdown-menu.tsx
  101. +0 −29 examples/swr/components/ui/hover-card.tsx
  102. +15 −18 examples/swr/components/ui/input.tsx
  103. +15 −16 examples/swr/components/ui/label.tsx
  104. +0 −236 examples/swr/components/ui/menubar.tsx
  105. +0 −128 examples/swr/components/ui/navigation-menu.tsx
  106. +0 −31 examples/swr/components/ui/popover.tsx
  107. +0 −28 examples/swr/components/ui/progress.tsx
  108. +0 −44 examples/swr/components/ui/radio-group.tsx
  109. +0 −48 examples/swr/components/ui/scroll-area.tsx
  110. +159 −89 examples/swr/components/ui/select.tsx
  111. +0 −31 examples/swr/components/ui/separator.tsx
  112. +0 −234 examples/swr/components/ui/sheet.tsx
  113. +0 −28 examples/swr/components/ui/slider.tsx
  114. +0 −29 examples/swr/components/ui/switch.tsx
  115. +0 −55 examples/swr/components/ui/tabs.tsx
  116. +0 −24 examples/swr/components/ui/textarea.tsx
  117. +0 −128 examples/swr/components/ui/toast.tsx
  118. +0 −32 examples/swr/components/ui/toaster.tsx
  119. +0 −45 examples/swr/components/ui/toggle.tsx
  120. +0 −31 examples/swr/components/ui/tooltip.tsx
  121. +0 −188 examples/swr/hooks/use-toast.ts
  122. +1 −1 examples/swr/next-env.d.ts
  123. +0 −8 examples/swr/next.config.mjs
  124. +45 −46 examples/swr/package.json
  125. +1 −1 examples/swr/pages/_app.tsx
  126. +13 −12 examples/swr/pages/use-infinite-scroll-query.tsx
  127. +13 −12 examples/swr/pages/use-pagination-query.tsx
  128. +1 −2 examples/swr/postcss.config.js
  129. +186 −3 examples/swr/styles/globals.css
  130. +0 −36 examples/swr/tailwind.config.js
  131. +2 −1 examples/swr/tsconfig.json
  132. +0 −1 examples/swr/tsconfig.tsbuildinfo
  133. +539 −29 examples/swr/types/database.ts
  134. +13 −6 package.json
  135. +90 −0 packages/postgrest-core/CHANGELOG.md
  136. +10 −11 packages/postgrest-core/package.json
  137. +72 −16 packages/postgrest-core/src/cursor-pagination-fetcher.ts
  138. +3 −2 packages/postgrest-core/src/delete-fetcher.ts
  139. +10 −1 packages/postgrest-core/src/delete-item.ts
  140. +14 −4 packages/postgrest-core/src/fetch/build-mutation-fetcher-response.ts
  141. +3 −0 packages/postgrest-core/src/index.ts
  142. +1 −1 packages/postgrest-core/src/insert-fetcher.ts
  143. +36 −1 packages/postgrest-core/src/lib/encode-object.ts
  144. +20 −0 packages/postgrest-core/src/lib/get-table-from-url.ts
  145. +12 −13 packages/postgrest-core/src/lib/get-table.ts
  146. +5 −0 packages/postgrest-core/src/lib/is-plain-object.ts
  147. +22 −0 packages/postgrest-core/src/lib/like-postgrest-builder.ts
  148. +14 −0 packages/postgrest-core/src/lib/like-query-builder.ts
  149. +23 −0 packages/postgrest-core/src/lib/parse-order-by.ts
  150. +11 −2 packages/postgrest-core/src/lib/parse-select-param.ts
  151. +4 −0 packages/postgrest-core/src/lib/query-types.ts
  152. +6 −1 packages/postgrest-core/src/mutate-item.ts
  153. +169 −31 packages/postgrest-core/src/offset-pagination-fetcher.ts
  154. +36 −26 packages/postgrest-core/src/postgrest-filter.ts
  155. +13 −22 packages/postgrest-core/src/postgrest-parser.ts
  156. +43 −0 packages/postgrest-core/src/revalidate-tables.ts
  157. +22 −7 packages/postgrest-core/src/update-fetcher.ts
  158. +1 −1 packages/postgrest-core/src/upsert-fetcher.ts
  159. +6 −1 packages/postgrest-core/src/upsert-item.ts
  160. +291 −76 packages/postgrest-core/tests/cursor-pagination-fetcher.spec.ts
  161. +539 −29 packages/postgrest-core/tests/database.types.ts
  162. +1 −1 packages/postgrest-core/tests/delete-fetcher.spec.ts
  163. +13 −1 packages/postgrest-core/tests/delete-item.spec.ts
  164. +85 −2 packages/postgrest-core/tests/fetch/build-mutation-fetcher-response.spec.ts
  165. +1 −1 packages/postgrest-core/tests/index.spec.ts
  166. +4 −0 packages/postgrest-core/tests/lib/get-table.spec.ts
  167. +78 −0 packages/postgrest-core/tests/lib/parse-select-param.spec.ts
  168. +32 −0 packages/postgrest-core/tests/mutate-item.spec.ts
  169. +214 −91 packages/postgrest-core/tests/offset-pagination-fetcher.spec.ts
  170. +74 −0 packages/postgrest-core/tests/postgrest-filter.spec.ts
  171. +11 −0 packages/postgrest-core/tests/postgrest-parser.spec.ts
  172. +161 −0 packages/postgrest-core/tests/revalidate-tables.spec.ts
  173. +80 −9 packages/postgrest-core/tests/update-fetcher.spec.ts
  174. +31 −0 packages/postgrest-core/tests/upsert-item.spec.ts
  175. +144 −0 packages/postgrest-react-query/CHANGELOG.md
  176. +3 −2 packages/postgrest-react-query/README.md
  177. +12 −12 packages/postgrest-react-query/package.json
  178. +1 −0 packages/postgrest-react-query/src/cache/index.ts
  179. +31 −0 packages/postgrest-react-query/src/cache/use-revalidate-tables.ts
  180. +8 −8 packages/postgrest-react-query/src/mutate/types.ts
  181. +4 −4 packages/postgrest-react-query/src/mutate/use-delete-many-mutation.ts
  182. +4 −4 packages/postgrest-react-query/src/mutate/use-delete-mutation.ts
  183. +4 −4 packages/postgrest-react-query/src/mutate/use-insert-mutation.ts
  184. +33 −16 packages/postgrest-react-query/src/mutate/use-update-mutation.ts
  185. +4 −4 packages/postgrest-react-query/src/mutate/use-upsert-mutation.ts
  186. +28 −9 packages/postgrest-react-query/src/query/use-query.ts
  187. +9 −21 packages/postgrest-react-query/src/subscribe/use-subscription-query.ts
  188. +500 −32 packages/postgrest-react-query/tests/database.types.ts
  189. +64 −2 packages/postgrest-react-query/tests/mutate/use-update-mutation.integration.spec.tsx
  190. +3 −1 packages/postgrest-react-query/tests/subscribe/use-subscription.integration.spec.tsx
  191. +110 −0 packages/postgrest-server/CHANGELOG.md
  192. +34 −0 packages/postgrest-server/README.md
  193. +47 −0 packages/postgrest-server/package.json
  194. +9 −0 packages/postgrest-server/src/context.ts
  195. +3 −0 packages/postgrest-server/src/index.ts
  196. +30 −0 packages/postgrest-server/src/key.ts
  197. +158 −0 packages/postgrest-server/src/query-cache.ts
  198. +20 −0 packages/postgrest-server/src/stores/entry.ts
  199. +4 −0 packages/postgrest-server/src/stores/index.ts
  200. +40 −0 packages/postgrest-server/src/stores/interface.ts
  201. +86 −0 packages/postgrest-server/src/stores/memory.ts
  202. +67 −0 packages/postgrest-server/src/stores/redis.ts
  203. +125 −0 packages/postgrest-server/src/swr-cache.ts
  204. +81 −0 packages/postgrest-server/src/tiered-store.ts
  205. +27 −0 packages/postgrest-server/src/utils.ts
  206. +376 −0 packages/postgrest-server/tests/database.types.ts
  207. +411 −0 packages/postgrest-server/tests/query-cache.test.ts
  208. +64 −0 packages/postgrest-server/tests/stores/memory.test.ts
  209. +118 −0 packages/postgrest-server/tests/swr-cache.test.ts
  210. +4 −0 packages/postgrest-server/tests/utils.ts
  211. +5 −0 packages/postgrest-server/tsconfig.json
  212. +18 −0 packages/postgrest-server/tsup.config.ts
  213. +10 −0 packages/postgrest-server/vitest.config.ts
  214. +165 −0 packages/postgrest-swr/CHANGELOG.md
  215. +4 −2 packages/postgrest-swr/README.md
  216. +12 −12 packages/postgrest-swr/package.json
  217. +1 −0 packages/postgrest-swr/src/cache/index.ts
  218. +31 −0 packages/postgrest-swr/src/cache/use-revalidate-tables.ts
  219. +124 −45 packages/postgrest-swr/src/lib/create-key-getter.ts
  220. +25 −0 packages/postgrest-swr/src/lib/parse-order-by.ts
  221. +7 −7 packages/postgrest-swr/src/mutate/types.ts
  222. +5 −5 packages/postgrest-swr/src/mutate/use-delete-many-mutation.ts
  223. +5 −5 packages/postgrest-swr/src/mutate/use-delete-mutation.ts
  224. +5 −5 packages/postgrest-swr/src/mutate/use-insert-mutation.ts
  225. +4 −4 packages/postgrest-swr/src/mutate/use-update-mutation.ts
  226. +4 −4 packages/postgrest-swr/src/mutate/use-upsert-mutation.ts
  227. +128 −97 packages/postgrest-swr/src/query/use-cursor-infinite-scroll-query.ts
  228. +57 −27 packages/postgrest-swr/src/query/use-infinite-offset-pagination-query.ts
  229. +48 −20 packages/postgrest-swr/src/query/use-offset-infinite-query.ts
  230. +58 −27 packages/postgrest-swr/src/query/use-offset-infinite-scroll-query.ts
  231. +3 −3 packages/postgrest-swr/src/subscribe/use-subscription-query.ts
  232. +539 −29 packages/postgrest-swr/tests/database.types.ts
  233. +85 −4 packages/postgrest-swr/tests/mutate/use-update-mutation.integration.spec.tsx
  234. +494 −328 packages/postgrest-swr/tests/query/use-cursor-infinite-scroll-query.spec.tsx
  235. +598 −0 packages/postgrest-swr/tests/query/use-infinite-offset-pagination-query.spec.tsx
  236. +0 −136 packages/postgrest-swr/tests/query/use-offset-infinite-query.integration.spec.tsx
  237. +326 −0 packages/postgrest-swr/tests/query/use-offset-infinite-query.spec.tsx
  238. +0 −163 packages/postgrest-swr/tests/query/use-offset-infinite-scroll-query.integration.spec.tsx
  239. +356 −0 packages/postgrest-swr/tests/query/use-offset-infinite-scroll-query.spec.tsx
  240. +0 −281 packages/postgrest-swr/tests/query/use-pagination-query.integration.spec.tsx
  241. +1 −1 packages/postgrest-swr/tests/subscribe/use-subscription-query.integration.spec.tsx
  242. +47 −0 packages/storage-core/CHANGELOG.md
  243. +9 −9 packages/storage-core/package.json
  244. +2 −0 packages/storage-core/src/upload.ts
  245. +12 −13 packages/storage-core/src/url-fetcher.ts
  246. +2 −1 packages/storage-core/tests/upload.spec.ts
  247. +1 −1 packages/storage-core/tests/url-fetcher.spec.ts
  248. +69 −0 packages/storage-react-query/CHANGELOG.md
  249. +5 −2 packages/storage-react-query/README.md
  250. +13 −13 packages/storage-react-query/package.json
  251. +69 −0 packages/storage-swr/CHANGELOG.md
  252. +6 −2 packages/storage-swr/README.md
  253. +13 −13 packages/storage-swr/package.json
  254. +14 −0 packages/tsconfig/node.json
  255. +4,988 −4,724 pnpm-lock.yaml
  256. +4 −0 renovate.json
  257. +9 −5 supabase/config.toml
  258. +3 −0 supabase/migrations/20240311151147_allow_aggregates.sql
  259. +42 −0 supabase/migrations/20240311151148_add_rpcs.sql
  260. +2 −2 turbo.json
50 changes: 32 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -17,18 +17,19 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v3.0.0
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8.x.x
run_install: false

- name: Set up Node
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache: 'pnpm'

- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Install dependencies
run: pnpm install

- name: Start Supabase
uses: nick-fields/retry@v3
@@ -51,37 +52,50 @@ jobs:
run: pnpm turbo run test --concurrency=1

- name: Upload postgrest-core coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
files: ./packages/postgrest-core/coverage/coverage-final.json
token: ${{ secrets.CODECOV_TOKEN }}
file: ./packages/postgrest-core/coverage/coverage-final.json
flags: postgrest-core

- name: Upload postgrest-react-query coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
files: ./packages/postgrest-react-query/coverage/coverage-final.json
token: ${{ secrets.CODECOV_TOKEN }}
file: ./packages/postgrest-react-query/coverage/coverage-final.json
flags: postgrest-react-query

- name: Upload postgrest-swr coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
files: ./packages/postgrest-swr/coverage/coverage-final.json
token: ${{ secrets.CODECOV_TOKEN }}
file: ./packages/postgrest-swr/coverage/coverage-final.json
flags: postgrest-swr

- name: Upload storage-core coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
files: ./packages/storage-core/coverage/coverage-final.json
token: ${{ secrets.CODECOV_TOKEN }}
file: ./packages/storage-core/coverage/coverage-final.json
flags: storage-core

- name: Upload storage-swr coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
files: ./packages/storage-swr/coverage/coverage-final.json
token: ${{ secrets.CODECOV_TOKEN }}
file: ./packages/storage-swr/coverage/coverage-final.json
flags: storage-swr

- name: Upload storage-react-query coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
files: ./packages/storage-react-query/coverage/coverage-final.json
token: ${{ secrets.CODECOV_TOKEN }}
file: ./packages/storage-react-query/coverage/coverage-final.json
flags: storage-react-query

- name: Upload postgrest-server coverage
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./packages/postgrest-server/coverage/coverage-final.json
flags: postgrest-server
5 changes: 4 additions & 1 deletion .github/workflows/update-prs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Update stale PRs
on: push
on:
push:
branches:
- main

jobs:
update-prs:
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -27,4 +27,7 @@ yarn-error.log*
.turbo

# dist
**/dist/
**/dist/

tsconfig.tsbuildinfo

2 changes: 2 additions & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
22.14.0

25 changes: 3 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -10,13 +10,14 @@

## Introduction

The cache helpers bridge the gap between popular frontend cache management solutions such as [SWR](https://swr.vercel.app) or [React Query](https://tanstack.com/query/latest), and the Supabase client libraries. All features of [`postgrest-js`](https://github.com/supabase/postgrest-js), [`storage-js`](https://github.com/supabase/storage-js) and [`realtime-js`](https://github.com/supabase/realtime-js) are supported. The cache helpers parse any query into a unique and definite query key, and automatically populates your query cache with every mutation using implicit knowledge of the schema. Check out the [demo](https://supabase-cache-helpers-swr.vercel.app) and find out how it feels like for your users.
The cache helpers bridge the gap between popular frontend cache management solutions such as [SWR](https://swr.vercel.app) or [React Query](https://tanstack.com/query/latest), and the Supabase client libraries. All features of [`postgrest-js`](https://github.com/supabase/postgrest-js), [`storage-js`](https://github.com/supabase/storage-js) and [`realtime-js`](https://github.com/supabase/realtime-js) are supported. It also provides a simple server-side abstraction to cache queries to the `PostgREST` API. The cache helpers parse any query into a unique and definite query key, and automatically populates your query cache with every mutation using implicit knowledge of the schema. Check out the [demo](https://supabase-cache-helpers-swr.vercel.app) and find out how it feels like for your users.

## Features

With just one single line of code, you can simplify the logic of **fetching, subscribing to updates, and mutating data as well as storage objects** in your project, and have all the amazing features of [SWR](https://swr.vercel.app) or [React Query](https://tanstack.com/query/latest) out-of-the-box.

- **Seamless** integration with [SWR](https://swr.vercel.app) and [React Query](https://tanstack.com/query/latest)
- Support for **Server-Side** queries
- **Automatic** cache key generation
- Easy **Pagination** and **Infinite Scroll** queries
- **Insert**, **update**, **upsert** and **delete** mutations
@@ -42,12 +43,12 @@ The cache helpers are split up into reusable libraries.
- [`storage-swr`](./packages/storage-swr/README.md): [SWR](https://swr.vercel.app) wrapper for storage [storage-js](https://github.com/supabase/storage-js)
- [`postgrest-react-query`](./packages/postgrest-react-query/README.md): [React Query](https://tanstack.com/query/latest) wrapper for [postgrest-js](https://github.com/supabase/postgrest-js)
- [`storage-react-query`](./packages/storage-react-query/README.md): [React Query](https://tanstack.com/query/latest) wrapper for storage [storage-js](https://github.com/supabase/storage-js)
- [`postgrest-server`](./packages/postgrest-server/README.md): Server-side caching wrapper for [postgrest-js](https://github.com/supabase/postgrest-js).

### Shared Packages

These are not meant for direct usage.

- `jest-presets`: `jest` presets
- `postgrest-core`: shared logic for [postgrest-js](https://github.com/supabase/postgrest-js)
- `storage-core`: shared logic for [storage-js](https://github.com/supabase/storage-js) operations
- `tsconfig`: `tsconfig.json`s used throughout the monorepo
@@ -67,25 +68,5 @@ Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).
<br />
(we are <a href="https://twitter.com/psteinroe">hiring</a>!)
</td>
<td align="center">
<a href="https://supabase.com/">
<img src="https://avatars.githubusercontent.com/u/54469796?s=200&v=4" style="width:100px;border-radius:50%" " alt="Supabase" />
</a>
<br />
<b>Supabase</b>
<br />
<a href="https://supabase.com">https://supabase.com</a>
<br />
</td>
<td align="center">
<a href="https://github.com/Marviel">
<img src="https://avatars.githubusercontent.com/u/2037165?v=4" style="width:100px;border-radius:50%" " alt="Marviel" />
</a>
<br />
<b>Luke Bechtel</b>
<br />
<a href="https://github.com/Marviel">@Marviel</a>
<br />
</td>
</tr>
</table>
24 changes: 24 additions & 0 deletions docs/app/[[...mdxPath]]/page.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { LinkedTabs } from '@/components/linked-tabs';
import { generateStaticParamsFor, importPage } from 'nextra/pages';
import { useMDXComponents as getMDXComponents } from '../../mdx-components';

export const generateStaticParams = generateStaticParamsFor('mdxPath');

export async function generateMetadata(props) {
const params = await props.params;
const { metadata } = await importPage(params.mdxPath);
return metadata;
}

const Wrapper = getMDXComponents({ LinkedTabs }).wrapper;

export default async function Page(props) {
const params = await props.params;
const result = await importPage(params.mdxPath);
const { default: MDXContent, toc, metadata } = result;
return (
<Wrapper toc={toc} metadata={metadata}>
<MDXContent {...props} params={params} />
</Wrapper>
);
}
8 changes: 8 additions & 0 deletions docs/app/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
index: {
title: 'Introduction',
},
configuration: 'Configuration',
postgrest: 'PostgREST',
storage: 'Storage',
};
101 changes: 101 additions & 0 deletions docs/app/layout.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import { Footer, Layout, Navbar } from 'nextra-theme-docs';
import { Banner, Head } from 'nextra/components';
import { getPageMap } from 'nextra/page-map';
import 'nextra-theme-docs/style.css';

import { TabProvider } from '../components/tab-context';

export const metadata = {
metadataBase: new URL('https://supabase-cache-helpers.vercel.app'),
title: {
default: 'Supabase Cache Helpers',
template: '%s – Supabase Cache Helpers',
},
description:
'A collection of framework specific Cache utilities for working with Supabase.',
applicationName: 'Supabase Cache Helpers',
generator: 'Next.js',
appleWebApp: {
title: 'Supabase Cache Helpers',
},
other: {
'msapplication-TileImage': '/ms-icon-144x144.png',
'msapplication-TileColor': '#fff',
},
openGraph: {
title: 'Supabase Cache Helpers',
description:
'A collection of framework specific Cache utilities for working with Supabase.',
url: 'https://supabase-cache-helpers.vercel.app',
siteName: 'Supabase Cache Helpers',
images: [
{
url: 'https://supabase-cache-helpers.vercel.app/og-image.png',
width: 1200,
height: 630,
},
],
locale: 'en_US',
type: 'website',
},
twitter: {
card: 'summary_large_image',
title: 'Supabase Cache Helpers',
description:
'A collection of framework specific Cache utilities for working with Supabase.',
images: ['https://supabase-cache-helpers.vercel.app/og-image.png'],
creator: '@psteinroe',
site: 'https://supabase-cache-helpers.vercel.app',
},
};

export const viewport = {
width: 'device-width',
initialScale: 1,
};

export default async function RootLayout({ children }) {
const navbar = <Navbar logo={<span>Supabase Cache Helpers</span>} />;
const pageMap = await getPageMap();
return (
<html lang="en" dir="ltr" suppressHydrationWarning>
<Head faviconGlyph="✦" />
<body>
<Layout
banner={
<Banner storageKey="hiring">
<a
href="https://twitter.com/psteinroe"
target="_blank"
rel="noreferrer"
>
🎉 We are hiring! You want to work on a large-scale Supabase
project? DM me →
</a>
</Banner>
}
navbar={navbar}
footer={
<Footer>
MIT {new Date().getFullYear()}
<a
href="https://supabase-cache-helpers.vercel.app"
target="_blank"
rel="noreferrer"
>
{': '}
Supabase Cache Helpers
</a>
</Footer>
}
editLink="Edit this page on GitHub"
docsRepositoryBase="https://github.com/psteinroe/supabase-cache-helpers/blob/core/docs"
sidebar={{ defaultMenuCollapseLevel: 1 }}
pageMap={pageMap}
>
<TabProvider>{children}</TabProvider>
</Layout>
</body>
</html>
);
}
23 changes: 23 additions & 0 deletions docs/components/linked-tabs.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use client';

import { Tabs } from 'nextra/components';
import React from 'react';
import { useTabContext } from './tab-context';

export const LinkedTabs = ({ id, items, children }) => {
const { selectedTabs, setSelectedTab } = useTabContext();
const selectedTab = selectedTabs[id] || items[0];

const index = items.indexOf(selectedTab);
const selectedIndex = index !== -1 ? index : 0;

return (
<Tabs
items={items}
selectedIndex={selectedIndex}
onChange={(index) => setSelectedTab(id, items[index])}
>
{children}
</Tabs>
);
};
50 changes: 50 additions & 0 deletions docs/components/tab-context.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
'use client';

import { createContext, useContext, useEffect, useState } from 'react';

const TabContext = createContext({
selectedTabs: {},
setSelectedTab: () => {},
});

export const useTabContext = () => useContext(TabContext);

export const TabProvider = ({ children }) => {
const [selectedTabs, setSelectedTabs] = useState({});

useEffect(() => {
if (typeof window !== 'undefined') {
const storedTabs = localStorage.getItem('selectedTabs');
if (storedTabs) {
try {
const parsedTabs = JSON.parse(storedTabs);
setSelectedTabs(parsedTabs);
} catch (error) {
console.error(
'Failed to parse selectedTabs from localStorage',
error,
);
}
}
}
}, []);

useEffect(() => {
if (typeof window !== 'undefined') {
localStorage.setItem('selectedTabs', JSON.stringify(selectedTabs));
}
}, [selectedTabs]);

const setSelectedTab = (id, tab) => {
setSelectedTabs((prev) => ({
...prev,
[id]: tab,
}));
};

return (
<TabContext.Provider value={{ selectedTabs, setSelectedTab }}>
{children}
</TabContext.Provider>
);
};
Loading