@promakeai/cli 0.8.0 → 0.9.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.
- package/README.md +48 -8
- package/dist/index.js +195 -192
- package/dist/registry/auth-core.json +1 -1
- package/dist/registry/case-study-page.json +2 -2
- package/dist/registry/checkout-page.json +3 -3
- package/dist/registry/cookie-consent.json +1 -1
- package/dist/registry/docs/verify-email-page.md +43 -0
- package/dist/registry/forgot-password-page-split.json +3 -3
- package/dist/registry/forgot-password-page.json +3 -3
- package/dist/registry/header-ecommerce.json +2 -2
- package/dist/registry/order-card-compact.json +2 -2
- package/dist/registry/order-confirmation-page.json +2 -2
- package/dist/registry/post-detail-block.json +2 -2
- package/dist/registry/product-card-detailed.json +2 -2
- package/dist/registry/product-detail-section.json +2 -2
- package/dist/registry/product-quick-view.json +2 -2
- package/dist/registry/register-page-split.json +3 -3
- package/dist/registry/register-page.json +3 -3
- package/dist/registry/reset-password-page-split.json +1 -1
- package/dist/registry/reset-password-page.json +1 -1
- package/dist/registry/verify-email-page.json +48 -0
- package/package.json +1 -1
- package/template/.env +2 -3
- package/template/bun.lock +10 -5
- package/template/index.html +233 -233
- package/template/package.json +4 -4
- package/template/src/constants/constants.json +4 -0
- package/template/src/db/index.ts +1 -0
- package/template/src/db/provider.tsx +58 -19
- package/template/src/db/schema.json +20 -0
- package/template/src/hooks/use-page-title.ts +49 -49
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
"defaultLanguage": "en",
|
|
8
8
|
"tables": {
|
|
9
9
|
"blog_categories": {
|
|
10
|
+
"$permissions": {
|
|
11
|
+
"anon": ["read"],
|
|
12
|
+
"user": ["read"],
|
|
13
|
+
"admin": ["read", "create", "update", "delete"]
|
|
14
|
+
},
|
|
10
15
|
"id": {
|
|
11
16
|
"type": "id"
|
|
12
17
|
},
|
|
@@ -35,6 +40,11 @@
|
|
|
35
40
|
}
|
|
36
41
|
},
|
|
37
42
|
"posts": {
|
|
43
|
+
"$permissions": {
|
|
44
|
+
"anon": ["read"],
|
|
45
|
+
"user": ["read"],
|
|
46
|
+
"admin": ["read", "create", "update", "delete"]
|
|
47
|
+
},
|
|
38
48
|
"id": {
|
|
39
49
|
"type": "id"
|
|
40
50
|
},
|
|
@@ -118,6 +128,11 @@
|
|
|
118
128
|
}
|
|
119
129
|
},
|
|
120
130
|
"product_categories": {
|
|
131
|
+
"$permissions": {
|
|
132
|
+
"anon": ["read"],
|
|
133
|
+
"user": ["read"],
|
|
134
|
+
"admin": ["read", "create", "update", "delete"]
|
|
135
|
+
},
|
|
121
136
|
"id": {
|
|
122
137
|
"type": "id"
|
|
123
138
|
},
|
|
@@ -150,6 +165,11 @@
|
|
|
150
165
|
}
|
|
151
166
|
},
|
|
152
167
|
"products": {
|
|
168
|
+
"$permissions": {
|
|
169
|
+
"anon": ["read"],
|
|
170
|
+
"user": ["read"],
|
|
171
|
+
"admin": ["read", "create", "update", "delete"]
|
|
172
|
+
},
|
|
153
173
|
"id": {
|
|
154
174
|
"type": "id"
|
|
155
175
|
},
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
import constants from "@/constants/constants.json";
|
|
3
|
-
interface UsePageTitleOptions {
|
|
4
|
-
title?: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
appendSiteName?: boolean;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const usePageTitle = (options: UsePageTitleOptions = {}) => {
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
if (!constants) return;
|
|
12
|
-
|
|
13
|
-
const { title, description, appendSiteName = true } = options;
|
|
14
|
-
|
|
15
|
-
// Set page title
|
|
16
|
-
let pageTitle = title || constants.site.name;
|
|
17
|
-
if (title && appendSiteName) {
|
|
18
|
-
pageTitle = `${title} | ${constants.site.name}`;
|
|
19
|
-
}
|
|
20
|
-
document.title = pageTitle;
|
|
21
|
-
|
|
22
|
-
// Set meta description
|
|
23
|
-
const metaDescription = description || constants.site.description;
|
|
24
|
-
let descriptionElement = document.querySelector('meta[name="description"]');
|
|
25
|
-
|
|
26
|
-
if (!descriptionElement) {
|
|
27
|
-
descriptionElement = document.createElement("meta");
|
|
28
|
-
descriptionElement.setAttribute("name", "description");
|
|
29
|
-
document.head.appendChild(descriptionElement);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
descriptionElement.setAttribute("content", metaDescription);
|
|
33
|
-
|
|
34
|
-
// Set favicon if provided
|
|
35
|
-
if (constants.site.favicon) {
|
|
36
|
-
const faviconElement = document.querySelector(
|
|
37
|
-
"#favicon",
|
|
38
|
-
) as HTMLLinkElement;
|
|
39
|
-
if (faviconElement) {
|
|
40
|
-
faviconElement.href = constants.site.favicon;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}, [options]);
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
siteName: constants?.site?.name || "",
|
|
47
|
-
siteDescription: constants?.site?.description || "",
|
|
48
|
-
};
|
|
49
|
-
};
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import constants from "@/constants/constants.json";
|
|
3
|
+
interface UsePageTitleOptions {
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
appendSiteName?: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const usePageTitle = (options: UsePageTitleOptions = {}) => {
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (!constants) return;
|
|
12
|
+
|
|
13
|
+
const { title, description, appendSiteName = true } = options;
|
|
14
|
+
|
|
15
|
+
// Set page title
|
|
16
|
+
let pageTitle = title || constants.site.name;
|
|
17
|
+
if (title && appendSiteName) {
|
|
18
|
+
pageTitle = `${title} | ${constants.site.name}`;
|
|
19
|
+
}
|
|
20
|
+
document.title = pageTitle;
|
|
21
|
+
|
|
22
|
+
// Set meta description
|
|
23
|
+
const metaDescription = description || constants.site.description;
|
|
24
|
+
let descriptionElement = document.querySelector('meta[name="description"]');
|
|
25
|
+
|
|
26
|
+
if (!descriptionElement) {
|
|
27
|
+
descriptionElement = document.createElement("meta");
|
|
28
|
+
descriptionElement.setAttribute("name", "description");
|
|
29
|
+
document.head.appendChild(descriptionElement);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
descriptionElement.setAttribute("content", metaDescription);
|
|
33
|
+
|
|
34
|
+
// Set favicon if provided
|
|
35
|
+
if (constants.site.favicon) {
|
|
36
|
+
const faviconElement = document.querySelector(
|
|
37
|
+
"#favicon",
|
|
38
|
+
) as HTMLLinkElement;
|
|
39
|
+
if (faviconElement) {
|
|
40
|
+
faviconElement.href = constants.site.favicon;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}, [options]);
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
siteName: constants?.site?.name || "",
|
|
47
|
+
siteDescription: constants?.site?.description || "",
|
|
48
|
+
};
|
|
49
|
+
};
|