@staff0rd/assist 0.387.2 → 0.388.0

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/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.387.2",
9
+ version: "0.388.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -2860,10 +2860,40 @@ function isHashCommentFile(filePath) {
2860
2860
  // src/commands/verify/blockComments/collectFileComments.ts
2861
2861
  import fs13 from "fs";
2862
2862
 
2863
- // src/commands/verify/blockComments/collectHashComments.ts
2863
+ // src/shared/isBicepFile.ts
2864
+ var BICEP_EXTENSIONS = [".bicep", ".bicepparam"];
2865
+ function isBicepFile(filePath) {
2866
+ if (!filePath) return false;
2867
+ return BICEP_EXTENSIONS.some((ext) => filePath.endsWith(ext));
2868
+ }
2869
+
2870
+ // src/commands/verify/blockComments/collectBicepComments.ts
2864
2871
  function blankNonNewline(text16) {
2865
2872
  return text16.replace(/[^\n]/g, " ");
2866
2873
  }
2874
+ var STRING_LITERAL = /'''[\s\S]*?'''|'(?:[^'\\]|\\.)*'/g;
2875
+ var BLOCK_COMMENT = /\/\*[\s\S]*?\*[/]/g;
2876
+ var LINE_COMMENT = /\/\/.*/;
2877
+ function collectBicepComments(content) {
2878
+ let work = content.replace(STRING_LITERAL, blankNonNewline);
2879
+ const comments3 = [];
2880
+ work = work.replace(BLOCK_COMMENT, (match, offset) => {
2881
+ const line = content.slice(0, offset).split("\n").length;
2882
+ comments3.push({ line, text: match });
2883
+ return blankNonNewline(match);
2884
+ });
2885
+ const lines = work.split("\n");
2886
+ for (let i = 0; i < lines.length; i++) {
2887
+ const match = lines[i].match(LINE_COMMENT);
2888
+ if (match) comments3.push({ line: i + 1, text: match[0] });
2889
+ }
2890
+ return comments3;
2891
+ }
2892
+
2893
+ // src/commands/verify/blockComments/collectHashComments.ts
2894
+ function blankNonNewline2(text16) {
2895
+ return text16.replace(/[^\n]/g, " ");
2896
+ }
2867
2897
  function isHeaderLine(line) {
2868
2898
  const trimmed = line.trim();
2869
2899
  return trimmed === "" || trimmed.startsWith("#");
@@ -2878,7 +2908,7 @@ function collectHashComments(content, options2) {
2878
2908
  for (let i = start3; i < lines.length; i++) {
2879
2909
  const work = lines[i].replace(
2880
2910
  /"(?:[^"\\]|\\.)*"|'(?:[^']|'')*'/g,
2881
- blankNonNewline
2911
+ blankNonNewline2
2882
2912
  );
2883
2913
  const match = work.match(/(?:^|\s)(#.*)/);
2884
2914
  if (match) comments3.push({ line: i + 1, text: match[1] });
@@ -2993,6 +3023,8 @@ function collectFileComments(file, lines, project) {
2993
3023
  collectHashComments(read(), { skipHeader: isShellFile(file) }),
2994
3024
  true
2995
3025
  );
3026
+ if (isBicepFile(file))
3027
+ return toFindings(file, lines, collectBicepComments(read()), true);
2996
3028
  return collectSourceFindings(file, lines, project);
2997
3029
  }
2998
3030
 
@@ -3040,7 +3072,9 @@ var SCANNED_EXTENSIONS = [
3040
3072
  ".js",
3041
3073
  ".jsx",
3042
3074
  ".yml",
3043
- ".yaml"
3075
+ ".yaml",
3076
+ ".bicep",
3077
+ ".bicepparam"
3044
3078
  ];
3045
3079
  function shouldScan(file, ignoreGlobs) {
3046
3080
  if (!SCANNED_EXTENSIONS.some((ext) => file.endsWith(ext)) && !isHashCommentFile(file))
@@ -14367,24 +14401,26 @@ var SOURCE_EXTENSIONS = [
14367
14401
  ".js",
14368
14402
  ".jsx",
14369
14403
  ".cjs",
14370
- ".mjs"
14404
+ ".mjs",
14405
+ ".bicep",
14406
+ ".bicepparam"
14371
14407
  ];
14372
14408
  function isSourceFile(filePath) {
14373
14409
  if (!filePath) return false;
14374
14410
  return SOURCE_EXTENSIONS.some((ext) => filePath.endsWith(ext));
14375
14411
  }
14376
- function blankNonNewline2(text16) {
14412
+ function blankNonNewline3(text16) {
14377
14413
  return text16.replace(/[^\n]/g, " ");
14378
14414
  }
14379
14415
  function extractComments(text16) {
14380
14416
  const comments3 = [];
14381
14417
  let work = text16.replace(
14382
14418
  /"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|`(?:[^`\\]|\\.)*`/g,
14383
- blankNonNewline2
14419
+ blankNonNewline3
14384
14420
  );
14385
14421
  work = work.replace(/\/\*[\s\S]*?\*\//g, (match) => {
14386
14422
  comments3.push(match);
14387
- return blankNonNewline2(match);
14423
+ return blankNonNewline3(match);
14388
14424
  });
14389
14425
  for (const match of work.matchAll(/\/\/.*/g)) {
14390
14426
  comments3.push(match[0]);
@@ -14393,13 +14429,13 @@ function extractComments(text16) {
14393
14429
  }
14394
14430
 
14395
14431
  // src/commands/editHook/extractYamlComments.ts
14396
- function blankNonNewline3(text16) {
14432
+ function blankNonNewline4(text16) {
14397
14433
  return text16.replace(/[^\n]/g, " ");
14398
14434
  }
14399
14435
  function extractYamlComments(text16) {
14400
14436
  const work = text16.replace(
14401
14437
  /"(?:[^"\\]|\\.)*"|'(?:[^']|'')*'/g,
14402
- blankNonNewline3
14438
+ blankNonNewline4
14403
14439
  );
14404
14440
  const comments3 = [];
14405
14441
  for (const match of work.matchAll(/(?:^|\s)(#.*)/gm)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.387.2",
3
+ "version": "0.388.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {