@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
|
@@ -1,119 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
const parsed = JSON.parse(raw);
|
|
16
|
-
return {
|
|
17
|
-
raw,
|
|
18
|
-
parsed: typeof parsed === "object" && parsed !== null && !Array.isArray(parsed) ? parsed : null
|
|
19
|
-
};
|
|
20
|
-
} catch {
|
|
21
|
-
return { raw, parsed: null };
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function readToolkitConfig(tree) {
|
|
25
|
-
return readToolkitConfigFile(tree).parsed;
|
|
26
|
-
}
|
|
27
|
-
function resolveLocaleOption(option, config) {
|
|
28
|
-
if (option) return option;
|
|
29
|
-
const locale = config?.["locale"];
|
|
30
|
-
return locale === "ko" || locale === "en" ? locale : "en";
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// src/generators/shared/template-files.ts
|
|
34
|
-
import { existsSync } from "node:fs";
|
|
35
|
-
import { fileURLToPath } from "node:url";
|
|
36
|
-
import { generateFiles } from "@nx/devkit";
|
|
37
|
-
import { createTree } from "@nx/devkit/testing";
|
|
38
|
-
function generatorFilesDir(generator, fromUrl) {
|
|
39
|
-
for (const relative of [`../${generator}/files`, `./generators/${generator}/files`]) {
|
|
40
|
-
const dir = fileURLToPath(new URL(relative, fromUrl));
|
|
41
|
-
if (existsSync(dir)) return dir;
|
|
42
|
-
}
|
|
43
|
-
throw new Error(`The "${generator}" generator's template files are missing next to ${fileURLToPath(fromUrl)}`);
|
|
44
|
-
}
|
|
45
|
-
function renderTemplateFiles(srcFolder, target, substitutions) {
|
|
46
|
-
const scratch = createTree();
|
|
47
|
-
const seeded = new Set(scratch.listChanges().map((change) => change.path));
|
|
48
|
-
generateFiles(scratch, srcFolder, target, substitutions);
|
|
49
|
-
return scratch.listChanges().flatMap(
|
|
50
|
-
(change) => change.type === "CREATE" && change.content !== null && !seeded.has(change.path) ? [{ filePath: change.path, content: change.content.toString("utf-8") }] : []
|
|
51
|
-
).sort((a, b) => a.filePath.localeCompare(b.filePath));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// src/generators/add-github-templates/render.ts
|
|
55
|
-
var ACTION_LINES = {
|
|
56
|
-
created: "created",
|
|
57
|
-
unchanged: "unchanged (already matches the generated version)",
|
|
58
|
-
skipped: "left as-is (a different file already exists there \u2014 never overwritten)"
|
|
59
|
-
};
|
|
60
|
-
function renderAddGithubTemplatesReport(report) {
|
|
61
|
-
const lines = [];
|
|
62
|
-
if (report.files.length === 0) {
|
|
63
|
-
lines.push("add-github-templates: nothing selected (issue/pr/codeowners all false) \u2014 no files to install.");
|
|
64
|
-
return lines.join("\n");
|
|
65
|
-
}
|
|
66
|
-
if (report.dryRun) {
|
|
67
|
-
lines.push("add-github-templates dry-run \u2014 no files were written.");
|
|
68
|
-
lines.push("");
|
|
69
|
-
for (const file of report.files) {
|
|
70
|
-
lines.push(`${file.filePath}:`);
|
|
71
|
-
lines.push(file.content);
|
|
72
|
-
lines.push("");
|
|
73
|
-
}
|
|
74
|
-
lines.push("Effective decision:");
|
|
75
|
-
}
|
|
76
|
-
for (const file of report.files) {
|
|
77
|
-
lines.push(` ${file.filePath}: ${ACTION_LINES[file.action]}`);
|
|
78
|
-
}
|
|
79
|
-
return lines.join("\n");
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// src/generators/add-github-templates/generator.ts
|
|
83
|
-
var BUG_REPORT_PATH = ".github/ISSUE_TEMPLATE/bug-report.yml";
|
|
84
|
-
var FEATURE_REQUEST_PATH = ".github/ISSUE_TEMPLATE/feature-request.yml";
|
|
85
|
-
var PULL_REQUEST_TEMPLATE_PATH = ".github/PULL_REQUEST_TEMPLATE.md";
|
|
86
|
-
var CODEOWNERS_PATH = ".github/CODEOWNERS";
|
|
87
|
-
function composeGithubTemplates(groups, locale) {
|
|
88
|
-
const files = generatorFilesDir("add-github-templates", import.meta.url);
|
|
89
|
-
return ["issue", "pr", "codeowners"].filter((group) => groups[group]).flatMap((group) => renderTemplateFiles(join(files, locale, group), ".", {}));
|
|
90
|
-
}
|
|
91
|
-
function runAddGithubTemplates(tree, options) {
|
|
92
|
-
const locale = resolveLocaleOption(options.locale, readToolkitConfig(tree));
|
|
93
|
-
const plan = composeGithubTemplates(
|
|
94
|
-
{ issue: options.issue ?? false, pr: options.pr ?? true, codeowners: options.codeowners ?? false },
|
|
95
|
-
locale
|
|
96
|
-
);
|
|
97
|
-
const dryRun = options.dryRun ?? false;
|
|
98
|
-
const files = plan.map(({ filePath, content }) => {
|
|
99
|
-
const existing = tree.read(filePath, "utf-8");
|
|
100
|
-
let action;
|
|
101
|
-
if (existing === null) {
|
|
102
|
-
action = "created";
|
|
103
|
-
if (!dryRun) tree.write(filePath, content);
|
|
104
|
-
} else if (existing === content) {
|
|
105
|
-
action = "unchanged";
|
|
106
|
-
} else {
|
|
107
|
-
action = "skipped";
|
|
108
|
-
}
|
|
109
|
-
return { filePath, action, content };
|
|
110
|
-
});
|
|
111
|
-
return { dryRun, files };
|
|
112
|
-
}
|
|
113
|
-
async function addGithubTemplatesGenerator(tree, options) {
|
|
114
|
-
console.log(renderAddGithubTemplatesReport(runAddGithubTemplates(tree, { ...options, dryRun: resolveDryRun(options) })));
|
|
115
|
-
}
|
|
116
|
-
var generator_default = addGithubTemplatesGenerator;
|
|
1
|
+
import {
|
|
2
|
+
BUG_REPORT_PATH,
|
|
3
|
+
CODEOWNERS_PATH,
|
|
4
|
+
FEATURE_REQUEST_PATH,
|
|
5
|
+
PULL_REQUEST_TEMPLATE_PATH,
|
|
6
|
+
addGithubTemplatesGenerator,
|
|
7
|
+
generator_default,
|
|
8
|
+
runAddGithubTemplates
|
|
9
|
+
} from "../_chunks/chunk-SNBIVIMI.js";
|
|
10
|
+
import "../_chunks/chunk-YNMLB4DL.js";
|
|
11
|
+
import "../_chunks/chunk-TUN34LAQ.js";
|
|
12
|
+
import "../_chunks/chunk-EXYZLL7A.js";
|
|
13
|
+
import "../_chunks/chunk-FQHFT5IH.js";
|
|
117
14
|
export {
|
|
118
15
|
BUG_REPORT_PATH,
|
|
119
16
|
CODEOWNERS_PATH,
|