@principal-ai/principal-view-cli 0.1.22 → 0.1.23

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;AAkIpC,wBAAgB,iBAAiB,IAAI,OAAO,CA6L3C"}
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;AA+GpC,wBAAgB,iBAAiB,IAAI,OAAO,CA6L3C"}
@@ -6,12 +6,6 @@ import { existsSync, mkdirSync, writeFileSync, readFileSync, chmodSync } from 'n
6
6
  import { join } from 'node:path';
7
7
  import { execSync } from 'node:child_process';
8
8
  import chalk from 'chalk';
9
- const TEMPLATE_LIBRARY = {
10
- version: '1.0.0',
11
- name: 'Component Library',
12
- nodeComponents: {},
13
- edgeComponents: {},
14
- };
15
9
  const TEMPLATE_CANVAS = {
16
10
  nodes: [],
17
11
  edges: [],
@@ -73,18 +67,6 @@ rules:
73
67
  const HUSKY_PRE_COMMIT = `# Run principal view linting on staged .principal-views files
74
68
  npx @principal-ai/principal-view-cli lint --quiet
75
69
  `;
76
- /**
77
- * Check if a command exists in PATH
78
- */
79
- function commandExists(cmd) {
80
- try {
81
- execSync(`which ${cmd}`, { stdio: 'ignore' });
82
- return true;
83
- }
84
- catch {
85
- return false;
86
- }
87
- }
88
70
  /**
89
71
  * Check if we're in a git repository
90
72
  */
@@ -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;AA0PpC,wBAAgB,iBAAiB,IAAI,OAAO,CA8L3C"}
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;AA2PpC,wBAAgB,iBAAiB,IAAI,OAAO,CA2L3C"}
@@ -20,6 +20,7 @@ const CONFIG_FILE_NAMES = ['.privurc.yaml', '.privurc.yml', '.privurc.json'];
20
20
  */
21
21
  function findConfig(startDir) {
22
22
  let currentDir = resolve(startDir);
23
+ // eslint-disable-next-line no-constant-condition
23
24
  while (true) {
24
25
  // Check for config files
25
26
  for (const fileName of CONFIG_FILE_NAMES) {
@@ -222,7 +223,6 @@ export function createLintCommand() {
222
223
  const cwd = process.cwd();
223
224
  // Load privurc config
224
225
  let privuConfig = getDefaultConfig();
225
- let configPath;
226
226
  if (options.config) {
227
227
  // Use specified config file
228
228
  const loadedConfig = loadConfigFile(resolve(cwd, options.config));
@@ -243,7 +243,6 @@ export function createLintCommand() {
243
243
  process.exit(1);
244
244
  }
245
245
  privuConfig = mergeConfigs(privuConfig, loadedConfig);
246
- configPath = resolve(cwd, options.config);
247
246
  }
248
247
  else {
249
248
  // Search for config file
@@ -261,7 +260,6 @@ export function createLintCommand() {
261
260
  process.exit(1);
262
261
  }
263
262
  privuConfig = mergeConfigs(privuConfig, found.config);
264
- configPath = found.path;
265
263
  }
266
264
  }
267
265
  // Determine files to lint
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4iCpC,wBAAgB,qBAAqB,IAAI,OAAO,CAsH/C"}
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0jCpC,wBAAgB,qBAAqB,IAAI,OAAO,CAsH/C"}
@@ -182,7 +182,7 @@ function validateIconName(iconValue, path, issues) {
182
182
  */
183
183
  const ALLOWED_CANVAS_FIELDS = {
184
184
  root: ['nodes', 'edges', 'pv'],
185
- pv: ['version', 'name', 'description', 'nodeTypes', 'edgeTypes', 'pathConfig', 'display'],
185
+ pv: ['version', 'name', 'description', 'nodeTypes', 'edgeTypes', 'pathConfig', 'display', 'scope', 'audit'],
186
186
  pvPathConfig: [
187
187
  'projectRoot',
188
188
  'captureSource',
@@ -216,17 +216,21 @@ const ALLOWED_CANVAS_FIELDS = {
216
216
  // Node pv extension
217
217
  nodePv: [
218
218
  'nodeType',
219
+ 'name',
219
220
  'description',
221
+ 'otel',
220
222
  'shape',
221
223
  'icon',
222
224
  'fill',
223
225
  'stroke',
224
226
  'states',
225
227
  'sources',
228
+ 'resourceMatch',
226
229
  'actions',
227
230
  'dataSchema',
228
231
  'layout',
229
232
  ],
233
+ nodePvOtel: ['kind', 'category', 'isNew'],
230
234
  nodePvState: ['color', 'icon', 'label'],
231
235
  nodePvAction: ['pattern', 'event', 'state', 'metadata', 'triggerEdges'],
232
236
  nodePvDataSchemaField: ['type', 'required', 'displayInLabel'],
@@ -263,6 +267,7 @@ const ALLOWED_LIBRARY_FIELDS = {
263
267
  'size',
264
268
  'states',
265
269
  'sources',
270
+ 'resourceMatch',
266
271
  'actions',
267
272
  'dataSchema',
268
273
  'layout',
@@ -595,6 +600,9 @@ function validateCanvas(canvas, filePath, library) {
595
600
  if (nodePv.layout && typeof nodePv.layout === 'object') {
596
601
  checkUnknownFields(nodePv.layout, ALLOWED_CANVAS_FIELDS.nodePvLayout, `${nodePath}.pv.layout`, issues);
597
602
  }
603
+ if (nodePv.otel && typeof nodePv.otel === 'object') {
604
+ checkUnknownFields(nodePv.otel, ALLOWED_CANVAS_FIELDS.nodePvOtel, `${nodePath}.pv.otel`, issues);
605
+ }
598
606
  if (Array.isArray(nodePv.actions)) {
599
607
  nodePv.actions.forEach((action, actionIndex) => {
600
608
  if (action && typeof action === 'object') {
package/dist/index.cjs CHANGED
@@ -10573,9 +10573,9 @@ var shouldExpandGlobstarDirectory = (pattern) => {
10573
10573
  if (!match) {
10574
10574
  return false;
10575
10575
  }
10576
- const dirname4 = match[1];
10577
- const hasWildcards = /[*?[\]{}]/.test(dirname4);
10578
- const hasExtension = import_node_path4.default.extname(dirname4) && !dirname4.startsWith(".");
10576
+ const dirname2 = match[1];
10577
+ const hasWildcards = /[*?[\]{}]/.test(dirname2);
10578
+ const hasExtension = import_node_path4.default.extname(dirname2) && !dirname2.startsWith(".");
10579
10579
  return !hasWildcards && !hasExtension;
10580
10580
  };
10581
10581
  var getDirectoryGlob = ({ directoryPath, files, extensions }) => {
@@ -13638,7 +13638,7 @@ function validateIconName(iconValue, path4, issues) {
13638
13638
  }
13639
13639
  var ALLOWED_CANVAS_FIELDS = {
13640
13640
  root: ["nodes", "edges", "pv"],
13641
- pv: ["version", "name", "description", "nodeTypes", "edgeTypes", "pathConfig", "display"],
13641
+ pv: ["version", "name", "description", "nodeTypes", "edgeTypes", "pathConfig", "display", "scope", "audit"],
13642
13642
  pvPathConfig: [
13643
13643
  "projectRoot",
13644
13644
  "captureSource",
@@ -13672,17 +13672,21 @@ var ALLOWED_CANVAS_FIELDS = {
13672
13672
  // Node pv extension
13673
13673
  nodePv: [
13674
13674
  "nodeType",
13675
+ "name",
13675
13676
  "description",
13677
+ "otel",
13676
13678
  "shape",
13677
13679
  "icon",
13678
13680
  "fill",
13679
13681
  "stroke",
13680
13682
  "states",
13681
13683
  "sources",
13684
+ "resourceMatch",
13682
13685
  "actions",
13683
13686
  "dataSchema",
13684
13687
  "layout"
13685
13688
  ],
13689
+ nodePvOtel: ["kind", "category", "isNew"],
13686
13690
  nodePvState: ["color", "icon", "label"],
13687
13691
  nodePvAction: ["pattern", "event", "state", "metadata", "triggerEdges"],
13688
13692
  nodePvDataSchemaField: ["type", "required", "displayInLabel"],
@@ -13716,6 +13720,7 @@ var ALLOWED_LIBRARY_FIELDS = {
13716
13720
  "size",
13717
13721
  "states",
13718
13722
  "sources",
13723
+ "resourceMatch",
13719
13724
  "actions",
13720
13725
  "dataSchema",
13721
13726
  "layout"
@@ -14055,6 +14060,14 @@ function validateCanvas(canvas, filePath, library) {
14055
14060
  issues
14056
14061
  );
14057
14062
  }
14063
+ if (nodePv.otel && typeof nodePv.otel === "object") {
14064
+ checkUnknownFields(
14065
+ nodePv.otel,
14066
+ ALLOWED_CANVAS_FIELDS.nodePvOtel,
14067
+ `${nodePath2}.pv.otel`,
14068
+ issues
14069
+ );
14070
+ }
14058
14071
  if (Array.isArray(nodePv.actions)) {
14059
14072
  nodePv.actions.forEach((action, actionIndex) => {
14060
14073
  if (action && typeof action === "object") {
@@ -17765,7 +17778,6 @@ function createLintCommand() {
17765
17778
  try {
17766
17779
  const cwd = process.cwd();
17767
17780
  let privuConfig = getDefaultConfig();
17768
- let configPath;
17769
17781
  if (options.config) {
17770
17782
  const loadedConfig = loadConfigFile((0, import_node_path11.resolve)(cwd, options.config));
17771
17783
  if (!loadedConfig) {
@@ -17784,7 +17796,6 @@ function createLintCommand() {
17784
17796
  process.exit(1);
17785
17797
  }
17786
17798
  privuConfig = mergeConfigs(privuConfig, loadedConfig);
17787
- configPath = (0, import_node_path11.resolve)(cwd, options.config);
17788
17799
  } else {
17789
17800
  const found = findConfig(cwd);
17790
17801
  if (found) {
@@ -17800,7 +17811,6 @@ function createLintCommand() {
17800
17811
  process.exit(1);
17801
17812
  }
17802
17813
  privuConfig = mergeConfigs(privuConfig, found.config);
17803
- configPath = found.path;
17804
17814
  }
17805
17815
  }
17806
17816
  let patterns;