@conformetry/languages 0.0.8 → 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 +14 -0
- package/README.md +8 -8
- package/dist/src/index.js +112 -112
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## 0.0.10 (2026-10-08)
|
|
2
|
+
|
|
3
|
+
### 🧱 Updated Dependencies
|
|
4
|
+
|
|
5
|
+
- Updated conformetry-configuration to 0.0.11
|
|
6
|
+
- Updated conformetry-core to 0.0.10
|
|
7
|
+
|
|
8
|
+
## 0.0.9 (2026-10-08)
|
|
9
|
+
|
|
10
|
+
### 🧱 Updated Dependencies
|
|
11
|
+
|
|
12
|
+
- Updated conformetry-configuration to 0.0.10
|
|
13
|
+
- Updated conformetry-core to 0.0.9
|
|
14
|
+
|
|
1
15
|
## 0.0.8 (2026-10-08)
|
|
2
16
|
|
|
3
17
|
### 🧱 Updated Dependencies
|
package/README.md
CHANGED
|
@@ -753,13 +753,13 @@ graph LR
|
|
|
753
753
|
### Project
|
|
754
754
|
|
|
755
755
|

|
|
756
|
-

|
|
757
757
|

|
|
758
758
|

|
|
759
759
|
|
|
760
760
|
### Measured Targets
|
|
761
761
|
|
|
762
|
-

|
|
763
763
|
|
|
764
764
|
### TypeScript
|
|
765
765
|
|
|
@@ -941,16 +941,16 @@ graph LR
|
|
|
941
941
|
### Markdown
|
|
942
942
|
|
|
943
943
|

|
|
944
|
-

|
|
945
945
|

|
|
946
|
-

|
|
947
|
+

|
|
948
948
|

|
|
949
949
|

|
|
950
950
|

|
|
951
|
-

|
|
952
|
+

|
|
953
|
+

|
|
954
954
|

|
|
955
955
|

|
|
956
956
|

