npm @ottofeller/templates 1.8.0
v1.8.0

latest releases: 1.10.8, 1.10.7, 1.10.6...
15 months ago

What's Changed

Nextjs template migration guide

The following changes are made:

  1. tsconfig is extended with next plugin and .next/types/**/*.ts are included into the TS project;
  2. app folder is added to the content in tailwind config;
  3. lintPaths are changed from pages folder to app folder;
  4. sample code for pages router is removed and added app folder.

All new projects are generated with the app router.

For existing projects with pages router the first two items should not have any detrimental effect. Items 3 and 4 would interfere with the pages router and thus need a little effort in case of pages or mixed pages/app router projects.
In order to maintain compatibility with pages router while adopting app router do the following:

  • rewrite lintPaths option to ['.projenrc.ts', 'pages', 'app', 'src'];
  • resolve issues with the index page (the new sample code includes an app router based index page and thus it would conflict with the existing pages router index page - only one instance of every page is allowed and thus nextjs would complain);
  • follow the nextjs documentation on migration;
  • after completing the migration fall back to default lintPaths in order to remove the pages folder from the array.

In order to opt out from app router:

  • disable sample code generation with sampleCode: false option;
  • rewrite lintPaths option to ['.projenrc.ts', 'pages', 'src'].

Full Changelog: v1.7.4...v1.8.0

Don't miss a new templates release

NewReleases is sending notifications on new releases.