@storm-software/config-tools 1.190.119 → 1.190.120

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 (114) hide show
  1. package/README.md +1 -1
  2. package/bin/config.cjs +20 -1532
  3. package/bin/config.js +19 -1527
  4. package/dist/config-file/get-config-file.cjs +80 -25
  5. package/dist/config-file/get-config-file.js +79 -24
  6. package/dist/config-file/index.cjs +1 -29
  7. package/dist/config-file/index.js +1 -29
  8. package/dist/create-storm-config.cjs +138 -26
  9. package/dist/create-storm-config.js +140 -28
  10. package/dist/env/get-env.cjs +221 -6
  11. package/dist/env/get-env.js +221 -6
  12. package/dist/env/index.cjs +2 -18
  13. package/dist/env/index.js +2 -18
  14. package/dist/env/set-env.cjs +383 -8
  15. package/dist/env/set-env.js +382 -7
  16. package/dist/get-config.cjs +28 -27
  17. package/dist/get-config.js +29 -28
  18. package/dist/index.cjs +7 -201
  19. package/dist/index.js +7 -201
  20. package/dist/logger/chalk.cjs +32 -4
  21. package/dist/logger/chalk.js +31 -3
  22. package/dist/logger/console-icons.cjs +15 -6
  23. package/dist/logger/console-icons.js +14 -5
  24. package/dist/logger/console.cjs +191 -37
  25. package/dist/logger/console.js +176 -22
  26. package/dist/logger/create-logger.cjs +25 -12
  27. package/dist/logger/create-logger.js +24 -11
  28. package/dist/logger/format-timestamp.cjs +4 -4
  29. package/dist/logger/format-timestamp.js +3 -3
  30. package/dist/logger/get-log-level.cjs +60 -7
  31. package/dist/logger/get-log-level.js +59 -6
  32. package/dist/logger/index.cjs +7 -61
  33. package/dist/logger/index.js +7 -61
  34. package/dist/logger/is-unicode-supported.cjs +10 -4
  35. package/dist/logger/is-unicode-supported.js +9 -3
  36. package/dist/types.cjs +25 -5
  37. package/dist/types.js +24 -4
  38. package/dist/utilities/apply-workspace-tokens.cjs +72 -9
  39. package/dist/utilities/apply-workspace-tokens.js +71 -8
  40. package/dist/utilities/colors.cjs +76 -7
  41. package/dist/utilities/colors.js +75 -6
  42. package/dist/utilities/correct-paths.cjs +231 -32
  43. package/dist/utilities/correct-paths.js +215 -16
  44. package/dist/utilities/file-path-utils.cjs +29 -7
  45. package/dist/utilities/file-path-utils.js +28 -6
  46. package/dist/utilities/find-up.cjs +21 -4
  47. package/dist/utilities/find-up.js +20 -3
  48. package/dist/utilities/find-workspace-root.cjs +74 -7
  49. package/dist/utilities/find-workspace-root.js +73 -6
  50. package/dist/utilities/get-default-config.cjs +90 -6
  51. package/dist/utilities/get-default-config.js +90 -6
  52. package/dist/utilities/index.cjs +9 -109
  53. package/dist/utilities/index.js +9 -109
  54. package/dist/utilities/process-handler.cjs +46 -11
  55. package/dist/utilities/process-handler.js +47 -12
  56. package/dist/utilities/run.cjs +34 -6
  57. package/dist/utilities/run.js +33 -5
  58. package/dist/utilities/toml.cjs +42 -24
  59. package/dist/utilities/toml.js +35 -17
  60. package/package.json +4 -4
  61. package/dist/chunk-24B36RDB.cjs +0 -81
  62. package/dist/chunk-27N3QEX5.js +0 -40
  63. package/dist/chunk-2AVLCXLT.js +0 -0
  64. package/dist/chunk-2RLMTBVZ.js +0 -233
  65. package/dist/chunk-2WBD2G3E.cjs +0 -38
  66. package/dist/chunk-3COHMHPU.cjs +0 -1
  67. package/dist/chunk-4Q45WJYQ.js +0 -165
  68. package/dist/chunk-5C7PIENF.js +0 -92
  69. package/dist/chunk-5J2SS4QU.js +0 -83
  70. package/dist/chunk-65SWKEHV.cjs +0 -1
  71. package/dist/chunk-6Y623TCS.cjs +0 -40
  72. package/dist/chunk-7PV6L7I7.cjs +0 -1
  73. package/dist/chunk-7QBTVNMR.cjs +0 -30
  74. package/dist/chunk-BDATZ3UB.cjs +0 -233
  75. package/dist/chunk-BZRTSWH4.cjs +0 -395
  76. package/dist/chunk-D3FRXXDE.js +0 -947
  77. package/dist/chunk-DTGT4OI3.cjs +0 -14
  78. package/dist/chunk-EC2KPWRG.cjs +0 -24
  79. package/dist/chunk-EENQN6N2.js +0 -40
  80. package/dist/chunk-ENI4UUSK.cjs +0 -35
  81. package/dist/chunk-FJNXECWU.js +0 -395
  82. package/dist/chunk-FMDVBSP6.cjs +0 -83
  83. package/dist/chunk-G2MK47WL.js +0 -14
  84. package/dist/chunk-HFS7WJVW.js +0 -81
  85. package/dist/chunk-HVVJHTFS.js +0 -36
  86. package/dist/chunk-IWD6YQKX.cjs +0 -1
  87. package/dist/chunk-IWQRXQ4N.cjs +0 -84
  88. package/dist/chunk-JK4TT5IV.js +0 -35
  89. package/dist/chunk-JWLDCEBZ.cjs +0 -70
  90. package/dist/chunk-JZAYHDV3.js +0 -8
  91. package/dist/chunk-KSMN3HSC.js +0 -38
  92. package/dist/chunk-L6UNTUC4.js +0 -0
  93. package/dist/chunk-LOY6ICHZ.cjs +0 -36
  94. package/dist/chunk-MBG2FTBL.cjs +0 -47
  95. package/dist/chunk-MQG74XF7.js +0 -102
  96. package/dist/chunk-MSAQEGBK.cjs +0 -92
  97. package/dist/chunk-NJFLUTGH.cjs +0 -25
  98. package/dist/chunk-PCYB64MB.cjs +0 -40
  99. package/dist/chunk-RALMUN5C.js +0 -30
  100. package/dist/chunk-RRKB32OH.js +0 -0
  101. package/dist/chunk-RUKM6FCF.js +0 -25
  102. package/dist/chunk-SIW7AXUG.js +0 -56
  103. package/dist/chunk-SLICWTO2.cjs +0 -165
  104. package/dist/chunk-SO3FWVXC.js +0 -84
  105. package/dist/chunk-SXPH7ILL.js +0 -70
  106. package/dist/chunk-T7YISGRS.cjs +0 -102
  107. package/dist/chunk-TZZRLM5J.cjs +0 -947
  108. package/dist/chunk-UJ77IBHD.cjs +0 -233
  109. package/dist/chunk-UKGRDKIH.js +0 -0
  110. package/dist/chunk-V3GMJ4TX.js +0 -233
  111. package/dist/chunk-WQJYIPSL.cjs +0 -8
  112. package/dist/chunk-YBVOKYAM.cjs +0 -56
  113. package/dist/chunk-YX4736HU.js +0 -47
  114. package/dist/chunk-ZFNAUMQS.js +0 -24
