create-koori-app 1.0.0

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.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,100 @@
1
+ #!/usr/bin/env node
2
+ import { execSync } from "node:child_process";
3
+ import { cpSync, mkdirSync, readFileSync, writeFileSync, existsSync } from "node:fs";
4
+ import { join, resolve } from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+ import prompts from "prompts";
7
+ import kleur from "kleur";
8
+ const __dirname = fileURLToPath(new URL(".", import.meta.url));
9
+ const TEMPLATE_DIR = resolve(__dirname, "../template");
10
+ async function main() {
11
+ console.log();
12
+ console.log(kleur.bold().cyan(" ✦ create-koori-app"));
13
+ console.log(kleur.dim(" Glassmorphism UI starter powered by Koori UI + Next.js\n"));
14
+ const args = process.argv.slice(2);
15
+ let projectName = args[0]?.trim();
16
+ if (!projectName) {
17
+ const res = await prompts({
18
+ type: "text",
19
+ name: "projectName",
20
+ message: "Project name:",
21
+ initial: "my-koori-app",
22
+ });
23
+ if (!res.projectName) {
24
+ console.log(kleur.red(" Cancelled."));
25
+ process.exit(1);
26
+ }
27
+ projectName = res.projectName.trim();
28
+ }
29
+ const { defaultTheme } = await prompts({
30
+ type: "select",
31
+ name: "defaultTheme",
32
+ message: "Default theme:",
33
+ choices: [
34
+ { title: "Dark", value: "dark" },
35
+ { title: "Light", value: "light" },
36
+ { title: "System (follows OS)", value: "system" },
37
+ ],
38
+ initial: 0,
39
+ });
40
+ const { packageManager } = await prompts({
41
+ type: "select",
42
+ name: "packageManager",
43
+ message: "Package manager:",
44
+ choices: [
45
+ { title: "npm", value: "npm" },
46
+ { title: "pnpm", value: "pnpm" },
47
+ { title: "yarn", value: "yarn" },
48
+ { title: "bun", value: "bun" },
49
+ ],
50
+ initial: 0,
51
+ });
52
+ const targetDir = resolve(process.cwd(), projectName);
53
+ if (existsSync(targetDir)) {
54
+ const { overwrite } = await prompts({
55
+ type: "confirm",
56
+ name: "overwrite",
57
+ message: `Directory "${projectName}" already exists. Overwrite?`,
58
+ initial: false,
59
+ });
60
+ if (!overwrite) {
61
+ console.log(kleur.red(" Cancelled."));
62
+ process.exit(1);
63
+ }
64
+ }
65
+ console.log();
66
+ console.log(kleur.dim(` Creating ${projectName}...`));
67
+ mkdirSync(targetDir, { recursive: true });
68
+ cpSync(TEMPLATE_DIR, targetDir, { recursive: true });
69
+ /* Patch package.json with project name */
70
+ const pkgPath = join(targetDir, "package.json");
71
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
72
+ pkg.name = projectName;
73
+ writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
74
+ /* Patch layout.tsx with chosen default theme */
75
+ const layoutPath = join(targetDir, "app", "layout.tsx");
76
+ let layout = readFileSync(layoutPath, "utf-8");
77
+ layout = layout.replace('defaultTheme="dark"', `defaultTheme="${defaultTheme}"`);
78
+ writeFileSync(layoutPath, layout);
79
+ /* Install deps */
80
+ const installCmd = packageManager === "yarn" ? "yarn" : `${packageManager} install`;
81
+ console.log(kleur.dim(` Installing dependencies with ${packageManager}...\n`));
82
+ try {
83
+ execSync(installCmd, { cwd: targetDir, stdio: "inherit" });
84
+ }
85
+ catch {
86
+ console.log(kleur.yellow("\n Install failed — run it manually inside the project folder."));
87
+ }
88
+ console.log();
89
+ console.log(kleur.green(" ✓ Done!\n"));
90
+ console.log(` ${kleur.bold("Get started:")}`);
91
+ console.log(` ${kleur.cyan(`cd ${projectName}`)}`);
92
+ console.log(` ${kleur.cyan(`${packageManager === "npm" ? "npm run" : packageManager} dev`)}`);
93
+ console.log();
94
+ console.log(` ${kleur.dim("Docs: https://koori-ui.dev")}`);
95
+ console.log();
96
+ }
97
+ main().catch((err) => {
98
+ console.error(kleur.red(" Error: " + err.message));
99
+ process.exit(1);
100
+ });
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "create-koori-app",
3
+ "version": "1.0.0",
4
+ "description": "Create a new Koori UI project with one command",
5
+ "type": "module",
6
+ "bin": {
7
+ "create-koori-app": "./dist/index.js"
8
+ },
9
+ "scripts": {
10
+ "build": "tsc",
11
+ "dev": "tsc --watch",
12
+ "start": "node dist/index.js"
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "template"
17
+ ],
18
+ "keywords": ["koori-ui", "glassmorphism", "react", "nextjs", "create-app"],
19
+ "license": "MIT",
20
+ "dependencies": {
21
+ "kleur": "^4.1.5",
22
+ "prompts": "^2.4.2"
23
+ },
24
+ "devDependencies": {
25
+ "@types/node": "^22",
26
+ "@types/prompts": "^2.4.9",
27
+ "typescript": "^5.7.0"
28
+ }
29
+ }
@@ -0,0 +1 @@
1
+ @import "koori-ui/styles.css";
@@ -0,0 +1,24 @@
1
+ import type { Metadata } from "next";
2
+ import "./globals.css";
3
+ import { KooriProvider } from "koori-ui";
4
+
5
+ export const metadata: Metadata = {
6
+ title: "My Koori App",
7
+ description: "Built with Koori UI glassmorphism components",
8
+ };
9
+
10
+ export default function RootLayout({
11
+ children,
12
+ }: {
13
+ children: React.ReactNode;
14
+ }) {
15
+ return (
16
+ <html lang="en" suppressHydrationWarning>
17
+ <body className="min-h-screen antialiased">
18
+ <KooriProvider defaultTheme="dark">
19
+ {children}
20
+ </KooriProvider>
21
+ </body>
22
+ </html>
23
+ );
24
+ }
@@ -0,0 +1,55 @@
1
+ "use client";
2
+
3
+ import {
4
+ GlassCard,
5
+ GlassCardHeader,
6
+ GlassCardBody,
7
+ GlassCardFooter,
8
+ GlassButton,
9
+ GlassH1,
10
+ GlassText,
11
+ GlassBadge,
12
+ useKooriTheme,
13
+ } from "koori-ui";
14
+
15
+ export default function Home() {
16
+ const { theme, setTheme } = useKooriTheme();
17
+
18
+ return (
19
+ <main className="flex min-h-screen items-center justify-center p-8">
20
+ {/* Background effects */}
21
+ <div className="ambient-orb ambient-orb--one" />
22
+ <div className="ambient-orb ambient-orb--two" />
23
+
24
+ <GlassCard variant="elevated" className="w-full max-w-md">
25
+ <GlassCardHeader>
26
+ <div className="flex items-center justify-between">
27
+ <GlassBadge variant="primary">Koori UI</GlassBadge>
28
+ <GlassButton
29
+ size="sm"
30
+ onClick={() => setTheme(theme === "dark" ? "light" : "dark")}
31
+ >
32
+ {theme === "dark" ? "☀️ Light" : "🌙 Dark"}
33
+ </GlassButton>
34
+ </div>
35
+ <GlassH1 className="mt-4 text-2xl">Welcome to Koori UI</GlassH1>
36
+ </GlassCardHeader>
37
+ <GlassCardBody>
38
+ <GlassText muted>
39
+ You&apos;re running a glassmorphism React app. Edit{" "}
40
+ <code className="text-[var(--koori-primary)] text-sm">app/page.tsx</code>{" "}
41
+ to get started.
42
+ </GlassText>
43
+ </GlassCardBody>
44
+ <GlassCardFooter className="flex gap-2">
45
+ <GlassButton variant="primary" className="flex-1">
46
+ Get Started
47
+ </GlassButton>
48
+ <GlassButton className="flex-1">
49
+ View Docs
50
+ </GlassButton>
51
+ </GlassCardFooter>
52
+ </GlassCard>
53
+ </main>
54
+ );
55
+ }
@@ -0,0 +1,5 @@
1
+ import type { NextConfig } from "next";
2
+
3
+ const nextConfig: NextConfig = {};
4
+
5
+ export default nextConfig;
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "my-koori-app",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "dev": "next dev --turbo",
7
+ "build": "next build",
8
+ "start": "next start",
9
+ "typecheck": "tsc --noEmit"
10
+ },
11
+ "dependencies": {
12
+ "koori-ui": "latest",
13
+ "next": "^15",
14
+ "react": "^19",
15
+ "react-dom": "^19",
16
+ "lucide-react": "^1.7.0"
17
+ },
18
+ "devDependencies": {
19
+ "@types/node": "^22",
20
+ "@types/react": "^19",
21
+ "@types/react-dom": "^19",
22
+ "typescript": "^5.7.0"
23
+ }
24
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2017",
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "allowJs": true,
6
+ "skipLibCheck": true,
7
+ "strict": true,
8
+ "noEmit": true,
9
+ "esModuleInterop": true,
10
+ "module": "esnext",
11
+ "moduleResolution": "bundler",
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "jsx": "preserve",
15
+ "incremental": true,
16
+ "plugins": [{ "name": "next" }],
17
+ "paths": { "@/*": ["./*"] }
18
+ },
19
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
20
+ "exclude": ["node_modules"]
21
+ }