@onexapis/cli 1.1.21 → 1.1.24

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": "@onexapis/cli",
3
- "version": "1.1.21",
3
+ "version": "1.1.24",
4
4
  "description": "CLI tool for OneX theme development - scaffolds themes using @onexapis/core",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -20,7 +20,8 @@
20
20
  "dev": "tsup --watch",
21
21
  "type-check": "tsc --noEmit",
22
22
  "lint": "eslint src --ext .ts",
23
- "prepublishOnly": "pnpm run type-check && pnpm run build"
23
+ "prepublishOnly": "pnpm run type-check && pnpm run build",
24
+ "release": "npm version patch --no-git-tag-version && node -e \"const p=require('./package.json');const fs=require('fs');const cv=require('../core/package.json').version;p.dependencies['@onexapis/core']='^'+cv;fs.writeFileSync('package.json',JSON.stringify(p,null,2)+'\\n')\" && npm publish --access public && node -e \"const p=require('./package.json');const fs=require('fs');p.dependencies['@onexapis/core']='workspace:*';fs.writeFileSync('package.json',JSON.stringify(p,null,2)+'\\n')\""
24
25
  },
25
26
  "keywords": [
26
27
  "onex",
@@ -49,7 +50,7 @@
49
50
  },
50
51
  "dependencies": {
51
52
  "@aws-sdk/client-s3": "^3.470.0",
52
- "@onexapis/core": "workspace:*",
53
+ "@onexapis/core": "^1.0.2",
53
54
  "@tanstack/react-query": "^5.90.16",
54
55
  "adm-zip": "^0.5.16",
55
56
  "archiver": "^7.0.1",
@@ -2,7 +2,11 @@
2
2
  "mcpServers": {
3
3
  "onexthm": {
4
4
  "command": "npx",
5
- "args": ["@onexapis/theme-mcp"]
5
+ "args": ["-y", "@onexapis/theme-mcp"]
6
+ },
7
+ "figma": {
8
+ "command": "npx",
9
+ "args": ["-y", "figma-developer-mcp", "--figma-api-key=__FIGMA_API_KEY__", "--stdio"]
6
10
  }
7
11
  }
8
12
  }
@@ -911,16 +911,48 @@ export default ProductGrid;
911
911
 
912
912
  ## MCP Servers
913
913
 
914
- This project has TWO separate MCP servers. Do NOT confuse them:
914
+ This project has THREE MCP servers. Do NOT confuse them:
915
915
 
916
916
  ### `onexthm` MCP (Theme Development) — USE THIS
917
917
 
918
918
  Registered in `.mcp.json` in this project. Provides theme-specific tools:
919
919
 
