@crossplatformai/dependency-graph 0.9.2 → 0.9.4

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
@@ -1,15 +1,27 @@
1
- # @repo/dependency-graph
1
+ # @crossplatformai/dependency-graph
2
2
 
3
- Shared utility plugin for workspace dependency graph analysis. Provides workspace discovery, graph building, traversal, and analysis utilities.
3
+ Workspace dependency graph tooling for CrossPlatform.ai projects.
4
4
 
5
- ## Zero Dependencies
5
+ This package provides workspace discovery, graph building, traversal, and analysis utilities for developer tooling, CI, release workflows, and repository maintenance.
6
6
 
7
- This plugin follows the **zero dependencies** pattern. It defines interfaces for external services (`FileSystemClient`, `GlobClient`, `YamlClient`) and accepts implementations via dependency injection.
7
+ ## Package Role
8
+
9
+ `@crossplatformai/dependency-graph` belongs in the developer tooling layer.
10
+
11
+ It is intended for:
12
+
13
+ - workspace analysis
14
+ - affected package detection
15
+ - release and CI automation
16
+ - dependency health checks
17
+ - repository tooling
18
+
19
+ It is not an app runtime capability.
8
20
 
9
21
  ## Installation
10
22
 
11
23
  ```bash
12
- pnpm add @repo/dependency-graph
24
+ pnpm add @crossplatformai/dependency-graph
13
25
  ```
14
26
 
15
27
  ## Usage
@@ -17,7 +29,7 @@ pnpm add @repo/dependency-graph
17
29
  ### Discovering Workspaces
18
30
 
19
31
  ```typescript
20
- import { discoverWorkspaces } from '@repo/dependency-graph';
32
+ import { discoverWorkspaces } from '@crossplatformai/dependency-graph';
21
33
  import { readFile } from 'node:fs/promises';
22
34
  import { glob } from 'glob';
23
35
  import { parse } from 'yaml';
@@ -46,7 +58,7 @@ const packages = await discoverWorkspaces(process.cwd(), {
46
58
  ### Building Dependency Graph
47
59
 
48
60
  ```typescript
49
- import { buildDependencyGraph } from '@repo/dependency-graph';
61
+ import { buildDependencyGraph } from '@crossplatformai/dependency-graph';
50
62
 
51
63
  const graph = buildDependencyGraph(packages);
52
64
  ```
@@ -54,19 +66,17 @@ const graph = buildDependencyGraph(packages);
54
66
  ### Finding Affected Packages
55
67
 
56
68
  ```typescript
57
- import { findAffectedPackages } from '@repo/dependency-graph';
69
+ import { findAffectedPackages } from '@crossplatformai/dependency-graph';
58
70
 
59
- const affected = findAffectedPackages(
60
- graph,
61
- 'my-package',
62
- { includeSelf: true }
63
- );
71
+ const affected = findAffectedPackages(graph, 'my-package', {
72
+ includeSelf: true,
73
+ });
64
74
  ```
65
75
 
66
76
  ### Detecting Cycles
67
77
 
68
78
  ```typescript
69
- import { detectCycles } from '@repo/dependency-graph';
79
+ import { detectCycles } from '@crossplatformai/dependency-graph';
70
80
 
71
81
  const cycles = detectCycles(graph);
