@rzl-zone/build-tools 0.0.9 → 0.0.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 (65) hide show
  1. package/dist/.references/index.d.cts +1 -1
  2. package/dist/.references/index.d.ts +1 -1
  3. package/dist/bundler/rolldown.cjs +2 -2
  4. package/dist/bundler/rolldown.d.cts +2 -2
  5. package/dist/bundler/rolldown.d.ts +2 -2
  6. package/dist/bundler/rolldown.js +1 -1
  7. package/dist/bundler/tsdown.cjs +3 -3
  8. package/dist/bundler/tsdown.d.cts +2 -2
  9. package/dist/bundler/tsdown.d.ts +2 -2
  10. package/dist/bundler/tsdown.js +3 -3
  11. package/dist/bundler/utils.cjs +2 -2
  12. package/dist/bundler/utils.d.cts +2 -2
  13. package/dist/bundler/utils.d.ts +2 -2
  14. package/dist/bundler/utils.js +2 -2
  15. package/dist/{client-C3jHSAqV.cjs → client-CuivP4z0.cjs} +3 -3
  16. package/dist/client-CuivP4z0.cjs.map +1 -0
  17. package/dist/{client-DUlrjus0.js → client-DzeqTq6Y.js} +3 -3
  18. package/dist/client-DzeqTq6Y.js.map +1 -0
  19. package/dist/commander-kit/index.cjs +5 -5
  20. package/dist/commander-kit/index.cjs.map +1 -1
  21. package/dist/commander-kit/index.d.cts +3 -3
  22. package/dist/commander-kit/index.d.ts +3 -3
  23. package/dist/commander-kit/index.js +5 -5
  24. package/dist/commander-kit/index.js.map +1 -1
  25. package/dist/{extra-CsRmdXC4.d.cts → extra-BleSbKJp.d.ts} +2 -2
  26. package/dist/{extra-DxvrBev9.d.ts → extra-C8r3KWjP.d.cts} +2 -2
  27. package/dist/{fast-globe-options-PH-bHWVK.d.cts → fast-globe-options-D7S2fQZZ.d.cts} +3 -3
  28. package/dist/{fast-globe-options-Cz8KJqKc.d.ts → fast-globe-options-DnV58KJc.d.ts} +3 -3
  29. package/dist/{helper-D11A-ZKL.js → helper-C0AShk-j.js} +2 -2
  30. package/dist/{helper-D11A-ZKL.js.map → helper-C0AShk-j.js.map} +1 -1
  31. package/dist/{helper-DpeqwciR.cjs → helper-DNj9Sj4w.cjs} +2 -2
  32. package/dist/{helper-DpeqwciR.cjs.map → helper-DNj9Sj4w.cjs.map} +1 -1
  33. package/dist/{identity-C5MeSAA7.js → identity-CcYkvy9q.js} +6 -6
  34. package/dist/{identity-C5MeSAA7.js.map → identity-CcYkvy9q.js.map} +1 -1
  35. package/dist/{identity-ByjqnR8L.cjs → identity-Crq3bzhv.cjs} +6 -6
  36. package/dist/{identity-ByjqnR8L.cjs.map → identity-Crq3bzhv.cjs.map} +1 -1
  37. package/dist/{index-xAz8brx-.d.cts → index-BdtMQyzF.d.cts} +2 -2
  38. package/dist/{index-Dvmmz0f_.d.ts → index-CwHGSras.d.ts} +2 -2
  39. package/dist/{index-TgjbNRWB.d.cts → index-DlH2PDPD.d.cts} +2 -2
  40. package/dist/{index-B1t7Xs3T.d.ts → index-NLQcJJFO.d.ts} +2 -2
  41. package/dist/index.cjs +176 -104
  42. package/dist/index.cjs.map +1 -1
  43. package/dist/index.d.cts +81 -48
  44. package/dist/index.d.ts +81 -48
  45. package/dist/index.js +176 -104
  46. package/dist/index.js.map +1 -1
  47. package/dist/{package-banner-ByfR7yCv.cjs → package-banner-BoS7Lbi9.cjs} +5 -5
  48. package/dist/{package-banner-ByfR7yCv.cjs.map → package-banner-BoS7Lbi9.cjs.map} +1 -1
  49. package/dist/{package-banner-vwqcAX8E.js → package-banner-DkNDAjMK.js} +5 -5
  50. package/dist/{package-banner-vwqcAX8E.js.map → package-banner-DkNDAjMK.js.map} +1 -1
  51. package/dist/{server-BK6eykjo.cjs → server-CvLC0e2m.cjs} +3 -3
  52. package/dist/{server-BK6eykjo.cjs.map → server-CvLC0e2m.cjs.map} +1 -1
  53. package/dist/{server-1H2HFAbi.js → server-Dc93jndm.js} +3 -3
  54. package/dist/{server-1H2HFAbi.js.map → server-Dc93jndm.js.map} +1 -1
  55. package/dist/utils/client.cjs +2 -2
  56. package/dist/utils/client.d.cts +25 -7
  57. package/dist/utils/client.d.ts +25 -7
  58. package/dist/utils/client.js +2 -2
  59. package/dist/utils/server.cjs +2 -2
  60. package/dist/utils/server.d.cts +2 -2
  61. package/dist/utils/server.d.ts +2 -2
  62. package/dist/utils/server.js +2 -2
  63. package/package.json +4 -2
  64. package/dist/client-C3jHSAqV.cjs.map +0 -1
  65. package/dist/client-DUlrjus0.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -2,16 +2,16 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/build-tools
