@principal-ai/principal-view-cli 0.8.1 → 0.8.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoLpC,wBAAgB,mBAAmB,IAAI,OAAO,CAiM7C"}
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoLpC,wBAAgB,mBAAmB,IAAI,OAAO,CA6L7C"}
@@ -160,20 +160,13 @@ export function createDoctorCommand() {
160
160
  absolute: true,
161
161
  ignore: ['README.md'],
162
162
  });
163
- if (configFiles.length === 0) {
164
- if (options.json) {
165
- console.log(JSON.stringify({ error: 'No config files found in .principal-views', results: [] }));
166
- }
167
- else {
168
- console.log(chalk.yellow('No configuration files found in .principal-views/'));
169
- }
170
- return;
171
- }
172
- // Check each config
163
+ // Check each config (if any)
173
164
  const results = [];
174
- for (const configFile of configFiles) {
175
- const result = await checkConfig(configFile, projectRoot);
176
- results.push(result);
165
+ if (configFiles.length > 0) {
166
+ for (const configFile of configFiles) {
167
+ const result = await checkConfig(configFile, projectRoot);
168
+ results.push(result);
169
+ }
177
170
  }
178
171
  // Aggregate stats
179
172
  const totalStats = results.reduce((acc, r) => ({
@@ -212,9 +205,13 @@ export function createDoctorCommand() {
212
205
  }, null, 2));
213
206
  }
214
207
  else {
215
- if (!options.quiet && !options.errorsOnly) {
208
+ if (!options.quiet && !options.errorsOnly && results.length > 0) {
216
209
  console.log(chalk.bold(`\nChecking ${results.length} configuration file(s)...\n`));
217
210
  }
211
+ if (results.length === 0 && !options.quiet && !options.errorsOnly) {
212
+ console.log(chalk.yellow('No YAML configuration files found in .principal-views/'));
213
+ console.log(chalk.dim('Checking file structure...\n'));
214
+ }
218
215
  for (const result of results) {
219
216
  const issues = filterIssues(result.issues);
220
217
  if (issues.length === 0 && !options.quiet && !options.errorsOnly) {
@@ -264,7 +261,7 @@ export function createDoctorCommand() {
264
261
  }
265
262
  }
266
263
  // Summary
267
- if (!options.errorsOnly) {
264
+ if (!options.errorsOnly && results.length > 0) {
268
265
  console.log(chalk.dim('\n' + '─'.repeat(50)));
269
266
  console.log(chalk.dim(`Checked ${totalStats.nodeTypesChecked} node types, ` +
270
267
  `${totalStats.patternsChecked} patterns, ` +
package/dist/index.cjs CHANGED
@@ -248720,20 +248720,12 @@ function createDoctorCommand() {
248720
248720
  absolute: true,
248721
248721
  ignore: ["README.md"]
248722
248722
  });
248723
- if (configFiles.length === 0) {
248724
- if (options.json) {
248725
- console.log(
248726
- JSON.stringify({ error: "No config files found in .principal-views", results: [] })
248727
- );
248728
- } else {
248729
- console.log(source_default.yellow("No configuration files found in .principal-views/"));
248730
- }
248731
- return;
248732
- }
248733
248723
  const results = [];
248734
- for (const configFile of configFiles) {
248735
- const result = await checkConfig(configFile, projectRoot);
248736
- results.push(result);
248724
+ if (configFiles.length > 0) {
248725
+ for (const configFile of configFiles) {
248726
+ const result = await checkConfig(configFile, projectRoot);
248727
+ results.push(result);
248728
+ }
248737
248729
  }
248738
248730
  const totalStats = results.reduce(
248739
248731
  (acc, r) => ({
@@ -248776,11 +248768,15 @@ function createDoctorCommand() {
248776
248768
  )
248777
248769
  );
248778
248770
  } else {
248779
- if (!options.quiet && !options.errorsOnly) {
248771
+ if (!options.quiet && !options.errorsOnly && results.length > 0) {
248780
248772
  console.log(source_default.bold(`
248781
248773
  Checking ${results.length} configuration file(s)...
248782
248774
  `));
248783
248775
  }
248776
+ if (results.length === 0 && !options.quiet && !options.errorsOnly) {
248777
+ console.log(source_default.yellow("No YAML configuration files found in .principal-views/"));
248778
+ console.log(source_default.dim("Checking file structure...\n"));
248779
+ }
248784
248780
  for (const result of results) {
248785
248781
  const issues = filterIssues(result.issues);
248786
248782
  if (issues.length === 0 && !options.quiet && !options.errorsOnly) {
@@ -248826,7 +248822,7 @@ Checking ${results.length} configuration file(s)...
248826
248822
  } catch (error) {
248827
248823
  }
248828
248824
  }
248829
- if (!options.errorsOnly) {
248825
+ if (!options.errorsOnly && results.length > 0) {
248830
248826
  console.log(source_default.dim("\n" + "\u2500".repeat(50)));
248831
248827
  console.log(
248832
248828
  source_default.dim(