@getcoherent/cli 0.3.6 → 0.3.8
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/dist/index.js +31 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2368,6 +2368,7 @@ export default config
|
|
|
2368
2368
|
await writeFile(join5(projectPath, "postcss.config.mjs"), postcssContent);
|
|
2369
2369
|
}
|
|
2370
2370
|
await scaffolder.generateRootLayout();
|
|
2371
|
+
await configureNextImages(projectPath);
|
|
2371
2372
|
const welcomeMarkdown = getWelcomeMarkdown();
|
|
2372
2373
|
const homePageContent = generateWelcomeComponent(welcomeMarkdown);
|
|
2373
2374
|
await writeFile(join5(projectPath, "app", "page.tsx"), homePageContent);
|
|
@@ -2421,6 +2422,31 @@ export default config
|
|
|
2421
2422
|
process.exit(1);
|
|
2422
2423
|
}
|
|
2423
2424
|
}
|
|
2425
|
+
async function configureNextImages(projectPath) {
|
|
2426
|
+
const tsPath = join5(projectPath, "next.config.ts");
|
|
2427
|
+
const jsPath = join5(projectPath, "next.config.js");
|
|
2428
|
+
const mjsPath = join5(projectPath, "next.config.mjs");
|
|
2429
|
+
let configPath = "";
|
|
2430
|
+
if (existsSync8(tsPath)) configPath = tsPath;
|
|
2431
|
+
else if (existsSync8(mjsPath)) configPath = mjsPath;
|
|
2432
|
+
else if (existsSync8(jsPath)) configPath = jsPath;
|
|
2433
|
+
else return;
|
|
2434
|
+
const content = `import type { NextConfig } from "next";
|
|
2435
|
+
|
|
2436
|
+
const nextConfig: NextConfig = {
|
|
2437
|
+
images: {
|
|
2438
|
+
remotePatterns: [
|
|
2439
|
+
{ protocol: "https", hostname: "i.pravatar.cc" },
|
|
2440
|
+
{ protocol: "https", hostname: "images.unsplash.com" },
|
|
2441
|
+
{ protocol: "https", hostname: "picsum.photos" },
|
|
2442
|
+
],
|
|
2443
|
+
},
|
|
2444
|
+
};
|
|
2445
|
+
|
|
2446
|
+
export default nextConfig;
|
|
2447
|
+
`;
|
|
2448
|
+
await writeFile(configPath, content);
|
|
2449
|
+
}
|
|
2424
2450
|
|
|
2425
2451
|
// src/commands/chat.ts
|
|
2426
2452
|
import chalk13 from "chalk";
|
|
@@ -4507,6 +4533,7 @@ pageCode rules (shadcn/ui blocks quality):
|
|
|
4507
4533
|
- Login/form pattern: outer div(flex min-h-svh flex-col items-center justify-center p-6 md:p-10) > inner div(w-full max-w-sm) > Card with form.
|
|
4508
4534
|
- Dashboard pattern: main(mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 py-6 flex flex-1 flex-col gap-4) > page header(h1 text-2xl font-bold tracking-tight + p text-sm text-muted-foreground) > stats grid(grid gap-4 md:grid-cols-2 lg:grid-cols-4) > content cards.
|
|
4509
4535
|
- No placeholders: real contextual copy only. Use the EXACT text, language, and content from the user's request.
|
|
4536
|
+
- IMAGES: For avatar/profile photos, use https://i.pravatar.cc/150?u=<unique-seed> (e.g. ?u=sarah.johnson). For hero/product images, use https://picsum.photos/800/400?random=N. Use standard <img> tags with className, NOT Next.js <Image>. Always provide alt text.
|
|
4510
4537
|
- Hover/focus on every interactive element (hover:bg-muted, focus-visible:ring-2 focus-visible:ring-ring).
|
|
4511
4538
|
- LANGUAGE: Match the language of the user's request. English request \u2192 English page. Russian request \u2192 Russian page. Never switch languages.
|
|
4512
4539
|
|
|
@@ -6733,7 +6760,8 @@ async function regenerateLayout(config2, projectRoot) {
|
|
|
6733
6760
|
type: "layout",
|
|
6734
6761
|
code: headerCode,
|
|
6735
6762
|
description: "Main site header with navigation and theme toggle",
|
|
6736
|
-
usedIn: ["app/layout.tsx"]
|
|
6763
|
+
usedIn: ["app/layout.tsx"],
|
|
6764
|
+
overwrite: true
|
|
6737
6765
|
});
|
|
6738
6766
|
if (!hasSharedFooter) {
|
|
6739
6767
|
const footerCode = generator.generateSharedFooterCode();
|
|
@@ -6742,7 +6770,8 @@ async function regenerateLayout(config2, projectRoot) {
|
|
|
6742
6770
|
type: "layout",
|
|
6743
6771
|
code: footerCode,
|
|
6744
6772
|
description: "Site footer",
|
|
6745
|
-
usedIn: ["app/layout.tsx"]
|
|
6773
|
+
usedIn: ["app/layout.tsx"],
|
|
6774
|
+
overwrite: true
|
|
6746
6775
|
});
|
|
6747
6776
|
}
|
|
6748
6777
|
}
|