@storm-software/config-tools 1.148.2 → 1.148.4

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 (106) hide show
  1. package/README.md +1 -1
  2. package/dist/config-file/get-config-file.cjs +66 -22
  3. package/dist/config-file/get-config-file.js +65 -21
  4. package/dist/config-file/index.cjs +1 -27
  5. package/dist/config-file/index.js +1 -27
  6. package/dist/create-storm-config.cjs +68 -26
  7. package/dist/create-storm-config.js +67 -25
  8. package/dist/env/get-env.cjs +152 -9
  9. package/dist/env/get-env.js +151 -8
  10. package/dist/env/index.cjs +2 -20
  11. package/dist/env/index.js +2 -20
  12. package/dist/env/set-env.cjs +259 -8
  13. package/dist/env/set-env.js +258 -7
  14. package/dist/get-config.cjs +9 -25
  15. package/dist/get-config.js +9 -25
  16. package/dist/index.cjs +7 -171
  17. package/dist/index.js +7 -171
  18. package/dist/logger/chalk.cjs +30 -4
  19. package/dist/logger/chalk.js +29 -3
  20. package/dist/logger/console-icons.cjs +15 -5
  21. package/dist/logger/console-icons.js +15 -5
  22. package/dist/logger/console.cjs +126 -38
  23. package/dist/logger/console.js +112 -24
  24. package/dist/logger/create-logger.cjs +31 -16
  25. package/dist/logger/create-logger.js +30 -15
  26. package/dist/logger/format-timestamp.cjs +5 -3
  27. package/dist/logger/format-timestamp.js +5 -3
  28. package/dist/logger/get-log-level.cjs +56 -6
  29. package/dist/logger/get-log-level.js +56 -6
  30. package/dist/logger/index.cjs +7 -62
  31. package/dist/logger/index.js +7 -62
  32. package/dist/logger/is-unicode-supported.cjs +16 -4
  33. package/dist/logger/is-unicode-supported.js +15 -3
  34. package/dist/types.cjs +24 -6
  35. package/dist/types.js +22 -4
  36. package/dist/utilities/apply-workspace-tokens.cjs +55 -9
  37. package/dist/utilities/apply-workspace-tokens.js +54 -8
  38. package/dist/utilities/correct-paths.cjs +242 -33
  39. package/dist/utilities/correct-paths.js +225 -16
  40. package/dist/utilities/file-path-utils.cjs +18 -5
  41. package/dist/utilities/file-path-utils.js +17 -4
  42. package/dist/utilities/find-up.cjs +22 -4
  43. package/dist/utilities/find-up.js +21 -3
  44. package/dist/utilities/find-workspace-root.cjs +64 -7
  45. package/dist/utilities/find-workspace-root.js +63 -6
  46. package/dist/utilities/get-default-config.cjs +79 -8
  47. package/dist/utilities/get-default-config.js +79 -8
  48. package/dist/utilities/index.cjs +7 -85
  49. package/dist/utilities/index.js +7 -85
  50. package/dist/utilities/process-handler.cjs +35 -17
  51. package/dist/utilities/process-handler.js +35 -17
  52. package/dist/utilities/run.cjs +34 -6
  53. package/dist/utilities/run.js +33 -5
  54. package/package.json +1 -1
  55. package/dist/chunk-2AVLCXLT.js +0 -0
  56. package/dist/chunk-2IKEUEGY.cjs +0 -94
  57. package/dist/chunk-2ZXJS2DW.js +0 -49
  58. package/dist/chunk-3557WSPY.js +0 -168
  59. package/dist/chunk-3NWKPYIG.cjs +0 -68
  60. package/dist/chunk-4DLP6LZY.cjs +0 -65
  61. package/dist/chunk-65SWKEHV.cjs +0 -1
  62. package/dist/chunk-6OM23J4N.js +0 -65
  63. package/dist/chunk-6T3V5XJK.js +0 -180
  64. package/dist/chunk-7CYF3NP3.cjs +0 -19
  65. package/dist/chunk-7NSHGJWY.cjs +0 -12
  66. package/dist/chunk-7PV6L7I7.cjs +0 -1
  67. package/dist/chunk-B7WWBK5Z.cjs +0 -93
  68. package/dist/chunk-BHZFTVXN.js +0 -42
  69. package/dist/chunk-C3W5DCMU.js +0 -19
  70. package/dist/chunk-DD3HX2NX.cjs +0 -1
  71. package/dist/chunk-GKI43HTL.cjs +0 -44
  72. package/dist/chunk-GZFXEQPB.js +0 -94
  73. package/dist/chunk-HESFC24Z.cjs +0 -245
  74. package/dist/chunk-HI33NNPB.js +0 -68
  75. package/dist/chunk-HSCCBYAV.js +0 -25
  76. package/dist/chunk-IRCFHYKZ.cjs +0 -28
  77. package/dist/chunk-IUT7Y2UY.js +0 -26
  78. package/dist/chunk-IWD6YQKX.cjs +0 -1
  79. package/dist/chunk-J2TOMCZU.cjs +0 -168
  80. package/dist/chunk-JHJGK3T7.js +0 -272
  81. package/dist/chunk-KNLWLA7O.cjs +0 -75
  82. package/dist/chunk-L6UNTUC4.js +0 -0
  83. package/dist/chunk-LOSUA6RB.js +0 -79
  84. package/dist/chunk-M7ASNATT.js +0 -142
  85. package/dist/chunk-MLUBD3PU.js +0 -245
  86. package/dist/chunk-NJVL3GF4.js +0 -0
  87. package/dist/chunk-OIEEXHKO.js +0 -75
  88. package/dist/chunk-POXTJ6GF.js +0 -28
  89. package/dist/chunk-PR7RQHRE.js +0 -12
  90. package/dist/chunk-QBS3OCHH.js +0 -22
  91. package/dist/chunk-QNYJXMP3.cjs +0 -79
  92. package/dist/chunk-RRKB32OH.js +0 -0
  93. package/dist/chunk-RVM5N5ZI.cjs +0 -22
  94. package/dist/chunk-SLGVSUEV.cjs +0 -36
  95. package/dist/chunk-SVQE7WVB.cjs +0 -180
  96. package/dist/chunk-SWX2MJHI.cjs +0 -28
  97. package/dist/chunk-TCTVN2ED.js +0 -44
  98. package/dist/chunk-U34AT42J.cjs +0 -49
  99. package/dist/chunk-ULZULP7Q.cjs +0 -142
  100. package/dist/chunk-XAJB3BSF.cjs +0 -25
  101. package/dist/chunk-XDBACKKN.cjs +0 -42
  102. package/dist/chunk-XQPQRRG3.js +0 -28
  103. package/dist/chunk-XY2LDOQ4.cjs +0 -26
  104. package/dist/chunk-XZ2SIQVM.js +0 -93
  105. package/dist/chunk-YBGTC6FM.cjs +0 -272
  106. package/dist/chunk-ZA4IO7YJ.js +0 -36
