@groma/scanner-angular 0.1.2 → 0.1.3
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 +7 -3
- package/dist/index.js +17 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,8 +93,12 @@ real-project result and remaining release gates.
|
|
|
93
93
|
|
|
94
94
|
Run Groma from the repository root. The scanner finds package declarations in
|
|
95
95
|
tracked and unignored files, including nested apps and libraries. Dependencies,
|
|
96
|
-
dev dependencies, peer dependencies and optional dependencies identify
|
|
97
|
-
|
|
96
|
+
dev dependencies, peer dependencies and optional dependencies identify candidates.
|
|
97
|
+
A candidate also needs a tracked or unignored `tsconfig.json` and TypeScript source
|
|
98
|
+
files belonging to that package, outside nested packages. Declaration files and
|
|
99
|
+
inactive fixtures with a `.fixture` suffix do not qualify. Packages with only
|
|
100
|
+
framework tooling dependencies are skipped. No matching project produces no evidence. Each compiler uses that project's configuration and installed dependencies;
|
|
98
101
|
imported source in sibling repository libraries keeps its original source path.
|
|
99
|
-
Readiness checks all selected projects.
|
|
102
|
+
Readiness checks all selected projects. An invalid selected project fails this scanner's observation; other scanners
|
|
103
|
+
can still update the architecture.
|
|
100
104
|
Source and nested package/configuration changes use the shared scanner watch flow.
|
package/dist/index.js
CHANGED
|
@@ -57981,9 +57981,22 @@ async function projectFiles(root, matches) {
|
|
|
57981
57981
|
function hasDependency(manifest, dependency) {
|
|
57982
57982
|
return ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"].some((section) => typeof manifest[section]?.[dependency] === "string");
|
|
57983
57983
|
}
|
|
57984
|
-
async function frameworkProjects(root, dependency) {
|
|
57984
|
+
async function frameworkProjects(root, dependency, extensions) {
|
|
57985
|
+
const files = await projectFiles(root, () => true);
|
|
57986
|
+
const manifests = files.filter((file) => path2.posix.basename(file) === "package.json");
|
|
57987
|
+
const directories = new Set(manifests.map((file) => path2.posix.dirname(file)));
|
|
57988
|
+
const sources = new Set;
|
|
57989
|
+
for (const file of files.filter((file) => extensions.some((extension) => file.endsWith(extension)) && !file.endsWith(".d.ts"))) {
|
|
57990
|
+
let directory = path2.posix.dirname(file);
|
|
57991
|
+
while (directory !== "." && !directories.has(directory))
|
|
57992
|
+
directory = path2.posix.dirname(directory);
|
|
57993
|
+
sources.add(directory);
|
|
57994
|
+
}
|
|
57985
57995
|
const projects = [];
|
|
57986
|
-
for (const file of
|
|
57996
|
+
for (const file of manifests) {
|
|
57997
|
+
const directory = path2.posix.dirname(file);
|
|
57998
|
+
if (!sources.has(directory) || !files.includes(path2.posix.join(directory, "tsconfig.json")))
|
|
57999
|
+
continue;
|
|
57987
58000
|
const manifest = JSON.parse(await readFile(path2.join(root, file), "utf8"));
|
|
57988
58001
|
if (hasDependency(manifest, dependency))
|
|
57989
58002
|
projects.push(path2.dirname(path2.join(root, file)));
|
|
@@ -58169,15 +58182,13 @@ function angularProject(root) {
|
|
|
58169
58182
|
}
|
|
58170
58183
|
}
|
|
58171
58184
|
async function checkAngularReadiness(root) {
|
|
58172
|
-
const projects = await frameworkProjects(root, "@angular/core");
|
|
58173
|
-
if (!projects.length)
|
|
58174
|
-
throw new Error("ANGULAR_PROJECT_REQUIRED: No Angular project declaration was found.");
|
|
58185
|
+
const projects = await frameworkProjects(root, "@angular/core", [".ts"]);
|
|
58175
58186
|
for (const project of projects)
|
|
58176
58187
|
angularProject(project);
|
|
58177
58188
|
}
|
|
58178
58189
|
async function scanAngular(root) {
|
|
58179
58190
|
const parts = [];
|
|
58180
|
-
for (const project of await frameworkProjects(root, "@angular/core")) {
|
|
58191
|
+
for (const project of await frameworkProjects(root, "@angular/core", [".ts"])) {
|
|
58181
58192
|
const observation = await scanAngularProject(project, root);
|
|
58182
58193
|
if (observation)
|
|
58183
58194
|
parts.push({ key: relative4(root, project), observation });
|