@clearlydev/nx-archweave 0.3.2 → 0.4.0
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 +1 -1
- package/dist/bin/review-verdict.js +8 -249
- package/dist/eslint/index.js +28 -321
- package/dist/generators/_chunks/chunk-2WSX5YNB.js +274 -0
- package/dist/generators/_chunks/chunk-34V6HAJT.js +55 -0
- package/dist/generators/_chunks/chunk-3A6RZUCZ.js +114 -0
- package/dist/generators/_chunks/chunk-47T7NOPP.js +30 -0
- package/dist/generators/_chunks/chunk-4FJ7CLEU.js +189 -0
- package/dist/generators/_chunks/chunk-5MI3O4VZ.js +99 -0
- package/dist/generators/_chunks/chunk-6ZTIUBB2.js +139 -0
- package/dist/generators/_chunks/chunk-AIJCJ7JK.js +203 -0
- package/dist/generators/_chunks/chunk-ALSXKTLM.js +1098 -0
- package/dist/generators/_chunks/chunk-AQHV7DJS.js +656 -0
- package/dist/generators/_chunks/chunk-C2VVUWBA.js +386 -0
- package/dist/generators/_chunks/chunk-EXYZLL7A.js +234 -0
- package/dist/generators/_chunks/chunk-FQHFT5IH.js +50 -0
- package/dist/generators/_chunks/chunk-H222FPLK.js +80 -0
- package/dist/generators/_chunks/chunk-IIDOBI42.js +616 -0
- package/dist/generators/_chunks/chunk-L2RZ2LBO.js +132 -0
- package/dist/generators/_chunks/chunk-MQNQJOWA.js +217 -0
- package/dist/generators/_chunks/chunk-QQNDYJTR.js +243 -0
- package/dist/generators/_chunks/chunk-SFXU6IUS.js +0 -0
- package/dist/generators/_chunks/chunk-SNBIVIMI.js +89 -0
- package/dist/generators/_chunks/chunk-TUN34LAQ.js +8 -0
- package/dist/generators/_chunks/chunk-TXAQ2GJC.js +20 -0
- package/dist/generators/_chunks/chunk-U6LAFHSF.js +49 -0
- package/dist/generators/_chunks/chunk-URV6FLUH.js +73 -0
- package/dist/generators/_chunks/chunk-YNMLB4DL.js +25 -0
- package/dist/generators/_chunks/chunk-YY2UESLM.js +282 -0
- package/dist/generators/add-agent-rules/generator.js +11 -842
- package/dist/generators/add-backend/generator.js +11 -906
- package/dist/generators/add-fsd-lite/generator.js +12 -801
- package/dist/generators/add-github-templates/generator.js +13 -116
- package/dist/generators/add-integration/generator.js +15 -743
- package/dist/generators/add-review/generator.js +12 -1231
- package/dist/generators/allow-builds/generator.js +7 -71
- package/dist/generators/doctor/generator.js +106 -2044
- package/dist/generators/entity/generator.js +15 -604
- package/dist/generators/feature/generator.js +15 -604
- package/dist/generators/init/generator.js +68 -3376
- package/dist/generators/install-integration/generator.js +35 -871
- package/dist/generators/page/generator.js +15 -604
- package/dist/generators/record-integration/generator.js +12 -778
- package/dist/generators/shared/generator.js +15 -604
- package/dist/generators/widget/generator.js +15 -604
- package/dist/index.js +5 -663
- package/package.json +1 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// src/generators/slice/render.ts
|
|
2
|
+
var ACTION_LINES = {
|
|
3
|
+
created: "created",
|
|
4
|
+
unchanged: "unchanged (already matches the generated content)",
|
|
5
|
+
skipped: "skipped \u2014 a slice with this name already exists with different content"
|
|
6
|
+
};
|
|
7
|
+
function renderSliceReport(report) {
|
|
8
|
+
const lines = [];
|
|
9
|
+
const label = `${report.layer} "${report.name}"`;
|
|
10
|
+
if (report.refused) {
|
|
11
|
+
lines.push(`${label}: refused \u2014 nothing was written.`);
|
|
12
|
+
lines.push("");
|
|
13
|
+
if (report.refusalReason === "invalid-name") {
|
|
14
|
+
lines.push(` "${report.name}" is not a valid kebab-case slice name.`);
|
|
15
|
+
lines.push(' Use lowercase letters, digits, and single hyphens, starting with a letter (e.g. "add-to-cart").');
|
|
16
|
+
} else if (report.refusalReason === "invalid-public-api-name") {
|
|
17
|
+
lines.push(" The public API name is not a usable JavaScript identifier (or is a reserved word).");
|
|
18
|
+
lines.push(' Pass --publicApiName with a valid identifier, e.g. "addToCart" (this also happens when');
|
|
19
|
+
lines.push(' the slice name camelCases into a reserved word, like "class" or "delete").');
|
|
20
|
+
} else if (report.refusalReason === "project-not-found") {
|
|
21
|
+
lines.push(` --project=${report.project} names no project in this workspace.`);
|
|
22
|
+
} else if (report.refusalReason === "ambiguous-frontend") {
|
|
23
|
+
lines.push(" More than one frontend app was found \u2014 rerun with --project=<one of them>:");
|
|
24
|
+
for (const name of report.candidates ?? []) lines.push(` - ${name}`);
|
|
25
|
+
if ((report.recordedFrontends ?? []).length > 0) lines.push(` (toolkit.config.json records: ${(report.recordedFrontends ?? []).join(", ")})`);
|
|
26
|
+
} else if (report.refusalReason === "invalid-project-json") {
|
|
27
|
+
lines.push(` A project.json could not be parsed (${report.detail ?? "unknown"}) \u2014 fix it, then rerun.`);
|
|
28
|
+
} else if (report.refusalReason === "no-frontend-app" && (report.candidates ?? []).length > 0) {
|
|
29
|
+
lines.push(" No project was recognised as a frontend app. If one of these is it, rerun with --project=<name>:");
|
|
30
|
+
for (const name of report.candidates ?? []) lines.push(` - ${name}`);
|
|
31
|
+
} else if (report.refusalReason === "no-frontend-app") {
|
|
32
|
+
lines.push(" The workspace has no projects to hold FSD layers \u2014 create a frontend app first.");
|
|
33
|
+
} else if (report.refusalReason === "invalid-segment") {
|
|
34
|
+
lines.push(` --segments: "${report.detail ?? ""}" is not a valid segment name.`);
|
|
35
|
+
lines.push(" Use lowercase letters, digits, and single hyphens, starting with a letter (e.g. ui, api, lib).");
|
|
36
|
+
} else if (report.refusalReason === "group-on-shared") {
|
|
37
|
+
lines.push(" --group does not apply to shared: shared holds segments, not slices.");
|
|
38
|
+
} else if (report.refusalReason === "invalid-group") {
|
|
39
|
+
lines.push(` --group: "${report.detail ?? ""}" is not a usable group name.`);
|
|
40
|
+
lines.push(' Use kebab-case (e.g. "mypage"), and not a segment name (ui, model, api, lib, config).');
|
|
41
|
+
} else if (report.refusalReason === "segments-on-shared") {
|
|
42
|
+
lines.push(" --segments does not apply to shared: a shared segment holds no segments of its own.");
|
|
43
|
+
lines.push(" Run the generator once per segment instead (e.g. --name=ui, then --name=api).");
|
|
44
|
+
} else {
|
|
45
|
+
const offender = report.detail ?? report.name;
|
|
46
|
+
lines.push(` "${offender}" names what a segment contains, not what it is for.`);
|
|
47
|
+
lines.push(" Canonical FSD names segments by purpose \u2014 ui, api, model, lib, config \u2014 so the code stays");
|
|
48
|
+
lines.push(" findable by what it does (e.g. a date helper lives in shared/lib, a Button in shared/ui).");
|
|
49
|
+
}
|
|
50
|
+
return lines.join("\n");
|
|
51
|
+
}
|
|
52
|
+
if (report.dryRun) {
|
|
53
|
+
lines.push("dry-run \u2014 no files were written.");
|
|
54
|
+
lines.push("");
|
|
55
|
+
}
|
|
56
|
+
lines.push(`${label}: ${ACTION_LINES[report.action]}`);
|
|
57
|
+
if (report.action === "skipped") {
|
|
58
|
+
lines.push(` ${report.directory} already exists and does not exactly match the generated content.`);
|
|
59
|
+
lines.push(" Pick a new slice name (a name collision is a signal to rename, not to merge)");
|
|
60
|
+
lines.push(" \u2014 or remove the existing directory manually first if you intended to replace it.");
|
|
61
|
+
return lines.join("\n");
|
|
62
|
+
}
|
|
63
|
+
if (report.specSkipped === "no-test-runner") {
|
|
64
|
+
lines.push(" no test runner found (jest or vitest) \u2014 no .spec.ts was written; pass --unitTestRunner=jest|vitest to add one.");
|
|
65
|
+
} else if (report.specSkipped === "none-requested") {
|
|
66
|
+
lines.push(" no .spec.ts was written (unitTestRunner: none).");
|
|
67
|
+
}
|
|
68
|
+
if (report.dryRun) {
|
|
69
|
+
for (const file of report.files) {
|
|
70
|
+
lines.push("");
|
|
71
|
+
lines.push(`${file.filePath}:`);
|
|
72
|
+
lines.push(file.content);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return lines.join("\n");
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
renderSliceReport
|
|
80
|
+
};
|