@@ -1,10 +1,77 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _correctpaths = require('./correct-paths');
2
+ var _findup = require('./find-up');
3
+ const rootFiles = [
4
+ "storm-workspace.json",
5
+ "storm-workspace.yaml",
6
+ "storm-workspace.yml",
7
+ "storm-workspace.js",
8
+ "storm-workspace.ts",
9
+ ".storm-workspace.json",
10
+ ".storm-workspace.yaml",
11
+ ".storm-workspace.yml",
12
+ ".storm-workspace.js",
13
+ ".storm-workspace.ts",
14
+ "lerna.json",
15
+ "nx.json",
16
+ "turbo.json",
17
+ "npm-workspace.json",
18
+ "yarn-workspace.json",
19
+ "pnpm-workspace.json",
20
+ "npm-workspace.yaml",
21
+ "yarn-workspace.yaml",
22
+ "pnpm-workspace.yaml",
23
+ "npm-workspace.yml",
24
+ "yarn-workspace.yml",
25
+ "pnpm-workspace.yml",
26
+ "npm-lock.json",
27
+ "yarn-lock.json",
28
+ "pnpm-lock.json",
29
+ "npm-lock.yaml",
30
+ "yarn-lock.yaml",
31
+ "pnpm-lock.yaml",
32
+ "npm-lock.yml",
33
+ "yarn-lock.yml",
34
+ "pnpm-lock.yml",
35
+ "bun.lockb",
36
+ "bun.lock",
37
+ "bunfig.toml"
38
+ ];
39
+ const rootDirectories = [
40
+ ".storm-workspace",
41
+ ".nx",
42
+ ".git",
43
+ ".github",
44
+ ".vscode",
45
+ ".verdaccio"
46
+ ];
47
+ function findWorkspaceRootSafe(pathInsideMonorepo) {
48
+ if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
49
+ return _correctpaths.correctPaths.call(void 0,
50
+ _nullishCoalesce(process.env.STORM_WORKSPACE_ROOT, () => ( process.env.NX_WORKSPACE_ROOT_PATH))
51
+ );
52
+ }
53
+ return _correctpaths.correctPaths.call(void 0,
54
+ _findup.findFolderUp.call(void 0,
55
+ _nullishCoalesce(pathInsideMonorepo, () => ( process.cwd())),
56
+ rootFiles,
57
+ rootDirectories
58
+ )
59
+ );
60
+ }
61
+ function findWorkspaceRoot(pathInsideMonorepo) {
62
+ const result = findWorkspaceRootSafe(pathInsideMonorepo);
63
+ if (!result) {
64
+ throw new Error(
65
+ `Cannot find workspace root upwards from known path. Files search list includes:
66
+ ${rootFiles.join(
67
+ "\n"
68
+ )}
69
+ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
70
+ );
71
+ }
72
+ return result;
73
+ }
2
74
 
3
75
 
4
- var _chunkIWQRXQ4Ncjs = require('../chunk-IWQRXQ4N.cjs');
5
- require('../chunk-NJFLUTGH.cjs');
6
- require('../chunk-BDATZ3UB.cjs');
7
76
 
8
-
9
-
10
- exports.findWorkspaceRoot = _chunkIWQRXQ4Ncjs.findWorkspaceRoot; exports.findWorkspaceRootSafe = _chunkIWQRXQ4Ncjs.findWorkspaceRootSafe;
77
+ exports.findWorkspaceRoot = findWorkspaceRoot; exports.findWorkspaceRootSafe = findWorkspaceRootSafe;
@@ -1,9 +1,76 @@
1
- import {
2
- findWorkspaceRoot,
3
- findWorkspaceRootSafe
4
- } from "../chunk-SO3FWVXC.js";
5
- import "../chunk-RUKM6FCF.js";
6
- import "../chunk-V3GMJ4TX.js";
1
+ import { correctPaths } from "./correct-paths";
2
+ import { findFolderUp } from "./find-up";
3
+ const rootFiles = [
4
+ "storm-workspace.json",
5
+ "storm-workspace.yaml",
6
+ "storm-workspace.yml",
7
+ "storm-workspace.js",
8
+ "storm-workspace.ts",
9
+ ".storm-workspace.json",
10
+ ".storm-workspace.yaml",
11
+ ".storm-workspace.yml",
12
+ ".storm-workspace.js",
13
+ ".storm-workspace.ts",
14
+ "lerna.json",
15
+ "nx.json",
16
+ "turbo.json",
17
+ "npm-workspace.json",
18
+ "yarn-workspace.json",
19
+ "pnpm-workspace.json",
20
+ "npm-workspace.yaml",
21
+ "yarn-workspace.yaml",
22
+ "pnpm-workspace.yaml",
23
+ "npm-workspace.yml",
24
+ "yarn-workspace.yml",
25
+ "pnpm-workspace.yml",
26
+ "npm-lock.json",
27
+ "yarn-lock.json",
28
+ "pnpm-lock.json",
29
+ "npm-lock.yaml",
30
+ "yarn-lock.yaml",
31
+ "pnpm-lock.yaml",
32
+ "npm-lock.yml",
33
+ "yarn-lock.yml",
34
+ "pnpm-lock.yml",
35
+ "bun.lockb",
36
+ "bun.lock",
37
+ "bunfig.toml"
38
+ ];
39
+ const rootDirectories = [
40
+ ".storm-workspace",
41
+ ".nx",
42
+ ".git",
43
+ ".github",
44
+ ".vscode",
45
+ ".verdaccio"
46
+ ];
47
+ function findWorkspaceRootSafe(pathInsideMonorepo) {
48
+ if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
49
+ return correctPaths(
50
+ process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
51
+ );
52
+ }
53
+ return correctPaths(
54
+ findFolderUp(
55
+ pathInsideMonorepo ?? process.cwd(),
56
+ rootFiles,
57
+ rootDirectories
58
+ )
59
+ );
60
+ }
61
+ function findWorkspaceRoot(pathInsideMonorepo) {
62
+ const result = findWorkspaceRootSafe(pathInsideMonorepo);
63
+ if (!result) {
64
+ throw new Error(
65
+ `Cannot find workspace root upwards from known path. Files search list includes:
66
+ ${rootFiles.join(
67
+ "\n"
68
+ )}
69
+ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
70
+ );
71
+ }
72
+ return result;
73
+ }
7
74
  export {
8
75
  findWorkspaceRoot,
9
76
  findWorkspaceRootSafe
@@ -1,11 +1,95 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }
2
2
 
