@clearlydev/nx-archweave 0.5.3 → 0.6.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/bin/review-verdict.js +2 -2
- package/dist/generators/_chunks/{chunk-ZFCK3KMO.js → chunk-2K4JADTK.js} +11 -10
- package/dist/generators/_chunks/{chunk-C2WELXMV.js → chunk-2TQWFUMC.js} +12 -8
- package/dist/generators/_chunks/chunk-BDLK2IID.js +10 -0
- package/dist/generators/_chunks/{chunk-OEEWCZCO.js → chunk-CH5AF5S2.js} +15 -8
- package/dist/generators/_chunks/{chunk-WQDJYSOD.js → chunk-CSJZ4PP3.js} +10 -1
- package/dist/generators/_chunks/{chunk-VCLVE4EQ.js → chunk-D7J7HTND.js} +3 -3
- package/dist/generators/_chunks/{chunk-23NN76E3.js → chunk-EHYC6FUR.js} +1 -1
- package/dist/generators/_chunks/{chunk-LJRFVE6B.js → chunk-F5C5HUSI.js} +10 -9
- package/dist/generators/_chunks/{chunk-ZRHIFPUC.js → chunk-L52OUT5T.js} +1 -1
- package/dist/generators/_chunks/{chunk-FBCIELXS.js → chunk-LKXSS5E2.js} +3 -1
- package/dist/generators/_chunks/{chunk-VI7U5HS5.js → chunk-UAPIAMRL.js} +10 -8
- package/dist/generators/_chunks/{chunk-7EDJKUY4.js → chunk-WD2HL2RE.js} +1 -1
- package/dist/generators/_chunks/{chunk-M7UBCSYL.js → chunk-XZM354ZH.js} +2 -2
- package/dist/generators/_chunks/{chunk-2WXAGWAJ.js → chunk-YVISD736.js} +3 -1
- package/dist/generators/add-agent-rules/generator.js +5 -4
- package/dist/generators/add-backend/generator.js +3 -2
- package/dist/generators/add-fsd-lite/generator.js +5 -4
- package/dist/generators/add-github-templates/generator.js +3 -2
- package/dist/generators/add-integration/generator.js +6 -3
- package/dist/generators/add-review/generator.js +5 -4
- package/dist/generators/allow-builds/generator.js +4 -1
- package/dist/generators/doctor/generator.js +78 -54
- package/dist/generators/entity/generator.js +4 -3
- package/dist/generators/feature/generator.js +4 -3
- package/dist/generators/init/generator.js +44 -21
- package/dist/generators/install-integration/generator.js +6 -3
- package/dist/generators/page/generator.js +4 -3
- package/dist/generators/record-integration/generator.js +4 -1
- package/dist/generators/shared/generator.js +4 -3
- package/dist/generators/widget/generator.js +4 -3
- package/dist/migrations/update-0.5.3/add-toolkit-config-lint-input.js +5 -4
- package/package.json +7 -2
- package/src/generators/add-agent-rules/schema.json +2 -2
- package/src/generators/add-review/schema.json +4 -0
- package/src/generators/init/schema.json +4 -0
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "../_chunks/chunk-U6LAFHSF.js";
|
|
4
4
|
import {
|
|
5
5
|
detectUnitTestRunner
|
|
6
|
-
} from "../_chunks/chunk-
|
|
6
|
+
} from "../_chunks/chunk-XZM354ZH.js";
|
|
7
7
|
import "../_chunks/chunk-ASY3CK5L.js";
|
|
8
8
|
import {
|
|
9
9
|
REVIEW_MODES,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
REVIEW_WORKFLOW_CONTRACT,
|
|
12
12
|
ROUND_MARKER,
|
|
13
13
|
judgeReviewFileConflict
|
|
14
|
-
} from "../_chunks/chunk-
|
|
14
|
+
} from "../_chunks/chunk-YVISD736.js";
|
|
15
15
|
import {
|
|
16
16
|
createGroupDetector,
|
|
17
17
|
indexFilePattern
|
|
@@ -31,9 +31,11 @@ import {
|
|
|
31
31
|
resolveTargetDefaults
|
|
32
32
|
} from "../_chunks/chunk-XXXON43Z.js";
|
|
33
33
|
import {
|
|
34
|
+
isBackend,
|
|
35
|
+
isEndToEnd,
|
|
34
36
|
resolveFrontendApp,
|
|
35
37
|
sourceRootOf
|
|
36
|
-
} from "../_chunks/chunk-
|
|
38
|
+
} from "../_chunks/chunk-LKXSS5E2.js";
|
|
37
39
|
import "../_chunks/chunk-YEMQFSL6.js";
|
|
38
40
|
import "../_chunks/chunk-TXAQ2GJC.js";
|
|
39
41
|
import {
|
|
@@ -53,15 +55,16 @@ import {
|
|
|
53
55
|
import "../_chunks/chunk-34V6HAJT.js";
|
|
54
56
|
import {
|
|
55
57
|
diskRunNx
|
|
56
|
-
} from "../_chunks/chunk-
|
|
58
|
+
} from "../_chunks/chunk-EHYC6FUR.js";
|
|
57
59
|
import {
|
|
58
60
|
readToolkitConfig,
|
|
59
61
|
recordedFrontends
|
|
60
|
-
} from "../_chunks/chunk-
|
|
62
|
+
} from "../_chunks/chunk-2TQWFUMC.js";
|
|
61
63
|
import {
|
|
62
64
|
detectWorkspacePackageManager,
|
|
63
65
|
runNxCommand
|
|
64
66
|
} from "../_chunks/chunk-5Z7VZPES.js";
|
|
67
|
+
import "../_chunks/chunk-BDLK2IID.js";
|
|
65
68
|
|
|
66
69
|
// ../shared/dist/lib/doctor-report.js
|
|
67
70
|
function createDoctorCheck(input) {
|
|
@@ -140,7 +143,7 @@ function detectEnvironment(root) {
|
|
|
140
143
|
|
|
141
144
|
// ../template-engine/dist/doctor/run-doctor-checks.js
|
|
142
145
|
import { existsSync as existsSync7 } from "node:fs";
|
|
143
|
-
import { join as
|
|
146
|
+
import { join as join8 } from "node:path";
|
|
144
147
|
|
|
145
148
|
// ../template-engine/dist/doctor/review-checks.js
|
|
146
149
|
import { existsSync as existsSync2, readdirSync, readFileSync as readFileSync2 } from "node:fs";
|
|
@@ -614,7 +617,7 @@ function buildBackendChecks(root, projects) {
|
|
|
614
617
|
suggestedAction: "Fix the backend field, then re-run doctor."
|
|
615
618
|
}));
|
|
616
619
|
} else {
|
|
617
|
-
let hasDependency
|
|
620
|
+
let hasDependency;
|
|
618
621
|
try {
|
|
619
622
|
const pkg = JSON.parse(readFileSync3(join3(root, "package.json"), "utf-8"));
|
|
620
623
|
const packageName = backend === "nest" ? "@nestjs/core" : "express";
|
|
@@ -726,12 +729,29 @@ function buildUntaggedProjectsCheck(projects, roleTags) {
|
|
|
726
729
|
|
|
727
730
|
// ../template-engine/dist/doctor/fsd-like-check.js
|
|
728
731
|
import { existsSync as existsSync4, readdirSync as readdirSync3 } from "node:fs";
|
|
732
|
+
import { join as join5 } from "node:path";
|
|
733
|
+
|
|
734
|
+
// ../template-engine/dist/doctor/toolkit-managed.js
|
|
735
|
+
import { readFileSync as readFileSync4 } from "node:fs";
|
|
729
736
|
import { join as join4 } from "node:path";
|
|
737
|
+
function isToolkitManaged(root) {
|
|
738
|
+
try {
|
|
739
|
+
const config = JSON.parse(readFileSync4(join4(root, "toolkit.config.json"), "utf-8"));
|
|
740
|
+
if (typeof config !== "object" || config === null || Array.isArray(config))
|
|
741
|
+
return false;
|
|
742
|
+
const preset = config["preset"];
|
|
743
|
+
return typeof preset === "string" && preset !== "";
|
|
744
|
+
} catch {
|
|
745
|
+
return false;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
// ../template-engine/dist/doctor/fsd-like-check.js
|
|
730
750
|
var FSD_LAYERS = ["app", "_app", "pages", "_pages", "widgets", "features", "entities", "shared"];
|
|
731
751
|
function conventionalSourceRoots(root) {
|
|
732
752
|
const scanRoots = ["src"];
|
|
733
753
|
try {
|
|
734
|
-
for (const entry of readdirSync3(
|
|
754
|
+
for (const entry of readdirSync3(join5(root, "apps"), { withFileTypes: true })) {
|
|
735
755
|
if (entry.isDirectory())
|
|
736
756
|
scanRoots.push(`apps/${entry.name}/src`);
|
|
737
757
|
}
|
|
@@ -740,16 +760,16 @@ function conventionalSourceRoots(root) {
|
|
|
740
760
|
return scanRoots;
|
|
741
761
|
}
|
|
742
762
|
function buildFsdLikeCheck(root, projects) {
|
|
743
|
-
const scanRoots = projects === void 0 ? conventionalSourceRoots(root) : [...new Set(projects.map((project) => project.sourceRoot))].sort();
|
|
763
|
+
const scanRoots = projects === void 0 ? conventionalSourceRoots(root) : [...new Set(projects.filter((project) => project.fsdScan !== false).map((project) => project.sourceRoot))].sort();
|
|
744
764
|
let found = [];
|
|
745
765
|
for (const scanRoot of scanRoots) {
|
|
746
766
|
for (const layer of FSD_LAYERS) {
|
|
747
|
-
if (existsSync4(
|
|
767
|
+
if (existsSync4(join5(root, scanRoot, layer)))
|
|
748
768
|
found.push(scanRoot === "." || scanRoot === "" ? layer : `${scanRoot}/${layer}`);
|
|
749
769
|
}
|
|
750
770
|
}
|
|
751
771
|
found = found.sort();
|
|
752
|
-
if (
|
|
772
|
+
if (isToolkitManaged(root)) {
|
|
753
773
|
return createDoctorCheck({
|
|
754
774
|
id: "fsd-like-structure",
|
|
755
775
|
label: "FSD-like structure",
|
|
@@ -778,8 +798,8 @@ function buildFsdLikeCheck(root, projects) {
|
|
|
778
798
|
}
|
|
779
799
|
|
|
780
800
|
// ../template-engine/dist/doctor/fsd-enforcement-check.js
|
|
781
|
-
import { existsSync as existsSync5, readdirSync as readdirSync4, readFileSync as
|
|
782
|
-
import { join as
|
|
801
|
+
import { existsSync as existsSync5, readdirSync as readdirSync4, readFileSync as readFileSync5 } from "node:fs";
|
|
802
|
+
import { join as join6 } from "node:path";
|
|
783
803
|
|
|
784
804
|
// ../template-engine/dist/doctor/doctor-projects.js
|
|
785
805
|
function projectPrefix(root) {
|
|
@@ -788,11 +808,11 @@ function projectPrefix(root) {
|
|
|
788
808
|
|
|
789
809
|
// ../template-engine/dist/doctor/fsd-enforcement-check.js
|
|
790
810
|
function fsdEnabledPerConfig(root) {
|
|
791
|
-
|
|
792
|
-
if (!existsSync5(path))
|
|
811
|
+
if (!isToolkitManaged(root))
|
|
793
812
|
return null;
|
|
813
|
+
const path = join6(root, "toolkit.config.json");
|
|
794
814
|
try {
|
|
795
|
-
const config = JSON.parse(
|
|
815
|
+
const config = JSON.parse(readFileSync5(path, "utf-8"));
|
|
796
816
|
const fsd = config["fsd"];
|
|
797
817
|
if (typeof fsd === "object" && fsd !== null && typeof fsd["enabled"] === "boolean") {
|
|
798
818
|
return fsd["enabled"];
|
|
@@ -805,18 +825,18 @@ function fsdEnabledPerConfig(root) {
|
|
|
805
825
|
function eslintConfigPaths(root, projects) {
|
|
806
826
|
if (projects !== void 0) {
|
|
807
827
|
const dirs2 = ["", ...projects.map((project) => projectPrefix(project.root))];
|
|
808
|
-
return [...new Set(dirs2.flatMap((dir) => ESLINT_CONFIG_CANDIDATES.map((name) => `${dir}${name}`)))].filter((rel) => existsSync5(
|
|
828
|
+
return [...new Set(dirs2.flatMap((dir) => ESLINT_CONFIG_CANDIDATES.map((name) => `${dir}${name}`)))].filter((rel) => existsSync5(join6(root, rel)));
|
|
809
829
|
}
|
|
810
830
|
const dirsIn = (rel) => {
|
|
811
831
|
try {
|
|
812
|
-
return readdirSync4(
|
|
832
|
+
return readdirSync4(join6(root, rel), { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => rel === "" ? entry.name : `${rel}/${entry.name}`);
|
|
813
833
|
} catch {
|
|
814
834
|
return [];
|
|
815
835
|
}
|
|
816
836
|
};
|
|
817
837
|
const apps = dirsIn("apps");
|
|
818
838
|
const dirs = ["", ...apps, ...apps.flatMap((app) => dirsIn(app))];
|
|
819
|
-
return dirs.flatMap((dir) => ESLINT_CONFIG_CANDIDATES.map((name) => dir === "" ? name : `${dir}/${name}`)).filter((rel) => existsSync5(
|
|
839
|
+
return dirs.flatMap((dir) => ESLINT_CONFIG_CANDIDATES.map((name) => dir === "" ? name : `${dir}/${name}`)).filter((rel) => existsSync5(join6(root, rel)));
|
|
820
840
|
}
|
|
821
841
|
function buildFsdEnforcementCheck(root, projects) {
|
|
822
842
|
const id = "fsd-enforcement-applied";
|
|
@@ -845,7 +865,7 @@ function buildFsdEnforcementCheck(root, projects) {
|
|
|
845
865
|
});
|
|
846
866
|
}
|
|
847
867
|
function appliedFsdConfigs(root, projects) {
|
|
848
|
-
return eslintConfigPaths(root, projects).filter((rel) => classifyFsdEslintConfig(
|
|
868
|
+
return eslintConfigPaths(root, projects).filter((rel) => classifyFsdEslintConfig(readFileSync5(join6(root, rel), "utf-8")) === "applied");
|
|
849
869
|
}
|
|
850
870
|
function buildFsdRuleAnchoredCheck(root, projects) {
|
|
851
871
|
const id = "fsd-rule-anchored";
|
|
@@ -854,7 +874,7 @@ function buildFsdRuleAnchoredCheck(root, projects) {
|
|
|
854
874
|
if (applied.length === 0) {
|
|
855
875
|
return createDoctorCheck({ id, label, status: "not-applicable", message: "no ESLint config wires the FSD rule", evidence: [] });
|
|
856
876
|
}
|
|
857
|
-
const unanchored = applied.filter((rel) => !/fsdBoundaries\(\s*\{[^}]*\bcwd\s*:/s.test(maskComments(
|
|
877
|
+
const unanchored = applied.filter((rel) => !/fsdBoundaries\(\s*\{[^}]*\bcwd\s*:/s.test(maskComments(readFileSync5(join6(root, rel), "utf-8"))));
|
|
858
878
|
if (unanchored.length === 0) {
|
|
859
879
|
return createDoctorCheck({ id, label, status: "pass", message: "every FSD rule config passes cwd", evidence: applied });
|
|
860
880
|
}
|
|
@@ -869,21 +889,21 @@ function buildFsdRuleAnchoredCheck(root, projects) {
|
|
|
869
889
|
}
|
|
870
890
|
|
|
871
891
|
// ../template-engine/dist/doctor/lint-cache-check.js
|
|
872
|
-
import { existsSync as existsSync6, readdirSync as readdirSync5, readFileSync as
|
|
873
|
-
import { join as
|
|
892
|
+
import { existsSync as existsSync6, readdirSync as readdirSync5, readFileSync as readFileSync6 } from "node:fs";
|
|
893
|
+
import { join as join7 } from "node:path";
|
|
874
894
|
var ESLINT_PLUGIN = "@nx/eslint/plugin";
|
|
875
895
|
var INFERRED_EXECUTOR = "nx:run-commands";
|
|
876
896
|
var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
877
897
|
function readJson(path) {
|
|
878
898
|
try {
|
|
879
|
-
const parsed = JSON.parse(
|
|
899
|
+
const parsed = JSON.parse(readFileSync6(path, "utf-8"));
|
|
880
900
|
return isObject(parsed) ? parsed : null;
|
|
881
901
|
} catch {
|
|
882
902
|
return null;
|
|
883
903
|
}
|
|
884
904
|
}
|
|
885
905
|
function readLintSetup(root) {
|
|
886
|
-
const nxJson = readJson(
|
|
906
|
+
const nxJson = readJson(join7(root, "nx.json"));
|
|
887
907
|
if (nxJson === null)
|
|
888
908
|
return null;
|
|
889
909
|
const plugins = Array.isArray(nxJson["plugins"]) ? nxJson["plugins"] : [];
|
|
@@ -901,15 +921,15 @@ function projectList(root, projects) {
|
|
|
901
921
|
return projects.map((project) => ({ name: project.name, root: project.root, tags: project.tags }));
|
|
902
922
|
const found = [];
|
|
903
923
|
for (const folder of ["apps", "libs"]) {
|
|
904
|
-
let entries
|
|
924
|
+
let entries;
|
|
905
925
|
try {
|
|
906
|
-
entries = readdirSync5(
|
|
926
|
+
entries = readdirSync5(join7(root, folder), { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name);
|
|
907
927
|
} catch {
|
|
908
928
|
continue;
|
|
909
929
|
}
|
|
910
930
|
for (const name of entries) {
|
|
911
931
|
const dir = `${folder}/${name}`;
|
|
912
|
-
const config = readJson(
|
|
932
|
+
const config = readJson(join7(root, dir, "project.json")) ?? readJson(join7(root, dir, "package.json"));
|
|
913
933
|
if (config === null)
|
|
914
934
|
continue;
|
|
915
935
|
const tags = Array.isArray(config["tags"]) ? config["tags"] : isObject(config["nx"]) && Array.isArray(config["nx"]["tags"]) ? config["nx"]["tags"] : [];
|
|
@@ -925,7 +945,7 @@ function ownLintTarget(root, project, target) {
|
|
|
925
945
|
[`${prefix}package.json`, (config) => isObject(config["nx"]) && isObject(config["nx"]["targets"]) ? config["nx"]["targets"][target] : void 0]
|
|
926
946
|
];
|
|
927
947
|
for (const [file, pick] of candidates) {
|
|
928
|
-
const config = readJson(
|
|
948
|
+
const config = readJson(join7(root, file));
|
|
929
949
|
if (config === null)
|
|
930
950
|
continue;
|
|
931
951
|
const own = pick(config);
|
|
@@ -938,7 +958,7 @@ function ownLintTarget(root, project, target) {
|
|
|
938
958
|
inputs: Array.isArray(own["inputs"]) ? own["inputs"] : void 0
|
|
939
959
|
};
|
|
940
960
|
}
|
|
941
|
-
const pkg = readJson(
|
|
961
|
+
const pkg = readJson(join7(root, `${prefix}package.json`));
|
|
942
962
|
if (pkg !== null && isObject(pkg["scripts"]) && typeof pkg["scripts"][target] === "string") {
|
|
943
963
|
return { project: project.name, file: `${prefix}package.json`, executor: "nx:run-script", inputs: void 0 };
|
|
944
964
|
}
|
|
@@ -946,7 +966,7 @@ function ownLintTarget(root, project, target) {
|
|
|
946
966
|
}
|
|
947
967
|
function configFileOf(root, projectRoot) {
|
|
948
968
|
const prefix = projectPrefix(projectRoot);
|
|
949
|
-
return existsSync6(
|
|
969
|
+
return existsSync6(join7(root, `${prefix}project.json`)) ? `${prefix}project.json` : `${prefix}package.json`;
|
|
950
970
|
}
|
|
951
971
|
function resolveDefaults(setup, project, own) {
|
|
952
972
|
const executor = own === null ? INFERRED_EXECUTOR : own.executor ?? (setup.pluginRegistered ? INFERRED_EXECUTOR : void 0);
|
|
@@ -974,8 +994,8 @@ function namesOwnFiles(inputs) {
|
|
|
974
994
|
}
|
|
975
995
|
function eslintConfigNames(root, projectRoot) {
|
|
976
996
|
const prefix = projectPrefix(projectRoot);
|
|
977
|
-
const own = ESLINT_CONFIG_CANDIDATES.find((name) => existsSync6(
|
|
978
|
-
const workspace = ESLINT_CONFIG_CANDIDATES.find((name) => existsSync6(
|
|
997
|
+
const own = ESLINT_CONFIG_CANDIDATES.find((name) => existsSync6(join7(root, `${prefix}${name}`)));
|
|
998
|
+
const workspace = ESLINT_CONFIG_CANDIDATES.find((name) => existsSync6(join7(root, name)));
|
|
979
999
|
return [
|
|
980
1000
|
...own === void 0 || prefix === "" ? [] : [`{projectRoot}/${own}`],
|
|
981
1001
|
...workspace === void 0 ? [] : [`{workspaceRoot}/${workspace}`]
|
|
@@ -983,8 +1003,8 @@ function eslintConfigNames(root, projectRoot) {
|
|
|
983
1003
|
}
|
|
984
1004
|
var NOT_READ = "nx.json could not be read";
|
|
985
1005
|
function runNxAt(root) {
|
|
986
|
-
const detected = detectWorkspacePackageManager((path) => existsSync6(
|
|
987
|
-
const recorded = readJson(
|
|
1006
|
+
const detected = detectWorkspacePackageManager((path) => existsSync6(join7(root, path)), (path) => existsSync6(join7(root, path)) ? readFileSync6(join7(root, path), "utf-8") : void 0);
|
|
1007
|
+
const recorded = readJson(join7(root, "toolkit.config.json"))?.["packageManager"];
|
|
988
1008
|
const known = ["pnpm", "npm", "yarn", "bun"].includes(recorded) ? recorded : null;
|
|
989
1009
|
return runNxCommand(detected ?? known);
|
|
990
1010
|
}
|
|
@@ -1273,21 +1293,18 @@ function buildFrameworkChecks(env) {
|
|
|
1273
1293
|
})
|
|
1274
1294
|
];
|
|
1275
1295
|
}
|
|
1276
|
-
function isToolkitManaged(root) {
|
|
1277
|
-
return existsSync7(join7(root, "toolkit.config.json"));
|
|
1278
|
-
}
|
|
1279
1296
|
function buildExistingConfigCheck(root) {
|
|
1280
|
-
const exists =
|
|
1297
|
+
const exists = existsSync7(join8(root, "toolkit.config.json"));
|
|
1281
1298
|
return createDoctorCheck({
|
|
1282
1299
|
id: "existing-config",
|
|
1283
1300
|
label: "toolkit.config.json",
|
|
1284
1301
|
status: "pass",
|
|
1285
|
-
message: exists ? "Found \u2014 the workspace is managed by nx-archweave; init and the generators merge into it, changing only their own fields" : "
|
|
1302
|
+
message: !exists ? "Not found \u2014 init creates it" : isToolkitManaged(root) ? "Found \u2014 the workspace is managed by nx-archweave; init and the generators merge into it, changing only their own fields" : "Found \u2014 init hasn't set this workspace up yet (no preset recorded); init and the generators merge into it",
|
|
1286
1303
|
evidence: exists ? ["toolkit.config.json"] : []
|
|
1287
1304
|
});
|
|
1288
1305
|
}
|
|
1289
1306
|
function buildIntegrationManifestCheck(root) {
|
|
1290
|
-
const exists = existsSync7(
|
|
1307
|
+
const exists = existsSync7(join8(root, "archweave-integrations.json"));
|
|
1291
1308
|
return createDoctorCheck({
|
|
1292
1309
|
id: "integration-manifest",
|
|
1293
1310
|
label: "Integration manifest",
|
|
@@ -1297,8 +1314,8 @@ function buildIntegrationManifestCheck(root) {
|
|
|
1297
1314
|
});
|
|
1298
1315
|
}
|
|
1299
1316
|
function buildAgentRulesCheck(root) {
|
|
1300
|
-
const claudeExists = existsSync7(
|
|
1301
|
-
const agentsExists = existsSync7(
|
|
1317
|
+
const claudeExists = existsSync7(join8(root, "CLAUDE.md"));
|
|
1318
|
+
const agentsExists = existsSync7(join8(root, "AGENTS.md"));
|
|
1302
1319
|
const exists = claudeExists || agentsExists;
|
|
1303
1320
|
const evidence = [claudeExists && "CLAUDE.md", agentsExists && "AGENTS.md"].filter(Boolean);
|
|
1304
1321
|
return createDoctorCheck({
|
|
@@ -1310,8 +1327,8 @@ function buildAgentRulesCheck(root) {
|
|
|
1310
1327
|
});
|
|
1311
1328
|
}
|
|
1312
1329
|
function buildGithubTemplatesCheck(root) {
|
|
1313
|
-
const issueTemplateExists = existsSync7(
|
|
1314
|
-
const prTemplateExists = existsSync7(
|
|
1330
|
+
const issueTemplateExists = existsSync7(join8(root, ".github", "ISSUE_TEMPLATE"));
|
|
1331
|
+
const prTemplateExists = existsSync7(join8(root, ".github", "PULL_REQUEST_TEMPLATE.md"));
|
|
1315
1332
|
const exists = issueTemplateExists || prTemplateExists;
|
|
1316
1333
|
const managed = isToolkitManaged(root);
|
|
1317
1334
|
return createDoctorCheck({
|
|
@@ -1448,16 +1465,16 @@ function buildIntegrationDoctorChecks(results) {
|
|
|
1448
1465
|
}
|
|
1449
1466
|
|
|
1450
1467
|
// ../integrations/dist/config/read-enabled-integrations.js
|
|
1451
|
-
import { existsSync as existsSync8, readFileSync as
|
|
1452
|
-
import { join as
|
|
1468
|
+
import { existsSync as existsSync8, readFileSync as readFileSync7 } from "node:fs";
|
|
1469
|
+
import { join as join9 } from "node:path";
|
|
1453
1470
|
var CONFIG_FILENAME = "toolkit.config.json";
|
|
1454
1471
|
function readEnabledIntegrationIds(root) {
|
|
1455
|
-
const configPath =
|
|
1472
|
+
const configPath = join9(root, CONFIG_FILENAME);
|
|
1456
1473
|
if (!existsSync8(configPath)) {
|
|
1457
1474
|
return [];
|
|
1458
1475
|
}
|
|
1459
1476
|
try {
|
|
1460
|
-
const parsed = JSON.parse(
|
|
1477
|
+
const parsed = JSON.parse(readFileSync7(configPath, "utf8"));
|
|
1461
1478
|
const enabled = parsed?.integrations?.enabled;
|
|
1462
1479
|
return Array.isArray(enabled) && enabled.every((id) => typeof id === "string") ? enabled : [];
|
|
1463
1480
|
} catch {
|
|
@@ -1519,7 +1536,14 @@ async function applyLiveVerification(driftResults, ctx) {
|
|
|
1519
1536
|
import { getProjects, joinPathFragments } from "@nx/devkit";
|
|
1520
1537
|
function doctorProjects(tree) {
|
|
1521
1538
|
try {
|
|
1522
|
-
|
|
1539
|
+
const backendTag = readBoundaryTags(readToolkitConfig(tree)).backend;
|
|
1540
|
+
return [...getProjects(tree).entries()].map(([name, config]) => ({
|
|
1541
|
+
name,
|
|
1542
|
+
root: config.root,
|
|
1543
|
+
sourceRoot: sourceRootOf(tree, config),
|
|
1544
|
+
tags: config.tags ?? [],
|
|
1545
|
+
...isEndToEnd(config.root) || isBackend(config.root, config, backendTag) ? { fsdScan: false } : {}
|
|
1546
|
+
})).sort((a, b) => a.name.localeCompare(b.name));
|
|
1523
1547
|
} catch {
|
|
1524
1548
|
return void 0;
|
|
1525
1549
|
}
|
|
@@ -1662,9 +1686,9 @@ function buildPolicySuggestion(tree, sourceRoot, current) {
|
|
|
1662
1686
|
}
|
|
1663
1687
|
|
|
1664
1688
|
// src/generators/doctor/nx-support.ts
|
|
1665
|
-
import { readFileSync as
|
|
1689
|
+
import { readFileSync as readFileSync8 } from "node:fs";
|
|
1666
1690
|
import { createRequire } from "node:module";
|
|
1667
|
-
import { join as
|
|
1691
|
+
import { join as join10 } from "node:path";
|
|
1668
1692
|
var MAJORS_EITHER_SIDE = 1;
|
|
1669
1693
|
function majorOf(version) {
|
|
1670
1694
|
const match = /^(\d+)\./.exec(version.trim());
|
|
@@ -1673,7 +1697,7 @@ function majorOf(version) {
|
|
|
1673
1697
|
function readOwnDevkitVersion() {
|
|
1674
1698
|
try {
|
|
1675
1699
|
const path = createRequire(import.meta.url).resolve("@nx/devkit/package.json");
|
|
1676
|
-
const version = JSON.parse(
|
|
1700
|
+
const version = JSON.parse(readFileSync8(path, "utf-8")).version;
|
|
1677
1701
|
return typeof version === "string" ? version : void 0;
|
|
1678
1702
|
} catch {
|
|
1679
1703
|
return void 0;
|
|
@@ -1681,7 +1705,7 @@ function readOwnDevkitVersion() {
|
|
|
1681
1705
|
}
|
|
1682
1706
|
function readInstalledNx(root) {
|
|
1683
1707
|
try {
|
|
1684
|
-
const version = JSON.parse(
|
|
1708
|
+
const version = JSON.parse(readFileSync8(join10(root, "node_modules", "nx", "package.json"), "utf-8")).version;
|
|
1685
1709
|
return typeof version === "string" ? version : void 0;
|
|
1686
1710
|
} catch {
|
|
1687
1711
|
return void 0;
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "../_chunks/chunk-H222FPLK.js";
|
|
4
4
|
import {
|
|
5
5
|
runFsdSlice
|
|
6
|
-
} from "../_chunks/chunk-
|
|
7
|
-
import "../_chunks/chunk-
|
|
6
|
+
} from "../_chunks/chunk-XZM354ZH.js";
|
|
7
|
+
import "../_chunks/chunk-LKXSS5E2.js";
|
|
8
8
|
import "../_chunks/chunk-YEMQFSL6.js";
|
|
9
9
|
import "../_chunks/chunk-TXAQ2GJC.js";
|
|
10
10
|
import "../_chunks/chunk-6ZTIUBB2.js";
|
|
@@ -13,8 +13,9 @@ import "../_chunks/chunk-JPS6XKYK.js";
|
|
|
13
13
|
import {
|
|
14
14
|
resolveDryRun
|
|
15
15
|
} from "../_chunks/chunk-TUN34LAQ.js";
|
|
16
|
-
import "../_chunks/chunk-
|
|
16
|
+
import "../_chunks/chunk-2TQWFUMC.js";
|
|
17
17
|
import "../_chunks/chunk-5Z7VZPES.js";
|
|
18
|
+
import "../_chunks/chunk-BDLK2IID.js";
|
|
18
19
|
|
|
19
20
|
// src/generators/entity/generator.ts
|
|
20
21
|
async function entityGenerator(tree, options) {
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "../_chunks/chunk-H222FPLK.js";
|
|
4
4
|
import {
|
|
5
5
|
runFsdSlice
|
|
6
|
-
} from "../_chunks/chunk-
|
|
7
|
-
import "../_chunks/chunk-
|
|
6
|
+
} from "../_chunks/chunk-XZM354ZH.js";
|
|
7
|
+
import "../_chunks/chunk-LKXSS5E2.js";
|
|
8
8
|
import "../_chunks/chunk-YEMQFSL6.js";
|
|
9
9
|
import "../_chunks/chunk-TXAQ2GJC.js";
|
|
10
10
|
import "../_chunks/chunk-6ZTIUBB2.js";
|
|
@@ -13,8 +13,9 @@ import "../_chunks/chunk-JPS6XKYK.js";
|
|
|
13
13
|
import {
|
|
14
14
|
resolveDryRun
|
|
15
15
|
} from "../_chunks/chunk-TUN34LAQ.js";
|
|
16
|
-
import "../_chunks/chunk-
|
|
16
|
+
import "../_chunks/chunk-2TQWFUMC.js";
|
|
17
17
|
import "../_chunks/chunk-5Z7VZPES.js";
|
|
18
|
+
import "../_chunks/chunk-BDLK2IID.js";
|
|
18
19
|
|
|
19
20
|
// src/generators/feature/generator.ts
|
|
20
21
|
async function featureGenerator(tree, options) {
|
|
@@ -3,37 +3,37 @@ import {
|
|
|
3
3
|
failedSections,
|
|
4
4
|
leftForYou,
|
|
5
5
|
renderInitReport
|
|
6
|
-
} from "../_chunks/chunk-
|
|
6
|
+
} from "../_chunks/chunk-2K4JADTK.js";
|
|
7
7
|
import {
|
|
8
8
|
recordedReview,
|
|
9
9
|
runAddReview
|
|
10
|
-
} from "../_chunks/chunk-
|
|
10
|
+
} from "../_chunks/chunk-CH5AF5S2.js";
|
|
11
11
|
import "../_chunks/chunk-ASY3CK5L.js";
|
|
12
12
|
import {
|
|
13
13
|
DEFAULT_MAX_ROUNDS,
|
|
14
14
|
REVIEW_PROVIDERS,
|
|
15
15
|
buildReviewConfigSnippet
|
|
16
|
-
} from "../_chunks/chunk-
|
|
16
|
+
} from "../_chunks/chunk-YVISD736.js";
|
|
17
17
|
import {
|
|
18
18
|
runAddAgentRules
|
|
19
|
-
} from "../_chunks/chunk-
|
|
20
|
-
import "../_chunks/chunk-
|
|
21
|
-
import "../_chunks/chunk-
|
|
19
|
+
} from "../_chunks/chunk-UAPIAMRL.js";
|
|
20
|
+
import "../_chunks/chunk-F5C5HUSI.js";
|
|
21
|
+
import "../_chunks/chunk-CSJZ4PP3.js";
|
|
22
22
|
import "../_chunks/chunk-5MI3O4VZ.js";
|
|
23
23
|
import {
|
|
24
24
|
runAddBackend
|
|
25
|
-
} from "../_chunks/chunk-
|
|
25
|
+
} from "../_chunks/chunk-WD2HL2RE.js";
|
|
26
26
|
import "../_chunks/chunk-SHKQSTV2.js";
|
|
27
27
|
import "../_chunks/chunk-WNO3ZGBB.js";
|
|
28
28
|
import {
|
|
29
29
|
DEFAULT_CONFLICT_POLICY,
|
|
30
30
|
runAddFsdLite
|
|
31
|
-
} from "../_chunks/chunk-
|
|
31
|
+
} from "../_chunks/chunk-D7J7HTND.js";
|
|
32
32
|
import "../_chunks/chunk-AMOOSD5Q.js";
|
|
33
33
|
import "../_chunks/chunk-XXXON43Z.js";
|
|
34
34
|
import {
|
|
35
35
|
resolveFrontendApp
|
|
36
|
-
} from "../_chunks/chunk-
|
|
36
|
+
} from "../_chunks/chunk-LKXSS5E2.js";
|
|
37
37
|
import {
|
|
38
38
|
allFrameworkProfiles
|
|
39
39
|
} from "../_chunks/chunk-YEMQFSL6.js";
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
} from "../_chunks/chunk-6ZTIUBB2.js";
|
|
44
44
|
import {
|
|
45
45
|
runAddGithubTemplates
|
|
46
|
-
} from "../_chunks/chunk-
|
|
46
|
+
} from "../_chunks/chunk-L52OUT5T.js";
|
|
47
47
|
import "../_chunks/chunk-FZGN5NEP.js";
|
|
48
48
|
import "../_chunks/chunk-YNMLB4DL.js";
|
|
49
49
|
import "../_chunks/chunk-JPS6XKYK.js";
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
import {
|
|
54
54
|
spawnableCommand
|
|
55
55
|
} from "../_chunks/chunk-34V6HAJT.js";
|
|
56
|
-
import "../_chunks/chunk-
|
|
56
|
+
import "../_chunks/chunk-EHYC6FUR.js";
|
|
57
57
|
import {
|
|
58
58
|
DEFAULT_AI_HOSTS,
|
|
59
59
|
RECORDED_BACKENDS,
|
|
@@ -61,7 +61,6 @@ import {
|
|
|
61
61
|
RECORDED_PRESETS,
|
|
62
62
|
TOOLKIT_CONFIG_PATH,
|
|
63
63
|
applyJsonEdits,
|
|
64
|
-
messageOnlyError,
|
|
65
64
|
readToolkitConfigFile,
|
|
66
65
|
recordedChoice,
|
|
67
66
|
recordedFrontends,
|
|
@@ -70,10 +69,13 @@ import {
|
|
|
70
69
|
resolveLocaleOption,
|
|
71
70
|
reviewProviderFor,
|
|
72
71
|
treePackageManager
|
|
73
|
-
} from "../_chunks/chunk-
|
|
72
|
+
} from "../_chunks/chunk-2TQWFUMC.js";
|
|
74
73
|
import {
|
|
75
74
|
runNxCommand
|
|
76
75
|
} from "../_chunks/chunk-5Z7VZPES.js";
|
|
76
|
+
import {
|
|
77
|
+
messageOnlyError
|
|
78
|
+
} from "../_chunks/chunk-BDLK2IID.js";
|
|
77
79
|
|
|
78
80
|
// src/generators/init/generator.ts
|
|
79
81
|
import { execFileSync } from "node:child_process";
|
|
@@ -354,7 +356,7 @@ function runInit(tree, options, deps) {
|
|
|
354
356
|
},
|
|
355
357
|
// init records aiHosts below, with its other choices; the FSD section follows this run's
|
|
356
358
|
// frontend axis, the Module Boundaries section its backend axis
|
|
357
|
-
{
|
|
359
|
+
{ recordChoices: false, fsdStructure: fsdEnabled, moduleBoundaries: backend === "none" ? null : readBoundaryTags(recorded) }
|
|
358
360
|
);
|
|
359
361
|
sections.push({ id: "agentRules", enabled: true, report: { kind: "agentRules", report } });
|
|
360
362
|
} else {
|
|
@@ -395,7 +397,8 @@ function runInit(tree, options, deps) {
|
|
|
395
397
|
dryRun,
|
|
396
398
|
// The first AI host's provider — buildPresetConfig
|
|
397
399
|
// resolved it; claude when no host was picked.
|
|
398
|
-
provider: config.review.provider
|
|
400
|
+
provider: config.review.provider,
|
|
401
|
+
...options.dependabot !== void 0 ? { dependabot: options.dependabot } : {}
|
|
399
402
|
});
|
|
400
403
|
sections.push({ id: "review", enabled: true, report: { kind: "review", report } });
|
|
401
404
|
} else {
|
|
@@ -413,14 +416,34 @@ function runInit(tree, options, deps) {
|
|
|
413
416
|
const anyChoiceApplied = fsdApplied || agentRulesApplied || reviewApplied;
|
|
414
417
|
const notRecorded = [];
|
|
415
418
|
if (fsdRan && !fsdApplied) {
|
|
416
|
-
notRecorded.push({ field: "fsd.enforcement", rerun: `add-fsd-lite --enforcement=${config.fsd.enforcement}` });
|
|
417
|
-
}
|
|
418
|
-
if (agentRulesRan && !agentRulesApplied) {
|
|
419
419
|
notRecorded.push({
|
|
420
|
-
|
|
421
|
-
|
|
420
|
+
fields: ["fsd.enforcement"],
|
|
421
|
+
reason: "the FSD section aborted",
|
|
422
|
+
reruns: [{ note: null, rerun: `add-fsd-lite --enforcement=${config.fsd.enforcement}` }]
|
|
422
423
|
});
|
|
423
|
-
|
|
424
|
+
}
|
|
425
|
+
if (agentRulesRan && !agentRulesApplied) {
|
|
426
|
+
const rerun = `add-agent-rules ${config.agentRules.teamRules ? "--teamRules" : "--teamRules=false"} --hosts=${config.aiHosts.join(",")}`;
|
|
427
|
+
const files = agentRulesSection?.report?.kind === "agentRules" ? agentRulesSection.report.report.files : [];
|
|
428
|
+
const named = (action) => files.filter((file) => file.action === action).map((file) => file.filePath).join(", ");
|
|
429
|
+
const unplaced = named("unrecognized");
|
|
430
|
+
notRecorded.push(
|
|
431
|
+
unplaced !== "" ? {
|
|
432
|
+
fields: ["agentRules.teamRules", "aiHosts"],
|
|
433
|
+
reason: `the agent rules markers in ${unplaced} could not be placed`,
|
|
434
|
+
reruns: [{ note: "fix the markers, then", rerun }]
|
|
435
|
+
} : (
|
|
436
|
+
// A kept edit: matching the block first keeps the user's work, so it comes first.
|
|
437
|
+
{
|
|
438
|
+
fields: ["agentRules.teamRules", "aiHosts"],
|
|
439
|
+
reason: `the agent rules block in ${named("user-modified")} was edited by hand and kept`,
|
|
440
|
+
reruns: [
|
|
441
|
+
{ note: "make the block match the generated one, then", rerun },
|
|
442
|
+
{ note: "or replace the block (your edits to it are lost)", rerun: `${rerun} --overwriteBlock` }
|
|
443
|
+
]
|
|
444
|
+
}
|
|
445
|
+
)
|
|
446
|
+
);
|
|
424
447
|
}
|
|
425
448
|
const lintInputs = fsdApplied ? applyLintInputs(tree, {
|
|
426
449
|
firstRun,
|
|
@@ -18,9 +18,12 @@ import {
|
|
|
18
18
|
import "../_chunks/chunk-34V6HAJT.js";
|
|
19
19
|
import {
|
|
20
20
|
diskRunNx
|
|
21
|
-
} from "../_chunks/chunk-
|
|
22
|
-
import "../_chunks/chunk-
|
|
21
|
+
} from "../_chunks/chunk-EHYC6FUR.js";
|
|
22
|
+
import "../_chunks/chunk-2TQWFUMC.js";
|
|
23
23
|
import "../_chunks/chunk-5Z7VZPES.js";
|
|
24
|
+
import {
|
|
25
|
+
messageOnlyError
|
|
26
|
+
} from "../_chunks/chunk-BDLK2IID.js";
|
|
24
27
|
|
|
25
28
|
// ../integrations/dist/config/declare-enabled-integration.js
|
|
26
29
|
import { existsSync, lstatSync, readFileSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
@@ -237,7 +240,7 @@ async function runInstallIntegration(tree, options, deps = {}) {
|
|
|
237
240
|
const entry = getCatalogEntry(options.tool);
|
|
238
241
|
const pluginId = entry?.hosts["claude-code"]?.pluginId;
|
|
239
242
|
if (!integration || !entry || pluginId === void 0) {
|
|
240
|
-
throw
|
|
243
|
+
throw messageOnlyError(`Unsupported integration "${options.tool}". Supported: ${PLUGIN_IDS.join(", ")}.`);
|
|
241
244
|
}
|
|
242
245
|
const name = entry.displayName;
|
|
243
246
|
const plan = await integration.plan({
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "../_chunks/chunk-H222FPLK.js";
|
|
4
4
|
import {
|
|
5
5
|
runFsdSlice
|
|
6
|
-
} from "../_chunks/chunk-
|
|
7
|
-
import "../_chunks/chunk-
|
|
6
|
+
} from "../_chunks/chunk-XZM354ZH.js";
|
|
7
|
+
import "../_chunks/chunk-LKXSS5E2.js";
|
|
8
8
|
import "../_chunks/chunk-YEMQFSL6.js";
|
|
9
9
|
import "../_chunks/chunk-TXAQ2GJC.js";
|
|
10
10
|
import "../_chunks/chunk-6ZTIUBB2.js";
|
|
@@ -13,8 +13,9 @@ import "../_chunks/chunk-JPS6XKYK.js";
|
|
|
13
13
|
import {
|
|
14
14
|
resolveDryRun
|
|
15
15
|
} from "../_chunks/chunk-TUN34LAQ.js";
|
|
16
|
-
import "../_chunks/chunk-
|
|
16
|
+
import "../_chunks/chunk-2TQWFUMC.js";
|
|
17
17
|
import "../_chunks/chunk-5Z7VZPES.js";
|
|
18
|
+
import "../_chunks/chunk-BDLK2IID.js";
|
|
18
19
|
|
|
19
20
|
// src/generators/page/generator.ts
|
|
20
21
|
async function pageGenerator(tree, options) {
|
|
@@ -9,6 +9,9 @@ import {
|
|
|
9
9
|
recordMetadataFor
|
|
10
10
|
} from "../_chunks/chunk-AQHV7DJS.js";
|
|
11
11
|
import "../_chunks/chunk-34V6HAJT.js";
|
|
12
|
+
import {
|
|
13
|
+
messageOnlyError
|
|
14
|
+
} from "../_chunks/chunk-BDLK2IID.js";
|
|
12
15
|
|
|
13
16
|
// src/generators/record-integration/render.ts
|
|
14
17
|
function renderRecordIntegrationView(view) {
|
|
@@ -54,7 +57,7 @@ async function recordIntegrationGenerator(tree, options, deps = {}) {
|
|
|
54
57
|
const apply = (options.apply ?? false) && process.env["NX_DRY_RUN"] !== "true";
|
|
55
58
|
const integration = root.getIntegration(options.tool);
|
|
56
59
|
if (!integration) {
|
|
57
|
-
throw
|
|
60
|
+
throw messageOnlyError(`Unsupported integration "${options.tool}". Supported: ${PLUGIN_IDS.join(", ")}.`);
|
|
58
61
|
}
|
|
59
62
|
const entry = getCatalogEntry(options.tool);
|
|
60
63
|
const metadata = entry === void 0 ? void 0 : recordMetadataFor(entry);
|