@visulima/vis 1.0.0-alpha.5 → 1.0.0-alpha.7
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 +157 -81
- package/README.md +144 -14
- package/dist/ai-analysis.d.ts +3 -17
- package/dist/ai-cache.d.ts +1 -1
- package/dist/ai-types.d.ts +16 -0
- package/dist/bin.js +352 -221
- package/dist/cache-directory.d.ts +73 -0
- package/dist/codeowners.d.ts +30 -0
- package/dist/commands/action-graph.d.ts +8 -0
- package/dist/commands/audit.d.ts +3 -3
- package/dist/commands/cache.d.ts +86 -0
- package/dist/commands/ci.d.ts +19 -0
- package/dist/commands/docker.d.ts +22 -0
- package/dist/commands/generate.d.ts +10 -0
- package/dist/commands/ignore-helpers.d.ts +157 -0
- package/dist/commands/ignore.d.ts +17 -0
- package/dist/commands/info.d.ts +3 -0
- package/dist/commands/list.d.ts +3 -0
- package/dist/commands/migrate/backup.d.ts +8 -0
- package/dist/commands/migrate/constants.d.ts +6 -2
- package/dist/commands/migrate/gitleaks.d.ts +29 -0
- package/dist/commands/migrate/json.d.ts +4 -2
- package/dist/commands/migrate/kingfisher.d.ts +14 -0
- package/dist/commands/migrate/moon.d.ts +5 -0
- package/dist/commands/migrate/nano-staged.d.ts +30 -0
- package/dist/commands/migrate/nx.d.ts +12 -0
- package/dist/commands/migrate/prompt.d.ts +2 -0
- package/dist/commands/migrate/secretlint.d.ts +14 -0
- package/dist/commands/migrate/shared.d.ts +29 -0
- package/dist/commands/migrate/turborepo.d.ts +11 -0
- package/dist/commands/migrate/types.d.ts +8 -1
- package/dist/commands/migrate/verify.d.ts +12 -0
- package/dist/commands/run.d.ts +13 -0
- package/dist/commands/sbom.d.ts +10 -0
- package/dist/commands/secrets.d.ts +3 -0
- package/dist/commands/staged.d.ts +7 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/sync.d.ts +16 -0
- package/dist/commands/task-why.d.ts +3 -0
- package/dist/config.d.ts +17 -2
- package/dist/config.js +1 -1
- package/dist/docker.d.ts +73 -0
- package/dist/flakiness.d.ts +40 -0
- package/dist/generate/discover.d.ts +29 -0
- package/dist/generate/index.d.ts +32 -0
- package/dist/generate/index.js +1 -0
- package/dist/generate/loader.d.ts +15 -0
- package/dist/generate/moon-adapter/filename-interp.d.ts +42 -0
- package/dist/generate/moon-adapter/filters.d.ts +22 -0
- package/dist/generate/moon-adapter/frontmatter.d.ts +39 -0
- package/dist/generate/moon-adapter/index.d.ts +19 -0
- package/dist/generate/moon-adapter/tera-subset.d.ts +85 -0
- package/dist/generate/moon-adapter/util.d.ts +14 -0
- package/dist/generate/prompts.d.ts +25 -0
- package/dist/generate/remote.d.ts +43 -0
- package/dist/generate/runner.d.ts +37 -0
- package/dist/generate/types.d.ts +152 -0
- package/dist/hooks.d.ts +118 -0
- package/dist/native-binding.d.ts +8 -1
- package/dist/packem_chunks/index.js +7 -0
- package/dist/packem_chunks/loader.js +1 -0
- package/dist/packem_shared/otelPlugin-CJLkguJ8.js +1 -0
- package/dist/plugins/otel.d.ts +63 -0
- package/dist/pm-runner.d.ts +24 -3
- package/dist/run-report.d.ts +40 -0
- package/dist/runtime-check.d.ts +27 -0
- package/dist/sbom/cyclonedx.d.ts +39 -0
- package/dist/sbom/installed-package.d.ts +49 -0
- package/dist/sbom/license.d.ts +31 -0
- package/dist/sbom/lockfile.d.ts +34 -0
- package/dist/sbom/purl.d.ts +25 -0
- package/dist/sbom/resolve-specifier.d.ts +24 -0
- package/dist/sbom/types.d.ts +196 -0
- package/dist/secrets/baseline.d.ts +20 -0
- package/dist/secrets/format.d.ts +14 -0
- package/dist/secrets/git.d.ts +6 -0
- package/dist/secrets/spinner.d.ts +9 -0
- package/dist/selectors.d.ts +81 -0
- package/dist/shell-history.d.ts +16 -0
- package/dist/staged/cli-parse.d.ts +18 -0
- package/dist/staged/config.d.ts +14 -0
- package/dist/staged/errors/apply-empty-commit-error.d.ts +4 -0
- package/dist/staged/errors/config-error.d.ts +4 -0
- package/dist/staged/errors/get-backup-stash-error.d.ts +4 -0
- package/dist/staged/errors/git-error.d.ts +6 -0
- package/dist/staged/errors/index.d.ts +12 -0
- package/dist/staged/errors/restore-original-state-error.d.ts +4 -0
- package/dist/staged/errors/staged-error.d.ts +8 -0
- package/dist/staged/errors/task-error.d.ts +6 -0
- package/dist/staged/git/diff.d.ts +76 -0
- package/dist/staged/git/exec.d.ts +43 -0
- package/dist/staged/git/index.d.ts +77 -0
- package/dist/staged/git/stash.d.ts +37 -0
- package/dist/staged/index.d.ts +13 -0
- package/dist/staged/match.d.ts +12 -0
- package/dist/staged/renderer/index.d.ts +9 -0
- package/dist/staged/renderer/ink/index.d.ts +4 -0
- package/dist/staged/renderer/plain.d.ts +12 -0
- package/dist/staged/tasks/build.d.ts +13 -0
- package/dist/staged/tasks/exec.d.ts +56 -0
- package/dist/staged/tasks/run.d.ts +26 -0
- package/dist/staged/types.d.ts +173 -0
- package/dist/target-discovery.d.ts +59 -0
- package/dist/target-options.d.ts +261 -0
- package/dist/tui/components/OutputPanel.d.ts +2 -1
- package/dist/tui/components/TaskListPanel.d.ts +1 -1
- package/dist/tui/components/TaskStore.d.ts +1 -1
- package/dist/tui/components/devcontainer/DevcontainerStore.d.ts +1 -1
- package/dist/tui/components/devcontainer/catalogs/mount-suggestions.d.ts +1 -1
- package/dist/tui/components/devcontainer/sections/GeneralSection.d.ts +1 -1
- package/dist/tui/components/devcontainer/sections/PreviewPanel.d.ts +1 -1
- package/dist/tui/components/devcontainer/types.d.ts +4 -4
- package/dist/tui/components/graph/GraphStore.d.ts +1 -1
- package/dist/tui/components/graph/ProjectDetailPanel.d.ts +1 -1
- package/dist/tui/components/optimize/OptimizeDetailPanel.d.ts +1 -1
- package/dist/tui/components/optimize/OptimizeStore.d.ts +1 -1
- package/dist/tui/components/update/PackageDetailPanel.d.ts +1 -1
- package/dist/tui/components/update/PackageListPanel.d.ts +2 -2
- package/dist/tui/components/update/UpdateStore.d.ts +1 -1
- package/dist/tui/components/update/VisUpdateApp.d.ts +3 -3
- package/dist/tui/dynamic-life-cycle.d.ts +2 -1
- package/dist/tui/static-life-cycle.d.ts +7 -1
- package/dist/watch.d.ts +65 -0
- package/dist/workspace.d.ts +326 -6
- package/index.js +727 -554
- package/package.json +38 -32
- package/schemas/project.schema.json +344 -0
- package/schemas/vis-config.schema.json +331 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared helpers for resolving the task runner's cache directory.
|
|
3
|
+
*
|
|
4
|
+
* Used by `vis run` (to configure the runner) and `vis cache` (to manage the
|
|
5
|
+
* cache from the outside) so both commands agree on:
|
|
6
|
+
*
|
|
7
|
+
* - the resolution order: `--cache-dir` flag > vis.config.ts
|
|
8
|
+
* `taskRunnerOptions.cacheDirectory` > `{workspaceRoot}/.task-runner-cache`
|
|
9
|
+
* - relative-path normalization against `workspaceRoot`
|
|
10
|
+
* - containment checks (used to decide whether a destructive operation is
|
|
11
|
+
* safe to perform without confirmation)
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the cache directory from CLI options and vis.config.ts.
|
|
15
|
+
*
|
|
16
|
+
* All paths returned from this helper are absolute — relative values are
|
|
17
|
+
* resolved against `workspaceRoot` so they refer to the same directory no
|
|
18
|
+
* matter what `process.cwd()` happens to be when the command runs.
|
|
19
|
+
*
|
|
20
|
+
* Precedence: `optionsCacheDir` > `configCacheDir` > `{workspaceRoot}/{@link DEFAULT_CACHE_DIRECTORY_NAME}`.
|
|
21
|
+
* @param workspaceRoot Absolute path to the workspace root directory.
|
|
22
|
+
* @param optionsCacheDir CLI `--cache-dir` value (may be relative or absolute). Takes highest priority.
|
|
23
|
+
* @param configCacheDir `taskRunnerOptions.cacheDirectory` from vis.config.ts (may be relative or absolute).
|
|
24
|
+
* @returns The resolved absolute path to the cache directory.
|
|
25
|
+
*/
|
|
26
|
+
declare const resolveCacheDirectory: (workspaceRoot: string, optionsCacheDir: string | undefined, configCacheDir: string | undefined) => string;
|
|
27
|
+
/**
|
|
28
|
+
* Converts an arbitrary branch name into a filesystem-safe segment.
|
|
29
|
+
* Strips characters outside `[A-Za-z0-9_.-]`, collapses runs of
|
|
30
|
+
* disallowed characters into a single `-`, and trims leading/trailing
|
|
31
|
+
* dashes. Truncated to 64 chars so deep-nested branch names (`user/long/feat`)
|
|
32
|
+
* stay bounded.
|
|
33
|
+
*/
|
|
34
|
+
export declare const sanitizeBranchSegment: (branch: string) => string;
|
|
35
|
+
/**
|
|
36
|
+
* Detects the current git branch by shelling out to `git rev-parse`.
|
|
37
|
+
* Returns `undefined` on detached HEAD, non-git workspaces, or when
|
|
38
|
+
* git is unavailable — callers fall back to the unscoped cache.
|
|
39
|
+
*/
|
|
40
|
+
export declare const detectGitBranch: (cwd: string) => string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Appends a branch-specific subdirectory to `cacheDirectory` when
|
|
43
|
+
* `enabled` is true and a branch can be detected. Keeps `main` and
|
|
44
|
+
* feature branches from thrashing each other's caches — different
|
|
45
|
+
* generated artefacts (schemas, `.d.ts` snapshots) cause oscillating
|
|
46
|
+
* invalidations when the same hash resolves to different contents.
|
|
47
|
+
*
|
|
48
|
+
* When `enabled === false` or the branch can't be detected, returns
|
|
49
|
+
* `cacheDirectory` unchanged. On detached HEAD or CI checkouts where
|
|
50
|
+
* `git rev-parse` resolves `HEAD`, the original path is used — this
|
|
51
|
+
* matches the behaviour of a non-git clone.
|
|
52
|
+
* @param cacheDirectory Resolved base cache directory.
|
|
53
|
+
* @param workspaceRoot Absolute path used to probe the branch.
|
|
54
|
+
* @param enabled When undefined, branch scoping is off. Set to `true`
|
|
55
|
+
* (or omit to keep current behaviour) to enable.
|
|
56
|
+
*/
|
|
57
|
+
export declare const applyBranchScope: (cacheDirectory: string, workspaceRoot: string, enabled: boolean | undefined) => string;
|
|
58
|
+
/**
|
|
59
|
+
* Returns `true` when `cacheDirectory` sits inside `workspaceRoot`. Uses
|
|
60
|
+
* `relative()` instead of `startsWith()` so paths with a common string
|
|
61
|
+
* prefix but different parents (e.g. `/work` vs `/workspace`) are correctly
|
|
62
|
+
* distinguished.
|
|
63
|
+
*
|
|
64
|
+
* Callers use this to decide whether a `rm -rf` on the cache directory is
|
|
65
|
+
* safe without an extra confirmation prompt.
|
|
66
|
+
* @param cacheDirectory Absolute path to the cache directory.
|
|
67
|
+
* @param workspaceRoot Absolute path to the workspace root directory.
|
|
68
|
+
* @returns `true` when `cacheDirectory` is a proper descendant of `workspaceRoot`; `false` otherwise
|
|
69
|
+
* (including when the two paths are identical).
|
|
70
|
+
*/
|
|
71
|
+
declare const isCacheDirectoryInsideWorkspace: (cacheDirectory: string, workspaceRoot: string) => boolean;
|
|
72
|
+
export { isCacheDirectoryInsideWorkspace, resolveCacheDirectory };
|
|
73
|
+
export { DEFAULT_CACHE_DIRECTORY_NAME } from "@visulima/task-runner";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { WorkspaceConfiguration } from "@visulima/task-runner";
|
|
2
|
+
import type { CodeownersConfig } from "./workspace.d.ts";
|
|
3
|
+
export type { CodeownersConfig } from "./workspace.d.ts";
|
|
4
|
+
/**
|
|
5
|
+
* A single resolved CODEOWNERS line, pre-sorted by path. Kept as an
|
|
6
|
+
* object so callers can post-process (e.g. append sub-sections).
|
|
7
|
+
*/
|
|
8
|
+
export interface CodeownersLine {
|
|
9
|
+
/** Optional notification channel (added as a trailing comment). */
|
|
10
|
+
channel?: string;
|
|
11
|
+
/** Owner handles, space-separated by the writer. */
|
|
12
|
+
owners: string[];
|
|
13
|
+
/** Effective path glob (workspace-root-relative). */
|
|
14
|
+
path: string;
|
|
15
|
+
/** Source project name — used for `order-by=project-id` sorting. */
|
|
16
|
+
projectId?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Computes CODEOWNERS lines from the workspace's projects and a
|
|
20
|
+
* workspace-level `codeowners` block. Returns lines in the requested
|
|
21
|
+
* order (default: `file-source`).
|
|
22
|
+
*/
|
|
23
|
+
export declare const buildCodeownersLines: (workspace: WorkspaceConfiguration, config: CodeownersConfig | undefined) => CodeownersLine[];
|
|
24
|
+
/**
|
|
25
|
+
* Serialises {@link CodeownersLine}s to a valid CODEOWNERS file string.
|
|
26
|
+
* @param lines Resolved CODEOWNERS lines.
|
|
27
|
+
* @param _provider Reserved for future provider-specific formatting (e.g. Bitbucket syntax).
|
|
28
|
+
* @returns The full CODEOWNERS file content with header and trailing newline.
|
|
29
|
+
*/
|
|
30
|
+
export declare const renderCodeowners: (lines: CodeownersLine[], _provider?: CodeownersConfig["provider"]) => string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Command } from "@visulima/cerebro";
|
|
2
|
+
/**
|
|
3
|
+
* `vis action-graph <selector>` — shows the execution plan that would
|
|
4
|
+
* be produced by `vis run <selector>` without running anything. Matches
|
|
5
|
+
* moon's `moon action-graph`.
|
|
6
|
+
*/
|
|
7
|
+
declare const actionGraph: Command;
|
|
8
|
+
export default actionGraph;
|
package/dist/commands/audit.d.ts
CHANGED
|
@@ -13,10 +13,10 @@ interface DuplicatePackage {
|
|
|
13
13
|
}
|
|
14
14
|
declare const scanInstalledPackages: (workspaceRoot: string) => InstalledPackage[];
|
|
15
15
|
/**
|
|
16
|
-
* Finds packages with multiple installed versions by parsing the
|
|
17
|
-
*
|
|
16
|
+
* Finds packages with multiple installed versions by parsing the
|
|
17
|
+
* workspace lockfile via `@visulima/package`.
|
|
18
18
|
*/
|
|
19
|
-
declare const findDuplicateDependencies: (workspaceRoot: string, pmName: string) =>
|
|
19
|
+
declare const findDuplicateDependencies: (workspaceRoot: string, pmName: string) => DuplicatePackage[];
|
|
20
20
|
declare const audit: Command;
|
|
21
21
|
export default audit;
|
|
22
22
|
export type { DuplicatePackage, InstalledPackage };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { Command } from "@visulima/cerebro";
|
|
2
|
+
/**
|
|
3
|
+
* Shape returned by `collectCacheEntries`. Kept close to what `removeOldEntries`
|
|
4
|
+
* uses internally so we can render the list identically.
|
|
5
|
+
*/
|
|
6
|
+
interface CacheEntry {
|
|
7
|
+
hash: string;
|
|
8
|
+
mtimeMs: number;
|
|
9
|
+
path: string;
|
|
10
|
+
sizeBytes: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Reads the cache directory and returns one entry per cached task hash.
|
|
14
|
+
* Skips any file/directory starting with `.` (index files, temp dirs).
|
|
15
|
+
* @param cacheDirectory Absolute path to the cache root directory.
|
|
16
|
+
* @returns Array of cache entries sorted newest-first by modification time.
|
|
17
|
+
* Returns an empty array when the directory does not exist or is empty.
|
|
18
|
+
*/
|
|
19
|
+
declare const collectCacheEntries: (cacheDirectory: string) => Promise<CacheEntry[]>;
|
|
20
|
+
/**
|
|
21
|
+
* Formats the difference between `now` and `mtimeMs` as a short age string:
|
|
22
|
+
* "3m", "2h", "4d". The caller passes a shared `now` so rows in the same
|
|
23
|
+
* listing use a consistent baseline.
|
|
24
|
+
* @param mtimeMs File modification time in milliseconds since epoch.
|
|
25
|
+
* @param now Reference timestamp in milliseconds since epoch. Defaults to `Date.now()`.
|
|
26
|
+
* @returns A compact age string such as `"5s"`, `"10m"`, `"2h"`, or `"3d"`.
|
|
27
|
+
*/
|
|
28
|
+
declare const formatAge: (mtimeMs: number, now?: number) => string;
|
|
29
|
+
/**
|
|
30
|
+
* `list` subcommand — prints a table of cached task entries.
|
|
31
|
+
* @param cacheDirectory Absolute path to the cache directory to enumerate.
|
|
32
|
+
* @param format Output format: `"table"` for a human-readable table, `"json"` for machine-readable JSON.
|
|
33
|
+
* @param logger Console instance used for non-prefixed table rows.
|
|
34
|
+
* @returns Resolves when output has been written.
|
|
35
|
+
*/
|
|
36
|
+
declare const runList: (cacheDirectory: string, format: string, logger: Console) => Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* `clean` subcommand — removes the entire cache directory.
|
|
39
|
+
*
|
|
40
|
+
* Uses `Cache.clear()` when the directory is inside `workspaceRoot` so we
|
|
41
|
+
* match the task runner's own cleanup semantics. For custom `--cache-dir`
|
|
42
|
+
* paths that live outside the workspace we fall back to `rm -r`, but only
|
|
43
|
+
* after prompting for confirmation: users pointing at a shared location
|
|
44
|
+
* (e.g. `~/.cache/...`) shouldn't lose unrelated data without an opt-in.
|
|
45
|
+
* The prompt is skipped in non-TTY / CI contexts and when `--force` is set.
|
|
46
|
+
*
|
|
47
|
+
* Refuses outright when `cacheDirectory` resolves to the workspace root.
|
|
48
|
+
* @param cacheDirectory Absolute path to the cache directory to remove.
|
|
49
|
+
* @param workspaceRoot Absolute path to the workspace root (used for containment checks and `Cache` construction).
|
|
50
|
+
* @param options `dryRun` previews without deleting; `force` skips the out-of-workspace confirmation prompt.
|
|
51
|
+
* @returns Resolves when the operation completes (or is skipped / aborted).
|
|
52
|
+
*/
|
|
53
|
+
declare const runClean: (cacheDirectory: string, workspaceRoot: string, options: {
|
|
54
|
+
dryRun: boolean;
|
|
55
|
+
force: boolean;
|
|
56
|
+
}) => Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* `prune` subcommand — removes stale entries (age + size) without nuking
|
|
59
|
+
* everything. Mirrors `Cache.removeOldEntries()` which the runner invokes
|
|
60
|
+
* automatically on each run.
|
|
61
|
+
*
|
|
62
|
+
* Both `--max-age-days` and `--max-size` are validated up-front so
|
|
63
|
+
* malformed values produce a friendly CLI error instead of a stack trace
|
|
64
|
+
* from inside `Cache`. The before/after count is a best-effort estimate —
|
|
65
|
+
* a concurrent `vis run` could skew it, but the cache state remains correct.
|
|
66
|
+
* @param cacheDirectory Absolute path to the cache directory to prune.
|
|
67
|
+
* @param workspaceRoot Absolute path to the workspace root (passed to the `Cache` constructor).
|
|
68
|
+
* @param options `maxCacheAgeDays` evicts entries older than N days; `maxCacheSize` (e.g. `"500MB"`)
|
|
69
|
+
* evicts oldest entries until the total size is under the limit.
|
|
70
|
+
* @returns Resolves when pruning completes or is skipped.
|
|
71
|
+
*/
|
|
72
|
+
declare const runPrune: (cacheDirectory: string, workspaceRoot: string, options: {
|
|
73
|
+
maxCacheAgeDays?: number;
|
|
74
|
+
maxCacheSize?: string;
|
|
75
|
+
}) => Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* `size` subcommand — prints the cache directory's on-disk footprint without
|
|
78
|
+
* the per-entry table.
|
|
79
|
+
* @param cacheDirectory Absolute path to the cache directory to measure.
|
|
80
|
+
* @param format `"table"` for human-readable output, `"json"` for machine-readable JSON.
|
|
81
|
+
* @returns Resolves when output has been written.
|
|
82
|
+
*/
|
|
83
|
+
declare const runSize: (cacheDirectory: string, format: string) => Promise<void>;
|
|
84
|
+
declare const cache: Command;
|
|
85
|
+
export default cache;
|
|
86
|
+
export { collectCacheEntries, formatAge, runClean, runList, runPrune, runSize };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Command } from "@visulima/cerebro";
|
|
2
|
+
/**
|
|
3
|
+
* `vis ci` bundles the CI lifecycle in a single entry:
|
|
4
|
+
*
|
|
5
|
+
* 1. Install dependencies (respecting lockfile / frozen install).
|
|
6
|
+
* 2. Enforce project constraints (implicit, via the `run` command).
|
|
7
|
+
* 3. Determine affected projects since the base ref.
|
|
8
|
+
* 4. Run the requested targets on affected projects only.
|
|
9
|
+
*
|
|
10
|
+
* Meant to be invoked as a single command at the top of a CI job:
|
|
11
|
+
*
|
|
12
|
+
* vis ci lint test build
|
|
13
|
+
*
|
|
14
|
+
* Compared to wiring these up by hand, this skips reinstalling when
|
|
15
|
+
* already installed, uses CI-safe defaults, and picks up the base ref
|
|
16
|
+
* from common CI provider environment variables.
|
|
17
|
+
*/
|
|
18
|
+
declare const ci: Command;
|
|
19
|
+
export default ci;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Command } from "@visulima/cerebro";
|
|
2
|
+
/**
|
|
3
|
+
* `vis docker scaffold` / `vis docker prune` — scaffolding and pruning
|
|
4
|
+
* helpers that mirror moon's `moon docker scaffold` and `moon docker prune`
|
|
5
|
+
* commands. Used inside Dockerfiles to keep install layers cache-friendly.
|
|
6
|
+
*
|
|
7
|
+
* Typical Dockerfile usage:
|
|
8
|
+
*
|
|
9
|
+
* ```dockerfile
|
|
10
|
+
* FROM node:22 AS deps
|
|
11
|
+
* WORKDIR /app
|
|
12
|
+
* COPY .vis/docker/workspace/ ./
|
|
13
|
+
* RUN pnpm install --frozen-lockfile
|
|
14
|
+
*
|
|
15
|
+
* FROM deps AS build
|
|
16
|
+
* COPY .vis/docker/sources/ ./
|
|
17
|
+
* RUN pnpm --filter my-app build
|
|
18
|
+
* RUN vis docker prune --context=.vis/docker
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare const docker: Command;
|
|
22
|
+
export default docker;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vis generate <template>` — in-repo scaffolding command.
|
|
3
|
+
*
|
|
4
|
+
* Discovers templates from `.vis/templates/`, `.moon/templates/`, and
|
|
5
|
+
* `vis.config.ts` `generator.templates`, then runs the selected
|
|
6
|
+
* template through prompts → produce → write.
|
|
7
|
+
*/
|
|
8
|
+
import type { Command } from "@visulima/cerebro";
|
|
9
|
+
declare const generate: Command;
|
|
10
|
+
export default generate;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers for `vis ignore`. Split from `ignore.ts` so tests can
|
|
3
|
+
* exercise them without pulling in `@visulima/task-runner`, which
|
|
4
|
+
* otherwise drags the whole run-graph module through ESM evaluation.
|
|
5
|
+
*/
|
|
6
|
+
/** Commit-message tokens that unconditionally skip the build. */
|
|
7
|
+
declare const SKIP_TOKENS: readonly ["[skip ci]", "[ci skip]", "[no ci]", "[vis skip]", "[nx skip]"];
|
|
8
|
+
/** Commit-message tokens that unconditionally force the build. */
|
|
9
|
+
declare const FORCE_TOKENS: readonly ["[vis deploy]", "[nx deploy]"];
|
|
10
|
+
/**
|
|
11
|
+
* Token prefixes accepted for per-project commit-message gating. `vis` is
|
|
12
|
+
* the canonical form; `nx` is kept so teams migrating from `nx-ignore`
|
|
13
|
+
* don't have to rewrite their commit automation.
|
|
14
|
+
*/
|
|
15
|
+
declare const PER_PROJECT_TOKEN_PREFIXES: readonly ["vis", "nx"];
|
|
16
|
+
/**
|
|
17
|
+
* CI-provider environment variables carrying the previously deployed SHA,
|
|
18
|
+
* probed in priority order. Only providers that *actually* invoke a custom
|
|
19
|
+
* ignore script (Vercel, Netlify) or that we commonly wrap manually in a
|
|
20
|
+
* preflight CI step (GitHub Actions, GitLab CI) are listed here.
|
|
21
|
+
*
|
|
22
|
+
* Cloudflare Pages / Render / Amplify are intentionally absent: they have
|
|
23
|
+
* no custom-command hook, so shipping env detection for them would only
|
|
24
|
+
* create the illusion of support.
|
|
25
|
+
*/
|
|
26
|
+
declare const CI_BASE_SHA_ENV_VARS: readonly ["CACHED_COMMIT_REF", "VERCEL_GIT_PREVIOUS_SHA", "GITHUB_BASE_REF", "CI_COMMIT_BEFORE_SHA"];
|
|
27
|
+
/** Machine-readable reason codes for the ignore decision. */
|
|
28
|
+
type IgnoreReason = "commit-force-deploy" | "commit-skip" | "missing-project-argument" | "no-changes" | "project-affected" | "project-not-affected" | "project-unknown" | "workspace-error";
|
|
29
|
+
/**
|
|
30
|
+
* Structured decision record emitted on stdout in `--json` mode and
|
|
31
|
+
* rendered as human text otherwise.
|
|
32
|
+
*/
|
|
33
|
+
interface IgnoreDecision {
|
|
34
|
+
/** "build" continues the deployment, "skip" cancels it. */
|
|
35
|
+
action: "build" | "skip";
|
|
36
|
+
/** The affected-project list, when the comparison actually ran. */
|
|
37
|
+
affectedProjects?: string[];
|
|
38
|
+
/** Base ref used for the affected comparison, if any. */
|
|
39
|
+
base?: string;
|
|
40
|
+
/** Head ref used for the affected comparison, if any. */
|
|
41
|
+
head?: string;
|
|
42
|
+
/** Human-readable reason message. */
|
|
43
|
+
message: string;
|
|
44
|
+
/** The project the decision applies to. */
|
|
45
|
+
project: string;
|
|
46
|
+
/** Stable reason code for scripting / analytics. */
|
|
47
|
+
reason: IgnoreReason;
|
|
48
|
+
}
|
|
49
|
+
/** Extra fields that decisions from the affected-detection path carry. */
|
|
50
|
+
type DecisionExtras = Partial<Pick<IgnoreDecision, "affectedProjects" | "base" | "head">>;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the first non-empty value from the CI env var priority list,
|
|
53
|
+
* or `undefined` if nothing is set. Reads from `env` (defaults to
|
|
54
|
+
* `process.env`) so tests can inject fixtures without clobbering globals.
|
|
55
|
+
* @param env Environment dictionary to probe. Defaults to `process.env`.
|
|
56
|
+
* @returns The resolved base SHA (trimmed) or `undefined` if no known CI env var is set.
|
|
57
|
+
*/
|
|
58
|
+
declare const resolveCiBaseSha: (env?: NodeJS.ProcessEnv) => string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Throws if the given string contains characters outside the safe git-ref
|
|
61
|
+
* alphabet or begins with a dash. Mirrors the validation used by
|
|
62
|
+
* task-runner's affected logic and additionally rejects leading dashes to
|
|
63
|
+
* prevent `git` option injection when the ref is passed as a positional
|
|
64
|
+
* argument to `execFile("git", [...])`.
|
|
65
|
+
* @param ref The git ref to validate (e.g. `"HEAD"`, `"main"`, `"abc123"`).
|
|
66
|
+
* @throws {Error} If `ref` does not match `GIT_REF_RE`. Returns `void` on success.
|
|
67
|
+
*/
|
|
68
|
+
declare const validateGitRef: (ref: string) => void;
|
|
69
|
+
/**
|
|
70
|
+
* Returns `true` if `ref` resolves to a commit object in the given repo.
|
|
71
|
+
* Used to detect unreachable base refs (e.g. Vercel's shallow clone) so
|
|
72
|
+
* we can silently fall back to `HEAD~1`.
|
|
73
|
+
* @param cwd Absolute path to the git repository's working directory.
|
|
74
|
+
* @param ref The git ref to probe. Should already be validated by `validateGitRef` to avoid `git` option injection.
|
|
75
|
+
* @returns `true` if the ref resolves to a commit, `false` otherwise (including when `git` itself fails or is unavailable).
|
|
76
|
+
*/
|
|
77
|
+
declare const isRefReachable: (cwd: string, ref: string) => Promise<boolean>;
|
|
78
|
+
/**
|
|
79
|
+
* Reads the subject+body of the most recent commit. Returns an empty
|
|
80
|
+
* string on any failure — the caller treats missing messages as "no
|
|
81
|
+
* keywords present" rather than erroring out.
|
|
82
|
+
* @param cwd Absolute path to the git repository's working directory.
|
|
83
|
+
* @returns The raw commit message (subject + body), or `""` on failure.
|
|
84
|
+
*/
|
|
85
|
+
declare const readLastCommitMessage: (cwd: string) => Promise<string>;
|
|
86
|
+
/**
|
|
87
|
+
* Returns `true` if the commit message contains a per-project token of
|
|
88
|
+
* the form `[<prefix> <verb> <project>]` for any of the supported
|
|
89
|
+
* prefixes (`vis` or the legacy `nx`).
|
|
90
|
+
* @param message Raw commit message to scan.
|
|
91
|
+
* @param verb The action verb embedded in the token (`"skip"` or `"deploy"`).
|
|
92
|
+
* @param project The project name the token is scoped to.
|
|
93
|
+
* @returns `true` on the first matching token, `false` otherwise.
|
|
94
|
+
*/
|
|
95
|
+
declare const matchesPerProjectToken: (message: string, verb: "deploy" | "skip", project: string) => boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Returns `true` if the commit message contains any skip token,
|
|
98
|
+
* including the per-project form `[vis skip <project>]`. Accepts both
|
|
99
|
+
* `vis` and legacy `nx` tokens so users migrating from nx-ignore don't
|
|
100
|
+
* need to rewrite their commit automation.
|
|
101
|
+
* @param message Raw commit message to scan.
|
|
102
|
+
* @param project The project whose per-project tokens should also match.
|
|
103
|
+
* @returns `true` if any skip token is present, `false` otherwise.
|
|
104
|
+
*/
|
|
105
|
+
declare const commitHasSkipMessage: (message: string, project: string) => boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Returns `true` if the commit message contains any force-deploy token,
|
|
108
|
+
* including the per-project form `[vis deploy <project>]`.
|
|
109
|
+
* @param message Raw commit message to scan.
|
|
110
|
+
* @param project The project whose per-project tokens should also match.
|
|
111
|
+
* @returns `true` if any force-deploy token is present, `false` otherwise.
|
|
112
|
+
*/
|
|
113
|
+
declare const commitHasForceDeployMessage: (message: string, project: string) => boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Builds a `"build"` decision record. Factory helper that collapses the
|
|
116
|
+
* otherwise-repetitive object literals in `ignore.ts`.
|
|
117
|
+
* @param project The project the decision applies to.
|
|
118
|
+
* @param reason Stable reason code.
|
|
119
|
+
* @param message Human-readable message.
|
|
120
|
+
* @param extra Optional base/head/affectedProjects when available.
|
|
121
|
+
* @returns A fully-populated `IgnoreDecision` with `action: "build"`.
|
|
122
|
+
*/
|
|
123
|
+
declare const decideBuild: (project: string, reason: IgnoreReason, message: string, extra?: DecisionExtras) => IgnoreDecision;
|
|
124
|
+
/**
|
|
125
|
+
* Builds a `"skip"` decision record. Companion to `decideBuild`.
|
|
126
|
+
* @param project The project the decision applies to.
|
|
127
|
+
* @param reason Stable reason code.
|
|
128
|
+
* @param message Human-readable message.
|
|
129
|
+
* @param extra Optional base/head/affectedProjects when available.
|
|
130
|
+
* @returns A fully-populated `IgnoreDecision` with `action: "skip"`.
|
|
131
|
+
*/
|
|
132
|
+
declare const decideSkip: (project: string, reason: IgnoreReason, message: string, extra?: DecisionExtras) => IgnoreDecision;
|
|
133
|
+
/**
|
|
134
|
+
* Renders a decision as a single human-readable line. Pure formatter;
|
|
135
|
+
* doesn't print anything itself.
|
|
136
|
+
* @param decision The decision to format.
|
|
137
|
+
* @returns A one-line string with an emoji prefix and the message.
|
|
138
|
+
*/
|
|
139
|
+
declare const formatDecisionLine: (decision: IgnoreDecision) => string;
|
|
140
|
+
/**
|
|
141
|
+
* Maps a decision to its process exit code, honoring
|
|
142
|
+
* `--exit-zero-on-build` for users who want normal exit semantics.
|
|
143
|
+
*
|
|
144
|
+
* Default:
|
|
145
|
+
* skip → 0 (platform cancels)
|
|
146
|
+
* build → 1 (platform continues)
|
|
147
|
+
*
|
|
148
|
+
* With --exit-zero-on-build:
|
|
149
|
+
* skip → 0
|
|
150
|
+
* build → 0
|
|
151
|
+
* @param decision The decision to map.
|
|
152
|
+
* @param exitZeroOnBuild If `true`, builds exit with `0` instead of `1`.
|
|
153
|
+
* @returns The literal exit code (`0` or `1`).
|
|
154
|
+
*/
|
|
155
|
+
declare const exitCodeFor: (decision: IgnoreDecision, exitZeroOnBuild: boolean) => 0 | 1;
|
|
156
|
+
export type { IgnoreDecision, IgnoreReason };
|
|
157
|
+
export { CI_BASE_SHA_ENV_VARS, commitHasForceDeployMessage, commitHasSkipMessage, decideBuild, decideSkip, exitCodeFor, FORCE_TOKENS, formatDecisionLine, isRefReachable, matchesPerProjectToken, PER_PROJECT_TOKEN_PREFIXES, readLastCommitMessage, resolveCiBaseSha, SKIP_TOKENS, validateGitRef, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vis ignore <project>` — CI build gating for deployment platforms.
|
|
3
|
+
*
|
|
4
|
+
* Exits with inverted codes so it can be wired directly into Vercel's
|
|
5
|
+
* "Ignored Build Step" field or Netlify's `ignore` command:
|
|
6
|
+
*
|
|
7
|
+
* exit 0 → platform cancels the build (project is NOT affected)
|
|
8
|
+
* exit 1 → platform continues the build (project IS affected)
|
|
9
|
+
*
|
|
10
|
+
* Inspired by `nx-ignore` from nrwl/nx-labs, but reuses vis's own
|
|
11
|
+
* `getAffectedProjects` so it doesn't need to bootstrap a parallel
|
|
12
|
+
* Nx installation on the deploy runner. Pure helpers live in
|
|
13
|
+
* `./ignore-helpers` for test isolation.
|
|
14
|
+
*/
|
|
15
|
+
import type { Command } from "@visulima/cerebro";
|
|
16
|
+
declare const ignore: Command;
|
|
17
|
+
export default ignore;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MigrationReport } from "./types.d.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Create a `.bak` sibling alongside `path` before we mutate/delete it. We only
|
|
4
|
+
* back up on first touch — subsequent writes to the same file in a single
|
|
5
|
+
* migration run don't clobber the original snapshot. When `report` is provided
|
|
6
|
+
* the backup path is recorded for the migration summary.
|
|
7
|
+
*/
|
|
8
|
+
export declare const backupFile: (path: string, report?: MigrationReport) => void;
|
|
@@ -2,11 +2,15 @@ declare const LINT_STAGED_JSON_CONFIG_FILES: readonly [".lintstagedrc.json", ".l
|
|
|
2
2
|
declare const LINT_STAGED_OTHER_CONFIG_FILES: readonly [".lintstagedrc.yaml", ".lintstagedrc.yml", ".lintstagedrc.mjs", "lint-staged.config.mjs", ".lintstagedrc.cjs", "lint-staged.config.cjs", ".lintstagedrc.js", "lint-staged.config.js", ".lintstagedrc.ts", "lint-staged.config.ts", ".lintstagedrc.mts", "lint-staged.config.mts", ".lintstagedrc.cts", "lint-staged.config.cts"];
|
|
3
3
|
declare const LINT_STAGED_ALL_CONFIG_FILES: ReadonlyArray<string>;
|
|
4
4
|
declare const STALE_LINT_STAGED_PATTERNS: ReadonlyArray<RegExp>;
|
|
5
|
-
declare const
|
|
5
|
+
declare const NANO_STAGED_JSON_CONFIG_FILES: readonly [".nano-staged.json", ".nanostagedrc"];
|
|
6
|
+
declare const NANO_STAGED_OTHER_CONFIG_FILES: readonly [".nano-staged.mjs", ".nano-staged.cjs", ".nano-staged.js", "nano-staged.config.mjs", "nano-staged.config.cjs", "nano-staged.config.js", "nano-staged.config.mts", "nano-staged.config.cts", "nano-staged.config.ts"];
|
|
7
|
+
declare const NANO_STAGED_ALL_CONFIG_FILES: ReadonlyArray<string>;
|
|
8
|
+
declare const STALE_NANO_STAGED_PATTERNS: ReadonlyArray<RegExp>;
|
|
9
|
+
declare const REPLACED_PACKAGES: readonly ["husky", "lint-staged", "nano-staged"];
|
|
6
10
|
declare const HUSKY_SCRIPT_PATTERNS: ReadonlyArray<RegExp>;
|
|
7
11
|
/**
|
|
8
12
|
* Remove husky references from a single script value.
|
|
9
13
|
* Returns the cleaned script, or undefined if the entire script should be removed.
|
|
10
14
|
*/
|
|
11
15
|
declare const cleanHuskyFromScript: (scriptValue: string) => string | undefined;
|
|
12
|
-
export { cleanHuskyFromScript, HUSKY_SCRIPT_PATTERNS, LINT_STAGED_ALL_CONFIG_FILES, LINT_STAGED_JSON_CONFIG_FILES, LINT_STAGED_OTHER_CONFIG_FILES, REPLACED_PACKAGES, STALE_LINT_STAGED_PATTERNS, };
|
|
16
|
+
export { cleanHuskyFromScript, HUSKY_SCRIPT_PATTERNS, LINT_STAGED_ALL_CONFIG_FILES, LINT_STAGED_JSON_CONFIG_FILES, LINT_STAGED_OTHER_CONFIG_FILES, NANO_STAGED_ALL_CONFIG_FILES, NANO_STAGED_JSON_CONFIG_FILES, NANO_STAGED_OTHER_CONFIG_FILES, REPLACED_PACKAGES, STALE_LINT_STAGED_PATTERNS, STALE_NANO_STAGED_PATTERNS, };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { MigrateLogger, MigrationReport } from "./types.d.ts";
|
|
2
|
+
interface GitleaksUpstreamFinding {
|
|
3
|
+
Author?: string;
|
|
4
|
+
Commit?: string;
|
|
5
|
+
Date?: string;
|
|
6
|
+
Description?: string;
|
|
7
|
+
Email?: string;
|
|
8
|
+
EndColumn?: number;
|
|
9
|
+
EndLine?: number;
|
|
10
|
+
Entropy?: number;
|
|
11
|
+
File?: string;
|
|
12
|
+
Fingerprint?: string;
|
|
13
|
+
Match?: string;
|
|
14
|
+
Message?: string;
|
|
15
|
+
RuleID?: string;
|
|
16
|
+
Secret?: string;
|
|
17
|
+
StartColumn?: number;
|
|
18
|
+
StartLine?: number;
|
|
19
|
+
Tags?: string[];
|
|
20
|
+
}
|
|
21
|
+
declare const detectGitleaksConfig: (root: string) => string | undefined;
|
|
22
|
+
declare const detectGitleaksIgnore: (root: string) => string | undefined;
|
|
23
|
+
declare const detectGitleaksBaseline: (root: string) => string | undefined;
|
|
24
|
+
declare const convertBaseline: (upstream: GitleaksUpstreamFinding[]) => unknown[];
|
|
25
|
+
declare const migrateGitleaks: (root: string, options: {
|
|
26
|
+
dryRun: boolean;
|
|
27
|
+
silent?: boolean;
|
|
28
|
+
}, logger: MigrateLogger, report: MigrationReport) => boolean;
|
|
29
|
+
export { convertBaseline, detectGitleaksBaseline, detectGitleaksConfig, detectGitleaksIgnore, migrateGitleaks };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MigrationReport } from "./types.d.ts";
|
|
1
2
|
/**
|
|
2
3
|
* Reads and parses a JSON file. Returns undefined if the file doesn't exist or isn't valid JSON.
|
|
3
4
|
*/
|
|
@@ -14,7 +15,8 @@ declare const detectJsonIndent: (content: string) => number;
|
|
|
14
15
|
* Edits a JSON file in place using a mutator function.
|
|
15
16
|
* The mutator receives the parsed data and should return the modified data,
|
|
16
17
|
* or undefined to skip writing. Returns true if the file was modified.
|
|
17
|
-
* Preserves the original indentation style.
|
|
18
|
+
* Preserves the original indentation style. When `report` is provided, a
|
|
19
|
+
* `.bak` snapshot is taken before the write.
|
|
18
20
|
*/
|
|
19
|
-
declare const editJsonFile: <T>(filePath: string, mutator: (data: T) => T | undefined) => boolean;
|
|
21
|
+
declare const editJsonFile: <T>(filePath: string, mutator: (data: T) => T | undefined, report?: MigrationReport) => boolean;
|
|
20
22
|
export { detectJsonIndent, editJsonFile, isJsonFile, readJsonFile };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { MigrateLogger, MigrationReport } from "./types.d.ts";
|
|
2
|
+
interface KingfisherBaselineRecord {
|
|
3
|
+
filepath: string;
|
|
4
|
+
fingerprint: string;
|
|
5
|
+
linenum: number;
|
|
6
|
+
}
|
|
7
|
+
declare const detectKingfisherBaseline: (root: string) => string | undefined;
|
|
8
|
+
declare const detectKingfisherRules: (root: string) => string | undefined;
|
|
9
|
+
declare const parseKingfisherBaseline: (text: string) => KingfisherBaselineRecord[];
|
|
10
|
+
declare const migrateKingfisher: (root: string, options: {
|
|
11
|
+
dryRun: boolean;
|
|
12
|
+
silent?: boolean;
|
|
13
|
+
}, logger: MigrateLogger, report: MigrationReport) => boolean;
|
|
14
|
+
export { detectKingfisherBaseline, detectKingfisherRules, migrateKingfisher, parseKingfisherBaseline };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { MigrationReport } from "./types.d.ts";
|
|
2
|
+
interface MigrateLogger {
|
|
3
|
+
info: (message: string) => void;
|
|
4
|
+
warn: (message: string) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const hasStandaloneNanoStagedConfig: (root: string) => boolean;
|
|
7
|
+
declare const hasUnsupportedNanoStagedConfig: (root: string) => boolean;
|
|
8
|
+
declare const hasStagedConfigInVisConfig: (root: string) => boolean;
|
|
9
|
+
declare const detectNanoStagedConfig: (root: string) => string | undefined;
|
|
10
|
+
declare const extractNanoStagedFromPackageJson: (root: string) => Record<string, string | string[]> | undefined;
|
|
11
|
+
declare const parseNanoStagedJsonFile: (filePath: string) => Record<string, string | string[]> | undefined;
|
|
12
|
+
declare const generateStagedConfigSnippet: (config: Record<string, string | string[]>) => string;
|
|
13
|
+
declare const insertStagedIntoVisConfig: (root: string, config: Record<string, string | string[]>, logger: MigrateLogger) => boolean;
|
|
14
|
+
declare const removeNanoStagedFromPackageJson: (root: string) => {
|
|
15
|
+
configRemoved: boolean;
|
|
16
|
+
dependencyRemoved: boolean;
|
|
17
|
+
};
|
|
18
|
+
declare const removeNanoStagedConfigFiles: (root: string, report: MigrationReport) => void;
|
|
19
|
+
declare const rewritePreCommitHook: (root: string, hooksDirectory: string) => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Migrates nano-staged configuration to the `staged` block in `vis.config.ts`.
|
|
22
|
+
* Mirrors the lint-staged migrator: detects configs from package.json or
|
|
23
|
+
* standalone `.nano-staged.*` files, inlines the mapping, then cleans up
|
|
24
|
+
* the source, dev-dependency entry, and pre-commit hook invocations.
|
|
25
|
+
*/
|
|
26
|
+
declare const migrateNanoStaged: (root: string, options: {
|
|
27
|
+
dryRun: boolean;
|
|
28
|
+
silent?: boolean;
|
|
29
|
+
}, logger: MigrateLogger, report: MigrationReport) => boolean;
|
|
30
|
+
export { detectNanoStagedConfig, extractNanoStagedFromPackageJson, generateStagedConfigSnippet, hasStagedConfigInVisConfig, hasStandaloneNanoStagedConfig, hasUnsupportedNanoStagedConfig, insertStagedIntoVisConfig, migrateNanoStaged, parseNanoStagedJsonFile, removeNanoStagedConfigFiles, removeNanoStagedFromPackageJson, rewritePreCommitHook, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MigrateLogger, MigrationReport } from "./types.d.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Translates an `nx.json` into a `vis.config.ts`. Per-project
|
|
4
|
+
* `project.json` files are left untouched — vis reads them natively.
|
|
5
|
+
* @param workspaceRoot Absolute workspace root path.
|
|
6
|
+
* @param options Migration options.
|
|
7
|
+
* @param logger Logger for user feedback.
|
|
8
|
+
* @param report Migration report to append manual steps and warnings.
|
|
9
|
+
*/
|
|
10
|
+
export declare const migrateNx: (workspaceRoot: string, options: {
|
|
11
|
+
dryRun?: boolean;
|
|
12
|
+
}, logger: MigrateLogger, report: MigrationReport) => void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { MigrateLogger, MigrationReport } from "./types.d.ts";
|
|
2
|
+
declare const detectSecretlintConfig: (root: string) => string | undefined;
|
|
3
|
+
declare const detectSecretlintIgnore: (root: string) => string | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Extract the set of rule / preset IDs from a secretlint config. Only parses
|
|
6
|
+
* JSON-style configs confidently; for .js/.mjs/.cjs we warn and leave the file
|
|
7
|
+
* for the user to inspect.
|
|
8
|
+
*/
|
|
9
|
+
declare const extractRuleIds: (root: string, file: string, report: MigrationReport) => string[];
|
|
10
|
+
declare const migrateSecretlint: (root: string, options: {
|
|
11
|
+
dryRun: boolean;
|
|
12
|
+
silent?: boolean;
|
|
13
|
+
}, logger: MigrateLogger, report: MigrationReport) => boolean;
|
|
14
|
+
export { detectSecretlintConfig, detectSecretlintIgnore, extractRuleIds, migrateSecretlint };
|