@harness-engineering/core 0.9.0 → 0.9.1
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 +25 -13
- package/dist/index.mjs +25 -13
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -960,13 +960,17 @@ var PHASE_PRIORITIES = {
|
|
|
960
960
|
priority: 2
|
|
961
961
|
},
|
|
962
962
|
{ category: "tests", patterns: ["tests/**/*.test.ts", "**/*.spec.ts"], priority: 3 },
|
|
963
|
-
{ category: "specs", patterns: ["docs/
|
|
963
|
+
{ category: "specs", patterns: ["docs/changes/*/proposal.md"], priority: 4 },
|
|
964
964
|
{ category: "config", patterns: ["package.json", "tsconfig.json"], priority: 5 }
|
|
965
965
|
],
|
|
966
966
|
review: [
|
|
967
967
|
{ category: "diff", patterns: [], priority: 1 },
|
|
968
968
|
// Diff is provided, not globbed
|
|
969
|
-
{
|
|
969
|
+
{
|
|
970
|
+
category: "specs",
|
|
971
|
+
patterns: ["docs/changes/*/proposal.md", "docs/plans/**/*.md"],
|
|
972
|
+
priority: 2
|
|
973
|
+
},
|
|
970
974
|
{ category: "learnings", patterns: [".harness/review-learnings.md"], priority: 3 },
|
|
971
975
|
{ category: "types", patterns: ["src/**/types.ts", "src/**/interfaces.ts"], priority: 4 },
|
|
972
976
|
{ category: "tests", patterns: ["tests/**/*.test.ts"], priority: 5 }
|
|
@@ -979,7 +983,11 @@ var PHASE_PRIORITIES = {
|
|
|
979
983
|
{ category: "types", patterns: ["src/**/types.ts"], priority: 5 }
|
|
980
984
|
],
|
|
981
985
|
plan: [
|
|
982
|
-
{
|
|
986
|
+
{
|
|
987
|
+
category: "specs",
|
|
988
|
+
patterns: ["docs/changes/*/proposal.md", "docs/plans/**/*.md"],
|
|
989
|
+
priority: 1
|
|
990
|
+
},
|
|
983
991
|
{ category: "architecture", patterns: ["AGENTS.md", "docs/standard/**/*.md"], priority: 2 },
|
|
984
992
|
{ category: "handoffs", patterns: [".harness/handoff.md"], priority: 3 },
|
|
985
993
|
{ category: "types", patterns: ["src/**/types.ts", "src/**/interfaces.ts"], priority: 4 },
|
|
@@ -1033,7 +1041,7 @@ function resolveImportPath(importSource, fromFile, _rootDir) {
|
|
|
1033
1041
|
if (!resolved.endsWith(".ts") && !resolved.endsWith(".tsx")) {
|
|
1034
1042
|
resolved = resolved + ".ts";
|
|
1035
1043
|
}
|
|
1036
|
-
return resolved;
|
|
1044
|
+
return resolved.replace(/\\/g, "/");
|
|
1037
1045
|
}
|
|
1038
1046
|
function getImportType(imp) {
|
|
1039
1047
|
if (imp.kind === "type") return "type-only";
|
|
@@ -1046,9 +1054,10 @@ async function buildDependencyGraph(files, parser, graphDependencyData) {
|
|
|
1046
1054
|
edges: graphDependencyData.edges
|
|
1047
1055
|
});
|
|
1048
1056
|
}
|
|
1049
|
-
const nodes =
|
|
1057
|
+
const nodes = files.map((f) => f.replace(/\\/g, "/"));
|
|
1050
1058
|
const edges = [];
|
|
1051
1059
|
for (const file of files) {
|
|
1060
|
+
const normalizedFile = file.replace(/\\/g, "/");
|
|
1052
1061
|
const parseResult = await parser.parseFile(file);
|
|
1053
1062
|
if (!parseResult.ok) {
|
|
1054
1063
|
continue;
|
|
@@ -1061,7 +1070,7 @@ async function buildDependencyGraph(files, parser, graphDependencyData) {
|
|
|
1061
1070
|
const resolvedPath = resolveImportPath(imp.source, file, "");
|
|
1062
1071
|
if (resolvedPath) {
|
|
1063
1072
|
edges.push({
|
|
1064
|
-
from:
|
|
1073
|
+
from: normalizedFile,
|
|
1065
1074
|
to: resolvedPath,
|
|
1066
1075
|
importType: getImportType(imp),
|
|
1067
1076
|
line: imp.location.line
|
|
@@ -4071,7 +4080,7 @@ var CriticalPathResolver = class {
|
|
|
4071
4080
|
return;
|
|
4072
4081
|
}
|
|
4073
4082
|
const lines = content.split("\n");
|
|
4074
|
-
const relativePath = path.relative(this.projectRoot, filePath);
|
|
4083
|
+
const relativePath = path.relative(this.projectRoot, filePath).replace(/\\/g, "/");
|
|
4075
4084
|
for (let i = 0; i < lines.length; i++) {
|
|
4076
4085
|
const line = lines[i];
|
|
4077
4086
|
if (!line.includes("@perf-critical")) continue;
|
|
@@ -7666,8 +7675,10 @@ function extractCrossFileRefs(finding) {
|
|
|
7666
7675
|
}
|
|
7667
7676
|
function normalizePath(filePath, projectRoot) {
|
|
7668
7677
|
let normalized = filePath;
|
|
7678
|
+
normalized = normalized.replace(/\\/g, "/");
|
|
7679
|
+
const normalizedRoot = projectRoot.replace(/\\/g, "/");
|
|
7669
7680
|
if (path8.isAbsolute(normalized)) {
|
|
7670
|
-
const root =
|
|
7681
|
+
const root = normalizedRoot.endsWith("/") ? normalizedRoot : normalizedRoot + "/";
|
|
7671
7682
|
if (normalized.startsWith(root)) {
|
|
7672
7683
|
normalized = normalized.slice(root.length);
|
|
7673
7684
|
}
|
|
@@ -7675,7 +7686,7 @@ function normalizePath(filePath, projectRoot) {
|
|
|
7675
7686
|
if (normalized.startsWith("./")) {
|
|
7676
7687
|
normalized = normalized.slice(2);
|
|
7677
7688
|
}
|
|
7678
|
-
return
|
|
7689
|
+
return normalized;
|
|
7679
7690
|
}
|
|
7680
7691
|
function followImportChain(fromFile, fileContents, maxDepth = 2) {
|
|
7681
7692
|
const visited = /* @__PURE__ */ new Set();
|
|
@@ -7692,11 +7703,11 @@ function followImportChain(fromFile, fileContents, maxDepth = 2) {
|
|
|
7692
7703
|
const importPath = match[1];
|
|
7693
7704
|
if (!importPath.startsWith(".")) continue;
|
|
7694
7705
|
const dir = path8.dirname(current.file);
|
|
7695
|
-
let resolved = path8.join(dir, importPath);
|
|
7706
|
+
let resolved = path8.join(dir, importPath).replace(/\\/g, "/");
|
|
7696
7707
|
if (!resolved.match(/\.(ts|tsx|js|jsx)$/)) {
|
|
7697
7708
|
resolved += ".ts";
|
|
7698
7709
|
}
|
|
7699
|
-
resolved = path8.normalize(resolved);
|
|
7710
|
+
resolved = path8.normalize(resolved).replace(/\\/g, "/");
|
|
7700
7711
|
if (!visited.has(resolved) && current.depth + 1 <= maxDepth) {
|
|
7701
7712
|
queue.push({ file: resolved, depth: current.depth + 1 });
|
|
7702
7713
|
}
|
|
@@ -7713,7 +7724,7 @@ async function validateFindings(options) {
|
|
|
7713
7724
|
if (exclusionSet.isExcluded(normalizedFile, finding.lineRange) || exclusionSet.isExcluded(finding.file, finding.lineRange)) {
|
|
7714
7725
|
continue;
|
|
7715
7726
|
}
|
|
7716
|
-
const absoluteFile = path8.isAbsolute(finding.file) ? finding.file : path8.join(projectRoot, finding.file);
|
|
7727
|
+
const absoluteFile = path8.isAbsolute(finding.file) ? finding.file : path8.join(projectRoot, finding.file).replace(/\\/g, "/");
|
|
7717
7728
|
if (exclusionSet.isExcluded(absoluteFile, finding.lineRange)) {
|
|
7718
7729
|
continue;
|
|
7719
7730
|
}
|
|
@@ -8483,7 +8494,8 @@ var path10 = __toESM(require("path"));
|
|
|
8483
8494
|
var os = __toESM(require("os"));
|
|
8484
8495
|
var import_child_process3 = require("child_process");
|
|
8485
8496
|
function getStatePath() {
|
|
8486
|
-
|
|
8497
|
+
const home = process.env["HOME"] || os.homedir();
|
|
8498
|
+
return path10.join(home, ".harness", "update-check.json");
|
|
8487
8499
|
}
|
|
8488
8500
|
function isUpdateCheckEnabled(configInterval) {
|
|
8489
8501
|
if (process.env["HARNESS_NO_UPDATE_CHECK"] === "1") return false;
|
package/dist/index.mjs
CHANGED
|
@@ -765,13 +765,17 @@ var PHASE_PRIORITIES = {
|
|
|
765
765
|
priority: 2
|
|
766
766
|
},
|
|
767
767
|
{ category: "tests", patterns: ["tests/**/*.test.ts", "**/*.spec.ts"], priority: 3 },
|
|
768
|
-
{ category: "specs", patterns: ["docs/
|
|
768
|
+
{ category: "specs", patterns: ["docs/changes/*/proposal.md"], priority: 4 },
|
|
769
769
|
{ category: "config", patterns: ["package.json", "tsconfig.json"], priority: 5 }
|
|
770
770
|
],
|
|
771
771
|
review: [
|
|
772
772
|
{ category: "diff", patterns: [], priority: 1 },
|
|
773
773
|
// Diff is provided, not globbed
|
|
774
|
-
{
|
|
774
|
+
{
|
|
775
|
+
category: "specs",
|
|
776
|
+
patterns: ["docs/changes/*/proposal.md", "docs/plans/**/*.md"],
|
|
777
|
+
priority: 2
|
|
778
|
+
},
|
|
775
779
|
{ category: "learnings", patterns: [".harness/review-learnings.md"], priority: 3 },
|
|
776
780
|
{ category: "types", patterns: ["src/**/types.ts", "src/**/interfaces.ts"], priority: 4 },
|
|
777
781
|
{ category: "tests", patterns: ["tests/**/*.test.ts"], priority: 5 }
|
|
@@ -784,7 +788,11 @@ var PHASE_PRIORITIES = {
|
|
|
784
788
|
{ category: "types", patterns: ["src/**/types.ts"], priority: 5 }
|
|
785
789
|
],
|
|
786
790
|
plan: [
|
|
787
|
-
{
|
|
791
|
+
{
|
|
792
|
+
category: "specs",
|
|
793
|
+
patterns: ["docs/changes/*/proposal.md", "docs/plans/**/*.md"],
|
|
794
|
+
priority: 1
|
|
795
|
+
},
|
|
788
796
|
{ category: "architecture", patterns: ["AGENTS.md", "docs/standard/**/*.md"], priority: 2 },
|
|
789
797
|
{ category: "handoffs", patterns: [".harness/handoff.md"], priority: 3 },
|
|
790
798
|
{ category: "types", patterns: ["src/**/types.ts", "src/**/interfaces.ts"], priority: 4 },
|
|
@@ -838,7 +846,7 @@ function resolveImportPath(importSource, fromFile, _rootDir) {
|
|
|
838
846
|
if (!resolved.endsWith(".ts") && !resolved.endsWith(".tsx")) {
|
|
839
847
|
resolved = resolved + ".ts";
|
|
840
848
|
}
|
|
841
|
-
return resolved;
|
|
849
|
+
return resolved.replace(/\\/g, "/");
|
|
842
850
|
}
|
|
843
851
|
function getImportType(imp) {
|
|
844
852
|
if (imp.kind === "type") return "type-only";
|
|
@@ -851,9 +859,10 @@ async function buildDependencyGraph(files, parser, graphDependencyData) {
|
|
|
851
859
|
edges: graphDependencyData.edges
|
|
852
860
|
});
|
|
853
861
|
}
|
|
854
|
-
const nodes =
|
|
862
|
+
const nodes = files.map((f) => f.replace(/\\/g, "/"));
|
|
855
863
|
const edges = [];
|
|
856
864
|
for (const file of files) {
|
|
865
|
+
const normalizedFile = file.replace(/\\/g, "/");
|
|
857
866
|
const parseResult = await parser.parseFile(file);
|
|
858
867
|
if (!parseResult.ok) {
|
|
859
868
|
continue;
|
|
@@ -866,7 +875,7 @@ async function buildDependencyGraph(files, parser, graphDependencyData) {
|
|
|
866
875
|
const resolvedPath = resolveImportPath(imp.source, file, "");
|
|
867
876
|
if (resolvedPath) {
|
|
868
877
|
edges.push({
|
|
869
|
-
from:
|
|
878
|
+
from: normalizedFile,
|
|
870
879
|
to: resolvedPath,
|
|
871
880
|
importType: getImportType(imp),
|
|
872
881
|
line: imp.location.line
|
|
@@ -3876,7 +3885,7 @@ var CriticalPathResolver = class {
|
|
|
3876
3885
|
return;
|
|
3877
3886
|
}
|
|
3878
3887
|
const lines = content.split("\n");
|
|
3879
|
-
const relativePath = path.relative(this.projectRoot, filePath);
|
|
3888
|
+
const relativePath = path.relative(this.projectRoot, filePath).replace(/\\/g, "/");
|
|
3880
3889
|
for (let i = 0; i < lines.length; i++) {
|
|
3881
3890
|
const line = lines[i];
|
|
3882
3891
|
if (!line.includes("@perf-critical")) continue;
|
|
@@ -7471,8 +7480,10 @@ function extractCrossFileRefs(finding) {
|
|
|
7471
7480
|
}
|
|
7472
7481
|
function normalizePath(filePath, projectRoot) {
|
|
7473
7482
|
let normalized = filePath;
|
|
7483
|
+
normalized = normalized.replace(/\\/g, "/");
|
|
7484
|
+
const normalizedRoot = projectRoot.replace(/\\/g, "/");
|
|
7474
7485
|
if (path8.isAbsolute(normalized)) {
|
|
7475
|
-
const root =
|
|
7486
|
+
const root = normalizedRoot.endsWith("/") ? normalizedRoot : normalizedRoot + "/";
|
|
7476
7487
|
if (normalized.startsWith(root)) {
|
|
7477
7488
|
normalized = normalized.slice(root.length);
|
|
7478
7489
|
}
|
|
@@ -7480,7 +7491,7 @@ function normalizePath(filePath, projectRoot) {
|
|
|
7480
7491
|
if (normalized.startsWith("./")) {
|
|
7481
7492
|
normalized = normalized.slice(2);
|
|
7482
7493
|
}
|
|
7483
|
-
return
|
|
7494
|
+
return normalized;
|
|
7484
7495
|
}
|
|
7485
7496
|
function followImportChain(fromFile, fileContents, maxDepth = 2) {
|
|
7486
7497
|
const visited = /* @__PURE__ */ new Set();
|
|
@@ -7497,11 +7508,11 @@ function followImportChain(fromFile, fileContents, maxDepth = 2) {
|
|
|
7497
7508
|
const importPath = match[1];
|
|
7498
7509
|
if (!importPath.startsWith(".")) continue;
|
|
7499
7510
|
const dir = path8.dirname(current.file);
|
|
7500
|
-
let resolved = path8.join(dir, importPath);
|
|
7511
|
+
let resolved = path8.join(dir, importPath).replace(/\\/g, "/");
|
|
7501
7512
|
if (!resolved.match(/\.(ts|tsx|js|jsx)$/)) {
|
|
7502
7513
|
resolved += ".ts";
|
|
7503
7514
|
}
|
|
7504
|
-
resolved = path8.normalize(resolved);
|
|
7515
|
+
resolved = path8.normalize(resolved).replace(/\\/g, "/");
|
|
7505
7516
|
if (!visited.has(resolved) && current.depth + 1 <= maxDepth) {
|
|
7506
7517
|
queue.push({ file: resolved, depth: current.depth + 1 });
|
|
7507
7518
|
}
|
|
@@ -7518,7 +7529,7 @@ async function validateFindings(options) {
|
|
|
7518
7529
|
if (exclusionSet.isExcluded(normalizedFile, finding.lineRange) || exclusionSet.isExcluded(finding.file, finding.lineRange)) {
|
|
7519
7530
|
continue;
|
|
7520
7531
|
}
|
|
7521
|
-
const absoluteFile = path8.isAbsolute(finding.file) ? finding.file : path8.join(projectRoot, finding.file);
|
|
7532
|
+
const absoluteFile = path8.isAbsolute(finding.file) ? finding.file : path8.join(projectRoot, finding.file).replace(/\\/g, "/");
|
|
7522
7533
|
if (exclusionSet.isExcluded(absoluteFile, finding.lineRange)) {
|
|
7523
7534
|
continue;
|
|
7524
7535
|
}
|
|
@@ -8288,7 +8299,8 @@ import * as path10 from "path";
|
|
|
8288
8299
|
import * as os from "os";
|
|
8289
8300
|
import { spawn } from "child_process";
|
|
8290
8301
|
function getStatePath() {
|
|
8291
|
-
|
|
8302
|
+
const home = process.env["HOME"] || os.homedir();
|
|
8303
|
+
return path10.join(home, ".harness", "update-check.json");
|
|
8292
8304
|
}
|
|
8293
8305
|
function isUpdateCheckEnabled(configInterval) {
|
|
8294
8306
|
if (process.env["HARNESS_NO_UPDATE_CHECK"] === "1") return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@harness-engineering/core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Core library for Harness Engineering toolkit",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
57
57
|
"lint": "eslint src",
|
|
58
58
|
"typecheck": "tsc --noEmit",
|
|
59
|
-
"clean": "
|
|
59
|
+
"clean": "node ../../scripts/clean.mjs dist",
|
|
60
60
|
"test": "vitest run",
|
|
61
61
|
"test:watch": "vitest",
|
|
62
62
|
"test:coverage": "vitest run --coverage",
|