920
- - `onexthm_create_section` — Generate section files (component + schema + index)
921
- - `onexthm_validate` — Validate theme structure
922
- - `onexthm_list_hooks` — List available hooks with examples
923
- - `onexthm_generate_schema` — Generate schema from natural language
920
+ - `onexthm_create_section` — Generate section files (component + schema + index) from structured input
921
+ - `onexthm_validate` — Validate theme structure (7 checks: entry file, config, sections, blocks, code quality, registry)
922
+ - `onexthm_list_hooks` — List available hooks with usage examples
923
+ - `onexthm_generate_schema` — Generate schema from natural language description
924
+ - `onexthm_from_figma` — **Convert Figma design to OneX section** (see Figma Integration below)
925
+
926
+ Resources (auto-loaded context):
927
+ - `onexthm://rules` — Theme development rules (DOs/DON'Ts)
928
+ - `onexthm://field-types` — All available field types and categories
929
+ - `onexthm://hooks` — Hooks reference with examples
930
+
931
+ Prompts (guided workflows):
932
+ - `create_section` — Guided section creation workflow
933
+ - `review_theme` — Review theme for issues
934
+ - `figma_to_section` — Full Figma-to-OneX conversion pipeline
935
+
936
+ ### `figma` MCP (Figma Design) — USE WITH `onexthm`
937
+
938
+ Registered in `.mcp.json`. Reads Figma designs for design-to-code conversion:
939
+
940
+ - `get_metadata` — Layer hierarchy (IDs, names, types, positions, sizes)
941
+ - `get_design_context` — React + Tailwind code suggestion for selected layers
942
+ - `get_variable_defs` — Design tokens (colors, typography, spacing variables)
943
+ - `get_screenshot` — Visual screenshot of selected elements
944
+ - `search_design_system` — Search components, variables, styles from libraries
945
+
946
+ **Setup**: Requires Figma API key in `.mcp.json`:
947
+ ```json
948
+ {
949
+ "figma": {
950
+ "command": "npx",
951
+ "args": ["-y", "figma-developer-mcp", "--figma-api-key=YOUR_KEY", "--stdio"]
952
+ }
953
+ }
954
+ ```
955
+ Get your key: Figma → Settings → Account → Personal access tokens.
924
956
 
925
957
  ### `onex-platform` MCP (Backend Services) — DO NOT USE FOR THEMES
926
958
 
@@ -932,10 +964,81 @@ This is for managing microservices on the OneXEOS platform. Its tools are:
932
964
 
933
965
  ### When to use which
934
966
 
935
- | Task | MCP to use |
936
- | ------------------------ | ---------------------------- |
937
- | Create a new section | `onexthm_create_section` |
938
- | Validate theme structure | `onexthm_validate` |
939
- | Look up available hooks | `onexthm_list_hooks` |
940
- | Deploy a backend service | `onex_deploy` (platform MCP) |
941
- | Check service health | `onex_status` (platform MCP) |
967
+ | Task | MCP to use |
968
+ | --------------------------------- | ----------------------------------------- |
969
+ | Create a new section | `onexthm_create_section` |
970
+ | Convert Figma design to section | `onexthm_from_figma` + `figma` tools |
971
+ | Validate theme structure | `onexthm_validate` |
972
+ | Look up available hooks | `onexthm_list_hooks` |
973
+ | Generate schema from description | `onexthm_generate_schema` |
974
+ | Read Figma design layers | `figma:get_metadata` |
975
+ | Get Figma design tokens | `figma:get_variable_defs` |
976
+ | Deploy a backend service | `onex_deploy` (platform MCP) |
977
+ | Check service health | `onex_status` (platform MCP) |
978
+
979
+ ## Figma → OneX Conversion
980
+
981
+ Convert Figma designs directly to OneX theme sections using the combined Figma + OneX MCP pipeline.
982
+
983
+ ### Quick Start
984
+
985
+ Use the `figma_to_section` prompt for a guided workflow:
986
+ ```
987
+ "Convert the selected Figma frame to a section called 'hero'"
988
+ ```
989
+
990
+ Or manually orchestrate the steps:
991
+
992
+ ```
993
+ 1. figma:get_metadata → Get layer hierarchy
994
+ 2. figma:get_variable_defs → Get design tokens
995
+ 3. figma:get_design_context → Get React+Tailwind code
996
+ 4. onexthm:onexthm_from_figma → Convert to OneX section files
997
+ 5. Write files to sections/ directory
998
+ 6. onexthm:onexthm_validate → Validate
999
+ 7. Register in sections-registry.ts
1000
+ ```
1001
+
1002
+ ### How Figma Layers Map to OneX
1003
+
1004
+ ```
1005
+ Figma Layer → OneX Concept
1006
+ ────────────────────────────────────────────────
1007
+ Top-level Frame → Section
1008
+ Nested Frame/Group → Block
1009
+ TEXT (large >=24px, bold >=600) → heading (h1-h6)
1010
+ TEXT (body <24px) → paragraph
1011
+ Button instance → button component
1012
+ Image node → image component
1013
+ Icon instance → icon component
1014
+ Badge/Label → badge component
1015
+ Repeating children (same shape) → Block definition
1016
+ Background color fill → backgroundColor setting
1017
+ Background image fill → backgroundImage setting
1018
+ Auto Layout horizontal → flex flex-row (Tailwind)
1019
+ Auto Layout vertical → flex flex-col (Tailwind)
1020
+ Auto Layout gap → gap-N (Tailwind)
1021
+ ```
1022
+
1023
+ ### `onexthm_from_figma` Tool Parameters
1024
+
1025
+ ```typescript
1026
+ {
1027
+ figmaMetadata: string, // Required: XML/JSON from figma:get_metadata
1028
+ figmaVariables?: string, // Optional: JSON from figma:get_variable_defs
1029
+ figmaCode?: string, // Optional: code from figma:get_design_context (fallback)
1030
+ sectionName: string, // Required: kebab-case name (e.g., "hero")
1031
+ category?: string, // Optional: section category
1032
+ themePrefix?: string, // Optional: type prefix (e.g., "my-simple")
1033
+ }
1034
+ ```
1035
+
1036
+ Returns generated files: `{name}.schema.ts`, `{name}-default.tsx`, `index.ts`, plus registry entry.
1037
+
1038
+ ### Pixel → Tailwind Reference
1039
+
1040
+ ```
1041
+ Font Size: 12→xs 14→sm 16→base 18→lg 20→xl 24→2xl 30→3xl 36→4xl 48→5xl 60→6xl
1042
+ Spacing: 4→1 8→2 12→3 16→4 20→5 24→6 32→8 40→10 48→12 64→16 80→20 96→24
1043
+ Weight: 100-400→normal 500→medium 600→semibold 700+→bold
1044
+ ```