Skip to content

Conversation

@KajSzy
Copy link
Contributor

@KajSzy KajSzy commented Nov 16, 2025

Add Turborepo + migrate to pnpm

This PR modernizes the project infrastructure by introducing Turborepo and pnpm to manage the monorepo.
This should help developing support for next v16 where this package will have to support multiple differently setup projects
(like with "use cache" directive, without it, pages router and app router etc)
pnpm allow to scale this project with turbo repo more easily while not introducing any breaking changes to final output

What Changed

  • Added Turborepo for task orchestration
  • Migrated to pnpm as the package manager
  • Created pnpm-workspace.yaml to manage packages and examples
  • Updated scripts to use Turbo commands (build, dev, lint, test)
  • Added turbo.json with caching configuration

@AyronK AyronK self-requested a review November 16, 2025 19:28
@AyronK
Copy link
Collaborator

AyronK commented Nov 16, 2025

Love it, I'll take a look and give it a try soon!

Copy link
Collaborator

@AyronK AyronK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KajSzy great work, I test it locally and runs smoothly. One thing is that the github workflows fail, please take a look.

@AyronK
Copy link
Collaborator

AyronK commented Nov 19, 2025

@KajSzy more CI issues I see (CACError: Unknown option --ifPresent):

Run pnpm run build --if-present

> @fortedigital/nextjs-cache-handler@2.3.0 build /home/runner/work/nextjs-cache-handler/nextjs-cache-handler/packages/nextjs-cache-handler
> tsup --dts-resolve --if-present

CACError: Unknown option `--ifPresent`
    at Command.checkUnknownOptions (/home/runner/work/nextjs-cache-handler/nextjs-cache-handler/node_modules/.pnpm/cac@6.7.14/node_modules/cac/dist/index.js:404:17)
    at CAC.runMatchedCommand (/home/runner/work/nextjs-cache-handler/nextjs-cache-handler/node_modules/.pnpm/cac@6.7.14/node_modules/cac/dist/index.js:602:13)
    at main (/home/runner/work/nextjs-cache-handler/nextjs-cache-handler/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_typescript@5.9.3/node_modules/tsup/dist/chunk-DI5BO6XE.js:148:13)
    at Object.<anonymous> (/home/runner/work/nextjs-cache-handler/nextjs-cache-handler/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_typescript@5.9.3/node_modules/tsup/dist/cli-default.js:12:23)
    at Module._compile (node:internal/modules/cjs/loader:1706:14)
    at Object..js (node:internal/modules/cjs/loader:1839:10)
    at Module.load (node:internal/modules/cjs/loader:1441:32)
    at Function._load (node:internal/modules/cjs/loader:1263:12)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
 ELIFECYCLE  Command failed with exit code 1.
Error: Process completed with exit code 1.

@AyronK
Copy link
Collaborator

AyronK commented Nov 19, 2025

Thanks @KajSzy, I'll take a look at the pipelines after merge and perhaps I'll move it to pnpm correctly.

@AyronK AyronK merged commit 78839c3 into fortedigital:master Nov 19, 2025
1 check passed
@KajSzy
Copy link
Contributor Author

KajSzy commented Nov 19, 2025

Thanks @KajSzy, I'll take a look at the pipelines after merge and perhaps I'll move it to pnpm correctly.

There is little to no difference between running build with npm run build or pnpm run build
Most important command is installing those deps using pnpm which is working
I've also started working on creating two nextjs project under examples folder using next v16
https://github.com/KajSzy/nextjs-cache-handler/tree/next16-examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants