@storm-software/config-tools 1.190.120 → 1.190.121

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 (156) hide show
  1. package/bin/config.cjs +1272 -105
  2. package/bin/config.mjs +1271 -0
  3. package/dist/_virtual/_rolldown/runtime.cjs +23 -0
  4. package/dist/config-file/get-config-file.cjs +63 -79
  5. package/dist/config-file/get-config-file.d.cts +5 -5
  6. package/dist/config-file/{get-config-file.d.ts → get-config-file.d.mts} +7 -5
  7. package/dist/config-file/get-config-file.mjs +66 -0
  8. package/dist/config-file/index.cjs +4 -1
  9. package/dist/config-file/index.d.cts +2 -3
  10. package/dist/config-file/index.d.mts +4 -0
  11. package/dist/config-file/index.mjs +5 -0
  12. package/dist/create-storm-config.cjs +105 -136
  13. package/dist/create-storm-config.d.cts +5 -5
  14. package/dist/{create-storm-config.d.ts → create-storm-config.d.mts} +7 -5
  15. package/dist/create-storm-config.mjs +113 -0
  16. package/dist/env/get-env.cjs +190 -214
  17. package/dist/env/get-env.d.cts +5 -5
  18. package/dist/env/{get-env.d.ts → get-env.d.mts} +7 -5
  19. package/dist/env/get-env.mjs +203 -0
  20. package/dist/env/index.cjs +7 -2
  21. package/dist/env/index.d.cts +3 -4
  22. package/dist/env/index.d.mts +5 -0
  23. package/dist/env/index.mjs +6 -0
  24. package/dist/env/set-env.cjs +218 -374
  25. package/dist/env/set-env.d.cts +8 -8
  26. package/dist/env/{set-env.d.ts → set-env.d.mts} +10 -8
  27. package/dist/env/set-env.mjs +231 -0
  28. package/dist/get-config.cjs +40 -29
  29. package/dist/get-config.d.cts +18 -18
  30. package/dist/{get-config.d.ts → get-config.d.mts} +20 -18
  31. package/dist/get-config.mjs +46 -0
  32. package/dist/index.cjs +98 -7
  33. package/dist/index.d.cts +27 -28
  34. package/dist/index.d.mts +29 -0
  35. package/dist/index.mjs +26 -0
  36. package/dist/logger/chalk.cjs +38 -29
  37. package/dist/logger/chalk.d.cts +18 -17
  38. package/dist/logger/chalk.d.mts +37 -0
  39. package/dist/logger/chalk.mjs +43 -0
  40. package/dist/logger/console-icons.cjs +15 -14
  41. package/dist/logger/console-icons.d.cts +5 -8
  42. package/dist/logger/console-icons.d.mts +7 -0
  43. package/dist/logger/console-icons.mjs +20 -0
  44. package/dist/logger/console.cjs +187 -183
  45. package/dist/logger/console.d.cts +25 -25
  46. package/dist/logger/{console.d.ts → console.d.mts} +27 -25
  47. package/dist/logger/console.mjs +185 -0
  48. package/dist/logger/create-logger.cjs +31 -24
  49. package/dist/logger/create-logger.d.cts +5 -6
  50. package/dist/logger/{create-logger.d.ts → create-logger.d.mts} +7 -6
  51. package/dist/logger/create-logger.mjs +34 -0
  52. package/dist/logger/format-timestamp.cjs +12 -4
  53. package/dist/logger/format-timestamp.d.cts +3 -2
  54. package/dist/logger/{format-timestamp.d.ts → format-timestamp.d.mts} +5 -2
  55. package/dist/logger/format-timestamp.mjs +16 -0
  56. package/dist/logger/get-log-level.cjs +50 -60
  57. package/dist/logger/get-log-level.d.cts +4 -5
  58. package/dist/logger/{get-log-level.d.ts → get-log-level.d.mts} +6 -5
  59. package/dist/logger/get-log-level.mjs +54 -0
  60. package/dist/logger/index.cjs +29 -7
  61. package/dist/logger/index.d.cts +8 -10
  62. package/dist/logger/index.d.mts +10 -0
  63. package/dist/logger/index.mjs +11 -0
  64. package/dist/logger/is-unicode-supported.cjs +6 -10
  65. package/dist/logger/is-unicode-supported.d.cts +3 -2
  66. package/dist/logger/is-unicode-supported.d.mts +6 -0
  67. package/dist/logger/is-unicode-supported.mjs +10 -0
  68. package/dist/types.cjs +26 -25
  69. package/dist/types.d.cts +39 -41
  70. package/dist/types.d.mts +53 -0
  71. package/dist/types.mjs +30 -0
  72. package/dist/utilities/apply-workspace-tokens.cjs +31 -70
  73. package/dist/utilities/apply-workspace-tokens.d.cts +4 -5
  74. package/dist/utilities/{apply-workspace-tokens.d.ts → apply-workspace-tokens.d.mts} +6 -5
  75. package/dist/utilities/apply-workspace-tokens.mjs +37 -0
  76. package/dist/utilities/colors.cjs +91 -74
  77. package/dist/utilities/colors.d.cts +4 -4
  78. package/dist/utilities/{colors.d.ts → colors.d.mts} +6 -4
  79. package/dist/utilities/colors.mjs +97 -0
  80. package/dist/utilities/correct-paths.cjs +166 -196
  81. package/dist/utilities/correct-paths.d.cts +4 -4
  82. package/dist/utilities/{correct-paths.d.ts → correct-paths.d.mts} +6 -4
  83. package/dist/utilities/correct-paths.mjs +190 -0
  84. package/dist/utilities/file-path-utils.cjs +42 -27
  85. package/dist/utilities/file-path-utils.d.cts +15 -14
  86. package/dist/utilities/{file-path-utils.d.ts → file-path-utils.d.mts} +17 -14
  87. package/dist/utilities/file-path-utils.mjs +48 -0
  88. package/dist/utilities/find-up.cjs +12 -18
  89. package/dist/utilities/find-up.d.cts +3 -2
  90. package/dist/utilities/{find-up.d.ts → find-up.d.mts} +5 -2
  91. package/dist/utilities/find-up.mjs +19 -0
  92. package/dist/utilities/find-workspace-root.cjs +64 -69
  93. package/dist/utilities/find-workspace-root.d.cts +3 -2
  94. package/dist/utilities/{find-workspace-root.d.ts → find-workspace-root.d.mts} +5 -2
  95. package/dist/utilities/find-workspace-root.mjs +73 -0
  96. package/dist/utilities/get-default-config.cjs +69 -91
  97. package/dist/utilities/get-default-config.d.cts +4 -4
  98. package/dist/utilities/{get-default-config.d.ts → get-default-config.d.mts} +6 -4
  99. package/dist/utilities/get-default-config.mjs +74 -0
  100. package/dist/utilities/index.cjs +49 -9
  101. package/dist/utilities/index.d.cts +10 -14
  102. package/dist/utilities/index.d.mts +12 -0
  103. package/dist/utilities/index.mjs +13 -0
  104. package/dist/utilities/process-handler.cjs +32 -47
  105. package/dist/utilities/process-handler.d.cts +4 -4
  106. package/dist/utilities/process-handler.d.mts +9 -0
  107. package/dist/utilities/process-handler.mjs +38 -0
  108. package/dist/utilities/run.cjs +62 -36
  109. package/dist/utilities/run.d.cts +5 -6
  110. package/dist/utilities/{run.d.ts → run.d.mts} +7 -6
  111. package/dist/utilities/run.mjs +64 -0
  112. package/dist/utilities/toml.cjs +27 -32
  113. package/dist/utilities/toml.d.cts +148 -147
  114. package/dist/utilities/toml.d.mts +192 -0
  115. package/dist/utilities/toml.mjs +33 -0
  116. package/package.json +105 -157
  117. package/bin/config.js +0 -108
  118. package/dist/config-file/get-config-file.js +0 -83
  119. package/dist/config-file/index.d.ts +0 -3
  120. package/dist/config-file/index.js +0 -1
  121. package/dist/create-storm-config.js +0 -147
  122. package/dist/env/get-env.js +0 -226
  123. package/dist/env/index.d.ts +0 -4
  124. package/dist/env/index.js +0 -2
  125. package/dist/env/set-env.js +0 -386
  126. package/dist/get-config.js +0 -35
  127. package/dist/index.d.ts +0 -28
  128. package/dist/index.js +0 -7
  129. package/dist/logger/chalk.d.ts +0 -34
  130. package/dist/logger/chalk.js +0 -34
  131. package/dist/logger/console-icons.d.ts +0 -8
  132. package/dist/logger/console-icons.js +0 -17
  133. package/dist/logger/console.js +0 -191
  134. package/dist/logger/create-logger.js +0 -27
  135. package/dist/logger/format-timestamp.js +0 -6
  136. package/dist/logger/get-log-level.js +0 -64
  137. package/dist/logger/index.d.ts +0 -10
  138. package/dist/logger/index.js +0 -7
  139. package/dist/logger/is-unicode-supported.d.ts +0 -3
  140. package/dist/logger/is-unicode-supported.js +0 -12
  141. package/dist/types.d.ts +0 -53
  142. package/dist/types.js +0 -28
  143. package/dist/utilities/apply-workspace-tokens.js +0 -76
  144. package/dist/utilities/colors.js +0 -81
  145. package/dist/utilities/correct-paths.js +0 -231
  146. package/dist/utilities/file-path-utils.js +0 -33
  147. package/dist/utilities/find-up.js +0 -23
  148. package/dist/utilities/find-workspace-root.js +0 -77
  149. package/dist/utilities/get-default-config.js +0 -95
  150. package/dist/utilities/index.d.ts +0 -14
  151. package/dist/utilities/index.js +0 -9
  152. package/dist/utilities/process-handler.d.ts +0 -7
  153. package/dist/utilities/process-handler.js +0 -53
  154. package/dist/utilities/run.js +0 -38
  155. package/dist/utilities/toml.d.ts +0 -189
  156. package/dist/utilities/toml.js +0 -42
