@clearlydev/nx-archweave 0.4.5 → 0.5.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/README.md +13 -13
- package/dist/bin/review-verdict.js +1 -1
- package/dist/generators/_chunks/{chunk-EGVFXXPE.js → chunk-2WXAGWAJ.js} +14 -14
- package/dist/generators/_chunks/{chunk-FNSOLEVB.js → chunk-3ZHRZK5M.js} +1 -1
- package/dist/generators/_chunks/{chunk-FQHFT5IH.js → chunk-5Z7VZPES.js} +8 -1
- package/dist/generators/_chunks/{chunk-LRJVAOZ2.js → chunk-624F6DEP.js} +10 -5
- package/dist/generators/_chunks/{chunk-FKABQJTB.js → chunk-ERCX7F6K.js} +2 -2
- package/dist/generators/_chunks/{chunk-GPZEZVPN.js → chunk-ILICA6LC.js} +5 -4
- package/dist/generators/_chunks/{chunk-AFAORV5O.js → chunk-M7OQWSNF.js} +1 -1
- package/dist/generators/_chunks/{chunk-L2RZ2LBO.js → chunk-N6B6VBHG.js} +32 -8
- package/dist/generators/_chunks/{chunk-KXPL6AJW.js → chunk-Q7IYHKT3.js} +2 -2
- package/dist/generators/_chunks/{chunk-SKM3CM5G.js → chunk-TJ6SCQLI.js} +17 -9
- package/dist/generators/_chunks/{chunk-B55SAIUS.js → chunk-WVMTOWLM.js} +1 -1
- package/dist/generators/_chunks/{chunk-XSXOQ2EE.js → chunk-ZNTGYYLU.js} +6 -5
- package/dist/generators/add-agent-rules/generator.js +3 -3
- package/dist/generators/add-backend/generator.js +3 -3
- package/dist/generators/add-fsd-lite/generator.js +6 -5
- package/dist/generators/add-github-templates/generator.js +3 -3
- package/dist/generators/add-integration/generator.js +5 -5
- package/dist/generators/add-review/generator.js +4 -4
- package/dist/generators/allow-builds/generator.js +1 -1
- package/dist/generators/doctor/generator.js +233 -29
- package/dist/generators/entity/generator.js +4 -4
- package/dist/generators/feature/generator.js +4 -4
- package/dist/generators/init/generator.js +303 -61
- package/dist/generators/install-integration/generator.js +5 -5
- package/dist/generators/page/generator.js +4 -4
- package/dist/generators/shared/generator.js +4 -4
- package/dist/generators/widget/generator.js +4 -4
- package/package.json +1 -1
- package/src/generators/add-fsd-lite/schema.json +1 -1
- package/src/generators/init/schema.json +3 -3
|
@@ -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-Q7IYHKT3.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-2WXAGWAJ.js";
|
|
15
15
|
import {
|
|
16
16
|
createGroupDetector,
|
|
17
17
|
indexFilePattern
|
|
@@ -23,12 +23,15 @@ import {
|
|
|
23
23
|
readSharedTypesConfig
|
|
24
24
|
} from "../_chunks/chunk-WNO3ZGBB.js";
|
|
25
25
|
import {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
TOOLKIT_CONFIG_INPUT,
|
|
27
|
+
classifyFsdEslintConfig,
|
|
28
|
+
lintInputsProjectSnippet,
|
|
29
|
+
lintInputsTargetDefaultsSnippet
|
|
30
|
+
} from "../_chunks/chunk-N6B6VBHG.js";
|
|
28
31
|
import {
|
|
29
32
|
resolveFrontendApp,
|
|
30
33
|
sourceRootOf
|
|
31
|
-
} from "../_chunks/chunk-
|
|
34
|
+
} from "../_chunks/chunk-WVMTOWLM.js";
|
|
32
35
|
import "../_chunks/chunk-TXAQ2GJC.js";
|
|
33
36
|
import {
|
|
34
37
|
ESLINT_CONFIG_CANDIDATES,
|
|
@@ -38,9 +41,6 @@ import {
|
|
|
38
41
|
} from "../_chunks/chunk-6ZTIUBB2.js";
|
|
39
42
|
import "../_chunks/chunk-YNMLB4DL.js";
|
|
40
43
|
import "../_chunks/chunk-JPS6XKYK.js";
|
|
41
|
-
import {
|
|
42
|
-
diskRunNx
|
|
43
|
-
} from "../_chunks/chunk-GPZEZVPN.js";
|
|
44
44
|
import {
|
|
45
45
|
PLUGIN_CATALOG,
|
|
46
46
|
createIntegrationsCompositionRoot,
|
|
@@ -48,13 +48,17 @@ import {
|
|
|
48
48
|
verifyClaudeMarketplacePlugin
|
|
49
49
|
} from "../_chunks/chunk-AQHV7DJS.js";
|
|
50
50
|
import "../_chunks/chunk-34V6HAJT.js";
|
|
51
|
+
import {
|
|
52
|
+
diskRunNx
|
|
53
|
+
} from "../_chunks/chunk-ILICA6LC.js";
|
|
51
54
|
import {
|
|
52
55
|
readToolkitConfig,
|
|
53
56
|
recordedFrontends
|
|
54
|
-
} from "../_chunks/chunk-
|
|
57
|
+
} from "../_chunks/chunk-M7OQWSNF.js";
|
|
55
58
|
import {
|
|
56
|
-
detectWorkspacePackageManager
|
|
57
|
-
|
|
59
|
+
detectWorkspacePackageManager,
|
|
60
|
+
runNxCommand
|
|
61
|
+
} from "../_chunks/chunk-5Z7VZPES.js";
|
|
58
62
|
|
|
59
63
|
// ../shared/dist/lib/doctor-report.js
|
|
60
64
|
function createDoctorCheck(input) {
|
|
@@ -132,8 +136,8 @@ function detectEnvironment(root) {
|
|
|
132
136
|
}
|
|
133
137
|
|
|
134
138
|
// ../template-engine/dist/doctor/run-doctor-checks.js
|
|
135
|
-
import { existsSync as
|
|
136
|
-
import { join as
|
|
139
|
+
import { existsSync as existsSync7 } from "node:fs";
|
|
140
|
+
import { join as join7 } from "node:path";
|
|
137
141
|
|
|
138
142
|
// ../template-engine/dist/doctor/review-checks.js
|
|
139
143
|
import { existsSync as existsSync2, readdirSync, readFileSync as readFileSync2 } from "node:fs";
|
|
@@ -861,11 +865,209 @@ function buildFsdRuleAnchoredCheck(root, projects) {
|
|
|
861
865
|
});
|
|
862
866
|
}
|
|
863
867
|
|
|
868
|
+
// ../template-engine/dist/doctor/lint-cache-check.js
|
|
869
|
+
import { existsSync as existsSync6, readdirSync as readdirSync5, readFileSync as readFileSync5 } from "node:fs";
|
|
870
|
+
import { join as join6 } from "node:path";
|
|
871
|
+
var ESLINT_PLUGIN = "@nx/eslint/plugin";
|
|
872
|
+
var ESLINT_EXECUTOR = "@nx/eslint:lint";
|
|
873
|
+
var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
874
|
+
function readJson(path) {
|
|
875
|
+
try {
|
|
876
|
+
const parsed = JSON.parse(readFileSync5(path, "utf-8"));
|
|
877
|
+
return isObject(parsed) ? parsed : null;
|
|
878
|
+
} catch {
|
|
879
|
+
return null;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
function readLintSetup(root) {
|
|
883
|
+
const nxJson = readJson(join6(root, "nx.json"));
|
|
884
|
+
if (nxJson === null)
|
|
885
|
+
return null;
|
|
886
|
+
const plugins = Array.isArray(nxJson["plugins"]) ? nxJson["plugins"] : [];
|
|
887
|
+
const entry = plugins.find((plugin) => plugin === ESLINT_PLUGIN || isObject(plugin) && plugin["plugin"] === ESLINT_PLUGIN);
|
|
888
|
+
const options = isObject(entry) && isObject(entry["options"]) ? entry["options"] : {};
|
|
889
|
+
return {
|
|
890
|
+
target: typeof options["targetName"] === "string" ? options["targetName"] : "lint",
|
|
891
|
+
pluginRegistered: entry !== void 0,
|
|
892
|
+
targetDefaults: isObject(nxJson["targetDefaults"]) ? nxJson["targetDefaults"] : {},
|
|
893
|
+
namedInputs: isObject(nxJson["namedInputs"]) ? nxJson["namedInputs"] : {}
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
function projectList(root, projects) {
|
|
897
|
+
if (projects !== void 0)
|
|
898
|
+
return projects.map((project) => ({ name: project.name, root: project.root }));
|
|
899
|
+
const found = [];
|
|
900
|
+
for (const folder of ["apps", "libs"]) {
|
|
901
|
+
let entries = [];
|
|
902
|
+
try {
|
|
903
|
+
entries = readdirSync5(join6(root, folder), { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name);
|
|
904
|
+
} catch {
|
|
905
|
+
continue;
|
|
906
|
+
}
|
|
907
|
+
for (const name of entries) {
|
|
908
|
+
const dir = `${folder}/${name}`;
|
|
909
|
+
const config = readJson(join6(root, dir, "project.json")) ?? readJson(join6(root, dir, "package.json"));
|
|
910
|
+
if (config === null)
|
|
911
|
+
continue;
|
|
912
|
+
found.push({ name: typeof config["name"] === "string" ? config["name"] : name, root: dir });
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
return found;
|
|
916
|
+
}
|
|
917
|
+
function ownLintTarget(root, project, target) {
|
|
918
|
+
const prefix = projectPrefix(project.root);
|
|
919
|
+
const candidates = [
|
|
920
|
+
[`${prefix}project.json`, (config) => isObject(config["targets"]) ? config["targets"][target] : void 0],
|
|
921
|
+
[`${prefix}package.json`, (config) => isObject(config["nx"]) && isObject(config["nx"]["targets"]) ? config["nx"]["targets"][target] : void 0]
|
|
922
|
+
];
|
|
923
|
+
for (const [file, pick] of candidates) {
|
|
924
|
+
const config = readJson(join6(root, file));
|
|
925
|
+
if (config === null)
|
|
926
|
+
continue;
|
|
927
|
+
const own = pick(config);
|
|
928
|
+
if (!isObject(own))
|
|
929
|
+
continue;
|
|
930
|
+
return {
|
|
931
|
+
project: project.name,
|
|
932
|
+
file,
|
|
933
|
+
executor: typeof own["executor"] === "string" ? own["executor"] : void 0,
|
|
934
|
+
inputs: Array.isArray(own["inputs"]) ? own["inputs"] : void 0
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
const pkg = readJson(join6(root, `${prefix}package.json`));
|
|
938
|
+
if (pkg !== null && isObject(pkg["scripts"]) && typeof pkg["scripts"][target] === "string") {
|
|
939
|
+
return { project: project.name, file: `${prefix}package.json`, executor: "nx:run-script", inputs: void 0 };
|
|
940
|
+
}
|
|
941
|
+
return null;
|
|
942
|
+
}
|
|
943
|
+
function configFileOf(root, projectRoot) {
|
|
944
|
+
const prefix = projectPrefix(projectRoot);
|
|
945
|
+
return existsSync6(join6(root, `${prefix}project.json`)) ? `${prefix}project.json` : `${prefix}package.json`;
|
|
946
|
+
}
|
|
947
|
+
function defaultsInputs(setup, executor) {
|
|
948
|
+
for (const key of [executor ?? ESLINT_EXECUTOR, setup.target]) {
|
|
949
|
+
const entry = setup.targetDefaults[key];
|
|
950
|
+
if (isObject(entry) && Array.isArray(entry["inputs"]))
|
|
951
|
+
return entry["inputs"];
|
|
952
|
+
}
|
|
953
|
+
return void 0;
|
|
954
|
+
}
|
|
955
|
+
function carriesToolkitConfig(inputs, namedInputs) {
|
|
956
|
+
return inputs.some((input) => {
|
|
957
|
+
if (input === TOOLKIT_CONFIG_INPUT)
|
|
958
|
+
return true;
|
|
959
|
+
if (typeof input !== "string")
|
|
960
|
+
return false;
|
|
961
|
+
const named = namedInputs[input.replace(/^\^/, "")];
|
|
962
|
+
return Array.isArray(named) && named.includes(TOOLKIT_CONFIG_INPUT);
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
function namesOwnFiles(inputs) {
|
|
966
|
+
return inputs.some((input) => typeof input === "string" && (input === "default" || input === "production" || input.startsWith("{projectRoot}")));
|
|
967
|
+
}
|
|
968
|
+
function eslintConfigNames(root, projectRoot) {
|
|
969
|
+
const prefix = projectPrefix(projectRoot);
|
|
970
|
+
const own = ESLINT_CONFIG_CANDIDATES.find((name) => existsSync6(join6(root, `${prefix}${name}`)));
|
|
971
|
+
const workspace = ESLINT_CONFIG_CANDIDATES.find((name) => existsSync6(join6(root, name)));
|
|
972
|
+
return [
|
|
973
|
+
...own === void 0 || prefix === "" ? [] : [`{projectRoot}/${own}`],
|
|
974
|
+
...workspace === void 0 ? [] : [`{workspaceRoot}/${workspace}`]
|
|
975
|
+
];
|
|
976
|
+
}
|
|
977
|
+
var NOT_READ = "nx.json could not be read";
|
|
978
|
+
function runNxAt(root) {
|
|
979
|
+
const detected = detectWorkspacePackageManager((path) => existsSync6(join6(root, path)), (path) => existsSync6(join6(root, path)) ? readFileSync5(join6(root, path), "utf-8") : void 0);
|
|
980
|
+
const recorded = readJson(join6(root, "toolkit.config.json"))?.["packageManager"];
|
|
981
|
+
const known = ["pnpm", "npm", "yarn", "bun"].includes(recorded) ? recorded : null;
|
|
982
|
+
return runNxCommand(detected ?? known);
|
|
983
|
+
}
|
|
984
|
+
function buildLintCacheCheck(root, projects) {
|
|
985
|
+
const id = "fsd-lint-cache";
|
|
986
|
+
const label = "Lint cache sees toolkit.config.json";
|
|
987
|
+
const setup = readLintSetup(root);
|
|
988
|
+
if (setup === null)
|
|
989
|
+
return createDoctorCheck({ id, label, status: "not-applicable", message: NOT_READ, evidence: [] });
|
|
990
|
+
const all = projectList(root, projects);
|
|
991
|
+
const fsdRoots = appliedFsdConfigs(root, projects).map((config) => config.replace(/\/?[^/]+$/, ""));
|
|
992
|
+
const fsdProjects = all.filter((project) => fsdRoots.includes(projectPrefix(project.root).replace(/\/$/, "")));
|
|
993
|
+
if (fsdRoots.length === 0) {
|
|
994
|
+
return createDoctorCheck({ id, label, status: "not-applicable", message: "no ESLint config wires the FSD rule", evidence: [] });
|
|
995
|
+
}
|
|
996
|
+
const missing = fsdProjects.filter((project) => {
|
|
997
|
+
if (projectPrefix(project.root) === "")
|
|
998
|
+
return false;
|
|
999
|
+
const own = ownLintTarget(root, project, setup.target);
|
|
1000
|
+
const inputs = own?.inputs ?? defaultsInputs(setup, own?.executor);
|
|
1001
|
+
return inputs === void 0 || !carriesToolkitConfig(inputs, setup.namedInputs);
|
|
1002
|
+
});
|
|
1003
|
+
if (missing.length === 0) {
|
|
1004
|
+
return createDoctorCheck({ id, label, status: "pass", message: "toolkit.config.json is among the FSD projects' lint inputs", evidence: [] });
|
|
1005
|
+
}
|
|
1006
|
+
const ownTargets = all.map((project) => ownLintTarget(root, project, setup.target)).filter((own) => own !== null);
|
|
1007
|
+
const lines = setup.pluginRegistered && ownTargets.length === 0 ? lintInputsTargetDefaultsSnippet(setup.target) : missing.flatMap((project) => {
|
|
1008
|
+
const own = ownLintTarget(root, project, setup.target);
|
|
1009
|
+
return lintInputsProjectSnippet({
|
|
1010
|
+
file: own?.file ?? configFileOf(root, project.root),
|
|
1011
|
+
target: setup.target,
|
|
1012
|
+
ownInputs: own?.inputs !== void 0,
|
|
1013
|
+
eslintConfigs: eslintConfigNames(root, project.root)
|
|
1014
|
+
});
|
|
1015
|
+
});
|
|
1016
|
+
const runNx = runNxAt(root);
|
|
1017
|
+
const skipCache = missing.map((project) => `${runNx} ${setup.target} ${project.name} --skip-nx-cache`).join(", ");
|
|
1018
|
+
return createDoctorCheck({
|
|
1019
|
+
id,
|
|
1020
|
+
label,
|
|
1021
|
+
status: "pass",
|
|
1022
|
+
message: "toolkit.config.json is not among lint's inputs: after a change to the fsd policy, Nx can replay a cached lint result",
|
|
1023
|
+
evidence: missing.map((project) => project.name),
|
|
1024
|
+
suggestedAction: [
|
|
1025
|
+
"A workspace init sets up from nx-archweave 0.5.0 on has it already (when its lint targets are inferred).",
|
|
1026
|
+
...lines,
|
|
1027
|
+
`Or, after changing the fsd policy, check with: ${skipCache}`
|
|
1028
|
+
].join("\n ")
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1031
|
+
function buildLintInputsSpreadCheck(root, projects) {
|
|
1032
|
+
const id = "lint-inputs-spread";
|
|
1033
|
+
const label = "Lint targets keep their own inputs";
|
|
1034
|
+
const setup = readLintSetup(root);
|
|
1035
|
+
if (setup === null)
|
|
1036
|
+
return createDoctorCheck({ id, label, status: "not-applicable", message: NOT_READ, evidence: [] });
|
|
1037
|
+
const affected = projectList(root, projects).filter((project) => {
|
|
1038
|
+
const own = ownLintTarget(root, project, setup.target);
|
|
1039
|
+
if (own === null || own.inputs !== void 0)
|
|
1040
|
+
return false;
|
|
1041
|
+
const inputs = defaultsInputs(setup, own.executor);
|
|
1042
|
+
return inputs !== void 0 && inputs.includes("...") && !namesOwnFiles(inputs);
|
|
1043
|
+
});
|
|
1044
|
+
if (affected.length === 0) {
|
|
1045
|
+
return createDoctorCheck({ id, label, status: "pass", message: 'no lint target loses its own files to a "..." in targetDefaults', evidence: [] });
|
|
1046
|
+
}
|
|
1047
|
+
return createDoctorCheck({
|
|
1048
|
+
id,
|
|
1049
|
+
label,
|
|
1050
|
+
status: "warning",
|
|
1051
|
+
message: `targetDefaults gives the ${setup.target} target inputs with "...", but these projects write their own ${setup.target} target without inputs, so "..." has nothing to keep: their lint inputs leave out the project's files, and a source change can come back from the cache`,
|
|
1052
|
+
evidence: affected.map((project) => project.name),
|
|
1053
|
+
suggestedAction: [
|
|
1054
|
+
`Give each of these ${setup.target} targets its own inputs, or list "default" and "^default" in targetDefaults next to "...":`,
|
|
1055
|
+
...affected.map((project) => {
|
|
1056
|
+
const own = ownLintTarget(root, project, setup.target);
|
|
1057
|
+
const inputs = ['"default"', '"^default"', ...eslintConfigNames(root, project.root).map((name) => `"${name}"`), '{ "externalDependencies": ["eslint"] }'];
|
|
1058
|
+
return `${project.name} (${own?.file ?? configFileOf(root, project.root)}): "inputs": [${inputs.join(", ")}]`;
|
|
1059
|
+
})
|
|
1060
|
+
].join("\n ")
|
|
1061
|
+
});
|
|
1062
|
+
}
|
|
1063
|
+
|
|
864
1064
|
// ../template-engine/dist/doctor/run-doctor-checks.js
|
|
865
1065
|
var NOT_APPLICABLE_IDS = [
|
|
866
1066
|
"fsd-like-structure",
|
|
867
1067
|
"fsd-enforcement-applied",
|
|
868
1068
|
"fsd-rule-anchored",
|
|
1069
|
+
"fsd-lint-cache",
|
|
1070
|
+
"lint-inputs-spread",
|
|
869
1071
|
"nx-version",
|
|
870
1072
|
"package-manager",
|
|
871
1073
|
"workspace-root",
|
|
@@ -912,6 +1114,8 @@ function runDoctorChecks(root, projects, nxSupport) {
|
|
|
912
1114
|
buildFsdLikeCheck(root, projects),
|
|
913
1115
|
buildFsdEnforcementCheck(root, projects),
|
|
914
1116
|
buildFsdRuleAnchoredCheck(root, projects),
|
|
1117
|
+
buildLintCacheCheck(root, projects),
|
|
1118
|
+
buildLintInputsSpreadCheck(root, projects),
|
|
915
1119
|
createDoctorCheck({
|
|
916
1120
|
id: "package-manager",
|
|
917
1121
|
label: "Package manager",
|
|
@@ -1056,7 +1260,7 @@ function buildFrameworkChecks(env) {
|
|
|
1056
1260
|
];
|
|
1057
1261
|
}
|
|
1058
1262
|
function isToolkitManaged(root) {
|
|
1059
|
-
return
|
|
1263
|
+
return existsSync7(join7(root, "toolkit.config.json"));
|
|
1060
1264
|
}
|
|
1061
1265
|
function buildExistingConfigCheck(root) {
|
|
1062
1266
|
const exists = isToolkitManaged(root);
|
|
@@ -1069,7 +1273,7 @@ function buildExistingConfigCheck(root) {
|
|
|
1069
1273
|
});
|
|
1070
1274
|
}
|
|
1071
1275
|
function buildIntegrationManifestCheck(root) {
|
|
1072
|
-
const exists =
|
|
1276
|
+
const exists = existsSync7(join7(root, "archweave-integrations.json"));
|
|
1073
1277
|
return createDoctorCheck({
|
|
1074
1278
|
id: "integration-manifest",
|
|
1075
1279
|
label: "Integration manifest",
|
|
@@ -1079,8 +1283,8 @@ function buildIntegrationManifestCheck(root) {
|
|
|
1079
1283
|
});
|
|
1080
1284
|
}
|
|
1081
1285
|
function buildAgentRulesCheck(root) {
|
|
1082
|
-
const claudeExists =
|
|
1083
|
-
const agentsExists =
|
|
1286
|
+
const claudeExists = existsSync7(join7(root, "CLAUDE.md"));
|
|
1287
|
+
const agentsExists = existsSync7(join7(root, "AGENTS.md"));
|
|
1084
1288
|
const exists = claudeExists || agentsExists;
|
|
1085
1289
|
const evidence = [claudeExists && "CLAUDE.md", agentsExists && "AGENTS.md"].filter(Boolean);
|
|
1086
1290
|
return createDoctorCheck({
|
|
@@ -1092,8 +1296,8 @@ function buildAgentRulesCheck(root) {
|
|
|
1092
1296
|
});
|
|
1093
1297
|
}
|
|
1094
1298
|
function buildGithubTemplatesCheck(root) {
|
|
1095
|
-
const issueTemplateExists =
|
|
1096
|
-
const prTemplateExists =
|
|
1299
|
+
const issueTemplateExists = existsSync7(join7(root, ".github", "ISSUE_TEMPLATE"));
|
|
1300
|
+
const prTemplateExists = existsSync7(join7(root, ".github", "PULL_REQUEST_TEMPLATE.md"));
|
|
1097
1301
|
const exists = issueTemplateExists || prTemplateExists;
|
|
1098
1302
|
const managed = isToolkitManaged(root);
|
|
1099
1303
|
return createDoctorCheck({
|
|
@@ -1230,16 +1434,16 @@ function buildIntegrationDoctorChecks(results) {
|
|
|
1230
1434
|
}
|
|
1231
1435
|
|
|
1232
1436
|
// ../integrations/dist/config/read-enabled-integrations.js
|
|
1233
|
-
import { existsSync as
|
|
1234
|
-
import { join as
|
|
1437
|
+
import { existsSync as existsSync8, readFileSync as readFileSync6 } from "node:fs";
|
|
1438
|
+
import { join as join8 } from "node:path";
|
|
1235
1439
|
var CONFIG_FILENAME = "toolkit.config.json";
|
|
1236
1440
|
function readEnabledIntegrationIds(root) {
|
|
1237
|
-
const configPath =
|
|
1238
|
-
if (!
|
|
1441
|
+
const configPath = join8(root, CONFIG_FILENAME);
|
|
1442
|
+
if (!existsSync8(configPath)) {
|
|
1239
1443
|
return [];
|
|
1240
1444
|
}
|
|
1241
1445
|
try {
|
|
1242
|
-
const parsed = JSON.parse(
|
|
1446
|
+
const parsed = JSON.parse(readFileSync6(configPath, "utf8"));
|
|
1243
1447
|
const enabled = parsed?.integrations?.enabled;
|
|
1244
1448
|
return Array.isArray(enabled) && enabled.every((id) => typeof id === "string") ? enabled : [];
|
|
1245
1449
|
} catch {
|
|
@@ -1439,14 +1643,14 @@ function buildPolicySuggestion(tree, sourceRoot, current) {
|
|
|
1439
1643
|
status: "warning",
|
|
1440
1644
|
message: `${deeper} of ${deeper + atSegment} imports into shared reach past a segment's index \u2014 with sharedPublicApi: segment the FSD rule reports each`,
|
|
1441
1645
|
evidence: examples,
|
|
1442
|
-
suggestedAction: 'If that is how this code is meant to be organised,
|
|
1646
|
+
suggestedAction: 'If that is how this code is meant to be organised, add "sharedPublicApi": "file" (or "component") to the fsd object in toolkit.config.json, keeping its other keys.'
|
|
1443
1647
|
});
|
|
1444
1648
|
}
|
|
1445
1649
|
|
|
1446
1650
|
// src/generators/doctor/nx-support.ts
|
|
1447
|
-
import { readFileSync as
|
|
1651
|
+
import { readFileSync as readFileSync7 } from "node:fs";
|
|
1448
1652
|
import { createRequire } from "node:module";
|
|
1449
|
-
import { join as
|
|
1653
|
+
import { join as join9 } from "node:path";
|
|
1450
1654
|
var MAJORS_EITHER_SIDE = 1;
|
|
1451
1655
|
function majorOf(version) {
|
|
1452
1656
|
const match = /^(\d+)\./.exec(version.trim());
|
|
@@ -1455,7 +1659,7 @@ function majorOf(version) {
|
|
|
1455
1659
|
function readOwnDevkitVersion() {
|
|
1456
1660
|
try {
|
|
1457
1661
|
const path = createRequire(import.meta.url).resolve("@nx/devkit/package.json");
|
|
1458
|
-
const version = JSON.parse(
|
|
1662
|
+
const version = JSON.parse(readFileSync7(path, "utf-8")).version;
|
|
1459
1663
|
return typeof version === "string" ? version : void 0;
|
|
1460
1664
|
} catch {
|
|
1461
1665
|
return void 0;
|
|
@@ -1463,7 +1667,7 @@ function readOwnDevkitVersion() {
|
|
|
1463
1667
|
}
|
|
1464
1668
|
function readInstalledNx(root) {
|
|
1465
1669
|
try {
|
|
1466
|
-
const version = JSON.parse(
|
|
1670
|
+
const version = JSON.parse(readFileSync7(join9(root, "node_modules", "nx", "package.json"), "utf-8")).version;
|
|
1467
1671
|
return typeof version === "string" ? version : void 0;
|
|
1468
1672
|
} catch {
|
|
1469
1673
|
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-Q7IYHKT3.js";
|
|
7
|
+
import "../_chunks/chunk-WVMTOWLM.js";
|
|
8
8
|
import "../_chunks/chunk-TXAQ2GJC.js";
|
|
9
9
|
import "../_chunks/chunk-6ZTIUBB2.js";
|
|
10
10
|
import "../_chunks/chunk-YNMLB4DL.js";
|
|
@@ -12,8 +12,8 @@ import "../_chunks/chunk-JPS6XKYK.js";
|
|
|
12
12
|
import {
|
|
13
13
|
resolveDryRun
|
|
14
14
|
} from "../_chunks/chunk-TUN34LAQ.js";
|
|
15
|
-
import "../_chunks/chunk-
|
|
16
|
-
import "../_chunks/chunk-
|
|
15
|
+
import "../_chunks/chunk-M7OQWSNF.js";
|
|
16
|
+
import "../_chunks/chunk-5Z7VZPES.js";
|
|
17
17
|
|
|
18
18
|
// src/generators/entity/generator.ts
|
|
19
19
|
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-Q7IYHKT3.js";
|
|
7
|
+
import "../_chunks/chunk-WVMTOWLM.js";
|
|
8
8
|
import "../_chunks/chunk-TXAQ2GJC.js";
|
|
9
9
|
import "../_chunks/chunk-6ZTIUBB2.js";
|
|
10
10
|
import "../_chunks/chunk-YNMLB4DL.js";
|
|
@@ -12,8 +12,8 @@ import "../_chunks/chunk-JPS6XKYK.js";
|
|
|
12
12
|
import {
|
|
13
13
|
resolveDryRun
|
|
14
14
|
} from "../_chunks/chunk-TUN34LAQ.js";
|
|
15
|
-
import "../_chunks/chunk-
|
|
16
|
-
import "../_chunks/chunk-
|
|
15
|
+
import "../_chunks/chunk-M7OQWSNF.js";
|
|
16
|
+
import "../_chunks/chunk-5Z7VZPES.js";
|
|
17
17
|
|
|
18
18
|
// src/generators/feature/generator.ts
|
|
19
19
|
async function featureGenerator(tree, options) {
|