inkbridge 0.1.0-beta.1 → 0.1.0-beta.11

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 CHANGED
@@ -1,12 +1,14 @@
1
+ <img src="https://inkbridge.ink/inkbridge-logo.png" alt="Inkbridge" width="80" />
2
+
1
3
  # Inkbridge
2
4
 
3
- Generates native Figma frames from your Tailwind React components and syncs design tokens back to your codebase via GitHub PRs.
5
+ Generates native Figma frames and reusable Figma component instances from your Tailwind React components, and syncs design tokens back to your codebase via GitHub PRs.
4
6
 
5
7
  ## What it does
6
8
 
7
9
  | Feature | Description |
8
10
  |---|---|
9
- | **Generate Design System Page** | Scans your Storybook stories and builds a pixel-accurate Figma page from your Tailwind classes |
11
+ | **Generate Design System Page** | Scans your Storybook stories and builds a pixel-accurate Figma page from your Tailwind classes, including reusable component instances for symbol candidates (CVA and non-CVA) |
10
12
  | **Push to Code** | Creates a GitHub PR from Figma token changes. Source can be CSS-first (`auto`/`css`) or DTCG (`dtcg`). |
11
13
  | **Detect & Sync Changes** | Detects class-level changes in Figma frames and proposes them as a GitHub PR |
12
14
  | **Dev Mode codegen** | Shows Tailwind class names for any selected node in Figma Dev Mode |
@@ -63,10 +65,18 @@ The plugin auto-discovers your server on ports `4000`, `3000`, and `5173`.
63
65
  1. Start dev server: `pnpm figma:dev`
64
66
  2. Open any Figma file
65
67
  3. **Plugins → Development → Inkbridge → Generate Design System Page**
66
- 4. The plugin scans your Storybook stories and builds a "Design System" page
68
+ 4. The plugin scans your Storybook stories and builds a "Design System" page with token tables, themed columns, grouped component sections, and responsive/state preview blocks where relevant
67
69
 
68
70
  Component data is always scanned live on every run — never stale. Re-run at any time to pick up changes.
69
71
 
72
+ For symbol candidates, the generated page renders real Figma component instances instead of only flattened frames:
73
+
74
+ - CVA components (for example `Button`) render as variant-aware instances.
75
+ - Non-CVA reusable components (for example `Card` compounds) can render as instances too.
76
+ - For compound instances, story text is applied by slot-aware overrides (for example title/description/content) when possible.
77
+
78
+ When a story instance uses non-default style/behavior props (for example `className`, `disabled`, `aria-invalid`, or unknown props), rendering falls back to direct frames for visual correctness.
79
+
70
80
  ### Manual scan
71
81
 
