@sudajs/cli 0.12.1 → 0.12.3

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.12.1",
3
+ "version": "0.12.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "suda": "./bin/suda.js"
@@ -34,7 +34,7 @@
34
34
  "react": "^19.2.7",
35
35
  "react-dom": "^19.2.7",
36
36
  "zod": "^3.24.1",
37
- "@sudajs/theme-engine": "4.0.0"
37
+ "@sudajs/theme-engine": "4.0.2"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@tailwindcss/postcss": "^4.3.0",
@@ -4,6 +4,47 @@ This directory is a standalone Vite + React + Tailwind Suda theme generated by `
4
4
 
5
5
  Your job in a theme project is to create a complete, publishable theme with theme-specific components, realistic starter pages, scoped styling, assets, and AI metadata. Do not build pages by assembling generic engine components; those are reserved for end users who need supplemental editing blocks after the theme is installed.
6
6
 
7
+ ## Component naming and editor organization
8
+
9
+ Use the clean Puck Cloud component naming style as a reference for
10
+ editor-facing section names and public component keys. Do not copy its component
11
+ list 1:1; learn the style: names should be short, concrete, and easy to infer
12
+ from the editor without opening the component.
13
+
14
+ - Group components by page role when `pageConfig.categories` is used. Category
15
+ `title` values must use `t(...)`, the same as component and field labels.
16
+ Keep the translated text short and task-oriented, such as `Introduction`,
17
+ `Content`, `Social Proof`, `Business`, `CMS`, and `Layout`, ordered roughly
18
+ by where those sections appear in a page.
19
+ - Name components with concise PascalCase nouns that describe the visitor-facing
20
+ pattern. For example, `ArticleCard` should clearly suggest an article preview
21
+ card, `FeatureCards` should suggest a group of feature cards, and `ContactUs`
22
+ should suggest a contact section. Use names that fit the theme's actual
23
+ sections rather than forcing a fixed list.
24
+ - Avoid theme names, implementation details, and filler suffixes such as
25
+ `Section`, `Component`, `Block`, `New`, or `Custom` unless the word is part
26
+ of the public pattern users recognize.
27
+ - When a theme needs multiple components with the same broad purpose, prefer a
28
+ friendly semantic variant name that tells editors what is different at a
29
+ glance. Use the content, media, layout, density, or page job as the
30
+ differentiator, such as `HeroImage`, `HeroVideo`, `MediaHero`,
31
+ `FeatureCards`, `FeatureList`, `PricingTable`, `PricingCards`,
32
+ `TestimonialsCarousel`, or `TestimonialsGrid`.
33
+ - Use numbered variants only as a fallback when the variants genuinely share
34
+ the same purpose and no concise semantic name would make the difference
35
+ clearer. In that case keep the base name and append a numbered variant to the
36
+ public key and editor label, for example `FeatureCards-1`,
37
+ `FeatureCards-2`, `Hero-1`, `Hero-2`, `Cta-1`, or `Cta-2`. Treat `-1` as the
38
+ primary or most generally useful option, and use later numbers for variants
39
+ with a clearly different visual rhythm, content density, or business
40
+ emphasis.
41
+ - Explain the difference between semantic or numbered variants in
42
+ `ai.instructions` and placement guidance so AI chooses the right one instead
43
+ of treating them as interchangeable duplicates.
44
+ - Keep instance ids separate from component type names. `content[].type` must
45
+ match the public component key, while `content[].props.id` remains a stable
46
+ unique instance id for that concrete page item.
47
+
7
48
  ## Theme-building workflow
8
49
 
9
50
  When you add or change a section, complete the whole theme authoring loop in
@@ -357,7 +398,7 @@ Theme editor labels are localized by the host editor. Use the template's
357
398
  other editor-facing configuration string.
358
399
 
359
400
  - Import `t` from `./i18n.js` in files that define `pageConfig`, `layoutConfig`,
360
- fields, options, or local blocks.
401
+ categories, fields, options, or local blocks.
361
402
  - Write labels as stable dot-path keys, for example
362
403
  `label: t("sections.hero.fields.title")`, not hardcoded strings.
363
404
  - Add every key used with `t(...)` to `src/locales/en.json`. This file is the
@@ -429,10 +470,12 @@ radius, shadows, or spacing.
429
470
  `mutedForeground`) and the radius tokens the CSS consumes (`card`, `button`,
430
471
  `input`). Do not invent platform-facing token keys without checking the
431
472
  generated types first.
432
- - Expose the design system at the layout root only:
433
- `designSystem: designSystemField(t("common.fields.designSystem"),
434
- sourceManifest.designSystem)`, with
435
- `createThemeDesignDefault(sourceManifest.designSystem)` in `ROOT_DEFAULTS`.
473
+ - Expose the design system at the layout root only, for example:
474
+ ```ts
475
+ designSystem: designSystemField(t("common.fields.designSystem"), sourceManifest.designSystem);
476
+ ```
477
+ Use `createThemeDesignDefault(sourceManifest.designSystem)` in
478
+ `ROOT_DEFAULTS`.
436
479
  - In the root render, resolve the value once with
437
480
  `resolveThemeDesignTokens(sourceManifest.designSystem, props.designSystem)`
438
481
  and apply `createThemeDesignCssVariables(tokens)` to the theme root element.
@@ -1,10 +1,17 @@
1
1
  import type { LayoutData, SudaConfig } from "@sudajs/theme-engine";
2
2
 
3
+ import { t } from "./i18n.js";
3
4
  import { LAYOUT_COMPONENTS, rootConfig } from "./layout.js";
4
5
  import { SECTION_COMPONENTS } from "./sections.js";
5
6
 
6
7
  export const pageConfig: SudaConfig = {
7
8
  components: SECTION_COMPONENTS,
9
+ categories: {
10
+ sections: {
11
+ title: t("common.categories.sections"),
12
+ components: ["Hero", "FeatureGrid", "FeaturedPosts", "Testimonial", "CallToAction"],
13
+ },
14
+ },
8
15
  };
9
16
 
10
17
  export const layoutConfig: SudaConfig = {
@@ -1,4 +1,9 @@
1
1
  {
2
+ "common": {
3
+ "categories": {
4
+ "sections": "Sections"
5
+ }
6
+ },
2
7
  "layout": {
3
8
  "root": {
4
9
  "fields": {