@catchdrift/cli 0.1.19 → 0.1.20

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.19",
3
+ "version": "0.1.20",
4
4
  "description": "CLI for Drift — install, check, and manage design system coverage for any React app.",
5
5
  "keywords": [
6
6
  "design-system",
@@ -397,67 +397,72 @@ export async function init(argv) {
397
397
  console.log('')
398
398
  p.outro(pc.green('Drift is set up ✓'))
399
399
 
400
- // Build next steps dynamically based on what was configured
401
- const nextSteps = []
402
-
403
- if (dsPackages?.length) {
404
- nextSteps.push(` ${pc.cyan('npx catchdrift sync')} Auto-populate registry from ${dsPackages.join(', ')}`)
405
- } else if (!sources.includes('storybook') || Object.keys(components).length === 0) {
406
- nextSteps.push(` ${pc.cyan('npx catchdrift sync')} Auto-populate registry once you have a DS package`)
407
- }
400
+ // ── What was set up (human-readable) ────────────────────────────────────────
401
+ const patchedShort = patched ? patched.replace(cwd + '/', '').replace(cwd, '') : null
402
+ console.log(`
403
+ ${pc.bold('What was set up:')}
404
+ ${pc.green('')} Overlay added to your app ${patchedShort ? pc.dim('(' + patchedShort + ')') : pc.yellow('— see manual step below')}
405
+ ${pc.green('✓')} AI rules written ${pc.dim(' your AI tools will use DS components by default')}
406
+ ${pc.green('')} Claude skills added ${pc.dim('— /drift-sync, /drift-scaffold, /drift-context, ...')}
407
+ ${addCI ? pc.green('✓') + ' GitHub check added ' + pc.dim('— every PR will show a coverage score') : pc.dim('○ GitHub check skipped')}`)
408
408
 
409
- nextSteps.push(` ${pc.cyan('npm run dev')} Start your app, then press ${pc.bold('D')} to open Drift`)
410
- nextSteps.push(` ${pc.cyan('npx catchdrift check')} Run a coverage scan ${pc.dim('(app must be running)')}`)
411
- nextSteps.push(` ${pc.cyan('git push')} First PR will show a drift delta comment`)
409
+ // ── Immediate next step specific to what was configured ───────────────────
410
+ console.log(`\n${pc.bold('Do this now:')}`)
412
411
 
413
- if (!sources.includes('storybook') && !storybook.found) {
414
- nextSteps.push(`\n ${pc.yellow('Storybook not set up')} — run ${pc.bold('npx storybook@latest init')} when ready,`)
415
- nextSteps.push(` then re-run ${pc.bold('npx catchdrift init')} to complete the coverage loop.`)
416
- }
412
+ if (figmaFiles.length > 0 && skillFiles.length > 0) {
413
+ console.log(`
414
+ Your components are in Figma. Pull them into the registry now:
417
415
 
418
- console.log(`
419
- ${pc.bold('What was created:')}
420
- drift.config.ts ${pc.dim('DS component registry')}
421
- ${rulesFiles.map(f => f.padEnd(34)).join('\n ')}${pc.dim('AI constraints')}
422
- ${skillFiles.length ? `.claude/commands/ ${pc.dim('Claude Code skills (/drift-sync, /drift-scaffold, etc.)')}` : ''}
423
- ${addCI ? '.github/workflows/drift-check.yml ' + pc.dim('CI drift check on every PR') : ''}
424
- ${patched ? patched.padEnd(34) + pc.dim('DriftOverlay added (dev-only)') : ''}
425
-
426
- ${pc.bold('Next steps:')}
427
- ${nextSteps.join('\n')}
428
-
429
- ${pc.bold('Your team\'s daily commands (Claude Code):')}
430
- ${pc.blue('/drift-context')} ${pc.dim('See DS state at a glance — run this first')}
431
- ${pc.blue('/drift-prd')} ${pc.dim('Generate a component inventory for a PRD')}
432
- ${pc.blue('/drift-scaffold')} ${pc.dim('Scaffold a new screen using only DS components')}
433
- ${pc.blue('/drift check')} ${pc.dim('Verify coverage before submitting a PR')}
434
- ${pc.blue('/drift-sync')} ${pc.dim('Re-sync registry after adding DS components')}
435
- ${pc.blue('/drift fix <X>')} ${pc.dim('Migrate a custom component to its DS equivalent')}
436
-
437
- ${pc.dim('Docs: https://catchdrift.ai · Issues: https://github.com/dyoon92/design-drift/issues')}
416
+ ${pc.cyan('1.')} Open ${pc.bold('Claude Code')} in this project folder
417
+ ${pc.cyan('2.')} Run: ${pc.blue('/drift-sync figma')}
418
+ This reads your Figma file and registers all your DS components.
419
+ ${pc.cyan('3.')} Run: ${pc.bold('npm run dev')} → press ${pc.bold('D')} → see live coverage
438
420
  `)
421
+ } else if (sources.includes('storybook') && Object.keys(components).length > 0) {
422
+ console.log(`
423
+ Your components were imported from Storybook ✓
439
424
 
440
- if (!patched) {
441
- console.log(`${pc.yellow('Manual step needed')} add DriftOverlay to your app entry point:
425
+ ${pc.cyan('1.')} Run: ${pc.bold('npm run dev')}
426
+ ${pc.cyan('2.')} Press ${pc.bold('D')} to open the Drift overlay you should see real coverage.
427
+ `)
428
+ } else if (dsPackages?.length) {
429
+ console.log(`
430
+ ${pc.cyan('1.')} Run: ${pc.bold('npx catchdrift sync')}
431
+ Scans your codebase for imports from ${dsPackages.join(', ')} and registers them.
432
+ ${pc.cyan('2.')} Run: ${pc.bold('npm run dev')} → press ${pc.bold('D')} → see live coverage
433
+ `)
434
+ } else {
435
+ console.log(`
436
+ ${pc.cyan('1.')} Run: ${pc.bold('npm run dev')} → press ${pc.bold('D')} → the overlay opens
437
+ Coverage will show 0% until you register your DS components.
438
+ ${pc.cyan('2.')} Add your components to ${pc.bold('drift.config.ts')} or connect a source:
439
+ • Figma: re-run ${pc.bold('npx catchdrift init')} and select Figma
440
+ • npm: add ${pc.bold('dsPackages')} to drift.config.ts, then run ${pc.bold('npx catchdrift sync')}
442
441
  `)
443
- console.log(` ${pc.dim('// src/main.tsx')}`)
444
- console.log(` import { DriftOverlay } from '@catchdrift/overlay'`)
445
- console.log(` import driftConfig from '../drift.config'`)
446
- console.log('')
447
- console.log(` ${pc.dim('// Last child in your root render:')}`)
448
- console.log(` {import.meta.env.DEV && <DriftOverlay config={driftConfig} />}`)
449
- console.log('')
450
442
  }
451
443
 
452
- if (dsPackages?.length) {
453
- console.log(`${pc.blue('Tip:')} Run ${pc.bold('npx catchdrift sync')} to auto-populate your component registry from ${dsPackages.join(', ')}.`)
454
- console.log('')
444
+ // ── Ongoing daily commands ───────────────────────────────────────────────────
445
+ console.log(`${pc.bold('Daily workflow (Claude Code):')}
446
+ ${pc.blue('/drift-context')} Check DS health — run this before starting work
447
+ ${pc.blue('/drift-scaffold')} Build a new screen using only DS components
448
+ ${pc.blue('/drift-sync')} Update registry after Figma or Storybook changes
449
+ ${pc.blue('npx catchdrift check')} Check coverage before submitting a PR
450
+ `)
451
+
452
+ if (!sources.includes('storybook') && !storybook.found) {
453
+ console.log(`${pc.yellow('Note:')} Storybook isn't set up yet. Run ${pc.bold('npx storybook@latest init')} when ready,`)
454
+ console.log(` then re-run ${pc.bold('npx catchdrift init')} to complete the coverage loop.\n`)
455
455
  }
456
456
 
457
- if (figmaFiles.length > 0) {
458
- console.log(`${pc.blue('Tip:')} Open the Drift overlay (press D), go to Settings, and paste your Figma personal access token to enable Figma component sync.`)
459
- console.log('')
457
+ if (!patchedShort) {
458
+ console.log(`${pc.yellow('Manual step needed')} add the overlay to your app entry point:`)
459
+ console.log(` import { DriftOverlay } from '@catchdrift/overlay'`)
460
+ console.log(` import driftConfig from './drift.config'`)
461
+ console.log(` // inside your root render, as the last child:`)
462
+ console.log(` {import.meta.env.DEV && <DriftOverlay config={driftConfig} />}\n`)
460
463
  }
464
+
465
+ console.log(pc.dim('Docs: https://catchdrift.ai · Issues: https://github.com/dyoon92/design-drift/issues'))
461
466
  }
462
467
 
463
468
  // ── Helpers ───────────────────────────────────────────────────────────────────