@craftzbay/create-app 1.0.0 → 1.0.2
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/LICENSE +21 -0
- package/README.md +4 -4
- package/dist/index.js +7 -12
- package/package.json +10 -11
- package/templates/vite-blank/_package.json +1 -1
- package/templates/vite-blank/index.html +6 -0
- package/templates/vite-dashboard/_package.json +1 -1
- package/templates/vite-dashboard/index.html +6 -0
- package/templates/vite-dashboard/src/App.tsx +185 -11
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 craftzbay
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ npm create @craftzbay/app my-app -- --template vite-dashboard
|
|
|
43
43
|
|
|
44
44
|
## Docs
|
|
45
45
|
|
|
46
|
-
- Showcase: <https://
|
|
47
|
-
- Components: <https://
|
|
48
|
-
- Templates: <https://
|
|
49
|
-
- Guides: <https://
|
|
46
|
+
- Showcase: <https://components.runestonetechnologies.com>
|
|
47
|
+
- Components: <https://components.runestonetechnologies.com/#components>
|
|
48
|
+
- Templates: <https://components.runestonetechnologies.com/#templates>
|
|
49
|
+
- Guides: <https://components.runestonetechnologies.com/#guides>
|
package/dist/index.js
CHANGED
|
@@ -5,22 +5,17 @@ import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSy
|
|
|
5
5
|
import path from "path";
|
|
6
6
|
import { fileURLToPath } from "url";
|
|
7
7
|
import { spawnSync } from "child_process";
|
|
8
|
-
import {
|
|
9
|
-
cancel,
|
|
10
|
-
confirm,
|
|
11
|
-
intro,
|
|
12
|
-
isCancel,
|
|
13
|
-
log,
|
|
14
|
-
outro,
|
|
15
|
-
select,
|
|
16
|
-
text
|
|
17
|
-
} from "@clack/prompts";
|
|
8
|
+
import { cancel, confirm, intro, isCancel, log, outro, select, text } from "@clack/prompts";
|
|
18
9
|
import kleur from "kleur";
|
|
19
10
|
var __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
20
11
|
var TEMPLATES_DIR = path.resolve(__dirname, "../templates");
|
|
21
12
|
var TEMPLATES = [
|
|
22
13
|
{ id: "vite-blank", label: "Vite + Blank", hint: "Minimal Vite + React + @craftzbay/ui starter" },
|
|
23
|
-
{
|
|
14
|
+
{
|
|
15
|
+
id: "vite-dashboard",
|
|
16
|
+
label: "Vite + Dashboard",
|
|
17
|
+
hint: "Sidebar + TopNav dashboard shell, ready to wire data"
|
|
18
|
+
}
|
|
24
19
|
];
|
|
25
20
|
function detectPackageManager() {
|
|
26
21
|
const ua = process.env.npm_config_user_agent ?? "";
|
|
@@ -197,7 +192,7 @@ async function run() {
|
|
|
197
192
|
...installNow ? [] : [` ${kleur.cyan(`${pm} install`)}`],
|
|
198
193
|
` ${kleur.cyan(`${pm} run dev`)}`,
|
|
199
194
|
"",
|
|
200
|
-
kleur.gray(" Docs: https://
|
|
195
|
+
kleur.gray(" Docs: https://components.runestonetechnologies.com")
|
|
201
196
|
].join("\n")
|
|
202
197
|
);
|
|
203
198
|
}
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@craftzbay/create-app",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Scaffold a new project preconfigured with @craftzbay/ui. Invoke via `npm create @craftzbay/app my-app`.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "craftzbay",
|
|
7
|
-
"homepage": "https://
|
|
7
|
+
"homepage": "https://components.runestonetechnologies.com",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "https://github.com/craftzbay/
|
|
10
|
+
"url": "https://github.com/craftzbay/craftzbay-ui.git",
|
|
11
11
|
"directory": "packages/create-app"
|
|
12
12
|
},
|
|
13
13
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/craftzbay/
|
|
14
|
+
"url": "https://github.com/craftzbay/craftzbay-ui/issues"
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"create-app",
|
|
@@ -33,12 +33,6 @@
|
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
|
-
"scripts": {
|
|
37
|
-
"build": "tsup src/index.ts --format esm --target node18 --out-dir dist --clean",
|
|
38
|
-
"dev": "tsup src/index.ts --format esm --target node18 --out-dir dist --watch",
|
|
39
|
-
"test": "pnpm build && node scripts/smoke.mjs",
|
|
40
|
-
"prepublishOnly": "pnpm build"
|
|
41
|
-
},
|
|
42
36
|
"dependencies": {
|
|
43
37
|
"@clack/prompts": "^0.8.2",
|
|
44
38
|
"kleur": "^4.1.5"
|
|
@@ -50,5 +44,10 @@
|
|
|
50
44
|
},
|
|
51
45
|
"engines": {
|
|
52
46
|
"node": ">=18"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "tsup src/index.ts --format esm --target node18 --out-dir dist --clean",
|
|
50
|
+
"dev": "tsup src/index.ts --format esm --target node18 --out-dir dist --watch",
|
|
51
|
+
"test": "pnpm build && node scripts/smoke.mjs"
|
|
53
52
|
}
|
|
54
|
-
}
|
|
53
|
+
}
|
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>__PROJECT_NAME__</title>
|
|
7
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
8
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
9
|
+
<link
|
|
10
|
+
href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500&display=swap"
|
|
11
|
+
rel="stylesheet"
|
|
12
|
+
/>
|
|
7
13
|
</head>
|
|
8
14
|
<body>
|
|
9
15
|
<div id="root"></div>
|
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>__PROJECT_NAME__</title>
|
|
7
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
8
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
9
|
+
<link
|
|
10
|
+
href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500&display=swap"
|
|
11
|
+
rel="stylesheet"
|
|
12
|
+
/>
|
|
7
13
|
</head>
|
|
8
14
|
<body>
|
|
9
15
|
<div id="root"></div>
|
|
@@ -1,26 +1,200 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Avatar,
|
|
4
|
+
Badge,
|
|
5
|
+
Button,
|
|
6
|
+
Card,
|
|
7
|
+
CardContent,
|
|
8
|
+
CardDescription,
|
|
9
|
+
CardHeader,
|
|
10
|
+
CardTitle,
|
|
11
|
+
EmptyState,
|
|
12
|
+
Icons,
|
|
13
|
+
Input,
|
|
14
|
+
Sidebar,
|
|
15
|
+
SidebarItem,
|
|
16
|
+
SidebarSection,
|
|
17
|
+
Table,
|
|
18
|
+
TableBody,
|
|
19
|
+
TableCell,
|
|
20
|
+
TableHead,
|
|
21
|
+
TableHeader,
|
|
22
|
+
TableRow,
|
|
23
|
+
Toaster,
|
|
24
|
+
TooltipProvider,
|
|
25
|
+
TopNav,
|
|
26
|
+
toast,
|
|
27
|
+
} from '@craftzbay/ui';
|
|
28
|
+
|
|
29
|
+
type NavKey = 'overview' | 'projects' | 'customers' | 'billing' | 'settings';
|
|
30
|
+
|
|
31
|
+
const stats = [
|
|
32
|
+
{ label: 'Revenue', value: '$48,200', delta: '+12.4%', tone: 'success' as const },
|
|
33
|
+
{ label: 'Active users', value: '2,310', delta: '+3.1%', tone: 'success' as const },
|
|
34
|
+
{ label: 'Open tickets', value: '14', delta: '-2', tone: 'neutral' as const },
|
|
35
|
+
{ label: 'Churn', value: '1.8%', delta: '+0.2%', tone: 'warning' as const },
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const orders = [
|
|
39
|
+
{ id: 'ORD-1042', customer: 'Alex Morgan', amount: '$1,200.00', status: 'Paid' },
|
|
40
|
+
{ id: 'ORD-1041', customer: 'Jamie Lee', amount: '$340.00', status: 'Pending' },
|
|
41
|
+
{ id: 'ORD-1040', customer: 'Sam Patel', amount: '$89.00', status: 'Failed' },
|
|
42
|
+
{ id: 'ORD-1039', customer: 'Riley Chen', amount: '$2,050.00', status: 'Paid' },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
const statusTone = { Paid: 'success', Pending: 'warning', Failed: 'danger' } as const;
|
|
2
46
|
|
|
3
47
|
const Brand = () => (
|
|
4
48
|
<span className="flex items-center gap-2 text-sm font-semibold">
|
|
5
|
-
<span className="inline-flex size-6 items-center justify-center rounded-md
|
|
6
|
-
|
|
49
|
+
<span className="bg-accent text-on-accent inline-flex size-6 items-center justify-center rounded-md text-xs">
|
|
50
|
+
<Icons.Zap className="size-3.5" />
|
|
7
51
|
</span>
|
|
8
52
|
__PROJECT_NAME__
|
|
9
53
|
</span>
|
|
10
54
|
);
|
|
11
55
|
|
|
12
56
|
export function App() {
|
|
57
|
+
const [active, setActive] = useState<NavKey>('overview');
|
|
58
|
+
|
|
13
59
|
return (
|
|
14
60
|
<TooltipProvider>
|
|
15
|
-
<
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
61
|
+
<div className="bg-background text-foreground flex min-h-screen">
|
|
62
|
+
<Sidebar header={<Brand />}>
|
|
63
|
+
<SidebarSection label="Workspace">
|
|
64
|
+
<SidebarItem
|
|
65
|
+
icon={<Icons.Home />}
|
|
66
|
+
active={active === 'overview'}
|
|
67
|
+
onClick={() => setActive('overview')}
|
|
68
|
+
>
|
|
69
|
+
Overview
|
|
70
|
+
</SidebarItem>
|
|
71
|
+
<SidebarItem
|
|
72
|
+
icon={<Icons.Folder />}
|
|
73
|
+
active={active === 'projects'}
|
|
74
|
+
onClick={() => setActive('projects')}
|
|
75
|
+
>
|
|
76
|
+
Projects
|
|
77
|
+
</SidebarItem>
|
|
78
|
+
<SidebarItem
|
|
79
|
+
icon={<Icons.Users />}
|
|
80
|
+
active={active === 'customers'}
|
|
81
|
+
onClick={() => setActive('customers')}
|
|
82
|
+
trailing={<Badge tone="accent">3</Badge>}
|
|
83
|
+
>
|
|
84
|
+
Customers
|
|
85
|
+
</SidebarItem>
|
|
86
|
+
</SidebarSection>
|
|
87
|
+
<SidebarSection label="Account">
|
|
88
|
+
<SidebarItem
|
|
89
|
+
icon={<Icons.CreditCard />}
|
|
90
|
+
active={active === 'billing'}
|
|
91
|
+
onClick={() => setActive('billing')}
|
|
92
|
+
>
|
|
93
|
+
Billing
|
|
94
|
+
</SidebarItem>
|
|
95
|
+
<SidebarItem
|
|
96
|
+
icon={<Icons.Settings />}
|
|
97
|
+
active={active === 'settings'}
|
|
98
|
+
onClick={() => setActive('settings')}
|
|
99
|
+
>
|
|
100
|
+
Settings
|
|
101
|
+
</SidebarItem>
|
|
102
|
+
</SidebarSection>
|
|
103
|
+
</Sidebar>
|
|
104
|
+
|
|
105
|
+
<div className="flex min-w-0 flex-1 flex-col">
|
|
106
|
+
<TopNav
|
|
107
|
+
logo={<span className="text-sm font-medium capitalize">{active}</span>}
|
|
108
|
+
search={<Input type="search" placeholder="Search…" aria-label="Search" />}
|
|
109
|
+
actions={
|
|
110
|
+
<>
|
|
111
|
+
<Button
|
|
112
|
+
variant="ghost"
|
|
113
|
+
size="sm"
|
|
114
|
+
aria-label="Notifications"
|
|
115
|
+
onClick={() => toast({ title: 'No new notifications' })}
|
|
116
|
+
>
|
|
117
|
+
<Icons.Bell />
|
|
118
|
+
</Button>
|
|
119
|
+
<Avatar fallback="AM" alt="Alex Morgan" size="sm" />
|
|
120
|
+
</>
|
|
121
|
+
}
|
|
20
122
|
/>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
123
|
+
|
|
124
|
+
<main className="flex flex-1 flex-col gap-6 p-6">
|
|
125
|
+
{active === 'overview' ? (
|
|
126
|
+
<>
|
|
127
|
+
<div className="flex items-center justify-between">
|
|
128
|
+
<div>
|
|
129
|
+
<h1 className="text-lg font-semibold">Overview</h1>
|
|
130
|
+
<p className="text-foreground-muted text-sm">
|
|
131
|
+
Replace this with your own data — every section is a primitive.
|
|
132
|
+
</p>
|
|
133
|
+
</div>
|
|
134
|
+
<Button onClick={() => toast({ title: 'Report queued', variant: 'success' })}>
|
|
135
|
+
<Icons.Download />
|
|
136
|
+
Export
|
|
137
|
+
</Button>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
<div className="grid gap-4 sm:grid-cols-2 xl:grid-cols-4">
|
|
141
|
+
{stats.map((s) => (
|
|
142
|
+
<Card key={s.label}>
|
|
143
|
+
<CardHeader>
|
|
144
|
+
<CardDescription>{s.label}</CardDescription>
|
|
145
|
+
<CardTitle className="text-2xl tabular-nums">{s.value}</CardTitle>
|
|
146
|
+
</CardHeader>
|
|
147
|
+
<CardContent>
|
|
148
|
+
<Badge tone={s.tone}>{s.delta}</Badge>
|
|
149
|
+
</CardContent>
|
|
150
|
+
</Card>
|
|
151
|
+
))}
|
|
152
|
+
</div>
|
|
153
|
+
|
|
154
|
+
<Card>
|
|
155
|
+
<CardHeader>
|
|
156
|
+
<CardTitle>Recent orders</CardTitle>
|
|
157
|
+
<CardDescription>Last 24 hours.</CardDescription>
|
|
158
|
+
</CardHeader>
|
|
159
|
+
<CardContent>
|
|
160
|
+
<Table>
|
|
161
|
+
<TableHeader>
|
|
162
|
+
<TableRow>
|
|
163
|
+
<TableHead>Order</TableHead>
|
|
164
|
+
<TableHead>Customer</TableHead>
|
|
165
|
+
<TableHead>Status</TableHead>
|
|
166
|
+
<TableHead className="text-right">Amount</TableHead>
|
|
167
|
+
</TableRow>
|
|
168
|
+
</TableHeader>
|
|
169
|
+
<TableBody>
|
|
170
|
+
{orders.map((o) => (
|
|
171
|
+
<TableRow key={o.id}>
|
|
172
|
+
<TableCell className="font-mono text-xs">{o.id}</TableCell>
|
|
173
|
+
<TableCell>{o.customer}</TableCell>
|
|
174
|
+
<TableCell>
|
|
175
|
+
<Badge tone={statusTone[o.status as keyof typeof statusTone]} dot>
|
|
176
|
+
{o.status}
|
|
177
|
+
</Badge>
|
|
178
|
+
</TableCell>
|
|
179
|
+
<TableCell className="text-right tabular-nums">{o.amount}</TableCell>
|
|
180
|
+
</TableRow>
|
|
181
|
+
))}
|
|
182
|
+
</TableBody>
|
|
183
|
+
</Table>
|
|
184
|
+
</CardContent>
|
|
185
|
+
</Card>
|
|
186
|
+
</>
|
|
187
|
+
) : (
|
|
188
|
+
<EmptyState
|
|
189
|
+
title={`Nothing in ${active} yet`}
|
|
190
|
+
description="This page is a placeholder — build it from @craftzbay/ui primitives."
|
|
191
|
+
action={<Button onClick={() => setActive('overview')}>Back to overview</Button>}
|
|
192
|
+
/>
|
|
193
|
+
)}
|
|
194
|
+
</main>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
<Toaster />
|
|
24
198
|
</TooltipProvider>
|
|
25
199
|
);
|
|
26
200
|
}
|