3
3
 
4
- var _chunkT7YISGRScjs = require('../chunk-T7YISGRS.cjs');
5
- require('../chunk-IWQRXQ4N.cjs');
6
- require('../chunk-NJFLUTGH.cjs');
7
- require('../chunk-BDATZ3UB.cjs');
4
+ var _config = require('@storm-software/config');
5
+ var _nodefs = require('node:fs');
6
+ var _promises = require('node:fs/promises');
7
+ var _nodepath = require('node:path');
8
+ var _correctpaths = require('./correct-paths');
9
+ var _findworkspaceroot = require('./find-workspace-root');
10
+ async function getPackageJsonConfig(root) {
11
+ let license = _config.STORM_DEFAULT_LICENSE;
12
+ let homepage = void 0;
13
+ let support = void 0;
14
+ let name = void 0;
15
+ let namespace = void 0;
16
+ let repository = void 0;
17
+ const workspaceRoot = _findworkspaceroot.findWorkspaceRoot.call(void 0, root);
18
+ if (_nodefs.existsSync.call(void 0, _nodepath.join.call(void 0, workspaceRoot, "package.json"))) {
19
+ const file = await _promises.readFile.call(void 0,
20
+ _correctpaths.joinPaths.call(void 0, workspaceRoot, "package.json"),
21
+ "utf8"
22
+ );
23
+ if (file) {
24
+ const packageJson = JSON.parse(file);
25
+ if (packageJson.name) {
26
+ name = packageJson.name;
27
+ }
28
+ if (packageJson.namespace) {
29
+ namespace = packageJson.namespace;
30
+ }
31
+ if (packageJson.repository) {
32
+ if (typeof packageJson.repository === "string") {
33
+ repository = packageJson.repository;
34
+ } else if (packageJson.repository.url) {
35
+ repository = packageJson.repository.url;
36
+ }
37
+ }
38
+ if (packageJson.license) {
39
+ license = packageJson.license;
40
+ }
41
+ if (packageJson.homepage) {
42
+ homepage = packageJson.homepage;
43
+ }
44
+ if (packageJson.bugs) {
45
+ if (typeof packageJson.bugs === "string") {
46
+ support = packageJson.bugs;
47
+ } else if (packageJson.bugs.url) {
48
+ support = packageJson.bugs.url;
49
+ }
50
+ }
51
+ }
52
+ }
53
+ return {
54
+ workspaceRoot,
55
+ name,
56
+ namespace,
57
+ repository,
58
+ license,
59
+ homepage,
60
+ support
61
+ };
62
+ }
63
+ function applyDefaultConfig(config) {
64
+ if (!config.support && config.contact) {
65
+ config.support = config.contact;
66
+ }
67
+ if (!config.contact && config.support) {
68
+ config.contact = config.support;
69
+ }
70
+ if (config.homepage) {
71
+ if (!config.docs) {
72
+ config.docs = `${config.homepage}/docs`;
73
+ }
74
+ if (!config.license) {
75
+ config.license = `${config.homepage}/license`;
76
+ }
77
+ if (!config.support) {
78
+ config.support = `${config.homepage}/support`;
79
+ }
80
+ if (!config.contact) {
81
+ config.contact = `${config.homepage}/contact`;
82
+ }
83
+ if (!_optionalChain([config, 'access', _ => _.error, 'optionalAccess', _2 => _2.codesFile]) || !_optionalChain([config, 'optionalAccess', _3 => _3.error, 'optionalAccess', _4 => _4.url])) {
84
+ config.error ??= { codesFile: _config.STORM_DEFAULT_ERROR_CODES_FILE };
85
+ if (config.homepage) {
86
+ config.error.url ??= `${config.homepage}/errors`;
87
+ }
88
+ }
89
+ }
90
+ return config;
91
+ }
8
92
 
