reposets 1.0.21 → 2.0.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/README.md +1 -1
- package/bin/reposets.js +73 -24
- package/cli/commands/credentials.js +28 -42
- package/cli/commands/doctor.js +45 -38
- package/cli/commands/drift.js +1 -1
- package/cli/commands/history.js +21 -34
- package/cli/commands/init.js +20 -10
- package/cli/commands/list.js +12 -10
- package/cli/commands/nuke.js +19 -22
- package/cli/commands/sync.js +13 -41
- package/cli/commands/validate.js +22 -19
- package/cli/flags.js +1 -1
- package/package.json +10 -9
- package/services/CredentialResolver.js +20 -8
- package/services/Invocation.js +38 -0
- package/services/OnePasswordClient.js +20 -8
- package/services/SyncLogger.js +10 -5
- package/tsdoc-metadata.json +1 -1
- package/cli/logger.js +0 -48
- package/lib/schema-issues.js +0 -50
package/lib/schema-issues.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { SchemaIssue } from "effect";
|
|
2
|
-
|
|
3
|
-
//#region src/lib/schema-issues.ts
|
|
4
|
-
/**
|
|
5
|
-
* Core's structured formatter: one entry per leaf, each with its property path.
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* Built once. It is a pure function of the issue tree, and `Formatter` carries
|
|
9
|
-
* no state.
|
|
10
|
-
*/
|
|
11
|
-
const formatter = SchemaIssue.makeFormatterStandardSchemaV1({ leafHook: (issue) => issue._tag === "UnexpectedKey" ? "unknown key" : SchemaIssue.defaultLeafHook(issue) });
|
|
12
|
-
/**
|
|
13
|
-
* Render a `ConfigValidationError`'s `issue` as one line per rejected value.
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* **No walker of our own.** Core already ships one:
|
|
17
|
-
* `SchemaIssue.makeFormatterStandardSchemaV1()` flattens the tree to
|
|
18
|
-
* `{ message, path }` entries, which is exactly the shape this needs.
|
|
19
|
-
* `defaultLeafHook` handles every leaf variant — `UnexpectedKey`,
|
|
20
|
-
* `InvalidType`, `MissingKey`, `Forbidden`, `OneOf` — so a wrong *type* renders
|
|
21
|
-
* as sensibly as an unknown key, and a variant added upstream is covered
|
|
22
|
-
* without a change here. Hand-rolling this against the excess-property shape
|
|
23
|
-
* alone would have got every other cause wrong.
|
|
24
|
-
*
|
|
25
|
-
* `issue` is declared `Schema.Defect`, so it arrives as `unknown`; the
|
|
26
|
-
* `isIssue` guard is what makes reading it safe. Anything that is not an issue
|
|
27
|
-
* tree yields no lines rather than a crash — a rendering helper on an error
|
|
28
|
-
* path must never become the reason a command dies.
|
|
29
|
-
*
|
|
30
|
-
* Nodes are never stringified. Each carries the entire AST inline, annotations
|
|
31
|
-
* included, so `String(node)` would dump the schema rather than describe the
|
|
32
|
-
* failure. Only `message` and `path` are read.
|
|
33
|
-
*
|
|
34
|
-
* @param issue - the `issue` field of a `ConfigValidationError`, or any value
|
|
35
|
-
* @returns one line per rejected value, deepest path last; empty if `issue` is
|
|
36
|
-
* not an issue tree
|
|
37
|
-
*
|
|
38
|
-
* @public
|
|
39
|
-
*/
|
|
40
|
-
const formatSchemaIssue = (issue) => {
|
|
41
|
-
if (!SchemaIssue.isIssue(issue)) return [];
|
|
42
|
-
const lines = formatter(issue).issues.map((entry) => {
|
|
43
|
-
const path = (entry.path ?? []).map(String).join(".");
|
|
44
|
-
return path === "" ? entry.message : `${entry.message} at ${path}`;
|
|
45
|
-
});
|
|
46
|
-
return [...new Set(lines)];
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
//#endregion
|
|
50
|
-
export { formatSchemaIssue };
|