@storm-software/config-tools 1.148.3 → 1.149.0

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-23WUCNWX.js +0 -142
  56. package/dist/chunk-2AVLCXLT.js +0 -0
  57. package/dist/chunk-2IKEUEGY.cjs +0 -94
  58. package/dist/chunk-3NWKPYIG.cjs +0 -68
  59. package/dist/chunk-4DLP6LZY.cjs +0 -65
  60. package/dist/chunk-65SWKEHV.cjs +0 -1
  61. package/dist/chunk-6OM23J4N.js +0 -65
  62. package/dist/chunk-6T3V5XJK.js +0 -180
  63. package/dist/chunk-7JBLPO7O.cjs +0 -168
  64. package/dist/chunk-7NSHGJWY.cjs +0 -12
  65. package/dist/chunk-7PV6L7I7.cjs +0 -1
  66. package/dist/chunk-BHZFTVXN.js +0 -42
  67. package/dist/chunk-C4RHWKK6.cjs +0 -142
  68. package/dist/chunk-CCO2PASC.js +0 -168
  69. package/dist/chunk-DD3HX2NX.cjs +0 -1
  70. package/dist/chunk-DD5UX56L.cjs +0 -272
  71. package/dist/chunk-FDJZUZKJ.js +0 -93
  72. package/dist/chunk-GS25DBTT.cjs +0 -93
  73. package/dist/chunk-GZFXEQPB.js +0 -94
  74. package/dist/chunk-HESFC24Z.cjs +0 -245
  75. package/dist/chunk-HI33NNPB.js +0 -68
  76. package/dist/chunk-HKZSDZZ4.cjs +0 -19
  77. package/dist/chunk-HSCCBYAV.js +0 -25
  78. package/dist/chunk-IRCFHYKZ.cjs +0 -28
  79. package/dist/chunk-IUT7Y2UY.js +0 -26
  80. package/dist/chunk-IWD6YQKX.cjs +0 -1
  81. package/dist/chunk-KNLWLA7O.cjs +0 -75
  82. package/dist/chunk-L6UNTUC4.js +0 -0
  83. package/dist/chunk-MLUBD3PU.js +0 -245
  84. package/dist/chunk-NJVL3GF4.js +0 -0
  85. package/dist/chunk-OIEEXHKO.js +0 -75
  86. package/dist/chunk-P7Q327IR.js +0 -272
  87. package/dist/chunk-POXTJ6GF.js +0 -28
  88. package/dist/chunk-PR7RQHRE.js +0 -12
  89. package/dist/chunk-Q7MMWMEN.js +0 -44
  90. package/dist/chunk-QBS3OCHH.js +0 -22
  91. package/dist/chunk-RRKB32OH.js +0 -0
  92. package/dist/chunk-RVM5N5ZI.cjs +0 -22
  93. package/dist/chunk-SLGVSUEV.cjs +0 -36
  94. package/dist/chunk-SVQE7WVB.cjs +0 -180
  95. package/dist/chunk-SWX2MJHI.cjs +0 -28
  96. package/dist/chunk-TZO4SYUO.cjs +0 -49
  97. package/dist/chunk-UZ5SHCFX.js +0 -49
  98. package/dist/chunk-WMWOH7LS.js +0 -79
  99. package/dist/chunk-XAJB3BSF.cjs +0 -25
  100. package/dist/chunk-XDBACKKN.cjs +0 -42
  101. package/dist/chunk-XIVRONKM.cjs +0 -44
  102. package/dist/chunk-XQPQRRG3.js +0 -28
  103. package/dist/chunk-XVIPFWZW.cjs +0 -79
  104. package/dist/chunk-XY2LDOQ4.cjs +0 -26
  105. package/dist/chunk-ZA4IO7YJ.js +0 -36
  106. package/dist/chunk-ZU6V7IRV.js +0 -19
