@visulima/vis 1.0.0-alpha.7 → 1.0.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. package/CHANGELOG.md +107 -47
  2. package/LICENSE.md +44 -1
  3. package/README.md +56 -0
  4. package/dist/bin.js +1 -991
  5. package/dist/config.d.ts +1073 -68
  6. package/dist/config.js +1 -1
  7. package/dist/generate/index.d.ts +155 -30
  8. package/dist/packem_chunks/handler.js +1 -0
  9. package/dist/packem_chunks/handler10.js +1 -0
  10. package/dist/packem_chunks/handler11.js +1 -0
  11. package/dist/packem_chunks/handler12.js +153 -0
  12. package/dist/packem_chunks/handler13.js +1 -0
  13. package/dist/packem_chunks/handler14.js +3 -0
  14. package/dist/packem_chunks/handler15.js +1 -0
  15. package/dist/packem_chunks/handler16.js +2 -0
  16. package/dist/packem_chunks/handler17.js +7 -0
  17. package/dist/packem_chunks/handler18.js +1 -0
  18. package/dist/packem_chunks/handler19.js +19 -0
  19. package/dist/packem_chunks/handler2.js +1 -0
  20. package/dist/packem_chunks/handler20.js +428 -0
  21. package/dist/packem_chunks/handler21.js +22 -0
  22. package/dist/packem_chunks/handler22.js +3 -0
  23. package/dist/packem_chunks/handler23.js +5 -0
  24. package/dist/packem_chunks/handler24.js +1 -0
  25. package/dist/packem_chunks/handler25.js +20 -0
  26. package/dist/packem_chunks/handler26.js +1 -0
  27. package/dist/packem_chunks/handler27.js +1 -0
  28. package/dist/packem_chunks/handler28.js +1 -0
  29. package/dist/packem_chunks/handler29.js +2 -0
  30. package/dist/packem_chunks/handler3.js +2 -0
  31. package/dist/packem_chunks/handler30.js +22 -0
  32. package/dist/packem_chunks/handler31.js +1 -0
  33. package/dist/packem_chunks/handler32.js +1 -0
  34. package/dist/packem_chunks/handler33.js +37 -0
  35. package/dist/packem_chunks/handler34.js +3 -0
  36. package/dist/packem_chunks/handler35.js +23 -0
  37. package/dist/packem_chunks/handler36.js +5 -0
  38. package/dist/packem_chunks/handler37.js +27 -0
  39. package/dist/packem_chunks/handler38.js +1 -0
  40. package/dist/packem_chunks/handler39.js +2 -0
  41. package/dist/packem_chunks/handler4.js +5 -0
  42. package/dist/packem_chunks/handler40.js +1 -0
  43. package/dist/packem_chunks/handler41.js +5 -0
  44. package/dist/packem_chunks/handler42.js +1 -0
  45. package/dist/packem_chunks/handler43.js +24 -0
  46. package/dist/packem_chunks/handler44.js +3 -0
  47. package/dist/packem_chunks/handler45.js +1 -0
  48. package/dist/packem_chunks/handler5.js +4 -0
  49. package/dist/packem_chunks/handler6.js +2 -0
  50. package/dist/packem_chunks/handler7.js +24 -0
  51. package/dist/packem_chunks/handler8.js +6 -0
  52. package/dist/packem_chunks/handler9.js +8 -0
  53. package/dist/packem_shared/VisUpdateApp-BBx3idMI.js +1 -0
  54. package/dist/packem_shared/ai-analysis-DDqXRFxY.js +67 -0
  55. package/dist/packem_shared/bin-BaZZ32BK.js +93 -0
  56. package/dist/packem_shared/cache-directory-DL8hfXeG.js +1 -0
  57. package/dist/packem_shared/catalog-CuSpuB_R.js +12 -0
  58. package/dist/packem_shared/dependency-scan-BoLG2Fez.js +1 -0
  59. package/dist/packem_shared/docker-BcfqH4Av.js +2 -0
  60. package/dist/packem_shared/flakiness-DSIHZGBT.js +1 -0
  61. package/dist/packem_shared/otelPlugin-DxyvBcXO.js +1 -0
  62. package/dist/packem_shared/runtime-check-CGHal8SO.js +1 -0
  63. package/dist/packem_shared/selectors-CfH9ZY08.js +3 -0
  64. package/dist/packem_shared/symbols-CIMw60-G.js +1 -0
  65. package/dist/packem_shared/toolchain-C3ZG0o_X.js +5 -0
  66. package/dist/packem_shared/typosquats-Bpq4zcWL.js +1 -0
  67. package/dist/packem_shared/utils-DrNg0XTR.js +1 -0
  68. package/index.js +555 -727
  69. package/package.json +29 -19
  70. package/schemas/project.schema.json +1 -1
  71. package/schemas/vis-config.schema.json +47 -1
  72. package/dist/ai-analysis.d.ts +0 -26
  73. package/dist/ai-cache.d.ts +0 -21
  74. package/dist/ai-types.d.ts +0 -16
  75. package/dist/audit-config.d.ts +0 -24
  76. package/dist/bin.d.ts +0 -1
  77. package/dist/cache-directory.d.ts +0 -73
  78. package/dist/catalog.d.ts +0 -136
  79. package/dist/codeowners.d.ts +0 -30
  80. package/dist/commands/action-graph.d.ts +0 -8
  81. package/dist/commands/add.d.ts +0 -3
  82. package/dist/commands/affected.d.ts +0 -3
  83. package/dist/commands/ai.d.ts +0 -3
  84. package/dist/commands/analyze.d.ts +0 -3
  85. package/dist/commands/approve-builds.d.ts +0 -3
  86. package/dist/commands/audit.d.ts +0 -23
  87. package/dist/commands/cache.d.ts +0 -86
  88. package/dist/commands/check.d.ts +0 -3
  89. package/dist/commands/ci.d.ts +0 -19
  90. package/dist/commands/clean.d.ts +0 -3
  91. package/dist/commands/create/discovery.d.ts +0 -42
  92. package/dist/commands/create/index.d.ts +0 -13
  93. package/dist/commands/create/prompts.d.ts +0 -31
  94. package/dist/commands/create/random-name.d.ts +0 -15
  95. package/dist/commands/create/templates/builtin.d.ts +0 -15
  96. package/dist/commands/create/templates/generator.d.ts +0 -14
  97. package/dist/commands/create/templates/index.d.ts +0 -13
  98. package/dist/commands/create/templates/monorepo.d.ts +0 -16
  99. package/dist/commands/create/templates/remote.d.ts +0 -41
  100. package/dist/commands/create/templates/types.d.ts +0 -46
  101. package/dist/commands/create/utils.d.ts +0 -42
  102. package/dist/commands/dedupe.d.ts +0 -3
  103. package/dist/commands/devcontainer.d.ts +0 -3
  104. package/dist/commands/dlx.d.ts +0 -3
  105. package/dist/commands/docker.d.ts +0 -22
  106. package/dist/commands/doctor.d.ts +0 -15
  107. package/dist/commands/exec.d.ts +0 -3
  108. package/dist/commands/generate.d.ts +0 -10
  109. package/dist/commands/graph.d.ts +0 -3
  110. package/dist/commands/hook/constants.d.ts +0 -8
  111. package/dist/commands/hook/index.d.ts +0 -3
  112. package/dist/commands/hook/install.d.ts +0 -7
  113. package/dist/commands/hook/migrate.d.ts +0 -27
  114. package/dist/commands/hook/uninstall.d.ts +0 -3
  115. package/dist/commands/ignore-helpers.d.ts +0 -157
  116. package/dist/commands/ignore.d.ts +0 -17
  117. package/dist/commands/implode.d.ts +0 -3
  118. package/dist/commands/info.d.ts +0 -3
  119. package/dist/commands/init.d.ts +0 -14
  120. package/dist/commands/install.d.ts +0 -3
  121. package/dist/commands/link.d.ts +0 -3
  122. package/dist/commands/list.d.ts +0 -3
  123. package/dist/commands/migrate/backup.d.ts +0 -8
  124. package/dist/commands/migrate/constants.d.ts +0 -16
  125. package/dist/commands/migrate/deps.d.ts +0 -32
  126. package/dist/commands/migrate/gitleaks.d.ts +0 -29
  127. package/dist/commands/migrate/index.d.ts +0 -3
  128. package/dist/commands/migrate/json.d.ts +0 -22
  129. package/dist/commands/migrate/kingfisher.d.ts +0 -14
  130. package/dist/commands/migrate/lint-staged.d.ts +0 -62
  131. package/dist/commands/migrate/moon.d.ts +0 -5
  132. package/dist/commands/migrate/nano-staged.d.ts +0 -30
  133. package/dist/commands/migrate/nx.d.ts +0 -12
  134. package/dist/commands/migrate/prompt.d.ts +0 -2
  135. package/dist/commands/migrate/secretlint.d.ts +0 -14
  136. package/dist/commands/migrate/shared.d.ts +0 -29
  137. package/dist/commands/migrate/turborepo.d.ts +0 -11
  138. package/dist/commands/migrate/types.d.ts +0 -27
  139. package/dist/commands/migrate/verify.d.ts +0 -12
  140. package/dist/commands/optimize.d.ts +0 -38
  141. package/dist/commands/pm.d.ts +0 -3
  142. package/dist/commands/remove.d.ts +0 -3
  143. package/dist/commands/run.d.ts +0 -16
  144. package/dist/commands/sbom.d.ts +0 -10
  145. package/dist/commands/secrets.d.ts +0 -3
  146. package/dist/commands/sort-package-json.d.ts +0 -3
  147. package/dist/commands/staged.d.ts +0 -10
  148. package/dist/commands/status.d.ts +0 -3
  149. package/dist/commands/sync.d.ts +0 -16
  150. package/dist/commands/task-why.d.ts +0 -3
  151. package/dist/commands/unlink.d.ts +0 -3
  152. package/dist/commands/update.d.ts +0 -3
  153. package/dist/commands/upgrade.d.ts +0 -3
  154. package/dist/commands/why.d.ts +0 -3
  155. package/dist/docker.d.ts +0 -73
  156. package/dist/flakiness.d.ts +0 -40
  157. package/dist/generate/discover.d.ts +0 -29
  158. package/dist/generate/loader.d.ts +0 -15
  159. package/dist/generate/moon-adapter/filename-interp.d.ts +0 -42
  160. package/dist/generate/moon-adapter/filters.d.ts +0 -22
  161. package/dist/generate/moon-adapter/frontmatter.d.ts +0 -39
  162. package/dist/generate/moon-adapter/index.d.ts +0 -19
  163. package/dist/generate/moon-adapter/tera-subset.d.ts +0 -85
  164. package/dist/generate/moon-adapter/util.d.ts +0 -14
  165. package/dist/generate/prompts.d.ts +0 -25
  166. package/dist/generate/remote.d.ts +0 -43
  167. package/dist/generate/runner.d.ts +0 -37
  168. package/dist/generate/types.d.ts +0 -152
  169. package/dist/hooks.d.ts +0 -118
  170. package/dist/native-binding.d.ts +0 -158
  171. package/dist/output.d.ts +0 -40
  172. package/dist/overrides.d.ts +0 -82
  173. package/dist/package-manager.d.ts +0 -23
  174. package/dist/packem_shared/otelPlugin-CJLkguJ8.js +0 -1
  175. package/dist/plugins/config-loader.d.ts +0 -3
  176. package/dist/plugins/otel.d.ts +0 -63
  177. package/dist/plugins/post-command.d.ts +0 -3
  178. package/dist/plugins/security-enforcement.d.ts +0 -3
  179. package/dist/pm-runner.d.ts +0 -44
  180. package/dist/run-report.d.ts +0 -40
  181. package/dist/runtime-check.d.ts +0 -27
  182. package/dist/sbom/cyclonedx.d.ts +0 -39
  183. package/dist/sbom/installed-package.d.ts +0 -49
  184. package/dist/sbom/license.d.ts +0 -31
  185. package/dist/sbom/lockfile.d.ts +0 -34
  186. package/dist/sbom/purl.d.ts +0 -25
  187. package/dist/sbom/resolve-specifier.d.ts +0 -24
  188. package/dist/sbom/types.d.ts +0 -196
  189. package/dist/secrets/baseline.d.ts +0 -20
  190. package/dist/secrets/format.d.ts +0 -14
  191. package/dist/secrets/git.d.ts +0 -6
  192. package/dist/secrets/spinner.d.ts +0 -9
  193. package/dist/security.d.ts +0 -64
  194. package/dist/selectors.d.ts +0 -81
  195. package/dist/shell-history.d.ts +0 -16
  196. package/dist/socket-security.d.ts +0 -129
  197. package/dist/staged/cli-parse.d.ts +0 -18
  198. package/dist/staged/config.d.ts +0 -14
  199. package/dist/staged/errors/apply-empty-commit-error.d.ts +0 -4
  200. package/dist/staged/errors/config-error.d.ts +0 -4
  201. package/dist/staged/errors/get-backup-stash-error.d.ts +0 -4
  202. package/dist/staged/errors/git-error.d.ts +0 -6
  203. package/dist/staged/errors/index.d.ts +0 -12
  204. package/dist/staged/errors/restore-original-state-error.d.ts +0 -4
  205. package/dist/staged/errors/staged-error.d.ts +0 -8
  206. package/dist/staged/errors/task-error.d.ts +0 -6
  207. package/dist/staged/git/diff.d.ts +0 -76
  208. package/dist/staged/git/exec.d.ts +0 -43
  209. package/dist/staged/git/index.d.ts +0 -77
  210. package/dist/staged/git/stash.d.ts +0 -37
  211. package/dist/staged/index.d.ts +0 -13
  212. package/dist/staged/match.d.ts +0 -12
  213. package/dist/staged/renderer/index.d.ts +0 -9
  214. package/dist/staged/renderer/ink/index.d.ts +0 -4
  215. package/dist/staged/renderer/plain.d.ts +0 -12
  216. package/dist/staged/tasks/build.d.ts +0 -13
  217. package/dist/staged/tasks/exec.d.ts +0 -56
  218. package/dist/staged/tasks/run.d.ts +0 -26
  219. package/dist/staged/types.d.ts +0 -173
  220. package/dist/target-discovery.d.ts +0 -59
  221. package/dist/target-options.d.ts +0 -261
  222. package/dist/tips.d.ts +0 -41
  223. package/dist/tui/components/CheckProgressApp.d.ts +0 -6
  224. package/dist/tui/components/CommandSummary.d.ts +0 -17
  225. package/dist/tui/components/Header.d.ts +0 -13
  226. package/dist/tui/components/OutputPanel.d.ts +0 -17
  227. package/dist/tui/components/QuitDialog.d.ts +0 -15
  228. package/dist/tui/components/TaskListPanel.d.ts +0 -19
  229. package/dist/tui/components/TaskRow.d.ts +0 -12
  230. package/dist/tui/components/TaskStore.d.ts +0 -80
  231. package/dist/tui/components/VisTaskRunnerApp.d.ts +0 -17
  232. package/dist/tui/components/devcontainer/DevcontainerStore.d.ts +0 -66
  233. package/dist/tui/components/devcontainer/VisDevcontainerApp.d.ts +0 -9
  234. package/dist/tui/components/devcontainer/catalogs/extensions.d.ts +0 -8
  235. package/dist/tui/components/devcontainer/catalogs/features.d.ts +0 -8
  236. package/dist/tui/components/devcontainer/catalogs/filters.d.ts +0 -4
  237. package/dist/tui/components/devcontainer/catalogs/mount-suggestions.d.ts +0 -19
  238. package/dist/tui/components/devcontainer/catalogs/templates.d.ts +0 -8
  239. package/dist/tui/components/devcontainer/devcontainer-io.d.ts +0 -14
  240. package/dist/tui/components/devcontainer/sections/DockerComposeSection.d.ts +0 -11
  241. package/dist/tui/components/devcontainer/sections/EnvironmentSection.d.ts +0 -16
  242. package/dist/tui/components/devcontainer/sections/ExtensionsSection.d.ts +0 -11
  243. package/dist/tui/components/devcontainer/sections/FeaturesSection.d.ts +0 -11
  244. package/dist/tui/components/devcontainer/sections/GeneralSection.d.ts +0 -12
  245. package/dist/tui/components/devcontainer/sections/LifecycleSection.d.ts +0 -13
  246. package/dist/tui/components/devcontainer/sections/MountsSection.d.ts +0 -16
  247. package/dist/tui/components/devcontainer/sections/PortsSection.d.ts +0 -10
  248. package/dist/tui/components/devcontainer/sections/PreviewPanel.d.ts +0 -11
  249. package/dist/tui/components/devcontainer/types.d.ts +0 -53
  250. package/dist/tui/components/devcontainer/validate.d.ts +0 -16
  251. package/dist/tui/components/graph/GraphStore.d.ts +0 -42
  252. package/dist/tui/components/graph/ProjectDetailPanel.d.ts +0 -10
  253. package/dist/tui/components/graph/ProjectListPanel.d.ts +0 -20
  254. package/dist/tui/components/graph/VisGraphApp.d.ts +0 -8
  255. package/dist/tui/components/optimize/OptimizeDetailPanel.d.ts +0 -9
  256. package/dist/tui/components/optimize/OptimizeListPanel.d.ts +0 -16
  257. package/dist/tui/components/optimize/OptimizeStore.d.ts +0 -50
  258. package/dist/tui/components/optimize/VisOptimizeApp.d.ts +0 -8
  259. package/dist/tui/components/optimize/constants.d.ts +0 -7
  260. package/dist/tui/components/update/PackageDetailPanel.d.ts +0 -12
  261. package/dist/tui/components/update/PackageListPanel.d.ts +0 -21
  262. package/dist/tui/components/update/UpdateStore.d.ts +0 -62
  263. package/dist/tui/components/update/VisUpdateApp.d.ts +0 -18
  264. package/dist/tui/dynamic-life-cycle.d.ts +0 -22
  265. package/dist/tui/formatting-utils.d.ts +0 -17
  266. package/dist/tui/pretty-time.d.ts +0 -8
  267. package/dist/tui/static-life-cycle.d.ts +0 -28
  268. package/dist/tui/status-utils.d.ts +0 -20
  269. package/dist/tui/symbols.d.ts +0 -7
  270. package/dist/tui/types.d.ts +0 -11
  271. package/dist/typosquats.d.ts +0 -70
  272. package/dist/upgrade-check.d.ts +0 -30
  273. package/dist/utils.d.ts +0 -22
  274. package/dist/watch.d.ts +0 -65
  275. package/dist/workspace.d.ts +0 -675