72
82
  if (cycles.length > 0) {
@@ -77,7 +87,7 @@ if (cycles.length > 0) {
77
87
  ### Mapping Files to Packages
78
88
 
79
89
  ```typescript
80
- import { mapFilesToPackages } from '@repo/dependency-graph';
90
+ import { mapFilesToPackages } from '@crossplatformai/dependency-graph';
81
91
 
82
92
  const changedFiles = ['apps/web/src/index.ts', 'packages/ui/src/button.tsx'];
83
93
  const fileMap = mapFilesToPackages(changedFiles, packages);
@@ -131,10 +141,10 @@ console.log(fileMap);
131
141
 
132
142
  ## Dependency Injection Pattern
133
143
 
134
- This plugin requires clients to be provided by the host application:
144
+ This package accepts clients supplied by the calling tool or script:
135
145
 
136
146
  ```typescript
137
- import type { WorkspaceDiscoveryConfig } from '@repo/dependency-graph';
147
+ import type { WorkspaceDiscoveryConfig } from '@crossplatformai/dependency-graph';
138
148
  import { readFile } from 'node:fs/promises';
139
149
  import { glob } from 'glob';
140
150
  import { parse as parseYaml } from 'yaml';
@@ -192,12 +202,16 @@ mockConfig.yaml.parse.mockReturnValue({ packages: ['apps/*', 'packages/*'] });
192
202
  const packages = await discoverWorkspaces('/fake/root', mockConfig);
193
203
  ```
194
204
 
195
- ## Why Zero Dependencies?
205
+ ## Design Approach
206
+
207
+ This package prefers host-provided implementations for filesystem, globbing, and YAML parsing when flexibility matters.
208
+
209
+ That keeps the graph logic:
196
210
 
197
- - **Flexibility**: Use any file system, glob, or YAML library
198
- - **Version Control**: Host controls all dependency versions
199
- - **Testing**: Easy to mock with simple interfaces
200
- - **Reusability**: Works across different environments (Node.js, Bun, Deno, etc.)
211
+ - testable
212
+ - environment-agnostic
213
+ - reusable across scripts and CI contexts
214
+ - decoupled from any one file access strategy
201
215
 
202
216
  ## License
203
217
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@crossplatformai/dependency-graph",
3
- "description": "Shared dependency graph plugin for CrossPlatform.ai projects",
4
- "version": "0.9.2",
3
+ "description": "Workspace dependency graph tooling for CrossPlatform.ai projects.",
4
+ "version": "0.9.4",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "license": "SEE LICENSE IN LICENSE",
@@ -9,7 +9,8 @@
9
9
  "types": "./src/index.ts",
10
10
  "repository": {
11
11
  "type": "git",
12
- "url": "git+https://github.com/crossplatformai/dependency-graph.git"
12
+ "url": "git+https://github.com/crossplatformai/framework.git",
13
+ "directory": "packages/dependency-graph"
13
14
  },
14
15
  "publishConfig": {
15
16
  "access": "public"
@@ -23,35 +24,31 @@
23
24
  "import": "./src/index.ts"
24
25
  }
25
26
  },
26
- "scripts": {
27
- "check-types": "tsc --noEmit --skipLibCheck",
28
- "format": "prettier --write \"src/**/*.ts\" \"*.json\"",
29
- "format:check": "prettier --check \"src/**/*.ts\" \"*.json\"",
30
- "lint": "eslint . --cache --fix --max-warnings 0",
31
- "test": "vitest run",
32
- "test:watch": "vitest",
33
- "publish:next": "npm publish --tag next",
34
- "publish:production": "npm publish --tag latest"
35
- },
36
27
  "dependencies": {
37
- "glob": "^11.0.1",
28
+ "glob": "^13.0.6",
38
29
  "yaml": "^2.7.0"
39
30
  },
40
31
  "devDependencies": {
41
- "@crossplatformai/prettier-config": "^0.0.2",
42
- "@crossplatformai/typescript-config": "^0.6.3",
43
32
  "@eslint/js": "^9.39.2",
44
- "@types/node": "^22.13.0",
45
- "eslint": "^9.21.0",
46
- "eslint-config-prettier": "^10.0.0",
33
+ "@types/node": "^25.3.0",
34
+ "eslint": "^9.39.2",
35
+ "eslint-config-prettier": "^10.1.8",
47
36
  "eslint-plugin-import": "^2.31.0",
48
- "eslint-plugin-prettier": "^5.2.1",
49
- "globals": "^15.13.0",
50
- "prettier": "^3.4.2",
51
- "typescript": "^5.8.2",
52
- "typescript-eslint": "^8.18.0",
53
- "vitest": "^3.0.6"
37
+ "eslint-plugin-prettier": "^5.5.5",
38
+ "globals": "^17.3.0",
39
+ "prettier": "^3.8.1",
40
+ "typescript": "~5.9.3",
41
+ "typescript-eslint": "^8.54.0",
42
+ "vitest": "^4.0.17",
43
+ "@crossplatformai/typescript-config": "0.7.0"
54
44
  },
55
- "prettier": "@crossplatformai/prettier-config",
56
- "packageManager": "pnpm@10.29.3+sha512.498e1fb4cca5aa06c1dcf2611e6fafc50972ffe7189998c409e90de74566444298ffe43e6cd2acdc775ba1aa7cc5e092a8b7054c811ba8c5770f84693d33d2dc"
57
- }
45
+ "scripts": {
46
+ "check-types": "tsc --noEmit --skipLibCheck",
47
+ "lint": "eslint . --cache --fix --max-warnings 0",
48
+ "publish:preview": "node ../../scripts/publish-preview.mjs",
49
+ "test": "vitest run",
50
+ "test:watch": "vitest",
51
+ "publish:next": "node ../../scripts/publish-release.mjs next",
52
+ "publish:latest": "node ../../scripts/publish-release.mjs latest"
53
+ }
54
+ }
@@ -11,7 +11,7 @@ import {
11
11
  buildDependencyGraph,
12
12
  findAffectedPackages,
13
13
  type WorkspacePackage,
14
- } from '../index.js';
14
+ } from '../index';
15
15
 
16
16
  interface ChangedFile {
17
17
  path: string;