Modules can bring their own pages, starting with products
add installs a module's pages after checking the project's routes, --no-pages leaves them out, and the new products module comes with a list and a product page.
What changed
Module pages:add installs the pages a module brings and lists their URLs. users, checkout-address and checkout-card bring no page and install as before.
products module: A product list with search, category, sorting and pagination in the URL, and a page for each product with a gallery, details and reviews. On Next.js and TanStack Start the server renders the first view, a missing product answers 404, and the title, description, Open Graph tags and JSON-LD come from the data.
add --no-pages: Installs the feature without its pages and prints the import line. A later add adds the pages that are missing.
Route check:add stops, writing nothing, when the project already has a route at one of the module's URLs. It reads the App Router and the Pages Router on Next.js and file routes on TanStack Start.
Route tree: On TanStack Start, add and remove regenerate src/routeTree.gen.ts.
shadcn components: A module can bring a shadcn/ui component no template has, card for products. add installs it only when the project lacks it and never overwrites one.
remove: Deletes the module's pages and the folders they leave empty. A page that differs from the module's is listed first and deleted only on a yes; with --yes it stays.
Next.js template: The root src/app/loading.tsx is gone.
Why
Module pages: A list and its product page link to each other, so the module needs URLs of its own. Before, add installed only the feature, and you or your agent wrote the page for your framework.
Route check: A module page next to a route that already answers the same URL leaves two routes for one address. add now refuses before it writes anything, and --no-pages keeps your own page.
Route tree: Without it, the typecheck failed right after add on TanStack Start, until the dev server or a build rewrote the file.
loading.tsx: A root loading.tsx streams every page, and a streamed response starts with status 200. With the file, a product that does not exist answered 200; without it, 404. The page's content also stayed in a hidden element until JavaScript ran.
Measured: With Lighthouse 12 (mobile) on production builds of the four templates, the products pages scored SEO 100 and CLS 0, and performance between 85 and 92.
Limits: We tested on macOS, not on Windows, and in a project created with 2.1.1, not with 2.0.0 or 2.1.0. products reads DummyJSON and its images load from there unresized. Add to cart and the favourite button only show a toast, since there is no cart module yet.
Adding the module: Run npx virastack add products in your project.
Next.js projects created before 2.2.0: Delete the root loading.tsx so a product that does not exist answers 404 instead of 200. The i18n template never had the file.