@@ -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 _chunkTZO4SYUOcjs = require('../chunk-TZO4SYUO.cjs');
7
-
8
-
9
-
10
-
11
- var _chunkXDBACKKNcjs = require('../chunk-XDBACKKN.cjs');
12
-
13
-
14
-
15
-
16
- var _chunk4DLP6LZYcjs = require('../chunk-4DLP6LZY.cjs');
17
-
18
-
19
-
20
- var _chunkXAJB3BSFcjs = require('../chunk-XAJB3BSF.cjs');
21
- require('../chunk-C4RHWKK6.cjs');
22
-
23
-
24
-
25
- var _chunk2IKEUEGYcjs = require('../chunk-2IKEUEGY.cjs');
26
-
27
-
28
-
29
- var _chunkKNLWLA7Ocjs = require('../chunk-KNLWLA7O.cjs');
30
- require('../chunk-SWX2MJHI.cjs');
31
- require('../chunk-SLGVSUEV.cjs');
32
- require('../chunk-XY2LDOQ4.cjs');
33
- require('../chunk-RVM5N5ZI.cjs');
34
- require('../chunk-7NSHGJWY.cjs');
35
- require('../chunk-SVQE7WVB.cjs');
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
- var _chunkHESFC24Zcjs = require('../chunk-HESFC24Z.cjs');
52
- require('../chunk-3NWKPYIG.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 = _chunkTZO4SYUOcjs.exitWithError; exports.exitWithSuccess = _chunkTZO4SYUOcjs.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 = _chunkTZO4SYUOcjs.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-UZ5SHCFX.js";
7
- import {
8
- LARGE_BUFFER,
9
- run,
10
- runAsync
11
- } from "../chunk-BHZFTVXN.js";
12
- import {
13
- applyWorkspaceBaseTokens,
14
- applyWorkspaceProjectTokens,
15
- applyWorkspaceTokens
16
- } from "../chunk-6OM23J4N.js";
17
- import {
18
- findFileName,
19
- removeExtension
20
- } from "../chunk-HSCCBYAV.js";
21
- import "../chunk-23WUCNWX.js";
22
- import {
23
- DEFAULT_COLOR_CONFIG,
24
- getDefaultConfig
25
- } from "../chunk-GZFXEQPB.js";
26
- import {
27
- findWorkspaceRoot,
28
- findWorkspaceRootSafe
29
- } from "../chunk-OIEEXHKO.js";
30
- import "../chunk-XQPQRRG3.js";
31
- import "../chunk-ZA4IO7YJ.js";
32
- import "../chunk-IUT7Y2UY.js";
33
- import "../chunk-QBS3OCHH.js";
34
- import "../chunk-PR7RQHRE.js";
35
- import "../chunk-6T3V5XJK.js";
36
- import {
37
- basename,
38
- correctPaths,
39
- dirname,
40
- extname,
41
- format,
42
- isAbsolute,
43
- joinPaths,
44
- normalizeString,
45
- normalizeWindowsPath,
46
- parse,
47
- relative,
48
- resolve,
49
- sep,
50
- toNamespacedPath
51
- } from "../chunk-MLUBD3PU.js";
52
- import "../chunk-HI33NNPB.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 _chunkTZO4SYUOcjs = require('../chunk-TZO4SYUO.cjs');
6
- require('../chunk-C4RHWKK6.cjs');
7
- require('../chunk-2IKEUEGY.cjs');
8
- require('../chunk-KNLWLA7O.cjs');
9
- require('../chunk-SWX2MJHI.cjs');
10
- require('../chunk-SLGVSUEV.cjs');
11
- require('../chunk-XY2LDOQ4.cjs');
12
- require('../chunk-RVM5N5ZI.cjs');
13
- require('../chunk-7NSHGJWY.cjs');
14
- require('../chunk-SVQE7WVB.cjs');
15
- require('../chunk-HESFC24Z.cjs');
16
- require('../chunk-3NWKPYIG.cjs');
17
- require('../chunk-IRCFHYKZ.cjs');
18
- require('../chunk-USNT2KNT.cjs');
19
39
 
20
40
 
21
-
22
-
23
- exports.exitWithError = _chunkTZO4SYUOcjs.exitWithError; exports.exitWithSuccess = _chunkTZO4SYUOcjs.exitWithSuccess; exports.handleProcess = _chunkTZO4SYUOcjs.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-UZ5SHCFX.js";
6
- import "../chunk-23WUCNWX.js";
7
- import "../chunk-GZFXEQPB.js";
8
- import "../chunk-OIEEXHKO.js";
9
- import "../chunk-XQPQRRG3.js";
10
- import "../chunk-ZA4IO7YJ.js";
11
- import "../chunk-IUT7Y2UY.js";
12
- import "../chunk-QBS3OCHH.js";
13
- import "../chunk-PR7RQHRE.js";
14
- import "../chunk-6T3V5XJK.js";
15
- import "../chunk-MLUBD3PU.js";
16
- import "../chunk-HI33NNPB.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;