@@ -1,11 +1,68 @@
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(); } }
2
2
 
3
+ var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
4
+ var _correctpaths = require('./correct-paths');
5
+ var _findup = require('./find-up');
6
+ const rootFiles = [
7
+ "storm-workspace.json",
8
+ "storm-workspace.json",
9
+ "storm-workspace.yaml",
10
+ "storm-workspace.yml",
11
+ "storm-workspace.js",
12
+ "storm-workspace.ts",
13
+ ".storm-workspace.json",
14
+ ".storm-workspace.yaml",
15
+ ".storm-workspace.yml",
16
+ ".storm-workspace.js",
17
+ ".storm-workspace.ts",
18
+ "lerna.json",
19
+ "nx.json",
20
+ "turbo.json",
21
+ "npm-workspace.json",
22
+ "yarn-workspace.json",
23
+ "pnpm-workspace.json",
24
+ "npm-workspace.yaml",
25
+ "yarn-workspace.yaml",
26
+ "pnpm-workspace.yaml",
27
+ "npm-workspace.yml",
28
+ "yarn-workspace.yml",
29
+ "pnpm-workspace.yml",
30
+ "npm-lock.json",
31
+ "yarn-lock.json",
32
+ "pnpm-lock.json",
33
+ "npm-lock.yaml",
34
+ "yarn-lock.yaml",
35
+ "pnpm-lock.yaml",
36
+ "npm-lock.yml",
37
+ "yarn-lock.yml",
38
+ "pnpm-lock.yml",
39
+ "bun.lockb"
40
+ ];
41
+ const rootDirectories = [
42
+ ".storm-workspace",
43
+ ".nx",
44
+ ".github",
45
+ ".vscode",
46
+ ".verdaccio"
47
+ ];
48
+ function findWorkspaceRootSafe(pathInsideMonorepo) {
49
+ if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
50
+ return _correctpaths.correctPaths.call(void 0, _nullishCoalesce(process.env.STORM_WORKSPACE_ROOT, () => ( process.env.NX_WORKSPACE_ROOT_PATH)));
51
+ }
52
+ return _correctpaths.correctPaths.call(void 0, _findup.findFolderUp.call(void 0, _nullishCoalesce(pathInsideMonorepo, () => ( process.cwd())), rootFiles, rootDirectories));
53
+ }
54
+ _chunkUSNT2KNTcjs.__name.call(void 0, findWorkspaceRootSafe, "findWorkspaceRootSafe");
55
+ function findWorkspaceRoot(pathInsideMonorepo) {
56
+ const result = findWorkspaceRootSafe(pathInsideMonorepo);
57
+ if (!result) {
58
+ throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
59
+ ${rootFiles.join("\n")}
60
+ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`);
61
+ }
62
+ return result;
63
+ }
64
+ _chunkUSNT2KNTcjs.__name.call(void 0, findWorkspaceRoot, "findWorkspaceRoot");
3
65
 
4
- var _chunkKNLWLA7Ocjs = require('../chunk-KNLWLA7O.cjs');
5
- require('../chunk-SWX2MJHI.cjs');
6
- require('../chunk-HESFC24Z.cjs');
7
- require('../chunk-USNT2KNT.cjs');
8
66
 
9
67
 
10
-
11
- exports.findWorkspaceRoot = _chunkKNLWLA7Ocjs.findWorkspaceRoot; exports.findWorkspaceRootSafe = _chunkKNLWLA7Ocjs.findWorkspaceRootSafe;
68
+ exports.findWorkspaceRoot = findWorkspaceRoot; exports.findWorkspaceRootSafe = findWorkspaceRootSafe;
@@ -1,10 +1,67 @@
1
1
  import {
2
- findWorkspaceRoot,
3
- findWorkspaceRootSafe
4
- } from "../chunk-OIEEXHKO.js";
5
- import "../chunk-XQPQRRG3.js";
6
- import "../chunk-MLUBD3PU.js";
7
- import "../chunk-SHUYVCID.js";
2
+ __name
3
+ } from "../chunk-SHUYVCID.js";
4
+ import { correctPaths } from "./correct-paths";
5
+ import { findFolderUp } from "./find-up";
6
+ const rootFiles = [
7
+ "storm-workspace.json",
8
+ "storm-workspace.json",
9
+ "storm-workspace.yaml",
10
+ "storm-workspace.yml",
11
+ "storm-workspace.js",
12
+ "storm-workspace.ts",
13
+ ".storm-workspace.json",
14
+ ".storm-workspace.yaml",
15
+ ".storm-workspace.yml",
16
+ ".storm-workspace.js",
17
+ ".storm-workspace.ts",
18
+ "lerna.json",
19
+ "nx.json",
20
+ "turbo.json",
21
+ "npm-workspace.json",
22
+ "yarn-workspace.json",
23
+ "pnpm-workspace.json",
24
+ "npm-workspace.yaml",
25
+ "yarn-workspace.yaml",
26
+ "pnpm-workspace.yaml",
27
+ "npm-workspace.yml",
28
+ "yarn-workspace.yml",
29
+ "pnpm-workspace.yml",
30
+ "npm-lock.json",
31
+ "yarn-lock.json",
32
+ "pnpm-lock.json",
33
+ "npm-lock.yaml",
34
+ "yarn-lock.yaml",
35
+ "pnpm-lock.yaml",
36
+ "npm-lock.yml",
37
+ "yarn-lock.yml",
38
+ "pnpm-lock.yml",
39
+ "bun.lockb"
40
+ ];
41
+ const rootDirectories = [
42
+ ".storm-workspace",
43
+ ".nx",
44
+ ".github",
45
+ ".vscode",
46
+ ".verdaccio"
47
+ ];
48
+ function findWorkspaceRootSafe(pathInsideMonorepo) {
49
+ if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
50
+ return correctPaths(process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH);
51
+ }
52
+ return correctPaths(findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles, rootDirectories));
53
+ }
54
+ __name(findWorkspaceRootSafe, "findWorkspaceRootSafe");
55
+ function findWorkspaceRoot(pathInsideMonorepo) {
56
+ const result = findWorkspaceRootSafe(pathInsideMonorepo);
57
+ if (!result) {
58
+ throw new Error(`Cannot find workspace root upwards from known path. Files search list includes:
59
+ ${rootFiles.join("\n")}
60
+ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`);
61
+ }
62
+ return result;
63
+ }
64
+ __name(findWorkspaceRoot, "findWorkspaceRoot");
8
65
  export {
9
66
  findWorkspaceRoot,
10
67
  findWorkspaceRootSafe
@@ -1,13 +1,84 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.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
+ const DEFAULT_COLOR_CONFIG = {
11
+ "light": {
12
+ "background": "#fafafa",
13
+ "foreground": "#1d1e22",
14
+ "brand": "#1fb2a6",
15
+ "alternate": "#db2777",
16
+ "help": "#5C4EE5",
17
+ "success": "#087f5b",
18
+ "info": "#0550ae",
19
+ "warning": "#e3b341",
20
+ "danger": "#D8314A",
21
+ "positive": "#22c55e",
22
+ "negative": "#dc2626"
23
+ },
24
+ "dark": {
25
+ "background": "#1d1e22",
26
+ "foreground": "#cbd5e1",
27
+ "brand": "#2dd4bf",
28
+ "alternate": "#db2777",
29
+ "help": "#818cf8",
30
+ "success": "#10b981",
31
+ "info": "#58a6ff",
32
+ "warning": "#f3d371",
33
+ "danger": "#D8314A",
34
+ "positive": "#22c55e",
35
+ "negative": "#dc2626"
36
+ }
37
+ };
38
+ const getDefaultConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (root) => {
39
+ let license = _config.STORM_DEFAULT_LICENSE;
40
+ let homepage = _config.STORM_DEFAULT_HOMEPAGE;
41
+ let name = void 0;
42
+ let namespace = void 0;
43
+ let repository = void 0;
44
+ const workspaceRoot = _findworkspaceroot.findWorkspaceRoot.call(void 0, root);
45
+ if (_nodefs.existsSync.call(void 0, _nodepath.join.call(void 0, workspaceRoot, "package.json"))) {
46
+ const file = await _promises.readFile.call(void 0, _correctpaths.joinPaths.call(void 0, workspaceRoot, "package.json"), "utf8");
47
+ if (file) {
48
+ const packageJson = JSON.parse(file);
49
+ if (packageJson.name) {
50
+ name = packageJson.name;
51
+ }
52
+ if (packageJson.namespace) {
53
+ namespace = packageJson.namespace;
54
+ }
55
+ if (packageJson.repository) {
56
+ if (typeof packageJson.repository === "string") {
57
+ repository = packageJson.repository;
58
+ } else if (packageJson.repository.url) {
59
+ repository = packageJson.repository.url;
60
+ }
61
+ }
62
+ if (packageJson.license) {
63
+ license = packageJson.license;
64
+ }
65
+ if (packageJson.homepage) {
66
+ homepage = packageJson.homepage;
67
+ }
68
+ }
69
+ }
70
+ return {
71
+ workspaceRoot,
72
+ name,
73
+ namespace,
74
+ repository,
75
+ license,
76
+ homepage,
77
+ docs: `${homepage || _config.STORM_DEFAULT_HOMEPAGE}/docs`,
78
+ licensing: `${homepage || _config.STORM_DEFAULT_HOMEPAGE}/license`
79
+ };
80
+ }, "getDefaultConfig");
3
81
 
4
- var _chunk2IKEUEGYcjs = require('../chunk-2IKEUEGY.cjs');
5
- require('../chunk-KNLWLA7O.cjs');
6
- require('../chunk-SWX2MJHI.cjs');
7
- require('../chunk-SVQE7WVB.cjs');
8
- require('../chunk-HESFC24Z.cjs');
9
- require('../chunk-USNT2KNT.cjs');
10
82
 
11
83
 
12
-
13
- exports.DEFAULT_COLOR_CONFIG = _chunk2IKEUEGYcjs.DEFAULT_COLOR_CONFIG; exports.getDefaultConfig = _chunk2IKEUEGYcjs.getDefaultConfig;
84
+ exports.DEFAULT_COLOR_CONFIG = DEFAULT_COLOR_CONFIG; exports.getDefaultConfig = getDefaultConfig;
@@ -1,12 +1,83 @@
1
1
  import {
2
- DEFAULT_COLOR_CONFIG,
3
- getDefaultConfig
4
- } from "../chunk-GZFXEQPB.js";
5
- import "../chunk-OIEEXHKO.js";
6
- import "../chunk-XQPQRRG3.js";
7
- import "../chunk-6T3V5XJK.js";
8
- import "../chunk-MLUBD3PU.js";
9
- import "../chunk-SHUYVCID.js";
2
+ __name
3
+ } from "../chunk-SHUYVCID.js";
4
+ import { STORM_DEFAULT_HOMEPAGE, STORM_DEFAULT_LICENSE } 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
+ const DEFAULT_COLOR_CONFIG = {
11
+ "light": {
12
+ "background": "#fafafa",
13
+ "foreground": "#1d1e22",
14
+ "brand": "#1fb2a6",
15
+ "alternate": "#db2777",
16
+ "help": "#5C4EE5",
17
+ "success": "#087f5b",
18
+ "info": "#0550ae",
19
+ "warning": "#e3b341",
20
+ "danger": "#D8314A",
21
+ "positive": "#22c55e",
22
+ "negative": "#dc2626"
23
+ },
24
+ "dark": {
25
+ "background": "#1d1e22",
26
+ "foreground": "#cbd5e1",
27
+ "brand": "#2dd4bf",
28
+ "alternate": "#db2777",
29
+ "help": "#818cf8",
30
+ "success": "#10b981",
31
+ "info": "#58a6ff",
32
+ "warning": "#f3d371",
33
+ "danger": "#D8314A",
34
+ "positive": "#22c55e",
35
+ "negative": "#dc2626"
36
+ }
37
+ };
38
+ const getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
39
+ let license = STORM_DEFAULT_LICENSE;
40
+ let homepage = STORM_DEFAULT_HOMEPAGE;
41
+ let name = void 0;
42
+ let namespace = void 0;
43
+ let repository = void 0;
44
+ const workspaceRoot = findWorkspaceRoot(root);
45
+ if (existsSync(join(workspaceRoot, "package.json"))) {
46
+ const file = await readFile(joinPaths(workspaceRoot, "package.json"), "utf8");
47
+ if (file) {
48
+ const packageJson = JSON.parse(file);
49
+ if (packageJson.name) {
50
+ name = packageJson.name;
51
+ }
52
+ if (packageJson.namespace) {
53
+ namespace = packageJson.namespace;
54
+ }
55
+ if (packageJson.repository) {
56
+ if (typeof packageJson.repository === "string") {
57
+ repository = packageJson.repository;
58
+ } else if (packageJson.repository.url) {
59
+ repository = packageJson.repository.url;
60
+ }
61
+ }
62
+ if (packageJson.license) {
63
+ license = packageJson.license;
64
+ }
65
+ if (packageJson.homepage) {
66
+ homepage = packageJson.homepage;
67
+ }
68
+ }
69
+ }
70
+ return {
71
+ workspaceRoot,
72
+ name,
73
+ namespace,
74
+ repository,
75
+ license,
76
+ homepage,
77
+ docs: `${homepage || STORM_DEFAULT_HOMEPAGE}/docs`,
78
+ licensing: `${homepage || STORM_DEFAULT_HOMEPAGE}/license`
79
+ };
80
+ }, "getDefaultConfig");
10
81
  export {
11
82
  DEFAULT_COLOR_CONFIG,
12
83
  getDefaultConfig
@@ -1,85 +1,7 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-DD3HX2NX.cjs');
2
-
3
-
4
-
5
-
6
- var _chunkU34AT42Jcjs = require('../chunk-U34AT42J.cjs');
7
-
8
-
9
-
10
-
11
- var _chunkXDBACKKNcjs = require('../chunk-XDBACKKN.cjs');
12
- require('../chunk-ULZULP7Q.cjs');
13
- require('../chunk-SLGVSUEV.cjs');
14
- require('../chunk-XY2LDOQ4.cjs');
15
- require('../chunk-RVM5N5ZI.cjs');
16
- require('../chunk-7NSHGJWY.cjs');
17
-
18
-
19
-
20
-
21
- var _chunk4DLP6LZYcjs = require('../chunk-4DLP6LZY.cjs');
22
-
23
-
24
-
25
- var _chunkXAJB3BSFcjs = require('../chunk-XAJB3BSF.cjs');
26
-
27
-
28
-
29
- var _chunk2IKEUEGYcjs = require('../chunk-2IKEUEGY.cjs');
30
-
31
-
32
-
33
- var _chunkKNLWLA7Ocjs = require('../chunk-KNLWLA7O.cjs');
34
- require('../chunk-SWX2MJHI.cjs');
35
- require('../chunk-3NWKPYIG.cjs');
36
- require('../chunk-SVQE7WVB.cjs');
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
- var _chunkHESFC24Zcjs = require('../chunk-HESFC24Z.cjs');
53
- require('../chunk-IRCFHYKZ.cjs');
54
- require('../chunk-USNT2KNT.cjs');
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
- exports.DEFAULT_COLOR_CONFIG = _chunk2IKEUEGYcjs.DEFAULT_COLOR_CONFIG; exports.LARGE_BUFFER = _chunkXDBACKKNcjs.LARGE_BUFFER; exports.applyWorkspaceBaseTokens = _chunk4DLP6LZYcjs.applyWorkspaceBaseTokens; exports.applyWorkspaceProjectTokens = _chunk4DLP6LZYcjs.applyWorkspaceProjectTokens; exports.applyWorkspaceTokens = _chunk4DLP6LZYcjs.applyWorkspaceTokens; exports.basename = _chunkHESFC24Zcjs.basename; exports.correctPaths = _chunkHESFC24Zcjs.correctPaths; exports.dirname = _chunkHESFC24Zcjs.dirname; exports.exitWithError = _chunkU34AT42Jcjs.exitWithError; exports.exitWithSuccess = _chunkU34AT42Jcjs.exitWithSuccess; exports.extname = _chunkHESFC24Zcjs.extname; exports.findFileName = _chunkXAJB3BSFcjs.findFileName; exports.findWorkspaceRoot = _chunkKNLWLA7Ocjs.findWorkspaceRoot; exports.findWorkspaceRootSafe = _chunkKNLWLA7Ocjs.findWorkspaceRootSafe; exports.format = _chunkHESFC24Zcjs.format; exports.getDefaultConfig = _chunk2IKEUEGYcjs.getDefaultConfig; exports.handleProcess = _chunkU34AT42Jcjs.handleProcess; exports.isAbsolute = _chunkHESFC24Zcjs.isAbsolute; exports.joinPaths = _chunkHESFC24Zcjs.joinPaths; exports.normalizeString = _chunkHESFC24Zcjs.normalizeString; exports.normalizeWindowsPath = _chunkHESFC24Zcjs.normalizeWindowsPath; exports.parse = _chunkHESFC24Zcjs.parse; exports.relative = _chunkHESFC24Zcjs.relative; exports.removeExtension = _chunkXAJB3BSFcjs.removeExtension; exports.resolve = _chunkHESFC24Zcjs.resolve; exports.run = _chunkXDBACKKNcjs.run; exports.runAsync = _chunkXDBACKKNcjs.runAsync; exports.sep = _chunkHESFC24Zcjs.sep; exports.toNamespacedPath = _chunkHESFC24Zcjs.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 _correctpaths = require('./correct-paths'); _createStarExport(_correctpaths);
3
+ var _filepathutils = require('./file-path-utils'); _createStarExport(_filepathutils);
4
+ var _findworkspaceroot = require('./find-workspace-root'); _createStarExport(_findworkspaceroot);
5
+ var _getdefaultconfig = require('./get-default-config'); _createStarExport(_getdefaultconfig);
6
+ var _processhandler = require('./process-handler'); _createStarExport(_processhandler);
7
+ var _run = require('./run'); _createStarExport(_run);
@@ -1,85 +1,7 @@
1
- import "../chunk-NJVL3GF4.js";
2
- import {
3
- exitWithError,
4
- exitWithSuccess,
5
- handleProcess
6
- } from "../chunk-2ZXJS2DW.js";
7
- import {
8
- LARGE_BUFFER,
9
- run,
10
- runAsync
11
- } from "../chunk-BHZFTVXN.js";
12
- import "../chunk-M7ASNATT.js";
13
- import "../chunk-ZA4IO7YJ.js";
14
- import "../chunk-IUT7Y2UY.js";
15
- import "../chunk-QBS3OCHH.js";
16
- import "../chunk-PR7RQHRE.js";
17
- import {
18
- applyWorkspaceBaseTokens,
19
- applyWorkspaceProjectTokens,
20
- applyWorkspaceTokens
21
- } from "../chunk-6OM23J4N.js";
22
- import {
23
- findFileName,
24
- removeExtension
25
- } from "../chunk-HSCCBYAV.js";
26
- import {
27
- DEFAULT_COLOR_CONFIG,
28
- getDefaultConfig
29
- } from "../chunk-GZFXEQPB.js";
30
- import {
31
- findWorkspaceRoot,
32
- findWorkspaceRootSafe
33
- } from "../chunk-OIEEXHKO.js";
34
- import "../chunk-XQPQRRG3.js";
35
- import "../chunk-HI33NNPB.js";
36
- import "../chunk-6T3V5XJK.js";
37
- import {
38
- basename,
39
- correctPaths,
40
- dirname,
41
- extname,
42
- format,
43
- isAbsolute,
44
- joinPaths,
45
- normalizeString,
46
- normalizeWindowsPath,
47
- parse,
48
- relative,
49
- resolve,
50
- sep,
51
- toNamespacedPath
52
- } from "../chunk-MLUBD3PU.js";
53
- import "../chunk-POXTJ6GF.js";
54
- import "../chunk-SHUYVCID.js";
55
- export {
56
- DEFAULT_COLOR_CONFIG,
57
- LARGE_BUFFER,
58
- applyWorkspaceBaseTokens,
59
- applyWorkspaceProjectTokens,
60
- applyWorkspaceTokens,
61
- basename,
62
- correctPaths,
63
- dirname,
64
- exitWithError,
65
- exitWithSuccess,
66
- extname,
67
- findFileName,
68
- findWorkspaceRoot,
69
- findWorkspaceRootSafe,
70
- format,
71
- getDefaultConfig,
72
- handleProcess,
73
- isAbsolute,
74
- joinPaths,
75
- normalizeString,
76
- normalizeWindowsPath,
77
- parse,
78
- relative,
79
- removeExtension,
80
- resolve,
81
- run,
82
- runAsync,
83
- sep,
84
- toNamespacedPath
85
- };
1
+ export * from "./apply-workspace-tokens";
2
+ export * from "./correct-paths";
3
+ export * from "./file-path-utils";
4
+ export * from "./find-workspace-root";
5
+ export * from "./get-default-config";
6
+ export * from "./process-handler";
7
+ export * from "./run";
@@ -1,23 +1,41 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
4
+ var _console = require('../logger/console');
5
+ const exitWithError = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config) => {
6
+ _console.writeFatal.call(void 0, "Exiting script with an error status...", config);
7
+ process.exit(1);
8
+ }, "exitWithError");
9
+ const exitWithSuccess = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config) => {
10
+ _console.writeSuccess.call(void 0, "Script completed successfully. Exiting...", config);
11
+ process.exit(0);
12
+ }, "exitWithSuccess");
13
+ const handleProcess = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config) => {
14
+ _console.writeTrace.call(void 0, `Using the following arguments to process the script: ${process.argv.join(", ")}`, config);
15
+ process.on("unhandledRejection", (error) => {
16
+ _console.writeError.call(void 0, `An Unhandled Rejection occurred while running the program: ${error}`, config);
17
+ exitWithError(config);
18
+ });
19
+ process.on("uncaughtException", (error) => {
20
+ _console.writeError.call(void 0, `An Uncaught Exception occurred while running the program: ${error.message}
21
+ Stacktrace: ${error.stack}`, config);
22
+ exitWithError(config);
23
+ });
24
+ process.on("SIGTERM", (signal) => {
25
+ _console.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
26
+ exitWithError(config);
27
+ });
28
+ process.on("SIGINT", (signal) => {
29
+ _console.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
30
+ exitWithError(config);
31
+ });
32
+ process.on("SIGHUP", (signal) => {
33
+ _console.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
34
+ exitWithError(config);
35
+ });
36
+ }, "handleProcess");
3
37
 
4
38
 
5
- var _chunkU34AT42Jcjs = require('../chunk-U34AT42J.cjs');
6
- require('../chunk-ULZULP7Q.cjs');
7
- require('../chunk-SLGVSUEV.cjs');
8
- require('../chunk-XY2LDOQ4.cjs');
9
- require('../chunk-RVM5N5ZI.cjs');
10
- require('../chunk-7NSHGJWY.cjs');
11
- require('../chunk-2IKEUEGY.cjs');
12
- require('../chunk-KNLWLA7O.cjs');
13
- require('../chunk-SWX2MJHI.cjs');
14
- require('../chunk-3NWKPYIG.cjs');
15
- require('../chunk-SVQE7WVB.cjs');
16
- require('../chunk-HESFC24Z.cjs');
17
- require('../chunk-IRCFHYKZ.cjs');
18
- require('../chunk-USNT2KNT.cjs');
19
39
 
20
40
 
21
-
22
-
23
- exports.exitWithError = _chunkU34AT42Jcjs.exitWithError; exports.exitWithSuccess = _chunkU34AT42Jcjs.exitWithSuccess; exports.handleProcess = _chunkU34AT42Jcjs.handleProcess;
41
+ exports.exitWithError = exitWithError; exports.exitWithSuccess = exitWithSuccess; exports.handleProcess = handleProcess;
@@ -1,21 +1,39 @@
1
1
  import {
2
- exitWithError,
3
- exitWithSuccess,
4
- handleProcess
5
- } from "../chunk-2ZXJS2DW.js";
6
- import "../chunk-M7ASNATT.js";
7
- import "../chunk-ZA4IO7YJ.js";
8
- import "../chunk-IUT7Y2UY.js";
9
- import "../chunk-QBS3OCHH.js";
10
- import "../chunk-PR7RQHRE.js";
11
- import "../chunk-GZFXEQPB.js";
12
- import "../chunk-OIEEXHKO.js";
13
- import "../chunk-XQPQRRG3.js";
14
- import "../chunk-HI33NNPB.js";
15
- import "../chunk-6T3V5XJK.js";
16
- import "../chunk-MLUBD3PU.js";
17
- import "../chunk-POXTJ6GF.js";
18
- import "../chunk-SHUYVCID.js";
2
+ __name
3
+ } from "../chunk-SHUYVCID.js";
4
+ import { writeError, writeFatal, writeSuccess, writeTrace } from "../logger/console";
5
+ const exitWithError = /* @__PURE__ */ __name((config) => {
6
+ writeFatal("Exiting script with an error status...", config);
7
+ process.exit(1);
8
+ }, "exitWithError");
9
+ const exitWithSuccess = /* @__PURE__ */ __name((config) => {
10
+ writeSuccess("Script completed successfully. Exiting...", config);
11
+ process.exit(0);
12
+ }, "exitWithSuccess");
13
+ const handleProcess = /* @__PURE__ */ __name((config) => {
14
+ writeTrace(`Using the following arguments to process the script: ${process.argv.join(", ")}`, config);
15
+ process.on("unhandledRejection", (error) => {
16
+ writeError(`An Unhandled Rejection occurred while running the program: ${error}`, config);
17
+ exitWithError(config);
18
+ });
19
+ process.on("uncaughtException", (error) => {
20
+ writeError(`An Uncaught Exception occurred while running the program: ${error.message}
21
+ Stacktrace: ${error.stack}`, config);
22
+ exitWithError(config);
23
+ });
24
+ process.on("SIGTERM", (signal) => {
25
+ writeError(`The program terminated with signal code: ${signal}`, config);
26
+ exitWithError(config);
27
+ });
28
+ process.on("SIGINT", (signal) => {
29
+ writeError(`The program terminated with signal code: ${signal}`, config);
30
+ exitWithError(config);
31
+ });
32
+ process.on("SIGHUP", (signal) => {
33
+ writeError(`The program terminated with signal code: ${signal}`, config);
34
+ exitWithError(config);
35
+ });
36
+ }, "handleProcess");
19
37
  export {
20
38
  exitWithError,
21
39
  exitWithSuccess,
@@ -1,11 +1,39 @@
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(); } }
2
2
 
3
+ var _chunkUSNT2KNTcjs = require('../chunk-USNT2KNT.cjs');
4
+ var _nodechild_process = require('node:child_process');
5
+ const LARGE_BUFFER = 1024 * 1e6;
6
+ const run = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config, command, cwd = _nullishCoalesce(config.workspaceRoot, () => ( process.cwd())), stdio = "inherit", env = process.env) => {
7
+ return _nodechild_process.execSync.call(void 0, command, {
8
+ cwd,
9
+ env: {
10
+ ...process.env,
11
+ ...env,
12
+ CLICOLOR: "true",
13
+ FORCE_COLOR: "true"
14
+ },
15
+ windowsHide: true,
16
+ stdio,
17
+ maxBuffer: LARGE_BUFFER,
18
+ killSignal: "SIGTERM"
19
+ });
20
+ }, "run");
21
+ const runAsync = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config, command, cwd = _nullishCoalesce(config.workspaceRoot, () => ( process.cwd())), env = process.env) => {
22
+ return _nodechild_process.exec.call(void 0, command, {
23
+ cwd,
24
+ env: {
25
+ ...process.env,
26
+ ...env,
27
+ CLICOLOR: "true",
28
+ FORCE_COLOR: "true"
29
+ },
30
+ windowsHide: true,
31
+ maxBuffer: LARGE_BUFFER,
32
+ killSignal: "SIGTERM"
33
+ });
34
+ }, "runAsync");
3
35
 
4
36
 
5
- var _chunkXDBACKKNcjs = require('../chunk-XDBACKKN.cjs');
6
- require('../chunk-USNT2KNT.cjs');
7
37
 
8
38
 
9
-
10
-
11
- exports.LARGE_BUFFER = _chunkXDBACKKNcjs.LARGE_BUFFER; exports.run = _chunkXDBACKKNcjs.run; exports.runAsync = _chunkXDBACKKNcjs.runAsync;
39
+ exports.LARGE_BUFFER = LARGE_BUFFER; exports.run = run; exports.runAsync = runAsync;