@visulima/vis 1.0.0-alpha.7 → 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 +107 -47
- package/LICENSE.md +44 -1
- package/README.md +56 -0
- package/dist/bin.js +1 -991
- 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 +29 -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 -8
- package/dist/commands/hook/index.d.ts +0 -3
- package/dist/commands/hook/install.d.ts +0 -7
- package/dist/commands/hook/migrate.d.ts +0 -27
- package/dist/commands/hook/uninstall.d.ts +0 -3
- 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
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Minimal quote-aware argv splitter. Handles single and double quotes,
|
|
3
|
-
* backslash escapes (both outside and inside double quotes, matching
|
|
4
|
-
* POSIX shell semantics), and collapses runs of whitespace — enough for
|
|
5
|
-
* the shell-like syntax users put in their staged config without
|
|
6
|
-
* dragging in `string-argv`.
|
|
7
|
-
*
|
|
8
|
-
* Inside single quotes everything is literal (POSIX semantics). Inside
|
|
9
|
-
* double quotes, `\"` and `\\` are interpreted; other backslash
|
|
10
|
-
* sequences are preserved verbatim.
|
|
11
|
-
*
|
|
12
|
-
* Throws `ConfigError` on unterminated quotes so typos in config fail
|
|
13
|
-
* fast instead of silently swallowing the rest of the command.
|
|
14
|
-
*/
|
|
15
|
-
export declare const parseCommandString: (input: string) => string[];
|
|
16
|
-
/**
|
|
17
|
-
* Platform-aware default for the maximum per-invocation argv byte length.
|
|
18
|
-
*
|
|
19
|
-
* Linux `execve()` caps `ARG_MAX` at ~128 KiB on most kernels; macOS sits at
|
|
20
|
-
* 256 KiB. Windows `CreateProcess` caps the full command line at 32,767
|
|
21
|
-
* UTF-16 code units (~65 KiB in the worst ASCII case, tighter for non-ASCII),
|
|
22
|
-
* so we pick a conservative 28 KiB limit there to leave headroom for the
|
|
23
|
-
* argv prefix and environment overhead that Node splices in.
|
|
24
|
-
*/
|
|
25
|
-
declare const DEFAULT_MAX_ARG_LENGTH: number;
|
|
26
|
-
/**
|
|
27
|
-
* Splits `files` into chunks whose combined byte length (plus a shared
|
|
28
|
-
* fixed-prefix length) does not exceed `maxArgLength`. Guarantees at
|
|
29
|
-
* least one file per chunk so extremely long individual paths still
|
|
30
|
-
* make it through.
|
|
31
|
-
*/
|
|
32
|
-
export declare const chunkFiles: (files: ReadonlyArray<string>, fixedPrefixLength: number, maxArgLength: number) => string[][];
|
|
33
|
-
export interface ExecCommandOptions {
|
|
34
|
-
readonly cwd: string;
|
|
35
|
-
readonly env?: Record<string, string>;
|
|
36
|
-
/**
|
|
37
|
-
* Signal delivered to the child process when `signal` fires. Defaults to `SIGTERM`
|
|
38
|
-
* (graceful). Use `SIGKILL` for fast-fail runs where graceful shutdown is not
|
|
39
|
-
* worth the wait.
|
|
40
|
-
*/
|
|
41
|
-
readonly killSignal?: NodeJS.Signals;
|
|
42
|
-
readonly maxArgLength?: number;
|
|
43
|
-
/** Aborted when the caller cancels the run (e.g. another task failed without `continueOnError`). */
|
|
44
|
-
readonly signal?: AbortSignal;
|
|
45
|
-
}
|
|
46
|
-
export interface ExecCommandResult {
|
|
47
|
-
readonly durationMs: number;
|
|
48
|
-
readonly output: string;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Runs a command once per file-chunk, concatenating stdout/stderr for
|
|
52
|
-
* renderer consumption. Throws `TaskError` on the first failing chunk
|
|
53
|
-
* or when the caller's `AbortSignal` fires mid-invocation.
|
|
54
|
-
*/
|
|
55
|
-
export declare const execCommand: (command: string, files: ReadonlyArray<string>, options: ExecCommandOptions) => Promise<ExecCommandResult>;
|
|
56
|
-
export { DEFAULT_MAX_ARG_LENGTH };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { PatternDescriptor, Renderer } from "../types.d.ts";
|
|
2
|
-
export interface RunTasksOptions {
|
|
3
|
-
readonly concurrent: boolean | number;
|
|
4
|
-
readonly continueOnError: boolean;
|
|
5
|
-
readonly cwd: string;
|
|
6
|
-
/** External cancellation (e.g. SIGINT handler). When fired, cancels like a task failure. */
|
|
7
|
-
readonly externalSignal?: AbortSignal;
|
|
8
|
-
/** Signal delivered to in-flight child processes when the run cancels. Defaults to `SIGTERM`. */
|
|
9
|
-
readonly killSignal?: NodeJS.Signals;
|
|
10
|
-
readonly maxArgLength?: number;
|
|
11
|
-
readonly verbose?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export interface RunTasksResult {
|
|
14
|
-
readonly failedCommands: string[];
|
|
15
|
-
readonly success: boolean;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Runs pattern tasks with pattern-level concurrency and command-level
|
|
19
|
-
* serial execution. Emits lifecycle events through the renderer.
|
|
20
|
-
*
|
|
21
|
-
* When a command fails and `continueOnError` is off, the shared
|
|
22
|
-
* `AbortController` is aborted so any execa children currently running
|
|
23
|
-
* in other workers exit promptly rather than running to completion on
|
|
24
|
-
* a doomed run.
|
|
25
|
-
*/
|
|
26
|
-
export declare const runTasks: (patterns: ReadonlyArray<PatternDescriptor>, renderer: Renderer, options: RunTasksOptions) => Promise<RunTasksResult>;
|
package/dist/staged/types.d.ts
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Public types for the in-house staged-files workflow that replaces
|
|
3
|
-
* the `lint-staged` peer dependency. The surface mirrors lint-staged's
|
|
4
|
-
* so existing configs and the `vis staged` command contract survive.
|
|
5
|
-
*/
|
|
6
|
-
/** Status of a single task or pattern in the runner lifecycle. */
|
|
7
|
-
export type TaskStatus = "failed" | "pending" | "running" | "skipped" | "success";
|
|
8
|
-
/**
|
|
9
|
-
* Custom task form — `{ title, task }` — analogous to lint-staged's
|
|
10
|
-
* listr-style task objects. `task` receives the matched absolute paths
|
|
11
|
-
* and returns a promise that resolves on success or rejects on failure.
|
|
12
|
-
*/
|
|
13
|
-
export interface CustomTask {
|
|
14
|
-
readonly task: (files: string[]) => Promise<unknown> | unknown;
|
|
15
|
-
readonly title: string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* A task value as authored by the user. Command strings are split into
|
|
19
|
-
* argv and invoked with the matched file paths appended. Arrays run
|
|
20
|
-
* serially. Functions receive the matched paths and return further
|
|
21
|
-
* task values (possibly async). `{ title, task }` objects run `task`
|
|
22
|
-
* directly with no argv construction.
|
|
23
|
-
*/
|
|
24
|
-
export type StagedTask = CustomTask | StagedTaskFunction | ReadonlyArray<CustomTask | StagedTaskFunction | string> | string | ReadonlyArray<string>;
|
|
25
|
-
export type StagedTaskFunction = (files: string[]) => Promise<StagedTaskResult> | StagedTaskResult;
|
|
26
|
-
export type StagedTaskResult = CustomTask | ReadonlyArray<CustomTask | string> | string | ReadonlyArray<string>;
|
|
27
|
-
/**
|
|
28
|
-
* Config object mapping glob patterns (basename or path-style) to tasks.
|
|
29
|
-
* A top-level function form lets the user generate the entire config
|
|
30
|
-
* from the staged file list.
|
|
31
|
-
*/
|
|
32
|
-
export type StagedConfig = Readonly<Record<string, StagedTask>> | StagedConfigFunction;
|
|
33
|
-
export type StagedConfigFunction = (files: string[]) => Promise<Record<string, StagedTask>> | Record<string, StagedTask>;
|
|
34
|
-
/** Options accepted by `runStaged`. Mirrors the lint-staged CLI surface. */
|
|
35
|
-
export interface RunOptions {
|
|
36
|
-
/** Allow empty commits when tasks revert every staged change. */
|
|
37
|
-
readonly allowEmpty?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* When a task writes *new* files that sit outside the originally-staged
|
|
40
|
-
* set, automatically stage them too. Defaults to `false` — only tasks
|
|
41
|
-
* explicitly called out to produce new artefacts should set this (e.g.
|
|
42
|
-
* codegen, lockfile regeneration). Closes nano-staged #43.
|
|
43
|
-
*/
|
|
44
|
-
readonly autoStage?: boolean;
|
|
45
|
-
/** Concurrency: `true` (unbounded), `false` (serial), or a positive integer. */
|
|
46
|
-
readonly concurrent?: boolean | number;
|
|
47
|
-
/** Inline staged config — the single source of truth at runtime. Supplied by `vis staged` from `vis.config.ts`. */
|
|
48
|
-
readonly config?: StagedConfig;
|
|
49
|
-
/** Run all tasks to completion even if one fails. */
|
|
50
|
-
readonly continueOnError?: boolean;
|
|
51
|
-
/** Working directory used for git and task execution. */
|
|
52
|
-
readonly cwd?: string;
|
|
53
|
-
/** Enable debug logging and force the plain renderer. */
|
|
54
|
-
readonly debug?: boolean;
|
|
55
|
-
/** Override the default `--staged` diff scope with an arbitrary git range. Implies `--no-stash`. */
|
|
56
|
-
readonly diff?: string;
|
|
57
|
-
/** Override the default `--diff-filter=ACMR`. */
|
|
58
|
-
readonly diffFilter?: string;
|
|
59
|
-
/** Exit with a non-zero status if tasks modified tracked files. Implies `--no-revert`. */
|
|
60
|
-
readonly failOnChanges?: boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Hide every unstaged change *and* every untracked file before running
|
|
63
|
-
* tasks. Useful for tools like Knip that inspect the whole worktree.
|
|
64
|
-
* Backed by a `git stash --include-untracked` so restore is automatic.
|
|
65
|
-
*/
|
|
66
|
-
readonly hideAll?: boolean;
|
|
67
|
-
/** Hide unstaged edits on partially-staged files (default: `true`). Set `false` to disable. */
|
|
68
|
-
readonly hidePartiallyStaged?: boolean;
|
|
69
|
-
/** Hide unstaged changes on every tracked file, not only partially-staged ones. */
|
|
70
|
-
readonly hideUnstaged?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Glob patterns for files to exclude from every task. Applied to the
|
|
73
|
-
* staged file list before pattern matching, so an `ignore` hit drops
|
|
74
|
-
* a file from *all* tasks regardless of which globs would otherwise
|
|
75
|
-
* have picked it up. Closes lint-staged issue #1722.
|
|
76
|
-
*/
|
|
77
|
-
readonly ignore?: ReadonlyArray<string>;
|
|
78
|
-
/**
|
|
79
|
-
* Signal used to kill in-flight task subprocesses when the run is
|
|
80
|
-
* cancelled (another task failed without `continueOnError`, or the
|
|
81
|
-
* user hit Ctrl+C). Defaults to `SIGTERM`, which lets well-behaved
|
|
82
|
-
* tools flush before exiting. Use `SIGKILL` for fast-fail runs
|
|
83
|
-
* where graceful shutdown is not worth the wait.
|
|
84
|
-
* @default "SIGTERM"
|
|
85
|
-
*/
|
|
86
|
-
readonly killSignal?: NodeJS.Signals;
|
|
87
|
-
/** Cap on combined argv byte length per command invocation. Defaults to a conservative OS limit. */
|
|
88
|
-
readonly maxArgLength?: number;
|
|
89
|
-
/** Suppress progress output entirely. */
|
|
90
|
-
readonly quiet?: boolean;
|
|
91
|
-
/** Pass matched paths to tasks relative to `cwd` instead of absolute. */
|
|
92
|
-
readonly relative?: boolean;
|
|
93
|
-
/** Revert the working tree from the backup stash when a task fails. */
|
|
94
|
-
readonly revert?: boolean;
|
|
95
|
-
/** Take a backup stash before running tasks (default: `true`). Set `false` to disable. */
|
|
96
|
-
readonly stash?: boolean;
|
|
97
|
-
/** Show task stdout/stderr on success, not only on failure. */
|
|
98
|
-
readonly verbose?: boolean;
|
|
99
|
-
}
|
|
100
|
-
/** A runtime descriptor for a single command belonging to a pattern. */
|
|
101
|
-
export interface CommandDescriptor {
|
|
102
|
-
/** Resolved command template; absent for custom tasks. */
|
|
103
|
-
readonly command?: string;
|
|
104
|
-
/** Matched files (absolute or relative, per `relative` option). */
|
|
105
|
-
readonly files: ReadonlyArray<string>;
|
|
106
|
-
/** A stable id for renderer lookups. */
|
|
107
|
-
readonly id: string;
|
|
108
|
-
/** Custom task callback; only set when `source === "custom"`. */
|
|
109
|
-
readonly run?: (files: string[]) => Promise<unknown> | unknown;
|
|
110
|
-
readonly source: "custom" | "function" | "string";
|
|
111
|
-
readonly title: string;
|
|
112
|
-
}
|
|
113
|
-
/** A runtime descriptor for a glob pattern and its resolved commands. */
|
|
114
|
-
export interface PatternDescriptor {
|
|
115
|
-
readonly commands: ReadonlyArray<CommandDescriptor>;
|
|
116
|
-
readonly files: ReadonlyArray<string>;
|
|
117
|
-
readonly id: string;
|
|
118
|
-
readonly pattern: string;
|
|
119
|
-
readonly title: string;
|
|
120
|
-
}
|
|
121
|
-
/** Events emitted by the runner and consumed by a renderer. */
|
|
122
|
-
export interface RunnerEvents {
|
|
123
|
-
commandEnd: {
|
|
124
|
-
readonly commandId: string;
|
|
125
|
-
readonly durationMs: number;
|
|
126
|
-
readonly error?: Error;
|
|
127
|
-
readonly output?: string;
|
|
128
|
-
readonly patternId: string;
|
|
129
|
-
readonly status: TaskStatus;
|
|
130
|
-
};
|
|
131
|
-
commandStart: {
|
|
132
|
-
readonly commandId: string;
|
|
133
|
-
readonly patternId: string;
|
|
134
|
-
};
|
|
135
|
-
error: {
|
|
136
|
-
readonly error?: Error;
|
|
137
|
-
readonly message: string;
|
|
138
|
-
};
|
|
139
|
-
info: {
|
|
140
|
-
readonly message: string;
|
|
141
|
-
};
|
|
142
|
-
patternEnd: {
|
|
143
|
-
readonly patternId: string;
|
|
144
|
-
readonly status: TaskStatus;
|
|
145
|
-
};
|
|
146
|
-
patternStart: {
|
|
147
|
-
readonly patternId: string;
|
|
148
|
-
};
|
|
149
|
-
start: {
|
|
150
|
-
readonly patterns: ReadonlyArray<PatternDescriptor>;
|
|
151
|
-
};
|
|
152
|
-
warn: {
|
|
153
|
-
readonly message: string;
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
/** Abstract renderer contract — plain and Ink implementations conform. */
|
|
157
|
-
export interface Renderer {
|
|
158
|
-
commandEnd: (payload: RunnerEvents["commandEnd"]) => void;
|
|
159
|
-
commandStart: (payload: RunnerEvents["commandStart"]) => void;
|
|
160
|
-
error: (payload: RunnerEvents["error"]) => void;
|
|
161
|
-
info: (payload: RunnerEvents["info"]) => void;
|
|
162
|
-
patternEnd: (payload: RunnerEvents["patternEnd"]) => void;
|
|
163
|
-
patternStart: (payload: RunnerEvents["patternStart"]) => void;
|
|
164
|
-
start: (payload: RunnerEvents["start"]) => void;
|
|
165
|
-
stop: () => Promise<void> | void;
|
|
166
|
-
warn: (payload: RunnerEvents["warn"]) => void;
|
|
167
|
-
}
|
|
168
|
-
/** Outcome of a `runStaged` invocation. */
|
|
169
|
-
export interface RunResult {
|
|
170
|
-
readonly failedCommands: ReadonlyArray<string>;
|
|
171
|
-
readonly ranTasks: boolean;
|
|
172
|
-
readonly success: boolean;
|
|
173
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { WorkspaceConfiguration } from "@visulima/task-runner";
|
|
2
|
-
import type { ProjectOptionsIndex } from "./workspace.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Collects every unique target name across all projects in the workspace.
|
|
5
|
-
* @param workspace The discovered workspace configuration.
|
|
6
|
-
* @returns Sorted array of unique target names.
|
|
7
|
-
*/
|
|
8
|
-
export declare const collectAvailableTargets: (workspace: WorkspaceConfiguration) => string[];
|
|
9
|
-
/**
|
|
10
|
-
* Builds a `{alias → canonicalTargetName}` lookup from declared
|
|
11
|
-
* `aliases` on any `VisTargetConfiguration` in the workspace. Aliases
|
|
12
|
-
* are treated as workspace-global — the first declaration wins and
|
|
13
|
-
* later ones are silently ignored (prefer explicit canonical names
|
|
14
|
-
* when aliases collide).
|
|
15
|
-
*
|
|
16
|
-
* Canonical target names themselves are not added to the map — only
|
|
17
|
-
* declared aliases — so `resolveTargetAlias` leaves non-alias input
|
|
18
|
-
* unchanged.
|
|
19
|
-
*/
|
|
20
|
-
export declare const buildAliasMap: (projectOptions: ProjectOptionsIndex) => Map<string, string>;
|
|
21
|
-
/**
|
|
22
|
-
* Resolves a user-typed target name to its canonical form, or returns
|
|
23
|
-
* the input unchanged when no alias matches.
|
|
24
|
-
*/
|
|
25
|
-
export declare const resolveTargetAlias: (name: string, aliases: Map<string, string>) => string;
|
|
26
|
-
/**
|
|
27
|
-
* Suggests the closest matching target name for a typo.
|
|
28
|
-
* @param input The unknown target name the user typed.
|
|
29
|
-
* @param available Known target names.
|
|
30
|
-
* @param maxDistance Maximum edit distance to consider (default 3).
|
|
31
|
-
* @returns The best match, or `undefined` if nothing is close enough.
|
|
32
|
-
*/
|
|
33
|
-
export declare const suggestTarget: (input: string, available: string[], maxDistance?: number) => string | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* Returns up to `limit` closest-matching target names within
|
|
36
|
-
* `maxDistance` edit distance, sorted by ascending distance.
|
|
37
|
-
*
|
|
38
|
-
* Used by the missing-target error output to offer several candidates
|
|
39
|
-
* — one suggestion often reads as authoritative, three reads as
|
|
40
|
-
* "pick whichever you meant", which is friendlier at scale.
|
|
41
|
-
*/
|
|
42
|
-
export declare const suggestTargets: (input: string, available: string[], limit?: number, maxDistance?: number) => string[];
|
|
43
|
-
/**
|
|
44
|
-
* Formats the available targets list for display.
|
|
45
|
-
* @param targets Sorted target names.
|
|
46
|
-
* @returns Formatted string for CLI output.
|
|
47
|
-
*/
|
|
48
|
-
export declare const formatTargetList: (targets: string[]) => string;
|
|
49
|
-
/**
|
|
50
|
-
* Prompts the user to pick a target from `targets` via an interactive
|
|
51
|
-
* numbered readline prompt. Accepts either the index (1-based) or the
|
|
52
|
-
* target name; empty input or Ctrl-C aborts with `undefined`.
|
|
53
|
-
*
|
|
54
|
-
* Uses Node's built-in readline rather than a TUI dependency — this
|
|
55
|
-
* keeps the bare `vis run` flow lightweight and works in any TTY.
|
|
56
|
-
* Mirrors vite-task's `vp run` (no args) interactive selector.
|
|
57
|
-
* @returns The chosen target name, or `undefined` if the user aborts.
|
|
58
|
-
*/
|
|
59
|
-
export declare const promptTargetInteractively: (targets: string[]) => Promise<string | undefined>;
|
package/dist/target-options.d.ts
DELETED
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import type { TargetConfiguration } from "@visulima/task-runner";
|
|
2
|
-
/**
|
|
3
|
-
* Semantic classification for a target.
|
|
4
|
-
* - `build`: Generates one or more artifacts; cached by default.
|
|
5
|
-
* - `test`: Validation task (lint, typecheck, unit test). Default type.
|
|
6
|
-
* - `run`: One-off or long-running process. Not cached by default.
|
|
7
|
-
*/
|
|
8
|
-
export type TargetType = "build" | "run" | "test";
|
|
9
|
-
/**
|
|
10
|
-
* Preset bundles of target options.
|
|
11
|
-
* - `server`: Long-running local dev server — caching off, not in CI,
|
|
12
|
-
* interactive, persistent.
|
|
13
|
-
* - `utility`: Short-lived helper — caching off, not in CI.
|
|
14
|
-
*/
|
|
15
|
-
export type TargetPreset = "server" | "utility";
|
|
16
|
-
/**
|
|
17
|
-
* Controls whether a target runs in CI.
|
|
18
|
-
* - `true` (default): Always run.
|
|
19
|
-
* - `false`: Never run in CI (local-only).
|
|
20
|
-
* - `"affected"`: Only when the project is affected by the current change set.
|
|
21
|
-
* - `"always"`: Always run, even if unaffected.
|
|
22
|
-
*/
|
|
23
|
-
export type RunInCI = "affected" | "always" | boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Controls how affected files are forwarded to a task.
|
|
26
|
-
* - `false` (default): Do not forward.
|
|
27
|
-
* - `"args"`: Append affected paths as additional command arguments.
|
|
28
|
-
* - `"env"`: Expose them via `VIS_AFFECTED_FILES` environment variable.
|
|
29
|
-
* - `"both"`: Both of the above.
|
|
30
|
-
*/
|
|
31
|
-
export type AffectedFilesMode = "args" | "both" | "env" | false;
|
|
32
|
-
/** Supported OS filters for target execution. */
|
|
33
|
-
export type TargetOsType = "linux" | "macos" | "windows";
|
|
34
|
-
/**
|
|
35
|
-
* Vis-specific target options that extend the task-runner's
|
|
36
|
-
* base `TargetConfiguration`. These live under `target.options` and are
|
|
37
|
-
* interpreted by vis before handing the task off to task-runner.
|
|
38
|
-
*/
|
|
39
|
-
/**
|
|
40
|
-
* Object form of the `when` gate. Matches against process.env or
|
|
41
|
-
* process.platform — deliberately small surface area so conditions
|
|
42
|
-
* stay auditable and declarative.
|
|
43
|
-
*/
|
|
44
|
-
export interface TargetConditionObject {
|
|
45
|
-
/** Env var name to compare against `equals` or `in`. */
|
|
46
|
-
env?: string;
|
|
47
|
-
/** Value that `env` must match exactly. */
|
|
48
|
-
equals?: string;
|
|
49
|
-
/** Any value in this list matches. Ignored when `equals` is set. */
|
|
50
|
-
in?: string[];
|
|
51
|
-
/** Run only on this platform (or one of these). */
|
|
52
|
-
platform?: NodeJS.Platform | NodeJS.Platform[];
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Evaluates a `when` condition against the current process state.
|
|
56
|
-
* Returns `true` when the task should run, `false` when it should be
|
|
57
|
-
* skipped. Unknown shapes default to `true` — we'd rather over-run
|
|
58
|
-
* than silently hide tasks on malformed config.
|
|
59
|
-
*/
|
|
60
|
-
export declare const evaluateWhen: (when: TargetConditionObject | string | undefined, environment?: Record<string, string | undefined>, platform?: NodeJS.Platform) => boolean;
|
|
61
|
-
export interface VisTargetOptions {
|
|
62
|
-
/**
|
|
63
|
-
* How to forward affected files to the task process.
|
|
64
|
-
* Only used when invoked via `vis affected <target>`.
|
|
65
|
-
* @default false
|
|
66
|
-
*/
|
|
67
|
-
affectedFiles?: AffectedFilesMode;
|
|
68
|
-
/**
|
|
69
|
-
* Load environment variables from dotenv file(s) before running.
|
|
70
|
-
* - `string`: a single file path (relative to project root).
|
|
71
|
-
* - `string[]`: multiple files — later entries override earlier ones,
|
|
72
|
-
* so put more-specific files last (e.g. `[".env", ".env.local"]`).
|
|
73
|
-
* - `true`: auto-cascade in the Next/Vite order:
|
|
74
|
-
* `.env` → `.env.{NODE_ENV}` → `.env.local` → `.env.{NODE_ENV}.local`.
|
|
75
|
-
* Skips `.env.local` when NODE_ENV is `test`, matching Next.js.
|
|
76
|
-
*/
|
|
77
|
-
envFile?: boolean | string | string[];
|
|
78
|
-
/**
|
|
79
|
-
* When true, the task is serialized with respect to parallel execution
|
|
80
|
-
* and must be run on the main process (claims stdin). Used for commands
|
|
81
|
-
* that read from the terminal.
|
|
82
|
-
* @default false
|
|
83
|
-
*/
|
|
84
|
-
interactive?: boolean;
|
|
85
|
-
/**
|
|
86
|
-
* When true, the task is hidden from CLI listings and can only be invoked
|
|
87
|
-
* as a dependency of another task.
|
|
88
|
-
* @default false
|
|
89
|
-
*/
|
|
90
|
-
internal?: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Serializes all tasks that share the same mutex name. Useful for tasks
|
|
93
|
-
* that contend on a shared resource (e.g., a database migration).
|
|
94
|
-
*/
|
|
95
|
-
mutex?: string;
|
|
96
|
-
/**
|
|
97
|
-
* Restricts execution to specific operating systems. Tasks run on
|
|
98
|
-
* unmatched platforms are skipped with a warning.
|
|
99
|
-
*/
|
|
100
|
-
osType?: TargetOsType | TargetOsType[];
|
|
101
|
-
/**
|
|
102
|
-
* When true, the task is a long-running / never-ending process.
|
|
103
|
-
* Persistent tasks are scheduled last, execute after all cacheable
|
|
104
|
-
* tasks complete, and are never cached.
|
|
105
|
-
* @default false
|
|
106
|
-
*/
|
|
107
|
-
persistent?: boolean;
|
|
108
|
-
/**
|
|
109
|
-
* A preset that pre-fills a common bundle of options.
|
|
110
|
-
* User-provided fields always take precedence over the preset.
|
|
111
|
-
*/
|
|
112
|
-
preset?: TargetPreset;
|
|
113
|
-
/**
|
|
114
|
-
* Run the task through a pseudo-terminal so color-aware tools
|
|
115
|
-
* (vitest, eslint, biome, …) render as if attached to a real TTY
|
|
116
|
-
* instead of a pipe. Output is captured via task-runner's
|
|
117
|
-
* `TerminalBuffer` so ANSI escapes are normalized into the final
|
|
118
|
-
* rendered state before reaching the reporter.
|
|
119
|
-
*
|
|
120
|
-
* Forces cache to off — PTY output can include timing-dependent
|
|
121
|
-
* frames (spinners) that aren't safe to replay from a cache.
|
|
122
|
-
* @default false
|
|
123
|
-
*/
|
|
124
|
-
pty?: boolean;
|
|
125
|
-
/**
|
|
126
|
-
* Number of times to retry the task on failure. Uses an exponential
|
|
127
|
-
* backoff by default (1s, 2s, 4s, ...).
|
|
128
|
-
* @default 0
|
|
129
|
-
*/
|
|
130
|
-
retryCount?: number;
|
|
131
|
-
/**
|
|
132
|
-
* Delay between retry attempts in milliseconds, or `"exponential"`
|
|
133
|
-
* for 2^attempt * 1000 ms.
|
|
134
|
-
* @default "exponential"
|
|
135
|
-
*/
|
|
136
|
-
retryDelay?: number | "exponential";
|
|
137
|
-
/**
|
|
138
|
-
* When true, the command executes with the workspace root as CWD
|
|
139
|
-
* instead of the project root.
|
|
140
|
-
* @default false
|
|
141
|
-
*/
|
|
142
|
-
runFromWorkspaceRoot?: boolean;
|
|
143
|
-
/**
|
|
144
|
-
* Controls whether the task runs in CI environments.
|
|
145
|
-
* @default true
|
|
146
|
-
*/
|
|
147
|
-
runInCI?: RunInCI;
|
|
148
|
-
/**
|
|
149
|
-
* Per-target shell override. When set, the command runs through this
|
|
150
|
-
* shell instead of the platform default.
|
|
151
|
-
*/
|
|
152
|
-
shell?: string;
|
|
153
|
-
/**
|
|
154
|
-
* Maximum wall-clock milliseconds a single task run is allowed to
|
|
155
|
-
* take before being killed. `0` / `undefined` means no timeout.
|
|
156
|
-
*
|
|
157
|
-
* When the timeout fires the task is sent SIGTERM then SIGKILL
|
|
158
|
-
* (via the concurrent runner's `killSignal`/`killTimeout`
|
|
159
|
-
* semantics) and the task exits with a failure status carrying the
|
|
160
|
-
* `[timeout]` marker in `terminalOutput`. Retries count against
|
|
161
|
-
* this per-attempt, not cumulatively.
|
|
162
|
-
*
|
|
163
|
-
* Use this to prevent runaway tasks from eating CI wall-clock time
|
|
164
|
-
* up to the job-level cutoff.
|
|
165
|
-
*/
|
|
166
|
-
timeout?: number;
|
|
167
|
-
/**
|
|
168
|
-
* Per-target unix shell override, used on Linux and macOS.
|
|
169
|
-
* Takes precedence over `shell` on unix-like systems.
|
|
170
|
-
*/
|
|
171
|
-
unixShell?: string;
|
|
172
|
-
/**
|
|
173
|
-
* Conditional gate: the task is scheduled only when `when` evaluates
|
|
174
|
-
* truthy. Shapes:
|
|
175
|
-
* - `"$VAR"` — run only if the env var is non-empty
|
|
176
|
-
* - `"!VAR"` — run only if the env var is empty/unset
|
|
177
|
-
* - `{ env: "NAME", equals: "value" }` — run only if env equals
|
|
178
|
-
* - `{ env: "NAME", in: ["a", "b"] }` — run only if env is in set
|
|
179
|
-
* - `{ platform: "darwin" | "linux" | "win32" }` — OS gate
|
|
180
|
-
*
|
|
181
|
-
* Kept declarative on purpose — no dynamic code execution. For
|
|
182
|
-
* richer logic, use osType/runInCI or a pre-hook script.
|
|
183
|
-
*/
|
|
184
|
-
when?: TargetConditionObject | string;
|
|
185
|
-
/**
|
|
186
|
-
* Per-target windows shell override, used on Windows.
|
|
187
|
-
* Takes precedence over `shell` on Windows.
|
|
188
|
-
*/
|
|
189
|
-
windowsShell?: string;
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* An extended target configuration that adds the vis-specific options
|
|
193
|
-
* on top of task-runner's `TargetConfiguration`.
|
|
194
|
-
*/
|
|
195
|
-
export interface VisTargetConfiguration extends Omit<TargetConfiguration, "options"> {
|
|
196
|
-
/**
|
|
197
|
-
* Alternate names that resolve to this target on the CLI. Useful
|
|
198
|
-
* for shortening long canonical names (`test` ↔ `t`) or for
|
|
199
|
-
* offering migration-friendly aliases when renaming targets.
|
|
200
|
-
* Aliases must be globally unique within the workspace.
|
|
201
|
-
*/
|
|
202
|
-
aliases?: string[];
|
|
203
|
-
/**
|
|
204
|
-
* One-line description surfaced by `vis list` and (in future)
|
|
205
|
-
* per-task `--help`. Kept short — longer docs belong in project
|
|
206
|
-
* READMEs or vis.config.ts comments.
|
|
207
|
-
*/
|
|
208
|
-
description?: string;
|
|
209
|
-
/** Vis-specific target options. */
|
|
210
|
-
options?: VisTargetOptions;
|
|
211
|
-
/** Preset applied before user-specified options. */
|
|
212
|
-
preset?: TargetPreset;
|
|
213
|
-
/**
|
|
214
|
-
* Semantic task type. Affects caching defaults and CI filtering.
|
|
215
|
-
* @default "test"
|
|
216
|
-
*/
|
|
217
|
-
type?: TargetType;
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Apply preset defaults to a target configuration. Returns a new
|
|
221
|
-
* object — never mutates its input.
|
|
222
|
-
*/
|
|
223
|
-
export declare const applyPreset: (target: VisTargetConfiguration) => VisTargetConfiguration;
|
|
224
|
-
/** Detects the current operating system as a {@link TargetOsType}. */
|
|
225
|
-
export declare const detectCurrentOs: () => TargetOsType;
|
|
226
|
-
/**
|
|
227
|
-
* Returns `true` if the given OS matches the target's `osType` filter.
|
|
228
|
-
* Tasks without an `osType` option always match.
|
|
229
|
-
*/
|
|
230
|
-
export declare const matchesOs: (options: VisTargetOptions | undefined, currentOs?: TargetOsType) => boolean;
|
|
231
|
-
/**
|
|
232
|
-
* Returns `true` if the task should run in the current environment based
|
|
233
|
-
* on its `runInCI` option. `affectedInCi` should indicate whether the
|
|
234
|
-
* project is in the current affected set (only relevant for `"affected"`).
|
|
235
|
-
*/
|
|
236
|
-
export declare const shouldRunInCI: (options: VisTargetOptions | undefined, isCi: boolean, affectedInCi?: boolean) => boolean;
|
|
237
|
-
/**
|
|
238
|
-
* Resolves the `envFile` target option into a merged env map.
|
|
239
|
-
*
|
|
240
|
-
* - `string` → load that single file
|
|
241
|
-
* - `string[]` → load each in order; later entries win on key collision
|
|
242
|
-
* - `true` → load the Next/Vite cascade:
|
|
243
|
-
* `.env` → `.env.{NODE_ENV}` → `.env.local` → `.env.{NODE_ENV}.local`
|
|
244
|
-
* (`.env.local` skipped for NODE_ENV=test, matching Next.js)
|
|
245
|
-
*
|
|
246
|
-
* Silently skips files that don't exist. Returns `{}` when no file in
|
|
247
|
-
* the cascade is present — safe to merge directly into the child env.
|
|
248
|
-
*/
|
|
249
|
-
export declare const loadEnvFile: (projectRoot: string, envFile: boolean | string | string[]) => Record<string, string>;
|
|
250
|
-
/**
|
|
251
|
-
* Pick the effective shell for a target on the current platform.
|
|
252
|
-
* Returns `undefined` if no per-target shell is configured.
|
|
253
|
-
*/
|
|
254
|
-
export declare const resolveTargetShell: (options: VisTargetOptions | undefined, currentOs?: TargetOsType) => string | undefined;
|
|
255
|
-
/**
|
|
256
|
-
* Returns the default `cache` value implied by the target type.
|
|
257
|
-
* - `build`: cached by default.
|
|
258
|
-
* - `run`: never cached.
|
|
259
|
-
* - `test`: cached by default.
|
|
260
|
-
*/
|
|
261
|
-
export declare const defaultCacheForType: (type: TargetType | undefined) => boolean | undefined;
|
package/dist/tips.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI tips system - displays contextual hints after command execution.
|
|
3
|
-
*
|
|
4
|
-
* Features (per vite-plus RFC):
|
|
5
|
-
* - Probabilistic frequency control with per-tip cooldowns
|
|
6
|
-
* - Contextual matching based on command, args, and success state
|
|
7
|
-
* - Rate-limited globally (max 1 tip per 5 minutes)
|
|
8
|
-
* - Per-tip cooldown tracking (each tip has its own cooldown)
|
|
9
|
-
* - Suppressed in CI/test environments
|
|
10
|
-
* - Dimmed styling to avoid being intrusive
|
|
11
|
-
*/
|
|
12
|
-
interface TipContext {
|
|
13
|
-
args: string[];
|
|
14
|
-
command: string;
|
|
15
|
-
hasVisConfig?: boolean;
|
|
16
|
-
success: boolean;
|
|
17
|
-
}
|
|
18
|
-
interface Tip {
|
|
19
|
-
/** Per-tip cooldown in milliseconds. Default: GLOBAL_COOLDOWN_MS */
|
|
20
|
-
cooldownMs?: number;
|
|
21
|
-
/** Unique identifier for per-tip cooldown tracking */
|
|
22
|
-
id: string;
|
|
23
|
-
matches: (context: TipContext) => boolean;
|
|
24
|
-
message: (context: TipContext) => string;
|
|
25
|
-
/** Probability of showing when matched (0.0 - 1.0). Default: 1.0 */
|
|
26
|
-
probability?: number;
|
|
27
|
-
}
|
|
28
|
-
declare const tips: Tip[];
|
|
29
|
-
/**
|
|
30
|
-
* Show a contextual tip if rate-limits allow and a tip matches.
|
|
31
|
-
*
|
|
32
|
-
* Flow:
|
|
33
|
-
* 1. Check environment (skip in CI/test)
|
|
34
|
-
* 2. Check global cooldown (max 1 tip per 5 minutes)
|
|
35
|
-
* 3. Find matching tips, filter by per-tip cooldowns
|
|
36
|
-
* 4. Apply probability filter
|
|
37
|
-
* 5. Show the first surviving tip, update state
|
|
38
|
-
*/
|
|
39
|
-
declare const showTip: (context: TipContext) => void;
|
|
40
|
-
export type { Tip, TipContext };
|
|
41
|
-
export { showTip, tips };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Task } from "@visulima/task-runner";
|
|
2
|
-
interface CommandSummaryProps {
|
|
3
|
-
cached: number;
|
|
4
|
-
failed: number;
|
|
5
|
-
failedIds: string[];
|
|
6
|
-
projectNames: string[];
|
|
7
|
-
skippedIds?: string[];
|
|
8
|
-
succeeded: number;
|
|
9
|
-
targets: string[];
|
|
10
|
-
tasks: Task[];
|
|
11
|
-
took: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Final summary block rendered after all tasks complete.
|
|
15
|
-
*/
|
|
16
|
-
declare const CommandSummary: ({ cached, failed, failedIds, projectNames, skippedIds, succeeded, targets, tasks, took }: CommandSummaryProps) => React.JSX.Element;
|
|
17
|
-
export default CommandSummary;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
interface HeaderProps {
|
|
3
|
-
children?: ReactNode;
|
|
4
|
-
title: string;
|
|
5
|
-
variant: "error" | "info" | "success";
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Renders the VIS badge + status dot + title header line.
|
|
9
|
-
*
|
|
10
|
-
* ` VIS ` ● Running targets build for 3 projects
|
|
11
|
-
*/
|
|
12
|
-
declare const Header: ({ children, title, variant }: HeaderProps) => React.JSX.Element;
|
|
13
|
-
export default Header;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ScrollViewRef } from "@visulima/tui";
|
|
2
|
-
import type { TaskRowData } from "./TaskRow.d.ts";
|
|
3
|
-
interface OutputPanelProps {
|
|
4
|
-
/** Duration in ms (for top-right border display). */
|
|
5
|
-
duration?: number;
|
|
6
|
-
focused: boolean;
|
|
7
|
-
/** Whether interactive input mode is active (keystrokes forwarded to PTY). */
|
|
8
|
-
interactiveMode?: boolean;
|
|
9
|
-
output: string;
|
|
10
|
-
scrollRef?: React.RefObject<ScrollViewRef | null>;
|
|
11
|
-
/** Whether to show "<enter> full screen" hint in bottom border. */
|
|
12
|
-
showFullscreenHint?: boolean;
|
|
13
|
-
status: TaskRowData["status"] | undefined;
|
|
14
|
-
taskId: string | null;
|
|
15
|
-
}
|
|
16
|
-
declare const OutputPanel: ({ duration, focused, interactiveMode, output, scrollRef, showFullscreenHint, status, taskId }: OutputPanelProps) => React.JSX.Element;
|
|
17
|
-
export default OutputPanel;
|