@alexgorbatchev/dotfiles 0.0.5 → 0.0.10

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/dashboard.js CHANGED
@@ -1,13 +1,13 @@
1
- <!DOCTYPE html>
1
+ <!doctype html>
2
2
  <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <base href="/">
7
- <title>Dotfiles Dashboard</title>
8
- <link rel="stylesheet" crossorigin href="./dashboard-3axqywva.css"><script type="module" crossorigin src="./dashboard-0ebz5sqb.js"></script></head>
9
- <body class="min-h-screen">
10
- <div id="app"></div>
11
-
12
- </body>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <base href="/" />
7
+ <title>Dotfiles Dashboard</title>
8
+ <link rel="stylesheet" crossorigin href="./dashboard-3axqywva.css"><script type="module" crossorigin src="./dashboard-vf1askzj.js"></script></head>
9
+ <body class="min-h-screen">
10
+ <div id="app"></div>
11
+
12
+ </body>
13
13
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexgorbatchev/dotfiles",
3
- "version": "0.0.5",
3
+ "version": "0.0.10",
4
4
  "description": "Declarative, versioned dotfiles management with generated shims and shell integration.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/schemas.d.ts CHANGED
@@ -39,6 +39,15 @@ export declare function dedentString(str: string): string;
39
39
  * @returns The processed string with proper indentation and replaced placeholders
40
40
  */
41
41
  export declare function dedentTemplate(template: string, values: Record<string, string>): string;
42
+ type FileWriteContent = string | NodeJS.ArrayBufferView;
43
+ interface IRecursiveDirectoryOptions {
44
+ recursive?: boolean;
45
+ }
46
+ interface IRemoveOptions extends IRecursiveDirectoryOptions {
47
+ force?: boolean;
48
+ }
49
+ type SymlinkKind = "file" | "dir" | "junction";
50
+ type FileMode = number | string;
42
51
  interface IFileSystem {
43
52
  /**
44
53
  * Reads the entire content of a file.
@@ -60,7 +69,7 @@ interface IFileSystem {
60
69
  * @param encoding - The encoding to use.
61
70
  * @returns A promise that resolves when the file has been written.
62
71
  */
63
- writeFile(path: string, content: string | NodeJS.ArrayBufferView, encoding?: BufferEncoding): Promise<void>;
72
+ writeFile(path: string, content: FileWriteContent, encoding?: BufferEncoding): Promise<void>;
64
73
  /**
65
74
  * Checks if a file or directory exists.
66
75
  * @param path - A path to a file or directory.
@@ -73,9 +82,7 @@ interface IFileSystem {
73
82
  * @param options - Options for creating the directory.
74
83
  * @returns A promise that resolves when the directory has been created.
75
84
  */
76
- mkdir(path: string, options?: {
77
- recursive?: boolean;
78
- }): Promise<void>;
85
+ mkdir(path: string, options?: IRecursiveDirectoryOptions): Promise<void>;
79
86
  /**
80
87
  * Reads the contents of a directory.
81
88
  * @param path - A path to a directory.
@@ -88,10 +95,7 @@ interface IFileSystem {
88
95
  * @param options - Options for removal.
89
96
  * @returns A promise that resolves when the file or directory has been removed.
90
97
  */
91
- rm(path: string, options?: {
92
- recursive?: boolean;
93
- force?: boolean;
94
- }): Promise<void>;
98
+ rm(path: string, options?: IRemoveOptions): Promise<void>;
95
99
  /**
96
100
  * Asynchronously removes a directory.
97
101
  * @param path - A path to a directory.
@@ -99,9 +103,7 @@ interface IFileSystem {
99
103
  * @returns A promise that resolves when the directory has been removed.
100
104
  * @deprecated Use {@link IFileSystem.rm} with `recursive: true` instead.
101
105
  */
102
- rmdir(path: string, options?: {
103
- recursive?: boolean;
104
- }): Promise<void>;
106
+ rmdir(path: string, options?: IRecursiveDirectoryOptions): Promise<void>;
105
107
  /**
106
108
  * Gets file or directory stats.
107
109
  * @param path - A path to a file or directory.
@@ -121,7 +123,7 @@ interface IFileSystem {
121
123
  * @param type - The type of symbolic link ('file', 'dir', or 'junction').
122
124
  * @returns A promise that resolves when the symbolic link has been created.
123
125
  */
124
- symlink(target: string, path: string, type?: "file" | "dir" | "junction"): Promise<void>;
126
+ symlink(target: string, path: string, type?: SymlinkKind): Promise<void>;
125
127
  /**
126
128
  * Reads the value of a symbolic link.
127
129
  * @param path - A path to a symbolic link.
@@ -134,7 +136,7 @@ interface IFileSystem {
134
136
  * @param mode - The permissions mode (e.g., `0o755`).
135
137
  * @returns A promise that resolves when the permissions have been changed.
136
138
  */
137
- chmod(path: string, mode: number | string): Promise<void>;
139
+ chmod(path: string, mode: FileMode): Promise<void>;
138
140
  /**
139
141
  * Asynchronously copies a file.
140
142
  * @param src - The source file path.
@@ -490,7 +492,7 @@ type BoundReplaceInFile = (filePath: string, from: ReplaceInFilePattern, to: Rep
490
492
  type BoundResolve = (pattern: string) => string;
491
493
  interface IBaseToolContext {
492
494
  /**
493
- * The user's parsed application configuration from the main `config.ts` file.
495
+ * The user's parsed application configuration from the main `dotfiles.config.ts` file.
494
496
  */
495
497
  projectConfig: ProjectConfig;
496
498
  /**
@@ -660,7 +662,7 @@ interface IGitHubRelease {
660
662
  /** The URL to view this release on the GitHub website. */
661
663
  html_url: string;
662
664
  }
