@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.
Files changed (120) hide show
  1. package/CHANGELOG.md +403 -12
  2. package/LICENSE.md +283 -0
  3. package/README.md +254 -9
  4. package/dist/bin.js +9 -146
  5. package/dist/config/index.d.ts +1818 -0
  6. package/dist/config/index.js +2 -0
  7. package/dist/generate/index.d.ts +157 -0
  8. package/dist/generate/index.js +3 -0
  9. package/dist/packem_chunks/applyDefaults.js +336 -0
  10. package/dist/packem_chunks/bin.js +9577 -0
  11. package/dist/packem_chunks/doctor-probe.js +112 -0
  12. package/dist/packem_chunks/fix.js +234 -0
  13. package/dist/packem_chunks/handler.js +99 -0
  14. package/dist/packem_chunks/handler10.js +53 -0
  15. package/dist/packem_chunks/handler11.js +32 -0
  16. package/dist/packem_chunks/handler12.js +100 -0
  17. package/dist/packem_chunks/handler13.js +25 -0
  18. package/dist/packem_chunks/handler14.js +916 -0
  19. package/dist/packem_chunks/handler15.js +206 -0
  20. package/dist/packem_chunks/handler16.js +124 -0
  21. package/dist/packem_chunks/handler17.js +13 -0
  22. package/dist/packem_chunks/handler18.js +106 -0
  23. package/dist/packem_chunks/handler19.js +19 -0
  24. package/dist/packem_chunks/handler2.js +75 -0
  25. package/dist/packem_chunks/handler20.js +29 -0
  26. package/dist/packem_chunks/handler21.js +222 -0
  27. package/dist/packem_chunks/handler22.js +237 -0
  28. package/dist/packem_chunks/handler23.js +101 -0
  29. package/dist/packem_chunks/handler24.js +110 -0
  30. package/dist/packem_chunks/handler25.js +402 -0
  31. package/dist/packem_chunks/handler26.js +13 -0
  32. package/dist/packem_chunks/handler27.js +63 -0
  33. package/dist/packem_chunks/handler28.js +34 -0
  34. package/dist/packem_chunks/handler29.js +458 -0
  35. package/dist/packem_chunks/handler3.js +95 -0
  36. package/dist/packem_chunks/handler30.js +170 -0
  37. package/dist/packem_chunks/handler31.js +530 -0
  38. package/dist/packem_chunks/handler32.js +214 -0
  39. package/dist/packem_chunks/handler33.js +119 -0
  40. package/dist/packem_chunks/handler34.js +630 -0
  41. package/dist/packem_chunks/handler35.js +283 -0
  42. package/dist/packem_chunks/handler36.js +542 -0
  43. package/dist/packem_chunks/handler37.js +762 -0
  44. package/dist/packem_chunks/handler38.js +989 -0
  45. package/dist/packem_chunks/handler39.js +574 -0
  46. package/dist/packem_chunks/handler4.js +90 -0
  47. package/dist/packem_chunks/handler40.js +1685 -0
  48. package/dist/packem_chunks/handler41.js +1088 -0
  49. package/dist/packem_chunks/handler42.js +797 -0
  50. package/dist/packem_chunks/handler43.js +2658 -0
  51. package/dist/packem_chunks/handler44.js +3886 -0
  52. package/dist/packem_chunks/handler45.js +2574 -0
  53. package/dist/packem_chunks/handler46.js +3769 -0
  54. package/dist/packem_chunks/handler47.js +1491 -0
  55. package/dist/packem_chunks/handler5.js +174 -0
  56. package/dist/packem_chunks/handler6.js +95 -0
  57. package/dist/packem_chunks/handler7.js +115 -0
  58. package/dist/packem_chunks/handler8.js +12 -0
  59. package/dist/packem_chunks/handler9.js +29 -0
  60. package/dist/packem_chunks/heal-accept.js +522 -0
  61. package/dist/packem_chunks/heal.js +673 -0
  62. package/dist/packem_chunks/index.js +873 -0
  63. package/dist/packem_chunks/loader.js +23 -0
  64. package/dist/packem_shared/VisUpdateApp-D-Yz_wvg.js +1316 -0
  65. package/dist/packem_shared/_commonjsHelpers-BqLXS_qQ.js +5 -0
  66. package/dist/packem_shared/ai-analysis-CHeB1joD.js +367 -0
  67. package/dist/packem_shared/ai-cache-Be_jexe4.js +142 -0
  68. package/dist/packem_shared/ai-fix-B9iQVcD2.js +379 -0
  69. package/dist/packem_shared/cache-directory-2qvs4goY.js +98 -0
  70. package/dist/packem_shared/catalog-BJTtyi-O.js +1371 -0
  71. package/dist/packem_shared/dependency-scan-A0KSklpG.js +188 -0
  72. package/dist/packem_shared/docker-2iZzc280.js +181 -0
  73. package/dist/packem_shared/failure-log-Cz3Z4SKL.js +100 -0
  74. package/dist/packem_shared/flakiness-goTxXuCX.js +180 -0
  75. package/dist/packem_shared/otel-DCvqCTz_.js +158 -0
  76. package/dist/packem_shared/otelPlugin-DFaLDvJf.js +3 -0
  77. package/dist/packem_shared/registry-CbqXI0rc.js +272 -0
  78. package/dist/packem_shared/run-summary-utils-PVMl4aIh.js +130 -0
  79. package/dist/packem_shared/runtime-check-Cobi3p6l.js +127 -0
  80. package/dist/packem_shared/selectors-SM69TfqC.js +194 -0
  81. package/dist/packem_shared/symbols-Ta7g2nU-.js +14 -0
  82. package/dist/packem_shared/toolchain-BdZd9eBi.js +975 -0
  83. package/dist/packem_shared/typosquats-C-bCh3PX.js +1210 -0
  84. package/dist/packem_shared/use-measured-height-CNP0vT4M.js +20 -0
  85. package/dist/packem_shared/utils-CthVdBPS.js +40 -0
  86. package/dist/packem_shared/xxh3-Ck8mXNg1.js +239 -0
  87. package/index.js +773 -0
  88. package/package.json +82 -21
  89. package/schemas/project.schema.json +420 -0
  90. package/schemas/vis-config.schema.json +501 -0
  91. package/skills/vis/SKILL.md +96 -0
  92. package/templates/buildkite-ci/.buildkite/pipeline.yml.tera +85 -0
  93. package/templates/buildkite-ci/template.yml +20 -0
  94. package/dist/ai-analysis.d.ts +0 -40
  95. package/dist/ai-cache.d.ts +0 -21
  96. package/dist/bin.d.ts +0 -1
  97. package/dist/catalog.d.ts +0 -110
  98. package/dist/commands/affected.d.ts +0 -3
  99. package/dist/commands/ai.d.ts +0 -3
  100. package/dist/commands/analyze.d.ts +0 -3
  101. package/dist/commands/check.d.ts +0 -3
  102. package/dist/commands/graph.d.ts +0 -3
  103. package/dist/commands/hook/constants.d.ts +0 -8
  104. package/dist/commands/hook/index.d.ts +0 -3
  105. package/dist/commands/hook/install.d.ts +0 -7
  106. package/dist/commands/hook/migrate.d.ts +0 -27
  107. package/dist/commands/hook/uninstall.d.ts +0 -3
  108. package/dist/commands/migrate/constants.d.ts +0 -12
  109. package/dist/commands/migrate/deps.d.ts +0 -32
  110. package/dist/commands/migrate/index.d.ts +0 -3
  111. package/dist/commands/migrate/json.d.ts +0 -20
  112. package/dist/commands/migrate/lint-staged.d.ts +0 -62
  113. package/dist/commands/migrate/types.d.ts +0 -20
  114. package/dist/commands/run.d.ts +0 -3
  115. package/dist/commands/staged.d.ts +0 -3
  116. package/dist/commands/update.d.ts +0 -3
  117. package/dist/config.d.ts +0 -40
  118. package/dist/config.js +0 -1
  119. package/dist/package-manager.d.ts +0 -23
  120. package/dist/workspace.d.ts +0 -58
