@sudajs/cli 0.8.1 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudajs/cli",
3
- "version": "0.8.1",
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.2.0"
35
+ "@sudajs/theme-engine": "2.3.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@tailwindcss/postcss": "^4.3.0",
@@ -47,9 +47,9 @@
47
47
  "typescript": "^5.7.2",
48
48
  "vite": "^7.3.3",
49
49
  "vitest": "^3.2.4",
50
+ "@suda/build-config": "0.0.0",
50
51
  "@suda/eslint-config": "0.0.0",
51
- "@suda/tsconfig": "0.0.0",
52
- "@suda/build-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 `src/assets/`; the CLI copies them to `dist/assets/` during build.
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 `src/assets/`. The starter hero exposes a Logo field that defaults to `src/assets/suda-logo.svg`, so you can replace it with your own brand image or choose a different image in the editor.
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: "dist/index.js",
13
- clientEntry: "dist/runtime.client.js",
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.",