@trieb.work/nextjs-turbo-redis-cache 1.15.0 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/.cursor/skills/testing/SKILL.md +121 -0
  2. package/.github/workflows/ci.yml +199 -69
  3. package/.github/workflows/release.yml +9 -1
  4. package/ARCHITECTURE.md +431 -0
  5. package/CHANGELOG.md +28 -0
  6. package/README.md +77 -49
  7. package/dist/index.d.mts +71 -45
  8. package/dist/index.d.ts +71 -45
  9. package/dist/index.js +107 -21
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +107 -21
  12. package/dist/index.mjs.map +1 -1
  13. package/docs/index.html +7 -6
  14. package/eslint.config.mjs +1 -1
  15. package/package.json +15 -16
  16. package/playwright.config.ts +5 -3
  17. package/src/CacheComponentsHandler.ts +57 -2
  18. package/src/RedisStringsHandler.ts +125 -66
  19. package/src/SyncedMap.ts +62 -13
  20. package/test/README.md +194 -0
  21. package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/package.json +6 -6
  22. package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-15-4-11}/pnpm-lock.yaml +89 -105
  23. package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-0-11}/package.json +3 -3
  24. package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-0-11}/pnpm-lock.yaml +53 -53
  25. package/test/nextjs-test-projects/next-app-16-0-11-cache-components/package.json +28 -0
  26. package/test/nextjs-test-projects/next-app-16-0-11-cache-components/pnpm-lock.yaml +4206 -0
  27. package/test/nextjs-test-projects/next-app-16-2-6/eslint.config.mjs +18 -0
  28. package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-16-2-6}/package.json +3 -3
  29. package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-16-2-6}/pnpm-lock.yaml +54 -60
  30. package/test/nextjs-test-projects/next-app-16-2-6/postcss.config.mjs +7 -0
  31. package/test/nextjs-test-projects/next-app-16-2-6/src/app/favicon.ico +0 -0
  32. package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-2-6}/tsconfig.json +9 -2
  33. package/test/nextjs-test-projects/next-app-16-2-6-cache-components/cache-handler.js +3 -0
  34. package/test/nextjs-test-projects/next-app-16-2-6-cache-components/next.config.ts +13 -0
  35. package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-2-6-cache-components}/package.json +3 -3
  36. package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-2-6-cache-components}/pnpm-lock.yaml +54 -60
  37. package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/api/cached-static-fetch/route.ts +19 -0
  38. package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/api/cached-with-cachelife/route.ts +24 -0
  39. package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/api/cached-with-tag/route.ts +21 -0
  40. package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/api/revalidate-tag/route.ts +19 -0
  41. package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/api/revalidated-fetch/route.ts +19 -0
  42. package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/cache-lab/cachelife-short/page.tsx +110 -0
  43. package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/cache-lab/page.tsx +90 -0
  44. package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/cache-lab/runtime-data-suspense/page.tsx +127 -0
  45. package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/cache-lab/stale-while-revalidate/page.tsx +130 -0
  46. package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/cache-lab/tag-invalidation/page.tsx +127 -0
  47. package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/cache-lab/use-cache-nondeterministic/page.tsx +110 -0
  48. package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-2-6-cache-components}/src/app/layout.tsx +0 -2
  49. package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/update-tag-test/page.tsx +22 -0
  50. package/test/nextjs-test-projects/next-pages-16-2-6/README.md +16 -0
  51. package/test/nextjs-test-projects/next-pages-16-2-6/eslint.config.mjs +18 -0
  52. package/test/nextjs-test-projects/next-pages-16-2-6/next.config.ts +7 -0
  53. package/test/nextjs-test-projects/next-pages-16-2-6/package.json +26 -0
  54. package/test/nextjs-test-projects/next-pages-16-2-6/pnpm-lock.yaml +3896 -0
  55. package/test/nextjs-test-projects/next-pages-16-2-6/src/pages/api/revalidate.ts +24 -0
  56. package/test/nextjs-test-projects/next-pages-16-2-6/src/pages/index.tsx +11 -0
  57. package/test/nextjs-test-projects/next-pages-16-2-6/src/pages/isr/[slug].tsx +49 -0
  58. package/test/nextjs-test-projects/next-pages-16-2-6/src/pages/static-forever.tsx +20 -0
  59. package/test/nextjs-test-projects/next-pages-16-2-6/tsconfig.json +34 -0
  60. package/{tests → test/playwright}/update-tag.spec.ts +1 -1
  61. package/test/{integration → vitest/integration}/build-id-prefix.integration.test.ts +2 -2
  62. package/test/{cache-components/cache-components.integration.spec.ts → vitest/integration/cache-components/cache-components.integration.test.ts} +7 -3
  63. package/test/{cache-components/redis-kill-reconnect.spec.ts → vitest/integration/cache-components/redis-kill-reconnect.test.ts} +28 -7
  64. package/test/vitest/integration/cache-components/redis-quit-vs-disconnect.test.ts +59 -0
  65. package/test/vitest/integration/cache-components/redis-subscriber-outage.test.ts +100 -0
  66. package/test/{cache-components → vitest/integration/cache-components}/scripts/redis-kill-reconnect.ts +31 -8
  67. package/test/vitest/integration/cache-components/scripts/redis-quit-vs-disconnect.ts +113 -0
  68. package/test/vitest/integration/cache-components/scripts/redis-subscriber-outage.ts +379 -0
  69. package/test/vitest/integration/cache-components/scripts/redis-test-helpers.ts +155 -0
  70. package/test/{integration → vitest/integration}/nextjs-cache-handler.integration.test.ts +15 -9
  71. package/test/vitest/integration/pages-router.integration.test.ts +420 -0
  72. package/test/vitest/unit/SyncedMap-reconnect-repro.test.ts +154 -0
  73. package/{src → test/vitest/unit}/index.test.ts +3 -3
  74. package/test/vitest/unit/pages-router-kinds.test.ts +292 -0
  75. package/test/{cache-components/reconnect-socket-already-opened.spec.ts → vitest/unit/reconnect-socket-already-opened.test.ts} +1 -1
  76. package/{src → test/vitest/unit}/serializer.test.ts +7 -3
  77. package/{src → test/vitest/unit}/utils/prefix.test.ts +1 -1
  78. package/vite.config.ts +4 -3
  79. package/vitest.cache-components.config.ts +1 -1
  80. package/test/browser/update-tag.browser.test.ts +0 -41
  81. package/test/integration/next-app-15-0-3/next.config.js +0 -6
  82. package/test/integration/next-app-15-0-3/package-lock.json +0 -5833
  83. package/test/integration/next-app-15-0-3/pnpm-lock.yaml +0 -3710
  84. package/test/integration/next-app-15-3-2/next.config.js +0 -6
  85. package/test/integration/next-app-15-3-2/package.json +0 -33
  86. package/test/integration/next-app-15-3-2/pnpm-lock.yaml +0 -3720
  87. package/test/integration/next-app-15-3-2/postcss.config.mjs +0 -5
  88. package/test/integration/next-app-15-3-2/src/app/api/revalidateTag/route.ts +0 -15
  89. package/test/integration/next-app-15-4-7/eslint.config.mjs +0 -16
  90. package/test/integration/next-app-15-4-7/package-lock.json +0 -5969
  91. package/test/integration/next-app-15-4-7/package.json +0 -33
  92. package/test/integration/next-app-15-4-7/postcss.config.mjs +0 -5
  93. package/test/integration/next-app-15-4-7/src/app/api/revalidateTag/route.ts +0 -15
  94. package/test/integration/next-app-15-4-7/tsconfig.json +0 -27
  95. package/test/integration/next-app-16-0-3/src/app/api/cached-static-fetch/route.ts +0 -18
  96. package/test/integration/next-app-16-0-3/src/app/api/nested-fetch-in-api-route/revalidated-fetch/route.ts +0 -27
  97. package/test/integration/next-app-16-0-3/src/app/api/revalidatePath/route.ts +0 -15
  98. package/test/integration/next-app-16-0-3/src/app/api/revalidated-fetch/route.ts +0 -17
  99. package/test/integration/next-app-16-0-3/src/app/api/uncached-fetch/route.ts +0 -15
  100. package/test/integration/next-app-16-0-3/src/app/pages/cached-static-fetch/default--force-dynamic-page/page.tsx +0 -19
  101. package/test/integration/next-app-16-0-3/src/app/pages/cached-static-fetch/revalidate15--default-page/page.tsx +0 -34
  102. package/test/integration/next-app-16-0-3/src/app/pages/cached-static-fetch/revalidate15--force-dynamic-page/page.tsx +0 -25
  103. package/test/integration/next-app-16-0-3/src/app/pages/no-fetch/default-page/page.tsx +0 -55
  104. package/test/integration/next-app-16-0-3/src/app/pages/revalidated-fetch/default--force-dynamic-page/page.tsx +0 -19
  105. package/test/integration/next-app-16-0-3/src/app/pages/revalidated-fetch/revalidate15--default-page/page.tsx +0 -35
  106. package/test/integration/next-app-16-0-3/src/app/pages/revalidated-fetch/revalidate15--force-dynamic-page/page.tsx +0 -25
  107. package/test/integration/next-app-16-0-3/src/app/pages/uncached-fetch/default--force-dynamic-page/page.tsx +0 -19
  108. package/test/integration/next-app-16-0-3/src/app/pages/uncached-fetch/revalidate15--default-page/page.tsx +0 -32
  109. package/test/integration/next-app-16-0-3/src/app/pages/uncached-fetch/revalidate15--force-dynamic-page/page.tsx +0 -25
  110. package/test/integration/next-app-16-2-3/src/app/api/cached-static-fetch/route.ts +0 -18
  111. package/test/integration/next-app-16-2-3/src/app/api/nested-fetch-in-api-route/revalidated-fetch/route.ts +0 -27
  112. package/test/integration/next-app-16-2-3/src/app/api/revalidatePath/route.ts +0 -15
  113. package/test/integration/next-app-16-2-3/src/app/api/revalidated-fetch/route.ts +0 -17
  114. package/test/integration/next-app-16-2-3/src/app/api/uncached-fetch/route.ts +0 -15
  115. package/test/integration/next-app-16-2-3/src/app/globals.css +0 -26
  116. package/test/integration/next-app-16-2-3/src/app/layout.tsx +0 -59
  117. package/test/integration/next-app-16-2-3/src/app/page.tsx +0 -755
  118. package/test/integration/next-app-16-2-3/src/app/pages/cached-static-fetch/default--force-dynamic-page/page.tsx +0 -19
  119. package/test/integration/next-app-16-2-3/src/app/pages/cached-static-fetch/revalidate15--default-page/page.tsx +0 -34
  120. package/test/integration/next-app-16-2-3/src/app/pages/cached-static-fetch/revalidate15--force-dynamic-page/page.tsx +0 -25
  121. package/test/integration/next-app-16-2-3/src/app/pages/no-fetch/default-page/page.tsx +0 -55
  122. package/test/integration/next-app-16-2-3/src/app/pages/revalidated-fetch/default--force-dynamic-page/page.tsx +0 -19
  123. package/test/integration/next-app-16-2-3/src/app/pages/revalidated-fetch/revalidate15--default-page/page.tsx +0 -35
  124. package/test/integration/next-app-16-2-3/src/app/pages/revalidated-fetch/revalidate15--force-dynamic-page/page.tsx +0 -25
  125. package/test/integration/next-app-16-2-3/src/app/pages/uncached-fetch/default--force-dynamic-page/page.tsx +0 -19
  126. package/test/integration/next-app-16-2-3/src/app/pages/uncached-fetch/revalidate15--default-page/page.tsx +0 -32
  127. package/test/integration/next-app-16-2-3/src/app/pages/uncached-fetch/revalidate15--force-dynamic-page/page.tsx +0 -25
  128. package/test/integration/next-app-16-2-3/src/app/revalidation-interface.tsx +0 -267
  129. package/test/integration/next-app-16-2-3-cache-components/public/file.svg +0 -1
  130. package/test/integration/next-app-16-2-3-cache-components/public/globe.svg +0 -1
  131. package/test/integration/next-app-16-2-3-cache-components/public/next.svg +0 -1
  132. package/test/integration/next-app-16-2-3-cache-components/public/vercel.svg +0 -1
  133. package/test/integration/next-app-16-2-3-cache-components/public/window.svg +0 -1
  134. package/test/integration/next-app-customized/README.md +0 -36
  135. package/test/integration/next-app-customized/eslint.config.mjs +0 -16
  136. package/vitest.browser.config.ts +0 -10
  137. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/README.md +0 -0
  138. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/eslint.config.mjs +0 -0
  139. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-15-4-11}/next.config.js +0 -0
  140. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-15-4-11}/package-lock.json +0 -0
  141. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/postcss.config.mjs +0 -0
  142. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/public/file.svg +0 -0
  143. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/public/globe.svg +0 -0
  144. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/public/next.svg +0 -0
  145. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/public/vercel.svg +0 -0
  146. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/public/window.svg +0 -0
  147. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/api/cached-static-fetch/route.ts +0 -0
  148. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/api/nested-fetch-in-api-route/revalidated-fetch/route.ts +0 -0
  149. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/api/revalidatePath/route.ts +0 -0
  150. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/api/revalidateTag/route.ts +0 -0
  151. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/api/revalidated-fetch/route.ts +0 -0
  152. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/api/uncached-fetch/route.ts +0 -0
  153. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/globals.css +0 -0
  154. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/layout.tsx +0 -0
  155. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/page.tsx +0 -0
  156. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/pages/cached-static-fetch/default--force-dynamic-page/page.tsx +0 -0
  157. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/pages/cached-static-fetch/revalidate15--default-page/page.tsx +0 -0
  158. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/pages/cached-static-fetch/revalidate15--force-dynamic-page/page.tsx +0 -0
  159. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/pages/no-fetch/default-page/page.tsx +0 -0
  160. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/pages/revalidated-fetch/default--force-dynamic-page/page.tsx +0 -0
  161. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/pages/revalidated-fetch/revalidate15--default-page/page.tsx +0 -0
  162. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/pages/revalidated-fetch/revalidate15--force-dynamic-page/page.tsx +0 -0
  163. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/pages/uncached-fetch/default--force-dynamic-page/page.tsx +0 -0
  164. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/pages/uncached-fetch/revalidate15--default-page/page.tsx +0 -0
  165. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/pages/uncached-fetch/revalidate15--force-dynamic-page/page.tsx +0 -0
  166. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/revalidation-interface.tsx +0 -0
  167. /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/tsconfig.json +0 -0
  168. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-0-11}/README.md +0 -0
  169. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11}/eslint.config.mjs +0 -0
  170. /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-0-11}/next.config.ts +0 -0
  171. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11}/postcss.config.mjs +0 -0
  172. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11}/src/app/api/cached-static-fetch/route.ts +0 -0
  173. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11}/src/app/api/nested-fetch-in-api-route/revalidated-fetch/route.ts +0 -0
  174. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11}/src/app/api/revalidatePath/route.ts +0 -0
  175. /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-0-11}/src/app/api/revalidateTag/route.ts +0 -0
  176. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11}/src/app/api/revalidated-fetch/route.ts +0 -0
  177. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11}/src/app/api/uncached-fetch/route.ts +0 -0
  178. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11}/src/app/favicon.ico +0 -0
  179. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-0-11}/src/app/globals.css +0 -0
  180. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11}/src/app/layout.tsx +0 -0
  181. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-0-11}/src/app/page.tsx +0 -0
  182. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11}/src/app/pages/cached-static-fetch/default--force-dynamic-page/page.tsx +0 -0
  183. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11}/src/app/pages/cached-static-fetch/revalidate15--default-page/page.tsx +0 -0
  184. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11}/src/app/pages/cached-static-fetch/revalidate15--force-dynamic-page/page.tsx +0 -0
  185. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11}/src/app/pages/no-fetch/default-page/page.tsx +0 -0
  186. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11}/src/app/pages/revalidated-fetch/default--force-dynamic-page/page.tsx +0 -0
  187. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11}/src/app/pages/revalidated-fetch/revalidate15--default-page/page.tsx +0 -0
  188. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11}/src/app/pages/revalidated-fetch/revalidate15--force-dynamic-page/page.tsx +0 -0
  189. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11}/src/app/pages/uncached-fetch/default--force-dynamic-page/page.tsx +0 -0
  190. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11}/src/app/pages/uncached-fetch/revalidate15--default-page/page.tsx +0 -0
  191. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11}/src/app/pages/uncached-fetch/revalidate15--force-dynamic-page/page.tsx +0 -0
  192. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-0-11}/src/app/revalidation-interface.tsx +0 -0
  193. /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-0-11}/src/app/update-tag-test/page.tsx +0 -0
  194. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11}/tsconfig.json +0 -0
  195. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11-cache-components}/README.md +0 -0
  196. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11-cache-components}/cache-handler.js +0 -0
  197. /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-0-11-cache-components}/eslint.config.mjs +0 -0
  198. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11-cache-components}/next.config.ts +0 -0
  199. /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-0-11-cache-components}/postcss.config.mjs +0 -0
  200. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11-cache-components}/public/file.svg +0 -0
  201. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11-cache-components}/public/globe.svg +0 -0
  202. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11-cache-components}/public/next.svg +0 -0
  203. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11-cache-components}/public/vercel.svg +0 -0
  204. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11-cache-components}/public/window.svg +0 -0
  205. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/api/cached-static-fetch/route.ts +0 -0
  206. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/api/cached-with-cachelife/route.ts +0 -0
  207. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/api/cached-with-tag/route.ts +0 -0
  208. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/api/revalidate-tag/route.ts +0 -0
  209. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/api/revalidated-fetch/route.ts +0 -0
  210. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/cache-lab/cachelife-short/page.tsx +0 -0
  211. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/cache-lab/page.tsx +0 -0
  212. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/cache-lab/runtime-data-suspense/page.tsx +0 -0
  213. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/cache-lab/stale-while-revalidate/page.tsx +0 -0
  214. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/cache-lab/tag-invalidation/page.tsx +0 -0
  215. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/cache-lab/use-cache-nondeterministic/page.tsx +0 -0
  216. /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/favicon.ico +0 -0
  217. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/globals.css +0 -0
  218. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/layout.tsx +0 -0
  219. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/page.tsx +0 -0
  220. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/revalidation-interface.tsx +0 -0
  221. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/update-tag-test/page.tsx +0 -0
  222. /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-0-11-cache-components}/tsconfig.json +0 -0
  223. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-2-6}/README.md +0 -0
  224. /package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-16-2-6}/next.config.ts +0 -0
  225. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6}/src/app/api/cached-static-fetch/route.ts +0 -0
  226. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6}/src/app/api/nested-fetch-in-api-route/revalidated-fetch/route.ts +0 -0
  227. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6}/src/app/api/revalidatePath/route.ts +0 -0
  228. /package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-16-2-6}/src/app/api/revalidateTag/route.ts +0 -0
  229. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6}/src/app/api/revalidated-fetch/route.ts +0 -0
  230. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6}/src/app/api/uncached-fetch/route.ts +0 -0
  231. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-2-6}/src/app/globals.css +0 -0
  232. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6}/src/app/layout.tsx +0 -0
  233. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-2-6}/src/app/page.tsx +0 -0
  234. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6}/src/app/pages/cached-static-fetch/default--force-dynamic-page/page.tsx +0 -0
  235. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6}/src/app/pages/cached-static-fetch/revalidate15--default-page/page.tsx +0 -0
  236. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6}/src/app/pages/cached-static-fetch/revalidate15--force-dynamic-page/page.tsx +0 -0
  237. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6}/src/app/pages/no-fetch/default-page/page.tsx +0 -0
  238. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6}/src/app/pages/revalidated-fetch/default--force-dynamic-page/page.tsx +0 -0
  239. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6}/src/app/pages/revalidated-fetch/revalidate15--default-page/page.tsx +0 -0
  240. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6}/src/app/pages/revalidated-fetch/revalidate15--force-dynamic-page/page.tsx +0 -0
  241. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6}/src/app/pages/uncached-fetch/default--force-dynamic-page/page.tsx +0 -0
  242. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6}/src/app/pages/uncached-fetch/revalidate15--default-page/page.tsx +0 -0
  243. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6}/src/app/pages/uncached-fetch/revalidate15--force-dynamic-page/page.tsx +0 -0
  244. /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-2-6}/src/app/revalidation-interface.tsx +0 -0
  245. /package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-16-2-6}/src/app/update-tag-test/page.tsx +0 -0
  246. /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-2-6-cache-components}/README.md +0 -0
  247. /package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-16-2-6-cache-components}/eslint.config.mjs +0 -0
  248. /package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-16-2-6-cache-components}/postcss.config.mjs +0 -0
  249. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6-cache-components}/public/file.svg +0 -0
  250. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6-cache-components}/public/globe.svg +0 -0
  251. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6-cache-components}/public/next.svg +0 -0
  252. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6-cache-components}/public/vercel.svg +0 -0
  253. /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6-cache-components}/public/window.svg +0 -0
  254. /package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-16-2-6-cache-components}/src/app/favicon.ico +0 -0
  255. /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-2-6-cache-components}/src/app/globals.css +0 -0
  256. /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-2-6-cache-components}/src/app/page.tsx +0 -0
  257. /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-2-6-cache-components}/src/app/revalidation-interface.tsx +0 -0
  258. /package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-16-2-6-cache-components}/tsconfig.json +0 -0
  259. /package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-customized}/README.md +0 -0
  260. /package/test/{integration → nextjs-test-projects}/next-app-customized/customized-cache-handler.js +0 -0
  261. /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-customized}/eslint.config.mjs +0 -0
  262. /package/test/{integration → nextjs-test-projects}/next-app-customized/next.config.js +0 -0
  263. /package/{tests → test/playwright}/cache-lab.spec.ts +0 -0
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: testing
3
+ description: >-
4
+ Run tests and add Next.js version coverage for the cache handler. Use when
5
+ running tests, adding a new Next.js version to the test matrix, creating test
6
+ apps, or debugging CI failures.
7
+ ---
8
+
9
+ # Testing
10
+
11
+ ## Running Tests
12
+
13
+ ```bash
14
+ # Unit tests (fast, no Redis needed)
15
+ pnpm test:unit
16
+ pnpm test:unit:watch # watch mode
17
+ pnpm test:unit:coverage # with coverage
18
+
19
+ # Integration tests (needs Redis + pre-built Next.js app)
20
+ pnpm test:integration
21
+ pnpm test:integration:build-id-prefix
22
+ pnpm test:integration:cache-components
23
+
24
+ # E2E / Playwright for cached components (needs Redis, auto-starts Next.js app)
25
+ pnpm test:e2e
26
+ ```
27
+
28
+ ## Test Structure
29
+
30
+ ```
31
+ test/
32
+ ├── playwright/ # E2E (Playwright browser tests)
33
+ ├── vitest/
34
+ │ ├── unit/ # Unit tests (no external deps)
35
+ │ └── integration/ # Integration tests (Redis + Next.js)
36
+ │ └── cache-components/
37
+ └── nextjs-test-projects/ # Shared Next.js app fixtures
38
+ ```
39
+
40
+ For details on each layer, see `test/README.md`.
41
+
42
+ ## Adding a New Next.js Version
43
+
44
+ ### 1. Standard Integration Test App
45
+
46
+ For testing the core cache handler against a new Next.js version (e.g. 16.5.0):
47
+
48
+ ```bash
49
+ cp -r test/nextjs-test-projects/next-app-16-2-6 test/nextjs-test-projects/next-app-16-5-0
50
+ rm -rf test/nextjs-test-projects/next-app-16-5-0/{node_modules,.next,pnpm-lock.yaml}
51
+ ```
52
+
53
+ Edit `test/nextjs-test-projects/next-app-16-5-0/package.json`:
54
+
55
+ - Change `"name"` to `"next-app-16-5-0"`
56
+ - Change `"next"` version to `"16.5.0"`
57
+ - Change `"eslint-config-next"` version to `"16.5.0"`
58
+
59
+ Then add the app to the CI integration matrix in `.github/workflows/ci.yml`:
60
+
61
+ ```yaml
62
+ # In the `integration` job → strategy.matrix.next-test-app
63
+ - next-app-16-5-0
64
+ ```
65
+
66
+ ### 2. Cache Components Test App (Next.js 16+ only)
67
+
68
+ If the new version supports `use cache` / `cacheTag` / `cacheLife`:
69
+
70
+ ```bash
71
+ cp -r test/nextjs-test-projects/next-app-16-2-6-cache-components test/nextjs-test-projects/next-app-16-5-0-cache-components
72
+ rm -rf test/nextjs-test-projects/next-app-16-5-0-cache-components/{node_modules,.next,pnpm-lock.yaml}
73
+ ```
74
+
75
+ Edit the `package.json`:
76
+
77
+ - Change `"name"` to `"next-app-16-5-0-cache-components"`
78
+ - Change `"next"` to `"16.5.0"`
79
+ - Change `"eslint-config-next"` to `"16.5.0"`
80
+
81
+ Then add it to both CI matrix jobs in `.github/workflows/ci.yml`:
82
+
83
+ ```yaml
84
+ # In `integration-cache-components` → strategy.matrix.cache-components-app
85
+ - next-app-16-5-0-cache-components
86
+
87
+ # In `e2e` → strategy.matrix.cache-components-app
88
+ - next-app-16-5-0-cache-components
89
+ ```
90
+
91
+ ### 3. Checklist After Adding
92
+
93
+ - [ ] `package.json` has correct Next.js version + matching `eslint-config-next`
94
+ - [ ] `"@trieb.work/nextjs-turbo-redis-cache": "file:../../../"` path is correct
95
+ - [ ] No leftover `node_modules/`, `.next/`, or `pnpm-lock.yaml` from the copy
96
+ - [ ] CI matrix updated (integration and/or cache-components + e2e)
97
+ - [ ] `test/README.md` → "Next.js Test Projects" table updated
98
+ - [ ] Run `cd test/nextjs-test-projects/next-app-16-5-0 && pnpm install && pnpm build` to verify it builds
99
+
100
+ ### 4. Removing a Version
101
+
102
+ Remove the folder, remove it from the CI matrix entries, and update `test/README.md`.
103
+
104
+ ## Environment Variables
105
+
106
+ | Variable | Default | Purpose |
107
+ | ---------------------- | ---------------------------------- | ----------------------------------------- |
108
+ | `NEXT_TEST_APP` | `next-app-15-4-11` | Which app for `pnpm test:integration` |
109
+ | `CACHE_COMPONENTS_APP` | `next-app-16-2-6-cache-components` | Which app for cache-components tests |
110
+ | `PLAYWRIGHT_TEST_APP` | `next-app-16-2-6-cache-components` | Which app Playwright starts |
111
+ | `PLAYWRIGHT_BASE_URL` | `http://localhost:3101` | Override to use an already-running server |
112
+ | `SKIP_BUILD` | — | Skip Next.js build in integration tests |
113
+ | `DEBUG_INTEGRATION` | — | Print child process output |
114
+
115
+ ## Writing New Tests
116
+
117
+ - **Unit tests**: Add `*.test.ts` in `test/vitest/unit/`. No Redis, no Next.js. Use mocks.
118
+ - **Integration tests**: Add `*.test.ts` in `test/vitest/integration/`. Spawn Next.js, use `fetch()`, check Redis.
119
+ - **E2E tests**: Add `*.spec.ts` in `test/playwright/`. Use Playwright browser automation.
120
+
121
+ Unit tests use `.test.ts` extension. Playwright tests use `.spec.ts` extension.
@@ -8,31 +8,15 @@ on:
8
8
  branches:
