@groma/scanner-vue 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 CHANGED
@@ -70,8 +70,12 @@ checks. This prototype package name does not imply public publication.
70
70
 
71
71
  Run Groma from the repository root. The scanner finds package declarations in
72
72
  tracked and unignored files, including nested apps and libraries. Dependencies,
73
- dev dependencies, peer dependencies and optional dependencies identify framework
74
- projects. Each compiler uses that project's configuration and installed dependencies;
73
+ dev dependencies, peer dependencies and optional dependencies identify candidates.
74
+ A candidate also needs a tracked or unignored `tsconfig.json` and Vue source
75
+ files belonging to that package, outside nested packages. Declaration files and
76
+ inactive fixtures with a `.fixture` suffix do not qualify. Packages with only
77
+ framework tooling dependencies are skipped. No matching project produces no evidence. Each compiler uses that project's configuration and installed dependencies;
75
78
  imported source in sibling repository libraries keeps its original source path.
76
- Readiness checks all selected projects. A project error fails the complete scan.
79
+ Readiness checks all selected projects. An invalid selected project fails this scanner's observation; other scanners
80
+ can still update the architecture.
77
81
  Source and nested package/configuration changes use the shared scanner watch flow.
package/dist/index.js CHANGED
@@ -39810,9 +39810,22 @@ async function projectFiles(root, matches) {
39810
39810
  function hasDependency(manifest, dependency) {
39811
39811
  return ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"].some((section) => typeof manifest[section]?.[dependency] === "string");
39812
39812
  }
39813
- async function frameworkProjects(root, dependency) {
39813
+ async function frameworkProjects(root, dependency, extensions) {
39814
+ const files = await projectFiles(root, () => true);
39815
+ const manifests = files.filter((file) => path.posix.basename(file) === "package.json");
39816
+ const directories = new Set(manifests.map((file) => path.posix.dirname(file)));
39817
+ const sources = new Set;
39818
+ for (const file of files.filter((file) => extensions.some((extension) => file.endsWith(extension)) && !file.endsWith(".d.ts"))) {
39819
+ let directory = path.posix.dirname(file);
39820
+ while (directory !== "." && !directories.has(directory))
39821
+ directory = path.posix.dirname(directory);
39822
+ sources.add(directory);
39823
+ }
39814
39824
  const projects = [];
39815
- for (const file of await projectFiles(root, (file) => path.posix.basename(file) === "package.json")) {
39825
+ for (const file of manifests) {
39826
+ const directory = path.posix.dirname(file);
39827
+ if (!sources.has(directory) || !files.includes(path.posix.join(directory, "tsconfig.json")))
39828
+ continue;
39816
39829
  const manifest = JSON.parse(await readFile(path.join(root, file), "utf8"));
39817
39830
  if (hasDependency(manifest, dependency))
39818
39831
  projects.push(path.dirname(path.join(root, file)));
@@ -40141,7 +40154,7 @@ function combineObservations(parts) {
40141
40154
  // plugins/scanners/vue/src/index.ts
40142
40155
  async function scanVue(root) {
40143
40156
  const parts = [];
40144
- for (const project of await frameworkProjects(root, "vue")) {
40157
+ for (const project of await frameworkProjects(root, "vue", [".vue"])) {
40145
40158
  const observation = await scanVueProject(project, root);
40146
40159
  if (observation)
40147
40160
  parts.push({ key: relative(root, project), observation });
@@ -40173,9 +40186,7 @@ var src_default = {
40173
40186
  id: "vue",
40174
40187
  watch: { include: ["**/*.vue", "**/*.ts", "**/tsconfig*.json", "**/package.json"], exclude: [] },
40175
40188
  checkReadiness: async (root) => {
40176
- const projects = await frameworkProjects(root, "vue");
40177
- if (!projects.length)
40178
- throw new Error("VUE_PROJECT_REQUIRED: No Vue project declaration was found.");
40189
+ const projects = await frameworkProjects(root, "vue", [".vue"]);
40179
40190
  for (const project of projects)
40180
40191
  vueProject(project, root);
40181
40192
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@groma/scanner-vue",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Complementary Vue framework evidence; a dependency declaration does not verify runtime use.",
5
5
  "private": false,
6
6
  "type": "module",