4
4
  * ------------------------------------------------------------------------
5
- * Version: `0.0.9`
5
+ * Version: `0.0.11`
6
6
  * Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
7
7
  * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
8
8
  * ========================================================================
9
9
  */
10
10
 
11
- import { a as OmitStrict, c as PrettifyOptions, r as DefaultPrettifyOptions, s as Prettify } from "./extra-CsRmdXC4.cjs";
12
- import { n as generatePackageBanner, r as PackageJson, t as GeneratePackageBannerOptions } from "./index-TgjbNRWB.cjs";
13
- import { t as CommandIdentity } from "./index-xAz8brx-.cjs";
14
- import { n as PatternOptions, t as PatternConfig } from "./fast-globe-options-PH-bHWVK.cjs";
11
+ import { a as OmitStrict, c as PrettifyOptions, r as DefaultPrettifyOptions, s as Prettify } from "./extra-C8r3KWjP.cjs";
12
+ import { n as generatePackageBanner, r as PackageJson, t as GeneratePackageBannerOptions } from "./index-DlH2PDPD.cjs";
13
+ import { t as CommandIdentity } from "./index-BdtMQyzF.cjs";
14
+ import { n as PatternOptions, t as PatternConfig } from "./fast-globe-options-D7S2fQZZ.cjs";
15
15
  import { ChildProcess, SpawnOptions, StdioOptions } from "node:child_process";
16
16
  import * as acorn from "acorn";
17
17
 
@@ -1464,7 +1464,7 @@ type BaseRunCommandOptions = {
1464
1464
  */
1465
1465
  env?: NodeJS.ProcessEnv;
1466
1466
  /** ----------------------------------------------------------------
1467
- * * ***Disable execution inside a system shell.***
1467
+ * * ***Control whether the command is executed inside a system shell.***
1468
1468
  * ----------------------------------------------------------------
1469
1469
  *
1470
1470
  * By default, commands are executed inside a system shell:
@@ -1474,13 +1474,18 @@ type BaseRunCommandOptions = {
1474
1474
  * Set this option to `false` to bypass the shell and execute
1475
1475
  * the command directly.
1476
1476
  *
1477
- * This is useful for:
1478
- * - Strict argument handling.
1479
- * - Avoiding shell interpretation.
1477
+ * - This is useful for:
1478
+ * - Strict argument handling.
1479
+ * - Avoiding shell interpretation.
1480
+ *
1481
+ * - ⚠️ Note:
1482
+ * - Shell operators and advanced shell syntax (e.g. `&&`, `||`, `|`, `>`)
1483
+ * are **not supported**, regardless of this option.
1484
+ * - This utility always executes a single command with arguments.
1480
1485
  *
1481
1486
  * @default true (shell is enabled)
1482
1487
  */
1483
- shell?: false;
1488
+ shell?: boolean;
1484
1489
  /** ----------------------------------------------------------------
1485
1490
  * * ***Abort signal for cancelling the spawned process.***
1486
1491
  * ----------------------------------------------------------------
@@ -1552,6 +1557,7 @@ type BaseRunCommandOptions = {
1552
1557
  */
1553
1558
  useColors?: boolean;
1554
1559
  } & Omit<SpawnOptions, "cwd" | "env" | "shell" | "stdio" | "argv0" | "timeout">;
