@buoy-design/cli 0.1.0 → 0.1.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.
Files changed (70) hide show
  1. package/LICENSE +21 -0
  2. package/dist/commands/baseline.d.ts +39 -0
  3. package/dist/commands/baseline.d.ts.map +1 -0
  4. package/dist/commands/baseline.js +298 -0
  5. package/dist/commands/baseline.js.map +1 -0
  6. package/dist/commands/bootstrap.js +1 -1
  7. package/dist/commands/bootstrap.js.map +1 -1
  8. package/dist/commands/ci.d.ts +2 -2
  9. package/dist/commands/ci.d.ts.map +1 -1
  10. package/dist/commands/ci.js +107 -129
  11. package/dist/commands/ci.js.map +1 -1
  12. package/dist/commands/drift.d.ts +1 -1
  13. package/dist/commands/drift.d.ts.map +1 -1
  14. package/dist/commands/drift.js +68 -95
  15. package/dist/commands/drift.js.map +1 -1
  16. package/dist/commands/index.d.ts +9 -8
  17. package/dist/commands/index.d.ts.map +1 -1
  18. package/dist/commands/index.js +9 -8
  19. package/dist/commands/index.js.map +1 -1
  20. package/dist/commands/init.d.ts.map +1 -1
  21. package/dist/commands/init.js +61 -86
  22. package/dist/commands/init.js.map +1 -1
  23. package/dist/commands/plugins.d.ts.map +1 -1
  24. package/dist/commands/plugins.js +32 -41
  25. package/dist/commands/plugins.js.map +1 -1
  26. package/dist/commands/scan.d.ts +1 -1
  27. package/dist/commands/scan.d.ts.map +1 -1
  28. package/dist/commands/scan.js +59 -211
  29. package/dist/commands/scan.js.map +1 -1
  30. package/dist/commands/status.d.ts +1 -1
  31. package/dist/commands/status.d.ts.map +1 -1
  32. package/dist/commands/status.js +79 -116
  33. package/dist/commands/status.js.map +1 -1
  34. package/dist/detect/frameworks.d.ts +6 -1
  35. package/dist/detect/frameworks.d.ts.map +1 -1
  36. package/dist/detect/frameworks.js +43 -69
  37. package/dist/detect/frameworks.js.map +1 -1
  38. package/dist/index.d.ts +3 -3
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +7 -6
  41. package/dist/index.js.map +1 -1
  42. package/dist/integrations/github-formatter.d.ts +3 -0
  43. package/dist/integrations/github-formatter.d.ts.map +1 -0
  44. package/dist/integrations/github-formatter.js +69 -0
  45. package/dist/integrations/github-formatter.js.map +1 -0
  46. package/dist/integrations/github.d.ts +20 -0
  47. package/dist/integrations/github.d.ts.map +1 -0
  48. package/dist/integrations/github.js +69 -0
  49. package/dist/integrations/github.js.map +1 -0
  50. package/dist/integrations/index.d.ts +4 -0
  51. package/dist/integrations/index.d.ts.map +1 -0
  52. package/dist/integrations/index.js +4 -0
  53. package/dist/integrations/index.js.map +1 -0
  54. package/dist/scan/orchestrator.d.ts +76 -0
  55. package/dist/scan/orchestrator.d.ts.map +1 -0
  56. package/dist/scan/orchestrator.js +247 -0
  57. package/dist/scan/orchestrator.js.map +1 -0
  58. package/package.json +26 -17
  59. package/dist/plugins/index.d.ts +0 -3
  60. package/dist/plugins/index.d.ts.map +0 -1
  61. package/dist/plugins/index.js +0 -3
  62. package/dist/plugins/index.js.map +0 -1
  63. package/dist/plugins/loader.d.ts +0 -11
  64. package/dist/plugins/loader.d.ts.map +0 -1
  65. package/dist/plugins/loader.js +0 -77
  66. package/dist/plugins/loader.js.map +0 -1
  67. package/dist/plugins/registry.d.ts +0 -15
  68. package/dist/plugins/registry.d.ts.map +0 -1
  69. package/dist/plugins/registry.js +0 -32
  70. package/dist/plugins/registry.js.map +0 -1
