@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 +1 -1
- package/src/commands/init.mjs +31 -18
- package/src/index.mjs +1 -1
package/package.json
CHANGED
package/src/commands/init.mjs
CHANGED
|
@@ -85,28 +85,41 @@ export async function init(argv) {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
// ── Step 2:
|
|
88
|
+
// ── Step 2: Do they have a DS at all? ────────────────────────────────────────
|
|
89
89
|
console.log('')
|
|
90
|
-
|
|
91
|
-
|
|
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(
|
|
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 =
|
|
119
|
+
const sources = dsSources
|
|
107
120
|
|
|
108
|
-
// ── Step
|
|
109
|
-
// Fires when user
|
|
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/' },
|