@component-compass/cli 0.0.2 → 0.0.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.
Files changed (54) hide show
  1. package/dist/cli.js +4 -0
  2. package/dist/cli.js.map +1 -1
  3. package/dist/commands/no-deps-diagnostic.d.ts +15 -0
  4. package/dist/commands/no-deps-diagnostic.js +23 -0
  5. package/dist/commands/no-deps-diagnostic.js.map +1 -0
  6. package/dist/commands/scan.d.ts +1 -0
  7. package/dist/commands/scan.js +69 -52
  8. package/dist/commands/scan.js.map +1 -1
  9. package/dist/composition-rollup.d.ts +16 -14
  10. package/dist/composition-rollup.js +33 -43
  11. package/dist/composition-rollup.js.map +1 -1
  12. package/dist/identity.d.ts +9 -3
  13. package/dist/identity.js +15 -3
  14. package/dist/identity.js.map +1 -1
  15. package/dist/local-index/detect-react.js +224 -47
  16. package/dist/local-index/detect-react.js.map +1 -1
  17. package/dist/local-index/index.d.ts +4 -1
  18. package/dist/local-index/index.js +30 -13
  19. package/dist/local-index/index.js.map +1 -1
  20. package/dist/manifest/derived-manifest-stub.d.ts +2 -2
  21. package/dist/manifest/diagnostic-filter.d.ts +4 -3
  22. package/dist/manifest/diagnostic-filter.js +15 -2
  23. package/dist/manifest/diagnostic-filter.js.map +1 -1
  24. package/dist/manifest/lazy-resolver.d.ts +17 -25
  25. package/dist/manifest/lazy-resolver.js +175 -48
  26. package/dist/manifest/lazy-resolver.js.map +1 -1
  27. package/dist/occurrences.d.ts +4 -4
  28. package/dist/occurrences.js +29 -5
  29. package/dist/occurrences.js.map +1 -1
  30. package/dist/reporter/index.d.ts +27 -12
  31. package/dist/reporter/index.js +105 -18
  32. package/dist/reporter/index.js.map +1 -1
  33. package/dist/rollup.d.ts +8 -2
  34. package/dist/rollup.js +2 -2
  35. package/dist/rollup.js.map +1 -1
  36. package/dist/seeds.d.ts +3 -2
  37. package/dist/seeds.js +61 -30
  38. package/dist/seeds.js.map +1 -1
  39. package/dist/workspace/build-graph.d.ts +2 -0
  40. package/dist/workspace/build-graph.js +117 -0
  41. package/dist/workspace/build-graph.js.map +1 -0
  42. package/dist/workspace/declared-deps.d.ts +5 -0
  43. package/dist/workspace/declared-deps.js +42 -0
  44. package/dist/workspace/declared-deps.js.map +1 -0
  45. package/dist/workspace/find-owning-package.d.ts +2 -0
  46. package/dist/workspace/find-owning-package.js +49 -0
  47. package/dist/workspace/find-owning-package.js.map +1 -0
  48. package/dist/workspace/index.d.ts +4 -0
  49. package/dist/workspace/index.js +4 -0
  50. package/dist/workspace/index.js.map +1 -0
  51. package/dist/workspace/types.d.ts +46 -0
  52. package/dist/workspace/types.js +13 -0
  53. package/dist/workspace/types.js.map +1 -0
  54. package/package.json +9 -7
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-owning-package.js","sourceRoot":"","sources":["../../src/workspace/find-owning-package.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,MAAM,UAAU,iBAAiB,CAC/B,KAAqB,EACrB,QAAgB;IAEhB,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7C,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC3C,IAAI,IAAI,GAA4B,IAAI,CAAC;IACzC,IAAI,aAAa,GAAG,CAAC,CAAC,CAAC;IACvB,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjC,kEAAkE;QAClE,2EAA2E;QAC3E,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAClD,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC;YAAE,SAAS;QAC/C,mEAAmE;QACnE,oEAAoE;QACpE,yEAAyE;QACzE,yEAAyE;QACzE,IAAI,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC;YAAE,SAAS;QACxE,IAAI,OAAO,CAAC,MAAM,GAAG,aAAa,EAAE,CAAC;YACnC,IAAI,GAAG,GAAG,CAAC;YACX,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;QACjC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,eAAe,CAAC,QAAgB;IACvC,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,MAAc,EAAE,SAAiB;IACrD,IAAI,SAAS,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IACtC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC;IAC7D,OAAO,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { buildWorkspaceGraph } from "./build-graph.js";
2
+ export { declaredDeps } from "./declared-deps.js";
3
+ export { findOwningPackage } from "./find-owning-package.js";
4
+ export type { PackageManager, WorkspaceGraph, WorkspacePackage } from "./types.js";
@@ -0,0 +1,4 @@
1
+ export { buildWorkspaceGraph } from "./build-graph.js";
2
+ export { declaredDeps } from "./declared-deps.js";
3
+ export { findOwningPackage } from "./find-owning-package.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workspace/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Workspace graph shape. Built once per scan at scan-start, threaded into the
3
+ * resolver (for workspace-locality classification) and the identity layer
4
+ * (for `OutputIdentity.packageName` enrichment).
5
+ *
6
+ * Two independent axes:
7
+ * - `packageManager` — yarn / npm / pnpm, sniffed from lockfile. Always set.
8
+ * Returns "unknown" when no lockfile is detected (explicit "no signal").
9
+ * - `packages` — workspace packages from pnpm-workspace.yaml or
10
+ * package.json#workspaces. Empty array for single-package repos.
11
+ */
12
+ export type PackageManager = "yarn" | "npm" | "pnpm" | "unknown";
13
+ export type WorkspacePackage = {
14
+ /** Workspace package name from its `package.json#name`. */
15
+ name: string;
16
+ /** Absolute path to the package directory. */
17
+ absolutePath: string;
18
+ /** Parsed `package.json` contents. Cached for `declaredDeps`. */
19
+ packageJson: {
20
+ name?: string;
21
+ dependencies?: Record<string, string>;
22
+ devDependencies?: Record<string, string>;
23
+ peerDependencies?: Record<string, string>;
24
+ optionalDependencies?: Record<string, string>;
25
+ workspaces?: string[] | {
26
+ packages?: string[];
27
+ };
28
+ };
29
+ };
30
+ export type WorkspaceGraph = {
31
+ /**
32
+ * Detected package manager (lockfile-based). `"unknown"` when no lockfile
33
+ * is present — explicit about not knowing. Independent of workspace
34
+ * detection — set even for single-package repos.
35
+ */
36
+ packageManager: PackageManager;
37
+ /** Absolute path to the scan's configDir (the workspace root). */
38
+ rootPath: string;
39
+ /** Root package name; "<unnamed>" if missing. */
40
+ rootPackageName: string;
41
+ /**
42
+ * Detected workspace packages from pnpm-workspace.yaml or
43
+ * package.json#workspaces. Empty array for single-package repos.
44
+ */
45
+ packages: WorkspacePackage[];
46
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Workspace graph shape. Built once per scan at scan-start, threaded into the
3
+ * resolver (for workspace-locality classification) and the identity layer
4
+ * (for `OutputIdentity.packageName` enrichment).
5
+ *
6
+ * Two independent axes:
7
+ * - `packageManager` — yarn / npm / pnpm, sniffed from lockfile. Always set.
8
+ * Returns "unknown" when no lockfile is detected (explicit "no signal").
9
+ * - `packages` — workspace packages from pnpm-workspace.yaml or
10
+ * package.json#workspaces. Empty array for single-package repos.
11
+ */
12
+ export {};
13
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/workspace/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@component-compass/cli",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Open-source CLI for measuring design-system component usage across multi-framework consumer repos.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -35,20 +35,22 @@
35
35
  "dependencies": {
36
36
  "@babel/parser": "^7.29.3",
37
37
  "@babel/types": "^7.29.0",
38
- "@component-compass/ast-utils": "^0.0.2",
39
- "@component-compass/parser-html": "^0.0.2",
40
- "@component-compass/parser-lit": "^0.0.2",
41
- "@component-compass/parser-react": "^0.0.2",
42
- "@component-compass/parser-vue": "^0.0.2",
43
- "@component-compass/plugin-core": "^0.0.2",
38
+ "@component-compass/ast-utils": "^0.0.3",
39
+ "@component-compass/parser-html": "^0.0.3",
40
+ "@component-compass/parser-lit": "^0.0.3",
41
+ "@component-compass/parser-react": "^0.0.3",
42
+ "@component-compass/parser-vue": "^0.0.3",
43
+ "@component-compass/plugin-core": "^0.0.3",
44
44
  "@vue/compiler-sfc": "^3.5.33",
45
45
  "ajv": "^8.20.0",
46
46
  "glob": "^13.0.0",
47
47
  "globby": "^16.2.0",
48
+ "js-yaml": "^4",
48
49
  "picomatch": "^4.0.4",
49
50
  "ulid": "^3.0.2"
50
51
  },
51
52
  "devDependencies": {
53
+ "@types/js-yaml": "^4",
52
54
  "@types/node": "^24.0.0",
53
55
  "@types/picomatch": "^4.0.3",
54
56
  "typescript": "^5.9.0",