9
9
  - main
10
10
 
11
- # Default-deny: every job inherits read-only access. Jobs that need more
12
- # elevate explicitly via their own `permissions:` block (see `build` below).
13
11
  permissions:
14
12
  contents: read
15
13
 
16
14
  jobs:
17
- build:
15
+ lint-and-unit:
18
16
  runs-on: ubuntu-latest
19
17
  permissions:
20
- contents: read # Required for actions/checkout
21
- pull-requests: write # Required for the coverage-comments action on PRs
22
- strategy:
23
- matrix:
24
- include:
25
- - next-test-app: next-app-15-0-3
26
- run-cache-components: false
27
- - next-test-app: next-app-15-3-2
28
- run-cache-components: false
29
- - next-test-app: next-app-15-4-7
30
- run-cache-components: false
31
- - next-test-app: next-app-16-0-3
32
- run-cache-components: true
33
- - next-test-app: next-app-16-2-3
34
- run-cache-components: true
35
-
18
+ contents: read
19
+ pull-requests: write
36
20
  steps:
37
21
  - name: Checkout code
38
22
  uses: actions/checkout@v6
@@ -47,8 +31,6 @@ jobs:
47
31
  cache: 'pnpm'
48
32
 
49
33
  - name: Install dependencies
50
- # --ignore-scripts blocks lifecycle scripts of all dependencies to mitigate
51
- # supply-chain attacks via compromised postinstall hooks.
52
34
  run: pnpm install --ignore-scripts