663
- interface ShellResult {
665
+ interface IShellResult {
664
666
  /** Exit code of the process */
665
667
  code: number;
666
668
  /** Stdout as string */
@@ -668,15 +670,15 @@ interface ShellResult {
668
670
  /** Stderr as string */
669
671
  stderr: string;
670
672
  }
671
- interface ShellCommand extends PromiseLike<ShellResult> {
673
+ interface IShellCommand extends PromiseLike<IShellResult> {
672
674
  /** Set working directory */
673
- cwd(path: string): ShellCommand;
675
+ cwd(path: string): IShellCommand;
674
676
  /** Set/merge environment variables */
675
- env(vars: Record<string, string | undefined>): ShellCommand;
677
+ env(vars: Record<string, string | undefined>): IShellCommand;
676
678
  /** Suppress output logging (command still logged) */
677
- quiet(): ShellCommand;
679
+ quiet(): IShellCommand;
678
680
  /** Don't throw on non-zero exit code, return result with code instead */
679
- noThrow(): ShellCommand;
681
+ noThrow(): IShellCommand;
680
682
  /** Get stdout as trimmed string */
681
683
  text(): Promise<string>;
682
684
  /** Parse stdout as JSON */
@@ -686,9 +688,9 @@ interface ShellCommand extends PromiseLike<ShellResult> {
686
688
  /** Get stdout as bytes */
687
689
  bytes(): Promise<Uint8Array>;
688
690
  }
689
- interface Shell {
690
- (strings: TemplateStringsArray, ...values: unknown[]): ShellCommand;
691
- (command: string): ShellCommand;
691
+ interface IShell {
692
+ (strings: TemplateStringsArray, ...values: unknown[]): IShellCommand;
693
+ (command: string): IShellCommand;
692
694
  }
693
695
  interface IEnvContext {
694
696
  /** Project configuration with paths and settings */
@@ -722,7 +724,7 @@ interface IInstallBaseContext extends IBaseToolContext {
722
724
  * Use the `$` tagged template literal to execute shell commands within hooks.
723
725
  * The working directory can be changed using `cd` commands or `process.chdir()`.
724
726
  */
725
- $: Shell;
727
+ $: IShell;
726
728
  /**
727
729
  * An instance of the file system for performing file operations.
728
730
  */
@@ -1353,7 +1355,7 @@ type PlatformBuilderForMethod<M extends InstallMethod> = [
1353
1355
  ] extends [
1354
1356
  NoBinMethodKeys
1355
1357
  ] ? Omit<IPlatformConfigBuilder, "bin"> : IPlatformConfigBuilder;
1356
- interface InstallFunction {
1358
+ interface IInstallFunction {
1357
1359
  <M extends InstallMethod>(method: M, params: IInstallParamsRegistry[M]): ToolBuilderForMethod<M>;
1358
1360
  <M extends NoParamsMethodKeys & InstallMethod>(method: M): ToolBuilderForMethod<M>;
1359
1361
  (): IToolConfigBuilder;
@@ -1365,7 +1367,7 @@ interface IPlatformInstallFunction {
1365
1367
  }
1366
1368
  interface IToolConfigContext extends IBaseToolContext {
1367
1369
  }
1368
- type AsyncConfigureTool = (install: InstallFunction, ctx: IToolConfigContext) => Promise<undefined | IToolConfigBuilder | Omit<IToolConfigBuilder, "bin"> | ToolConfig> | undefined | IToolConfigBuilder | Omit<IToolConfigBuilder, "bin"> | ToolConfig;
1370
+ type AsyncConfigureTool = (install: IInstallFunction, ctx: IToolConfigContext) => Promise<undefined | IToolConfigBuilder | Omit<IToolConfigBuilder, "bin"> | ToolConfig> | undefined | IToolConfigBuilder | Omit<IToolConfigBuilder, "bin"> | ToolConfig;
1369
1371
  declare const platformConfigSchema: z.ZodObject<{
1370
1372
  binaries: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [
1371
1373
  z.ZodString,
@@ -1425,7 +1427,7 @@ type PlatformConfig = Omit<z.infer<typeof platformConfigSchema>, "installationMe
1425
1427
  };
1426
1428
  type InstallHook = AsyncInstallHook<IInstallBaseContext>;
1427
1429
  type BaseEnv = Resolvable<IEnvContext, Record<string, string>>;
1428
- interface InstallHooks {
1430
+ interface IInstallHooks {
1429
1431
  /** Runs before any other installation steps (download, extract, main install command) begin. */
1430
1432
  "before-install"?: InstallHook[];
1431
1433
  /** Runs after download but before extraction or execution. */
@@ -1435,7 +1437,7 @@ interface InstallHooks {
1435
1437
  /** Runs after the main installation command completes. */
1436
1438
  "after-install"?: InstallHook[];
1437
1439
  }
1438
- interface BaseInstallParams {
1440
+ interface IBaseInstallParams {
1439
1441
  /**
1440
1442
  * When true, the tool will be automatically installed during the `generate` command
1441
1443
  * if not already installed. This is useful for tools that must be installed before
@@ -1443,7 +1445,7 @@ interface BaseInstallParams {
1443
1445
  */
1444
1446
  auto?: boolean;
1445
1447
  /**
1446
- * A record of environment variables to be set specifically for the duration of this tool's installation process.
1448
+ * A record of environment variables to be set specifically for the duration of the tool's installation process.
1447
1449
  * Can be a static object or a function that receives context and returns the object.
1448
1450
  */
1449
1451
  env?: BaseEnv;
@@ -1451,7 +1453,7 @@ interface BaseInstallParams {
1451
1453
  * A collection of optional asynchronous hook functions that can be executed at different stages
1452
1454
  * of the installation lifecycle.
1453
1455
  */
1454
- hooks?: InstallHooks;
1456
+ hooks?: IInstallHooks;
1455
1457
  }
1456
1458
  declare const platformConfigEntrySchema: z.ZodObject<{
1457
1459
  platforms: z.ZodNumber;
@@ -1473,7 +1475,7 @@ type InferToolConfigWithPlatforms<TSchema extends z.ZodType> = Omit<z.infer<TSch
1473
1475
  * NOTE: This is an explicit interface (not z.infer) to ensure TypeScript fully resolves
1474
1476
  * the property names, which is required for proper `keyof` behavior in declaration files.
1475
1477
  */
1476
- interface BrewInstallParams extends BaseInstallParams {
1478
+ interface IBrewInstallParams extends IBaseInstallParams {
1477
1479
  /** The name of the Homebrew formula to install (e.g., `ripgrep`). */
1478
1480
  formula?: string;
1479
1481
  /** If `true`, the `formula` property is treated as a Homebrew Cask name. */
@@ -1482,8 +1484,8 @@ interface BrewInstallParams extends BaseInstallParams {
1482
1484
  tap?: string | string[];
1483
1485
  /** Arguments to pass to the binary to check the version. */
1484
1486
  versionArgs?: string[];
1485
- /** Regex to extract version from output. */
1486
- versionRegex?: string;
1487
+ /** Regex pattern or source string used to extract the version from output. */
1488
+ versionRegex?: string | RegExp;
1487
1489
  }
1488
1490
  declare const brewToolConfigSchema: z.ZodObject<{
1489
1491
  binaries: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [
@@ -1559,12 +1561,15 @@ declare const brewToolConfigSchema: z.ZodObject<{
1559
1561
  z.ZodArray<z.ZodString>
1560
1562
  ]>>;
1561
1563
  versionArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
1562
- versionRegex: z.ZodOptional<z.ZodString>;
1564
+ versionRegex: z.ZodOptional<z.ZodUnion<readonly [
1565
+ z.ZodString,
1566
+ z.ZodCustom<RegExp, RegExp>
1567
+ ]>>;
1563
1568
  }, z.core.$strict>;
1564
1569
  }, z.core.$strict>;
1565
1570
  type BrewToolConfig = InferToolConfigWithPlatforms<typeof brewToolConfigSchema>;
1566
1571
  interface IInstallParamsRegistry {
1567
- brew: BrewInstallParams;
1572
+ brew: IBrewInstallParams;
1568
1573
  }
1569
1574
  interface IToolConfigRegistry {
1570
1575
  brew: BrewToolConfig;
@@ -1657,7 +1662,7 @@ declare const cargoToolConfigSchema: z.ZodObject<{
1657
1662
  * NOTE: This is an explicit interface (not z.infer) to ensure TypeScript fully resolves
1658
1663
  * the property names, which is required for proper `keyof` behavior in declaration files.
1659
1664
  */
1660
- interface CargoInstallParams extends BaseInstallParams {
1665
+ interface ICargoInstallParams extends IBaseInstallParams {
1661
1666
  /** The crate name */
1662
1667
  crateName: string;
1663
1668
  /** Source for binaries - either cargo-quickinstall or GitHub releases */
@@ -1673,7 +1678,7 @@ interface CargoInstallParams extends BaseInstallParams {
1673
1678
  }
1674
1679
  type CargoToolConfig = InferToolConfigWithPlatforms<typeof cargoToolConfigSchema>;
1675
1680
  interface IInstallParamsRegistry {
1676
- cargo: CargoInstallParams;
1681
+ cargo: ICargoInstallParams;
1677
1682
  }
1678
1683
  interface IToolConfigRegistry {
1679
1684
  cargo: CargoToolConfig;
@@ -1710,7 +1715,7 @@ type CurlScriptEnv = Resolvable<ICurlScriptArgsContext, Record<string, string>>;
1710
1715
  * the property names, which is required for proper `keyof` behavior in declaration files.
1711
1716
  * Uses Omit because `env` has a more specific type than BaseInstallParams.env.
1712
1717
  */
1713
- interface CurlScriptInstallParams extends Omit<BaseInstallParams, "env"> {
1718
+ interface ICurlScriptInstallParams extends Omit<IBaseInstallParams, "env"> {
1714
1719
  /** The URL of the installation script to download. */
1715
1720
  url: string;
1716
1721
  /** The shell to use for executing the downloaded script. */
@@ -1721,8 +1726,8 @@ interface CurlScriptInstallParams extends Omit<BaseInstallParams, "env"> {
1721
1726
  env?: CurlScriptEnv;
1722
1727
  /** Arguments to pass to the binary to check the version. */
1723
1728
  versionArgs?: string[];
1724
- /** Regex to extract version from output. */
1725
- versionRegex?: string;
1729
+ /** Regex pattern or source string used to extract the version from output. */
1730
+ versionRegex?: string | RegExp;
1726
1731
  }
1727
1732
  declare const curlScriptToolConfigSchema: z.ZodObject<{
1728
1733
  dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1791,7 +1796,10 @@ declare const curlScriptToolConfigSchema: z.ZodObject<{
1791
1796
  args: z.ZodOptional<z.ZodCustom<CurlScriptArgs, CurlScriptArgs>>;
1792
1797
  env: z.ZodOptional<z.ZodCustom<CurlScriptEnv, CurlScriptEnv>>;
1793
1798
  versionArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
1794
- versionRegex: z.ZodOptional<z.ZodString>;
1799
+ versionRegex: z.ZodOptional<z.ZodUnion<readonly [
1800
+ z.ZodString,
1801
+ z.ZodCustom<RegExp, RegExp>
1802
+ ]>>;
1795
1803
  }, z.core.$strict>;
1796
1804
  binaries: z.ZodArray<z.ZodUnion<readonly [
1797
1805
  z.ZodString,
@@ -1803,7 +1811,7 @@ declare const curlScriptToolConfigSchema: z.ZodObject<{
1803
1811
  }, z.core.$strict>;
1804
1812
  type CurlScriptToolConfig = InferToolConfigWithPlatforms<typeof curlScriptToolConfigSchema>;
1805
1813
  interface IInstallParamsRegistry {
1806
- "curl-script": CurlScriptInstallParams;
1814
+ "curl-script": ICurlScriptInstallParams;
1807
1815
  }
1808
1816
  interface IToolConfigRegistry {
1809
1817
  "curl-script": CurlScriptToolConfig;
@@ -1815,13 +1823,13 @@ interface IToolConfigRegistry {
1815
1823
  * NOTE: This is an explicit interface (not z.infer) to ensure TypeScript fully resolves
1816
1824
  * the property names, which is required for proper `keyof` behavior in declaration files.
1817
1825
  */
1818
- interface CurlTarInstallParams extends BaseInstallParams {
1826
+ interface ICurlTarInstallParams extends IBaseInstallParams {
1819
1827
  /** The URL of the tarball to download. */
1820
1828
  url: string;
1821
1829
  /** Arguments to pass to the binary to check the version. */
1822
1830
  versionArgs?: string[];
1823
- /** Regex to extract version from output. */
1824
- versionRegex?: string;
1831
+ /** Regex pattern or source string used to extract the version from output. */
1832
+ versionRegex?: string | RegExp;
1825
1833
  }
1826
1834
  declare const curlTarToolConfigSchema: z.ZodObject<{
1827
1835
  dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1885,7 +1893,10 @@ declare const curlTarToolConfigSchema: z.ZodObject<{
1885
1893
  }, z.core.$strip>>;
1886
1894
  url: z.ZodString;
1887
1895
  versionArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
1888
- versionRegex: z.ZodOptional<z.ZodString>;
1896
+ versionRegex: z.ZodOptional<z.ZodUnion<readonly [
1897
+ z.ZodString,
1898
+ z.ZodCustom<RegExp, RegExp>
1899
+ ]>>;
1889
1900
  }, z.core.$strict>;
1890
1901
  binaries: z.ZodArray<z.ZodUnion<readonly [
1891
1902
  z.ZodString,
@@ -1897,7 +1908,7 @@ declare const curlTarToolConfigSchema: z.ZodObject<{
1897
1908
  }, z.core.$strict>;
1898
1909
  type CurlTarToolConfig = InferToolConfigWithPlatforms<typeof curlTarToolConfigSchema>;
1899
1910
  interface IInstallParamsRegistry {
1900
- "curl-tar": CurlTarInstallParams;
1911
+ "curl-tar": ICurlTarInstallParams;
1901
1912
  }
1902
1913
  interface IToolConfigRegistry {
1903
1914
  "curl-tar": CurlTarToolConfig;
@@ -1918,7 +1929,7 @@ type AssetSelector = (context: IAssetSelectionContext) => IGitHubReleaseAsset |
1918
1929
  * NOTE: This is an explicit interface (not z.infer) to ensure TypeScript fully resolves
1919
1930
  * the property names, which is required for proper `keyof` behavior in declaration files.
1920
1931
  */
1921
- interface GithubReleaseInstallParams extends BaseInstallParams {
1932
+ interface IGithubReleaseInstallParams extends IBaseInstallParams {
1922
1933
  /**
1923
1934
  * The GitHub repository in "owner/repo" format (e.g., `junegunn/fzf`).
1924
1935
  */
@@ -2025,12 +2036,12 @@ declare const githubReleaseToolConfigSchema: z.ZodObject<{
2025
2036
  }, z.core.$strict>;
2026
2037
  type GithubReleaseToolConfig = InferToolConfigWithPlatforms<typeof githubReleaseToolConfigSchema>;
2027
2038
  interface IInstallParamsRegistry {
2028
- "github-release": GithubReleaseInstallParams;
2039
+ "github-release": IGithubReleaseInstallParams;
2029
2040
  }
2030
2041
  interface IToolConfigRegistry {
2031
2042
  "github-release": GithubReleaseToolConfig;
2032
2043
  }
2033
- interface DmgInstallParams extends BaseInstallParams {
2044
+ interface IDmgInstallParams extends IBaseInstallParams {
2034
2045
  /** Source definition for resolving the DMG file. */
2035
2046
  source: DmgSource;
2036
2047
  /** The name of the .app bundle inside the DMG. */
@@ -2039,17 +2050,17 @@ interface DmgInstallParams extends BaseInstallParams {
2039
2050
  binaryPath?: string;
2040
2051
  /** Arguments to pass to the binary to check the version. */
2041
2052
  versionArgs?: string[];
2042
- /** Regex to extract version from output. */
2043
- versionRegex?: string;
2053
+ /** Regex pattern or source string used to extract the version from output. */
2054
+ versionRegex?: string | RegExp;
2044
2055
  }
2045
- interface DmgUrlSource {
2056
+ interface IDmgUrlSource {
2046
2057
  type: "url";
2047
2058
  url: string;
2048
2059
  }
2049
- interface DmgGitHubReleaseSource extends Pick<GithubReleaseInstallParams, "repo" | "version" | "assetPattern" | "assetSelector" | "ghCli" | "prerelease"> {
2060
+ interface IDmgGitHubReleaseSource extends Pick<IGithubReleaseInstallParams, "repo" | "version" | "assetPattern" | "assetSelector" | "ghCli" | "prerelease"> {
2050
2061
  type: "github-release";
2051
2062
  }
2052
- type DmgSource = DmgUrlSource | DmgGitHubReleaseSource;
2063
+ type DmgSource = IDmgUrlSource | IDmgGitHubReleaseSource;
2053
2064
  declare const dmgToolConfigSchema: z.ZodObject<{
2054
2065
  binaries: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [
2055
2066
  z.ZodString,
@@ -2138,12 +2149,15 @@ declare const dmgToolConfigSchema: z.ZodObject<{
2138
2149
  appName: z.ZodOptional<z.ZodString>;
2139
2150
  binaryPath: z.ZodOptional<z.ZodString>;
2140
2151
  versionArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
2141
- versionRegex: z.ZodOptional<z.ZodString>;
2152
+ versionRegex: z.ZodOptional<z.ZodUnion<readonly [
2153
+ z.ZodString,
2154
+ z.ZodCustom<RegExp, RegExp>
2155
+ ]>>;
2142
2156
  }, z.core.$strict>;
2143
2157
  }, z.core.$strict>;
2144
2158
  type DmgToolConfig = InferToolConfigWithPlatforms<typeof dmgToolConfigSchema>;
2145
2159
  interface IInstallParamsRegistry {
2146
- dmg: DmgInstallParams;
2160
+ dmg: IDmgInstallParams;
2147
2161
  }
2148
2162
  interface IToolConfigRegistry {
2149
2163
  dmg: DmgToolConfig;
@@ -2158,7 +2172,7 @@ type GiteaAssetSelector = (context: IGiteaAssetSelectionContext) => IGitHubRelea
2158
2172
  /**
2159
2173
  * Parameters for installing a tool from a Gitea/Forgejo release.
2160
2174
  */
2161
- interface GiteaReleaseInstallParams extends BaseInstallParams {
2175
+ interface IGiteaReleaseInstallParams extends IBaseInstallParams {
2162
2176
  instanceUrl: string;
2163
2177
  repo: string;
2164
2178
  assetPattern?: string | RegExp;
@@ -2248,7 +2262,7 @@ declare const giteaReleaseToolConfigSchema: z.ZodObject<{
2248
2262
  }, z.core.$strict>;
2249
2263
  type GiteaReleaseToolConfig = InferToolConfigWithPlatforms<typeof giteaReleaseToolConfigSchema>;
2250
2264
  interface IInstallParamsRegistry {
2251
- "gitea-release": GiteaReleaseInstallParams;
2265
+ "gitea-release": IGiteaReleaseInstallParams;
2252
2266
  }
2253
2267
  interface IToolConfigRegistry {
2254
2268
  "gitea-release": GiteaReleaseToolConfig;
@@ -2259,7 +2273,7 @@ interface IToolConfigRegistry {
2259
2273
  * NOTE: This is an explicit interface (not z.infer) to ensure TypeScript fully resolves
2260
2274
  * the property names, which is required for proper `keyof` behavior in declaration files.
2261
2275
  */
2262
- interface ManualInstallParams extends BaseInstallParams {
2276
+ interface IManualInstallParams extends IBaseInstallParams {
2263
2277
  /**
2264
2278
  * The path to the binary file relative to the tool configuration file location.
2265
2279
  * If not specified, only shell configurations and symlinks will be processed.
@@ -2338,7 +2352,7 @@ declare const manualToolConfigSchema: z.ZodObject<{
2338
2352
  }, z.core.$strict>;
2339
2353
  type ManualToolConfig = InferToolConfigWithPlatforms<typeof manualToolConfigSchema>;
2340
2354
  interface IInstallParamsRegistry {
2341
- manual: ManualInstallParams;
2355
+ manual: IManualInstallParams;
2342
2356
  }
2343
2357
  interface INoParamsMethodRegistry {
2344
2358
  manual: true;
@@ -2346,7 +2360,7 @@ interface INoParamsMethodRegistry {
2346
2360
  interface IToolConfigRegistry {
2347
2361
  manual: ManualToolConfig;
2348
2362
  }
2349
- interface ConfigContext {
2363
+ interface IConfigContext {
2350
2364
  /**
2351
2365
  * The directory containing the configuration file.
2352
2366
  */
@@ -2356,7 +2370,7 @@ interface ConfigContext {
2356
2370
  */
2357
2371
  systemInfo: ISystemInfo;
2358
2372
  }
2359
- type ConfigFactory = (ctx: ConfigContext) => Promise<ProjectConfigPartial> | ProjectConfigPartial;
2373
+ type ConfigFactory = (ctx: IConfigContext) => Promise<ProjectConfigPartial> | ProjectConfigPartial;
2360
2374
  /**
2361
2375
  * Wraps a configuration factory so `.ts` config files stay fully typed.
2362
2376
  *
@@ -2385,7 +2399,6 @@ type ConfigFactory = (ctx: ConfigContext) => Promise<ProjectConfigPartial> | Pro
2385
2399
  * ```
2386
2400
  */
2387
2401
  export declare function defineConfig(configFn: ConfigFactory): ConfigFactory;
2388
- type ConfigureToolFnResult = ToolConfig | IToolConfigBuilder | Omit<IToolConfigBuilder, "bin"> | undefined | Promise<ToolConfig | IToolConfigBuilder | Omit<IToolConfigBuilder, "bin"> | undefined>;
2389
2402
  /**
2390
2403
  * Define a tool configuration with type-safe install method selection.
2391
2404
  *
@@ -2408,33 +2421,20 @@ type ConfigureToolFnResult = ToolConfig | IToolConfigBuilder | Omit<IToolConfigB
2408
2421
  * );
2409
2422
  * ```
2410
2423
  */
2411
- export declare function defineTool(fn: (
2412
- /**
2413
- * Function to select the installation method and provide type-checked parameters.
2414
- * Call with a method name and params for installers, or call with no args for manual tools.
2415
- * Returns a fluent builder to configure binaries, versions, hooks, and shell settings.
2416
- *
2417
- * @inheritdoc
2418
- */
2419
- install: InstallFunction,
2420
- /**
2421
- * Context object providing access to paths, configuration, and system information.
2422
- * Use `ctx.projectConfig.paths.*` for configured directory paths.
2423
- */
2424
- ctx: IToolConfigContext) => ConfigureToolFnResult): AsyncConfigureTool;
2424
+ export declare function defineTool(fn: AsyncConfigureTool): AsyncConfigureTool;
2425
2425
  /**
2426
2426
  * Parameters for installing a tool by downloading a standalone binary file.
2427
2427
  *
2428
2428
  * NOTE: This is an explicit interface (not z.infer) to ensure TypeScript fully resolves
2429
2429
  * the property names, which is required for proper `keyof` behavior in declaration files.
2430
2430
  */
2431
- interface CurlBinaryInstallParams extends BaseInstallParams {
2431
+ interface ICurlBinaryInstallParams extends IBaseInstallParams {
2432
2432
  /** The URL of the binary file to download. */
2433
2433
  url: string;
2434
2434
  /** Arguments to pass to the binary to check the version. */
2435
2435
  versionArgs?: string[];
2436
- /** Regex to extract version from output. */
2437
- versionRegex?: string;
2436
+ /** Regex pattern or source string used to extract the version from output. */
2437
+ versionRegex?: string | RegExp;
2438
2438
  }
2439
2439
  declare const curlBinaryToolConfigSchema: z.ZodObject<{
2440
2440
  dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -2498,7 +2498,10 @@ declare const curlBinaryToolConfigSchema: z.ZodObject<{
2498
2498
  }, z.core.$strip>>;
2499
2499
  url: z.ZodString;
2500
2500
  versionArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
2501
- versionRegex: z.ZodOptional<z.ZodString>;
2501
+ versionRegex: z.ZodOptional<z.ZodUnion<readonly [
2502
+ z.ZodString,
2503
+ z.ZodCustom<RegExp, RegExp>
2504
+ ]>>;
2502
2505
  }, z.core.$strict>;
2503
2506
  binaries: z.ZodArray<z.ZodUnion<readonly [
2504
2507
  z.ZodString,
@@ -2510,7 +2513,7 @@ declare const curlBinaryToolConfigSchema: z.ZodObject<{
2510
2513
  }, z.core.$strict>;
2511
2514
  type CurlBinaryToolConfig = InferToolConfigWithPlatforms<typeof curlBinaryToolConfigSchema>;
2512
2515
  interface IInstallParamsRegistry {
2513
- "curl-binary": CurlBinaryInstallParams;
2516
+ "curl-binary": ICurlBinaryInstallParams;
2514
2517
  }
2515
2518
  interface IToolConfigRegistry {
2516
2519
  "curl-binary": CurlBinaryToolConfig;
@@ -2521,7 +2524,7 @@ interface IToolConfigRegistry {
2521
2524
  * NOTE: This is an explicit interface (not z.infer) to ensure TypeScript fully resolves
2522
2525
  * the property names, which is required for proper `keyof` behavior in declaration files.
2523
2526
  */
2524
- interface ZshPluginInstallParams extends BaseInstallParams {
2527
+ interface IZshPluginInstallParams extends IBaseInstallParams {
2525
2528
  /** GitHub repository in `user/repo` format. Either `repo` or `url` must be specified. */
2526
2529
  repo?: string;
2527
2530
  /** Full git URL for non-GitHub repositories. Either `repo` or `url` must be specified. */
@@ -2602,7 +2605,7 @@ declare const zshPluginToolConfigSchema: z.ZodObject<{
2602
2605
  }, z.core.$strict>;
2603
2606
  type ZshPluginToolConfig = InferToolConfigWithPlatforms<typeof zshPluginToolConfigSchema>;
2604
2607
  interface IInstallParamsRegistry {
2605
- "zsh-plugin": ZshPluginInstallParams;
2608
+ "zsh-plugin": IZshPluginInstallParams;
2606
2609
  }
2607
2610
  interface IToolConfigRegistry {
2608
2611
  "zsh-plugin": ZshPluginToolConfig;
@@ -2613,15 +2616,15 @@ interface IToolConfigRegistry {
2613
2616
  * NOTE: This is an explicit interface (not z.infer) to ensure TypeScript fully resolves
2614
2617
  * the property names, which is required for proper `keyof` behavior in declaration files.
2615
2618
  */
2616
- interface NpmInstallParams extends BaseInstallParams {
2619
+ interface INpmInstallParams extends IBaseInstallParams {
2617
2620
  /** The npm package name to install. */
2618
2621
  package?: string;
2619
2622
  /** The version or version range to install. */
2620
2623
  version?: string;
2621
2624
  /** Arguments to pass to the binary to check the version. */
2622
2625
  versionArgs?: string[];
2623
- /** Regex to extract version from output. */
2624
- versionRegex?: string;
2626
+ /** Regex pattern or source string used to extract the version from output. */
2627
+ versionRegex?: string | RegExp;
2625
2628
  /** The package manager to use for installation. Defaults to `'npm'`. */
2626
2629
  packageManager?: "npm" | "bun";
2627
2630
  }
@@ -2688,7 +2691,10 @@ declare const npmToolConfigSchema: z.ZodObject<{
2688
2691
  package: z.ZodOptional<z.ZodString>;
2689
2692
  version: z.ZodOptional<z.ZodString>;
2690
2693
  versionArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
2691
- versionRegex: z.ZodOptional<z.ZodString>;
2694
+ versionRegex: z.ZodOptional<z.ZodUnion<readonly [
2695
+ z.ZodString,
2696
+ z.ZodCustom<RegExp, RegExp>
2697
+ ]>>;
2692
2698
  packageManager: z.ZodOptional<z.ZodEnum<{
2693
2699
  bun: "bun";
2694
2700
  npm: "npm";
@@ -2704,27 +2710,27 @@ declare const npmToolConfigSchema: z.ZodObject<{
2704
2710
  }, z.core.$strict>;
2705
2711
  type NpmToolConfig = InferToolConfigWithPlatforms<typeof npmToolConfigSchema>;
2706
2712
  interface IInstallParamsRegistry {
2707
- npm: NpmInstallParams;
2713
+ npm: INpmInstallParams;
2708
2714
  }
2709
2715
  interface IToolConfigRegistry {
2710
2716
  npm: NpmToolConfig;
2711
2717
  }
2712
2718
 
2713
2719
  export {
2714
- BrewInstallParams as z_internal_BrewInstallParams,
2715
- CargoInstallParams as z_internal_CargoInstallParams,
2716
- CurlBinaryInstallParams as z_internal_CurlBinaryInstallParams,
2717
- CurlScriptInstallParams as z_internal_CurlScriptInstallParams,
2718
- CurlTarInstallParams as z_internal_CurlTarInstallParams,
2719
- GiteaReleaseInstallParams as z_internal_GiteaReleaseInstallParams,
2720
- GithubReleaseInstallParams as z_internal_GithubReleaseInstallParams,
2720
+ IBrewInstallParams as z_internal_BrewInstallParams,
2721
+ ICargoInstallParams as z_internal_CargoInstallParams,
2722
+ ICurlBinaryInstallParams as z_internal_CurlBinaryInstallParams,
2723
+ ICurlScriptInstallParams as z_internal_CurlScriptInstallParams,
2724
+ ICurlTarInstallParams as z_internal_CurlTarInstallParams,
2725
+ IGiteaReleaseInstallParams as z_internal_GiteaReleaseInstallParams,
2726
+ IGithubReleaseInstallParams as z_internal_GithubReleaseInstallParams,
2721
2727
  IInstallParamsRegistry as z_internal_IInstallParamsRegistry,
2722
2728
  IKnownBinNameRegistry as z_internal_IKnownBinNameRegistry,
2729
+ IManualInstallParams as z_internal_ManualInstallParams,
2730
+ INpmInstallParams as z_internal_NpmInstallParams,
2723
2731
  ISystemInfo as z_internal_ISystemInfo,
2732
+ IZshPluginInstallParams as z_internal_ZshPluginInstallParams,
2724
2733
  InstallMethod as z_internal_InstallMethod,
2725
- ManualInstallParams as z_internal_ManualInstallParams,
2726
- NpmInstallParams as z_internal_NpmInstallParams,
2727
- ZshPluginInstallParams as z_internal_ZshPluginInstallParams,
2728
2734
  };
2729
2735
 
2730
2736
  export {};
package/skill/SKILL.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: dotfiles
3
3
  description: >-
4
- .tool.ts configuration files, defineTool, install(), config.ts, defineConfig,
4
+ .tool.ts configuration files, defineTool, install(), dotfiles.config.ts, defineConfig,
5
5
  installation methods (github-release, gitea-release, brew, cargo, npm, curl-script, curl-tar, curl-binary, dmg, manual, zsh-plugin),
6
6
  shell integration (aliases, functions, completions, env, symlinks, sourceFile),
7
7
  hooks (before-install, after-download, after-extract, after-install),
@@ -15,12 +15,12 @@ Declarative, versioned dotfiles management. Define CLI tools in TypeScript `.too
15
15
  ## Quick Reference
16
16
 
17
17
  ```typescript
18
- import { defineTool } from '@alexgorbatchev/dotfiles';
18
+ import { defineTool } from "@alexgorbatchev/dotfiles";
19
19
 
20
20
  export default defineTool((install, ctx) =>
21
- install('github-release', { repo: 'BurntSushi/ripgrep' })
22
- .bin('rg')
23
- .zsh((shell) => shell.aliases({ rgi: 'rg -i' }).completions('complete/_rg'))
21
+ install("github-release", { repo: "BurntSushi/ripgrep" })
22
+ .bin("rg")
23
+ .zsh((shell) => shell.aliases({ rgi: "rg -i" }).completions("complete/_rg")),
24
24
  );
25
25
  ```
26
26
 
@@ -30,6 +30,8 @@ Every tool that provides executables **must** have `.bin()` — it generates a s
30
30
 
31
31
  After any `.tool.ts` file change (create, delete, or modify), run `dotfiles generate` to sync generated artifacts.
32
32
 
33
+ `dotfiles install <tool-or-binary>` is also a repair command: it verifies the on-disk install payload, reinstalls broken tools, regenerates missing shims for non-externally-managed tools, removes stale temporary shims for externally managed tools, and reconciles the tool's generated artifacts.
34
+
33
35
  ## Reference Files
34
36
 
35
37
  Read these based on the task at hand: