@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,233 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
-
3
- var _chunkBDATZ3UBcjs = require('./chunk-BDATZ3UB.cjs');
4
-
5
-
6
- var _chunkJWLDCEBZcjs = require('./chunk-JWLDCEBZ.cjs');
7
-
8
- // src/env/get-env.ts
9
-
10
-
11
-
12
-
13
-
14
- var _config = require('@storm-software/config');
15
- var getExtensionEnv = (extensionName) => {
16
- const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
17
- return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
18
- const name = key.replace(prefix, "").split("_").map(
19
- (i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : ""
20
- ).join("");
21
- if (name) {
22
- ret[name] = process.env[key];
23
- }
24
- return ret;
25
- }, {});
26
- };
27
- var getConfigEnv = () => {
28
- const prefix = "STORM_";
29
- let config = {
30
- extends: process.env[`${prefix}EXTENDS`] || void 0,
31
- name: process.env[`${prefix}NAME`] || void 0,
32
- variant: process.env[`${prefix}VARIANT`] || void 0,
33
- namespace: process.env[`${prefix}NAMESPACE`] || void 0,
34
- owner: process.env[`${prefix}OWNER`] || void 0,
35
- bot: {
36
- name: process.env[`${prefix}BOT_NAME`] || void 0,
37
- email: process.env[`${prefix}BOT_EMAIL`] || void 0
38
- },
39
- release: {
40
- banner: {
41
- url: process.env[`${prefix}RELEASE_BANNER_URL`] || void 0,
42
- alt: process.env[`${prefix}RELEASE_BANNER_ALT`] || void 0
43
- },
44
- header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
45
- footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
46
- },
47
- error: {
48
- codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
49
- url: process.env[`${prefix}ERROR_URL`] || void 0
50
- },
51
- socials: {
52
- twitter: process.env[`${prefix}SOCIAL_TWITTER`] || void 0,
53
- discord: process.env[`${prefix}SOCIAL_DISCORD`] || void 0,
54
- telegram: process.env[`${prefix}SOCIAL_TELEGRAM`] || void 0,
55
- slack: process.env[`${prefix}SOCIAL_SLACK`] || void 0,
56
- medium: process.env[`${prefix}SOCIAL_MEDIUM`] || void 0,
57
- github: process.env[`${prefix}SOCIAL_GITHUB`] || void 0
58
- },
59
- organization: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] ? process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] ? {
60
- name: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`],
61
- description: process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || void 0,
62
- url: process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || void 0,
63
- logo: process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] || void 0,
64
- icon: process.env[`${prefix}ORG_ICON`] || process.env[`${prefix}ORGANIZATION_ICON`] || void 0
65
- } : process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] : void 0,
66
- packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
67
- license: process.env[`${prefix}LICENSE`] || void 0,
68
- homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
69
- docs: process.env[`${prefix}DOCS`] || void 0,
70
- portal: process.env[`${prefix}PORTAL`] || void 0,
71
- licensing: process.env[`${prefix}LICENSING`] || void 0,
72
- contact: process.env[`${prefix}CONTACT`] || void 0,
73
- support: process.env[`${prefix}SUPPORT`] || void 0,
74
- timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
75
- locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
76
- configFile: process.env[`${prefix}WORKSPACE_CONFIG_FILE`] ? _chunkBDATZ3UBcjs.correctPaths.call(void 0, process.env[`${prefix}WORKSPACE_CONFIG_FILE`]) : void 0,
77
- workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? _chunkBDATZ3UBcjs.correctPaths.call(void 0, process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
78
- directories: {
79
- cache: process.env[`${prefix}CACHE_DIR`] ? _chunkBDATZ3UBcjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : process.env[`${prefix}CACHE_DIRECTORY`] ? _chunkBDATZ3UBcjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIRECTORY`]) : void 0,
80
- data: process.env[`${prefix}DATA_DIR`] ? _chunkBDATZ3UBcjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : process.env[`${prefix}DATA_DIRECTORY`] ? _chunkBDATZ3UBcjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIRECTORY`]) : void 0,
81
- config: process.env[`${prefix}CONFIG_DIR`] ? _chunkBDATZ3UBcjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : process.env[`${prefix}CONFIG_DIRECTORY`] ? _chunkBDATZ3UBcjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIRECTORY`]) : void 0,
82
- temp: process.env[`${prefix}TEMP_DIR`] ? _chunkBDATZ3UBcjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : process.env[`${prefix}TEMP_DIRECTORY`] ? _chunkBDATZ3UBcjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIRECTORY`]) : void 0,
83
- log: process.env[`${prefix}LOG_DIR`] ? _chunkBDATZ3UBcjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : process.env[`${prefix}LOG_DIRECTORY`] ? _chunkBDATZ3UBcjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIRECTORY`]) : void 0,
84
- build: process.env[`${prefix}BUILD_DIR`] ? _chunkBDATZ3UBcjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : process.env[`${prefix}BUILD_DIRECTORY`] ? _chunkBDATZ3UBcjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIRECTORY`]) : void 0
85
- },
86
- skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
87
- mode: (_nullishCoalesce(_nullishCoalesce(process.env[`${prefix}MODE`], () => ( process.env.NODE_ENV)), () => ( process.env.ENVIRONMENT))) || void 0,
88
- // ci:
89
- // process.env[`${prefix}CI`] !== undefined
90
- // ? Boolean(
91
- // process.env[`${prefix}CI`] ??
92
- // process.env.CI ??
93
- // process.env.CONTINUOUS_INTEGRATION
94
- // )
95
- // : undefined,
96
- repository: process.env[`${prefix}REPOSITORY`] || void 0,
97
- branch: process.env[`${prefix}BRANCH`] || void 0,
98
- preid: process.env[`${prefix}PRE_ID`] || void 0,
99
- registry: {
100
- github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
101
- npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
102
- cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
103
- cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
104
- container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
105
- },
106
- logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
107
- Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
108
- ) ? _chunkJWLDCEBZcjs.getLogLevelLabel.call(void 0,
109
- Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
110
- ) : process.env[`${prefix}LOG_LEVEL`] : void 0,
111
- skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
112
- };
113
- const themeNames = Object.keys(process.env).filter(
114
- (envKey) => envKey.startsWith(`${prefix}COLOR_`) && _config.COLOR_KEYS.every(
115
- (colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
116
- )
117
- );
118
- config.colors = themeNames.length > 0 ? themeNames.reduce(
119
- (ret, themeName) => {
120
- ret[themeName] = getThemeColorsEnv(prefix, themeName);
121
- return ret;
122
- },
123
- {}
124
- ) : getThemeColorsEnv(prefix);
125
- if (config.docs === _config.STORM_DEFAULT_DOCS) {
126
- if (config.homepage === _config.STORM_DEFAULT_HOMEPAGE) {
127
- config.docs = `${_config.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
128
- } else {
129
- config.docs = `${config.homepage}/docs`;
130
- }
131
- }
132
- if (config.licensing === _config.STORM_DEFAULT_LICENSING) {
133
- if (config.homepage === _config.STORM_DEFAULT_HOMEPAGE) {
134
- config.licensing = `${_config.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
135
- } else {
136
- config.licensing = `${config.homepage}/docs`;
137
- }
138
- }
139
- const serializedConfig = process.env[`${prefix}WORKSPACE_CONFIG`];
140
- if (serializedConfig) {
141
- const parsed = JSON.parse(serializedConfig);
142
- config = {
143
- ...config,
144
- ...parsed,
145
- colors: { ...config.colors, ...parsed.colors },
146
- extensions: { ...config.extensions, ...parsed.extensions }
147
- };
148
- }
149
- return config;
150
- };
151
- var getThemeColorsEnv = (prefix, theme) => {
152
- const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
153
- return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorsEnv(prefix + themeName) : getSingleThemeColorsEnv(prefix + themeName);
154
- };
155
- var getSingleThemeColorsEnv = (prefix) => {
156
- const gradient = [];
157
- if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
158
- gradient.push(
159
- process.env[`${prefix}GRADIENT_START`],
160
- process.env[`${prefix}GRADIENT_END`]
161
- );
162
- } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
163
- let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
164
- while (process.env[`${prefix}GRADIENT_${index}`]) {
165
- gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
166
- index++;
167
- }
168
- }
169
- return {
170
- dark: process.env[`${prefix}DARK`],
171
- light: process.env[`${prefix}LIGHT`],
172
- brand: process.env[`${prefix}BRAND`],
173
- alternate: process.env[`${prefix}ALTERNATE`],
174
- accent: process.env[`${prefix}ACCENT`],
175
- link: process.env[`${prefix}LINK`],
176
- discovery: process.env[`${prefix}DISCOVERY`],
177
- success: process.env[`${prefix}SUCCESS`],
178
- info: process.env[`${prefix}INFO`],
179
- debug: process.env[`${prefix}DEBUG`],
180
- warning: process.env[`${prefix}WARNING`],
181
- danger: process.env[`${prefix}DANGER`],
182
- fatal: process.env[`${prefix}FATAL`],
183
- performance: process.env[`${prefix}PERFORMANCE`],
184
- positive: process.env[`${prefix}POSITIVE`],
185
- negative: process.env[`${prefix}NEGATIVE`],
186
- gradient
187
- };
188
- };
189
- var getMultiThemeColorsEnv = (prefix) => {
190
- return {
191
- light: getBaseThemeColorsEnv(`${prefix}_LIGHT_`),
192
- dark: getBaseThemeColorsEnv(`${prefix}_DARK_`)
193
- };
194
- };
195
- var getBaseThemeColorsEnv = (prefix) => {
196
- const gradient = [];
197
- if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
198
- gradient.push(
199
- process.env[`${prefix}GRADIENT_START`],
200
- process.env[`${prefix}GRADIENT_END`]
201
- );
202
- } else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
203
- let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
204
- while (process.env[`${prefix}GRADIENT_${index}`]) {
205
- gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
206
- index++;
207
- }
208
- }
209
- return {
210
- foreground: process.env[`${prefix}FOREGROUND`],
211
- background: process.env[`${prefix}BACKGROUND`],
212
- brand: process.env[`${prefix}BRAND`],
213
- alternate: process.env[`${prefix}ALTERNATE`],
214
- accent: process.env[`${prefix}ACCENT`],
215
- link: process.env[`${prefix}LINK`],
216
- discovery: process.env[`${prefix}DISCOVERY`],
217
- success: process.env[`${prefix}SUCCESS`],
218
- info: process.env[`${prefix}INFO`],
219
- debug: process.env[`${prefix}DEBUG`],
220
- warning: process.env[`${prefix}WARNING`],
221
- danger: process.env[`${prefix}DANGER`],
222
- fatal: process.env[`${prefix}FATAL`],
223
- performance: process.env[`${prefix}PERFORMANCE`],
224
- positive: process.env[`${prefix}POSITIVE`],
225
- negative: process.env[`${prefix}NEGATIVE`],
226
- gradient
227
- };
228
- };
229
-
230
-
231
-
232
-
233
- exports.getExtensionEnv = getExtensionEnv; exports.getConfigEnv = getConfigEnv;
File without changes
@@ -1,233 +0,0 @@
1
- // src/utilities/correct-paths.ts
2
- var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
3
- function normalizeWindowsPath(input = "") {
4
- if (!input) {
5
- return input;
6
- }
7
- return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
8
- }
9
- var _UNC_REGEX = /^[/\\]{2}/;
10
- var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
11
- var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
12
- var _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
13
- var _EXTNAME_RE = /.(\.[^./]+|\.)$/;
14
- var _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
15
- var sep = "/";
16
- var correctPaths = function(path) {
17
- if (!path || path.length === 0) {
18
- return ".";
19
- }
20
- path = normalizeWindowsPath(path);
21
- const isUNCPath = path?.match(_UNC_REGEX);
22
- const isPathAbsolute = isAbsolute(path);
23
- const trailingSeparator = path[path.length - 1] === "/";
24
- path = normalizeString(path, !isPathAbsolute);
25
- if (path.length === 0) {
26
- if (isPathAbsolute) {
27
- return "/";
28
- }
29
- return trailingSeparator ? "./" : ".";
30
- }
31
- if (trailingSeparator) {
32
- path += "/";
33
- }
34
- if (_DRIVE_LETTER_RE.test(path)) {
35
- path += "/";
36
- }
37
- if (isUNCPath) {
38
- if (!isPathAbsolute) {
39
- return `//./${path}`;
40
- }
41
- return `//${path}`;
42
- }
43
- return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
44
- };
45
- var joinPaths = function(...segments) {
46
- let path = "";
47
- for (const seg of segments) {
48
- if (!seg) {
49
- continue;
50
- }
51
- if (path.length > 0) {
52
- const pathTrailing = path[path.length - 1] === "/";
53
- const segLeading = seg[0] === "/";
54
- const both = pathTrailing && segLeading;
55
- if (both) {
56
- path += seg.slice(1);
57
- } else {
58
- path += pathTrailing || segLeading ? seg : `/${seg}`;
59
- }
60
- } else {
61
- path += seg;
62
- }
63
- }
64
- return correctPaths(path);
65
- };
66
- function cwd() {
67
- if (typeof process !== "undefined" && typeof process.cwd === "function") {
68
- return process.cwd().replace(/\\/g, "/");
69
- }
70
- return "/";
71
- }
72
- var resolve = function(...arguments_) {
73
- arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
74
- let resolvedPath = "";
75
- let resolvedAbsolute = false;
76
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
77
- const path = index >= 0 ? arguments_[index] : cwd();
78
- if (!path || path.length === 0) {
79
- continue;
80
- }
81
- resolvedPath = `${path}/${resolvedPath}`;
82
- resolvedAbsolute = isAbsolute(path);
83
- }
84
- resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
85
- if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
86
- return `/${resolvedPath}`;
87
- }
88
- return resolvedPath.length > 0 ? resolvedPath : ".";
89
- };
90
- function normalizeString(path, allowAboveRoot) {
91
- let res = "";
92
- let lastSegmentLength = 0;
93
- let lastSlash = -1;
94
- let dots = 0;
95
- let char = null;
96
- for (let index = 0; index <= path.length; ++index) {
97
- if (index < path.length) {
98
- char = path[index];
99
- } else if (char === "/") {
100
- break;
101
- } else {
102
- char = "/";
103
- }
104
- if (char === "/") {
105
- if (lastSlash === index - 1 || dots === 1) {
106
- } else if (dots === 2) {
107
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
108
- if (res.length > 2) {
109
- const lastSlashIndex = res.lastIndexOf("/");
110
- if (lastSlashIndex === -1) {
111
- res = "";
112
- lastSegmentLength = 0;
113
- } else {
114
- res = res.slice(0, lastSlashIndex);
115
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
116
- }
117
- lastSlash = index;
118
- dots = 0;
119
- continue;
120
- } else if (res.length > 0) {
121
- res = "";
122
- lastSegmentLength = 0;
123
- lastSlash = index;
124
- dots = 0;
125
- continue;
126
- }
127
- }
128
- if (allowAboveRoot) {
129
- res += res.length > 0 ? "/.." : "..";
130
- lastSegmentLength = 2;
131
- }
132
- } else {
133
- if (res.length > 0) {
134
- res += `/${path.slice(lastSlash + 1, index)}`;
135
- } else {
136
- res = path.slice(lastSlash + 1, index);
137
- }
138
- lastSegmentLength = index - lastSlash - 1;
139
- }
140
- lastSlash = index;
141
- dots = 0;
142
- } else if (char === "." && dots !== -1) {
143
- ++dots;
144
- } else {
145
- dots = -1;
146
- }
147
- }
148
- return res;
149
- }
150
- var isAbsolute = function(p) {
151
- return _IS_ABSOLUTE_RE.test(p);
152
- };
153
- var toNamespacedPath = function(p) {
154
- return normalizeWindowsPath(p);
155
- };
156
- var extname = function(p) {
157
- if (p === "..") return "";
158
- const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
159
- return match && match[1] || "";
160
- };
161
- var relative = function(from, to) {
162
- const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
163
- const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
164
- if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
165
- return _to.join("/");
166
- }
167
- const _fromCopy = [..._from];
168
- for (const segment of _fromCopy) {
169
- if (_to[0] !== segment) {
170
- break;
171
- }
172
- _from.shift();
173
- _to.shift();
174
- }
175
- return [..._from.map(() => ".."), ..._to].join("/");
176
- };
177
- var dirname = function(p) {
178
- const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
179
- if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
180
- segments[0] += "/";
181
- }
182
- return segments.join("/") || (isAbsolute(p) ? "/" : ".");
183
- };
184
- var format = function(p) {
185
- const ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "";
186
- const segments = [p.root, p.dir, p.base ?? (p.name ?? "") + ext].filter(
187
- Boolean
188
- );
189
- return normalizeWindowsPath(
190
- p.root ? resolve(...segments) : segments.join("/")
191
- );
192
- };
193
- var basename = function(p, extension) {
194
- const segments = normalizeWindowsPath(p).split("/");
195
- let lastSegment = "";
196
- for (let i = segments.length - 1; i >= 0; i--) {
197
- const val = segments[i];
198
- if (val) {
199
- lastSegment = val;
200
- break;
201
- }
202
- }
203
- return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
204
- };
205
- var parse = function(p) {
206
- const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "";
207
- const base = basename(p);
208
- const extension = extname(base);
209
- return {
210
- root,
211
- dir: dirname(p),
212
- base,
213
- ext: extension,
214
- name: base.slice(0, base.length - extension.length)
215
- };
216
- };
217
-
218
- export {
219
- normalizeWindowsPath,
220
- sep,
221
- correctPaths,
222
- joinPaths,
223
- resolve,
224
- normalizeString,
225
- isAbsolute,
226
- toNamespacedPath,
227
- extname,
228
- relative,
229
- dirname,
230
- format,
231
- basename,
232
- parse
233
- };
@@ -1,8 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/logger/format-timestamp.ts
2
- var formatTimestamp = (fullDateTime = false, date = /* @__PURE__ */ new Date()) => {
3
- return fullDateTime ? `${date.toLocaleDateString()} ${date.toLocaleTimeString()}` : `${date.toLocaleTimeString()}`;
4
- };
5
-
6
-
7
-
8
- exports.formatTimestamp = formatTimestamp;
@@ -1,56 +0,0 @@
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
-
3
-
4
-
5
-
6
- var _chunkTZZRLM5Jcjs = require('./chunk-TZZRLM5J.cjs');
7
-
8
- // src/utilities/process-handler.ts
9
- var exitWithError = (config) => {
10
- _chunkTZZRLM5Jcjs.writeFatal.call(void 0, "Exiting script with an error status...", config);
11
- process.exit(1);
12
- };
13
- var exitWithSuccess = (config) => {
14
- _chunkTZZRLM5Jcjs.writeSuccess.call(void 0, "Script completed successfully. Exiting...", config);
15
- process.exit(0);
16
- };
17
- var handleProcess = (config) => {
18
- _chunkTZZRLM5Jcjs.writeTrace.call(void 0,
19
- `Using the following arguments to process the script: ${process.argv.join(", ")}`,
20
- config
21
- );
22
- process.on("unhandledRejection", (error) => {
23
- _chunkTZZRLM5Jcjs.writeError.call(void 0,
24
- `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"}
25
- Stacktrace: ${error && typeof error === "object" && "stack" in error && _optionalChain([error, 'optionalAccess', _2 => _2.stack]) ? error.stack : ""}`,
26
- config
27
- );
28
- exitWithError(config);
29
- });
30
- process.on("uncaughtException", (error) => {
31
- _chunkTZZRLM5Jcjs.writeError.call(void 0,
32
- `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"}
33
- Stacktrace: ${error && typeof error === "object" && "stack" in error && _optionalChain([error, 'optionalAccess', _4 => _4.stack]) ? error.stack : ""}`,
34
- config
35
- );
36
- exitWithError(config);
37
- });
38
- process.on("SIGTERM", (signal) => {
39
- _chunkTZZRLM5Jcjs.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
40
- exitWithError(config);
41
- });
42
- process.on("SIGINT", (signal) => {
43
- _chunkTZZRLM5Jcjs.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
44
- exitWithError(config);
45
- });
46
- process.on("SIGHUP", (signal) => {
47
- _chunkTZZRLM5Jcjs.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
48
- exitWithError(config);
49
- });
50
- };
51
-
52
-
53
-
54
-
55
-
56
- exports.exitWithError = exitWithError; exports.exitWithSuccess = exitWithSuccess; exports.handleProcess = handleProcess;
@@ -1,47 +0,0 @@
1
- import {
2
- writeError
3
- } from "./chunk-D3FRXXDE.js";
4
-
5
- // src/utilities/toml.ts
6
- import TOML from "@ltd/j-toml";
7
- function parseCargoTomlWithTree(tree, projectRoot, projectName) {
8
- const cargoTomlString = tree.read(`${projectRoot}/Cargo.toml`)?.toString();
9
- if (!cargoTomlString) {
10
- writeError(`Cannot find a Cargo.toml file in the ${projectName}`);
11
- throw new Error();
12
- }
13
- return parseCargoToml(cargoTomlString);
14
- }
15
- function parseCargoToml(cargoString) {
16
- if (!cargoString) {
17
- throw new Error("Cargo.toml is empty");
18
- }
19
- return TOML.parse(cargoString, {
20
- x: { comment: true }
21
- });
22
- }
23
- function stringifyCargoToml(cargoToml) {
24
- const tomlString = TOML.stringify(cargoToml, {
25
- newlineAround: "section"
26
- });
27
- if (Array.isArray(tomlString)) {
28
- return tomlString.join("\n");
29
- }
30
- return tomlString;
31
- }
32
- function modifyCargoTable(toml, section, key, value) {
33
- toml[section] ??= TOML.Section({});
34
- toml[section][key] = typeof value === "object" && !Array.isArray(value) ? TOML.inline(value) : typeof value === "function" ? value() : value;
35
- }
36
- function modifyCargoNestedTable(toml, section, key, value) {
37
- toml[section] ??= {};
38
- toml[section][key] = TOML.Section(value);
39
- }
40
-
41
- export {
42
- parseCargoTomlWithTree,
43
- parseCargoToml,
44
- stringifyCargoToml,
45
- modifyCargoTable,
46
- modifyCargoNestedTable
47
- };
@@ -1,24 +0,0 @@
1
- import {
2
- isUnicodeSupported
3
- } from "./chunk-G2MK47WL.js";
4
- import {
5
- LogLevelLabel
6
- } from "./chunk-RALMUN5C.js";
7
-
8
- // src/logger/console-icons.ts
9
- var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
10
- var CONSOLE_ICONS = {
11
- [LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
12
- [LogLevelLabel.FATAL]: useIcon("\u{1F571}", "\xD7"),
13
- [LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
14
- [LogLevelLabel.INFO]: useIcon("\u2139", "i"),
15
- [LogLevelLabel.PERFORMANCE]: useIcon("\u23F1", "\u23F1"),
16
- [LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
17
- [LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
18
- [LogLevelLabel.TRACE]: useIcon("\u2699", "T"),
19
- [LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
20
- };
21
-
22
- export {
23
- CONSOLE_ICONS
24
- };