@@ -0,0 +1,174 @@
1
+ import { findPackageManagerSync } from '@visulima/package';
2
+ import { render, renderToString, Text } from '@visulima/tui';
3
+ import { c as detectPm, g as printSecurityReport, h as previewPnpmSync, p as pail, i as isInCi, j as scoreColor, a as buildSocketOptions } from './bin.js';
4
+ import React from 'react';
5
+ import { v as validateAnalysisType, r as runAiAnalysis, f as formatAiAnalysis } from '../packem_shared/ai-analysis-CHeB1joD.js';
6
+ import { U as UpdateStore, V as VisUpdateApp, C as CheckProgressApp } from '../packem_shared/VisUpdateApp-D-Yz_wvg.js';
7
+ import { l as loadNpmrc, r as readCatalogs, c as checkOutdated, b as formatSummary, d as formatOutdatedMinimal, h as formatOutdatedTable, t as toFilterArray } from '../packem_shared/catalog-BJTtyi-O.js';
8
+
9
+ const execute = async ({ argument, logger, options, visConfig, workspaceRoot: wsRoot }) => {
10
+ if (!wsRoot) {
11
+ throw new Error("Could not determine workspace root. Run this command inside a monorepo.");
12
+ }
13
+ const workspaceRoot = wsRoot;
14
+ if (options.securityConfig) {
15
+ const pm = detectPm(workspaceRoot);
16
+ printSecurityReport(visConfig ?? {}, pm.name);
17
+ if (options.sync && pm.name === "pnpm") {
18
+ const synced = previewPnpmSync(visConfig ?? {});
19
+ if (synced.length > 0) {
20
+ pail.info("\nSettings that would sync to pnpm-workspace.yaml:");
21
+ for (const s of synced) {
22
+ pail.success(` ${s}`);
23
+ }
24
+ } else {
25
+ pail.info("No security settings to sync.");
26
+ }
27
+ } else if (options.sync && pm.name !== "pnpm") {
28
+ pail.info(`--sync is only available for pnpm projects. Your project uses ${pm.name}.`);
29
+ pail.info("vis enforces security settings at the vis layer for non-pnpm projects.");
30
+ }
31
+ if (!options.security && !argument?.length) {
32
+ return;
33
+ }
34
+ }
35
+ const { packageManager } = findPackageManagerSync(workspaceRoot);
36
+ const npmrcConfig = loadNpmrc(workspaceRoot);
37
+ const configDefaults = visConfig?.update ?? {};
38
+ const catalogs = readCatalogs(workspaceRoot, packageManager, {
39
+ dev: options.dev,
40
+ prod: options.prod
41
+ });
42
+ if (catalogs.size === 0) {
43
+ logger.info("No catalogs found.");
44
+ return;
45
+ }
46
+ const target = options.target ?? configDefaults.target ?? "latest";
47
+ if (!["latest", "minor", "patch"].includes(target)) {
48
+ throw new Error(`Invalid target "${target}". Use: latest, minor, or patch.`);
49
+ }
50
+ const checkOptions = {
51
+ exclude: [...toFilterArray(options.exclude), ...toFilterArray(configDefaults.exclude)],
52
+ ignore: toFilterArray(configDefaults.ignore),
53
+ include: [...toFilterArray(options.include), ...toFilterArray(configDefaults.include), ...argument],
54
+ includeLocked: Boolean(options.includeLocked),
55
+ includePrerelease: options.prerelease || configDefaults.prerelease || false,
56
+ security: !options.noSecurity,
57
+ target
58
+ };
59
+ let totalDeps = 0;
60
+ for (const deps of catalogs.values()) {
61
+ totalDeps += deps.size;
62
+ }
63
+ const isTTY = Boolean(process.stdout.isTTY) && !isInCi;
64
+ let progressInstance;
65
+ const onProgress = isTTY ? (current, total) => {
66
+ if (progressInstance) {
67
+ progressInstance.rerender(React.createElement(CheckProgressApp, { current, total }));
68
+ } else {
69
+ progressInstance = render(React.createElement(CheckProgressApp, { current, total }), {
70
+ interactive: true,
71
+ patchConsole: false
72
+ });
73
+ }
74
+ } : (current, total) => {
75
+ logger.info(`Checking ${String(current)}/${String(total)} dependencies...`);
76
+ };
77
+ if (!isTTY) {
78
+ logger.info(`Checking ${String(totalDeps)} catalog dependencies against npm registry...
79
+ `);
80
+ }
81
+ const socketOptions = buildSocketOptions(visConfig?.security?.socket);
82
+ const { failed, outdated } = await checkOutdated(
83
+ catalogs,
84
+ checkOptions,
85
+ npmrcConfig,
86
+ onProgress,
87
+ workspaceRoot,
88
+ socketOptions,
89
+ visConfig?.security?.socket?.acceptedRisks
90
+ );
91
+ if (progressInstance) {
92
+ progressInstance.clear();
93
+ progressInstance.unmount();
94
+ }
95
+ if (failed.length > 0) {
96
+ logger.warn(`Failed to fetch: ${failed.join(", ")}`);
97
+ }
98
+ if (outdated.length === 0) {
99
+ logger.info("All catalog dependencies are up to date.");
100
+ return;
101
+ }
102
+ const format = options.format ?? configDefaults.format ?? "table";
103
+ const analysisType = validateAnalysisType(options.aiType ?? "impact");
104
+ const aiResult = options.ai ? await runAiAnalysis(outdated, logger, visConfig?.ai, analysisType) : void 0;
105
+ if (isTTY && format === "table") {
106
+ const store = new UpdateStore(outdated, aiResult ?? null);
107
+ const autoExitConfig = visConfig?.tui?.autoExit ?? false;
108
+ const autoExitSeconds = autoExitConfig === true ? 3 : typeof autoExitConfig === "number" ? autoExitConfig : 0;
109
+ const instance = render(
110
+ React.createElement(VisUpdateApp, {
111
+ autoExitSeconds,
112
+ isDryRun: true,
113
+ store
114
+ }),
115
+ {
116
+ alternateScreen: true,
117
+ exitOnCtrlC: false,
118
+ interactive: true,
119
+ patchConsole: true
120
+ }
121
+ );
122
+ await instance.waitUntilExit();
123
+ const columns = process.stdout.columns || 80;
124
+ process.stdout.write("\n");
125
+ for (const entry of outdated) {
126
+ const hasSecurityIssue = entry.vulnerabilities?.length || entry.socketReport && entry.socketReport.alerts.length > 0;
127
+ const isAck = Boolean(entry.acceptedRisk);
128
+ const icon = hasSecurityIssue ? isAck ? "✓" : "⚠" : "✓";
129
+ const iconColor = isAck ? "gray" : entry.updateType === "major" ? "red" : entry.updateType === "minor" ? "yellow" : "green";
130
+ const socketOverall = entry.socketReport?.score.overall;
131
+ const scoreSuffix = socketOverall === void 0 ? "" : ` [${String(Math.round(socketOverall * 100))}%]`;
132
+ const socketColorName = socketOverall === void 0 ? void 0 : scoreColor(socketOverall);
133
+ process.stdout.write(
134
+ `${renderToString(
135
+ React.createElement(
136
+ Text,
137
+ null,
138
+ " ",
139
+ React.createElement(Text, { color: iconColor }, icon),
140
+ ` ${entry.packageName} ${entry.currentRange} → ${entry.newRange}`,
141
+ React.createElement(Text, { dimColor: true }, ` ${entry.updateType}`),
142
+ socketColorName ? React.createElement(Text, { color: socketColorName }, scoreSuffix) : null
143
+ ),
144
+ { columns }
145
+ )}
146
+ `
147
+ );
148
+ }
149
+ process.stdout.write("\n");
150
+ logger.info(formatSummary(outdated));
151
+ } else if (format === "json") {
152
+ const output = { failed, outdated };
153
+ if (aiResult) {
154
+ output.aiAnalysis = aiResult;
155
+ }
156
+ process.stdout.write(`${JSON.stringify(output, void 0, 2)}
157
+ `);
158
+ } else if (format === "minimal") {
159
+ process.stdout.write(`${formatOutdatedMinimal(outdated)}
160
+ `);
161
+ } else {
162
+ formatOutdatedTable(outdated, logger);
163
+ logger.info(formatSummary(outdated));
164
+ if (aiResult) {
165
+ logger.info("");
166
+ logger.info(formatAiAnalysis(aiResult));
167
+ }
168
+ }
169
+ if (options.exitCode && outdated.length > 0) {
170
+ process.exitCode = 1;
171
+ }
172
+ };
173
+
174
+ export { execute as default };
@@ -0,0 +1,95 @@
1
+ import { r as runToolchainPreflight } from '../packem_shared/toolchain-BdZd9eBi.js';
2
+
3
+ const detectCiRefs = () => {
4
+ if (process.env["GITHUB_BASE_REF"]) {
5
+ return {
6
+ base: `origin/${process.env["GITHUB_BASE_REF"]}`,
7
+ head: process.env["GITHUB_SHA"] ?? "HEAD"
8
+ };
9
+ }
10
+ if (process.env["CI_MERGE_REQUEST_TARGET_BRANCH_NAME"]) {
11
+ return {
12
+ base: `origin/${process.env["CI_MERGE_REQUEST_TARGET_BRANCH_NAME"]}`,
13
+ head: process.env["CI_COMMIT_SHA"] ?? "HEAD"
14
+ };
15
+ }
16
+ if (process.env["BUILDKITE_PULL_REQUEST_BASE_BRANCH"]) {
17
+ return {
18
+ base: `origin/${process.env["BUILDKITE_PULL_REQUEST_BASE_BRANCH"]}`,
19
+ head: process.env["BUILDKITE_COMMIT"] ?? "HEAD"
20
+ };
21
+ }
22
+ if (process.env["CIRCLE_BRANCH"] && process.env["CIRCLE_SHA1"]) {
23
+ return {
24
+ base: "origin/main",
25
+ head: process.env["CIRCLE_SHA1"]
26
+ };
27
+ }
28
+ return { base: "origin/main", head: "HEAD" };
29
+ };
30
+ const execute = async ({ argument, logger, options, runtime, visConfig, workspaceRoot: wsRoot }) => {
31
+ const rawTargets = argument[0];
32
+ if (!rawTargets) {
33
+ throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");
34
+ }
35
+ const targets = rawTargets.split(",").map((t) => t.trim()).filter(Boolean);
36
+ if (targets.length === 0) {
37
+ throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");
38
+ }
39
+ if (!wsRoot) {
40
+ throw new Error("Could not determine workspace root. Run this command inside a monorepo.");
41
+ }
42
+ const { base: defaultBase, head: defaultHead } = detectCiRefs();
43
+ const base = options.base ?? defaultBase;
44
+ const head = options.head ?? defaultHead;
45
+ if (!options.skipToolchain) {
46
+ logger.info("▸ Toolchain pre-flight");
47
+ }
48
+ await runToolchainPreflight(
49
+ wsRoot,
50
+ visConfig?.toolchain,
51
+ {
52
+ error: (message) => {
53
+ logger.error(message);
54
+ },
55
+ info: (message) => {
56
+ logger.info(message);
57
+ },
58
+ warn: (message) => {
59
+ logger.warn(message);
60
+ }
61
+ },
62
+ Boolean(options.skipToolchain)
63
+ );
64
+ if (options.install === false) {
65
+ logger.info("▸ Skipping install (--no-install)");
66
+ } else {
67
+ logger.info("▸ Installing dependencies");
68
+ await runtime.runCommand("install", {
69
+ argv: ["--frozen-lockfile"]
70
+ });
71
+ }
72
+ for (const target of targets) {
73
+ logger.info(`▸ Running affected ${target} (base=${base}, head=${head})`);
74
+ const argv = [
75
+ target,
76
+ `--base=${base}`,
77
+ `--head=${head}`,
78
+ `--upstream=${String(options.upstream ?? "none")}`,
79
+ `--downstream=${String(options.downstream ?? "deep")}`
80
+ ];
81
+ if (options.parallel !== void 0) {
82
+ argv.push(`--parallel=${String(options.parallel)}`);
83
+ }
84
+ if (options.partition) {
85
+ argv.push(`--partition=${String(options.partition)}`);
86
+ }
87
+ if (options.query) {
88
+ argv.push(`--query=${String(options.query)}`);
89
+ }
90
+ await runtime.runCommand("affected", { argv });
91
+ }
92
+ logger.info("▸ CI pipeline complete");
93
+ };
94
+
95
+ export { execute as default };
@@ -0,0 +1,115 @@
1
+ import { createRequire as __cjs_createRequire } from "node:module";
2
+
3
+ const __cjs_require = __cjs_createRequire(import.meta.url);
4
+
5
+ const __cjs_getProcess = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;
6
+
7
+ const __cjs_getBuiltinModule = (module) => {
8
+ // Check if we're in Node.js and version supports getBuiltinModule
9
+ if (typeof __cjs_getProcess !== "undefined" && __cjs_getProcess.versions && __cjs_getProcess.versions.node) {
10
+ const [major, minor] = __cjs_getProcess.versions.node.split(".").map(Number);
11
+ // Node.js 20.16.0+ and 22.3.0+
12
+ if (major > 22 || (major === 22 && minor >= 3) || (major === 20 && minor >= 16)) {
13
+ return __cjs_getProcess.getBuiltinModule(module);
14
+ }
15
+ }
16
+ // Fallback to createRequire
17
+ return __cjs_require(module);
18
+ };
19
+
20
+ const {
21
+ readdirSync,
22
+ lstatSync
23
+ } = __cjs_getBuiltinModule("node:fs");
24
+ import { isAccessibleSync } from '@visulima/fs';
25
+ import { join } from '@visulima/path';
26
+ import { cleanWorkspace } from '#native';
27
+ import { p as pail } from './bin.js';
28
+
29
+ const findNodeModulesDirectories = (root) => {
30
+ const results = [];
31
+ const stack = [root];
32
+ while (stack.length > 0) {
33
+ const dir = stack.pop();
34
+ let entries;
35
+ try {
36
+ entries = readdirSync(dir);
37
+ } catch {
38
+ continue;
39
+ }
40
+ for (const entry of entries) {
41
+ const fullPath = join(dir, entry);
42
+ try {
43
+ const stat = lstatSync(fullPath);
44
+ if (stat.isSymbolicLink() || !stat.isDirectory()) {
45
+ continue;
46
+ }
47
+ } catch {
48
+ continue;
49
+ }
50
+ if (entry === "node_modules") {
51
+ results.push(fullPath);
52
+ } else if (entry !== ".git" && entry !== ".hg") {
53
+ stack.push(fullPath);
54
+ }
55
+ }
56
+ }
57
+ return results;
58
+ };
59
+ const LOCKFILE_NAMES = ["pnpm-lock.yaml", "package-lock.json", "npm-shrinkwrap.json", "yarn.lock", "bun.lock", "bun.lockb"];
60
+ const removeLockfiles = (cwd, dryRun, logger) => {
61
+ let removed = 0;
62
+ let hadError = false;
63
+ for (const name of LOCKFILE_NAMES) {
64
+ const lockfile = join(cwd, name);
65
+ if (!isAccessibleSync(lockfile)) {
66
+ continue;
67
+ }
68
+ {
69
+ logger.info(` ${lockfile}`);
70
+ removed++;
71
+ continue;
72
+ }
73
+ }
74
+ return { hadError, removed };
75
+ };
76
+ const execute = async ({ logger, options, workspaceRoot: wsRoot }) => {
77
+ const cwd = wsRoot ?? process.cwd();
78
+ const shouldRemoveLockfile = options.lockfile || false;
79
+ const dryRun = options.dryRun || false;
80
+ if (dryRun) {
81
+ const directories = findNodeModulesDirectories(cwd);
82
+ if (directories.length > 0) {
83
+ pail.info("Would remove:");
84
+ for (const dir of directories) {
85
+ logger.info(` ${dir}`);
86
+ }
87
+ } else {
88
+ pail.info("No node_modules directories found.");
89
+ }
90
+ if (shouldRemoveLockfile) {
91
+ removeLockfiles(cwd, true, logger);
92
+ }
93
+ return;
94
+ }
95
+ const result = cleanWorkspace(cwd, shouldRemoveLockfile);
96
+ for (const dir of result.removed) {
97
+ pail.success(`Removed ${dir}`);
98
+ }
99
+ for (const file of result.lockfilesRemoved) {
100
+ pail.success(`Removed ${file}`);
101
+ }
102
+ for (const error of result.errors) {
103
+ pail.error(error);
104
+ }
105
+ if (result.removed.length === 0 && result.lockfilesRemoved.length === 0) {
106
+ pail.info("No node_modules directories found.");
107
+ } else {
108
+ pail.info(`Cleaned ${result.removed.length} node_modules director${result.removed.length === 1 ? "y" : "ies"}`);
109
+ }
110
+ if (result.errors.length > 0) {
111
+ process.exitCode = 1;
112
+ }
113
+ };
114
+
115
+ export { execute as default };
@@ -0,0 +1,12 @@
1
+ import { r as resolveInstaller, k as runDedupe } from './bin.js';
2
+
3
+ const execute = async ({ logger, options, visConfig, workspaceRoot: wsRoot }) => {
4
+ const cwd = wsRoot ?? process.cwd();
5
+ const pm = resolveInstaller(cwd, { configBackend: visConfig?.install?.backend });
6
+ const code = runDedupe(pm, options.check || false, cwd, logger);
7
+ if (code !== 0) {
8
+ process.exitCode = code;
9
+ }
10
+ };
11
+
12
+ export { execute as default };
@@ -0,0 +1,29 @@
1
+ import { r as resolveInstaller, l as runDlx } from './bin.js';
2
+
3
+ const execute = async ({ argument, logger, options, visConfig, workspaceRoot: wsRoot }) => {
4
+ const args = argument;
5
+ if (!args || args.length === 0) {
6
+ throw new Error("No package specified. Usage: vis dlx <package[@version]> [args...]");
7
+ }
8
+ const [pkg, ...rest] = args;
9
+ const cwd = wsRoot ?? process.cwd();
10
+ const pm = resolveInstaller(cwd, { configBackend: visConfig?.install?.backend });
11
+ const additionalPackages = options.package ? Array.isArray(options.package) ? options.package : [options.package] : [];
12
+ const code = runDlx(
13
+ pm,
14
+ {
15
+ additionalPackages,
16
+ args: rest,
17
+ package: pkg,
18
+ shellMode: options.shellMode || false,
19
+ silent: options.silent || false
20
+ },
21
+ cwd,
22
+ logger
23
+ );
24
+ if (code !== 0) {
25
+ process.exitCode = code;
26
+ }
27
+ };
28
+
29
+ export { execute as default };