@promakeai/cli 0.4.3 → 0.4.5
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 +168 -166
- package/dist/registry/contact-page-centered.json +3 -3
- package/dist/registry/contact-page-map-overlay.json +3 -3
- package/dist/registry/contact-page-map-split.json +3 -3
- package/dist/registry/contact-page-split.json +3 -3
- package/dist/registry/contact-page.json +3 -3
- package/dist/registry/payment-success-block.json +1 -1
- package/package.json +53 -53
- package/template/package.json +3 -1
- package/template/src/components/FormField.tsx +43 -0
- package/template/src/components/FormFileInput.tsx +76 -0
- package/template/src/components/Stack.tsx +39 -0
- package/template/src/constants/constants.json +67 -63
- package/template/src/lib/api.ts +345 -236
- package/template/vite.config.ts +65 -132
package/package.json
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@promakeai/cli",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"bin": {
|
|
6
|
-
"promake": "dist/index.js"
|
|
7
|
-
},
|
|
8
|
-
"files": [
|
|
9
|
-
"dist/index.js",
|
|
10
|
-
"dist/registry",
|
|
11
|
-
"template"
|
|
12
|
-
],
|
|
13
|
-
"scripts": {
|
|
14
|
-
"dev": "bun run src/index.ts",
|
|
15
|
-
"dev:app": "cd dev && bun run dev",
|
|
16
|
-
"dev:populate": "bun run scripts/populate-dev.ts",
|
|
17
|
-
"dev:fresh": "bun run dev:populate && bun run dev:app",
|
|
18
|
-
"playground:create": "rm -rf playground && bun run dev -- create playground --template empty --pm bun",
|
|
19
|
-
"playground:reset": "bun run playground:create",
|
|
20
|
-
"playground:add": "cd playground && bun run ../src/index.ts add",
|
|
21
|
-
"playground:ecommerce": "rm -rf playground && bun run dev -- create playground --template ecommerce --pm bun",
|
|
22
|
-
"build": "bun run build:cli && bun run build:registry",
|
|
23
|
-
"build:cli": "bun build src/index.ts --outdir dist --target node --minify",
|
|
24
|
-
"build:registry": "bun run scripts/build-registry.ts",
|
|
25
|
-
"typecheck": "tsc --noEmit",
|
|
26
|
-
"prepublishOnly": "bun run build",
|
|
27
|
-
"test": "bun test",
|
|
28
|
-
"test:watch": "bun test --watch",
|
|
29
|
-
"test:coverage": "bun test --coverage",
|
|
30
|
-
"release": "bun run build && npm publish --access public"
|
|
31
|
-
},
|
|
32
|
-
"dependencies": {
|
|
33
|
-
"adm-zip": "^0.5.16",
|
|
34
|
-
"archiver": "^7.0.1",
|
|
35
|
-
"chalk": "^5.3.0",
|
|
36
|
-
"commander": "^12.1.0",
|
|
37
|
-
"culori": "^4.0.2",
|
|
38
|
-
"dotenv": "^17.2.3",
|
|
39
|
-
"fs-extra": "^11.3.3",
|
|
40
|
-
"glob": "^11.0.0",
|
|
41
|
-
"ora": "^8.1.1",
|
|
42
|
-
"prompts": "^2.4.2",
|
|
43
|
-
"puppeteer-core": "^24.36.0"
|
|
44
|
-
},
|
|
45
|
-
"devDependencies": {
|
|
46
|
-
"@types/archiver": "^7.0.0",
|
|
47
|
-
"@types/bun": "^1.1.14",
|
|
48
|
-
"@types/culori": "^4.0.1",
|
|
49
|
-
"@types/fs-extra": "^11.0.4",
|
|
50
|
-
"@types/node": "^22.10.2",
|
|
51
|
-
"@types/prompts": "^2.4.9",
|
|
52
|
-
"typescript": "^5.7.2"
|
|
53
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@promakeai/cli",
|
|
3
|
+
"version": "0.4.5",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"bin": {
|
|
6
|
+
"promake": "dist/index.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/index.js",
|
|
10
|
+
"dist/registry",
|
|
11
|
+
"template"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"dev": "bun run src/index.ts",
|
|
15
|
+
"dev:app": "cd dev && bun run dev",
|
|
16
|
+
"dev:populate": "bun run scripts/populate-dev.ts",
|
|
17
|
+
"dev:fresh": "bun run dev:populate && bun run dev:app",
|
|
18
|
+
"playground:create": "rm -rf playground && bun run dev -- create playground --template empty --pm bun",
|
|
19
|
+
"playground:reset": "bun run playground:create",
|
|
20
|
+
"playground:add": "cd playground && bun run ../src/index.ts add",
|
|
21
|
+
"playground:ecommerce": "rm -rf playground && bun run dev -- create playground --template ecommerce --pm bun",
|
|
22
|
+
"build": "bun run build:cli && bun run build:registry",
|
|
23
|
+
"build:cli": "bun build src/index.ts --outdir dist --target node --minify",
|
|
24
|
+
"build:registry": "bun run scripts/build-registry.ts",
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"prepublishOnly": "bun run build",
|
|
27
|
+
"test": "bun test",
|
|
28
|
+
"test:watch": "bun test --watch",
|
|
29
|
+
"test:coverage": "bun test --coverage",
|
|
30
|
+
"release": "bun run build && npm publish --access public"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"adm-zip": "^0.5.16",
|
|
34
|
+
"archiver": "^7.0.1",
|
|
35
|
+
"chalk": "^5.3.0",
|
|
36
|
+
"commander": "^12.1.0",
|
|
37
|
+
"culori": "^4.0.2",
|
|
38
|
+
"dotenv": "^17.2.3",
|
|
39
|
+
"fs-extra": "^11.3.3",
|
|
40
|
+
"glob": "^11.0.0",
|
|
41
|
+
"ora": "^8.1.1",
|
|
42
|
+
"prompts": "^2.4.2",
|
|
43
|
+
"puppeteer-core": "^24.36.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/archiver": "^7.0.0",
|
|
47
|
+
"@types/bun": "^1.1.14",
|
|
48
|
+
"@types/culori": "^4.0.1",
|
|
49
|
+
"@types/fs-extra": "^11.0.4",
|
|
50
|
+
"@types/node": "^22.10.2",
|
|
51
|
+
"@types/prompts": "^2.4.9",
|
|
52
|
+
"typescript": "^5.7.2"
|
|
53
|
+
}
|
|
54
54
|
}
|
package/template/package.json
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Stack } from "./Stack";
|
|
2
|
+
import { Label } from "./ui/label";
|
|
3
|
+
|
|
4
|
+
export interface FormFieldProps {
|
|
5
|
+
label: string;
|
|
6
|
+
htmlFor?: string;
|
|
7
|
+
error?: string;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
description?: string;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
gap?: 0 | 1 | 2 | 3 | 4 | 6 | 8 | 10 | 12; // Stack gap override
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function FormField({
|
|
16
|
+
label,
|
|
17
|
+
htmlFor,
|
|
18
|
+
error,
|
|
19
|
+
required,
|
|
20
|
+
children,
|
|
21
|
+
description,
|
|
22
|
+
gap = 2,
|
|
23
|
+
className,
|
|
24
|
+
}: FormFieldProps) {
|
|
25
|
+
return (
|
|
26
|
+
<Stack gap={gap} className={className}>
|
|
27
|
+
<Label htmlFor={htmlFor}>
|
|
28
|
+
{label} {required && <span className="text-destructive">*</span>}
|
|
29
|
+
</Label>
|
|
30
|
+
{children}
|
|
31
|
+
{description && (
|
|
32
|
+
<p className="text-sm text-muted-foreground">
|
|
33
|
+
{description}
|
|
34
|
+
</p>
|
|
35
|
+
)}
|
|
36
|
+
{error && (
|
|
37
|
+
<p className="text-sm text-destructive" role="alert">
|
|
38
|
+
{error}
|
|
39
|
+
</p>
|
|
40
|
+
)}
|
|
41
|
+
</Stack>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { useRef } from "react";
|
|
2
|
+
import { Input } from "@/components/ui/input";
|
|
3
|
+
import { Button } from "@/components/ui/button";
|
|
4
|
+
import { Stack } from "./Stack";
|
|
5
|
+
import { Upload } from "lucide-react";
|
|
6
|
+
|
|
7
|
+
interface FormFileInputProps {
|
|
8
|
+
files: File[];
|
|
9
|
+
onFilesChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
10
|
+
maxFiles?: number;
|
|
11
|
+
accept?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
uploadButtonText?: string;
|
|
14
|
+
maxFilesReachedText?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
handleRemoveFile: (index: number) => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const FormFileInput: React.FC<FormFileInputProps> = ({
|
|
20
|
+
files,
|
|
21
|
+
onFilesChange,
|
|
22
|
+
maxFiles = 5,
|
|
23
|
+
accept = ".pdf,.doc,.docx,.jpg,.jpeg,.png",
|
|
24
|
+
disabled = false,
|
|
25
|
+
uploadButtonText = "Add Files",
|
|
26
|
+
maxFilesReachedText = "Max files reached",
|
|
27
|
+
className,
|
|
28
|
+
handleRemoveFile,
|
|
29
|
+
}) => {
|
|
30
|
+
const fileInputRef = useRef<HTMLInputElement>(null);
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
const isMaxReached = files.length >= maxFiles;
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Stack gap={2} className={className}>
|
|
38
|
+
<Input
|
|
39
|
+
ref={fileInputRef}
|
|
40
|
+
type="file"
|
|
41
|
+
className="hidden"
|
|
42
|
+
multiple
|
|
43
|
+
disabled={isMaxReached || disabled}
|
|
44
|
+
onChange={onFilesChange}
|
|
45
|
+
accept={accept}
|
|
46
|
+
/>
|
|
47
|
+
<Button
|
|
48
|
+
type="button"
|
|
49
|
+
variant="outline"
|
|
50
|
+
className="w-full"
|
|
51
|
+
disabled={isMaxReached || disabled}
|
|
52
|
+
onClick={() => fileInputRef.current?.click()}
|
|
53
|
+
>
|
|
54
|
+
<Upload className="w-4 h-4 mr-2" />
|
|
55
|
+
{isMaxReached ? maxFilesReachedText : uploadButtonText}
|
|
56
|
+
</Button>
|
|
57
|
+
|
|
58
|
+
{files.length > 0 && (
|
|
59
|
+
<div className="flex flex-wrap gap-2 mt-2">
|
|
60
|
+
{files.map((file, index) => (
|
|
61
|
+
<div key={index} className="flex items-center gap-2 px-3 py-1 bg-muted rounded-md text-sm">
|
|
62
|
+
<span className="text-muted-foreground">{file.name}</span>
|
|
63
|
+
<button
|
|
64
|
+
type="button"
|
|
65
|
+
onClick={() => handleRemoveFile(index)}
|
|
66
|
+
className="text-destructive hover:text-destructive/80"
|
|
67
|
+
>
|
|
68
|
+
×
|
|
69
|
+
</button>
|
|
70
|
+
</div>
|
|
71
|
+
))}
|
|
72
|
+
</div>
|
|
73
|
+
)}
|
|
74
|
+
</Stack>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import { Children } from "react";
|
|
3
|
+
|
|
4
|
+
type StackProps = {
|
|
5
|
+
as?: keyof HTMLElementTagNameMap; // "div", "ul", "section" vs can be any valid HTML element
|
|
6
|
+
gap?: 0 | 1 | 2 | 3 | 4 | 6 | 8 | 10 | 12; //Tailwind spacing scale
|
|
7
|
+
direction?: "vertical" | "horizontal";
|
|
8
|
+
className?: string;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
wrapChildren?: boolean; // If true, wraps each child in a Stack with the same gap
|
|
11
|
+
childGap?: 0 | 1 | 2 | 3 | 4 | 6 | 8 | 10 | 12; // Gap for wrapped children
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export function Stack({
|
|
15
|
+
as: Component = "div",
|
|
16
|
+
gap = 2,
|
|
17
|
+
direction = "vertical",
|
|
18
|
+
className,
|
|
19
|
+
children,
|
|
20
|
+
wrapChildren = false,
|
|
21
|
+
childGap = 2,
|
|
22
|
+
}: StackProps) {
|
|
23
|
+
const gapClass =
|
|
24
|
+
direction === "vertical" ? `space-y-${gap}` : `space-x-${gap}`;
|
|
25
|
+
|
|
26
|
+
const content = wrapChildren
|
|
27
|
+
? Children.map(children, (child, index) => (
|
|
28
|
+
<Stack key={index} gap={childGap} direction={direction}>
|
|
29
|
+
{child}
|
|
30
|
+
</Stack>
|
|
31
|
+
))
|
|
32
|
+
: children;
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<Component className={clsx(gapClass, className)}>
|
|
36
|
+
{content}
|
|
37
|
+
</Component>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -1,64 +1,68 @@
|
|
|
1
|
-
{
|
|
2
|
-
"site": {
|
|
3
|
-
"name": "Site Name",
|
|
4
|
-
"tagline": "Your Site Tagline",
|
|
5
|
-
"description": "A modern, responsive site template for businesses, blogs, ecommerce stores, or portfolios.",
|
|
6
|
-
"logo": "",
|
|
7
|
-
"favicon": "./favicon.svg",
|
|
8
|
-
"currency": "USD",
|
|
9
|
-
"country": "United States",
|
|
10
|
-
"countryCode": "US",
|
|
11
|
-
"defaultLanguage": "en",
|
|
12
|
-
"availableLanguages": {
|
|
13
|
-
"en": "EN"
|
|
14
|
-
},
|
|
15
|
-
"overrideBrowserLanguage": true,
|
|
16
|
-
"timezone": "America/New_York",
|
|
17
|
-
"slug": "site-name",
|
|
18
|
-
"taxName": "Tax"
|
|
19
|
-
},
|
|
20
|
-
"api": {
|
|
21
|
-
"baseUrl": "https://backend.promake.ai/api",
|
|
22
|
-
"endpoints": {
|
|
23
|
-
"contact": "/contact",
|
|
24
|
-
"services": "/services"
|
|
25
|
-
},
|
|
26
|
-
"timeout": 30000
|
|
27
|
-
},
|
|
28
|
-
"seo": {
|
|
29
|
-
"title": "Site Name",
|
|
30
|
-
"description": "Your site description",
|
|
31
|
-
"author": "Site Name",
|
|
32
|
-
"ogTitle": "Site Name",
|
|
33
|
-
"ogDescription": "Your site description",
|
|
34
|
-
"ogImage": "",
|
|
35
|
-
"twitterSite": "",
|
|
36
|
-
"twitterImage": "",
|
|
37
|
-
"googleVerification": ""
|
|
38
|
-
},
|
|
39
|
-
"scripts": {
|
|
40
|
-
"gaId": "",
|
|
41
|
-
"headStart": "",
|
|
42
|
-
"headEnd": "",
|
|
43
|
-
"bodyStart": "",
|
|
44
|
-
"bodyEnd": ""
|
|
45
|
-
},
|
|
46
|
-
"email": "hello@example.com",
|
|
47
|
-
"supportEmail": "support@example.com",
|
|
48
|
-
"phone": "+1 (555) 010-0000",
|
|
49
|
-
"whatsapp": "+1 (555) 010-0001",
|
|
50
|
-
"address": {
|
|
51
|
-
"line1": "123 Main Street",
|
|
52
|
-
"line2": "Suite 100",
|
|
53
|
-
"city": "City",
|
|
54
|
-
"state": "State",
|
|
55
|
-
"postalCode": "00000",
|
|
56
|
-
"country": "Country"
|
|
57
|
-
},
|
|
58
|
-
"socialMedia": {
|
|
59
|
-
"twitter": "",
|
|
60
|
-
"facebook": "",
|
|
61
|
-
"instagram": "",
|
|
62
|
-
"linkedin": ""
|
|
63
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"site": {
|
|
3
|
+
"name": "Site Name",
|
|
4
|
+
"tagline": "Your Site Tagline",
|
|
5
|
+
"description": "A modern, responsive site template for businesses, blogs, ecommerce stores, or portfolios.",
|
|
6
|
+
"logo": "",
|
|
7
|
+
"favicon": "./favicon.svg",
|
|
8
|
+
"currency": "USD",
|
|
9
|
+
"country": "United States",
|
|
10
|
+
"countryCode": "US",
|
|
11
|
+
"defaultLanguage": "en",
|
|
12
|
+
"availableLanguages": {
|
|
13
|
+
"en": "EN"
|
|
14
|
+
},
|
|
15
|
+
"overrideBrowserLanguage": true,
|
|
16
|
+
"timezone": "America/New_York",
|
|
17
|
+
"slug": "site-name",
|
|
18
|
+
"taxName": "Tax"
|
|
19
|
+
},
|
|
20
|
+
"api": {
|
|
21
|
+
"baseUrl": "https://backend.promake.ai/api",
|
|
22
|
+
"endpoints": {
|
|
23
|
+
"contact": "/contact",
|
|
24
|
+
"services": "/services"
|
|
25
|
+
},
|
|
26
|
+
"timeout": 30000
|
|
27
|
+
},
|
|
28
|
+
"seo": {
|
|
29
|
+
"title": "Site Name",
|
|
30
|
+
"description": "Your site description",
|
|
31
|
+
"author": "Site Name",
|
|
32
|
+
"ogTitle": "Site Name",
|
|
33
|
+
"ogDescription": "Your site description",
|
|
34
|
+
"ogImage": "",
|
|
35
|
+
"twitterSite": "",
|
|
36
|
+
"twitterImage": "",
|
|
37
|
+
"googleVerification": ""
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"gaId": "",
|
|
41
|
+
"headStart": "",
|
|
42
|
+
"headEnd": "",
|
|
43
|
+
"bodyStart": "",
|
|
44
|
+
"bodyEnd": ""
|
|
45
|
+
},
|
|
46
|
+
"email": "hello@example.com",
|
|
47
|
+
"supportEmail": "support@example.com",
|
|
48
|
+
"phone": "+1 (555) 010-0000",
|
|
49
|
+
"whatsapp": "+1 (555) 010-0001",
|
|
50
|
+
"address": {
|
|
51
|
+
"line1": "123 Main Street",
|
|
52
|
+
"line2": "Suite 100",
|
|
53
|
+
"city": "City",
|
|
54
|
+
"state": "State",
|
|
55
|
+
"postalCode": "00000",
|
|
56
|
+
"country": "Country"
|
|
57
|
+
},
|
|
58
|
+
"socialMedia": {
|
|
59
|
+
"twitter": "",
|
|
60
|
+
"facebook": "",
|
|
61
|
+
"instagram": "",
|
|
62
|
+
"linkedin": ""
|
|
63
|
+
},
|
|
64
|
+
"file":{
|
|
65
|
+
"maxFiles": 5,
|
|
66
|
+
"accept": ".pdf,.doc,.docx,.jpg,.jpeg,.png"
|
|
67
|
+
}
|
|
64
68
|
}
|