@shahadpichen/docpush 1.0.2 → 1.0.3
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/cli/commands/add.d.ts +5 -0
- package/dist/cli/commands/add.d.ts.map +1 -0
- package/dist/cli/commands/add.js +370 -0
- package/dist/cli/commands/add.js.map +1 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +7 -0
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/index.js +6 -0
- package/dist/cli/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/add.ts"],"names":[],"mappings":"AAmCA;;GAEG;AACH,wBAAsB,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA6HpE"}
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.addCommand = addCommand;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
10
|
+
// Component registry - maps component names to their source files
|
|
11
|
+
const COMPONENTS = {
|
|
12
|
+
// UI primitives
|
|
13
|
+
button: { files: ['button.tsx'], dependencies: ['utils'] },
|
|
14
|
+
input: { files: ['input.tsx'], dependencies: ['utils'] },
|
|
15
|
+
textarea: { files: ['textarea.tsx'], dependencies: ['utils'] },
|
|
16
|
+
badge: { files: ['badge.tsx'], dependencies: ['utils'] },
|
|
17
|
+
card: { files: ['card.tsx'], dependencies: ['utils'] },
|
|
18
|
+
'scroll-area': { files: ['scroll-area.tsx'], dependencies: ['utils'] },
|
|
19
|
+
// Feature components
|
|
20
|
+
'docs-sidebar': { files: ['docs-sidebar.tsx'], dependencies: ['utils', 'scroll-area'] },
|
|
21
|
+
'markdown-viewer': { files: ['markdown-viewer.tsx'], dependencies: ['utils'] },
|
|
22
|
+
'markdown-editor': {
|
|
23
|
+
files: ['markdown-editor.tsx'],
|
|
24
|
+
dependencies: ['utils', 'button', 'textarea'],
|
|
25
|
+
},
|
|
26
|
+
'comments-panel': {
|
|
27
|
+
files: ['comments-panel.tsx'],
|
|
28
|
+
dependencies: ['utils', 'button', 'card', 'scroll-area', 'textarea'],
|
|
29
|
+
},
|
|
30
|
+
'drafts-list': { files: ['drafts-list.tsx'], dependencies: ['utils', 'badge', 'button', 'card'] },
|
|
31
|
+
'search-bar': { files: ['search-bar.tsx'], dependencies: ['utils', 'input'] },
|
|
32
|
+
// Utilities
|
|
33
|
+
utils: { files: ['utils.ts'] },
|
|
34
|
+
};
|
|
35
|
+
// All available components
|
|
36
|
+
const ALL_COMPONENTS = Object.keys(COMPONENTS).filter((c) => c !== 'utils');
|
|
37
|
+
/**
|
|
38
|
+
* Add components to user's project
|
|
39
|
+
*/
|
|
40
|
+
async function addCommand(components) {
|
|
41
|
+
console.log(chalk_1.default.blue('📦 Adding DocPush components...\n'));
|
|
42
|
+
// Resolve all components including dependencies
|
|
43
|
+
const toInstall = new Set();
|
|
44
|
+
for (const comp of components) {
|
|
45
|
+
if (comp === 'all') {
|
|
46
|
+
ALL_COMPONENTS.forEach((c) => toInstall.add(c));
|
|
47
|
+
}
|
|
48
|
+
else if (COMPONENTS[comp]) {
|
|
49
|
+
toInstall.add(comp);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
console.log(chalk_1.default.yellow(`⚠ Unknown component: ${comp}`));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// Add dependencies
|
|
56
|
+
function addDeps(compName) {
|
|
57
|
+
const comp = COMPONENTS[compName];
|
|
58
|
+
if (comp?.dependencies) {
|
|
59
|
+
for (const dep of comp.dependencies) {
|
|
60
|
+
if (!toInstall.has(dep)) {
|
|
61
|
+
toInstall.add(dep);
|
|
62
|
+
addDeps(dep);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
toInstall.forEach((c) => addDeps(c));
|
|
68
|
+
if (toInstall.size === 0) {
|
|
69
|
+
console.log(chalk_1.default.yellow('No valid components specified.'));
|
|
70
|
+
console.log('Available components:', ALL_COMPONENTS.join(', '));
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
// Load config to get custom paths (if docs.config.js exists)
|
|
74
|
+
let uiDir = './src/components/ui';
|
|
75
|
+
let libDir = './src/lib';
|
|
76
|
+
let aliasPrefix = '@';
|
|
77
|
+
try {
|
|
78
|
+
const configPath = node_path_1.default.resolve('./docs.config.js');
|
|
79
|
+
if (await fs_extra_1.default.pathExists(configPath)) {
|
|
80
|
+
// biome-ignore lint/security/noGlobalEval: config file loading
|
|
81
|
+
const config = eval(`require('${configPath}')`);
|
|
82
|
+
if (config.components?.uiPath) {
|
|
83
|
+
uiDir = config.components.uiPath;
|
|
84
|
+
}
|
|
85
|
+
if (config.components?.libPath) {
|
|
86
|
+
libDir = config.components.libPath;
|
|
87
|
+
}
|
|
88
|
+
if (config.components?.aliasPrefix) {
|
|
89
|
+
aliasPrefix = config.components.aliasPrefix;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch (e) {
|
|
94
|
+
// Config doesn't exist or has errors, use defaults
|
|
95
|
+
}
|
|
96
|
+
console.log(chalk_1.default.gray(`📁 UI components: ${uiDir}`));
|
|
97
|
+
console.log(chalk_1.default.gray(`📁 Utilities: ${libDir}\n`));
|
|
98
|
+
await fs_extra_1.default.ensureDir(uiDir);
|
|
99
|
+
await fs_extra_1.default.ensureDir(libDir);
|
|
100
|
+
// Find package location
|
|
101
|
+
const packageDir = node_path_1.default.dirname(require.resolve('@shahadpichen/docpush/package.json'));
|
|
102
|
+
const reactSrcDir = node_path_1.default.join(packageDir, 'dist', 'react');
|
|
103
|
+
// Copy components
|
|
104
|
+
for (const compName of toInstall) {
|
|
105
|
+
const comp = COMPONENTS[compName];
|
|
106
|
+
for (const file of comp.files) {
|
|
107
|
+
let srcPath;
|
|
108
|
+
let destPath;
|
|
109
|
+
if (compName === 'utils') {
|
|
110
|
+
// Utils go to src/lib
|
|
111
|
+
srcPath = node_path_1.default.join(reactSrcDir, 'lib', file.replace('.ts', '.js'));
|
|
112
|
+
destPath = node_path_1.default.join(libDir, file);
|
|
113
|
+
// Write TypeScript source instead of compiled
|
|
114
|
+
const tsContent = `import { clsx, type ClassValue } from 'clsx';
|
|
115
|
+
import { twMerge } from 'tailwind-merge';
|
|
116
|
+
|
|
117
|
+
export function cn(...inputs: ClassValue[]) {
|
|
118
|
+
return twMerge(clsx(inputs));
|
|
119
|
+
}
|
|
120
|
+
`;
|
|
121
|
+
await fs_extra_1.default.writeFile(destPath, tsContent);
|
|
122
|
+
console.log(chalk_1.default.green('✓'), `Created ${destPath}`);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
// Determine source path based on component type
|
|
126
|
+
const isUiComponent = [
|
|
127
|
+
'button',
|
|
128
|
+
'input',
|
|
129
|
+
'textarea',
|
|
130
|
+
'badge',
|
|
131
|
+
'card',
|
|
132
|
+
'scroll-area',
|
|
133
|
+
].includes(compName);
|
|
134
|
+
const srcSubdir = isUiComponent ? 'components/ui' : 'components';
|
|
135
|
+
// Get component template from package
|
|
136
|
+
const template = getComponentTemplate(compName);
|
|
137
|
+
destPath = node_path_1.default.join(uiDir, file);
|
|
138
|
+
await fs_extra_1.default.writeFile(destPath, template);
|
|
139
|
+
console.log(chalk_1.default.green('✓'), `Created ${destPath}`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
console.log(chalk_1.default.blue('\n✨ Components added successfully!'));
|
|
144
|
+
console.log(chalk_1.default.gray('\nImport from:'));
|
|
145
|
+
console.log(chalk_1.default.gray(" import { Button } from '@/components/ui/button';"));
|
|
146
|
+
console.log(chalk_1.default.gray(" import { cn } from '@/lib/utils';"));
|
|
147
|
+
// Check for required dependencies
|
|
148
|
+
console.log(chalk_1.default.blue('\n📋 Required dependencies:'));
|
|
149
|
+
console.log(' npm install clsx tailwind-merge class-variance-authority');
|
|
150
|
+
console.log(' npm install @radix-ui/react-scroll-area @radix-ui/react-slot');
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Get component TypeScript template
|
|
154
|
+
*/
|
|
155
|
+
function getComponentTemplate(name) {
|
|
156
|
+
const templates = {
|
|
157
|
+
button: `import * as React from 'react';
|
|
158
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
159
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
160
|
+
import { cn } from '@/lib/utils';
|
|
161
|
+
|
|
162
|
+
const buttonVariants = cva(
|
|
163
|
+
'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
|
|
164
|
+
{
|
|
165
|
+
variants: {
|
|
166
|
+
variant: {
|
|
167
|
+
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
168
|
+
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
|
|
169
|
+
outline: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
|
|
170
|
+
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
171
|
+
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
172
|
+
link: 'text-primary underline-offset-4 hover:underline',
|
|
173
|
+
},
|
|
174
|
+
size: {
|
|
175
|
+
default: 'h-10 px-4 py-2',
|
|
176
|
+
sm: 'h-9 rounded-md px-3',
|
|
177
|
+
lg: 'h-11 rounded-md px-8',
|
|
178
|
+
icon: 'h-10 w-10',
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
defaultVariants: {
|
|
182
|
+
variant: 'default',
|
|
183
|
+
size: 'default',
|
|
184
|
+
},
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
|
|
188
|
+
export interface ButtonProps
|
|
189
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
190
|
+
VariantProps<typeof buttonVariants> {
|
|
191
|
+
asChild?: boolean;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
195
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
196
|
+
const Comp = asChild ? Slot : 'button';
|
|
197
|
+
return <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />;
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
Button.displayName = 'Button';
|
|
201
|
+
|
|
202
|
+
export { Button, buttonVariants };
|
|
203
|
+
`,
|
|
204
|
+
input: `import * as React from 'react';
|
|
205
|
+
import { cn } from '@/lib/utils';
|
|
206
|
+
|
|
207
|
+
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {}
|
|
208
|
+
|
|
209
|
+
const Input = React.forwardRef<HTMLInputElement, InputProps>(({ className, type, ...props }, ref) => {
|
|
210
|
+
return (
|
|
211
|
+
<input
|
|
212
|
+
type={type}
|
|
213
|
+
className={cn(
|
|
214
|
+
'flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
|
|
215
|
+
className
|
|
216
|
+
)}
|
|
217
|
+
ref={ref}
|
|
218
|
+
{...props}
|
|
219
|
+
/>
|
|
220
|
+
);
|
|
221
|
+
});
|
|
222
|
+
Input.displayName = 'Input';
|
|
223
|
+
|
|
224
|
+
export { Input };
|
|
225
|
+
`,
|
|
226
|
+
textarea: `import * as React from 'react';
|
|
227
|
+
import { cn } from '@/lib/utils';
|
|
228
|
+
|
|
229
|
+
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
|
|
230
|
+
|
|
231
|
+
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(({ className, ...props }, ref) => {
|
|
232
|
+
return (
|
|
233
|
+
<textarea
|
|
234
|
+
className={cn(
|
|
235
|
+
'flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
|
|
236
|
+
className
|
|
237
|
+
)}
|
|
238
|
+
ref={ref}
|
|
239
|
+
{...props}
|
|
240
|
+
/>
|
|
241
|
+
);
|
|
242
|
+
});
|
|
243
|
+
Textarea.displayName = 'Textarea';
|
|
244
|
+
|
|
245
|
+
export { Textarea };
|
|
246
|
+
`,
|
|
247
|
+
badge: `import * as React from 'react';
|
|
248
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
249
|
+
import { cn } from '@/lib/utils';
|
|
250
|
+
|
|
251
|
+
const badgeVariants = cva(
|
|
252
|
+
'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
|
|
253
|
+
{
|
|
254
|
+
variants: {
|
|
255
|
+
variant: {
|
|
256
|
+
default: 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',
|
|
257
|
+
secondary: 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
258
|
+
destructive: 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',
|
|
259
|
+
outline: 'text-foreground',
|
|
260
|
+
draft: 'border-transparent bg-yellow-100 text-yellow-800',
|
|
261
|
+
pending: 'border-transparent bg-blue-100 text-blue-800',
|
|
262
|
+
approved: 'border-transparent bg-green-100 text-green-800',
|
|
263
|
+
rejected: 'border-transparent bg-red-100 text-red-800',
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
defaultVariants: {
|
|
267
|
+
variant: 'default',
|
|
268
|
+
},
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
|
|
272
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
|
|
273
|
+
|
|
274
|
+
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
275
|
+
return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export { Badge, badgeVariants };
|
|
279
|
+
`,
|
|
280
|
+
card: `import * as React from 'react';
|
|
281
|
+
import { cn } from '@/lib/utils';
|
|
282
|
+
|
|
283
|
+
const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
284
|
+
({ className, ...props }, ref) => (
|
|
285
|
+
<div ref={ref} className={cn('rounded-lg border bg-card text-card-foreground shadow-sm', className)} {...props} />
|
|
286
|
+
)
|
|
287
|
+
);
|
|
288
|
+
Card.displayName = 'Card';
|
|
289
|
+
|
|
290
|
+
const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
291
|
+
({ className, ...props }, ref) => (
|
|
292
|
+
<div ref={ref} className={cn('flex flex-col space-y-1.5 p-6', className)} {...props} />
|
|
293
|
+
)
|
|
294
|
+
);
|
|
295
|
+
CardHeader.displayName = 'CardHeader';
|
|
296
|
+
|
|
297
|
+
const CardTitle = React.forwardRef<HTMLHeadingElement, React.HTMLAttributes<HTMLHeadingElement>>(
|
|
298
|
+
({ className, ...props }, ref) => (
|
|
299
|
+
<h3 ref={ref} className={cn('text-2xl font-semibold leading-none tracking-tight', className)} {...props} />
|
|
300
|
+
)
|
|
301
|
+
);
|
|
302
|
+
CardTitle.displayName = 'CardTitle';
|
|
303
|
+
|
|
304
|
+
const CardDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
|
|
305
|
+
({ className, ...props }, ref) => (
|
|
306
|
+
<p ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />
|
|
307
|
+
)
|
|
308
|
+
);
|
|
309
|
+
CardDescription.displayName = 'CardDescription';
|
|
310
|
+
|
|
311
|
+
const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
312
|
+
({ className, ...props }, ref) => <div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
|
|
313
|
+
);
|
|
314
|
+
CardContent.displayName = 'CardContent';
|
|
315
|
+
|
|
316
|
+
const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
317
|
+
({ className, ...props }, ref) => (
|
|
318
|
+
<div ref={ref} className={cn('flex items-center p-6 pt-0', className)} {...props} />
|
|
319
|
+
)
|
|
320
|
+
);
|
|
321
|
+
CardFooter.displayName = 'CardFooter';
|
|
322
|
+
|
|
323
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
|
324
|
+
`,
|
|
325
|
+
'scroll-area': `'use client';
|
|
326
|
+
|
|
327
|
+
import * as React from 'react';
|
|
328
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
329
|
+
import { cn } from '@/lib/utils';
|
|
330
|
+
|
|
331
|
+
const ScrollArea = React.forwardRef<
|
|
332
|
+
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
|
|
333
|
+
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
|
|
334
|
+
>(({ className, children, ...props }, ref) => (
|
|
335
|
+
<ScrollAreaPrimitive.Root ref={ref} className={cn('relative overflow-hidden', className)} {...props}>
|
|
336
|
+
<ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
|
|
337
|
+
{children}
|
|
338
|
+
</ScrollAreaPrimitive.Viewport>
|
|
339
|
+
<ScrollBar />
|
|
340
|
+
<ScrollAreaPrimitive.Corner />
|
|
341
|
+
</ScrollAreaPrimitive.Root>
|
|
342
|
+
));
|
|
343
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
344
|
+
|
|
345
|
+
const ScrollBar = React.forwardRef<
|
|
346
|
+
React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
|
|
347
|
+
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
348
|
+
>(({ className, orientation = 'vertical', ...props }, ref) => (
|
|
349
|
+
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
350
|
+
ref={ref}
|
|
351
|
+
orientation={orientation}
|
|
352
|
+
className={cn(
|
|
353
|
+
'flex touch-none select-none transition-colors',
|
|
354
|
+
orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent p-[1px]',
|
|
355
|
+
orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent p-[1px]',
|
|
356
|
+
className
|
|
357
|
+
)}
|
|
358
|
+
{...props}
|
|
359
|
+
>
|
|
360
|
+
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
|
|
361
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
362
|
+
));
|
|
363
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
364
|
+
|
|
365
|
+
export { ScrollArea, ScrollBar };
|
|
366
|
+
`,
|
|
367
|
+
};
|
|
368
|
+
return templates[name] || `// Component template not found: ${name}`;
|
|
369
|
+
}
|
|
370
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/cli/commands/add.ts"],"names":[],"mappings":";;;;;AAsCA,gCA6HC;AAnKD,0D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,OAAO,CAAC,GAAG,CAAC,4DAA4D,CAAC,CAAC;IAC1E,OAAO,CAAC,GAAG,CAAC,gEAAgE,CAAC,CAAC;AAChF,CAAC;AAED;;GAEG;AACH,SAAS,oBAAoB,CAAC,IAAY;IACxC,MAAM,SAAS,GAA2B;QACxC,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CX;QAEG,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;CAqBV;QAEG,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;CAoBb;QAEG,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCV;QAEG,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CT;QAEG,aAAa,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyClB;KACE,CAAC;IAEF,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,oCAAoC,IAAI,EAAE,CAAC;AACvE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAsFA,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAsCjD"}
|
|
@@ -43,6 +43,13 @@ const CONFIG_TEMPLATE = `module.exports = {
|
|
|
43
43
|
emails: ['admin@example.com'] // TODO: Add your admin emails
|
|
44
44
|
},
|
|
45
45
|
|
|
46
|
+
// Optional: Component paths (for npx docpush add)
|
|
47
|
+
components: {
|
|
48
|
+
uiPath: './src/components/ui', // Where to install UI components
|
|
49
|
+
libPath: './src/lib', // Where to install utilities
|
|
50
|
+
aliasPrefix: '@' // Import alias prefix (e.g., @/components)
|
|
51
|
+
},
|
|
52
|
+
|
|
46
53
|
// Optional: Branding
|
|
47
54
|
branding: {
|
|
48
55
|
name: 'Documentation',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":";;;;;AAsFA,kCAsCC;AA3HD,kDAA0B;AAC1B,wDAA0B;AAE1B,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;CAgBxB,CAAC;AAEF,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCvB,CAAC;AAEF,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BpB,CAAC;AAEK,KAAK,UAAU,WAAW;IAC/B,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAExD,wBAAwB;IACxB,MAAM,kBAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC7B,MAAM,kBAAE,CAAC,SAAS,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAC;IAC1D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,sCAAsC,CAAC,CAAC;IAEtE,wBAAwB;IACxB,IAAI,CAAC,CAAC,MAAM,kBAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC;QAC/C,MAAM,kBAAE,CAAC,SAAS,CAAC,kBAAkB,EAAE,eAAe,CAAC,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,wBAAwB,CAAC,CAAC;IAC1D,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,yCAAyC,CAAC,CAAC;IAC5E,CAAC;IAED,yBAAyB;IACzB,MAAM,kBAAE,CAAC,SAAS,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,sBAAsB,CAAC,CAAC;IAEtD,iCAAiC;IACjC,MAAM,OAAO,GAAG,gBAAgB,CAAC;IACjC,IAAI,MAAM,kBAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACjC,MAAM,GAAG,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACvC,GAAG,CAAC,OAAO,GAAG;YACZ,GAAG,GAAG,CAAC,OAAO;YACd,UAAU,EAAE,eAAe;YAC3B,YAAY,EAAE,eAAe;SAC9B,CAAC;QACF,MAAM,kBAAE,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;QAChD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,8BAA8B,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC5C,OAAO,CAAC,GAAG,CAAC,mDAAmD,CAAC,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;IAC9D,OAAO,CAAC,GAAG,CAAC,8DAA8D,CAAC,CAAC;IAC5E,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;AAC9C,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
|
+
const add_1 = require("./commands/add");
|
|
5
6
|
const init_1 = require("./commands/init");
|
|
6
7
|
const start_1 = require("./commands/start");
|
|
7
8
|
const program = new commander_1.Command();
|
|
@@ -18,5 +19,10 @@ program
|
|
|
18
19
|
.description('Start the DocPush development server')
|
|
19
20
|
.option('-p, --port <port>', 'Port to run on', '3000')
|
|
20
21
|
.action(start_1.startCommand);
|
|
22
|
+
program
|
|
23
|
+
.command('add')
|
|
24
|
+
.description('Add UI components to your project (shadcn/ui style)')
|
|
25
|
+
.argument('<components...>', 'Components to add (e.g., button input textarea or "all")')
|
|
26
|
+
.action(add_1.addCommand);
|
|
21
27
|
program.parse();
|
|
22
28
|
//# sourceMappingURL=index.js.map
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,0CAA8C;AAC9C,4CAAgD;AAEhD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,SAAS,CAAC;KACf,WAAW,CAAC,8DAA8D,CAAC;KAC3E,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,6CAA6C,CAAC;KAC1D,MAAM,CAAC,kBAAW,CAAC,CAAC;AAEvB,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,sCAAsC,CAAC;KACnD,MAAM,CAAC,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,CAAC;KACrD,MAAM,CAAC,oBAAY,CAAC,CAAC;AAExB,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,wCAA4C;AAC5C,0CAA8C;AAC9C,4CAAgD;AAEhD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IA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