@komatikai/trailhead 4.4.4 → 4.4.6
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 +43 -39
- package/dist/index.js +12147 -271
- package/dist/index.js.map +1 -1
- package/dist/licenses.txt +51 -0
- package/dist/sourcemap-register.js +1 -0
- package/package.json +8 -7
- package/dist/index.d.ts +0 -2
- package/dist/run-doctor.d.ts +0 -1
- package/dist/run-doctor.js +0 -83
- package/dist/run-doctor.js.map +0 -1
- package/dist/shared/ci-core.d.ts +0 -18
- package/dist/shared/ci-core.js +0 -210
- package/dist/shared/ci-core.js.map +0 -1
- package/dist/shared/ci-manifest.d.ts +0 -82
- package/dist/shared/ci-manifest.js +0 -51
- package/dist/shared/ci-manifest.js.map +0 -1
- package/dist/shared/config-core.d.ts +0 -5
- package/dist/shared/config-core.js +0 -127
- package/dist/shared/config-core.js.map +0 -1
- package/dist/shared/doctor.d.ts +0 -48
- package/dist/shared/doctor.js +0 -308
- package/dist/shared/doctor.js.map +0 -1
- package/dist/shared/release-ready.d.ts +0 -27
- package/dist/shared/release-ready.js +0 -97
- package/dist/shared/release-ready.js.map +0 -1
- package/dist/shared/submission-checks/detectors.d.ts +0 -23
- package/dist/shared/submission-checks/detectors.js +0 -547
- package/dist/shared/submission-checks/detectors.js.map +0 -1
- package/dist/shared/submission-checks/helpers.d.ts +0 -30
- package/dist/shared/submission-checks/helpers.js +0 -119
- package/dist/shared/submission-checks/helpers.js.map +0 -1
- package/dist/shared/submission-checks/phase0-detectors.d.ts +0 -18
- package/dist/shared/submission-checks/phase0-detectors.js +0 -374
- package/dist/shared/submission-checks/phase0-detectors.js.map +0 -1
- package/dist/shared/submission-checks/syntax-validity.d.ts +0 -2
- package/dist/shared/submission-checks/syntax-validity.js +0 -44
- package/dist/shared/submission-checks/syntax-validity.js.map +0 -1
- package/dist/shared/submission-checks/types.d.ts +0 -33
- package/dist/shared/submission-checks/types.js +0 -2
- package/dist/shared/submission-checks/types.js.map +0 -1
- package/dist/shared/submission-engine.d.ts +0 -19
- package/dist/shared/submission-engine.js +0 -51
- package/dist/shared/submission-engine.js.map +0 -1
- package/dist/shared/types.d.ts +0 -2644
- package/dist/shared/types.js +0 -487
- package/dist/shared/types.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,32 +1,42 @@
|
|
|
1
1
|
# Trailhead CLI
|
|
2
2
|
|
|
3
|
-
Interactive setup wizard and diagnostics for Trailhead. Generates `.trailhead.yml`, validates policy files,
|
|
3
|
+
Interactive setup wizard and diagnostics for Trailhead. Generates `.trailhead.yml`, validates policy files, compares configured CI check names against GitHub, and runs the submission gate (`validate-submission`).
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Install (no build required)
|
|
6
|
+
|
|
7
|
+
The published npm package ships a **prebuilt JS bundle** (`dist/index.js`) plus **`@swc/core`** as a runtime dependency (one platform-native binding installed via npm optionalDependencies — ~25 MB download, not 135 MB). No repo clone or local build required.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @komatikai/trailhead init # interactive — pick solo / team / agent / ops
|
|
11
|
+
npx @komatikai/trailhead init --preset solo
|
|
12
|
+
npx @komatikai/trailhead doctor --offline
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Pin a version for CI:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -D @komatikai/trailhead@4.4.6
|
|
19
|
+
npx trailhead validate-submission --input bundle.json
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Persona guide: [docs/getting-started.md](../docs/getting-started.md) · Presets: [presets/README.md](../presets/README.md)
|
|
23
|
+
|
|
24
|
+
### Migrating from vendored `cli-dist`
|
|
25
|
+
|
|
26
|
+
Komatik agents and other repos that vendor `trailhead/cli-dist/` can replace the copy with an npm pin:
|
|
6
27
|
|
|
7
28
|
```bash
|
|
8
|
-
|
|
9
|
-
npx
|
|
29
|
+
npm install -D @komatikai/trailhead@<tag>
|
|
30
|
+
# invoke: npx trailhead validate-submission …
|
|
10
31
|
```
|
|
11
32
|
|
|
33
|
+
Set `TRAILHEAD_CLI=$(npm root)/.bin/trailhead` (or `npx trailhead`) in shadow-compare harnesses instead of a repo-relative `cli/dist/index.js`.
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
12
37
|
### `trailhead init`
|
|
13
38
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
1. **Gate mode** — release-ready, advisory, or risk-only
|
|
17
|
-
2. **Branch model** — main-only or progressive promotion paths
|
|
18
|
-
3. **Required checks** — CI job names for release-ready contexts
|
|
19
|
-
4. **Sensitivity patterns** — which file paths are high/medium risk
|
|
20
|
-
5. **Thresholds** — risk and warn scores
|
|
21
|
-
6. **Freeze windows** — days and hours when deployments are blocked
|
|
22
|
-
7. **Environments** — per-environment threshold overrides
|
|
23
|
-
8. **Services** — monorepo service boundaries with path patterns
|
|
24
|
-
9. **Security gate** — Code Scanning alerts as a risk factor
|
|
25
|
-
10. **Canary tracking** — deploy outcome webhook type
|
|
26
|
-
11. **DORA metrics** — compute DORA-5 alongside gate evaluations
|
|
27
|
-
12. **Health checks** — URLs to probe before scoring
|
|
28
|
-
13. **OpenTelemetry** — OTLP endpoint for evaluation span export
|
|
29
|
-
14. **Evaluation store** — URL for persisting evaluations to a trend dashboard
|
|
39
|
+
Interactive wizard — no GitHub token required. Creates `.trailhead.yml` and `.github/workflows/trailhead.yml`.
|
|
30
40
|
|
|
31
41
|
### `trailhead doctor`
|
|
32
42
|
|
|
@@ -43,8 +53,6 @@ GITHUB_TOKEN=ghp_... trailhead doctor --repo owner/repo
|
|
|
43
53
|
trailhead doctor --json
|
|
44
54
|
```
|
|
45
55
|
|
|
46
|
-
Options:
|
|
47
|
-
|
|
48
56
|
| Flag | Description |
|
|
49
57
|
| --------------------- | -------------------------------------- |
|
|
50
58
|
| `--path <dir>` | Directory to scan (default: cwd) |
|
|
@@ -56,30 +64,26 @@ Options:
|
|
|
56
64
|
|
|
57
65
|
Exit code `0` when there are no errors; `1` when config is missing/invalid or structural errors are found. Warnings do not fail the command.
|
|
58
66
|
|
|
59
|
-
|
|
67
|
+
### `trailhead validate-submission`
|
|
60
68
|
|
|
61
|
-
|
|
69
|
+
Runs the canonical Gate 1 engine on a JSON payload of files (used by komatik-agents and MCP). See `cli/src/index.ts` for input shape.
|
|
62
70
|
|
|
63
|
-
|
|
64
|
-
- **`.github/workflows/trailhead.yml`** — GitHub Actions workflow with selected features
|
|
71
|
+
## Development (this repo)
|
|
65
72
|
|
|
66
|
-
|
|
73
|
+
Source lives in `cli/src/`; shared modules are copied from `src/` at build time. **Do not commit `cli/dist/`** — CI and the release workflow build the bundle.
|
|
67
74
|
|
|
68
75
|
```bash
|
|
69
|
-
|
|
70
|
-
npm
|
|
71
|
-
npm run build
|
|
72
|
-
node dist/index.js doctor --offline --path
|
|
76
|
+
# From repo root
|
|
77
|
+
npm ci
|
|
78
|
+
npm run build:cli
|
|
79
|
+
node cli/dist/index.js doctor --offline --path .
|
|
80
|
+
|
|
81
|
+
# Typecheck CLI sources only
|
|
82
|
+
cd cli && npm ci && npm run typecheck
|
|
73
83
|
```
|
|
74
84
|
|
|
75
|
-
|
|
85
|
+
Bundle pipeline: `scripts/build-cli-bundle.mjs` → `ncc` with `@swc/core` external (Action bundle still vendors `swc.*.node` via `copy-swc-bindings.mjs`).
|
|
76
86
|
|
|
77
87
|
## Publishing
|
|
78
88
|
|
|
79
|
-
|
|
80
|
-
cd cli
|
|
81
|
-
npm run build
|
|
82
|
-
npm publish
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
The package is published as `@komatikai/trailhead` on npm.
|
|
89
|
+
On tag push (`v*`), `.github/workflows/release.yml` runs `npm run build:cli`, `npm ci --omit=dev` in `cli/`, then publishes `@komatikai/trailhead`. The npm tarball ships `dist/` plus `@swc/core` in `dependencies` (platform binding resolved at install).
|