72
82
  ```bash
@@ -39,17 +39,17 @@ function detectStorybookPaths(root) {
39
39
  }
40
40
 
41
41
  // ---------------------------------------------------------------------------
42
- // postinstall — called automatically after `pnpm add -D inkhouse`
42
+ // postinstall — called automatically after `pnpm add -D inkbridge`
43
43
  // ---------------------------------------------------------------------------
44
44
  async function postinstall() {
45
45
  const pkg = JSON.parse(await readFile(join(PACKAGE_DIR, "package.json"), "utf8"));
46
- const manifestPath = join(PROJECT_ROOT, "node_modules/inkhouse/manifest.json");
46
+ const manifestPath = join(PROJECT_ROOT, "node_modules/inkbridge/manifest.json");
47
47
 
48
48
  console.log("");
49
- console.log(` ✓ inkhouse v${pkg.version} installed`);
49
+ console.log(` ✓ inkbridge v${pkg.version} installed`);
50
50
  console.log("");
51
51
  console.log(" Next: run setup to wire up the scanner endpoint and scripts:");
52
- console.log(" pnpm exec inkhouse setup");
52
+ console.log(" pnpm exec inkbridge setup");
53
53
  console.log("");
54
54
  console.log(" Then load the plugin in Figma Desktop:");
55
55
  console.log(" Plugins → Development → Import plugin from manifest");
@@ -67,10 +67,10 @@ async function setup() {
67
67
  const patchRouteSrc = join(PACKAGE_DIR, "templates/patch-tokens-route.ts");
68
68
  const pkgPath = join(PROJECT_ROOT, "package.json");
69
69
 
70
- // 1. Create inkhouse.config.json
71
- const inkhouseCfgPath = join(PROJECT_ROOT, "inkhouse.config.json");
72
- if (existsSync(inkhouseCfgPath)) {
73
- console.log(" ~ inkhouse.config.json already exists, skipping");
70
+ // 1. Create inkbridge.config.json
71
+ const inkbridgeCfgPath = join(PROJECT_ROOT, "inkbridge.config.json");
72
+ if (existsSync(inkbridgeCfgPath)) {
73
+ console.log(" ~ inkbridge.config.json already exists, skipping");
74
74
  } else {
75
75
  const detectedPaths = detectStorybookPaths(PROJECT_ROOT);
76
76
  const componentPaths = detectedPaths.length > 0 ? detectedPaths : ["src"];
@@ -79,11 +79,11 @@ async function setup() {
79
79
  exclude: [],
80
80
  onlyWithStories: true,
81
81
  };
82
- await writeFile(inkhouseCfgPath, JSON.stringify(cfg, null, 2) + "\n", "utf8");
82
+ await writeFile(inkbridgeCfgPath, JSON.stringify(cfg, null, 2) + "\n", "utf8");
83
83
  if (detectedPaths.length > 0) {
84
- console.log(` ✓ created inkhouse.config.json (detected paths: ${detectedPaths.join(", ")})`);
84
+ console.log(` ✓ created inkbridge.config.json (detected paths: ${detectedPaths.join(", ")})`);
85
85
  } else {
86
- console.log(" ✓ created inkhouse.config.json (defaulting to src/ — edit to customise)");
86
+ console.log(" ✓ created inkbridge.config.json (defaulting to src/ — edit to customise)");
87
87
  }
88
88
  }
89
89
 
@@ -112,7 +112,7 @@ async function setup() {
112
112
  pkg.scripts = pkg.scripts || {};
113
113
  const toAdd = {
114
114
  "figma:dev": "next dev",
115
- "figma:scan": "tsx node_modules/inkhouse/scanner/cli.ts",
115
+ "figma:scan": "tsx node_modules/inkbridge/scanner/cli.ts",
116
116
  };
117
117
  const added = [];
118
118
  for (const [k, v] of Object.entries(toAdd)) {
@@ -130,7 +130,7 @@ async function setup() {
130
130
  }
131
131
 
132
132
  // 5. Print manifest path
133
- const manifestPath = resolve(PROJECT_ROOT, "node_modules/inkhouse/manifest.json");
133
+ const manifestPath = resolve(PROJECT_ROOT, "node_modules/inkbridge/manifest.json");
134
134
  console.log("");
135
135
  console.log(" Setup complete. Load the plugin in Figma Desktop:");
136
136
  console.log(" Plugins → Development → Import plugin from manifest");
@@ -146,7 +146,7 @@ async function setup() {
146
146
  // path — print manifest path (useful reference)
147
147
  // ---------------------------------------------------------------------------
148
148
  function printPath() {
149
- const manifestPath = resolve(PROJECT_ROOT, "node_modules/inkhouse/manifest.json");
149
+ const manifestPath = resolve(PROJECT_ROOT, "node_modules/inkbridge/manifest.json");
150
150
  console.log(manifestPath);
151
151
  }
152
152
 
@@ -165,7 +165,7 @@ switch (command) {
165
165
  break;
166
166
  default:
167
167
  console.log("Usage:");
168
- console.log(" inkhouse setup Wire up scanner/token-patch routes + scripts (run once after install)");
169
- console.log(" inkhouse path Print the manifest.json path for Figma Desktop");
168
+ console.log(" inkbridge setup Wire up scanner/token-patch routes + scripts (run once after install)");
169
+ console.log(" inkbridge path Print the manifest.json path for Figma Desktop");
170
170
  break;
171
171
  }