9
93
 
10
94
 
11
- exports.applyDefaultConfig = _chunkT7YISGRScjs.applyDefaultConfig; exports.getPackageJsonConfig = _chunkT7YISGRScjs.getPackageJsonConfig;
95
+ exports.applyDefaultConfig = applyDefaultConfig; exports.getPackageJsonConfig = getPackageJsonConfig;
@@ -1,10 +1,94 @@
1
1
  import {
2
- applyDefaultConfig,
3
- getPackageJsonConfig
4
- } from "../chunk-MQG74XF7.js";
5
- import "../chunk-SO3FWVXC.js";
6
- import "../chunk-RUKM6FCF.js";
7
- import "../chunk-V3GMJ4TX.js";
2
+ STORM_DEFAULT_ERROR_CODES_FILE,
3
+ STORM_DEFAULT_LICENSE
4
+ } from "@storm-software/config";
5
+ import { existsSync } from "node:fs";
6
+ import { readFile } from "node:fs/promises";
7
+ import { join } from "node:path";
8
+ import { joinPaths } from "./correct-paths";
9
+ import { findWorkspaceRoot } from "./find-workspace-root";
10
+ async function getPackageJsonConfig(root) {
11
+ let license = STORM_DEFAULT_LICENSE;
12
+ let homepage = void 0;
13
+ let support = void 0;
14
+ let name = void 0;
15
+ let namespace = void 0;
16
+ let repository = void 0;
17
+ const workspaceRoot = findWorkspaceRoot(root);
18
+ if (existsSync(join(workspaceRoot, "package.json"))) {
19
+ const file = await readFile(
20
+ joinPaths(workspaceRoot, "package.json"),
21
+ "utf8"
22
+ );
23
+ if (file) {
24
+ const packageJson = JSON.parse(file);
25
+ if (packageJson.name) {
26
+ name = packageJson.name;
27
+ }
28
+ if (packageJson.namespace) {
29
+ namespace = packageJson.namespace;
30
+ }
31
+ if (packageJson.repository) {
32
+ if (typeof packageJson.repository === "string") {
33
+ repository = packageJson.repository;
34
+ } else if (packageJson.repository.url) {
35
+ repository = packageJson.repository.url;
36
+ }
37
+ }
38
+ if (packageJson.license) {
39
+ license = packageJson.license;
40
+ }
41
+ if (packageJson.homepage) {
42
+ homepage = packageJson.homepage;
43
+ }
44
+ if (packageJson.bugs) {
45
+ if (typeof packageJson.bugs === "string") {
46
+ support = packageJson.bugs;
47
+ } else if (packageJson.bugs.url) {
48
+ support = packageJson.bugs.url;
49
+ }
50
+ }
51
+ }
52
+ }
53
+ return {
54
+ workspaceRoot,
55
+ name,
56
+ namespace,
57
+ repository,
58
+ license,
59
+ homepage,
60
+ support
61
+ };
62
+ }
63
+ function applyDefaultConfig(config) {
64
+ if (!config.support && config.contact) {
65
+ config.support = config.contact;
66
+ }
67
+ if (!config.contact && config.support) {
68
+ config.contact = config.support;
69
+ }
70
+ if (config.homepage) {
71
+ if (!config.docs) {
72
+ config.docs = `${config.homepage}/docs`;
73
+ }
74
+ if (!config.license) {
75
+ config.license = `${config.homepage}/license`;
76
+ }
77
+ if (!config.support) {
78
+ config.support = `${config.homepage}/support`;
79
+ }
80
+ if (!config.contact) {
81
+ config.contact = `${config.homepage}/contact`;
82
+ }
83
+ if (!config.error?.codesFile || !config?.error?.url) {
84
+ config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
85
+ if (config.homepage) {
86
+ config.error.url ??= `${config.homepage}/errors`;
87
+ }
88
+ }
89
+ }
90
+ return config;
91
+ }
8
92
  export {
9
93
  applyDefaultConfig,
10
94
  getPackageJsonConfig
@@ -1,109 +1,9 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-3COHMHPU.cjs');
2
-
3
-
4
-
5
-
6
- var _chunkYBVOKYAMcjs = require('../chunk-YBVOKYAM.cjs');
7
-
8
-
9
-
10
-
11
- var _chunk6Y623TCScjs = require('../chunk-6Y623TCS.cjs');
12
-
13
-
14
-
15
-
16
-
17
-
18
- var _chunkMBG2FTBLcjs = require('../chunk-MBG2FTBL.cjs');
19
-
20
-
21
-
22
-
23
- var _chunk24B36RDBcjs = require('../chunk-24B36RDB.cjs');
24
-
25
-
26
-
27
-
28
- var _chunk2WBD2G3Ecjs = require('../chunk-2WBD2G3E.cjs');
29
-
30
-
31
-
32
- var _chunkT7YISGRScjs = require('../chunk-T7YISGRS.cjs');
33
-
34
-
35
-
36
- var _chunkIWQRXQ4Ncjs = require('../chunk-IWQRXQ4N.cjs');
37
- require('../chunk-NJFLUTGH.cjs');
38
- require('../chunk-7PV6L7I7.cjs');
39
- require('../chunk-ENI4UUSK.cjs');
40
- require('../chunk-TZZRLM5J.cjs');
41
-
42
-
43
-
44
-
45
-
46
- var _chunkFMDVBSP6cjs = require('../chunk-FMDVBSP6.cjs');
47
- require('../chunk-LOY6ICHZ.cjs');
48
- require('../chunk-EC2KPWRG.cjs');
49
- require('../chunk-DTGT4OI3.cjs');
50
- require('../chunk-WQJYIPSL.cjs');
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
- var _chunkBDATZ3UBcjs = require('../chunk-BDATZ3UB.cjs');
67
- require('../chunk-JWLDCEBZ.cjs');
68
- require('../chunk-7QBTVNMR.cjs');
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
- exports.DEFAULT_COLOR_CONFIG = _chunkFMDVBSP6cjs.DEFAULT_COLOR_CONFIG; exports.LARGE_BUFFER = _chunk6Y623TCScjs.LARGE_BUFFER; exports.applyDefaultConfig = _chunkT7YISGRScjs.applyDefaultConfig; exports.applyWorkspaceBaseTokens = _chunk24B36RDBcjs.applyWorkspaceBaseTokens; exports.applyWorkspaceProjectTokens = _chunk24B36RDBcjs.applyWorkspaceProjectTokens; exports.applyWorkspaceTokens = _chunk24B36RDBcjs.applyWorkspaceTokens; exports.basename = _chunkBDATZ3UBcjs.basename; exports.correctPaths = _chunkBDATZ3UBcjs.correctPaths; exports.dirname = _chunkBDATZ3UBcjs.dirname; exports.exitWithError = _chunkYBVOKYAMcjs.exitWithError; exports.exitWithSuccess = _chunkYBVOKYAMcjs.exitWithSuccess; exports.extname = _chunkBDATZ3UBcjs.extname; exports.findFileName = _chunk2WBD2G3Ecjs.findFileName; exports.findFilePath = _chunk2WBD2G3Ecjs.findFilePath; exports.findWorkspaceRoot = _chunkIWQRXQ4Ncjs.findWorkspaceRoot; exports.findWorkspaceRootSafe = _chunkIWQRXQ4Ncjs.findWorkspaceRootSafe; exports.format = _chunkBDATZ3UBcjs.format; exports.getColor = _chunkFMDVBSP6cjs.getColor; exports.getColors = _chunkFMDVBSP6cjs.getColors; exports.getGradient = _chunkFMDVBSP6cjs.getGradient; exports.getPackageJsonConfig = _chunkT7YISGRScjs.getPackageJsonConfig; exports.handleProcess = _chunkYBVOKYAMcjs.handleProcess; exports.isAbsolute = _chunkBDATZ3UBcjs.isAbsolute; exports.joinPaths = _chunkBDATZ3UBcjs.joinPaths; exports.modifyCargoNestedTable = _chunkMBG2FTBLcjs.modifyCargoNestedTable; exports.modifyCargoTable = _chunkMBG2FTBLcjs.modifyCargoTable; exports.normalizeString = _chunkBDATZ3UBcjs.normalizeString; exports.normalizeWindowsPath = _chunkBDATZ3UBcjs.normalizeWindowsPath; exports.parse = _chunkBDATZ3UBcjs.parse; exports.parseCargoToml = _chunkMBG2FTBLcjs.parseCargoToml; exports.parseCargoTomlWithTree = _chunkMBG2FTBLcjs.parseCargoTomlWithTree; exports.relative = _chunkBDATZ3UBcjs.relative; exports.removeExtension = _chunk2WBD2G3Ecjs.removeExtension; exports.resolve = _chunkBDATZ3UBcjs.resolve; exports.run = _chunk6Y623TCScjs.run; exports.runAsync = _chunk6Y623TCScjs.runAsync; exports.sep = _chunkBDATZ3UBcjs.sep; exports.stringifyCargoToml = _chunkMBG2FTBLcjs.stringifyCargoToml; exports.toNamespacedPath = _chunkBDATZ3UBcjs.toNamespacedPath;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _applyworkspacetokens = require('./apply-workspace-tokens'); _createStarExport(_applyworkspacetokens);
2
+ var _colors = require('./colors'); _createStarExport(_colors);
3
+ var _correctpaths = require('./correct-paths'); _createStarExport(_correctpaths);
4
+ var _filepathutils = require('./file-path-utils'); _createStarExport(_filepathutils);
5
+ var _findworkspaceroot = require('./find-workspace-root'); _createStarExport(_findworkspaceroot);
6
+ var _getdefaultconfig = require('./get-default-config'); _createStarExport(_getdefaultconfig);
7
+ var _processhandler = require('./process-handler'); _createStarExport(_processhandler);
8
+ var _run = require('./run'); _createStarExport(_run);
9
+ var _toml = require('./toml'); _createStarExport(_toml);
@@ -1,109 +1,9 @@
1
- import "../chunk-UKGRDKIH.js";
2
- import {
3
- exitWithError,
4
- exitWithSuccess,
5
- handleProcess
6
- } from "../chunk-SIW7AXUG.js";
7
- import {
8
- LARGE_BUFFER,
9
- run,
10
- runAsync
11
- } from "../chunk-EENQN6N2.js";
12
- import {
13
- modifyCargoNestedTable,
14
- modifyCargoTable,
15
- parseCargoToml,
16
- parseCargoTomlWithTree,
17
- stringifyCargoToml
18
- } from "../chunk-YX4736HU.js";
19
- import {
20
- applyWorkspaceBaseTokens,
21
- applyWorkspaceProjectTokens,
22
- applyWorkspaceTokens
23
- } from "../chunk-HFS7WJVW.js";
24
- import {
25
- findFileName,
26
- findFilePath,
27
- removeExtension
28
- } from "../chunk-KSMN3HSC.js";
29
- import {
30
- applyDefaultConfig,
31
- getPackageJsonConfig
32
- } from "../chunk-MQG74XF7.js";
33
- import {
34
- findWorkspaceRoot,
35
- findWorkspaceRootSafe
36
- } from "../chunk-SO3FWVXC.js";
37
- import "../chunk-RUKM6FCF.js";
38
- import "../chunk-RRKB32OH.js";
39
- import "../chunk-JK4TT5IV.js";
40
- import "../chunk-D3FRXXDE.js";
41
- import {
42
- DEFAULT_COLOR_CONFIG,
43
- getColor,
44
- getColors,
45
- getGradient
46
- } from "../chunk-5J2SS4QU.js";
47
- import "../chunk-HVVJHTFS.js";
48
- import "../chunk-ZFNAUMQS.js";
49
- import "../chunk-G2MK47WL.js";
50
- import "../chunk-JZAYHDV3.js";
51
- import {
52
- basename,
53
- correctPaths,
54
- dirname,
55
- extname,
56
- format,
57
- isAbsolute,
58
- joinPaths,
59
- normalizeString,
60
- normalizeWindowsPath,
61
- parse,
62
- relative,
63
- resolve,
64
- sep,
65
- toNamespacedPath
66
- } from "../chunk-V3GMJ4TX.js";
67
- import "../chunk-SXPH7ILL.js";
68
- import "../chunk-RALMUN5C.js";
69
- export {
70
- DEFAULT_COLOR_CONFIG,
71
- LARGE_BUFFER,
72
- applyDefaultConfig,
73
- applyWorkspaceBaseTokens,
74
- applyWorkspaceProjectTokens,
75
- applyWorkspaceTokens,
76
- basename,
77
- correctPaths,
78
- dirname,
79
- exitWithError,
80
- exitWithSuccess,
81
- extname,
82
- findFileName,
83
- findFilePath,
84
- findWorkspaceRoot,
85
- findWorkspaceRootSafe,
86
- format,
87
- getColor,
88
- getColors,
89
- getGradient,
90
- getPackageJsonConfig,
91
- handleProcess,
92
- isAbsolute,
93
- joinPaths,
94
- modifyCargoNestedTable,
95
- modifyCargoTable,
96
- normalizeString,
97
- normalizeWindowsPath,
98
- parse,
99
- parseCargoToml,
100
- parseCargoTomlWithTree,
101
- relative,
102
- removeExtension,
103
- resolve,
104
- run,
105
- runAsync,
106
- sep,
107
- stringifyCargoToml,
108
- toNamespacedPath
109
- };
1
+ export * from "./apply-workspace-tokens";
2
+ export * from "./colors";
3
+ export * from "./correct-paths";
4
+ export * from "./file-path-utils";
5
+ export * from "./find-workspace-root";
6
+ export * from "./get-default-config";
7
+ export * from "./process-handler";
8
+ export * from "./run";
9
+ export * from "./toml";
@@ -1,18 +1,53 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }
2
2
 
