@visulima/vis 1.0.0-alpha.8 → 1.0.0-alpha.9
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 +90 -57
- package/LICENSE.md +44 -1
- package/README.md +56 -0
- package/dist/bin.js +1 -1003
- package/dist/config.d.ts +1073 -68
- package/dist/config.js +1 -1
- package/dist/generate/index.d.ts +155 -30
- package/dist/packem_chunks/handler.js +1 -0
- package/dist/packem_chunks/handler10.js +1 -0
- package/dist/packem_chunks/handler11.js +1 -0
- package/dist/packem_chunks/handler12.js +153 -0
- package/dist/packem_chunks/handler13.js +1 -0
- package/dist/packem_chunks/handler14.js +3 -0
- package/dist/packem_chunks/handler15.js +1 -0
- package/dist/packem_chunks/handler16.js +2 -0
- package/dist/packem_chunks/handler17.js +7 -0
- package/dist/packem_chunks/handler18.js +1 -0
- package/dist/packem_chunks/handler19.js +19 -0
- package/dist/packem_chunks/handler2.js +1 -0
- package/dist/packem_chunks/handler20.js +428 -0
- package/dist/packem_chunks/handler21.js +22 -0
- package/dist/packem_chunks/handler22.js +3 -0
- package/dist/packem_chunks/handler23.js +5 -0
- package/dist/packem_chunks/handler24.js +1 -0
- package/dist/packem_chunks/handler25.js +20 -0
- package/dist/packem_chunks/handler26.js +1 -0
- package/dist/packem_chunks/handler27.js +1 -0
- package/dist/packem_chunks/handler28.js +1 -0
- package/dist/packem_chunks/handler29.js +2 -0
- package/dist/packem_chunks/handler3.js +2 -0
- package/dist/packem_chunks/handler30.js +22 -0
- package/dist/packem_chunks/handler31.js +1 -0
- package/dist/packem_chunks/handler32.js +1 -0
- package/dist/packem_chunks/handler33.js +37 -0
- package/dist/packem_chunks/handler34.js +3 -0
- package/dist/packem_chunks/handler35.js +23 -0
- package/dist/packem_chunks/handler36.js +5 -0
- package/dist/packem_chunks/handler37.js +27 -0
- package/dist/packem_chunks/handler38.js +1 -0
- package/dist/packem_chunks/handler39.js +2 -0
- package/dist/packem_chunks/handler4.js +5 -0
- package/dist/packem_chunks/handler40.js +1 -0
- package/dist/packem_chunks/handler41.js +5 -0
- package/dist/packem_chunks/handler42.js +1 -0
- package/dist/packem_chunks/handler43.js +24 -0
- package/dist/packem_chunks/handler44.js +3 -0
- package/dist/packem_chunks/handler45.js +1 -0
- package/dist/packem_chunks/handler5.js +4 -0
- package/dist/packem_chunks/handler6.js +2 -0
- package/dist/packem_chunks/handler7.js +24 -0
- package/dist/packem_chunks/handler8.js +6 -0
- package/dist/packem_chunks/handler9.js +8 -0
- package/dist/packem_shared/VisUpdateApp-BBx3idMI.js +1 -0
- package/dist/packem_shared/ai-analysis-DDqXRFxY.js +67 -0
- package/dist/packem_shared/bin-BaZZ32BK.js +93 -0
- package/dist/packem_shared/cache-directory-DL8hfXeG.js +1 -0
- package/dist/packem_shared/catalog-CuSpuB_R.js +12 -0
- package/dist/packem_shared/dependency-scan-BoLG2Fez.js +1 -0
- package/dist/packem_shared/docker-BcfqH4Av.js +2 -0
- package/dist/packem_shared/flakiness-DSIHZGBT.js +1 -0
- package/dist/packem_shared/otelPlugin-DxyvBcXO.js +1 -0
- package/dist/packem_shared/runtime-check-CGHal8SO.js +1 -0
- package/dist/packem_shared/selectors-CfH9ZY08.js +3 -0
- package/dist/packem_shared/symbols-CIMw60-G.js +1 -0
- package/dist/packem_shared/toolchain-C3ZG0o_X.js +5 -0
- package/dist/packem_shared/typosquats-Bpq4zcWL.js +1 -0
- package/dist/packem_shared/utils-DrNg0XTR.js +1 -0
- package/index.js +555 -727
- package/package.json +27 -19
- package/schemas/project.schema.json +1 -1
- package/schemas/vis-config.schema.json +47 -1
- package/dist/ai-analysis.d.ts +0 -26
- package/dist/ai-cache.d.ts +0 -21
- package/dist/ai-types.d.ts +0 -16
- package/dist/audit-config.d.ts +0 -24
- package/dist/bin.d.ts +0 -1
- package/dist/cache-directory.d.ts +0 -73
- package/dist/catalog.d.ts +0 -136
- package/dist/codeowners.d.ts +0 -30
- package/dist/commands/action-graph.d.ts +0 -8
- package/dist/commands/add.d.ts +0 -3
- package/dist/commands/affected.d.ts +0 -3
- package/dist/commands/ai.d.ts +0 -3
- package/dist/commands/analyze.d.ts +0 -3
- package/dist/commands/approve-builds.d.ts +0 -3
- package/dist/commands/audit.d.ts +0 -23
- package/dist/commands/cache.d.ts +0 -86
- package/dist/commands/check.d.ts +0 -3
- package/dist/commands/ci.d.ts +0 -19
- package/dist/commands/clean.d.ts +0 -3
- package/dist/commands/create/discovery.d.ts +0 -42
- package/dist/commands/create/index.d.ts +0 -13
- package/dist/commands/create/prompts.d.ts +0 -31
- package/dist/commands/create/random-name.d.ts +0 -15
- package/dist/commands/create/templates/builtin.d.ts +0 -15
- package/dist/commands/create/templates/generator.d.ts +0 -14
- package/dist/commands/create/templates/index.d.ts +0 -13
- package/dist/commands/create/templates/monorepo.d.ts +0 -16
- package/dist/commands/create/templates/remote.d.ts +0 -41
- package/dist/commands/create/templates/types.d.ts +0 -46
- package/dist/commands/create/utils.d.ts +0 -42
- package/dist/commands/dedupe.d.ts +0 -3
- package/dist/commands/devcontainer.d.ts +0 -3
- package/dist/commands/dlx.d.ts +0 -3
- package/dist/commands/docker.d.ts +0 -22
- package/dist/commands/doctor.d.ts +0 -15
- package/dist/commands/exec.d.ts +0 -3
- package/dist/commands/generate.d.ts +0 -10
- package/dist/commands/graph.d.ts +0 -3
- package/dist/commands/hook/constants.d.ts +0 -13
- package/dist/commands/hook/index.d.ts +0 -3
- package/dist/commands/hook/install.d.ts +0 -7
- package/dist/commands/hook/list.d.ts +0 -28
- package/dist/commands/hook/migrate.d.ts +0 -30
- package/dist/commands/hook/prek-builtins.d.ts +0 -8
- package/dist/commands/hook/prek.d.ts +0 -129
- package/dist/commands/hook/run.d.ts +0 -21
- package/dist/commands/hook/uninstall.d.ts +0 -3
- package/dist/commands/hook/validate.d.ts +0 -17
- package/dist/commands/ignore-helpers.d.ts +0 -157
- package/dist/commands/ignore.d.ts +0 -17
- package/dist/commands/implode.d.ts +0 -3
- package/dist/commands/info.d.ts +0 -3
- package/dist/commands/init.d.ts +0 -14
- package/dist/commands/install.d.ts +0 -3
- package/dist/commands/link.d.ts +0 -3
- package/dist/commands/list.d.ts +0 -3
- package/dist/commands/migrate/backup.d.ts +0 -8
- package/dist/commands/migrate/constants.d.ts +0 -16
- package/dist/commands/migrate/deps.d.ts +0 -32
- package/dist/commands/migrate/gitleaks.d.ts +0 -29
- package/dist/commands/migrate/index.d.ts +0 -3
- package/dist/commands/migrate/json.d.ts +0 -22
- package/dist/commands/migrate/kingfisher.d.ts +0 -14
- package/dist/commands/migrate/lint-staged.d.ts +0 -62
- package/dist/commands/migrate/moon.d.ts +0 -5
- package/dist/commands/migrate/nano-staged.d.ts +0 -30
- package/dist/commands/migrate/nx.d.ts +0 -12
- package/dist/commands/migrate/prompt.d.ts +0 -2
- package/dist/commands/migrate/secretlint.d.ts +0 -14
- package/dist/commands/migrate/shared.d.ts +0 -29
- package/dist/commands/migrate/turborepo.d.ts +0 -11
- package/dist/commands/migrate/types.d.ts +0 -27
- package/dist/commands/migrate/verify.d.ts +0 -12
- package/dist/commands/optimize.d.ts +0 -38
- package/dist/commands/pm.d.ts +0 -3
- package/dist/commands/remove.d.ts +0 -3
- package/dist/commands/run.d.ts +0 -16
- package/dist/commands/sbom.d.ts +0 -10
- package/dist/commands/secrets.d.ts +0 -3
- package/dist/commands/sort-package-json.d.ts +0 -3
- package/dist/commands/staged.d.ts +0 -10
- package/dist/commands/status.d.ts +0 -3
- package/dist/commands/sync.d.ts +0 -16
- package/dist/commands/task-why.d.ts +0 -3
- package/dist/commands/unlink.d.ts +0 -3
- package/dist/commands/update.d.ts +0 -3
- package/dist/commands/upgrade.d.ts +0 -3
- package/dist/commands/why.d.ts +0 -3
- package/dist/docker.d.ts +0 -73
- package/dist/flakiness.d.ts +0 -40
- package/dist/generate/discover.d.ts +0 -29
- package/dist/generate/loader.d.ts +0 -15
- package/dist/generate/moon-adapter/filename-interp.d.ts +0 -42
- package/dist/generate/moon-adapter/filters.d.ts +0 -22
- package/dist/generate/moon-adapter/frontmatter.d.ts +0 -39
- package/dist/generate/moon-adapter/index.d.ts +0 -19
- package/dist/generate/moon-adapter/tera-subset.d.ts +0 -85
- package/dist/generate/moon-adapter/util.d.ts +0 -14
- package/dist/generate/prompts.d.ts +0 -25
- package/dist/generate/remote.d.ts +0 -43
- package/dist/generate/runner.d.ts +0 -37
- package/dist/generate/types.d.ts +0 -152
- package/dist/hooks.d.ts +0 -118
- package/dist/native-binding.d.ts +0 -158
- package/dist/output.d.ts +0 -40
- package/dist/overrides.d.ts +0 -82
- package/dist/package-manager.d.ts +0 -23
- package/dist/packem_shared/otelPlugin-CJLkguJ8.js +0 -1
- package/dist/plugins/config-loader.d.ts +0 -3
- package/dist/plugins/otel.d.ts +0 -63
- package/dist/plugins/post-command.d.ts +0 -3
- package/dist/plugins/security-enforcement.d.ts +0 -3
- package/dist/pm-runner.d.ts +0 -44
- package/dist/run-report.d.ts +0 -40
- package/dist/runtime-check.d.ts +0 -27
- package/dist/sbom/cyclonedx.d.ts +0 -39
- package/dist/sbom/installed-package.d.ts +0 -49
- package/dist/sbom/license.d.ts +0 -31
- package/dist/sbom/lockfile.d.ts +0 -34
- package/dist/sbom/purl.d.ts +0 -25
- package/dist/sbom/resolve-specifier.d.ts +0 -24
- package/dist/sbom/types.d.ts +0 -196
- package/dist/secrets/baseline.d.ts +0 -20
- package/dist/secrets/format.d.ts +0 -14
- package/dist/secrets/git.d.ts +0 -6
- package/dist/secrets/spinner.d.ts +0 -9
- package/dist/security.d.ts +0 -64
- package/dist/selectors.d.ts +0 -81
- package/dist/shell-history.d.ts +0 -16
- package/dist/socket-security.d.ts +0 -129
- package/dist/staged/cli-parse.d.ts +0 -18
- package/dist/staged/config.d.ts +0 -14
- package/dist/staged/errors/apply-empty-commit-error.d.ts +0 -4
- package/dist/staged/errors/config-error.d.ts +0 -4
- package/dist/staged/errors/get-backup-stash-error.d.ts +0 -4
- package/dist/staged/errors/git-error.d.ts +0 -6
- package/dist/staged/errors/index.d.ts +0 -12
- package/dist/staged/errors/restore-original-state-error.d.ts +0 -4
- package/dist/staged/errors/staged-error.d.ts +0 -8
- package/dist/staged/errors/task-error.d.ts +0 -6
- package/dist/staged/git/diff.d.ts +0 -76
- package/dist/staged/git/exec.d.ts +0 -43
- package/dist/staged/git/index.d.ts +0 -77
- package/dist/staged/git/stash.d.ts +0 -37
- package/dist/staged/index.d.ts +0 -13
- package/dist/staged/match.d.ts +0 -12
- package/dist/staged/renderer/index.d.ts +0 -9
- package/dist/staged/renderer/ink/index.d.ts +0 -4
- package/dist/staged/renderer/plain.d.ts +0 -12
- package/dist/staged/tasks/build.d.ts +0 -13
- package/dist/staged/tasks/exec.d.ts +0 -56
- package/dist/staged/tasks/run.d.ts +0 -26
- package/dist/staged/types.d.ts +0 -173
- package/dist/target-discovery.d.ts +0 -59
- package/dist/target-options.d.ts +0 -261
- package/dist/tips.d.ts +0 -41
- package/dist/tui/components/CheckProgressApp.d.ts +0 -6
- package/dist/tui/components/CommandSummary.d.ts +0 -17
- package/dist/tui/components/Header.d.ts +0 -13
- package/dist/tui/components/OutputPanel.d.ts +0 -17
- package/dist/tui/components/QuitDialog.d.ts +0 -15
- package/dist/tui/components/TaskListPanel.d.ts +0 -19
- package/dist/tui/components/TaskRow.d.ts +0 -12
- package/dist/tui/components/TaskStore.d.ts +0 -80
- package/dist/tui/components/VisTaskRunnerApp.d.ts +0 -17
- package/dist/tui/components/devcontainer/DevcontainerStore.d.ts +0 -66
- package/dist/tui/components/devcontainer/VisDevcontainerApp.d.ts +0 -9
- package/dist/tui/components/devcontainer/catalogs/extensions.d.ts +0 -8
- package/dist/tui/components/devcontainer/catalogs/features.d.ts +0 -8
- package/dist/tui/components/devcontainer/catalogs/filters.d.ts +0 -4
- package/dist/tui/components/devcontainer/catalogs/mount-suggestions.d.ts +0 -19
- package/dist/tui/components/devcontainer/catalogs/templates.d.ts +0 -8
- package/dist/tui/components/devcontainer/devcontainer-io.d.ts +0 -14
- package/dist/tui/components/devcontainer/sections/DockerComposeSection.d.ts +0 -11
- package/dist/tui/components/devcontainer/sections/EnvironmentSection.d.ts +0 -16
- package/dist/tui/components/devcontainer/sections/ExtensionsSection.d.ts +0 -11
- package/dist/tui/components/devcontainer/sections/FeaturesSection.d.ts +0 -11
- package/dist/tui/components/devcontainer/sections/GeneralSection.d.ts +0 -12
- package/dist/tui/components/devcontainer/sections/LifecycleSection.d.ts +0 -13
- package/dist/tui/components/devcontainer/sections/MountsSection.d.ts +0 -16
- package/dist/tui/components/devcontainer/sections/PortsSection.d.ts +0 -10
- package/dist/tui/components/devcontainer/sections/PreviewPanel.d.ts +0 -11
- package/dist/tui/components/devcontainer/types.d.ts +0 -53
- package/dist/tui/components/devcontainer/validate.d.ts +0 -16
- package/dist/tui/components/graph/GraphStore.d.ts +0 -42
- package/dist/tui/components/graph/ProjectDetailPanel.d.ts +0 -10
- package/dist/tui/components/graph/ProjectListPanel.d.ts +0 -20
- package/dist/tui/components/graph/VisGraphApp.d.ts +0 -8
- package/dist/tui/components/optimize/OptimizeDetailPanel.d.ts +0 -9
- package/dist/tui/components/optimize/OptimizeListPanel.d.ts +0 -16
- package/dist/tui/components/optimize/OptimizeStore.d.ts +0 -50
- package/dist/tui/components/optimize/VisOptimizeApp.d.ts +0 -8
- package/dist/tui/components/optimize/constants.d.ts +0 -7
- package/dist/tui/components/update/PackageDetailPanel.d.ts +0 -12
- package/dist/tui/components/update/PackageListPanel.d.ts +0 -21
- package/dist/tui/components/update/UpdateStore.d.ts +0 -62
- package/dist/tui/components/update/VisUpdateApp.d.ts +0 -18
- package/dist/tui/dynamic-life-cycle.d.ts +0 -22
- package/dist/tui/formatting-utils.d.ts +0 -17
- package/dist/tui/pretty-time.d.ts +0 -8
- package/dist/tui/static-life-cycle.d.ts +0 -28
- package/dist/tui/status-utils.d.ts +0 -20
- package/dist/tui/symbols.d.ts +0 -7
- package/dist/tui/types.d.ts +0 -11
- package/dist/typosquats.d.ts +0 -70
- package/dist/upgrade-check.d.ts +0 -30
- package/dist/utils.d.ts +0 -22
- package/dist/watch.d.ts +0 -65
- package/dist/workspace.d.ts +0 -675
package/dist/config.d.ts
CHANGED
|
@@ -1,82 +1,1087 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { TaskResult, Task, TargetConfiguration, ConstraintsConfig, NamedInputs } from '@visulima/task-runner';
|
|
2
|
+
import { Hookable } from 'hookable';
|
|
3
|
+
/**
|
|
4
|
+
* Typed hook surface exposed to vis plugins.
|
|
5
|
+
*
|
|
6
|
+
* Plugins subscribe via `hooks.hook(name, handler)` — handlers are
|
|
7
|
+
* awaited sequentially in registration order. Returning a promise
|
|
8
|
+
* delays the next hook firing until it resolves, so plugins can
|
|
9
|
+
* safely perform async setup/teardown.
|
|
10
|
+
*
|
|
11
|
+
* Naming deliberately mirrors vite-task / webpack-style verbs:
|
|
12
|
+
* before/after for boundaries, on<Event> for passive observation.
|
|
13
|
+
*/
|
|
14
|
+
interface VisHooks {
|
|
15
|
+
/**
|
|
16
|
+
* Fired after the entire task graph completes (including any
|
|
17
|
+
* failures). `results` maps task ID → {@link TaskResult}.
|
|
18
|
+
*/
|
|
19
|
+
"run:after": (results: Map<string, TaskResult>) => Promise<void> | void;
|
|
20
|
+
/**
|
|
21
|
+
* Fired once before any task in the graph starts, after workspace
|
|
22
|
+
* discovery and graph construction. Throwing aborts the run.
|
|
23
|
+
*/
|
|
24
|
+
"run:before": (context: {
|
|
25
|
+
tasks: Task[];
|
|
26
|
+
workspaceRoot: string;
|
|
27
|
+
}) => Promise<void> | void;
|
|
28
|
+
/**
|
|
29
|
+
* Fired after a task completes (success, failure, or cache hit).
|
|
30
|
+
* Receives the final {@link TaskResult}.
|
|
31
|
+
*/
|
|
32
|
+
"task:after": (task: Task, result: TaskResult) => Promise<void> | void;
|
|
33
|
+
/**
|
|
34
|
+
* Fired before each task begins execution — after scheduling, before
|
|
35
|
+
* the executor runs the command. Throwing aborts that single task.
|
|
36
|
+
*/
|
|
37
|
+
"task:before": (task: Task) => Promise<void> | void;
|
|
38
|
+
/** Fired when a task hit the local or remote cache. */
|
|
39
|
+
"task:cacheHit": (task: Task, result: TaskResult) => Promise<void> | void;
|
|
40
|
+
/**
|
|
41
|
+
* Fired when auto-fingerprint cache diagnostics reports a miss,
|
|
42
|
+
* carrying the human-readable reason string.
|
|
43
|
+
*/
|
|
44
|
+
"task:cacheMiss": (task: Task, reasons: string) => Promise<void> | void;
|
|
45
|
+
/** Fired when a task exits non-zero. */
|
|
46
|
+
"task:failure": (task: Task, result: TaskResult) => Promise<void> | void;
|
|
47
|
+
/**
|
|
48
|
+
* Fired with a stderr chunk as a running task emits it. Plugins
|
|
49
|
+
* that ship logs live (Slack, Datadog) should prefer this over
|
|
50
|
+
* `task:after` so they don't wait for the full buffer.
|
|
51
|
+
*/
|
|
52
|
+
"task:stderr": (task: Task, chunk: string) => Promise<void> | void;
|
|
53
|
+
/**
|
|
54
|
+
* Fired with a stdout chunk as a running task emits it. See
|
|
55
|
+
* `task:stderr` for semantics.
|
|
56
|
+
*/
|
|
57
|
+
"task:stdout": (task: Task, chunk: string) => Promise<void> | void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Public plugin contract. Implementations register handlers by
|
|
61
|
+
* returning a partial {@link VisHooks} map from `hooks`, or by
|
|
62
|
+
* mutating the Hookable instance directly via `setup(hooks)` for
|
|
63
|
+
* advanced cases (dynamic registration, removeHook, etc.).
|
|
64
|
+
*
|
|
65
|
+
* Plugins are loaded in the order they appear in `visConfig.plugins`.
|
|
66
|
+
* Handler execution order within a hook follows registration order,
|
|
67
|
+
* so earlier plugins see events first.
|
|
68
|
+
*/
|
|
69
|
+
interface VisPlugin {
|
|
70
|
+
/**
|
|
71
|
+
* Declarative handlers — the common shape. One entry per hook
|
|
72
|
+
* name; pass a function or an array of functions (all run serially
|
|
73
|
+
* in order).
|
|
74
|
+
*/
|
|
75
|
+
hooks?: Partial<{ [K in keyof VisHooks]: VisHooks[K] | VisHooks[K][] }>;
|
|
76
|
+
/** Plugin name — surfaced in debug logs. */
|
|
77
|
+
name: string;
|
|
78
|
+
/**
|
|
79
|
+
* Imperative setup — receives the shared Hookable instance so the
|
|
80
|
+
* plugin can register hooks conditionally, unregister later, or
|
|
81
|
+
* use advanced APIs like `hookOnce`/`beforeEach`/`afterEach`.
|
|
82
|
+
*/
|
|
83
|
+
setup?: (hooks: Hookable<VisHooks>) => Promise<void> | void;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Custom task form — `{ title, task }` — analogous to lint-staged's
|
|
87
|
+
* listr-style task objects. `task` receives the matched absolute paths
|
|
88
|
+
* and returns a promise that resolves on success or rejects on failure.
|
|
89
|
+
*/
|
|
90
|
+
interface CustomTask {
|
|
91
|
+
readonly task: (files: string[]) => Promise<unknown> | unknown;
|
|
92
|
+
readonly title: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* A task value as authored by the user. Command strings are split into
|
|
96
|
+
* argv and invoked with the matched file paths appended. Arrays run
|
|
97
|
+
* serially. Functions receive the matched paths and return further
|
|
98
|
+
* task values (possibly async). `{ title, task }` objects run `task`
|
|
99
|
+
* directly with no argv construction.
|
|
100
|
+
*/
|
|
101
|
+
type StagedTask = CustomTask | StagedTaskFunction | ReadonlyArray<CustomTask | StagedTaskFunction | string> | string | ReadonlyArray<string>;
|
|
102
|
+
type StagedTaskFunction = (files: string[]) => Promise<StagedTaskResult> | StagedTaskResult;
|
|
103
|
+
type StagedTaskResult = CustomTask | ReadonlyArray<CustomTask | string> | string | ReadonlyArray<string>;
|
|
104
|
+
/**
|
|
105
|
+
* Config object mapping glob patterns (basename or path-style) to tasks.
|
|
106
|
+
* A top-level function form lets the user generate the entire config
|
|
107
|
+
* from the staged file list.
|
|
108
|
+
*/
|
|
109
|
+
type StagedConfig = Readonly<Record<string, StagedTask>> | StagedConfigFunction;
|
|
110
|
+
type StagedConfigFunction = (files: string[]) => Promise<Record<string, StagedTask>> | Record<string, StagedTask>;
|
|
111
|
+
/**
|
|
112
|
+
* Semantic classification for a target.
|
|
113
|
+
* - `build`: Generates one or more artifacts; cached by default.
|
|
114
|
+
* - `test`: Validation task (lint, typecheck, unit test). Default type.
|
|
115
|
+
* - `run`: One-off or long-running process. Not cached by default.
|
|
116
|
+
*/
|
|
117
|
+
type TargetType = "build" | "run" | "test";
|
|
118
|
+
/**
|
|
119
|
+
* Preset bundles of target options.
|
|
120
|
+
* - `server`: Long-running local dev server — caching off, not in CI,
|
|
121
|
+
* interactive, persistent.
|
|
122
|
+
* - `utility`: Short-lived helper — caching off, not in CI.
|
|
123
|
+
*/
|
|
124
|
+
type TargetPreset = "server" | "utility";
|
|
125
|
+
/**
|
|
126
|
+
* Controls whether a target runs in CI.
|
|
127
|
+
* - `true` (default): Always run.
|
|
128
|
+
* - `false`: Never run in CI (local-only).
|
|
129
|
+
* - `"affected"`: Only when the project is affected by the current change set.
|
|
130
|
+
* - `"always"`: Always run, even if unaffected.
|
|
131
|
+
*/
|
|
132
|
+
type RunInCI = "affected" | "always" | boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Controls how affected files are forwarded to a task.
|
|
135
|
+
* - `false` (default): Do not forward.
|
|
136
|
+
* - `"args"`: Append affected paths as additional command arguments.
|
|
137
|
+
* - `"env"`: Expose them via `VIS_AFFECTED_FILES` environment variable.
|
|
138
|
+
* - `"both"`: Both of the above.
|
|
139
|
+
*/
|
|
140
|
+
type AffectedFilesMode = "args" | "both" | "env" | false;
|
|
141
|
+
/** Supported OS filters for target execution. */
|
|
142
|
+
type TargetOsType = "linux" | "macos" | "windows";
|
|
143
|
+
/**
|
|
144
|
+
* Vis-specific target options that extend the task-runner's
|
|
145
|
+
* base `TargetConfiguration`. These live under `target.options` and are
|
|
146
|
+
* interpreted by vis before handing the task off to task-runner.
|
|
147
|
+
*/
|
|
148
|
+
/**
|
|
149
|
+
* Object form of the `when` gate. Matches against process.env or
|
|
150
|
+
* process.platform — deliberately small surface area so conditions
|
|
151
|
+
* stay auditable and declarative.
|
|
152
|
+
*/
|
|
153
|
+
interface TargetConditionObject {
|
|
154
|
+
/** Env var name to compare against `equals` or `in`. */
|
|
155
|
+
env?: string;
|
|
156
|
+
/** Value that `env` must match exactly. */
|
|
157
|
+
equals?: string;
|
|
158
|
+
/** Any value in this list matches. Ignored when `equals` is set. */
|
|
159
|
+
in?: string[];
|
|
160
|
+
/** Run only on this platform (or one of these). */
|
|
161
|
+
platform?: NodeJS.Platform | NodeJS.Platform[];
|
|
162
|
+
}
|
|
163
|
+
interface VisTargetOptions {
|
|
164
|
+
/**
|
|
165
|
+
* How to forward affected files to the task process.
|
|
166
|
+
* Only used when invoked via `vis affected <target>`.
|
|
167
|
+
* @default false
|
|
168
|
+
*/
|
|
169
|
+
affectedFiles?: AffectedFilesMode;
|
|
170
|
+
/**
|
|
171
|
+
* Load environment variables from dotenv file(s) before running.
|
|
172
|
+
* - `string`: a single file path (relative to project root).
|
|
173
|
+
* - `string[]`: multiple files — later entries override earlier ones,
|
|
174
|
+
* so put more-specific files last (e.g. `[".env", ".env.local"]`).
|
|
175
|
+
* - `true`: auto-cascade in the Next/Vite order:
|
|
176
|
+
* `.env` → `.env.{NODE_ENV}` → `.env.local` → `.env.{NODE_ENV}.local`.
|
|
177
|
+
* Skips `.env.local` when NODE_ENV is `test`, matching Next.js.
|
|
178
|
+
*/
|
|
179
|
+
envFile?: boolean | string | string[];
|
|
180
|
+
/**
|
|
181
|
+
* When true, the task is serialized with respect to parallel execution
|
|
182
|
+
* and must be run on the main process (claims stdin). Used for commands
|
|
183
|
+
* that read from the terminal.
|
|
184
|
+
* @default false
|
|
185
|
+
*/
|
|
186
|
+
interactive?: boolean;
|
|
187
|
+
/**
|
|
188
|
+
* When true, the task is hidden from CLI listings and can only be invoked
|
|
189
|
+
* as a dependency of another task.
|
|
190
|
+
* @default false
|
|
191
|
+
*/
|
|
192
|
+
internal?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Serializes all tasks that share the same mutex name. Useful for tasks
|
|
195
|
+
* that contend on a shared resource (e.g., a database migration).
|
|
196
|
+
*/
|
|
197
|
+
mutex?: string;
|
|
198
|
+
/**
|
|
199
|
+
* Restricts execution to specific operating systems. Tasks run on
|
|
200
|
+
* unmatched platforms are skipped with a warning.
|
|
201
|
+
*/
|
|
202
|
+
osType?: TargetOsType | TargetOsType[];
|
|
203
|
+
/**
|
|
204
|
+
* When true, the task is a long-running / never-ending process.
|
|
205
|
+
* Persistent tasks are scheduled last, execute after all cacheable
|
|
206
|
+
* tasks complete, and are never cached.
|
|
207
|
+
* @default false
|
|
208
|
+
*/
|
|
209
|
+
persistent?: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* A preset that pre-fills a common bundle of options.
|
|
212
|
+
* User-provided fields always take precedence over the preset.
|
|
213
|
+
*/
|
|
214
|
+
preset?: TargetPreset;
|
|
215
|
+
/**
|
|
216
|
+
* Run the task through a pseudo-terminal so color-aware tools
|
|
217
|
+
* (vitest, eslint, biome, …) render as if attached to a real TTY
|
|
218
|
+
* instead of a pipe. Output is captured via task-runner's
|
|
219
|
+
* `TerminalBuffer` so ANSI escapes are normalized into the final
|
|
220
|
+
* rendered state before reaching the reporter.
|
|
221
|
+
*
|
|
222
|
+
* Forces cache to off — PTY output can include timing-dependent
|
|
223
|
+
* frames (spinners) that aren't safe to replay from a cache.
|
|
224
|
+
* @default false
|
|
225
|
+
*/
|
|
226
|
+
pty?: boolean;
|
|
227
|
+
/**
|
|
228
|
+
* Number of times to retry the task on failure. Uses an exponential
|
|
229
|
+
* backoff by default (1s, 2s, 4s, ...).
|
|
230
|
+
* @default 0
|
|
231
|
+
*/
|
|
232
|
+
retryCount?: number;
|
|
233
|
+
/**
|
|
234
|
+
* Delay between retry attempts in milliseconds, or `"exponential"`
|
|
235
|
+
* for 2^attempt * 1000 ms.
|
|
236
|
+
* @default "exponential"
|
|
237
|
+
*/
|
|
238
|
+
retryDelay?: number | "exponential";
|
|
239
|
+
/**
|
|
240
|
+
* When true, the command executes with the workspace root as CWD
|
|
241
|
+
* instead of the project root.
|
|
242
|
+
* @default false
|
|
243
|
+
*/
|
|
244
|
+
runFromWorkspaceRoot?: boolean;
|
|
245
|
+
/**
|
|
246
|
+
* Controls whether the task runs in CI environments.
|
|
247
|
+
* @default true
|
|
248
|
+
*/
|
|
249
|
+
runInCI?: RunInCI;
|
|
250
|
+
/**
|
|
251
|
+
* Per-target shell override. When set, the command runs through this
|
|
252
|
+
* shell instead of the platform default.
|
|
253
|
+
*/
|
|
254
|
+
shell?: string;
|
|
255
|
+
/**
|
|
256
|
+
* Maximum wall-clock milliseconds a single task run is allowed to
|
|
257
|
+
* take before being killed. `0` / `undefined` means no timeout.
|
|
258
|
+
*
|
|
259
|
+
* When the timeout fires the task is sent SIGTERM then SIGKILL
|
|
260
|
+
* (via the concurrent runner's `killSignal`/`killTimeout`
|
|
261
|
+
* semantics) and the task exits with a failure status carrying the
|
|
262
|
+
* `[timeout]` marker in `terminalOutput`. Retries count against
|
|
263
|
+
* this per-attempt, not cumulatively.
|
|
264
|
+
*
|
|
265
|
+
* Use this to prevent runaway tasks from eating CI wall-clock time
|
|
266
|
+
* up to the job-level cutoff.
|
|
267
|
+
*/
|
|
268
|
+
timeout?: number;
|
|
269
|
+
/**
|
|
270
|
+
* Per-target unix shell override, used on Linux and macOS.
|
|
271
|
+
* Takes precedence over `shell` on unix-like systems.
|
|
272
|
+
*/
|
|
273
|
+
unixShell?: string;
|
|
274
|
+
/**
|
|
275
|
+
* Conditional gate: the task is scheduled only when `when` evaluates
|
|
276
|
+
* truthy. Shapes:
|
|
277
|
+
* - `"$VAR"` — run only if the env var is non-empty
|
|
278
|
+
* - `"!VAR"` — run only if the env var is empty/unset
|
|
279
|
+
* - `{ env: "NAME", equals: "value" }` — run only if env equals
|
|
280
|
+
* - `{ env: "NAME", in: ["a", "b"] }` — run only if env is in set
|
|
281
|
+
* - `{ platform: "darwin" | "linux" | "win32" }` — OS gate
|
|
282
|
+
*
|
|
283
|
+
* Kept declarative on purpose — no dynamic code execution. For
|
|
284
|
+
* richer logic, use osType/runInCI or a pre-hook script.
|
|
285
|
+
*/
|
|
286
|
+
when?: TargetConditionObject | string;
|
|
287
|
+
/**
|
|
288
|
+
* Per-target windows shell override, used on Windows.
|
|
289
|
+
* Takes precedence over `shell` on Windows.
|
|
290
|
+
*/
|
|
291
|
+
windowsShell?: string;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* An extended target configuration that adds the vis-specific options
|
|
295
|
+
* on top of task-runner's `TargetConfiguration`.
|
|
296
|
+
*/
|
|
297
|
+
interface VisTargetConfiguration extends Omit<TargetConfiguration, "options"> {
|
|
298
|
+
/**
|
|
299
|
+
* Alternate names that resolve to this target on the CLI. Useful
|
|
300
|
+
* for shortening long canonical names (`test` ↔ `t`) or for
|
|
301
|
+
* offering migration-friendly aliases when renaming targets.
|
|
302
|
+
* Aliases must be globally unique within the workspace.
|
|
303
|
+
*/
|
|
304
|
+
aliases?: string[];
|
|
305
|
+
/**
|
|
306
|
+
* One-line description surfaced by `vis list` and (in future)
|
|
307
|
+
* per-task `--help`. Kept short — longer docs belong in project
|
|
308
|
+
* READMEs or vis.config.ts comments.
|
|
309
|
+
*/
|
|
310
|
+
description?: string;
|
|
311
|
+
/** Vis-specific target options. */
|
|
312
|
+
options?: VisTargetOptions;
|
|
313
|
+
/** Preset applied before user-specified options. */
|
|
314
|
+
preset?: TargetPreset;
|
|
315
|
+
/**
|
|
316
|
+
* Semantic task type. Affects caching defaults and CI filtering.
|
|
317
|
+
* @default "test"
|
|
318
|
+
*/
|
|
319
|
+
type?: TargetType;
|
|
320
|
+
}
|
|
321
|
+
type VersionManagerName = "asdf" | "corepack" | "fnm" | "mise" | "none" | "nvm" | "proto" | "self-activate" | "volta";
|
|
322
|
+
type RuntimeTool = "bun" | "deno" | "go" | "node" | "npm" | "pnpm" | "python" | "ruby" | "rust" | "yarn";
|
|
323
|
+
interface ToolchainConfig {
|
|
324
|
+
/**
|
|
325
|
+
* When a tool pin doesn't match the running version, try to fix it
|
|
326
|
+
* automatically before `vis run` / `vis ci` proceed. Defaults to
|
|
327
|
+
* `true` when {@link findInstalledManagers} reports at least one
|
|
328
|
+
* installed manager, `false` otherwise.
|
|
329
|
+
*
|
|
330
|
+
* Set to `false` to keep the doctor-style warning behaviour and
|
|
331
|
+
* make users run `vis toolchain install` themselves.
|
|
332
|
+
*/
|
|
333
|
+
readonly autoInstall?: boolean;
|
|
334
|
+
/** Explicit manager override, useful in CI. */
|
|
335
|
+
readonly preferredManager?: VersionManagerName;
|
|
336
|
+
/** Overrides for engines/packageManager-derived pins. */
|
|
337
|
+
readonly tools?: Partial<Record<RuntimeTool, string>>;
|
|
338
|
+
}
|
|
339
|
+
interface CodeownersConfig {
|
|
340
|
+
/** Workspace-level paths that apply outside any project (e.g., `.github/**`). */
|
|
341
|
+
globalPaths?: Record<string, string[]>;
|
|
342
|
+
/** Sort order for generated entries — mirrors moon's `orderBy`. */
|
|
343
|
+
orderBy?: "file-source" | "project-id";
|
|
344
|
+
/** Provider determines whether `channel` is emitted (GitHub supports it via comment). */
|
|
345
|
+
provider?: "bitbucket" | "github" | "gitlab" | "other";
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Declared code-owner assignment for a path glob within a project.
|
|
349
|
+
* Mirrors moon's `owners` shape so migrations can round-trip cleanly.
|
|
350
|
+
*/
|
|
351
|
+
interface OwnersEntry {
|
|
352
|
+
/** Optional notification channel (e.g. Slack, Teams). */
|
|
353
|
+
channel?: string;
|
|
354
|
+
/** Owner handles (e.g. `@visulima/core-team`). */
|
|
355
|
+
owners: string[];
|
|
356
|
+
/** File/glob pattern relative to the project root. */
|
|
357
|
+
path: string;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Per-project metadata surfaced by `project.json`. Extended beyond the
|
|
361
|
+
* minimal `projectType` / `tags` / `sourceRoot` fields we historically
|
|
362
|
+
* parsed to include targets, owners, and layer/stack classification.
|
|
363
|
+
*/
|
|
364
|
+
interface ProjectJson {
|
|
365
|
+
/** Implicit dependencies on other projects. */
|
|
366
|
+
implicitDependencies?: string[];
|
|
367
|
+
/** Primary language — informational and query-able. */
|
|
368
|
+
language?: string;
|
|
369
|
+
/** Project layer, used for constraint inheritance and query filtering. */
|
|
370
|
+
layer?: "application" | "automation" | "configuration" | "library" | "scaffolding" | "tool";
|
|
371
|
+
/** Code owners for paths inside this project. */
|
|
372
|
+
owners?: OwnersEntry[];
|
|
373
|
+
/** Project-level metadata. */
|
|
374
|
+
project?: {
|
|
375
|
+
channel?: string;
|
|
376
|
+
description?: string;
|
|
377
|
+
maintainers?: string[];
|
|
378
|
+
owner?: string;
|
|
379
|
+
title?: string;
|
|
380
|
+
};
|
|
381
|
+
/** Project type — library or application. */
|
|
382
|
+
projectType?: "application" | "library";
|
|
383
|
+
/** Source root, used for display and language inference. */
|
|
384
|
+
sourceRoot?: string;
|
|
385
|
+
/** Tech stack. */
|
|
386
|
+
stack?: "backend" | "data" | "frontend" | "infrastructure" | "systems";
|
|
387
|
+
/** Filterable tags. */
|
|
388
|
+
tags?: string[];
|
|
389
|
+
/** Vis-style target definitions (merged on top of package.json scripts). */
|
|
390
|
+
targets?: Record<string, VisTargetConfiguration>;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* A scope predicate used by {@link VisConfig.taskDefaults}.
|
|
394
|
+
* All listed constraints must match for the block to apply.
|
|
395
|
+
*/
|
|
396
|
+
interface TaskDefaultsScope {
|
|
397
|
+
/** Match on primary language. */
|
|
398
|
+
language?: string | string[];
|
|
399
|
+
/** Match on project layer. */
|
|
400
|
+
layer?: ProjectJson["layer"] | ProjectJson["layer"][];
|
|
401
|
+
/** Match on project type. */
|
|
402
|
+
projectType?: "application" | "library";
|
|
403
|
+
/** Match on project stack. */
|
|
404
|
+
stack?: ProjectJson["stack"] | ProjectJson["stack"][];
|
|
405
|
+
/** Match projects tagged with any of these tags. */
|
|
406
|
+
tags?: string[];
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* A single task-defaults block — a set of target defaults gated by an
|
|
410
|
+
* optional scope predicate.
|
|
411
|
+
*/
|
|
412
|
+
interface TaskDefaultsBlock {
|
|
413
|
+
/** Optional scope predicate; if omitted, the block applies universally. */
|
|
414
|
+
scope?: TaskDefaultsScope;
|
|
415
|
+
/** Target default configurations. */
|
|
416
|
+
targets: Record<string, Partial<VisTargetConfiguration>>;
|
|
417
|
+
}
|
|
418
|
+
interface VisConfig {
|
|
419
|
+
/** AI analysis configuration */
|
|
420
|
+
ai?: {
|
|
421
|
+
/** Cache TTL in milliseconds. Overrides default (1h / 30min for security). */
|
|
422
|
+
cacheTtl?: number;
|
|
423
|
+
/** Override default provider priority. Higher number = preferred. */
|
|
424
|
+
priority?: Record<string, number>;
|
|
425
|
+
/** Use a specific provider instead of auto-detecting (e.g., `"claude"`, `"gemini"`). */
|
|
426
|
+
provider?: string;
|
|
427
|
+
};
|
|
428
|
+
/**
|
|
429
|
+
* Scope the task-runner cache directory by the current git branch.
|
|
430
|
+
* When `true`, caches are stored under `<cacheDir>/branches/<slug>`
|
|
431
|
+
* so `main` and feature branches stop thrashing each other —
|
|
432
|
+
* generated artefacts (schemas, `.d.ts` snapshots) that legitimately
|
|
433
|
+
* differ across branches no longer oscillate the cache contents.
|
|
434
|
+
*
|
|
435
|
+
* Falls back to the unscoped path on detached HEAD, non-git
|
|
436
|
+
* workspaces, or when git isn't available.
|
|
437
|
+
* @default false
|
|
438
|
+
*/
|
|
439
|
+
branchScopedCache?: boolean;
|
|
440
|
+
/**
|
|
441
|
+
* Code ownership configuration. Controls how `vis sync codeowners`
|
|
442
|
+
* renders the generated CODEOWNERS file.
|
|
443
|
+
*/
|
|
444
|
+
codeowners?: CodeownersConfig;
|
|
445
|
+
/**
|
|
446
|
+
* Project dependency constraints.
|
|
447
|
+
* Enforced after building the project graph, before running tasks.
|
|
448
|
+
*/
|
|
449
|
+
constraints?: ConstraintsConfig;
|
|
450
|
+
/**
|
|
451
|
+
* Configuration for the `vis create` scaffolding command.
|
|
452
|
+
* Controls template downloads (via giget), default options, and
|
|
453
|
+
* post-creation behavior.
|
|
454
|
+
*/
|
|
455
|
+
create?: {
|
|
456
|
+
/**
|
|
457
|
+
* Authorization token for downloading private repository templates.
|
|
458
|
+
* Passed as Bearer token to the git host API.
|
|
459
|
+
* Can also be set via GIGET_AUTH, GITHUB_TOKEN, or GH_TOKEN environment variables.
|
|
460
|
+
*/
|
|
461
|
+
auth?: string;
|
|
462
|
+
/**
|
|
463
|
+
* Default editor to configure after scaffolding.
|
|
464
|
+
* When set, `vis create` automatically generates editor config files.
|
|
465
|
+
* @example "vscode"
|
|
466
|
+
*/
|
|
467
|
+
defaultEditor?: "vscode";
|
|
468
|
+
/**
|
|
469
|
+
* Default package manager for new standalone projects.
|
|
470
|
+
* When set, skips the PM selection prompt in interactive mode.
|
|
471
|
+
*/
|
|
472
|
+
defaultPm?: "bun" | "npm" | "pnpm" | "yarn";
|
|
473
|
+
/**
|
|
474
|
+
* Default giget provider for `owner/repo` shorthand inputs.
|
|
475
|
+
* @default "github"
|
|
476
|
+
*/
|
|
477
|
+
defaultProvider?: "bitbucket" | "github" | "gitlab" | "sourcehut";
|
|
478
|
+
/**
|
|
479
|
+
* Initialize a git repository after scaffolding standalone projects.
|
|
480
|
+
* @default false
|
|
481
|
+
*/
|
|
482
|
+
gitInit?: boolean;
|
|
483
|
+
/**
|
|
484
|
+
* Install dependencies automatically after scaffolding.
|
|
485
|
+
* @default true
|
|
486
|
+
*/
|
|
487
|
+
install?: boolean;
|
|
488
|
+
/**
|
|
489
|
+
* Prefer locally cached templates over re-downloading.
|
|
490
|
+
* Useful for offline development or slow connections.
|
|
491
|
+
* @default false
|
|
492
|
+
*/
|
|
493
|
+
preferOffline?: boolean;
|
|
494
|
+
/**
|
|
495
|
+
* Custom template registry URL.
|
|
496
|
+
* When set, giget checks this registry for template metadata
|
|
497
|
+
* before falling back to direct provider resolution.
|
|
498
|
+
* Set to `false` to disable registry lookup entirely.
|
|
499
|
+
* @see https://github.com/unjs/giget#custom-registry
|
|
500
|
+
*/
|
|
501
|
+
registry?: false | string;
|
|
502
|
+
/**
|
|
503
|
+
* Named template aliases for quick access.
|
|
504
|
+
* Maps short names to full giget source strings.
|
|
505
|
+
* @example
|
|
506
|
+
* ```
|
|
507
|
+
* templates: {
|
|
508
|
+
* "react": "github:vitejs/vite/packages/create-vite/template-react-ts",
|
|
509
|
+
* "lib": "github:my-org/lib-template",
|
|
510
|
+
* "internal": "gitlab:company/templates/node-service",
|
|
511
|
+
* }
|
|
512
|
+
* ```
|
|
513
|
+
*/
|
|
514
|
+
templates?: Record<string, string>;
|
|
515
|
+
};
|
|
516
|
+
/**
|
|
517
|
+
* Named file-group patterns, reusable from target `inputs` via the
|
|
518
|
+
* `@filegroup:<name>` token. File groups are resolved relative to each
|
|
519
|
+
* project root at discovery time.
|
|
520
|
+
* @example
|
|
521
|
+
* ```
|
|
522
|
+
* fileGroups: {
|
|
523
|
+
* sources: ["src/**\/*.ts", "!src/**\/*.test.ts"],
|
|
524
|
+
* tests: ["**\/*.test.ts"],
|
|
525
|
+
* }
|
|
526
|
+
* ```
|
|
527
|
+
*/
|
|
528
|
+
fileGroups?: Record<string, string[]>;
|
|
529
|
+
/**
|
|
530
|
+
* Configuration for the `vis generate` in-repo scaffolding command.
|
|
531
|
+
* Points at additional template directories beyond the defaults
|
|
532
|
+
* (`.vis/templates/` and `.moon/templates/`).
|
|
533
|
+
*/
|
|
534
|
+
generator?: {
|
|
535
|
+
/**
|
|
536
|
+
* Authorization token forwarded to giget when fetching
|
|
537
|
+
* `git://`/`npm://` remote templates. Falls back to
|
|
538
|
+
* `GIGET_AUTH` / `GITHUB_TOKEN` / `GH_TOKEN` env vars.
|
|
539
|
+
*/
|
|
540
|
+
auth?: string;
|
|
541
|
+
/**
|
|
542
|
+
* Prefer locally cached remote templates over re-downloading.
|
|
543
|
+
* Overridable per invocation via `--prefer-offline`.
|
|
544
|
+
* @default false
|
|
545
|
+
*/
|
|
546
|
+
preferOffline?: boolean;
|
|
547
|
+
/**
|
|
548
|
+
* Extra directories to scan for templates. Each directory is
|
|
549
|
+
* checked for both native templates (`<name>.ts`) and
|
|
550
|
+
* moon-format directories (containing `template.yml`).
|
|
551
|
+
* @example
|
|
552
|
+
* ```
|
|
553
|
+
* generator: {
|
|
554
|
+
* templates: ["./tools/generators", "./packages/scaffolding/templates"],
|
|
555
|
+
* }
|
|
556
|
+
* ```
|
|
557
|
+
*/
|
|
558
|
+
templates?: string[];
|
|
559
|
+
};
|
|
560
|
+
/**
|
|
561
|
+
* Named input patterns inherited by every project target. Equivalent
|
|
562
|
+
* to task-runner's `namedInputs` but configurable from the vis config.
|
|
563
|
+
*/
|
|
564
|
+
namedInputs?: NamedInputs;
|
|
565
|
+
/** Package override mappings applied during migration (e.g., `{ "lodash": "lodash-es" }`) */
|
|
566
|
+
overrides?: Record<string, string>;
|
|
567
|
+
/**
|
|
568
|
+
* Plugins — each plugin registers typed hooks that fire at run /
|
|
569
|
+
* task / cache boundaries. See {@link VisPlugin} for the contract.
|
|
570
|
+
* Prefer plugins over per-target shell hooks when behaviour needs
|
|
571
|
+
* access to task metadata, results, or cache state.
|
|
572
|
+
*/
|
|
573
|
+
plugins?: VisPlugin[];
|
|
574
|
+
/**
|
|
575
|
+
* Default options for `vis secrets`. CLI flags always take precedence;
|
|
576
|
+
* this block provides workspace-wide defaults so teams can commit config
|
|
577
|
+
* once and every invocation picks it up.
|
|
578
|
+
*/
|
|
579
|
+
secrets?: {
|
|
580
|
+
/** Path to a baseline of previously-triaged findings (relative to workspace root). */
|
|
581
|
+
baseline?: string;
|
|
582
|
+
/** Where the ruleset comes from. Omit for the bundled gitleaks default. */
|
|
583
|
+
config?: {
|
|
584
|
+
/** Layer the user's rules on top of the bundled ruleset. Default: `true`. */
|
|
585
|
+
extendBundled?: boolean;
|
|
586
|
+
/** Inline rule overrides. Wins over `path` when both are set. */
|
|
587
|
+
inline?: {
|
|
588
|
+
allowlist?: unknown;
|
|
589
|
+
allowlists?: unknown[];
|
|
590
|
+
description?: string;
|
|
591
|
+
rules?: unknown[];
|
|
592
|
+
title?: string;
|
|
593
|
+
};
|
|
594
|
+
/** Path to a JSON config (gitleaks-compatible). */
|
|
595
|
+
path?: string;
|
|
596
|
+
/** Bundled presets layered on top of the default ruleset (e.g. `"weak-passwords"`). */
|
|
597
|
+
presets?: string[];
|
|
598
|
+
};
|
|
599
|
+
/** Redact secret values in findings. */
|
|
600
|
+
redact?: boolean;
|
|
601
|
+
/** Rule-id filters applied after scanning. */
|
|
602
|
+
rules?: {
|
|
603
|
+
/** Drop findings whose ruleId matches. */
|
|
604
|
+
exclude?: string[];
|
|
605
|
+
/** Only report findings whose ruleId matches. */
|
|
606
|
+
include?: string[];
|
|
607
|
+
};
|
|
608
|
+
/** Walker / filesystem traversal. */
|
|
609
|
+
walk?: {
|
|
610
|
+
/**
|
|
611
|
+
* Paths to additional `.gitignore`-syntax files (e.g. `.secretsignore`).
|
|
612
|
+
*/
|
|
613
|
+
excludeFromFiles?: string[];
|
|
614
|
+
/**
|
|
615
|
+
* Gitignore-syntax patterns (supports negation, directory markers, leading `/`).
|
|
616
|
+
* Applied on top of `.gitignore`.
|
|
617
|
+
*/
|
|
618
|
+
excludePatterns?: string[];
|
|
619
|
+
/** Respect `.gitignore`. Default: `true`. */
|
|
620
|
+
gitignore?: boolean;
|
|
621
|
+
/** Include hidden (dotfile) entries. Default: `false`. */
|
|
622
|
+
includeHidden?: boolean;
|
|
623
|
+
/** Max file size in bytes. Default 10 MiB. */
|
|
624
|
+
maxFileSize?: number;
|
|
625
|
+
};
|
|
626
|
+
};
|
|
627
|
+
/**
|
|
628
|
+
* Supply chain security settings.
|
|
629
|
+
* These settings are inspired by pnpm's security features and are applied
|
|
630
|
+
* universally across all package managers (pnpm, npm, yarn, bun).
|
|
631
|
+
*
|
|
632
|
+
* For pnpm users: these map directly to pnpm-workspace.yaml settings.
|
|
633
|
+
* For npm/yarn/bun users: vis enforces these at the vis layer since
|
|
634
|
+
* those package managers lack native support.
|
|
635
|
+
*/
|
|
636
|
+
security?: {
|
|
637
|
+
/**
|
|
638
|
+
* Map of package names/patterns to allow (true) or deny (false) build scripts.
|
|
639
|
+
* Packages not listed are denied by default.
|
|
640
|
+
* Equivalent to pnpm's `allowBuilds` setting.
|
|
641
|
+
* @example
|
|
642
|
+
* ```
|
|
643
|
+
* allowBuilds: {
|
|
644
|
+
* "esbuild": true,
|
|
645
|
+
* "core-js": false,
|
|
646
|
+
* "@prisma/client": true,
|
|
647
|
+
* }
|
|
648
|
+
* ```
|
|
649
|
+
*/
|
|
650
|
+
allowBuilds?: Record<string, boolean>;
|
|
651
|
+
/**
|
|
652
|
+
* When true, prevents transitive dependencies from using exotic sources
|
|
653
|
+
* (git repositories, direct tarball URLs). Only direct dependencies may
|
|
654
|
+
* use such sources. Equivalent to pnpm's `blockExoticSubdeps`.
|
|
655
|
+
* @default false
|
|
656
|
+
*/
|
|
657
|
+
blockExoticSubdeps?: boolean;
|
|
658
|
+
/**
|
|
659
|
+
* Minimum number of minutes that must pass after a version is published
|
|
660
|
+
* before vis will allow installation. Reduces risk of installing
|
|
661
|
+
* compromised packages that are typically discovered within hours.
|
|
662
|
+
* Equivalent to pnpm's `minimumReleaseAge`.
|
|
663
|
+
* @default 0
|
|
664
|
+
* @example 1440 // 24 hours
|
|
665
|
+
*/
|
|
666
|
+
minimumReleaseAge?: number;
|
|
667
|
+
/**
|
|
668
|
+
* Package names/patterns excluded from minimumReleaseAge check.
|
|
669
|
+
* Equivalent to pnpm's `minimumReleaseAgeExclude`.
|
|
670
|
+
* @example ["webpack", "react", "@myorg/*"]
|
|
671
|
+
*/
|
|
672
|
+
minimumReleaseAgeExclude?: string[];
|
|
673
|
+
/**
|
|
674
|
+
* Socket.dev security intelligence configuration.
|
|
675
|
+
* When enabled, vis fetches package security scores, alerts, and report
|
|
676
|
+
* data from the Socket.dev API during install, update, and check commands.
|
|
677
|
+
* @see https://socket.dev
|
|
678
|
+
*/
|
|
679
|
+
socket?: {
|
|
680
|
+
/**
|
|
681
|
+
* Packages whose low Socket.dev scores or alerts have been reviewed
|
|
682
|
+
* and explicitly accepted. These packages skip the confirmation
|
|
683
|
+
* prompt during `vis add` and show as "acknowledged" in `vis audit`.
|
|
684
|
+
*
|
|
685
|
+
* Key format: package name (`"lodash"`), name@version
|
|
686
|
+
* (`"lodash@4.17.21"`), or glob (`"@myorg/*"`).
|
|
687
|
+
* Unversioned keys match all versions of that package.
|
|
688
|
+
* @example
|
|
689
|
+
* ```
|
|
690
|
+
* acceptedRisks: {
|
|
691
|
+
* "some-risky-pkg": {
|
|
692
|
+
* reason: "Internal fork, low score expected",
|
|
693
|
+
* acceptedAt: "2026-03-15T10:00:00Z",
|
|
694
|
+
* acceptedScore: 0.25,
|
|
695
|
+
* },
|
|
696
|
+
* }
|
|
697
|
+
* ```
|
|
698
|
+
*/
|
|
699
|
+
acceptedRisks?: Record<string, {
|
|
700
|
+
/** ISO 8601 timestamp when the risk was accepted. */
|
|
701
|
+
acceptedAt: string;
|
|
702
|
+
/** The overall Socket.dev score at the time of acceptance. */
|
|
703
|
+
acceptedScore: number;
|
|
704
|
+
/** User-provided reason for accepting the risk. */
|
|
705
|
+
reason: string;
|
|
706
|
+
}>;
|
|
707
|
+
/**
|
|
708
|
+
* Custom Socket.dev API token. Falls back to the public API token.
|
|
709
|
+
* Set via VIS_SOCKET_TOKEN environment variable or here.
|
|
710
|
+
*/
|
|
711
|
+
apiToken?: string;
|
|
712
|
+
/**
|
|
713
|
+
* Cache TTL in milliseconds for Socket.dev reports.
|
|
714
|
+
* @default 3_600_000 (1 hour)
|
|
715
|
+
*/
|
|
716
|
+
cacheTtlMs?: number;
|
|
717
|
+
/**
|
|
718
|
+
* Enable Socket.dev security scanning on install/update/check commands.
|
|
719
|
+
* @default false
|
|
720
|
+
*/
|
|
721
|
+
enabled?: boolean;
|
|
722
|
+
/**
|
|
723
|
+
* Minimum overall Socket.dev score (0–1) for a package to be
|
|
724
|
+
* accepted without a confirmation prompt during `vis add`.
|
|
725
|
+
* Packages scoring below this threshold trigger an interactive
|
|
726
|
+
* prompt asking the user to confirm. Set to 0 to disable.
|
|
727
|
+
* @default 0.4
|
|
728
|
+
*/
|
|
729
|
+
minimumScore?: number;
|
|
730
|
+
/**
|
|
731
|
+
* Request timeout in milliseconds for the Socket.dev API.
|
|
732
|
+
* @default 15_000 (15 seconds)
|
|
733
|
+
*/
|
|
734
|
+
timeoutMs?: number;
|
|
735
|
+
};
|
|
736
|
+
/**
|
|
737
|
+
* When true, installation will fail (exit non-zero) if any dependencies
|
|
738
|
+
* have unreviewed build scripts. Equivalent to pnpm's `strictDepBuilds`.
|
|
739
|
+
* @default false
|
|
740
|
+
*/
|
|
741
|
+
strictDepBuilds?: boolean;
|
|
742
|
+
/**
|
|
743
|
+
* Trust level checking for package publishing.
|
|
744
|
+
* - "off": No trust checking (default)
|
|
745
|
+
* - "no-downgrade": Fail if a package's trust level has decreased
|
|
746
|
+
* compared to previous releases (e.g., was published by trusted
|
|
747
|
+
* publisher, now only has provenance).
|
|
748
|
+
* Equivalent to pnpm's `trustPolicy`.
|
|
749
|
+
* @default "off"
|
|
750
|
+
*/
|
|
751
|
+
trustPolicy?: "no-downgrade" | "off";
|
|
752
|
+
/**
|
|
753
|
+
* Package selectors excluded from trust policy checks.
|
|
754
|
+
* Equivalent to pnpm's `trustPolicyExclude`.
|
|
755
|
+
* @example ["chokidar@4.0.3", "@babel/core@7.28.5"]
|
|
756
|
+
*/
|
|
757
|
+
trustPolicyExclude?: string[];
|
|
758
|
+
/**
|
|
759
|
+
* Ignore the trust policy check for packages published more than
|
|
760
|
+
* the specified number of minutes ago. Useful for older packages
|
|
761
|
+
* that pre-date provenance support.
|
|
762
|
+
* Equivalent to pnpm's `trustPolicyIgnoreAfter` (10.27+).
|
|
763
|
+
* @example 43200 // 30 days
|
|
764
|
+
*/
|
|
765
|
+
trustPolicyIgnoreAfter?: number;
|
|
766
|
+
/**
|
|
767
|
+
* Package names to skip during typosquat detection.
|
|
768
|
+
* Use this for internal packages or known-safe names that happen to
|
|
769
|
+
* look similar to popular packages.
|
|
770
|
+
* @example ["my-internal-axois", "@myorg/recat"]
|
|
771
|
+
*/
|
|
772
|
+
typosquatAllowlist?: string[];
|
|
773
|
+
};
|
|
774
|
+
/** sort-package-json command defaults */
|
|
775
|
+
sortPackageJson?: {
|
|
776
|
+
/** Alphabetize script commands (default: false) */
|
|
777
|
+
sortScripts?: boolean;
|
|
778
|
+
};
|
|
779
|
+
/**
|
|
780
|
+
* Staged file patterns and commands (replaces lint-staged).
|
|
781
|
+
*
|
|
782
|
+
* Accepts all lint-staged config forms:
|
|
783
|
+
* - `string` or `string[]` commands
|
|
784
|
+
* - Sync/async functions returning `string | string[]`
|
|
785
|
+
* - `{ title, task }` objects for named side-effect tasks
|
|
786
|
+
* - Mixed arrays of strings and functions
|
|
787
|
+
* - A top-level generate-task function
|
|
788
|
+
*/
|
|
789
|
+
staged?: StagedConfig;
|
|
790
|
+
/** Target default configurations */
|
|
791
|
+
targetDefaults?: Record<string, Partial<VisTargetConfiguration>>;
|
|
792
|
+
/**
|
|
793
|
+
* Cascading task-default blocks. Each block may scope its targets to a
|
|
794
|
+
* subset of projects via `scope`. Blocks are evaluated in order; later
|
|
795
|
+
* blocks override earlier ones when the same field is set.
|
|
796
|
+
*
|
|
797
|
+
* Scope matching is additive — if `scope` is omitted, the block applies
|
|
798
|
+
* to every project.
|
|
799
|
+
* @example
|
|
800
|
+
* ```
|
|
801
|
+
* taskDefaults: [
|
|
802
|
+
* { scope: { tags: ["frontend"] }, targets: { build: { cache: true } } },
|
|
803
|
+
* { scope: { projectType: "library" }, targets: { lint: { cache: true } } },
|
|
804
|
+
* ]
|
|
805
|
+
* ```
|
|
806
|
+
*/
|
|
807
|
+
taskDefaults?: TaskDefaultsBlock[];
|
|
808
|
+
/**
|
|
809
|
+
* Named bundles of target dependencies, referenceable from any task's
|
|
810
|
+
* `dependsOn`. `dependsOn: [{ group: "lint" }]` expands to every entry
|
|
811
|
+
* in the named group; nested groups are resolved recursively and a
|
|
812
|
+
* cycle raises during discovery.
|
|
813
|
+
*/
|
|
814
|
+
taskGroups?: Record<string, (string | {
|
|
815
|
+
dependencies?: boolean;
|
|
816
|
+
projects?: string | string[];
|
|
817
|
+
target: string;
|
|
818
|
+
} | {
|
|
819
|
+
group: string;
|
|
820
|
+
})[]>;
|
|
821
|
+
/** Task runner options */
|
|
822
|
+
taskRunnerOptions?: Record<string, unknown>;
|
|
823
|
+
/**
|
|
824
|
+
* Toolchain (Node / pnpm / python / rust / ...) management. vis
|
|
825
|
+
* delegates to whichever version manager (proto, mise, fnm, volta,
|
|
826
|
+
* asdf, nvm, corepack) the developer already has — it does not ship
|
|
827
|
+
* its own.
|
|
828
|
+
*
|
|
829
|
+
* Re-exported from `./toolchain` so the public config type stays
|
|
830
|
+
* in lockstep with the resolver implementation. `self-activate` is
|
|
831
|
+
* narrowed out of `preferredManager` here — it's auto-resolved for
|
|
832
|
+
* pnpm/yarn `packageManager` pins and isn't meaningful as an
|
|
833
|
+
* override.
|
|
834
|
+
*/
|
|
835
|
+
toolchain?: Omit<ToolchainConfig, "preferredManager"> & {
|
|
836
|
+
readonly preferredManager?: Exclude<VersionManagerName, "self-activate">;
|
|
837
|
+
};
|
|
838
|
+
/** Terminal UI configuration */
|
|
839
|
+
tui?: {
|
|
840
|
+
/**
|
|
841
|
+
* Auto-exit the TUI after tasks complete.
|
|
842
|
+
* - `false`: Stay open until the user presses `q` (default)
|
|
843
|
+
* - `true`: Show quit dialog with 3-second countdown after completion
|
|
844
|
+
* - `number`: Show quit dialog with custom countdown in seconds
|
|
845
|
+
*/
|
|
846
|
+
autoExit?: boolean | number;
|
|
847
|
+
};
|
|
848
|
+
/**
|
|
849
|
+
* Installer backend selection for `vis install` / `vis add` /
|
|
850
|
+
* `vis remove` / `vis update` / `vis ci`.
|
|
851
|
+
*
|
|
852
|
+
* Lets users opt into [aube](https://github.com/endevco/aube) — a
|
|
853
|
+
* Rust-native package manager that reads/writes pnpm/npm/yarn/bun
|
|
854
|
+
* lockfiles in place — as the default installer, while keeping a
|
|
855
|
+
* single switch to fall back to the conventional PM detected from
|
|
856
|
+
* the lockfile.
|
|
857
|
+
*
|
|
858
|
+
* Resolution precedence (highest first):
|
|
859
|
+
* 1. CLI flag (`--installer <name>` / `--no-aube`)
|
|
860
|
+
* 2. Env var `VIS_INSTALLER`
|
|
861
|
+
* 3. This config field
|
|
862
|
+
* 4. Auto-detect (the default)
|
|
863
|
+
*
|
|
864
|
+
* Aube must be installed separately — `vis` does not bundle it.
|
|
865
|
+
* Install via `npm i -g @endevco/aube`, `mise use -g aube`, or
|
|
866
|
+
* `brew install endevco/tap/aube`.
|
|
867
|
+
*/
|
|
868
|
+
install?: {
|
|
869
|
+
/**
|
|
870
|
+
* Which package manager performs install/add/remove/etc.
|
|
871
|
+
* - `auto` (default): use `aube` when it is on PATH; otherwise
|
|
872
|
+
* fall back to the lockfile-detected PM.
|
|
873
|
+
* - explicit name: always use that PM. Errors when the named
|
|
874
|
+
* binary is missing rather than silently falling back.
|
|
875
|
+
* @default "auto"
|
|
876
|
+
*/
|
|
877
|
+
backend?: "aube" | "auto" | "bun" | "npm" | "pnpm" | "yarn";
|
|
878
|
+
};
|
|
879
|
+
/** Update command defaults */
|
|
880
|
+
update?: {
|
|
881
|
+
/**
|
|
882
|
+
* Dependency fields to scan for outdated packages.
|
|
883
|
+
* Beyond the standard fields, supports:
|
|
884
|
+
* - `"overrides"` (npm)
|
|
885
|
+
* - `"resolutions"` (yarn)
|
|
886
|
+
* - `"pnpm.overrides"`
|
|
887
|
+
* @default ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"]
|
|
888
|
+
*/
|
|
889
|
+
depFields?: string[];
|
|
890
|
+
exclude?: string[];
|
|
891
|
+
format?: "json" | "minimal" | "table";
|
|
892
|
+
/**
|
|
893
|
+
* Package names or glob patterns to permanently ignore during updates.
|
|
894
|
+
* Ignored packages are skipped and listed in the output so you know
|
|
895
|
+
* they were not checked.
|
|
896
|
+
* @example ["eslint", "@types/*"]
|
|
897
|
+
*/
|
|
898
|
+
ignore?: string[];
|
|
899
|
+
include?: string[];
|
|
900
|
+
/**
|
|
901
|
+
* Include packages with pinned/exact versions (no `^` or `~` prefix).
|
|
902
|
+
* By default, pinned versions are skipped during update checks.
|
|
903
|
+
* @default false
|
|
904
|
+
*/
|
|
905
|
+
includeLocked?: boolean;
|
|
906
|
+
install?: boolean;
|
|
907
|
+
/**
|
|
908
|
+
* Minimum number of minutes since a version was published before
|
|
909
|
+
* vis will consider it for updates. This mirrors pnpm's
|
|
910
|
+
* `minimumReleaseAge` — a single setting that applies to both
|
|
911
|
+
* install and update.
|
|
912
|
+
*
|
|
913
|
+
* Not set by default. If your package manager config
|
|
914
|
+
* (`pnpm-workspace.yaml`) has `minimumReleaseAge`, vis will
|
|
915
|
+
* read it from there as a fallback.
|
|
916
|
+
* @example 1440 // 24 hours
|
|
917
|
+
*/
|
|
918
|
+
minimumReleaseAge?: number;
|
|
919
|
+
/**
|
|
920
|
+
* Package names/patterns excluded from the minimumReleaseAge check.
|
|
921
|
+
* @example ["webpack", "@myorg/*"]
|
|
922
|
+
*/
|
|
923
|
+
minimumReleaseAgeExclude?: string[];
|
|
924
|
+
/**
|
|
925
|
+
* Per-package or per-pattern update target overrides.
|
|
926
|
+
* Keys are exact package names, glob patterns, or regex patterns
|
|
927
|
+
* wrapped in `/` (e.g., `/^@vue/`).
|
|
928
|
+
* Values are `"latest"`, `"minor"`, or `"patch"`.
|
|
929
|
+
* @example { "typescript": "minor", "/^@vue/": "patch" }
|
|
930
|
+
*/
|
|
931
|
+
packageMode?: Record<string, "latest" | "minor" | "patch">;
|
|
932
|
+
prerelease?: boolean;
|
|
933
|
+
security?: boolean;
|
|
934
|
+
target?: "latest" | "minor" | "patch";
|
|
935
|
+
};
|
|
936
|
+
/**
|
|
937
|
+
* Minimum vis CLI version required by this workspace. When the
|
|
938
|
+
* running vis binary is older than this constraint, vis exits with
|
|
939
|
+
* an actionable error before executing any command.
|
|
940
|
+
*
|
|
941
|
+
* Accepts a semver range string (e.g. `">=1.0.0"`, `"^1.2.0"`).
|
|
942
|
+
* @example ">=1.0.0"
|
|
943
|
+
*/
|
|
944
|
+
versionConstraint?: string;
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* Resolves glob-like workspace patterns to actual directories.
|
|
948
|
+
* Supports simple patterns like "packages/*" and "packages/**".
|
|
949
|
+
*/
|
|
950
|
+
/**
|
|
951
|
+
* Minimal OTel-shaped span. Deliberately structural so users can pass
|
|
952
|
+
* an `@opentelemetry/api` Tracer, an `@opentelemetry/sdk-node` one, or
|
|
953
|
+
* a custom implementation without the plugin depending on any
|
|
954
|
+
* particular OTel package.
|
|
955
|
+
*/
|
|
956
|
+
interface OtelSpan {
|
|
957
|
+
end: () => void;
|
|
958
|
+
recordException?: (error: unknown) => void;
|
|
959
|
+
setAttribute?: (key: string, value: boolean | number | string) => void;
|
|
960
|
+
setStatus?: (status: {
|
|
961
|
+
code: number;
|
|
962
|
+
message?: string;
|
|
963
|
+
}) => void;
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* Minimal Tracer contract. Accepts the real
|
|
967
|
+
* `@opentelemetry/api`'s `Tracer.startSpan(name, options?)` shape —
|
|
968
|
+
* the plugin only calls the two methods it strictly needs.
|
|
969
|
+
*/
|
|
970
|
+
interface OtelTracer {
|
|
971
|
+
startSpan: (name: string, options?: {
|
|
972
|
+
attributes?: Record<string, string | number | boolean>;
|
|
973
|
+
}) => OtelSpan;
|
|
974
|
+
}
|
|
975
|
+
interface OtelPluginOptions {
|
|
976
|
+
/**
|
|
977
|
+
* Rename incoming `project:target` IDs before they become OTel
|
|
978
|
+
* span names. Defaults to passing the id through unchanged.
|
|
979
|
+
*/
|
|
980
|
+
renameSpan?: (task: Task) => string;
|
|
981
|
+
/** Tracer used to emit spans. Required — pass the one from `@opentelemetry/api`'s `trace.getTracer("vis")`. */
|
|
982
|
+
tracer: OtelTracer;
|
|
983
|
+
}
|
|
984
|
+
/**
|
|
985
|
+
* Reference plugin that maps vis hook lifecycle events to OTel spans.
|
|
986
|
+
*
|
|
987
|
+
* Emits:
|
|
988
|
+
* - one **root span** named `vis.run` spanning `run:before` → `run:after`
|
|
989
|
+
* - one **child span** per task spanning `task:before` → `task:after`
|
|
990
|
+
* with attributes `vis.task.id`, `vis.task.project`, `vis.task.target`,
|
|
991
|
+
* `vis.task.cache_status`, `vis.task.exit_code`
|
|
992
|
+
* - `task:failure` sets span status to ERROR and records the exit code
|
|
993
|
+
*
|
|
994
|
+
* Streaming stdout/stderr events are intentionally **not** emitted as
|
|
995
|
+
* span events — high-frequency chunks would blow up OTel backends. Use
|
|
996
|
+
* a log exporter if you need stream-level visibility.
|
|
997
|
+
* @example
|
|
998
|
+
* ```ts
|
|
999
|
+
* import { trace } from "@opentelemetry/api";
|
|
1000
|
+
* import { defineConfig } from "@visulima/vis/config";
|
|
1001
|
+
* import { otelPlugin } from "@visulima/vis/plugins/otel";
|
|
1002
|
+
*
|
|
1003
|
+
* const tracer = trace.getTracer("vis", "1.0.0");
|
|
1004
|
+
*
|
|
1005
|
+
* export default defineConfig({
|
|
1006
|
+
* plugins: [otelPlugin({ tracer })],
|
|
1007
|
+
* });
|
|
1008
|
+
* ```
|
|
1009
|
+
*/
|
|
1010
|
+
declare const otelPlugin: (options: OtelPluginOptions) => VisPlugin;
|
|
3
1011
|
/** Supported config file names, checked in priority order. */
|
|
4
1012
|
declare const CONFIG_FILES: string[];
|
|
5
1013
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1014
|
+
* Secure-by-default security settings based on npm supply chain best practices.
|
|
1015
|
+
*
|
|
1016
|
+
* These defaults are applied automatically when using `defineConfig()` or `loadVisConfig()`.
|
|
1017
|
+
* Users can override any value — their settings always take precedence.
|
|
1018
|
+
* @see https://github.com/lirantal/awesome-npm-security-best-practices
|
|
1019
|
+
*/
|
|
12
1020
|
declare const SECURITY_DEFAULTS: Required<Pick<NonNullable<VisConfig["security"]>, "blockExoticSubdeps" | "strictDepBuilds" | "trustPolicy" | "trustPolicyIgnoreAfter">>;
|
|
13
1021
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1022
|
+
* Apply secure defaults to a raw config object.
|
|
1023
|
+
* Merges `SECURITY_DEFAULTS` into `config.security`, preserving all user overrides.
|
|
1024
|
+
*/
|
|
17
1025
|
declare const applyDefaults: (config: VisConfig) => VisConfig;
|
|
18
1026
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1027
|
+
* Find the vis config file in a directory.
|
|
1028
|
+
*
|
|
1029
|
+
* Reads the directory listing once and intersects it with the known
|
|
1030
|
+
* config filenames rather than `stat`-ing each candidate — one syscall
|
|
1031
|
+
* instead of up to six. Priority order is preserved via
|
|
1032
|
+
* `CONFIG_FILES` so `.ts` still wins over `.mjs` when both exist.
|
|
1033
|
+
* @param directory The directory to search in.
|
|
1034
|
+
* @returns The absolute path to the config file, or `undefined` if not found.
|
|
1035
|
+
*/
|
|
28
1036
|
declare const findVisConfigFile: (directory: string) => string | undefined;
|
|
29
1037
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1038
|
+
* Load the vis configuration from a `vis.config.ts` (or `.js`, `.mjs`, `.cjs`, `.mts`, `.cts`) file.
|
|
1039
|
+
*
|
|
1040
|
+
* Uses a file-hash based cache to avoid repeated jiti compilations.
|
|
1041
|
+
* Falls back to secure defaults if no config file is found.
|
|
1042
|
+
* @param workspaceRoot The workspace root directory to search for the config file.
|
|
1043
|
+
* @returns The loaded and resolved configuration with secure defaults applied.
|
|
1044
|
+
*/
|
|
37
1045
|
declare const loadVisConfig: (workspaceRoot: string) => Promise<VisConfig>;
|
|
38
1046
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
1047
|
+
* Type-safe helper for defining vis configuration.
|
|
1048
|
+
* Provides full TypeScript autocomplete when used in `vis.config.ts`.
|
|
1049
|
+
*
|
|
1050
|
+
* Secure defaults are applied automatically — you only need to specify overrides.
|
|
1051
|
+
* To see the active defaults, run `vis check --security-config`.
|
|
1052
|
+
* @example
|
|
1053
|
+
* ```typescript
|
|
1054
|
+
* // vis.config.ts — minimal config, fully secured by defaults
|
|
1055
|
+
* import { defineConfig } from "@visulima/vis/config";
|
|
1056
|
+
*
|
|
1057
|
+
* export default defineConfig({
|
|
1058
|
+
* security: {
|
|
1059
|
+
* allowBuilds: {
|
|
1060
|
+
* esbuild: true,
|
|
1061
|
+
* "@prisma/client": true,
|
|
1062
|
+
* },
|
|
1063
|
+
* },
|
|
1064
|
+
* });
|
|
1065
|
+
* ```
|
|
1066
|
+
* @example
|
|
1067
|
+
* ```typescript
|
|
1068
|
+
* // vis.config.ts — override a default
|
|
1069
|
+
* import { defineConfig } from "@visulima/vis/config";
|
|
1070
|
+
*
|
|
1071
|
+
* export default defineConfig({
|
|
1072
|
+
* security: {
|
|
1073
|
+
* // Relax cooldown to 24 hours instead of the default 14 days
|
|
1074
|
+
* minimumReleaseAge: 1440,
|
|
1075
|
+
* allowBuilds: { esbuild: true },
|
|
1076
|
+
* },
|
|
1077
|
+
* });
|
|
1078
|
+
* ```
|
|
1079
|
+
*/
|
|
72
1080
|
declare const defineConfig: (config: VisConfig) => VisConfig;
|
|
73
1081
|
/**
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
1082
|
+
* Type-safe helper for defining a vis plugin. Pure identity — exists
|
|
1083
|
+
* only so plugin authors get inference from the `VisPlugin` contract
|
|
1084
|
+
* without needing a `satisfies` annotation.
|
|
1085
|
+
*/
|
|
78
1086
|
declare const definePlugin: (plugin: VisPlugin) => VisPlugin;
|
|
79
|
-
export type
|
|
80
|
-
export type { OtelPluginOptions, OtelSpan, OtelTracer } from "./plugins/otel.d.ts";
|
|
81
|
-
export { otelPlugin } from "./plugins/otel.d.ts";
|
|
82
|
-
export { applyDefaults, CONFIG_FILES, defineConfig, definePlugin, findVisConfigFile, loadVisConfig, SECURITY_DEFAULTS };
|
|
1087
|
+
export { CONFIG_FILES, type OtelPluginOptions, type OtelSpan, type OtelTracer, SECURITY_DEFAULTS, type VisHooks, type VisPlugin, applyDefaults, defineConfig, definePlugin, findVisConfigFile, loadVisConfig, otelPlugin };
|