From d0f5c6e8222c4bdf1e8532d5e4ea843ba1e278e7 Mon Sep 17 00:00:00 2001
From: Eric Luce <37158449+eluce2@users.noreply.github.com>
Date: Wed, 19 Feb 2025 13:10:39 -0600
Subject: [PATCH 1/2] fix templates
---
.changeset/brave-eggs-reflect.md | 5 +++++
cli/package.json | 2 +-
cli/src/cli/add/page/index.ts | 7 +++++++
cli/template/nextjs/src/app/layout.tsx | 2 +-
config/templates.ts | 16 ++++++++++------
5 files changed, 24 insertions(+), 8 deletions(-)
create mode 100644 .changeset/brave-eggs-reflect.md
diff --git a/.changeset/brave-eggs-reflect.md b/.changeset/brave-eggs-reflect.md
new file mode 100644
index 00000000..97245f42
--- /dev/null
+++ b/.changeset/brave-eggs-reflect.md
@@ -0,0 +1,5 @@
+---
+"@proofgeist/kit": patch
+---
+
+Fix: post-install template functions not running
diff --git a/cli/package.json b/cli/package.json
index 4125d909..e7dfb263 100644
--- a/cli/package.json
+++ b/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@proofgeist/kit",
- "version": "0.1.2",
+ "version": "0.1.3",
"description": "Create web application with the ProofKit stack",
"license": "MIT",
"repository": {
diff --git a/cli/src/cli/add/page/index.ts b/cli/src/cli/add/page/index.ts
index 6f0a2a91..cd4cc680 100644
--- a/cli/src/cli/add/page/index.ts
+++ b/cli/src/cli/add/page/index.ts
@@ -1,6 +1,7 @@
import path from "path";
import * as p from "@clack/prompts";
import { nextjsTemplates, wvTemplates } from "@config/templates.js";
+import chalk from "chalk";
import { Command } from "commander";
import { capitalize } from "es-toolkit";
import fs from "fs-extra";
@@ -10,6 +11,7 @@ import { getExistingSchemas } from "~/generators/fmdapi.js";
import { addRouteToNav } from "~/generators/route.js";
import { ciOption, debugOption } from "~/globalOptions.js";
import { initProgramState, state } from "~/state.js";
+import { getUserPkgManager } from "~/utils/getUserPkgManager.js";
import {
getSettings,
mergeSettings,
@@ -178,6 +180,11 @@ export const runAddPageAction = async (opts?: {
}
spinner.stop("Added page!");
+ const pkgManager = getUserPkgManager();
+
+ console.log(
+ `\n${chalk.green("Next steps:")}\nTo preview this page, restart your dev server using the ${chalk.cyan(`${pkgManager} dev`)} command\n`
+ );
};
export const makeAddPageCommand = () => {
diff --git a/cli/template/nextjs/src/app/layout.tsx b/cli/template/nextjs/src/app/layout.tsx
index 05435627..2b4efe54 100644
--- a/cli/template/nextjs/src/app/layout.tsx
+++ b/cli/template/nextjs/src/app/layout.tsx
@@ -28,7 +28,7 @@ export default function RootLayout({