3
3
 
4
4
 
5
- var _chunkYBVOKYAMcjs = require('../chunk-YBVOKYAM.cjs');
6
- require('../chunk-TZZRLM5J.cjs');
7
- require('../chunk-FMDVBSP6.cjs');
8
- require('../chunk-LOY6ICHZ.cjs');
9
- require('../chunk-EC2KPWRG.cjs');
10
- require('../chunk-DTGT4OI3.cjs');
11
- require('../chunk-WQJYIPSL.cjs');
12
- require('../chunk-JWLDCEBZ.cjs');
13
- require('../chunk-7QBTVNMR.cjs');
14
5
 
6
+ var _console = require('../logger/console');
7
+ const exitWithError = (config) => {
8
+ _console.writeFatal.call(void 0, "Exiting script with an error status...", config);
9
+ process.exit(1);
10
+ };
11
+ const exitWithSuccess = (config) => {
12
+ _console.writeSuccess.call(void 0, "Script completed successfully. Exiting...", config);
13
+ process.exit(0);
14
+ };
15
+ const handleProcess = (config) => {
16
+ _console.writeTrace.call(void 0,
17
+ `Using the following arguments to process the script: ${process.argv.join(", ")}`,
18
+ config
19
+ );
20
+ process.on("unhandledRejection", (error) => {
21
+ _console.writeError.call(void 0,
22
+ `An Unhandled Rejection occurred while running the program: ${error && typeof error === "object" && "message" in error && _optionalChain([error, 'optionalAccess', _ => _.message]) ? error.message : typeof error === "string" ? error : "Unknown error"}
23
+ Stacktrace: ${error && typeof error === "object" && "stack" in error && _optionalChain([error, 'optionalAccess', _2 => _2.stack]) ? error.stack : ""}`,
24
+ config
25
+ );
26
+ exitWithError(config);
27
+ });
28
+ process.on("uncaughtException", (error) => {
29
+ _console.writeError.call(void 0,
30
+ `An Uncaught Exception occurred while running the program: ${error && typeof error === "object" && "message" in error && _optionalChain([error, 'optionalAccess', _3 => _3.message]) ? error.message : typeof error === "string" ? error : "Unknown error"}
31
+ Stacktrace: ${error && typeof error === "object" && "stack" in error && _optionalChain([error, 'optionalAccess', _4 => _4.stack]) ? error.stack : ""}`,
32
+ config
33
+ );
34
+ exitWithError(config);
35
+ });
36
+ process.on("SIGTERM", (signal) => {
37
+ _console.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
38
+ exitWithError(config);
39
+ });
40
+ process.on("SIGINT", (signal) => {
41
+ _console.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
42
+ exitWithError(config);
43
+ });
44
+ process.on("SIGHUP", (signal) => {
45
+ _console.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
46
+ exitWithError(config);
47
+ });
48
+ };
15
49
 
16
50
 
17
51
 
18
- exports.exitWithError = _chunkYBVOKYAMcjs.exitWithError; exports.exitWithSuccess = _chunkYBVOKYAMcjs.exitWithSuccess; exports.handleProcess = _chunkYBVOKYAMcjs.handleProcess;
52
+
53
+ exports.exitWithError = exitWithError; exports.exitWithSuccess = exitWithSuccess; exports.handleProcess = handleProcess;