@catchdrift/cli 0.1.6 → 0.1.7

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": "@catchdrift/cli",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "CLI for Drift — install, check, and manage design system coverage for any React app.",
5
5
  "keywords": [
6
6
  "design-system",
@@ -102,6 +102,33 @@ export async function init(argv) {
102
102
 
103
103
  const sources = Array.isArray(dsSources) ? dsSources : []
104
104
 
105
+ // ── Storybook nudge — needed to close the Figma → code loop ─────────────────
106
+ if (sources.includes('figma') && !sources.includes('storybook') && !storybook.found) {
107
+ p.log.warn(
108
+ 'Storybook is needed to complete the loop.\n' +
109
+ ' Without it, the overlay has no way to identify which components are from your DS.\n' +
110
+ ' Figma tells Drift what exists in design — Storybook tells it what exists in code.'
111
+ )
112
+ const setupSB = await p.confirm({
113
+ message: 'Set up Storybook now? (runs npx storybook@latest init)',
114
+ initialValue: true,
115
+ })
116
+ if (p.isCancel(setupSB)) { p.cancel('Setup cancelled.'); process.exit(EXIT_CANCELED) }
117
+
118
+ if (setupSB) {
119
+ spinner.start('Running npx storybook@latest init...')
120
+ try {
121
+ execSync('npx storybook@latest init --yes', { cwd, stdio: 'ignore' })
122
+ spinner.stop('Storybook installed — it will be available at http://localhost:6006')
123
+ sources.push('storybook')
124
+ } catch {
125
+ spinner.stop('Storybook install failed — run `npx storybook@latest init` manually, then re-run `npx catchdrift init`')
126
+ }
127
+ } else {
128
+ p.log.info('Continuing without Storybook. Add it later and re-run `npx catchdrift init` to complete the loop.')
129
+ }
130
+ }
131
+
105
132
  // ── Step 3a: Figma ───────────────────────────────────────────────────────────
106
133
  let figmaFileKey, figmaToken, figmaWIPPages
107
134
  if (sources.includes('figma')) {