@osdlc/wayfinder 0.11.5 → 0.12.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 +28 -0
- package/README.md +18 -3
- package/bin/way.js +4 -17
- package/dist/cli.d.ts +23 -10
- package/dist/cli.js +33 -32
- package/dist/devlink.d.ts +0 -5
- package/dist/devlink.js +0 -11
- package/dist/document-schemas.generated.js +18 -42
- package/dist/terminal-text.d.ts +8 -6
- package/dist/terminal-text.js +6 -15
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/dist/web/main.js +9 -9
- package/package.json +5 -5
- package/schema/config.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @osdlc/wayfinder
|
|
2
2
|
|
|
3
|
+
## 0.12.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9948d90: In a project that has this tool in its `node_modules`, the global command now runs the project's copy, unless a `dev link` or `<NAME>_HOME` checkout is set. Set `<NAME>_PROJECT=0` to keep the global copy.
|
|
8
|
+
- 79407f5: Depend on `zod` `^4.6.6` instead of exactly `4.4.3`. 4.4.3 is covered by GHSA-mrhx-c7xc-m3w5 (memory exhaustion validating an oversized constrained collection; fixed in 4.6.6), and the exact pin made a consumer that already had a fixed `zod` install a second, vulnerable copy.
|
|
9
|
+
- Updated dependencies [9948d90]
|
|
10
|
+
- @osdlc/cli-tool@0.14.0
|
|
11
|
+
|
|
12
|
+
## 0.12.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- dd2265e: `way` now runs through `@osdlc/cli-tool`'s `runMain`, as the other osdlc CLIs do, and answers `way --where`: the file that is running, the checkout or install it belongs to, and which devlink layer chose it. `way --where --json` prints the same facts as one object. `bin/way.js` and a checkout's `src/cli.ts` both call the new `runWay()`, so a handed-off checkout answers the same way.
|
|
17
|
+
|
|
18
|
+
Behaviour changes:
|
|
19
|
+
|
|
20
|
+
- `way dev …` is answered by the `way` you ran, not handed off to the linked checkout first. So `way dev off` and `way dev use` work even when the linked checkout is broken. Run a checkout's own `dev` (`node bin/way.js dev install` in it, as before) for verbs that need that checkout as `self`.
|
|
21
|
+
- `way dev …` is answered by cli-tool's devlink hook, as every other tool's `dev` is, so `dev` must be the first word. Flags before it are no longer accepted: write `way dev status --json`, not `way --json dev status`.
|
|
22
|
+
- An error no command caught, when it is a classified failure (such as a missing tool), now exits with that failure's code instead of always 1. It is still terminal-safe on stderr.
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- 14d4351: `runMain` no longer crashes on an unhandled `EPIPE` when the reader of stdout or stderr goes away (`tool --json | head -1`): the rest of the output is dropped, `main` runs to its end, and the exit code is `main`'s, so a tool is never stopped between two steps. The guard is exported as `quietOnBrokenPipe(stream, exit)`, where an exit function ends a read-only run at once; wayfinder now uses it in place of its own copy.
|
|
27
|
+
- Updated dependencies [14d4351]
|
|
28
|
+
- Updated dependencies [dd2265e]
|
|
29
|
+
- @osdlc/cli-tool@0.13.0
|
|
30
|
+
|
|
3
31
|
## 0.11.5
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -39,7 +39,8 @@ An installed `way` can run the source of a checkout instead, through
|
|
|
39
39
|
[`@osdlc/cli-tool/devlink`](https://www.npmjs.com/package/@osdlc/cli-tool).
|
|
40
40
|
`way dev link` makes one checkout the one every `way` on the machine runs, and
|
|
41
41
|
`WAY_HOME` names one for a shell. Every link is remembered. `way dev` is a
|
|
42
|
-
contributor tool, so `way --help` does not list it.
|
|
42
|
+
contributor tool, so `way --help` does not list it. `dev` must be the first
|
|
43
|
+
word: put its flags after it, as in `way dev status --json`.
|
|
43
44
|
|
|
44
45
|
```sh
|
|
45
46
|
way dev install # once: put shims for this checkout on PATH as way and wayfinder
|
|
@@ -48,13 +49,26 @@ way dev history # every checkout ever linked, most recent first, with b
|
|
|
48
49
|
way dev use '#2' # back to an earlier one …
|
|
49
50
|
way dev use canonical # … or to the install itself
|
|
50
51
|
way dev status # which checkout runs now, and why
|
|
52
|
+
way --where # ask the running process: its file, and the layer that chose it
|
|
51
53
|
```
|
|
52
54
|
|
|
53
55
|
The first match wins, in this order: `WAY_HOME`, the linked checkout, then the
|
|
54
56
|
install. `way` never picks a checkout from the cwd, so a repository you run it
|
|
55
57
|
in cannot choose the code that runs. A checkout must hold `src/cli.ts` and a
|
|
56
58
|
`package.json` named `@osdlc/wayfinder`; anything else is skipped. The shim
|
|
57
|
-
prints which one it chose on stderr, and `WAY_QUIET=1` silences it.
|
|
59
|
+
prints which one it chose on stderr, and `WAY_QUIET=1` silences it.
|
|
60
|
+
`way --where` is handed on like any other argument, so the process that
|
|
61
|
+
answers is the one that runs:
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
$ WAY_HOME=~/src/osdlc/packages/ts/wayfinder way --where
|
|
65
|
+
way: running /home/me/src/osdlc/packages/ts/wayfinder/src/cli.ts (WAY_HOME)
|
|
66
|
+
way 0.11.5
|
|
67
|
+
file /home/me/src/osdlc/packages/ts/wayfinder/src/cli.ts
|
|
68
|
+
from checkout /home/me/src/osdlc/packages/ts/wayfinder
|
|
69
|
+
chosen by env ($WAY_HOME)
|
|
70
|
+
```
|
|
71
|
+
State
|
|
58
72
|
is kept in `${XDG_CONFIG_HOME:-~/.config}/way` on Linux and macOS and
|
|
59
73
|
`%APPDATA%\way` on Windows, or under `$WAYFINDER_ROOT/config/way` when that
|
|
60
74
|
is set. `way clean --dev` removes it,
|
|
@@ -476,6 +490,7 @@ way config | trust | clean | guide
|
|
|
476
490
|
way help [command] help for a command; --all for every flag
|
|
477
491
|
way schema <command> the JSON Schema of a command's --json document
|
|
478
492
|
way --version
|
|
493
|
+
way --where the file that answers, and which devlink layer chose it; --json for one object
|
|
479
494
|
```
|
|
480
495
|
|
|
481
496
|
`run` takes a task's `id` or its command line, when only one task has it, such
|
|
@@ -587,7 +602,7 @@ repository:
|
|
|
587
602
|
| `providers` | yes | a trusted project file can add tools when execution is allowed |
|
|
588
603
|
| `clean` | accepted, unused | resolves every path from the environment and the home directory |
|
|
589
604
|
| `guide` | accepted, unused | its argument is a topic name |
|
|
590
|
-
| `dev` | no | its state is devlink's, keyed on the tool name;
|
|
605
|
+
| `dev` | no | its state is devlink's, keyed on the tool name; it takes no global flags, and none before it |
|
|
591
606
|
|
|
592
607
|
`way help` lists the commands and the global flags. `way help <command>` and
|
|
593
608
|
`way <command> --help` show one command, and `--all` adds every note. `way
|
package/bin/way.js
CHANGED
|
@@ -3,21 +3,8 @@
|
|
|
3
3
|
// checkout should answer: the one `WAY_HOME` names, or the one `way dev link`
|
|
4
4
|
// linked. A checkout other than this one runs there instead. The cwd is never
|
|
5
5
|
// searched, so a repository you stand in cannot choose the code that runs.
|
|
6
|
-
//
|
|
7
|
-
|
|
6
|
+
// `runWay` does this through cli-tool's `runMain`, which also answers
|
|
7
|
+
// `--version` and `--where`. Requires the built dist/ (`pnpm run build`).
|
|
8
|
+
import { runWay } from '../dist/cli.js'
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
import { WAYFINDER_SPEC, checkoutRoot } from '../dist/devlink.js'
|
|
11
|
-
import { guardedExit, terminalSafe } from '../dist/terminal-text.js'
|
|
12
|
-
|
|
13
|
-
const argv = process.argv.slice(2)
|
|
14
|
-
// An error nothing caught is printed terminal-safe, not raw by Node.
|
|
15
|
-
process.exitCode = await guardedExit(() => {
|
|
16
|
-
const handedOff = execSelection(
|
|
17
|
-
WAYFINDER_SPEC,
|
|
18
|
-
resolve(WAYFINDER_SPEC, { self: checkoutRoot() }),
|
|
19
|
-
argv,
|
|
20
|
-
{ announce: (line) => process.stderr.write(`${terminalSafe(line)}\n`) },
|
|
21
|
-
)
|
|
22
|
-
return handedOff ?? main(argv)
|
|
23
|
-
})
|
|
10
|
+
await runWay()
|
package/dist/cli.d.ts
CHANGED
|
@@ -2,23 +2,18 @@
|
|
|
2
2
|
* `way`: browse and run every task in a repository.
|
|
3
3
|
*
|
|
4
4
|
* The commands are a `@osdlc/cli-tool` command tree (`commands/index.ts`).
|
|
5
|
-
* This module is the entry point
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* This module is the entry point. {@link runWay} runs {@link main} through
|
|
6
|
+
* cli-tool's `runMain`, whose devlink hook answers `dev` and hands off to a
|
|
7
|
+
* linked checkout, and which answers `--version` and `--where`. `main` maps
|
|
8
|
+
* the old surface flags onto commands and hands the rest to the tree.
|
|
8
9
|
*
|
|
9
10
|
* wayfinder's `allowExec` default is `true`. You usually run it in your own
|
|
10
11
|
* repository, and a task browser that cannot see the build graph is of little
|
|
11
12
|
* use. `--no-exec` turns execution off. The default alone does not allow
|
|
12
13
|
* execution: the repository must also be trusted (see `core/session.ts`).
|
|
13
14
|
*/
|
|
14
|
-
import { type CliIo } from '@osdlc/cli-tool';
|
|
15
|
+
import { type CliContext, type CliIo } from '@osdlc/cli-tool';
|
|
15
16
|
import type { GuideTool } from './guide.ts';
|
|
16
|
-
/**
|
|
17
|
-
* Exit quietly when the reader of `stream` goes away, as `way list --json |
|
|
18
|
-
* head -1` does: the rest of the output has nowhere to go, which is not an
|
|
19
|
-
* error. Any other write error is thrown as before.
|
|
20
|
-
*/
|
|
21
|
-
export declare function quietOnBrokenPipe(stream: Pick<NodeJS.WriteStream, 'on'>, exit?: (code: number) => void): void;
|
|
22
17
|
/** What the `guide` command needs: the complete help, and what it cannot say. */
|
|
23
18
|
export declare const GUIDE_TOOL: GuideTool;
|
|
24
19
|
/**
|
|
@@ -40,3 +35,21 @@ export declare function rewriteAliases(argv: readonly string[], commandWords: re
|
|
|
40
35
|
* config, cache or trust store. `io` defaults to the real process streams.
|
|
41
36
|
*/
|
|
42
37
|
export declare function main(argv: string[], env?: Record<string, string | undefined>, home?: string, io?: CliIo): Promise<number>;
|
|
38
|
+
/**
|
|
39
|
+
* What {@link runWay} takes in place of the process's own: the arguments, the
|
|
40
|
+
* context, the home directory and the running script. A test passes them.
|
|
41
|
+
*/
|
|
42
|
+
export interface RunWayOptions {
|
|
43
|
+
argv?: readonly string[];
|
|
44
|
+
/** With a context, `main` writes to its `io`. */
|
|
45
|
+
context?: CliContext;
|
|
46
|
+
home?: string;
|
|
47
|
+
script?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Run `way` as a process and set its exit code, through `runMain`. The devlink
|
|
51
|
+
* hook answers `dev` and hands off to the checkout `WAY_HOME` or `way dev link`
|
|
52
|
+
* names, and `runMain` answers `--version` and `--where`, then runs
|
|
53
|
+
* {@link main}. What they print themselves is made terminal-safe here.
|
|
54
|
+
*/
|
|
55
|
+
export declare function runWay(options?: RunWayOptions): Promise<void>;
|
package/dist/cli.js
CHANGED
|
@@ -2,38 +2,28 @@
|
|
|
2
2
|
* `way`: browse and run every task in a repository.
|
|
3
3
|
*
|
|
4
4
|
* The commands are a `@osdlc/cli-tool` command tree (`commands/index.ts`).
|
|
5
|
-
* This module is the entry point
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* This module is the entry point. {@link runWay} runs {@link main} through
|
|
6
|
+
* cli-tool's `runMain`, whose devlink hook answers `dev` and hands off to a
|
|
7
|
+
* linked checkout, and which answers `--version` and `--where`. `main` maps
|
|
8
|
+
* the old surface flags onto commands and hands the rest to the tree.
|
|
8
9
|
*
|
|
9
10
|
* wayfinder's `allowExec` default is `true`. You usually run it in your own
|
|
10
11
|
* repository, and a task browser that cannot see the build graph is of little
|
|
11
12
|
* use. `--no-exec` turns execution off. The default alone does not allow
|
|
12
13
|
* execution: the repository must also be trusted (see `core/session.ts`).
|
|
13
14
|
*/
|
|
14
|
-
import { EXIT, processContext, processIo } from '@osdlc/cli-tool';
|
|
15
|
+
import { EXIT, processContext, processIo, quietOnBrokenPipe, runMain, } from '@osdlc/cli-tool';
|
|
15
16
|
import { errorDocument } from '@osdlc/cli-tool/command';
|
|
16
|
-
import {
|
|
17
|
+
import { devlinkHook } from '@osdlc/cli-tool/devlink';
|
|
17
18
|
import { installGroupSignalForwarding } from '@osdlc/command-seam';
|
|
18
19
|
import { homeDir } from '@osdlc/trust-repo';
|
|
19
20
|
import { APP, BIN } from "./app.js";
|
|
20
21
|
import { createWayApp } from "./commands/index.js";
|
|
21
22
|
import { GLOBALS } from "./commands/shared.js";
|
|
22
|
-
import { WAYFINDER_SPEC
|
|
23
|
+
import { WAYFINDER_SPEC } from "./devlink.js";
|
|
23
24
|
import { flushWrites } from "./core/writes.js";
|
|
24
|
-
import { safeJsonStdout, safeStderr
|
|
25
|
-
|
|
26
|
-
* Exit quietly when the reader of `stream` goes away, as `way list --json |
|
|
27
|
-
* head -1` does: the rest of the output has nowhere to go, which is not an
|
|
28
|
-
* error. Any other write error is thrown as before.
|
|
29
|
-
*/
|
|
30
|
-
export function quietOnBrokenPipe(stream, exit = (code) => process.exit(code)) {
|
|
31
|
-
stream.on('error', (err) => {
|
|
32
|
-
if (err.code !== 'EPIPE')
|
|
33
|
-
throw err;
|
|
34
|
-
exit(0);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
25
|
+
import { safeIo, safeJsonStdout, safeStderr } from "./terminal-text.js";
|
|
26
|
+
import { VERSION } from "./version.generated.js";
|
|
37
27
|
/**
|
|
38
28
|
* Refuse a command line before the tree runs: a line on stderr, and with
|
|
39
29
|
* `--json` before any `--` the error document on stdout, as the tree does.
|
|
@@ -151,18 +141,6 @@ export async function main(argv, env = process.env, home = homeDir(), io = proce
|
|
|
151
141
|
// Every stderr line is human text that can quote repository content.
|
|
152
142
|
io = safeStderr(io);
|
|
153
143
|
const cwd = process.cwd();
|
|
154
|
-
// `dev` is a contributor tool that parses its own arguments, so help does
|
|
155
|
-
// not list it. `self` is this checkout, so `dev install` and a bare
|
|
156
|
-
// `dev link` know what to point at. Global flags before the word move after it.
|
|
157
|
-
const at = commandWordIndex(argv);
|
|
158
|
-
if (at !== -1 && argv[at] === 'dev') {
|
|
159
|
-
const rest = [...argv.slice(at + 1), ...argv.slice(0, at)];
|
|
160
|
-
return runDevCli(WAYFINDER_SPEC, rest, {
|
|
161
|
-
io: rest.includes('--json') ? safeJsonStdout(io) : safeStdout(io),
|
|
162
|
-
env,
|
|
163
|
-
self: checkoutRoot(),
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
144
|
const { app, words } = createWayApp({ home, guide: () => GUIDE_TOOL });
|
|
167
145
|
const aliased = rewriteAliases(argv, words);
|
|
168
146
|
if ('error' in aliased)
|
|
@@ -183,8 +161,31 @@ export async function main(argv, env = process.env, home = homeDir(), io = proce
|
|
|
183
161
|
await flushWrites();
|
|
184
162
|
return code;
|
|
185
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* Run `way` as a process and set its exit code, through `runMain`. The devlink
|
|
166
|
+
* hook answers `dev` and hands off to the checkout `WAY_HOME` or `way dev link`
|
|
167
|
+
* names, and `runMain` answers `--version` and `--where`, then runs
|
|
168
|
+
* {@link main}. What they print themselves is made terminal-safe here.
|
|
169
|
+
*/
|
|
170
|
+
export async function runWay(options = {}) {
|
|
171
|
+
const argv = options.argv ?? process.argv.slice(2);
|
|
172
|
+
const script = options.script === undefined ? {} : { script: options.script };
|
|
173
|
+
const base = options.context ?? processContext();
|
|
174
|
+
const head = argv.includes('--') ? argv.slice(0, argv.indexOf('--')) : argv;
|
|
175
|
+
await runMain(
|
|
176
|
+
// `main` makes its own output safe. It takes the process's streams as they
|
|
177
|
+
// are, since it installs signal and broken-pipe handling only for those.
|
|
178
|
+
(words, ctx) => main([...words], ctx.env, options.home, options.context?.io ?? processIo), {
|
|
179
|
+
name: BIN,
|
|
180
|
+
version: VERSION,
|
|
181
|
+
context: { ...base, io: safeIo(base.io, { json: head.includes('--json') }) },
|
|
182
|
+
argv,
|
|
183
|
+
devlink: devlinkHook(WAYFINDER_SPEC, script),
|
|
184
|
+
...script,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
186
187
|
// Runs when executed directly (devlink runs a checkout's `src/cli.ts` under
|
|
187
188
|
// Bun); inert when imported by the bin.
|
|
188
189
|
if (import.meta.main) {
|
|
189
|
-
|
|
190
|
+
await runWay();
|
|
190
191
|
}
|
package/dist/devlink.d.ts
CHANGED
|
@@ -14,8 +14,3 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { type ToolSpec } from '@osdlc/cli-tool/devlink';
|
|
16
16
|
export declare const WAYFINDER_SPEC: ToolSpec;
|
|
17
|
-
/**
|
|
18
|
-
* The checkout this module runs from, or null for an installed package.
|
|
19
|
-
* `src/` and `dist/` are both one level below the package root.
|
|
20
|
-
*/
|
|
21
|
-
export declare function checkoutRoot(): string | null;
|
package/dist/devlink.js
CHANGED
|
@@ -12,9 +12,6 @@
|
|
|
12
12
|
* The link state is `<config>/way/` under the `xdg` convention, moved by the
|
|
13
13
|
* same `WAYFINDER_ROOT` and `WAYFINDER_CONFIG_DIR` as wayfinder's other files.
|
|
14
14
|
*/
|
|
15
|
-
import { existsSync } from 'node:fs';
|
|
16
|
-
import { resolve } from 'node:path';
|
|
17
|
-
import { fileURLToPath } from 'node:url';
|
|
18
15
|
import { validateSpec } from '@osdlc/cli-tool/devlink';
|
|
19
16
|
import { APP, BIN } from "./app.js";
|
|
20
17
|
import { DIR_ENV_VARS } from "./xdg.js";
|
|
@@ -28,11 +25,3 @@ export const WAYFINDER_SPEC = validateSpec({
|
|
|
28
25
|
aliases: [APP],
|
|
29
26
|
vendorDirs: { vendor: APP, envVars: DIR_ENV_VARS },
|
|
30
27
|
});
|
|
31
|
-
/**
|
|
32
|
-
* The checkout this module runs from, or null for an installed package.
|
|
33
|
-
* `src/` and `dist/` are both one level below the package root.
|
|
34
|
-
*/
|
|
35
|
-
export function checkoutRoot() {
|
|
36
|
-
const root = resolve(fileURLToPath(import.meta.url), '..', '..');
|
|
37
|
-
return existsSync(resolve(root, MARKER)) ? root : null;
|
|
38
|
-
}
|
|
@@ -68,13 +68,9 @@ export const GENERATED_SCHEMAS = {
|
|
|
68
68
|
"type": "boolean"
|
|
69
69
|
},
|
|
70
70
|
"envVar": {
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"type": "null"
|
|
77
|
-
}
|
|
71
|
+
"type": [
|
|
72
|
+
"string",
|
|
73
|
+
"null"
|
|
78
74
|
]
|
|
79
75
|
}
|
|
80
76
|
},
|
|
@@ -216,13 +212,9 @@ export const GENERATED_SCHEMAS = {
|
|
|
216
212
|
"type": "boolean"
|
|
217
213
|
},
|
|
218
214
|
"envVar": {
|
|
219
|
-
"
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
"type": "null"
|
|
225
|
-
}
|
|
215
|
+
"type": [
|
|
216
|
+
"string",
|
|
217
|
+
"null"
|
|
226
218
|
]
|
|
227
219
|
}
|
|
228
220
|
},
|
|
@@ -257,13 +249,9 @@ export const GENERATED_SCHEMAS = {
|
|
|
257
249
|
},
|
|
258
250
|
"value": {},
|
|
259
251
|
"source": {
|
|
260
|
-
"
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
"type": "null"
|
|
266
|
-
}
|
|
252
|
+
"type": [
|
|
253
|
+
"string",
|
|
254
|
+
"null"
|
|
267
255
|
]
|
|
268
256
|
},
|
|
269
257
|
"reason": {
|
|
@@ -352,13 +340,9 @@ export const GENERATED_SCHEMAS = {
|
|
|
352
340
|
"type": "boolean"
|
|
353
341
|
},
|
|
354
342
|
"by": {
|
|
355
|
-
"
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
},
|
|
359
|
-
{
|
|
360
|
-
"type": "null"
|
|
361
|
-
}
|
|
343
|
+
"type": [
|
|
344
|
+
"string",
|
|
345
|
+
"null"
|
|
362
346
|
]
|
|
363
347
|
},
|
|
364
348
|
"rule": {
|
|
@@ -397,13 +381,9 @@ export const GENERATED_SCHEMAS = {
|
|
|
397
381
|
"const": "guide"
|
|
398
382
|
},
|
|
399
383
|
"topic": {
|
|
400
|
-
"
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
},
|
|
404
|
-
{
|
|
405
|
-
"type": "null"
|
|
406
|
-
}
|
|
384
|
+
"type": [
|
|
385
|
+
"string",
|
|
386
|
+
"null"
|
|
407
387
|
]
|
|
408
388
|
},
|
|
409
389
|
"topics": {
|
|
@@ -483,13 +463,9 @@ export const GENERATED_SCHEMAS = {
|
|
|
483
463
|
"type": "string"
|
|
484
464
|
},
|
|
485
465
|
"bytes": {
|
|
486
|
-
"
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
},
|
|
490
|
-
{
|
|
491
|
-
"type": "null"
|
|
492
|
-
}
|
|
466
|
+
"type": [
|
|
467
|
+
"number",
|
|
468
|
+
"null"
|
|
493
469
|
]
|
|
494
470
|
},
|
|
495
471
|
"removed": {
|
package/dist/terminal-text.d.ts
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* at the wrong characters, and a person would not see that the name held
|
|
21
21
|
* anything. The set of control characters is ux's own, from `controlPattern`.
|
|
22
22
|
*/
|
|
23
|
-
import {
|
|
23
|
+
import type { CliIo } from '@osdlc/cli-tool';
|
|
24
24
|
/**
|
|
25
25
|
* `text` with every C0 control character (ESC included), DEL, C1 control
|
|
26
26
|
* character and bidi control replaced by U+FFFD. With `multiline`, tab and
|
|
@@ -57,9 +57,11 @@ export declare function safeJsonStdout(io: CliIo): CliIo;
|
|
|
57
57
|
*/
|
|
58
58
|
export declare function safeStderr(io: CliIo): CliIo;
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
61
|
-
* `
|
|
62
|
-
*
|
|
63
|
-
*
|
|
60
|
+
* `io` with both streams made terminal-safe: stdout through
|
|
61
|
+
* {@link safeJsonStdout} with `json`, else {@link safeStdout}, and stderr
|
|
62
|
+
* through {@link safeStderr}. For output wayfinder does not write itself,
|
|
63
|
+
* such as `runMain`'s `--where` and `way dev`.
|
|
64
64
|
*/
|
|
65
|
-
export declare function
|
|
65
|
+
export declare function safeIo(io: CliIo, opts: {
|
|
66
|
+
json: boolean;
|
|
67
|
+
}): CliIo;
|
package/dist/terminal-text.js
CHANGED
|
@@ -20,9 +20,7 @@
|
|
|
20
20
|
* at the wrong characters, and a person would not see that the name held
|
|
21
21
|
* anything. The set of control characters is ux's own, from `controlPattern`.
|
|
22
22
|
*/
|
|
23
|
-
import { EXIT } from '@osdlc/cli-tool';
|
|
24
23
|
import { controlPattern } from '@osdlc/ux';
|
|
25
|
-
import { BIN } from "./app.js";
|
|
26
24
|
/**
|
|
27
25
|
* C0 (tab and newline included), DEL, C1, and the bidi controls: the marks
|
|
28
26
|
* U+061C, U+200E and U+200F, and U+202A-202E and U+2066-2069.
|
|
@@ -92,18 +90,11 @@ export function safeStderr(io) {
|
|
|
92
90
|
return { ...io, stderr: (text) => io.stderr(terminalSafe(text, { multiline: true })) };
|
|
93
91
|
}
|
|
94
92
|
/**
|
|
95
|
-
*
|
|
96
|
-
* `
|
|
97
|
-
*
|
|
98
|
-
*
|
|
93
|
+
* `io` with both streams made terminal-safe: stdout through
|
|
94
|
+
* {@link safeJsonStdout} with `json`, else {@link safeStdout}, and stderr
|
|
95
|
+
* through {@link safeStderr}. For output wayfinder does not write itself,
|
|
96
|
+
* such as `runMain`'s `--where` and `way dev`.
|
|
99
97
|
*/
|
|
100
|
-
export
|
|
101
|
-
|
|
102
|
-
return await run();
|
|
103
|
-
}
|
|
104
|
-
catch (err) {
|
|
105
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
106
|
-
stderr(`${BIN}: ${terminalSafe(message)}\n`);
|
|
107
|
-
return EXIT.error;
|
|
108
|
-
}
|
|
98
|
+
export function safeIo(io, opts) {
|
|
99
|
+
return safeStderr(opts.json ? safeJsonStdout(io) : safeStdout(io));
|
|
109
100
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** This package's version, from its package.json when it was built. */
|
|
2
|
-
export declare const VERSION = "0.
|
|
2
|
+
export declare const VERSION = "0.12.1";
|
package/dist/web/main.js
CHANGED
|
@@ -450,15 +450,6 @@ function controlPattern(options = {}) {
|
|
|
450
450
|
return new RegExp(`[${c0Class(options)}\\u007f-\\u009f${BIDI}]`, "g");
|
|
451
451
|
}
|
|
452
452
|
//#endregion
|
|
453
|
-
//#region src/app.ts
|
|
454
|
-
/**
|
|
455
|
-
* The app's names. Every user-facing name that carries the product name
|
|
456
|
-
* derives from here. Browser-safe: the page imports it too.
|
|
457
|
-
*/
|
|
458
|
-
/** The product name: config directory, cache directory and trust store key. Messages start with {@link BIN}. */
|
|
459
|
-
const APP = "wayfinder";
|
|
460
|
-
`${APP.toUpperCase()}`;
|
|
461
|
-
//#endregion
|
|
462
453
|
//#region src/terminal-text.ts
|
|
463
454
|
/**
|
|
464
455
|
* C0 (tab and newline included), DEL, C1, and the bidi controls: the marks
|
|
@@ -629,6 +620,15 @@ function groupOf(runner) {
|
|
|
629
620
|
return GROUPS.find((g) => g.runner === runner) ?? GROUPS[0];
|
|
630
621
|
}
|
|
631
622
|
//#endregion
|
|
623
|
+
//#region src/app.ts
|
|
624
|
+
/**
|
|
625
|
+
* The app's names. Every user-facing name that carries the product name
|
|
626
|
+
* derives from here. Browser-safe: the page imports it too.
|
|
627
|
+
*/
|
|
628
|
+
/** The product name: config directory, cache directory and trust store key. Messages start with {@link BIN}. */
|
|
629
|
+
const APP = "wayfinder";
|
|
630
|
+
`${APP.toUpperCase()}`;
|
|
631
|
+
//#endregion
|
|
632
632
|
//#region src/vocabulary.ts
|
|
633
633
|
/**
|
|
634
634
|
* The words every surface shows a person: the noun for a row, the name of a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdlc/wayfinder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "Browse and run every task in a repository from one list: a terminal UI where Enter runs the selected task, a live web view, and JSON for scripts. Tasks, installs, tool trust and git hooks come from @osdlc/system-model.",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"author": "sksizer",
|
|
@@ -54,9 +54,8 @@
|
|
|
54
54
|
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"zod": "4.
|
|
58
|
-
"@osdlc/cli-tool": "^0.
|
|
59
|
-
"@osdlc/command-seam": "^0.14.0",
|
|
57
|
+
"zod": "^4.6.6",
|
|
58
|
+
"@osdlc/cli-tool": "^0.14.0",
|
|
60
59
|
"@osdlc/config-layers": "^0.8.0",
|
|
61
60
|
"@osdlc/detect-harness": "^0.7.0",
|
|
62
61
|
"@osdlc/etag-write": "^0.3.0",
|
|
@@ -65,7 +64,8 @@
|
|
|
65
64
|
"@osdlc/tiered-dirs": "^0.5.0",
|
|
66
65
|
"@osdlc/trust-repo": "^0.5.3",
|
|
67
66
|
"@osdlc/typed-git": "^0.12.0",
|
|
68
|
-
"@osdlc/ux": "^0.1.1"
|
|
67
|
+
"@osdlc/ux": "^0.1.1",
|
|
68
|
+
"@osdlc/command-seam": "^0.14.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/node": "^26.1.0",
|
package/schema/config.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://unpkg.com/@osdlc/wayfinder@0.
|
|
3
|
+
"$id": "https://unpkg.com/@osdlc/wayfinder@0.12/schema/config.json",
|
|
4
4
|
"title": "wayfinder configuration",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|