@gjsify/workspace 0.4.42 → 0.4.44

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 (2) hide show
  1. package/README.md +38 -0
  2. package/package.json +3 -3
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # @gjsify/workspace
2
+
3
+ Yarn-workspaces-compatible monorepo engine behind `gjsify foreach`, `gjsify workspace`, and `gjsify run`. Discovers workspace packages from `package.json#workspaces` globs, resolves `workspace:^` protocol references to local versions, builds an inter-package dependency graph, and produces a topological build order — the Node-free replacement for `yarn workspaces` that runs on both Node.js and GJS.
4
+
5
+ Part of the [gjsify](https://github.com/gjsify/gjsify) project — Node.js and Web APIs for GJS (GNOME JavaScript).
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ gjsify install @gjsify/workspace
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```typescript
16
+ import {
17
+ discoverWorkspaces,
18
+ buildDependencyGraph,
19
+ topologicalSort,
20
+ filterWorkspaces,
21
+ } from '@gjsify/workspace';
22
+
23
+ // Discover all workspace packages defined in the root package.json
24
+ const workspaces = discoverWorkspaces('/path/to/monorepo');
25
+
26
+ // Build inter-workspace dependency graph and get topological build order
27
+ const graph = buildDependencyGraph(workspaces);
28
+ const ordered = topologicalSort(graph);
29
+ console.log(ordered.map(ws => ws.name));
30
+ // → ['@scope/a', '@scope/b', '@scope/c'] (deps before dependents)
31
+
32
+ // Filter to a subset (mirrors --include / --exclude)
33
+ const published = filterWorkspaces(workspaces, { noPrivate: true });
34
+ ```
35
+
36
+ ## License
37
+
38
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/workspace",
3
- "version": "0.4.42",
3
+ "version": "0.4.44",
4
4
  "description": "Yarn-workspaces-compatible discovery + resolution for gjsify install/foreach. Reads package.json `workspaces` (string array or { packages, nohoist } shape), expands globs, resolves `workspace:^` to local versions, builds the dependency graph + topological order. Cross-platform Node + GJS.",
5
5
  "type": "module",
6
6
  "module": "lib/esm/index.js",
@@ -38,8 +38,8 @@
38
38
  ],
39
39
  "license": "MIT",
40
40
  "devDependencies": {
41
- "@gjsify/cli": "^0.4.42",
42
- "@gjsify/unit": "^0.4.42",
41
+ "@gjsify/cli": "^0.4.44",
42
+ "@gjsify/unit": "^0.4.44",
43
43
  "@types/node": "^25.9.1",
44
44
  "typescript": "^6.0.3"
45
45
  },