53
35
 
54
36
  - name: Run lint
@@ -57,6 +39,51 @@ jobs:
57
39
  - name: Build project
58
40
  run: pnpm build
59
41
 
42
+ - name: Run unit tests
43
+ run: pnpm test:unit:coverage
44
+
45
+ - name: Code Coverage Comments
46
+ if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
47
+ uses: kcjpop/coverage-comments@v2.2
48
+ with:
49
+ github-token: ${{ secrets.GITHUB_TOKEN }}
50
+ coverage-file: './coverage/lcov.info'
51
+
52
+ - name: Dry run the release
53
+ if: github.event_name == 'pull_request'
54
+ env:
55
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
57
+ run: npx semantic-release --dry-run
58
+
59
+ integration:
60
+ runs-on: ubuntu-latest
61
+ needs: lint-and-unit
62
+ strategy:
63
+ matrix:
64
+ next-test-app:
65
+ - next-app-15-4-11
66
+ - next-app-16-0-11
67
+ - next-app-16-2-6
68
+ steps:
69
+ - name: Checkout code
70
+ uses: actions/checkout@v6
71
+
72
+ - name: Install pnpm
73
+ run: corepack enable
74
+
75
+ - name: Setup Node.js
76
+ uses: actions/setup-node@v6
77
+ with:
78
+ node-version: '22'
79
+ cache: 'pnpm'
80
+
81
+ - name: Install dependencies
82
+ run: pnpm install --ignore-scripts
83
+
84
+ - name: Build project
85
+ run: pnpm build
86
+
60
87
  - name: Start Redis