1560
+ type Reason = "timeout" | "abort" | "signal" | "non-zero exit code" | "validation";
1555
1561
  /** ----------------------------------------------------------------
1556
1562
  * * ***Represents a command execution failure.***
1557
1563
  * ----------------------------------------------------------------
@@ -1626,7 +1632,7 @@ type BaseRunCommandOptions = {
1626
1632
  * output when logged via `console.error`.
1627
1633
  */
1628
1634
  declare class CommandProcessError extends Error {
1629
- reason: "timeout" | "abort" | "signal" | "non-zero exit code";
1635
+ reason: Reason;
1630
1636
  exitCode?: number;
1631
1637
  signal?: NodeJS.Signals | null;
1632
1638
  command: string;
@@ -1753,6 +1759,18 @@ type RunCommandCaptureOptions = Omit<BaseRunCommandOptions, "stdio">;
1753
1759
  * - Parsing results (JSON, text, etc.).
1754
1760
  * - Testing and scripting utilities.
1755
1761
  *
1762
+ * ----------------------------------------------------------------
1763
+ * #### Limitations
1764
+ *
1765
+ * - Only a **single command** is supported.
1766
+ * - Shell syntax is **NOT allowed**, including:
1767
+ * - `&&`, `||`
1768
+ * - `|`
1769
+ * - `>`, `<`
1770
+ * - command chaining or piping of any kind
1771
+ *
1772
+ * Commands must represent a single executable with arguments.
1773
+ *
1756
1774
  * @param {string} command
1757
1775
  * The executable or command to run.
1758
1776
  *
@@ -1774,33 +1792,34 @@ type RunCommandCaptureOptions = Omit<BaseRunCommandOptions, "stdio">;
1774
1792
  *
1775
1793
  * This function does NOT reject on non-zero exit codes.
1776
1794
  * - Instead, use:
1777
- * - `result.ok`.
1778
- * - `result.exitCode`.
1795
+ * - `result.ok`
1796
+ * - `result.exitCode`
1779
1797
  *
1780
- * - However, the promise WILL reject for:
1781
- * - spawn errors.
1782
- * - abort signals.
1783
- * - timeouts.
1784
- * - termination by signal.
1798
+ * The promise will reject in the following cases:
1799
+ * - validation errors (invalid command or arguments)
1800
+ * - spawn errors
1801
+ * - abort signals
1802
+ * - timeouts
1803
+ * - termination by signal
1785
1804
  *
1786
1805
  * In those cases, the promise is rejected with a
1787
1806
  * {@link CommandProcessError | **`CommandProcessError`**}.
1788
1807
  *
1789
1808
  * - *Error metadata:*
1790
- * - `reason` ➔ `"timeout" | "abort" | "signal" | "non-zero exit code"`.
1791
- * - `exitCode` ➔ Exit code (if available).
1792
- * - `signal` ➔ Termination signal (if any).
1793
- * - `command` ➔ Executed command (plain string, no colors).
1809
+ * - `reason` ➔ `"timeout" | "abort" | "signal" | "validation"`
1810
+ * - `exitCode` ➔ Exit code (if available)
1811
+ * - `signal` ➔ Termination signal (if any)
1812
+ * - `command` ➔ Executed command (plain string, no colors)
1794
1813
  *
1795
1814
  * - *Type narrowing:*
1796
- * - Use `instanceof CommandProcessError` to safely access metadata.
1797
- * - Or use {@link isCommandProcessError | **`isCommandProcessError`**} as a type guard.
1815
+ * - Use `instanceof CommandProcessError` to safely access metadata
1816
+ * - Or use {@link isCommandProcessError | **`isCommandProcessError`**} as a type guard
1798
1817
  *
1799
1818
  * - *Notes:*
1800
- * - `"non-zero exit code"` is NOT treated as an error in this function.
1801
- * - Metadata is available programmatically (e.g. `err.reason`).
1819
+ * - Non-zero exit codes are NOT treated as errors
1820
+ * - Metadata is available programmatically (e.g. `err.reason`)
1802
1821
  * - Metadata is also included in the formatted stack output
1803
- * for CLI readability.
1822
+ * for CLI readability
1804
1823
  *
1805
1824
  * @example
1806
1825
  * ```ts
@@ -1824,6 +1843,7 @@ type RunCommandCaptureOptions = Omit<BaseRunCommandOptions, "stdio">;
1824
1843
  * }
1825
1844
  * ```
1826
1845
  * ----------------------------------------------------------------
1846
+ *
1827
1847
  * @example
1828
1848
  * ```ts
1829
1849
  * const result = await runCommandCapture("node", ["--version"]);
@@ -1853,28 +1873,29 @@ type RunCommandCaptureOptions = Omit<BaseRunCommandOptions, "stdio">;
1853
1873
  *
1854
1874
  * @remarks
1855
1875
  * - **Execution model:**
1856
- * - Uses {@link spawn | **`spawn`**} to avoid output size limits
1857
- * imposed by `exec`.
1876
+ * - Uses {@link spawn | **`spawn`**} to avoid output size limits
1877
+ * imposed by `exec`
1858
1878
  *
1859
1879
  * - **Output handling:**
1860
- * - Always uses `stdio: "pipe"` (cannot be overridden).
1861
- * - Output is buffered entirely in memory.
1880
+ * - Always uses `stdio: "pipe"` (cannot be overridden)
1881
+ * - Output is buffered entirely in memory
1862
1882
  *
1863
1883
  * - **Exit behavior:**
1864
- * - Does NOT reject on non-zero exit codes.
1865
- * - Use `result.ok` or `result.exitCode` to handle failures.
1884
+ * - Does NOT reject on non-zero exit codes
1885
+ * - Use `result.ok` or `result.exitCode` to handle failures
1866
1886
  *
1867
1887
  * - **Shell execution:**
1868
- * - Defaults to `shell: true`.
1869
- * - Same behavior and constraints as {@link runCommand | `runCommand`}.
1888
+ * - Defaults to `shell: true` for cross-platform compatibility
1889
+ * - However, shell operators and advanced shell syntax are NOT supported
1890
+ * - This utility always executes a single command only
1870
1891
  *
1871
1892
  * - **Abort & timeout:**
1872
- * - Abort signals and timeouts will terminate the process
1873
- * and reject the promise.
1893
+ * - Abort signals and timeouts will terminate the process
1894
+ * and reject the promise
1874
1895
  *
1875
1896
  * - **When NOT to use this utility:**
1876
- * - When output needs to be streamed in real-time
1877
- * - When handling very large outputs (risk of high memory usage)
1897
+ * - When output needs to be streamed in real-time
1898
+ * - When handling very large outputs (risk of high memory usage)
1878
1899
  *
1879
1900
  * ***In those cases, use {@link runCommand | `runCommand`}.***
1880
1901
  */
@@ -1909,6 +1930,18 @@ type RunCommandOptions = BaseRunCommandOptions;
1909
1930
  * - CLI tooling.
1910
1931
  * - Long-running tasks (bundlers, compilers, CSS processors).
1911
1932
  *
1933
+ * ----------------------------------------------------------------
1934
+ * #### Limitations
1935
+ *
1936
+ * - Only a **single command** is supported.
1937
+ * - Shell syntax is **NOT allowed**, including:
1938
+ * - `&&`, `||`
1939
+ * - `|`
1940
+ * - `>`, `<`
1941
+ * - command chaining or piping of any kind
1942
+ *
1943
+ * Commands must represent a single executable with arguments.
1944
+ *
1912
1945
  * @param {string} command
1913
1946
  * The executable or command to run.
1914
1947
  *
@@ -1929,13 +1962,13 @@ type RunCommandOptions = BaseRunCommandOptions;
1929
1962
  * {@link CommandProcessError | **`CommandProcessError`**}.
1930
1963
  *
1931
1964
  * - *Error metadata:*
1932
- * - `reason` ➔ `"timeout" | "abort" | "signal" | "non-zero exit code"`.
1965
+ * - `reason` ➔ `"timeout" | "abort" | "signal" | "non-zero exit code" | "validation"`.
1933
1966
  * - `exitCode` ➔ Exit code (if available).
1934
1967
  * - `signal` ➔ Termination signal (if any).
1935
1968
  * - `command` ➔ Executed command (plain string, no colors).
1936
1969
  *
1937
1970
  * - *Type narrowing:*
1938
- * - Use `instanceof CommandProcessError` to safely access metadata.
1971
+ * - Use ***instanceof {@link CommandProcessError | **`CommandProcessError`**}*** to safely access metadata.
1939
1972
  * - Or use {@link isCommandProcessError | **`isCommandProcessError`**} as a type guard.
1940
1973
  *
1941
1974
  * - *Notes:*
@@ -1966,6 +1999,7 @@ type RunCommandOptions = BaseRunCommandOptions;
1966
1999
  * }
1967
2000
  * }
1968
2001
  * ```
2002
+ *
1969
2003
  * ----------------------------------------------------------------
1970
2004
  *
1971
2005
  * @example
@@ -2007,11 +2041,10 @@ type RunCommandOptions = BaseRunCommandOptions;
2007
2041
  * - If `stdio` is overridden (e.g. `"pipe"`), output will NOT be auto-forwarded.
2008
2042
  *
2009
2043
  * - **Shell execution:**
2010
- * - Defaults to {@link RunCommandOptions.shell | **`shell: true`**}.
2011
- * - Required on Windows to resolve commands like `pnpm`, `npm`, `git`, etc.
2012
- * - When `shell: false`, the command must be:
2013
- * - An absolute path, or
2014
- * - A directly executable binary.
2044
+ * - Defaults to {@link RunCommandOptions.shell | **`shell: true`**}
2045
+ * for cross-platform compatibility (especially on Windows).
2046
+ * - However, shell operators and advanced shell syntax are **NOT supported**.
2047
+ * - This utility always executes a **single command only**.
2015
2048
  *
2016
2049
  * - **Abort handling:**
2017
2050
  * - When `signal` is provided, the process will be terminated
@@ -2031,9 +2064,9 @@ type RunCommandOptions = BaseRunCommandOptions;
2031
2064
  *
2032
2065
  * - **When NOT to use this utility:**
2033
2066
  * - When you need to capture output programmatically.
2034
- * - When you need advanced shell features (`|`, `>`, `&&`).
2067
+ * - When you need advanced shell features (`|`, `>`, `&&`, piping, chaining).
2035
2068
  *
2036
- * ***In those cases, consider using `exec` or a dedicated process runner.***
2069
+ * ***In those cases, use `exec` or a dedicated shell runner instead.***
2037
2070
  */
2038
2071
  declare function runCommand(command: string, args: readonly string[]): Promise<ChildProcess>;
2039
2072
  declare function runCommand(command: string, options: RunCommandOptions): Promise<ChildProcess>;
package/dist/index.d.ts CHANGED
@@ -2,16 +2,16 @@
2
2
  * ========================================================================
3
3
  * @rzl-zone/build-tools
4
4
  * ------------------------------------------------------------------------
5
- * Version: `0.0.9`
5
+ * Version: `0.0.11`
6
6
  * Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
7
7
  * Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
8
8
  * ========================================================================
9
9
  */
10
10
 
11
- import { a as OmitStrict, c as PrettifyOptions, r as DefaultPrettifyOptions, s as Prettify } from "./extra-DxvrBev9.js";
12
- import { n as generatePackageBanner, r as PackageJson, t as GeneratePackageBannerOptions } from "./index-Dvmmz0f_.js";
13
- import { t as CommandIdentity } from "./index-B1t7Xs3T.js";
14
- import { n as PatternOptions, t as PatternConfig } from "./fast-globe-options-Cz8KJqKc.js";
11
+ import { a as OmitStrict, c as PrettifyOptions, r as DefaultPrettifyOptions, s as Prettify } from "./extra-BleSbKJp.js";
12
+ import { n as generatePackageBanner, r as PackageJson, t as GeneratePackageBannerOptions } from "./index-CwHGSras.js";
13
+ import { t as CommandIdentity } from "./index-NLQcJJFO.js";
14
+ import { n as PatternOptions, t as PatternConfig } from "./fast-globe-options-DnV58KJc.js";
15
15
  import { ChildProcess, SpawnOptions, StdioOptions, spawn } from "node:child_process";
16
16
  import * as acorn from "acorn";
17
17
 
@@ -1464,7 +1464,7 @@ type BaseRunCommandOptions = {
1464
1464
  */
1465
1465
  env?: NodeJS.ProcessEnv;
1466
1466
  /** ----------------------------------------------------------------
1467
- * * ***Disable execution inside a system shell.***
1467
+ * * ***Control whether the command is executed inside a system shell.***
1468
1468
  * ----------------------------------------------------------------
1469
1469
  *
1470
1470
  * By default, commands are executed inside a system shell:
@@ -1474,13 +1474,18 @@ type BaseRunCommandOptions = {
1474
1474
  * Set this option to `false` to bypass the shell and execute
1475
1475
  * the command directly.
1476
1476
  *
1477
- * This is useful for:
1478
- * - Strict argument handling.
1479
- * - Avoiding shell interpretation.
1477
+ * - This is useful for:
1478
+ * - Strict argument handling.
1479
+ * - Avoiding shell interpretation.
1480
+ *
1481
+ * - ⚠️ Note:
1482
+ * - Shell operators and advanced shell syntax (e.g. `&&`, `||`, `|`, `>`)
1483
+ * are **not supported**, regardless of this option.
1484
+ * - This utility always executes a single command with arguments.
1480
1485
  *
1481
1486
  * @default true (shell is enabled)
1482
1487
  */
1483
- shell?: false;
1488
+ shell?: boolean;
1484
1489
  /** ----------------------------------------------------------------
1485
1490
  * * ***Abort signal for cancelling the spawned process.***
1486
1491
  * ----------------------------------------------------------------
@@ -1552,6 +1557,7 @@ type BaseRunCommandOptions = {
1552
1557
  */
1553
1558
  useColors?: boolean;
1554
1559
  } & Omit<SpawnOptions, "cwd" | "env" | "shell" | "stdio" | "argv0" | "timeout">;
1560
+ type Reason = "timeout" | "abort" | "signal" | "non-zero exit code" | "validation";
1555
1561
  /** ----------------------------------------------------------------
1556
1562
  * * ***Represents a command execution failure.***
1557
1563
  * ----------------------------------------------------------------
@@ -1626,7 +1632,7 @@ type BaseRunCommandOptions = {
1626
1632
  * output when logged via `console.error`.
1627
1633
  */
1628
1634
  declare class CommandProcessError extends Error {
1629
- reason: "timeout" | "abort" | "signal" | "non-zero exit code";
1635
+ reason: Reason;
1630
1636
  exitCode?: number;
1631
1637
  signal?: NodeJS.Signals | null;
1632
1638
  command: string;
@@ -1753,6 +1759,18 @@ type RunCommandCaptureOptions = Omit<BaseRunCommandOptions, "stdio">;
1753
1759
  * - Parsing results (JSON, text, etc.).
1754
1760
  * - Testing and scripting utilities.
1755
1761
  *
1762
+ * ----------------------------------------------------------------
1763
+ * #### Limitations
1764
+ *
1765
+ * - Only a **single command** is supported.
1766
+ * - Shell syntax is **NOT allowed**, including:
1767
+ * - `&&`, `||`
1768
+ * - `|`
1769
+ * - `>`, `<`
1770
+ * - command chaining or piping of any kind
1771
+ *
1772
+ * Commands must represent a single executable with arguments.
1773
+ *
1756
1774
  * @param {string} command
1757
1775
  * The executable or command to run.
1758
1776
  *
@@ -1774,33 +1792,34 @@ type RunCommandCaptureOptions = Omit<BaseRunCommandOptions, "stdio">;
1774
1792
  *
1775
1793
  * This function does NOT reject on non-zero exit codes.
1776
1794
  * - Instead, use:
1777
- * - `result.ok`.
1778
- * - `result.exitCode`.
1795
+ * - `result.ok`
1796
+ * - `result.exitCode`
1779
1797
  *
1780
- * - However, the promise WILL reject for:
1781
- * - spawn errors.
1782
- * - abort signals.
1783
- * - timeouts.
1784
- * - termination by signal.
1798
+ * The promise will reject in the following cases:
1799
+ * - validation errors (invalid command or arguments)
1800
+ * - spawn errors
1801
+ * - abort signals
1802
+ * - timeouts
1803
+ * - termination by signal
1785
1804
  *
1786
1805
  * In those cases, the promise is rejected with a
1787
1806
  * {@link CommandProcessError | **`CommandProcessError`**}.
1788
1807
  *
1789
1808
  * - *Error metadata:*
1790
- * - `reason` ➔ `"timeout" | "abort" | "signal" | "non-zero exit code"`.
1791
- * - `exitCode` ➔ Exit code (if available).
1792
- * - `signal` ➔ Termination signal (if any).
1793
- * - `command` ➔ Executed command (plain string, no colors).
1809
+ * - `reason` ➔ `"timeout" | "abort" | "signal" | "validation"`
1810
+ * - `exitCode` ➔ Exit code (if available)
1811
+ * - `signal` ➔ Termination signal (if any)
1812
+ * - `command` ➔ Executed command (plain string, no colors)
1794
1813
  *
1795
1814
  * - *Type narrowing:*
1796
- * - Use `instanceof CommandProcessError` to safely access metadata.
1797
- * - Or use {@link isCommandProcessError | **`isCommandProcessError`**} as a type guard.
1815
+ * - Use `instanceof CommandProcessError` to safely access metadata
1816
+ * - Or use {@link isCommandProcessError | **`isCommandProcessError`**} as a type guard
1798
1817
  *
1799
1818
  * - *Notes:*
1800
- * - `"non-zero exit code"` is NOT treated as an error in this function.
1801
- * - Metadata is available programmatically (e.g. `err.reason`).
1819
+ * - Non-zero exit codes are NOT treated as errors
1820
+ * - Metadata is available programmatically (e.g. `err.reason`)
1802
1821
  * - Metadata is also included in the formatted stack output
1803
- * for CLI readability.
1822
+ * for CLI readability
1804
1823
  *
1805
1824
  * @example
1806
1825
  * ```ts
@@ -1824,6 +1843,7 @@ type RunCommandCaptureOptions = Omit<BaseRunCommandOptions, "stdio">;
1824
1843
  * }
1825
1844
  * ```
1826
1845
  * ----------------------------------------------------------------
1846
+ *
1827
1847
  * @example
1828
1848
  * ```ts
1829
1849
  * const result = await runCommandCapture("node", ["--version"]);
@@ -1853,28 +1873,29 @@ type RunCommandCaptureOptions = Omit<BaseRunCommandOptions, "stdio">;
1853
1873
  *
1854
1874
  * @remarks
1855
1875
  * - **Execution model:**
1856
- * - Uses {@link spawn | **`spawn`**} to avoid output size limits
1857
- * imposed by `exec`.
1876
+ * - Uses {@link spawn | **`spawn`**} to avoid output size limits
1877
+ * imposed by `exec`
1858
1878
  *
1859
1879
  * - **Output handling:**
1860
- * - Always uses `stdio: "pipe"` (cannot be overridden).
1861
- * - Output is buffered entirely in memory.
1880
+ * - Always uses `stdio: "pipe"` (cannot be overridden)
1881
+ * - Output is buffered entirely in memory
1862
1882
  *
1863
1883
  * - **Exit behavior:**
1864
- * - Does NOT reject on non-zero exit codes.
1865
- * - Use `result.ok` or `result.exitCode` to handle failures.
1884
+ * - Does NOT reject on non-zero exit codes
1885
+ * - Use `result.ok` or `result.exitCode` to handle failures
1866
1886
  *
1867
1887
  * - **Shell execution:**
1868
- * - Defaults to `shell: true`.
1869
- * - Same behavior and constraints as {@link runCommand | `runCommand`}.
1888
+ * - Defaults to `shell: true` for cross-platform compatibility
1889
+ * - However, shell operators and advanced shell syntax are NOT supported
1890
+ * - This utility always executes a single command only
1870
1891
  *
1871
1892
  * - **Abort & timeout:**
1872
- * - Abort signals and timeouts will terminate the process
1873
- * and reject the promise.
1893
+ * - Abort signals and timeouts will terminate the process
1894
+ * and reject the promise
1874
1895
  *
1875
1896
  * - **When NOT to use this utility:**
1876
- * - When output needs to be streamed in real-time
1877
- * - When handling very large outputs (risk of high memory usage)
1897
+ * - When output needs to be streamed in real-time
1898
+ * - When handling very large outputs (risk of high memory usage)
1878
1899
  *
1879
1900
  * ***In those cases, use {@link runCommand | `runCommand`}.***
1880
1901
  */
@@ -1909,6 +1930,18 @@ type RunCommandOptions = BaseRunCommandOptions;
1909
1930
  * - CLI tooling.
1910
1931
  * - Long-running tasks (bundlers, compilers, CSS processors).
1911
1932
  *
1933
+ * ----------------------------------------------------------------
1934
+ * #### Limitations
1935
+ *
1936
+ * - Only a **single command** is supported.
1937
+ * - Shell syntax is **NOT allowed**, including:
1938
+ * - `&&`, `||`
1939
+ * - `|`
1940
+ * - `>`, `<`
1941
+ * - command chaining or piping of any kind
1942
+ *
1943
+ * Commands must represent a single executable with arguments.
1944
+ *
1912
1945
  * @param {string} command
1913
1946
  * The executable or command to run.
1914
1947
  *
@@ -1929,13 +1962,13 @@ type RunCommandOptions = BaseRunCommandOptions;
1929
1962
  * {@link CommandProcessError | **`CommandProcessError`**}.
1930
1963
  *
1931
1964
  * - *Error metadata:*
1932
- * - `reason` ➔ `"timeout" | "abort" | "signal" | "non-zero exit code"`.
1965
+ * - `reason` ➔ `"timeout" | "abort" | "signal" | "non-zero exit code" | "validation"`.
1933
1966
  * - `exitCode` ➔ Exit code (if available).
1934
1967
  * - `signal` ➔ Termination signal (if any).
1935
1968
  * - `command` ➔ Executed command (plain string, no colors).
1936
1969
  *
1937
1970
  * - *Type narrowing:*
1938
- * - Use `instanceof CommandProcessError` to safely access metadata.
1971
+ * - Use ***instanceof {@link CommandProcessError | **`CommandProcessError`**}*** to safely access metadata.
1939
1972
  * - Or use {@link isCommandProcessError | **`isCommandProcessError`**} as a type guard.
1940
1973
  *
1941
1974
  * - *Notes:*
@@ -1966,6 +1999,7 @@ type RunCommandOptions = BaseRunCommandOptions;
1966
1999
  * }
1967
2000
  * }
1968
2001
  * ```
2002
+ *
1969
2003
  * ----------------------------------------------------------------
1970
2004
  *
1971
2005
  * @example
@@ -2007,11 +2041,10 @@ type RunCommandOptions = BaseRunCommandOptions;
2007
2041
  * - If `stdio` is overridden (e.g. `"pipe"`), output will NOT be auto-forwarded.
2008
2042
  *
2009
2043
  * - **Shell execution:**
2010
- * - Defaults to {@link RunCommandOptions.shell | **`shell: true`**}.
2011
- * - Required on Windows to resolve commands like `pnpm`, `npm`, `git`, etc.
2012
- * - When `shell: false`, the command must be:
2013
- * - An absolute path, or
2014
- * - A directly executable binary.
2044
+ * - Defaults to {@link RunCommandOptions.shell | **`shell: true`**}
2045
+ * for cross-platform compatibility (especially on Windows).
2046
+ * - However, shell operators and advanced shell syntax are **NOT supported**.
2047
+ * - This utility always executes a **single command only**.
2015
2048
  *
2016
2049
  * - **Abort handling:**
2017
2050
  * - When `signal` is provided, the process will be terminated
@@ -2031,9 +2064,9 @@ type RunCommandOptions = BaseRunCommandOptions;
2031
2064
  *
2032
2065
  * - **When NOT to use this utility:**
2033
2066
  * - When you need to capture output programmatically.
2034
- * - When you need advanced shell features (`|`, `>`, `&&`).
2067
+ * - When you need advanced shell features (`|`, `>`, `&&`, piping, chaining).
2035
2068
  *
2036
- * ***In those cases, consider using `exec` or a dedicated process runner.***
2069
+ * ***In those cases, use `exec` or a dedicated shell runner instead.***
2037
2070
  */
2038
2071
  declare function runCommand(command: string, args: readonly string[]): Promise<ChildProcess>;
2039
2072
  declare function runCommand(command: string, options: RunCommandOptions): Promise<ChildProcess>;