@procedures/lib 0.12.2 → 0.13.1

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,29 @@
1
1
  # @procedures/lib
2
2
 
3
+ ## 0.13.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 992b801: New: the procedure `lib.importCycles` and the functions `importCycles` and `importGraph` (Graph's split, wave 2, W7). They give the import cycles of a tree of TypeScript sources: the cycles at runtime (after the import elision of TypeScript, with the injection tokens of Angular as an option), the cycles of the declared imports, or the cycles of each import. `findCycles` keeps its own stack, so a long chain does not overflow the call stack.
8
+ - @procedures/client@0.13.1
9
+ - @procedures/dag@0.13.1
10
+ - @procedures/fs@0.13.1
11
+ - @procedures/git@0.13.1
12
+ - @procedures/pnpm@0.13.1
13
+ - @procedures/shell@0.13.1
14
+
15
+ ## 0.13.0
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [e2fe006]
20
+ - @procedures/client@0.13.0
21
+ - @procedures/dag@0.13.0
22
+ - @procedures/fs@0.13.0
23
+ - @procedures/git@0.13.0
24
+ - @procedures/pnpm@0.13.0
25
+ - @procedures/shell@0.13.0
26
+
3
27
  ## 0.12.2
4
28
 
5
29
  ### Patch Changes
package/README.md CHANGED
@@ -15,6 +15,7 @@ npm install @procedures/lib
15
15
  | `lib.audit` | Compare each package with the template |
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
+ | `lib.importCycles` | Give the import cycles of a tree of TypeScript sources |
18
19
  | `ecosystem.procedures` | List the procedures of the packages |
19
20
 
20
21
  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)).
@@ -94,6 +95,28 @@ Input: `rootPath`. The procedure reads the `package.json` of each folder in `pac
94
95
  node packages/mark/dist/cli.js lib graph
95
96
  ```
96
97
 
98
+ ## `lib.importCycles`
99
+
100
+ The import cycles of the TypeScript sources under a folder. The default mode counts the cycles that exist at runtime: TypeScript's import elision drops an import of types only, as the build drops it.
101
+
102
+ | Mode | The edges |
103
+ |---|---|
104
+ | `runtime` (the default) | The imports after the elision, and the injection tokens of the decorators in `diDecorators` |
105
+ | `declared` | Each import that the source does not declare type-only (`import type`) |
106
+ | `raw` | Each import statement |
107
+
108
+ ```sh
109
+ node packages/mark/dist/cli.js lib importCycles packages/web/src
110
+ ```
111
+
112
+ - For Angular, give `diDecorators` the value of `ANGULAR_DI_DECORATORS`. The class of such a decorator keeps the types of its constructor parameters at runtime.
113
+ - The default `exclude` leaves out `node_modules`, the declarations and the tests.
114
+ - `limits` keeps a call small: `maxFiles` (default 20000) refuses a folder with more files before a read, and `maxFileBytes` (default 1 MiB) skips a larger file. The result lists each skipped file in `skipped`.
115
+ - The defaults are the ceiling. A caller can give lower limits, and the input refuses a higher value.
116
+ - An abort of the call stops the reads and the analysis.
117
+ - `importCycles(sources, options)` and `importGraph(sources, options)` take the sources as text, for a caller that reads its own files.
118
+ - `findCycles` keeps its own stack, so a long chain of imports does not overflow the call stack.
119
+
97
120
  ## `ecosystem.procedures`
98
121
 
99
122
  Input: `rootPath`, `namespace` and `includeMetadata`. The output lists the procedures of the packages that have a `client.procedures` field.