61
88
  uses: supercharge/redis-github-action@1.8.0
62
89
  with:
@@ -69,63 +96,114 @@ jobs:
69
96
  - name: Configure Redis Keyspace Notifications
70
97
  run: redis-cli config set notify-keyspace-events Exe
71
98
 
72
- - name: Install Integration Test Project
73
- run: cd test/integration/${{ matrix.next-test-app }} && pnpm install
99
+ - name: Install test project
100
+ run: cd test/nextjs-test-projects/${{ matrix.next-test-app }} && pnpm install
74
101
 
75
- - name: Build Integration Test Project
76
- run: cd test/integration/${{ matrix.next-test-app }} && pnpm build
102
+ - name: Build test project
103
+ run: cd test/nextjs-test-projects/${{ matrix.next-test-app }} && pnpm build
77
104
 
78
- - name: Run tests
79
- run: pnpm test:ci
105
+ - name: Run integration tests
106
+ run: pnpm test:integration
80
107
  env:
81
108
  SKIP_BUILD: true
82
109
  NEXT_TEST_APP: ${{ matrix.next-test-app }}
83
110
 
84
- - name: Install Cache Components Integration Test Project
85
- if: matrix.run-cache-components
86
- run: cd test/integration/next-app-16-2-3-cache-components && pnpm install
111
+ integration-pages:
112
+ runs-on: ubuntu-latest
113
+ needs: lint-and-unit
114
+ steps:
115
+ - name: Checkout code
116
+ uses: actions/checkout@v6
117
+
118
+ - name: Install pnpm
119
+ run: corepack enable
87
120
 