|
package/dist/src/index.js
CHANGED
|
@@ -8,16 +8,16 @@ import { remark as l } from "remark";
|
|
|
8
8
|
import ee from "remark-gfm";
|
|
9
9
|
import { spawnSync as te } from "node:child_process";
|
|
10
10
|
import { fileURLToPath as ne } from "node:url";
|
|
11
|
-
import { ScriptKind as u, ScriptTarget as
|
|
12
|
-
//#region
|
|
13
|
-
var
|
|
11
|
+
import { ScriptKind as u, ScriptTarget as d, SyntaxKind as f, createSourceFile as re, forEachChild as ie, getLeadingCommentRanges as ae, isBigIntLiteral as p, isCallExpression as m, isDecorator as oe, isExportDeclaration as h, isExpressionStatement as g, isIdentifier as _, isImportDeclaration as se, isNoSubstitutionTemplateLiteral as v, isNumericLiteral as y, isPrivateIdentifier as b, isPropertyAccessExpression as x, isStringLiteral as S } from "typescript";
|
|
12
|
+
//#region \0rolldown/runtime.js
|
|
13
|
+
var ce = [
|
|
14
14
|
"javascript",
|
|
15
15
|
"json",
|
|
16
16
|
"markdown",
|
|
17
17
|
"python",
|
|
18
18
|
"text",
|
|
19
19
|
"typescript"
|
|
20
|
-
],
|
|
20
|
+
], le = [
|
|
21
21
|
"code",
|
|
22
22
|
"comment",
|
|
23
23
|
"directory",
|
|
@@ -27,12 +27,12 @@ var fe = [
|
|
|
27
27
|
];
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorateMetadata.js
|
|
30
|
-
function
|
|
30
|
+
function __decorateMetadata(e, t) {
|
|
31
31
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorate.js
|
|
35
|
-
function
|
|
35
|
+
function __decorate(e, t, n, r) {
|
|
36
36
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
37
37
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
38
38
|
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);
|
|
@@ -40,7 +40,7 @@ function x(e, t, n, r) {
|
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/differences/differences.service.ts
|
|
43
|
-
var
|
|
43
|
+
var C = class DifferencesService {
|
|
44
44
|
constructor() {}
|
|
45
45
|
buildMissingDirectoryDifference(e) {
|
|
46
46
|
return {
|
|
@@ -57,25 +57,25 @@ var S = class {
|
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
resolveDifferenceType(e) {
|
|
60
|
-
return
|
|
60
|
+
return le.find((t) => t === e) ?? "code";
|
|
61
61
|
}
|
|
62
62
|
resolveErrorLanguage(e) {
|
|
63
|
-
return
|
|
63
|
+
return ce.find((t) => t === e);
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
|
-
|
|
66
|
+
C = __decorate([e(), __decorateMetadata("design:paramtypes", [])], C);
|
|
67
67
|
//#endregion
|
|
68
68
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/differences/differences.module.ts
|
|
69
|
-
var
|
|
70
|
-
|
|
69
|
+
var w = class DifferencesModule {};
|
|
70
|
+
w = __decorate([t({
|
|
71
71
|
controllers: [],
|
|
72
|
-
exports: [
|
|
72
|
+
exports: [C],
|
|
73
73
|
imports: [],
|
|
74
|
-
providers: [
|
|
75
|
-
})],
|
|
74
|
+
providers: [C]
|
|
75
|
+
})], w);
|
|
76
76
|
//#endregion
|
|
77
77
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/files/files.service.ts
|
|
78
|
-
var
|
|
78
|
+
var T = class FilesService {
|
|
79
79
|
configurationService;
|
|
80
80
|
errorsService;
|
|
81
81
|
constructor(e, t) {
|
|
@@ -124,19 +124,19 @@ var w = class {
|
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
|
-
|
|
127
|
+
T = __decorate([e(), __decorateMetadata("design:paramtypes", [r === void 0 ? Object : r, C === void 0 ? Object : C])], T);
|
|
128
128
|
//#endregion
|
|
129
129
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/files/files.module.ts
|
|
130
|
-
var
|
|
131
|
-
|
|
130
|
+
var E = class FilesModule {};
|
|
131
|
+
E = __decorate([t({
|
|
132
132
|
controllers: [],
|
|
133
|
-
exports: [
|
|
134
|
-
imports: [n,
|
|
135
|
-
providers: [
|
|
136
|
-
})],
|
|
133
|
+
exports: [T],
|
|
134
|
+
imports: [n, w],
|
|
135
|
+
providers: [T]
|
|
136
|
+
})], E);
|
|
137
137
|
//#endregion
|
|
138
138
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/scoring/scoring.constants.ts
|
|
139
|
-
var
|
|
139
|
+
var ue = 1, de = 1, fe = 1, D = class ScoringService {
|
|
140
140
|
constructor() {}
|
|
141
141
|
calculateScore(e) {
|
|
142
142
|
if (e.totalWeight <= 0) return 1;
|
|
@@ -147,10 +147,10 @@ var E = 1, pe = 1, me = 1, D = class {
|
|
|
147
147
|
return e.reduce((e, t) => e + (t.weight ?? 1), 0);
|
|
148
148
|
}
|
|
149
149
|
};
|
|
150
|
-
D =
|
|
150
|
+
D = __decorate([e(), __decorateMetadata("design:paramtypes", [])], D);
|
|
151
151
|
//#endregion
|
|
152
152
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/json/json-comparison.service.ts
|
|
153
|
-
var O = class {
|
|
153
|
+
var O = class JsonComparisonService {
|
|
154
154
|
scoringService;
|
|
155
155
|
constructor(e) {
|
|
156
156
|
this.scoringService = e;
|
|
@@ -313,26 +313,26 @@ var O = class {
|
|
|
313
313
|
};
|
|
314
314
|
}
|
|
315
315
|
};
|
|
316
|
-
O =
|
|
316
|
+
O = __decorate([e(), __decorateMetadata("design:paramtypes", [D === void 0 ? Object : D])], O);
|
|
317
317
|
//#endregion
|
|
318
318
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/scoring/scoring.module.ts
|
|
319
|
-
var k = class {};
|
|
320
|
-
k =
|
|
319
|
+
var k = class ScoringModule {};
|
|
320
|
+
k = __decorate([t({
|
|
321
321
|
controllers: [],
|
|
322
322
|
exports: [D],
|
|
323
323
|
imports: [],
|
|
324
324
|
providers: [D]
|
|
325
325
|
})], k);
|
|
326
|
-
var
|
|
326
|
+
var pe = {
|
|
327
327
|
description: "Checks JSON and JSONC structural conformance",
|
|
328
328
|
fileExtensions: [".json", ".jsonc"],
|
|
329
329
|
name: "json"
|
|
330
|
-
}, A = class {
|
|
330
|
+
}, A = class JsonService {
|
|
331
331
|
jsonComparisonService;
|
|
332
332
|
constructor(e) {
|
|
333
333
|
this.jsonComparisonService = e;
|
|
334
334
|
}
|
|
335
|
-
descriptor =
|
|
335
|
+
descriptor = pe;
|
|
336
336
|
validateDocument(e) {
|
|
337
337
|
return this.jsonComparisonService.compare({
|
|
338
338
|
instanceValue: s(e.instance),
|
|
@@ -341,11 +341,11 @@ var he = {
|
|
|
341
341
|
});
|
|
342
342
|
}
|
|
343
343
|
};
|
|
344
|
-
A =
|
|
344
|
+
A = __decorate([e(), __decorateMetadata("design:paramtypes", [O === void 0 ? Object : O])], A);
|
|
345
345
|
//#endregion
|
|
346
346
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/json/json.module.ts
|
|
347
|
-
var j = class {};
|
|
348
|
-
j =
|
|
347
|
+
var j = class JsonModule {};
|
|
348
|
+
j = __decorate([t({
|
|
349
349
|
controllers: [],
|
|
350
350
|
exports: [O, A],
|
|
351
351
|
imports: [k],
|
|
@@ -353,7 +353,7 @@ j = x([t({
|
|
|
353
353
|
})], j);
|
|
354
354
|
//#endregion
|
|
355
355
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/jupyter/jupyter-notebook.service.ts
|
|
356
|
-
var M = class {
|
|
356
|
+
var M = class JupyterNotebookService {
|
|
357
357
|
constructor() {}
|
|
358
358
|
groupSourcesByKind(e) {
|
|
359
359
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -394,8 +394,8 @@ var M = class {
|
|
|
394
394
|
return Array.isArray(n) ? { cells: n.filter((e) => typeof e == "object" && !!e) } : { cells: [] };
|
|
395
395
|
}
|
|
396
396
|
};
|
|
397
|
-
M =
|
|
398
|
-
var
|
|
397
|
+
M = __decorate([e(), __decorateMetadata("design:paramtypes", [])], M);
|
|
398
|
+
var me = {
|
|
399
399
|
description: "Checks markdown structural conformance using mdast",
|
|
400
400
|
fileExtensions: [".md"],
|
|
401
401
|
name: "markdown"
|
|
@@ -408,7 +408,7 @@ var ge = {
|
|
|
408
408
|
"table",
|
|
409
409
|
"tableCell",
|
|
410
410
|
"tableRow"
|
|
411
|
-
]), P = /* @__PURE__ */ new Set(["text"]), F = class {
|
|
411
|
+
]), P = /* @__PURE__ */ new Set(["text"]), F = class MarkdownNodesService {
|
|
412
412
|
constructor() {}
|
|
413
413
|
matchersByType = {
|
|
414
414
|
code: (e, t) => this.sameField(e.lang, t.lang) && this.sameField(e.value, t.value),
|
|
@@ -455,10 +455,10 @@ var ge = {
|
|
|
455
455
|
return c(e);
|
|
456
456
|
}
|
|
457
457
|
};
|
|
458
|
-
F =
|
|
458
|
+
F = __decorate([e(), __decorateMetadata("design:paramtypes", [])], F);
|
|
459
459
|
//#endregion
|
|
460
460
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/markdown/markdown-tree.service.ts
|
|
461
|
-
var I = class {
|
|
461
|
+
var I = class MarkdownTreeService {
|
|
462
462
|
markdownNodesService;
|
|
463
463
|
scoringService;
|
|
464
464
|
constructor(e, t) {
|
|
@@ -565,17 +565,17 @@ var I = class {
|
|
|
565
565
|
};
|
|
566
566
|
}
|
|
567
567
|
};
|
|
568
|
-
I =
|
|
568
|
+
I = __decorate([e(), __decorateMetadata("design:paramtypes", [F === void 0 ? Object : F, D === void 0 ? Object : D])], I);
|
|
569
569
|
//#endregion
|
|
570
570
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/markdown/markdown.service.ts
|
|
571
|
-
var L = class {
|
|
571
|
+
var L = class MarkdownService {
|
|
572
572
|
markdownNodesService;
|
|
573
573
|
markdownTreeService;
|
|
574
574
|
constructor(e, t) {
|
|
575
575
|
this.markdownNodesService = e, this.markdownTreeService = t;
|
|
576
576
|
}
|
|
577
577
|
processor = l().use(ee);
|
|
578
|
-
descriptor =
|
|
578
|
+
descriptor = me;
|
|
579
579
|
validateDocument(e) {
|
|
580
580
|
let t = this.processor.parse(e.renderedTemplate), n = this.processor.parse(e.instance), r = this.markdownTreeService.compareChildren({
|
|
581
581
|
instanceChildren: this.markdownNodesService.filterNodes(n.children),
|
|
@@ -596,11 +596,11 @@ var L = class {
|
|
|
596
596
|
};
|
|
597
597
|
}
|
|
598
598
|
};
|
|
599
|
-
L =
|
|
599
|
+
L = __decorate([e(), __decorateMetadata("design:paramtypes", [F === void 0 ? Object : F, I === void 0 ? Object : I])], L);
|
|
600
600
|
//#endregion
|
|
601
601
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/markdown/markdown.module.ts
|
|
602
|
-
var R = class {};
|
|
603
|
-
R =
|
|
602
|
+
var R = class MarkdownModule {};
|
|
603
|
+
R = __decorate([t({
|
|
604
604
|
controllers: [],
|
|
605
605
|
exports: [L],
|
|
606
606
|
imports: [k],
|
|
@@ -610,11 +610,11 @@ R = x([t({
|
|
|
610
610
|
I
|
|
611
611
|
]
|
|
612
612
|
})], R);
|
|
613
|
-
var
|
|
613
|
+
var he = {
|
|
614
614
|
description: "Checks Python structure and comments against templates",
|
|
615
615
|
fileExtensions: [".py"],
|
|
616
616
|
name: "python"
|
|
617
|
-
}, z = "python3",
|
|
617
|
+
}, z = "python3", ge = "python.bridge", _e = "Install Python 3 and ensure `python3` is on PATH; conformetry validates Python files through the interpreter's own ast module.", B = class PythonBridgeService {
|
|
618
618
|
errorsService;
|
|
619
619
|
scoringService;
|
|
620
620
|
constructor(e, t) {
|
|
@@ -625,7 +625,7 @@ var _e = {
|
|
|
625
625
|
return {
|
|
626
626
|
differences: [{
|
|
627
627
|
differenceType: "code",
|
|
628
|
-
fix:
|
|
628
|
+
fix: _e,
|
|
629
629
|
language: "python",
|
|
630
630
|
message: e
|
|
631
631
|
}],
|
|
@@ -668,7 +668,7 @@ var _e = {
|
|
|
668
668
|
};
|
|
669
669
|
}
|
|
670
670
|
validatePythonSource(e) {
|
|
671
|
-
let t = te(z, ["-m",
|
|
671
|
+
let t = te(z, ["-m", ge], {
|
|
672
672
|
cwd: this.pythonRootPath,
|
|
673
673
|
encoding: "utf8",
|
|
674
674
|
env: {
|
|
@@ -690,15 +690,15 @@ var _e = {
|
|
|
690
690
|
}
|
|
691
691
|
}
|
|
692
692
|
};
|
|
693
|
-
B =
|
|
693
|
+
B = __decorate([e(), __decorateMetadata("design:paramtypes", [C === void 0 ? Object : C, D === void 0 ? Object : D])], B);
|
|
694
694
|
//#endregion
|
|
695
695
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/python/python.service.ts
|
|
696
|
-
var V = class {
|
|
696
|
+
var V = class PythonService {
|
|
697
697
|
pythonBridgeService;
|
|
698
698
|
constructor(e) {
|
|
699
699
|
this.pythonBridgeService = e;
|
|
700
700
|
}
|
|
701
|
-
descriptor =
|
|
701
|
+
descriptor = he;
|
|
702
702
|
validateDocument(e) {
|
|
703
703
|
return this.pythonBridgeService.validatePythonSource({
|
|
704
704
|
filename: e.filename,
|
|
@@ -707,25 +707,25 @@ var V = class {
|
|
|
707
707
|
});
|
|
708
708
|
}
|
|
709
709
|
};
|
|
710
|
-
V =
|
|
710
|
+
V = __decorate([e(), __decorateMetadata("design:paramtypes", [B === void 0 ? Object : B])], V);
|
|
711
711
|
//#endregion
|
|
712
712
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/python/python.module.ts
|
|
713
|
-
var H = class {};
|
|
714
|
-
H =
|
|
713
|
+
var H = class PythonModule {};
|
|
714
|
+
H = __decorate([t({
|
|
715
715
|
controllers: [],
|
|
716
716
|
exports: [B, V],
|
|
717
|
-
imports: [
|
|
717
|
+
imports: [w, k],
|
|
718
718
|
providers: [B, V]
|
|
719
719
|
})], H);
|
|
720
|
-
var
|
|
720
|
+
var ve = {
|
|
721
721
|
description: "Checks Jupyter notebook structure, markdown cells, and code cells",
|
|
722
722
|
fileExtensions: [".ipynb"],
|
|
723
723
|
name: "jupyter"
|
|
724
|
-
},
|
|
724
|
+
}, ye = [
|
|
725
725
|
"metadata",
|
|
726
726
|
"nbformat",
|
|
727
727
|
"nbformat_minor"
|
|
728
|
-
], U = class {
|
|
728
|
+
], U = class JupyterService {
|
|
729
729
|
jsonComparisonService;
|
|
730
730
|
jupyterNotebookService;
|
|
731
731
|
markdownService;
|
|
@@ -733,7 +733,7 @@ var be = {
|
|
|
733
733
|
constructor(e, t, n, r) {
|
|
734
734
|
this.jsonComparisonService = e, this.jupyterNotebookService = t, this.markdownService = n, this.pythonBridgeService = r;
|
|
735
735
|
}
|
|
736
|
-
descriptor =
|
|
736
|
+
descriptor = ve;
|
|
737
737
|
attributeToCell(e) {
|
|
738
738
|
return e.differences.map((t) => ({
|
|
739
739
|
...t,
|
|
@@ -744,7 +744,7 @@ var be = {
|
|
|
744
744
|
let t = s(e);
|
|
745
745
|
if (typeof t != "object" || !t || Array.isArray(t)) return {};
|
|
746
746
|
let n = {};
|
|
747
|
-
for (let e of
|
|
747
|
+
for (let e of ye) {
|
|
748
748
|
let r = t[e];
|
|
749
749
|
r !== void 0 && (n[e] = r);
|
|
750
750
|
}
|
|
@@ -836,7 +836,7 @@ var be = {
|
|
|
836
836
|
};
|
|
837
837
|
}
|
|
838
838
|
};
|
|
839
|
-
U =
|
|
839
|
+
U = __decorate([e(), __decorateMetadata("design:paramtypes", [
|
|
840
840
|
O === void 0 ? Object : O,
|
|
841
841
|
M === void 0 ? Object : M,
|
|
842
842
|
L === void 0 ? Object : L,
|
|
@@ -844,8 +844,8 @@ U = x([e(), b("design:paramtypes", [
|
|
|
844
844
|
])], U);
|
|
845
845
|
//#endregion
|
|
846
846
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/jupyter/jupyter.module.ts
|
|
847
|
-
var W = class {};
|
|
848
|
-
W =
|
|
847
|
+
var W = class JupyterModule {};
|
|
848
|
+
W = __decorate([t({
|
|
849
849
|
controllers: [],
|
|
850
850
|
exports: [U],
|
|
851
851
|
imports: [
|
|
@@ -855,13 +855,13 @@ W = x([t({
|
|
|
855
855
|
],
|
|
856
856
|
providers: [M, U]
|
|
857
857
|
})], W);
|
|
858
|
-
var
|
|
858
|
+
var be = {
|
|
859
859
|
description: "Checks text files using duplicate-aware line conformance",
|
|
860
860
|
fileExtensions: [".txt"],
|
|
861
861
|
name: "text"
|
|
862
|
-
}, G = class {
|
|
862
|
+
}, G = class TextService {
|
|
863
863
|
constructor() {}
|
|
864
|
-
descriptor =
|
|
864
|
+
descriptor = be;
|
|
865
865
|
captureLine(e) {
|
|
866
866
|
for (let [t, n] of e.remainingLines) {
|
|
867
867
|
let r = n === 0 ? void 0 : i({
|
|
@@ -917,26 +917,26 @@ var Se = {
|
|
|
917
917
|
};
|
|
918
918
|
}
|
|
919
919
|
};
|
|
920
|
-
G =
|
|
920
|
+
G = __decorate([e(), __decorateMetadata("design:paramtypes", [])], G);
|
|
921
921
|
//#endregion
|
|
922
922
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/text/text.module.ts
|
|
923
|
-
var K = class {};
|
|
924
|
-
K =
|
|
923
|
+
var K = class TextModule {};
|
|
924
|
+
K = __decorate([t({
|
|
925
925
|
controllers: [],
|
|
926
926
|
exports: [G],
|
|
927
927
|
imports: [],
|
|
928
928
|
providers: [G]
|
|
929
929
|
})], K);
|
|
930
|
-
var
|
|
930
|
+
var xe = {
|
|
931
931
|
description: "Checks TypeScript AST structure and required comments",
|
|
932
932
|
fileExtensions: [".ts", ".tsx"],
|
|
933
933
|
name: "typescript"
|
|
934
|
-
},
|
|
934
|
+
}, Se = /\bTODO\b/u, q = class TypescriptCommentsService {
|
|
935
935
|
constructor() {}
|
|
936
936
|
compareComments(e) {
|
|
937
937
|
let t = this.extractComments(e.instanceSourceFile), n = this.extractComments(e.templateSourceFile), r = [], i = 0;
|
|
938
938
|
for (let e of n) {
|
|
939
|
-
let n =
|
|
939
|
+
let n = Se.test(e.text), a = t.slice(i).findIndex((t) => n || t.text === e.text);
|
|
940
940
|
if (a === -1) {
|
|
941
941
|
r.push(e);
|
|
942
942
|
continue;
|
|
@@ -949,29 +949,29 @@ var Ce = {
|
|
|
949
949
|
};
|
|
950
950
|
}
|
|
951
951
|
extractComments(e) {
|
|
952
|
-
let t = /* @__PURE__ */ new Map(),
|
|
953
|
-
let
|
|
954
|
-
if (
|
|
955
|
-
for (let
|
|
956
|
-
position:
|
|
957
|
-
text: e.text.slice(
|
|
952
|
+
let t = /* @__PURE__ */ new Map(), visit = (n) => {
|
|
953
|
+
let r = n.getChildren(e);
|
|
954
|
+
if (r.length === 0) {
|
|
955
|
+
for (let r of ae(e.text, n.getFullStart()) ?? []) t.set(r.pos, {
|
|
956
|
+
position: r.pos,
|
|
957
|
+
text: e.text.slice(r.pos, r.end).trim()
|
|
958
958
|
});
|
|
959
959
|
return;
|
|
960
960
|
}
|
|
961
|
-
for (let e of
|
|
961
|
+
for (let e of r) visit(e);
|
|
962
962
|
};
|
|
963
|
-
return
|
|
963
|
+
return visit(e), [...t.values()].toSorted((e, t) => e.position - t.position);
|
|
964
964
|
}
|
|
965
965
|
};
|
|
966
|
-
q =
|
|
966
|
+
q = __decorate([e(), __decorateMetadata("design:paramtypes", [])], q);
|
|
967
967
|
//#endregion
|
|
968
968
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/typescript/typescript-nodes.service.ts
|
|
969
|
-
var J = class {
|
|
969
|
+
var J = class TypescriptNodesService {
|
|
970
970
|
constructor() {}
|
|
971
971
|
buildDottedName(e) {
|
|
972
972
|
let t = [], n = e;
|
|
973
|
-
for (;
|
|
974
|
-
return
|
|
973
|
+
for (; x(n);) t.unshift(n.name.text), n = n.expression;
|
|
974
|
+
return _(n) ? (t.unshift(n.text), t.join(".")) : null;
|
|
975
975
|
}
|
|
976
976
|
isNode(e) {
|
|
977
977
|
return typeof e == "object" && !!e && "kind" in e && typeof e.kind == "number";
|
|
@@ -981,7 +981,7 @@ var J = class {
|
|
|
981
981
|
}
|
|
982
982
|
readExportKey(e) {
|
|
983
983
|
let { moduleSpecifier: t } = e;
|
|
984
|
-
return t === void 0 || !
|
|
984
|
+
return t === void 0 || !S(t) ? null : t.text;
|
|
985
985
|
}
|
|
986
986
|
readExpressionStatementKey(e) {
|
|
987
987
|
if (!m(e)) return null;
|
|
@@ -991,43 +991,43 @@ var J = class {
|
|
|
991
991
|
return r === void 0 ? t : `${t}:${r}`;
|
|
992
992
|
}
|
|
993
993
|
readImportKey(e) {
|
|
994
|
-
return
|
|
994
|
+
return S(e.moduleSpecifier) ? e.moduleSpecifier.text : null;
|
|
995
995
|
}
|
|
996
996
|
readLiteralKey(e) {
|
|
997
|
-
if (
|
|
997
|
+
if (_(e) || S(e) || y(e) || p(e) || v(e)) return e.text;
|
|
998
998
|
}
|
|
999
999
|
readNamedKey(e) {
|
|
1000
1000
|
if (!("name" in e)) return null;
|
|
1001
1001
|
let t = e.name;
|
|
1002
|
-
return this.isNode(t) && (
|
|
1002
|
+
return this.isNode(t) && (_(t) || b(t) || S(t) || y(t)) ? t.text : null;
|
|
1003
1003
|
}
|
|
1004
1004
|
countSubtree(e) {
|
|
1005
1005
|
return this.readChildren(e).reduce((e, t) => e + this.countSubtree(t), 1);
|
|
1006
1006
|
}
|
|
1007
1007
|
readChildren(e) {
|
|
1008
1008
|
let t = [];
|
|
1009
|
-
return
|
|
1010
|
-
e.kind !==
|
|
1009
|
+
return ie(e, (e) => {
|
|
1010
|
+
e.kind !== f.EndOfFileToken && t.push(e);
|
|
1011
1011
|
}), t;
|
|
1012
1012
|
}
|
|
1013
1013
|
readKey(e) {
|
|
1014
|
-
if (
|
|
1015
|
-
if (
|
|
1016
|
-
if (
|
|
1017
|
-
if (
|
|
1014
|
+
if (se(e)) return this.readImportKey(e);
|
|
1015
|
+
if (h(e)) return this.readExportKey(e);
|
|
1016
|
+
if (oe(e)) return this.readDecoratorKey(e);
|
|
1017
|
+
if (g(e)) {
|
|
1018
1018
|
let t = this.readExpressionStatementKey(e.expression);
|
|
1019
1019
|
if (t !== null) return t;
|
|
1020
1020
|
}
|
|
1021
1021
|
return this.readLiteralKey(e) ?? this.readNamedKey(e);
|
|
1022
1022
|
}
|
|
1023
1023
|
readKindLabel(e) {
|
|
1024
|
-
return
|
|
1024
|
+
return f[e.kind];
|
|
1025
1025
|
}
|
|
1026
1026
|
};
|
|
1027
|
-
J =
|
|
1027
|
+
J = __decorate([e(), __decorateMetadata("design:paramtypes", [])], J);
|
|
1028
1028
|
//#endregion
|
|
1029
1029
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/typescript/typescript-tree.service.ts
|
|
1030
|
-
var Y = class {
|
|
1030
|
+
var Y = class TypescriptTreeService {
|
|
1031
1031
|
scoringService;
|
|
1032
1032
|
typeScriptNodesService;
|
|
1033
1033
|
constructor(e, t) {
|
|
@@ -1118,18 +1118,18 @@ var Y = class {
|
|
|
1118
1118
|
});
|
|
1119
1119
|
}
|
|
1120
1120
|
};
|
|
1121
|
-
Y =
|
|
1121
|
+
Y = __decorate([e(), __decorateMetadata("design:paramtypes", [D === void 0 ? Object : D, J === void 0 ? Object : J])], Y);
|
|
1122
1122
|
//#endregion
|
|
1123
1123
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/typescript/typescript.service.ts
|
|
1124
|
-
var X = class {
|
|
1124
|
+
var X = class TypescriptService {
|
|
1125
1125
|
typeScriptCommentsService;
|
|
1126
1126
|
typeScriptTreeService;
|
|
1127
1127
|
constructor(e, t) {
|
|
1128
1128
|
this.typeScriptCommentsService = e, this.typeScriptTreeService = t;
|
|
1129
1129
|
}
|
|
1130
|
-
descriptor =
|
|
1130
|
+
descriptor = xe;
|
|
1131
1131
|
parseSourceFile(e) {
|
|
1132
|
-
return
|
|
1132
|
+
return re(e.filename, e.content, d.Latest, !0, e.filename.endsWith(".tsx") ? u.TSX : u.TS);
|
|
1133
1133
|
}
|
|
1134
1134
|
readLocation(e) {
|
|
1135
1135
|
if (e.position === void 0 || e.position < 0) return;
|
|
@@ -1214,11 +1214,11 @@ var X = class {
|
|
|
1214
1214
|
};
|
|
1215
1215
|
}
|
|
1216
1216
|
};
|
|
1217
|
-
X =
|
|
1217
|
+
X = __decorate([e(), __decorateMetadata("design:paramtypes", [q === void 0 ? Object : q, Y === void 0 ? Object : Y])], X);
|
|
1218
1218
|
//#endregion
|
|
1219
1219
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/typescript/typescript.module.ts
|
|
1220
|
-
var Z = class {};
|
|
1221
|
-
Z =
|
|
1220
|
+
var Z = class TypescriptModule {};
|
|
1221
|
+
Z = __decorate([t({
|
|
1222
1222
|
controllers: [],
|
|
1223
1223
|
exports: [X],
|
|
1224
1224
|
imports: [k],
|
|
@@ -1231,7 +1231,7 @@ Z = x([t({
|
|
|
1231
1231
|
})], Z);
|
|
1232
1232
|
//#endregion
|
|
1233
1233
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/languages/languages.service.ts
|
|
1234
|
-
var Q = class {
|
|
1234
|
+
var Q = class LanguagesService {
|
|
1235
1235
|
jsonService;
|
|
1236
1236
|
jupyterService;
|
|
1237
1237
|
markdownService;
|
|
@@ -1265,7 +1265,7 @@ var Q = class {
|
|
|
1265
1265
|
return r.length === 0 ? t : [...t, this.widenFallback(r)];
|
|
1266
1266
|
}
|
|
1267
1267
|
};
|
|
1268
|
-
Q =
|
|
1268
|
+
Q = __decorate([e(), __decorateMetadata("design:paramtypes", [
|
|
1269
1269
|
A === void 0 ? Object : A,
|
|
1270
1270
|
U === void 0 ? Object : U,
|
|
1271
1271
|
L === void 0 ? Object : L,
|
|
@@ -1275,8 +1275,8 @@ Q = x([e(), b("design:paramtypes", [
|
|
|
1275
1275
|
])], Q);
|
|
1276
1276
|
//#endregion
|
|
1277
1277
|
//#region packages/ic-suite/conformetry/conformetry-languages/src/modules/languages/languages.module.ts
|
|
1278
|
-
var $ = class {};
|
|
1279
|
-
$ =
|
|
1278
|
+
var $ = class LanguagesModule {};
|
|
1279
|
+
$ = __decorate([t({
|
|
1280
1280
|
controllers: [],
|
|
1281
1281
|
exports: [
|
|
1282
1282
|
j,
|
|
@@ -1298,4 +1298,4 @@ $ = x([t({
|
|
|
1298
1298
|
providers: [Q]
|
|
1299
1299
|
})], $);
|
|
1300
1300
|
//#endregion
|
|
1301
|
-
export {
|
|
1301
|
+
export { ue as DEFAULT_ERROR_WEIGHT, w as DifferencesModule, C as DifferencesService, de as EMPTY_TEMPLATE_SCORE, E as FilesModule, T as FilesService, O as JsonComparisonService, j as JsonModule, A as JsonService, W as JupyterModule, M as JupyterNotebookService, U as JupyterService, $ as LanguagesModule, Q as LanguagesService, R as MarkdownModule, F as MarkdownNodesService, L as MarkdownService, I as MarkdownTreeService, fe as PERFECT_SCORE, B as PythonBridgeService, H as PythonModule, V as PythonService, k as ScoringModule, D as ScoringService, K as TextModule, G as TextService, q as TypescriptCommentsService, Z as TypescriptModule, J as TypescriptNodesService, X as TypescriptService, Y as TypescriptTreeService };
|
package/package.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"url": "https://github.com/organizzolini/codebase/issues"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@conformetry/configuration": "0.0.
|
|
8
|
-
"@conformetry/core": "0.0.
|
|
7
|
+
"@conformetry/configuration": "0.0.11",
|
|
8
|
+
"@conformetry/core": "0.0.10",
|
|
9
9
|
"@nestjs/common": "^11.1.21 || ^12.0.1",
|
|
10
10
|
"jsonc-parser": "^3.3.1",
|
|
11
11
|
"mdast-util-to-string": "^4.0.0",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"strict": true
|
|
67
67
|
},
|
|
68
68
|
"types": "./dist/src/index.d.ts",
|
|
69
|
-
"version": "0.0.
|
|
69
|
+
"version": "0.0.10"
|
|
70
70
|
}
|