@@ -1,86 +0,0 @@
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 };
@@ -1,3 +0,0 @@
1
- import type { Command } from "@visulima/cerebro";
2
- declare const check: Command;
3
- export default check;
@@ -1,19 +0,0 @@
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;
@@ -1,3 +0,0 @@
1
- import type { Command } from "@visulima/cerebro";
2
- declare const clean: Command;
3
- export default clean;
@@ -1,42 +0,0 @@
1
- /**
2
- * Template discovery — identifies and resolves template sources from user input.
3
- *
4
- * Supports:
5
- * - Built-in templates prefixed with `vis:` (app, library, monorepo, generator)
6
- * - npm `create-*` packages (with shorthand expansion)
7
- * - Git repositories from GitHub, GitLab, Bitbucket, and Sourcehut (all URL formats)
8
- * - Direct tarball/registry URLs via giget's http/https providers
9
- */
10
- import type { TemplateConfig, TemplateType } from "./templates/types.d.ts";
11
- /**
12
- * Check if the input looks like a git/tarball URL that giget can handle.
13
- * @param input Raw user input string.
14
- * @returns `true` when the input matches a known git host, provider prefix, or URL scheme.
15
- */
16
- export declare const isGitUrl: (input: string) => boolean;
17
- /**
18
- * Expand shorthand npm create names following the `npm create` convention:
19
- *
20
- * - `vite` → `create-vite`
21
- * - `@scope/foo` → `@scope/create-foo`
22
- * - `create-vue` → `create-vue` (already expanded)
23
- * - `sv` → `sv` (direct-package initialiser, not expanded)
24
- * @param name Bare package name or scoped package name.
25
- * @returns Expanded package name suitable for `dlx`.
26
- */
27
- export declare const expandCreateShorthand: (name: string) => string;
28
- /**
29
- * Given the raw template string from the user, determine what kind of
30
- * template it is and return a resolved {@link TemplateConfig}.
31
- * @param input Raw template string (e.g., "vis:app", "vite", "user/repo").
32
- * @param extraArgs Additional CLI arguments to forward to the template runner.
33
- * @returns Resolved template configuration with type, source, and args.
34
- */
35
- export declare const discoverTemplate: (input: string, extraArgs?: string[]) => TemplateConfig;
36
- /**
37
- * Suggest the most appropriate parent directory for a new project based on
38
- * the template type.
39
- * @param type The resolved template type.
40
- * @returns Suggested parent directory name ("apps", "packages", or ".").
41
- */
42
- export declare const inferParentDir: (type: TemplateType) => string;
@@ -1,13 +0,0 @@
1
- /**
2
- * `vis create` — full-featured project scaffolding command.
3
- *
4
- * Supports built-in templates (monorepo, app, library, generator),
5
- * remote npm create-* packages, and git repository templates
6
- * (GitHub, GitLab, Bitbucket, Sourcehut) via giget.
7
- *
8
- * Interactive mode guides users through template selection, naming,
9
- * directory choice, and post-creation setup.
10
- */
11
- import type { Command } from "@visulima/cerebro";
12
- declare const create: Command;
13
- export default create;
@@ -1,31 +0,0 @@
1
- /**
2
- * Interactive prompts for `vis create`.
3
- *
4
- * Uses `node:readline` (same pattern as `vis init`) to keep dependencies minimal.
5
- */
6
- export interface PromptResult {
7
- editor?: "vscode" | undefined;
8
- gitInit: boolean;
9
- /** Whether the user confirmed overwriting an existing non-empty directory. */
10
- overwrite: boolean;
11
- pm?: "bun" | "npm" | "pnpm" | "yarn" | undefined;
12
- projectName: string;
13
- targetDir: string;
14
- template: string;
15
- }
16
- /**
17
- * Run the full interactive prompt flow and return the collected answers.
18
- * @param options.cwd Working directory for resolving paths.
19
- * @param options.defaultPm Pre-selected package manager (skips PM prompt when set).
20
- * @param options.defaultGitInit Default for the git-init prompt (from vis.config.ts).
21
- * @param options.defaultEditor Default for the editor prompt (from vis.config.ts).
22
- * @param options.inMonorepo Whether we are inside an existing monorepo workspace.
23
- * @returns Collected answers including template, name, directory, PM, and flags.
24
- */
25
- export declare const runInteractivePrompts: (options: {
26
- cwd: string;
27
- defaultEditor?: "vscode";
28
- defaultGitInit?: boolean;
29
- defaultPm?: string;
30
- inMonorepo: boolean;
31
- }) => Promise<PromptResult>;
@@ -1,15 +0,0 @@
1
- /**
2
- * Random project name generator — produces friendly `word-word` names
3
- * used as default project name suggestions in interactive mode.
4
- *
5
- * Uses @nkzw/safe-word-list for a curated set of ~2700 safe English words.
6
- */
7
- /**
8
- * Generate a random `word-word` project name from the safe word list.
9
- * @example
10
- * ```ts
11
- * randomName(); // "swift-ember"
12
- * randomName(); // "bold-prism"
13
- * ```
14
- */
15
- export declare const randomName: () => string;
@@ -1,15 +0,0 @@
1
- /**
2
- * Built-in template executor — routes `vis:app` and `vis:library`
3
- * to appropriate scaffolding strategies.
4
- *
5
- * - `vis:app` delegates to `create-vite` via dlx
6
- * - `vis:library` scaffolds a minimal TypeScript library package
7
- */
8
- import type { ExecutionContext, TemplateConfig } from "./types.d.ts";
9
- /**
10
- * Execute a built-in template (vis:app or vis:library).
11
- * @param config Resolved template config with type and extra args.
12
- * @param context Runtime context with PM info, target dir, and project name.
13
- * @returns Exit code — 0 on success, non-zero on failure.
14
- */
15
- export declare const executeBuiltin: (config: TemplateConfig, context: ExecutionContext) => number;
@@ -1,14 +0,0 @@
1
- /**
2
- * Built-in generator template — scaffolds a code generator package
3
- * inside an existing monorepo workspace.
4
- *
5
- * Creates a minimal Node.js CLI package with a bin entry point.
6
- */
7
- import type { ExecutionContext } from "./types.d.ts";
8
- /**
9
- * Scaffold a code generator package with a bin entry point.
10
- * @param context Runtime context with project name and target directory.
11
- * @param description Optional generator description for package.json.
12
- * @returns Exit code — 0 on success.
13
- */
14
- export declare const executeGeneratorTemplate: (context: ExecutionContext, description?: string) => number;
@@ -1,13 +0,0 @@
1
- /**
2
- * Template executor router — dispatches to the correct executor
3
- * based on the resolved template type.
4
- */
5
- import type { ExecutionContext, TemplateConfig } from "./types.d.ts";
6
- /**
7
- * Execute a template given its resolved configuration and runtime context.
8
- * @param config Resolved template info (type, source, extra args).
9
- * @param context Runtime context (cwd, PM, project name, target dir, config).
10
- * @returns Exit code — 0 on success, non-zero on failure.
11
- */
12
- export declare const executeTemplate: (config: TemplateConfig, context: ExecutionContext) => Promise<number>;
13
- export type { ExecutionContext, TemplateConfig } from "./types.d.ts";
@@ -1,16 +0,0 @@
1
- /**
2
- * Built-in monorepo template — scaffolds a complete pnpm workspace.
3
- *
4
- * Creates:
5
- * - Root package.json with workspace scripts
6
- * - pnpm-workspace.yaml
7
- * - .gitignore, .editorconfig
8
- * - apps/ and packages/ directories
9
- */
10
- import type { ExecutionContext } from "./types.d.ts";
11
- /**
12
- * Scaffold a pnpm monorepo workspace with apps/ and packages/ directories.
13
- * @param context Execution context with project name, target directory, and PM info.
14
- * @returns Exit code (0 = success).
15
- */
16
- export declare const executeMonorepoTemplate: (context: ExecutionContext) => number;
@@ -1,41 +0,0 @@
1
- /**
2
- * Remote template executors:
3
- *
4
- * - `executeRemoteNpm` — runs npm `create-*` packages via `dlx`
5
- * - `executeRemoteGit` — downloads git repositories using giget
6
- * (GitHub, GitLab, Bitbucket, Sourcehut — tarballs with caching)
7
- *
8
- * Includes auto-fix rules for popular tools that need extra flags
9
- * to play nicely with monorepo setups.
10
- */
11
- import type { ExecutionContext, TemplateConfig } from "./types.d.ts";
12
- /**
13
- * Execute an npm `create-*` package via the package manager's `dlx` command.
14
- *
15
- * Injects the target directory as the first positional argument if not
16
- * already present, since most `create-*` packages expect the output
17
- * directory as the first arg (e.g., `create-vite my-app`).
18
- *
19
- * Auto-fix rules are applied for known tools that need extra flags.
20
- * @param config Resolved template config with source package name and extra args.
21
- * @param context Runtime context with PM, cwd, target dir, and monorepo flag.
22
- * @returns Exit code — 0 on success, non-zero on failure.
23
- */
24
- export declare const executeRemoteNpm: (config: TemplateConfig, context: ExecutionContext) => number;
25
- /**
26
- * Download a git repository template using giget.
27
- *
28
- * Supports GitHub, GitLab, Bitbucket, and Sourcehut — with tarball
29
- * downloads, disk caching, offline support, subdirectory extraction,
30
- * and private repo auth via tokens.
31
- *
32
- * Source format follows giget conventions:
33
- * - `provider:owner/repo[/subpath][#ref]`
34
- * - `owner/repo` (defaults to GitHub)
35
- * - Full HTTPS URLs
36
- * - `git:` prefix for raw git clone
37
- * @param config Resolved template config with giget source string and extra args.
38
- * @param context Runtime context with target dir and createConfig (auth, registry, etc.).
39
- * @returns Exit code — 0 on success, 1 on failure.
40
- */
41
- export declare const executeRemoteGit: (config: TemplateConfig, context: ExecutionContext) => Promise<number>;
@@ -1,46 +0,0 @@
1
- /**
2
- * Core type definitions for the `vis create` scaffolding system.
3
- */
4
- /** The kind of template being scaffolded. */
5
- export type TemplateType = "builtin:app" | "builtin:generator" | "builtin:library" | "builtin:monorepo" | "remote:git" | "remote:npm";
6
- /** Resolved information about a template after discovery. */
7
- export interface TemplateConfig {
8
- /** Extra CLI arguments forwarded to the template runner. */
9
- args: string[];
10
- /** The npm package name (for remote:npm) or git URL (for remote:git). */
11
- source: string;
12
- /** What kind of template this is. */
13
- type: TemplateType;
14
- }
15
- /** Create config from vis.config.ts — full shape matching VisConfig.create. */
16
- export interface CreateConfig {
17
- auth?: string;
18
- defaultEditor?: "vscode";
19
- defaultPm?: "bun" | "npm" | "pnpm" | "yarn";
20
- defaultProvider?: "bitbucket" | "github" | "gitlab" | "sourcehut";
21
- gitInit?: boolean;
22
- install?: boolean;
23
- preferOffline?: boolean;
24
- registry?: false | string;
25
- templates?: Record<string, string>;
26
- }
27
- /** Runtime context passed to every template executor. */
28
- export interface ExecutionContext {
29
- /** Create config from vis.config.ts. */
30
- createConfig?: CreateConfig;
31
- /** Working directory (workspace root or cwd). */
32
- cwd: string;
33
- /** Whether we are inside an existing monorepo workspace. */
34
- inMonorepo: boolean;
35
- /** Console-compatible logger from Cerebro toolbox. */
36
- logger: Console;
37
- /** Detected package manager. */
38
- pm: {
39
- name: "bun" | "npm" | "pnpm" | "yarn";
40
- version: string;
41
- };
42
- /** The validated npm-safe project name. */
43
- projectName: string;
44
- /** Absolute path to the target directory. */
45
- targetDir: string;
46
- }
@@ -1,42 +0,0 @@
1
- /**
2
- * Utility helpers for the `vis create` command.
3
- *
4
- * - Package name validation & sanitisation
5
- * - Directory emptiness / conflict checks
6
- * - Target directory resolution
7
- */
8
- /**
9
- * Validate an npm package name using the official `validate-npm-package-name` library.
10
- * Handles blacklisted names, core module conflicts, length limits, etc.
11
- * @param name Package name to validate.
12
- * @returns `true` when `name` is valid for new npm packages.
13
- */
14
- export declare const isValidPackageName: (name: string) => boolean;
15
- /**
16
- * Sanitise an arbitrary string into a valid npm package name.
17
- * @param raw Arbitrary string to sanitise.
18
- * @returns Lowercased, hyphen-separated name with special chars stripped.
19
- */
20
- export declare const toValidPackageName: (raw: string) => string;
21
- /**
22
- * Check if a directory is empty or contains only ignored files (.DS_Store, .git, etc.).
23
- * @param dir Absolute path to check.
24
- * @returns `true` when `dir` does not exist or contains only ignored files.
25
- */
26
- export declare const isEmptyDir: (dir: string) => boolean;
27
- /**
28
- * Resolve `projectName` relative to `cwd` into an absolute target directory path.
29
- * @param projectName Project name or relative path.
30
- * @param cwd Base directory to resolve from.
31
- * @returns Object with absolute `targetDir` and sanitised `packageName`.
32
- */
33
- export declare const resolveTargetDir: (projectName: string, cwd: string) => {
34
- packageName: string;
35
- targetDir: string;
36
- };
37
- /**
38
- * Check whether scaffolding can proceed without overwriting user files.
39
- * @param dir Absolute path to the target directory.
40
- * @returns `true` when the directory is safe to write into (empty or non-existent).
41
- */
42
- export declare const canSafelyOverwrite: (dir: string) => boolean;
@@ -1,3 +0,0 @@
1
- import type { Command } from "@visulima/cerebro";
2
- declare const dedupe: Command;
3
- export default dedupe;
@@ -1,3 +0,0 @@
1
- import type { Command } from "@visulima/cerebro";
2
- declare const devcontainer: Command;
3
- export default devcontainer;
@@ -1,3 +0,0 @@
1
- import type { Command } from "@visulima/cerebro";
2
- declare const dlx: Command;
3
- export default dlx;
@@ -1,22 +0,0 @@
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;
@@ -1,15 +0,0 @@
1
- import type { Command } from "@visulima/cerebro";
2
- /**
3
- * `vis doctor` — unified project health check.
4
- *
5
- * Runs all diagnostic scans in parallel (outdated, vulnerabilities,
6
- * Socket.dev scores, duplicates, optimization opportunities) and
7
- * displays a single dashboard with actionable next steps.
8
- * @example
9
- * ```sh
10
- * vis doctor # full health check
11
- * vis doctor --json # machine-readable output
12
- * ```
13
- */
14
- declare const doctor: Command;
15
- export default doctor;
@@ -1,3 +0,0 @@
1
- import type { Command } from "@visulima/cerebro";
2
- declare const exec: Command;
3
- export default exec;
@@ -1,10 +0,0 @@
1
- /**
2
- * `vis generate &lt;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;
@@ -1,3 +0,0 @@
1
- import type { Command } from "@visulima/cerebro";
2
- declare const graph: Command;
3
- export default graph;
@@ -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,3 +0,0 @@
1
- import type { Command } from "@visulima/cerebro";
2
- declare const hook: Command;
3
- export default hook;
@@ -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,3 +0,0 @@
1
- import type { InstallResult } from "./constants.d.ts";
2
- declare const uninstallHooks: (directory?: string) => InstallResult;
3
- export { uninstallHooks };