88
- - name: Build Cache Components Integration Test Project
89
- if: matrix.run-cache-components
90
- run: cd test/integration/next-app-16-2-3-cache-components && pnpm build
121
+ - name: Setup Node.js
122
+ uses: actions/setup-node@v6
123
+ with:
124
+ node-version: '22'
125
+ cache: 'pnpm'
91
126
 
92
- - name: Run Cache Components integration tests
93
- if: matrix.run-cache-components
94
- run: pnpm test:cache-components
127
+ - name: Install dependencies
128
+ run: pnpm install --ignore-scripts
95
129
 
96
- - name: Run Redis kill/restart E2E test (cache-components)
97
- if: matrix.run-cache-components
98
- run: pnpm vitest --run --config vitest.cache-components.config.ts test/cache-components/redis-kill-reconnect.spec.ts
130
+ - name: Build project
131
+ run: pnpm build
99
132
 
100
- - name: Install Playwright browsers
101
- if: matrix.run-cache-components
102
- run: pnpm exec playwright install --with-deps
133
+ - name: Start Redis
134
+ uses: supercharge/redis-github-action@1.8.0
135
+ with:
136
+ redis-version: '7'
137
+ redis-port: 6379
103
138
 
104
- - name: Run Playwright E2E tests
105
- if: matrix.run-cache-components
106
- run: pnpm test:e2e
139
+ - name: Install redis-cli
140
+ run: sudo apt-get update && sudo apt-get install -y redis-tools
141
+
142
+ - name: Configure Redis Keyspace Notifications
143
+ run: redis-cli config set notify-keyspace-events Exe
144
+
145
+ - name: Install test project
146
+ run: cd test/nextjs-test-projects/next-pages-16-2-6 && pnpm install
147
+
148
+ - name: Build test project
149
+ run: cd test/nextjs-test-projects/next-pages-16-2-6 && pnpm build
150
+
151
+ - name: Run Pages Router integration tests
152
+ run: pnpm test:integration:pages
107
153
  env:
