@codometer/languages 0.0.14 → 0.0.15
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 +19 -122
- 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
|
@@ -44,12 +44,12 @@ var _e = /^(\p{Extended_Pictographic}️?(?:\p{Extended_Pictographic}️?)*)\
|
|
|
44
44
|
"TypeOrmModule"
|
|
45
45
|
]);
|
|
46
46
|
//#endregion
|
|
47
|
-
//#region \0@oxc-project+runtime@0.
|
|
47
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateMetadata.js
|
|
48
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
|
-
//#region \0@oxc-project+runtime@0.
|
|
52
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
53
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);
|
|
@@ -86,11 +86,7 @@ var m, h = class LoggerService extends e {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
static logToStandardError() {
|
|
89
|
-
|
|
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
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
m.writesToStandardError = !0;
|
|
89
|
+
m.rootLogger === void 0 ? m.writesToStandardError = !0 : 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.");
|
|
94
90
|
}
|
|
95
91
|
assertConventionalMessage(e) {
|
|
96
92
|
if (m.isProduction || this.shouldSkipConventionalMessageValidation(e.context)) return;
|
|
@@ -241,11 +237,7 @@ var xe = "comment", Se = /#[^\n]*/g, Ce = /\/\/[^\n]*/g, we = /^\s*#+\s?/u, _ =
|
|
|
241
237
|
let t = [];
|
|
242
238
|
for (let n of e) {
|
|
243
239
|
let e = t.at(-1), r = e?.tokens.at(-1);
|
|
244
|
-
|
|
245
|
-
e.tokens.push(n);
|
|
246
|
-
continue;
|
|
247
|
-
}
|
|
248
|
-
t.push({ tokens: [n] });
|
|
240
|
+
e !== void 0 && r !== void 0 && n.ownLine && r.ownLine && n.line === r.line + 1 ? e.tokens.push(n) : t.push({ tokens: [n] });
|
|
249
241
|
}
|
|
250
242
|
return t;
|
|
251
243
|
}
|
|
@@ -488,11 +480,8 @@ var ke = /* @__PURE__ */ new Set([
|
|
|
488
480
|
]), Ae = /* @__PURE__ */ new Set([".jsx", ".tsx"]), S = class TypescriptCommentsService {
|
|
489
481
|
constructor() {}
|
|
490
482
|
collectComments(e, t, n) {
|
|
491
|
-
if (e.getChildCount(t) === 0)
|
|
492
|
-
|
|
493
|
-
return;
|
|
494
|
-
}
|
|
495
|
-
for (let r of e.getChildren(t)) this.collectComments(r, t, n);
|
|
483
|
+
if (e.getChildCount(t) === 0) for (let t of [...f.getLeadingCommentRanges(n.content, e.getFullStart()) ?? [], ...f.getTrailingCommentRanges(n.content, e.getEnd()) ?? []]) n.ranges.set(t.pos, t);
|
|
484
|
+
else for (let r of e.getChildren(t)) this.collectComments(r, t, n);
|
|
496
485
|
}
|
|
497
486
|
getScriptKind(e) {
|
|
498
487
|
let t = u.extname(e);
|
|
@@ -735,19 +724,7 @@ var je = {
|
|
|
735
724
|
this.logger = e, this.logger.setContext(Me.name);
|
|
736
725
|
}
|
|
737
726
|
countNode(e, t) {
|
|
738
|
-
|
|
739
|
-
t.comments++;
|
|
740
|
-
return;
|
|
741
|
-
}
|
|
742
|
-
if (e.type === "decl") {
|
|
743
|
-
t.declarations++, e.prop.startsWith("--") && t.customProperties++;
|
|
744
|
-
return;
|
|
745
|
-
}
|
|
746
|
-
if (e.type === "atrule") {
|
|
747
|
-
t.atRules++, e.name === "media" && t.mediaQueries++;
|
|
748
|
-
return;
|
|
749
|
-
}
|
|
750
|
-
t.rules++, t.selectors += e.selectors.length;
|
|
727
|
+
e.type === "comment" ? t.comments++ : e.type === "decl" ? (t.declarations++, e.prop.startsWith("--") && t.customProperties++) : e.type === "atrule" ? (t.atRules++, e.name === "media" && t.mediaQueries++) : (t.rules++, t.selectors += e.selectors.length);
|
|
751
728
|
}
|
|
752
729
|
analyze({ cssFiles: e, workingDirectory: t }) {
|
|
753
730
|
let n = { ...je };
|
|
@@ -795,15 +772,7 @@ var Ne = /^([A-Za-z_]\w*)\s+(?:"[^"]*"\s*)*\{/, Pe = /^[A-Za-z_]\w*\s*=/, Fe = /
|
|
|
795
772
|
this.logger = e, this.logger.setContext(k.name);
|
|
796
773
|
}
|
|
797
774
|
countBlock(e, t) {
|
|
798
|
-
|
|
799
|
-
t.resources++;
|
|
800
|
-
return;
|
|
801
|
-
}
|
|
802
|
-
if (e === "variable") {
|
|
803
|
-
t.variables++;
|
|
804
|
-
return;
|
|
805
|
-
}
|
|
806
|
-
e === "output" && t.outputs++;
|
|
775
|
+
t.blocks++, e === "resource" || e === "data" ? t.resources++ : e === "variable" ? t.variables++ : e === "output" && t.outputs++;
|
|
807
776
|
}
|
|
808
777
|
countLine(e, t) {
|
|
809
778
|
let n = e.trim();
|
|
@@ -813,11 +782,7 @@ var Ne = /^([A-Za-z_]\w*)\s+(?:"[^"]*"\s*)*\{/, Pe = /^[A-Za-z_]\w*\s*=/, Fe = /
|
|
|
813
782
|
}
|
|
814
783
|
t.interpolations += (n.match(Fe) ?? []).length;
|
|
815
784
|
let r = Ne.exec(n)?.[1];
|
|
816
|
-
|
|
817
|
-
this.countBlock(r, t);
|
|
818
|
-
return;
|
|
819
|
-
}
|
|
820
|
-
Pe.test(n) && t.attributes++;
|
|
785
|
+
r === void 0 ? Pe.test(n) && t.attributes++ : this.countBlock(r, t);
|
|
821
786
|
}
|
|
822
787
|
analyze({ hclFiles: e, workingDirectory: t }) {
|
|
823
788
|
let n = { ...Ie };
|
|
@@ -892,34 +857,14 @@ var Le = {
|
|
|
892
857
|
for (let r of e) this.countNode(r, t, n + 1);
|
|
893
858
|
}
|
|
894
859
|
countNode(e, t, n) {
|
|
895
|
-
|
|
896
|
-
this.countArrayNode(e, t, n);
|
|
897
|
-
return;
|
|
898
|
-
}
|
|
899
|
-
if (this.isRecordNode(e)) {
|
|
900
|
-
this.countRecordNode(e, t, n);
|
|
901
|
-
return;
|
|
902
|
-
}
|
|
903
|
-
this.countPrimitiveNode(e, t, n);
|
|
860
|
+
this.isArrayNode(e) ? this.countArrayNode(e, t, n) : this.isRecordNode(e) ? this.countRecordNode(e, t, n) : this.countPrimitiveNode(e, t, n);
|
|
904
861
|
}
|
|
905
862
|
countPrimitiveNode(e, t, n) {
|
|
906
|
-
|
|
907
|
-
t.nulls++;
|
|
908
|
-
return;
|
|
909
|
-
}
|
|
910
|
-
this.countPrimitiveValue(e, t);
|
|
863
|
+
t.totalNodes++, t.maxDepth = Math.max(t.maxDepth, n), e === null ? t.nulls++ : this.countPrimitiveValue(e, t);
|
|
911
864
|
}
|
|
912
865
|
countPrimitiveValue(e, t) {
|
|
913
866
|
let n = typeof e;
|
|
914
|
-
|
|
915
|
-
t.booleans++;
|
|
916
|
-
return;
|
|
917
|
-
}
|
|
918
|
-
if (n === "number") {
|
|
919
|
-
t.numbers++;
|
|
920
|
-
return;
|
|
921
|
-
}
|
|
922
|
-
n === "string" && t.strings++;
|
|
867
|
+
n === "boolean" ? t.booleans++ : n === "number" ? t.numbers++ : n === "string" && t.strings++;
|
|
923
868
|
}
|
|
924
869
|
countRecordNode(e, t, n) {
|
|
925
870
|
t.objects++, t.totalNodes++, t.maxDepth = Math.max(t.maxDepth, n);
|
|
@@ -1234,15 +1179,7 @@ var Ue = p.object({
|
|
|
1234
1179
|
this.jsonService = e, this.markdownService = t, this.pythonService = n, this.logger = r, this.logger.setContext(Ke.name);
|
|
1235
1180
|
}
|
|
1236
1181
|
collectCell(e, t) {
|
|
1237
|
-
|
|
1238
|
-
t.codeCells++, t.codeSources.push(this.readSource(e.source)), typeof e.execution_count == "number" && t.executedCells++;
|
|
1239
|
-
return;
|
|
1240
|
-
}
|
|
1241
|
-
if (e.cell_type === "markdown") {
|
|
1242
|
-
t.markdownCells++, t.markdownSources.push(this.readSource(e.source));
|
|
1243
|
-
return;
|
|
1244
|
-
}
|
|
1245
|
-
t.rawCells++;
|
|
1182
|
+
t.cells++, t.outputs += e.outputs?.length ?? 0, e.cell_type === "code" ? (t.codeCells++, t.codeSources.push(this.readSource(e.source)), typeof e.execution_count == "number" && t.executedCells++) : e.cell_type === "markdown" ? (t.markdownCells++, t.markdownSources.push(this.readSource(e.source))) : t.rawCells++;
|
|
1246
1183
|
}
|
|
1247
1184
|
collectParts(e) {
|
|
1248
1185
|
let t = {
|
|
@@ -1359,15 +1296,7 @@ var qe = /^(?:function\s+)?[\w-]+\s*\(\s*\)|^function\s+[\w-]+/, Je = /^(?:expor
|
|
|
1359
1296
|
}
|
|
1360
1297
|
countLine(e, t) {
|
|
1361
1298
|
let n = e.trim();
|
|
1362
|
-
|
|
1363
|
-
t.shebangs++;
|
|
1364
|
-
return;
|
|
1365
|
-
}
|
|
1366
|
-
if (n.startsWith("#")) {
|
|
1367
|
-
t.comments++, t.commentLines++;
|
|
1368
|
-
return;
|
|
1369
|
-
}
|
|
1370
|
-
n !== "" && this.countStatements(n, t);
|
|
1299
|
+
n.startsWith("#!") ? t.shebangs++ : n.startsWith("#") ? (t.comments++, t.commentLines++) : n !== "" && this.countStatements(n, t);
|
|
1371
1300
|
}
|
|
1372
1301
|
countStatements(e, t) {
|
|
1373
1302
|
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;
|
|
@@ -1461,19 +1390,7 @@ var tt = /^\[\[[^\]]+\]\]/, nt = /^\[[^\]]+\]/, rt = /"""|'''/g, it = {
|
|
|
1461
1390
|
}
|
|
1462
1391
|
countLine(e, t) {
|
|
1463
1392
|
let n = e.trim();
|
|
1464
|
-
|
|
1465
|
-
t.comments++;
|
|
1466
|
-
return;
|
|
1467
|
-
}
|
|
1468
|
-
if (tt.test(n)) {
|
|
1469
|
-
t.arrayTables++;
|
|
1470
|
-
return;
|
|
1471
|
-
}
|
|
1472
|
-
if (nt.test(n)) {
|
|
1473
|
-
t.tables++;
|
|
1474
|
-
return;
|
|
1475
|
-
}
|
|
1476
|
-
this.countKey(n, t);
|
|
1393
|
+
n.startsWith("#") ? t.comments++ : tt.test(n) ? t.arrayTables++ : nt.test(n) ? t.tables++ : this.countKey(n, t);
|
|
1477
1394
|
}
|
|
1478
1395
|
isInsideMultilineString(e, t) {
|
|
1479
1396
|
return (e.match(rt) ?? []).length % 2 == 0 ? t : !t;
|
|
@@ -1661,13 +1578,7 @@ var Y = class TypescriptService {
|
|
|
1661
1578
|
let e = n[1]?.toLowerCase() ?? "";
|
|
1662
1579
|
t.docTags[e] = (t.docTags[e] ?? 0) + 1;
|
|
1663
1580
|
}
|
|
1664
|
-
|
|
1665
|
-
}
|
|
1666
|
-
if (e.startsWith("/*")) {
|
|
1667
|
-
t.blockComments++;
|
|
1668
|
-
return;
|
|
1669
|
-
}
|
|
1670
|
-
t.lineComments++;
|
|
1581
|
+
} else e.startsWith("/*") ? t.blockComments++ : t.lineComments++;
|
|
1671
1582
|
}
|
|
1672
1583
|
countSymbols(e, t) {
|
|
1673
1584
|
let n = ot[e.kind];
|
|
@@ -1765,9 +1676,7 @@ var Y = class TypescriptService {
|
|
|
1765
1676
|
insideClass: !0
|
|
1766
1677
|
};
|
|
1767
1678
|
f.forEachChild(e, (e) => this.walkNode(e, n));
|
|
1768
|
-
|
|
1769
|
-
}
|
|
1770
|
-
this.dispatchNode(e, t.stats, t.insideClass), f.forEachChild(e, (e) => this.walkNode(e, t));
|
|
1679
|
+
} else this.dispatchNode(e, t.stats, t.insideClass), f.forEachChild(e, (e) => this.walkNode(e, t));
|
|
1771
1680
|
}
|
|
1772
1681
|
analyze(e) {
|
|
1773
1682
|
let t = this.createEmptyResult(e);
|
|
@@ -1814,9 +1723,7 @@ var ft = {
|
|
|
1814
1723
|
if (oe(e)) {
|
|
1815
1724
|
t.mappings++;
|
|
1816
1725
|
for (let r of e.items) se(r) && (t.keys++, this.countNode(r.key, t, n + 1), this.countNode(r.value, t, n + 1));
|
|
1817
|
-
|
|
1818
|
-
}
|
|
1819
|
-
if (le(e)) {
|
|
1726
|
+
} else if (le(e)) {
|
|
1820
1727
|
t.sequences++;
|
|
1821
1728
|
for (let r of e.items) this.countNode(r, t, n + 1);
|
|
1822
1729
|
}
|
|
@@ -1828,17 +1735,7 @@ var ft = {
|
|
|
1828
1735
|
t.documents++, this.countComments(e, t), this.countNode(e.contents, t, 1);
|
|
1829
1736
|
}
|
|
1830
1737
|
countNode(e, t, n) {
|
|
1831
|
-
|
|
1832
|
-
if (t.maxDepth = Math.max(t.maxDepth, n), this.countComments(e, t), typeof e.anchor == "string" && t.anchors++, ae(e)) {
|
|
1833
|
-
t.aliases++;
|
|
1834
|
-
return;
|
|
1835
|
-
}
|
|
1836
|
-
if (ce(e)) {
|
|
1837
|
-
t.scalars++;
|
|
1838
|
-
return;
|
|
1839
|
-
}
|
|
1840
|
-
this.countCollection(e, t, n);
|
|
1841
|
-
}
|
|
1738
|
+
(oe(e) || le(e) || ce(e) || ae(e)) && (t.maxDepth = Math.max(t.maxDepth, n), this.countComments(e, t), typeof e.anchor == "string" && t.anchors++, ae(e) ? t.aliases++ : ce(e) ? t.scalars++ : this.countCollection(e, t, n));
|
|
1842
1739
|
}
|
|
1843
1740
|
analyze({ workingDirectory: e, yamlFiles: t }) {
|
|
1844
1741
|
let n = { ...ft };
|
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.15",
|
|
8
|
+
"@codometer/core": "0.0.15",
|
|
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.15"
|
|
75
75
|
}
|