@wringer/gunshi 0.3.0 → 0.3.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.
- package/dist/{build-guide-ports.d.ts → guide-command/build-guide-ports.d.ts} +1 -1
- package/dist/{pick-cli-outcome.d.ts → invocation/pick-cli-outcome.d.ts} +2 -2
- package/dist/{pick-dispatch-plan.d.ts → invocation/pick-dispatch-plan.d.ts} +1 -1
- package/dist/read-guide.d.ts +1 -1
- package/dist/resolve-lint-failures.d.ts +1 -1
- package/guide/create.md +9 -7
- package/guide/overview.md +6 -6
- package/guide/template/verify/SKILL.md +15 -14
- package/guide/template/verify.ts +1 -1
- package/package.json +4 -4
- package/src/build-cli-wringer.ts +2 -2
- package/src/{build-guide-command.ts → guide-command/build-guide-command.ts} +1 -1
- package/src/{build-guide-ports.ts → guide-command/build-guide-ports.ts} +1 -1
- package/src/{pick-cli-outcome.ts → invocation/pick-cli-outcome.ts} +4 -4
- package/src/{pick-dispatch-plan.ts → invocation/pick-dispatch-plan.ts} +2 -2
- package/src/{resolve-invocation.ts → invocation/resolve-invocation.ts} +2 -2
- package/src/{build-lint-command.ts → lint-command/build-lint-command.ts} +1 -1
- package/src/{read-template-hash.ts → lint-command/read-template-hash.ts} +1 -1
- package/src/{resolve-journey-problem.ts → lint-command/resolve-journey-problem.ts} +2 -2
- package/src/read-guide.ts +3 -3
- package/src/resolve-lint-failures.ts +12 -9
- package/src/run-cli.ts +9 -9
- package/src/wringer-gunshi.ts +2 -2
- /package/dist/{build-guide-command.d.ts → guide-command/build-guide-command.d.ts} +0 -0
- /package/dist/{build-guide-wringer.d.ts → guide-command/build-guide-wringer.d.ts} +0 -0
- /package/dist/{parse-guide-topic.d.ts → guide-command/parse-guide-topic.d.ts} +0 -0
- /package/dist/{pick-guide-data.d.ts → guide-command/pick-guide-data.d.ts} +0 -0
- /package/dist/{build-gunshi-args.d.ts → gunshi-commands/build-gunshi-args.d.ts} +0 -0
- /package/dist/{build-gunshi-commands.d.ts → gunshi-commands/build-gunshi-commands.d.ts} +0 -0
- /package/dist/{build-positional-args.d.ts → gunshi-commands/build-positional-args.d.ts} +0 -0
- /package/dist/{build-raw-args.d.ts → gunshi-commands/build-raw-args.d.ts} +0 -0
- /package/dist/{collect-boolean-flags-with-value.d.ts → gunshi-commands/collect-boolean-flags-with-value.d.ts} +0 -0
- /package/dist/{collect-flags-without-value.d.ts → gunshi-commands/collect-flags-without-value.d.ts} +0 -0
- /package/dist/{keep-flag-text.d.ts → gunshi-commands/keep-flag-text.d.ts} +0 -0
- /package/dist/{parse-arg-properties.d.ts → gunshi-commands/parse-arg-properties.d.ts} +0 -0
- /package/dist/{find-signed-value-flag.d.ts → invocation/find-signed-value-flag.d.ts} +0 -0
- /package/dist/{pick-command-name.d.ts → invocation/pick-command-name.d.ts} +0 -0
- /package/dist/{resolve-invocation.d.ts → invocation/resolve-invocation.d.ts} +0 -0
- /package/dist/{scrub-parsed-invocation.d.ts → invocation/scrub-parsed-invocation.d.ts} +0 -0
- /package/dist/{build-lint-command.d.ts → lint-command/build-lint-command.d.ts} +0 -0
- /package/dist/{check-feature-file.d.ts → lint-command/check-feature-file.d.ts} +0 -0
- /package/dist/{collect-dead-globs.d.ts → lint-command/collect-dead-globs.d.ts} +0 -0
- /package/dist/{collect-journey-commands.d.ts → lint-command/collect-journey-commands.d.ts} +0 -0
- /package/dist/{collect-lint-files.d.ts → lint-command/collect-lint-files.d.ts} +0 -0
- /package/dist/{collect-unclaimed-files.d.ts → lint-command/collect-unclaimed-files.d.ts} +0 -0
- /package/dist/{parse-feature-table-span.d.ts → lint-command/parse-feature-table-span.d.ts} +0 -0
- /package/dist/{parse-shell-words.d.ts → lint-command/parse-shell-words.d.ts} +0 -0
- /package/dist/{parse-skill-metadata.d.ts → lint-command/parse-skill-metadata.d.ts} +0 -0
- /package/dist/{read-template-hash.d.ts → lint-command/read-template-hash.d.ts} +0 -0
- /package/dist/{resolve-journey-problem.d.ts → lint-command/resolve-journey-problem.d.ts} +0 -0
- /package/dist/{build-failure-envelope.d.ts → output/build-failure-envelope.d.ts} +0 -0
- /package/dist/{pick-output-mode.d.ts → output/pick-output-mode.d.ts} +0 -0
- /package/dist/{render-envelope.d.ts → output/render-envelope.d.ts} +0 -0
- /package/dist/{render-human-envelope.d.ts → output/render-human-envelope.d.ts} +0 -0
- /package/dist/{render-human-event.d.ts → output/render-human-event.d.ts} +0 -0
- /package/guide/template/{verify-registry.ts → create-verify-registry.ts} +0 -0
- /package/src/{build-guide-wringer.ts → guide-command/build-guide-wringer.ts} +0 -0
- /package/src/{parse-guide-topic.ts → guide-command/parse-guide-topic.ts} +0 -0
- /package/src/{pick-guide-data.ts → guide-command/pick-guide-data.ts} +0 -0
- /package/src/{build-gunshi-args.ts → gunshi-commands/build-gunshi-args.ts} +0 -0
- /package/src/{build-gunshi-commands.ts → gunshi-commands/build-gunshi-commands.ts} +0 -0
- /package/src/{build-positional-args.ts → gunshi-commands/build-positional-args.ts} +0 -0
- /package/src/{build-raw-args.ts → gunshi-commands/build-raw-args.ts} +0 -0
- /package/src/{collect-boolean-flags-with-value.ts → gunshi-commands/collect-boolean-flags-with-value.ts} +0 -0
- /package/src/{collect-flags-without-value.ts → gunshi-commands/collect-flags-without-value.ts} +0 -0
- /package/src/{keep-flag-text.ts → gunshi-commands/keep-flag-text.ts} +0 -0
- /package/src/{parse-arg-properties.ts → gunshi-commands/parse-arg-properties.ts} +0 -0
- /package/src/{find-signed-value-flag.ts → invocation/find-signed-value-flag.ts} +0 -0
- /package/src/{pick-command-name.ts → invocation/pick-command-name.ts} +0 -0
- /package/src/{scrub-parsed-invocation.ts → invocation/scrub-parsed-invocation.ts} +0 -0
- /package/src/{check-feature-file.ts → lint-command/check-feature-file.ts} +0 -0
- /package/src/{collect-dead-globs.ts → lint-command/collect-dead-globs.ts} +0 -0
- /package/src/{collect-journey-commands.ts → lint-command/collect-journey-commands.ts} +0 -0
- /package/src/{collect-lint-files.ts → lint-command/collect-lint-files.ts} +0 -0
- /package/src/{collect-unclaimed-files.ts → lint-command/collect-unclaimed-files.ts} +0 -0
- /package/src/{parse-feature-table-span.ts → lint-command/parse-feature-table-span.ts} +0 -0
- /package/src/{parse-shell-words.ts → lint-command/parse-shell-words.ts} +0 -0
- /package/src/{parse-skill-metadata.ts → lint-command/parse-skill-metadata.ts} +0 -0
- /package/src/{build-failure-envelope.ts → output/build-failure-envelope.ts} +0 -0
- /package/src/{pick-output-mode.ts → output/pick-output-mode.ts} +0 -0
- /package/src/{render-envelope.ts → output/render-envelope.ts} +0 -0
- /package/src/{render-human-envelope.ts → output/render-human-envelope.ts} +0 -0
- /package/src/{render-human-event.ts → output/render-human-event.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WringerError } from '@wringer/core';
|
|
2
|
-
import type { Invocation } from '
|
|
3
|
-
import type { OutputMode } from '
|
|
2
|
+
import type { Invocation } from '../gunshi-commands/build-gunshi-commands.ts';
|
|
3
|
+
import type { OutputMode } from '../output/pick-output-mode.ts';
|
|
4
4
|
export type ParsedInvocation = {
|
|
5
5
|
readonly kind: 'invoked';
|
|
6
6
|
readonly invocation: Invocation;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WringerError } from '@wringer/core';
|
|
2
2
|
import type { Envelope } from '@wringer/core';
|
|
3
|
-
import type { Invocation } from '
|
|
3
|
+
import type { Invocation } from '../gunshi-commands/build-gunshi-commands.ts';
|
|
4
4
|
export type DispatchPlan = {
|
|
5
5
|
readonly kind: 'refuse';
|
|
6
6
|
readonly envelope: Envelope;
|
package/dist/read-guide.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Wringer } from '@wringer/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import type { MarkdownFile } from './collect-journey-commands.ts';
|
|
3
|
+
import type { MarkdownFile } from './lint-command/collect-journey-commands.ts';
|
|
4
4
|
export declare const lintFailureSchema: z.ZodObject<{
|
|
5
5
|
check: z.ZodEnum<{
|
|
6
6
|
"feature-file": "feature-file";
|
package/guide/create.md
CHANGED
|
@@ -4,8 +4,8 @@ Write the verify CLI, its registry and the repo's verify skill
|
|
|
4
4
|
|
|
5
5
|
Add the verify CLI, its
|
|
6
6
|
[registry](https://github.com/zgeoff/wringer/blob/main/docs/reference/terms.md#registry) and the
|
|
7
|
-
repo's `verify` skill. `verify-registry.ts` in the template shows one target, driver, action,
|
|
8
|
-
command, doctor check and feature, on the builder that `createWringer` returns.
|
|
7
|
+
repo's `verify` skill. `create-verify-registry.ts` in the template shows one target, driver, action,
|
|
8
|
+
repo command, doctor check and feature, on the builder that `createWringer` returns.
|
|
9
9
|
|
|
10
10
|
The mistakes that cost the most:
|
|
11
11
|
|
|
@@ -35,15 +35,16 @@ The mistakes that cost the most:
|
|
|
35
35
|
| `@wringer/db` | SQL on the app's SQLite or Postgres database |
|
|
36
36
|
| `@wringer/stream` | the app's logs, recorded for the whole run |
|
|
37
37
|
| `@wringer/terminal` | a text program, through its screen |
|
|
38
|
+
| `@wringer/mcp` | the tools of an MCP server |
|
|
38
39
|
|
|
39
40
|
Each driver adds its own commands and its own doctor check. Its README in `node_modules/` gives
|
|
40
41
|
its config for a target.
|
|
41
42
|
|
|
42
43
|
2. Add `.wringer/` to `.gitignore`. The CLI keeps each run's state and evidence there.
|
|
43
|
-
3. Copy `verify.ts` and `verify-registry.ts` from the template (`bun verify guide template`
|
|
44
|
-
its folder) into `scripts/verify/`. Add `"verify": "bun scripts/verify/verify.ts"` to the
|
|
44
|
+
3. Copy `verify.ts` and `create-verify-registry.ts` from the template (`bun verify guide template`
|
|
45
|
+
names its folder) into `scripts/verify/`. Add `"verify": "bun scripts/verify/verify.ts"` to the
|
|
45
46
|
`scripts` of `package.json`. Expect: `bun verify --help` lists the template's commands.
|
|
46
|
-
4. In `verify-registry.ts`, write the `local` target with `mode: 'launch'` and
|
|
47
|
+
4. In `create-verify-registry.ts`, write the `local` target with `mode: 'launch'` and
|
|
47
48
|
`access: 'read-write'`. Its `launch` function returns:
|
|
48
49
|
- `command`: the command a developer runs to start the app;
|
|
49
50
|
- `env`: the app's environment. Point the app's state at `ctx.runDirectory` here, such as a
|
|
@@ -61,8 +62,9 @@ The mistakes that cost the most:
|
|
|
61
62
|
the app, such as seeding a record. The CLI runs it as `bun verify action <name>`.
|
|
62
63
|
8. Write a repo command with `.command` for a read that a journey checks, such as a count.
|
|
63
64
|
9. Write a doctor check with `.check` for each thing that must hold before a journey means anything,
|
|
64
|
-
such as an API that answers.
|
|
65
|
-
`
|
|
65
|
+
such as an API that answers. When a check holds only on some targets, list them in its `targets`;
|
|
66
|
+
the doctor reports it as `skipped` on the rest. Then run `bun verify up`, then
|
|
67
|
+
`bun verify doctor`. Expect: `data.passed: true`. Run `bun verify down`.
|
|
66
68
|
10. Write 3 to 5 features with `.feature`, each with `name`, `summary` and `paths`. Pick the
|
|
67
69
|
journeys users take most, from the app's routes and its README, and give each feature the globs
|
|
68
70
|
of the files that change its behaviour.
|
package/guide/overview.md
CHANGED
|
@@ -75,13 +75,13 @@ the CLI with `bun`.
|
|
|
75
75
|
CLI, prints the absolute path of the installed template folder. It holds a working example for an
|
|
76
76
|
invented app, Larder:
|
|
77
77
|
|
|
78
|
-
| File
|
|
79
|
-
|
|
|
80
|
-
| `verify.ts`
|
|
81
|
-
| `verify-registry.ts` | `scripts/verify/verify-registry.ts` | targets, a driver, an action, a command, a check, a feature |
|
|
82
|
-
| `verify/`
|
|
78
|
+
| File | Copy to | Holds |
|
|
79
|
+
| --------------------------- | ------------------------------------------ | ----------------------------------------------------------------- |
|
|
80
|
+
| `verify.ts` | `scripts/verify/verify.ts` | the entry point that calls `runVerify` |
|
|
81
|
+
| `create-verify-registry.ts` | `scripts/verify/create-verify-registry.ts` | targets, a driver, an action, a command, a check, a feature |
|
|
82
|
+
| `verify/` | `.claude/skills/verify/` | the repo's `verify` skill, and its feature files in `references/` |
|
|
83
83
|
|
|
84
|
-
Skip `verify-registry.test.ts` in the template: it tests the template inside wringer.
|
|
84
|
+
Skip `create-verify-registry.test.ts` in the template: it tests the template inside wringer.
|
|
85
85
|
|
|
86
86
|
These locations are defaults. When you change one, change each place that refers to it:
|
|
87
87
|
|
|
@@ -5,7 +5,7 @@ description:
|
|
|
5
5
|
feature works. Load it before you check a change in the running app, run the journey of a feature,
|
|
6
6
|
or put the verdicts in a PR.'
|
|
7
7
|
metadata:
|
|
8
|
-
wringer-template: 'sha256:
|
|
8
|
+
wringer-template: 'sha256:97fabc9a9389'
|
|
9
9
|
wringer-command: bun verify
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -40,8 +40,7 @@ The mistakes that cost the most time:
|
|
|
40
40
|
|
|
41
41
|
## References
|
|
42
42
|
|
|
43
|
-
Read a feature's file before you run its journey
|
|
44
|
-
journey of `bun verify` commands, and the end state that shows it works.
|
|
43
|
+
Read a feature's file before you run its journey.
|
|
45
44
|
|
|
46
45
|
<!-- wringer:features -->
|
|
47
46
|
|
|
@@ -54,8 +53,7 @@ journey of `bun verify` commands, and the end state that shows it works.
|
|
|
54
53
|
## Check a change
|
|
55
54
|
|
|
56
55
|
1. Run `bun verify report`. A feature in `data.report.features` shows `changed: true` when a file
|
|
57
|
-
under its `paths` differs from the default branch, committed or not.
|
|
58
|
-
verdict.
|
|
56
|
+
under its `paths` differs from the default branch, committed or not.
|
|
59
57
|
2. Unless your task names another target, start a run on `local`, with the commands in the
|
|
60
58
|
[Targets](#targets) table. Expect from `up` or `attach`: `ok: true`, and the app's endpoints in
|
|
61
59
|
`data.endpoints`.
|
|
@@ -81,13 +79,14 @@ journey of `bun verify` commands, and the end state that shows it works.
|
|
|
81
79
|
After `done`, an edit to a file under a feature's `paths` makes its verdict `stale`; a commit
|
|
82
80
|
alone leaves each verdict as it was. Repeat steps 4 to 6 for each stale feature.
|
|
83
81
|
9. Run `bun verify publish`. Expect: `ok: true`, and `data.action` of `created`, `replaced` or
|
|
84
|
-
`unchanged`. It writes the report into the description of the branch's open PR.
|
|
82
|
+
`unchanged`. It writes the report into the description of the branch's open PR. Until you run
|
|
83
|
+
`publish`, each verdict from `done` stays in `.wringer/`, where the gate never looks.
|
|
85
84
|
10. End the run: `bun verify down` after `up`, or `bun verify detach` after `attach`.
|
|
86
85
|
|
|
87
86
|
## Read the envelope
|
|
88
87
|
|
|
89
|
-
Each command prints one JSON envelope as its last line, or text
|
|
90
|
-
|
|
88
|
+
Each command prints one JSON envelope as its last line, or text with `--human`. A streaming command,
|
|
89
|
+
such as `doctor`, prints JSON event lines before it. Read these fields:
|
|
91
90
|
|
|
92
91
|
- `ok`, then `data` on success, or `error.code`, `error.message` and `error.hint` on failure;
|
|
93
92
|
- `evidence`: the files the command kept, under `.wringer/`;
|
|
@@ -113,7 +112,8 @@ attach target, an app that runs apart from `bun verify`, with `bun verify attach
|
|
|
113
112
|
`bun verify detach` leaves it running. Your edits never reach an attach target's app, so check a
|
|
114
113
|
change on a launch target.
|
|
115
114
|
|
|
116
|
-
Run `bun verify use --target <target>` to point every later command at a target.
|
|
115
|
+
Run `bun verify use --target <target>` to point every later command at a target. `use` saves the
|
|
116
|
+
choice in this worktree's `.wringer/`, so it holds across shells and sessions. `--target` on one
|
|
117
117
|
command points that command alone.
|
|
118
118
|
|
|
119
119
|
<!-- repo: targets -->
|
|
@@ -127,9 +127,10 @@ command points that command alone.
|
|
|
127
127
|
|
|
128
128
|
## Commands
|
|
129
129
|
|
|
130
|
-
Run `bun verify --help` for the list, with each command marked `[read]` or `[write]`.
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
Run `bun verify --help` for the list, with each command marked `[read]` or `[write]`. A read-only
|
|
131
|
+
target refuses each `[write]` command that writes app data. `up` and `down` are `[read]`, but start
|
|
132
|
+
and stop the app. Run `bun verify <command> --help` for a command's flags. The top-level list shows
|
|
133
|
+
only the name of a group, such as `action`: run `bun verify <group> --help` for its commands.
|
|
133
134
|
|
|
134
135
|
- Write a negative number with `=`, as in `--offset=-5`.
|
|
135
136
|
- Pass an object as JSON text, as in `--filter '{"shelf":"top"}'`.
|
|
@@ -145,8 +146,8 @@ group, such as `action`: run `bun verify <group> --help` for its commands.
|
|
|
145
146
|
|
|
146
147
|
<!-- repo: registry -->
|
|
147
148
|
|
|
148
|
-
The registry, `scripts/verify/verify-registry.ts`, declares the targets, actions, commands,
|
|
149
|
-
checks and features, with each feature's `paths`.
|
|
149
|
+
The registry, `scripts/verify/create-verify-registry.ts`, declares the targets, actions, commands,
|
|
150
|
+
doctor checks and features, with each feature's `paths`.
|
|
150
151
|
|
|
151
152
|
<!-- /repo -->
|
|
152
153
|
|
package/guide/template/verify.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { runVerify } from '@wringer/gunshi';
|
|
2
|
-
import { createVerifyRegistry } from './verify-registry.ts';
|
|
2
|
+
import { createVerifyRegistry } from './create-verify-registry.ts';
|
|
3
3
|
|
|
4
4
|
// The repo's verify CLI. The `verify` script in package.json runs this file, so an agent calls
|
|
5
5
|
// `bun verify <command>`. `skill` names the folder of the repo's verify skill, which `lint` checks.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wringer/gunshi",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "The gunshi adapter for wringer: turns a wringer registry into a CLI",
|
|
5
5
|
"homepage": "https://github.com/zgeoff/wringer/tree/main/packages/gunshi#readme",
|
|
6
6
|
"bugs": "https://github.com/zgeoff/wringer/issues",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"ts-pattern": "5.9.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@wringer/core": "0.3.
|
|
45
|
-
"@wringer/http": "0.1.
|
|
44
|
+
"@wringer/core": "0.3.1",
|
|
45
|
+
"@wringer/http": "0.1.4",
|
|
46
46
|
"@zgeoff/testing": "0.3.0",
|
|
47
47
|
"zod": "4.6.7"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@wringer/core": "0.3.
|
|
50
|
+
"@wringer/core": "0.3.1",
|
|
51
51
|
"zod": "^4.0.0"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
package/src/build-cli-wringer.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WringerError } from '@wringer/core';
|
|
2
2
|
import type { RegisteredCommand, Wringer } from '@wringer/core';
|
|
3
|
-
import { buildGuideCommand } from './build-guide-command.ts';
|
|
4
|
-
import { buildLintCommand } from './build-lint-command.ts';
|
|
3
|
+
import { buildGuideCommand } from './guide-command/build-guide-command.ts';
|
|
4
|
+
import { buildLintCommand } from './lint-command/build-lint-command.ts';
|
|
5
5
|
|
|
6
6
|
// The registry with the `lint` and `guide` built-ins added. `lint` parses journey lines with
|
|
7
7
|
// gunshi, so this package adds them rather than core. `registryFile` is the registry's own file,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { WringerError, buildBuiltinCommand } from '@wringer/core';
|
|
2
2
|
import type { RegisteredCommand } from '@wringer/core';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
import { readGuide } from '../read-guide.ts';
|
|
4
5
|
import { guideDataSchema, pickGuideData } from './pick-guide-data.ts';
|
|
5
6
|
import type { GuideData } from './pick-guide-data.ts';
|
|
6
|
-
import { readGuide } from './read-guide.ts';
|
|
7
7
|
|
|
8
8
|
const guideArgsSchema = z.strictObject({
|
|
9
9
|
topic: z.string().min(1).optional().describe('The topic to print; leave out to list the topics'),
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
makeProcessSupervisorPort,
|
|
6
6
|
} from '@wringer/core';
|
|
7
7
|
import type { PullRequestHost, RepoHost, StateFileSystem } from '@wringer/core';
|
|
8
|
-
import type { CLIPorts } from '
|
|
8
|
+
import type { CLIPorts } from '../run-cli.ts';
|
|
9
9
|
|
|
10
10
|
type RepoPorts = Pick<CLIPorts, 'readRepoRoot' | 'openRepo'>;
|
|
11
11
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { exitCodeFor } from '@wringer/core';
|
|
2
2
|
import type { WringerError } from '@wringer/core';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import type { OutputMode } from '
|
|
6
|
-
import { renderEnvelope } from '
|
|
3
|
+
import type { Invocation } from '../gunshi-commands/build-gunshi-commands.ts';
|
|
4
|
+
import { buildFailureEnvelope } from '../output/build-failure-envelope.ts';
|
|
5
|
+
import type { OutputMode } from '../output/pick-output-mode.ts';
|
|
6
|
+
import { renderEnvelope } from '../output/render-envelope.ts';
|
|
7
7
|
|
|
8
8
|
export type ParsedInvocation =
|
|
9
9
|
| { readonly kind: 'invoked'; readonly invocation: Invocation }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WringerError, exitCodeFor } from '@wringer/core';
|
|
2
2
|
import type { Envelope } from '@wringer/core';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import type { Invocation } from '../gunshi-commands/build-gunshi-commands.ts';
|
|
4
|
+
import { buildFailureEnvelope } from '../output/build-failure-envelope.ts';
|
|
5
5
|
|
|
6
6
|
export type DispatchPlan =
|
|
7
7
|
| { readonly kind: 'refuse'; readonly envelope: Envelope; readonly exitCode: number }
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { WringerError } from '@wringer/core';
|
|
2
2
|
import type { Wringer } from '@wringer/core';
|
|
3
3
|
import { cli, parseArgs } from 'gunshi';
|
|
4
|
-
import { buildGunshiCommands } from '
|
|
5
|
-
import type { InvokeResult } from '
|
|
4
|
+
import { buildGunshiCommands } from '../gunshi-commands/build-gunshi-commands.ts';
|
|
5
|
+
import type { InvokeResult } from '../gunshi-commands/build-gunshi-commands.ts';
|
|
6
6
|
import { findSignedValueFlag } from './find-signed-value-flag.ts';
|
|
7
7
|
import type { SignedValueFlag } from './find-signed-value-flag.ts';
|
|
8
8
|
import type { ParsedInvocation } from './pick-cli-outcome.ts';
|
|
@@ -3,9 +3,9 @@ import { isAbsolute, join, relative, resolve } from 'node:path';
|
|
|
3
3
|
import { WringerError, buildBuiltinCommand } from '@wringer/core';
|
|
4
4
|
import type { BuiltinContext, RegisteredCommand } from '@wringer/core';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
+
import { lintFailureSchema, resolveLintFailures } from '../resolve-lint-failures.ts';
|
|
6
7
|
import { collectLintFiles } from './collect-lint-files.ts';
|
|
7
8
|
import { readTemplateHash } from './read-template-hash.ts';
|
|
8
|
-
import { lintFailureSchema, resolveLintFailures } from './resolve-lint-failures.ts';
|
|
9
9
|
|
|
10
10
|
const lintArgsSchema = z.strictObject({});
|
|
11
11
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
import { readFile, readdir } from 'node:fs/promises';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
-
import { guideFolder } from '
|
|
4
|
+
import { guideFolder } from '../read-guide.ts';
|
|
5
5
|
|
|
6
6
|
const templateFolder = join(guideFolder, 'template');
|
|
7
7
|
const hashLength = 12;
|
|
@@ -2,8 +2,8 @@ import { prepareArgs } from '@wringer/core';
|
|
|
2
2
|
import type { RegisteredCommand, Wringer } from '@wringer/core';
|
|
3
3
|
import invariant from 'tiny-invariant';
|
|
4
4
|
import { match } from 'ts-pattern';
|
|
5
|
-
import type { Invocation } from '
|
|
6
|
-
import { resolveInvocation } from '
|
|
5
|
+
import type { Invocation } from '../gunshi-commands/build-gunshi-commands.ts';
|
|
6
|
+
import { resolveInvocation } from '../invocation/resolve-invocation.ts';
|
|
7
7
|
|
|
8
8
|
// Why one journey command would fail before it ran, or null when it would run: the words go through
|
|
9
9
|
// the CLI's own parser, the arguments through the command's schema, and a feature or a target it
|
package/src/read-guide.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { readFile, readdir } from 'node:fs/promises';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { parseGuideTopic } from './parse-guide-topic.ts';
|
|
5
|
-
import type { GuideTopic } from './parse-guide-topic.ts';
|
|
6
|
-
import type { Guide } from './pick-guide-data.ts';
|
|
4
|
+
import { parseGuideTopic } from './guide-command/parse-guide-topic.ts';
|
|
5
|
+
import type { GuideTopic } from './guide-command/parse-guide-topic.ts';
|
|
6
|
+
import type { Guide } from './guide-command/pick-guide-data.ts';
|
|
7
7
|
|
|
8
8
|
const packageSchema = z.looseObject({ version: z.string().min(1) });
|
|
9
9
|
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { buildFeatureFile, isGlobMatch, renderFeatureTable } from '@wringer/core';
|
|
2
2
|
import type { Wringer } from '@wringer/core';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { checkFeatureFile } from './check-feature-file.ts';
|
|
5
|
-
import { collectDeadGlobs } from './collect-dead-globs.ts';
|
|
6
|
-
import { collectJourneyCommands } from './collect-journey-commands.ts';
|
|
7
|
-
import type { JourneyCommand, MarkdownFile } from './collect-journey-commands.ts';
|
|
8
|
-
import { collectUnclaimedFiles } from './collect-unclaimed-files.ts';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
import { checkFeatureFile } from './lint-command/check-feature-file.ts';
|
|
5
|
+
import { collectDeadGlobs } from './lint-command/collect-dead-globs.ts';
|
|
6
|
+
import { collectJourneyCommands } from './lint-command/collect-journey-commands.ts';
|
|
7
|
+
import type { JourneyCommand, MarkdownFile } from './lint-command/collect-journey-commands.ts';
|
|
8
|
+
import { collectUnclaimedFiles } from './lint-command/collect-unclaimed-files.ts';
|
|
9
|
+
import {
|
|
10
|
+
parseFeatureTableSpan,
|
|
11
|
+
toComparableTable,
|
|
12
|
+
} from './lint-command/parse-feature-table-span.ts';
|
|
13
|
+
import { parseSkillMetadata } from './lint-command/parse-skill-metadata.ts';
|
|
14
|
+
import type { SkillMetadata } from './lint-command/parse-skill-metadata.ts';
|
|
15
|
+
import { resolveJourneyProblem } from './lint-command/resolve-journey-problem.ts';
|
|
13
16
|
|
|
14
17
|
export const lintFailureSchema = z.strictObject({
|
|
15
18
|
// `where` names the feature, the glob group or the file that the check found at fault.
|
package/src/run-cli.ts
CHANGED
|
@@ -8,15 +8,15 @@ import type {
|
|
|
8
8
|
WringerError,
|
|
9
9
|
} from '@wringer/core';
|
|
10
10
|
import { parseArgs } from 'gunshi';
|
|
11
|
-
import type { Invocation } from './build-gunshi-commands.ts';
|
|
12
|
-
import { pickCLIOutcome } from './pick-cli-outcome.ts';
|
|
13
|
-
import { pickDispatchPlan } from './pick-dispatch-plan.ts';
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
11
|
+
import type { Invocation } from './gunshi-commands/build-gunshi-commands.ts';
|
|
12
|
+
import { pickCLIOutcome } from './invocation/pick-cli-outcome.ts';
|
|
13
|
+
import { pickDispatchPlan } from './invocation/pick-dispatch-plan.ts';
|
|
14
|
+
import { resolveInvocation } from './invocation/resolve-invocation.ts';
|
|
15
|
+
import { scrubParsedInvocation } from './invocation/scrub-parsed-invocation.ts';
|
|
16
|
+
import { pickOutputMode } from './output/pick-output-mode.ts';
|
|
17
|
+
import type { OutputMode } from './output/pick-output-mode.ts';
|
|
18
|
+
import { renderEnvelope } from './output/render-envelope.ts';
|
|
19
|
+
import { renderHumanEvent } from './output/render-human-event.ts';
|
|
20
20
|
|
|
21
21
|
interface RepoPorts {
|
|
22
22
|
readonly state: StatePort;
|
package/src/wringer-gunshi.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { buildGuidePorts } from './build-guide-ports.ts';
|
|
3
|
-
import { buildGuideWringer } from './build-guide-wringer.ts';
|
|
2
|
+
import { buildGuidePorts } from './guide-command/build-guide-ports.ts';
|
|
3
|
+
import { buildGuideWringer } from './guide-command/build-guide-wringer.ts';
|
|
4
4
|
import { runWringer } from './run-verify.ts';
|
|
5
5
|
|
|
6
6
|
const [, script] = process.argv;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{collect-flags-without-value.d.ts → gunshi-commands/collect-flags-without-value.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/{collect-flags-without-value.ts → gunshi-commands/collect-flags-without-value.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|