@principal-ai/principal-view-cli 0.1.15 → 0.1.17

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":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoIpC,wBAAgB,iBAAiB,IAAI,OAAO,CAoK3C"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkIpC,wBAAgB,iBAAiB,IAAI,OAAO,CAoK3C"}
@@ -49,31 +49,29 @@ rules:
49
49
 
50
50
  # Structure rules - ensure completeness
51
51
  minimum-node-sources:
52
- - error
53
- - minimum: 1
52
+ severity: error
53
+ options:
54
+ minimum: 1
54
55
  excludeNodeTypes: []
55
56
  orphaned-node-types: error
56
57
  orphaned-edge-types: error
57
58
  unreachable-states: error
58
- dead-end-states:
59
- - error
60
- - allowTerminalStates: true
59
+ dead-end-states: error
61
60
 
62
61
  # Pattern rules - validate regex patterns
63
62
  valid-action-patterns:
64
- - error
65
- - strictMode: false
63
+ severity: error
64
+ options:
65
+ strictMode: false
66
66
 
67
67
  # Library rules - check against component library
68
68
  library-node-type-match:
69
- - error
70
- - requireLibraryMatch: false
69
+ severity: error
70
+ options:
71
+ allowExtra: true
71
72
  `;
72
- const HUSKY_PRE_COMMIT = `#!/usr/bin/env sh
73
- . "$(dirname -- "$0")/_/husky.sh"
74
-
75
- # Run principal view linting on staged .principal-views files
76
- privu lint --quiet
73
+ const HUSKY_PRE_COMMIT = `# Run principal view linting on staged .principal-views files
74
+ npx @principal-ai/principal-view-cli lint --quiet
77
75
  `;