@@ -1,258 +1,106 @@
1
- import { Command } from 'commander';
2
- import chalk from 'chalk';
3
- import { loadConfig, getConfigPath } from '../config/loader.js';
4
- import { spinner, success, error, info, warning, header, keyValue, newline, setJsonMode } from '../output/reporters.js';
5
- import { loadDiscoveredPlugins, registry } from '../plugins/index.js';
6
- import { formatComponentTable, formatTokenTable } from '../output/formatters.js';
1
+ import { Command } from "commander";
2
+ import chalk from "chalk";
3
+ import { loadConfig, getConfigPath } from "../config/loader.js";
4
+ import { spinner, success, error, info, warning, header, keyValue, newline, setJsonMode, } from "../output/reporters.js";
5
+ import { formatComponentTable, formatTokenTable, } from "../output/formatters.js";
6
+ import { ScanOrchestrator } from "../scan/orchestrator.js";
7
7
  export function createScanCommand() {
8
- const cmd = new Command('scan')
9
- .description('Scan sources for components and tokens')
10
- .option('-s, --source <sources...>', 'Specific sources to scan (react, vue, svelte, angular, tokens, etc.)')
11
- .option('--json', 'Output as JSON')
12
- .option('-v, --verbose', 'Verbose output')
8
+ const cmd = new Command("scan")
9
+ .description("Scan sources for components and tokens")
10
+ .option("-s, --source <sources...>", "Specific sources to scan (react, vue, svelte, angular, tokens, etc.)")
11
+ .option("--json", "Output as JSON")
12
+ .option("-v, --verbose", "Verbose output")
13
13
  .action(async (options) => {
14
14
  // Set JSON mode before creating spinner to redirect spinner to stderr
15
15
  if (options.json) {
16
16
  setJsonMode(true);
17
17
  }
18
- const spin = spinner('Loading configuration...');
18
+ const spin = spinner("Loading configuration...");
19
19
  try {
20
20
  // Load config
21
21
  const { config, configPath } = await loadConfig();
22
- spin.text = 'Loading plugins...';
23
- // Load discovered plugins from package.json
24
- const plugins = await loadDiscoveredPlugins({ projectRoot: process.cwd() });
25
- if (plugins.length > 0 && options.verbose) {
26
- spin.stop();
27
- console.log(chalk.dim(`Loaded ${plugins.length} plugin(s): ${plugins.map(p => p.metadata.name).join(', ')}`));
28
- spin.start();
29
- }
30
- spin.text = 'Scanning sources...';
22
+ spin.text = "Scanning sources...";
31
23
  if (options.verbose && configPath) {
32
24
  spin.stop();
33
25
  info(`Using config: ${configPath}`);
34
26
  spin.start();
35
27
  }
36
- // Determine which sources to scan
37
- const sourcesToScan = options.source || [];
38
- if (sourcesToScan.length === 0) {
39
- // JS Frameworks
40
- if (config.sources.react?.enabled)
41
- sourcesToScan.push('react');
42
- if (config.sources.vue?.enabled)
43
- sourcesToScan.push('vue');
44
- if (config.sources.svelte?.enabled)
45
- sourcesToScan.push('svelte');
46
- if (config.sources.angular?.enabled)
47
- sourcesToScan.push('angular');
48
- if (config.sources.webcomponent?.enabled)
49
- sourcesToScan.push('webcomponent');
50
- // Templates
51
- if (config.sources.templates?.enabled)
52
- sourcesToScan.push('templates');
53
- // Design tools
54
- if (config.sources.figma?.enabled)
55
- sourcesToScan.push('figma');
56
- if (config.sources.storybook?.enabled)
57
- sourcesToScan.push('storybook');
58
- if (config.sources.tokens?.enabled)
59
- sourcesToScan.push('tokens');
60
- }
28
+ // Create orchestrator and determine sources
29
+ const orchestrator = new ScanOrchestrator(config);
30
+ const sourcesToScan = options.source || orchestrator.getEnabledSources();
61
31
  if (sourcesToScan.length === 0) {
62
32
  spin.stop();
63
33
  // Check if config file even exists
64
34
  const configExists = getConfigPath() !== null;
65
35
  if (!configExists) {
66
- error('No configuration found');
67
- console.log('');
68
- info('Run ' + chalk.cyan('buoy init') + ' to set up your project');
69
- console.log('');
70
- info('This will auto-detect components, tokens, and more.');
36
+ error("No configuration found");
37
+ console.log("");
38
+ info("Run " + chalk.cyan("buoy init") + " to set up your project");
39
+ console.log("");
40
+ info("This will auto-detect components, tokens, and more.");
71
41
  }
72
42
  else {
73
- warning('No sources to scan');
74
- console.log('');
75
- info('Your config file has no sources enabled.');
76
- console.log('');
77
- info('This can happen if:');
78
- info(' Auto-detection found no components');
79
- info(' No token files (CSS variables, JSON tokens) were found');
80
- info(' This is not a frontend project');
81
- console.log('');
82
- info('To fix:');
83
- info(' 1. Run ' + chalk.cyan('buoy bootstrap') + ' to extract tokens from existing code');
84
- info(' 2. Run ' + chalk.cyan('buoy build') + ' to generate a design system with AI');
85
- info(' 3. Or add paths manually to your config');
43
+ warning("No sources to scan");
44
+ console.log("");
45
+ info("Your config file has no sources enabled.");
46
+ console.log("");
47
+ info("This can happen if:");
48
+ info(" - Auto-detection found no components");
49
+ info(" - No token files (CSS variables, JSON tokens) were found");
50
+ info(" - This is not a frontend project");
51
+ console.log("");
52
+ info("To fix:");
53
+ info(" 1. Run " +
54
+ chalk.cyan("buoy bootstrap") +
55
+ " to extract tokens from existing code");
56
+ info(" 2. Run " +
57
+ chalk.cyan("buoy build") +
58
+ " to generate a design system with AI");
59
+ info(" 3. Or add paths manually to your config");
86
60
  }
87
61
  return;
88
62
  }
89
- // Import scanners dynamically
90
- const { ReactComponentScanner, VueComponentScanner, SvelteComponentScanner, AngularComponentScanner, WebComponentScanner, TemplateScanner, TokenScanner, } = await import('@buoy-design/scanners/git');
91
- const results = {
92
- components: [],
93
- tokens: [],
94
- errors: [],
95
- };
96
- // Scan each source
97
- for (const source of sourcesToScan) {
98
- spin.text = `Scanning ${source}...`;
99
- try {
100
- // Check if a plugin can handle this source type
101
- const plugin = registry.getByDetection(source);
102
- if (plugin && plugin.scan) {
103
- // Use plugin scanner
104
- if (options.verbose) {
105
- spin.stop();
106
- console.log(chalk.dim(` Using plugin "${plugin.metadata.name}" for ${source}`));
107
- spin.start();
108
- }
109
- const sourceConfig = config.sources[source];
110
- const pluginResult = await plugin.scan({
111
- projectRoot: process.cwd(),
112
- config: sourceConfig || {},
113
- include: sourceConfig?.include,
114
- exclude: sourceConfig?.exclude,
115
- });
116
- results.components.push(...pluginResult.components);
117
- results.tokens.push(...pluginResult.tokens);
118
- if (pluginResult.errors.length > 0) {
119
- results.errors.push(...pluginResult.errors.map(e => `[${source}] ${e.file || ''}: ${e.message}`));
120
- }
121
- }
122
- else {
123
- // Fall back to bundled scanners
124
- // React
125
- if (source === 'react' && config.sources.react) {
126
- const scanner = new ReactComponentScanner({
127
- projectRoot: process.cwd(),
128
- include: config.sources.react.include,
129
- exclude: config.sources.react.exclude,
130
- designSystemPackage: config.sources.react.designSystemPackage,
131
- });
132
- const scanResult = await scanner.scan();
133
- results.components.push(...scanResult.items);
134
- if (scanResult.errors.length > 0) {
135
- results.errors.push(...scanResult.errors.map(e => `[${source}] ${e.file || ''}: ${e.message}`));
136
- }
137
- }
138
- // Vue
139
- if (source === 'vue' && config.sources.vue) {
140
- const scanner = new VueComponentScanner({
141
- projectRoot: process.cwd(),
142
- include: config.sources.vue.include,
143
- exclude: config.sources.vue.exclude,
144
- });
145
- const scanResult = await scanner.scan();
146
- results.components.push(...scanResult.items);
147
- if (scanResult.errors.length > 0) {
148
- results.errors.push(...scanResult.errors.map(e => `[${source}] ${e.file || ''}: ${e.message}`));
149
- }
150
- }
151
- // Svelte
152
- if (source === 'svelte' && config.sources.svelte) {
153
- const scanner = new SvelteComponentScanner({
154
- projectRoot: process.cwd(),
155
- include: config.sources.svelte.include,
156
- exclude: config.sources.svelte.exclude,
157
- });
158
- const scanResult = await scanner.scan();
159
- results.components.push(...scanResult.items);
160
- if (scanResult.errors.length > 0) {
161
- results.errors.push(...scanResult.errors.map(e => `[${source}] ${e.file || ''}: ${e.message}`));
162
- }
163
- }
164
- // Angular
165
- if (source === 'angular' && config.sources.angular) {
166
- const scanner = new AngularComponentScanner({
167
- projectRoot: process.cwd(),
168
- include: config.sources.angular.include,
169
- exclude: config.sources.angular.exclude,
170
- });
171
- const scanResult = await scanner.scan();
172
- results.components.push(...scanResult.items);
173
- if (scanResult.errors.length > 0) {
174
- results.errors.push(...scanResult.errors.map(e => `[${source}] ${e.file || ''}: ${e.message}`));
175
- }
176
- }
177
- // Web Components (Lit, Stencil)
178
- if (source === 'webcomponent' && config.sources.webcomponent) {
179
- const scanner = new WebComponentScanner({
180
- projectRoot: process.cwd(),
181
- include: config.sources.webcomponent.include,
182
- exclude: config.sources.webcomponent.exclude,
183
- framework: config.sources.webcomponent.framework,
184
- });
185
- const scanResult = await scanner.scan();
186
- results.components.push(...scanResult.items);
187
- if (scanResult.errors.length > 0) {
188
- results.errors.push(...scanResult.errors.map(e => `[${source}] ${e.file || ''}: ${e.message}`));
189
- }
190
- }
191
- // Templates (Blade, ERB, Twig, etc.)
192
- if (source === 'templates' && config.sources.templates) {
193
- const scanner = new TemplateScanner({
194
- projectRoot: process.cwd(),
195
- include: config.sources.templates.include,
196
- exclude: config.sources.templates.exclude,
197
- templateType: config.sources.templates.type,
198
- });
199
- const scanResult = await scanner.scan();
200
- results.components.push(...scanResult.items);
201
- if (scanResult.errors.length > 0) {
202
- results.errors.push(...scanResult.errors.map(e => `[${source}] ${e.file || ''}: ${e.message}`));
203
- }
204
- }
205
- // Tokens
206
- if (source === 'tokens' && config.sources.tokens) {
207
- const scanner = new TokenScanner({
208
- projectRoot: process.cwd(),
209
- files: config.sources.tokens.files,
210
- cssVariablePrefix: config.sources.tokens.cssVariablePrefix,
211
- });
212
- const scanResult = await scanner.scan();
213
- results.tokens.push(...scanResult.items);
214
- if (scanResult.errors.length > 0) {
215
- results.errors.push(...scanResult.errors.map(e => `[${source}] ${e.file || ''}: ${e.message}`));
216
- }
217
- }
218
- // TODO: Add figma, storybook scanners
219
- }
220
- }
221
- catch (err) {
222
- const message = err instanceof Error ? err.message : String(err);
223
- results.errors.push(`[${source}] ${message}`);
224
- }
225
- }
63
+ // Run the scan using orchestrator
64
+ const results = await orchestrator.scan({
65
+ sources: sourcesToScan,
66
+ onProgress: (msg) => {
67
+ spin.text = msg;
68
+ },
69
+ });
226
70
  spin.stop();
227
71
  // Output results
228
72
  if (options.json) {
229
- console.log(JSON.stringify(results, null, 2));
73
+ console.log(JSON.stringify({
74
+ components: results.components,
75
+ tokens: results.tokens,
76
+ errors: results.errors.map((e) => `[${e.source}] ${e.file || ""}: ${e.message}`),
77
+ }, null, 2));
230
78
  return;
231
79
  }
232
- header('Scan Results');
80
+ header("Scan Results");
233
81
  newline();
234
- keyValue('Components found', String(results.components.length));
235
- keyValue('Tokens found', String(results.tokens.length));
236
- keyValue('Errors', String(results.errors.length));
82
+ keyValue("Components found", String(results.components.length));
83
+ keyValue("Tokens found", String(results.tokens.length));
84
+ keyValue("Errors", String(results.errors.length));
237
85
  newline();
238
86
  if (results.components.length > 0) {
239
- header('Components');
87
+ header("Components");
240
88
  console.log(formatComponentTable(results.components));
241
89
  newline();
242
90
  }
243
91
  if (results.tokens.length > 0) {
244
- header('Tokens');
92
+ header("Tokens");
245
93
  console.log(formatTokenTable(results.tokens));
246
94
  newline();
247
95
  }
248
96
  if (results.errors.length > 0) {
249
- header('Errors');
97
+ header("Errors");
250
98
  for (const err of results.errors) {
251
- error(err);
99
+ error(`[${err.source}] ${err.file || ""}: ${err.message}`);
252
100
  }
253
101
  newline();
254
102
  }
255
- success('Scan complete');
103
+ success("Scan complete");
256
104
  }
257
105
  catch (err) {
258
106
  spin.stop();
@@ -1 +1 @@
1
- {"version":3,"file":"scan.js","sourceRoot":"","sources":["../../src/commands/scan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACxH,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEjF,MAAM,UAAU,iBAAiB;IAC/B,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;SAC5B,WAAW,CAAC,wCAAwC,CAAC;SACrD,MAAM,CAAC,2BAA2B,EAAE,sEAAsE,CAAC;SAC3G,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;SAClC,MAAM,CAAC,eAAe,EAAE,gBAAgB,CAAC;SACzC,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,sEAAsE;QACtE,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,WAAW,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;QACD,MAAM,IAAI,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;QAEjD,IAAI,CAAC;YACH,cAAc;YACd,MAAM,EAAE,MAAM,EAAE,UAAU,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 import { Command } from "commander";
2
2
  export declare function createStatusCommand(): Command;
3
3
  //# sourceMappingURL=status.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAepC,wBAAgB,mBAAmB,IAAI,OAAO,CA8O7C"}
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,wBAAgB,mBAAmB,IAAI,OAAO,CAuM7C"}
@@ -1,104 +1,46 @@
1
- import { Command } from 'commander';
2
- import chalk from 'chalk';
3
- import { loadConfig, getConfigPath } from '../config/loader.js';
4
- import { spinner, success, error, info, coverageGrid, setJsonMode, } from '../output/reporters.js';
5
- import { ProjectDetector } from '../detect/project-detector.js';
1
+ import { Command } from "commander";
2
+ import chalk from "chalk";
3
+ import { loadConfig, getConfigPath } from "../config/loader.js";
4
+ import { spinner, success, error, info, coverageGrid, setJsonMode, } from "../output/reporters.js";
5
+ import { ProjectDetector } from "../detect/project-detector.js";
6
+ import { ScanOrchestrator } from "../scan/orchestrator.js";
6
7
  export function createStatusCommand() {
7
- const cmd = new Command('status')
8
- .description('Show design system coverage at a glance')
9
- .option('--json', 'Output as JSON')
10
- .option('-v, --verbose', 'Verbose output')
8
+ const cmd = new Command("status")
9
+ .description("Show design system coverage at a glance")
10
+ .option("--json", "Output as JSON")
11
+ .option("-v, --verbose", "Verbose output")
11
12
  .action(async (options) => {
12
13
  // Set JSON mode before creating spinner to redirect spinner to stderr
13
14
  if (options.json) {
14
15
  setJsonMode(true);
15
16
  }
16
- const spin = spinner('Analyzing design system coverage...');
17
+ const spin = spinner("Analyzing design system coverage...");
17
18
  try {
18
19
  // Check if config exists
19
20
  const configExists = getConfigPath() !== null;
20
21
  if (!configExists) {
21
22
  spin.stop();
22
- error('No configuration found');
23
- console.log('');
24
- info('Run buoy init to set up your project');
23
+ error("No configuration found");
24
+ console.log("");
25
+ info("Run buoy init to set up your project");
25
26
  return;
26
27
  }
27
28
  const { config } = await loadConfig();
28
- // Import required modules
29
- const { ReactComponentScanner, VueComponentScanner, SvelteComponentScanner, AngularComponentScanner, WebComponentScanner, TemplateScanner, } = await import('@buoy-design/scanners/git');
30
- const { SemanticDiffEngine } = await import('@buoy-design/core/analysis');
31
- const components = [];
32
- spin.text = 'Scanning components...';
33
- // React
34
- if (config.sources.react?.enabled) {
35
- const scanner = new ReactComponentScanner({
36
- projectRoot: process.cwd(),
37
- include: config.sources.react.include,
38
- exclude: config.sources.react.exclude,
39
- designSystemPackage: config.sources.react.designSystemPackage,
40
- });
41
- const result = await scanner.scan();
42
- components.push(...result.items);
43
- }
44
- // Vue
45
- if (config.sources.vue?.enabled) {
46
- const scanner = new VueComponentScanner({
47
- projectRoot: process.cwd(),
48
- include: config.sources.vue.include,
49
- exclude: config.sources.vue.exclude,
50
- });
51
- const result = await scanner.scan();
52
- components.push(...result.items);
53
- }
54
- // Svelte
55
- if (config.sources.svelte?.enabled) {
56
- const scanner = new SvelteComponentScanner({
57
- projectRoot: process.cwd(),
58
- include: config.sources.svelte.include,
59
- exclude: config.sources.svelte.exclude,
60
- });
61
- const result = await scanner.scan();
62
- components.push(...result.items);
63
- }
64
- // Angular
65
- if (config.sources.angular?.enabled) {
66
- const scanner = new AngularComponentScanner({
67
- projectRoot: process.cwd(),
68
- include: config.sources.angular.include,
69
- exclude: config.sources.angular.exclude,
70
- });
71
- const result = await scanner.scan();
72
- components.push(...result.items);
73
- }
74
- // Web Components
75
- if (config.sources.webcomponent?.enabled) {
76
- const scanner = new WebComponentScanner({
77
- projectRoot: process.cwd(),
78
- include: config.sources.webcomponent.include,
79
- exclude: config.sources.webcomponent.exclude,
80
- framework: config.sources.webcomponent.framework,
81
- });
82
- const result = await scanner.scan();
83
- components.push(...result.items);
84
- }
85
- // Templates
86
- if (config.sources.templates?.enabled) {
87
- const scanner = new TemplateScanner({
88
- projectRoot: process.cwd(),
89
- include: config.sources.templates.include,
90
- exclude: config.sources.templates.exclude,
91
- templateType: config.sources.templates.type,
92
- });
93
- const result = await scanner.scan();
94
- components.push(...result.items);
95
- }
29
+ // Scan components using orchestrator
30
+ spin.text = "Scanning components...";
31
+ const orchestrator = new ScanOrchestrator(config);
32
+ const { components } = await orchestrator.scanComponents({
33
+ onProgress: (msg) => {
34
+ spin.text = msg;
35
+ },
36
+ });
96
37
  // Detect frameworks for sprawl check
97
- spin.text = 'Detecting frameworks...';
38
+ spin.text = "Detecting frameworks...";
98
39
  const detector = new ProjectDetector(process.cwd());
99
40
  const projectInfo = await detector.detect();
100
41
  // Run drift analysis
101
- spin.text = 'Analyzing drift...';
42
+ spin.text = "Analyzing drift...";
43
+ const { SemanticDiffEngine } = await import("@buoy-design/core/analysis");
102
44
  const engine = new SemanticDiffEngine();
103
45
  const diffResult = engine.analyzeComponents(components, {
104
46
  checkDeprecated: true,
@@ -107,87 +49,108 @@ export function createStatusCommand() {
107
49
  });
108
50
  const drifts = [...diffResult.drifts];
109
51
  // Check for framework sprawl
110
- const sprawlSignal = engine.checkFrameworkSprawl(projectInfo.frameworks.map(f => ({ name: f.name, version: f.version })));
52
+ const sprawlSignal = engine.checkFrameworkSprawl(projectInfo.frameworks.map((f) => ({
53
+ name: f.name,
54
+ version: f.version,
55
+ })));
111
56
  if (sprawlSignal) {
112
57
  drifts.push(sprawlSignal);
113
58
  }
114
59
  // Calculate coverage stats
115
- const driftingComponentIds = new Set(drifts.map(d => d.source.entityId));
60
+ const driftingComponentIds = new Set(drifts.map((d) => d.source.entityId));
116
61
  const stats = {
117
- aligned: components.filter(c => !driftingComponentIds.has(c.id)).length,
62
+ aligned: components.filter((c) => !driftingComponentIds.has(c.id))
63
+ .length,
118
64
  drifting: driftingComponentIds.size,
119
65
  untracked: 0, // For future: components not yet analyzed
120
66
  total: components.length,
121
67
  };
122
68
  spin.stop();
123
69
  // Group components by status
124
- const alignedComponents = components.filter(c => !driftingComponentIds.has(c.id));
125
- const driftingComponentsList = components.filter(c => driftingComponentIds.has(c.id));
70
+ const alignedComponents = components.filter((c) => !driftingComponentIds.has(c.id));
71
+ const driftingComponentsList = components.filter((c) => driftingComponentIds.has(c.id));
126
72
  // Output
127
73
  if (options.json) {
128
74
  console.log(JSON.stringify({
129
75
  stats,
130
- alignedPercent: stats.total > 0 ? Math.round((stats.aligned / stats.total) * 100) : 0,
131
- frameworks: projectInfo.frameworks.map(f => ({ name: f.name, version: f.version })),
76
+ alignedPercent: stats.total > 0
77
+ ? Math.round((stats.aligned / stats.total) * 100)
78
+ : 0,
79
+ frameworks: projectInfo.frameworks.map((f) => ({
80
+ name: f.name,
81
+ version: f.version,
82
+ })),
132
83
  frameworkSprawl: sprawlSignal !== null,
133
84
  components: {
134
- aligned: alignedComponents.map(c => ({ id: c.id, name: c.name, path: 'path' in c.source ? c.source.path : undefined })),
135
- drifting: driftingComponentsList.map(c => ({ id: c.id, name: c.name, path: 'path' in c.source ? c.source.path : undefined })),
85
+ aligned: alignedComponents.map((c) => ({
86
+ id: c.id,
87
+ name: c.name,
88
+ path: "path" in c.source ? c.source.path : undefined,
89
+ })),
90
+ drifting: driftingComponentsList.map((c) => ({
91
+ id: c.id,
92
+ name: c.name,
93
+ path: "path" in c.source ? c.source.path : undefined,
94
+ })),
136
95
  },
137
96
  }, null, 2));
138
97
  return;
139
98
  }
140
99
  if (stats.total === 0) {
141
- info('No components found to analyze.');
142
- console.log('');
143
- info('Options:');
144
- info(' Run ' + chalk.cyan('buoy bootstrap') + ' to extract tokens from existing code');
145
- info(' • Run ' + chalk.cyan('buoy build') + ' to generate a design system with AI');
146
- info(' • Check your config has component paths configured');
100
+ info("No components found to analyze.");
101
+ console.log("");
102
+ info("Options:");
103
+ info(" - Run " +
104
+ chalk.cyan("buoy bootstrap") +
105
+ " to extract tokens from existing code");
106
+ info(" - Run " +
107
+ chalk.cyan("buoy build") +
108
+ " to generate a design system with AI");
109
+ info(" - Check your config has component paths configured");
147
110
  return;
148
111
  }
149
112
  // Display framework sprawl warning if detected
150
113
  if (sprawlSignal) {
151
- console.log('');
152
- console.log(chalk.yellow.bold('⚠️ Framework Sprawl Detected'));
153
- console.log(chalk.dim(' Multiple UI frameworks in use:'));
154
- projectInfo.frameworks.forEach(f => {
155
- const version = f.version !== 'unknown' ? chalk.dim(` (${f.version})`) : '';
156
- console.log(` ${chalk.cyan(f.name)}${version}`);
114
+ console.log("");
115
+ console.log(chalk.yellow.bold("Warning: Framework Sprawl Detected"));
116
+ console.log(chalk.dim(" Multiple UI frameworks in use:"));
117
+ projectInfo.frameworks.forEach((f) => {
118
+ const version = f.version !== "unknown" ? chalk.dim(` (${f.version})`) : "";
119
+ console.log(` - ${chalk.cyan(f.name)}${version}`);
157
120
  });
158
- console.log('');
121
+ console.log("");
159
122
  }
160
123
  // Display the coverage grid
161
124
  coverageGrid(stats);
162
125
  // Display component lists
163
- console.log('');
126
+ console.log("");
164
127
  if (driftingComponentsList.length > 0) {
165
- console.log('\x1b[33m⛀ Drifting:\x1b[0m');
166
- driftingComponentsList.forEach(c => {
128
+ console.log("\x1b[33mDrifting:\x1b[0m");
129
+ driftingComponentsList.forEach((c) => {
167
130
  console.log(` ${c.name}`);
168
131
  });
169
- console.log('');
132
+ console.log("");
170
133
  }
171
134
  if (alignedComponents.length > 0) {
172
- console.log('\x1b[32m⛁ Aligned:\x1b[0m');
173
- alignedComponents.forEach(c => {
135
+ console.log("\x1b[32mAligned:\x1b[0m");
136
+ alignedComponents.forEach((c) => {
174
137
  console.log(` ${c.name}`);
175
138
  });
176
- console.log('');
139
+ console.log("");
177
140
  }
178
141
  // Summary message
179
142
  const alignedPct = Math.round((stats.aligned / stats.total) * 100);
180
143
  if (alignedPct === 100) {
181
- success('Perfect alignment! No drift detected.');
144
+ success("Perfect alignment! No drift detected.");
182
145
  }
183
146
  else if (alignedPct >= 80) {
184
- success('Good alignment. Minor drift to review.');
147
+ success("Good alignment. Minor drift to review.");
185
148
  }
186
149
  else if (alignedPct >= 50) {
187
- info('Moderate alignment. Consider reviewing drifting components.');
150
+ info("Moderate alignment. Consider reviewing drifting components.");
188
151
  }
189
152
  else {
190
- error('Low alignment. Run buoy drift check for details.');
153
+ error("Low alignment. Run buoy drift check for details.");
191
154
  }
192
155
  }
193
156
  catch (err) {