@nathapp/nax 0.69.8 → 0.69.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/dist/nax.js +45 -15
- package/package.json +1 -1
package/dist/nax.js
CHANGED
|
@@ -22826,8 +22826,12 @@ async function _detectLanguageImpl(workdir, pkg) {
|
|
|
22826
22826
|
};
|
|
22827
22827
|
if ("typescript" in allDeps)
|
|
22828
22828
|
return "typescript";
|
|
22829
|
+
if (await deps.fileExists(join5(workdir, "tsconfig.json")))
|
|
22830
|
+
return "typescript";
|
|
22829
22831
|
return "javascript";
|
|
22830
22832
|
}
|
|
22833
|
+
if (await deps.fileExists(join5(workdir, "tsconfig.json")))
|
|
22834
|
+
return "typescript";
|
|
22831
22835
|
return;
|
|
22832
22836
|
}
|
|
22833
22837
|
function detectType(pkg) {
|
|
@@ -35568,6 +35572,22 @@ ${BATCH_ROUTING_SCHEMA_INLINE}`;
|
|
|
35568
35572
|
|
|
35569
35573
|
// src/acceptance/test-path.ts
|
|
35570
35574
|
import path3 from "path";
|
|
35575
|
+
async function _readPackageTestPath(workdir, relativeDir) {
|
|
35576
|
+
if (!relativeDir)
|
|
35577
|
+
return;
|
|
35578
|
+
if (path3.isAbsolute(relativeDir) || relativeDir.split(path3.sep).includes(".."))
|
|
35579
|
+
return;
|
|
35580
|
+
const cfgPath = path3.join(workdir, ".nax", "mono", relativeDir, "config.json");
|
|
35581
|
+
const file3 = Bun.file(cfgPath);
|
|
35582
|
+
if (!await file3.exists())
|
|
35583
|
+
return;
|
|
35584
|
+
try {
|
|
35585
|
+
const cfg = JSON.parse(await file3.text());
|
|
35586
|
+
return cfg?.acceptance?.testPath;
|
|
35587
|
+
} catch {
|
|
35588
|
+
return;
|
|
35589
|
+
}
|
|
35590
|
+
}
|
|
35571
35591
|
function acceptanceTestFilename(language) {
|
|
35572
35592
|
switch (language?.toLowerCase()) {
|
|
35573
35593
|
case "go":
|
|
@@ -35598,7 +35618,7 @@ function resolveAcceptanceTestCandidates(options) {
|
|
|
35598
35618
|
return [];
|
|
35599
35619
|
return [resolveAcceptanceFeatureTestPath(options.featureDir, options.testPathConfig, options.language)];
|
|
35600
35620
|
}
|
|
35601
|
-
function groupStoriesByPackage(prd, workdir, featureName, testPathConfig, language) {
|
|
35621
|
+
async function groupStoriesByPackage(prd, workdir, featureName, testPathConfig, language) {
|
|
35602
35622
|
const nonFixStories = prd.userStories.filter((s) => !s.id.startsWith("US-FIX-") && s.status !== "decomposed");
|
|
35603
35623
|
const groupMap = new Map;
|
|
35604
35624
|
for (const story of nonFixStories) {
|
|
@@ -35615,13 +35635,15 @@ function groupStoriesByPackage(prd, workdir, featureName, testPathConfig, langua
|
|
|
35615
35635
|
if (groupMap.size === 0) {
|
|
35616
35636
|
groupMap.set("", { stories: [], criteria: [] });
|
|
35617
35637
|
}
|
|
35618
|
-
|
|
35619
|
-
for (const [wd, { stories, criteria }] of groupMap) {
|
|
35638
|
+
return Promise.all(Array.from(groupMap.entries()).map(async ([wd, { stories, criteria }]) => {
|
|
35620
35639
|
const packageDir = wd ? path3.join(workdir, wd) : workdir;
|
|
35621
|
-
const
|
|
35622
|
-
|
|
35623
|
-
|
|
35624
|
-
|
|
35640
|
+
const pkgTestPath = await _groupDeps.readPackageTestPath(workdir, wd);
|
|
35641
|
+
const detectedLang = await _groupDeps.detectLanguage(packageDir);
|
|
35642
|
+
const resolvedLang = detectedLang ?? language;
|
|
35643
|
+
const resolvedTestPathConfig = pkgTestPath ?? testPathConfig;
|
|
35644
|
+
const testPath = resolveAcceptancePackageFeatureTestPath(packageDir, featureName, resolvedTestPathConfig, resolvedLang);
|
|
35645
|
+
return { testPath, packageDir, stories, criteria, language: resolvedLang };
|
|
35646
|
+
}));
|
|
35625
35647
|
}
|
|
35626
35648
|
function suggestedTestFilename(language) {
|
|
35627
35649
|
switch (language?.toLowerCase()) {
|
|
@@ -35664,7 +35686,14 @@ async function findExistingAcceptanceTestPath(options) {
|
|
|
35664
35686
|
}
|
|
35665
35687
|
return;
|
|
35666
35688
|
}
|
|
35667
|
-
var
|
|
35689
|
+
var _groupDeps;
|
|
35690
|
+
var init_test_path = __esm(() => {
|
|
35691
|
+
init_detector();
|
|
35692
|
+
_groupDeps = {
|
|
35693
|
+
detectLanguage,
|
|
35694
|
+
readPackageTestPath: _readPackageTestPath
|
|
35695
|
+
};
|
|
35696
|
+
});
|
|
35668
35697
|
|
|
35669
35698
|
// src/acceptance/generator-helpers.ts
|
|
35670
35699
|
function skeletonImportLine(testFramework) {
|
|
@@ -52820,7 +52849,8 @@ __export(exports_acceptance, {
|
|
|
52820
52849
|
convertFixStoryToUserStory: () => convertFixStoryToUserStory,
|
|
52821
52850
|
buildAcceptanceTestPrompt: () => buildAcceptanceTestPrompt,
|
|
52822
52851
|
buildAcceptanceRunCommand: () => buildAcceptanceRunCommand,
|
|
52823
|
-
acceptanceTestFilename: () => acceptanceTestFilename2
|
|
52852
|
+
acceptanceTestFilename: () => acceptanceTestFilename2,
|
|
52853
|
+
_groupDeps: () => _groupDeps
|
|
52824
52854
|
});
|
|
52825
52855
|
var init_acceptance2 = __esm(() => {
|
|
52826
52856
|
init_refinement();
|
|
@@ -53169,7 +53199,7 @@ ${stderr}` };
|
|
|
53169
53199
|
const metaPath = path10.join(ctx.featureDir, "acceptance-meta.json");
|
|
53170
53200
|
const allCriteria = ctx.prd.userStories.filter((s) => !s.id.startsWith("US-FIX-") && s.status !== "decomposed").flatMap((s) => s.acceptanceCriteria);
|
|
53171
53201
|
const featureName = ctx.prd.feature ?? ctx.prd.featureName;
|
|
53172
|
-
const groups = groupStoriesByPackage(ctx.prd, ctx.workdir, featureName, testPathConfig, language);
|
|
53202
|
+
const groups = await groupStoriesByPackage(ctx.prd, ctx.workdir, featureName, testPathConfig, language);
|
|
53173
53203
|
const nonFixStories = groups.flatMap((g) => g.stories);
|
|
53174
53204
|
let totalCriteria = 0;
|
|
53175
53205
|
let testableCount = 0;
|
|
@@ -53265,7 +53295,7 @@ ${stderr}` };
|
|
|
53265
53295
|
text: c.refined,
|
|
53266
53296
|
lineNumber: i + 1
|
|
53267
53297
|
}));
|
|
53268
|
-
const skeletonCode = generateSkeletonTests(featureName, skeletonCriteria, ctx.config.acceptance.testFramework, language);
|
|
53298
|
+
const skeletonCode = generateSkeletonTests(featureName, skeletonCriteria, ctx.config.acceptance.testFramework, group.language);
|
|
53269
53299
|
await _acceptanceSetupDeps.writeFile(testPath, skeletonCode);
|
|
53270
53300
|
getSafeLogger()?.warn("acceptance-setup", "agent did not produce test content; using skeleton", {
|
|
53271
53301
|
storyId: groupStoryId,
|
|
@@ -59804,7 +59834,7 @@ var package_default;
|
|
|
59804
59834
|
var init_package = __esm(() => {
|
|
59805
59835
|
package_default = {
|
|
59806
59836
|
name: "@nathapp/nax",
|
|
59807
|
-
version: "0.69.
|
|
59837
|
+
version: "0.69.10",
|
|
59808
59838
|
description: "AI Coding Agent Orchestrator \u2014 loops until done",
|
|
59809
59839
|
type: "module",
|
|
59810
59840
|
bin: {
|
|
@@ -59899,8 +59929,8 @@ var init_version = __esm(() => {
|
|
|
59899
59929
|
NAX_VERSION = package_default.version;
|
|
59900
59930
|
NAX_COMMIT = (() => {
|
|
59901
59931
|
try {
|
|
59902
|
-
if (/^[0-9a-f]{6,10}$/.test("
|
|
59903
|
-
return "
|
|
59932
|
+
if (/^[0-9a-f]{6,10}$/.test("5b5bf412"))
|
|
59933
|
+
return "5b5bf412";
|
|
59904
59934
|
} catch {}
|
|
59905
59935
|
try {
|
|
59906
59936
|
const result = Bun.spawnSync(["git", "rev-parse", "--short", "HEAD"], {
|
|
@@ -98043,7 +98073,7 @@ async function runCompletionPhase(options) {
|
|
|
98043
98073
|
} else if (options.config.acceptance.enabled && isComplete(options.prd)) {
|
|
98044
98074
|
options.statusWriter.setPostRunPhase("acceptance", { status: "running" });
|
|
98045
98075
|
pipelineEventBus.emit({ type: "postrun:phase:started", phase: "acceptance" });
|
|
98046
|
-
const acceptanceTestPaths = options.featureDir ? await Promise.all(groupStoriesByPackage(options.prd, options.workdir, options.feature, options.config.acceptance.testPath, options.config.project?.language).map(async (g) => {
|
|
98076
|
+
const acceptanceTestPaths = options.featureDir ? await Promise.all((await groupStoriesByPackage(options.prd, options.workdir, options.feature, options.config.acceptance.testPath, options.config.project?.language)).map(async (g) => {
|
|
98047
98077
|
const relativeWorkdir = path19.relative(options.workdir, g.packageDir);
|
|
98048
98078
|
let groupConfig = options.config;
|
|
98049
98079
|
if (relativeWorkdir && relativeWorkdir !== ".") {
|