78
76
  /**
79
77
  * Check if a command exists in PATH
@@ -200,14 +198,14 @@ edgeComponents: {}
200
198
  if (existsSync(preCommitFile)) {
201
199
  // Check if our hook is already in the file
202
200
  const existingContent = readFileSync(preCommitFile, 'utf8');
203
- if (existingContent.includes('privu lint')) {
204
- console.log(chalk.yellow(`Husky pre-commit hook already includes privu lint`));
201
+ if (existingContent.includes('principal-view-cli lint') || existingContent.includes('privu lint')) {
202
+ console.log(chalk.yellow(`Husky pre-commit hook already includes principal view linting`));
205
203
  }
206
204
  else {
207
205
  // Append our lint command to existing pre-commit
208
- const updatedContent = existingContent.trimEnd() + '\n\n# Run principal view linting\nprivu lint --quiet\n';
206
+ const updatedContent = existingContent.trimEnd() + '\n\n# Run principal view linting\nnpx @principal-ai/principal-view-cli lint --quiet\n';
209
207
  writeFileSync(preCommitFile, updatedContent);
210
- console.log(chalk.green(`Updated Husky pre-commit hook with privu lint`));
208
+ console.log(chalk.green(`Updated Husky pre-commit hook with principal view linting`));
211
209
  huskySetup = true;
212
210
  }
213
211
  }
@@ -1 +1 @@
1
- {"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/commands/lint.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8PpC,wBAAgB,iBAAiB,IAAI,OAAO,CA2K3C"}
1
+ {"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/commands/lint.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8PpC,wBAAgB,iBAAiB,IAAI,OAAO,CA8K3C"}
@@ -284,10 +284,13 @@ export function createLintCommand() {
284
284
  ignore: privuConfig.exclude || ['**/node_modules/**'],
285
285
  expandDirectories: false,
286
286
  });
287
- // Filter out library files and config files
287
+ // Filter out library files, config files, and canvas files (canvas files use `validate` command)
288
288
  const configFiles = matchedFiles.filter((f) => {
289
289
  const name = basename(f).toLowerCase();
290
- return !name.startsWith('library.') && !name.startsWith('.privurc');
290
+ const isLibraryFile = name.startsWith('library.');
291
+ const isConfigFile = name.startsWith('.privurc');
292
+ const isCanvasFile = f.toLowerCase().endsWith('.canvas');
293
+ return !isLibraryFile && !isConfigFile && !isCanvasFile;
291
294
  });
292
295
  if (configFiles.length === 0) {
293
296
  if (options.json) {
package/dist/index.cjs CHANGED
@@ -14047,31 +14047,29 @@ rules:
14047
14047
 
14048
14048
  # Structure rules - ensure completeness
14049
14049
  minimum-node-sources:
14050
- - error
14051
- - minimum: 1
14050
+ severity: error
14051
+ options:
14052
+ minimum: 1
14052
14053
  excludeNodeTypes: []
14053
14054
  orphaned-node-types: error
14054
14055
  orphaned-edge-types: error
14055
14056
  unreachable-states: error
14056
- dead-end-states:
14057
- - error
14058
- - allowTerminalStates: true
14057
+ dead-end-states: error
14059
14058
 
14060
14059
  # Pattern rules - validate regex patterns
14061
14060
  valid-action-patterns:
14062
- - error
14063
- - strictMode: false
14061
+ severity: error
14062
+ options:
14063
+ strictMode: false
14064
14064
 
14065
14065
  # Library rules - check against component library
14066
14066
  library-node-type-match:
14067
- - error
14068
- - requireLibraryMatch: false
14067
+ severity: error
14068
+ options:
14069
+ allowExtra: true
14069
14070
  `;
14070
- var HUSKY_PRE_COMMIT = `#!/usr/bin/env sh
14071
- . "$(dirname -- "$0")/_/husky.sh"
14072
-
14073
- # Run principal view linting on staged .principal-views files
14074
- privu lint --quiet
14071
+ var HUSKY_PRE_COMMIT = `# Run principal view linting on staged .principal-views files
14072
+ npx @principal-ai/principal-view-cli lint --quiet
14075
14073
  `;
14076
14074
  function isGitRepo() {
14077
14075
  try {
@@ -14151,12 +14149,12 @@ edgeComponents: {}
14151
14149
  if (isHuskyInstalled(gitRoot)) {
14152
14150
  if ((0, import_node_fs5.existsSync)(preCommitFile)) {
14153
14151
  const existingContent = (0, import_node_fs5.readFileSync)(preCommitFile, "utf8");
14154
- if (existingContent.includes("privu lint")) {
14155
- console.log(source_default.yellow(`Husky pre-commit hook already includes privu lint`));
14152
+ if (existingContent.includes("principal-view-cli lint") || existingContent.includes("privu lint")) {
14153
+ console.log(source_default.yellow(`Husky pre-commit hook already includes principal view linting`));
14156
14154
  } else {
14157
- const updatedContent = existingContent.trimEnd() + "\n\n# Run principal view linting\nprivu lint --quiet\n";
14155
+ const updatedContent = existingContent.trimEnd() + "\n\n# Run principal view linting\nnpx @principal-ai/principal-view-cli lint --quiet\n";
14158
14156
  (0, import_node_fs5.writeFileSync)(preCommitFile, updatedContent);
14159
- console.log(source_default.green(`Updated Husky pre-commit hook with privu lint`));
14157
+ console.log(source_default.green(`Updated Husky pre-commit hook with principal view linting`));
14160
14158
  huskySetup = true;
14161
14159
  }
14162
14160
  } else {
@@ -17379,7 +17377,10 @@ function createLintCommand() {
17379
17377
  });
17380
17378
  const configFiles = matchedFiles.filter((f) => {
17381
17379
  const name = (0, import_node_path11.basename)(f).toLowerCase();
17382
- return !name.startsWith("library.") && !name.startsWith(".privurc");
17380
+ const isLibraryFile = name.startsWith("library.");
17381
+ const isConfigFile = name.startsWith(".privurc");
17382
+ const isCanvasFile = f.toLowerCase().endsWith(".canvas");
17383
+ return !isLibraryFile && !isConfigFile && !isCanvasFile;
17383
17384
  });
17384
17385
  if (configFiles.length === 0) {
17385
17386
  if (options.json) {