@projectwallace/css-analyzer 5.12.2 → 5.13.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.d.ts CHANGED
@@ -12,6 +12,7 @@ export function analyze(css: string, options?: Options): {
12
12
  sourceLinesOfCode: number;
13
13
  linesOfCode: number;
14
14
  size: number;
15
+ complexity: number;
15
16
  comments: {
16
17
  total: number;
17
18
  size: number;
@@ -51,7 +52,16 @@ export function analyze(css: string, options?: Options): {
51
52
  totalUnique: any;
52
53
  unique: any;
53
54
  uniquenessRatio: number;
54
- };
55
+ } & ({
56
+ __unstable_uniqueWithLocations: Record<string, {
57
+ line: number;
58
+ column: number;
59
+ offset: number;
60
+ length: number;
61
+ }[]>;
62
+ } | {
63
+ __unstable_uniqueWithLocations?: undefined;
64
+ });
55
65
  import: {
56
66
  total: number;
57
67
  totalUnique: number;
@@ -189,6 +199,16 @@ export function analyze(css: string, options?: Options): {
189
199
  length: number;
190
200
  }[]>;
191
201
  };
202
+ total: number;
203
+ complexity: {
204
+ min: number;
205
+ max: number;
206
+ mean: number;
207
+ mode: number;
208
+ median: number;
209
+ range: number;
210
+ sum: number;
211
+ };
192
212
  };
193
213
  rules: {
194
214
  total: number;
@@ -398,6 +418,15 @@ export function analyze(css: string, options?: Options): {
398
418
  ratio: number;
399
419
  };
400
420
  };
421
+ complexity: {
422
+ min: number;
423
+ max: number;
424
+ mean: number;
425
+ mode: number;
426
+ median: number;
427
+ range: number;
428
+ sum: number;
429
+ };
401
430
  };
402
431
  properties: {
403
432
  total: number;
@@ -667,6 +696,15 @@ export function analyze(css: string, options?: Options): {
667
696
  };
668
697
  };
669
698
  };
699
+ complexity: {
700
+ min: number;
701
+ max: number;
702
+ mean: number;
703
+ mode: number;
704
+ median: number;
705
+ range: number;
706
+ sum: number;
707
+ };
670
708
  };
671
709
  __meta__: {
672
710
  parseTime: number;
@@ -681,6 +719,10 @@ export function analyze(css: string, options?: Options): {
681
719
  * @returns {number} sortIndex - 0 when a==b, 1 when a<b, -1 when a>b
682
720
  */
683
721
  export function compareSpecificity(a: Specificity, b: Specificity): number;
722
+ export { isBrowserhack as isValueBrowserhack } from "./values/browserhacks.js";
723
+ export { isHack as isPropertyHack } from "./properties/property-utils.js";
724
+ export { isValuePrefixed } from "./values/vendor-prefix.js";
725
+ export { hasVendorPrefix } from "./vendor-prefix.js";
684
726
  export type Specificity = [number, number, number];
685
727
  export type Options = {
686
728
  /**
@@ -688,3 +730,5 @@ export type Options = {
688
730
  */
689
731
  useUnstableLocations: boolean;
690
732
  };
733
+ export { getComplexity as selectorComplexity, isPrefixed as isSelectorPrefixed, isAccessibility as isAccessibilitySelector } from "./selectors/utils.js";
734
+ export { isSupportsBrowserhack, isMediaBrowserhack } from "./atrules/atrules.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectwallace/css-analyzer",
3
- "version": "5.12.2",
3
+ "version": "5.13.0",
4
4
  "author": "Bart Veneman",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,6 +27,7 @@
27
27
  },
28
28
  "scripts": {
29
29
  "test": "uvu",
30
+ "lint": "oxlint",
30
31
  "build": "microbundle"
31
32
  },
32
33
  "keywords": [
@@ -39,7 +40,12 @@
39
40
  "analytics",
40
41
  "performance",
41
42
  "styleguide",
42
- "metrics"
43
+ "metrics",
44
+ "designsystem",
45
+ "fonts",
46
+ "colors",
47
+ "quality",
48
+ "code"
43
49
  ],
44
50
  "dependencies": {
45
51
  "@bramus/specificity": "^2.3.0",
@@ -47,6 +53,7 @@
47
53
  },
48
54
  "devDependencies": {
49
55
  "microbundle": "^0.15.1",
56
+ "oxlint": "^0.0.22",
50
57
  "uvu": "^0.5.6"
51
58
  },
52
59
  "mangle": {