@@ -1,38 +1,64 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _nodechild_process = require('node:child_process');
2
- const LARGE_BUFFER = 1024 * 1e6;
3
- const run = (config, command, cwd = _nullishCoalesce(config.workspaceRoot, () => ( process.cwd())), stdio = "inherit", env = process.env) => {
4
- return _nodechild_process.execSync.call(void 0, command, {
5
- cwd,
6
- env: {
7
- ...process.env,
8
- ...env,
9
- CLICOLOR: "true",
10
- FORCE_COLOR: "true"
11
- },
12
- windowsHide: true,
13
- stdio,
14
- maxBuffer: LARGE_BUFFER,
15
- killSignal: "SIGTERM",
16
- encoding: "utf8"
17
- });
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let node_child_process = require("node:child_process");
3
+ //#region src/utilities/run.ts
4
+ const LARGE_BUFFER = 1024e6;
5
+ /**
6
+ * Run a command line process
7
+ *
8
+ * @remarks
9
+ * A wrapper around `execSync` to run our command line processes
10
+ *
11
+ * @param config - The Storm configuration object
12
+ * @param command - The command to run
13
+ * @param cwd - The current working directory
14
+ * @param stdio - The standard input/output options
15
+ * @param env - The environment variables
16
+ * @returns The result of the command
17
+ */
18
+ const run = (config, command, cwd = config.workspaceRoot ?? process.cwd(), stdio = "inherit", env = process.env) => {
19
+ return (0, node_child_process.execSync)(command, {
20
+ cwd,
21
+ env: {
22
+ ...process.env,
23
+ ...env,
24
+ CLICOLOR: "true",
25
+ FORCE_COLOR: "true"
26
+ },
27
+ windowsHide: true,
28
+ stdio,
29
+ maxBuffer: LARGE_BUFFER,
30
+ killSignal: "SIGTERM",
31
+ encoding: "utf8"
32
+ });
18
33
  };
19
- const runAsync = (config, command, cwd = _nullishCoalesce(config.workspaceRoot, () => ( process.cwd())), env = process.env) => {
20
- return _nodechild_process.exec.call(void 0, command, {
21
- cwd,
22
- env: {
23
- ...process.env,
24
- ...env,
25
- CLICOLOR: "true",
26
- FORCE_COLOR: "true"
27
- },
28
- windowsHide: true,
29
- maxBuffer: LARGE_BUFFER,
30
- killSignal: "SIGTERM",
31
- encoding: "utf8"
32
- });
34
+ /**
35
+ * Run an asynchronous command line process
36
+ *
37
+ * @remarks
38
+ * A wrapper around `exec` to run our command line processes
39
+ *
40
+ * @param config - The Storm configuration object
41
+ * @param command - The command to run
42
+ * @param cwd - The current working directory
43
+ * @param env - The environment variables
44
+ * @returns A promise with the result of the command
45
+ */
46
+ const runAsync = (config, command, cwd = config.workspaceRoot ?? process.cwd(), env = process.env) => {
47
+ return (0, node_child_process.exec)(command, {
48
+ cwd,
49
+ env: {
50
+ ...process.env,
51
+ ...env,
52
+ CLICOLOR: "true",
53
+ FORCE_COLOR: "true"
54
+ },
55
+ windowsHide: true,
56
+ maxBuffer: LARGE_BUFFER,
57
+ killSignal: "SIGTERM",
58
+ encoding: "utf8"
59
+ });
33
60
  };
34
-
35
-
36
-
37
-
38
- exports.LARGE_BUFFER = LARGE_BUFFER; exports.run = run; exports.runAsync = runAsync;
61
+ //#endregion
62
+ exports.LARGE_BUFFER = LARGE_BUFFER;
63
+ exports.run = run;
64
+ exports.runAsync = runAsync;
@@ -1,6 +1,5 @@
1
- import * as node_child_process from 'node:child_process';
2
- import { StormWorkspaceConfig } from '@storm-software/config';
3
-
1
+ import { StormWorkspaceConfig } from "@storm-software/config";
2
+ //#region src/utilities/run.d.ts
4
3
  declare const LARGE_BUFFER: number;
5
4
  type IOType = "overlapped" | "pipe" | "ignore" | "inherit";
6
5
  type StdioOptions = IOType | Array<IOType | "ipc" | number | null | undefined>;
@@ -30,6 +29,6 @@ declare const run: (config: Partial<StormWorkspaceConfig>, command: string, cwd?
30
29
  * @param env - The environment variables
31
30
  * @returns A promise with the result of the command
32
31
  */
33
- declare const runAsync: (config: Partial<StormWorkspaceConfig>, command: string, cwd?: string, env?: NodeJS.ProcessEnv) => node_child_process.ChildProcess;
34
-
35
- export { type IOType, LARGE_BUFFER, type StdioOptions, run, runAsync };
32
+ declare const runAsync: (config: Partial<StormWorkspaceConfig>, command: string, cwd?: string, env?: NodeJS.ProcessEnv) => import("node:child_process").ChildProcess;
33
+ //#endregion
34
+ export { IOType, LARGE_BUFFER, StdioOptions, run, runAsync };
@@ -1,6 +1,7 @@
1
- import * as node_child_process from 'node:child_process';
2
- import { StormWorkspaceConfig } from '@storm-software/config';
3
-
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { StormWorkspaceConfig } from "@storm-software/config";
4
+ //#region src/utilities/run.d.ts
4
5
  declare const LARGE_BUFFER: number;
5
6
  type IOType = "overlapped" | "pipe" | "ignore" | "inherit";
6
7
  type StdioOptions = IOType | Array<IOType | "ipc" | number | null | undefined>;
@@ -30,6 +31,6 @@ declare const run: (config: Partial<StormWorkspaceConfig>, command: string, cwd?
30
31
  * @param env - The environment variables
31
32
  * @returns A promise with the result of the command
32
33
  */
33
- declare const runAsync: (config: Partial<StormWorkspaceConfig>, command: string, cwd?: string, env?: NodeJS.ProcessEnv) => node_child_process.ChildProcess;
34
-
35
- export { type IOType, LARGE_BUFFER, type StdioOptions, run, runAsync };
34
+ declare const runAsync: (config: Partial<StormWorkspaceConfig>, command: string, cwd?: string, env?: NodeJS.ProcessEnv) => import("node:child_process").ChildProcess;
35
+ //#endregion
36
+ export { IOType, LARGE_BUFFER, StdioOptions, run, runAsync };
@@ -0,0 +1,64 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { exec, execSync } from "node:child_process";
5
+ //#region src/utilities/run.ts
6
+ const LARGE_BUFFER = 1024e6;
7
+ /**
8
+ * Run a command line process
9
+ *
10
+ * @remarks
11
+ * A wrapper around `execSync` to run our command line processes
12
+ *
13
+ * @param config - The Storm configuration object
14
+ * @param command - The command to run
15
+ * @param cwd - The current working directory
16
+ * @param stdio - The standard input/output options
17
+ * @param env - The environment variables
18
+ * @returns The result of the command
19
+ */
20
+ const run = (config, command, cwd = config.workspaceRoot ?? process.cwd(), stdio = "inherit", env = process.env) => {
21
+ return execSync(command, {
22
+ cwd,
23
+ env: {
24
+ ...process.env,
25
+ ...env,
26
+ CLICOLOR: "true",
27
+ FORCE_COLOR: "true"
28
+ },
29
+ windowsHide: true,
30
+ stdio,
31
+ maxBuffer: LARGE_BUFFER,
32
+ killSignal: "SIGTERM",
33
+ encoding: "utf8"
34
+ });
35
+ };
36
+ /**
37
+ * Run an asynchronous command line process
38
+ *
39
+ * @remarks
40
+ * A wrapper around `exec` to run our command line processes
41
+ *
42
+ * @param config - The Storm configuration object
43
+ * @param command - The command to run
44
+ * @param cwd - The current working directory
45
+ * @param env - The environment variables
46
+ * @returns A promise with the result of the command
47
+ */
48
+ const runAsync = (config, command, cwd = config.workspaceRoot ?? process.cwd(), env = process.env) => {
49
+ return exec(command, {
50
+ cwd,
51
+ env: {
52
+ ...process.env,
53
+ ...env,
54
+ CLICOLOR: "true",
55
+ FORCE_COLOR: "true"
56
+ },
57
+ windowsHide: true,
58
+ maxBuffer: LARGE_BUFFER,
59
+ killSignal: "SIGTERM",
60
+ encoding: "utf8"
61
+ });
62
+ };
63
+ //#endregion
64
+ export { LARGE_BUFFER, run, runAsync };
@@ -1,42 +1,37 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _jtoml = require('@ltd/j-toml'); var _jtoml2 = _interopRequireDefault(_jtoml);
2
- var _logger = require('../logger');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
3
+ const require_logger_console = require("../logger/console.cjs");
4
+ let _ltd_j_toml = require("@ltd/j-toml");
5
+ _ltd_j_toml = require_runtime.__toESM(_ltd_j_toml, 1);
6
+ //#region src/utilities/toml.ts
3
7
  function parseCargoTomlWithTree(tree, projectRoot, projectName) {
4
- const cargoTomlString = _optionalChain([tree, 'access', _ => _.read, 'call', _2 => _2(`${projectRoot}/Cargo.toml`), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]);
5
- if (!cargoTomlString) {
6
- _logger.writeError.call(void 0, `Cannot find a Cargo.toml file in the ${projectName}`);
7
- throw new Error();
8
- }
9
- return parseCargoToml(cargoTomlString);
8
+ const cargoTomlString = tree.read(`${projectRoot}/Cargo.toml`)?.toString();
9
+ if (!cargoTomlString) {
10
+ require_logger_console.writeError(`Cannot find a Cargo.toml file in the ${projectName}`);
11
+ throw new Error();
12
+ }
13
+ return parseCargoToml(cargoTomlString);
10
14
  }
11
15
  function parseCargoToml(cargoString) {
12
- if (!cargoString) {
13
- throw new Error("Cargo.toml is empty");
14
- }
15
- return _jtoml2.default.parse(cargoString, {
16
- x: { comment: true }
17
- });
16
+ if (!cargoString) throw new Error("Cargo.toml is empty");
17
+ return _ltd_j_toml.default.parse(cargoString, { x: { comment: true } });
18
18
  }
19
19
  function stringifyCargoToml(cargoToml) {
20
- const tomlString = _jtoml2.default.stringify(cargoToml, {
21
- newlineAround: "section"
22
- });
23
- if (Array.isArray(tomlString)) {
24
- return tomlString.join("\n");
25
- }
26
- return tomlString;
20
+ const tomlString = _ltd_j_toml.default.stringify(cargoToml, { newlineAround: "section" });
21
+ if (Array.isArray(tomlString)) return tomlString.join("\n");
22
+ return tomlString;
27
23
  }
28
24
  function modifyCargoTable(toml, section, key, value) {
29
- toml[section] ??= _jtoml2.default.Section({});
30
- toml[section][key] = typeof value === "object" && !Array.isArray(value) ? _jtoml2.default.inline(value) : typeof value === "function" ? value() : value;
25
+ toml[section] ??= _ltd_j_toml.default.Section({});
26
+ toml[section][key] = typeof value === "object" && !Array.isArray(value) ? _ltd_j_toml.default.inline(value) : typeof value === "function" ? value() : value;
31
27
  }
32
28
  function modifyCargoNestedTable(toml, section, key, value) {
33
- toml[section] ??= {};
34
- toml[section][key] = _jtoml2.default.Section(value);
29
+ toml[section] ??= {};
30
+ toml[section][key] = _ltd_j_toml.default.Section(value);
35
31
  }
36
-
37
-
38
-
39
-
40
-
41
-
42
- exports.modifyCargoNestedTable = modifyCargoNestedTable; exports.modifyCargoTable = modifyCargoTable; exports.parseCargoToml = parseCargoToml; exports.parseCargoTomlWithTree = parseCargoTomlWithTree; exports.stringifyCargoToml = stringifyCargoToml;
32
+ //#endregion
33
+ exports.modifyCargoNestedTable = modifyCargoNestedTable;
34
+ exports.modifyCargoTable = modifyCargoTable;
35
+ exports.parseCargoToml = parseCargoToml;
36
+ exports.parseCargoTomlWithTree = parseCargoTomlWithTree;
37
+ exports.stringifyCargoToml = stringifyCargoToml;
@@ -1,189 +1,190 @@
1
+ //#region src/utilities/toml.d.ts
1
2
  interface CargoToml {
2
- workspace?: {
3
- members: string[];
4
- };
5
- package: any;
6
- dependencies?: Record<string, string | {
7
- version: string;
8
- features?: string[];
9
- optional?: boolean;
10
- }>;
11
- "dev-dependencies"?: Record<string, string | {
12
- version: string;
13
- features: string[];
14
- }>;
15
- [key: string]: any;
3
+ workspace?: {
4
+ members: string[];
5
+ };
6
+ package: any;
7
+ dependencies?: Record<string, string | {
8
+ version: string;
9
+ features?: string[];
10
+ optional?: boolean;
11
+ }>;
12
+ "dev-dependencies"?: Record<string, string | {
13
+ version: string;
14
+ features: string[];
15
+ }>;
16
+ [key: string]: any;
16
17
  }
17
18
  interface CargoMetadata {
18
- packages: Package[];
19
- workspace_members: string[];
20
- resolve: Resolve;
21
- target_directory: string;
22
- version: number;
23
- workspace_root: string;
24
- metadata: Metadata2;
19
+ packages: Package[];
20
+ workspace_members: string[];
21
+ resolve: Resolve;
22
+ target_directory: string;
23
+ version: number;
24
+ workspace_root: string;
25
+ metadata: Metadata2;
25
26
  }
26
27
  interface Package {
27
- name: string;
28
- version: string;
29
- id: string;
30
- license: string;
31
- license_file: string;
32
- description: string;
33
- source: any;
34
- dependencies: Dependency[];
35
- targets: Target[];
36
- features: Features;
37
- manifest_path: string;
38
- metadata: Metadata;
39
- /**
40
- * From the docs:
41
- * "List of registries to which this package may be published.
42
- * Publishing is unrestricted if null, and forbidden if an empty array."
43
- *
44
- * Additional observation:
45
- * false can be used by the end user but it will be converted to an empty
46
- * array in the cargo metadata output.
47
- */
48
- publish?: string[] | boolean | null;
49
- authors: string[];
50
- categories: string[];
51
- default_run: any;
52
- rust_version: string;
53
- keywords: string[];
54
- readme: string;
55
- repository: string;
56
- homepage: string;
57
- documentation: string;
58
- edition: string;
59
- links: any;
28
+ name: string;
29
+ version: string;
30
+ id: string;
31
+ license: string;
32
+ license_file: string;
33
+ description: string;
34
+ source: any;
35
+ dependencies: Dependency[];
36
+ targets: Target[];
37
+ features: Features;
38
+ manifest_path: string;
39
+ metadata: Metadata;
40
+ /**
41
+ * From the docs:
42
+ * "List of registries to which this package may be published.
43
+ * Publishing is unrestricted if null, and forbidden if an empty array."
44
+ *
45
+ * Additional observation:
46
+ * false can be used by the end user but it will be converted to an empty
47
+ * array in the cargo metadata output.
48
+ */
49
+ publish?: string[] | boolean | null;
50
+ authors: string[];
51
+ categories: string[];
52
+ default_run: any;
53
+ rust_version: string;
54
+ keywords: string[];
55
+ readme: string;
56
+ repository: string;
57
+ homepage: string;
58
+ documentation: string;
59
+ edition: string;
60
+ links: any;
60
61
  }
61
62
  interface Dependency {
62
- name: string;
63
- source: string;
64
- req: string;
65
- kind: any;
66
- rename: any;
67
- optional: boolean;
68
- uses_default_features: boolean;
69
- features: any[];
70
- target: string;
71
- path: string;
72
- registry: any;
73
- workspace: boolean;
63
+ name: string;
64
+ source: string;
65
+ req: string;
66
+ kind: any;
67
+ rename: any;
68
+ optional: boolean;
69
+ uses_default_features: boolean;
70
+ features: any[];
71
+ target: string;
72
+ path: string;
73
+ registry: any;
74
+ workspace: boolean;
74
75
  }
75
76
  interface Target {
76
- kind: string[];
77
- crate_types: string[];
78
- name: string;
79
- src_path: string;
80
- edition: string;
81
- "required-features": string[];
82
- doc: boolean;
83
- doctest: boolean;
84
- test: boolean;
77
+ kind: string[];
78
+ crate_types: string[];
79
+ name: string;
80
+ src_path: string;
81
+ edition: string;
82
+ "required-features": string[];
83
+ doc: boolean;
84
+ doctest: boolean;
85
+ test: boolean;
85
86
  }
86
87
  interface Features {
87
- default: string[];
88
- feat1: any[];
89
- feat2: any[];
88
+ default: string[];
89
+ feat1: any[];
90
+ feat2: any[];
90
91
  }
91
92
  interface Metadata {
92
- docs: Docs;
93
+ docs: Docs;
93
94
  }
94
95
  interface Docs {
95
- rs: Rs;
96
+ rs: Rs;
96
97
  }
97
98
  interface Rs {
98
- "all-features": boolean;
99
+ "all-features": boolean;
99
100
  }
100
101
  interface Resolve {
101
- nodes: Node[];
102
- root: string;
102
+ nodes: Node[];
103
+ root: string;
103
104
  }
104
105
  interface Node {
105
- id: string;
106
- dependencies: string[];
107
- deps: Dep[];
108
- features: string[];
106
+ id: string;
107
+ dependencies: string[];
108
+ deps: Dep[];
109
+ features: string[];
109
110
  }
110
111
  interface Dep {
111
- name: string;
112
- pkg: string;
113
- dep_kinds: DepKind[];
112
+ name: string;
113
+ pkg: string;
114
+ dep_kinds: DepKind[];
114
115
  }
115
116
  interface DepKind {
116
- kind: any;
117
- target: string;
117
+ kind: any;
118
+ target: string;
118
119
  }
119
120
  interface Metadata2 {
120
- docs: Docs2;
121
+ docs: Docs2;
121
122
  }
122
123
  interface Docs2 {
123
- rs: Rs2;
124
+ rs: Rs2;
124
125
  }
125
126
  interface Rs2 {
126
- "all-features": boolean;
127
+ "all-features": boolean;
127
128
  }
128
129
  /**
129
130
  * Virtual file system tree.
130
131
  */
131
132
  interface Tree {
132
- /**
133
- * Root of the workspace. All paths are relative to this.
134
- */
135
- root: string;
136
- /**
137
- * Read the contents of a file.
138
- * @param filePath A path to a file.
139
- */
140
- read(filePath: string): Buffer | null;
141
- /**
142
- * Read the contents of a file as string.
143
- * @param filePath A path to a file.
144
- * @param encoding the encoding for the result
145
- */
146
- read(filePath: string, encoding: BufferEncoding): string | null;
147
- /**
148
- * Update the contents of a file or create a new file.
149
- */
150
- write(filePath: string, content: Buffer | string, options?: any): void;
151
- /**
152
- * Check if a file exists.
153
- */
154
- exists(filePath: string): boolean;
155
- /**
156
- * Delete the file.
157
- */
158
- delete(filePath: string): void;
159
- /**
160
- * Rename the file or the folder.
161
- */
162
- rename(from: string, to: string): void;
163
- /**
164
- * Check if this is a file or not.
165
- */
166
- isFile(filePath: string): boolean;
167
- /**
168
- * Returns the list of children of a folder.
169
- */
170
- children(dirPath: string): string[];
171
- /**
172
- * Returns the list of currently recorded changes.
173
- */
174
- listChanges(): any[];
175
- /**
176
- * Changes permissions of a file.
177
- * @param filePath A path to a file.
178
- * @param mode The permission to be granted on the file, given as a string (e.g `755`) or octal integer (e.g `0o755`).
179
- * See https://nodejs.org/api/fs.html#fs_file_modes.
180
- */
181
- changePermissions(filePath: string, mode: string): void;
133
+ /**
134
+ * Root of the workspace. All paths are relative to this.
135
+ */
136
+ root: string;
137
+ /**
138
+ * Read the contents of a file.
139
+ * @param filePath A path to a file.
140
+ */
141
+ read(filePath: string): Buffer | null;
142
+ /**
143
+ * Read the contents of a file as string.
144
+ * @param filePath A path to a file.
145
+ * @param encoding the encoding for the result
146
+ */
147
+ read(filePath: string, encoding: BufferEncoding): string | null;
148
+ /**
149
+ * Update the contents of a file or create a new file.
150
+ */
151
+ write(filePath: string, content: Buffer | string, options?: any): void;
152
+ /**
153
+ * Check if a file exists.
154
+ */
155
+ exists(filePath: string): boolean;
156
+ /**
157
+ * Delete the file.
158
+ */
159
+ delete(filePath: string): void;
160
+ /**
161
+ * Rename the file or the folder.
162
+ */
163
+ rename(from: string, to: string): void;
164
+ /**
165
+ * Check if this is a file or not.
166
+ */
167
+ isFile(filePath: string): boolean;
168
+ /**
169
+ * Returns the list of children of a folder.
170
+ */
171
+ children(dirPath: string): string[];
172
+ /**
173
+ * Returns the list of currently recorded changes.
174
+ */
175
+ listChanges(): any[];
176
+ /**
177
+ * Changes permissions of a file.
178
+ * @param filePath A path to a file.
179
+ * @param mode The permission to be granted on the file, given as a string (e.g `755`) or octal integer (e.g `0o755`).
180
+ * See https://nodejs.org/api/fs.html#fs_file_modes.
181
+ */
182
+ changePermissions(filePath: string, mode: string): void;
182
183
  }
183
184
  declare function parseCargoTomlWithTree(tree: Tree, projectRoot: string, projectName: string): CargoToml;
184
185
  declare function parseCargoToml(cargoString?: string): CargoToml;
185
186
  declare function stringifyCargoToml(cargoToml: CargoToml): string;
186
187
  declare function modifyCargoTable(toml: CargoToml, section: string, key: string, value: string | object | any[] | (() => any)): void;
187
188
  declare function modifyCargoNestedTable(toml: CargoToml, section: string, key: string, value: object): void;
188
-
189
- export { type CargoMetadata, type CargoToml, type Dep, type DepKind, type Dependency, type Docs, type Docs2, type Features, type Metadata, type Metadata2, type Node, type Package, type Resolve, type Rs, type Rs2, type Target, type Tree, modifyCargoNestedTable, modifyCargoTable, parseCargoToml, parseCargoTomlWithTree, stringifyCargoToml };
189
+ //#endregion
190
+ export { CargoMetadata, CargoToml, Dep, DepKind, Dependency, Docs, Docs2, Features, Metadata, Metadata2, Node, Package, Resolve, Rs, Rs2, Target, Tree, modifyCargoNestedTable, modifyCargoTable, parseCargoToml, parseCargoTomlWithTree, stringifyCargoToml };