@codometer/languages 0.0.9 → 0.0.10
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/CHANGELOG.md +7 -0
- package/README.md +8 -8
- package/dist/src/index.js +209 -209
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -760,13 +760,13 @@ graph LR
|
|
|
760
760
|
### Project
|
|
761
761
|
|
|
762
762
|

|
|
763
|
-

|
|
764
764
|

|
|
765
765
|

|
|
766
766
|
|
|
767
767
|
### Measured Targets
|
|
768
768
|
|
|
769
|
-

|
|
770
770
|
|
|
771
771
|
### TypeScript
|
|
772
772
|
|
|
@@ -948,16 +948,16 @@ graph LR
|
|
|
948
948
|
### Markdown
|
|
949
949
|
|
|
950
950
|

|
|
951
|
-

|
|
952
952
|

|
|
953
|
-

|
|
954
|
+

|
|
955
955
|

|
|
956
956
|

|
|
957
957
|

|
|
958
|
-

|
|
959
|
+

|
|
960
|
+

|
|
961
961
|

|
|
962
962
|

|
|
963
963
|

|
package/dist/src/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { execSync as me } from "node:child_process";
|
|
|
13
13
|
import { tmpdir as he } from "node:os";
|
|
14
14
|
import { fileURLToPath as ge } from "node:url";
|
|
15
15
|
import { z as p } from "zod";
|
|
16
|
-
//#region
|
|
16
|
+
//#region \0rolldown/runtime.js
|
|
17
17
|
var _e = /^(\p{Extended_Pictographic}️?(?:\p{Extended_Pictographic}️?)*)\s+/u, ve = /^([A-Za-z]+)/, ye = /* @__PURE__ */ new Set([
|
|
18
18
|
"built",
|
|
19
19
|
"cut",
|
|
@@ -45,12 +45,12 @@ var _e = /^(\p{Extended_Pictographic}️?(?:\p{Extended_Pictographic}️?)*)\
|
|
|
45
45
|
]);
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorateMetadata.js
|
|
48
|
-
function
|
|
48
|
+
function __decorateMetadata(e, t) {
|
|
49
49
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
50
50
|
}
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorate.js
|
|
53
|
-
function
|
|
53
|
+
function __decorate(e, t, n, r) {
|
|
54
54
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
55
55
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
56
56
|
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
@@ -58,9 +58,9 @@ function h(e, t, n, r) {
|
|
|
58
58
|
}
|
|
59
59
|
//#endregion
|
|
60
60
|
//#region packages/logging/src/modules/logger/logger.service.ts
|
|
61
|
-
var
|
|
61
|
+
var m, h = class LoggerService extends e {
|
|
62
62
|
static {
|
|
63
|
-
|
|
63
|
+
m = this;
|
|
64
64
|
}
|
|
65
65
|
constructor() {
|
|
66
66
|
super();
|
|
@@ -68,15 +68,15 @@ var g, _ = class extends e {
|
|
|
68
68
|
static isProduction = process.env.NODE_ENV === "production";
|
|
69
69
|
static rootLogger;
|
|
70
70
|
static writesToStandardError = !1;
|
|
71
|
-
child =
|
|
71
|
+
child = m.root;
|
|
72
72
|
static createRootLogger() {
|
|
73
73
|
let e = process.env.LOG_LEVEL ?? "info";
|
|
74
|
-
return
|
|
74
|
+
return m.isProduction ? m.writesToStandardError ? d({ level: e }, d.destination(2)) : d({ level: e }) : d({
|
|
75
75
|
level: e,
|
|
76
76
|
transport: {
|
|
77
77
|
options: {
|
|
78
78
|
colorize: !0,
|
|
79
|
-
destination:
|
|
79
|
+
destination: m.writesToStandardError ? 2 : 1,
|
|
80
80
|
ignore: "pid,hostname,emoji",
|
|
81
81
|
messageFormat: "{emoji} {msg}",
|
|
82
82
|
singleLine: !0
|
|
@@ -86,14 +86,14 @@ var g, _ = class extends e {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
static logToStandardError() {
|
|
89
|
-
if (
|
|
89
|
+
if (m.rootLogger !== void 0) {
|
|
90
90
|
process.emitWarning("LoggerService.logToStandardError() was called after the first log line, so log lines still go to standard output and anything piping that stream will read them as data. Call it as the first statement of the application's bootstrap.");
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
m.writesToStandardError = !0;
|
|
94
94
|
}
|
|
95
95
|
assertConventionalMessage(e) {
|
|
96
|
-
if (
|
|
96
|
+
if (m.isProduction || this.shouldSkipConventionalMessageValidation(e.context)) return;
|
|
97
97
|
let t = this.getConventionalMessageViolation(e.parsed);
|
|
98
98
|
if (t !== void 0) throw Error(t);
|
|
99
99
|
}
|
|
@@ -104,7 +104,7 @@ var g, _ = class extends e {
|
|
|
104
104
|
}), {
|
|
105
105
|
...e.data,
|
|
106
106
|
context: e.context,
|
|
107
|
-
...
|
|
107
|
+
...m.isProduction ? {} : { emoji: e.parsed.emoji }
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
110
|
getConventionalMessageViolation(e) {
|
|
@@ -131,7 +131,7 @@ var g, _ = class extends e {
|
|
|
131
131
|
return e !== void 0 && be.has(e);
|
|
132
132
|
}
|
|
133
133
|
static get root() {
|
|
134
|
-
return
|
|
134
|
+
return m.rootLogger ??= m.createRootLogger(), m.rootLogger;
|
|
135
135
|
}
|
|
136
136
|
buildErrorLogEntry(e, t) {
|
|
137
137
|
let n = t instanceof Error ? t.stack || t.message : String(t);
|
|
@@ -175,7 +175,7 @@ var g, _ = class extends e {
|
|
|
175
175
|
this.info(e, t, n);
|
|
176
176
|
}
|
|
177
177
|
setContext(e) {
|
|
178
|
-
super.setContext(e), this.child =
|
|
178
|
+
super.setContext(e), this.child = m.root.child({ context: e });
|
|
179
179
|
}
|
|
180
180
|
verbose(e, t, n) {
|
|
181
181
|
let r = this.parseMessage(e);
|
|
@@ -194,19 +194,19 @@ var g, _ = class extends e {
|
|
|
194
194
|
}), r.text);
|
|
195
195
|
}
|
|
196
196
|
};
|
|
197
|
-
|
|
197
|
+
h = m = __decorate([n({ scope: i.TRANSIENT }), __decorateMetadata("design:paramtypes", [])], h);
|
|
198
198
|
//#endregion
|
|
199
199
|
//#region packages/logging/src/modules/logger/logger.module.ts
|
|
200
|
-
var
|
|
201
|
-
|
|
200
|
+
var g = class LoggerModule {};
|
|
201
|
+
g = __decorate([t(), r({
|
|
202
202
|
controllers: [],
|
|
203
|
-
exports: [
|
|
203
|
+
exports: [h],
|
|
204
204
|
imports: [],
|
|
205
|
-
providers: [
|
|
206
|
-
})],
|
|
205
|
+
providers: [h]
|
|
206
|
+
})], g);
|
|
207
207
|
//#endregion
|
|
208
208
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/comments/comments.constants.ts
|
|
209
|
-
var xe = "comment", Se = /#[^\n]*/g, Ce = /\/\/[^\n]*/g, we = /^\s*#+\s?/u,
|
|
209
|
+
var xe = "comment", Se = /#[^\n]*/g, Ce = /\/\/[^\n]*/g, we = /^\s*#+\s?/u, _ = class CommentsService {
|
|
210
210
|
constructor() {}
|
|
211
211
|
countWords(e) {
|
|
212
212
|
let t = e.trim();
|
|
@@ -277,10 +277,10 @@ var xe = "comment", Se = /#[^\n]*/g, Ce = /\/\/[^\n]*/g, we = /^\s*#+\s?/u, y =
|
|
|
277
277
|
}));
|
|
278
278
|
}
|
|
279
279
|
};
|
|
280
|
-
|
|
280
|
+
_ = __decorate([n(), __decorateMetadata("design:paramtypes", [])], _);
|
|
281
281
|
//#endregion
|
|
282
282
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/comments/css-comments.service.ts
|
|
283
|
-
var
|
|
283
|
+
var v = class CssCommentsService {
|
|
284
284
|
constructor() {}
|
|
285
285
|
toBody(e) {
|
|
286
286
|
/* v8 ignore next -- postcss always sets both after a real parse */
|
|
@@ -314,10 +314,10 @@ var b = class {
|
|
|
314
314
|
return t;
|
|
315
315
|
}
|
|
316
316
|
};
|
|
317
|
-
|
|
317
|
+
v = __decorate([n(), __decorateMetadata("design:paramtypes", [])], v);
|
|
318
318
|
//#endregion
|
|
319
319
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/comments/hash-comments.service.ts
|
|
320
|
-
var
|
|
320
|
+
var y = class HashCommentsService {
|
|
321
321
|
constructor() {}
|
|
322
322
|
isShebang(e, t, n) {
|
|
323
323
|
return e === 0 && t === 0 && n.startsWith("#!");
|
|
@@ -339,10 +339,10 @@ var x = class {
|
|
|
339
339
|
return t;
|
|
340
340
|
}
|
|
341
341
|
};
|
|
342
|
-
|
|
342
|
+
y = __decorate([n(), __decorateMetadata("design:paramtypes", [])], y);
|
|
343
343
|
//#endregion
|
|
344
344
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/comments/hcl-comments.service.ts
|
|
345
|
-
var
|
|
345
|
+
var b = class HclCommentsService {
|
|
346
346
|
constructor() {}
|
|
347
347
|
findBlockComments(e) {
|
|
348
348
|
let t = [], n = 0;
|
|
@@ -392,15 +392,15 @@ var S = class {
|
|
|
392
392
|
});
|
|
393
393
|
}
|
|
394
394
|
read(e) {
|
|
395
|
-
let t = this.readBlocks(e),
|
|
395
|
+
let t = this.readBlocks(e), overlapsBlock = (e) => t.some((t) => e >= t.start && e < t.end), n = this.readMatches(e, Se, (e) => e.slice(1)).filter((e) => !overlapsBlock(e.start)), r = this.readMatches(e, Ce, (e) => e.slice(2)).filter((e) => !overlapsBlock(e.start));
|
|
396
396
|
return [
|
|
397
397
|
...t,
|
|
398
|
-
...
|
|
399
|
-
...
|
|
398
|
+
...n,
|
|
399
|
+
...r
|
|
400
400
|
].toSorted((e, t) => e.start - t.start).map(({ token: e }) => e);
|
|
401
401
|
}
|
|
402
402
|
};
|
|
403
|
-
|
|
403
|
+
b = __decorate([n(), __decorateMetadata("design:paramtypes", [])], b);
|
|
404
404
|
//#endregion
|
|
405
405
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/sql/sql.constants.ts
|
|
406
406
|
var Te = /\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g, Ee = /--[^\n]*/g, De = [
|
|
@@ -423,7 +423,7 @@ var Te = /\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g, Ee = /--[^\n]*/g, De = [
|
|
|
423
423
|
selects: 0,
|
|
424
424
|
statements: 0,
|
|
425
425
|
updates: 0
|
|
426
|
-
},
|
|
426
|
+
}, x = class SqlCommentsService {
|
|
427
427
|
constructor() {}
|
|
428
428
|
findBlockComments(e) {
|
|
429
429
|
let t = [], n = 0;
|
|
@@ -477,7 +477,7 @@ var Te = /\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g, Ee = /--[^\n]*/g, De = [
|
|
|
477
477
|
return [...t, ...n].toSorted((e, t) => e.start - t.start).map(({ token: e }) => e);
|
|
478
478
|
}
|
|
479
479
|
};
|
|
480
|
-
|
|
480
|
+
x = __decorate([n(), __decorateMetadata("design:paramtypes", [])], x);
|
|
481
481
|
//#endregion
|
|
482
482
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/comments/typescript-comments.constants.ts
|
|
483
483
|
var ke = /* @__PURE__ */ new Set([
|
|
@@ -485,7 +485,7 @@ var ke = /* @__PURE__ */ new Set([
|
|
|
485
485
|
".js",
|
|
486
486
|
".jsx",
|
|
487
487
|
".mjs"
|
|
488
|
-
]), Ae = /* @__PURE__ */ new Set([".jsx", ".tsx"]),
|
|
488
|
+
]), Ae = /* @__PURE__ */ new Set([".jsx", ".tsx"]), S = class TypescriptCommentsService {
|
|
489
489
|
constructor() {}
|
|
490
490
|
collectComments(e, t, n) {
|
|
491
491
|
if (e.getChildCount(t) === 0) {
|
|
@@ -531,10 +531,10 @@ var ke = /* @__PURE__ */ new Set([
|
|
|
531
531
|
});
|
|
532
532
|
}
|
|
533
533
|
};
|
|
534
|
-
|
|
534
|
+
S = __decorate([n(), __decorateMetadata("design:paramtypes", [])], S);
|
|
535
535
|
//#endregion
|
|
536
536
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/comments/yaml-comments.service.ts
|
|
537
|
-
var
|
|
537
|
+
var C = class YamlCommentsService {
|
|
538
538
|
constructor() {}
|
|
539
539
|
collectComments(e, t) {
|
|
540
540
|
if (typeof e != "object" || !e) return;
|
|
@@ -571,10 +571,10 @@ var T = class {
|
|
|
571
571
|
return t.tokens.toSorted((e, t) => e.offset - t.offset).map((e) => e.token);
|
|
572
572
|
}
|
|
573
573
|
};
|
|
574
|
-
|
|
574
|
+
C = __decorate([n(), __decorateMetadata("design:paramtypes", [])], C);
|
|
575
575
|
//#endregion
|
|
576
576
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/comments/language-comments.service.ts
|
|
577
|
-
var
|
|
577
|
+
var w, T = w = class LanguageCommentsService {
|
|
578
578
|
comments;
|
|
579
579
|
cssComments;
|
|
580
580
|
hashComments;
|
|
@@ -584,7 +584,7 @@ var je, E = je = class {
|
|
|
584
584
|
typescriptComments;
|
|
585
585
|
yamlComments;
|
|
586
586
|
constructor(e, t, n, r, i, a, o, s) {
|
|
587
|
-
this.comments = e, this.cssComments = t, this.hashComments = n, this.hclComments = r, this.logger = i, this.sqlComments = a, this.typescriptComments = o, this.yamlComments = s, this.logger.setContext(
|
|
587
|
+
this.comments = e, this.cssComments = t, this.hashComments = n, this.hclComments = r, this.logger = i, this.sqlComments = a, this.typescriptComments = o, this.yamlComments = s, this.logger.setContext(w.name);
|
|
588
588
|
}
|
|
589
589
|
measureLanguage(e) {
|
|
590
590
|
let t = [];
|
|
@@ -601,7 +601,7 @@ var je, E = je = class {
|
|
|
601
601
|
measureOneLanguage(e) {
|
|
602
602
|
let { counter: t, files: n, language: r, pythonComments: i, workingDirectory: a } = e;
|
|
603
603
|
if (r === "python") return this.measurePython(t.budget, i);
|
|
604
|
-
let
|
|
604
|
+
let readHash = (e) => this.hashComments.read(e), { files: o, read: s } = {
|
|
605
605
|
css: {
|
|
606
606
|
files: n.cssFiles,
|
|
607
607
|
read: (e) => this.cssComments.read(e)
|
|
@@ -612,11 +612,11 @@ var je, E = je = class {
|
|
|
612
612
|
},
|
|
613
613
|
python: {
|
|
614
614
|
files: [],
|
|
615
|
-
read:
|
|
615
|
+
read: readHash
|
|
616
616
|
},
|
|
617
617
|
shell: {
|
|
618
618
|
files: n.shellFiles,
|
|
619
|
-
read:
|
|
619
|
+
read: readHash
|
|
620
620
|
},
|
|
621
621
|
sql: {
|
|
622
622
|
files: n.sqlFiles,
|
|
@@ -624,7 +624,7 @@ var je, E = je = class {
|
|
|
624
624
|
},
|
|
625
625
|
toml: {
|
|
626
626
|
files: n.tomlFiles,
|
|
627
|
-
read:
|
|
627
|
+
read: readHash
|
|
628
628
|
},
|
|
629
629
|
typescript: {
|
|
630
630
|
files: n.sourceFiles,
|
|
@@ -637,8 +637,8 @@ var je, E = je = class {
|
|
|
637
637
|
}[r];
|
|
638
638
|
return this.measureLanguage({
|
|
639
639
|
budget: t.budget,
|
|
640
|
-
files:
|
|
641
|
-
read:
|
|
640
|
+
files: o,
|
|
641
|
+
read: s,
|
|
642
642
|
workingDirectory: a
|
|
643
643
|
});
|
|
644
644
|
}
|
|
@@ -682,44 +682,44 @@ var je, E = je = class {
|
|
|
682
682
|
return a;
|
|
683
683
|
}
|
|
684
684
|
};
|
|
685
|
-
|
|
685
|
+
T = w = __decorate([n(), __decorateMetadata("design:paramtypes", [
|
|
686
|
+
_ === void 0 ? Object : _,
|
|
687
|
+
v === void 0 ? Object : v,
|
|
686
688
|
y === void 0 ? Object : y,
|
|
687
689
|
b === void 0 ? Object : b,
|
|
690
|
+
h === void 0 ? Object : h,
|
|
688
691
|
x === void 0 ? Object : x,
|
|
689
692
|
S === void 0 ? Object : S,
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
w === void 0 ? Object : w,
|
|
693
|
-
T === void 0 ? Object : T
|
|
694
|
-
])], E);
|
|
693
|
+
C === void 0 ? Object : C
|
|
694
|
+
])], T);
|
|
695
695
|
//#endregion
|
|
696
696
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/comments/comments.module.ts
|
|
697
|
-
var
|
|
698
|
-
|
|
697
|
+
var E = class CommentsModule {};
|
|
698
|
+
E = __decorate([r({
|
|
699
699
|
controllers: [],
|
|
700
700
|
exports: [
|
|
701
|
+
_,
|
|
702
|
+
v,
|
|
701
703
|
y,
|
|
702
704
|
b,
|
|
705
|
+
T,
|
|
703
706
|
x,
|
|
704
707
|
S,
|
|
705
|
-
|
|
706
|
-
C,
|
|
707
|
-
w,
|
|
708
|
-
T
|
|
708
|
+
C
|
|
709
709
|
],
|
|
710
|
-
imports: [
|
|
710
|
+
imports: [g],
|
|
711
711
|
providers: [
|
|
712
|
+
_,
|
|
713
|
+
v,
|
|
712
714
|
y,
|
|
713
715
|
b,
|
|
716
|
+
T,
|
|
714
717
|
x,
|
|
715
718
|
S,
|
|
716
|
-
|
|
717
|
-
C,
|
|
718
|
-
w,
|
|
719
|
-
T
|
|
719
|
+
C
|
|
720
720
|
]
|
|
721
|
-
})],
|
|
722
|
-
var
|
|
721
|
+
})], E);
|
|
722
|
+
var je = {
|
|
723
723
|
atRules: 0,
|
|
724
724
|
comments: 0,
|
|
725
725
|
customProperties: 0,
|
|
@@ -729,10 +729,10 @@ var Me = {
|
|
|
729
729
|
mediaQueries: 0,
|
|
730
730
|
rules: 0,
|
|
731
731
|
selectors: 0
|
|
732
|
-
},
|
|
732
|
+
}, Me, D = Me = class CssService {
|
|
733
733
|
logger;
|
|
734
734
|
constructor(e) {
|
|
735
|
-
this.logger = e, this.logger.setContext(
|
|
735
|
+
this.logger = e, this.logger.setContext(Me.name);
|
|
736
736
|
}
|
|
737
737
|
countNode(e, t) {
|
|
738
738
|
if (e.type === "comment") {
|
|
@@ -750,7 +750,7 @@ var Me = {
|
|
|
750
750
|
t.rules++, t.selectors += e.selectors.length;
|
|
751
751
|
}
|
|
752
752
|
analyze({ cssFiles: e, workingDirectory: t }) {
|
|
753
|
-
let n = { ...
|
|
753
|
+
let n = { ...je };
|
|
754
754
|
for (let r of e) try {
|
|
755
755
|
let e = c(u.resolve(t, r), "utf8"), i = te.parse(e);
|
|
756
756
|
n.files++, n.lines += e.split("\n").length, i.walk((e) => {
|
|
@@ -767,19 +767,19 @@ var Me = {
|
|
|
767
767
|
return n;
|
|
768
768
|
}
|
|
769
769
|
};
|
|
770
|
-
|
|
770
|
+
D = Me = __decorate([n(), __decorateMetadata("design:paramtypes", [h === void 0 ? Object : h])], D);
|
|
771
771
|
//#endregion
|
|
772
772
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/css/css.module.ts
|
|
773
|
-
var
|
|
774
|
-
|
|
773
|
+
var O = class CssModule {};
|
|
774
|
+
O = __decorate([r({
|
|
775
775
|
controllers: [],
|
|
776
|
-
exports: [
|
|
777
|
-
imports: [
|
|
778
|
-
providers: [
|
|
779
|
-
})],
|
|
776
|
+
exports: [D],
|
|
777
|
+
imports: [g],
|
|
778
|
+
providers: [D]
|
|
779
|
+
})], O);
|
|
780
780
|
//#endregion
|
|
781
781
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/hcl/hcl.constants.ts
|
|
782
|
-
var
|
|
782
|
+
var Ne = /^([A-Za-z_]\w*)\s+(?:"[^"]*"\s*)*\{/, Pe = /^[A-Za-z_]\w*\s*=/, Fe = /\$\{[^}]*\}/g, Ie = {
|
|
783
783
|
attributes: 0,
|
|
784
784
|
blocks: 0,
|
|
785
785
|
comments: 0,
|
|
@@ -789,10 +789,10 @@ var Pe = /^([A-Za-z_]\w*)\s+(?:"[^"]*"\s*)*\{/, Fe = /^[A-Za-z_]\w*\s*=/, Ie = /
|
|
|
789
789
|
outputs: 0,
|
|
790
790
|
resources: 0,
|
|
791
791
|
variables: 0
|
|
792
|
-
},
|
|
792
|
+
}, k, A = k = class HclService {
|
|
793
793
|
logger;
|
|
794
794
|
constructor(e) {
|
|
795
|
-
this.logger = e, this.logger.setContext(
|
|
795
|
+
this.logger = e, this.logger.setContext(k.name);
|
|
796
796
|
}
|
|
797
797
|
countBlock(e, t) {
|
|
798
798
|
if (t.blocks++, e === "resource" || e === "data") {
|
|
@@ -811,16 +811,16 @@ var Pe = /^([A-Za-z_]\w*)\s+(?:"[^"]*"\s*)*\{/, Fe = /^[A-Za-z_]\w*\s*=/, Ie = /
|
|
|
811
811
|
t.comments++;
|
|
812
812
|
return;
|
|
813
813
|
}
|
|
814
|
-
t.interpolations += (n.match(
|
|
815
|
-
let r =
|
|
814
|
+
t.interpolations += (n.match(Fe) ?? []).length;
|
|
815
|
+
let r = Ne.exec(n)?.[1];
|
|
816
816
|
if (r !== void 0) {
|
|
817
817
|
this.countBlock(r, t);
|
|
818
818
|
return;
|
|
819
819
|
}
|
|
820
|
-
|
|
820
|
+
Pe.test(n) && t.attributes++;
|
|
821
821
|
}
|
|
822
822
|
analyze({ hclFiles: e, workingDirectory: t }) {
|
|
823
|
-
let n = { ...
|
|
823
|
+
let n = { ...Ie };
|
|
824
824
|
for (let r of e) try {
|
|
825
825
|
let e = c(u.resolve(t, r), "utf8").split("\n");
|
|
826
826
|
n.files++, n.lines += e.length;
|
|
@@ -836,19 +836,19 @@ var Pe = /^([A-Za-z_]\w*)\s+(?:"[^"]*"\s*)*\{/, Fe = /^[A-Za-z_]\w*\s*=/, Ie = /
|
|
|
836
836
|
return n;
|
|
837
837
|
}
|
|
838
838
|
};
|
|
839
|
-
A =
|
|
839
|
+
A = k = __decorate([n(), __decorateMetadata("design:paramtypes", [h === void 0 ? Object : h])], A);
|
|
840
840
|
//#endregion
|
|
841
841
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/hcl/hcl.module.ts
|
|
842
|
-
var j = class {};
|
|
843
|
-
j =
|
|
842
|
+
var j = class HclModule {};
|
|
843
|
+
j = __decorate([r({
|
|
844
844
|
controllers: [],
|
|
845
845
|
exports: [A],
|
|
846
|
-
imports: [
|
|
846
|
+
imports: [g],
|
|
847
847
|
providers: [A]
|
|
848
848
|
})], j);
|
|
849
849
|
//#endregion
|
|
850
850
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/json/json.constants.ts
|
|
851
|
-
var
|
|
851
|
+
var Le = {
|
|
852
852
|
arrays: 0,
|
|
853
853
|
booleans: 0,
|
|
854
854
|
files: 0,
|
|
@@ -861,10 +861,10 @@ var ze = {
|
|
|
861
861
|
properties: 0,
|
|
862
862
|
strings: 0,
|
|
863
863
|
totalNodes: 0
|
|
864
|
-
},
|
|
864
|
+
}, Re, M = Re = class JsonService {
|
|
865
865
|
logger;
|
|
866
866
|
constructor(e) {
|
|
867
|
-
this.logger = e, this.logger.setContext(
|
|
867
|
+
this.logger = e, this.logger.setContext(Re.name);
|
|
868
868
|
}
|
|
869
869
|
consumeCharacterOutsideComments(e, t, n) {
|
|
870
870
|
return e === "\"" ? {
|
|
@@ -995,7 +995,7 @@ var ze = {
|
|
|
995
995
|
}
|
|
996
996
|
analyze(e) {
|
|
997
997
|
let { jsonFiles: t, workingDirectory: n } = e, r = {
|
|
998
|
-
...
|
|
998
|
+
...Le,
|
|
999
999
|
files: t.length
|
|
1000
1000
|
};
|
|
1001
1001
|
for (let e of t) {
|
|
@@ -1016,19 +1016,19 @@ var ze = {
|
|
|
1016
1016
|
return r;
|
|
1017
1017
|
}
|
|
1018
1018
|
};
|
|
1019
|
-
M =
|
|
1019
|
+
M = Re = __decorate([n(), __decorateMetadata("design:paramtypes", [h === void 0 ? Object : h])], M);
|
|
1020
1020
|
//#endregion
|
|
1021
1021
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/json/json.module.ts
|
|
1022
|
-
var N = class {};
|
|
1023
|
-
N =
|
|
1022
|
+
var N = class JsonModule {};
|
|
1023
|
+
N = __decorate([r({
|
|
1024
1024
|
controllers: [],
|
|
1025
1025
|
exports: [M],
|
|
1026
|
-
imports: [
|
|
1026
|
+
imports: [g],
|
|
1027
1027
|
providers: [M]
|
|
1028
1028
|
})], N);
|
|
1029
1029
|
//#endregion
|
|
1030
1030
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/markdown/markdown.constants.ts
|
|
1031
|
-
var
|
|
1031
|
+
var ze = {
|
|
1032
1032
|
blockQuotes: 0,
|
|
1033
1033
|
codeBlocks: 0,
|
|
1034
1034
|
files: 0,
|
|
@@ -1049,7 +1049,7 @@ var Ve = {
|
|
|
1049
1049
|
tables: 0,
|
|
1050
1050
|
taskListItems: 0,
|
|
1051
1051
|
thematicBreaks: 0
|
|
1052
|
-
},
|
|
1052
|
+
}, Be = {
|
|
1053
1053
|
blockquote: "blockQuotes",
|
|
1054
1054
|
code: "codeBlocks",
|
|
1055
1055
|
image: "images",
|
|
@@ -1062,10 +1062,10 @@ var Ve = {
|
|
|
1062
1062
|
table: "tables",
|
|
1063
1063
|
tableRow: "tableRows",
|
|
1064
1064
|
thematicBreak: "thematicBreaks"
|
|
1065
|
-
},
|
|
1065
|
+
}, P, F = P = class MarkdownService {
|
|
1066
1066
|
logger;
|
|
1067
1067
|
constructor(e) {
|
|
1068
|
-
this.logger = e, this.logger.setContext(
|
|
1068
|
+
this.logger = e, this.logger.setContext(P.name);
|
|
1069
1069
|
}
|
|
1070
1070
|
processor = de().use(pe).use(fe, ["yaml", "toml"]);
|
|
1071
1071
|
countHeading(e, t) {
|
|
@@ -1083,7 +1083,7 @@ var Ve = {
|
|
|
1083
1083
|
this.countListItem(e, t);
|
|
1084
1084
|
return;
|
|
1085
1085
|
}
|
|
1086
|
-
let n =
|
|
1086
|
+
let n = Be[e.type];
|
|
1087
1087
|
n !== void 0 && t[n]++;
|
|
1088
1088
|
}
|
|
1089
1089
|
walk(e, t) {
|
|
@@ -1104,7 +1104,7 @@ var Ve = {
|
|
|
1104
1104
|
return this.analyzeContents(n);
|
|
1105
1105
|
}
|
|
1106
1106
|
analyzeContents(e) {
|
|
1107
|
-
let t = { ...
|
|
1107
|
+
let t = { ...ze };
|
|
1108
1108
|
for (let n of e) {
|
|
1109
1109
|
let e = this.processor.parse(n);
|
|
1110
1110
|
t.files++, t.lines += n.split("\n").length;
|
|
@@ -1113,19 +1113,19 @@ var Ve = {
|
|
|
1113
1113
|
return t;
|
|
1114
1114
|
}
|
|
1115
1115
|
};
|
|
1116
|
-
|
|
1116
|
+
F = P = __decorate([n(), __decorateMetadata("design:paramtypes", [h === void 0 ? Object : h])], F);
|
|
1117
1117
|
//#endregion
|
|
1118
1118
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/markdown/markdown.module.ts
|
|
1119
|
-
var
|
|
1120
|
-
|
|
1119
|
+
var I = class MarkdownModule {};
|
|
1120
|
+
I = __decorate([r({
|
|
1121
1121
|
controllers: [],
|
|
1122
|
-
exports: [
|
|
1123
|
-
imports: [
|
|
1124
|
-
providers: [
|
|
1125
|
-
})],
|
|
1122
|
+
exports: [F],
|
|
1123
|
+
imports: [g],
|
|
1124
|
+
providers: [F]
|
|
1125
|
+
})], I);
|
|
1126
1126
|
//#endregion
|
|
1127
1127
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/python/python.constants.ts
|
|
1128
|
-
var
|
|
1128
|
+
var Ve = {
|
|
1129
1129
|
classes: 0,
|
|
1130
1130
|
commentLines: 0,
|
|
1131
1131
|
comments: 0,
|
|
@@ -1139,15 +1139,15 @@ var I = {
|
|
|
1139
1139
|
imports: 0,
|
|
1140
1140
|
lines: 0,
|
|
1141
1141
|
protocols: 0
|
|
1142
|
-
},
|
|
1142
|
+
}, He, L = He = class PythonService {
|
|
1143
1143
|
logger;
|
|
1144
1144
|
constructor(e) {
|
|
1145
|
-
this.logger = e, this.logger.setContext(
|
|
1145
|
+
this.logger = e, this.logger.setContext(He.name);
|
|
1146
1146
|
}
|
|
1147
1147
|
scriptPath = u.resolve(u.dirname(ge(import.meta.url)), "python.service.py");
|
|
1148
1148
|
analyze(e) {
|
|
1149
1149
|
if (e.pythonFiles.length === 0) return {
|
|
1150
|
-
...
|
|
1150
|
+
...Ve,
|
|
1151
1151
|
commentTokens: []
|
|
1152
1152
|
};
|
|
1153
1153
|
try {
|
|
@@ -1160,14 +1160,14 @@ var I = {
|
|
|
1160
1160
|
} catch (e) {
|
|
1161
1161
|
let t = e instanceof Error ? e.message : String(e);
|
|
1162
1162
|
return this.logger.warn("🐍 Skipped Python analysis", void 0, { reason: t }), {
|
|
1163
|
-
...
|
|
1163
|
+
...Ve,
|
|
1164
1164
|
commentTokens: []
|
|
1165
1165
|
};
|
|
1166
1166
|
}
|
|
1167
1167
|
}
|
|
1168
1168
|
analyzeContents(e) {
|
|
1169
1169
|
if (e.contents.length === 0) return {
|
|
1170
|
-
...
|
|
1170
|
+
...Ve,
|
|
1171
1171
|
commentTokens: []
|
|
1172
1172
|
};
|
|
1173
1173
|
let t = s(u.join(he(), "codometer-python-"));
|
|
@@ -1189,22 +1189,22 @@ var I = {
|
|
|
1189
1189
|
}
|
|
1190
1190
|
}
|
|
1191
1191
|
};
|
|
1192
|
-
|
|
1192
|
+
L = He = __decorate([n(), __decorateMetadata("design:paramtypes", [h === void 0 ? Object : h])], L);
|
|
1193
1193
|
//#endregion
|
|
1194
1194
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/python/python.module.ts
|
|
1195
|
-
var
|
|
1196
|
-
|
|
1195
|
+
var R = class PythonModule {};
|
|
1196
|
+
R = __decorate([r({
|
|
1197
1197
|
controllers: [],
|
|
1198
|
-
exports: [
|
|
1199
|
-
imports: [
|
|
1200
|
-
providers: [
|
|
1201
|
-
})],
|
|
1202
|
-
var
|
|
1198
|
+
exports: [L],
|
|
1199
|
+
imports: [g],
|
|
1200
|
+
providers: [L]
|
|
1201
|
+
})], R);
|
|
1202
|
+
var Ue = p.object({
|
|
1203
1203
|
cell_type: p.string().optional(),
|
|
1204
1204
|
execution_count: p.number().nullish(),
|
|
1205
1205
|
outputs: p.array(p.unknown()).optional(),
|
|
1206
1206
|
source: p.union([p.string(), p.array(p.string())]).optional()
|
|
1207
|
-
}),
|
|
1207
|
+
}), We = p.object({ cells: p.array(Ue).optional() }), Ge = {
|
|
1208
1208
|
cells: 0,
|
|
1209
1209
|
classes: 0,
|
|
1210
1210
|
codeBlocks: 0,
|
|
@@ -1225,13 +1225,13 @@ var We = p.object({
|
|
|
1225
1225
|
properties: 0,
|
|
1226
1226
|
rawCells: 0,
|
|
1227
1227
|
totalNodes: 0
|
|
1228
|
-
},
|
|
1228
|
+
}, Ke, z = Ke = class JupyterService {
|
|
1229
1229
|
jsonService;
|
|
1230
1230
|
markdownService;
|
|
1231
1231
|
pythonService;
|
|
1232
1232
|
logger;
|
|
1233
1233
|
constructor(e, t, n, r) {
|
|
1234
|
-
this.jsonService = e, this.markdownService = t, this.pythonService = n, this.logger = r, this.logger.setContext(
|
|
1234
|
+
this.jsonService = e, this.markdownService = t, this.pythonService = n, this.logger = r, this.logger.setContext(Ke.name);
|
|
1235
1235
|
}
|
|
1236
1236
|
collectCell(e, t) {
|
|
1237
1237
|
if (t.cells++, t.outputs += e.outputs?.length ?? 0, e.cell_type === "code") {
|
|
@@ -1271,7 +1271,7 @@ var We = p.object({
|
|
|
1271
1271
|
readNotebook(e, t) {
|
|
1272
1272
|
try {
|
|
1273
1273
|
let n = c(u.resolve(t, e), "utf8");
|
|
1274
|
-
return
|
|
1274
|
+
return We.parse(JSON.parse(n)).cells ?? [];
|
|
1275
1275
|
} catch (t) {
|
|
1276
1276
|
let n = t instanceof Error ? t.message : String(t);
|
|
1277
1277
|
this.logger.warn("📓 Skipped notebook analysis", void 0, {
|
|
@@ -1285,7 +1285,7 @@ var We = p.object({
|
|
|
1285
1285
|
return typeof e == "string" ? e : e?.join("") ?? "";
|
|
1286
1286
|
}
|
|
1287
1287
|
analyze(e) {
|
|
1288
|
-
if (e.notebookFiles.length === 0) return { ...
|
|
1288
|
+
if (e.notebookFiles.length === 0) return { ...Ge };
|
|
1289
1289
|
let t = this.collectParts(e), n = this.jsonService.analyze({
|
|
1290
1290
|
jsonFiles: e.notebookFiles,
|
|
1291
1291
|
workingDirectory: e.workingDirectory
|
|
@@ -1318,29 +1318,29 @@ var We = p.object({
|
|
|
1318
1318
|
};
|
|
1319
1319
|
}
|
|
1320
1320
|
};
|
|
1321
|
-
|
|
1321
|
+
z = Ke = __decorate([n(), __decorateMetadata("design:paramtypes", [
|
|
1322
1322
|
M === void 0 ? Object : M,
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
])],
|
|
1323
|
+
F === void 0 ? Object : F,
|
|
1324
|
+
L === void 0 ? Object : L,
|
|
1325
|
+
h === void 0 ? Object : h
|
|
1326
|
+
])], z);
|
|
1327
1327
|
//#endregion
|
|
1328
1328
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/jupyter/jupyter.module.ts
|
|
1329
|
-
var
|
|
1330
|
-
|
|
1329
|
+
var B = class JupyterModule {};
|
|
1330
|
+
B = __decorate([r({
|
|
1331
1331
|
controllers: [],
|
|
1332
|
-
exports: [
|
|
1332
|
+
exports: [z],
|
|
1333
1333
|
imports: [
|
|
1334
1334
|
N,
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1335
|
+
g,
|
|
1336
|
+
I,
|
|
1337
|
+
R
|
|
1338
1338
|
],
|
|
1339
|
-
providers: [
|
|
1340
|
-
})],
|
|
1339
|
+
providers: [z]
|
|
1340
|
+
})], B);
|
|
1341
1341
|
//#endregion
|
|
1342
1342
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/shell/shell.constants.ts
|
|
1343
|
-
var
|
|
1343
|
+
var qe = /^(?:function\s+)?[\w-]+\s*\(\s*\)|^function\s+[\w-]+/, Je = /^(?:export|declare\s+-x)\s+[A-Za-z_]\w*=/, Ye = /^(?:local\s+|readonly\s+|declare\s+)?[A-Za-z_]\w*=/, Xe = /(?:^|;\s*)(?:if|elif|case)\s/, Ze = /(?:^|;\s*)(?:for|while|until)\s/, Qe = /(?<!\|)\|(?!\|)/g, $e = {
|
|
1344
1344
|
commentLines: 0,
|
|
1345
1345
|
comments: 0,
|
|
1346
1346
|
conditionals: 0,
|
|
@@ -1352,10 +1352,10 @@ var Je = /^(?:function\s+)?[\w-]+\s*\(\s*\)|^function\s+[\w-]+/, Ye = /^(?:expor
|
|
|
1352
1352
|
pipelines: 0,
|
|
1353
1353
|
shebangs: 0,
|
|
1354
1354
|
variables: 0
|
|
1355
|
-
},
|
|
1355
|
+
}, V, H = V = class ShellService {
|
|
1356
1356
|
logger;
|
|
1357
1357
|
constructor(e) {
|
|
1358
|
-
this.logger = e, this.logger.setContext(
|
|
1358
|
+
this.logger = e, this.logger.setContext(V.name);
|
|
1359
1359
|
}
|
|
1360
1360
|
countLine(e, t) {
|
|
1361
1361
|
let n = e.trim();
|
|
@@ -1370,10 +1370,10 @@ var Je = /^(?:function\s+)?[\w-]+\s*\(\s*\)|^function\s+[\w-]+/, Ye = /^(?:expor
|
|
|
1370
1370
|
n !== "" && this.countStatements(n, t);
|
|
1371
1371
|
}
|
|
1372
1372
|
countStatements(e, t) {
|
|
1373
|
-
|
|
1373
|
+
qe.test(e) && t.functions++, Je.test(e) ? t.exports++ : Ye.test(e) && t.variables++, Xe.test(e) && t.conditionals++, Ze.test(e) && t.loops++, t.pipelines += (e.match(Qe) ?? []).length;
|
|
1374
1374
|
}
|
|
1375
1375
|
analyze({ shellFiles: e, workingDirectory: t }) {
|
|
1376
|
-
let n = {
|
|
1376
|
+
let n = { ...$e };
|
|
1377
1377
|
for (let r of e) try {
|
|
1378
1378
|
let e = c(u.resolve(t, r), "utf8").split("\n");
|
|
1379
1379
|
n.files++, n.lines += e.length;
|
|
@@ -1389,22 +1389,22 @@ var Je = /^(?:function\s+)?[\w-]+\s*\(\s*\)|^function\s+[\w-]+/, Ye = /^(?:expor
|
|
|
1389
1389
|
return n;
|
|
1390
1390
|
}
|
|
1391
1391
|
};
|
|
1392
|
-
H =
|
|
1392
|
+
H = V = __decorate([n(), __decorateMetadata("design:paramtypes", [h === void 0 ? Object : h])], H);
|
|
1393
1393
|
//#endregion
|
|
1394
1394
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/shell/shell.module.ts
|
|
1395
|
-
var U = class {};
|
|
1396
|
-
U =
|
|
1395
|
+
var U = class ShellModule {};
|
|
1396
|
+
U = __decorate([r({
|
|
1397
1397
|
controllers: [],
|
|
1398
1398
|
exports: [H],
|
|
1399
|
-
imports: [
|
|
1399
|
+
imports: [g],
|
|
1400
1400
|
providers: [H]
|
|
1401
1401
|
})], U);
|
|
1402
1402
|
//#endregion
|
|
1403
1403
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/sql/sql.service.ts
|
|
1404
|
-
var
|
|
1404
|
+
var et, W = et = class SqlService {
|
|
1405
1405
|
logger;
|
|
1406
1406
|
constructor(e) {
|
|
1407
|
-
this.logger = e, this.logger.setContext(
|
|
1407
|
+
this.logger = e, this.logger.setContext(et.name);
|
|
1408
1408
|
}
|
|
1409
1409
|
countKeywords(e, t) {
|
|
1410
1410
|
for (let [n, r] of De) t[n] += (e.match(r) ?? []).length;
|
|
@@ -1430,19 +1430,19 @@ var nt, W = nt = class {
|
|
|
1430
1430
|
return n;
|
|
1431
1431
|
}
|
|
1432
1432
|
};
|
|
1433
|
-
W =
|
|
1433
|
+
W = et = __decorate([n(), __decorateMetadata("design:paramtypes", [h === void 0 ? Object : h])], W);
|
|
1434
1434
|
//#endregion
|
|
1435
1435
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/sql/sql.module.ts
|
|
1436
|
-
var G = class {};
|
|
1437
|
-
G =
|
|
1436
|
+
var G = class SqlModule {};
|
|
1437
|
+
G = __decorate([r({
|
|
1438
1438
|
controllers: [],
|
|
1439
1439
|
exports: [W],
|
|
1440
|
-
imports: [
|
|
1440
|
+
imports: [g],
|
|
1441
1441
|
providers: [W]
|
|
1442
1442
|
})], G);
|
|
1443
1443
|
//#endregion
|
|
1444
1444
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/toml/toml.constants.ts
|
|
1445
|
-
var
|
|
1445
|
+
var tt = /^\[\[[^\]]+\]\]/, nt = /^\[[^\]]+\]/, rt = /"""|'''/g, it = {
|
|
1446
1446
|
arrays: 0,
|
|
1447
1447
|
arrayTables: 0,
|
|
1448
1448
|
comments: 0,
|
|
@@ -1450,10 +1450,10 @@ var rt = /^\[\[[^\]]+\]\]/, it = /^\[[^\]]+\]/, at = /"""|'''/g, ot = {
|
|
|
1450
1450
|
keys: 0,
|
|
1451
1451
|
lines: 0,
|
|
1452
1452
|
tables: 0
|
|
1453
|
-
},
|
|
1453
|
+
}, at, K = at = class TomlService {
|
|
1454
1454
|
logger;
|
|
1455
1455
|
constructor(e) {
|
|
1456
|
-
this.logger = e, this.logger.setContext(
|
|
1456
|
+
this.logger = e, this.logger.setContext(at.name);
|
|
1457
1457
|
}
|
|
1458
1458
|
countKey(e, t) {
|
|
1459
1459
|
let n = e.indexOf("=");
|
|
@@ -1465,21 +1465,21 @@ var rt = /^\[\[[^\]]+\]\]/, it = /^\[[^\]]+\]/, at = /"""|'''/g, ot = {
|
|
|
1465
1465
|
t.comments++;
|
|
1466
1466
|
return;
|
|
1467
1467
|
}
|
|
1468
|
-
if (
|
|
1468
|
+
if (tt.test(n)) {
|
|
1469
1469
|
t.arrayTables++;
|
|
1470
1470
|
return;
|
|
1471
1471
|
}
|
|
1472
|
-
if (
|
|
1472
|
+
if (nt.test(n)) {
|
|
1473
1473
|
t.tables++;
|
|
1474
1474
|
return;
|
|
1475
1475
|
}
|
|
1476
1476
|
this.countKey(n, t);
|
|
1477
1477
|
}
|
|
1478
1478
|
isInsideMultilineString(e, t) {
|
|
1479
|
-
return (e.match(
|
|
1479
|
+
return (e.match(rt) ?? []).length % 2 == 0 ? t : !t;
|
|
1480
1480
|
}
|
|
1481
1481
|
analyze({ tomlFiles: e, workingDirectory: t }) {
|
|
1482
|
-
let n = { ...
|
|
1482
|
+
let n = { ...it };
|
|
1483
1483
|
for (let r of e) try {
|
|
1484
1484
|
let e = c(u.resolve(t, r), "utf8").split("\n"), i = !1;
|
|
1485
1485
|
n.files++, n.lines += e.length;
|
|
@@ -1495,19 +1495,19 @@ var rt = /^\[\[[^\]]+\]\]/, it = /^\[[^\]]+\]/, at = /"""|'''/g, ot = {
|
|
|
1495
1495
|
return n;
|
|
1496
1496
|
}
|
|
1497
1497
|
};
|
|
1498
|
-
K =
|
|
1498
|
+
K = at = __decorate([n(), __decorateMetadata("design:paramtypes", [h === void 0 ? Object : h])], K);
|
|
1499
1499
|
//#endregion
|
|
1500
1500
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/toml/toml.module.ts
|
|
1501
|
-
var q = class {};
|
|
1502
|
-
q =
|
|
1501
|
+
var q = class TomlModule {};
|
|
1502
|
+
q = __decorate([r({
|
|
1503
1503
|
controllers: [],
|
|
1504
1504
|
exports: [K],
|
|
1505
|
-
imports: [
|
|
1505
|
+
imports: [g],
|
|
1506
1506
|
providers: [K]
|
|
1507
1507
|
})], q);
|
|
1508
1508
|
//#endregion
|
|
1509
1509
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/typescript/typescript.constants.ts
|
|
1510
|
-
var
|
|
1510
|
+
var ot = {
|
|
1511
1511
|
[f.SyntaxKind.ArrowFunction]: "function",
|
|
1512
1512
|
[f.SyntaxKind.ClassDeclaration]: "class",
|
|
1513
1513
|
[f.SyntaxKind.ClassExpression]: "class",
|
|
@@ -1519,7 +1519,7 @@ var ct = {
|
|
|
1519
1519
|
[f.SyntaxKind.MethodDeclaration]: "method",
|
|
1520
1520
|
[f.SyntaxKind.PropertyDeclaration]: "property",
|
|
1521
1521
|
[f.SyntaxKind.SetAccessor]: "setter"
|
|
1522
|
-
},
|
|
1522
|
+
}, st = {
|
|
1523
1523
|
[f.SyntaxKind.AbstractKeyword]: "abstract",
|
|
1524
1524
|
[f.SyntaxKind.AsyncKeyword]: "async",
|
|
1525
1525
|
[f.SyntaxKind.ExportKeyword]: "export",
|
|
@@ -1529,12 +1529,12 @@ var ct = {
|
|
|
1529
1529
|
[f.SyntaxKind.PublicKeyword]: "public",
|
|
1530
1530
|
[f.SyntaxKind.ReadonlyKeyword]: "readonly",
|
|
1531
1531
|
[f.SyntaxKind.StaticKeyword]: "static"
|
|
1532
|
-
},
|
|
1532
|
+
}, ct = /\/\/.*\b(?:TODO|FIXME)\b|\/\*[\s\S]*?\b(?:TODO|FIXME)\b[\s\S]*?\*\//g, lt = /@([a-zA-Z][a-zA-Z0-9-]*)/g, ut = /* @__PURE__ */ new Set([
|
|
1533
1533
|
".cjs",
|
|
1534
1534
|
".js",
|
|
1535
1535
|
".jsx",
|
|
1536
1536
|
".mjs"
|
|
1537
|
-
]),
|
|
1537
|
+
]), dt = {
|
|
1538
1538
|
asyncFunctions: 0,
|
|
1539
1539
|
blockComments: 0,
|
|
1540
1540
|
classes: 0,
|
|
@@ -1561,7 +1561,7 @@ var ct = {
|
|
|
1561
1561
|
testFiles: 0,
|
|
1562
1562
|
todos: 0,
|
|
1563
1563
|
tsFiles: 0
|
|
1564
|
-
}, J = class {
|
|
1564
|
+
}, J = class DeclarationCommentsService {
|
|
1565
1565
|
comments;
|
|
1566
1566
|
constructor(e) {
|
|
1567
1567
|
this.comments = e;
|
|
@@ -1573,7 +1573,7 @@ var ct = {
|
|
|
1573
1573
|
return (f.getLeadingCommentRanges(t.text, e.getFullStart()) ?? []).findLast((e) => e.kind === f.SyntaxKind.MultiLineCommentTrivia && t.text.slice(e.pos, e.pos + 3) === "/**");
|
|
1574
1574
|
}
|
|
1575
1575
|
prepare(e, t) {
|
|
1576
|
-
let { commentCounters: n, sourceFile: r } = t, i =
|
|
1576
|
+
let { commentCounters: n, sourceFile: r } = t, i = ot[e.kind];
|
|
1577
1577
|
if (i === void 0) return;
|
|
1578
1578
|
let a = n.filter((e) => e.kind === i);
|
|
1579
1579
|
if (a.length === 0) return;
|
|
@@ -1614,10 +1614,10 @@ var ct = {
|
|
|
1614
1614
|
return l;
|
|
1615
1615
|
}
|
|
1616
1616
|
};
|
|
1617
|
-
J =
|
|
1617
|
+
J = __decorate([n(), __decorateMetadata("design:paramtypes", [_ === void 0 ? Object : _])], J);
|
|
1618
1618
|
//#endregion
|
|
1619
1619
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/typescript/typescript.service.ts
|
|
1620
|
-
var Y = class {
|
|
1620
|
+
var Y = class TypescriptService {
|
|
1621
1621
|
declarationComments;
|
|
1622
1622
|
constructor(e) {
|
|
1623
1623
|
this.declarationComments = e;
|
|
@@ -1640,7 +1640,7 @@ var Y = class {
|
|
|
1640
1640
|
};
|
|
1641
1641
|
analyzeFile(e) {
|
|
1642
1642
|
let { commentCounters: t, counters: n, filePath: r, stats: i, workingDirectory: a } = e, o = c(u.resolve(a, r), "utf8"), s = f.createSourceFile(r, o, f.ScriptTarget.Latest, !0, this.getScriptKind(r));
|
|
1643
|
-
i.lines += o.split(/\r?\n/).length, i.todos += (o.match(
|
|
1643
|
+
i.lines += o.split(/\r?\n/).length, i.todos += (o.match(ct) ?? []).length, this.scanComments(o, i), this.walkNode(s, {
|
|
1644
1644
|
commentCounters: t,
|
|
1645
1645
|
counters: n,
|
|
1646
1646
|
filePath: r,
|
|
@@ -1657,7 +1657,7 @@ var Y = class {
|
|
|
1657
1657
|
let n = e.replaceAll("\r\n", "\n"), r = n.split("\n").length, i = n.includes("\n") ? Math.max(1, r - 1) : 1;
|
|
1658
1658
|
if (t.commentLines += i, e.startsWith("/**")) {
|
|
1659
1659
|
t.docComments++;
|
|
1660
|
-
for (let n of e.matchAll(
|
|
1660
|
+
for (let n of e.matchAll(lt)) {
|
|
1661
1661
|
let e = n[1]?.toLowerCase() ?? "";
|
|
1662
1662
|
t.docTags[e] = (t.docTags[e] ?? 0) + 1;
|
|
1663
1663
|
}
|
|
@@ -1670,7 +1670,7 @@ var Y = class {
|
|
|
1670
1670
|
t.lineComments++;
|
|
1671
1671
|
}
|
|
1672
1672
|
countSymbols(e, t) {
|
|
1673
|
-
let n =
|
|
1673
|
+
let n = ot[e.kind];
|
|
1674
1674
|
if (n === void 0 || t.counters.length === 0) return;
|
|
1675
1675
|
let r = this.getSymbolModifiers(e);
|
|
1676
1676
|
for (let e of t.counters) e.kinds.includes(n) && e.modifiers.every((e) => r.has(e)) && (t.stats.symbolCounts[e.label] = (t.stats.symbolCounts[e.label] ?? 0) + 1);
|
|
@@ -1678,14 +1678,14 @@ var Y = class {
|
|
|
1678
1678
|
createEmptyResult(e) {
|
|
1679
1679
|
let { sourceFiles: t } = e;
|
|
1680
1680
|
return {
|
|
1681
|
-
...
|
|
1681
|
+
...dt,
|
|
1682
1682
|
declarationCommentCounts: this.seedDeclarationCommentCounts(e.commentCounters),
|
|
1683
|
-
docTags: { ...
|
|
1683
|
+
docTags: { ...dt.docTags },
|
|
1684
1684
|
externalPackages: /* @__PURE__ */ new Set(),
|
|
1685
|
-
jsFiles: t.filter((e) =>
|
|
1685
|
+
jsFiles: t.filter((e) => ut.has(u.extname(e))).length,
|
|
1686
1686
|
symbolCounts: Object.fromEntries(e.symbolCounters.map((e) => [e.label, 0])),
|
|
1687
1687
|
testFiles: t.filter((e) => /\.(test|spec|unit\.test|integration\.test|end-to-end\.test)\.[cm]?[jt]sx?$/.test(e)).length,
|
|
1688
|
-
tsFiles: t.filter((e) => !
|
|
1688
|
+
tsFiles: t.filter((e) => !ut.has(u.extname(e))).length
|
|
1689
1689
|
};
|
|
1690
1690
|
}
|
|
1691
1691
|
dispatchNode(e, t, n) {
|
|
@@ -1696,12 +1696,12 @@ var Y = class {
|
|
|
1696
1696
|
}
|
|
1697
1697
|
getScriptKind(e) {
|
|
1698
1698
|
let t = u.extname(e);
|
|
1699
|
-
return t === ".tsx" || t === ".jsx" ? f.ScriptKind.TSX :
|
|
1699
|
+
return t === ".tsx" || t === ".jsx" ? f.ScriptKind.TSX : ut.has(t) ? f.ScriptKind.JS : f.ScriptKind.TS;
|
|
1700
1700
|
}
|
|
1701
1701
|
getSymbolModifiers(e) {
|
|
1702
1702
|
let t = f.canHaveModifiers(e) ? f.getModifiers(e) : void 0, n = /* @__PURE__ */ new Set();
|
|
1703
1703
|
for (let e of t ?? []) {
|
|
1704
|
-
let t =
|
|
1704
|
+
let t = st[e.kind];
|
|
1705
1705
|
t !== void 0 && n.add(t);
|
|
1706
1706
|
}
|
|
1707
1707
|
return n;
|
|
@@ -1781,19 +1781,19 @@ var Y = class {
|
|
|
1781
1781
|
return t;
|
|
1782
1782
|
}
|
|
1783
1783
|
};
|
|
1784
|
-
Y =
|
|
1784
|
+
Y = __decorate([n(), __decorateMetadata("design:paramtypes", [J === void 0 ? Object : J])], Y);
|
|
1785
1785
|
//#endregion
|
|
1786
1786
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/typescript/typescript.module.ts
|
|
1787
|
-
var X = class {};
|
|
1788
|
-
X =
|
|
1787
|
+
var X = class TypescriptModule {};
|
|
1788
|
+
X = __decorate([r({
|
|
1789
1789
|
controllers: [],
|
|
1790
1790
|
exports: [Y],
|
|
1791
|
-
imports: [
|
|
1791
|
+
imports: [E],
|
|
1792
1792
|
providers: [J, Y]
|
|
1793
1793
|
})], X);
|
|
1794
1794
|
//#endregion
|
|
1795
1795
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/yaml/yaml.constants.ts
|
|
1796
|
-
var
|
|
1796
|
+
var ft = {
|
|
1797
1797
|
aliases: 0,
|
|
1798
1798
|
anchors: 0,
|
|
1799
1799
|
comments: 0,
|
|
@@ -1805,10 +1805,10 @@ var mt = {
|
|
|
1805
1805
|
maxDepth: 0,
|
|
1806
1806
|
scalars: 0,
|
|
1807
1807
|
sequences: 0
|
|
1808
|
-
},
|
|
1808
|
+
}, pt, Z = pt = class YamlService {
|
|
1809
1809
|
logger;
|
|
1810
1810
|
constructor(e) {
|
|
1811
|
-
this.logger = e, this.logger.setContext(
|
|
1811
|
+
this.logger = e, this.logger.setContext(pt.name);
|
|
1812
1812
|
}
|
|
1813
1813
|
countCollection(e, t, n) {
|
|
1814
1814
|
if (oe(e)) {
|
|
@@ -1841,7 +1841,7 @@ var mt = {
|
|
|
1841
1841
|
}
|
|
1842
1842
|
}
|
|
1843
1843
|
analyze({ workingDirectory: e, yamlFiles: t }) {
|
|
1844
|
-
let n = { ...
|
|
1844
|
+
let n = { ...ft };
|
|
1845
1845
|
for (let r of t) try {
|
|
1846
1846
|
let t = c(u.resolve(e, r), "utf8");
|
|
1847
1847
|
n.files++, n.lines += t.split("\n").length;
|
|
@@ -1857,19 +1857,19 @@ var mt = {
|
|
|
1857
1857
|
return n;
|
|
1858
1858
|
}
|
|
1859
1859
|
};
|
|
1860
|
-
Z =
|
|
1860
|
+
Z = pt = __decorate([n(), __decorateMetadata("design:paramtypes", [h === void 0 ? Object : h])], Z);
|
|
1861
1861
|
//#endregion
|
|
1862
1862
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/yaml/yaml.module.ts
|
|
1863
|
-
var Q = class {};
|
|
1864
|
-
Q =
|
|
1863
|
+
var Q = class YamlModule {};
|
|
1864
|
+
Q = __decorate([r({
|
|
1865
1865
|
controllers: [],
|
|
1866
1866
|
exports: [Z],
|
|
1867
|
-
imports: [
|
|
1867
|
+
imports: [g],
|
|
1868
1868
|
providers: [Z]
|
|
1869
1869
|
})], Q);
|
|
1870
1870
|
//#endregion
|
|
1871
1871
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/languages/languages.service.ts
|
|
1872
|
-
var $ = class {
|
|
1872
|
+
var $ = class LanguagesService {
|
|
1873
1873
|
cssService;
|
|
1874
1874
|
languageComments;
|
|
1875
1875
|
hclService;
|
|
@@ -1945,14 +1945,14 @@ var $ = class {
|
|
|
1945
1945
|
};
|
|
1946
1946
|
}
|
|
1947
1947
|
};
|
|
1948
|
-
$ =
|
|
1949
|
-
|
|
1950
|
-
|
|
1948
|
+
$ = __decorate([n(), __decorateMetadata("design:paramtypes", [
|
|
1949
|
+
D === void 0 ? Object : D,
|
|
1950
|
+
T === void 0 ? Object : T,
|
|
1951
1951
|
A === void 0 ? Object : A,
|
|
1952
1952
|
M === void 0 ? Object : M,
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1953
|
+
z === void 0 ? Object : z,
|
|
1954
|
+
F === void 0 ? Object : F,
|
|
1955
|
+
L === void 0 ? Object : L,
|
|
1956
1956
|
H === void 0 ? Object : H,
|
|
1957
1957
|
W === void 0 ? Object : W,
|
|
1958
1958
|
K === void 0 ? Object : K,
|
|
@@ -1961,18 +1961,18 @@ $ = h([n(), m("design:paramtypes", [
|
|
|
1961
1961
|
])], $);
|
|
1962
1962
|
//#endregion
|
|
1963
1963
|
//#region packages/ic-suite/codometer/codometer-languages/src/modules/languages/languages.module.ts
|
|
1964
|
-
var
|
|
1965
|
-
|
|
1964
|
+
var mt = class LanguagesModule {};
|
|
1965
|
+
mt = __decorate([r({
|
|
1966
1966
|
controllers: [],
|
|
1967
1967
|
exports: [$],
|
|
1968
1968
|
imports: [
|
|
1969
|
-
|
|
1970
|
-
|
|
1969
|
+
E,
|
|
1970
|
+
O,
|
|
1971
1971
|
j,
|
|
1972
1972
|
N,
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1973
|
+
B,
|
|
1974
|
+
I,
|
|
1975
|
+
R,
|
|
1976
1976
|
U,
|
|
1977
1977
|
G,
|
|
1978
1978
|
q,
|
|
@@ -1980,6 +1980,6 @@ gt = h([r({
|
|
|
1980
1980
|
Q
|
|
1981
1981
|
],
|
|
1982
1982
|
providers: [$]
|
|
1983
|
-
})],
|
|
1983
|
+
})], mt);
|
|
1984
1984
|
//#endregion
|
|
1985
|
-
export {
|
|
1985
|
+
export { E as CommentsModule, _ as CommentsService, v as CssCommentsService, O as CssModule, D as CssService, y as HashCommentsService, b as HclCommentsService, j as HclModule, A as HclService, N as JsonModule, M as JsonService, B as JupyterModule, z as JupyterService, T as LanguageCommentsService, mt as LanguagesModule, $ as LanguagesService, I as MarkdownModule, F as MarkdownService, R as PythonModule, L as PythonService, U as ShellModule, H as ShellService, x as SqlCommentsService, G as SqlModule, W as SqlService, q as TomlModule, K as TomlService, S as TypescriptCommentsService, X as TypescriptModule, Y as TypescriptService, C as YamlCommentsService, Q as YamlModule, Z as YamlService };
|
package/package.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"url": "https://github.com/organizzolini/codebase/issues"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@codometer/configuration": "0.0.
|
|
8
|
-
"@codometer/core": "0.0.
|
|
7
|
+
"@codometer/configuration": "0.0.10",
|
|
8
|
+
"@codometer/core": "0.0.10",
|
|
9
9
|
"@nestjs/common": "^11.1.21 || ^12.0.1",
|
|
10
10
|
"mdast": "^3.0.0",
|
|
11
11
|
"pino": "^10.3.1",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"strict": true
|
|
72
72
|
},
|
|
73
73
|
"types": "./dist/src/index.d.ts",
|
|
74
|
-
"version": "0.0.
|
|
74
|
+
"version": "0.0.10"
|
|
75
75
|
}
|