@sudajs/cli 0.8.2 → 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/dist/index.d.ts +72 -2
- package/dist/index.js +238 -242
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/templates/theme/AGENTS.md +2 -1
- package/templates/theme/README.md +11 -2
- package/templates/theme/src/manifest.ts +2 -2
- package/templates/theme/src/sections.tsx +1 -1
- package/templates/theme/src/templates.ts +1 -1
- /package/templates/theme/{src/assets → assets/brand}/suda-logo.svg +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudajs/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"suda": "./bin/suda.js"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"react": "^19.2.7",
|
|
33
33
|
"react-dom": "^19.2.7",
|
|
34
34
|
"zod": "^3.24.1",
|
|
35
|
-
"@sudajs/theme-engine": "2.
|
|
35
|
+
"@sudajs/theme-engine": "2.3.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@tailwindcss/postcss": "^4.3.0",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"vite": "^7.3.3",
|
|
49
49
|
"vitest": "^3.2.4",
|
|
50
50
|
"@suda/build-config": "0.0.0",
|
|
51
|
-
"@suda/
|
|
52
|
-
"@suda/
|
|
51
|
+
"@suda/eslint-config": "0.0.0",
|
|
52
|
+
"@suda/tsconfig": "0.0.0"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"build": "tsup",
|
|
@@ -12,7 +12,8 @@ This directory is a standalone Vite + React + Tailwind Suda theme generated by `
|
|
|
12
12
|
## Styling
|
|
13
13
|
|
|
14
14
|
- Tailwind v4 starts in `src/styles.css` with `@import "tailwindcss";` and `@source "./**/*.{ts,tsx}";`.
|
|
15
|
-
- Theme-local assets live in `
|
|
15
|
+
- Theme-local assets live in top-level `assets/`; the CLI copies them to `dist/assets/` during build. Use `themeAsset("assets/...")` instead of importing images from React code.
|
|
16
|
+
- Preview screenshots are required at `assets/preview/desktop.png`, `assets/preview/tablet.png`, and `assets/preview/mobile.png`; run `suda theme capture` to generate them.
|
|
16
17
|
- Customize `vite.config.ts`, `postcss.config.mjs`, and `src/styles.css` as needed.
|
|
17
18
|
|
|
18
19
|
## Commands
|
|
@@ -19,9 +19,18 @@ pnpm build
|
|
|
19
19
|
pnpm validate
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
`pnpm dev` starts the Vite-powered preview. `pnpm build` produces the Suda artifact contract in `dist/`, including `dist/index.js`, `dist/runtime.client.js`, `dist/manifest.json`, and `dist/styles.css`.
|
|
22
|
+
`pnpm dev` starts the Vite-powered preview. `pnpm build` produces the Suda artifact contract in `dist/`, including `dist/index.js`, `dist/runtime.client.js`, `dist/manifest.json`, and `dist/styles.css`. Published artifact paths omit the local `dist/` prefix.
|
|
23
23
|
|
|
24
|
-
Theme-local assets live in `
|
|
24
|
+
Theme-local assets live in top-level `assets/`. The starter hero exposes a Logo field that defaults to `assets/brand/suda-logo.svg`, so you can replace it with your own brand image or choose a different image in the editor.
|
|
25
|
+
|
|
26
|
+
Preview screenshots are required before publishing:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
suda theme capture
|
|
30
|
+
pnpm build
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
By default capture writes `assets/preview/desktop.png`, `assets/preview/tablet.png`, and `assets/preview/mobile.png`.
|
|
25
34
|
|
|
26
35
|
Fields can use `visibleIf: ({ props }, { fields }) => boolean` for synchronous dynamic visibility. The starter hero shows this by hiding the Logo picker when `showLogo` is false. Suda converts `visibleIf` to Puck `resolveFields` during normalization, and the generated AI/MCP section schema marks those fields as dynamically visible.
|
|
27
36
|
|
|
@@ -9,8 +9,8 @@ export const sourceManifest: ThemeSourceManifest = {
|
|
|
9
9
|
name: "__SUDA_THEME_KEY__",
|
|
10
10
|
categories: ["other"],
|
|
11
11
|
minEngineVersion: "0.0.0",
|
|
12
|
-
entry: "
|
|
13
|
-
clientEntry: "
|
|
12
|
+
entry: "index.js",
|
|
13
|
+
clientEntry: "runtime.client.js",
|
|
14
14
|
// Required. SudaCloud currently hosts SSR themes only; CSR/Hybrid postures
|
|
15
15
|
// are on the roadmap. Authoring `renderMode` is the contract a theme uses
|
|
16
16
|
// to declare which posture it expects from the host.
|
|
@@ -63,7 +63,7 @@ export const Hero: SudaComponentConfig<HeroProps> = {
|
|
|
63
63
|
},
|
|
64
64
|
defaultProps: {
|
|
65
65
|
showLogo: true,
|
|
66
|
-
logo: themeAsset("assets/suda-logo.svg"),
|
|
66
|
+
logo: themeAsset("assets/brand/suda-logo.svg"),
|
|
67
67
|
eyebrow: "New theme",
|
|
68
68
|
title: "Build with SudaCloud",
|
|
69
69
|
description: "Edit this starter section in the visual editor.",
|
|
@@ -14,7 +14,7 @@ export const starterPages: ThemeStarterPage[] = [
|
|
|
14
14
|
type: "Hero",
|
|
15
15
|
props: {
|
|
16
16
|
id: "Hero-1",
|
|
17
|
-
logo: themeAsset("assets/suda-logo.svg"),
|
|
17
|
+
logo: themeAsset("assets/brand/suda-logo.svg"),
|
|
18
18
|
eyebrow: "Starter page",
|
|
19
19
|
title: "Welcome to __SUDA_THEME_KEY__",
|
|
20
20
|
description: "This page was generated by suda theme init.",
|
|
File without changes
|