108
- PLAYWRIGHT_BASE_URL: http://localhost:3101
154
+ SKIP_BUILD: true
109
155
 
110
- - name: Code Coverage Comments
111
- if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
112
- uses: kcjpop/coverage-comments@v2.2
156
+ integration-build-id-prefix:
157
+ runs-on: ubuntu-latest
158
+ needs: lint-and-unit
159
+ steps:
160
+ - name: Checkout code
161
+ uses: actions/checkout@v6
162
+
163
+ - name: Install pnpm
164
+ run: corepack enable
165
+
166
+ - name: Setup Node.js
167
+ uses: actions/setup-node@v6
113
168
  with:
114
- github-token: ${{ secrets.GITHUB_TOKEN }}
115
- coverage-file: './coverage/lcov.info'
169
+ node-version: '22'
170
+ cache: 'pnpm'
116
171
 
117
- - name: Dry run the release
118
- if: github.event_name == 'pull_request'
119
- env:
120
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token for Semantic Release
121
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # NPM token for publishing
122
- run: |
123
- npx semantic-release --dry-run
172
+ - name: Install dependencies
173
+ run: pnpm install --ignore-scripts
174
+
175
+ - name: Build project
176
+ run: pnpm build
177
+
178
+ - name: Start Redis
179
+ uses: supercharge/redis-github-action@1.8.0
180
+ with:
181
+ redis-version: '7'
182
+ redis-port: 6379
124
183
 
