@catchdrift/cli 0.2.0 → 0.2.1

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.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "CLI for Drift — install, check, and manage design system coverage for any React app.",
5
5
  "keywords": [
6
6
  "design-system",
@@ -85,28 +85,41 @@ export async function init(argv) {
85
85
  }
86
86
  }
87
87
 
88
- // ── Step 2: Where does the DS live? ─────────────────────────────────────────
88
+ // ── Step 2: Do they have a DS at all? ────────────────────────────────────────
89
89
  console.log('')
90
- p.log.step('Where does your design system live? Select all that apply.')
91
- console.log('')
92
-
93
- const dsSources = await p.multiselect({
94
- message: 'DS source (you can pick more than one)',
95
- options: [
96
- { value: 'figma', label: 'Figma', hint: 'components published in a Figma file' },
97
- { value: 'storybook', label: 'Storybook', hint: 'stories at a URL' },
98
- { value: 'package', label: 'npm package / path', hint: 'e.g. @acme/ui or ./src/components' },
99
- { value: 'fresh', label: 'No DS yet — bootstrap from scratch', hint: 'pick Material UI, shadcn, Ant Design, etc.' },
100
- { value: 'manual', label: 'I\'ll type component names myself', hint: 'you can always run /drift-sync later' },
101
- ],
102
- required: false,
90
+ const hasDS = await p.confirm({
91
+ message: 'Do you already have a design system?',
92
+ initialValue: true,
103
93
  })
104
- if (p.isCancel(dsSources)) { p.cancel('Setup cancelled.'); process.exit(EXIT_CANCELED) }
94
+ if (p.isCancel(hasDS)) { p.cancel('Setup cancelled.'); process.exit(EXIT_CANCELED) }
95
+
96
+ let dsSources = []
97
+ if (hasDS) {
98
+ // ── Step 2b: Where does it live? ───────────────────────────────────────────
99
+ console.log('')
100
+ p.log.step('Where does your design system live? Select all that apply.')
101
+ console.log('')
102
+
103
+ const picked = await p.multiselect({
104
+ message: 'DS source (you can pick more than one)',
105
+ options: [
106
+ { value: 'figma', label: 'Figma', hint: 'components published in a Figma file' },
107
+ { value: 'storybook', label: 'Storybook', hint: 'stories at a URL' },
108
+ { value: 'package', label: 'npm package / path', hint: 'e.g. @acme/ui or ./src/components' },
109
+ { value: 'manual', label: 'Type names manually', hint: 'you can always run /drift-sync later' },
110
+ ],
111
+ required: false,
112
+ })
113
+ if (p.isCancel(picked)) { p.cancel('Setup cancelled.'); process.exit(EXIT_CANCELED) }
114
+ dsSources = Array.isArray(picked) ? picked : []
115
+ } else {
116
+ dsSources = ['fresh']
117
+ }
105
118
 
106
- const sources = Array.isArray(dsSources) ? dsSources : []
119
+ const sources = dsSources
107
120
 
108
- // ── Step 2b: Bootstrap foundation picker ─────────────────────────────────────
109
- // Fires when user picks "No DS yet — bootstrap from scratch"
121
+ // ── Step 2c: Bootstrap foundation picker ─────────────────────────────────────
122
+ // Fires when user has no existing DS
110
123
  const DS_FOUNDATIONS = [
111
124
  { value: 'shadcn', label: 'shadcn/ui', hint: 'Radix + Tailwind — copy-paste components', pkg: '@radix-ui/react-dialog', install: 'npx shadcn@latest init', docs: 'https://ui.shadcn.com' },
112
125
  { value: 'mui', label: 'Material UI', hint: 'Google Material Design — battle-tested ecosystem', pkg: '@mui/material', install: 'npm install @mui/material @emotion/react @emotion/styled', docs: 'https://mui.com/material-ui/' },
package/src/index.mjs CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import pc from 'picocolors'
7
7
 
8
- const VERSION = '0.2.0'
8
+ const VERSION = '0.2.1'
9
9
 
10
10
  const HELP = `
11
11
  ${pc.bold(pc.blue('catchdrift'))} — Design system compliance for teams shipping with AI