@visulima/vis 1.0.0-alpha.1 → 1.0.0-alpha.11
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 +403 -12
- package/LICENSE.md +283 -0
- package/README.md +254 -9
- package/dist/bin.js +9 -146
- package/dist/config/index.d.ts +1818 -0
- package/dist/config/index.js +2 -0
- package/dist/generate/index.d.ts +157 -0
- package/dist/generate/index.js +3 -0
- package/dist/packem_chunks/applyDefaults.js +336 -0
- package/dist/packem_chunks/bin.js +9577 -0
- package/dist/packem_chunks/doctor-probe.js +112 -0
- package/dist/packem_chunks/fix.js +234 -0
- package/dist/packem_chunks/handler.js +99 -0
- package/dist/packem_chunks/handler10.js +53 -0
- package/dist/packem_chunks/handler11.js +32 -0
- package/dist/packem_chunks/handler12.js +100 -0
- package/dist/packem_chunks/handler13.js +25 -0
- package/dist/packem_chunks/handler14.js +916 -0
- package/dist/packem_chunks/handler15.js +206 -0
- package/dist/packem_chunks/handler16.js +124 -0
- package/dist/packem_chunks/handler17.js +13 -0
- package/dist/packem_chunks/handler18.js +106 -0
- package/dist/packem_chunks/handler19.js +19 -0
- package/dist/packem_chunks/handler2.js +75 -0
- package/dist/packem_chunks/handler20.js +29 -0
- package/dist/packem_chunks/handler21.js +222 -0
- package/dist/packem_chunks/handler22.js +237 -0
- package/dist/packem_chunks/handler23.js +101 -0
- package/dist/packem_chunks/handler24.js +110 -0
- package/dist/packem_chunks/handler25.js +402 -0
- package/dist/packem_chunks/handler26.js +13 -0
- package/dist/packem_chunks/handler27.js +63 -0
- package/dist/packem_chunks/handler28.js +34 -0
- package/dist/packem_chunks/handler29.js +458 -0
- package/dist/packem_chunks/handler3.js +95 -0
- package/dist/packem_chunks/handler30.js +170 -0
- package/dist/packem_chunks/handler31.js +530 -0
- package/dist/packem_chunks/handler32.js +214 -0
- package/dist/packem_chunks/handler33.js +119 -0
- package/dist/packem_chunks/handler34.js +630 -0
- package/dist/packem_chunks/handler35.js +283 -0
- package/dist/packem_chunks/handler36.js +542 -0
- package/dist/packem_chunks/handler37.js +762 -0
- package/dist/packem_chunks/handler38.js +989 -0
- package/dist/packem_chunks/handler39.js +574 -0
- package/dist/packem_chunks/handler4.js +90 -0
- package/dist/packem_chunks/handler40.js +1685 -0
- package/dist/packem_chunks/handler41.js +1088 -0
- package/dist/packem_chunks/handler42.js +797 -0
- package/dist/packem_chunks/handler43.js +2658 -0
- package/dist/packem_chunks/handler44.js +3886 -0
- package/dist/packem_chunks/handler45.js +2574 -0
- package/dist/packem_chunks/handler46.js +3769 -0
- package/dist/packem_chunks/handler47.js +1491 -0
- package/dist/packem_chunks/handler5.js +174 -0
- package/dist/packem_chunks/handler6.js +95 -0
- package/dist/packem_chunks/handler7.js +115 -0
- package/dist/packem_chunks/handler8.js +12 -0
- package/dist/packem_chunks/handler9.js +29 -0
- package/dist/packem_chunks/heal-accept.js +522 -0
- package/dist/packem_chunks/heal.js +673 -0
- package/dist/packem_chunks/index.js +873 -0
- package/dist/packem_chunks/loader.js +23 -0
- package/dist/packem_shared/VisUpdateApp-D-Yz_wvg.js +1316 -0
- package/dist/packem_shared/_commonjsHelpers-BqLXS_qQ.js +5 -0
- package/dist/packem_shared/ai-analysis-CHeB1joD.js +367 -0
- package/dist/packem_shared/ai-cache-Be_jexe4.js +142 -0
- package/dist/packem_shared/ai-fix-B9iQVcD2.js +379 -0
- package/dist/packem_shared/cache-directory-2qvs4goY.js +98 -0
- package/dist/packem_shared/catalog-BJTtyi-O.js +1371 -0
- package/dist/packem_shared/dependency-scan-A0KSklpG.js +188 -0
- package/dist/packem_shared/docker-2iZzc280.js +181 -0
- package/dist/packem_shared/failure-log-Cz3Z4SKL.js +100 -0
- package/dist/packem_shared/flakiness-goTxXuCX.js +180 -0
- package/dist/packem_shared/otel-DCvqCTz_.js +158 -0
- package/dist/packem_shared/otelPlugin-DFaLDvJf.js +3 -0
- package/dist/packem_shared/registry-CbqXI0rc.js +272 -0
- package/dist/packem_shared/run-summary-utils-PVMl4aIh.js +130 -0
- package/dist/packem_shared/runtime-check-Cobi3p6l.js +127 -0
- package/dist/packem_shared/selectors-SM69TfqC.js +194 -0
- package/dist/packem_shared/symbols-Ta7g2nU-.js +14 -0
- package/dist/packem_shared/toolchain-BdZd9eBi.js +975 -0
- package/dist/packem_shared/typosquats-C-bCh3PX.js +1210 -0
- package/dist/packem_shared/use-measured-height-CNP0vT4M.js +20 -0
- package/dist/packem_shared/utils-CthVdBPS.js +40 -0
- package/dist/packem_shared/xxh3-Ck8mXNg1.js +239 -0
- package/index.js +773 -0
- package/package.json +82 -21
- package/schemas/project.schema.json +420 -0
- package/schemas/vis-config.schema.json +501 -0
- package/skills/vis/SKILL.md +96 -0
- package/templates/buildkite-ci/.buildkite/pipeline.yml.tera +85 -0
- package/templates/buildkite-ci/template.yml +20 -0
- package/dist/ai-analysis.d.ts +0 -40
- package/dist/ai-cache.d.ts +0 -21
- package/dist/bin.d.ts +0 -1
- package/dist/catalog.d.ts +0 -110
- 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/check.d.ts +0 -3
- 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/migrate/constants.d.ts +0 -12
- package/dist/commands/migrate/deps.d.ts +0 -32
- package/dist/commands/migrate/index.d.ts +0 -3
- package/dist/commands/migrate/json.d.ts +0 -20
- package/dist/commands/migrate/lint-staged.d.ts +0 -62
- package/dist/commands/migrate/types.d.ts +0 -20
- package/dist/commands/run.d.ts +0 -3
- package/dist/commands/staged.d.ts +0 -3
- package/dist/commands/update.d.ts +0 -3
- package/dist/config.d.ts +0 -40
- package/dist/config.js +0 -1
- package/dist/package-manager.d.ts +0 -23
- package/dist/workspace.d.ts +0 -58
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
to: ".buildkite/pipeline.yml"
|
|
3
|
+
---
|
|
4
|
+
# Generated by `vis generate buildkite-ci`.
|
|
5
|
+
# Run `vis ci` against affected packages on every build.{% if withHeal %}
|
|
6
|
+
# Heal block: on failure, `vis ai heal` posts a Buildkite annotation; an
|
|
7
|
+
# allow-listed maintainer manually unblocks the block step to apply +
|
|
8
|
+
# commit the patch via `vis ai heal accept`. The unblocker email
|
|
9
|
+
# (BUILDKITE_UNBLOCKER_EMAIL) must be listed in `ai.heal.allowedActors`
|
|
10
|
+
# in vis.config.ts or the accept step refuses to commit.{% endif %}
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- label: ":hammer: vis ci"
|
|
14
|
+
key: ci
|
|
15
|
+
timeout_in_minutes: 30
|
|
16
|
+
command: |
|
|
17
|
+
{% if packageManager == "pnpm" %} corepack enable
|
|
18
|
+
pnpm install --frozen-lockfile
|
|
19
|
+
pnpm vis ci {{ targets }}
|
|
20
|
+
{% endif %}{% if packageManager == "npm" %} npm ci
|
|
21
|
+
npx vis ci {{ targets }}
|
|
22
|
+
{% endif %}{% if packageManager == "yarn" %} corepack enable
|
|
23
|
+
yarn install --immutable
|
|
24
|
+
yarn vis ci {{ targets }}
|
|
25
|
+
{% endif %}{% if packageManager == "bun" %} bun install --frozen-lockfile
|
|
26
|
+
bunx vis ci {{ targets }}
|
|
27
|
+
{% endif %} agents:
|
|
28
|
+
queue: {{ agentQueue }}
|
|
29
|
+
{% if withHeal %}
|
|
30
|
+
- label: ":sparkles: vis ai heal"
|
|
31
|
+
key: heal-propose
|
|
32
|
+
depends_on: ci
|
|
33
|
+
timeout_in_minutes: 30
|
|
34
|
+
# Only run when CI failed and the build is for a PR — heal-accept
|
|
35
|
+
# has nowhere to commit on push-event builds.
|
|
36
|
+
if: build.failed_jobs > 0 && build.pull_request.id != null
|
|
37
|
+
command: |
|
|
38
|
+
{% if packageManager == "pnpm" %} corepack enable
|
|
39
|
+
pnpm install --frozen-lockfile
|
|
40
|
+
pnpm vis ai heal
|
|
41
|
+
{% endif %}{% if packageManager == "npm" %} npm ci
|
|
42
|
+
npx vis ai heal
|
|
43
|
+
{% endif %}{% if packageManager == "yarn" %} corepack enable
|
|
44
|
+
yarn install --immutable
|
|
45
|
+
yarn vis ai heal
|
|
46
|
+
{% endif %}{% if packageManager == "bun" %} bun install --frozen-lockfile
|
|
47
|
+
bunx vis ai heal
|
|
48
|
+
{% endif %} agents:
|
|
49
|
+
queue: {{ agentQueue }}
|
|
50
|
+
# Buildkite has no commit API of its own — `vis ai heal accept`
|
|
51
|
+
# derives the upstream provider from BUILDKITE_REPO and commits
|
|
52
|
+
# through GitHub or GitLab. Set GITHUB_TOKEN or GITLAB_TOKEN on
|
|
53
|
+
# the agent (matching your remote) so heal accept can land the patch.
|
|
54
|
+
|
|
55
|
+
- block: ":white_check_mark: Apply AI heal patch?"
|
|
56
|
+
key: heal-gate
|
|
57
|
+
depends_on: heal-propose
|
|
58
|
+
if: build.failed_jobs > 0 && build.pull_request.id != null
|
|
59
|
+
prompt: |
|
|
60
|
+
Unblocking applies and commits the patch from the heal annotation.
|
|
61
|
+
The unblocker email (BUILDKITE_UNBLOCKER_EMAIL) must be listed in
|
|
62
|
+
`ai.heal.allowedActors` in vis.config.ts, otherwise the accept
|
|
63
|
+
step will refuse to commit.
|
|
64
|
+
|
|
65
|
+
- label: ":robot_face: vis ai heal accept"
|
|
66
|
+
key: heal-accept
|
|
67
|
+
depends_on: heal-gate
|
|
68
|
+
timeout_in_minutes: 30
|
|
69
|
+
# Defense in depth — heal-accept can't push to a fork and has no
|
|
70
|
+
# commit target on push-event builds. Refuse early.
|
|
71
|
+
if: build.pull_request.id != null
|
|
72
|
+
command: |
|
|
73
|
+
{% if packageManager == "pnpm" %} corepack enable
|
|
74
|
+
pnpm install --frozen-lockfile
|
|
75
|
+
pnpm vis ai heal accept
|
|
76
|
+
{% endif %}{% if packageManager == "npm" %} npm ci
|
|
77
|
+
npx vis ai heal accept
|
|
78
|
+
{% endif %}{% if packageManager == "yarn" %} corepack enable
|
|
79
|
+
yarn install --immutable
|
|
80
|
+
yarn vis ai heal accept
|
|
81
|
+
{% endif %}{% if packageManager == "bun" %} bun install --frozen-lockfile
|
|
82
|
+
bunx vis ai heal accept
|
|
83
|
+
{% endif %} agents:
|
|
84
|
+
queue: {{ agentQueue }}
|
|
85
|
+
{% endif %}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
title: Buildkite CI
|
|
2
|
+
description: A Buildkite pipeline.yml that runs `vis ci` against affected packages, with an optional `vis ai heal` block-step flow.
|
|
3
|
+
variables:
|
|
4
|
+
targets:
|
|
5
|
+
type: string
|
|
6
|
+
default: "lint,test,build"
|
|
7
|
+
prompt: Comma-separated list of `vis ci` targets to run
|
|
8
|
+
packageManager:
|
|
9
|
+
type: enum
|
|
10
|
+
values: [pnpm, npm, yarn, bun]
|
|
11
|
+
default: pnpm
|
|
12
|
+
prompt: Package manager (used in the install line)
|
|
13
|
+
withHeal:
|
|
14
|
+
type: boolean
|
|
15
|
+
default: false
|
|
16
|
+
prompt: Include the `vis ai heal` propose + block-step accept flow?
|
|
17
|
+
agentQueue:
|
|
18
|
+
type: string
|
|
19
|
+
default: default
|
|
20
|
+
prompt: Buildkite agent queue to schedule on
|
package/dist/ai-analysis.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { AiProviderInfo } from "@visulima/find-ai-runner";
|
|
2
|
-
import type { OutdatedEntry } from "./catalog.d.ts";
|
|
3
|
-
interface AiConfig {
|
|
4
|
-
/** Cache TTL in milliseconds. Overrides default (1h / 30min for security). */
|
|
5
|
-
cacheTtl?: number;
|
|
6
|
-
/** Override default provider priority. Higher = preferred. */
|
|
7
|
-
priority?: Record<string, number>;
|
|
8
|
-
/** Use a specific provider, skip auto-detection. */
|
|
9
|
-
provider?: string;
|
|
10
|
-
}
|
|
11
|
-
type AnalysisType = "compatibility" | "impact" | "recommend" | "security";
|
|
12
|
-
declare const DEFAULT_PRIORITY: Record<string, number>;
|
|
13
|
-
/** Resolve which AI provider to use based on config and availability. */
|
|
14
|
-
declare const resolveProvider: (config?: AiConfig) => AiProviderInfo | undefined;
|
|
15
|
-
interface AiRecommendation {
|
|
16
|
-
action: "defer" | "review" | "skip" | "update";
|
|
17
|
-
breakingChanges: string[];
|
|
18
|
-
effort: "high" | "low" | "medium";
|
|
19
|
-
package: string;
|
|
20
|
-
reason: string;
|
|
21
|
-
riskLevel: "critical" | "high" | "low" | "medium";
|
|
22
|
-
}
|
|
23
|
-
interface AiAnalysisResult {
|
|
24
|
-
analysisType: AnalysisType;
|
|
25
|
-
provider: string;
|
|
26
|
-
recommendations: AiRecommendation[];
|
|
27
|
-
summary: string;
|
|
28
|
-
warnings: string[];
|
|
29
|
-
}
|
|
30
|
-
declare const validateAnalysisType: (type: string) => AnalysisType;
|
|
31
|
-
declare const buildAnalysisPrompt: (outdated: OutdatedEntry[], analysisType?: AnalysisType) => string;
|
|
32
|
-
declare const extractJson: (text: string) => unknown | undefined;
|
|
33
|
-
declare const normalizeRecommendation: (raw: Record<string, unknown>) => AiRecommendation;
|
|
34
|
-
declare const parseAiResponse: (text: string, provider: string, analysisType: AnalysisType) => AiAnalysisResult;
|
|
35
|
-
declare const ruleBasedAnalysis: (outdated: OutdatedEntry[], analysisType: AnalysisType) => AiAnalysisResult;
|
|
36
|
-
declare const formatAiAnalysis: (result: AiAnalysisResult) => string;
|
|
37
|
-
declare const formatAiAnalysisJson: (result: AiAnalysisResult) => string;
|
|
38
|
-
declare const runAiAnalysis: (outdated: OutdatedEntry[], logger: Console, config?: AiConfig, analysisType?: AnalysisType) => Promise<AiAnalysisResult>;
|
|
39
|
-
export type { AiAnalysisResult, AiConfig, AiRecommendation, AnalysisType };
|
|
40
|
-
export { buildAnalysisPrompt, DEFAULT_PRIORITY, extractJson, formatAiAnalysis, formatAiAnalysisJson, normalizeRecommendation, parseAiResponse, resolveProvider, ruleBasedAnalysis, runAiAnalysis, validateAnalysisType, };
|
package/dist/ai-cache.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { AiAnalysisResult, AnalysisType } from "./ai-analysis.d.ts";
|
|
2
|
-
import type { OutdatedEntry } from "./catalog.d.ts";
|
|
3
|
-
interface CacheEntry {
|
|
4
|
-
createdAt: number;
|
|
5
|
-
result: AiAnalysisResult;
|
|
6
|
-
ttlMs: number;
|
|
7
|
-
}
|
|
8
|
-
interface CacheStats {
|
|
9
|
-
entries: number;
|
|
10
|
-
newestEntry: number | undefined;
|
|
11
|
-
oldestEntry: number | undefined;
|
|
12
|
-
totalSizeBytes: number;
|
|
13
|
-
}
|
|
14
|
-
declare const buildCacheKey: (provider: string, analysisType: string, outdated: Pick<OutdatedEntry, "currentRange" | "packageName" | "targetVersion">[]) => string;
|
|
15
|
-
declare const getCachedAnalysis: (cacheKey: string) => AiAnalysisResult | undefined;
|
|
16
|
-
declare const setCachedAnalysis: (cacheKey: string, result: AiAnalysisResult, ttlMs: number) => void;
|
|
17
|
-
declare const getTtlForAnalysisType: (analysisType: AnalysisType | string, configTtl?: number) => number;
|
|
18
|
-
declare const getCacheStats: () => CacheStats;
|
|
19
|
-
declare const clearCache: () => number;
|
|
20
|
-
export type { CacheEntry, CacheStats };
|
|
21
|
-
export { buildCacheKey, clearCache, getCachedAnalysis, getCacheStats, getTtlForAnalysisType, setCachedAnalysis };
|
package/dist/bin.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/catalog.d.ts
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
type UpdateTarget = "latest" | "minor" | "patch";
|
|
2
|
-
interface ParsedVersion {
|
|
3
|
-
major: number;
|
|
4
|
-
minor: number;
|
|
5
|
-
patch: number;
|
|
6
|
-
prerelease: string;
|
|
7
|
-
}
|
|
8
|
-
interface SecurityVulnerability {
|
|
9
|
-
cvssScore?: number;
|
|
10
|
-
fixedVersions: string[];
|
|
11
|
-
id: string;
|
|
12
|
-
severity: "CRITICAL" | "HIGH" | "LOW" | "MODERATE" | "UNKNOWN";
|
|
13
|
-
summary: string;
|
|
14
|
-
}
|
|
15
|
-
interface OutdatedEntry {
|
|
16
|
-
catalogName: string;
|
|
17
|
-
currentRange: string;
|
|
18
|
-
newRange: string;
|
|
19
|
-
packageName: string;
|
|
20
|
-
targetVersion: string;
|
|
21
|
-
updateType: "major" | "minor" | "patch";
|
|
22
|
-
vulnerabilities?: SecurityVulnerability[];
|
|
23
|
-
}
|
|
24
|
-
interface CatalogCheckOptions {
|
|
25
|
-
exclude: string[];
|
|
26
|
-
include: string[];
|
|
27
|
-
includePrerelease: boolean;
|
|
28
|
-
security?: boolean;
|
|
29
|
-
target: UpdateTarget;
|
|
30
|
-
}
|
|
31
|
-
interface ReadCatalogOptions {
|
|
32
|
-
dev?: boolean;
|
|
33
|
-
prod?: boolean;
|
|
34
|
-
}
|
|
35
|
-
declare const parseVersion: (input: string) => ParsedVersion | undefined;
|
|
36
|
-
declare const extractPrefix: (range: string) => string;
|
|
37
|
-
declare const getUpdateType: (current: ParsedVersion, target: ParsedVersion) => "major" | "minor" | "none" | "patch";
|
|
38
|
-
declare const isNewer: (current: ParsedVersion, target: ParsedVersion) => boolean;
|
|
39
|
-
declare const matchesPattern: (name: string, pattern: string) => boolean;
|
|
40
|
-
declare const matchesFilters: (name: string, include: string[], exclude: string[]) => boolean;
|
|
41
|
-
declare const parseCatalogsFromYaml: (content: string) => Map<string, Map<string, string>>;
|
|
42
|
-
interface BunPackageJson {
|
|
43
|
-
workspaces?: {
|
|
44
|
-
catalog?: Record<string, string>;
|
|
45
|
-
catalogs?: Record<string, Record<string, string>>;
|
|
46
|
-
packages?: string[];
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
declare const parseBunCatalogs: (pkg: BunPackageJson) => Map<string, Map<string, string>>;
|
|
50
|
-
declare const parseCompositeCatalogName: (name: string) => {
|
|
51
|
-
depType: string;
|
|
52
|
-
relativePath: string;
|
|
53
|
-
} | undefined;
|
|
54
|
-
declare const readPackageJsonDeps: (workspaceRoot: string, options?: ReadCatalogOptions) => Map<string, Map<string, string>>;
|
|
55
|
-
declare const hasPackageJsonDeps: (workspaceRoot: string) => boolean;
|
|
56
|
-
declare const applyPackageJsonUpdates: (workspaceRoot: string, updates: OutdatedEntry[]) => void;
|
|
57
|
-
type CatalogProvider = "bun" | "pnpm";
|
|
58
|
-
declare const hasCatalogs: (workspaceRoot: string, packageManager?: string) => boolean;
|
|
59
|
-
declare const readCatalogs: (workspaceRoot: string, packageManager?: string, options?: ReadCatalogOptions) => Map<string, Map<string, string>>;
|
|
60
|
-
interface NpmrcConfig {
|
|
61
|
-
authTokens: Map<string, string>;
|
|
62
|
-
defaultRegistry: string;
|
|
63
|
-
registries: Map<string, string>;
|
|
64
|
-
}
|
|
65
|
-
declare const parseNpmrc: (content: string) => NpmrcConfig;
|
|
66
|
-
declare const loadNpmrc: (workspaceRoot: string) => NpmrcConfig;
|
|
67
|
-
declare const getRegistryForPackage: (packageName: string, config: NpmrcConfig) => {
|
|
68
|
-
token?: string;
|
|
69
|
-
url: string;
|
|
70
|
-
};
|
|
71
|
-
interface RegistryVersionInfo {
|
|
72
|
-
latest: string;
|
|
73
|
-
versions: string[];
|
|
74
|
-
}
|
|
75
|
-
declare const fetchPackageVersions: (packageName: string, registryConfig?: {
|
|
76
|
-
authToken?: string;
|
|
77
|
-
url: string;
|
|
78
|
-
}, timeoutMs?: number) => Promise<RegistryVersionInfo>;
|
|
79
|
-
declare const fetchVulnerabilities: (packages: {
|
|
80
|
-
name: string;
|
|
81
|
-
version: string;
|
|
82
|
-
}[], timeoutMs?: number) => Promise<Map<string, SecurityVulnerability[]>>;
|
|
83
|
-
declare const findTargetVersion: (versions: string[], latest: string, currentRange: string, target: UpdateTarget, includePrerelease: boolean) => string | undefined;
|
|
84
|
-
interface CheckOutdatedResult {
|
|
85
|
-
failed: string[];
|
|
86
|
-
outdated: OutdatedEntry[];
|
|
87
|
-
}
|
|
88
|
-
declare const checkOutdated: (catalogs: Map<string, Map<string, string>>, options: CatalogCheckOptions, npmrcConfig?: NpmrcConfig, onProgress?: (current: number, total: number) => void) => Promise<CheckOutdatedResult>;
|
|
89
|
-
declare const createBackup: (workspaceRoot: string, packageManager?: string, updates?: OutdatedEntry[]) => string | undefined;
|
|
90
|
-
declare const restoreFromBackup: (workspaceRoot: string, packageManager?: string) => boolean;
|
|
91
|
-
declare const hasBackup: (workspaceRoot: string, packageManager?: string) => boolean;
|
|
92
|
-
type OutputFormat = "json" | "minimal" | "table";
|
|
93
|
-
declare const formatOutdatedJson: (result: CheckOutdatedResult) => string;
|
|
94
|
-
declare const formatOutdatedMinimal: (outdated: OutdatedEntry[]) => string;
|
|
95
|
-
declare const toFilterArray: (value: string | string[] | undefined) => string[];
|
|
96
|
-
declare const groupByCatalog: (entries: OutdatedEntry[]) => Map<string, OutdatedEntry[]>;
|
|
97
|
-
declare const formatOutdatedTable: (outdated: OutdatedEntry[], logger: Console) => void;
|
|
98
|
-
declare const formatSummary: (outdated: OutdatedEntry[]) => string;
|
|
99
|
-
declare const detectJsonIndent: (content: string) => number | string;
|
|
100
|
-
declare const applyCatalogUpdates: (workspaceRoot: string, updates: OutdatedEntry[], packageManager?: string, backup?: boolean) => string | undefined;
|
|
101
|
-
declare const promptPackageSelection: (outdated: OutdatedEntry[]) => Promise<OutdatedEntry[]>;
|
|
102
|
-
interface ChangelogInfo {
|
|
103
|
-
npmUrl: string;
|
|
104
|
-
packageName: string;
|
|
105
|
-
releaseUrl?: string;
|
|
106
|
-
repoUrl?: string;
|
|
107
|
-
}
|
|
108
|
-
declare const fetchChangelogInfo: (packages: OutdatedEntry[], timeoutMs?: number) => Promise<ChangelogInfo[]>;
|
|
109
|
-
export type { CatalogCheckOptions, CatalogProvider, ChangelogInfo, CheckOutdatedResult, NpmrcConfig, OutdatedEntry, OutputFormat, ParsedVersion, ReadCatalogOptions, SecurityVulnerability, UpdateTarget, };
|
|
110
|
-
export { applyCatalogUpdates, applyPackageJsonUpdates, checkOutdated, createBackup, detectJsonIndent, extractPrefix, fetchChangelogInfo, fetchPackageVersions, fetchVulnerabilities, findTargetVersion, formatOutdatedJson, formatOutdatedMinimal, formatOutdatedTable, formatSummary, getRegistryForPackage, getUpdateType, groupByCatalog, hasBackup, hasCatalogs, hasPackageJsonDeps, isNewer, loadNpmrc, matchesFilters, matchesPattern, parseBunCatalogs, parseCatalogsFromYaml, parseCompositeCatalogName, parseNpmrc, parseVersion, promptPackageSelection, readCatalogs, readPackageJsonDeps, restoreFromBackup, toFilterArray, };
|
package/dist/commands/ai.d.ts
DELETED
package/dist/commands/check.d.ts
DELETED
package/dist/commands/graph.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
declare const HOOKS: readonly ["pre-commit", "pre-merge-commit", "prepare-commit-msg", "commit-msg", "post-commit", "applypatch-msg", "pre-applypatch", "post-applypatch", "pre-rebase", "post-rewrite", "post-checkout", "post-merge", "pre-push", "pre-auto-gc"];
|
|
2
|
-
declare const DEFAULT_HOOKS_DIRECTORY = ".vis-hooks";
|
|
3
|
-
interface InstallResult {
|
|
4
|
-
isError: boolean;
|
|
5
|
-
message: string;
|
|
6
|
-
}
|
|
7
|
-
export type { InstallResult };
|
|
8
|
-
export { DEFAULT_HOOKS_DIRECTORY, HOOKS };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { InstallResult } from "./constants.d.ts";
|
|
2
|
-
/**
|
|
3
|
-
* Generates the shell script that dispatches to user-defined hooks.
|
|
4
|
-
*/
|
|
5
|
-
declare const hookScript: (directory: string) => string;
|
|
6
|
-
declare const installHooks: (directory?: string) => InstallResult;
|
|
7
|
-
export { hookScript, installHooks };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { PackageManagerType } from "../migrate/types.d.ts";
|
|
2
|
-
import type { InstallResult } from "./constants.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Detects which husky directory is in use, if any.
|
|
5
|
-
*/
|
|
6
|
-
declare const detectHuskyDirectory: (root: string) => string | undefined;
|
|
7
|
-
/**
|
|
8
|
-
* Transforms a husky hook script for vis.
|
|
9
|
-
* Removes the common.sh sourcing line since vis handles PATH setup in its dispatcher.
|
|
10
|
-
*/
|
|
11
|
-
declare const transformHookScript: (content: string) => string;
|
|
12
|
-
/**
|
|
13
|
-
* Detects the package manager used in the project.
|
|
14
|
-
*/
|
|
15
|
-
declare const detectPackageManager: (root: string) => PackageManagerType;
|
|
16
|
-
/**
|
|
17
|
-
* Cleans husky references from package.json scripts.
|
|
18
|
-
*/
|
|
19
|
-
declare const cleanPackageJsonScripts: (root: string) => {
|
|
20
|
-
modified: boolean;
|
|
21
|
-
removedScriptReferences: string[];
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Migrates from husky to vis hooks.
|
|
25
|
-
*/
|
|
26
|
-
declare const migrateFromHusky: (root: string, hooksDirectory: string, logger: Console) => InstallResult;
|
|
27
|
-
export { cleanPackageJsonScripts, detectHuskyDirectory, detectPackageManager, migrateFromHusky, transformHookScript };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare const LINT_STAGED_JSON_CONFIG_FILES: readonly [".lintstagedrc.json", ".lintstagedrc"];
|
|
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
|
-
declare const LINT_STAGED_ALL_CONFIG_FILES: ReadonlyArray<string>;
|
|
4
|
-
declare const STALE_LINT_STAGED_PATTERNS: ReadonlyArray<RegExp>;
|
|
5
|
-
declare const REPLACED_PACKAGES: readonly ["husky", "lint-staged"];
|
|
6
|
-
declare const HUSKY_SCRIPT_PATTERNS: ReadonlyArray<RegExp>;
|
|
7
|
-
/**
|
|
8
|
-
* Remove husky references from a single script value.
|
|
9
|
-
* Returns the cleaned script, or undefined if the entire script should be removed.
|
|
10
|
-
*/
|
|
11
|
-
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, };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { VisConfig } from "../../workspace.d.ts";
|
|
2
|
-
import type { MigrationReport, PackageManagerType } from "./types.d.ts";
|
|
3
|
-
interface MigrateLogger {
|
|
4
|
-
info: (message: string) => void;
|
|
5
|
-
warn: (message: string) => void;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Rewrite scripts in package.json to replace husky/lint-staged references.
|
|
9
|
-
*/
|
|
10
|
-
declare const rewriteScripts: (scripts: Record<string, string>, report: MigrationReport) => {
|
|
11
|
-
modified: boolean;
|
|
12
|
-
scripts: Record<string, string>;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Rewrite a single package.json: remove replaced packages, add overrides, rewrite scripts.
|
|
16
|
-
*/
|
|
17
|
-
declare const rewritePackageJson: (root: string, packageManager: PackageManagerType, overrides: Record<string, string>, report: MigrationReport) => void;
|
|
18
|
-
/**
|
|
19
|
-
* Iterate over all workspace packages and rewrite their package.json files.
|
|
20
|
-
*/
|
|
21
|
-
declare const migrateMonorepoPackages: (root: string, packageManager: PackageManagerType, overrides: Record<string, string>, report: MigrationReport) => void;
|
|
22
|
-
/**
|
|
23
|
-
* Update pnpm-workspace.yaml catalog with override entries.
|
|
24
|
-
*/
|
|
25
|
-
declare const updatePnpmWorkspaceCatalog: (root: string, overrides: Record<string, string>) => void;
|
|
26
|
-
/**
|
|
27
|
-
* Top-level orchestrator for dependency migration.
|
|
28
|
-
*/
|
|
29
|
-
declare const migrateDeps: (root: string, packageManager: PackageManagerType, visConfig: VisConfig, options: {
|
|
30
|
-
dryRun: boolean;
|
|
31
|
-
}, logger: MigrateLogger, report: MigrationReport) => void;
|
|
32
|
-
export { migrateDeps, migrateMonorepoPackages, rewritePackageJson, rewriteScripts, updatePnpmWorkspaceCatalog };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reads and parses a JSON file. Returns undefined if the file doesn't exist or isn't valid JSON.
|
|
3
|
-
*/
|
|
4
|
-
declare const readJsonFile: <T>(filePath: string) => T | undefined;
|
|
5
|
-
/**
|
|
6
|
-
* Checks if a file exists and contains valid JSON.
|
|
7
|
-
*/
|
|
8
|
-
declare const isJsonFile: (filePath: string) => boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Detect the indentation used in a JSON file by looking at the first indented line.
|
|
11
|
-
*/
|
|
12
|
-
declare const detectJsonIndent: (content: string) => number;
|
|
13
|
-
/**
|
|
14
|
-
* Edits a JSON file in place using a mutator function.
|
|
15
|
-
* The mutator receives the parsed data and should return the modified data,
|
|
16
|
-
* or undefined to skip writing. Returns true if the file was modified.
|
|
17
|
-
* Preserves the original indentation style.
|
|
18
|
-
*/
|
|
19
|
-
declare const editJsonFile: <T>(filePath: string, mutator: (data: T) => T | undefined) => boolean;
|
|
20
|
-
export { detectJsonIndent, editJsonFile, isJsonFile, readJsonFile };
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { MigrationReport } from "./types.d.ts";
|
|
2
|
-
interface MigrateLogger {
|
|
3
|
-
info: (message: string) => void;
|
|
4
|
-
warn: (message: string) => void;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Check if a standalone lint-staged config file exists.
|
|
8
|
-
*/
|
|
9
|
-
declare const hasStandaloneLintStagedConfig: (root: string) => boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Check if a standalone lint-staged config exists in a format that can't be
|
|
12
|
-
* auto-migrated (non-JSON files like .yaml, .mjs, .cjs, .js, or a non-JSON .lintstagedrc).
|
|
13
|
-
*/
|
|
14
|
-
declare const hasUnsupportedLintStagedConfig: (root: string) => boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Check if vis.config.ts already has a `staged` config key.
|
|
17
|
-
*/
|
|
18
|
-
declare const hasStagedConfigInVisConfig: (root: string) => boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Detect lint-staged config: returns the source ("package.json", a filename, or undefined).
|
|
21
|
-
*/
|
|
22
|
-
declare const detectLintStagedConfig: (root: string) => string | undefined;
|
|
23
|
-
/**
|
|
24
|
-
* Extract lint-staged config from package.json.
|
|
25
|
-
*/
|
|
26
|
-
declare const extractLintStagedFromPackageJson: (root: string) => Record<string, string | string[]> | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* Parse a JSON lint-staged config file.
|
|
29
|
-
*/
|
|
30
|
-
declare const parseLintStagedJsonFile: (filePath: string) => Record<string, string | string[]> | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* Generate a TypeScript snippet for the staged block.
|
|
33
|
-
*/
|
|
34
|
-
declare const generateStagedConfigSnippet: (config: Record<string, string | string[]>) => string;
|
|
35
|
-
/**
|
|
36
|
-
* Insert staged config into vis.config.ts. Creates the file if it doesn't exist.
|
|
37
|
-
*/
|
|
38
|
-
declare const insertStagedIntoVisConfig: (root: string, config: Record<string, string | string[]>, logger: MigrateLogger) => boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Remove `lint-staged` key, config, and dependency from package.json in a single read/write.
|
|
41
|
-
* Returns which removals were performed.
|
|
42
|
-
*/
|
|
43
|
-
declare const removeLintStagedFromPackageJson: (root: string) => {
|
|
44
|
-
configRemoved: boolean;
|
|
45
|
-
dependencyRemoved: boolean;
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Remove standalone lint-staged config files.
|
|
49
|
-
*/
|
|
50
|
-
declare const removeLintStagedConfigFiles: (root: string, report: MigrationReport) => void;
|
|
51
|
-
/**
|
|
52
|
-
* Rewrite pre-commit hook to replace lint-staged invocations with `vis staged`.
|
|
53
|
-
*/
|
|
54
|
-
declare const rewritePreCommitHook: (root: string, hooksDirectory: string) => boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Migrates lint-staged configuration to vis.config.ts staged block.
|
|
57
|
-
*/
|
|
58
|
-
declare const migrateLintStaged: (root: string, options: {
|
|
59
|
-
dryRun: boolean;
|
|
60
|
-
silent?: boolean;
|
|
61
|
-
}, logger: MigrateLogger, report: MigrationReport) => boolean;
|
|
62
|
-
export { detectLintStagedConfig, extractLintStagedFromPackageJson, generateStagedConfigSnippet, hasStagedConfigInVisConfig, hasStandaloneLintStagedConfig, hasUnsupportedLintStagedConfig, insertStagedIntoVisConfig, migrateLintStaged, parseLintStagedJsonFile, removeLintStagedConfigFiles, removeLintStagedFromPackageJson, rewritePreCommitHook, };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
interface MigrateLogger {
|
|
2
|
-
info: (message: string) => void;
|
|
3
|
-
warn: (message: string) => void;
|
|
4
|
-
}
|
|
5
|
-
interface MigrationReport {
|
|
6
|
-
gitHooksConfigured: boolean;
|
|
7
|
-
inlinedLintStagedConfigCount: number;
|
|
8
|
-
manualSteps: string[];
|
|
9
|
-
mergedStagedConfigCount: number;
|
|
10
|
-
removedConfigCount: number;
|
|
11
|
-
removedPackageCount: number;
|
|
12
|
-
rewrittenScriptCount: number;
|
|
13
|
-
warnings: string[];
|
|
14
|
-
}
|
|
15
|
-
declare const createMigrationReport: () => MigrationReport;
|
|
16
|
-
declare const addMigrationWarning: (report: MigrationReport | undefined, warning: string) => void;
|
|
17
|
-
declare const addManualStep: (report: MigrationReport | undefined, step: string) => void;
|
|
18
|
-
type PackageManagerType = "bun" | "npm" | "pnpm" | "yarn";
|
|
19
|
-
export type { MigrateLogger, MigrationReport, PackageManagerType };
|
|
20
|
-
export { addManualStep, addMigrationWarning, createMigrationReport };
|
package/dist/commands/run.d.ts
DELETED
package/dist/config.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { VisConfig } from "./workspace.d.ts";
|
|
2
|
-
/** Supported config file names, checked in order. */
|
|
3
|
-
declare const CONFIG_FILES: string[];
|
|
4
|
-
/**
|
|
5
|
-
* Find the vis config file in a directory.
|
|
6
|
-
* @param directory The directory to search in.
|
|
7
|
-
* @returns The absolute path to the config file, or `undefined` if not found.
|
|
8
|
-
*/
|
|
9
|
-
declare const findVisConfigFile: (directory: string) => string | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* Load the vis configuration from a `vis.config.ts` (or `.js`, `.mjs`, `.cjs`, `.mts`, `.cts`) file.
|
|
12
|
-
*
|
|
13
|
-
* Uses jiti for runtime TypeScript support — no build step needed for config files.
|
|
14
|
-
* Falls back to an empty config if no config file is found.
|
|
15
|
-
* @param workspaceRoot The workspace root directory to search for the config file.
|
|
16
|
-
* @returns The loaded and resolved configuration.
|
|
17
|
-
*/
|
|
18
|
-
declare const loadVisConfig: (workspaceRoot: string) => Promise<VisConfig>;
|
|
19
|
-
/**
|
|
20
|
-
* Type-safe helper for defining vis configuration.
|
|
21
|
-
* Provides full TypeScript autocomplete when used in `vis.config.ts`.
|
|
22
|
-
* @example
|
|
23
|
-
* ```typescript
|
|
24
|
-
* // vis.config.ts
|
|
25
|
-
* import { defineConfig } from "@visulima/vis/config";
|
|
26
|
-
*
|
|
27
|
-
* export default defineConfig({
|
|
28
|
-
* update: {
|
|
29
|
-
* target: "minor",
|
|
30
|
-
* exclude: ["@types/*"],
|
|
31
|
-
* security: true,
|
|
32
|
-
* },
|
|
33
|
-
* ai: {
|
|
34
|
-
* provider: "claude",
|
|
35
|
-
* },
|
|
36
|
-
* });
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
declare const defineConfig: (config: VisConfig) => VisConfig;
|
|
40
|
-
export { CONFIG_FILES, defineConfig, findVisConfigFile, loadVisConfig };
|
package/dist/config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r=Object.defineProperty;var n=(e,i)=>r(e,"name",{value:i,configurable:!0});import{createRequire as f}from"node:module";import{join as g}from"@visulima/path";import{createJiti as d}from"jiti";const c=f(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,a=n(e=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[i,o]=s.versions.node.split(".").map(Number);if(i>22||i===22&&o>=3||i===20&&o>=16)return s.getBuiltinModule(e)}return c(e)},"__cjs_getBuiltinModule"),{existsSync:u}=a("node:fs");var l=Object.defineProperty,t=n((e,i)=>l(e,"name",{value:i,configurable:!0}),"o");const m=["vis.config.ts","vis.config.mts","vis.config.cts","vis.config.js","vis.config.mjs","vis.config.cjs"],p=t(e=>{for(const i of m){const o=g(e,i);if(u(o))return o}},"findVisConfigFile"),C=t(async e=>{const i=p(e);if(!i)return{};const o=await d(e).import(i,{default:!0,try:!0})??{};return typeof o=="function"?await o():o},"loadVisConfig"),b=t(e=>e,"defineConfig");export{m as CONFIG_FILES,b as defineConfig,p as findVisConfigFile,C as loadVisConfig};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
interface UpdateCommandOptions {
|
|
2
|
-
dev: boolean;
|
|
3
|
-
filters: string[];
|
|
4
|
-
global: boolean;
|
|
5
|
-
interactive: boolean;
|
|
6
|
-
latest: boolean;
|
|
7
|
-
noOptional: boolean;
|
|
8
|
-
noSave: boolean;
|
|
9
|
-
packages: string[];
|
|
10
|
-
prod: boolean;
|
|
11
|
-
recursive: boolean;
|
|
12
|
-
workspaceRoot: boolean;
|
|
13
|
-
}
|
|
14
|
-
interface ResolvedCommand {
|
|
15
|
-
args: string[];
|
|
16
|
-
bin: string;
|
|
17
|
-
}
|
|
18
|
-
declare const resolveUpdateCommand: (packageManager: "bun" | "npm" | "pnpm" | "yarn", version: string, options: UpdateCommandOptions) => {
|
|
19
|
-
command: ResolvedCommand;
|
|
20
|
-
warnings: string[];
|
|
21
|
-
};
|
|
22
|
-
export type { ResolvedCommand, UpdateCommandOptions };
|
|
23
|
-
export { resolveUpdateCommand };
|