125
- build-id-prefix:
184
+ - name: Install redis-cli
185
+ run: sudo apt-get update && sudo apt-get install -y redis-tools
186
+
187
+ - name: Configure Redis Keyspace Notifications
188
+ run: redis-cli config set notify-keyspace-events Exe
189
+
190
+ - name: Install test project
191
+ run: cd test/nextjs-test-projects/next-app-15-4-11 && pnpm install
192
+
193
+ - name: Build test project
194
+ run: cd test/nextjs-test-projects/next-app-15-4-11 && pnpm build
195
+
196
+ - name: Run BUILD_ID prefix integration test
197
+ run: pnpm test:integration:build-id-prefix
198
+
199
+ integration-cache-components:
126
200
  runs-on: ubuntu-latest
127
- permissions:
128
- contents: read
201
+ needs: lint-and-unit
202
+ strategy:
203
+ matrix:
204
+ cache-components-app:
205
+ - next-app-16-0-11-cache-components
206
+ - next-app-16-2-6-cache-components
129
207
  steps:
130
208
  - name: Checkout code
131
209
  uses: actions/checkout@v6
@@ -142,8 +220,55 @@ jobs:
142
220
  - name: Install dependencies
143
221
  run: pnpm install --ignore-scripts
144
222
 
145
- - name: Run lint
146
- run: pnpm lint
223
+ - name: Build project
224
+ run: pnpm build
225
+
226
+ - name: Start Redis
227
+ uses: supercharge/redis-github-action@1.8.0
228
+ with:
229
+ redis-version: '7'
230
+ redis-port: 6379
231
+
232
+ - name: Install redis-cli
233
+ run: sudo apt-get update && sudo apt-get install -y redis-tools
234
+
235
+ - name: Configure Redis Keyspace Notifications
236
+ run: redis-cli config set notify-keyspace-events Exe
237
+
238
+ - name: Install test project
239
+ run: cd test/nextjs-test-projects/${{ matrix.cache-components-app }} && pnpm install
240
+
241
+ - name: Build test project
242
+ run: cd test/nextjs-test-projects/${{ matrix.cache-components-app }} && pnpm build
243
+
244
+ - name: Run cache-components integration tests
245
+ run: pnpm test:integration:cache-components
246
+ env:
247
+ CACHE_COMPONENTS_APP: ${{ matrix.cache-components-app }}
248
+
249
+ e2e:
250
+ runs-on: ubuntu-latest
251
+ needs: lint-and-unit
252
+ strategy:
253
+ matrix:
254
+ cache-components-app:
255
+ - next-app-16-0-11-cache-components
256
+ - next-app-16-2-6-cache-components
257
+ steps:
258
+ - name: Checkout code
259
+ uses: actions/checkout@v6
260
+
261
+ - name: Install pnpm
262
+ run: corepack enable
263
+
264
+ - name: Setup Node.js
265
+ uses: actions/setup-node@v6
266
+ with:
267
+ node-version: '22'
268
+ cache: 'pnpm'
269
+
270
+ - name: Install dependencies
271
+ run: pnpm install --ignore-scripts
147
272
 
