@procedures/lib 0.3.0 → 0.4.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # @procedures/lib
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 2fd2398: `dag.traverse` moved from `@procedures/lib` to `@procedures/dag`. Its name, input, output and effects stay the same. In this version, `@procedures/dag` has a `./module` entry, a `./register` entry and the `client.procedures` field, and it depends on `@procedures/client` and `zod`. The graph algorithms of its root do not change.
8
+
9
+ `dag.traverse` gets the packages from `lib.scan` through `ctx.client` (`calls: ["lib.scan"]`). `@procedures/lib` depends on `@procedures/dag`, so the module of `@procedures/dag` does not list the module of `@procedures/lib` as a dependency: a host registers the two modules. `bundle-dev`, `bundle-mcp` and `mark` do. The module of `@procedures/lib` does not register `dag.traverse` any more.
10
+
11
+ `DagTraverseInputSchema`, `DagTraverseInput`, `DagTraverseOutput` and `TraverseNodeResult` are exports of `@procedures/dag`, not of `@procedures/lib`.
12
+ - 3fefa43: `core.catch` is removed. Use `client.tryCatch`.
13
+
14
+ `core.catch` did the same as `client.tryCatch` of `@procedures/client`. `CoreCatchInputSchema`, `CoreCatchInput`, `CoreCatchOutput` and `CoreCatchOutputSchema` are removed too. `client.tryCatch` gives no context name: a call of its `try` or `catch` operand needs no `$when: "catch"`.
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [d919678]
19
+ - Updated dependencies [057d69a]
20
+ - Updated dependencies [b2a1a1e]
21
+ - Updated dependencies [057d69a]
22
+ - Updated dependencies [057d69a]
23
+ - Updated dependencies [057d69a]
24
+ - Updated dependencies [057d69a]
25
+ - Updated dependencies [057d69a]
26
+ - Updated dependencies [afd6a19]
27
+ - Updated dependencies [057d69a]
28
+ - Updated dependencies [2fd2398]
29
+ - Updated dependencies [3d76cb7]
30
+ - Updated dependencies [0ecc788]
31
+ - Updated dependencies [4c51727]
32
+ - Updated dependencies [4e751da]
33
+ - @procedures/client@0.4.0
34
+ - @procedures/dag@0.4.0
35
+ - @procedures/fs@0.4.0
36
+ - @procedures/git@0.4.0
37
+ - @procedures/shell@0.4.0
38
+ - @procedures/pnpm@0.4.0
39
+
3
40
  ## 0.3.0
4
41
 
5
42
  ### Minor Changes
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  npm install @procedures/lib
7
7
  ```
8
8
 
9
- `client-lib` gives the procedures that manage the packages of the monorepo, and two runners of programs.
9
+ `client-lib` gives the procedures that manage the packages of the monorepo.
10
10
 
11
11
  | Procedure | Function |
12
12
  |---|---|
@@ -16,11 +16,14 @@ npm install @procedures/lib
16
16
  | `lib.rename` | Rename a package in each file of the workspace |
17
17
  | `lib.graph` | Give the dependency graph of the workspace packages, with its cycles |
18
18
  | `ecosystem.procedures` | List the procedures of the packages |
19
- | `dag.traverse` | Start a procedure for each package, in the order of their dependencies |
20
- | `core.catch` | Start a deferred call, and give the error to a handler call |
21
19
 
22
20
  Until October 2026, `client-lib` also had `lib.install`, `lib.pull` and `lib.refresh`, for one repository per package. The monorepo does not need them, and they are gone ([DECISIONS-2026-10.md](../documentation/DECISIONS-2026-10.md)).
23
21
 
22
+ In version 0.3.0 and before, `client-lib` also had two runners of programs:
23
+
24
+ - `dag.traverse` moved to [`client-dag`](../client-dag) (`@procedures/dag`), with the same name. It gets the packages from `lib.scan` of this package. Thus a host registers the two modules.
25
+ - `core.catch` is removed. It did the same as `client.tryCatch` of `@procedures/client`. Use `client.tryCatch`.
26
+
24
27
  ## Use
25
28
 
26
29
  ```typescript
@@ -89,47 +92,8 @@ node packages/mark/dist/cli.js lib graph
89
92
 
90
93
  Input: `rootPath`, `namespace` and `includeMetadata`. The output lists the procedures of the packages that have a `client.procedures` field.
91
94
 
92
- ## `dag.traverse`
93
-
94
- `dag.traverse` starts the `visit` procedure once for each package, with `cwd` set to the folder of the package. A package starts after the packages that it depends on.
95
-
96
- | Field | Default | Function |
97
- |---|---|---|
98
- | `visit` | | A procedure path, or a call with `$when: "$parent"` (or `$never`) |
99
- | `filter` | | Only these package names |
100
- | `root` | | Only this package and the packages that it depends on |
101
- | `rootPath` | the workspace | The workspace root |
102
- | `concurrency` | 4 | The number of visits at the same time |
103
- | `serialize` | `auto` | When the visits in one git repository start one at a time: `auto` (when the visit uses a `git` procedure), `repository` (always) or `none` |
104
- | `continueOnError` | false | Continue after a failed visit |
105
- | `dryRun` | false | Give the plan only |
106
-
107
- All packages of the monorepo are in one git repository. Concurrent `git add` commands fail on `index.lock`, so `auto` starts git visits one at a time (deep dive DATA-17).
108
-
109
- ```typescript
110
- await client.exec(["dag", "traverse"], {
111
- visit: { $proc: ["pnpm", "run"], input: { script: "build" }, $when: "$parent" },
112
- root: "@procedures/fs",
113
- });
114
- ```
115
-
116
- `dag.traverse` has the tag `runs-refs`: it starts the refs of its input. Thus a server with an `expose` rule lets it use only exposed procedures. A call in `visit` with `$when: "dag.traverse"` waits for this runner ([PROGRAM-FORMAT.md](../documentation/PROGRAM-FORMAT.md), section 5).
117
-
118
- ## `core.catch`
119
-
120
- `core.catch` starts the `try` call. When it fails, `core.catch` starts the `handler` call with the error in its input (`success: false`, `error`, `proc`). Give both calls `$when: "catch"`, so that they wait for this runner.
121
-
122
- ```typescript
123
- await client.exec(["core", "catch"], {
124
- try: { $proc: ["git", "commit"], input: { message: "auto" }, $when: "catch" },
125
- handler: { $proc: ["client", "identity"], input: { value: { continue: true } }, $when: "catch" },
126
- });
127
- ```
128
-
129
- The output gives `success`, `result`, `error` and `continue`. The calls of the `try` input start inside the error handling (deep dive DATA-22).
130
-
131
95
  ## Related packages
132
96
 
133
- - `client-dag`: the graph algorithms of `dag.traverse`.
97
+ - `client-dag`: the graph algorithms of `lib.graph`, and the procedure `dag.traverse`, which uses `lib.scan`.
134
98
  - `client-procedure`: `procedure.new`, the scaffold of a procedure.
135
99
  - `mark`: the CLI that starts these procedures.