@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.
- package/.cursor/skills/testing/SKILL.md +121 -0
- package/.github/workflows/ci.yml +199 -69
- package/.github/workflows/release.yml +9 -1
- package/ARCHITECTURE.md +431 -0
- package/CHANGELOG.md +28 -0
- package/README.md +77 -49
- package/dist/index.d.mts +71 -45
- package/dist/index.d.ts +71 -45
- package/dist/index.js +107 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +107 -21
- package/dist/index.mjs.map +1 -1
- package/docs/index.html +7 -6
- package/eslint.config.mjs +1 -1
- package/package.json +15 -16
- package/playwright.config.ts +5 -3
- package/src/CacheComponentsHandler.ts +57 -2
- package/src/RedisStringsHandler.ts +125 -66
- package/src/SyncedMap.ts +62 -13
- package/test/README.md +194 -0
- package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/package.json +6 -6
- package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-15-4-11}/pnpm-lock.yaml +89 -105
- package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-0-11}/package.json +3 -3
- package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-0-11}/pnpm-lock.yaml +53 -53
- package/test/nextjs-test-projects/next-app-16-0-11-cache-components/package.json +28 -0
- package/test/nextjs-test-projects/next-app-16-0-11-cache-components/pnpm-lock.yaml +4206 -0
- package/test/nextjs-test-projects/next-app-16-2-6/eslint.config.mjs +18 -0
- package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-16-2-6}/package.json +3 -3
- package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-16-2-6}/pnpm-lock.yaml +54 -60
- package/test/nextjs-test-projects/next-app-16-2-6/postcss.config.mjs +7 -0
- package/test/nextjs-test-projects/next-app-16-2-6/src/app/favicon.ico +0 -0
- package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-2-6}/tsconfig.json +9 -2
- package/test/nextjs-test-projects/next-app-16-2-6-cache-components/cache-handler.js +3 -0
- package/test/nextjs-test-projects/next-app-16-2-6-cache-components/next.config.ts +13 -0
- package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-2-6-cache-components}/package.json +3 -3
- 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
- package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/api/cached-static-fetch/route.ts +19 -0
- package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/api/cached-with-cachelife/route.ts +24 -0
- package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/api/cached-with-tag/route.ts +21 -0
- package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/api/revalidate-tag/route.ts +19 -0
- package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/api/revalidated-fetch/route.ts +19 -0
- package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/cache-lab/cachelife-short/page.tsx +110 -0
- package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/cache-lab/page.tsx +90 -0
- package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/cache-lab/runtime-data-suspense/page.tsx +127 -0
- package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/cache-lab/stale-while-revalidate/page.tsx +130 -0
- package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/cache-lab/tag-invalidation/page.tsx +127 -0
- package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/cache-lab/use-cache-nondeterministic/page.tsx +110 -0
- package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-2-6-cache-components}/src/app/layout.tsx +0 -2
- package/test/nextjs-test-projects/next-app-16-2-6-cache-components/src/app/update-tag-test/page.tsx +22 -0
- package/test/nextjs-test-projects/next-pages-16-2-6/README.md +16 -0
- package/test/nextjs-test-projects/next-pages-16-2-6/eslint.config.mjs +18 -0
- package/test/nextjs-test-projects/next-pages-16-2-6/next.config.ts +7 -0
- package/test/nextjs-test-projects/next-pages-16-2-6/package.json +26 -0
- package/test/nextjs-test-projects/next-pages-16-2-6/pnpm-lock.yaml +3896 -0
- package/test/nextjs-test-projects/next-pages-16-2-6/src/pages/api/revalidate.ts +24 -0
- package/test/nextjs-test-projects/next-pages-16-2-6/src/pages/index.tsx +11 -0
- package/test/nextjs-test-projects/next-pages-16-2-6/src/pages/isr/[slug].tsx +49 -0
- package/test/nextjs-test-projects/next-pages-16-2-6/src/pages/static-forever.tsx +20 -0
- package/test/nextjs-test-projects/next-pages-16-2-6/tsconfig.json +34 -0
- package/{tests → test/playwright}/update-tag.spec.ts +1 -1
- package/test/{integration → vitest/integration}/build-id-prefix.integration.test.ts +2 -2
- package/test/{cache-components/cache-components.integration.spec.ts → vitest/integration/cache-components/cache-components.integration.test.ts} +7 -3
- package/test/{cache-components/redis-kill-reconnect.spec.ts → vitest/integration/cache-components/redis-kill-reconnect.test.ts} +28 -7
- package/test/vitest/integration/cache-components/redis-quit-vs-disconnect.test.ts +59 -0
- package/test/vitest/integration/cache-components/redis-subscriber-outage.test.ts +100 -0
- package/test/{cache-components → vitest/integration/cache-components}/scripts/redis-kill-reconnect.ts +31 -8
- package/test/vitest/integration/cache-components/scripts/redis-quit-vs-disconnect.ts +113 -0
- package/test/vitest/integration/cache-components/scripts/redis-subscriber-outage.ts +379 -0
- package/test/vitest/integration/cache-components/scripts/redis-test-helpers.ts +155 -0
- package/test/{integration → vitest/integration}/nextjs-cache-handler.integration.test.ts +15 -9
- package/test/vitest/integration/pages-router.integration.test.ts +420 -0
- package/test/vitest/unit/SyncedMap-reconnect-repro.test.ts +154 -0
- package/{src → test/vitest/unit}/index.test.ts +3 -3
- package/test/vitest/unit/pages-router-kinds.test.ts +292 -0
- package/test/{cache-components/reconnect-socket-already-opened.spec.ts → vitest/unit/reconnect-socket-already-opened.test.ts} +1 -1
- package/{src → test/vitest/unit}/serializer.test.ts +7 -3
- package/{src → test/vitest/unit}/utils/prefix.test.ts +1 -1
- package/vite.config.ts +4 -3
- package/vitest.cache-components.config.ts +1 -1
- package/test/browser/update-tag.browser.test.ts +0 -41
- package/test/integration/next-app-15-0-3/next.config.js +0 -6
- package/test/integration/next-app-15-0-3/package-lock.json +0 -5833
- package/test/integration/next-app-15-0-3/pnpm-lock.yaml +0 -3710
- package/test/integration/next-app-15-3-2/next.config.js +0 -6
- package/test/integration/next-app-15-3-2/package.json +0 -33
- package/test/integration/next-app-15-3-2/pnpm-lock.yaml +0 -3720
- package/test/integration/next-app-15-3-2/postcss.config.mjs +0 -5
- package/test/integration/next-app-15-3-2/src/app/api/revalidateTag/route.ts +0 -15
- package/test/integration/next-app-15-4-7/eslint.config.mjs +0 -16
- package/test/integration/next-app-15-4-7/package-lock.json +0 -5969
- package/test/integration/next-app-15-4-7/package.json +0 -33
- package/test/integration/next-app-15-4-7/postcss.config.mjs +0 -5
- package/test/integration/next-app-15-4-7/src/app/api/revalidateTag/route.ts +0 -15
- package/test/integration/next-app-15-4-7/tsconfig.json +0 -27
- package/test/integration/next-app-16-0-3/src/app/api/cached-static-fetch/route.ts +0 -18
- package/test/integration/next-app-16-0-3/src/app/api/nested-fetch-in-api-route/revalidated-fetch/route.ts +0 -27
- package/test/integration/next-app-16-0-3/src/app/api/revalidatePath/route.ts +0 -15
- package/test/integration/next-app-16-0-3/src/app/api/revalidated-fetch/route.ts +0 -17
- package/test/integration/next-app-16-0-3/src/app/api/uncached-fetch/route.ts +0 -15
- package/test/integration/next-app-16-0-3/src/app/pages/cached-static-fetch/default--force-dynamic-page/page.tsx +0 -19
- package/test/integration/next-app-16-0-3/src/app/pages/cached-static-fetch/revalidate15--default-page/page.tsx +0 -34
- package/test/integration/next-app-16-0-3/src/app/pages/cached-static-fetch/revalidate15--force-dynamic-page/page.tsx +0 -25
- package/test/integration/next-app-16-0-3/src/app/pages/no-fetch/default-page/page.tsx +0 -55
- package/test/integration/next-app-16-0-3/src/app/pages/revalidated-fetch/default--force-dynamic-page/page.tsx +0 -19
- package/test/integration/next-app-16-0-3/src/app/pages/revalidated-fetch/revalidate15--default-page/page.tsx +0 -35
- package/test/integration/next-app-16-0-3/src/app/pages/revalidated-fetch/revalidate15--force-dynamic-page/page.tsx +0 -25
- package/test/integration/next-app-16-0-3/src/app/pages/uncached-fetch/default--force-dynamic-page/page.tsx +0 -19
- package/test/integration/next-app-16-0-3/src/app/pages/uncached-fetch/revalidate15--default-page/page.tsx +0 -32
- package/test/integration/next-app-16-0-3/src/app/pages/uncached-fetch/revalidate15--force-dynamic-page/page.tsx +0 -25
- package/test/integration/next-app-16-2-3/src/app/api/cached-static-fetch/route.ts +0 -18
- package/test/integration/next-app-16-2-3/src/app/api/nested-fetch-in-api-route/revalidated-fetch/route.ts +0 -27
- package/test/integration/next-app-16-2-3/src/app/api/revalidatePath/route.ts +0 -15
- package/test/integration/next-app-16-2-3/src/app/api/revalidated-fetch/route.ts +0 -17
- package/test/integration/next-app-16-2-3/src/app/api/uncached-fetch/route.ts +0 -15
- package/test/integration/next-app-16-2-3/src/app/globals.css +0 -26
- package/test/integration/next-app-16-2-3/src/app/layout.tsx +0 -59
- package/test/integration/next-app-16-2-3/src/app/page.tsx +0 -755
- package/test/integration/next-app-16-2-3/src/app/pages/cached-static-fetch/default--force-dynamic-page/page.tsx +0 -19
- package/test/integration/next-app-16-2-3/src/app/pages/cached-static-fetch/revalidate15--default-page/page.tsx +0 -34
- package/test/integration/next-app-16-2-3/src/app/pages/cached-static-fetch/revalidate15--force-dynamic-page/page.tsx +0 -25
- package/test/integration/next-app-16-2-3/src/app/pages/no-fetch/default-page/page.tsx +0 -55
- package/test/integration/next-app-16-2-3/src/app/pages/revalidated-fetch/default--force-dynamic-page/page.tsx +0 -19
- package/test/integration/next-app-16-2-3/src/app/pages/revalidated-fetch/revalidate15--default-page/page.tsx +0 -35
- package/test/integration/next-app-16-2-3/src/app/pages/revalidated-fetch/revalidate15--force-dynamic-page/page.tsx +0 -25
- package/test/integration/next-app-16-2-3/src/app/pages/uncached-fetch/default--force-dynamic-page/page.tsx +0 -19
- package/test/integration/next-app-16-2-3/src/app/pages/uncached-fetch/revalidate15--default-page/page.tsx +0 -32
- package/test/integration/next-app-16-2-3/src/app/pages/uncached-fetch/revalidate15--force-dynamic-page/page.tsx +0 -25
- package/test/integration/next-app-16-2-3/src/app/revalidation-interface.tsx +0 -267
- package/test/integration/next-app-16-2-3-cache-components/public/file.svg +0 -1
- package/test/integration/next-app-16-2-3-cache-components/public/globe.svg +0 -1
- package/test/integration/next-app-16-2-3-cache-components/public/next.svg +0 -1
- package/test/integration/next-app-16-2-3-cache-components/public/vercel.svg +0 -1
- package/test/integration/next-app-16-2-3-cache-components/public/window.svg +0 -1
- package/test/integration/next-app-customized/README.md +0 -36
- package/test/integration/next-app-customized/eslint.config.mjs +0 -16
- package/vitest.browser.config.ts +0 -10
- /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/README.md +0 -0
- /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/eslint.config.mjs +0 -0
- /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-15-4-11}/next.config.js +0 -0
- /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-15-4-11}/package-lock.json +0 -0
- /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/postcss.config.mjs +0 -0
- /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/public/file.svg +0 -0
- /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/public/globe.svg +0 -0
- /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/public/next.svg +0 -0
- /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/public/vercel.svg +0 -0
- /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/public/window.svg +0 -0
- /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
- /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
- /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/api/revalidatePath/route.ts +0 -0
- /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/api/revalidateTag/route.ts +0 -0
- /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
- /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
- /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/globals.css +0 -0
- /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/layout.tsx +0 -0
- /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/page.tsx +0 -0
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/src/app/revalidation-interface.tsx +0 -0
- /package/test/{integration/next-app-15-0-3 → nextjs-test-projects/next-app-15-4-11}/tsconfig.json +0 -0
- /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-0-11}/README.md +0 -0
- /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11}/eslint.config.mjs +0 -0
- /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-0-11}/next.config.ts +0 -0
- /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11}/postcss.config.mjs +0 -0
- /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
- /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
- /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11}/src/app/api/revalidatePath/route.ts +0 -0
- /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-0-11}/src/app/api/revalidateTag/route.ts +0 -0
- /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
- /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
- /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11}/src/app/favicon.ico +0 -0
- /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-0-11}/src/app/globals.css +0 -0
- /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11}/src/app/layout.tsx +0 -0
- /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-0-11}/src/app/page.tsx +0 -0
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-0-11}/src/app/revalidation-interface.tsx +0 -0
- /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
- /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-0-11}/tsconfig.json +0 -0
- /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11-cache-components}/README.md +0 -0
- /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
- /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-0-11-cache-components}/eslint.config.mjs +0 -0
- /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
- /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-0-11-cache-components}/postcss.config.mjs +0 -0
- /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11-cache-components}/public/file.svg +0 -0
- /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11-cache-components}/public/globe.svg +0 -0
- /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11-cache-components}/public/next.svg +0 -0
- /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11-cache-components}/public/vercel.svg +0 -0
- /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11-cache-components}/public/window.svg +0 -0
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/favicon.ico +0 -0
- /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/globals.css +0 -0
- /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
- /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-16-0-11-cache-components}/src/app/page.tsx +0 -0
- /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
- /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
- /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-0-11-cache-components}/tsconfig.json +0 -0
- /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-2-6}/README.md +0 -0
- /package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-16-2-6}/next.config.ts +0 -0
- /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
- /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
- /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6}/src/app/api/revalidatePath/route.ts +0 -0
- /package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-16-2-6}/src/app/api/revalidateTag/route.ts +0 -0
- /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
- /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
- /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-2-6}/src/app/globals.css +0 -0
- /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6}/src/app/layout.tsx +0 -0
- /package/test/{integration/next-app-16-2-3-cache-components → nextjs-test-projects/next-app-16-2-6}/src/app/page.tsx +0 -0
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-2-6-cache-components}/README.md +0 -0
- /package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-16-2-6-cache-components}/eslint.config.mjs +0 -0
- /package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-16-2-6-cache-components}/postcss.config.mjs +0 -0
- /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6-cache-components}/public/file.svg +0 -0
- /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6-cache-components}/public/globe.svg +0 -0
- /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6-cache-components}/public/next.svg +0 -0
- /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6-cache-components}/public/vercel.svg +0 -0
- /package/test/{integration/next-app-15-4-7 → nextjs-test-projects/next-app-16-2-6-cache-components}/public/window.svg +0 -0
- /package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-16-2-6-cache-components}/src/app/favicon.ico +0 -0
- /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-2-6-cache-components}/src/app/globals.css +0 -0
- /package/test/{integration/next-app-16-0-3 → nextjs-test-projects/next-app-16-2-6-cache-components}/src/app/page.tsx +0 -0
- /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
- /package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-16-2-6-cache-components}/tsconfig.json +0 -0
- /package/test/{integration/next-app-16-2-3 → nextjs-test-projects/next-app-customized}/README.md +0 -0
- /package/test/{integration → nextjs-test-projects}/next-app-customized/customized-cache-handler.js +0 -0
- /package/test/{integration/next-app-15-3-2 → nextjs-test-projects/next-app-customized}/eslint.config.mjs +0 -0
- /package/test/{integration → nextjs-test-projects}/next-app-customized/next.config.js +0 -0
- /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.
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -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
|
-
|
|
15
|
+
lint-and-unit:
|
|
18
16
|
runs-on: ubuntu-latest
|
|
19
17
|
permissions:
|
|
20
|
-
contents: read
|
|
21
|
-
pull-requests: write
|
|
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
|
|
73
|
-
run: cd test/
|
|
99
|
+
- name: Install test project
|
|
100
|
+
run: cd test/nextjs-test-projects/${{ matrix.next-test-app }} && pnpm install
|
|
74
101
|
|
|
75
|
-
- name: Build
|
|
76
|
-
run: cd test/
|
|
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:
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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:
|
|
89
|
-
|
|
90
|
-
|
|
121
|
+
- name: Setup Node.js
|
|
122
|
+
uses: actions/setup-node@v6
|
|
123
|
+
with:
|
|
124
|
+
node-version: '22'
|
|
125
|
+
cache: 'pnpm'
|
|
91
126
|
|
|
92
|
-
- name:
|
|
93
|
-
|
|
94
|
-
run: pnpm test:cache-components
|
|
127
|
+
- name: Install dependencies
|
|
128
|
+
run: pnpm install --ignore-scripts
|
|
95
129
|
|
|
96
|
-
- name:
|
|
97
|
-
|
|
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:
|
|
101
|
-
|
|
102
|
-
|
|
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:
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
|
|
154
|
+
SKIP_BUILD: true
|
|
109
155
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
-
|
|
115
|
-
|
|
169
|
+
node-version: '22'
|
|
170
|
+
cache: 'pnpm'
|
|
116
171
|
|
|
117
|
-
- name:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
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
|
-
|
|
128
|
-
|
|
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:
|
|
146
|
-
run: pnpm
|
|
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
|
|
164
|
-
run: cd test/
|
|
288
|
+
- name: Install test project
|
|
289
|
+
run: cd test/nextjs-test-projects/${{ matrix.cache-components-app }} && pnpm install
|
|
165
290
|
|
|
166
|
-
- name: Build
|
|
167
|
-
run: cd test/
|
|
291
|
+
- name: Build test project
|
|
292
|
+
run: cd test/nextjs-test-projects/${{ matrix.cache-components-app }} && pnpm build
|
|
168
293
|
|
|
169
|
-
- name:
|
|
170
|
-
run: pnpm
|
|
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: ${{
|
|
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
|
|