148
273
  - name: Build project
149
274
  run: pnpm build
@@ -160,11 +285,16 @@ jobs:
160
285
  - name: Configure Redis Keyspace Notifications
161
286
  run: redis-cli config set notify-keyspace-events Exe
162
287
 
163
- - name: Install Integration Test Project
164
- run: cd test/integration/next-app-15-4-7 && pnpm install
288
+ - name: Install test project
289
+ run: cd test/nextjs-test-projects/${{ matrix.cache-components-app }} && pnpm install
165
290
 
166
- - name: Build Integration Test Project
167
- run: cd test/integration/next-app-15-4-7 && pnpm build
291
+ - name: Build test project
292
+ run: cd test/nextjs-test-projects/${{ matrix.cache-components-app }} && pnpm build
168
293
 
169
- - name: Run BUILD_ID integration test
170
- run: pnpm test:integration:build-id-prefix
294
+ - name: Install Playwright browsers
295
+ run: pnpm exec playwright install --with-deps
296
+
297
+ - name: Run Playwright E2E tests
298
+ run: pnpm test:e2e
299
+ env:
300
+ PLAYWRIGHT_TEST_APP: ${{ matrix.cache-components-app }}
@@ -22,11 +22,19 @@ jobs:
22
22
  runs-on: ubuntu-latest
23
23
 
24
24
  steps:
25
+ - name: Create GitHub App token
26
+ id: app-token
27
+ uses: actions/create-github-app-token@v1
28
+ with:
29
+ app-id: ${{ vars.RELEASE_APP_ID }}
30
+ private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
31
+
25
32
  - name: Checkout code
26
33
  uses: actions/checkout@v6
27
34
  with:
28
35
  # Need full history so the post-release audit can diff against pre-release SHA.
29
36
  fetch-depth: 0
37
+ token: ${{ steps.app-token.outputs.token }}
30
38
 
31
39
  - name: Capture pre-release SHA
32
40
  id: pre
@@ -65,7 +73,7 @@ jobs:
65
73
 
66
74
  - name: Run Semantic Release
67
75
  env:
68
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token for Semantic Release
76
+ GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} # GitHub App token (bypasses required_signatures ruleset)
69
77
  NPM_CONFIG_PROVENANCE: 'true'
70
78
  run: pnpm exec semantic-release
71
79