@procedures/dag 0.46.0 → 0.47.2

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 (47) hide show
  1. package/CHANGELOG.md +35 -1
  2. package/README.md +17 -0
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/graph/index.d.ts +6 -0
  5. package/dist/graph/index.d.ts.map +1 -0
  6. package/dist/graph/index.js +6 -0
  7. package/dist/graph/index.js.map +1 -0
  8. package/dist/index.d.ts +3 -2
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +3 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/procedures/traverse.js +1 -1
  13. package/dist/procedures/traverse.js.map +1 -1
  14. package/dist/procedures/types.d.ts +2 -2
  15. package/dist/procedures/types.d.ts.map +1 -1
  16. package/dist/procedures/types.js +1 -1
  17. package/dist/procedures/types.js.map +1 -1
  18. package/package.json +12 -4
  19. package/src/graph/index.ts +6 -0
  20. package/src/index.ts +5 -2
  21. package/src/procedures/traverse.ts +1 -1
  22. package/src/procedures/types.ts +2 -2
  23. package/dist/dag/builder.d.ts +0 -25
  24. package/dist/dag/builder.d.ts.map +0 -1
  25. package/dist/dag/builder.js +0 -95
  26. package/dist/dag/builder.js.map +0 -1
  27. package/dist/dag/executor.d.ts +0 -28
  28. package/dist/dag/executor.d.ts.map +0 -1
  29. package/dist/dag/executor.js +0 -147
  30. package/dist/dag/executor.js.map +0 -1
  31. package/dist/dag/index.d.ts +0 -7
  32. package/dist/dag/index.d.ts.map +0 -1
  33. package/dist/dag/index.js +0 -7
  34. package/dist/dag/index.js.map +0 -1
  35. package/dist/dag/traversal.d.ts +0 -28
  36. package/dist/dag/traversal.d.ts.map +0 -1
  37. package/dist/dag/traversal.js +0 -103
  38. package/dist/dag/traversal.js.map +0 -1
  39. package/dist/types.d.ts +0 -80
  40. package/dist/types.d.ts.map +0 -1
  41. package/dist/types.js +0 -8
  42. package/dist/types.js.map +0 -1
  43. package/src/dag/builder.ts +0 -124
  44. package/src/dag/executor.ts +0 -190
  45. package/src/dag/index.ts +0 -23
  46. package/src/dag/traversal.ts +0 -129
  47. package/src/types.ts +0 -87
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @procedures/dag
2
2
 
3
+ ## 0.47.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 2684531: The pure collection and graph code moved to `@mark1russell7/collections`. Both packages re-export the same names, and the signatures stay the same.
8
+ - Updated dependencies [0650616]
9
+ - Updated dependencies [ae1e3fd]
10
+ - Updated dependencies [f1ece74]
11
+ - @procedures/client@0.47.2
12
+
13
+ ## 0.47.1
14
+
15
+ ### Patch Changes
16
+
17
+ - 74f2f24: `@procedures/dag`: a new entry `./graph` with `hubBreadthFirstOrder`, a pure breadth-first order from the hub of each component of a weighted graph. The entry imports no other package.
18
+ - Updated dependencies [f845c6d]
19
+ - @procedures/client@0.47.1
20
+
21
+ ## 0.47.0
22
+
23
+ ### Patch Changes
24
+
25
+ - e913014: Each module imports zod with `import * as z from "zod"`, not `import { z } from "zod"`. With the old form, an esbuild bundle got each locale of zod: 264 kB of minified code (esbuild metafile of the journey worker of the site). The Vite build of the site gives the same worker files with both forms. The procedure scaffolder writes the new form in `types.ts`. The API and the behavior stay the same.
26
+ - Updated dependencies [c9125a8]
27
+ - Updated dependencies [335728b]
28
+ - Updated dependencies [d987202]
29
+ - Updated dependencies [45a737f]
30
+ - Updated dependencies [d77e9e8]
31
+ - Updated dependencies [e913014]
32
+ - Updated dependencies [2f0c7b0]
33
+ - Updated dependencies [ad70c38]
34
+ - Updated dependencies [47819c6]
35
+ - @procedures/client@0.47.0
36
+
3
37
  ## 0.46.0
4
38
 
5
39
  ### Patch Changes
@@ -123,7 +157,7 @@
123
157
 
124
158
  Migration:
125
159
 
126
- - The site, MiniMongo, Graph and jarvis: no change at this time. The deprecated names work until the next MINOR.
160
+ - Apps: no change at this time. The deprecated names work until the next MINOR.
127
161
  - Before the next MINOR, replace `zodAdapter<T>(schema)` with `schema`. To keep the check of a schema against a type, write `const schema: z.ZodType<T> = ...`.
128
162
  - Before the next MINOR, replace `typedAnySchema<T>()` and `outputSchema<T>()` with `typed<T>()`.
129
163
  - A parse-only object (`{ parse }`) in `zodAdapter` becomes a Standard Schema with a `~standard` property.
package/README.md CHANGED
@@ -12,6 +12,8 @@ npm install @procedures/dag
12
12
 
13
13
  > Generic DAG (Directed Acyclic Graph) utilities for dependency ordering and parallel execution. Powers the ecosystem's build system.
14
14
 
15
+ The pure DAG code is in the general package [`@mark1russell7/collections`](https://www.npmjs.com/package/@mark1russell7/collections), which has no runtime dependencies. This package re-exports it.
16
+
15
17
  ## Table of Contents
16
18
 
17
19
  - [Overview](#overview)
@@ -23,6 +25,7 @@ npm install @procedures/dag
23
25
  - [Functions](#functions)
24
26
  - [buildDAG](#builddag)
25
27
  - [executeDAG](#executedag)
28
+ - [hubBreadthFirstOrder](#hubbreadthfirstorder)
26
29
  - [Use Cases](#use-cases)
27
30
  - [Integration](#integration)
28
31
  - [Requirements](#requirements)
@@ -378,6 +381,20 @@ graph LR
378
381
 
379
382
  ---
380
383
 
384
+ ### hubBreadthFirstOrder
385
+
386
+ The entry `@procedures/dag/graph` holds pure graph functions. It imports no other package.
387
+
388
+ ```typescript
389
+ import { hubBreadthFirstOrder } from "@procedures/dag/graph";
390
+
391
+ const sizes = [4, 9, 1];
392
+ const order = hubBreadthFirstOrder(3, [{ a: 0, b: 1, weight: 2 }, { a: 1, b: 2 }], (i, j) => sizes[j]! - sizes[i]!);
393
+ // order: [1, 0, 2]
394
+ ```
395
+
396
+ The function reads an undirected weighted graph with the nodes `0` to `n - 1`. It starts at the node with the largest sum of edge weights, and goes breadth-first. The comparator, then the lower index, breaks each tie. Each next component starts at its own hub.
397
+
381
398
  ## Use Cases
382
399
 
383
400
  ### Package Build Order