@nuvler/cli 0.3.1 → 0.4.1
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 +258 -38
- package/dist/api/client.js.map +1 -1
- package/dist/api/theme-registry.js.map +1 -1
- package/dist/commands/theme/create.js +74 -18
- package/dist/commands/theme/create.js.map +1 -1
- package/dist/commands/theme/migrate.js +117 -0
- package/dist/commands/theme/migrate.js.map +1 -0
- package/dist/config/developer-session.js.map +1 -1
- package/dist/index.js +28 -1
- package/dist/index.js.map +1 -1
- package/dist/migrate/analyzer.js +479 -0
- package/dist/migrate/analyzer.js.map +1 -0
- package/dist/migrate/asset-copier.js +40 -0
- package/dist/migrate/asset-copier.js.map +1 -0
- package/dist/migrate/classifier.js +107 -0
- package/dist/migrate/classifier.js.map +1 -0
- package/dist/migrate/generator.js +500 -0
- package/dist/migrate/generator.js.map +1 -0
- package/dist/migrate/transformer.js +150 -0
- package/dist/migrate/transformer.js.map +1 -0
- package/dist/migrate/types.js +2 -0
- package/dist/migrate/types.js.map +1 -0
- package/dist/migrate/validator.js +40 -0
- package/dist/migrate/validator.js.map +1 -0
- package/dist/nuvler.js +1643 -33
- package/dist/nuvler.js.map +1 -1
- package/dist/preview/launcher.js.map +1 -1
- package/dist/templates/nuvler-atelier/README.md +17 -1
- package/dist/templates/nuvler-atelier/nuvler.theme.json +10 -3
- package/dist/templates/nuvler-atelier/package.json +3 -3
- package/dist/templates/nuvler-atelier/src/definition.tsx +11 -1
- package/dist/templates/nuvler-atelier/src/theme.css +26 -26
- package/dist/templates/nuvler-atelier/src/theme.tsx +12 -1
- package/dist/templates/nuvler-default/README.md +18 -4
- package/dist/templates/nuvler-default/nuvler.theme.json +10 -3
- package/dist/templates/nuvler-default/package.json +2 -2
- package/dist/templates/nuvler-default/src/definition.ts +11 -0
- package/dist/templates/nuvler-default/src/theme-component.tsx +11 -0
- package/dist/templates/nuvler-default/src/theme.css +27 -16
- package/dist/templates/starter/README.md +18 -1
- package/dist/templates/starter/nuvler.theme.json +9 -2
- package/dist/templates/starter/package.json +2 -2
- package/dist/templates/starter/src/definition.tsx +8 -1
- package/dist/templates/starter/src/theme.css +10 -10
- package/dist/templates/starter/src/theme.tsx +11 -0
- package/package.json +4 -3
- package/preview-host/index.html +1 -0
- package/preview-host/package.json +1 -1
- package/preview-host/public/nuvler-icon.ico +0 -0
- package/preview-host/public/nuvler-logo-white.png +0 -0
- package/preview-host/src/app/globals.css +28 -0
- package/preview-host/src/main.tsx +11 -1
- package/preview-host/vendor/theme-runtime/default-theme.tsx +24 -2
|
@@ -37,7 +37,14 @@ export const manifest = manifestData as ThemeManifest;
|
|
|
37
37
|
export const themeDefinition = defineTheme({
|
|
38
38
|
manifest,
|
|
39
39
|
tokens: {
|
|
40
|
-
colors: {
|
|
40
|
+
colors: {
|
|
41
|
+
primary: "#1d4ed8", primaryText: "#ffffff",
|
|
42
|
+
secondary: "#f59e0b", secondaryText: "#0f172a", accent: "#d97706",
|
|
43
|
+
background: "#f8fafc", surface: "#ffffff", surfaceAlt: "#f1f5f9",
|
|
44
|
+
text: "#0f172a", textMuted: "#64748b", border: "#e2e8f0",
|
|
45
|
+
headerBackground: "#ffffff", headerText: "#0f172a",
|
|
46
|
+
footerBackground: "#0f172a", footerText: "#f8fafc",
|
|
47
|
+
},
|
|
41
48
|
layout: { containerWidth: 1200, borderRadius: 16 },
|
|
42
49
|
},
|
|
43
50
|
template: {
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
body { margin: 0; }
|
|
3
3
|
.nuvler-starter-theme { min-height: 100vh; background: var(--theme-background); color: var(--theme-text); font-family: Inter, system-ui, sans-serif; }
|
|
4
4
|
.theme-header, .theme-footer, .theme-section, .theme-hero { width: min(calc(100% - 32px), var(--theme-container)); margin-inline: auto; }
|
|
5
|
-
.theme-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
|
|
5
|
+
.theme-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--theme-header-background); color: var(--theme-header-text); }
|
|
6
6
|
.theme-brand { color: var(--theme-primary); font-size: 20px; font-weight: 800; text-decoration: none; }
|
|
7
7
|
.theme-header form { display: flex; gap: 8px; }
|
|
8
|
-
.theme-header input { min-width: 260px; border: 1px solid
|
|
9
|
-
.theme-header button, .theme-product-detail button { border: 0; border-radius: var(--theme-radius); background: var(--theme-primary); color:
|
|
10
|
-
.theme-hero { margin-block: 32px; border-radius: calc(var(--theme-radius) * 1.5); background: var(--theme-primary); color:
|
|
11
|
-
.theme-hero span { color: var(--theme-
|
|
8
|
+
.theme-header input { min-width: 260px; border: 1px solid var(--theme-border); border-radius: var(--theme-radius); background: var(--theme-surface); color: var(--theme-header-text); padding: 11px 14px; }
|
|
9
|
+
.theme-header button, .theme-product-detail button { border: 0; border-radius: var(--theme-radius); background: var(--theme-primary); color: var(--theme-primary-text); padding: 12px 18px; font-weight: 700; }
|
|
10
|
+
.theme-hero { margin-block: 32px; border-radius: calc(var(--theme-radius) * 1.5); background: var(--theme-primary); color: var(--theme-primary-text); padding: clamp(40px, 8vw, 96px); }
|
|
11
|
+
.theme-hero span { color: var(--theme-accent); font-size: 12px; font-weight: 800; text-transform: uppercase; }
|
|
12
12
|
.theme-hero h1 { max-width: 760px; margin: 12px 0; font-size: clamp(40px, 7vw, 80px); line-height: .95; }
|
|
13
|
-
.theme-hero a { display: inline-block; margin-top: 16px; border-radius: var(--theme-radius); background: var(--theme-secondary); color: var(--theme-text); padding: 13px 18px; font-weight: 800; text-decoration: none; }
|
|
13
|
+
.theme-hero a { display: inline-block; margin-top: 16px; border-radius: var(--theme-radius); background: var(--theme-secondary); color: var(--theme-secondary-text); padding: 13px 18px; font-weight: 800; text-decoration: none; }
|
|
14
14
|
.theme-section { padding-block: 48px; }
|
|
15
15
|
.theme-products { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
|
|
16
|
-
.theme-products article { min-height: 180px; border: 1px solid
|
|
16
|
+
.theme-products article { min-height: 180px; border: 1px solid var(--theme-border); border-radius: var(--theme-radius); background: var(--theme-surface); padding: 20px; }
|
|
17
17
|
.theme-products a { display: flex; height: 100%; flex-direction: column; justify-content: flex-end; color: inherit; text-decoration: none; }
|
|
18
|
-
.theme-products span { margin-top: 8px; color:
|
|
19
|
-
.theme-product-detail { display: grid; gap: 32px; grid-template-columns: 1fr auto; align-items: end; border-radius: var(--theme-radius); background:
|
|
20
|
-
.theme-footer { display: flex; justify-content: space-between; border-top: 1px solid
|
|
18
|
+
.theme-products span { margin-top: 8px; color: var(--theme-text-muted); font-size: 13px; }
|
|
19
|
+
.theme-product-detail { display: grid; gap: 32px; grid-template-columns: 1fr auto; align-items: end; border-radius: var(--theme-radius); background: var(--theme-surface); padding: clamp(24px, 5vw, 56px); }
|
|
20
|
+
.theme-footer { display: flex; justify-content: space-between; border-top: 1px solid var(--theme-border); background: var(--theme-footer-background); color: var(--theme-footer-text); padding: 32px 20px; }
|
|
21
21
|
@media (max-width: 700px) { .theme-header { align-items: stretch; flex-direction: column; padding-block: 16px; } .theme-header form, .theme-header input { width: 100%; min-width: 0; } .theme-product-detail { grid-template-columns: 1fr; } }
|
|
@@ -15,9 +15,20 @@ export default function Theme({ context, route = { type: "home" }, sdk }: Nuvler
|
|
|
15
15
|
};
|
|
16
16
|
const style = {
|
|
17
17
|
"--theme-primary": tokens.colors.primary,
|
|
18
|
+
"--theme-primary-text": tokens.colors.primaryText,
|
|
18
19
|
"--theme-secondary": tokens.colors.secondary,
|
|
20
|
+
"--theme-secondary-text": tokens.colors.secondaryText,
|
|
21
|
+
"--theme-accent": tokens.colors.accent,
|
|
19
22
|
"--theme-background": tokens.colors.background,
|
|
23
|
+
"--theme-surface": tokens.colors.surface,
|
|
24
|
+
"--theme-surface-alt": tokens.colors.surfaceAlt,
|
|
20
25
|
"--theme-text": tokens.colors.text,
|
|
26
|
+
"--theme-text-muted": tokens.colors.textMuted,
|
|
27
|
+
"--theme-border": tokens.colors.border,
|
|
28
|
+
"--theme-header-background": tokens.colors.headerBackground,
|
|
29
|
+
"--theme-header-text": tokens.colors.headerText,
|
|
30
|
+
"--theme-footer-background": tokens.colors.footerBackground,
|
|
31
|
+
"--theme-footer-text": tokens.colors.footerText,
|
|
21
32
|
"--theme-radius": `${tokens.layout.borderRadius}px`,
|
|
22
33
|
"--theme-container": `${tokens.layout.containerWidth}px`,
|
|
23
34
|
} as CSSProperties;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuvler/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "CLI oficial para criação, validação, preview e empacotamento de temas Nuvler",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -20,14 +20,15 @@
|
|
|
20
20
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@nuvler/theme-schema": "^1.
|
|
24
|
-
"@nuvler/theme-sdk": "^1.
|
|
23
|
+
"@nuvler/theme-schema": "^1.2.0",
|
|
24
|
+
"@nuvler/theme-sdk": "^1.2.0",
|
|
25
25
|
"@vitejs/plugin-react": "^6.0.5",
|
|
26
26
|
"commander": "^15.0.0",
|
|
27
27
|
"react": "19.2.8",
|
|
28
28
|
"react-dom": "19.2.8",
|
|
29
29
|
"semver": "^7.8.5",
|
|
30
30
|
"tar": "^7.5.22",
|
|
31
|
+
"typescript": "^5.9.3",
|
|
31
32
|
"vite": "^8.2.1"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
package/preview-host/index.html
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<meta name="description" content="Preview local de temas Nuvler" />
|
|
7
|
+
<link rel="icon" href="/nuvler-icon.ico" sizes="any" />
|
|
7
8
|
<title>Nuvler Theme Preview</title>
|
|
8
9
|
</head>
|
|
9
10
|
<body>
|
|
Binary file
|
|
Binary file
|
|
@@ -14,3 +14,31 @@ img {
|
|
|
14
14
|
display: block;
|
|
15
15
|
max-width: 100%;
|
|
16
16
|
}
|
|
17
|
+
|
|
18
|
+
.nuvler-platform-footer {
|
|
19
|
+
position: relative;
|
|
20
|
+
z-index: 1;
|
|
21
|
+
display: flex;
|
|
22
|
+
min-height: 76px;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
border-top: 1px solid rgb(255 255 255 / 10%);
|
|
26
|
+
background: #0b1220;
|
|
27
|
+
padding: 20px 24px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.nuvler-platform-footer img {
|
|
31
|
+
width: 132px;
|
|
32
|
+
height: auto;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@media (max-width: 640px) {
|
|
36
|
+
.nuvler-platform-footer {
|
|
37
|
+
min-height: 68px;
|
|
38
|
+
padding-block: 18px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.nuvler-platform-footer img {
|
|
42
|
+
width: 116px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -69,6 +69,11 @@ function PreviewApp() {
|
|
|
69
69
|
const [route, setRoute] = useState<ThemeRoute>({ type: "loading", pathname: window.location.pathname });
|
|
70
70
|
const requestId = useRef(0);
|
|
71
71
|
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
const favicon = document.querySelector<HTMLLinkElement>('link[rel~="icon"]');
|
|
74
|
+
if (favicon) favicon.href = context.site.settings?.favicon?.url || "/nuvler-icon.ico";
|
|
75
|
+
}, []);
|
|
76
|
+
|
|
72
77
|
const loadRoute = useCallback(async (url: URL) => {
|
|
73
78
|
const currentRequest = ++requestId.current;
|
|
74
79
|
const localRoute = routeFromLocalData(url);
|
|
@@ -137,7 +142,12 @@ function PreviewApp() {
|
|
|
137
142
|
};
|
|
138
143
|
}, [loadRoute]);
|
|
139
144
|
|
|
140
|
-
return
|
|
145
|
+
return <>
|
|
146
|
+
<ActiveTheme adapters={adapters} context={context} route={route} />
|
|
147
|
+
<footer className="nuvler-platform-footer" aria-label="Nuvler">
|
|
148
|
+
<img src="/nuvler-logo-white.png" alt="Nuvler" width="1532" height="289" />
|
|
149
|
+
</footer>
|
|
150
|
+
</>;
|
|
141
151
|
}
|
|
142
152
|
|
|
143
153
|
const container = document.getElementById("root");
|
|
@@ -13,9 +13,20 @@ import type { ThemeRoute } from "./index.js";
|
|
|
13
13
|
|
|
14
14
|
const fallbackColors: ThemeSiteColors = {
|
|
15
15
|
primary: "#176b3a",
|
|
16
|
+
primaryText: "#ffffff",
|
|
16
17
|
secondary: "#d99b31",
|
|
18
|
+
secondaryText: "#18221b",
|
|
19
|
+
accent: "#b45309",
|
|
17
20
|
background: "#f7f7f2",
|
|
21
|
+
surface: "#ffffff",
|
|
22
|
+
surfaceAlt: "#eef2e9",
|
|
18
23
|
text: "#18221b",
|
|
24
|
+
textMuted: "#657068",
|
|
25
|
+
border: "#dfe4dd",
|
|
26
|
+
headerBackground: "#ffffff",
|
|
27
|
+
headerText: "#18221b",
|
|
28
|
+
footerBackground: "#14251a",
|
|
29
|
+
footerText: "#f7f7f2",
|
|
19
30
|
};
|
|
20
31
|
|
|
21
32
|
const template = {
|
|
@@ -552,20 +563,31 @@ function FloatingWhatsapp({ context }: { context: ThemeContext }) {
|
|
|
552
563
|
|
|
553
564
|
export function DefaultTheme({ context, adapters, route = { type: "home" } }: DefaultThemeProps) {
|
|
554
565
|
const configured = context.site.settings?.theme;
|
|
555
|
-
const colors = configured?.colors
|
|
566
|
+
const colors = { ...fallbackColors, ...configured?.colors };
|
|
556
567
|
const layout = configured?.layout;
|
|
557
568
|
const style = {
|
|
558
569
|
"--color-primary": colors.primary,
|
|
570
|
+
"--color-primary-text": colors.primaryText,
|
|
559
571
|
"--color-secondary": colors.secondary,
|
|
572
|
+
"--color-secondary-text": colors.secondaryText,
|
|
573
|
+
"--color-accent": colors.accent,
|
|
560
574
|
"--store-background": colors.background,
|
|
575
|
+
"--store-surface": colors.surface,
|
|
576
|
+
"--store-surface-alt": colors.surfaceAlt,
|
|
561
577
|
"--store-text": colors.text,
|
|
578
|
+
"--store-muted": colors.textMuted,
|
|
579
|
+
"--store-line": colors.border,
|
|
580
|
+
"--store-header-background": colors.headerBackground,
|
|
581
|
+
"--store-header-text": colors.headerText,
|
|
582
|
+
"--store-footer-background": colors.footerBackground,
|
|
583
|
+
"--store-footer-text": colors.footerText,
|
|
562
584
|
"--container-width": `${layout?.containerWidth ?? 1280}px`,
|
|
563
585
|
"--border-radius": `${layout?.borderRadius ?? 18}px`,
|
|
564
586
|
} as CSSProperties;
|
|
565
587
|
const visible = context.home.content.sections.filter((section) => section.enabled).sort((a, b) => a.order - b.order);
|
|
566
588
|
const sections = visible.length ? visible : fallbackSections(context);
|
|
567
589
|
|
|
568
|
-
return <div className="store-shell nuvler-default-theme" data-theme-id="nuvler-default" data-theme-version="1.0.
|
|
590
|
+
return <div className="store-shell nuvler-default-theme" data-theme-id="nuvler-default" data-theme-version="1.0.2" style={style}>
|
|
569
591
|
<Header adapters={adapters} context={context} />
|
|
570
592
|
<div className="store-page"><RouteContent adapters={adapters} context={context} route={route} home={<main>{sections.map((section, index) => {
|
|
571
593
|
const Renderer = defaultSectionRegistry[section.type];
|